Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1150272rdb; Fri, 1 Dec 2023 08:13:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IEMZi0gwMqgMEJ+HfHTY0DxGDLwzVqrUDkmPbpRXTdtI0CCTG2cocB09nVNhtMsC0a6hcps X-Received: by 2002:a17:902:e852:b0:1cf:fa41:ae66 with SMTP id t18-20020a170902e85200b001cffa41ae66mr13807672plg.7.1701447209480; Fri, 01 Dec 2023 08:13:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701447209; cv=none; d=google.com; s=arc-20160816; b=h5sGt2tjl4Vb1ew3To1xBnqjDKmLWSxr8syVUP4KH95t3pM2SJ5+CXgeILGafjUD5A YskPxZd1i5HHiksTEQyQnfCv6+S7pSq4JdXmGBLIgHoSKBRFdpbvSOSi2Hj7nLyU2zGr alp3L1khN6N2bZxBYFYeVCz8t7OxvE6WMFLUqbAL9WeOMa9HQR3fwRY4NVitTreej/v8 9U/QRIKed8vl73b0G6PDVV6obhKqwPLgs4O9ZBxC9dlAyQACDCEZ6xmDbTfmBJTHhbYP KOCFfnaa7Xy6iWwwauC00gDQ+wC1Wx2umvP6FSOqQkOB3VDDsrjyoxlbT0T/uH+jogJ0 jkcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=N6dkrssK5YDM3E/nkMQ4XrP0Y/x6njkScsujOrPp6rA=; fh=B0PVeMVslGUEzGB3+8SIClZTYdU8tIViPDl9zDMvs7k=; b=v/JgRzRjkWawKSPag5L9C88bCPVnOSLecN9CIrMXcEBtCel0ua8hID16+dv2RGn0BC 0WQHLWLXN2OrVLuykGPo3IY5YPpv1T+3TZ59VJ4/7AkFxCEEo+HoNh8Njm6+0vhLJm4f R+k7G7z2XeybxunHVqtNTC6HIzXMTLT0jiBdEAOVWYMFzknClFNgW9lfiCOXwpiRF9sm pFgpkrqggZB19YqGjTtpou6ZdWFurm60b1k7Y8yWjM6TWiIBsmLiRUkJkZPT7auzefpD gWKVuRvzZHlnY94Z8V3kIHkys8u/aujOJV8HAZ8BLKuIi2c1+AAZweR2KhSD1oU2elK3 cFuA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id x12-20020a65414c000000b0058afac51c12si3528510pgp.545.2023.12.01.08.13.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 08:13:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 39CC083D51FE; Fri, 1 Dec 2023 08:13:17 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378023AbjLAQNE (ORCPT + 99 others); Fri, 1 Dec 2023 11:13:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbjLAQND (ORCPT ); Fri, 1 Dec 2023 11:13:03 -0500 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 63476B2 for ; Fri, 1 Dec 2023 08:13:09 -0800 (PST) Received: (qmail 291284 invoked by uid 1000); 1 Dec 2023 11:13:08 -0500 Date: Fri, 1 Dec 2023 11:13:08 -0500 From: Alan Stern To: Jose Ignacio Tornos Martinez Cc: greg@kroah.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, netdev@vger.kernel.org, oneukum@suse.com, pabeni@redhat.com, stable@vger.kernel.org Subject: Re: [PATCH v3] net: usb: ax88179_178a: avoid failed operations when device is disconnected Message-ID: <140e912f-8702-4e85-8d6c-ef0255e718f8@rowland.harvard.edu> References: <2023120130-repair-tackle-698e@gregkh> <20231201132647.178979-1-jtornosm@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231201132647.178979-1-jtornosm@redhat.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Fri, 01 Dec 2023 08:13:17 -0800 (PST) On Fri, Dec 01, 2023 at 02:26:47PM +0100, Jose Ignacio Tornos Martinez wrote: > When the device is disconnected we get the following messages showing > failed operations: > Nov 28 20:22:11 localhost kernel: usb 2-3: USB disconnect, device number 2 > Nov 28 20:22:11 localhost kernel: ax88179_178a 2-3:1.0 enp2s0u3: unregister 'ax88179_178a' usb-0000:02:00.0-3, ASIX AX88179 USB 3.0 Gigabit Ethernet > Nov 28 20:22:11 localhost kernel: ax88179_178a 2-3:1.0 enp2s0u3: Failed to read reg index 0x0002: -19 > Nov 28 20:22:11 localhost kernel: ax88179_178a 2-3:1.0 enp2s0u3: Failed to write reg index 0x0002: -19 > Nov 28 20:22:11 localhost kernel: ax88179_178a 2-3:1.0 enp2s0u3 (unregistered): Failed to write reg index 0x0002: -19 > Nov 28 20:22:11 localhost kernel: ax88179_178a 2-3:1.0 enp2s0u3 (unregistered): Failed to write reg index 0x0001: -19 > Nov 28 20:22:11 localhost kernel: ax88179_178a 2-3:1.0 enp2s0u3 (unregistered): Failed to write reg index 0x0002: -19 > > The reason is that although the device is detached, normal stop and > unbind operations are commanded from the driver. These operations are > not necessary in this situation, so avoid these logs when the device is > detached if the result of the operation is -ENODEV and if the new flag > informing about the stopping or unbind operation is enabled. > > cc: stable@vger.kernel.org > Fixes: e2ca90c276e1f ("ax88179_178a: ASIX AX88179_178A USB 3.0/2.0 to gigabit ethernet adapter driver") > Signed-off-by: Jose Ignacio Tornos Martinez > @@ -242,7 +245,7 @@ static int __ax88179_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index, > ret = fn(dev, cmd, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, > value, index, data, size); > > - if (unlikely(ret < 0)) > + if (unlikely(ret < 0 && !(ret == -ENODEV && ax179_data->stopping_unbinding))) Would it be good enough just to check for ret != -ENODEV and not do the stopping_unbinding check at all? Alan Stern