Skip to contentSkip to conversation

ata: ahci: use correct macro when calculating offsets in dma memory

PATCH Applied Denis Orlov 2 participants 2 messages May 5, 2022 – May 11, 2022 libata

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ata: ahci: use correct macro when calculating offsets in dma memory

The macro that indicates the size of a single element in the command list was incorrectly used instead of the macro that stands for the size of the whole list.

---
 drivers/ata/ahci.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/ata/ahci.c +4 -4
index f707efb50f..eb9e1bd133 100644
@@ -310,15 +310,15 @@ static int ahci_init_port(struct ahci_port *ahci_port)
 	/*
 	 * Second item: Received-FIS area
 	 */
-	ahci_port->rx_fis = mem + AHCI_CMD_SLOT_SZ;
-	ahci_port->rx_fis_dma = mem_dma + AHCI_CMD_SLOT_SZ;
+	ahci_port->rx_fis = mem + AHCI_CMD_LIST_SZ;
+	ahci_port->rx_fis_dma = mem_dma + AHCI_CMD_LIST_SZ;
 
 	/*
 	 * Third item: data area for storing a single command
 	 * and its scatter-gather table
 	 */
-	ahci_port->cmd_tbl = mem + AHCI_CMD_SLOT_SZ + AHCI_RX_FIS_SZ;
-	ahci_port->cmd_tbl_dma = mem_dma + AHCI_CMD_SLOT_SZ + AHCI_RX_FIS_SZ;
+	ahci_port->cmd_tbl = mem + AHCI_CMD_LIST_SZ + AHCI_RX_FIS_SZ;
+	ahci_port->cmd_tbl_dma = mem_dma + AHCI_CMD_LIST_SZ + AHCI_RX_FIS_SZ;
 
 	ahci_port_debug(ahci_port, "cmd_tbl = 0x%p (0x%pa)\n",
 			ahci_port->cmd_tbl, ahci_port->cmd_tbl_dma);
Signature · 7 lines
2.20.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#1 lore raw
Quoted 8 lines · Denis Orlov

The macro that indicates the size of a single element in the command list was incorrectly used instead of the macro that stands for the size of the whole list.

---
 drivers/ata/ahci.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Applied, thanks

Sascha

Quoted 29 lines
drivers/ata/ahci.c +4 -4
index f707efb50f..eb9e1bd133 100644
@@ -310,15 +310,15 @@ static int ahci_init_port(struct ahci_port *ahci_port)
 	/*
 	 * Second item: Received-FIS area
 	 */
-	ahci_port->rx_fis = mem + AHCI_CMD_SLOT_SZ;
-	ahci_port->rx_fis_dma = mem_dma + AHCI_CMD_SLOT_SZ;
+	ahci_port->rx_fis = mem + AHCI_CMD_LIST_SZ;
+	ahci_port->rx_fis_dma = mem_dma + AHCI_CMD_LIST_SZ;
 
 	/*
 	 * Third item: data area for storing a single command
 	 * and its scatter-gather table
 	 */
-	ahci_port->cmd_tbl = mem + AHCI_CMD_SLOT_SZ + AHCI_RX_FIS_SZ;
-	ahci_port->cmd_tbl_dma = mem_dma + AHCI_CMD_SLOT_SZ + AHCI_RX_FIS_SZ;
+	ahci_port->cmd_tbl = mem + AHCI_CMD_LIST_SZ + AHCI_RX_FIS_SZ;
+	ahci_port->cmd_tbl_dma = mem_dma + AHCI_CMD_LIST_SZ + AHCI_RX_FIS_SZ;
 
 	ahci_port_debug(ahci_port, "cmd_tbl = 0x%p (0x%pa)\n",
 			ahci_port->cmd_tbl, ahci_port->cmd_tbl_dma);
Signature · 1 line
2.20.1
Signature · 9 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox