Skip to contentSkip to conversation

ata: libahci: use ahci_nr_ports() if port_map > ahci_nr_ports()

PATCH New Lukas Herbolt 1 participant 1 message Nov 19, 2020 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ata: libahci: use ahci_nr_ports() if port_map > ahci_nr_ports()

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.

---
 drivers/ata/libahci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/ata/libahci.c +2 -1
index ea5bf5f4cbed..fe416b6542b2 100644
@@ -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;
 		}
 	}
 
Signature · 1 line
2.26.2