<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/scsi, branch v5.11.4</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>scsi: iscsi: Verify lengths on passthrough PDUs</title>
<updated>2021-03-07T11:35:56+00:00</updated>
<author>
<name>Chris Leech</name>
<email>cleech@redhat.com</email>
</author>
<published>2021-02-24T05:39:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=cbfa0cd441302502ebb62c1d0c75614b34970150'/>
<id>cbfa0cd441302502ebb62c1d0c75614b34970150</id>
<content type='text'>
commit f9dbdf97a5bd92b1a49cee3d591b55b11fd7a6d5 upstream.

Open-iSCSI sends passthrough PDUs over netlink, but the kernel should be
verifying that the provided PDU header and data lengths fall within the
netlink message to prevent accessing beyond that in memory.

Cc: stable@vger.kernel.org
Reported-by: Adam Nichols &lt;adam@grimm-co.com&gt;
Reviewed-by: Lee Duncan &lt;lduncan@suse.com&gt;
Reviewed-by: Mike Christie &lt;michael.christie@oracle.com&gt;
Signed-off-by: Chris Leech &lt;cleech@redhat.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit f9dbdf97a5bd92b1a49cee3d591b55b11fd7a6d5 upstream.

Open-iSCSI sends passthrough PDUs over netlink, but the kernel should be
verifying that the provided PDU header and data lengths fall within the
netlink message to prevent accessing beyond that in memory.

Cc: stable@vger.kernel.org
Reported-by: Adam Nichols &lt;adam@grimm-co.com&gt;
Reviewed-by: Lee Duncan &lt;lduncan@suse.com&gt;
Reviewed-by: Mike Christie &lt;michael.christie@oracle.com&gt;
Signed-off-by: Chris Leech &lt;cleech@redhat.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: iscsi: Ensure sysfs attributes are limited to PAGE_SIZE</title>
<updated>2021-03-07T11:35:56+00:00</updated>
<author>
<name>Chris Leech</name>
<email>cleech@redhat.com</email>
</author>
<published>2021-02-24T02:00:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=99cfc479b678d3e8e86013d17a082308a215fa0e'/>
<id>99cfc479b678d3e8e86013d17a082308a215fa0e</id>
<content type='text'>
commit ec98ea7070e94cc25a422ec97d1421e28d97b7ee upstream.

As the iSCSI parameters are exported back through sysfs, it should be
enforcing that they never are more than PAGE_SIZE (which should be more
than enough) before accepting updates through netlink.

Change all iSCSI sysfs attributes to use sysfs_emit().

Cc: stable@vger.kernel.org
Reported-by: Adam Nichols &lt;adam@grimm-co.com&gt;
Reviewed-by: Lee Duncan &lt;lduncan@suse.com&gt;
Reviewed-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Reviewed-by: Mike Christie &lt;michael.christie@oracle.com&gt;
Signed-off-by: Chris Leech &lt;cleech@redhat.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit ec98ea7070e94cc25a422ec97d1421e28d97b7ee upstream.

As the iSCSI parameters are exported back through sysfs, it should be
enforcing that they never are more than PAGE_SIZE (which should be more
than enough) before accepting updates through netlink.

Change all iSCSI sysfs attributes to use sysfs_emit().

Cc: stable@vger.kernel.org
Reported-by: Adam Nichols &lt;adam@grimm-co.com&gt;
Reviewed-by: Lee Duncan &lt;lduncan@suse.com&gt;
Reviewed-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Reviewed-by: Mike Christie &lt;michael.christie@oracle.com&gt;
Signed-off-by: Chris Leech &lt;cleech@redhat.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: iscsi: Restrict sessions and handles to admin capabilities</title>
<updated>2021-03-07T11:35:56+00:00</updated>
<author>
<name>Lee Duncan</name>
<email>lduncan@suse.com</email>
</author>
<published>2021-02-23T21:06:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=3ada197fece73a5cab673427b960546b09bbef31'/>
<id>3ada197fece73a5cab673427b960546b09bbef31</id>
<content type='text'>
commit 688e8128b7a92df982709a4137ea4588d16f24aa upstream.

Protect the iSCSI transport handle, available in sysfs, by requiring
CAP_SYS_ADMIN to read it. Also protect the netlink socket by restricting
reception of messages to ones sent with CAP_SYS_ADMIN. This disables
normal users from being able to end arbitrary iSCSI sessions.

Cc: stable@vger.kernel.org
Reported-by: Adam Nichols &lt;adam@grimm-co.com&gt;
Reviewed-by: Chris Leech &lt;cleech@redhat.com&gt;
Reviewed-by: Mike Christie &lt;michael.christie@oracle.com&gt;
Signed-off-by: Lee Duncan &lt;lduncan@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 688e8128b7a92df982709a4137ea4588d16f24aa upstream.

Protect the iSCSI transport handle, available in sysfs, by requiring
CAP_SYS_ADMIN to read it. Also protect the netlink socket by restricting
reception of messages to ones sent with CAP_SYS_ADMIN. This disables
normal users from being able to end arbitrary iSCSI sessions.

Cc: stable@vger.kernel.org
Reported-by: Adam Nichols &lt;adam@grimm-co.com&gt;
Reviewed-by: Chris Leech &lt;cleech@redhat.com&gt;
Reviewed-by: Mike Christie &lt;michael.christie@oracle.com&gt;
Signed-off-by: Lee Duncan &lt;lduncan@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: sd: Fix Opal support</title>
<updated>2021-03-04T11:15:17+00:00</updated>
<author>
<name>Bart Van Assche</name>
<email>bvanassche@acm.org</email>
</author>
<published>2021-02-22T02:10:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=20894f310a2739f5f72271fdbc40632b319391ed'/>
<id>20894f310a2739f5f72271fdbc40632b319391ed</id>
<content type='text'>
commit aaf15f8c6de932861f1fce6aeec6a89ac0e354b6 upstream.

The SCSI core has been modified recently such that it only processes PM
requests if rpm_status != RPM_ACTIVE. Since some Opal requests are
submitted while rpm_status != RPM_ACTIVE, set flag RQF_PM for Opal
requests.

See also https://bugzilla.kernel.org/show_bug.cgi?id=211227.

[mkp: updated sha for PM patch]

Link: https://lore.kernel.org/r/20210222021042.3534-1-bvanassche@acm.org
Fixes: d80210f25ff0 ("sd: add support for TCG OPAL self encrypting disks")
Fixes: e6044f714b25 ("scsi: core: Only process PM requests if rpm_status != RPM_ACTIVE")
Cc: chriscjsus@yahoo.com
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: stable@vger.kernel.org
Reported-by: chriscjsus@yahoo.com
Tested-by: chriscjsus@yahoo.com
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit aaf15f8c6de932861f1fce6aeec6a89ac0e354b6 upstream.

The SCSI core has been modified recently such that it only processes PM
requests if rpm_status != RPM_ACTIVE. Since some Opal requests are
submitted while rpm_status != RPM_ACTIVE, set flag RQF_PM for Opal
requests.

See also https://bugzilla.kernel.org/show_bug.cgi?id=211227.

[mkp: updated sha for PM patch]

Link: https://lore.kernel.org/r/20210222021042.3534-1-bvanassche@acm.org
Fixes: d80210f25ff0 ("sd: add support for TCG OPAL self encrypting disks")
Fixes: e6044f714b25 ("scsi: core: Only process PM requests if rpm_status != RPM_ACTIVE")
Cc: chriscjsus@yahoo.com
Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: stable@vger.kernel.org
Reported-by: chriscjsus@yahoo.com
Tested-by: chriscjsus@yahoo.com
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: sd: sd_zbc: Don't pass GFP_NOIO to kvcalloc</title>
<updated>2021-03-04T11:15:16+00:00</updated>
<author>
<name>Johannes Thumshirn</name>
<email>johannes.thumshirn@wdc.com</email>
</author>
<published>2021-02-17T13:52:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=599ffde6791f123f708f7b943880c912a3398655'/>
<id>599ffde6791f123f708f7b943880c912a3398655</id>
<content type='text'>
[ Upstream commit 9acced3f58ad24407c1f9ebf53a8892c1e24cdb5 ]

Dan reported we're passing in GFP_NOIO to kvmalloc() which will then
fallback to doing kmalloc() instead of an optional vmalloc() if the size
exceeds kmalloc()s limits. This will break with drives that have zone
numbers exceeding PAGE_SIZE/sizeof(u32).

