Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2471487imm; Mon, 24 Sep 2018 05:05:18 -0700 (PDT) X-Google-Smtp-Source: ACcGV63qIy0DzIA/syzT1VJpQITpfQQr2/0nN5cDPHgSk3DfUYqTlvb3oke+uG6b3JowYqncTiS+ X-Received: by 2002:a17:902:6907:: with SMTP id j7-v6mr10498702plk.323.1537790718699; Mon, 24 Sep 2018 05:05:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537790718; cv=none; d=google.com; s=arc-20160816; b=YMIpVHDw0sN0jdN1FX7ARaoY+C2tNGPnQ66gqBYkvCZf5469yQsynj8iFatKLLqTbn iBr2xVF9qg1ow9sj2QymiX5ZeU2DiJDBtp/ZcLsV+ZcAcuiXRLUxv71UFvt2BxPv8PKY snmx4CD9eTeCPuHKPWS9JOC0tb2s9FW5vkgFONa5x5irarVsjRKNkP0Gvh6IYwQ64gpa leI0HYuPNGNLok5lwtmOmmcHmfzYf0/YP2msttX8CY05AHP8MrtnXEQHK6CwnqOaT6Qk bFv9YU+TslGgWON+f05/nlHt5Q/LDxJOTl74D0KarPRBa95tNMQsvHj8KaXP8jidY1KE 8VVw== 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=fxkePgULsPDReurLDxEp1nnlLEM+kU/yBxFdIlBXyr4=; b=Oz5JzqdaoXaNocmAqblFeQxVv+kC+C8A0vk2tvEdu5Qf4tZNxpyCL1vNXv7mWor6qO 4wTld9KjRRBbysihBjcIgXVT4vmJfgoRN731EgqhwCsOwg820XQApKnS8wRvAxmsIJz0 8Fw0JINc1UeecT7V6Kc/bNP9yenn4NG3hAHuxF5DV9jVw2fLWT6zjYX/YrZshBUVkibm SgCQrAfbwGY6gbwVTLMuEbbL+9gQdCg6rf4mSkfeg6bXCosIXWlKOVks5eRglnZ/DsRm 63Z2cmHyeCvVH1TAZ2jnOezH8uC7R7YYRP8uHvVFXpJGOqK0o2aA9R0FlzTh/Zx98MUP qZMA== 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 d2-v6si111385pln.29.2018.09.24.05.05.03; Mon, 24 Sep 2018 05:05:18 -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 S1730954AbeIXSEf (ORCPT + 99 others); Mon, 24 Sep 2018 14:04:35 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:53764 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730877AbeIXSEd (ORCPT ); Mon, 24 Sep 2018 14:04:33 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 1252BD64; Mon, 24 Sep 2018 12:02:46 +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.9 057/111] usb: uas: add support for more quirk flags Date: Mon, 24 Sep 2018 13:52:24 +0200 Message-Id: <20180924113110.586526882@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.337261320@linuxfoundation.org> References: <20180924113103.337261320@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.9-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; }