Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4692887iob; Sun, 8 May 2022 22:13:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7DcpPGhU/S3TkzjiSkOZurTSTaz4q2O6LA6ObMmc6kZ/zA3bHwALez9ZKAcKBjGDuAoTG X-Received: by 2002:a05:6a00:1a89:b0:50d:fee4:cdb1 with SMTP id e9-20020a056a001a8900b0050dfee4cdb1mr14625407pfv.85.1652073198309; Sun, 08 May 2022 22:13:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652073198; cv=none; d=google.com; s=arc-20160816; b=B77UlyJm8NQrDxV7MMotlDWnvYlcyJuVD14F/Ub7uilJ5EiZ3mpalHPWgk1T+UU92Z SF5NnCsEWDxWv2y1o045QMqmXuGv+qBrlIJWeSVOsu7Cp+inv+yMymeJwaF9Aci7NBEc v7gfcEnOp4XL5aPtZq1hvC4kMJeOhGgUV/CMr6ENU/uc6DTv7UdJE4zffLYFPdl0pePf eJkMZ9bGsqWZIvsPl00urGNYJ6W/SvN0s4ty4YBIXk8Vj3A3K9xTFcubSnwKwxnObH05 cmJ4hXBenk0AcKAyr/dkewGlJAf/3AQQVz2wEyQpO9TusOfgb6JxI7aQK5jhaRduqXTR 2NlQ== 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:subject:cc:to:from:date :dkim-signature; bh=Cbh47f//eJHFUTXlmGjPBKBNHh4uMhbq8cQxpwPu71c=; b=0uXSp46Ch8mdjsQxR6oqR2Ikod4DcEzyQBvZynHPBLax9UKPlcpDHgPzMAxT5HOY/b Vb14F8R/0BYeq+V9RepYLmihnuWE4ZAINBhCoOCPZ2RJOXrshqiEg7l79OIOSva+MgFK fN/0nECW/ax8dk/JpiSdKNtkbAM3T/snuG6QxUJHvwC3+21+GqZXm58Dk3Iqu8PpXE0w iZBX+YHypQSyDdeoob17yS4Dfp4nYehGpqWW/HHTtRUSnAhpktHdpRDdZ5KWRt07n+/4 1z1d5nRFAH9wExHpC4Ki+Oc1uvx87JFs7j9ehrdcwz5xBub+5cg/T9bT5hWGP5DszkkE OGWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pouF2F4d; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id x187-20020a6331c4000000b003c20594afcdsi13591467pgx.755.2022.05.08.22.13.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 22:13:18 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pouF2F4d; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B4E8213E98; Sun, 8 May 2022 22:08:39 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239566AbiEECeb (ORCPT + 99 others); Wed, 4 May 2022 22:34:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239533AbiEECe2 (ORCPT ); Wed, 4 May 2022 22:34:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BD1A2DA9F; Wed, 4 May 2022 19:30:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 03195615C2; Thu, 5 May 2022 02:30:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07087C385A4; Thu, 5 May 2022 02:30:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651717849; bh=RkDhcgrzYae7GmKeIL3pDbwgzqwIh9Ckm5gs6D/gdC8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=pouF2F4dNdWdKDOnHU3L2517bVFfOcb6TYpC5jtBTgbGpyMSw3Jyk3He3hU9KlG3w Up4AvnNvaqmsHozVeC83iiwYDP7ctQ9VYzGJNIGyFuMQk0FViVh1hraFrXZ5VJM6nM htlS/VCq3RLIUc4HXOnwEx7GO5D4mrRxfE4AVbdtAgnNj1SjilOyVSwOU6EixmbLVb yy+k1izGp64NKjnsOgk1RIbSgtVsvN0n7zF4nRTBXYFS5HiPDO02zxHoVF3A7viJr9 jTTuMw99VZegegwRIjZyQ+Ia7GD5jlRuWHmyHAP0N7AHpMV0+z/A5xPBbF76IaoeDG vu0ODDt3LDamw== Date: Wed, 4 May 2022 19:30:47 -0700 From: Jakub Kicinski To: Hector Martin Cc: Jacky Chou , "David S. Miller" , Eric Dumazet , Paolo Abeni , linux-usb@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] net: usb: ax88179_178a: Bind only to vendor-specific interface Message-ID: <20220504193047.1e4b97b7@kernel.org> In-Reply-To: <20220502110644.167179-1-marcan@marcan.st> References: <20220502110644.167179-1-marcan@marcan.st> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2 May 2022 20:06:44 +0900 Hector Martin wrote: > The Anker PowerExpand USB-C to Gigabit Ethernet adapter uses this > chipset, but exposes CDC Ethernet configurations as well as the > vendor specific one. And we have reasons to believe all dongle vendors may have a similar problem? > This driver ends up binding first to both CDC > interfaces, tries to instantiate two Ethernet interfaces talking to > the same device, and the result is a nice fireworks show. > > Change all the ID matches to specifically match the vendor-specific > interface. By default the device comes up in CDC mode and is bound by > that driver (which works fine); users may switch it to the vendor > interface using sysfs to set bConfigurationValue, at which point the > device actually goes through a reconnect cycle and comes back as a > vendor specific only device, and then this driver binds and works too. > > v2: Fixed interface protocol match, commit message. > > Signed-off-by: Hector Martin > --- > drivers/net/usb/ax88179_178a.c | 26 +++++++++++++------------- > 1 file changed, 13 insertions(+), 13 deletions(-) > > diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c > index e2fa56b92685..7c7c2f31d9f1 100644 > --- a/drivers/net/usb/ax88179_178a.c > +++ b/drivers/net/usb/ax88179_178a.c > @@ -1914,55 +1914,55 @@ static const struct driver_info at_umc2000sp_info = { > static const struct usb_device_id products[] = { > { > /* ASIX AX88179 10/100/1000 */ > - USB_DEVICE(0x0b95, 0x1790), > + USB_DEVICE_AND_INTERFACE_INFO(0x0b95, 0x1790, 0xff, 0xff, 0), > .driver_info = (unsigned long)&ax88179_info, > }, Should we use USB_CLASS_VENDOR_SPEC and USB_SUBCLASS_VENDOR_SPEC ? Maybe define a local macro wrapper for USB_DEVICE_AND.. which will fill those in to avoid long lines?