Instead of passing in GFP_NOIO, enter an implicit GFP_NOIO allocation
scope.

Link: https://lore.kernel.org/r/YCuvSfKw4qEQBr/t@mwanda
Link: https://lore.kernel.org/r/5a6345e2989fd06c049ac4e4627f6acb492c15b8.1613569821.git.johannes.thumshirn@wdc.com
Fixes: 5795eb443060: ("scsi: sd_zbc: emulate ZONE_APPEND commands")
Cc: Damien Le Moal &lt;Damien.LeMoal@wdc.com&gt;
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Damien Le Moal &lt;damien.lemoal@wdc.com&gt;
Signed-off-by: Johannes Thumshirn &lt;johannes.thumshirn@wdc.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 9acced3f58ad24407c1f9ebf53a8892c1e24cdb5 ]

Dan reported we're passing in GFP_NOIO to kvmalloc() which will then
fallback to doing kmalloc() instead of an optional vmalloc() if the size
exceeds kmalloc()s limits. This will break with drives that have zone
numbers exceeding PAGE_SIZE/sizeof(u32).

Instead of passing in GFP_NOIO, enter an implicit GFP_NOIO allocation
scope.

Link: https://lore.kernel.org/r/YCuvSfKw4qEQBr/t@mwanda
Link: https://lore.kernel.org/r/5a6345e2989fd06c049ac4e4627f6acb492c15b8.1613569821.git.johannes.thumshirn@wdc.com
Fixes: 5795eb443060: ("scsi: sd_zbc: emulate ZONE_APPEND commands")
Cc: Damien Le Moal &lt;Damien.LeMoal@wdc.com&gt;
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Damien Le Moal &lt;damien.lemoal@wdc.com&gt;
Signed-off-by: Johannes Thumshirn &lt;johannes.thumshirn@wdc.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: bnx2fc: Fix Kconfig warning &amp; CNIC build errors</title>
<updated>2021-03-04T11:15:16+00:00</updated>
<author>
<name>Randy Dunlap</name>
<email>rdunlap@infradead.org</email>
</author>
<published>2021-02-13T19:24:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=eade299459039a89e8153dc56492ebece8a2afbf'/>
<id>eade299459039a89e8153dc56492ebece8a2afbf</id>
<content type='text'>
[ Upstream commit eefb816acb0162e94a85a857f3a55148f671d5a5 ]

CNIC depends on MMU, but since 'select' does not follow any dependency
chains, SCSI_BNX2X_FCOE also needs to depend on MMU, so that erroneous
configs are not generated, which cause build errors in cnic.

WARNING: unmet direct dependencies detected for CNIC
  Depends on [n]: NETDEVICES [=y] &amp;&amp; ETHERNET [=y] &amp;&amp; NET_VENDOR_BROADCOM [=y] &amp;&amp; PCI [=y] &amp;&amp; (IPV6 [=n] || IPV6 [=n]=n) &amp;&amp; MMU [=n]
  Selected by [y]:
  - SCSI_BNX2X_FCOE [=y] &amp;&amp; SCSI_LOWLEVEL [=y] &amp;&amp; SCSI [=y] &amp;&amp; PCI [=y] &amp;&amp; (IPV6 [=n] || IPV6 [=n]=n) &amp;&amp; LIBFC [=y] &amp;&amp; LIBFCOE [=y]

riscv64-linux-ld: drivers/net/ethernet/broadcom/cnic.o: in function `.L154':
cnic.c:(.text+0x1094): undefined reference to `uio_event_notify'
riscv64-linux-ld: cnic.c:(.text+0x10bc): undefined reference to `uio_event_notify'
riscv64-linux-ld: drivers/net/ethernet/broadcom/cnic.o: in function `.L1442':
cnic.c:(.text+0x96a8): undefined reference to `__uio_register_device'
riscv64-linux-ld: drivers/net/ethernet/broadcom/cnic.o: in function `.L0 ':
cnic.c:(.text.unlikely+0x68): undefined reference to `uio_unregister_device'

Link: https://lore.kernel.org/r/20210213192428.22537-1-rdunlap@infradead.org
Fixes: 853e2bd2103a ("[SCSI] bnx2fc: Broadcom FCoE offload driver")
Cc: Saurav Kashyap &lt;skashyap@marvell.com&gt;
Cc: Javed Hasan &lt;jhasan@marvell.com&gt;
Cc: GR-QLogic-Storage-Upstream@marvell.com
Cc: "James E.J. Bottomley" &lt;jejb@linux.ibm.com&gt;
Cc: "Martin K. Petersen" &lt;martin.petersen@oracle.com&gt;
Cc: linux-scsi@vger.kernel.org
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit eefb816acb0162e94a85a857f3a55148f671d5a5 ]

CNIC depends on MMU, but since 'select' does not follow any dependency
chains, SCSI_BNX2X_FCOE also needs to depend on MMU, so that erroneous
configs are not generated, which cause build errors in cnic.

WARNING: unmet direct dependencies detected for CNIC
  Depends on [n]: NETDEVICES [=y] &amp;&amp; ETHERNET [=y] &amp;&amp; NET_VENDOR_BROADCOM [=y] &amp;&amp; PCI [=y] &amp;&amp; (IPV6 [=n] || IPV6 [=n]=n) &amp;&amp; MMU [=n]
  Selected by [y]:
  - SCSI_BNX2X_FCOE [=y] &amp;&amp; SCSI_LOWLEVEL [=y] &amp;&amp; SCSI [=y] &amp;&amp; PCI [=y] &amp;&amp; (IPV6 [=n] || IPV6 [=n]=n) &amp;&amp; LIBFC [=y] &amp;&amp; LIBFCOE [=y]

riscv64-linux-ld: drivers/net/ethernet/broadcom/cnic.o: in function `.L154':
cnic.c:(.text+0x1094): undefined reference to `uio_event_notify'
riscv64-linux-ld: cnic.c:(.text+0x10bc): undefined reference to `uio_event_notify'
riscv64-linux-ld: drivers/net/ethernet/broadcom/cnic.o: in function `.L1442':
cnic.c:(.text+0x96a8): undefined reference to `__uio_register_device'
riscv64-linux-ld: drivers/net/ethernet/broadcom/cnic.o: in function `.L0 ':
cnic.c:(.text.unlikely+0x68): undefined reference to `uio_unregister_device'

Link: https://lore.kernel.org/r/20210213192428.22537-1-rdunlap@infradead.org
Fixes: 853e2bd2103a ("[SCSI] bnx2fc: Broadcom FCoE offload driver")
Cc: Saurav Kashyap &lt;skashyap@marvell.com&gt;
Cc: Javed Hasan &lt;jhasan@marvell.com&gt;
Cc: GR-QLogic-Storage-Upstream@marvell.com
Cc: "James E.J. Bottomley" &lt;jejb@linux.ibm.com&gt;
Cc: "Martin K. Petersen" &lt;martin.petersen@oracle.com&gt;
Cc: linux-scsi@vger.kernel.org
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: lpfc: Fix ancient double free</title>
<updated>2021-03-04T11:14:45+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2021-01-25T08:44:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=798ccdeb1752edf4fdfdf4496e1ca4ee7f36cdd6'/>
<id>798ccdeb1752edf4fdfdf4496e1ca4ee7f36cdd6</id>
<content type='text'>
[ Upstream commit 0be310979e5e1272d4c5b557642df4da4ce7eba4 ]

The "pmb" pointer is freed at the start of the function and then freed
again in the error handling code.

Link: https://lore.kernel.org/r/YA6E8rO51hE56SVw@mwanda
Fixes: 92d7f7b0cde3 ("[SCSI] lpfc: NPIV: add NPIV support on top of SLI-3")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 0be310979e5e1272d4c5b557642df4da4ce7eba4 ]

The "pmb" pointer is freed at the start of the function and then freed
again in the error handling code.

