diff mbox

Some drives failing on SCT Write Same

Message ID 20160909164419.12978-1-shaun@tancheff.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Shaun Tancheff Sept. 9, 2016, 4:44 p.m. UTC
Restrict support SCT Write Same to devices which also support ZAC where 
support is required.

Reported-by: Mike Krinkin <krinkin.m.u@gmail.com>
Signed-off-by: Shaun Tancheff <shaun.tancheff@seagate.com>
---
 drivers/ata/libata-scsi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Mike Krinkin Sept. 9, 2016, 5:52 p.m. UTC | #1
On Fri, Sep 09, 2016 at 11:48:51AM -0500, Shaun Tancheff wrote:
> Mike,
> 
> Can you confirm if this fix works for you?
> 
> I tested the patch is tested on top of next-20160909.

Works for me too, thank you.

> 
> Thanks!
> --Shaun
> 
> On Fri, Sep 9, 2016 at 11:44 AM, Shaun Tancheff <shaun@tancheff.com> wrote:
> 
> > Restrict support SCT Write Same to devices which also support ZAC where
> > support is required.
> >
> > Reported-by: Mike Krinkin <krinkin.m.u@gmail.com>
> > Signed-off-by: Shaun Tancheff <shaun.tancheff@seagate.com>
> > ---
> >  drivers/ata/libata-scsi.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
> > index 2f5487f..9cceb4a 100644
> > --- a/drivers/ata/libata-scsi.c
> > +++ b/drivers/ata/libata-scsi.c
> > @@ -3562,9 +3562,9 @@ static unsigned int ata_scsiop_maint_in(struct
> > ata_scsi_args *args, u8 *rbuf)
> >                 supported = 3;
> >                 break;
> >         case WRITE_SAME_16:
> > -               if (ata_id_sct_write_same(dev->id))
> > -                       supported = 3;
> > -               break;
> > +               if (!ata_id_sct_write_same(dev->id))
> > +                       break;
> > +               /* fallthrough: if SCT ... only enable for ZBC */
> >         case ZBC_IN:
> >         case ZBC_OUT:
> >                 if (ata_id_zoned_cap(dev->id) ||
> > --
> > 2.9.3
> >
> >
> 
> 
> -- 
> Shaun Tancheff
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tejun Heo Sept. 9, 2016, 7:24 p.m. UTC | #2
On Fri, Sep 09, 2016 at 11:44:19AM -0500, Shaun Tancheff wrote:
> Restrict support SCT Write Same to devices which also support ZAC where 
> support is required.
> 
> Reported-by: Mike Krinkin <krinkin.m.u@gmail.com>
> Signed-off-by: Shaun Tancheff <shaun.tancheff@seagate.com>

Applied to libata/for-4.9.

Thanks.
diff mbox

Patch

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 2f5487f..9cceb4a 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3562,9 +3562,9 @@  static unsigned int ata_scsiop_maint_in(struct ata_scsi_args *args, u8 *rbuf)
 		supported = 3;
 		break;
 	case WRITE_SAME_16:
-		if (ata_id_sct_write_same(dev->id))
-			supported = 3;
-		break;
+		if (!ata_id_sct_write_same(dev->id))
+			break;
+		/* fallthrough: if SCT ... only enable for ZBC */
 	case ZBC_IN:
 	case ZBC_OUT:
 		if (ata_id_zoned_cap(dev->id) ||