Skip to content

Commit

Permalink
Merge tag 'ata-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/dlemoal/libata

Pull ata fixes from Damien Le Moal:

 - Fix a compilation warning due to an uninitialized variable in
   ata_sff_lost_interrupt(), from me.

 - Fix invalid internal command tag handling in the sata_dwc_460ex
   driver, from Christian.

 - Disable READ LOG DMA EXT with Samsung 840 EVO SSDs as this command
   causes the drives to hang, from Christian.

 - Change the config option CONFIG_SATA_LPM_POLICY back to its original
   name CONFIG_SATA_LPM_MOBILE_POLICY to avoid potential problems with
   users losing their configuration (as discussed during the merge
   window), from Mario.

* tag 'ata-5.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata:
  ata: ahci: Rename CONFIG_SATA_LPM_POLICY configuration item back
  ata: libata-core: Disable READ LOG DMA EXT for Samsung 840 EVOs
  ata: sata_dwc_460ex: Fix crash due to OOB write
  ata: libata-sff: Fix compilation warning in ata_sff_lost_interrupt()
  • Loading branch information
Linus Torvalds committed Apr 7, 2022
2 parents 3e732eb + 55b0141 commit 640b503
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 6 deletions.
6 changes: 4 additions & 2 deletions drivers/ata/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,16 @@ config SATA_AHCI

If unsure, say N.

config SATA_LPM_POLICY
config SATA_MOBILE_LPM_POLICY
int "Default SATA Link Power Management policy for low power chipsets"
range 0 4
default 0
depends on SATA_AHCI
help
Select the Default SATA Link Power Management (LPM) policy to use
for chipsets / "South Bridges" designated as supporting low power.
for chipsets / "South Bridges" supporting low-power modes. Such
chipsets are typically found on most laptops but desktops and
servers now also widely use chipsets supporting low power modes.

The value set has the following meanings:
0 => Keep firmware settings
Expand Down
2 changes: 1 addition & 1 deletion drivers/ata/ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,7 @@ static int ahci_init_msi(struct pci_dev *pdev, unsigned int n_ports,
static void ahci_update_initial_lpm_policy(struct ata_port *ap,
struct ahci_host_priv *hpriv)
{
int policy = CONFIG_SATA_LPM_POLICY;
int policy = CONFIG_SATA_MOBILE_LPM_POLICY;


/* Ignore processing for chipsets that don't use policy */
Expand Down
2 changes: 1 addition & 1 deletion drivers/ata/ahci.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ enum {
AHCI_HFLAG_NO_WRITE_TO_RO = (1 << 24), /* don't write to read
only registers */
AHCI_HFLAG_USE_LPM_POLICY = (1 << 25), /* chipset that should use
SATA_LPM_POLICY
SATA_MOBILE_LPM_POLICY
as default lpm_policy */
AHCI_HFLAG_SUSPEND_PHYS = (1 << 26), /* handle PHYs during
suspend/resume */
Expand Down
3 changes: 3 additions & 0 deletions drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -4014,6 +4014,9 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
ATA_HORKAGE_ZERO_AFTER_TRIM, },
{ "Crucial_CT*MX100*", "MU01", ATA_HORKAGE_NO_NCQ_TRIM |
ATA_HORKAGE_ZERO_AFTER_TRIM, },
{ "Samsung SSD 840 EVO*", NULL, ATA_HORKAGE_NO_NCQ_TRIM |
ATA_HORKAGE_NO_DMA_LOG |
ATA_HORKAGE_ZERO_AFTER_TRIM, },
{ "Samsung SSD 840*", NULL, ATA_HORKAGE_NO_NCQ_TRIM |
ATA_HORKAGE_ZERO_AFTER_TRIM, },
{ "Samsung SSD 850*", NULL, ATA_HORKAGE_NO_NCQ_TRIM |
Expand Down
2 changes: 1 addition & 1 deletion drivers/ata/libata-sff.c
Original file line number Diff line number Diff line change
Expand Up @@ -1634,7 +1634,7 @@ EXPORT_SYMBOL_GPL(ata_sff_interrupt);

void ata_sff_lost_interrupt(struct ata_port *ap)
{
u8 status;
u8 status = 0;
struct ata_queued_cmd *qc;

/* Only one outstanding command per SFF channel */
Expand Down
6 changes: 5 additions & 1 deletion drivers/ata/sata_dwc_460ex.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ struct sata_dwc_device {
#endif
};

#define SATA_DWC_QCMD_MAX 32
/*
* Allow one extra special slot for commands and DMA management
* to account for libata internal commands.
*/
#define SATA_DWC_QCMD_MAX (ATA_MAX_QUEUE + 1)

struct sata_dwc_device_port {
struct sata_dwc_device *hsdev;
Expand Down

0 comments on commit 640b503

Please sign in to comment.