diff options
author | Damien Le Moal <dlemoal@kernel.org> | 2024-08-28 04:07:43 +0200 |
---|---|---|
committer | Damien Le Moal <dlemoal@kernel.org> | 2024-09-07 03:16:55 +0200 |
commit | da65bbdd3bc1e8d2193e01167a413d90d9988c04 (patch) | |
tree | d58d7f9fc4ae8a26018022135aa7e26ac9f4a7c4 /drivers/ata/libata-zpodd.c | |
parent | ata: libata: Rename ata_eh_read_sense_success_ncq_log() (diff) | |
download | linux-da65bbdd3bc1e8d2193e01167a413d90d9988c04.tar.xz linux-da65bbdd3bc1e8d2193e01167a413d90d9988c04.zip |
ata: libata: Move sector_buf from struct ata_port to struct ata_device
The 512B buffer sector_buf field of struct ata_port is used for scanning
devices as well as during error recovery with ata EH. This buffer is
thus useless if a port does not have a device connected to it.
And also given that commands using this buffer are issued to devices,
and not to ports, move this buffer definition from struct ata_port to
struct ata_device.
This change slightly increases system memory usage for systems using a
port-multiplier as in that case we do not need a per-device buffer for
scanning devices (PMP does not allow parallel scanning) nor for EH (as
when entering EH we are guaranteed that all commands to all devices
connected to the PMP have completed or have been aborted). However,
this change reduces memory usage on systems that have many ports with
only few devices rives connected, which is a much more common use case
than the PMP use case.
Suggested-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Diffstat (limited to 'drivers/ata/libata-zpodd.c')
-rw-r--r-- | drivers/ata/libata-zpodd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ata/libata-zpodd.c b/drivers/ata/libata-zpodd.c index eefda51f97d3..4b83b517caec 100644 --- a/drivers/ata/libata-zpodd.c +++ b/drivers/ata/libata-zpodd.c @@ -112,7 +112,7 @@ static bool zpready(struct ata_device *dev) if (!ret || sense_key != NOT_READY) return false; - sense_buf = dev->link->ap->sector_buf; + sense_buf = dev->sector_buf; ret = atapi_eh_request_sense(dev, sense_buf, sense_key); if (ret) return false; |