public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Jeffery <andrew@codeconstruct.com.au>
To: Jeremy Kerr <jk@codeconstruct.com.au>,
	Neal Liu <neal_liu@aspeedtech.com>,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Joel Stanley <joel@jms.id.au>
Cc: linux-aspeed@lists.ozlabs.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH] usb: gadget: aspeed_udc: fix device address configuration
Date: Wed, 12 Jun 2024 13:36:52 +0930	[thread overview]
Message-ID: <de1c329751bfc327901c969eafecb7624aaf6a97.camel@codeconstruct.com.au> (raw)
In-Reply-To: <20240612-aspeed-udc-v1-1-d277b553aecf@codeconstruct.com.au>

On Wed, 2024-06-12 at 10:07 +0800, Jeremy Kerr wrote:
> In the aspeed UDC setup, we configure the UDC hardware with the assigned
> USB device address.
> 
> However, we have an off-by-one in the bitmask, so we're only setting the
> lower 6 bits of the address (USB addresses being 7 bits, and the
> hardware bitmask being bits 0:6).
> 
> This means that device enumeration fails if the assigned address is
> greater than 64:
> 
> [  344.607255] usb 1-1: new high-speed USB device number 63 using ehci-platform
> [  344.808459] usb 1-1: New USB device found, idVendor=cc00, idProduct=cc00, bcdDevice= 6.10
> [  344.817684] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
> [  344.825671] usb 1-1: Product: Test device
> [  344.831075] usb 1-1: Manufacturer: Test vendor
> [  344.836335] usb 1-1: SerialNumber: 00
> [  349.917181] usb 1-1: USB disconnect, device number 63
> [  352.036775] usb 1-1: new high-speed USB device number 64 using ehci-platform
> [  352.249432] usb 1-1: device descriptor read/all, error -71
> [  352.696740] usb 1-1: new high-speed USB device number 65 using ehci-platform
> [  352.909431] usb 1-1: device descriptor read/all, error -71
> 
> Use the correct mask of 0x7f (rather than 0x3f), and generate this
> through the GENMASK macro, so we have numbers that correspond exactly
> to the hardware register definition.
> 
> Fixes: 055276c13205 ("usb: gadget: add Aspeed ast2600 udc driver")
> Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>

Reviewed-by: Andrew Jeffery <andrew@codeconstruct.com.au>

  reply	other threads:[~2024-06-12  4:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-12  2:07 [PATCH] usb: gadget: aspeed_udc: fix device address configuration Jeremy Kerr
2024-06-12  4:06 ` Andrew Jeffery [this message]
2024-06-12  5:35   ` Neal Liu
2024-06-12  5:48 ` Ryan Chen
2024-06-12  6:23   ` Jeremy Kerr
2024-06-12  6:33     ` Ryan Chen
2024-06-12  7:59 ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=de1c329751bfc327901c969eafecb7624aaf6a97.camel@codeconstruct.com.au \
    --to=andrew@codeconstruct.com.au \
    --cc=gregkh@linuxfoundation.org \
    --cc=jk@codeconstruct.com.au \
    --cc=joel@jms.id.au \
    --cc=linux-aspeed@lists.ozlabs.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=neal_liu@aspeedtech.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox