From: Chunfeng Yun <chunfeng.yun@mediatek.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Felipe Balbi <balbi@kernel.org>
Cc: Pawel Laszczak <pawell@cadence.com>,
Al Cooper <alcooperx@gmail.com>,
Thierry Reding <thierry.reding@gmail.com>,
Jonathan Hunter <jonathanh@nvidia.com>,
Chunfeng Yun <chunfeng.yun@mediatek.com>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
Yang Yingliang <yangyingliang@huawei.com>,
Rikard Falkeborn <rikard.falkeborn@gmail.com>,
<linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<bcm-kernel-feedback-list@broadcom.com>,
<linux-tegra@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>,
Eddie Hung <eddie.hung@mediatek.com>,
stable <stable@vger.kernel.org>
Subject: [PATCH v2 3/7] usb: mtu3: fix the wrong HS mult value
Date: Thu, 12 Aug 2021 21:11:31 +0800 [thread overview]
Message-ID: <1628773895-304-3-git-send-email-chunfeng.yun@mediatek.com> (raw)
In-Reply-To: <1628773895-304-1-git-send-email-chunfeng.yun@mediatek.com>
usb_endpoint_maxp() returns actual max packet size, @mult will
always be zero, fix it by using usb_endpoint_maxp_mult() instead
to get mult.
Fixes: 4d79e042ed8b ("usb: mtu3: add support for usb3.1 IP")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
v2: split two patch [v2 2/7],[v2 3/7] suggested by Felipe
---
drivers/usb/mtu3/mtu3_gadget.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/mtu3/mtu3_gadget.c b/drivers/usb/mtu3/mtu3_gadget.c
index 635ad277cb13..a399fd84c71f 100644
--- a/drivers/usb/mtu3/mtu3_gadget.c
+++ b/drivers/usb/mtu3/mtu3_gadget.c
@@ -64,14 +64,12 @@ static int mtu3_ep_enable(struct mtu3_ep *mep)
u32 interval = 0;
u32 mult = 0;
u32 burst = 0;
- int max_packet;
int ret;
desc = mep->desc;
comp_desc = mep->comp_desc;
mep->type = usb_endpoint_type(desc);
- max_packet = usb_endpoint_maxp(desc);
- mep->maxp = max_packet & GENMASK(10, 0);
+ mep->maxp = usb_endpoint_maxp(desc);
switch (mtu->g.speed) {
case USB_SPEED_SUPER:
@@ -92,7 +90,7 @@ static int mtu3_ep_enable(struct mtu3_ep *mep)
usb_endpoint_xfer_int(desc)) {
interval = desc->bInterval;
interval = clamp_val(interval, 1, 16) - 1;
- mult = (max_packet & GENMASK(12, 11)) >> 11;
+ mult = usb_endpoint_maxp_mult(desc) - 1;
}
break;
default:
--
2.18.0
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
next prev parent reply other threads:[~2021-08-12 13:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-12 13:11 [PATCH v2 1/7] usb: mtu3: restore HS function when set SS/SSP Chunfeng Yun
2021-08-12 13:11 ` [PATCH v2 2/7] usb: mtu3: use @mult for HS isoc or intr Chunfeng Yun
2021-08-12 13:11 ` Chunfeng Yun [this message]
2021-08-12 13:17 [PATCH v2 1/7] usb: mtu3: restore HS function when set SS/SSP Chunfeng Yun
2021-08-12 13:17 ` [PATCH v2 3/7] usb: mtu3: fix the wrong HS mult value Chunfeng Yun
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=1628773895-304-3-git-send-email-chunfeng.yun@mediatek.com \
--to=chunfeng.yun@mediatek.com \
--cc=alcooperx@gmail.com \
--cc=balbi@kernel.org \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=eddie.hung@mediatek.com \
--cc=gregkh@linuxfoundation.org \
--cc=jonathanh@nvidia.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=pawell@cadence.com \
--cc=rikard.falkeborn@gmail.com \
--cc=stable@vger.kernel.org \
--cc=thierry.reding@gmail.com \
--cc=yangyingliang@huawei.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;
as well as URLs for NNTP newsgroup(s).