Bug 92488

Summary: add support for read look-ahead ATA settings
Product: udisks Reporter: Tom Yan <tom.ty89>
Component: generalAssignee: Martin Pitt <martin.pitt>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Working patch for udisks2 to set ATA Read Look-ahead
Working patch for udisks2 to set ATA Read Look-ahead (with correct get bits)

Description Tom Yan 2015-10-16 01:56:11 UTC
Read look-ahead is pretty much a standard ATA feature setting just like write cache or APM. Both hdparm (-A) and smartctl (--get|set lookahead) supports it. Would be nice if udisks2 can support this as well.

Note that this is NOT equivalence of "Read Cache Disable (RCD)" in SCSI but "Disable Read Ahead (DRA)".

FYR, I also requested better support for it on libata: https://bugzilla.kernel.org/show_bug.cgi?id=105861
Comment 1 Martin Pitt 2015-10-16 04:46:16 UTC
What's wrong with actually using hdparm for this? udisks2's primary purpose is to provide access to partitions to user sessions via D-Bus. This sounds like needlessly duplicating already existing functionality, and it would also stop making udisks D-Bus activatable.

So I'm leaning towards a "wontfix" here.
Comment 2 Tom Yan 2015-10-16 08:50:29 UTC
There's nothing wrong with using hdparm or smartctl for this. It's just one of udisksd purposes is to restore ATA settings since they are often volatile to power cycles (and hdparm / smartctl is not a daemon):

https://bugzilla.kernel.org/show_bug.cgi?id=102471
https://bugzilla.kernel.org/show_bug.cgi?id=105281

(Duplicate of a LONG opened bug report I filed yesterday, in case you missed: https://bugs.freedesktop.org/show_bug.cgi?id=92479)

I am pretty shocked when I see this reply since this is clearly documented in DRIVE CONFIGURATION of udisks(8) and you seem to have no idea at all.

There are even SERIES of rework on this to avoid inappropriate udev/ata_id dependency since this commit:
http://cgit.freedesktop.org/udisks/commit/src/udiskslinuxdriveata.c?id=406d0f785d3c7af63481dcf1b0d02c5d26df1753

I don't see how this will stop udisks from being d-bus activatable.
Comment 3 Tom Yan 2015-10-16 17:29:22 UTC
Created attachment 118928 [details] [review]
Working patch for udisks2 to set ATA Read Look-ahead

Might post a patch to gnome-disks as well if this is accepted. Shouldn't be too difficult (well, except i18n? :P)
Comment 4 Tom Yan 2015-10-17 20:49:24 UTC
Created attachment 118940 [details] [review]
Working patch for udisks2 to set ATA Read Look-ahead (with correct get bits)

oops read_lookahead_supported and read_lookahead_enabled should be bit 6 in word 82 and word 85 instead of bit 3. corrected now.
Comment 5 Martin Pitt 2016-02-29 15:58:52 UTC
Thanks! Pushed as https://cgit.freedesktop.org/udisks/commit/?id=7c7a43df1031

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.