IB/hfi1: Protect context array set/clear with spinlock
The rcd array can be accessed from user context or during interrupts. Protecting this with a mutex isn't a good idea because the mutex should not be used from an IRQ. Protect the allocation and freeing of rcd array elements with a spinlock. Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Reviewed-by: Sebastian Sanchez <sebastian.sanchez@intel.com> Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
这个提交包含在:
@@ -15054,10 +15054,16 @@ struct hfi1_devdata *hfi1_init_dd(struct pci_dev *pdev,
|
||||
if (ret)
|
||||
goto bail_cleanup;
|
||||
|
||||
ret = hfi1_create_ctxts(dd);
|
||||
ret = hfi1_create_kctxts(dd);
|
||||
if (ret)
|
||||
goto bail_cleanup;
|
||||
|
||||
/*
|
||||
* Initialize aspm, to be done after gen3 transition and setting up
|
||||
* contexts and before enabling interrupts
|
||||
*/
|
||||
aspm_init(dd);
|
||||
|
||||
dd->rcvhdrsize = DEFAULT_RCVHDRSIZE;
|
||||
/*
|
||||
* rcd[0] is guaranteed to be valid by this point. Also, all
|
||||
@@ -15076,7 +15082,7 @@ struct hfi1_devdata *hfi1_init_dd(struct pci_dev *pdev,
|
||||
goto bail_cleanup;
|
||||
}
|
||||
|
||||
/* use contexts created by hfi1_create_ctxts */
|
||||
/* use contexts created by hfi1_create_kctxts */
|
||||
ret = set_up_interrupts(dd);
|
||||
if (ret)
|
||||
goto bail_cleanup;
|
||||
|
在新工单中引用
屏蔽一个用户