All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] udevng: Don't crash for non-QMI devices
@ 2024-05-30 15:25 Denis Kenzior
  2024-05-30 15:25 ` [PATCH 2/2] udevng: Fix detection of USB attached tty devices Denis Kenzior
  2024-05-31 19:30 ` [PATCH 1/2] udevng: Don't crash for non-QMI devices patchwork-bot+ofono
  0 siblings, 2 replies; 6+ messages in thread
From: Denis Kenzior @ 2024-05-30 15:25 UTC (permalink / raw)
  To: ofono; +Cc: Denis Kenzior

In cases where the modem detected isn't QMI, do not crash when trying to
print the qmi devnode.

ofonod[278551]: Aborting (signal 11) [src/ofonod]
ofonod[278551]: ++++++++ backtrace ++++++++
ofonod[278551]: #0  0x7a779c5cbe20 in /usr/lib/libc.so.6
ofonod[278551]: #1  0x413470 in setup_sierra() at plugins/udevng.c:497
ofonod[278551]: #2  0x410a67 in create_modem() at plugins/udevng.c:2557
ofonod[278551]: #3  0x7a779c80b551 in /usr/lib/libglib-2.0.so.0
ofonod[278551]: #4  0x41955f in check_modem_list() at plugins/udevng.c:2626
ofonod[278551]: #5  0x7a779c81f43e in /usr/lib/libglib-2.0.so.0
ofonod[278551]: #6  0x7a779c81e199 in /usr/lib/libglib-2.0.so.0
ofonod[278551]: #7  0x7a779c87d3bf in /usr/lib/libglib-2.0.so.0
ofonod[278551]: #8  0x7a779c81edc7 in /usr/lib/libglib-2.0.so.0
ofonod[278551]: #9  0x5291e6 in main() at src/main.c:316
ofonod[278551]: #10 0x7a779c5b4d4a in /usr/lib/libc.so.6
ofonod[278551]: #11 0x7a779c5b4e0c in /usr/lib/libc.so.6
ofonod[278551]: +++++++++++++++++++++++++++
---
 plugins/udevng.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/plugins/udevng.c b/plugins/udevng.c
index d3ce3d5b3f7c..07c87eb8aa08 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -495,7 +495,8 @@ static gboolean setup_sierra(struct modem_info *modem)
 					get_ifname(net));
 done:
 	DBG("modem=%s app=%s net=%s diag=%s qmi=%s",
-			mdm, app, get_ifname(net), diag, qmi->devnode);
+			mdm, app, get_ifname(net), diag,
+			qmi ? qmi->devnode : NULL);
 
 	ofono_modem_set_string(modem->modem, "Modem", mdm);
 	ofono_modem_set_string(modem->modem, "App", app);
@@ -574,7 +575,7 @@ static gboolean setup_huawei(struct modem_info *modem)
 					get_ifname(net));
 done:
 	DBG("mdm=%s pcui=%s diag=%s qmi=%s net=%s",
-		mdm, pcui, diag, qmi->devnode, get_ifname(net));
+		mdm, pcui, diag, qmi ? qmi->devnode : NULL, get_ifname(net));
 
 	ofono_modem_set_string(modem->modem, "Modem", mdm);
 	ofono_modem_set_string(modem->modem, "Pcui", pcui);
-- 
2.45.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] udevng: Fix detection of USB attached tty devices
  2024-05-30 15:25 [PATCH 1/2] udevng: Don't crash for non-QMI devices Denis Kenzior
@ 2024-05-30 15:25 ` Denis Kenzior
  2024-05-31  6:09   ` Ivaylo Dimitrov
  2024-05-31 19:30 ` [PATCH 1/2] udevng: Don't crash for non-QMI devices patchwork-bot+ofono
  1 sibling, 1 reply; 6+ messages in thread
From: Denis Kenzior @ 2024-05-30 15:25 UTC (permalink / raw)
  To: ofono; +Cc: Denis Kenzior, Ivaylo Dimitrov

devices on the USB bus, that are part of the tty subsystem were not
forwarded to check_usb_device.

Fixes: cdd58360140a ("udevng: Add mhi subsystem detection")
Reported-By: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
---
 plugins/udevng.c | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/plugins/udevng.c b/plugins/udevng.c
index 07c87eb8aa08..87969461ac5b 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -2510,17 +2510,16 @@ static void check_device(struct udev_device *device)
 	const char *subsystem = udev_device_get_subsystem(device);
 	const char *bus = udev_device_get_property_value(device, "ID_BUS");
 
-	if (l_streq0(subsystem, "net")) {
-		/* Handle USB-connected network devices in check_usb_device */
-		if (l_streq0(bus, "usb"))
-			check_usb_device(device);
-		else
-			check_net_device(device);
-
+	/* Handle USB-connected devices in check_usb_device */
+	if (l_streq0(bus, "usb")) {
+		check_usb_device(device);
 		return;
 	}
 
-	if (l_streq0(subsystem, "usb") || l_streq0(subsystem, "usbmisc"))
+	/* Check the rest based on the subsystem */
+	if (l_streq0(subsystem, "net"))
+		check_net_device(device);
+	else if (l_streq0(subsystem, "usbmisc"))
 		check_usb_device(device);
 	else if (l_streq0(subsystem, "pci"))
 		check_pci_device(device);
-- 
2.45.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] udevng: Fix detection of USB attached tty devices
  2024-05-30 15:25 ` [PATCH 2/2] udevng: Fix detection of USB attached tty devices Denis Kenzior
