Index: hw/mthca/kernel/hca_smp.c
===================================================================
--- hw/mthca/kernel/hca_smp.c	(revision 322)
+++ hw/mthca/kernel/hca_smp.c	(working copy)
@@ -568,6 +567,32 @@
 			status = IB_ERROR;
 			goto err_process_mad;
 		}
+
+		if( (p_mad_in->mgmt_class == IB_MCLASS_SUBN_DIR ||
+			p_mad_in->mgmt_class == IB_MCLASS_SUBN_LID) &&
+			p_mad_in->attr_id == IB_MAD_ATTR_PORT_INFO )
+		{
+			ib_port_info_t	*p_pi_in, *p_pi_out;
+
+			if( p_mad_in->mgmt_class == IB_MCLASS_SUBN_DIR )
+			{
+				p_pi_in = (ib_port_info_t*)
+					ib_smp_get_payload_ptr( (ib_smp_t*)p_mad_in );
+				p_pi_out = (ib_port_info_t*)
+					ib_smp_get_payload_ptr( (ib_smp_t*)p_mad_out );
+			}
+			else
+			{
+				p_pi_in = (ib_port_info_t*)(p_mad_in + 1);
+				p_pi_out = (ib_port_info_t*)(p_mad_out + 1);
+			}
+
+			/* Work around FW bug 33958 */
+			p_pi_out->subnet_timeout &= 0x7F;
+			if( p_mad_in->method == IB_MAD_METHOD_SET )
+				p_pi_out->subnet_timeout |= (p_pi_in->subnet_timeout & 0x80);
+		}
+
 		mlnx_update_cache( h_ca, port_num, p_mad_out );
 	}
 
Index: hw/mt23108/kernel/hca_smp.c
===================================================================
--- hw/mt23108/kernel/hca_smp.c	(revision 322)
+++ hw/mt23108/kernel/hca_smp.c	(working copy)
@@ -541,6 +540,31 @@
 			goto cleanup;
 		}
 
+		if( (p_mad_in->mgmt_class == IB_MCLASS_SUBN_DIR ||
+			p_mad_in->mgmt_class == IB_MCLASS_SUBN_LID) &&
+			p_mad_in->attr_id == IB_MAD_ATTR_PORT_INFO )
+		{
+			ib_port_info_t	*p_pi_in, *p_pi_out;
+
+			if( p_mad_in->mgmt_class == IB_MCLASS_SUBN_DIR )
+			{
+				p_pi_in = (ib_port_info_t*)
+					ib_smp_get_payload_ptr( (ib_smp_t*)p_mad_in );
+				p_pi_out = (ib_port_info_t*)
+					ib_smp_get_payload_ptr( (ib_smp_t*)p_mad_out );
+			}
+			else
+			{
+				p_pi_in = (ib_port_info_t*)(p_mad_in + 1);
+				p_pi_out = (ib_port_info_t*)(p_mad_out + 1);
+			}
+
+			/* Work around FW bug 33958 */
+			p_pi_out->subnet_timeout &= 0x7F;
+			if( p_mad_in->method == IB_MAD_METHOD_SET )
+				p_pi_out->subnet_timeout |= (p_pi_in->subnet_timeout & 0x80);
+		}
+
 		mlnx_update_cache( h_ca, port_num, p_mad_out );
 	}
 
