[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <40f27470.6281.19ab4a6d782.Coremail.slark_xiao@163.com>
Date: Mon, 24 Nov 2025 14:57:04 +0800 (CST)
From: "Slark Xiao" <slark_xiao@....com>
To: "Loic Poulain" <loic.poulain@....qualcomm.com>
Cc: "Sergey Ryazanov" <ryazanov.s.a@...il.com>,
"Daniele Palmas" <dnlplm@...il.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:Re: Re: [RFC PATCH v2 0/6] net: wwan: add NMEA port type support
At 2025-11-19 19:27:49, "Loic Poulain" <loic.poulain@....qualcomm.com> wrote:
>Hi Slark,
>
>On Fri, Nov 14, 2025 at 8:08 AM Slark Xiao <slark_xiao@....com> wrote:
>>
>>
>> At 2025-10-13 06:55:28, "Sergey Ryazanov" <ryazanov.s.a@...il.com> wrote:
>> >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
>>
>> Hi Sergey,
>> Sorry for bothering this thread again.
>> Do we have any updates on this potential issue? If this issue is not a big problem,
>> Could we commit these patches into a branch then every one could help debug
>> it based on this base code?
>> I think we shall have a base to develop. No code is perfect.
>
>We shouldn’t merge a series that is known to be broken or causes
>crashes. However, based on Daniele’s feedback, the series can be
>fixed.
>
>You can check the tentative fix here:
>https://github.com/loicpoulain/linux/commits/wwan/pending
>This branch includes Sergey’s patch from the mailing list along with a
>proposed fix.
>
>If you can test it on your side, that would be very helpful.
>
I will have a try based on this branch on our products.
Let's stay in touch.
>Also, it’s fine to resubmit the corrected series without the RFC tag,
>as long as you keep Sergey as the original author.
>
>Regards,
>Loic
Powered by blists - more mailing lists