Link: https://lore.kernel.org/r/YA6E8rO51hE56SVw@mwanda
Fixes: 92d7f7b0cde3 ("[SCSI] lpfc: NPIV: add NPIV support on top of SLI-3")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: isci: Pass gfp_t flags in isci_port_bc_change_received()</title>
<updated>2021-03-04T11:14:43+00:00</updated>
<author>
<name>Ahmed S. Darwish</name>
<email>a.darwish@linutronix.de</email>
</author>
<published>2021-01-18T10:09:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=0e6828b9f1e67a6a59fc429790a552ad6568ed76'/>
<id>0e6828b9f1e67a6a59fc429790a552ad6568ed76</id>
<content type='text'>
[ Upstream commit 71dca5539fcf977aead0c9ea1962e70e78484b8e ]

Use the new libsas event notifiers API, which requires callers to
explicitly pass the gfp_t memory allocation flags.

libsas sas_notify_port_event() is called from
isci_port_bc_change_received(). Below is the context analysis for all of
its call chains:

host.c: sci_controller_error_handler(): atomic, irq handler     (*)
OR host.c: sci_controller_completion_handler(), atomic, tasklet (*)
  -&gt; sci_controller_process_completions()
    -&gt; sci_controller_event_completion()
      -&gt; phy.c: sci_phy_event_handler()
        -&gt; port.c: sci_port_broadcast_change_received()
          -&gt; isci_port_bc_change_received()

host.c: isci_host_init()                                        (@)
spin_lock_irq(isci_host::scic_lock)
  -&gt; sci_controller_initialize(), atomic                        (*)
    -&gt; port_config.c: sci_port_configuration_agent_initialize()
      -&gt; sci_mpc_agent_validate_phy_configuration()
        -&gt; port.c: sci_port_add_phy()
          -&gt; sci_port_set_phy()
            -&gt; phy.c: sci_phy_set_port()
              -&gt; port.c: sci_port_broadcast_change_received()
                -&gt; isci_port_bc_change_received()

port_config.c: apc_agent_timeout(), atomic, timer callback      (*)
  -&gt; sci_apc_agent_configure_ports()
    -&gt; port.c: sci_port_add_phy()
      -&gt; sci_port_set_phy()
        -&gt; phy.c: sci_phy_set_port()
          -&gt; port.c: sci_port_broadcast_change_received()
            -&gt; isci_port_bc_change_received()

phy.c: enter SCI state: *SCI_PHY_STOPPED*                       # Cont. from [1]
  -&gt; sci_phy_stopped_state_enter()
    -&gt; host.c: sci_controller_link_down()
      -&gt; -&gt;link_down_handler()
      == port_config.c: sci_apc_agent_link_down()
        -&gt; port.c: sci_port_remove_phy()
          -&gt; sci_port_clear_phy()
            -&gt; phy.c: sci_phy_set_port()
              -&gt; port.c: sci_port_broadcast_change_received()
                -&gt; isci_port_bc_change_received()

phy.c: enter SCI state: *SCI_PHY_STARTING*                      # Cont. from [2]
  -&gt; sci_phy_starting_state_enter()
    -&gt; host.c: sci_controller_link_down()
      -&gt; -&gt;link_down_handler()
      == port_config.c: sci_apc_agent_link_down()
        -&gt; port.c: sci_port_remove_phy()
          -&gt; sci_port_clear_phy()
            -&gt; phy.c: sci_phy_set_port()
              -&gt; port.c: sci_port_broadcast_change_received()
                -&gt; isci_port_bc_change_received()

[1] Call chains for entering state: *SCI_PHY_STOPPED*
-----------------------------------------------------

host.c: isci_host_init()                                        (@)
spin_lock_irq(isci_host::scic_lock)
  -&gt; sci_controller_initialize(), atomic                        (*)
      -&gt; phy.c: sci_phy_initialize()
        -&gt; phy.c: sci_phy_link_layer_initialization()
          -&gt; phy.c: sci_change_state(SCI_PHY_STOPPED)

init.c: PCI -&gt;remove() || PM_OPS -&gt;suspend,  process context    (+)
  -&gt; host.c: isci_host_deinit()
    -&gt; sci_controller_stop_phys()
      -&gt; phy.c: sci_phy_stop()
	-&gt; sci_change_state(SCI_PHY_STOPPED)

phy.c: isci_phy_control()
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; sci_phy_stop(), atomic                                     (*)
    -&gt; sci_change_state(SCI_PHY_STOPPED)

[2] Call chains for entering state: *SCI_PHY_STARTING*
------------------------------------------------------

phy.c: phy_sata_timeout(), atimer, timer callback               (*)
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; sci_change_state(SCI_PHY_STARTING)

host.c: phy_startup_timeout(), atomic, timer callback           (*)
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; sci_controller_start_next_phy()
    -&gt; sci_phy_start()
      -&gt; sci_change_state(SCI_PHY_STARTING)

host.c: isci_host_start()                                       (@)
spin_lock_irq(isci_host::scic_lock)
  -&gt; sci_controller_start(), atomic                             (*)
    -&gt; sci_controller_start_next_phy()
      -&gt; sci_phy_start()
        -&gt; sci_change_state(SCI_PHY_STARTING)

phy.c: Enter SCI state *SCI_PHY_SUB_FINAL*                      # Cont. from [2A]
  -&gt; sci_change_state(SCI_PHY_SUB_FINAL)
    -&gt; sci_phy_starting_final_substate_enter()
      -&gt; sci_change_state(SCI_PHY_READY)
        -&gt; Enter SCI state: *SCI_PHY_READY*
          -&gt; sci_phy_ready_state_enter()
            -&gt; host.c: sci_controller_link_up()
              -&gt; sci_controller_start_next_phy()
                -&gt; sci_phy_start()
                  -&gt; sci_change_state(SCI_PHY_STARTING)

phy.c: sci_phy_event_handler(), atomic, discussed earlier       (*)
  -&gt; sci_change_state(SCI_PHY_STARTING), 11 instances

port.c: isci_port_perform_hard_reset()
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; port.c: sci_port_hard_reset(), atomic                      (*)
    -&gt; phy.c: sci_phy_reset()
      -&gt; sci_change_state(SCI_PHY_RESETTING)
        -&gt; enter SCI PHY state: *SCI_PHY_RESETTING*
          -&gt; sci_phy_resetting_state_enter()
            -&gt; sci_change_state(SCI_PHY_STARTING)

[2A] Call chains for entering SCI state: *SCI_PHY_SUB_FINAL*
------------------------------------------------------------

host.c: power_control_timeout(), atomic, timer callback         (*)
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; phy.c: sci_phy_consume_power_handler()
    -&gt; phy.c: sci_change_state(SCI_PHY_SUB_FINAL)

host.c: sci_controller_error_handler(): atomic, irq handler     (*)
OR host.c: sci_controller_completion_handler(), atomic, tasklet (*)
  -&gt; sci_controller_process_completions()
    -&gt; sci_controller_unsolicited_frame()
      -&gt; phy.c: sci_phy_frame_handler()
        -&gt; sci_change_state(SCI_PHY_SUB_AWAIT_SAS_POWER)
          -&gt; sci_phy_starting_await_sas_power_substate_enter()
            -&gt; host.c: sci_controller_power_control_queue_insert()
              -&gt; phy.c: sci_phy_consume_power_handler()
                -&gt; sci_change_state(SCI_PHY_SUB_FINAL)
        -&gt; sci_change_state(SCI_PHY_SUB_FINAL)
    -&gt; sci_controller_event_completion()
      -&gt; phy.c: sci_phy_event_handler()
        -&gt; sci_phy_start_sata_link_training()
          -&gt; sci_change_state(SCI_PHY_SUB_AWAIT_SATA_POWER)
            -&gt; sci_phy_starting_await_sata_power_substate_enter
              -&gt; host.c: sci_controller_power_control_queue_insert()
                -&gt; phy.c: sci_phy_consume_power_handler()
                  -&gt; sci_change_state(SCI_PHY_SUB_FINAL)

As can be seen from the "(*)" markers above, almost all the call-chains are
atomic. The only exception, marked with "(+)", is a PCI -&gt;remove() and
PM_OPS -&gt;suspend() cold path. Thus, pass GFP_ATOMIC to the libsas port
event notifier.

Note, the now-replaced libsas APIs used in_interrupt() to implicitly decide
which memory allocation type to use.  This was only partially correct, as
it fails to choose the correct GFP flags when just preemption or interrupts
are disabled. Such buggy code paths are marked with "(@)" in the call
chains above.

