public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	patches@lists.linux.dev,
	"André Draszik" <andre.draszik@linaro.org>,
	"Thinh Nguyen" <Thinh.Nguyen@synopsys.com>
Subject: [PATCH 6.1 58/92] usb: dwc3: gadget: fix writing NYET threshold
Date: Wed, 15 Jan 2025 11:37:16 +0100	[thread overview]
Message-ID: <20250115103549.876433273@linuxfoundation.org> (raw)
In-Reply-To: <20250115103547.522503305@linuxfoundation.org>

6.1-stable review patch.  If anyone has any objections, please let me know.

------------------

From: André Draszik <andre.draszik@linaro.org>

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   |    1 +
 drivers/usb/dwc3/gadget.c |    4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -447,6 +447,7 @@
 #define DWC3_DCTL_TRGTULST_SS_INACT	(DWC3_DCTL_TRGTULST(6))
 
 /* These apply for core versions 1.94a and later */
+#define DWC3_DCTL_NYET_THRES_MASK	(0xf << 20)
 #define DWC3_DCTL_NYET_THRES(n)		(((n) & 0xf) << 20)
 
 #define DWC3_DCTL_KEEP_CONNECT		BIT(19)
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -4056,8 +4056,10 @@ static void dwc3_gadget_conndone_interru
 		WARN_ONCE(DWC3_VER_IS_PRIOR(DWC3, 240A) && dwc->has_lpm_erratum,
 				"LPM Erratum not available on dwc3 revisions < 2.40a\n");
 
