* [PATCH] libata-scsi: fix D_SENSE bit relection in control mode page
@ 2016-07-12 17:35 tom.ty89
2016-07-12 17:45 ` Tom Yan
0 siblings, 1 reply; 3+ messages in thread
From: tom.ty89 @ 2016-07-12 17:35 UTC (permalink / raw)
To: tj, hare; +Cc: linux-ide, linux-scsi, Tom Yan
From: Tom Yan <tom.ty89@gmail.com>
The bit should always be set to 1 when the requested version of
page is "changeable" because we've made it so in ata_mselect_control().
Also, it should always be set to 1 if ATA_DFLAG_D_SENSE is set (when
the requested version of page is "current" or "default").
Signed-off-by: Tom Yan <tom.ty89@gmail.com>
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index bfec66f..7e24f0a 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -2446,7 +2446,7 @@ static unsigned int ata_msense_ctl_mode(struct ata_device *dev, u8 *buf,
bool changeable)
{
modecpy(buf, def_control_mpage, sizeof(def_control_mpage), changeable);
- if (changeable && (dev->flags & ATA_DFLAG_D_SENSE))
+ if (changeable || (dev->flags & ATA_DFLAG_D_SENSE))
buf[2] |= (1 << 2); /* Descriptor sense requested */
return sizeof(def_control_mpage);
}
--
2.9.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] libata-scsi: fix D_SENSE bit relection in control mode page
2016-07-12 17:35 [PATCH] libata-scsi: fix D_SENSE bit relection in control mode page tom.ty89
@ 2016-07-12 17:45 ` Tom Yan
2016-07-12 18:39 ` Tejun Heo
0 siblings, 1 reply; 3+ messages in thread
From: Tom Yan @ 2016-07-12 17:45 UTC (permalink / raw)
To: Tejun Heo, Hannes Reinecke; +Cc: linux-ide, linux-scsi, Tom Yan
Btw, why is the MODE SELECT function called ata_mselect_control()
while the MODE SENSE function is called ata_msense_ctl_mode()?
Shouldn't we make their names consistent?
On 13 July 2016 at 01:35, <tom.ty89@gmail.com> wrote:
> From: Tom Yan <tom.ty89@gmail.com>
>
> The bit should always be set to 1 when the requested version of
> page is "changeable" because we've made it so in ata_mselect_control().
> Also, it should always be set to 1 if ATA_DFLAG_D_SENSE is set (when
> the requested version of page is "current" or "default").
>
> Signed-off-by: Tom Yan <tom.ty89@gmail.com>
>
> diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
> index bfec66f..7e24f0a 100644
> --- a/drivers/ata/libata-scsi.c
> +++ b/drivers/ata/libata-scsi.c
> @@ -2446,7 +2446,7 @@ static unsigned int ata_msense_ctl_mode(struct ata_device *dev, u8 *buf,
> bool changeable)
> {
> modecpy(buf, def_control_mpage, sizeof(def_control_mpage), changeable);
> - if (changeable && (dev->flags & ATA_DFLAG_D_SENSE))
> + if (changeable || (dev->flags & ATA_DFLAG_D_SENSE))
> buf[2] |= (1 << 2); /* Descriptor sense requested */
> return sizeof(def_control_mpage);
> }
> --
> 2.9.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] libata-scsi: fix D_SENSE bit relection in control mode page
2016-07-12 17:45 ` Tom Yan
@ 2016-07-12 18:39 ` Tejun Heo
0 siblings, 0 replies; 3+ messages in thread
From: Tejun Heo @ 2016-07-12 18:39 UTC (permalink / raw)
To: Tom Yan; +Cc: Hannes Reinecke, linux-ide, linux-scsi
On Wed, Jul 13, 2016 at 01:45:21AM +0800, Tom Yan wrote:
> Btw, why is the MODE SELECT function called ata_mselect_control()
> while the MODE SENSE function is called ata_msense_ctl_mode()?
> Shouldn't we make their names consistent?
Sure, please go ahead.
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-07-12 18:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-12 17:35 [PATCH] libata-scsi: fix D_SENSE bit relection in control mode page tom.ty89
2016-07-12 17:45 ` Tom Yan
2016-07-12 18:39 ` Tejun Heo
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).