Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp817712ybn; Wed, 25 Sep 2019 08:09:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJOYDo1qZwJSy9sLllKJtSZ2e3EH5JpUTFnyZ1e8b1OFN5wT19z2ZF8aSLfz5g5lN7mRCM X-Received: by 2002:a50:99d5:: with SMTP id n21mr3510403edb.50.1569424158498; Wed, 25 Sep 2019 08:09:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569424158; cv=none; d=google.com; s=arc-20160816; b=jHBEZr7TEb4iO0dLIbhWotJs12S/bvIzxlSR6Pg+7Sqe9hsUAxO3lUDhNFMbJhKOA9 TgFO4cgRVXoiYatmrRt0S+ZP47iAVecLK5qP3ezbKbhp8+Y35GOC4KoDxLPfDMgF/rsU bQWbAjrscvoq2VGAGg+cciZvkqihiqs9zaAQkMDGlIbTPrNyJN43lURlGUc4xWRyFJ1n u5AeD74qexTOaNcSspxaqXAyMN6vvLjeg6SCYE9hnS4zvwDoCusLq5YEAtzyTwsnWWYX N7dv5Ha5tg8D9h6xgsLdOLGrnRo2K0NS+z0JzP4y9mHC8QvMeFLGj7QVk3AUojBI5sH8 bpsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=XqAT/S+UBdFWYT/bdZe7s2eHzMVIKhz+pGGAZTlm1uI=; b=mmS2m7iQWiHl9RIRzyizyZ5CepkGEiAuPXosH0qTkRFwPu+1fIqzsZnthLu0rKibjr goQxhS4BpKgr/rZruomKiVhuYNpcRvwW4YiaJmdL5xq66CQXnGm/vELdDUmrpexEOQXa e2u3I9JSkYjDEtV1e0X9vwYtUZUFoQbUm4vQNlhedyL6RDWiA5/nbwPBbUzIntYgOOVm GGzK949Gku4WOWxgqB1KVj12fUC3mKzaeEnRBQLQZSb70Z3NAkM1KhnSKwnWkRBQprNc A5ch/TMi/2DOiFvKB9cQ0v1j75k+nwLcJ7w9ofSbQK1+MrxCXyD7nftwXPpHnPSOTPkt MDgw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rh23si2822566ejb.75.2019.09.25.08.08.48; Wed, 25 Sep 2019 08:09:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731645AbfIWPBQ (ORCPT + 99 others); Mon, 23 Sep 2019 11:01:16 -0400 Received: from netrider.rowland.org ([192.131.102.5]:43755 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1727515AbfIWPBQ (ORCPT ); Mon, 23 Sep 2019 11:01:16 -0400 Received: (qmail 27837 invoked by uid 500); 23 Sep 2019 11:01:15 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 23 Sep 2019 11:01:15 -0400 Date: Mon, 23 Sep 2019 11:01:15 -0400 (EDT) From: Alan Stern X-X-Sender: stern@netrider.rowland.org To: Ran Wang cc: Greg Kroah-Hartman , Kai-Heng Feng , Mathias Nyman , Mathias Payer , Dennis Wassenberg , "open list:USB SUBSYSTEM" , open list Subject: Re: [PATCH] usb: hub add filter for device with specific VID&PID In-Reply-To: <20190923105102.37413-1-ran.wang_1@nxp.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 23 Sep 2019, Ran Wang wrote: > USB 2.0 Embedded Host PET Automated Test (CH6) 6.7.23 A-UUT "Unsupported > Device" Message require to stop enumerating device with VID=0x1a0a PID=0x0201 > and pop message to declare this device is not supported. > > Signed-off-by: Ran Wang > --- > drivers/usb/core/hub.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c > index bbcfa63..3cda0da 100644 > --- a/drivers/usb/core/hub.c > +++ b/drivers/usb/core/hub.c > @@ -4982,6 +4982,18 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus, > if (status < 0) > goto loop; > > + /* USB 2.0 Embedded Host PET Automated Test (CH6) > + * 6.7.23 A-UUT "Unsupported Device" Message > + * require to filter out below device when enumeration > + */ > + if ((udev->descriptor.idVendor == 0x1a0a) > + && (udev->descriptor.idProduct == 0x0201)) { > + dev_err(&udev->dev, "This device is not supported: idVendor=0x%x idProduct=0x%x\n", > + udev->descriptor.idVendor, > + udev->descriptor.idProduct); There's no need to write out the Vendor and Product IDs. They already appear in the "New device" message. > + goto done; > + } > + > if (udev->quirks & USB_QUIRK_DELAY_INIT) > msleep(2000); Shouldn't this be implemented as a device quirk? Alan Stern