diff options
author | Niklas Cassel <niklas.cassel@wdc.com> | 2022-12-29 20:00:01 +0300 |
---|---|---|
committer | Damien Le Moal <damien.lemoal@opensource.wdc.com> | 2023-01-04 07:39:38 +0300 |
commit | 87aab3c4cd59aef42fe280fece2be8b8156b99e0 (patch) | |
tree | 5c3da57a8b30bae4cac4021cb8720c1fe0eadd37 /drivers/ata | |
parent | 7affcded810b7fa9b2e935fff5faa12af2b67033 (diff) | |
download | linux-87aab3c4cd59aef42fe280fece2be8b8156b99e0.tar.xz |
ata: libata: move NCQ related ATA_DFLAGs
ata_dev_configure() starts off by clearing all flags in ATA_DFLAG_CFG_MASK:
dev->flags &= ~ATA_DFLAG_CFG_MASK;
ata_dev_configure() then calls ata_dev_config_lba() which calls
ata_dev_config_ncq().
ata_dev_config_ncq() will set the correct ATA_DFLAGs depending on what is
actually supported.
Since these flags are set by ata_dev_configure(), they should be in
ATA_DFLAG_CFG_MASK and not in ATA_DFLAG_INIT_MASK.
ATA_DFLAG_NCQ_PRIO_ENABLED is set via sysfs, is should therefore not be in
ATA_DFLAG_CFG_MASK. It also cannot be in ATA_DFLAG_INIT_MASK, because
ata_eh_schedule_probe() calls ata_dev_init(), which will clear all flags in
ATA_DFLAG_INIT_MASK.
This means that ATA_DFLAG_NCQ_PRIO_ENABLED (the value the user sets via
sysfs) would get silently cleared if ata_eh_schedule_probe() is called.
While that should only happen in certain circumstances, it still doesn't
seem right that it can get silently cleared.
(ata_dev_config_ncq_prio() will still clear the ATA_DFLAG_NCQ_PRIO_ENABLED
flag if ATA_DFLAG_NCQ_PRIO is suddenly no longer supported after a
revalidation.)
Because of this, move ATA_DFLAG_NCQ_PRIO_ENABLED to be outside of both
ATA_DFLAG_CFG_MASK and ATA_DFLAG_INIT_MASK.
Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Diffstat (limited to 'drivers/ata')
0 files changed, 0 insertions, 0 deletions