Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2639840rdb; Mon, 4 Dec 2023 03:31:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IF9AHohT2GOTtOMYIOcRS/4Yj3UZLYyXvj1egx3yPHekMcQh3XVPH8mTWnA1AAXe820lsJh X-Received: by 2002:a17:90a:1984:b0:286:6cc0:b90a with SMTP id 4-20020a17090a198400b002866cc0b90amr1121953pji.65.1701689508848; Mon, 04 Dec 2023 03:31:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701689508; cv=none; d=google.com; s=arc-20160816; b=h/FCOAGsK93gzDkp4XYgxk3hXlFKx2w9USHM8dTI5yBUqNR2JehS6dYAgjEZIl1Yke wtEGso9FUyJkqDo2EnnLb5J2wjM/uE+hgMsPU0Up6I5YBmM4hM4m4RphIQRpXdf0YhwH oGQBk3ULBZfzYeLNXOJQK9l0nFEdleBsu/kPvlByPWFI59UbRKX4xAy3OHMyvJVuaj7S KGvlVjbTQhA35wnEsXXj+scMTC9lOJrREZ//3G3n3CrsIzoRToVvLuHY3wPRdA1KrngI /JP3naAG+Oc8mfaVThHH6kRIu9nWFkT8Ue/hSFnFTYQzL0EJPS7vdq3fFrWukeiPKMAH SmVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jJEZOaCc2w94rl3BlMnubip+8eCagEswLw1gSwc8CGo=; fh=VFIPwOtUTHeodzAk0IJgCE+jsKLJm/vCVKGf4viYnqA=; b=BX04OUauvPYoRUzh3GEWc1TCeo5MeLEMudsJ3CJrHRw2CEqUoeQ4UqoNvZioU3uelp HQLDM8AnwJQI5zY2PJLqutciszSskhO/jl1b7GrU+nI54vJkCuGbfx81aTniiG/52kjV y4l7j9jIX9PhRe3yYe50oXUxbeKBDmm1ABdN4e+dgqyeznzid40I2yKPjWNytVDAJ0a7 bso6haV3b5o5G1avern6eISSiCwvZmUhbXedYGAUBBrza+gySiXEcFQBW/3JtHw+ygwS wiFU8ZPqnLO+pVWtOnLQeD6AJ5a68FkNzYesBh/l/OE4W1J3ao2VMRt5xQiq9vC52Crt x8hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bNMrTt9a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id r7-20020a635d07000000b005ae05010bc4si7613122pgb.235.2023.12.04.03.31.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 03:31:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bNMrTt9a; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 92154807C84F; Mon, 4 Dec 2023 03:31:46 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231891AbjLDLb1 (ORCPT + 99 others); Mon, 4 Dec 2023 06:31:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232885AbjLDLbY (ORCPT ); Mon, 4 Dec 2023 06:31:24 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55B9F102 for ; Mon, 4 Dec 2023 03:31:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701689489; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jJEZOaCc2w94rl3BlMnubip+8eCagEswLw1gSwc8CGo=; b=bNMrTt9a5dAQ+w1oSMngtfh1p829bWtIymo/gOFwyS5sYKxiN32KWndhadQvJ8JDy6fO5y EwAMH1t0iVuUfvFeQlYMjDstKFFgfUASRRrxZImULdzYm5NGbyNHN5LWpE/pJTd3L4lcIK kmNUHti13hRj3X+Jij1XJc8KqCAFH6o= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-486-iQPyttfTPUGA5LOLaM8WOg-1; Mon, 04 Dec 2023 06:31:24 -0500 X-MC-Unique: iQPyttfTPUGA5LOLaM8WOg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C6147811E7B; Mon, 4 Dec 2023 11:31:23 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.193.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id E76391C060AE; Mon, 4 Dec 2023 11:31:20 +0000 (UTC) From: Jose Ignacio Tornos Martinez To: oneukum@suse.com Cc: davem@davemloft.net, edumazet@google.com, greg@kroah.com, jtornosm@redhat.com, kuba@kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, stable@vger.kernel.org, stern@rowland.harvard.edu Subject: Re: [PATCH v3] net: usb: ax88179_178a: avoid failed operations when device is disconnected Date: Mon, 4 Dec 2023 12:31:18 +0100 Message-ID: <20231204113119.11247-1-jtornosm@redhat.com> In-Reply-To: <4ce32363-378c-4ea3-9a4e-d7274d4f7787@suse.com> References: <4ce32363-378c-4ea3-9a4e-d7274d4f7787@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 morse.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 (morse.vger.email [0.0.0.0]); Mon, 04 Dec 2023 03:31:46 -0800 (PST) Hi Oliver, > this is much better. >> ... > This is problematic. ndo_stop() is not limited to disconnection. > It is also used whenever an interface transitions from up to down. >> ... > > On a general note, you are going for a belt and suspenders approach. > It seems to me that you have two options. > 1. Do as Alan suggested and ignore ENODEV. You'd be acknowledging that > these devices are hotpluggable and therefore -ENODEV is not an error > 2. Use only a flag. But if you do that, you are setting it in the wrong > place. It should be set in usbnet_disconnect() Thank you for you help, I will do what you say. I would like to try 2 first so that it only affects the unbind operation. If I find any problem, I will try 1. > O and, well, this is a very mior issue, but you've introduced a memory > ordering issue. You ought to use smp_wmb() after setting the flag and > smp_rmb() before reading it. Thank you again, I'll keep that in mind Best regards José Ignacio