All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bug,200917] 4.18 regression: I/O error on external icybox disk enclosures
@ 2018-10-07 15:11 Klaus Kusche
  0 siblings, 0 replies; 6+ messages in thread
From: Klaus Kusche @ 2018-10-07 15:11 UTC (permalink / raw)
  To: Alan Stern; +Cc: oneukum, sellis, linux-usb

Hello,

On 03/10/2018 16:02, Alan Stern wrote:
> Well, what happens if you add only US_FL_BROKEN_FUA without
> US_FL_IGNORE_UAS?  Does it work?

Tried all four combinations with gentoo 4.18.12.
Just US_FL_IGNORE_UAS fails with the error message in the original bug report.

The other three combinations (both flags removed, both flags set,
just US_FL_BROKEN_FUA set) work, at least for a quick test with ext4.

My guess:
Without US_FL_IGNORE_UAS (i.e. when using UAS),
the FUA command triggering the error is not used at all,
so US_FL_BROKEN_FUA doesn't make a difference.

> For that matter, does your kernel config include the uas driver?

Yes, it does.


I think we have to wait for sellis@redhat.com .
He could tell why he added US_FL_IGNORE_UAS,
if it's really needed, and why it was not included in mainline.

However, as US_FL_BROKEN_FUA is set for JMS567,
it is perhaps a good idea to set it for JMS566, too,
independent of US_FL_IGNORE_UAS (which is not set for JMS567).

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug,200917] 4.18 regression: I/O error on external icybox disk enclosures
@ 2018-10-07 20:27 Alan Stern
  0 siblings, 0 replies; 6+ messages in thread
From: Alan Stern @ 2018-10-07 20:27 UTC (permalink / raw)
  To: Klaus Kusche; +Cc: oneukum, sellis, linux-usb

On Sun, 7 Oct 2018, Klaus Kusche wrote:

> Hello,
> 
> On 03/10/2018 16:02, Alan Stern wrote:
> > Well, what happens if you add only US_FL_BROKEN_FUA without
> > US_FL_IGNORE_UAS?  Does it work?
> 
> Tried all four combinations with gentoo 4.18.12.
> Just US_FL_IGNORE_UAS fails with the error message in the original bug report.
> 
> The other three combinations (both flags removed, both flags set,
> just US_FL_BROKEN_FUA set) work, at least for a quick test with ext4.
> 
> My guess:
> Without US_FL_IGNORE_UAS (i.e. when using UAS),
> the FUA command triggering the error is not used at all,
> so US_FL_BROKEN_FUA doesn't make a difference.

That may or may not be correct.  A usbmon trace would tell us.

> > For that matter, does your kernel config include the uas driver?
> 
> Yes, it does.
> 
> 
> I think we have to wait for sellis@redhat.com .
> He could tell why he added US_FL_IGNORE_UAS,
> if it's really needed, and why it was not included in mainline.

Good point.

> However, as US_FL_BROKEN_FUA is set for JMS567,
> it is perhaps a good idea to set it for JMS566, too,
> independent of US_FL_IGNORE_UAS (which is not set for JMS567).

Agreed.  Especially since we know that FUA does trigger a problem when
UAS isn't used.

Alan Stern

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug,200917] 4.18 regression: I/O error on external icybox disk enclosures
@ 2018-10-03 14:02 Alan Stern
  0 siblings, 0 replies; 6+ messages in thread
From: Alan Stern @ 2018-10-03 14:02 UTC (permalink / raw)
  To: Klaus Kusche; +Cc: oneukum, sellis, linux-usb

On Wed, 3 Oct 2018, Klaus Kusche wrote:

> Hello,
> 
> On 09/09/2018 21:28, Alan Stern wrote:
> > On Sun, 9 Sep 2018, Klaus Kusche wrote:
> > 
> >> Hello,
> >>
> >> On 01/09/2018 17:38, Alan Stern wrote:
> >>> However, the USB layer does set certain quirk bits which can cause
> >>> those other parts to avoid sending certain commands.  Perhaps your
> >>> controller needs the BROKEN_FUA flag (see the existing entries in
> >>> drivers/usb/storage/unusual_devs.h with that flag).
> >>
> >> The following seems to fix the problem (I don't know if I did it right):
> >>
> >> --- unusual_uas.h.orig  2018-09-09 10:31:20.440751625 +0200
> >> +++ unusual_uas.h       2018-09-09 10:32:30.491381466 +0200
> >> @@ -95,7 +95,7 @@
> >>                   "JMicron",
> >>                   "JMS566",
> >>                   USB_SC_DEVICE, USB_PR_DEVICE, NULL,
> >> -               US_FL_NO_REPORT_OPCODES | US_FL_IGNORE_UAS),
> >> +               US_FL_NO_REPORT_OPCODES | US_FL_IGNORE_UAS | US_FL_BROKEN_FUA),
> >>
> >>    /* Reported-by: Hans de Goede <hdegoede@redhat.com> */
> >>    UNUSUAL_DEV(0x4971, 0x1012, 0x0000, 0x9999,
> > 
> > Okay.  You should submit this in the proper format for inclusion in the
> > kernel.  Follow the instructions in
> > Documentation/process/submitting-patches.rst.
> 
> Sorry for the long delay, I was not able to spare some time earlier
> (winter semester has started...).
> 
> I just wanted to submit the patch as advised above,
> but noticed that it does not apply to the current usb git tree:
> 
> Both the usb tree and linus's tree do not have US_FL_IGNORE_UAS
> set for device JMS566 (357d:7788).
> So I checked where my version came from and found a patch
> which gentoo applies to all its kernels, but which is not mainline:
> 
> --- a/drivers/usb/storage/unusual_uas.h
> +++ b/drivers/usb/storage/unusual_uas.h
> @@ -141,12 +141,15 @@ UNUSUAL_DEV(0x2109, 0x0711, 0x0000, 0x9999,
>   		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
>   		US_FL_NO_ATA_1X),
> 
> -/* Reported-by: Takeo Nakayama <javhera@gmx.com> */
> +/*
> + * Initially Reported-by: Takeo Nakayama <javhera@gmx.com>
> + * UAS Ignore Reported by Steven Ellis <sellis@redhat.com>
> + */
>   UNUSUAL_DEV(0x357d, 0x7788, 0x0000, 0x9999,
>   		"JMicron",
>   		"JMS566",
>   		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
> -		US_FL_NO_REPORT_OPCODES),
> +		US_FL_NO_REPORT_OPCODES | US_FL_IGNORE_UAS),
> 
>   /* Reported-by: Hans de Goede <hdegoede@redhat.com> */
>   UNUSUAL_DEV(0x4971, 0x1012, 0x0000, 0x9999,
> 
> So is my patch still relevant or is it obsolete?
> Shall I add only US_FL_BROKEN_FUA even without US_FL_IGNORE_UAS,
> or shall I add both flags?
> 
> (I noticed that US_FL_BROKEN_FUA without US_FL_IGNORE_UAS is set
> for two entries for "JMS567").

Well, what happens if you add only US_FL_BROKEN_FUA without 
US_FL_IGNORE_UAS?  Does it work?

For that matter, does your kernel config include the uas driver?

Alan Stern

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug,200917] 4.18 regression: I/O error on external icybox disk enclosures
@ 2018-10-03 10:18 Klaus Kusche
  0 siblings, 0 replies; 6+ messages in thread
From: Klaus Kusche @ 2018-10-03 10:18 UTC (permalink / raw)
  To: Alan Stern, oneukum, sellis; +Cc: linux-usb

Hello,