Link: https://lore.kernel.org/r/20210118100955.1761652-8-a.darwish@linutronix.de
Fixes: 1c393b970e0f ("scsi: libsas: Use dynamic alloced work to avoid sas event lost")
Cc: Artur Paszkiewicz &lt;artur.paszkiewicz@intel.com&gt;
Reviewed-by: John Garry &lt;john.garry@huawei.com&gt;
Signed-off-by: Ahmed S. Darwish &lt;a.darwish@linutronix.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 71dca5539fcf977aead0c9ea1962e70e78484b8e ]

Use the new libsas event notifiers API, which requires callers to
explicitly pass the gfp_t memory allocation flags.

libsas sas_notify_port_event() is called from
isci_port_bc_change_received(). Below is the context analysis for all of
its call chains:

host.c: sci_controller_error_handler(): atomic, irq handler     (*)
OR host.c: sci_controller_completion_handler(), atomic, tasklet (*)
  -&gt; sci_controller_process_completions()
    -&gt; sci_controller_event_completion()
      -&gt; phy.c: sci_phy_event_handler()
        -&gt; port.c: sci_port_broadcast_change_received()
          -&gt; isci_port_bc_change_received()

host.c: isci_host_init()                                        (@)
spin_lock_irq(isci_host::scic_lock)
  -&gt; sci_controller_initialize(), atomic                        (*)
    -&gt; port_config.c: sci_port_configuration_agent_initialize()
      -&gt; sci_mpc_agent_validate_phy_configuration()
        -&gt; port.c: sci_port_add_phy()
          -&gt; sci_port_set_phy()
            -&gt; phy.c: sci_phy_set_port()
              -&gt; port.c: sci_port_broadcast_change_received()
                -&gt; isci_port_bc_change_received()

port_config.c: apc_agent_timeout(), atomic, timer callback      (*)
  -&gt; sci_apc_agent_configure_ports()
    -&gt; port.c: sci_port_add_phy()
      -&gt; sci_port_set_phy()
        -&gt; phy.c: sci_phy_set_port()
          -&gt; port.c: sci_port_broadcast_change_received()
            -&gt; isci_port_bc_change_received()

phy.c: enter SCI state: *SCI_PHY_STOPPED*                       # Cont. from [1]
  -&gt; sci_phy_stopped_state_enter()
    -&gt; host.c: sci_controller_link_down()
      -&gt; -&gt;link_down_handler()
      == port_config.c: sci_apc_agent_link_down()
        -&gt; port.c: sci_port_remove_phy()
          -&gt; sci_port_clear_phy()
            -&gt; phy.c: sci_phy_set_port()
              -&gt; port.c: sci_port_broadcast_change_received()
                -&gt; isci_port_bc_change_received()

phy.c: enter SCI state: *SCI_PHY_STARTING*                      # Cont. from [2]
  -&gt; sci_phy_starting_state_enter()
    -&gt; host.c: sci_controller_link_down()
      -&gt; -&gt;link_down_handler()
      == port_config.c: sci_apc_agent_link_down()
        -&gt; port.c: sci_port_remove_phy()
          -&gt; sci_port_clear_phy()
            -&gt; phy.c: sci_phy_set_port()
              -&gt; port.c: sci_port_broadcast_change_received()
                -&gt; isci_port_bc_change_received()

[1] Call chains for entering state: *SCI_PHY_STOPPED*
-----------------------------------------------------

host.c: isci_host_init()                                        (@)
spin_lock_irq(isci_host::scic_lock)
  -&gt; sci_controller_initialize(), atomic                        (*)
      -&gt; phy.c: sci_phy_initialize()
        -&gt; phy.c: sci_phy_link_layer_initialization()
          -&gt; phy.c: sci_change_state(SCI_PHY_STOPPED)

init.c: PCI -&gt;remove() || PM_OPS -&gt;suspend,  process context    (+)
  -&gt; host.c: isci_host_deinit()
    -&gt; sci_controller_stop_phys()
      -&gt; phy.c: sci_phy_stop()
	-&gt; sci_change_state(SCI_PHY_STOPPED)

phy.c: isci_phy_control()
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; sci_phy_stop(), atomic                                     (*)
    -&gt; sci_change_state(SCI_PHY_STOPPED)

[2] Call chains for entering state: *SCI_PHY_STARTING*
------------------------------------------------------

phy.c: phy_sata_timeout(), atimer, timer callback               (*)
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; sci_change_state(SCI_PHY_STARTING)

host.c: phy_startup_timeout(), atomic, timer callback           (*)
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; sci_controller_start_next_phy()
    -&gt; sci_phy_start()
      -&gt; sci_change_state(SCI_PHY_STARTING)

host.c: isci_host_start()                                       (@)
spin_lock_irq(isci_host::scic_lock)
  -&gt; sci_controller_start(), atomic                             (*)
    -&gt; sci_controller_start_next_phy()
      -&gt; sci_phy_start()
        -&gt; sci_change_state(SCI_PHY_STARTING)

phy.c: Enter SCI state *SCI_PHY_SUB_FINAL*                      # Cont. from [2A]
  -&gt; sci_change_state(SCI_PHY_SUB_FINAL)
    -&gt; sci_phy_starting_final_substate_enter()
      -&gt; sci_change_state(SCI_PHY_READY)
        -&gt; Enter SCI state: *SCI_PHY_READY*
          -&gt; sci_phy_ready_state_enter()
            -&gt; host.c: sci_controller_link_up()
              -&gt; sci_controller_start_next_phy()
                -&gt; sci_phy_start()
                  -&gt; sci_change_state(SCI_PHY_STARTING)

phy.c: sci_phy_event_handler(), atomic, discussed earlier       (*)
  -&gt; sci_change_state(SCI_PHY_STARTING), 11 instances

port.c: isci_port_perform_hard_reset()
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; port.c: sci_port_hard_reset(), atomic                      (*)
    -&gt; phy.c: sci_phy_reset()
      -&gt; sci_change_state(SCI_PHY_RESETTING)
        -&gt; enter SCI PHY state: *SCI_PHY_RESETTING*
          -&gt; sci_phy_resetting_state_enter()
            -&gt; sci_change_state(SCI_PHY_STARTING)

[2A] Call chains for entering SCI state: *SCI_PHY_SUB_FINAL*
------------------------------------------------------------

host.c: power_control_timeout(), atomic, timer callback         (*)
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; phy.c: sci_phy_consume_power_handler()
    -&gt; phy.c: sci_change_state(SCI_PHY_SUB_FINAL)

host.c: sci_controller_error_handler(): atomic, irq handler     (*)
OR host.c: sci_controller_completion_handler(), atomic, tasklet (*)
  -&gt; sci_controller_process_completions()
    -&gt; sci_controller_unsolicited_frame()
      -&gt; phy.c: sci_phy_frame_handler()
        -&gt; sci_change_state(SCI_PHY_SUB_AWAIT_SAS_POWER)
          -&gt; sci_phy_starting_await_sas_power_substate_enter()
            -&gt; host.c: sci_controller_power_control_queue_insert()
              -&gt; phy.c: sci_phy_consume_power_handler()
                -&gt; sci_change_state(SCI_PHY_SUB_FINAL)
        -&gt; sci_change_state(SCI_PHY_SUB_FINAL)
    -&gt; sci_controller_event_completion()
      -&gt; phy.c: sci_phy_event_handler()
        -&gt; sci_phy_start_sata_link_training()
          -&gt; sci_change_state(SCI_PHY_SUB_AWAIT_SATA_POWER)
            -&gt; sci_phy_starting_await_sata_power_substate_enter
              -&gt; host.c: sci_controller_power_control_queue_insert()
                -&gt; phy.c: sci_phy_consume_power_handler()
                  -&gt; sci_change_state(SCI_PHY_SUB_FINAL)

As can be seen from the "(*)" markers above, almost all the call-chains are
atomic. The only exception, marked with "(+)", is a PCI -&gt;remove() and
PM_OPS -&gt;suspend() cold path. Thus, pass GFP_ATOMIC to the libsas port
event notifier.

Note, the now-replaced libsas APIs used in_interrupt() to implicitly decide
which memory allocation type to use.  This was only partially correct, as
it fails to choose the correct GFP flags when just preemption or interrupts
are disabled. Such buggy code paths are marked with "(@)" in the call
chains above.

