[lkml]   [2019]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] drivers/ata: print trim features at device initialization
On Sat, 2019-06-08 at 17:13 +0300, Konstantin Khlebnikov wrote:
> > On 08.06.2019 11:25, Christoph Hellwig wrote:> On Fri, Jun 07, 2019
> > at 10:34:39AM +0300, Konstantin Khlebnikov wrote:
> > >
> > > Do we really need to spam dmesg with even more ATA crap? What
> > about
> > > a sysfs file that can be read on demand instead?
> > >
> >
> > Makes sense.
> >
> > Trim state is exposed for ata_device:
> > /sys/class/ata_device/devX.Y/trim
> > but there is no link from scsi device to ata device so they hard to
> > match.
> >
> > I'll think about it.
> Nope. There is no obvious way to link scsi device with ata_device.
> ata_device is built on top of "transport_class" and
> "attribute_container".
> This some extremely over engineered sysfs framework used only in
> ata/scsi. I don't want to touch this.

You don't need to know any of that. The problem is actually when the
ata transport classes were first created, the devices weren't properly
parented. What should have happened, like every other transport class,
is that the devices should have descended down to the scsi device as
the leaf in an integrated fashion. Instead, what we seem to have is
three completely separate trees.

So if you look at a SAS device, you see from the pci device:


But if you look at a SATA device, you see three separate paths:


Instead of an integrated tree

Unfortunately, this whole thing is unfixable now. If I integrate the
tree properly, the separate port and link directories will get subsumed
and we won't be able to recover them with judicious linking so scripts
relying on them will break. The best we can probably do is add
additional links with what we have.

To follow the way we usually do it, there should be a link from the ata
device to the scsi target, but that wouldn't help you find the "trim"
files, so it sounds like you want a link from the scsi device to the ata device, which would?


 \ /
  Last update: 2019-06-09 23:38    [W:0.064 / U:2.656 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site