Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2496956imm; Wed, 16 May 2018 13:57:16 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq0y2fwHPXCLkTRSWjv1C3lA6F4i8MGzbqNBh3qo36ABvPh9pKqb6w3dNhEttfd54uPWP6c X-Received: by 2002:a65:5d8e:: with SMTP id f14-v6mr1973822pgt.25.1526504236934; Wed, 16 May 2018 13:57:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526504236; cv=none; d=google.com; s=arc-20160816; b=b8YZWtWK0GMY8+7g2wDmjmac1An6PC3206Qeq8UVJ0ilTu+FlRfbiBnIk7EZraRwEQ mkR3wwnIqkOgnIMoz71b0yT6A24BMy2p+0iDAyEYmU7vfMVinrlhX80316LnH0C/qbpm 0Ml6PvEbHytkbJ0AkUNRa09pOeOhxxmiLBpR6Ntg0uOBKRE0Zr2ROXSfmp3BG942u21w g5RzACPQ+l+j+MSg6fdlxDnIYaLHlzE9tEy95Knud79G/v1jepFbUervU5LbGI9wgZG4 HjgexvoliTAajofpnBin3VVV4crOX2h8H8eW0M49GWhQPkRVyAqP+xpzSYejvjlSZKvq Nqcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date:arc-authentication-results; bh=ZMeLjlUV38JsYpJMEA2ceUHlj0RPZQrifOV9LmHcAbA=; b=HGA2wb/Iyh0fAmgFen27jawCM80GqBoXQqmoqc8e1p6rwB6gC1OSd0Fk4v/eg9XOsX e1eZb99AET2SkNkR9zuToqBZlPCdZRvkaATKLx7yZCEJDX9YViUi9sCU0TlytB7ofoO7 06AY2IDG6rF+pPe5I6DOXwprMEC1P9wpEY8W0JNUVEuvh2YobZQbwToQFPGDU48iatQR XHjMklTfO1TOg9+mj4mWCdge+0DZIm/u7QWCEIG+y0oUN9W5NOZ+iXvL8MKwRDVF/5yj iDpL6rfoLcavB8cqRHOcFNWeft5vjC/qYQxBHW00EBWV1BK1RyRGwO0YsRDd5zgqeMhx rPGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c131-v6si3430750pfg.108.2018.05.16.13.57.02; Wed, 16 May 2018 13:57:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752073AbeEPUzR (ORCPT + 99 others); Wed, 16 May 2018 16:55:17 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:60250 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751198AbeEPUzQ (ORCPT ); Wed, 16 May 2018 16:55:16 -0400 Received: (qmail 6956 invoked by uid 2102); 16 May 2018 16:55:14 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 16 May 2018 16:55:14 -0400 Date: Wed, 16 May 2018 16:55:14 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Alexander Kappner cc: gregkh@linuxfoundation.org, , , Subject: Re: [PATCH] usb-storage: Add quirks to make G-Technology "G-Drive" work In-Reply-To: <1526500880-26512-1-git-send-email-agk@godking.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 16 May 2018, Alexander Kappner wrote: > The "G-Drive" (sold by G-Technology) external USB 3.0 drive > hangs on write access under UAS: > > [ 136.079121] sd 15:0:0:0: [sdi] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE > [ 136.079144] sd 15:0:0:0: [sdi] tag#0 Sense Key : Illegal Request [current] > [ 136.079152] sd 15:0:0:0: [sdi] tag#0 Add. Sense: Invalid field in cdb > [ 136.079176] sd 15:0:0:0: [sdi] tag#0 CDB: Write(16) 8a 08 00 00 00 00 00 00 00 00 00 00 00 08 00 00 > [ 136.079180] print_req_error: critical target error, dev sdi, sector 0 > [ 136.079183] Buffer I/O error on dev sdi, logical block 0, lost sync page write > [ 136.173148] EXT4-fs (sdi): mounted filesystem with ordered data mode. Opts: (null) > [ 140.583998] sd 15:0:0:0: [sdi] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE > [ 140.584010] sd 15:0:0:0: [sdi] tag#0 Sense Key : Illegal Request [current] > [ 140.584016] sd 15:0:0:0: [sdi] tag#0 Add. Sense: Invalid field in cdb > [ 140.584022] sd 15:0:0:0: [sdi] tag#0 CDB: Write(16) 8a 08 00 00 00 00 e8 c4 00 18 00 00 00 08 00 00 > [ 140.584025] print_req_error: critical target error, dev sdi, sector 3905159192 > [ 140.584044] print_req_error: critical target error, dev sdi, sector 3905159192 > [ 140.584052] Aborting journal on device sdi-8. That's kind of weird. Does the drive work under Windows in UAS mode? If so, why are the WRITE(16) commands failing under Linux? > The proposed patch adds compatibility quirks. Because the drive requires two > quirks (one to disable UAS, and another to work with usb-storage), adding this > under unusual_devs.h and not unusual_uas.h so kernels compiled without UAS > receive the quirk. That doesn't quite make sense. Since you prevent the uas driver from binding to this device, it will end up using usb-storage no matter how the kernel was built. Therefore the second quirk flag has to go into unusual_devs.h no matter what. > With the patch, the drive works reliably > (tested on NEC Corporation uPD720200 USB 3.0 host controller). You don't describe the second quirk flag at all. Are you sure it is needed? > Signed-off-by: Alexander Kappner > --- > drivers/usb/storage/unusual_devs.h | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h > index 747d3a9..b8661a1 100644 > --- a/drivers/usb/storage/unusual_devs.h > +++ b/drivers/usb/storage/unusual_devs.h > @@ -2321,6 +2321,15 @@ UNUSUAL_DEV( 0x4146, 0xba01, 0x0100, 0x0100, > "Micro Mini 1GB", > USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_NOT_LOCKABLE ), > > +/* "G-DRIVE" external HDD hangs on write without these. > + * Reported-by: Alexander Kappner > + */ > +UNUSUAL_DEV(0x4971, 0x8024, 0x0000, 0x9999, > + "SimpleTech", > + "External HDD", > + USB_SC_DEVICE, USB_PR_DEVICE, NULL, > + US_FL_IGNORE_UAS | US_FL_NO_WP_DETECT), > + > /* > * Nick Bowler > * SCSI stack spams (otherwise harmless) error messages. >