All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ramon Fried <rfried.dev@gmail.com>
To: u-boot@lists.denx.de
Subject: [PATCH 2/2] net: xilinx: axi_emac: Typecast flush_cache arguments
Date: Mon, 14 Sep 2020 17:07:34 +0300	[thread overview]
Message-ID: <CAGi-RU+HFFxd35SLTMN72HMJxEeSXq8ZJVL5qKt6rcsUUHkOqg@mail.gmail.com> (raw)
In-Reply-To: <fc0e77d7d076cafa69678caf244041cd6763053d.1600076060.git.michal.simek@xilinx.com>

On Mon, Sep 14, 2020 at 12:35 PM Michal Simek <michal.simek@xilinx.com> wrote:
>
> From: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
>
> flush_cache() arguments are not type casted to take care of 64 bit
> systems. Use phys_addr_t to type cast for it to work properly for 32 bit
> and 64 bit systems.
>
> Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
>  drivers/net/xilinx_axi_emac.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/xilinx_axi_emac.c b/drivers/net/xilinx_axi_emac.c
> index c56c4d0d83e4..8af371120462 100644
> --- a/drivers/net/xilinx_axi_emac.c
> +++ b/drivers/net/xilinx_axi_emac.c
> @@ -500,11 +500,11 @@ static int axiemac_start(struct udevice *dev)
>  #endif
>         rx_bd.cntrl = sizeof(rxframe);
>         /* Flush the last BD so DMA core could see the updates */
> -       flush_cache((u32)&rx_bd, sizeof(rx_bd));
> +       flush_cache((phys_addr_t)&rx_bd, sizeof(rx_bd));
>
>         /* It is necessary to flush rxframe because if you don't do it
>          * then cache can contain uninitialized data */
> -       flush_cache((u32)&rxframe, sizeof(rxframe));
> +       flush_cache((phys_addr_t)&rxframe, sizeof(rxframe));
>
>         /* Start the hardware */
>         temp = readl(&priv->dmarx->control);
> @@ -538,7 +538,7 @@ static int axiemac_send(struct udevice *dev, void *ptr, int len)
>                 len = PKTSIZE_ALIGN;
>
>         /* Flush packet to main memory to be trasfered by DMA */
> -       flush_cache((u32)ptr, len);
> +       flush_cache((phys_addr_t)ptr, len);
>
>         /* Setup Tx BD */
>         memset(&tx_bd, 0, sizeof(tx_bd));
> @@ -554,7 +554,7 @@ static int axiemac_send(struct udevice *dev, void *ptr, int len)
>                                                 XAXIDMA_BD_CTRL_TXEOF_MASK;
>
>         /* Flush the last BD so DMA core could see the updates */
> -       flush_cache((u32)&tx_bd, sizeof(tx_bd));
> +       flush_cache((phys_addr_t)&tx_bd, sizeof(tx_bd));
>
>         if (readl(&priv->dmatx->status) & XAXIDMA_HALTED_MASK) {
>                 u32 temp;
> @@ -654,11 +654,11 @@ static int axiemac_free_pkt(struct udevice *dev, uchar *packet, int length)
>         rx_bd.cntrl = sizeof(rxframe);
>
>         /* Write bd to HW */
> -       flush_cache((u32)&rx_bd, sizeof(rx_bd));
> +       flush_cache((phys_addr_t)&rx_bd, sizeof(rx_bd));
>
>         /* It is necessary to flush rxframe because if you don't do it
>          * then cache will contain previous packet */
> -       flush_cache((u32)&rxframe, sizeof(rxframe));
> +       flush_cache((phys_addr_t)&rxframe, sizeof(rxframe));
>
>         /* Rx BD is ready - start again */
>         axienet_dma_write(&rx_bd, &priv->dmarx->tail);
> --
> 2.28.0
>
Reviewed-By: Ramon Fried <rfried.dev@gmail.com>

  reply	other threads:[~2020-09-14 14:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-14  9:34 [PATCH 0/2] net: xilinx: axi_emac: Add 64bit support Michal Simek
2020-09-14  9:34 ` [PATCH 1/2] net: xilinx: axi_emac: Fix dma descriptors for 64bit and compilation warnings Michal Simek
2020-09-14 14:07   ` Ramon Fried
2020-09-14  9:34 ` [PATCH 2/2] net: xilinx: axi_emac: Typecast flush_cache arguments Michal Simek
2020-09-14 14:07   ` Ramon Fried [this message]
2020-09-14 14:07 ` [PATCH 0/2] net: xilinx: axi_emac: Add 64bit support Ramon Fried
2020-09-23 12:08 ` Michal Simek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGi-RU+HFFxd35SLTMN72HMJxEeSXq8ZJVL5qKt6rcsUUHkOqg@mail.gmail.com \
    --to=rfried.dev@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.