From: Felipe Balbi <balbi@kernel.org>
To: "Macpaul Lin" <macpaul.lin@mediatek.com>,
"Chunfeng Yun" <chunfeng.yun@mediatek.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"Michał Mirosław" <mirq-linux@rere.qmqm.pl>,
"Sergey Organov" <sorganov@gmail.com>,
"Fabrice Gasnier" <fabrice.gasnier@st.com>,
linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: Macpaul Lin <macpaul.lin@gmail.com>,
Macpaul Lin <macpaul.lin@mediatek.com>,
Mediatek WSD Upstream <wsd_upstream@mediatek.com>
Subject: Re: [PATCH 1/2] usb: gadget: introduce flag for large request
Date: Wed, 24 Jun 2020 09:47:28 +0300 [thread overview]
Message-ID: <87wo3xvu2n.fsf@kernel.org> (raw)
In-Reply-To: <1592310884-4307-1-git-send-email-macpaul.lin@mediatek.com>
[-- Attachment #1.1: Type: text/plain, Size: 2251 bytes --]
Hi,
Macpaul Lin <macpaul.lin@mediatek.com> writes:
> Some USB hardware like DMA engine can help to process (split) the data
> of each URB request into small packets. For example, the max packet size
> of high speed is 512 bytes. These kinds of hardware can help to split
> the continue Tx/Rx data requests into packets just at the max packet
> size during transmission. Hence upper layer software can reduce some
> effort for queueing many requests back and forth for larger data.
>
> Here we introduce "can_exceed_maxp" flag in gadget when these kinds of
> hardware is ready to support these operations.
>
> Signed-off-by: Macpaul Lin <macpaul.lin@mediatek.com>
> ---
> drivers/usb/mtu3/mtu3_qmu.c | 11 ++++++++++-
> include/linux/usb/gadget.h | 1 +
> 2 files changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/mtu3/mtu3_qmu.c b/drivers/usb/mtu3/mtu3_qmu.c
> index 3f414f9..2b51a20 100644
> --- a/drivers/usb/mtu3/mtu3_qmu.c
> +++ b/drivers/usb/mtu3/mtu3_qmu.c
> @@ -620,7 +620,7 @@ irqreturn_t mtu3_qmu_isr(struct mtu3 *mtu)
>
> int mtu3_qmu_init(struct mtu3 *mtu)
> {
> -
> + int i;
> compiletime_assert(QMU_GPD_SIZE == 16, "QMU_GPD size SHOULD be 16B");
>
> mtu->qmu_gpd_pool = dma_pool_create("QMU_GPD", mtu->dev,
> @@ -629,10 +629,19 @@ int mtu3_qmu_init(struct mtu3 *mtu)
> if (!mtu->qmu_gpd_pool)
> return -ENOMEM;
>
> + /* Let gadget know we can process request larger than max packet */
> + for (i = 1; i < mtu->num_eps; i++)
> + mtu->ep_array[i].ep.can_exceed_maxp = 1;
> +
> return 0;
> }
>
> void mtu3_qmu_exit(struct mtu3 *mtu)
> {
> + int i;
> dma_pool_destroy(mtu->qmu_gpd_pool);
> +
> + /* Disable large request support */
> + for (i = 1; i < mtu->num_eps; i++)
> + mtu->ep_array[i].ep.can_exceed_maxp = 0;
> }
> diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
> index 6a17817..60e0645 100644
> --- a/include/linux/usb/gadget.h
> +++ b/include/linux/usb/gadget.h
> @@ -236,6 +236,7 @@ struct usb_ep {
> unsigned max_streams:16;
> unsigned mult:2;
> unsigned maxburst:5;
> + unsigned can_exceed_maxp:1;
every driver does this without this flag. This is unnecessary.
--
balbi
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2020-06-24 6:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-16 12:34 [PATCH 1/2] usb: gadget: introduce flag for large request Macpaul Lin
2020-06-16 12:34 ` [PATCH 2/2] usb: gadget: u_serial: improve performance for large data Macpaul Lin
2020-06-24 6:48 ` Felipe Balbi
2020-06-16 14:02 ` [PATCH 1/2] usb: gadget: introduce flag for large request Alan Stern
2020-06-17 2:27 ` Macpaul Lin
2020-06-17 2:46 ` [PATCH v2] usb: gadget: u_serial: improve performance for large data Macpaul Lin
2020-06-17 5:14 ` Greg Kroah-Hartman
2020-06-17 5:34 ` Macpaul Lin
2020-06-17 5:42 ` [PATCH v3] " Macpaul Lin
2020-06-24 6:50 ` Felipe Balbi
2020-06-24 6:47 ` Felipe Balbi [this message]
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=87wo3xvu2n.fsf@kernel.org \
--to=balbi@kernel.org \
--cc=chunfeng.yun@mediatek.com \
--cc=fabrice.gasnier@st.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=macpaul.lin@gmail.com \
--cc=macpaul.lin@mediatek.com \
--cc=matthias.bgg@gmail.com \
--cc=mirq-linux@rere.qmqm.pl \
--cc=sorganov@gmail.com \
--cc=wsd_upstream@mediatek.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).