linux-stable/Documentation/scsi
Ahmed S. Darwish c2d0f1a65a scsi: libsas: Introduce a _gfp() variant of event notifiers
sas_alloc_event() uses in_interrupt() to decide which allocation should be
used.

The usage of in_interrupt() in drivers is phased out and Linus clearly
requested that code which changes behaviour depending on context should
either be separated or the context be conveyed in an argument passed by the
caller, which usually knows the context.

The in_interrupt() check is also only partially correct, because it fails
to choose the correct code path when just preemption or interrupts are
disabled. For example, as in the following call chain:

  mvsas/mv_sas.c: mvs_work_queue() [process context]
  spin_lock_irqsave(mvs_info::lock, )
    -> libsas/sas_event.c: sas_notify_phy_event()
      -> sas_alloc_event()
        -> in_interrupt() = false
          -> invalid GFP_KERNEL allocation
    -> libsas/sas_event.c: sas_notify_port_event()
      -> sas_alloc_event()
        -> in_interrupt() = false
          -> invalid GFP_KERNEL allocation

Introduce sas_alloc_event_gfp(), sas_notify_port_event_gfp(), and
sas_notify_phy_event_gfp(), which all behave like the non _gfp() variants
but use a caller-passed GFP mask for allocations.

For bisectability, all callers will be modified first to pass GFP context,
then the non _gfp() libsas API variants will be modified to take a gfp_t by
default.

