[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <90747682-22c6-4cb6-a6d1-3bef4aeab70e@gmail.com>
Date: Mon, 13 Oct 2025 01:55:28 +0300
From: Sergey Ryazanov <ryazanov.s.a@...il.com>
To: Daniele Palmas <dnlplm@...il.com>
Cc: Loic Poulain <loic.poulain@....qualcomm.com>,
Slark Xiao <slark_xiao@....com>, Muhammad Nuzaihan <zaihan@...ealasia.net>,
Johannes Berg <johannes@...solutions.net>,
Andrew Lunn <andrew+netdev@...n.ch>, Eric Dumazet <edumazet@...gle.com>,
"David S . Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org,
Qiang Yu <quic_qianyu@...cinc.com>, Manivannan Sadhasivam <mani@...nel.org>,
Johan Hovold <johan@...nel.org>
Subject: Re: [RFC PATCH v2 0/6] net: wwan: add NMEA port type support
Hi Daniele,
On 10/10/25 16:47, Daniele Palmas wrote:
> Il giorno mer 8 ott 2025 alle ore 23:00 Sergey Ryazanov
> <ryazanov.s.a@...il.com> ha scritto:
>> On 10/2/25 18:44, Loic Poulain wrote:
>>> On Tue, Sep 30, 2025 at 9:22 AM Daniele Palmas <dnlplm@...il.com> wrote:
>>> [...]
>>>> diff --git a/drivers/net/wwan/wwan_hwsim.c b/drivers/net/wwan/wwan_hwsim.c
>>>> index a748b3ea1602..e4b1bbff9af2 100644
>>>> --- a/drivers/net/wwan/wwan_hwsim.c
>>>> +++ b/drivers/net/wwan/wwan_hwsim.c
>>>> @@ -236,7 +236,7 @@ static void wwan_hwsim_nmea_emul_timer(struct timer_list *t)
>>>> /* 43.74754722298909 N 11.25759835922875 E in DMM format */
>>>> static const unsigned int coord[4 * 2] = { 43, 44, 8528, 0,
>>>> 11, 15, 4559, 0 };
>>>> - struct wwan_hwsim_port *port = from_timer(port, t, nmea_emul.timer);
>>>> + struct wwan_hwsim_port *port = timer_container_of(port, t,
>>>> nmea_emul.timer);
>>>>
>>>> it's basically working fine in operative mode though there's an issue
>>>> at the host shutdown, not able to properly terminate.
>>>>
>>>> Unfortunately I was not able to gather useful text logs besides the picture at
>>>>
>>>> https://drive.google.com/file/d/13ObWikuiMMUENl2aZerzxFBg57OB1KNj/view?usp=sharing
>>>>
>>>> showing an oops with the following call stack:
>>>>
>>>> __simple_recursive_removal
>>>> preempt_count_add
>>>> __pfx_remove_one
>>>> wwan_remove_port
>>>> mhi_wwan_ctrl_remove
>>>> mhi_driver_remove
>>>> device_remove
>>>> device_del
>>>>
>>>> but the issue is systematic. Any idea?
>>>>
>>>> At the moment I don't have the time to debug this deeper, I don't even
>>>> exclude the chance that it could be somehow related to the modem. I
>>>> would like to further look at this, but I'm not sure exactly when I
>>>> can....
>>>
>>> Thanks a lot for testing, Sergey, do you know what is wrong with port removal?
>>
>> Daniele, thanks a lot for verifying the proposal on a real hardware and
>> sharing the build fix.
>>
>> Unfortunately, I unable to reproduce the crash. I have tried multiple
>> times to reboot a VM running the simulator module even with opened GNSS
>> device. No luck. It reboots and shutdowns smoothly.
>>
>
> I've probably figured out what's happening.
>
> The problem seems that the gnss device is not considered a wwan_child
> by is_wwan_child and this makes device_unregister in wwan_remove_dev
> to be called twice.
>
> For testing I've overwritten the gnss device class with the following hack:
>
> diff --git a/drivers/net/wwan/wwan_core.c b/drivers/net/wwan/wwan_core.c
> index 4d29fb8c16b8..32b3f7c4a402 100644
> --- a/drivers/net/wwan/wwan_core.c
> +++ b/drivers/net/wwan/wwan_core.c
> @@ -599,6 +599,7 @@ static int wwan_port_register_gnss(struct wwan_port *port)
> gnss_put_device(gdev);
> return err;
> }
> + gdev->dev.class = &wwan_class;
>
> dev_info(&wwandev->dev, "port %s attached\n", dev_name(&gdev->dev));
>
> and now the system powers off without issues.
>
> So, not sure how to fix it properly, but at least does the analysis
> make sense to you?
Nice catch! I had a doubt regarding correct child port detection. Let me
double check, and thank you for pointing me to the possible source of
issues.
--
Sergey
Powered by blists - more mailing lists