linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs: ufshcd: Enable no_write_same for scsi host
@ 2017-11-30  4:19 Bjorn Andersson
  2017-12-04  1:26 ` Kyuho Choi
  0 siblings, 1 reply; 2+ messages in thread
From: Bjorn Andersson @ 2017-11-30  4:19 UTC (permalink / raw)
  To: Vinayak Holikatti, James E.J. Bottomley, Martin K. Petersen
  Cc: linux-scsi, linux-kernel, linux-arm-msm, Subhash Jadavani,
	Vivek Gautam, Yaniv Gardi, stable

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 <bjorn.andersson@linaro.org>
---
 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,
-- 
2.15.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] scsi: ufs: ufshcd: Enable no_write_same for scsi host
  2017-11-30  4:19 [PATCH] scsi: ufs: ufshcd: Enable no_write_same for scsi host Bjorn Andersson
@ 2017-12-04  1:26 ` Kyuho Choi
  0 siblings, 0 replies; 2+ messages in thread
From: Kyuho Choi @ 2017-12-04  1:26 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Vinayak Holikatti, James E.J. Bottomley, Martin K. Petersen,
	linux-scsi, linux-kernel, linux-arm-msm, Subhash Jadavani,
	Vivek Gautam, Yaniv Gardi, stable

Hi Anderson,

Could you please check about below thread?

https://patchwork.kernel.org/patch/6357751/

Your patch is same as my old one.

On 11/30/17, Bjorn Andersson <bjorn.andersson@linaro.org> wrote:
> 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 <bjorn.andersson@linaro.org>
> ---
>  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,
> --
> 2.15.0
>
>

WBR,
Kyuho Choi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-04  1:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-30  4:19 [PATCH] scsi: ufs: ufshcd: Enable no_write_same for scsi host Bjorn Andersson
2017-12-04  1:26 ` Kyuho Choi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).