Link: https://lore.kernel.org/r/20210118100955.1761652-4-a.darwish@linutronix.de
Fixes: 1c393b970e ("scsi: libsas: Use dynamic alloced work to avoid sas event lost")
Cc: Jason Yan <yanaijie@huawei.com>
Reviewed-by: John Garry <john.garry@huawei.com>
Signed-off-by: Ahmed S. Darwish <a.darwish@linutronix.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-01-22 21:31:07 -05:00
..
scsi_transport_srp scsi: docs: include SCSI Transport SRP diagram at the doc body 2020-03-11 23:07:57 -04:00
53c700.rst scsi: docs: convert 53c700.txt to ReST 2020-03-11 23:07:58 -04:00
aacraid.rst scsi: docs: convert aacraid.txt to ReST 2020-03-11 23:07:58 -04:00
advansys.rst scsi: advansys: docs: Eliminate duplicated word 2020-07-08 01:32:11 -04:00
aha152x.rst scsi: docs: convert aha152x.txt to ReST 2020-03-11 23:07:58 -04:00
aic7xxx.rst scsi: docs: convert aic7xxx.txt to ReST 2020-03-11 23:07:58 -04:00
aic79xx.rst scsi: docs: convert aic79xx.txt to ReST 2020-03-11 23:07:58 -04:00
arcmsr_spec.rst scsi: docs: convert arcmsr_spec.txt to ReST 2020-03-11 23:08:03 -04:00
bfa.rst scsi: docs: convert bfa.txt to ReST 2020-03-11 23:07:58 -04:00
bnx2fc.rst scsi: docs: convert bnx2fc.txt to ReST 2020-03-11 23:07:59 -04:00
BusLogic.rst scsi: docs: convert BusLogic.txt to ReST 2020-03-11 23:07:59 -04:00
ChangeLog.arcmsr [SCSI] arcmsr: update version and changelog 2008-03-03 13:10:22 -06:00
ChangeLog.ips Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
ChangeLog.lpfc Documentation: Fix multiple typo in Documentation 2012-03-07 16:08:24 +01:00
ChangeLog.megaraid Fix common misspellings 2011-03-31 11:26:23 -03:00
ChangeLog.megaraid_sas scripts/spelling.txt: add "varible" pattern and fix typo instances 2017-02-27 18:43:47 -08:00
ChangeLog.ncr53c8xx Fix common misspellings 2011-03-31 11:26:23 -03:00
ChangeLog.sym53c8xx Fix common misspellings 2011-03-31 11:26:23 -03:00
ChangeLog.sym53c8xx_2 Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
cxgb3i.rst scsi: docs: convert cxgb3i.txt to ReST 2020-03-11 23:07:59 -04:00
dc395x.rst scsi: docs: convert dc395x.txt to ReST 2020-03-11 23:07:59 -04:00
dpti.rst scsi: docs: convert dpti.txt to ReST 2020-03-11 23:07:59 -04:00
FlashPoint.rst scsi: docs: convert FlashPoint.txt to ReST 2020-03-11 23:07:59 -04:00
g_NCR5380.rst scsi: docs: convert g_NCR5380.txt to ReST 2020-03-11 23:08:00 -04:00
hpsa.rst scsi: docs: convert hpsa.txt to ReST 2020-03-11 23:08:00 -04:00
hptiop.rst scsi: docs: convert hptiop.txt to ReST 2020-03-11 23:08:00 -04:00
index.rst scsi: docs: convert arcmsr_spec.txt to ReST 2020-03-11 23:08:03 -04:00
libsas.rst scsi: libsas: Introduce a _gfp() variant of event notifiers 2021-01-22 21:31:07 -05:00
LICENSE.FlashPoint Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
link_power_management_policy.rst scsi: docs: convert link_power_management_policy.txt to ReST 2020-03-11 23:08:00 -04:00
lpfc.rst scsi: docs: convert lpfc.txt to ReST 2020-03-11 23:08:00 -04:00
megaraid.rst scsi: docs: convert megaraid.txt to ReST 2020-03-11 23:08:00 -04:00
ncr53c8xx.rst scsi: docs: convert ncr53c8xx.txt to ReST 2020-03-11 23:08:01 -04:00
NinjaSCSI.rst scsi: docs: convert NinjaSCSI.txt to ReST 2020-03-11 23:08:01 -04:00
ppa.rst scsi: docs: convert ppa.txt to ReST 2020-03-11 23:08:01 -04:00
qlogicfas.rst scsi: docs: convert qlogicfas.txt to ReST 2020-03-11 23:08:01 -04:00
scsi_eh.rst scsi: docs: convert scsi_mid_low_api.txt to ReST 2020-03-11 23:08:02 -04:00
scsi_fc_transport.rst scsi: docs: convert scsi_fc_transport.txt to ReST 2020-03-11 23:08:01 -04:00
scsi_mid_low_api.rst scsi: docs: Remove obsolete scsi typedef text from scsi_mid_low_api 2020-09-08 22:02:10 -04:00
scsi-changer.rst scsi: docs: convert scsi-changer.txt to ReST 2020-03-11 23:08:01 -04:00
scsi-generic.rst scsi: docs: convert scsi-generic.txt to ReST 2020-03-11 23:08:02 -04:00
scsi-parameters.rst scsi: Drop gdth driver 2021-01-22 21:14:07 -05:00
scsi.rst scsi: docs: convert scsi.txt to ReST 2020-03-11 23:08:02 -04:00
sd-parameters.rst scsi: docs: convert sd-parameters.txt to ReST 2020-03-11 23:08:02 -04:00
smartpqi.rst scsi: smartpqi: Update documentation 2020-09-02 22:49:06 -04:00
st.rst scsi: docs: convert st.txt to ReST 2020-03-11 23:08:02 -04:00
sym53c8xx_2.rst scsi: docs: convert sym53c8xx_2.txt to ReST 2020-03-11 23:08:03 -04:00
sym53c500_cs.rst scsi: docs: convert sym53c500_cs.txt to ReST 2020-03-11 23:08:03 -04:00
tcm_qla2xxx.rst scsi: docs: convert tcm_qla2xxx.txt to ReST 2020-03-11 23:08:03 -04:00
ufs.rst scsi: docs: convert ufs.txt to ReST 2020-03-11 23:08:03 -04:00
wd719x.rst scsi: docs: convert wd719x.txt to ReST 2020-03-11 23:08:03 -04:00