Linux Serial subsystem development
 help / color / mirror / Atom feed
From: Gregory CLEMENT <gregory.clement@bootlin.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "Russell King" <linux@armlinux.org.uk>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jiri Slaby" <jslaby@suse.com>,
	linux-serial@vger.kernel.org,
	"Vladimir Kondratiev" <vladimir.kondratiev@mobileye.com>,
	"Tawfik Bayouk" <tawfik.bayouk@mobileye.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Théo Lebrun" <theo.lebrun@bootlin.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Arnd Bergmann" <arnd@arndb.de>
Subject: Re: [PATCH] ARM: PL011: Fix DMA support
Date: Wed, 22 Nov 2023 15:57:38 +0100	[thread overview]
Message-ID: <8734wxhm3h.fsf@BL-laptop> (raw)
In-Reply-To: <CACRpkdY6CtReAOr9oiVZ-97YRpyNCN_s1E_-j6zYuZbtmis80A@mail.gmail.com>

Hello Linus,

> On Wed, Nov 22, 2023 at 8:47 AM Gregory CLEMENT
> <gregory.clement@bootlin.com> wrote:
>
>> From: Arnd Bergmann <arnd@arndb.de>
>>
>> Since there is no guarantee that the memory returned by
>> dma_alloc_coherent() is associated with a 'struct page', using the
>> architecture specific phys_to_page() is wrong, but using
>> virt_to_page() would be as well.
>>
>> Stop using sg lists altogether and just use the *_single() functions
>> instead. This also simplifies the code a bit since the scatterlists in
>> this driver always have only one entry anyway.
>>
>> gcl: Add a commit log from the initial thread:
>
> First I thought this was Grant C. Likely, but now I realized it is
> Gregory :)

:)

Next time I will only use gc then.

>
>> https://lore.kernel.org/lkml/86db0fe5-930d-4cbb-bd7d-03367da38951@app.fastmail.com/
>>
>> Fixes: cb06ff102e2d7 ("ARM: PL011: Add support for Rx DMA buffer polling.")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> Tested-by: Gregory CLEMENT <gregory.clement@bootlin.com>
>> Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
>
> Fair enough.
>
>>  struct pl011_sgbuf {
>> -       struct scatterlist sg;
>> -       char *buf;
>> +       dma_addr_t              dma;
>> +       size_t                  len;
>> +       char                    *buf;
>>  };
>
> Should this struct really be named "pl011_sgbuf" after this?
>
> It breaks Rusty Russell's API naming rules.
>
> What about renaming it pl011_dmabuf?

OK

>
>> @@ -369,18 +371,11 @@ static int pl011_fifo_to_tty(struct uart_amba_port *uap)
>>  static int pl011_sgbuf_init(struct dma_chan *chan, struct pl011_sgbuf *sg,
>
> And then parameters and variables named "sg" don't make much sense
> either, so just db or so for "dma buffer" if you wanna keep it short.

I am preparing a v2.

Thanks,

Gregory

>
> Yours,
> Linus Walleij

-- 
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com

      reply	other threads:[~2023-11-22 14:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-22  7:45 [PATCH] ARM: PL011: Fix DMA support Gregory CLEMENT
2023-11-22 13:43 ` Ilpo Järvinen
2023-11-22 14:48   ` Gregory CLEMENT
2023-11-22 14:51 ` Linus Walleij
2023-11-22 14:57   ` Gregory CLEMENT [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=8734wxhm3h.fsf@BL-laptop \
    --to=gregory.clement@bootlin.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=tawfik.bayouk@mobileye.com \
    --cc=theo.lebrun@bootlin.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=vladimir.kondratiev@mobileye.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