Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2511308imm; Mon, 24 Sep 2018 05:42:30 -0700 (PDT) X-Google-Smtp-Source: ACcGV60NEyn4+cfOiiqAlrUBbXNTMwAU0Tl59359qVZ79IUAAzaF8AwJAaBBFw2t/PcSjHzBjN73 X-Received: by 2002:a63:e255:: with SMTP id y21-v6mr9356827pgj.160.1537792950891; Mon, 24 Sep 2018 05:42:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537792950; cv=none; d=google.com; s=arc-20160816; b=j/AtN/g/HW9RGeiDDk5yPTo3hKhK9Eb2w9SHZBNQihG+XkCkNTLmUnIT0qhzeI/unv 91I30j+7Mjp3J39fYIm3SdEMGaa38Q3+V4x9XIGhWJZKtmL6Ug6oCws5K2fZOZvxjMw3 p/CjRtrZcCOT46xVg//0eEpXbsgMwIIrx8vDKWagyrjDJmT63JzX7+P3uZsIdYHSaUXt KykCbE06BUA46hVBa2dJm7UB0MNiQ0H/LRfqgVaFKEaJOvPTuBQokLN2tYTQT8m2Pxvv ono9PAMlvt5URoP9+ZWTVLdnO8rpjw9cLiM3MZfyTK1gTDQePpZitaShH1gFXV8Ma0Hj w+YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=GwO7/yT6quYd6eOLXGd22oTnpu14yzWYWz//yt7J1yI=; b=Vv1RGLjhUoENgZZgQ/KI9KKjVvyeMEGEgIO71QCxhMlO6G54kTCjI3z5FDk4vDdDjB 98PX2MRmaLc5Pg3p97e/vVAkm576yYrNnXy2iwLtON/x4f0nlPZO+QLcOFSuDeiLMfpE 0SjR+hkvj2DEzA1MDcx8aK5bAi0q6t9fh5uPlKKq33kW9awQ5cS5uFTcgoA65mi31a/K c4+HoH2KwchgeiDV8UZPjsJ1eG3dLq55wwV1J3FzQ5BH93Xn2HGJnVhr3Q78m9ibAwTk INILGkA6dzh3zWb+kGKQ0/Ppa0/kYruWX/TvhFFOqqxAVe01zVrjV3lgZ4ObQHB1LQEf pQmg== 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 s25-v6si34985625pgd.539.2018.09.24.05.42.15; Mon, 24 Sep 2018 05:42:30 -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 S2388745AbeIXSnN (ORCPT + 99 others); Mon, 24 Sep 2018 14:43:13 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:59104 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733116AbeIXSnM (ORCPT ); Mon, 24 Sep 2018 14:43:12 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E57D1109A; Mon, 24 Sep 2018 12:41:14 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Oliver Neukum Subject: [PATCH 4.18 122/235] usb: uas: add support for more quirk flags Date: Mon, 24 Sep 2018 13:51:48 +0200 Message-Id: <20180924113118.299274090@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.999624566@linuxfoundation.org> References: <20180924113103.999624566@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Oliver Neukum commit 42d1c6d4a06a77b3ab206a919b9050c3080f3a71 upstream. The hope that UAS devices would be less broken than old style storage devices has turned out to be unfounded. Make UAS support more of the quirk flags of the old driver. Signed-off-by: Oliver Neukum Cc: stable Signed-off-by: Greg Kroah-Hartman --- drivers/usb/storage/uas.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) --- a/drivers/usb/storage/uas.c +++ b/drivers/usb/storage/uas.c @@ -842,6 +842,27 @@ static int uas_slave_configure(struct sc sdev->skip_ms_page_8 = 1; sdev->wce_default_on = 1; } + + /* + * Some disks return the total number of blocks in response + * to READ CAPACITY rather than the highest block number. + * If this device makes that mistake, tell the sd driver. + */ + if (devinfo->flags & US_FL_FIX_CAPACITY) + sdev->fix_capacity = 1; + + /* + * Some devices don't like MODE SENSE with page=0x3f, + * which is the command used for checking if a device + * is write-protected. Now that we tell the sd driver + * to do a 192-byte transfer with this command the + * majority of devices work fine, but a few still can't + * handle it. The sd driver will simply assume those + * devices are write-enabled. + */ + if (devinfo->flags & US_FL_NO_WP_DETECT) + sdev->skip_ms_page_3f = 1; + scsi_change_queue_depth(sdev, devinfo->qdepth - 2); return 0; }