From: Peter Chen <peter.chen@kernel.org>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>,
"Peter Geis" <pgwipeout@gmail.com>,
"Dmitry Osipenko" <digetx@gmail.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Thierry Reding" <treding@nvidia.com>,
linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org,
linux-usb@vger.kernel.org
Subject: Re: [PATCH v2 2/3] usb: chipidea: Simplify Tegra DMA alignment code
Date: Thu, 12 Oct 2023 22:28:59 +0800 [thread overview]
Message-ID: <20231012142859.GC1010588@nchen-desktop> (raw)
In-Reply-To: <ZScZWFJCCMr7oWwX@orome.fritz.box>
On 23-10-11 23:53:28, Thierry Reding wrote:
> On Thu, Sep 28, 2023 at 11:06:03PM +0200, Michał Mirosław wrote:
> > The USB host on Tegra3 works with 32-bit alignment. Previous code tried
> > to align the buffer, but it did align the wrapper struct instead, so
> > the buffer was at a constant offset of 8 bytes (two pointers) from
> > expected alignment. Since kmalloc() guarantees at least 8-byte
> > alignment already, the alignment-extending is removed.
> >
> > Fixes: fc53d5279094 ("usb: chipidea: tegra: Support host mode")
> > Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> > ---
> > drivers/usb/chipidea/host.c | 45 +++++++++++++++----------------------
> > 1 file changed, 18 insertions(+), 27 deletions(-)
> >
> > diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c
> > index abddd39d1ff1..0cce19208370 100644
> > --- a/drivers/usb/chipidea/host.c
> > +++ b/drivers/usb/chipidea/host.c
> > @@ -30,8 +30,7 @@ struct ehci_ci_priv {
> > };
> >
> > struct ci_hdrc_dma_aligned_buffer {
> > - void *kmalloc_ptr;
> > - void *old_xfer_buffer;
> > + void *original_buffer;
> > u8 data[];
> > };
> >
> > @@ -380,60 +379,52 @@ static int ci_ehci_bus_suspend(struct usb_hcd *hcd)
> > return 0;
> > }
> >
> > -static void ci_hdrc_free_dma_aligned_buffer(struct urb *urb)
> > +static void ci_hdrc_free_dma_aligned_buffer(struct urb *urb, bool copy_back)
> > {
> > struct ci_hdrc_dma_aligned_buffer *temp;
> > - size_t length;
> >
> > if (!(urb->transfer_flags & URB_ALIGNED_TEMP_BUFFER))
> > return;
> > + urb->transfer_flags &= ~URB_ALIGNED_TEMP_BUFFER;
>
> This threw me off a bit until I realized it was already there
> previously, just in a different place. Is there a particular reason why
> this is moved?
>
> Regardless, this looks fine, so:
>
> Acked-by: Thierry Reding <treding@nvidia.com>
Acked-by: Peter Chen <peter.chen@kernel.org>
--
Thanks,
Peter Chen
next prev parent reply other threads:[~2023-10-12 14:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-28 21:06 [PATCH v2 0/3] usb: chipidea: An USB DMA fix + cleanups for Tegra Michał Mirosław
2023-09-28 21:06 ` [PATCH v2 1/3] usb: chipidea: Fix DMA overwrite " Michał Mirosław
2023-10-11 21:51 ` Thierry Reding
2023-10-12 14:28 ` Peter Chen
2023-09-28 21:06 ` [PATCH v2 2/3] usb: chipidea: Simplify Tegra DMA alignment code Michał Mirosław
2023-10-11 21:53 ` Thierry Reding
2023-10-12 14:28 ` Peter Chen [this message]
2023-10-12 21:20 ` Michał Mirosław
2023-09-28 21:06 ` [PATCH v2 3/3] usb: chipidea: tegra: Consistently use dev_err_probe() Michał Mirosław
2023-10-11 21:53 ` Thierry Reding
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=20231012142859.GC1010588@nchen-desktop \
--to=peter.chen@kernel.org \
--cc=digetx@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mirq-linux@rere.qmqm.pl \
--cc=pgwipeout@gmail.com \
--cc=thierry.reding@gmail.com \
--cc=treding@nvidia.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