• Damien Le Moal's avatar
    ata: libata: Move sector_buf from struct ata_port to struct ata_device · da65bbdd
    Damien Le Moal authored
    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: default avatarNiklas Cassel <cassel@kernel.org>
    Signed-off-by: default avatarDamien Le Moal <dlemoal@kernel.org>
    Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
    Reviewed-by: default avatarNiklas Cassel <cassel@kernel.org>
    da65bbdd
libata-zpodd.c 7.25 KB