From patchwork Thu May 30 15:25:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13680553 Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A92451E889 for ; Thu, 30 May 2024 15:25:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717082719; cv=none; b=qSRKaoqXjulMaqayzNtEV9/YO0KY97r8mTDKBVZwCpXcZsgEkcw+Ld9nGTXf7SEcZL5cedOxIkMrQUKUZ8AsdI3Jj576AtM1rnu6oRIET2wOw2wfD/2INCZDMRlB6rjp+s/YGchqD6r1avW7s4GwCu3KO90idm9U7MvdIpLmEUQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717082719; c=relaxed/simple; bh=S4Hn4878GXdPFYX+ym9FtHFg4twCjG6hOLsSQs1aQ8U=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ZlQfJUg5k3wGTiO2RHEm61uwrQcJJcx2FedFMj06M0IlmZfqGl9emhi6zJPAeSsi/PWAWnrlkJ6XDOuWh8UsnwIg91QTj7myC5HotvPBL+UC21vJhpunYGfPrOGOtz4YIG/GNwnzS8NnP3tTRH2JkZitHg3dsOzPg4EPIFgOGVo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=A0CnFcrV; arc=none smtp.client-ip=209.85.167.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="A0CnFcrV" Received: by mail-oi1-f176.google.com with SMTP id 5614622812f47-3d1d65a471aso540626b6e.1 for ; Thu, 30 May 2024 08:25:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717082716; x=1717687516; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=a7rU4PBn5KoGsoX8ivWOuaA2DyVF9qew4kW6t0L816Q=; b=A0CnFcrVRBbLJuA68LIBkU4d5JFhVBHik8Ye5NhfF6oYCl2G7XUv6QIlM0MfjKPWp0 oAqtNCLt6agpOC9HkKV4qBciQ7V0uS0eKqZYzcIpnifobdEmhILf9kNbCLTbev791KPi S37iv13XTOBd98jZKO5dlkfc3+y7TpdG58JTyg3N02TmMiBw3ODZATF/WI/eIJJZ4YQE 4rg7/Wd5mC0uheUiNJsnFxUDA/zJ7/8PjZoNPyBalXvpo/yl6+DOMdOqzZTFK7/ylQMG i2yrMuwdnwwwVhMh8nErld+YzuXr1nlTueZzZcQy3PLfuThBa1l3Xc/86WS8sxJvv1i+ PHtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717082716; x=1717687516; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=a7rU4PBn5KoGsoX8ivWOuaA2DyVF9qew4kW6t0L816Q=; b=PRFc65l6FH6U/+VFlQ+1OWAXYZz48WO4rxEIY85wdYjtBr3zIFPposGI6hutP386o/ 22Gc13ezYNlHPvA1Kw/T45tsrftIKtyhpbwuG/0FOwfZsyHpZBn+VZUZF8DkamD7TMAJ 3vi7/lrHnXC0ZpgcTRwiwH4Xh1qaUr8AfKn5weAjVEFw2arA7Wb1rcjEOy9v9UazeUFb TMvt0IXocGg1hI3c3hs7WAkMN/+vtrpX/7nNpXjXcvQyEbDwq+Q/F84JlfEtAM0H19ZB JHsARKWf+3d1XMBFxrMMmS9FjhOfDHgqI6P8+uCnFgy5+GpXYEUFvgy1m7Id+0amK0C4 Ztvw== X-Gm-Message-State: AOJu0Yxf1dR9r5yNUL+cfHrshQvOcJlIPjHLznkrCBn7iiQ3dn8M+qBU 78Z7Yp0uMHk0k140xeo3UmSjfe6Ah8GSZPicZqAg7qmAARKeOxHvZJNi/g== X-Google-Smtp-Source: AGHT+IHeCyTmHEkzrAS644GMFiq1FhqAF3wgJC6z5SZO7A4peFCYxNY3lMRY5E9GfxaixbBBAzcWWA== X-Received: by 2002:a05:6808:6246:b0:3c9:c4a3:41a0 with SMTP id 5614622812f47-3d1dccb9ab7mr2433954b6e.33.1717082716544; Thu, 30 May 2024 08:25:16 -0700 (PDT) Received: from localhost.localdomain (syn-070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3d1b36c1eeesm2017889b6e.23.2024.05.30.08.25.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 08:25:16 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior Subject: [PATCH 1/2] udevng: Don't crash for non-QMI devices Date: Thu, 30 May 2024 10:25:02 -0500 Message-ID: <20240530152513.279243-1-denkenz@gmail.com> X-Mailer: git-send-email 2.45.0 Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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); From patchwork Thu May 30 15:25:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kenzior X-Patchwork-Id: 13680554 Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7223C1EA84 for ; Thu, 30 May 2024 15:25:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717082719; cv=none; b=KmhvD0senU1TTarfgnONy5UI3Q5hQBjFkMNDnOOy83cOw4u3wytqbpBXHgypRbtoPUvxmwUtnp4JdskLF/xmwBMeRgspFwyvLSvE7xe3jCWBfEUv8J19vFKzrViRzf2+v9yWBTG6P+qpE47E4du76bJh97BLXAnnInJNX0JyJGg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717082719; c=relaxed/simple; bh=HkEZgaqAD97w5ZCrZHZrRaa8u8UJmQyYN5Bof3loaKI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S018QrEuqJxL7X+nbTPeWiFg/Vv08zP1n8kGEagu+1zMHTLuYCIAZ/jq7FBadbJX9t+3gQtGiS6VjYHAzDc+YG+Zot9RXNz7VHa1brmnD7i5I/A1pmei2nN47GrMl3tfeRvL3ss/4t4pjPpe1vfuzvGFaE6K+uWcrpAm7tZSHPo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=U3cJwfoN; arc=none smtp.client-ip=209.85.167.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="U3cJwfoN" Received: by mail-oi1-f179.google.com with SMTP id 5614622812f47-3d1b33e9ac6so515182b6e.1 for ; Thu, 30 May 2024 08:25:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717082717; x=1717687517; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=SAlq4X7UE2lFWDJuJQqAUZuWhAg2MFQ0l9yYqeRjFd8=; b=U3cJwfoN2IYaok9mOfehfRX20BWyiVG2fDxpTjzB2Yy8J58VxuWiwg9ds0xhbJgN+L kWKt7zeMpNmBx7kwqe6q07qw6c5Bjud80NToprTF9+4UzHeLSqLWGbOAOrK9HiJBwAZL kGzhV682Q5uIfICawD+q8lPzrhPgZ9Lcxt2VAfoVxOEuIrTLt4xYPwyuc9NsT9Z/9dQz 8mYPRKVfuO2uGc3631kvrQm+hYOncSW5JNpfMC04EYdxCii6bpigREtT1RxmtNCnFJ3r Sv/tFTet4VyFsV1VPeAYlPfj91r66M/EDR+zj6kAtkAYrowg3MY1mHNP0vAkI9jo9Hxi tOCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717082717; x=1717687517; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SAlq4X7UE2lFWDJuJQqAUZuWhAg2MFQ0l9yYqeRjFd8=; b=feZoX/9fG2N8Jj8mSH9QQWG97Px3Wt57Ytx+CxJvauhi+B07qhiWNisWzd30PRPcHe CKOwl1YsyLndLv4RWh+tTzL3w2g3fcVCtWATAWPrpue0cXm+P84+2xcHEFfQUK/mSI/X OpgTmslPUIHlEgOaICsTAHLotx77SxZkpVTC/lLIldK+Hu11mL2IyOfk20Bikvh3w/dB JpQpcbVSYPNTW6qFUob1a1YHpWMwYWnVIW6mmhnow5PjpSwuncmdWQWVz28JqmcFBUBB uQ1zpoB3qYgXgHQca4H9gY9c/QaqvIQ7L8+HMB+owHM1E5oS32fnE+KSYyXYOVr/ch3f utHg== X-Gm-Message-State: AOJu0YxcU0MhdHRsh7Zf1cQ1UNeKdzQHPJ/aS+OwwBp2D9RuhCI9MhqK do8GhonWJ6eKEXayDvCdZuVuN/g2rH7bk28lchMcZnpJqYGE1eO7q7uJAQ== X-Google-Smtp-Source: AGHT+IG/Nhr/DCEz3R/e0R9b9bP/VfO+7I9CJQsbwahfTqJfaWQCy4uLrECjbcPHtMLAzRt+vrtXuQ== X-Received: by 2002:a05:6808:1288:b0:3c8:4dc7:3963 with SMTP id 5614622812f47-3d1dd2be12dmr1104522b6e.13.1717082717276; Thu, 30 May 2024 08:25:17 -0700 (PDT) Received: from localhost.localdomain (syn-070-114-247-242.res.spectrum.com. [70.114.247.242]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3d1b36c1eeesm2017889b6e.23.2024.05.30.08.25.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 08:25:16 -0700 (PDT) From: Denis Kenzior To: ofono@lists.linux.dev Cc: Denis Kenzior , Ivaylo Dimitrov Subject: [PATCH 2/2] udevng: Fix detection of USB attached tty devices Date: Thu, 30 May 2024 10:25:03 -0500 Message-ID: <20240530152513.279243-2-denkenz@gmail.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240530152513.279243-1-denkenz@gmail.com> References: <20240530152513.279243-1-denkenz@gmail.com> Precedence: bulk X-Mailing-List: ofono@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 Tested-by: Ivaylo Dimitrov --- 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);