On 28.11.2026 17:07, David Westen wrote:
> On 28.11.2026 16:04, Maciej S. Szmigiero wrote:
>> I think for the issue at hand (S3 suspend/resume) currently the cleanest
>> and less intrusive solution is to unbind/rebind the driver as the
>> hibernation path already does.
>
> Thanks, that helps. Just to make sure I read it right: do you mean
> unbinding before S3, as v2 did and as hibernation does, or v3's
> re-bind after resume once the modem is detected as rebooted?
I meant going back to how your earlier patch titled "fix S3 resume by
re-binding the driver around it" did it.
As I wrote previously, I think that the alternative attempt to detect
whether the modem survived the S3 cycle in this patch is just too
complicated and intrusive in comparison to simply adding S3 case to
existing unbind/re-bind functionality that the aforementioned earlier
patch attempted.
I think that any effort is better spent fixing the bugs you describe
in the next paragraph.
> I'd prefer the latter. Unbinding before S3 runs the cleanup against a
> modem that is still running, so every suspend with traffic hits the
> cleanup bugs we discussed: with a strict IOMMU that's DMA faults, and
> without one the modem writes into freed memory.
These are the bugs I think should (eventually) be fixed.
> Hibernation has the
> same exposure, but it runs far less often than S3.
That depends on what the user prefers - hibernating their machine
or putting it into S3.
> After resume, the
> modem has lost power and holds none of the driver's memory, so the
> cleanup can't hit those bugs.
Yeah, but then there are issues with iosm code touching dead modem
requiring introducing "IOSM_MODEM_GONE" bit in this patch.
And also this won't help the "rmmod iosm" case.
So fixing the cleanup done on suspend with modem still live would still
be the preferred option.
> v4 would drop the checks from v3 and keep only the detection on resume
> and the re-bind after it, plus one check that stops doorbells to the
> rebooted modem until the re-bind. In my testing without it, a doorbell
> from the old driver instance crashed the rebooted modem into CD_READY
> again.
>
>> However, these fixes should go in separate patches from the S3 fix,
>> maybe even into separate patch series.
>
> Agreed, the teardown fixes will be a separate series.
> Patch 1 is the one exception: the re-bind hits that use-after-free on
> every S3 with wwan0 up, so I'd keep it first in this series. If you'd
> rather have it sent on its own, I can do that.
Sure, if it makes sense to include certain fix in the S3 fix series
then no problem with that.
> Thanks,
> David
Thanks,
Maciej