<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/scsi/isci, branch linux-5.11.y</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=linux-5.11.y</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=linux-5.11.y'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2021-03-04T11:14:43+00:00</updated>
<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.radix-linux.su/kernel/linux.git/commit/?id=0e6828b9f1e67a6a59fc429790a552ad6568ed76'/>
<id>urn:sha1: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>
</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.radix-linux.su/kernel/linux.git/commit/?id=9a5ee39a64455e25dcab2ff885e31f9df1cc8a77'/>
<id>urn:sha1: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>
</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.radix-linux.su/kernel/linux.git/commit/?id=6c9822a2933e5c39dfa0d5a5660a132c37939ffd'/>
<id>urn:sha1: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>
</entry>
<entry>
<title>scsi: libsas: Remove notifier indirection</title>
<updated>2021-03-04T11:14:42+00:00</updated>
<author>
<name>John Garry</name>
<email>john.garry@huawei.com</email>
</author>
<published>2021-01-18T10:09:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=04d7a4e2f658b7dabc91ab590aa40e6e5dfb3483'/>
<id>urn:sha1:04d7a4e2f658b7dabc91ab590aa40e6e5dfb3483</id>
<content type='text'>
[ Upstream commit 121181f3f839c29d8dd9fdc3cc9babbdc74227f8 ]

LLDDs report events to libsas with .notify_port_event and .notify_phy_event
callbacks.

These callbacks are fixed and so there is no reason why the functions
cannot be called directly, so do that.

This neatens the code slightly, makes it more obvious, and reduces function
pointer usage, which is generally a good thing. Downside is that there are
2x more symbol exports.

[a.darwish@linutronix.de: Remove the now unused "sas_ha" local variables]

Link: https://lore.kernel.org/r/20210118100955.1761652-3-a.darwish@linutronix.de
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Jack Wang &lt;jinpu.wang@cloud.ionos.com&gt;
Signed-off-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>
</entry>
<entry>
<title>scsi: isci: Don't use PCI helper functions</title>
<updated>2020-11-11T04:08:36+00:00</updated>
<author>
<name>Vaibhav Gupta</name>
<email>vaibhavgupta40@gmail.com</email>
</author>
<published>2020-11-07T10:04:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=44ff81f2995794982daf7b89a923c6335d57c469'/>
<id>urn:sha1:44ff81f2995794982daf7b89a923c6335d57c469</id>
<content type='text'>
PCI helper functions such as pci_enable/disable_device(),
pci_save/restore_state(), pci_set_power_state(), etc. were used by the
legacy framework to perform standard operations related to PCI PM.

This driver is using the generic framework and thus calls for those
functions should be dropped as those tasks are now performed by the PCI
core.

Link: https://lore.kernel.org/r/20201107100420.149521-1-vaibhavgupta40@gmail.com
Acked-by: Artur Paszkiewicz &lt;artur.paszkiewicz@intel.com&gt;
Signed-off-by: Vaibhav Gupta &lt;vaibhavgupta40@gmail.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: Remove unneeded break statements</title>
<updated>2020-10-26T22:23:24+00:00</updated>
<author>
<name>Tom Rix</name>
<email>trix@redhat.com</email>
</author>
<published>2020-10-19T14:23:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=170b7d2de29e6239b8dbc63a88de1fa9789b0d8d'/>
<id>urn:sha1:170b7d2de29e6239b8dbc63a88de1fa9789b0d8d</id>
<content type='text'>
A break is not needed if it is preceded by a return or goto.

Link: https://lore.kernel.org/r/20201019142333.16584-1-trix@redhat.com
Signed-off-by: Tom Rix &lt;trix@redhat.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi</title>
<updated>2020-10-23T23:19:02+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2020-10-23T23:19:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=af995383eb653f875c4e4e2349d5b0b4ba839eaa'/>
<id>urn:sha1:af995383eb653f875c4e4e2349d5b0b4ba839eaa</id>
<content type='text'>
Pull more SCSI updates from James Bottomley:
 "The set of core changes here is Christoph's submission path cleanups.

  These introduced a couple of regressions when first proposed so they
  got held over from the initial merge window pull request to give more
  testing time, which they've now had and Syzbot has confirmed the
  regression it detected is fixed.

  The other main changes are two driver updates (arcmsr, pm80xx) and
  assorted minor clean ups"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (38 commits)
  scsi: qla2xxx: Fix return of uninitialized value in rval
  scsi: core: Set sc_data_direction to DMA_NONE for no-transfer commands
  scsi: sr: Initialize -&gt;cmd_len
  scsi: arcmsr: Update driver version to v1.50.00.02-20200819
  scsi: arcmsr: Add support for ARC-1886 series RAID controllers
  scsi: arcmsr: Fix device hot-plug monitoring timer stop
  scsi: arcmsr: Remove unnecessary syntax
  scsi: pm80xx: Driver version update
  scsi: pm80xx: Increase the number of outstanding I/O supported to 1024
  scsi: pm80xx: Remove DMA memory allocation for ccb and device structures
  scsi: pm80xx: Increase number of supported queues
  scsi: sym53c8xx_2: Fix sizeof() mismatch
  scsi: isci: Fix a typo in a comment
  scsi: qla4xxx: Fix inconsistent format argument type
  scsi: myrb: Fix inconsistent format argument types
  scsi: myrb: Remove redundant assignment to variable timeout
  scsi: bfa: Fix error return in bfad_pci_init()
  scsi: fcoe: Simplify the return expression of fcoe_sysfs_setup()
  scsi: snic: Simplify the return expression of svnic_cq_alloc()
  scsi: fnic: Simplify the return expression of vnic_wq_copy_alloc()
  ...
