Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2757764rwl; Thu, 13 Apr 2023 10:24:04 -0700 (PDT) X-Google-Smtp-Source: AKy350afTZp8toTrvb/PfckXgf8KlN4HV+kIHh3g0E4TNB/ISDXbIJdF6gukk4CzF/phgfSK5HuZ X-Received: by 2002:a05:6a20:4f25:b0:d8:161e:46 with SMTP id gi37-20020a056a204f2500b000d8161e0046mr2886413pzb.58.1681406643838; Thu, 13 Apr 2023 10:24:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681406643; cv=none; d=google.com; s=arc-20160816; b=VIFLgp4ZW55zibbPxbXE1KYbCikILJvx79xeGXYZ2MZbCkYkFz0IQmw8jGbeJZ7Sba tGzF0oBunSUx/sEqDaz/2KxNHddBaNFwaQ6uKYG6Sfp1esgo4rMYnmU5lHXhkYh9AOvg pVTOdauKOA8x909ZCvVgKWisymjb+OhADDsPcUmaAtzdYKjMmyR6tk06Wgjara3LMiEz VcJlxdd1LL5s/7Tg+2Vs30BoqT6Wp6mcX2lD8jC4rzFhb/jQ0UWep+ctS/kfrBGChzKW 409T4USvidCKkXC4aF5GgjPUQCoDk/QL5D6WcjuAIGcDU195hVGmfIHu9SPBInt4MUgl cPQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=LSXwkXBchEWpt1wH2gWLxy2J6syLDyFSqFiB87bgTpo=; b=EHdk9hbzJ2I7+IfyjfXlEc3ujwFLI1t5W+XAA8UM9fG7NpfFeryjqIYi86BoIYqVCt MlebOAW0O9d0ciJ0wHKturv1aOG6+wTLXPx/q9cNngwwlTi5XXcxjUGe2Qyr9pRPk0bO bKjwAeAwVbNriy3PXNxc083wUj/RXAX477d8VltDuh/EXyuT1J/CXa6pemRP4lvoNcEO 7Q6hRd1L6gb3kniHVASH1OeBSenN+buDh+OjNCrMwqDr4FN/Y8lZVYwu1j+SJS8Av+/c 97im6BcJN18CAiWgyL2ErgdEG6ntxn5jADMYaksX9W+asLW1AX8sAetD0O2dNeWWLHIG uZ/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jEmtFVkU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t3-20020a63f343000000b00517a65a29a4si2640951pgj.240.2023.04.13.10.23.49; Thu, 13 Apr 2023 10:24:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jEmtFVkU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230092AbjDMRNB (ORCPT + 99 others); Thu, 13 Apr 2023 13:13:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230099AbjDMRNA (ORCPT ); Thu, 13 Apr 2023 13:13:00 -0400 Received: from mail-oa1-x2e.google.com (mail-oa1-x2e.google.com [IPv6:2001:4860:4864:20::2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F8606592 for ; Thu, 13 Apr 2023 10:12:57 -0700 (PDT) Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-1878504c22aso5178563fac.8 for ; Thu, 13 Apr 2023 10:12:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681405977; x=1683997977; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=LSXwkXBchEWpt1wH2gWLxy2J6syLDyFSqFiB87bgTpo=; b=jEmtFVkUS3Ob3wdx5Jrd1VDyz8/zN9P1pb+U/syVnZMxt3VAyIcBlrMSaWOo5N2XTh 9BphMJwTvf4Jw0q2Do8IR+8Mkskrq1hhUJev4swSH1fHyZW1eSgU2fOZ/NxITwM1p3mR 2hqKOQ/DA3hX90PiumR0wh90Eb6F5hZzbkvq45dG/aN4DjLrtHADmGTlGfzBmWf16QMR 2cWcZMHA6VAkY4ZwxN06j8ZZ8qf1+wK7IxGC2IaWDYmpd0AqeojYXSS1iyR+Xiicvlfi GbBQ4RR2o9CtasPVMsT8l89a0+cMnIx72nkLVUJGAl6teGrRgxJUub9h3BGXFThu7XK0 o2Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681405977; x=1683997977; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LSXwkXBchEWpt1wH2gWLxy2J6syLDyFSqFiB87bgTpo=; b=g3VWLcNdJocwklfzpVgkkHaNCWrVObfAw8L5qSt8TCMpEU++n08309QGjloWZqebws AC2w9RHk5TUUxL0dnQOKgohKZU4IW+NK+8Bj0PNZs4zLaPjbm02NZZzDtnzP0OspqvPQ DdF7ZKKjcpwttKcy+4l8LlWx7++ZXqNbKEUYKXPNVY4EE+Hmoq+PpJU3DZt87/bUZ4rl JjKBdOWtKdrCINMDFQ0g2tyxT7yPXPjvIMxThMxQ7yzl6R/7bVU+WbT9PjLDCUsxbzWT w45ER/jP85As33cz4wstyIadmkH17r9e+P1LuyLv3SMSkBr4wq1Uu8F35MZ/CBIBbr4+ jKUQ== X-Gm-Message-State: AAQBX9e085Ont6GVmpX1cNHyp1EeK5SdAQmwd5hHHIEt73AxiYGBnwYm hR5X7vuLGzJSHGVtsJ2SmCvX5FoNV5/xvF54+JJqdg== X-Received: by 2002:a05:6870:40d3:b0:187:88f8:e9b5 with SMTP id l19-20020a05687040d300b0018788f8e9b5mr1581575oal.6.1681405976861; Thu, 13 Apr 2023 10:12:56 -0700 (PDT) MIME-Version: 1.0 References: <20230412114402.1119956-1-slark_xiao@163.com> <5372bdf6.533d.1877981651f.Coremail.slark_xiao@163.com> In-Reply-To: <5372bdf6.533d.1877981651f.Coremail.slark_xiao@163.com> From: Loic Poulain Date: Thu, 13 Apr 2023 19:12:20 +0200 Message-ID: Subject: Re: Re: [PATCH net] wwan: core: add print for wwan port attach/disconnect To: Slark Xiao Cc: ryazanov.s.a@gmail.com, johannes@sipsolutions.net, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 13 Apr 2023 at 09:26, Slark Xiao wrote: > > At 2023-04-13 15:07:21, "Loic Poulain" wrote: > >On Wed, 12 Apr 2023 at 13:45, Slark Xiao wrote: > >> > >> Refer to USB serial device or net device, there is notice to > >> let end user know the status of device, like attached or > >> disconnected. Add attach/disconnect print for wwan device as > >> well. This change works for MHI device and USB device. > > > >This change works for wwan port devices, whatever the bus is. > > > Sure. Since wwan support USB device as well after integrating > WWAN framework into cdc-wdm. > >> > >> Signed-off-by: Slark Xiao > >> --- > >> drivers/net/wwan/wwan_core.c | 5 +++++ > >> 1 file changed, 5 insertions(+) > >> > >> diff --git a/drivers/net/wwan/wwan_core.c b/drivers/net/wwan/wwan_core.c > >> index 2e1c01cf00a9..d3ac6c5b0b26 100644 > >> --- a/drivers/net/wwan/wwan_core.c > >> +++ b/drivers/net/wwan/wwan_core.c > >> @@ -492,6 +492,8 @@ struct wwan_port *wwan_create_port(struct device *parent, > >> if (err) > >> goto error_put_device; > >> > >> + dev_info(&wwandev->dev, "%s converter now attached to %s\n", > >> + wwan_port_dev_type.name, port->dev.kobj.name); > > > >You should use `dev_name()` instead of direct reference to kobj. > > > Will update this in v2. > >Why 'converter' ? If you really want to print, it should be something like: > >wwan0: wwan0at1 port attached > This refer to USB device attached info: > 696.444511] usb 2-3: GSM modem (1-port) converter now attached to ttyUSB0 > [ 696.444877] usb 2-3: GSM modem (1-port) converter now attached to ttyUSB1 > [ 696.445065] usb 2-3: GSM modem (1-port) converter now attached to ttyUSB2 > currently, we will print it as below with above patch: > [ 233.192123] wwan wwan0: wwan_port converter now attached to wwan0mbim0 > [ 694.530781] wwan wwan0: wwan_port converter now disconnected from wwan0mbim0 Ok, but we don't have to mimic USB, and it's not a converter, keep that simple (e.g. 'port %s attached'). Regards, Loic