[PATCH] ata: ahci: use correct macro when calculating offsets in dma memory
Denis Orlov
denorl2009 at gmail.com
Thu May 5 07:44:40 PDT 2022
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.
Signed-off-by: Denis Orlov <denorl2009 at gmail.com>
---
drivers/ata/ahci.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index f707efb50f..eb9e1bd133 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -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);
--
2.20.1
More information about the barebox
mailing list