linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 16/17] xgmac: replace __raw with relaxed IO
Date: Sat, 09 Feb 2013 14:59:55 -0600	[thread overview]
Message-ID: <5116B8CB.40007@gmail.com> (raw)
In-Reply-To: <1360365467-25056-17-git-send-email-ben.dooks@codethink.co.uk>

On 02/08/2013 05:17 PM, Ben Dooks wrote:
> The xgmac driver is using __raw read and write functions, where it
> should be using readl_relaxed and writel_relaxed to avoid any issues
> with which endian mode the CPU is running in.
> 
> Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
> ---
>  drivers/net/ethernet/calxeda/xgmac.c |   12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

This will break on arches which don't have the _relaxed variants. David
Miller will reject restricting this to build on ARM only. See this:

http://www.spinics.net/lists/netdev/msg215457.html

Rob

> 
> diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c
> index f91d9b2..08a6f9e 100644
> --- a/drivers/net/ethernet/calxeda/xgmac.c
> +++ b/drivers/net/ethernet/calxeda/xgmac.c
> @@ -1202,7 +1202,7 @@ static int xgmac_poll(struct napi_struct *napi, int budget)
>  
>  	if (work_done < budget) {
>  		napi_complete(napi);
> -		__raw_writel(DMA_INTR_DEFAULT_MASK, priv->base + XGMAC_DMA_INTR_ENA);
> +		writel_relaxed(DMA_INTR_DEFAULT_MASK, priv->base + XGMAC_DMA_INTR_ENA);
>  	}
>  	return work_done;
>  }
> @@ -1347,7 +1347,7 @@ static irqreturn_t xgmac_pmt_interrupt(int irq, void *dev_id)
>  	struct xgmac_priv *priv = netdev_priv(dev);
>  	void __iomem *ioaddr = priv->base;
>  
> -	intr_status = __raw_readl(ioaddr + XGMAC_INT_STAT);
> +	intr_status = readl_relaxed(ioaddr + XGMAC_INT_STAT);
>  	if (intr_status & XGMAC_INT_STAT_PMT) {
>  		netdev_dbg(priv->dev, "received Magic frame\n");
>  		/* clear the PMT bits 5 and 6 by reading the PMT */
> @@ -1365,9 +1365,9 @@ static irqreturn_t xgmac_interrupt(int irq, void *dev_id)
>  	struct xgmac_extra_stats *x = &priv->xstats;
>  
>  	/* read the status register (CSR5) */
> -	intr_status = __raw_readl(priv->base + XGMAC_DMA_STATUS);
> -	intr_status &= __raw_readl(priv->base + XGMAC_DMA_INTR_ENA);
> -	__raw_writel(intr_status, priv->base + XGMAC_DMA_STATUS);
> +	intr_status = readl_relaxed(priv->base + XGMAC_DMA_STATUS);
> +	intr_status &= readl_relaxed(priv->base + XGMAC_DMA_INTR_ENA);
> +	writel_relaxed(intr_status, priv->base + XGMAC_DMA_STATUS);
>  
>  	/* It displays the DMA process states (CSR5 register) */
>  	/* ABNORMAL interrupts */
> @@ -1403,7 +1403,7 @@ static irqreturn_t xgmac_interrupt(int irq, void *dev_id)
>  
>  	/* TX/RX NORMAL interrupts */
>  	if (intr_status & (DMA_STATUS_RI | DMA_STATUS_TU | DMA_STATUS_TI)) {
> -		__raw_writel(DMA_INTR_ABNORMAL, priv->base + XGMAC_DMA_INTR_ENA);
> +		writel_relaxed(DMA_INTR_ABNORMAL, priv->base + XGMAC_DMA_INTR_ENA);
>  		napi_schedule(&priv->napi);
>  	}
>  
> 

  reply	other threads:[~2013-02-09 20:59 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-08 23:17 ARM big-endian on current kernels for linux-3.8 Ben Dooks
2013-02-08 23:17 ` [PATCH 01/17] ARM: add CPU_BE8_BOOT_LE configuration Ben Dooks
2013-02-09  4:10   ` Nicolas Pitre
2013-02-09 16:46     ` Ben Dooks
2013-02-08 23:17 ` [PATCH 02/17] ARM: set BE8 if LE in head code Ben Dooks
2013-02-09  3:33   ` Nicolas Pitre
2013-02-09 16:47     ` Ben Dooks
2013-02-09 21:38   ` Rob Herring
2013-02-09 21:56     ` Ben Dooks
2013-02-11 19:35     ` Ben Dooks
2013-02-08 23:17 ` [PATCH 03/17] ARM: fix ARCH_IXP4xx usage of ARCH_SUPPORTS_BIG_ENDIAN Ben Dooks
2013-02-08 23:17 ` [PATCH 04/17] ARM: Add ARCH_SUPPORTS_BIG_ENDIAN Ben Dooks
2013-02-09 11:55   ` Russell King - ARM Linux
2013-02-09 16:55     ` Ben Dooks
2013-02-08 23:17 ` [PATCH 05/17] ARM: fixup_pv_table bug when CPU_ENDIAN_BE8 Ben Dooks
2013-02-09  3:40   ` Nicolas Pitre
2013-02-11 19:11     ` Ben Dooks
2013-02-12 21:45       ` Nicolas Pitre
2013-02-08 23:17 ` [PATCH 06/17] ARM: fixup head for atag verification Ben Dooks
2013-02-09  3:51   ` Nicolas Pitre
2013-02-09 17:09     ` Ben Dooks
2013-02-08 23:17 ` [PATCH 07/17] ARM: twd: data endian fix Ben Dooks
2013-02-08 23:17 ` [PATCH 08/17] ARM: smp_scu: data endian fixes Ben Dooks
2013-02-08 23:17 ` [PATCH 09/17] ARM: add atag32_to_cpu() function Ben Dooks
2013-02-09  3:57   ` Nicolas Pitre
2013-02-09 12:03   ` Russell King - ARM Linux
2013-02-11 19:15     ` Ben Dooks
2013-02-11 19:30       ` Russell King - ARM Linux
2013-02-12 18:46       ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-12 20:34         ` Russell King - ARM Linux
2013-02-08 23:17 ` [PATCH 10/17] ARM: update atag-to-fdt code to be endian agnostic Ben Dooks
2013-02-09  3:57   ` Nicolas Pitre
2013-02-09 12:05   ` Russell King - ARM Linux
2013-02-11 19:16     ` Ben Dooks
2013-02-12 21:53       ` Nicolas Pitre
2013-02-13 11:27         ` Ben Dooks
2013-02-14  4:43           ` Nicolas Pitre
2013-02-15 11:28             ` Ben Dooks
2013-02-08 23:17 ` [PATCH 11/17] ARM: fixup atags " Ben Dooks
2013-02-09  4:03   ` Nicolas Pitre
2013-02-09 12:06   ` Russell King - ARM Linux
2013-02-08 23:17 ` [PATCH 12/17] ARM: fix magic for bootloader in BE8 Ben Dooks
2013-02-09  4:06   ` Nicolas Pitre
2013-02-09 12:08     ` Russell King - ARM Linux
2013-02-12 18:50       ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-12 18:54         ` Ben Dooks
2013-02-12 19:52           ` Jean-Christophe PLAGNIOL-VILLARD
2013-02-11 19:17     ` Ben Dooks
2013-02-12 21:57       ` Nicolas Pitre
2013-02-08 23:17 ` [PATCH 13/17] ARM: pl01x debug code endian fix Ben Dooks
2013-02-09 12:09   ` Russell King - ARM Linux
2013-02-11 19:19     ` Ben Dooks
2013-02-08 23:17 ` [PATCH 14/17] highbank: enable big-endian Ben Dooks
2013-02-09 21:33   ` Rob Herring
2013-02-09 22:00     ` Ben Dooks
2013-02-08 23:17 ` [PATCH 15/17] xgmac: fix printing of hardware version Ben Dooks
2013-02-09 12:10   ` Russell King - ARM Linux
2013-02-09 17:20     ` Ben Dooks
2013-02-09 21:35   ` Rob Herring
2013-02-08 23:17 ` [PATCH 16/17] xgmac: replace __raw with relaxed IO Ben Dooks
2013-02-09 20:59   ` Rob Herring [this message]
2013-02-09 22:03     ` Ben Dooks
2013-02-08 23:17 ` [PATCH 17/17] mvebu: support running big-endian Ben Dooks
2013-02-12 17:08 ` ARM big-endian on current kernels for linux-3.8 Thomas Petazzoni
2013-02-12 17:25   ` Ben Dooks
2013-02-12 18:49     ` Thomas Petazzoni
2013-02-12 18:54       ` Ben Dooks
2013-02-13  9:48     ` Thomas Petazzoni
2013-02-12 17:13 ` Russell King - ARM Linux
2013-02-12 17:33   ` Ben Dooks
2013-02-12 22:13     ` Nicolas Pitre
2013-02-13 11:00       ` Ben Dooks
2013-02-13 10:24     ` Matthieu CASTET
2013-02-13 11:18       ` Ben Dooks
2013-02-13 15:52         ` Catalin Marinas
2013-02-13 16:02           ` Ben Dooks
2013-02-13 16:03           ` Arnd Bergmann

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=5116B8CB.40007@gmail.com \
    --to=robherring2@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).