On 09/09/2018 21:28, Alan Stern wrote:
> On Sun, 9 Sep 2018, Klaus Kusche wrote:
> 
>> Hello,
>>
>> On 01/09/2018 17:38, Alan Stern wrote:
>>> However, the USB layer does set certain quirk bits which can cause
>>> those other parts to avoid sending certain commands.  Perhaps your
>>> controller needs the BROKEN_FUA flag (see the existing entries in
>>> drivers/usb/storage/unusual_devs.h with that flag).
>>
>> The following seems to fix the problem (I don't know if I did it right):
>>
>> --- unusual_uas.h.orig  2018-09-09 10:31:20.440751625 +0200
>> +++ unusual_uas.h       2018-09-09 10:32:30.491381466 +0200
>> @@ -95,7 +95,7 @@
>>                   "JMicron",
>>                   "JMS566",
>>                   USB_SC_DEVICE, USB_PR_DEVICE, NULL,
>> -               US_FL_NO_REPORT_OPCODES | US_FL_IGNORE_UAS),
>> +               US_FL_NO_REPORT_OPCODES | US_FL_IGNORE_UAS | US_FL_BROKEN_FUA),
>>
>>    /* Reported-by: Hans de Goede <hdegoede@redhat.com> */
>>    UNUSUAL_DEV(0x4971, 0x1012, 0x0000, 0x9999,
> 
> Okay.  You should submit this in the proper format for inclusion in the
> kernel.  Follow the instructions in
> Documentation/process/submitting-patches.rst.

Sorry for the long delay, I was not able to spare some time earlier
(winter semester has started...).

I just wanted to submit the patch as advised above,
but noticed that it does not apply to the current usb git tree:

Both the usb tree and linus's tree do not have US_FL_IGNORE_UAS
set for device JMS566 (357d:7788).
So I checked where my version came from and found a patch
which gentoo applies to all its kernels, but which is not mainline:


So is my patch still relevant or is it obsolete?
Shall I add only US_FL_BROKEN_FUA even without US_FL_IGNORE_UAS,
or shall I add both flags?

(I noticed that US_FL_BROKEN_FUA without US_FL_IGNORE_UAS is set
for two entries for "JMS567").

--- a/drivers/usb/storage/unusual_uas.h
+++ b/drivers/usb/storage/unusual_uas.h
@@ -141,12 +141,15 @@ UNUSUAL_DEV(0x2109, 0x0711, 0x0000, 0x9999,
  		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
  		US_FL_NO_ATA_1X),

-/* Reported-by: Takeo Nakayama <javhera@gmx.com> */
+/*
+ * Initially Reported-by: Takeo Nakayama <javhera@gmx.com>
+ * UAS Ignore Reported by Steven Ellis <sellis@redhat.com>
+ */
  UNUSUAL_DEV(0x357d, 0x7788, 0x0000, 0x9999,
  		"JMicron",
  		"JMS566",
  		USB_SC_DEVICE, USB_PR_DEVICE, NULL,
-		US_FL_NO_REPORT_OPCODES),
+		US_FL_NO_REPORT_OPCODES | US_FL_IGNORE_UAS),

  /* Reported-by: Hans de Goede <hdegoede@redhat.com> */
  UNUSUAL_DEV(0x4971, 0x1012, 0x0000, 0x9999,

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug,200917] 4.18 regression: I/O error on external icybox disk enclosures
@ 2018-09-09 19:28 Alan Stern
  0 siblings, 0 replies; 6+ messages in thread
From: Alan Stern @ 2018-09-09 19:28 UTC (permalink / raw)
  To: Klaus Kusche; +Cc: linux-usb

On Sun, 9 Sep 2018, Klaus Kusche wrote:

