Skip to content

Commit 8206ceb

Browse files
committed
Merge branch 'hfi1' into k.o/for-next
Signed-off-by: Doug Ledford <[email protected]>
2 parents 1848757 + ecf7998 commit 8206ceb

20 files changed

+577
-627
lines changed

drivers/infiniband/hw/hfi1/chip.c

Lines changed: 28 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -9956,7 +9956,7 @@ int hfi1_get_ib_cfg(struct hfi1_pportdata *ppd, int which)
99569956
val = ppd->phy_error_threshold;
99579957
break;
99589958
case HFI1_IB_CFG_LINKDEFAULT: /* IB link default (sleep/poll) */
9959-
val = dd->link_default;
9959+
val = HLS_DEFAULT;
99609960
break;
99619961

99629962
case HFI1_IB_CFG_HRTBT: /* Heartbeat off/enable/auto */
@@ -10159,6 +10159,10 @@ static const char * const state_complete_reasons[] = {
1015910159
[0x33] =
1016010160
"Link partner completed the VerifyCap state, but the passing lanes do not meet the local link width policy",
1016110161
[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",
1016210166
};
1016310167

1016410168
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)
1054710551

1054810552
orig_new_state = state;
1054910553
if (state == HLS_DN_DOWNDEF)
10550-
state = dd->link_default;
10554+
state = HLS_DEFAULT;
1055110555

1055210556
/* interpret poll -> poll as a link bounce */
1055310557
poll_bounce = ppd->host_link_state == HLS_DN_POLL &&
@@ -12925,7 +12929,7 @@ static void clean_up_interrupts(struct hfi1_devdata *dd)
1292512929
if (!me->arg) /* => no irq, no affinity */
1292612930
continue;
1292712931
hfi1_put_irq_affinity(dd, me);
12928-
free_irq(me->irq, me->arg);
12932+
pci_free_irq(dd->pcidev, i, me->arg);
1292912933
}
1293012934