Link: https://lore.kernel.org/r/20210118100955.1761652-8-a.darwish@linutronix.de
Fixes: 1c393b970e0f ("scsi: libsas: Use dynamic alloced work to avoid sas event lost")
Cc: Artur Paszkiewicz &lt;artur.paszkiewicz@intel.com&gt;
Reviewed-by: John Garry &lt;john.garry@huawei.com&gt;
Signed-off-by: Ahmed S. Darwish &lt;a.darwish@linutronix.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: isci: Pass gfp_t flags in isci_port_link_up()</title>
<updated>2021-03-04T11:14:43+00:00</updated>
<author>
<name>Ahmed S. Darwish</name>
<email>a.darwish@linutronix.de</email>
</author>
<published>2021-01-18T10:09:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=9a5ee39a64455e25dcab2ff885e31f9df1cc8a77'/>
<id>9a5ee39a64455e25dcab2ff885e31f9df1cc8a77</id>
<content type='text'>
[ Upstream commit 5ce7902902adb8d154d67ba494f06daa29360ef0 ]

Use the new libsas event notifiers API, which requires callers to
explicitly pass the gfp_t memory allocation flags.

libsas sas_notify_port_event() is called from isci_port_link_up().  Below
is the context analysis for all of its call chains:

host.c: isci_host_init()                                        (@)
spin_lock_irq(isci_host::scic_lock)
  -&gt; sci_controller_initialize(), atomic                        (*)
    -&gt; port_config.c: sci_port_configuration_agent_initialize()
      -&gt; sci_mpc_agent_validate_phy_configuration()
        -&gt; port.c: sci_port_add_phy()
          -&gt; sci_port_general_link_up_handler()
            -&gt; sci_port_activate_phy()
              -&gt; isci_port_link_up()

port_config.c: apc_agent_timeout(), atomic, timer callback      (*)
  -&gt; sci_apc_agent_configure_ports()
    -&gt; port.c: sci_port_add_phy()
      -&gt; sci_port_general_link_up_handler()
        -&gt; sci_port_activate_phy()
          -&gt; isci_port_link_up()

phy.c: enter SCI state: *SCI_PHY_SUB_FINAL*                     # Cont. from [1]
  -&gt; phy.c: sci_phy_starting_final_substate_enter()
    -&gt; phy.c: sci_change_state(SCI_PHY_READY)
      -&gt; enter SCI state: *SCI_PHY_READY*
        -&gt; phy.c: sci_phy_ready_state_enter()
          -&gt; host.c: sci_controller_link_up()
            -&gt; .link_up_handler()
            == port_config.c: sci_apc_agent_link_up()
              -&gt; port.c: sci_port_link_up()
                -&gt; (continue at [A])
            == port_config.c: sci_mpc_agent_link_up()
	      -&gt; port.c: sci_port_link_up()
                -&gt; (continue at [A])

port_config.c: mpc_agent_timeout(), atomic, timer callback      (*)
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; -&gt;link_up_handler()
  == port_config.c: sci_apc_agent_link_up()
    -&gt; port.c: sci_port_link_up()
      -&gt; (continue at [A])
  == port_config.c: sci_mpc_agent_link_up()
    -&gt; port.c: sci_port_link_up()
      -&gt; (continue at [A])

[A] port.c: sci_port_link_up()
  -&gt; sci_port_activate_phy()
    -&gt; isci_port_link_up()
  -&gt; sci_port_general_link_up_handler()
    -&gt; sci_port_activate_phy()
      -&gt; isci_port_link_up()

[1] Call chains for entering SCI state: *SCI_PHY_SUB_FINAL*
-----------------------------------------------------------

host.c: power_control_timeout(), atomic, timer callback         (*)
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; phy.c: sci_phy_consume_power_handler()
    -&gt; phy.c: sci_change_state(SCI_PHY_SUB_FINAL)

host.c: sci_controller_error_handler(): atomic, irq handler     (*)
OR host.c: sci_controller_completion_handler(), atomic, tasklet (*)
  -&gt; sci_controller_process_completions()
    -&gt; sci_controller_unsolicited_frame()
      -&gt; phy.c: sci_phy_frame_handler()
        -&gt; sci_change_state(SCI_PHY_SUB_AWAIT_SAS_POWER)
          -&gt; sci_phy_starting_await_sas_power_substate_enter()
            -&gt; host.c: sci_controller_power_control_queue_insert()
              -&gt; phy.c: sci_phy_consume_power_handler()
                -&gt; sci_change_state(SCI_PHY_SUB_FINAL)
        -&gt; sci_change_state(SCI_PHY_SUB_FINAL)
    -&gt; sci_controller_event_completion()
      -&gt; phy.c: sci_phy_event_handler()
        -&gt; sci_phy_start_sata_link_training()
          -&gt; sci_change_state(SCI_PHY_SUB_AWAIT_SATA_POWER)
            -&gt; sci_phy_starting_await_sata_power_substate_enter
              -&gt; host.c: sci_controller_power_control_queue_insert()
                -&gt; phy.c: sci_phy_consume_power_handler()
                  -&gt; sci_change_state(SCI_PHY_SUB_FINAL)

As can be seen from the "(*)" markers above, all the call-chains are
atomic.  Pass GFP_ATOMIC to libsas port event notifier.

Note, the now-replaced libsas APIs used in_interrupt() to implicitly decide
which memory allocation type to use.  This was only partially correct, as
it fails to choose the correct GFP flags when just preemption or interrupts
are disabled. Such buggy code paths are marked with "(@)" in the call
chains above.

Link: https://lore.kernel.org/r/20210118100955.1761652-7-a.darwish@linutronix.de
Fixes: 1c393b970e0f ("scsi: libsas: Use dynamic alloced work to avoid sas event lost")
Cc: Artur Paszkiewicz &lt;artur.paszkiewicz@intel.com&gt;
Reviewed-by: John Garry &lt;john.garry@huawei.com&gt;
Signed-off-by: Ahmed S. Darwish &lt;a.darwish@linutronix.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 5ce7902902adb8d154d67ba494f06daa29360ef0 ]

Use the new libsas event notifiers API, which requires callers to
explicitly pass the gfp_t memory allocation flags.

libsas sas_notify_port_event() is called from isci_port_link_up().  Below
is the context analysis for all of its call chains:

host.c: isci_host_init()                                        (@)
spin_lock_irq(isci_host::scic_lock)
  -&gt; sci_controller_initialize(), atomic                        (*)
    -&gt; port_config.c: sci_port_configuration_agent_initialize()
      -&gt; sci_mpc_agent_validate_phy_configuration()
        -&gt; port.c: sci_port_add_phy()
          -&gt; sci_port_general_link_up_handler()
            -&gt; sci_port_activate_phy()
              -&gt; isci_port_link_up()

port_config.c: apc_agent_timeout(), atomic, timer callback      (*)
  -&gt; sci_apc_agent_configure_ports()
    -&gt; port.c: sci_port_add_phy()
      -&gt; sci_port_general_link_up_handler()
        -&gt; sci_port_activate_phy()
          -&gt; isci_port_link_up()

phy.c: enter SCI state: *SCI_PHY_SUB_FINAL*                     # Cont. from [1]
  -&gt; phy.c: sci_phy_starting_final_substate_enter()
    -&gt; phy.c: sci_change_state(SCI_PHY_READY)
      -&gt; enter SCI state: *SCI_PHY_READY*
        -&gt; phy.c: sci_phy_ready_state_enter()
          -&gt; host.c: sci_controller_link_up()
            -&gt; .link_up_handler()
            == port_config.c: sci_apc_agent_link_up()
              -&gt; port.c: sci_port_link_up()
                -&gt; (continue at [A])
            == port_config.c: sci_mpc_agent_link_up()
	      -&gt; port.c: sci_port_link_up()
                -&gt; (continue at [A])

port_config.c: mpc_agent_timeout(), atomic, timer callback      (*)
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; -&gt;link_up_handler()
  == port_config.c: sci_apc_agent_link_up()
    -&gt; port.c: sci_port_link_up()
      -&gt; (continue at [A])
  == port_config.c: sci_mpc_agent_link_up()
    -&gt; port.c: sci_port_link_up()
      -&gt; (continue at [A])

[A] port.c: sci_port_link_up()
  -&gt; sci_port_activate_phy()
    -&gt; isci_port_link_up()
  -&gt; sci_port_general_link_up_handler()
    -&gt; sci_port_activate_phy()
      -&gt; isci_port_link_up()

