[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKb7UvjE-xLBpV637qQ8DG7odnoLvaPgBK5QRThiGYZF_tgwFg@mail.gmail.com>
Date: Tue, 23 Jul 2024 13:03:54 -0400
From: Ilia Mirkin <imirkin@...m.mit.edu>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: nouveau@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
kernel-janitors@...r.kernel.org, Daniel Vetter <daniel@...ll.ch>,
Danilo Krummrich <dakr@...hat.com>, David Airlie <airlied@...il.com>, Karol Herbst <kherbst@...hat.com>,
Lyude Paul <lyude@...hat.com>, LKML <linux-kernel@...r.kernel.org>,
Markus Elfring <Markus.Elfring@....de>
Subject: Re: [PATCH] drm/nouveau/debugfs: Simplify character output in nouveau_debugfs_vbios_image()
On Tue, Jul 23, 2024 at 12:58 PM Christophe JAILLET
<christophe.jaillet@...adoo.fr> wrote:
>
> Le 15/07/2024 à 15:15, Ilia Mirkin a écrit :
> > On Mon, Jul 15, 2024 at 7:49 AM Markus Elfring <Markus.Elfring@....de> wrote:
> >>
> >> From: Markus Elfring <elfring@...rs.sourceforge.net>
> >> Date: Mon, 15 Jul 2024 13:36:54 +0200
> >>
> >> Single characters should be put into a sequence.
> >> Thus use the corresponding function “seq_putc” for one selected call.
> >>
> >> This issue was transformed by using the Coccinelle software.
> >>
> >> Suggested-by: Christophe Jaillet <christophe.jaillet@...adoo.fr>
> >> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
> >> ---
> >> drivers/gpu/drm/nouveau/nouveau_debugfs.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
> >> index e83db051e851..931b62097366 100644
> >> --- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c
> >> +++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
> >> @@ -42,7 +42,7 @@ nouveau_debugfs_vbios_image(struct seq_file *m, void *data)
> >> int i;
> >>
> >> for (i = 0; i < drm->vbios.length; i++)
> >> - seq_printf(m, "%c", drm->vbios.data[i]);
> >> + seq_putc(m, drm->vbios.data[i]);
> >
> > Is there some reason this whole thing isn't just
> >
> > seq_write(m, drm->vbios.data, drm->vbios.length)
>
> Hi,
>
> I don't know if my answer is relevant or not here but:
> for () seq_putc(); ==> will fill 'm' with everything that fits in
> and
> seq_write() ==> is all or nothing. So if 'm' is too small, then
> nothing will be appended.
>
> I've not looked at the calling tree, but I would expect 'm' to be able
> to have PAGE_SIZE chars, so most probably 4096.
>
> And having gpu + "vbios.rom", I would expect it to be bigger than 4096.
>
> If I'm correct, then changing for seq_write() would just show... nothing.
>
>
> I don't know if it can happen., but testing should be easy enough to
> figure it out.
The vbios can definitely be much much larger than 4k. But it does
currently work as-is, i.e. you don't just get the first 4k, you get
everything. So I think there's some internal resizing/extension/etc
going on.
But I totally agree -- testing required here. Not sure if the author
has done that.
Cheers,
-ilia
Powered by blists - more mailing lists