public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: Alban Browaeys <alban.browaeys@gmail.com>
To: Oliver Neukum <oneukum@suse.com>, linux-usb@vger.kernel.org
Subject: Remove NO_ATA_1X quirk for at least a few Seagate external drives to fix smartctl with uas ?
Date: Fri, 14 Jun 2024 03:20:17 +0200	[thread overview]
Message-ID: <4f4f814d22f491cc1fe051a33fea8352ee5dc5df.camel@gmail.com> (raw)
In-Reply-To: <db0adddf85d29d50c3930342bd4b09fc287091b8.camel@gmail.com>

I found where the quirk from usb-storage.quirks applies to uas:
uas_probe drivers/usb/storage/uas.c u64 dev_flags;
> uas_use_uas_driver(intf, id, &dev_flags) drivers/usb/storage/uas-detect.h u64 flags = id->driver_info;
	> usb_stor_adjust_quirks(udev, &flags); 

Thus I found why the patch does not work.
The fix to get smartctl working is not to set NO_REPORT_LUNS (though
this lead me to debug why and find why smarttl was broken).

I found that with the NO_REPORT_LUNS patch the flags set by
usb_stor_adjust_quirks were 12000000, ie:
	US_FLAG(NO_ATA_1X,      0x02000000
	US_FLAG(NO_REPORT_LUNS, 0x10000000)
and without the patch the value is likely: 0x02000000

But with the working "0x0bc2:0x2037:j" usb-storage.quirks the flags
value was 10000000, thus the NO_ATA_1X was removed.

So I though that maybe teh issue was with NO_ATA_1X being applied by
default and not with a missing NO_REPORT_LUNS.

So I tried:
 echo -n "0x0bc2:0x2037:" | sudo tee  /sys/module/usb_storage/parameters/quirks
and I get a flags value of "0" and smartctl is working.

sudo smartctl -i /dev/sdd
smartctl 7.4 2023-08-01 r5530 [x86_64-linux-6.10.0-rc3+] (local build)
Copyright (C) 2002-23, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Seagate Barracuda 2.5 5400
Device Model:     ST4000LM024-2AN17V
Serial Number:    WCKAEWZZ
LU WWN Device Id: 5 000c50 0e732b6d8
Firmware Version: 0001
User Capacity:    4 000 787 030 016 bytes [4,00 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    5526 rpm
Form Factor:      2.5 inches
Device is:        In smartctl database 7.3/5528
ATA Version is:   ACS-3 T13/2161-D revision 5
SATA Version is:  SATA 3.1, 6.0 Gb/s (current: 6.0 Gb/s)
Local Time is:    Fri Jun 14 02:58:20 2024 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled



The issue is US_FL_NO_ATA_1X is harcoded in uas_use_uas_driver drivers/usb/storage/uas-detect.h.
/* All Seagate disk enclosures have broken ATA pass-through support */
if (le16_to_cpu(udev->descriptor.idVendor) == 0x0bc2)
        flags |= US_FL_NO_ATA_1X;

How can I confirm that indeed at least my two Seagate drives are fine
with US_FL_NO_ATA_1X and how would you suggest disabling this flag if
these drives are stable? Add a new flag to force enable US_FL_NO_ATA_1X
via quirks only for specific Seagate drives?

Regards,
Alban

      reply	other threads:[~2024-06-14  1:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-10 19:25 add NO_REPORT_LUNS quirk for at least a few Seagate external drives to fix smartctl with uas Alban Browaeys
2024-06-11  6:08 ` Greg KH
2024-06-11  8:21 ` Oliver Neukum
2024-06-12  1:39   ` Alban Browaeys
2024-06-12 15:13     ` Alban Browaeys
2024-06-14  0:18       ` Alban Browaeys
2024-06-14  1:20         ` Alban Browaeys [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4f4f814d22f491cc1fe051a33fea8352ee5dc5df.camel@gmail.com \
    --to=alban.browaeys@gmail.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=oneukum@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox