Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1918476rdb; Thu, 7 Dec 2023 12:23:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IEQ3FeUx6SDVaKtux79J6jzZeip16rD2rRg/DW16vHWV97CXo3hLHHN+rTe2A2XuTnyl5Ls X-Received: by 2002:a17:902:7612:b0:1d0:6ffd:9e34 with SMTP id k18-20020a170902761200b001d06ffd9e34mr2735596pll.134.1701980621282; Thu, 07 Dec 2023 12:23:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701980621; cv=none; d=google.com; s=arc-20160816; b=xzRM1k2E+U5whUsu6rElm++wEa6ys3TiL0/t4zKKwwd/mpNacNsE+xcp02gq51MGQS yChkDbkw6oJ9XO/7K5cu1gX7SIz11C9DlTFegxxCGWE4UjT0GAQkHrLTsSdrhvGfmRuK loWqq+aev7pU4KsavoTz+4KzcWUtEaw//ZOD6xId6i3frtJtrfda69CW9NSWf5ti9uQy 3QEvKlVhQgw7AYlUGujRtI6ZfLrVmZufO1ePyIzP5AtJcsBnQKqZ3MKHkSXMuBKwjIfW LR9uZmhlK4GKFp7q4l5PmKw53jnU1pq9ItN1AXWeG91foUFvXf4kAFyMbGhublwHgbT+ +wNw== 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=kiguQY+JstElEu7687WJCrte5EZJcV32+b2ypeIRV2s=; fh=DEg0UxC1d14Zn7bDFrylmesiAp5RmAQ6lmL1Ly3ACjc=; b=Zvln8iwaP7Q51BoETdvZXCU1AwN41jXgVA3qMRUvNNpUmwlw4v6IHRjymERcekG6Gg oAJCvkRBW7aTCzQfA8WWJGyhSf4Dwecilp6MuF4k6AcFU+uqTuUF9oB8ODvdlAgGy63S 4UwccW0xa33Nxgxi8A1yIdynzxb35sBQ1AYoODwFqk+DpDRUdhgk4Uz2w2yAMn8GVMYq VqjJdN5y7YhYvxdwIia0Nt6mjm7hwLCB5HpsXA4f6/ikhfp9JSH/+nDpzy96PI1Em8r+ djyDA4a3Hqvz7hmKJucHAYfEUnaLwkqc1AmvpNwYk9aWMt0nvIv4XXcInvOXq6+vb22Q EpZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id l12-20020a170902d34c00b001c566ea86eesi292593plk.177.2023.12.07.12.23.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 12:23:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 86E94805B07F; Thu, 7 Dec 2023 12:23:38 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233115AbjLGUXT (ORCPT + 99 others); Thu, 7 Dec 2023 15:23:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229541AbjLGUXS (ORCPT ); Thu, 7 Dec 2023 15:23:18 -0500 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id E810F1713 for ; Thu, 7 Dec 2023 12:23:23 -0800 (PST) Received: (qmail 18390 invoked by uid 1000); 7 Dec 2023 15:23:23 -0500 Date: Thu, 7 Dec 2023 15:23:23 -0500 From: Alan Stern To: Jose Ignacio Tornos Martinez Cc: davem@davemloft.net, edumazet@google.com, greg@kroah.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 v6] net: usb: ax88179_178a: avoid failed operations when device is disconnected Message-ID: References: <0bd3204e-19f4-48de-b42e-a75640a1b1da@rowland.harvard.edu> <20231207175007.263907-1-jtornosm@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231207175007.263907-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 groat.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 (groat.vger.email [0.0.0.0]); Thu, 07 Dec 2023 12:23:38 -0800 (PST) On Thu, Dec 07, 2023 at 06:50:07PM +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 disconnecting status 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 > --- > V1 -> V2: > - Follow the suggestions from Alan Stern and Oliver Neukum to check the > result of the operations (-ENODEV) and not the internal state of the USB > layer (USB_STATE_NOTATTACHED). > V2 -> V3 > - Add cc: stable line in the signed-off-by area. > V3 -> V4 > - Follow the suggestions from Oliver Neukum to use only one flag when > disconnecting and include barriers to avoid memory ordering issues. > V4 -> V5 > - Fix my misundestanding and follow the suggestion from Alan Stern to > syncronize and not order the flag. > V5 -> V6 > - Remove the unnecessary mutex. Thank you Alan for your teaching and > patience! Acked-by: Alan Stern