[PATCH] ata: libahci: use ahci_nr_ports() if port_map > ahci_nr_ports()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



While we report use of nr_port value, we set port_map to zero
which later leads to marking all the ports reported by ahci_nr_ports()
as DUMMY.

Signed-off-by: Lukas Herbolt <lherbolt@xxxxxxxxxx>
---
 drivers/ata/libahci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index ea5bf5f4cbed..fe416b6542b2 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -522,7 +522,8 @@ void ahci_save_initial_config(struct device *dev, struct ahci_host_priv *hpriv)
 			dev_warn(dev,
 				 "implemented port map (0x%x) contains more ports than nr_ports (%u), using nr_ports\n",
 				 port_map, ahci_nr_ports(cap));
-			port_map = 0;
+			port_map = (1 << ahci_nr_ports(cap)) - 1;
+			hpriv->saved_port_map = port_map;
 		}
 	}
 
-- 
2.26.2




[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux