mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Elder <elder@linaro.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: davem@davemloft.net, evgreen@chromium.org,
	subashab@codeaurora.org, cpratapa@codeaurora.org,
	bjorn.andersson@linaro.org, mka@chromium.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 1/2] net: ipa: only clear hardware state if setup has completed
Date: Fri, 9 Oct 2020 14:39:45 -0500	[thread overview]
Message-ID: <65ea5328-9f15-5bb6-80e9-514970cd4380@linaro.org> (raw)
In-Reply-To: <20201009122517.02a53088@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>

On 10/9/20 2:25 PM, Jakub Kicinski wrote:
> On Tue,  6 Oct 2020 16:30:46 -0500 Alex Elder wrote:
>> In the setup phase of initialization, GSI firmware gets loaded
>> and initialized, and the AP command TX and default RX endpoints
>> get set up.  Until that happens, IPA commands must not be issued
>> to the hardware.
>>
>> If the modem crashes, we stop endpoint channels and perform a
>> number of other activities to clear modem-related IPA state,
>> including zeroing filter and routing tables (using IPA commands).
>> This is a bug if setup is not complete.  We should also not be
>> performing the other cleanup activity in that case either.
>>
>> Fix this by returning immediately when handling a modem crash if we
>> haven't completed setup.
>>
>> Fixes: a646d6ec9098 ("soc: qcom: ipa: modem and microcontroller")
>> Tested-by: Matthias Kaehlcke <mka@chromium.org>
>> Signed-off-by: Alex Elder <elder@linaro.org>
> 
>> diff --git a/drivers/net/ipa/ipa_modem.c b/drivers/net/ipa/ipa_modem.c
>> index e34fe2d77324e..dd5b89c5cb2d4 100644
>> --- a/drivers/net/ipa/ipa_modem.c
>> +++ b/drivers/net/ipa/ipa_modem.c
>> @@ -285,6 +285,9 @@ static void ipa_modem_crashed(struct ipa *ipa)
>>   	struct device *dev = &ipa->pdev->dev;
>>   	int ret;
>>   
>> +	if (!ipa->setup_complete)
>> +		return;
>> +
>>   	ipa_endpoint_modem_pause_all(ipa, true);
>>   
>>   	ipa_endpoint_modem_hol_block_clear_all(ipa);
> 
> The only call site already checks setup_complete, so this is not needed,
> no?

Wow, you are correct.

I was mainly focused on the fact that the ipa_modem_crashed()
call could happen asynchronously, and that it called
ipa_table_reset() which requires IPA immediate commands.
I should have followed it back to its callers.

I agree with you, this is not needed.  The other patch
is definitely needed though.

Would you like me to re-post that single patch, or is
it acceptable as-is?

Thank you for reviewing this and catching my mistake.

					-Alex

> $ git grep -C2 ipa_modem_crashed\(
> drivers/net/ipa/ipa_modem.c-
> drivers/net/ipa/ipa_modem.c-/* Treat a "clean" modem stop the same as a crash */
> drivers/net/ipa/ipa_modem.c:static void ipa_modem_crashed(struct ipa *ipa)
> drivers/net/ipa/ipa_modem.c-{
> drivers/net/ipa/ipa_modem.c-    struct device *dev = &ipa->pdev->dev;
> --
> drivers/net/ipa/ipa_modem.c-                     notify_data->crashed ? "crashed" : "stopping");
> drivers/net/ipa/ipa_modem.c-            if (ipa->setup_complete)
> drivers/net/ipa/ipa_modem.c:                    ipa_modem_crashed(ipa);
> drivers/net/ipa/ipa_modem.c-            break;
> drivers/net/ipa/ipa_modem.c-
> 


  reply	other threads:[~2020-10-09 19:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-06 21:30 [PATCH net 0/2] net: ipa: non-setup bug fixes Alex Elder
2020-10-06 21:30 ` [PATCH net 1/2] net: ipa: only clear hardware state if setup has completed Alex Elder
2020-10-09 19:25   ` Jakub Kicinski
2020-10-09 19:39     ` Alex Elder [this message]
2020-10-09 19:41       ` Jakub Kicinski
2020-10-06 21:30 ` [PATCH net 2/2] net: ipa: skip suspend/resume activities if not set up Alex Elder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=65ea5328-9f15-5bb6-80e9-514970cd4380@linaro.org \
    --to=elder@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=cpratapa@codeaurora.org \
    --cc=davem@davemloft.net \
    --cc=evgreen@chromium.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mka@chromium.org \
    --cc=netdev@vger.kernel.org \
    --cc=subashab@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®