mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] ata: ahci: use correct macro when calculating offsets in dma memory
@ 2022-05-05 14:44 Denis Orlov
  2022-05-11  6:46 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Denis Orlov @ 2022-05-05 14:44 UTC (permalink / raw)
  To: barebox; +Cc: 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.

Signed-off-by: Denis Orlov <denorl2009@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


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ata: ahci: use correct macro when calculating offsets in dma memory
  2022-05-05 14:44 [PATCH] ata: ahci: use correct macro when calculating offsets in dma memory Denis Orlov
@ 2022-05-11  6:46 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2022-05-11  6:46 UTC (permalink / raw)
  To: Denis Orlov; +Cc: barebox

On Thu, May 05, 2022 at 05:44:40PM +0300, Denis Orlov wrote:
> 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@gmail.com>
> ---
>  drivers/ata/ahci.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Applied, thanks

Sascha

> 
> 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
> 
> 

-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-11  6:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-05 14:44 [PATCH] ata: ahci: use correct macro when calculating offsets in dma memory Denis Orlov
2022-05-11  6:46 ` Sascha Hauer

mail archive of the barebox mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://lore.barebox.org/barebox/0 barebox/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 barebox barebox/ https://lore.barebox.org/barebox \
		barebox@lists.infradead.org barebox@lists.infradead.org
	public-inbox-index barebox

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git