|
Revision tags: v6.15, v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4, v6.15-rc3, v6.15-rc2, v6.15-rc1, v6.14 |
|
| #
f2aac4c7 |
| 17-Mar-2025 |
Niklas Cassel <[email protected]> |
ata: libata-core: Add ATA_QUIRK_NO_LPM_ON_ATI for certain Samsung SSDs
Before commit 7627a0edef54 ("ata: ahci: Drop low power policy board type") the ATI AHCI controllers specified board type 'board
ata: libata-core: Add ATA_QUIRK_NO_LPM_ON_ATI for certain Samsung SSDs
Before commit 7627a0edef54 ("ata: ahci: Drop low power policy board type") the ATI AHCI controllers specified board type 'board_ahci' rather than board type 'board_ahci'. This means that LPM was historically not enabled for the ATI AHCI controllers.
By looking at commit 7a8526a5cd51 ("libata: Add ATA_HORKAGE_NO_NCQ_ON_ATI for Samsung 860 and 870 SSD."), it is clear that, for some unknown reason, that Samsung SSDs do not play nice with ATI AHCI controllers. (When using other AHCI controllers, NCQ can be enabled on these Samsung SSDs without issues.)
In a similar way, from user reports, it is clear the ATI AHCI controllers can enable LPM on e.g. Maxtor HDDs perfectly fine, but when enabling LPM on certain Samsung SSDs, things break. (E.g. the SSDs will not get detected by the ATI AHCI controller even after a COMRESET.)
Yet, when using LPM on these Samsung SSDs with other AHCI controllers, e.g. Intel AHCI controllers, these Samsung drives appear to work perfectly fine.
Considering that the combination of ATI + Samsung, for some unknown reason, does not seem to work well, disable LPM when detecting an ATI AHCI controller with a problematic Samsung SSD.
Apply this new ATA_QUIRK_NO_LPM_ON_ATI quirk for all Samsung SSDs that have already been reported to not play nice with ATI (ATA_QUIRK_NO_NCQ_ON_ATI).
Fixes: 7627a0edef54 ("ata: ahci: Drop low power policy board type") Suggested-by: Hans de Goede <[email protected]> Reported-by: Eric <[email protected]> Closes: https://lore.kernel.org/linux-ide/[email protected]/ Tested-by: Eric <[email protected]> Reviewed-by: Damien Le Moal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Niklas Cassel <[email protected]>
show more ...
|
| #
b500ee5f |
| 17-Mar-2025 |
Niklas Cassel <[email protected]> |
ata: libata: Fix NCQ Non-Data log not supported print
Currently, both ata_dev_config_ncq_send_recv() - which checks for NCQ Send/Recv Log (Log Address 13h) and ata_dev_config_ncq_non_data() - which
ata: libata: Fix NCQ Non-Data log not supported print
Currently, both ata_dev_config_ncq_send_recv() - which checks for NCQ Send/Recv Log (Log Address 13h) and ata_dev_config_ncq_non_data() - which checks for NCQ Non-Data Log (Log Address 12h), uses the same print when the log is not supported:
"NCQ Send/Recv Log not supported"
This seems like a copy paste error, since NCQ Non-Data Log is actually a separate log.
Fix the print to reference the correct log.
Fixes: 284b3b77ea88 ("libata: NCQ encapsulation for ZAC MANAGEMENT OUT") Reviewed-by: Damien Le Moal <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Niklas Cassel <[email protected]>
show more ...
|
|
Revision tags: v6.14-rc7 |
|
| #
725ad028 |
| 12-Mar-2025 |
Huacai Chen <[email protected]> |
ata: libata: Improve return value of atapi_check_dma()
atapi_check_dma() allows a LLD to filter ATAPI commands, returning a status indicating whether or not it is OK to use DMA for the supplied ATAP
ata: libata: Improve return value of atapi_check_dma()
atapi_check_dma() allows a LLD to filter ATAPI commands, returning a status indicating whether or not it is OK to use DMA for the supplied ATAPI command.
Change atapi_check_dma() to return -EOPNOTSUPP instead of 1 for an ATAPI command that is not allowed to use DMA.
Signed-off-by: Huacai Chen <[email protected]> Link: https://lore.kernel.org/r/[email protected] [cassel: improve commit log] Signed-off-by: Niklas Cassel <[email protected]>
show more ...
|
|
Revision tags: v6.14-rc6, v6.14-rc5 |
|
| #
a2f925a2 |
| 28-Feb-2025 |
Niklas Cassel <[email protected]> |
Revert "ata: libata-core: Add ATA_QUIRK_NOLPM for Samsung SSD 870 QVO drives"
This reverts commit cc77e2ce187d26cc66af3577bf896d7410eb25ab.
It was reported that adding ATA_QUIRK_NOLPM for Samsung S
Revert "ata: libata-core: Add ATA_QUIRK_NOLPM for Samsung SSD 870 QVO drives"
This reverts commit cc77e2ce187d26cc66af3577bf896d7410eb25ab.
It was reported that adding ATA_QUIRK_NOLPM for Samsung SSD 870 QVO drives breaks entering lower package states for certain systems.
It turns out that Samsung SSD 870 QVO actually has working LPM when using a recent SSD firmware version.
The author of commit cc77e2ce187d ("ata: libata-core: Add ATA_QUIRK_NOLPM for Samsung SSD 870 QVO drives") reported himself that only older SSD firmware versions have broken LPM: https://lore.kernel.org/stable/[email protected]/
Unfortunately, he did not specify which older firmware version he was using which had broken LPM.
Let's revert this quirk, which has FW version field specified as NULL (which means that it applies for all Samsung SSD 870 QVO firmware versions) for now. Once the author reports which older firmware version(s) that are broken, we can create a more fine grained quirk, which populates the FW version field accordingly.
Fixes: cc77e2ce187d ("ata: libata-core: Add ATA_QUIRK_NOLPM for Samsung SSD 870 QVO drives") Reported-by: Dieter Mummenschanz <[email protected]> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219747 Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Niklas Cassel <[email protected]>
show more ...
|
|
Revision tags: v6.14-rc4, v6.14-rc3, v6.14-rc2, v6.14-rc1 |
|
| #
deca4232 |
| 30-Jan-2025 |
Niklas Cassel <[email protected]> |
ata: libata-core: Add 'external' to the libata.force kernel parameter
Commit ae1f3db006b7 ("ata: ahci: do not enable LPM on external ports") changed so that LPM is not enabled on external ports (hot
ata: libata-core: Add 'external' to the libata.force kernel parameter
Commit ae1f3db006b7 ("ata: ahci: do not enable LPM on external ports") changed so that LPM is not enabled on external ports (hotplug-capable or eSATA ports).
This is because hotplug and LPM are mutually exclusive, see 7.3.1 Hot Plug Removal Detection and Power Management Interaction in AHCI 1.3.1.
This does require that firmware has set the appropate bits (HPCP or ESP) in PxCMD (which is a per port register in the AHCI controller).
If the firmware has failed to mark a port as hotplug-capable or eSATA in PxCMD, then there is currently not much a user can do.
If LPM is enabled on the port, hotplug insertions and removals will not be detected on that port.
In order to allow a user to fix up broken firmware, add 'external' to the libata.force kernel parameter.
libata.force can be specified either on the kernel command line, or as a kernel module parameter.
For more information, see Documentation/admin-guide/kernel-parameters.txt.
Reviewed-by: Damien Le Moal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Niklas Cassel <[email protected]>
show more ...
|
|
Revision tags: v6.13 |
|
| #
cc77e2ce |
| 18-Jan-2025 |
Daniel Baumann <[email protected]> |
ata: libata-core: Add ATA_QUIRK_NOLPM for Samsung SSD 870 QVO drives
Disabling link power management on Samsung SSD 870 QVO drives to make them work again after the switch of the default LPM policy
ata: libata-core: Add ATA_QUIRK_NOLPM for Samsung SSD 870 QVO drives
Disabling link power management on Samsung SSD 870 QVO drives to make them work again after the switch of the default LPM policy to low.
Testing so far has shown that regular Samsung SSD 870 (the non QVO variants) do not need it and work fine with the default LPM policy.
Cc: [email protected] Fixes: 7627a0edef54 ("ata: ahci: Drop low power policy board type") Signed-off-by: Daniel Baumann <[email protected]> Link: https://lore.kernel.org/linux-ide/[email protected]/ Signed-off-by: Niklas Cassel <[email protected]>
show more ...
|
|
Revision tags: v6.13-rc7, v6.13-rc6, v6.13-rc5, v6.13-rc4, v6.13-rc3, v6.13-rc2, v6.13-rc1, v6.12, v6.12-rc7, v6.12-rc6, v6.12-rc5, v6.12-rc4, v6.12-rc3, v6.12-rc2 |
|
| #
5f60d5f6 |
| 01-Oct-2024 |
Al Viro <[email protected]> |
move asm/unaligned.h to linux/unaligned.h
asm/unaligned.h is always an include of asm-generic/unaligned.h; might as well move that thing to linux/unaligned.h and include that - there's nothing arch-
move asm/unaligned.h to linux/unaligned.h
asm/unaligned.h is always an include of asm-generic/unaligned.h; might as well move that thing to linux/unaligned.h and include that - there's nothing arch-specific in that header.
auto-generated by the following:
for i in `git grep -l -w asm/unaligned.h`; do sed -i -e "s/asm\/unaligned.h/linux\/unaligned.h/" $i done for i in `git grep -l -w asm-generic/unaligned.h`; do sed -i -e "s/asm-generic\/unaligned.h/linux\/unaligned.h/" $i done git mv include/asm-generic/unaligned.h include/linux/unaligned.h git mv tools/include/asm-generic/unaligned.h tools/include/linux/unaligned.h sed -i -e "/unaligned.h/d" include/asm-generic/Kbuild sed -i -e "s/__ASM_GENERIC/__LINUX/" include/linux/unaligned.h tools/include/linux/unaligned.h
show more ...
|
|
Revision tags: v6.12-rc1, v6.11, v6.11-rc7, v6.11-rc6, v6.11-rc5, v6.11-rc4, v6.11-rc3, v6.11-rc2, v6.11-rc1 |
|
| #
602bcf21 |
| 17-Jul-2024 |
Damien Le Moal <[email protected]> |
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,
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 <[email protected]> Reviewed-by: Niklas Cassel <[email protected]>
show more ...
|
| #
5f8319c4 |
| 05-Sep-2024 |
Damien Le Moal <[email protected]> |
ata: libata: Introduce ata_dev_free_resources
Introduce the function ata_dev_free_resources() to free the resources allocated to support a device features. For now, this function is reduced to calli
ata: libata: Introduce ata_dev_free_resources
Introduce the function ata_dev_free_resources() to free the resources allocated to support a device features. For now, this function is reduced to calling zpodd_exit() for devices that have this feature enabled.
ata_dev_free_resources() is called from ata_eh_dev_disable() as this function is always called for all devices attached to a port that is being detached and for devices that are being disabled due to being removed (detached) from the system or due to errors.
With this change, the call to zpodd_exit() done in ata_port_detach() and ata_scsi_handle_link_detach() are removed as these functions remove all devices attached to the link or port using libata EH, thus resulting in ata_eh_dev_disable() being called and the zpodd_exit() function being executed.
Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Niklas Cassel <[email protected]>
show more ...
|
| #
da65bbdd |
| 28-Aug-2024 |
Damien Le Moal <[email protected]> |
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.
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 <[email protected]> Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Niklas Cassel <[email protected]>
show more ...
|
| #
78f76b09 |
| 17-Jul-2024 |
Damien Le Moal <[email protected]> |
ata: libata: Move sata_std_hardreset() definition to libata-sata.c
Unlike ata_std_prereset() and ata_std_postreset(), the function sata_std_hardreset() applies only to SATA devices, as its name impl
ata: libata: Move sata_std_hardreset() definition to libata-sata.c
Unlike ata_std_prereset() and ata_std_postreset(), the function sata_std_hardreset() applies only to SATA devices, as its name implies. So move its definition to libata-sata.c.
Together with this, also move the definition of sata_port_ops to libata-sata.c, where it belongs.
Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Niklas Cassel <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]>
show more ...
|
| #
b642212d |
| 17-Jul-2024 |
Damien Le Moal <[email protected]> |
ata: libata: Move sata_down_spd_limit() to libata-sata.c
Move the definition of the function sata_down_spd_limit() to libata-sata.c where it belongs, together with sata_set_spd(). The helper functio
ata: libata: Move sata_down_spd_limit() to libata-sata.c
Move the definition of the function sata_down_spd_limit() to libata-sata.c where it belongs, together with sata_set_spd(). The helper function ata_sstatus_online() is also changed to be an inline function defined in drivers/ata/libata.h.
Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Niklas Cassel <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]>
show more ...
|
|
Revision tags: v6.10, v6.10-rc7, v6.10-rc6 |
|
| #
5bb52d92 |
| 25-Jun-2024 |
Damien Le Moal <[email protected]> |
ata: libata: Improve __ata_qc_complete()
The function __ata_qc_complete() is always called with a qc that already has been dereferenced and so is guaranteed to be non-NULL (as otherwise the kernel w
ata: libata: Improve __ata_qc_complete()
The function __ata_qc_complete() is always called with a qc that already has been dereferenced and so is guaranteed to be non-NULL (as otherwise the kernel would have crashed). So remove the warning for a NULL qc as it is useless.
Furthermore, the qc passed to __ata_qc_complete() must always be marked as active with the ATA_QCFLAG_ACTIVE flag. If that is not the case, in addition to the existing warning, return early so that we do not attempt to complete an invalid qc.
Finally, fix the comment related to clearing the qc active flag as that operation applies to all devices, not just ATAPI ones.
Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Niklas Cassel <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]>
show more ...
|
| #
284b75a3 |
| 22-Aug-2024 |
Zheng Qixing <[email protected]> |
ata: libata: Fix memory leak for error path in ata_host_alloc()
In ata_host_alloc(), if devres_alloc() fails to allocate the device host resource data pointer, the already allocated ata_host structu
ata: libata: Fix memory leak for error path in ata_host_alloc()
In ata_host_alloc(), if devres_alloc() fails to allocate the device host resource data pointer, the already allocated ata_host structure is not freed before returning from the function. This results in a potential memory leak.
Call kfree(host) before jumping to the error handling path to ensure that the ata_host structure is properly freed if devres_alloc() fails.
Fixes: 2623c7a5f279 ("libata: add refcounting to ata_host") Cc: [email protected] Signed-off-by: Zheng Qixing <[email protected]> Reviewed-by: Yu Kuai <[email protected]> Signed-off-by: Damien Le Moal <[email protected]>
show more ...
|
| #
bf1807c6 |
| 01-Aug-2024 |
Damien Le Moal <[email protected]> |
ata: libata: Print device quirks only once
In ata_dev_print_quirks(), return early if ata_dev_print_info() returns false or if we already printed quirk information. This is to avoid printing a devic
ata: libata: Print device quirks only once
In ata_dev_print_quirks(), return early if ata_dev_print_info() returns false or if we already printed quirk information. This is to avoid printing a device quirks multiple times (that is, each time ata_dev_revalidate() is called).
To remember if ata_dev_print_quirks() was already executed, define the EH context flag ATA_EHI_DID_PRINT_QUIRKS and set this flag in ata_dev_print_quirks().
Reported-by: Geert Uytterhoeven <[email protected]> Fixes: 58157d607aec ("ata: libata: Print quirks applied to devices") Signed-off-by: Damien Le Moal <[email protected]> Tested-by: Geert Uytterhoeven <[email protected]>
show more ...
|
| #
b4082450 |
| 30-Jul-2024 |
Damien Le Moal <[email protected]> |
ata: libata: Remove ata_noop_qc_prep()
The function ata_noop_qc_prep(), as its name implies, does nothing and simply returns AC_ERR_OK. For drivers that do not need any special preparations of queue
ata: libata: Remove ata_noop_qc_prep()
The function ata_noop_qc_prep(), as its name implies, does nothing and simply returns AC_ERR_OK. For drivers that do not need any special preparations of queued commands, we can avoid having to define struct ata_port qc_prep operation by simply testing if that operation is defined or not in ata_qc_issue(). Make this change and remove ata_noop_qc_prep().
Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: John Garry <[email protected]> Reviewed-by: Sergey Shtylyov <[email protected]>
show more ...
|
| #
58157d60 |
| 18-Jul-2024 |
Damien Le Moal <[email protected]> |
ata: libata: Print quirks applied to devices
Introduce the function ata_dev_print_quirks() to print the quirk flags that will be applied to a scanned device. This new function is called from ata_dev
ata: libata: Print quirks applied to devices
Introduce the function ata_dev_print_quirks() to print the quirk flags that will be applied to a scanned device. This new function is called from ata_dev_quirks() when a match on a device model or device model and revision is found for a device in the __ata_dev_quirks array.
To implement this function, the ATA_QUIRK_ flags are redefined using the new enum ata_quirk which defines the bit shift for each quirk flag. The array of strings ata_quirk_names is used to define the name of each flag, which are printed by ata_dev_print_quirks().
Example output for a device listed in the __ata_dev_quirks array and which has the ATA_QUIRK_DISABLE flag applied:
[10193.461270] ata1: SATA link up 6.0 Gbps (SStatus 133 SControl 300) [10193.469190] ata1.00: Model 'ASMT109x- Config', rev '2143 5', applying quirks: disable [10193.469195] ata1.00: unsupported device, disabling [10193.481564] ata1.00: disable device
enum ata_quirk also defines the __ATA_QUIRK_MAX value as one plus the last quirk flag defined. This value is used in ata_dev_quirks() to add a build time check that all quirk flags fit within the unsigned int (32-bits) quirks field of struct ata_device.
Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Igor Pylypiv <[email protected]> Reviewed-by: Niklas Cassel <[email protected]>
show more ...
|
| #
7ebd8c5a |
| 18-Jul-2024 |
Damien Le Moal <[email protected]> |
ata: libata: Use QUIRK instead of HORKAGE
According to Wiktionary, the verb "hork" is computing slang defined as "To foul up; to be occupied with difficulty, tangle, or unpleasantness; to be broken"
ata: libata: Use QUIRK instead of HORKAGE
According to Wiktionary, the verb "hork" is computing slang defined as "To foul up; to be occupied with difficulty, tangle, or unpleasantness; to be broken" (https://en.wiktionary.org/wiki/hork#Verb). libata uses this with the term "horkage" to refer to broken device features. Given that this term is not widely used and its meaning unknown to many, rename it to the more commonly used term "quirk", similar to many other places in the kernel.
The renaming done is: 1) Rename all ATA_HORKAGE_XXX flags to ATA_QUIRK_XXX 2) Rename struct ata_device horkage field to quirks 3) Rename struct ata_blacklist_entry to struct ata_dev_quirks_entry. The array of these structures defining quirks for known devices is renamed __ata_dev_quirks. 4) The functions ata_dev_blacklisted() and ata_force_horkage() are renamed to ata_dev_quirks() and ata_force_quirks() respectively. 5) All the force_horkage_xxx() macros are renamed to force_quirk_xxx()
And while at it, make sure that the type "unsigned int" is used consistantly for quirk flags variables and data structure fields.
Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Niklas Cassel <[email protected]> Reviewed-by: Igor Pylypiv <[email protected]>
show more ...
|
| #
f209d8ed |
| 18-Jul-2024 |
Damien Le Moal <[email protected]> |
ata: libata: Rename ata_dma_blacklisted()
Rename the function ata_dma_blacklisted() to ata_dev_nodma() as this new name is more neutral. The function signature is also changed to return a boolean in
ata: libata: Rename ata_dma_blacklisted()
Rename the function ata_dma_blacklisted() to ata_dev_nodma() as this new name is more neutral. The function signature is also changed to return a boolean instead of an int.
Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Igor Pylypiv <[email protected]> Reviewed-by: Niklas Cassel <[email protected]>
show more ...
|
| #
f8f26f74 |
| 23-Jul-2024 |
Damien Le Moal <[email protected]> |
ata: libata: Change ata_dev_knobble() to return a bool
Change the function ata_dev_knobble() to return a boolean instead of a u8.
Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Igo
ata: libata: Change ata_dev_knobble() to return a bool
Change the function ata_dev_knobble() to return a boolean instead of a u8.
Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Igor Pylypiv <[email protected]> Reviewed-by: Niklas Cassel <[email protected]>
show more ...
|
| #
0d3603ac |
| 03-Jul-2024 |
Niklas Cassel <[email protected]> |
ata,scsi: Remove wrapper ata_sas_port_alloc()
The ata_sas_port_alloc() wrapper mainly exists in order to export the internal libata function which it wraps. The secondary reason is that it initializ
ata,scsi: Remove wrapper ata_sas_port_alloc()
The ata_sas_port_alloc() wrapper mainly exists in order to export the internal libata function which it wraps. The secondary reason is that it initializes some ata_port struct members.
However, ata_sas_port_alloc() is only used in a single location, sas_ata_init(), which already performs some ata_port struct member initialization, so it does not make sense to spread this initialization out over two separate locations.
Thus, remove the wrapper and instead export the libata function directly, and move the libsas specific ata_port initialization to sas_ata_init(), which already does some ata_port initialization.
Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: John Garry <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Niklas Cassel <[email protected]>
show more ...
|
| #
1228713c |
| 03-Jul-2024 |
Niklas Cassel <[email protected]> |
ata: libata-core: Reuse available ata_port print_ids
Currently, the ata_port print_ids are increased indefinitely, even when there are lower ids available.
E.g. on first boot you will have ata1-ata
ata: libata-core: Reuse available ata_port print_ids
Currently, the ata_port print_ids are increased indefinitely, even when there are lower ids available.
E.g. on first boot you will have ata1-ata6 assigned. After a rmmod + modprobe, you will instead have ata7-ata12 assigned.
Move to use the ida_alloc() API, such that print_ids will get reused. This means that even after a rmmod + modprobe, the ports will be assigned print_ids ata1-ata6.
Reviewed-by: Damien Le Moal <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Niklas Cassel <[email protected]>
show more ...
|
| #
1c1fbb86 |
| 03-Jul-2024 |
Niklas Cassel <[email protected]> |
ata: libata: Assign print_id at port allocation time
While the assignment of ap->print_id could have been moved to ata_host_alloc(), let's simply move it to ata_port_alloc().
If you allocate a port
ata: libata: Assign print_id at port allocation time
While the assignment of ap->print_id could have been moved to ata_host_alloc(), let's simply move it to ata_port_alloc().
If you allocate a port, you want to give it a unique name that can be used for printing.
By moving the ap->print_id assignment to ata_port_alloc(), means that we can also remove the ap->print_id assignment from ata_sas_port_alloc().
This will allow a LLD to use the ata_port_*() print functions before ata_host_register() has been called.
Reviewed-by: Damien Le Moal <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Niklas Cassel <[email protected]>
show more ...
|
| #
1dd63a6b |
| 03-Jul-2024 |
Niklas Cassel <[email protected]> |
ata: libata-core: Remove local_port_no struct member
ap->local_port_no is simply ap->port_no + 1. Since ap->local_port_no can be derived from ap->port_no, there is no need for the ap->local_port_no
ata: libata-core: Remove local_port_no struct member
ap->local_port_no is simply ap->port_no + 1. Since ap->local_port_no can be derived from ap->port_no, there is no need for the ap->local_port_no struct member, so remove ap->local_port_no.
Reviewed-by: Damien Le Moal <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Niklas Cassel <[email protected]>
show more ...
|
| #
23262cce |
| 03-Jul-2024 |
Niklas Cassel <[email protected]> |
ata: libata-core: Remove support for decreasing the number of ports
Commit f31871951b38 ("libata: separate out ata_host_alloc() and ata_host_register()") added ata_host_alloc(), where the API allowe
ata: libata-core: Remove support for decreasing the number of ports
Commit f31871951b38 ("libata: separate out ata_host_alloc() and ata_host_register()") added ata_host_alloc(), where the API allowed a LLD to overallocate the number of ports supplied to ata_host_alloc(), as long as the LLD decreased host->n_ports before calling ata_host_register().
However, this functionally has never ever been used by a single LLD.
Because of the current API design, the assignment of ap->print_id is deferred until registration time, which is bad, because that means that the ata_port_*() print functions cannot be used by a LLD until after registration time, which means that a LLD is forced to use a print function that is non-port specific, even for a port specific error.
Remove the support for decreasing the number of ports, such that it will be possible to assign ap->print_id earlier.
Reviewed-by: Damien Le Moal <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Niklas Cassel <[email protected]>
show more ...
|