mbox series

[net,0/2] net: ipa: prevent shutdown during setup

Message ID 20211123001555.505546-1-elder@linaro.org (mailing list archive)
Headers show
Series net: ipa: prevent shutdown during setup | expand

Message

Alex Elder Nov. 23, 2021, 12:15 a.m. UTC
The setup phase of the IPA driver occurs in one of two ways.
Normally, it is done directly by the main driver probe function.
But some systems (those having a "modem-init" DTS property) don't
start setup until an SMP2P interrupt (sent by the modem) arrives.

Because it isn't performed by the probe function, setup on
"modem-init" systems could be underway at the time a driver
remove (or shutdown) request arrives (or vice-versa).  This
situation can lead to hardware state not being cleaned up
properly.

This series addresses this problem by having the driver remove
function disable the setup interrupt.  A consequence of this is
that setup will complete if it is underway when the remove function
is called.

So now, when removing the driver, setup:
  - will have already completed;
  - is underway, and will complete before proceeding; or
  - will not have begun (and will not occur).

					-Alex

PS  These patches might not back-port cleanly; I'll gladly provide
    equivalent code for older kernel releases if needed.

Alex Elder (2):
  net: ipa: directly disable ipa-setup-ready interrupt
  net: ipa: separate disabling setup from modem stop

 drivers/net/ipa/ipa_main.c  |  6 ++++++
 drivers/net/ipa/ipa_modem.c |  6 +++---
 drivers/net/ipa/ipa_smp2p.c | 21 ++++++++++-----------
 drivers/net/ipa/ipa_smp2p.h |  7 +++----
 4 files changed, 22 insertions(+), 18 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Nov. 23, 2021, 12:20 p.m. UTC | #1
Hello:

This series was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Mon, 22 Nov 2021 18:15:53 -0600 you wrote:
> The setup phase of the IPA driver occurs in one of two ways.
> Normally, it is done directly by the main driver probe function.
> But some systems (those having a "modem-init" DTS property) don't
> start setup until an SMP2P interrupt (sent by the modem) arrives.
> 
> Because it isn't performed by the probe function, setup on
> "modem-init" systems could be underway at the time a driver
> remove (or shutdown) request arrives (or vice-versa).  This
> situation can lead to hardware state not being cleaned up
> properly.
> 
> [...]

Here is the summary with links:
  - [net,1/2] net: ipa: directly disable ipa-setup-ready interrupt
    https://git.kernel.org/netdev/net/c/33a153100bb3
  - [net,2/2] net: ipa: separate disabling setup from modem stop
    https://git.kernel.org/netdev/net/c/8afc7e471ad3

You are awesome, thank you!