From patchwork Thu Aug 11 02:40:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Martin K. Petersen" X-Patchwork-Id: 9274405 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BC8CE600CB for ; Thu, 11 Aug 2016 02:41:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ABCE3284B1 for ; Thu, 11 Aug 2016 02:41:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E49E284B6; Thu, 11 Aug 2016 02:41:42 +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=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY 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 500C9284B1 for ; Thu, 11 Aug 2016 02:41:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932260AbcHKClj (ORCPT ); Wed, 10 Aug 2016 22:41:39 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:29233 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932203AbcHKCli (ORCPT ); Wed, 10 Aug 2016 22:41:38 -0400 Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id u7B2eX5U017160 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Aug 2016 02:40:33 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.13.8/8.13.8) with ESMTP id u7B2eXdp007665 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 11 Aug 2016 02:40:33 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id u7B2eWFQ017705; Thu, 11 Aug 2016 02:40:32 GMT Received: from ca-mkp.ca.oracle.com (/10.159.214.123) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 10 Aug 2016 19:40:31 -0700 To: Oliver Neukum Cc: linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Subject: Re: [PATCH] scsi: introduce a quirk for false cache reporting From: "Martin K. Petersen" Organization: Oracle Corporation References: <1470657309-9564-1-git-send-email-oneukum@suse.com> Date: Wed, 10 Aug 2016 22:40:29 -0400 In-Reply-To: <1470657309-9564-1-git-send-email-oneukum@suse.com> (Oliver Neukum's message of "Mon, 8 Aug 2016 13:55:09 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP >>>>> "Oliver" == Oliver Neukum writes: Oliver> Some SATA to USB bridges fail to cooperate with some drives Oliver> resulting in no cache being present being reported to the Oliver> host. That causes the host to skip sending a command to Oliver> synchronize caches. That causes data loss when the drive is Oliver> powered down. I must be missing something. How is always_sync different from just setting wce_default_on? diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index a6c346d..392d166 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -179,6 +179,7 @@ struct scsi_device { unsigned try_rc_10_first:1; /* Try READ_CAPACACITY_10 first */ unsigned is_visible:1; /* is the device visible in sysfs */ unsigned wce_default_on:1; /* Cache is ON by default */ + unsigned always_sync:1; /* synchronize cache in every case*/ unsigned no_dif:1; /* T10 PI (DIF) should be disabled */ unsigned broken_fua:1; /* Don't set FUA bit */ unsigned lun_in_cdb:1; /* Store LUN bits in CDB[1] */