[1] Call chains for entering SCI state: *SCI_PHY_SUB_FINAL*
-----------------------------------------------------------

host.c: power_control_timeout(), atomic, timer callback         (*)
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; phy.c: sci_phy_consume_power_handler()
    -&gt; phy.c: sci_change_state(SCI_PHY_SUB_FINAL)

host.c: sci_controller_error_handler(): atomic, irq handler     (*)
OR host.c: sci_controller_completion_handler(), atomic, tasklet (*)
  -&gt; sci_controller_process_completions()
    -&gt; sci_controller_unsolicited_frame()
      -&gt; phy.c: sci_phy_frame_handler()
        -&gt; sci_change_state(SCI_PHY_SUB_AWAIT_SAS_POWER)
          -&gt; sci_phy_starting_await_sas_power_substate_enter()
            -&gt; host.c: sci_controller_power_control_queue_insert()
              -&gt; phy.c: sci_phy_consume_power_handler()
                -&gt; sci_change_state(SCI_PHY_SUB_FINAL)
        -&gt; sci_change_state(SCI_PHY_SUB_FINAL)
    -&gt; sci_controller_event_completion()
      -&gt; phy.c: sci_phy_event_handler()
        -&gt; sci_phy_start_sata_link_training()
          -&gt; sci_change_state(SCI_PHY_SUB_AWAIT_SATA_POWER)
            -&gt; sci_phy_starting_await_sata_power_substate_enter
              -&gt; host.c: sci_controller_power_control_queue_insert()
                -&gt; phy.c: sci_phy_consume_power_handler()
                  -&gt; sci_change_state(SCI_PHY_SUB_FINAL)

As can be seen from the "(*)" markers above, all the call-chains are
atomic.  Pass GFP_ATOMIC to libsas port event notifier.

Note, the now-replaced libsas APIs used in_interrupt() to implicitly decide
which memory allocation type to use.  This was only partially correct, as
it fails to choose the correct GFP flags when just preemption or interrupts
are disabled. Such buggy code paths are marked with "(@)" in the call
chains above.

Link: https://lore.kernel.org/r/20210118100955.1761652-7-a.darwish@linutronix.de
Fixes: 1c393b970e0f ("scsi: libsas: Use dynamic alloced work to avoid sas event lost")
Cc: Artur Paszkiewicz &lt;artur.paszkiewicz@intel.com&gt;
Reviewed-by: John Garry &lt;john.garry@huawei.com&gt;
Signed-off-by: Ahmed S. Darwish &lt;a.darwish@linutronix.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: isci: Pass gfp_t flags in isci_port_link_down()</title>
<updated>2021-03-04T11:14:43+00:00</updated>
<author>
<name>Ahmed S. Darwish</name>
<email>a.darwish@linutronix.de</email>
</author>
<published>2021-01-18T10:09:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6c9822a2933e5c39dfa0d5a5660a132c37939ffd'/>
<id>6c9822a2933e5c39dfa0d5a5660a132c37939ffd</id>
<content type='text'>
[ Upstream commit 885ab3b8926fdf9cdd7163dfad99deb9b0662b39 ]

Use the new libsas event notifiers API, which requires callers to
explicitly pass the gfp_t memory allocation flags.

sas_notify_phy_event() is exclusively called by isci_port_link_down().
Below is the context analysis for all of its call chains:

port.c: port_timeout(), atomic, timer callback                  (*)
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; port_state_machine_change(..., SCI_PORT_FAILED)
    -&gt; enter SCI port state: *SCI_PORT_FAILED*
      -&gt; sci_port_failed_state_enter()
        -&gt; isci_port_hard_reset_complete()
          -&gt; isci_port_link_down()

port.c: isci_port_perform_hard_reset()
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; port.c: sci_port_hard_reset(), atomic                      (*)
    -&gt; phy.c: sci_phy_reset()
      -&gt; sci_change_state(SCI_PHY_RESETTING)
        -&gt; enter SCI PHY state: *SCI_PHY_RESETTING*
          -&gt; sci_phy_resetting_state_enter()
            -&gt; port.c: sci_port_deactivate_phy()
	      -&gt; isci_port_link_down()

port.c: enter SCI port state: *SCI_PORT_READY*                  # Cont. from [1]
  -&gt; sci_port_ready_state_enter()
    -&gt; isci_port_hard_reset_complete()
      -&gt; isci_port_link_down()

phy.c: enter SCI state: *SCI_PHY_STOPPED*                       # Cont. from [2]
  -&gt; sci_phy_stopped_state_enter()
    -&gt; host.c: sci_controller_link_down()
      -&gt; -&gt;link_down_handler()
      == port_config.c: sci_apc_agent_link_down()
        -&gt; port.c: sci_port_remove_phy()
          -&gt; sci_port_deactivate_phy()
            -&gt; isci_port_link_down()
      == port_config.c: sci_mpc_agent_link_down()
        -&gt; port.c: sci_port_link_down()
          -&gt; sci_port_deactivate_phy()
            -&gt; isci_port_link_down()

phy.c: enter SCI state: *SCI_PHY_STARTING*                      # Cont. from [3]
  -&gt; sci_phy_starting_state_enter()
    -&gt; host.c: sci_controller_link_down()
      -&gt; -&gt;link_down_handler()
      == port_config.c: sci_apc_agent_link_down()
        -&gt; port.c: sci_port_remove_phy()
          -&gt; isci_port_link_down()
      == port_config.c: sci_mpc_agent_link_down()
        -&gt; port.c: sci_port_link_down()
          -&gt; sci_port_deactivate_phy()
            -&gt; isci_port_link_down()

[1] Call chains for 'enter SCI port state: *SCI_PORT_READY*'
------------------------------------------------------------

host.c: isci_host_init()                                        (@)
spin_lock_irq(isci_host::scic_lock)
  -&gt; sci_controller_initialize(), atomic                        (*)
    -&gt; port_config.c: sci_port_configuration_agent_initialize()
      -&gt; sci_mpc_agent_validate_phy_configuration()
        -&gt; port.c: sci_port_add_phy()
          -&gt; sci_port_general_link_up_handler()
            -&gt; port_state_machine_change(, SCI_PORT_READY)
              -&gt; enter port state *SCI_PORT_READY*

host.c: isci_host_start()                                       (@)
spin_lock_irq(isci_host::scic_lock)
  -&gt; host.c: sci_controller_start(), atomic                     (*)
    -&gt; host.c: sci_port_start()
      -&gt; port.c: port_state_machine_change(, SCI_PORT_READY)
        -&gt; enter port state *SCI_PORT_READY*

port_config.c: apc_agent_timeout(), atomic, timer callback      (*)
  -&gt; sci_apc_agent_configure_ports()
    -&gt; port.c: sci_port_add_phy()
      -&gt; sci_port_general_link_up_handler()
        -&gt; port_state_machine_change(, SCI_PORT_READY)
          -&gt; enter port state *SCI_PORT_READY*

port_config.c: mpc_agent_timeout(), atomic, timer callback      (*)
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; -&gt;link_up_handler()
  == port.c: sci_apc_agent_link_up()
    -&gt; sci_port_general_link_up_handler()
      -&gt; port_state_machine_change(, SCI_PORT_READY)
        -&gt; enter port state *SCI_PORT_READY*
  == port.c: sci_mpc_agent_link_up()
    -&gt; port.c: sci_port_link_up()
      -&gt; sci_port_general_link_up_handler()
        -&gt; port_state_machine_change(, SCI_PORT_READY)
          -&gt; enter port state *SCI_PORT_READY*

phy.c: enter SCI state: SCI_PHY_SUB_FINAL                       # Cont. from [1A]
  -&gt; sci_phy_starting_final_substate_enter()
    -&gt; sci_change_state(SCI_PHY_READY)
      -&gt; enter SCI state: *SCI_PHY_READY*
        -&gt; sci_phy_ready_state_enter()
          -&gt; host.c: sci_controller_link_up()
            -&gt; port_agent.link_up_handler()
            == port_config.c: sci_apc_agent_link_up()
              -&gt; port.c: sci_port_link_up()
                -&gt; sci_port_general_link_up_handler()
                  -&gt; port_state_machine_change(, SCI_PORT_READY)
                    -&gt; enter port state *SCI_PORT_READY*
            == port_config.c: sci_mpc_agent_link_up()
              -&gt; port.c: sci_port_link_up()
                -&gt; sci_port_general_link_up_handler()
                  -&gt; port_state_machine_change(, SCI_PORT_READY)
                    -&gt; enter port state *SCI_PORT_READY*

