@@ -9956,7 +9956,7 @@ int hfi1_get_ib_cfg(struct hfi1_pportdata *ppd, int which)
9956
9956
val = ppd -> phy_error_threshold ;
9957
9957
break ;
9958
9958
case HFI1_IB_CFG_LINKDEFAULT : /* IB link default (sleep/poll) */
9959
- val = dd -> link_default ;
9959
+ val = HLS_DEFAULT ;
9960
9960
break ;
9961
9961
9962
9962
case HFI1_IB_CFG_HRTBT : /* Heartbeat off/enable/auto */
@@ -10159,6 +10159,10 @@ static const char * const state_complete_reasons[] = {
10159
10159
[0x33 ] =
10160
10160
"Link partner completed the VerifyCap state, but the passing lanes do not meet the local link width policy" ,
10161
10161
[0x34 ] = tx_out_of_policy ,
10162
+ [0x35 ] = "Negotiated link width is mutually exclusive" ,
10163
+ [0x36 ] =
10164
+ "Timed out before receiving verifycap frames in VerifyCap.Exchange" ,
10165
+ [0x37 ] = "Unable to resolve secure data exchange" ,
10162
10166
};
10163
10167
10164
10168
static const char * state_complete_reason_code_string (struct hfi1_pportdata * ppd ,
@@ -10547,7 +10551,7 @@ int set_link_state(struct hfi1_pportdata *ppd, u32 state)
10547
10551
10548
10552
orig_new_state = state ;
10549
10553
if (state == HLS_DN_DOWNDEF )
10550
- state = dd -> link_default ;
10554
+ state = HLS_DEFAULT ;
10551
10555
10552
10556
/* interpret poll -> poll as a link bounce */
10553
10557
poll_bounce = ppd -> host_link_state == HLS_DN_POLL &&
@@ -12925,7 +12929,7 @@ static void clean_up_interrupts(struct hfi1_devdata *dd)
12925
12929
if (!me -> arg ) /* => no irq, no affinity */
12926
12930
continue ;
12927
12931
hfi1_put_irq_affinity (dd , me );
12928
- free_irq ( me -> irq , me -> arg );
12932
+ pci_free_irq ( dd -> pcidev , i , me -> arg );
12929
12933
}
12930
12934
12931
12935
/* clean structures */
@@ -12935,7 +12939,7 @@ static void clean_up_interrupts(struct hfi1_devdata *dd)
12935
12939
} else {
12936
12940
/* INTx */
12937
12941
if (dd -> requested_intx_irq ) {
12938
- free_irq (dd -> pcidev -> irq , dd );
12942
+ pci_free_irq (dd -> pcidev , 0 , dd );
12939
12943
dd -> requested_intx_irq = 0 ;
12940
12944
}
12941
12945
disable_intx (dd -> pcidev );
@@ -12994,10 +12998,8 @@ static int request_intx_irq(struct hfi1_devdata *dd)
12994
12998
{
12995
12999
int ret ;
12996
13000
12997
- snprintf (dd -> intx_name , sizeof (dd -> intx_name ), DRIVER_NAME "_%d" ,
12998
- dd -> unit );
12999
- ret = request_irq (dd -> pcidev -> irq , general_interrupt ,
13000
- IRQF_SHARED , dd -> intx_name , dd );
13001
+ ret = pci_request_irq (dd -> pcidev , 0 , general_interrupt , NULL , dd ,
13002
+ DRIVER_NAME "_%d" , dd -> unit );
13001
13003
if (ret )
13002
13004
dd_dev_err (dd , "unable to request INTx interrupt, err %d\n" ,
13003
13005
ret );
@@ -13040,13 +13042,14 @@ static int request_msix_irqs(struct hfi1_devdata *dd)
13040
13042
int idx ;
13041
13043
struct hfi1_ctxtdata * rcd = NULL ;
13042
13044
struct sdma_engine * sde = NULL ;
13045
+ char name [MAX_NAME_SIZE ];
13043
13046
13044
- /* obtain the arguments to request_irq */
13047
+ /* obtain the arguments to pci_request_irq */
13045
13048
if (first_general <= i && i < last_general ) {
13046
13049
idx = i - first_general ;
13047
13050
handler = general_interrupt ;
13048
13051
arg = dd ;
13049
- snprintf (me -> name , sizeof (me -> name ),
13052
+ snprintf (name , sizeof (name ),
13050
13053
DRIVER_NAME "_%d" , dd -> unit );
13051
13054
err_info = "general" ;
13052
13055
me -> type = IRQ_GENERAL ;
@@ -13055,14 +13058,14 @@ static int request_msix_irqs(struct hfi1_devdata *dd)
13055
13058
sde = & dd -> per_sdma [idx ];
13056
13059
handler = sdma_interrupt ;
13057
13060
arg = sde ;
13058
- snprintf (me -> name , sizeof (me -> name ),
13061
+ snprintf (name , sizeof (name ),
13059
13062
DRIVER_NAME "_%d sdma%d" , dd -> unit , idx );
13060
13063
err_info = "sdma" ;
13061
13064
remap_sdma_interrupts (dd , idx , i );
13062
13065
me -> type = IRQ_SDMA ;
13063
13066
} else if (first_rx <= i && i < last_rx ) {
13064
13067
idx = i - first_rx ;
13065
- rcd = hfi1_rcd_get_by_index (dd , idx );
13068
+ rcd = hfi1_rcd_get_by_index_safe (dd , idx );
13066
13069
if (rcd ) {
13067
13070
/*
13068
13071
* Set the interrupt register and mask for this
@@ -13074,7 +13077,7 @@ static int request_msix_irqs(struct hfi1_devdata *dd)
13074
13077
handler = receive_context_interrupt ;
13075
13078
thread = receive_context_thread ;
13076
13079
arg = rcd ;
13077
- snprintf (me -> name , sizeof (me -> name ),
13080
+ snprintf (name , sizeof (name ),
13078
13081
DRIVER_NAME "_%d kctxt%d" ,
13079
13082
dd -> unit , idx );
13080
13083
err_info = "receive context" ;
@@ -13095,26 +13098,18 @@ static int request_msix_irqs(struct hfi1_devdata *dd)
13095
13098
if (!arg )
13096
13099
continue ;
13097
13100
/* make sure the name is terminated */
13098
- me -> name [sizeof (me -> name ) - 1 ] = 0 ;
13101
+ name [sizeof (name ) - 1 ] = 0 ;
13099
13102
me -> irq = pci_irq_vector (dd -> pcidev , i );
13100
- /*
13101
- * On err return me->irq. Don't need to clear this
13102
- * because 'arg' has not been set, and cleanup will
13103
- * do the right thing.
13104
- */
13105
- if (me -> irq < 0 )
13106
- return me -> irq ;
13107
-
13108
- ret = request_threaded_irq (me -> irq , handler , thread , 0 ,
13109
- me -> name , arg );
13103
+ ret = pci_request_irq (dd -> pcidev , i , handler , thread , arg ,
13104
+ name );
13110
13105
if (ret ) {
13111
13106
dd_dev_err (dd ,
13112
13107
"unable to allocate %s interrupt, irq %d, index %d, err %d\n" ,
13113
13108
err_info , me -> irq , idx , ret );
13114
13109
return ret ;
13115
13110
}
13116
13111
/*
13117
- * assign arg after request_irq call, so it will be
13112
+ * assign arg after pci_request_irq call, so it will be
13118
13113
* cleaned up
13119
13114
*/
13120
13115
me -> arg = arg ;
@@ -13132,7 +13127,7 @@ void hfi1_vnic_synchronize_irq(struct hfi1_devdata *dd)
13132
13127
int i ;
13133
13128
13134
13129
if (!dd -> num_msix_entries ) {
13135
- synchronize_irq (dd -> pcidev -> irq );
13130
+ synchronize_irq (pci_irq_vector ( dd -> pcidev , 0 ) );
13136
13131
return ;
13137
13132
}
13138
13133
@@ -13153,7 +13148,7 @@ void hfi1_reset_vnic_msix_info(struct hfi1_ctxtdata *rcd)
13153
13148
return ;
13154
13149
13155
13150
hfi1_put_irq_affinity (dd , me );
13156
- free_irq ( me -> irq , me -> arg );
13151
+ pci_free_irq ( dd -> pcidev , rcd -> msix_intr , me -> arg );
13157
13152
13158
13153
me -> arg = NULL ;
13159
13154
}
@@ -13176,28 +13171,21 @@ void hfi1_set_vnic_msix_info(struct hfi1_ctxtdata *rcd)
13176
13171
rcd -> ireg = (IS_RCVAVAIL_START + idx ) / 64 ;
13177
13172
rcd -> imask = ((u64 )1 ) <<
13178
13173
((IS_RCVAVAIL_START + idx ) % 64 );
13179
-
13180
- snprintf (me -> name , sizeof (me -> name ),
13181
- DRIVER_NAME "_%d kctxt%d" , dd -> unit , idx );
13182
- me -> name [sizeof (me -> name ) - 1 ] = 0 ;
13183
13174
me -> type = IRQ_RCVCTXT ;
13184
13175
me -> irq = pci_irq_vector (dd -> pcidev , rcd -> msix_intr );
13185
- if (me -> irq < 0 ) {
13186
- dd_dev_err (dd , "vnic irq vector request (idx %d) fail %d\n" ,
13187
- idx , me -> irq );
13188
- return ;
13189
- }
13190
13176
remap_intr (dd , IS_RCVAVAIL_START + idx , rcd -> msix_intr );
13191
13177
13192
- ret = request_threaded_irq (me -> irq , receive_context_interrupt ,
13193
- receive_context_thread , 0 , me -> name , arg );
13178
+ ret = pci_request_irq (dd -> pcidev , rcd -> msix_intr ,
13179
+ receive_context_interrupt ,
13180
+ receive_context_thread , arg ,
13181
+ DRIVER_NAME "_%d kctxt%d" , dd -> unit , idx );
13194
13182
if (ret ) {
13195
13183
dd_dev_err (dd , "vnic irq request (irq %d, idx %d) fail %d\n" ,
13196
13184
me -> irq , idx , ret );
13197
13185
return ;
13198
13186
}
13199
13187
/*
13200
- * assign arg after request_irq call, so it will be
13188
+ * assign arg after pci_request_irq call, so it will be
13201
13189
* cleaned up
13202
13190
*/
13203
13191
me -> arg = arg ;
@@ -13206,7 +13194,7 @@ void hfi1_set_vnic_msix_info(struct hfi1_ctxtdata *rcd)
13206
13194
if (ret ) {
13207
13195
dd_dev_err (dd ,
13208
13196
"unable to pin IRQ %d\n" , ret );
13209
- free_irq ( me -> irq , me -> arg );
13197
+ pci_free_irq ( dd -> pcidev , rcd -> msix_intr , me -> arg );
13210
13198
}
13211
13199
}
13212
13200
@@ -14907,8 +14895,6 @@ struct hfi1_devdata *hfi1_init_dd(struct pci_dev *pdev,
14907
14895
init_vl_arb_caches (ppd );
14908
14896
}
14909
14897
14910
- dd -> link_default = HLS_DN_POLL ;
14911
-
14912
14898
/*
14913
14899
* Do remaining PCIe setup and save PCIe values in dd.
14914
14900
* Any error printing is already done by the init code.
0 commit comments