From patchwork Thu Nov 30 04:19:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 10084265 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 E79CE602B9 for ; Thu, 30 Nov 2017 04:19:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA45429D3A for ; Thu, 30 Nov 2017 04:19:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF42729DF6; Thu, 30 Nov 2017 04:19:25 +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.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=unavailable 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 782C129D3A for ; Thu, 30 Nov 2017 04:19:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753369AbdK3ETO (ORCPT ); Wed, 29 Nov 2017 23:19:14 -0500 Received: from mail-pl0-f66.google.com ([209.85.160.66]:42613 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753373AbdK3ETN (ORCPT ); Wed, 29 Nov 2017 23:19:13 -0500 Received: by mail-pl0-f66.google.com with SMTP id bd8so3489107plb.9 for ; Wed, 29 Nov 2017 20:19:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=aEEgZ+RnQvAWffJA/zBhvq2hZSsrF4CYA69kJEfA1VI=; b=e9GuF7FHdbopdiz9HuXAep5YsvDecZzuKaZvAaSCmu2sAHWC3YZSRu0LlotSvzsNAR 6Jj2Q/bFPpQIY8Wm4IvdAjU/ef30XF5z1rb4WNPs8VUM1k/jK4MwAwFFfcCuK+hPJOhk 3+P78B9nLFuRAD+QGxKYfDDdR6103YTc1jmew= 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=aEEgZ+RnQvAWffJA/zBhvq2hZSsrF4CYA69kJEfA1VI=; b=tcJ6O5vXYlMxsucNWnYb/0uCAo7WyvJ7twxf/B3gz+Xg+3lI3MW/HUJbE2ZOz1HL35 ReThBo0yHUjrUU79TGHhRMGwn0CDvZ/Bo+whUUp7rWF4zmkkZW0e2yQaOFYmK0Oj/nz/ etx01GURSrkSLDDwJCnSTsUViy6WM53KAfGXtQHYgxHR7Z/Qy0nliCw2Mtl5sDh5p4Ae ibog65mkoYMtpk50cZkDmDG1j4eeEMe/5RpuTVcMbVLoUak724geNSsHLuLy5VrRALSf D5asoIiJzRFwiTEbxcONwkSxFy2oMBO+Tj0x0//eDDoKOZ5HI3inMnj6Pa4Mg/0VkS5B gLbg== X-Gm-Message-State: AJaThX7OVFjI3ICZZGqY8wqhgtLz4neDYhn14JEeiAc6yYw2WN7TUqoz Ti/NaLG/KSykvhbjEvjlu68IkA== X-Google-Smtp-Source: AGs4zMbHwvg4hP5rEEnXwRLlEAgUZYDJEx0eqOWAelow3x6zrlh5xU5Q9Lw49K/WwrJNU82rua5+kQ== X-Received: by 10.84.228.193 with SMTP id y1mr1239513pli.404.1512015552303; Wed, 29 Nov 2017 20:19:12 -0800 (PST) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id z23sm4787551pgc.2.2017.11.29.20.19.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Nov 2017 20:19:11 -0800 (PST) From: Bjorn Andersson To: Vinayak Holikatti , "James E.J. Bottomley" , "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Subhash Jadavani , Vivek Gautam , Yaniv Gardi , stable@vger.kernel.org Subject: [PATCH] scsi: ufs: ufshcd: Enable no_write_same for scsi host Date: Wed, 29 Nov 2017 20:19:07 -0800 Message-Id: <20171130041907.4417-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.15.0 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 Occasionally the following error message can be seen in the logs of Qualcomm devices using UFS: EXT4-fs (sda9): Delayed block allocation failed for inode 685600 at logical offset 1086 with max blocks 3 with error 121 EXT4-fs (sda9): This should not happen!! Data will be lost This is caused by a failing WRITE_SAME command, which per the JEDEC UFS specification is not a supported. Set the no_write_same flag on the ufshcd SCSI host to let the SCSI layer know this. Fixes: 7a3e97b0dc4b ("[SCSI] ufshcd: UFS Host controller driver") Cc: stable@vger.kernel.org Signed-off-by: Bjorn Andersson --- drivers/scsi/ufs/ufshcd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 88c086f5c4e3..e5b1efd1dafd 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -6515,6 +6515,7 @@ static struct scsi_host_template ufshcd_driver_template = { .can_queue = UFSHCD_CAN_QUEUE, .max_host_blocked = 1, .track_queue_depth = 1, + .no_write_same = 1, }; static int ufshcd_config_vreg_load(struct device *dev, struct ufs_vreg *vreg,