</content>
</entry>
<entry>
<title>Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi</title>
<updated>2020-10-14T22:15:35+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2020-10-14T22:15:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=55e0500eb5c0440a3d43074edbd8db3e95851b66'/>
<id>urn:sha1:55e0500eb5c0440a3d43074edbd8db3e95851b66</id>
<content type='text'>
Pull SCSI updates from James Bottomley:
 "The usual driver updates (ufs, qla2xxx, tcmu, ibmvfc, lpfc, smartpqi,
  hisi_sas, qedi, qedf, mpt3sas) and minor bug fixes.

  There are only three core changes: adding sense codes, cleaning up
  noretry and adding an option for limitless retries"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (226 commits)
  scsi: hisi_sas: Recover PHY state according to the status before reset
  scsi: hisi_sas: Filter out new PHY up events during suspend
  scsi: hisi_sas: Add device link between SCSI devices and hisi_hba
  scsi: hisi_sas: Add check for methods _PS0 and _PR0
  scsi: hisi_sas: Add controller runtime PM support for v3 hw
  scsi: hisi_sas: Switch to new framework to support suspend and resume
  scsi: hisi_sas: Use hisi_hba-&gt;cq_nvecs for calling calling synchronize_irq()
  scsi: qedf: Remove redundant assignment to variable 'rc'
  scsi: lpfc: Remove unneeded variable 'status' in lpfc_fcp_cpu_map_store()
  scsi: snic: Convert to use DEFINE_SEQ_ATTRIBUTE macro
  scsi: qla4xxx: Delete unneeded variable 'status' in qla4xxx_process_ddb_changed
  scsi: sun_esp: Use module_platform_driver to simplify the code
  scsi: sun3x_esp: Use module_platform_driver to simplify the code
  scsi: sni_53c710: Use module_platform_driver to simplify the code
  scsi: qlogicpti: Use module_platform_driver to simplify the code
  scsi: mac_esp: Use module_platform_driver to simplify the code
  scsi: jazz_esp: Use module_platform_driver to simplify the code
  scsi: mvumi: Fix error return in mvumi_io_attach()
  scsi: lpfc: Drop nodelist reference on error in lpfc_gen_req()
  scsi: be2iscsi: Fix a theoretical leak in beiscsi_create_eqs()
  ...
</content>
</entry>
<entry>
<title>scsi: isci: Fix a typo in a comment</title>
<updated>2020-10-08T03:50:04+00:00</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2020-10-03T05:57:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=45660591ee8f5b08bfc6e3aec50639df82a19ca3'/>
<id>urn:sha1:45660591ee8f5b08bfc6e3aec50639df82a19ca3</id>
<content type='text'>
s/remtoe/remote/ and add a missing '.'

Link: https://lore.kernel.org/r/20201003055709.766119-1-christophe.jaillet@wanadoo.fr
Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: isci: Make scu_link_layer_set_txcomsas_timeout() static</title>
<updated>2020-09-16T01:30:48+00:00</updated>
<author>
<name>Jason Yan</name>
<email>yanaijie@huawei.com</email>
</author>
<published>2020-09-15T08:40:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2494ebe1b3f73c01b92b7bf623de261e7bd8677f'/>
<id>urn:sha1:2494ebe1b3f73c01b92b7bf623de261e7bd8677f</id>
<content type='text'>
This addresses the following sparse warning:

drivers/scsi/isci/phy.c:672:6: warning: symbol
'scu_link_layer_set_txcomsas_timeout' was not declared. Should it be
static?

Link: https://lore.kernel.org/r/20200915084000.2826741-1-yanaijie@huawei.com
Reported-by: Hulk Robot &lt;hulkci@huawei.com&gt;
Signed-off-by: Jason Yan &lt;yanaijie@huawei.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
</feed>