@ 2024-05-31  6:09   ` Ivaylo Dimitrov
  2024-05-31 15:52     ` Denis Kenzior
  0 siblings, 1 reply; 6+ messages in thread
From: Ivaylo Dimitrov @ 2024-05-31  6:09 UTC (permalink / raw)
  To: Denis Kenzior, ofono

Hi,

On 30.05.24 г. 18:25 ч., Denis Kenzior wrote:
> devices on the USB bus, that are part of the tty subsystem were not
> forwarded to check_usb_device.
> 
> Fixes: cdd58360140a ("udevng: Add mhi subsystem detection")
> Reported-By: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
> ---
>   plugins/udevng.c | 15 +++++++--------
>   1 file changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/plugins/udevng.c b/plugins/udevng.c
> index 07c87eb8aa08..87969461ac5b 100644
> --- a/plugins/udevng.c
> +++ b/plugins/udevng.c
> @@ -2510,17 +2510,16 @@ static void check_device(struct udev_device *device)
>   	const char *subsystem = udev_device_get_subsystem(device);
>   	const char *bus = udev_device_get_property_value(device, "ID_BUS");
>   
> -	if (l_streq0(subsystem, "net")) {
> -		/* Handle USB-connected network devices in check_usb_device */
> -		if (l_streq0(bus, "usb"))
> -			check_usb_device(device);
> -		else
> -			check_net_device(device);
> -
> +	/* Handle USB-connected devices in check_usb_device */
> +	if (l_streq0(bus, "usb")) {
> +		check_usb_device(device);
>   		return;
>   	}
>   
> -	if (l_streq0(subsystem, "usb") || l_streq0(subsystem, "usbmisc"))

Is it possible (in theory) that we have 'usb' subsystem device that is 
not on USB bus? If yes, then you shouldn't drop l_streq0(subsystem, 
"usb") check.

> +	/* Check the rest based on the subsystem */
> +	if (l_streq0(subsystem, "net"))
> +		check_net_device(device);
> +	else if (l_streq0(subsystem, "usbmisc"))
>   		check_usb_device(device);
>   	else if (l_streq0(subsystem, "pci"))
>   		check_pci_device(device);
> 

Regards,
Ivo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] udevng: Fix detection of USB attached tty devices
  2024-05-31  6:09   ` Ivaylo Dimitrov
@ 2024-05-31 15:52     ` Denis Kenzior
  2024-05-31 17:27       ` Ivaylo Dimitrov
  0 siblings, 1 reply; 6+ messages in thread
From: Denis Kenzior @ 2024-05-31 15:52 UTC (permalink / raw)
  To: Ivaylo Dimitrov, ofono

Hi Ivo,

>> -
>> +    /* Handle USB-connected devices in check_usb_device */
>> +    if (l_streq0(bus, "usb")) {
>> +        check_usb_device(device);
>>           return;
>>       }
>> -    if (l_streq0(subsystem, "usb") || l_streq0(subsystem, "usbmisc"))
> 
> Is it possible (in theory) that we have 'usb' subsystem device that is not on 
> USB bus? If yes, then you shouldn't drop l_streq0(subsystem, "usb") check.

I hope not.  What i've seen is subsystem 'usbmisc' devices not setting ID_BUS to 
'usb', which is a bit weird.  Hence the 'usbmisc' check below.

I think we do not care about usb subsystem devices, only the leafs:
	- usbmisc (cdc-acm)
	- tty (ttyUSB...)
	- net

Regards,
-Denis

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] udevng: Fix detection of USB attached tty devices
  2024-05-31 15:52     ` Denis Kenzior
