[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87mspvi0lk.fsf@miraculix.mork.no>
Date: Mon, 15 Apr 2024 08:47:19 +0200
From: Bjørn Mork <bjorn@...k.no>
To: Aleksander Morgado <aleksandermj@...omium.org>
Cc: oneukum@...e.com, linux-usb@...r.kernel.org, gregkh@...uxfoundation.org,
linux@...ck-us.net, linux-kernel@...r.kernel.org,
ejcaruso@...omium.org
Subject: Re: [PATCH] usb: cdc-wdm: close race between read and workqueue
Aleksander Morgado <aleksandermj@...omium.org> writes:
> On 3/14/24 11:50, Oliver Neukum wrote:
>> wdm_read() cannot race with itself. However, in
>> service_outstanding_interrupt() it can race with the
>> workqueue, which can be triggered by error handling.
>> Hence we need to make sure that the WDM_RESPONDING
>> flag is not just only set but tested.
>> Fixes: afba937e540c9 ("USB: CDC WDM driver")
>> Signed-off-by: Oliver Neukum <oneukum@...e.com>
>
> We are not aware of all the details involved in this patch, but we had
> to revert it in all the different ChromeOS kernel versions where we
> had it cherry-picked, because it broke the MBIM communication with the
> Intel XMM based Fibocomm L850 modem. Other modems shipped in
> Chromebooks like the QC based Fibocomm FM101 don't seem to be
> affected.
>
> Attached is an example output of mbimcli talking directly to the
> cdc-wdm port (i.e. without ModemManager or the mbim-proxy). In the
> example, we are receiving a bunch of different messages from previous
> mbimcli runs. Looking at the timestamps, it looks as if we only
> receive a message right after we have sent one, e.g. after each "open
> request" we end up receiving responses for requests sent in earlier
> runs; or something along those lines.
>
> Is this bad behavior of this specific modem chipset, and if so, how
> can we workaround it? If you need any additional information or help
> to test new patches, let us know.
I'm not sure I understand what problem that patch is supposed to fix.
Which means that everything I write could be completely wrong...
But to me it looks like the described issue is exactly what you should
expect if that change ever triggers. I believe we must resubmit the
urb from service_outstanding_interrupt(). That's why it was added. See
the explanation Robert wrote when introducing it:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/usb/class/cdc-wdm.c?id=c1da59dad0ebd3f9bd238f3fff82b1f7ffda7829
As for the XMM behaviour: it's been a long time since I tried any of
those, but AFAIR one the major differences compared to Qualcomm was the
strict queue handling in the firmware. This caused a number of problems
where the cdc-wdm driver wanted to skip a message for some reason. So
I'm not surprised that a bug like this is triggered by one of those
modems. That's probably the only thing they are good for :-)
Bjørn
Powered by blists - more mailing lists