linux/include
Damien Le Moal 602bcf2126 ata: libata: Improve CDL resource management
The ncq_sense_buf buffer field of struct ata_port is allocated and used
only for devices that support the Command Duration Limits (CDL) feature.
However, the cdl buffer of struct ata_device, which is used to cache the
command duration limits log page for devices supporting CDL is always
allocated as part of struct ata_device, which is wasteful of memory for
devices that do not support this feature.

Clean this up by defining both buffers as part of the new ata_cdl
structure and allocating this structure only for devices that support
the CDL feature. This new structure is attached to struct ata_device
using the cdl pointer.

The functions ata_dev_init_cdl_resources() and
ata_dev_cleanup_cdl_resources() are defined to manage this new structure
allocation, initialization and freeing when a port is removed or a
device disabled. ata_dev_init_cdl_resources() is called from
ata_dev_config_cdl() only for devices that support CDL.
ata_dev_cleanup_cdl_resources() is called from ata_dev_free_resources()
to free the ata_cdl structure when a device is being disabled by EH.

Note that the name of the former cdl log buffer of struct ata_device is
changed to desc_log_buf to make it clearer that it is a buffer for the
limit descriptors log page.

This change reduces the size of struct ata_device, thus reducing memory
usage for ATA devices that do not support the CDL feature.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
2024-09-07 10:16:56 +09:00
..
acpi Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
asm-generic Kbuild updates for v6.11 2024-07-23 14:32:21 -07:00
clocksource
crypto
drm
dt-bindings I3C for 6.11 2024-07-27 10:53:06 -07:00
keys
kunit kunit: Introduce KUNIT_ASSERT_MEMEQ and KUNIT_ASSERT_MEMNEQ macros 2024-07-12 10:12:11 -06:00
kvm
linux ata: libata: Improve CDL resource management 2024-09-07 10:16:56 +09:00
math-emu
media
memory
misc
net sysctl: treewide: constify the ctl_table argument of proc_handlers 2024-07-24 20:59:29 +02:00
pcmcia
ras mm/memory-failure: remove obsolete MF_MSG_DIFFERENT_COMPOUND 2024-07-12 15:52:22 -07:00
rdma
rv
scsi Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
soc sound updates for 6.11-rc1 2024-07-19 12:39:34 -07:00
sound sound fixes for 6.11-rc1 2024-07-26 11:01:31 -07:00
target
trace Fixes and minor updates for the timer migration code: 2024-07-27 10:19:55 -07:00
uapi A lot of networking people were at a conference last week, busy 2024-07-25 13:32:25 -07:00
ufs Merge patch series "Basic inline encryption support for ufs-exynos" 2024-07-10 22:33:34 -04:00
vdso Random number generator updates for Linux 6.11-rc1. 2024-07-24 10:29:50 -07:00
video
xen Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00