netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Will Deacon <will.deacon@arm.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Nicolas Pitre <nico@fluxnic.net>,
	"David S. Miller" <davem@davemloft.net>,
	Russell King <linux@arm.linux.org.uk>,
	Eric Miao <eric.y.miao@gmail.com>,
	Jonathan Cameron <jic23@cam.ac.uk>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH v2] net: smc91: fix crash regression on the versatile
Date: Wed, 27 Nov 2013 13:35:23 +0000	[thread overview]
Message-ID: <20131127133523.GH9032@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <1385555601-4497-1-git-send-email-linus.walleij@linaro.org>

Hi Linus,

On Wed, Nov 27, 2013 at 12:33:21PM +0000, Linus Walleij wrote:
> After commit e9e4ea74f06635f2ffc1dffe5ef40c854faa0a90
> "net: smc91x: dont't use SMC_outw for fixing up halfword-aligned data"
> The Versatile SMSC LAN91C111 is crashing like this:

[...]

> This is because the macro operations in smc91x.h defined
> for Versatile are missing SMC_outsw() as used in this
> commit.
> 
> The Versatile needs and uses the same accessors as the other
> platforms in the first if(...) clause, just switch it to using
> that and we have one problem less to worry about.

[...]

> diff --git a/drivers/net/ethernet/smsc/smc91x.h b/drivers/net/ethernet/smsc/smc91x.h
> index c9d4c872e81d..902a7c268d82 100644
> --- a/drivers/net/ethernet/smsc/smc91x.h
> +++ b/drivers/net/ethernet/smsc/smc91x.h
> @@ -46,7 +46,8 @@
>      defined(CONFIG_MACH_LITTLETON) ||\
>      defined(CONFIG_MACH_ZYLONITE2) ||\
>      defined(CONFIG_ARCH_VIPER) ||\
> -    defined(CONFIG_MACH_STARGATE2)
> +    defined(CONFIG_MACH_STARGATE2) ||\
> +    defined(CONFIG_ARCH_VERSATILE)
>  
>  #include <asm/mach-types.h>
>  
> @@ -206,23 +207,6 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg)
>  #define RPC_LSA_DEFAULT		RPC_LED_TX_RX
>  #define RPC_LSB_DEFAULT		RPC_LED_100_10
>  
> -#elif	defined(CONFIG_ARCH_VERSATILE)
> -
> -#define SMC_CAN_USE_8BIT	1
> -#define SMC_CAN_USE_16BIT	1
> -#define SMC_CAN_USE_32BIT	1
> -#define SMC_NOWAIT		1
> -
> -#define SMC_inb(a, r)		readb((a) + (r))
> -#define SMC_inw(a, r)		readw((a) + (r))
> -#define SMC_inl(a, r)		readl((a) + (r))
> -#define SMC_outb(v, a, r)	writeb(v, (a) + (r))
> -#define SMC_outw(v, a, r)	writew(v, (a) + (r))
> -#define SMC_outl(v, a, r)	writel(v, (a) + (r))
> -#define SMC_insl(a, r, p, l)	readsl((a) + (r), p, l)
> -#define SMC_outsl(a, r, p, l)	writesl((a) + (r), p, l)
> -#define SMC_IRQ_FLAGS		(-1)	/* from resource */
> -
>  #elif defined(CONFIG_MN10300)

Ha! I was about to post a different fix for this issue, see below. I think
we may want a combination of the two...

Will

--->8

>From 2b4db3f7ddd560bc52be522098a96a6d18388f0f Mon Sep 17 00:00:00 2001
From: Will Deacon <will.deacon@arm.com>
Date: Wed, 27 Nov 2013 11:32:15 +0000
Subject: [PATCH] net: smc91x: ensure {in,out}sw are defined for platforms with
 32-bit PIO

Commit e9e4ea74f066 ("net: smc91x: dont't use SMC_outw for fixing up
halfword-aligned data") introduced a requirement for all 32-bit PIO
capable platforms to implement the string variants for word accessors.

This patch adds the accessors to platforms where they are missing.

Reported-by: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
 drivers/net/ethernet/smsc/smc91x.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/smsc/smc91x.h b/drivers/net/ethernet/smsc/smc91x.h
index c9d4c872e81d..cbe72022cb52 100644
--- a/drivers/net/ethernet/smsc/smc91x.h
+++ b/drivers/net/ethernet/smsc/smc91x.h
@@ -154,6 +154,8 @@ static inline void SMC_outw(u16 val, void __iomem *ioaddr, int reg)
 #define SMC_outl(v, a, r)      writel(v, (a) + (r))
 #define SMC_insl(a, r, p, l)   readsl((a) + (r), p, l)
 #define SMC_outsl(a, r, p, l)  writesl((a) + (r), p, l)
+#define SMC_insw(a, r, p, l)   readsw((a) + (r), p, l)
+#define SMC_outsw(a, r, p, l)  writesw((a) + (r), p, l)
 #define SMC_IRQ_FLAGS          (-1)    /* from resource */
 
 /* We actually can't write halfwords properly if not word aligned */
@@ -221,6 +223,8 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg)
 #define SMC_outl(v, a, r)      writel(v, (a) + (r))
 #define SMC_insl(a, r, p, l)   readsl((a) + (r), p, l)
 #define SMC_outsl(a, r, p, l)  writesl((a) + (r), p, l)
+#define SMC_insw(a, r, p, l)   readsw((a) + (r), p, l)
+#define SMC_outsw(a, r, p, l)  writesw((a) + (r), p, l)
 #define SMC_IRQ_FLAGS          (-1)    /* from resource */
 
 #elif defined(CONFIG_MN10300)
-- 
1.8.2.2

  reply	other threads:[~2013-11-27 13:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-27 12:33 [PATCH v2] net: smc91: fix crash regression on the versatile Linus Walleij
2013-11-27 13:35 ` Will Deacon [this message]
2013-11-28 13:34   ` Linus Walleij

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=20131127133523.GH9032@mudshark.cambridge.arm.com \
    --to=will.deacon@arm.com \
    --cc=davem@davemloft.net \
    --cc=eric.y.miao@gmail.com \
    --cc=jic23@cam.ac.uk \
    --cc=linus.walleij@linaro.org \
    --cc=linux@arm.linux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=nico@fluxnic.net \
    --cc=stable@vger.kernel.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).