Re: [PATCH v4] scsi: ufs: Make sysfs attributes writable

From: Evan Green
Date: Thu Sep 27 2018 - 19:17:17 EST


On Thu, Sep 27, 2018 at 7:01 AM Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
>
> On Thu, Sep 27, 2018 at 06:32:47AM +0000, Avri Altman wrote:
> > Also, in this context there is the series in
> > https://www.spinics.net/lists/linux-scsi/msg123479.html
> > which allows to send UPIUs via a bsg device.
> >
> > It's not a provisioning series per-se like Evan's and Sayali's.
> > It covers the provisioning functionality,
> > But also allow to send task management UPIU, and UIC commands,
> > Which can be used for testing and validation.
>
> And as someone having been involved with review of a few different
> UFS provisioning bits this is what I think we should be merging.
>
> Instead of being in a rat race of adding ever new sysfs or configfs
> attributes for things that don't matter to normal driver operation
> I'd rather have a relatively clean pass through interface and move
> policy to userspace. Especially given that there are plenty of
> vendor specific commands at these levels as well.

There's no policy in my patches (nor Sayali's), nor are there any
vendor-specific commands here. The sysfs interface has exposed knobs
defined by the UFS specification, which to me seems like the kernel
providing a sane abstraction of device functionality. I don't see
there being a rat race, as these attributes and the config descriptor
are all that's needed to provision a device, and any reasonable future
versions of the UFS spec would likely be backwards compatible with
respect to attributes and flags.

The patches Avri linked to seem fine as well, but I don't see why
there's not room for both the "roll your own driver completely in user
mode" approach, and the "kernel provides a reasonable abstraction of
device functionality" approach to co-exist. We do the same sort of
thing for simple buses like I2C for example, where you can both write
a kernel driver or do bus transactions directly from user mode.

-Evan