[1A] Call chains for entering SCI state: *SCI_PHY_SUB_FINAL*
------------------------------------------------------------

host.c: power_control_timeout(), atomic, timer callback         (*)
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; phy.c: sci_phy_consume_power_handler()
    -&gt; phy.c: sci_change_state(SCI_PHY_SUB_FINAL)

host.c: sci_controller_error_handler(): atomic, irq handler     (*)
OR host.c: sci_controller_completion_handler(), atomic, tasklet (*)
  -&gt; sci_controller_process_completions()
    -&gt; sci_controller_unsolicited_frame()
      -&gt; phy.c: sci_phy_frame_handler()
        -&gt; sci_change_state(SCI_PHY_SUB_AWAIT_SAS_POWER)
          -&gt; sci_phy_starting_await_sas_power_substate_enter()
            -&gt; host.c: sci_controller_power_control_queue_insert()
              -&gt; phy.c: sci_phy_consume_power_handler()
                -&gt; sci_change_state(SCI_PHY_SUB_FINAL)
        -&gt; sci_change_state(SCI_PHY_SUB_FINAL)
    -&gt; sci_controller_event_completion()
      -&gt; phy.c: sci_phy_event_handler()
        -&gt; sci_phy_start_sata_link_training()
          -&gt; sci_change_state(SCI_PHY_SUB_AWAIT_SATA_POWER)
            -&gt; sci_phy_starting_await_sata_power_substate_enter
              -&gt; host.c: sci_controller_power_control_queue_insert()
                -&gt; phy.c: sci_phy_consume_power_handler()
                  -&gt; sci_change_state(SCI_PHY_SUB_FINAL)

[2] Call chains for entering state: *SCI_PHY_STOPPED*
-----------------------------------------------------

host.c: isci_host_init()                                        (@)
spin_lock_irq(isci_host::scic_lock)
  -&gt; sci_controller_initialize(), atomic                        (*)
      -&gt; phy.c: sci_phy_initialize()
        -&gt; phy.c: sci_phy_link_layer_initialization()
          -&gt; phy.c: sci_change_state(SCI_PHY_STOPPED)

init.c: PCI -&gt;remove() || PM_OPS -&gt;suspend,  process context    (+)
  -&gt; host.c: isci_host_deinit()
    -&gt; sci_controller_stop_phys()
      -&gt; phy.c: sci_phy_stop()
	-&gt; sci_change_state(SCI_PHY_STOPPED)

phy.c: isci_phy_control()
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; sci_phy_stop(), atomic                                     (*)
    -&gt; sci_change_state(SCI_PHY_STOPPED)

[3] Call chains for entering state: *SCI_PHY_STARTING*
------------------------------------------------------

phy.c: phy_sata_timeout(), atimer, timer callback               (*)
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; sci_change_state(SCI_PHY_STARTING)

host.c: phy_startup_timeout(), atomic, timer callback           (*)
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; sci_controller_start_next_phy()
    -&gt; sci_phy_start()
      -&gt; sci_change_state(SCI_PHY_STARTING)

host.c: isci_host_start()                                       (@)
spin_lock_irq(isci_host::scic_lock)
  -&gt; sci_controller_start(), atomic                             (*)
    -&gt; sci_controller_start_next_phy()
      -&gt; sci_phy_start()
        -&gt; sci_change_state(SCI_PHY_STARTING)

phy.c: Enter SCI state *SCI_PHY_SUB_FINAL*, atomic, check above (*)
  -&gt; sci_change_state(SCI_PHY_SUB_FINAL)
    -&gt; sci_phy_starting_final_substate_enter()
      -&gt; sci_change_state(SCI_PHY_READY)
        -&gt; Enter SCI state: *SCI_PHY_READY*
          -&gt; sci_phy_ready_state_enter()
            -&gt; host.c: sci_controller_link_up()
              -&gt; sci_controller_start_next_phy()
                -&gt; sci_phy_start()
                  -&gt; sci_change_state(SCI_PHY_STARTING)

phy.c: sci_phy_event_handler(), atomic, discussed earlier       (*)
  -&gt; sci_change_state(SCI_PHY_STARTING), 11 instances

phy.c: enter SCI state: *SCI_PHY_RESETTING*, atomic, discussed  (*)
  -&gt; sci_phy_resetting_state_enter()
    -&gt; sci_change_state(SCI_PHY_STARTING)

As can be seen from the "(*)" markers above, almost all the call-chains are
atomic. The only exception, marked with "(+)", is a PCI -&gt;remove() and
PM_OPS -&gt;suspend() cold path. Thus, pass GFP_ATOMIC to the libsas phy event
notifier.

Note, The now-replaced libsas APIs used in_interrupt() to implicitly decide
which memory allocation type to use.  This was only partially correct, as
it fails to choose the correct GFP flags when just preemption or interrupts
are disabled. Such buggy code paths are marked with "(@)" in the call
chains above.

Link: https://lore.kernel.org/r/20210118100955.1761652-6-a.darwish@linutronix.de
Fixes: 1c393b970e0f ("scsi: libsas: Use dynamic alloced work to avoid sas event lost")
Cc: Artur Paszkiewicz &lt;artur.paszkiewicz@intel.com&gt;
Reviewed-by: John Garry &lt;john.garry@huawei.com&gt;
Signed-off-by: Ahmed S. Darwish &lt;a.darwish@linutronix.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[ Upstream commit 885ab3b8926fdf9cdd7163dfad99deb9b0662b39 ]

Use the new libsas event notifiers API, which requires callers to
explicitly pass the gfp_t memory allocation flags.

sas_notify_phy_event() is exclusively called by isci_port_link_down().
Below is the context analysis for all of its call chains:

port.c: port_timeout(), atomic, timer callback                  (*)
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; port_state_machine_change(..., SCI_PORT_FAILED)
    -&gt; enter SCI port state: *SCI_PORT_FAILED*
      -&gt; sci_port_failed_state_enter()
        -&gt; isci_port_hard_reset_complete()
          -&gt; isci_port_link_down()

port.c: isci_port_perform_hard_reset()
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; port.c: sci_port_hard_reset(), atomic                      (*)
    -&gt; phy.c: sci_phy_reset()
      -&gt; sci_change_state(SCI_PHY_RESETTING)
        -&gt; enter SCI PHY state: *SCI_PHY_RESETTING*
          -&gt; sci_phy_resetting_state_enter()
            -&gt; port.c: sci_port_deactivate_phy()
	      -&gt; isci_port_link_down()

port.c: enter SCI port state: *SCI_PORT_READY*                  # Cont. from [1]
  -&gt; sci_port_ready_state_enter()
    -&gt; isci_port_hard_reset_complete()
      -&gt; isci_port_link_down()

phy.c: enter SCI state: *SCI_PHY_STOPPED*                       # Cont. from [2]
  -&gt; sci_phy_stopped_state_enter()
    -&gt; host.c: sci_controller_link_down()
      -&gt; -&gt;link_down_handler()
      == port_config.c: sci_apc_agent_link_down()
        -&gt; port.c: sci_port_remove_phy()
          -&gt; sci_port_deactivate_phy()
            -&gt; isci_port_link_down()
      == port_config.c: sci_mpc_agent_link_down()
        -&gt; port.c: sci_port_link_down()
          -&gt; sci_port_deactivate_phy()
            -&gt; isci_port_link_down()

phy.c: enter SCI state: *SCI_PHY_STARTING*                      # Cont. from [3]
  -&gt; sci_phy_starting_state_enter()
    -&gt; host.c: sci_controller_link_down()
      -&gt; -&gt;link_down_handler()
      == port_config.c: sci_apc_agent_link_down()
        -&gt; port.c: sci_port_remove_phy()
          -&gt; isci_port_link_down()
      == port_config.c: sci_mpc_agent_link_down()
        -&gt; port.c: sci_port_link_down()
          -&gt; sci_port_deactivate_phy()
            -&gt; isci_port_link_down()

[1] Call chains for 'enter SCI port state: *SCI_PORT_READY*'
------------------------------------------------------------

