From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B1C15311C11 for ; Wed, 6 May 2026 10:32:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778063523; cv=none; b=BgooPaXtmrGEI4tHIzRGuJe9RhmGqXwpK06bQnm8Ja9WMrUXOzTE+APJSTT8SepmB4xbXkSo6YX8H3yL9nGDddsJKpyDHicBTfYxce1sKGCyKcYBx7dbYaZuZ4BLPAhsTyjkGWPpjsPPFbbrbgsuR7UQ2nr7ikeHqfjOVOX3wV8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778063523; c=relaxed/simple; bh=2u1hbOuO0VpjAHZvvKtwRuB3AqMRY6/qKgrC0iLEtcs=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qe8UunyGIq6Tztc2kACZIlsdTsHyVrBAseKcTU1FxWjKt5CF0xBq4Z8EFzMH4XvnoLpw62rJh7uTmEUU1eVkfHg6CHQoCplIaD3GpdXIyvkEiIbvVRsLpUbuntsE4TiXcFQaLr4DyNCurc/hIpD9+Cdz6qxdbKYBAnaNJMJ+ugc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=N3qBRRaV; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="N3qBRRaV" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-44985f4ab0fso2943876f8f.0 for ; Wed, 06 May 2026 03:32:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778063520; x=1778668320; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=EwUdW68A0CbE204lXa/smh9IH8R3/rozqZP7NaSGf5A=; b=N3qBRRaV0KA/L4odxTf/VNqzwh2+5MWufUqgKAW7xooUZCJN579khgEn+RghYhVub+ ffn8G9L+k1jefkZ/zb3mzT3AdJshjFaCjGYCRmF2FmMdBWm3aV1LVpnGwBjY38FLk2bk vfK0bt14MAlkCNIpwVHsjdTd8EMylaTEFTRHlUI9aVlgisuwD5SdNyk29GC1bCiiRCj4 fORf+15n3+wLnyBk2CAuSK89RhbMqvJi7pL9YGZ+i5m5vxgxTrh0y1hO1LpSHjIjP8vH +xC0yXywHQ1/iGrttV5hCv/4KywHutDaznAH/WDAkNWJYox9+Ubal9Tj3+a3aHL7L8oG aC4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778063520; x=1778668320; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=EwUdW68A0CbE204lXa/smh9IH8R3/rozqZP7NaSGf5A=; b=pdUqOGldJlWbivruXIIFBD1iKvHzX1B0C6BHR/Np9NdlXTb/e4+u4Dabn4W8xrd3Bk YIYSQjVShAOTDxCF/hi62oo9OhtxpRr589JqztT6HCv7NVKPFb4W4uEFoXQ2DpE6lXXW RnNQ0bsFO2p96RWsJGK6uksB+1YCZ6pUQkUqz5mJJSN1ucVaNzkHkryJGziw8izShUJ0 nekDz5y6Ng6WzSzthkZQVa0vz6FMzYTGGBA6Hb7lXoKRXfu2NOdK0UA1OOdzUrFUDGSV YXLrFCv/F7yRg7H0luzNO7EL0JMqCQqzLb571seuZALCiZBcLEYJPmiVlXV7e+bfbN+T zE7A== X-Forwarded-Encrypted: i=1; AFNElJ8aPntWs0Yyt4vYw7HdCIaFga+V/QFau/Zxtl//VxecIf1bXds7+1p1VG4xp9U+Tfx3VT+6drAkQsuMOyw=@vger.kernel.org X-Gm-Message-State: AOJu0YwJP761QrFYvqs+LKU7KFlpuPV2WT/paxUFlMzPihs64fDhmXim lHNEGJGzvYwW+USBr6MOnBs347PO0INm9Ax4LEiqOPWgcv3AaJMlkPV0 X-Gm-Gg: AeBDiesk16MlQd6IV1lOjZ9MOQvoB9yb8PGXVLiNcMvCNaOeoExNHh2iBlTui78dxxY br/xRrWDeG+UBkXMHmqVHh5JTYkzhtXOp/e6DRRUBcepr7lNw/BBLZOWsbAOwmp1vFRQuky+3SZ +ITHhWvLWAm/JaNQs0B3ayA6VjljXKCZ6dUc7tZD08miWid3rJflPTQoTReRWUzXAGyGEenXPcH Maw6SCyn/sJSiWT3m14p47lZ8qiHQ9vKWoHAqSIW5suQ23Rrgriso5iZl7s+OQgHVW8vX53Ueu/ 3XRBlcwT26/lj1OkzWpiw3o1ABkc1KV5bif0uhLFJgiKToxhqHGp2tyHzYv8i4KygJtswM1tbiP d5+94kV4uL4NAudkHYS3OpNtsS3VVnCcFhPnKR+FloR6Am02l5ad5cVqa6yCGNAf8lzNZT6UUvA e0j9/Whe4JhRyeAtSbAbL94G/HkKrR3dRjMmFaxCykaYXIqA== X-Received: by 2002:a5d:5f90:0:b0:451:ccc:a6e5 with SMTP id ffacd0b85a97d-4515d5c68d1mr4653082f8f.30.1778063519764; Wed, 06 May 2026 03:31:59 -0700 (PDT) Received: from foxbook (bgt227.neoplus.adsl.tpnet.pl. [83.28.83.227]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45055960fd6sm12185219f8f.31.2026.05.06.03.31.58 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 06 May 2026 03:31:59 -0700 (PDT) Date: Wed, 6 May 2026 12:31:55 +0200 From: Michal Pecio To: Mathias Nyman Cc: Greg KH , Alan Stern , "Xuetao (kirin)" , caiyadong@huawei.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/3] usb: core: Fix root hub descriptor wBytesPerInterval Message-ID: <20260506123155.3b041e55.michal.pecio@gmail.com> In-Reply-To: References: <20260504111353.55ba2530.michal.pecio@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 6 May 2026 13:17:46 +0300, Mathias Nyman wrote: > On 5/4/26 12:13, Michal Pecio wrote: > > Per USB3 9.6.7, it's "the total number of bytes this endpoint will > > transfer every service interval". There seems to be no good reason > > to have wBytesPerInterval < wMaxPacketSize - either one is too low > > or the other too high. Here, wBytesPerInterval is too low for hubs > > with more than 15 ports and xHCI spec allows such root hubs. > > > > There shouldn't be a USB3 hub with more than 15 ports as > USB 3.x specification limits USB3 ports to 15. > > See USB 3.2 section 10.15.2.1 Hub Descriptor > "bNbrPorts: Number of downstream facing ports that this hub supports. The > maximum number of ports of ports a hub can support is 15." > > > Hub driver also fails if hub has more than 15 ports. > hub.c hub_configure(): > > maxchild = USB_MAXCHILDREN; > if (hub_is_superspeed(hdev)) > maxchild = min_t(unsigned, maxchild, USB_SS_MAXPORTS); > > if (hub->descriptor->bNbrPorts > maxchild) { > message = "hub has too many ports!"; > ret = -ENODEV; > goto fail; > > ch11.h:#define USB_SS_MAXPORTS 15 > > The USB 3.2 specification 10.15.1 'Standard Descriptors for Hub Class' also > shows hardcoded values of '2' for both the wBytesPerInterval and wMaxPacketSize > for the hub interrupt endpoint. Thanks, looks like we should be able to get away with reducing wMaxPacketSize then. Currently it's calculated to fit USB_MAXCHILDREN i.e. 31 ports, supposedly dictated by the needs of (obsolete) WUSB. Any preferences whether to replace USB_MAXCHILDREN with USB_SS_MAXPORTS in the existing formula for USB3 hubs or just hardcode 0x02? Regards, Michal