[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CA+wEVJZaJEXMwQ3E0WKqQCMUR4Fsa=83PuarT+72c6nA1qSKAQ@mail.gmail.com>
Date: Fri, 22 Aug 2025 17:14:25 +0200
From: Gabriele Paoloni <gpaoloni@...hat.com>
To: Greg KH <gregkh@...uxfoundation.org>
Cc: arnd@...db.de, linux-kernel@...r.kernel.org,
safety-architecture@...ts.elisa.tech
Subject: Re: [RFC PATCH] /dev/mem: Add initial documentation of memory_open()
and mem_fops
On Thu, Aug 21, 2025 at 7:35 PM Greg KH <gregkh@...uxfoundation.org> wrote:
>
> On Thu, Aug 21, 2025 at 07:04:19PM +0200, Gabriele Paoloni wrote:
> > This patch proposes initial kernel-doc documentation for memory_open()
> > and most of the functions in the mem_fops structure.
> > The format used for the **Description** intends to define testable
> > function's expectations and Assumptions of Use to be met by the
> > user of the function.
> >
> > Signed-off-by: Gabriele Paoloni <gpaoloni@...hat.com>
> > ---
> > I have a couple of comments from this documentation activity:
> > 1) Shouldn't the check in read_mem() <<if (p != *ppos)>> return
> > -EFBIG (as done in write_mem())?
>
> I think that check implies you don't want to read any more memory,
> right? Try changing it and see what happens :)
Right I see, 0 is better to gracefully terminate a read routine of
a program that may have read the whole physical range..
>
> > 2) There is a note in memory_lseek() that states the return value
> > to be (0) for negative addresses, however I cannot see how that
> > would happen in the current implementation...
>
> How that you could have a negative address, or how you would return 0?
Today the note above memory_lseek() states
* The memory devices use the full 32/64 bits of the offset, and so we cannot
* check against negative addresses: they are ok. The return value is weird,
* though, in that case (0).
I interpret this as "if offset and orig lead to an f_pos that is
negative the function
returns 0"....however I cannot see where this happen...
>
> Also, you should cc: the mm developers, they touch this file all the
> time and know it quite well (recent changes to /dev/zero just got added
> in the past few days from them.)
Sorry, I just used the addresses returned by get_maintainers...
would adding linux-mm@...ck.org work ok?
Thanks
Gab
> thanks,
>
> greg k-h
>
Powered by blists - more mailing lists