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: 120069 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp204762qgn; Wed, 29 Nov 2017 20:19:16 -0800 (PST) X-Google-Smtp-Source: AGs4zMZbiAgN78zH/ZhxmuxdQxFUWfpScOcOLv+2rQafFAwumbjY8Z9ZuEYVdUnAcYlip7kF08g1 X-Received: by 10.84.241.15 with SMTP id a15mr1261071pll.103.1512015556061; Wed, 29 Nov 2017 20:19:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512015556; cv=none; d=google.com; s=arc-20160816; b=QWp8I31iHArBuc6uhiVo+aZbuZZjdHKXVImqGXEiqsG/wXTyAB+J1HweGPFWuExlzV TfaqzmtdTFJruE81OynmE98VeyycE92PL/y0bAZfSLQo8S4Brl/0QfhlqD0Corz1or1E +Mov0obyQTz4A3oNIc4U8eQ9iq1QR6HZ+C3XEvVdFyB1fPh8YSxr64M8ld3fkAsTXAMv 04caskun/qHfE1so2cog0nf2r7vKAKggbQO+XgYtJSHPMYSwOJQHtyx94P4GuIj3TO7D 6V27ep3Dyv9OWOWT+HXTUjUpT8C8ZOEZYZsjleU95YWF8OwTJM4aw6W9IZqZrS9QvF+5 W9Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=aEEgZ+RnQvAWffJA/zBhvq2hZSsrF4CYA69kJEfA1VI=; b=tEFBlZXjgTaZoHdbcfUWytKc5+SiYQq7c9q9uWiJcg1iuUwvX24+skjzalZW3nbjMQ crcq36JfOgot8cCMpkNMcwTHwIvOaDcpK60lITmuMoO8/S+AV2EUfC5PIDRhJC6JNlvK G/JYib+O7kqjDOgOnU/VsvUY2HiA/Ps9pMAasAyUxFZvV+bGv2EIm9Ct1UMaSao5og2Q zwyosOBhdYZS2jvAsrZYOGF7TlV0oM8yF4gDK8zja0MpejLKyI5i0seBRuCYB6E1UI1S TKO2PlSzGYA7a2fG4CbluAOWRM/HecNy9hMmeehDGNKztRMWWLdFKIoroVfkEBcL1pnJ oEYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e9GuF7FH; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h192si2501167pfe.371.2017.11.29.20.19.15; Wed, 29 Nov 2017 20:19:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e9GuF7FH; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753384AbdK3ETO (ORCPT + 9 others); Wed, 29 Nov 2017 23:19:14 -0500 Received: from mail-pl0-f65.google.com ([209.85.160.65]:34213 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753375AbdK3ETN (ORCPT ); Wed, 29 Nov 2017 23:19:13 -0500 Received: by mail-pl0-f65.google.com with SMTP id d21so3489591pll.1 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=AAueqtN2e0JwoYVyn0HWXYVdRBnIvubnw/t+mZUkf33F2az6wjnJcSidds7k7kKI+7 5xPqR5FHwuAfutCcjpmncWWUgOIfQFg0uQHj2rDY5m2U7oEoWgZ6JH54AHJTcCVpBV2i AIHSJW8ft+2UciYPL9eIHQAD7icFym0MdIZDpsl59KbLSIHyjkSrwfefPiy712orZcXq v0EygUtj8nvja5UkhXrJcCKlfJ3lr91roque01n2zN8rQMvBiAYUqgPt15COpxAIc1lB tDQI68CkLuGxtVivtQV2gVzPOm/ltRaMk0F0MHULRvBd9mGjiSKeyMBGtsNgjB3ecLBh 5j2w== X-Gm-Message-State: AJaThX42HxErL+d8Lx4f9aNMJVamZD/xTw8XAIqES97QyBhr16zi5bwF 3Qz8hmMvG3w0gYz9B/+X2ndsHQ== 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: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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(+) -- 2.15.0 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,