[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yu7TGDYTyzFLoVe4@chromium.org>
Date: Sat, 6 Aug 2022 13:46:16 -0700
From: Jack Rosenthal <jrosenth@...omium.org>
To: Stephen Boyd <swboyd@...omium.org>
Cc: chrome-platform@...ts.linux.dev, linux-kernel@...r.kernel.org,
Tzung-Bi Shih <tzungbi@...nel.org>,
Guenter Roeck <groeck@...omium.org>,
Julius Werner <jwerner@...omium.org>
Subject: Re: [PATCH v7] firmware: google: Implement cbmem in sysfs driver
On 2022-08-04 at 15:59 -0500, Stephen Boyd wrote:
> I suspect this won't work because the driver can be unbound, and thus
> the mapping can be destroyed by devm, but then the kobject and sysfs
> file like 'mem' can be held by userspace after the driver is unbound.
> Userspace access after that time will try to read/write unmapped memory.
When the driver is unbound, read()/write() will return -ENODEV, and
mmap() isn't supported.
> Why not make this in the bus driver (coreboot-table.c)? In fact, most
> things could probably be created there instead of in a 'driver' that
> really isn't doing much 'driving' at all.
In v8, I moved the coreboot_kobj to coreboot-table.c. I imagine in the
future we could move some of the other things (e.g., "vpd") under this
object for consistency. So now the structure is:
/sys/firmware/coreboot/cbmem/<id>/...
Powered by blists - more mailing lists