From patchwork Thu Aug 9 21:55:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Anderson X-Patchwork-Id: 10562021 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2F3551515 for ; Thu, 9 Aug 2018 21:55:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1ADD12B09B for ; Thu, 9 Aug 2018 21:55:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0CC6C2B907; Thu, 9 Aug 2018 21:55:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9901E2B09B for ; Thu, 9 Aug 2018 21:55:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727320AbeHJAWj (ORCPT ); Thu, 9 Aug 2018 20:22:39 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:42507 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727294AbeHJAWi (ORCPT ); Thu, 9 Aug 2018 20:22:38 -0400 Received: by mail-pl0-f66.google.com with SMTP id g6-v6so3102333plq.9 for ; Thu, 09 Aug 2018 14:55:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=biglakesoftware-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=6R3LYbiaigFCuZ5fjs0LyJ8E4fPql01oAI1pgan6s1g=; b=naLR6+fBSXVDrParbytVrbRP7WWksB33MsDz7hBBLyr+Oe3QuTOFLV/mEPzQm/ojuW GO+fFkD7OhTtleUW8qOuMgtWhqyJllEiPJHTCLxvbRreWeE2ozy2eSqMyRTBtHR+7i5h 5yu4GGcMB/iQMR3qdSDJ4BK1EgXdJoM2BxrJzVyWF5DdOcHzjI5Aohq5V2CH4ARrjrap VD3uv0I+I82rs9caTVjqthm2IF683Rb7uHgAZE8up6KoFlvmXI0lQTWXOfI11LaOZJeE mr3rC927CGkNh1rkG1f5rxHBKkq9LwF8dsLEUu3XmGB84GB0wMsl9R9n2Yh7rFMG9vBx Paxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6R3LYbiaigFCuZ5fjs0LyJ8E4fPql01oAI1pgan6s1g=; b=t4+4qNUG8TuBbxJ09DxuTX0bDTOYoyCktOOxQBp5brWVkmgWa1ki1FR7ohnM6tFVLo 8ERbwIKqnrs2BxjBHt4h/ZkdOP3sZ/T3ATIfzLbU9Ctr2sG9iYfsYBDfiAvEBt+1llGn SkKvYTR7CtzyBYM3B5pNmSYAZoMMRy9Bxo0M4tLk+/Gg5v9nzaRWl7T0EyG7z61qvSdJ 40wv46egGD6I2vWLhuqlba4ZD5sQISFUut4vuyBRuHYXKKDPve2E7n7nFVVy46SEkzk+ kStSDdLlzpj8p8sroi78uvwpZZVD7M3fhc1uJnGBMR6d/hfCur90rWHiodKhV3FgXNkV PnFg== X-Gm-Message-State: AOUpUlEBCg9RaLwA0kSnHRApGNKGBbL4lQ2HUPamcovgI9lT9CEjJ0R6 X+IVQOfz8HnmdHl60s65RhTK8hBX83tUuw== X-Google-Smtp-Source: AA+uWPwY2H8AqirkirANJgbmqSqDNjI9BBEdcLf+Wpgtc0RgPHWAQxaL6/gfQru5q/CL/rfiv8+jiw== X-Received: by 2002:a17:902:1101:: with SMTP id d1-v6mr3515645pla.131.1533851750467; Thu, 09 Aug 2018 14:55:50 -0700 (PDT) Received: from virtual5.ph.cox.net (ip24-251-164-198.ph.ph.cox.net. [24.251.164.198]) by smtp.gmail.com with ESMTPSA id l27-v6sm17626603pfi.180.2018.08.09.14.55.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Aug 2018 14:55:49 -0700 (PDT) Received: by virtual5.ph.cox.net (Postfix, from userid 1000) id 6CCD740F20; Thu, 9 Aug 2018 14:56:25 -0700 (MST) From: Tim Anderson To: linux-usb@vger.kernel.org Cc: Tim Anderson Subject: [PATCH] Add quirk to support DJI CineSSD Date: Thu, 9 Aug 2018 14:55:34 -0700 Message-Id: <1533851734-3598-1-git-send-email-tsa@biglakesoftware.com> X-Mailer: git-send-email 2.7.5 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This device does not correctly handle the LPM operations. Also, the device cannot handle ATA pass-through commands and locks up when attempted while running in super speed. This patch adds the equivalent quirk logic as found in uas. Signed-off-by: Tim Anderson Acked-by: Alan Stern --- drivers/usb/core/quirks.c | 3 +++ drivers/usb/storage/scsiglue.c | 9 +++++++++ drivers/usb/storage/unusual_devs.h | 7 +++++++ 3 files changed, 19 insertions(+) diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c index 097057d..560ce25 100644 --- a/drivers/usb/core/quirks.c +++ b/drivers/usb/core/quirks.c @@ -406,6 +406,9 @@ static const struct usb_device_id usb_quirk_list[] = { { USB_DEVICE(0x2040, 0x7200), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS }, + /* DJI CineSSD */ + { USB_DEVICE(0x2ca3, 0x0031), .driver_info = USB_QUIRK_NO_LPM }, + /* INTEL VALUE SSD */ { USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME }, diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c index c267f28..e227bb5 100644 --- a/drivers/usb/storage/scsiglue.c +++ b/drivers/usb/storage/scsiglue.c @@ -376,6 +376,15 @@ static int queuecommand_lck(struct scsi_cmnd *srb, return 0; } + if ((us->fflags & US_FL_NO_ATA_1X) && + (srb->cmnd[0] == ATA_12 || srb->cmnd[0] == ATA_16)) { + memcpy(srb->sense_buffer, usb_stor_sense_invalidCDB, + sizeof(usb_stor_sense_invalidCDB)); + srb->result = SAM_STAT_CHECK_CONDITION; + done(srb); + return 0; + } + /* enqueue the command and wake up the control thread */ srb->scsi_done = done; us->srb = srb; diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index 22fcfcc..f7f83b21 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h @@ -2288,6 +2288,13 @@ UNUSUAL_DEV( 0x2735, 0x100b, 0x0000, 0x9999, USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_GO_SLOW ), +/* Reported-by: Tim Anderson */ +UNUSUAL_DEV( 0x2ca3, 0x0031, 0x0000, 0x9999, + "DJI", + "CineSSD", + USB_SC_DEVICE, USB_PR_DEVICE, NULL, + US_FL_NO_ATA_1X), + /* * Reported by Frederic Marchal * Mio Moov 330