All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 5.4 1/6] usb: mtu3: fix interval value for intr and isoc
@ 2022-01-03 17:30 ` Sasha Levin
  0 siblings, 0 replies; 8+ messages in thread
From: Sasha Levin @ 2022-01-03 17:30 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Chunfeng Yun, Greg Kroah-Hartman, Sasha Levin, matthias.bgg,
	linux-usb, linux-arm-kernel, linux-mediatek

From: Chunfeng Yun <chunfeng.yun@mediatek.com>

[ Upstream commit e3d4621c22f90c33321ae6a6baab60cdb8e5a77c ]

Use the Interval value from isoc/intr endpoint descriptor, no need
minus one. The original code doesn't cause transfer error for
normal cases, but it may have side effect with respond time of ERDY
or tPingTimeout.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Link: https://lore.kernel.org/r/20211218095749.6250-1-chunfeng.yun@mediatek.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/usb/mtu3/mtu3_gadget.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/mtu3/mtu3_gadget.c b/drivers/usb/mtu3/mtu3_gadget.c
index 619c4598e64ea..63f82026cca39 100644
--- a/drivers/usb/mtu3/mtu3_gadget.c
+++ b/drivers/usb/mtu3/mtu3_gadget.c
@@ -85,7 +85,7 @@ static int mtu3_ep_enable(struct mtu3_ep *mep)
 		if (usb_endpoint_xfer_int(desc) ||
 				usb_endpoint_xfer_isoc(desc)) {
 			interval = desc->bInterval;
-			interval = clamp_val(interval, 1, 16) - 1;
+			interval = clamp_val(interval, 1, 16);
 			if (usb_endpoint_xfer_isoc(desc) && comp_desc)
 				mult = comp_desc->bmAttributes;
 		}
@@ -97,7 +97,7 @@ static int mtu3_ep_enable(struct mtu3_ep *mep)
 		if (usb_endpoint_xfer_isoc(desc) ||
 				usb_endpoint_xfer_int(desc)) {
 			interval = desc->bInterval;
-			interval = clamp_val(interval, 1, 16) - 1;
+			interval = clamp_val(interval, 1, 16);
 			mult = usb_endpoint_maxp_mult(desc) - 1;
 		}
 		break;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-01-03 17:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-03 17:30 [PATCH AUTOSEL 5.4 1/6] usb: mtu3: fix interval value for intr and isoc Sasha Levin
2022-01-03 17:30 ` Sasha Levin
2022-01-03 17:30 ` Sasha Levin
2022-01-03 17:30 ` [PATCH AUTOSEL 5.4 2/6] scsi: libiscsi: Fix UAF in iscsi_conn_get_param()/iscsi_conn_teardown() Sasha Levin
2022-01-03 17:30 ` [PATCH AUTOSEL 5.4 3/6] ip6_vti: initialize __ip6_tnl_parm struct in vti6_siocdevprivate Sasha Levin
2022-01-03 17:30 ` [PATCH AUTOSEL 5.4 4/6] net: udp: fix alignment problem in udp4_seq_show() Sasha Levin
2022-01-03 17:30 ` [PATCH AUTOSEL 5.4 5/6] atlantic: Fix buff_ring OOB in aq_ring_rx_clean Sasha Levin
2022-01-03 17:30 ` [PATCH AUTOSEL 5.4 6/6] mISDN: change function names to avoid conflicts Sasha Levin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.