> Hello,
> 
> On 01/09/2018 17:38, Alan Stern wrote:
> > However, the USB layer does set certain quirk bits which can cause
> > those other parts to avoid sending certain commands.  Perhaps your
> > controller needs the BROKEN_FUA flag (see the existing entries in
> > drivers/usb/storage/unusual_devs.h with that flag).
> 
> The following seems to fix the problem (I don't know if I did it right):
> 
> --- unusual_uas.h.orig  2018-09-09 10:31:20.440751625 +0200
> +++ unusual_uas.h       2018-09-09 10:32:30.491381466 +0200
> @@ -95,7 +95,7 @@
>                  "JMicron",
>                  "JMS566",
>                  USB_SC_DEVICE, USB_PR_DEVICE, NULL,
> -               US_FL_NO_REPORT_OPCODES | US_FL_IGNORE_UAS),
> +               US_FL_NO_REPORT_OPCODES | US_FL_IGNORE_UAS | US_FL_BROKEN_FUA),
> 
>   /* Reported-by: Hans de Goede <hdegoede@redhat.com> */
>   UNUSUAL_DEV(0x4971, 0x1012, 0x0000, 0x9999,

Okay.  You should submit this in the proper format for inclusion in the 
kernel.  Follow the instructions in 
Documentation/process/submitting-patches.rst.

> When plugging in the USB enclosure, syslog now says:
> 
> Sep 09 10:36:51 lap kernel: sd 6:0:0:0: [sdc] Disabling FUA
> Sep 09 10:36:51 lap kernel: sd 6:0:0:0: [sdc] Write cache: enabled, read cache: 
> enabled, doesn't support DPO or FUA
> 
> With that, the disk can be mounted, read and written
> with no error at the user level.
> 
> There is just one irritating message in the syslog:
> 
> Sep 09 10:42:53 lap kernel: sd 6:0:0:0: [sdc] Synchronizing SCSI cache
> Sep 09 10:42:53 lap kernel: sd 6:0:0:0: [sdc] Synchronize Cache(10) failed: 
> Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK

JMicron devices are notorious for not obeying the standard requirements
for USB and SCSI.  That error is unfortunate, but I don't think much
can be done about it.  As long as you're careful about not unplugging
the drive or turning it off while a filesystem is still mounted, you
should be okay.

Alan Stern

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug,200917] 4.18 regression: I/O error on external icybox disk enclosures
@ 2018-09-09  8:57 Klaus Kusche
  0 siblings, 0 replies; 6+ messages in thread
From: Klaus Kusche @ 2018-09-09  8:57 UTC (permalink / raw)
  To: Alan Stern; +Cc: linux-usb

Hello,

On 01/09/2018 17:38, Alan Stern wrote:
> However, the USB layer does set certain quirk bits which can cause
> those other parts to avoid sending certain commands.  Perhaps your
> controller needs the BROKEN_FUA flag (see the existing entries in
> drivers/usb/storage/unusual_devs.h with that flag).

The following seems to fix the problem (I don't know if I did it right):


When plugging in the USB enclosure, syslog now says:

Sep 09 10:36:51 lap kernel: sd 6:0:0:0: [sdc] Disabling FUA
Sep 09 10:36:51 lap kernel: sd 6:0:0:0: [sdc] Write cache: enabled, read cache: 
enabled, doesn't support DPO or FUA

With that, the disk can be mounted, read and written
with no error at the user level.

There is just one irritating message in the syslog:

Sep 09 10:42:53 lap kernel: sd 6:0:0:0: [sdc] Synchronizing SCSI cache
Sep 09 10:42:53 lap kernel: sd 6:0:0:0: [sdc] Synchronize Cache(10) failed: 
Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK

--- unusual_uas.h.orig  2018-09-09 10:31:20.440751625 +0200
+++ unusual_uas.h       2018-09-09 10:32:30.491381466 +0200
@@ -95,7 +95,7 @@
                 "JMicron",
                 "JMS566",
                 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
-               US_FL_NO_REPORT_OPCODES | US_FL_IGNORE_UAS),
+               US_FL_NO_REPORT_OPCODES | US_FL_IGNORE_UAS | US_FL_BROKEN_FUA),

  /* Reported-by: Hans de Goede <hdegoede@redhat.com> */
  UNUSUAL_DEV(0x4971, 0x1012, 0x0000, 0x9999,

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-10-07 20:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-07 15:11 [Bug,200917] 4.18 regression: I/O error on external icybox disk enclosures Klaus Kusche
  -- strict thread matches above, loose matches on Subject: below --
2018-10-07 20:27 Alan Stern
2018-10-03 14:02 Alan Stern
2018-10-03 10:18 Klaus Kusche
2018-09-09 19:28 Alan Stern
2018-09-09  8:57 Klaus Kusche

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.