host.c: isci_host_init()                                        (@)
spin_lock_irq(isci_host::scic_lock)
  -&gt; sci_controller_initialize(), atomic                        (*)
    -&gt; port_config.c: sci_port_configuration_agent_initialize()
      -&gt; sci_mpc_agent_validate_phy_configuration()
        -&gt; port.c: sci_port_add_phy()
          -&gt; sci_port_general_link_up_handler()
            -&gt; port_state_machine_change(, SCI_PORT_READY)
              -&gt; enter port state *SCI_PORT_READY*

host.c: isci_host_start()                                       (@)
spin_lock_irq(isci_host::scic_lock)
  -&gt; host.c: sci_controller_start(), atomic                     (*)
    -&gt; host.c: sci_port_start()
      -&gt; port.c: port_state_machine_change(, SCI_PORT_READY)
        -&gt; enter port state *SCI_PORT_READY*

port_config.c: apc_agent_timeout(), atomic, timer callback      (*)
  -&gt; sci_apc_agent_configure_ports()
    -&gt; port.c: sci_port_add_phy()
      -&gt; sci_port_general_link_up_handler()
        -&gt; port_state_machine_change(, SCI_PORT_READY)
          -&gt; enter port state *SCI_PORT_READY*

port_config.c: mpc_agent_timeout(), atomic, timer callback      (*)
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; -&gt;link_up_handler()
  == port.c: sci_apc_agent_link_up()
    -&gt; sci_port_general_link_up_handler()
      -&gt; port_state_machine_change(, SCI_PORT_READY)
        -&gt; enter port state *SCI_PORT_READY*
  == port.c: sci_mpc_agent_link_up()
    -&gt; port.c: sci_port_link_up()
      -&gt; sci_port_general_link_up_handler()
        -&gt; port_state_machine_change(, SCI_PORT_READY)
          -&gt; enter port state *SCI_PORT_READY*

phy.c: enter SCI state: SCI_PHY_SUB_FINAL                       # Cont. from [1A]
  -&gt; sci_phy_starting_final_substate_enter()
    -&gt; sci_change_state(SCI_PHY_READY)
      -&gt; enter SCI state: *SCI_PHY_READY*
        -&gt; sci_phy_ready_state_enter()
          -&gt; host.c: sci_controller_link_up()
            -&gt; port_agent.link_up_handler()
            == port_config.c: sci_apc_agent_link_up()
              -&gt; port.c: sci_port_link_up()
                -&gt; sci_port_general_link_up_handler()
                  -&gt; port_state_machine_change(, SCI_PORT_READY)
                    -&gt; enter port state *SCI_PORT_READY*
            == port_config.c: sci_mpc_agent_link_up()
              -&gt; port.c: sci_port_link_up()
                -&gt; sci_port_general_link_up_handler()
                  -&gt; port_state_machine_change(, SCI_PORT_READY)
                    -&gt; enter port state *SCI_PORT_READY*

[1A] Call chains for entering SCI state: *SCI_PHY_SUB_FINAL*
------------------------------------------------------------

host.c: power_control_timeout(), atomic, timer callback         (*)
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; phy.c: sci_phy_consume_power_handler()
    -&gt; phy.c: sci_change_state(SCI_PHY_SUB_FINAL)

host.c: sci_controller_error_handler(): atomic, irq handler     (*)
OR host.c: sci_controller_completion_handler(), atomic, tasklet (*)
  -&gt; sci_controller_process_completions()
    -&gt; sci_controller_unsolicited_frame()
      -&gt; phy.c: sci_phy_frame_handler()
        -&gt; sci_change_state(SCI_PHY_SUB_AWAIT_SAS_POWER)
          -&gt; sci_phy_starting_await_sas_power_substate_enter()
            -&gt; host.c: sci_controller_power_control_queue_insert()
              -&gt; phy.c: sci_phy_consume_power_handler()
                -&gt; sci_change_state(SCI_PHY_SUB_FINAL)
        -&gt; sci_change_state(SCI_PHY_SUB_FINAL)
    -&gt; sci_controller_event_completion()
      -&gt; phy.c: sci_phy_event_handler()
        -&gt; sci_phy_start_sata_link_training()
          -&gt; sci_change_state(SCI_PHY_SUB_AWAIT_SATA_POWER)
            -&gt; sci_phy_starting_await_sata_power_substate_enter
              -&gt; host.c: sci_controller_power_control_queue_insert()
                -&gt; phy.c: sci_phy_consume_power_handler()
                  -&gt; sci_change_state(SCI_PHY_SUB_FINAL)

[2] Call chains for entering state: *SCI_PHY_STOPPED*
-----------------------------------------------------

host.c: isci_host_init()                                        (@)
spin_lock_irq(isci_host::scic_lock)
  -&gt; sci_controller_initialize(), atomic                        (*)
      -&gt; phy.c: sci_phy_initialize()
        -&gt; phy.c: sci_phy_link_layer_initialization()
          -&gt; phy.c: sci_change_state(SCI_PHY_STOPPED)

init.c: PCI -&gt;remove() || PM_OPS -&gt;suspend,  process context    (+)
  -&gt; host.c: isci_host_deinit()
    -&gt; sci_controller_stop_phys()
      -&gt; phy.c: sci_phy_stop()
	-&gt; sci_change_state(SCI_PHY_STOPPED)

phy.c: isci_phy_control()
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; sci_phy_stop(), atomic                                     (*)
    -&gt; sci_change_state(SCI_PHY_STOPPED)

[3] Call chains for entering state: *SCI_PHY_STARTING*
------------------------------------------------------

phy.c: phy_sata_timeout(), atimer, timer callback               (*)
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; sci_change_state(SCI_PHY_STARTING)

host.c: phy_startup_timeout(), atomic, timer callback           (*)
spin_lock_irqsave(isci_host::scic_lock, )
  -&gt; sci_controller_start_next_phy()
    -&gt; sci_phy_start()
      -&gt; sci_change_state(SCI_PHY_STARTING)

host.c: isci_host_start()                                       (@)
spin_lock_irq(isci_host::scic_lock)
  -&gt; sci_controller_start(), atomic                             (*)
    -&gt; sci_controller_start_next_phy()
      -&gt; sci_phy_start()
        -&gt; sci_change_state(SCI_PHY_STARTING)

phy.c: Enter SCI state *SCI_PHY_SUB_FINAL*, atomic, check above (*)
  -&gt; sci_change_state(SCI_PHY_SUB_FINAL)
    -&gt; sci_phy_starting_final_substate_enter()
      -&gt; sci_change_state(SCI_PHY_READY)
        -&gt; Enter SCI state: *SCI_PHY_READY*
          -&gt; sci_phy_ready_state_enter()
            -&gt; host.c: sci_controller_link_up()
              -&gt; sci_controller_start_next_phy()
                -&gt; sci_phy_start()
                  -&gt; sci_change_state(SCI_PHY_STARTING)

phy.c: sci_phy_event_handler(), atomic, discussed earlier       (*)
  -&gt; sci_change_state(SCI_PHY_STARTING), 11 instances

phy.c: enter SCI state: *SCI_PHY_RESETTING*, atomic, discussed  (*)
  -&gt; sci_phy_resetting_state_enter()
    -&gt; sci_change_state(SCI_PHY_STARTING)

As can be seen from the "(*)" markers above, almost all the call-chains are
atomic. The only exception, marked with "(+)", is a PCI -&gt;remove() and
PM_OPS -&gt;suspend() cold path. Thus, pass GFP_ATOMIC to the libsas phy event
notifier.

Note, The now-replaced libsas APIs used in_interrupt() to implicitly decide
which memory allocation type to use.  This was only partially correct, as
it fails to choose the correct GFP flags when just preemption or interrupts
are disabled. Such buggy code paths are marked with "(@)" in the call
chains above.

Link: https://lore.kernel.org/r/20210118100955.1761652-6-a.darwish@linutronix.de
Fixes: 1c393b970e0f ("scsi: libsas: Use dynamic alloced work to avoid sas event lost")
Cc: Artur Paszkiewicz &lt;artur.paszkiewicz@intel.com&gt;
Reviewed-by: John Garry &lt;john.garry@huawei.com&gt;
Signed-off-by: Ahmed S. Darwish &lt;a.darwish@linutronix.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
