]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: dwc3: gadget: fix writing NYET threshold
authorAndré Draszik <andre.draszik@linaro.org>
Mon, 9 Dec 2024 11:49:53 +0000 (11:49 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jan 2025 16:15:53 +0000 (17:15 +0100)
commit85b8a1a3176dff9101cc08a2a3f0c84f8f6ef3d8
treee1ad7d86afd2c3fabc436e6e1d92faae5062e9e4
parent7f626e8e148c07d1a309586814e52510e92b74c8
usb: dwc3: gadget: fix writing NYET threshold

commit 01ea6bf5cb58b20cc1bd159f0cf74a76cf04bb69 upstream.

Before writing a new value to the register, the old value needs to be
masked out for the new value to be programmed as intended, because at
least in some cases the reset value of that field is 0xf (max value).

At the moment, the dwc3 core initialises the threshold to the maximum
value (0xf), with the option to override it via a DT. No upstream DTs
seem to override it, therefore this commit doesn't change behaviour for
any upstream platform. Nevertheless, the code should be fixed to have
the desired outcome.

Do so.

Fixes: 80caf7d21adc ("usb: dwc3: add lpm erratum support")
Cc: stable@vger.kernel.org # 5.10+ (needs adjustment for 5.4)
Signed-off-by: André Draszik <andre.draszik@linaro.org>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
Link: https://lore.kernel.org/r/20241209-dwc3-nyet-fix-v2-1-02755683345b@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/dwc3/core.h
drivers/usb/dwc3/gadget.c