🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #23909

Re: [PATCH net v3 2/2] net: wwan: iosm: re-bind the driver when the modem rebooted during S3

#23909
From: "Maciej S. Szmigiero"
Date: Sat, 28 Nov 2026 15:04
77 lines
14346 bytes
On 27.11.2026 17:46, David Westen wrote:
> Hi Maciej,
> 
> Thanks for taking the time to review this again!
> 
> On 27.11.2026 14:49, Maciej S. Szmigiero wrote:
>> That's a much more intrusive change than simply re-binding the driver
>> and to be honest, feels like a hack around various paths in the iosm
>> driver that may be touching a modem that lost its power and then crashed.
> 
> Fair point about the size. The aim was to avoid behavioral changes
> unless the modem rebooted, and, unlike v2, now also avoid possibly
> re-binding on s2idle or opportunistic sleep.
> 
> On my laptop, the order is the other way around: the modem crashes
> during suspend entry, from the FORCE_SLEEP doorbell (which my s2idle
> series removes), and writes CD_READY to the shared memory. Then it
> loses power and boots again during resume. So after resume the modem
> is fine, and only that stale CD_READY says otherwise.

Interesting, I would presume that doing things that crash the modem
should, in principle, be avoided.

However, if the modem loses power or gets hardware-reset anyway during
S3 cycle then it effectively matters very little whether at the point
of that reset it was fully operational or in a crashed state.

> A plain re-bind of the unmodified driver after S3 worked in my tests,
> but those had no port open and wwan0 down; with this patch I also
> tested wwan0 up through the suspend. The checks are there because the
> driver and the modem are out of sync until the re-bind, so the cleanup
> shouldn't wait for replies or send commands the rebooted modem knows
> nothing about. If you prefer the plain re-bind, I'll keep only the
> detection and the re-bind, and test that with a port open and wwan0 up
> before sending v4.

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.

Especially considering there's AFAIK no programming documentation
available for this modem so one can't be certain of possible side effects
of more intrusive changes.

>> Also, wouldn't the problematic things that you describe in your cover
>> letter as happening at modem unbind during suspend also happen without
>> any power transition if the iosm module is simply unloaded from the
>> kernel (presumably with modem still connected)?
> 
> Yes, rmmod and hibernation run the same cleanup, and both problems
> are already in mainline: unbinding with wwan0 up hits the
> use-after-free that patch 1 fixes, and unbinding under traffic lets
> the modem DMA into the freed MUX buffers. I reproduced them with my v2
> patches applied, which leave that part of the cleanup unchanged.
> 
>> If yes, then this new approach is simply papering over bugs in the
>> iosm module cleanup that really should be fixed at some point
>> independently from any suspend/resume transition issues.
> 
> Agreed they need fixing, and I'd like to rework the teardown for
> net-next. But the re-bind doesn't hide them: a modem that lost power
> holds none of the driver's memory, and the remaining races are as
> exposed as with rmmod today.

Sure, the cleanup bugs are still there and would be good to fix these,
regardless whether they can be triggered by unbinding on suspend or
by removing the iosm module.

However, these fixes should go in separate patches from the S3 fix,
maybe even into separate patch series.

> Thanks,
> David

Thanks,
Maciej
Technical Details
Message-ID: <26f19a1f-8f60-4402-afc8-96fe46611998@maciej.szmigiero.name>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373175-linux-kernel-netdev=dewy.ru
References: <20261126194143.32283-1-davidlwesten@gmail.com> <20261126194143.32283-3-davidlwesten@gmail.com> <fd2a9a0a-106e-467b-acd0-7045410305e3@maciej.szmigiero.name> <DN659J3QCZRL.2PU3PICXJW6K9@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-373175-linux-kernel-netdev=dewy.ru
From: mail@maciej.szmigiero.name ("Maciej S. Szmigiero")
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v3 2/2] net: wwan: iosm: re-bind the driver when the
 modem rebooted during S3
Date: Sat, 28 Nov 2026 16:04:37 +0100
Organization: Usenet Network
Sender: mhej@vps-ovh.mhejs.net
Message-ID: <26f19a1f-8f60-4402-afc8-96fe46611998@maciej.szmigiero.name>
References: <20261126194143.32283-1-davidlwesten@gmail.com>
 <20261126194143.32283-3-davidlwesten@gmail.com>
 <fd2a9a0a-106e-467b-acd0-7045410305e3@maciej.szmigiero.name>
 <DN659J3QCZRL.2PU3PICXJW6K9@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="971936"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:k+5QPk3kv85uszDTcLb4WWUY5MM= sha256:4zYSGsoyN+XAqJZBHhP29M49+6NW/pILJNzOzAkgimc=
	sha1:SsFk/8jTefnm+vVUA6SrUH4OgrY= sha256:dzxyIO5blgRLuWoS5RPj2iS13gWRyBc5MhUWp0qKvTc=
Content-Language: en-US, pl-PL
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 52C8F125F80; Sat, 28 Nov 2026 18:05:14 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31
	tests=[HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
	autolearn=ham autolearn_force=no
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id BHZM-53bwg8Q;
	Sat, 28 Nov 2026 18:05:10 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-373175-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=maciej.szmigiero.name
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id B1704125F7E; Sat, 28 Nov 2026 18:05:05 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id 337EE6025D4; Sat, 28 Nov 2026 15:05:02 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795878299;
	b=GRJawupZwB2TowWAIGyHlR7/EN4P6eh1JpDyAreAyucKGwk3CVWFvAyDKz/bsnxtc3dN
	 Ya2EreJek03aZx2ADqY+40aNBpFz6wk5EwWvsS7+clSZnEPbRQjppRUledkzZ9VDfATxY
	 46tsUQSg5HS2Ni1TfqDlMBzRRiLKJcP4aUbp2FGvqC41nHY8X0ZIFVr1M4Wk87cBsfRc3
	 EPhRDsNznEEi7vqZ1w1+7xHByQeGtS5dZ7B82HckCXce3g4YIFyvOvSCjSrqwfYJ/rFCV
	 a3p2tAYehlKN24QSSaO4IAb17+FjnjfQCG/n12HLSRxms8yxWY8nW5+b7E1mAYSJjRw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795878299;
	h=X-Original-To:Received:DMARC-Filter:Received:Message-ID:Date:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent:
	 Subject:To:Cc:References:From:Content-Language:Autocrypt:
	 Disposition-Notification-To:In-Reply-To:Content-Type:
	 Content-Transfer-Encoding:Sender;
	bh=XQYaC1OGjjaYawwDE0pW25W49/SGHQua3j6bpgylExg=;
	b=UdY2IyCeuvMmpmKcakFs9wtEC9KcdYR/p1Kee/uceTAv6dbX+5Ft1aoOAodfWXSf4sPf
	 e5cEdVMlb+aFvJdHEPubo6Tw7C/tA6S2MI2ghcKiqRnGU/Wff94Nlkd1i26gGOllWEyH1
	 NPYQox5+T9wVVqW6Xfi55jg1g+KUY17tT7OMa4ezVNEE+jIG9xDSFq9H7wIvx57ipVORA
	 W4J5DKO1KNu5R9du2sOJdYm1wWFLvDoTCPTcJReyh6MU2Zwo52Mn6GaVy9V8mTPvwNvzC
	 7yv4hvR/MRAWWFfpahVRbt5tCKf5Gpu0ddfptZqIV7rYbSq1iT4K6BL8fa3JVYqjA8g==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dmarc=none header.from=maciej.szmigiero.name;
	spf=pass smtp.mailfrom=vps-ovh.mhejs.net;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id BE3FA606A329;
	Sat, 28 Nov 2026 15:04:59 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=145.239.82.108
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795878299;
	b=sOMhP31BNCogz8OuD84QsVjhdotob4GU6YSfYcZuGrBavmMO9auWOwf1Ht1eDLTTYAIY
	 7F6+BPMHrTvKam5rrgp3qPSYmRLtYV7cWw4fMKHyzeLMTH8jtTrXNuUtMa8HzF6KjBB6f
	 BIE8lD7BFBG0caNP5RPUCfJShVPrIR4fdLS0Ay9zU1knWQEBezsFwtrv0C8/TbAvzNiib
	 xyYFA7ab4ZmloA7IVr4gdiQVFrmn8ViE3++vOapztOS5kqk8Nx9aGJRC1oDWpa7ueMxXS
	 HUa7ksnUEymQ013A3kRaBfhqplxi9yi/R2BbrkIWH60eM2fiSziA2pi0/Jz+6dZcj/Q==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795878299;
	h=DMARC-Filter:Received:Message-ID:Date:MIME-Version:User-Agent:
	 Subject:To:Cc:References:From:Content-Language:Autocrypt:
	 Disposition-Notification-To:In-Reply-To:Content-Type:
	 Content-Transfer-Encoding:Sender;
	bh=XQYaC1OGjjaYawwDE0pW25W49/SGHQua3j6bpgylExg=;
	b=sCX0zSCJIEfWgcYq9cZNg0k1uaH4PU/l7uHLtLPutXpVBFVoap9JpWldRe80WLwdKqb2
	 lnS0SxXX4y1DOLJXlYO7UhgwRSjFo+ZFE+8h7L5i4XSLp50tllBSxI36hhZu7MCqEPBUt
	 IGT4wLMaoUB7FEro+r3mBpiyVD5RlkxYz4shivxKYKL82nGwjrN4tjEh7gVeS3ZP+OFyv
	 WvT1sd7aUa7XVPdy9LaWXkqW+Kd+e42pK6y17N8SktSS5PgWesGbqs0bfBOBTeyMUPF94
	 K0XehwIy6qH9TpwCCygr65zRSzNHK4eLquqw0M3znNiV0Uw0Rv7i2ceXZ0YW1TLsD/A==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=maciej.szmigiero.name;
	spf=pass smtp.mailfrom=vps-ovh.mhejs.net;
	arc=none smtp.remote-ip=145.239.82.108
X-Received: from vps-ovh.mhejs.net (vps-ovh.mhejs.net [145.239.82.108])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1675C606A321
	for <netdev@vger.kernel.org>; Sat, 28 Nov 2026 15:04:56 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1675C606A321
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=maciej.szmigiero.name
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vps-ovh.mhejs.net
X-Received: from MUA
	by vps-ovh.mhejs.net with esmtpsa  (TLS1.3) tls TLS_AES_128_GCM_SHA256
	(Exim 4.100.1)
	(envelope-from <mhej@vps-ovh.mhejs.net>)
	id 1xXJyk-00000001Kto-1Qtd;
	Sat, 28 Nov 2026 16:04:42 +0100
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-User-Agent: Mozilla Thunderbird
X-Cc: netdev@vger.kernel.org, Loic Poulain <loic.poulain@oss.qualcomm.com>,
 Sergey Ryazanov <ryazanov.s.a@gmail.com>,
 Johannes Berg <johannes@sipsolutions.net>,
 Andrew Lunn <andrew+netdev@lunn.ch>, "David S. Miller"
 <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>,
 Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
X-Autocrypt: addr=mail@maciej.szmigiero.name; keydata=
 xsFNBFpGusUBEADXUMM2t7y9sHhI79+2QUnDdpauIBjZDukPZArwD+sDlx5P+jxaZ13XjUQc
 6oJdk+jpvKiyzlbKqlDtw/Y2Ob24tg1g/zvkHn8AVUwX+ZWWewSZ0vcwp7u/LvA+w2nJbIL1
 N0/QUUdmxfkWTHhNqgkNX5hEmYqhwUPozFR0zblfD/6+XFR7VM9yT0fZPLqYLNOmGfqAXlxY
 m8nWmi+lxkd/PYqQQwOq6GQwxjRFEvSc09m/YPYo9hxh7a6s8hAP88YOf2PD8oBB1r5E7KGb
 Fv10Qss4CU/3zaiyRTExWwOJnTQdzSbtnM3S8/ZO/sL0FY/b4VLtlZzERAraxHdnPn8GgxYk
 oPtAqoyf52RkCabL9dsXPWYQjkwG8WEUPScHDy8Uoo6imQujshG23A99iPuXcWc/5ld9mIo/
 Ee7kN50MOXwS4vCJSv0c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