-		if (dwc->has_lpm_erratum && !DWC3_VER_IS_PRIOR(DWC3, 240A))
+		if (dwc->has_lpm_erratum && !DWC3_VER_IS_PRIOR(DWC3, 240A)) {
+			reg &= ~DWC3_DCTL_NYET_THRES_MASK;
 			reg |= DWC3_DCTL_NYET_THRES(dwc->lpm_nyet_threshold);
+		}
 
 		dwc3_gadget_dctl_write_safe(dwc, reg);
 	} else {



  parent reply	other threads:[~2025-01-15 10:43 UTC|newest]

Thread overview: 110+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-15 10:36 [PATCH 6.1 00/92] 6.1.125-rc1 review Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 01/92] ceph: give up on paths longer than PATH_MAX Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 02/92] bpf, sockmap: Fix race between element replace and close() Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 03/92] sched/task_stack: fix object_is_on_stack() for KASAN tagged pointers Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 04/92] jbd2: increase IO priority for writing revoke records Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 05/92] jbd2: flush filesystem device before updating tail sequence Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 06/92] dm array: fix releasing a faulty array block twice in dm_array_cursor_end Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 07/92] dm array: fix unreleased btree blocks on closing a faulty array cursor Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 08/92] dm array: fix cursor index when skipping across block boundaries Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 09/92] exfat: fix the infinite loop in exfat_readdir() Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 10/92] exfat: fix the infinite loop in __exfat_free_cluster() Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 11/92] scripts/sorttable: fix orc_sort_cmp() to maintain symmetry and transitivity Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 12/92] ASoC: mediatek: disable buffer pre-allocation Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 13/92] ieee802154: ca8210: Add missing check for kfifo_alloc() in ca8210_probe() Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 14/92] net: 802: LLC+SNAP OID:PID lookup on start of skb data Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 15/92] tcp/dccp: complete lockless accesses to sk->sk_max_ack_backlog Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 16/92] tcp/dccp: allow a connection when sk_max_ack_backlog is zero Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 17/92] net_sched: cls_flow: validate TCA_FLOW_RSHIFT attribute Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 18/92] bnxt_en: Fix possible memory leak when hwrm_req_replace fails Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 19/92] cxgb4: Avoid removal of uninserted tid Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 20/92] ice: fix incorrect PHY settings for 100 GB/s Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 21/92] tls: Fix tls_sw_sendmsg error handling Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 22/92] Bluetooth: hci_sync: Fix not setting Random Address when required Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 23/92] tcp: Annotate data-race around sk->sk_mark in tcp_v4_send_reset Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 24/92] netfilter: nf_tables: imbalance in flowtable binding Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 25/92] netfilter: conntrack: clamp maximum hashtable size to INT_MAX Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 26/92] sched: sch_cake: add bounds checks to host bulk flow fairness counts Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 27/92] net/mlx5: Fix variable not being completed when function returns Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 28/92] drm/mediatek: stop selecting foreign drivers Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 29/92] drm/mediatek: Fix YCbCr422 color format issue for DP Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 30/92] drm/mediatek: Fix mode valid issue for dp Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 31/92] drm/mediatek: Add return value check when reading DPCD Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 32/92] ksmbd: fix a missing return value check bug Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 33/92] afs: Fix the maximum cell name length Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 34/92] ksmbd: fix unexpectedly changed path in ksmbd_vfs_kern_path_locked Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 35/92] cpuidle: riscv-sbi: fix device node release in early exit of for_each_possible_cpu Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 36/92] dm thin: make get_first_thin use rcu-safe list first function Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 37/92] dm-ebs: dont set the flag DM_TARGET_PASSES_INTEGRITY Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 38/92] sctp: sysctl: cookie_hmac_alg: avoid using current->nsproxy Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 39/92] sctp: sysctl: rto_min/max: " Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 40/92] sctp: sysctl: auth_enable: " Greg Kroah-Hartman
2025-01-15 10:36 ` [PATCH 6.1 41/92] sctp: sysctl: udp_port: " Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 42/92] sctp: sysctl: plpmtud_probe_interval: " Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 43/92] drm/amd/display: Add check for granularity in dml ceil/floor helpers Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 44/92] thermal: of: fix OF node leak in of_thermal_zone_find() Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 45/92] riscv: Fix sleeping in invalid context in die() Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 46/92] ACPI: resource: Add TongFang GM5HG0A to irq1_edge_low_force_override[] Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 47/92] ACPI: resource: Add Asus Vivobook X1504VAP to irq1_level_low_skip_override[] Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 48/92] drm/amd/display: increase MAX_SURFACES to the value supported by hw Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 49/92] dm-verity FEC: Fix RS FEC repair for roots unaligned to block size (take 2) Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 50/92] bpf: Add MEM_WRITE attribute Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 51/92] bpf: Fix overloading of MEM_UNINITs meaning Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 52/92] USB: serial: option: add MeiG Smart SRM815 Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 53/92] USB: serial: option: add Neoway N723-EA support Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 54/92] staging: iio: ad9834: Correct phase range check Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 55/92] staging: iio: ad9832: " Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 56/92] usb-storage: Add max sectors quirk for Nokia 208 Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 57/92] USB: serial: cp210x: add Phoenix Contact UPS Device Greg Kroah-Hartman
2025-01-15 10:37 ` Greg Kroah-Hartman [this message]
2025-01-15 10:37 ` [PATCH 6.1 59/92] topology: Keep the cpumask unchanged when printing cpumap Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 60/92] misc: microchip: pci1xxxx: Resolve kernel panic during GPIO IRQ handling Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 61/92] misc: microchip: pci1xxxx: Resolve return code mismatch during GPIO set config Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 62/92] usb: gadget: u_serial: Disable ep before setting port to null to fix the crash caused by port being null Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 63/92] usb: dwc3-am62: Disable autosuspend during remove Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 64/92] USB: usblp: return error when setting unsupported protocol Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 65/92] USB: core: Disable LPM only for non-suspended ports Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 66/92] usb: fix reference leak in usb_new_device() Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 67/92] usb: gadget: f_uac2: Fix incorrect setting of bNumEndpoints Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 68/92] usb: gadget: f_fs: Remove WARN_ON in functionfs_bind Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 69/92] iio: pressure: zpa2326: fix information leak in triggered buffer Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 70/92] iio: dummy: iio_simply_dummy_buffer: " Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 71/92] iio: light: vcnl4035: " Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 72/92] iio: imu: kmx61: " Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 73/92] iio: adc: ti-ads8688: " Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 74/92] iio: gyro: fxas21002c: Fix missing data update in trigger handler Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 75/92] iio: adc: ti-ads124s08: Use gpiod_set_value_cansleep() Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 76/92] iio: adc: at91: call input_free_device() on allocated iio_dev Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 77/92] iio: inkern: call iio_device_put() only on mapped devices Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 78/92] iio: adc: ad7124: Disable all channels at probe time Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 79/92] io_uring/eventfd: ensure io_eventfd_signal() defers another RCU period Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 80/92] ARM: dts: imxrt1050: Fix clocks for mmc Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 81/92] block, bfq: fix waker_bfqq UAF after bfq_split_bfqq() Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 82/92] arm64: dts: rockchip: add hevc power domain clock to rk3328 Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 83/92] of: unittest: Add bus address range parsing tests Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 84/92] of/address: Add support for 3 address cell bus Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 85/92] of: address: Fix address translation when address-size is greater than 2 Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 86/92] of: address: Remove duplicated functions Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 87/92] of: address: Store number of bus flag cells rather than bool Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 88/92] of: address: Preserve the flags portion on 1:1 dma-ranges mapping Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 89/92] ocfs2: correct return value of ocfs2_local_free_info() Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 90/92] ocfs2: fix slab-use-after-free due to dangling pointer dqi_priv Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 91/92] drm: bridge: adv7511: use dev_err_probe in probe function Greg Kroah-Hartman
2025-01-15 10:37 ` [PATCH 6.1 92/92] drm: adv7511: Fix use-after-free in adv7533_attach_dsi() Greg Kroah-Hartman
2025-01-15 12:50 ` [PATCH 6.1 00/92] 6.1.125-rc1 review Pavel Machek
2025-01-15 13:57   ` Pavel Machek
     [not found]     ` <2025011725-underdog-heftiness-49df@gregkh>
2025-01-17 21:16       ` 6.1.125 build fail was -- " Pavel Machek
2025-01-18  6:37         ` Ron Economos
2025-01-18  7:20           ` Greg Kroah-Hartman
2025-01-18 12:27             ` Ron Economos
2025-01-15 14:09   ` Ron Economos
2025-01-15 15:07     ` Greg Kroah-Hartman
2025-01-15 13:15 ` Mark Brown
2025-01-15 14:13 ` Jon Hunter
2025-01-15 22:14 ` Florian Fainelli
2025-01-15 22:32 ` Shuah Khan
2025-01-16 10:48 ` Naresh Kamboju
2025-01-16 13:59 ` Peter Schneider
2025-01-17  2:25 ` [PATCH 6.1] " Hardik Garg
2025-01-18 15:05 ` [PATCH 6.1 00/92] " Guenter Roeck
2025-01-18 15:34   ` 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=20250115103549.876433273@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=andre.draszik@linaro.org \
    --cc=patches@lists.linux.dev \
    --cc=stable@vger.kernel.org \
    /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