@ 2024-05-31 17:27       ` Ivaylo Dimitrov
  0 siblings, 0 replies; 6+ messages in thread
From: Ivaylo Dimitrov @ 2024-05-31 17:27 UTC (permalink / raw)
  To: Denis Kenzior, ofono

Hi Denis,

On 31.05.24 г. 18:52 ч., Denis Kenzior wrote:
> Hi Ivo,
> 
>>> -
>>> +    /* Handle USB-connected devices in check_usb_device */
>>> +    if (l_streq0(bus, "usb")) {
>>> +        check_usb_device(device);
>>>           return;
>>>       }
>>> -    if (l_streq0(subsystem, "usb") || l_streq0(subsystem, "usbmisc"))
>>
>> Is it possible (in theory) that we have 'usb' subsystem device that is 
>> not on USB bus? If yes, then you shouldn't drop l_streq0(subsystem, 
>> "usb") check.
> 
> I hope not.  What i've seen is subsystem 'usbmisc' devices not setting 
> ID_BUS to 'usb', which is a bit weird.  Hence the 'usbmisc' check below.
> 
> I think we do not care about usb subsystem devices, only the leafs:
>      - usbmisc (cdc-acm)
>      - tty (ttyUSB...)
>      - net
> 

I see. Well, the $subject patch is fixing my USB Quectel not being 
recognized, so in case tags are used, you can add my:

Tested-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>

Thanks and regards,
Ivo


P.S. It is not that I forgot about call forwarding API change, it is 
just that I was very busy with my RL job. Will implement it as soon as I 
have few spare days.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] udevng: Don't crash for non-QMI devices
  2024-05-30 15:25 [PATCH 1/2] udevng: Don't crash for non-QMI devices Denis Kenzior
  2024-05-30 15:25 ` [PATCH 2/2] udevng: Fix detection of USB attached tty devices Denis Kenzior
@ 2024-05-31 19:30 ` patchwork-bot+ofono
  1 sibling, 0 replies; 6+ messages in thread
From: patchwork-bot+ofono @ 2024-05-31 19:30 UTC (permalink / raw)
  To: Denis Kenzior; +Cc: ofono

Hello:

This series was applied to ofono.git (master)
by Denis Kenzior <denkenz@gmail.com>:

On Thu, 30 May 2024 10:25:02 -0500 you wrote:
> In cases where the modem detected isn't QMI, do not crash when trying to
> print the qmi devnode.
> 
> ofonod[278551]: Aborting (signal 11) [src/ofonod]
> ofonod[278551]: ++++++++ backtrace ++++++++
> ofonod[278551]: #0  0x7a779c5cbe20 in /usr/lib/libc.so.6
> ofonod[278551]: #1  0x413470 in setup_sierra() at plugins/udevng.c:497
> ofonod[278551]: #2  0x410a67 in create_modem() at plugins/udevng.c:2557
> ofonod[278551]: #3  0x7a779c80b551 in /usr/lib/libglib-2.0.so.0
> ofonod[278551]: #4  0x41955f in check_modem_list() at plugins/udevng.c:2626
> ofonod[278551]: #5  0x7a779c81f43e in /usr/lib/libglib-2.0.so.0
> ofonod[278551]: #6  0x7a779c81e199 in /usr/lib/libglib-2.0.so.0
> ofonod[278551]: #7  0x7a779c87d3bf in /usr/lib/libglib-2.0.so.0
> ofonod[278551]: #8  0x7a779c81edc7 in /usr/lib/libglib-2.0.so.0
> ofonod[278551]: #9  0x5291e6 in main() at src/main.c:316
> ofonod[278551]: #10 0x7a779c5b4d4a in /usr/lib/libc.so.6
> ofonod[278551]: #11 0x7a779c5b4e0c in /usr/lib/libc.so.6
> ofonod[278551]: +++++++++++++++++++++++++++
> 
> [...]

Here is the summary with links:
  - [1/2] udevng: Don't crash for non-QMI devices
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=d5daaeda9d19
  - [2/2] udevng: Fix detection of USB attached tty devices
    https://git.kernel.org/pub/scm/network/ofono/ofono.git/?id=ddb637fb784a

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-05-31 19:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-30 15:25 [PATCH 1/2] udevng: Don't crash for non-QMI devices Denis Kenzior
2024-05-30 15:25 ` [PATCH 2/2] udevng: Fix detection of USB attached tty devices Denis Kenzior
2024-05-31  6:09   ` Ivaylo Dimitrov
2024-05-31 15:52     ` Denis Kenzior
2024-05-31 17:27       ` Ivaylo Dimitrov
2024-05-31 19:30 ` [PATCH 1/2] udevng: Don't crash for non-QMI devices patchwork-bot+ofono

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.