1293112935
/* clean structures */
@@ -12935,7 +12939,7 @@ static void clean_up_interrupts(struct hfi1_devdata *dd)
1293512939
} else {
1293612940
/* INTx */
1293712941
if (dd->requested_intx_irq) {
12938-
free_irq(dd->pcidev->irq, dd);
12942+
pci_free_irq(dd->pcidev, 0, dd);
1293912943
dd->requested_intx_irq = 0;
1294012944
}
1294112945
disable_intx(dd->pcidev);
@@ -12994,10 +12998,8 @@ static int request_intx_irq(struct hfi1_devdata *dd)
1299412998
{
1299512999
int ret;
1299613000

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);
1300113003
if (ret)
1300213004
dd_dev_err(dd, "unable to request INTx interrupt, err %d\n",
1300313005
ret);
@@ -13040,13 +13042,14 @@ static int request_msix_irqs(struct hfi1_devdata *dd)
1304013042
int idx;
1304113043
struct hfi1_ctxtdata *rcd = NULL;
1304213044
struct sdma_engine *sde = NULL;
13045+
char name[MAX_NAME_SIZE];
1304313046

13044-
/* obtain the arguments to request_irq */
13047+
/* obtain the arguments to pci_request_irq */
1304513048
if (first_general <= i && i < last_general) {
1304613049
idx = i - first_general;
1304713050
handler = general_interrupt;
1304813051
arg = dd;
13049-
snprintf(me->name, sizeof(me->name),
13052+
snprintf(name, sizeof(name),
1305013053
DRIVER_NAME "_%d", dd->unit);
1305113054
err_info = "general";
1305213055
me->type = IRQ_GENERAL;
@@ -13055,14 +13058,14 @@ static int request_msix_irqs(struct hfi1_devdata *dd)
1305513058
sde = &dd->per_sdma[idx];
1305613059
handler = sdma_interrupt;
1305713060
arg = sde;
13058-
snprintf(me->name, sizeof(me->name),
13061+
snprintf(name, sizeof(name),
1305913062
DRIVER_NAME "_%d sdma%d", dd->unit, idx);
1306013063
err_info = "sdma";
1306113064
remap_sdma_interrupts(dd, idx, i);
1306213065
me->type = IRQ_SDMA;
1306313066
} else if (first_rx <= i && i < last_rx) {
1306413067
idx = i - first_rx;
13065-
rcd = hfi1_rcd_get_by_index(dd, idx);
13068+
rcd = hfi1_rcd_get_by_index_safe(dd, idx);
1306613069
if (rcd) {
1306713070
/*
1306813071
* Set the interrupt register and mask for this
@@ -13074,7 +13077,7 @@ static int request_msix_irqs(struct hfi1_devdata *dd)
1307413077
handler = receive_context_interrupt;
1307513078
thread = receive_context_thread;
1307613079
arg = rcd;
13077-
snprintf(me->name, sizeof(me->name),
13080+
snprintf(name, sizeof(name),
1307813081
DRIVER_NAME "_%d kctxt%d",
1307913082
dd->unit, idx);
1308013083
err_info = "receive context";
@@ -13095,26 +13098,18 @@ static int request_msix_irqs(struct hfi1_devdata *dd)
1309513098
if (!arg)
1309613099
continue;
1309713100
/* make sure the name is terminated */
13098-
me->name[sizeof(me->name) - 1] = 0;
13101+
name[sizeof(name) - 1] = 0;
1309913102
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);
1311013105
if (ret) {
1311113106
dd_dev_err(dd,
1311213107
"unable to allocate %s interrupt, irq %d, index %d, err %d\n",
1311313108
err_info, me->irq, idx, ret);
1311413109
return ret;
1311513110
}
1311613111
/*
13117-
* assign arg after request_irq call, so it will be
13112+
* assign arg after pci_request_irq call, so it will be
1311813113
* cleaned up
1311913114
*/
1312013115
me->arg = arg;
@@ -13132,7 +13127,7 @@ void hfi1_vnic_synchronize_irq(struct hfi1_devdata *dd)
1313213127
int i;
1313313128

1313413129
if (!dd->num_msix_entries) {
13135-
synchronize_irq(dd->pcidev->irq);
13130+
synchronize_irq(pci_irq_vector(dd->pcidev, 0));
1313613131
return;
1313713132
}
1313813133

@@ -13153,7 +13148,7 @@ void hfi1_reset_vnic_msix_info(struct hfi1_ctxtdata *rcd)
1315313148
return;
1315413149

1315513150
hfi1_put_irq_affinity(dd, me);
13156-
free_irq(me->irq, me->arg);
13151+
pci_free_irq(dd->pcidev, rcd->msix_intr, me->arg);
1315713152

1315813153
me->arg = NULL;
1315913154
}
@@ -13176,28 +13171,21 @@ void hfi1_set_vnic_msix_info(struct hfi1_ctxtdata *rcd)
1317613171
rcd->ireg = (IS_RCVAVAIL_START + idx) / 64;
1317713172
rcd->imask = ((u64)1) <<
1317813173
((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;
1318313174
me->type = IRQ_RCVCTXT;
1318413175
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-
}
1319013176
remap_intr(dd, IS_RCVAVAIL_START + idx, rcd->msix_intr);
1319113177

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);
1319413182
if (ret) {
1319513183
dd_dev_err(dd, "vnic irq request (irq %d, idx %d) fail %d\n",
1319613184
me->irq, idx, ret);
1319713185
return;
1319813186
}
1319913187
/*
13200-
* assign arg after request_irq call, so it will be
13188+
* assign arg after pci_request_irq call, so it will be
1320113189
* cleaned up
1320213190
*/
1320313191
me->arg = arg;
@@ -13206,7 +13194,7 @@ void hfi1_set_vnic_msix_info(struct hfi1_ctxtdata *rcd)
1320613194
if (ret) {
1320713195
dd_dev_err(dd,
1320813196
"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);
1321013198
}
1321113199
}
1321213200

@@ -14907,8 +14895,6 @@ struct hfi1_devdata *hfi1_init_dd(struct pci_dev *pdev,
1490714895
init_vl_arb_caches(ppd);
1490814896
}
1490914897

14910-
dd->link_default = HLS_DN_POLL;
14911-
1491214898
/*
1491314899
* Do remaining PCIe setup and save PCIe values in dd.
1491414900
* Any error printing is already done by the init code.

drivers/infiniband/hw/hfi1/debugfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ static int _ctx_stats_seq_show(struct seq_file *s, void *v)
243243
spos = v;
244244
i = *spos;
245245

246-
rcd = hfi1_rcd_get_by_index(dd, i);
246+
rcd = hfi1_rcd_get_by_index_safe(dd, i);
247247
if (!rcd)
248248
return SEQ_SKIP;
249249

@@ -402,7 +402,7 @@ static int _rcds_seq_show(struct seq_file *s, void *v)
402402
loff_t *spos = v;
403403
loff_t i = *spos;
404404

405-
rcd = hfi1_rcd_get_by_index(dd, i);
405+
rcd = hfi1_rcd_get_by_index_safe(dd, i);
406406
if (rcd)
407407
seqfile_dump_rcd(s, rcd);
408408
hfi1_rcd_put(rcd);

drivers/infiniband/hw/hfi1/driver.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ static inline void set_nodma_rtail(struct hfi1_devdata *dd, u16 ctxt)
866866
* interrupt handler for all statically allocated kernel contexts.
867867
*/
868868
if (ctxt >= dd->first_dyn_alloc_ctxt) {
869-
rcd = hfi1_rcd_get_by_index(dd, ctxt);
869+
rcd = hfi1_rcd_get_by_index_safe(dd, ctxt);
870870
if (rcd) {
871871
rcd->do_interrupt =
872872
&handle_receive_interrupt_nodma_rtail;
@@ -895,7 +895,7 @@ static inline void set_dma_rtail(struct hfi1_devdata *dd, u16 ctxt)
895895
* interrupt handler for all statically allocated kernel contexts.
896896
*/
897897
if (ctxt >= dd->first_dyn_alloc_ctxt) {
898-
rcd = hfi1_rcd_get_by_index(dd, ctxt);
898+
rcd = hfi1_rcd_get_by_index_safe(dd, ctxt);
899899
if (rcd) {
900900
rcd->do_interrupt =
901901
&handle_receive_interrupt_dma_rtail;

0 commit comments

Comments
 (0)