Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH] usbnet: fix usb_autopm_get_interface failure(v1)
From: David Miller @ 2010-11-01 14:13 UTC (permalink / raw)
  To: tom.leiming
  Cc: netdev, oliver, dbrownell, gregkh, ben, joe, andy.shevchenko,
	stable
In-Reply-To: <1288620349-9769-1-git-send-email-tom.leiming@gmail.com>

From: tom.leiming@gmail.com
Date: Mon,  1 Nov 2010 22:05:49 +0800

> From: Ming Lei <tom.leiming@gmail.com>
> 
> Since usbnet already took usb runtime pm, we have to
> enable runtime pm for usb interface of usbnet, otherwise
> usb_autopm_get_interface may return failure and cause
> 'ifconfig usb0 up' failed if USB_SUSPEND(RUNTIME_PM) is
> enabled.
> 
> Cc: David Brownell <dbrownell@users.sourceforge.net>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Ben Hutchings <ben@decadent.org.uk>
> Cc: Joe Perches <joe@perches.com>
> Cc: Oliver Neukum <oliver@neukum.org>
> Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
> Cc: stable@kernel.org
> Signed-off-by: Ming Lei <tom.leiming@gmail.com>
> ---
> v1: include header file

Applied, thanks.

^ permalink raw reply

* Re: [PATCH RFC] tun: remove of user-controlled memory allocation
From: David Miller @ 2010-11-01 14:16 UTC (permalink / raw)
  To: mst; +Cc: herbert, eric.dumazet, joe, netdev, linux-kernel
In-Reply-To: <20101101082749.GA25860@redhat.com>

From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Mon, 1 Nov 2010 10:27:49 +0200

> Untested, this is just an RFC.
> 
> tun does a kmalloc where userspace controls the length. This will
> produce warnings in kernel log when the length is too large, or might
> block for a long while. A simple fix is to avoid the allocatiuon
> altogether, and copy from user in a loop.
> 
> However, with this patch an illegal address passed to the ioctl might
> leave the filter disabled.  Is this something we care about?  If
> yes we could recover by creating a copy of the filter.  Thoughts?
> 
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

I think the key issue in situations like this is simply to make
sure that reasonable things that worked before, still do afterwards.

And I think your patch does that, so it's fine as far as I can tell.

^ permalink raw reply

* Re: [PATCH] usbnet: fix usb_autopm_get_interface failure(v1)
From: Andy Shevchenko @ 2010-11-01 15:04 UTC (permalink / raw)
  To: tom.leiming
  Cc: netdev, oliver, davem, David Brownell, Greg Kroah-Hartman,
	Ben Hutchings, Joe Perches, stable
In-Reply-To: <1288620349-9769-1-git-send-email-tom.leiming@gmail.com>

On Mon, Nov 1, 2010 at 4:05 PM,  <tom.leiming@gmail.com> wrote:
> From: Ming Lei <tom.leiming@gmail.com>
>
> Since usbnet already took usb runtime pm, we have to
> enable runtime pm for usb interface of usbnet, otherwise
> usb_autopm_get_interface may return failure and cause
> 'ifconfig usb0 up' failed if USB_SUSPEND(RUNTIME_PM) is
> enabled.
>
> Cc: David Brownell <dbrownell@users.sourceforge.net>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Ben Hutchings <ben@decadent.org.uk>
> Cc: Joe Perches <joe@perches.com>
> Cc: Oliver Neukum <oliver@neukum.org>
> Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
> Cc: stable@kernel.org
> Signed-off-by: Ming Lei <tom.leiming@gmail.com>
> ---
> v1: include header file
>
> ---
>  drivers/net/usb/usbnet.c |   11 +++++++++++
>  1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
> index ca7fc9d..06b1dee 100644
> --- a/drivers/net/usb/usbnet.c
> +++ b/drivers/net/usb/usbnet.c
> @@ -45,6 +45,7 @@
>  #include <linux/usb/usbnet.h>
>  #include <linux/slab.h>
>  #include <linux/kernel.h>
> +#include <linux/pm_runtime.h>
>
>  #define DRIVER_VERSION         "22-Aug-2005"
>
> @@ -1273,6 +1274,16 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
>        struct usb_device               *xdev;
>        int                             status;
>        const char                      *name;
> +       struct usb_driver       *driver = to_usb_driver(udev->dev.driver);
> +
> +       /*usbnet already took usb runtime pm, so have to enable the feature
> +       * for usb interface, otherwise usb_autopm_get_interface may return
> +       * failure if USB_SUSPEND(RUNTIME_PM) is enabled.
> +       * */
Just minor: multiline comments doesn't follow the required style.

> +       if (!driver->supports_autosuspend) {
> +               driver->supports_autosuspend = 1;
> +               pm_runtime_enable(&udev->dev);
> +       }
>
>        name = udev->dev.driver->name;
>        info = (struct driver_info *) prod->driver_info;
> --
> 1.7.3
>
>



-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply

* Re: [PATCH] usbnet: fix usb_autopm_get_interface failure(v1)
From: David Miller @ 2010-11-01 15:08 UTC (permalink / raw)
  To: andy.shevchenko
  Cc: tom.leiming, netdev, oliver, dbrownell, gregkh, ben, joe, stable
In-Reply-To: <AANLkTim_NRFV0ELzpOE6K539Wfxsw8j1eW-3TXLCrgOZ@mail.gmail.com>

From: Andy Shevchenko <andy.shevchenko@gmail.com>
Date: Mon, 1 Nov 2010 17:04:35 +0200

>> +       /*usbnet already took usb runtime pm, so have to enable the feature
>> +       * for usb interface, otherwise usb_autopm_get_interface may return
>> +       * failure if USB_SUSPEND(RUNTIME_PM) is enabled.
>> +       * */
> Just minor: multiline comments doesn't follow the required style.

There were also spaces before tabs at the beginning of each
line.

I fixed all of this up when applying the patch.

^ permalink raw reply

* Re: [PATCH] OF device tree: Move of_get_mac_address() to a common source file.
From: Timur Tabi @ 2010-11-01 15:46 UTC (permalink / raw)
  To: Grant Likely; +Cc: devicetree-discuss, netdev, linuxppc-dev
In-Reply-To: <20101101051734.GB17587@angua.secretlab.ca>

On Mon, Nov 1, 2010 at 12:17 AM, Grant Likely <grant.likely@secretlab.ca> wrote:

> Applied, thanks; but made some changes to protect this code because it
> does not work on little endian (it can be fixed in a separate patch)

I'm confused.  How does of_get_mac_address() not work on little-endian?

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply

* Re: [PATCH] OF device tree: Move of_get_mac_address() to a common source file.
From: Grant Likely @ 2010-11-01 15:51 UTC (permalink / raw)
  To: Timur Tabi
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ
In-Reply-To: <AANLkTimp-AFN5T3z9o6X9qM-GQXSU5vinf+Lqu_jUmJj-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Mon, Nov 1, 2010 at 11:46 AM, Timur Tabi <timur-KZfg59tc24xl57MIdRCFDg@public.gmane.org> wrote:
> On Mon, Nov 1, 2010 at 12:17 AM, Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org> wrote:
>
>> Applied, thanks; but made some changes to protect this code because it
>> does not work on little endian (it can be fixed in a separate patch)
>
> I'm confused.  How does of_get_mac_address() not work on little-endian?

Hmmm, right.  I got confused here.  It should be just fine on
little-endian.  I'll revert my change.  Thanks.

g.

^ permalink raw reply

* [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup
From: Dmitry Artamonow @ 2010-10-28  8:18 UTC (permalink / raw)
  To: linux-usb
  Cc: David Brownell, Greg Kroah-Hartman, netdev, linux-kernel,
	Tom Herbert, David S. Miller

Crash is triggered by commit e6484930d7 ("net: allocate tx queues in
register_netdevice"), which moved tx netqueue creation into register_netdev.
So now calling netif_stop_queue() before register_netdev causes an oops.
Move netif_stop_queue() after net device registration to fix crash.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
---
 drivers/usb/gadget/u_ether.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
index 6bb876d..cb23355 100644
--- a/drivers/usb/gadget/u_ether.c
+++ b/drivers/usb/gadget/u_ether.c
@@ -797,7 +797,6 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
 	 *  - iff DATA transfer is active, carrier is "on"
 	 *  - tx queueing enabled if open *and* carrier is "on"
 	 */
-	netif_stop_queue(net);
 	netif_carrier_off(net);
 
 	dev->gadget = g;
@@ -812,6 +811,7 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
 		INFO(dev, "MAC %pM\n", net->dev_addr);
 		INFO(dev, "HOST MAC %pM\n", dev->host_mac);
 
+		netif_stop_queue(net);
 		the_dev = dev;
 	}
 
-- 
1.7.0.4


^ permalink raw reply related

* Re: [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup
From: Michał Mirosław @ 2010-11-01 16:16 UTC (permalink / raw)
  To: Dmitry Artamonow
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, David Brownell,
	Greg Kroah-Hartman, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Tom Herbert, David S. Miller
In-Reply-To: <1288253909-12084-1-git-send-email-mad_soft-aPYA7nAdAYY@public.gmane.org>

2010/10/28 Dmitry Artamonow <mad_soft-aPYA7nAdAYY@public.gmane.org>:
> Crash is triggered by commit e6484930d7 ("net: allocate tx queues in
> register_netdevice"), which moved tx netqueue creation into register_netdev.
> So now calling netif_stop_queue() before register_netdev causes an oops.
> Move netif_stop_queue() after net device registration to fix crash.
>
> Signed-off-by: Dmitry Artamonow <mad_soft-aPYA7nAdAYY@public.gmane.org>
> ---
>  drivers/usb/gadget/u_ether.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
> index 6bb876d..cb23355 100644
> --- a/drivers/usb/gadget/u_ether.c
> +++ b/drivers/usb/gadget/u_ether.c
> @@ -797,7 +797,6 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
>         *  - iff DATA transfer is active, carrier is "on"
>         *  - tx queueing enabled if open *and* carrier is "on"
>         */
> -       netif_stop_queue(net);
>        netif_carrier_off(net);
>
>        dev->gadget = g;
> @@ -812,6 +811,7 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
>                INFO(dev, "MAC %pM\n", net->dev_addr);
>                INFO(dev, "HOST MAC %pM\n", dev->host_mac);
>
> +               netif_stop_queue(net);
>                the_dev = dev;
>        }
>

What about a race between register_netdev() -> open() -> rest of
gether_setup() ? What is this netif_stop_queue() here needed for?

Best Regards,
Michał Mirosław
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup
From: David Miller @ 2010-11-01 16:22 UTC (permalink / raw)
  To: mirqus-Re5JQEeQqe8AvxtiuMwx3w
  Cc: mad_soft-aPYA7nAdAYY, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f, gregkh-l3A5Bk7waGM,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	therbert-hpIqsD4AKlfQT0dZR+AlfA
In-Reply-To: <AANLkTimMwTbj-2oP-VP7Ht1VnA8_w7vpTGz1kk5HG7zx-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: Text/Plain; charset=utf-8, Size: 1815 bytes --]

From: Michał Mirosław <mirqus@gmail.com>
Date: Mon, 1 Nov 2010 17:16:39 +0100

> 2010/10/28 Dmitry Artamonow <mad_soft@inbox.ru>:
>> Crash is triggered by commit e6484930d7 ("net: allocate tx queues in
>> register_netdevice"), which moved tx netqueue creation into register_netdev.
>> So now calling netif_stop_queue() before register_netdev causes an oops.
>> Move netif_stop_queue() after net device registration to fix crash.
>>
>> Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
>> ---
>>  drivers/usb/gadget/u_ether.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
>> index 6bb876d..cb23355 100644
>> --- a/drivers/usb/gadget/u_ether.c
>> +++ b/drivers/usb/gadget/u_ether.c
>> @@ -797,7 +797,6 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
>>         *  - iff DATA transfer is active, carrier is "on"
>>         *  - tx queueing enabled if open *and* carrier is "on"
>>         */
>> -       netif_stop_queue(net);
>>        netif_carrier_off(net);
>>
>>        dev->gadget = g;
>> @@ -812,6 +811,7 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
>>                INFO(dev, "MAC %pM\n", net->dev_addr);
>>                INFO(dev, "HOST MAC %pM\n", dev->host_mac);
>>
>> +               netif_stop_queue(net);
>>                the_dev = dev;
>>        }
>>
> 
> What about a race between register_netdev() -> open() -> rest of
> gether_setup() ? What is this netif_stop_queue() here needed for?

Nothing, it should be completely removed.
N‹§²æìr¸›yúèšØb²X¬¶Ç§vØ^–)Þº{.nÇ+‰·¥Š{±ºÆâžØ^n‡r¡ö¦zË\x1aëh™¨è­Ú&¢îý»\x05ËÛÔØï¦v¬Îf\x1dp)¹¹br	šê+€Ê+zf£¢·hšˆ§~†­†Ûiÿûàz¹\x1e®w¥¢¸?™¨è­Ú&¢)ߢ^[f

^ permalink raw reply

* Re: Fwd: [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup
From: Denis Kirjanov @ 2010-11-01 16:29 UTC (permalink / raw)
  To: mad_soft
  Cc: David Brownell, Greg Kroah-Hartman, netdev, linux-kernel,
	Tom Herbert, David S. Miller
In-Reply-To: <AANLkTi=B93UqfiBFMFryLk1wxus6LwHsSo+8+Ff5D0Ne@mail.gmail.com>

On 11/01/2010 07:12 PM, Denis Kirjanov wrote:
> ---------- Forwarded message ----------
> From: Dmitry Artamonow <mad_soft@inbox.ru>
> Date: Thu, Oct 28, 2010 at 12:18 PM
> Subject: [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup
> To: linux-usb@vger.kernel.org
> Cc: David Brownell <dbrownell@users.sourceforge.net>, Greg
> Kroah-Hartman <gregkh@suse.de>, netdev@vger.kernel.org,
> linux-kernel@vger.kernel.org, Tom Herbert <therbert@google.com>,
> "David S. Miller" <davem@davemloft.net>
> 
> 
> Crash is triggered by commit e6484930d7 ("net: allocate tx queues in
> register_netdevice"), which moved tx netqueue creation into register_netdev.
> So now calling netif_stop_queue() before register_netdev causes an oops.
> Move netif_stop_queue() after net device registration to fix crash.
> 
> Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
> ---

Doesn't this is racy with the ->open? eth_open invokes netif_wake_queue() inside eth_start


[PATCH] USB: gadget: fix ethernet gadget crash in gether_setup

Crash is triggered by commit e6484930d7 ("net: allocate tx queues in
register_netdevice"), which moved tx netqueue creation into register_netdev.
So now calling netif_stop_queue() before register_netdev causes an oops.
Move netif_stop_queue() after net device registration to fix crash.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
---
 drivers/usb/gadget/u_ether.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
index cb23355..fbe86ca 100644
--- a/drivers/usb/gadget/u_ether.c
+++ b/drivers/usb/gadget/u_ether.c
@@ -811,7 +811,6 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
 		INFO(dev, "MAC %pM\n", net->dev_addr);
 		INFO(dev, "HOST MAC %pM\n", dev->host_mac);
 
-		netif_stop_queue(net);
 		the_dev = dev;
 	}
 
-- 
1.7.1

^ permalink raw reply related

* Re: [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup
From: David Miller @ 2010-11-01 16:34 UTC (permalink / raw)
  To: dkirjanov; +Cc: mad_soft, dbrownell, gregkh, netdev, linux-kernel, therbert
In-Reply-To: <4CCEEAEA.4050504@kernel.org>

From: Denis Kirjanov <dkirjanov@kernel.org>
Date: Mon, 01 Nov 2010 19:29:30 +0300

> [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup
> 
> Crash is triggered by commit e6484930d7 ("net: allocate tx queues in
> register_netdevice"), which moved tx netqueue creation into register_netdev.
> So now calling netif_stop_queue() before register_netdev causes an oops.
> Move netif_stop_queue() after net device registration to fix crash.
> 
> Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
> Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH v4 0/2] Get and Set Feature Reports on HIDRAW (USB and Bluetooth)
From: Jiri Kosina @ 2010-11-01 19:23 UTC (permalink / raw)
  To: Alan Ott, Marcel Holtmann, David S. Miller
  Cc: Stefan Achatz, Antonio Ospite, Alexey Dobriyan, Tejun Heo,
	Alan Stern, Greg Kroah-Hartman, Stephane Chatty, Michael Poole,
	Bastien Nocera, Eric Dumazet, linux-input, linux-kernel,
	linux-usb, linux-bluetooth, netdev
In-Reply-To: <alpine.LNX.2.00.1009221408330.26813@pobox.suse.cz>

On Wed, 22 Sep 2010, Jiri Kosina wrote:

> > > > This is version 4. Built against 2.6.35+ revision 320b2b8de12698 .
> > > > 
> > > > Alan Ott (2):
> > > >   HID: Add Support for Setting and Getting Feature Reports from hidraw
> > > >   Bluetooth: hidp: Add support for hidraw  HIDIOCGFEATURE  and
> > > >     HIDIOCSFEATURE
> > > > 
> > > >  drivers/hid/hidraw.c          |  105 ++++++++++++++++++++++++++++++++++++--
> > > >  drivers/hid/usbhid/hid-core.c |   37 +++++++++++++-
> > > >  include/linux/hid.h           |    3 +
> > > >  include/linux/hidraw.h        |    3 +
> > > >  net/bluetooth/hidp/core.c     |  114 +++++++++++++++++++++++++++++++++++++++--
> > > >  net/bluetooth/hidp/hidp.h     |    8 +++
> > > >  6 files changed, 260 insertions(+), 10 deletions(-)
> > > 
> > > Marcel, as per our previous discussion -- what is your word on this? I'd 
> > > be glad taking it once you Ack the bluetooth bits (which, as far as I 
> > > understood from your last mail, don't have strong objections against any 
> > > more).
> > 
> > ... Marcel?
> > 
> > I'd really like not to miss 2.6.37 merge window with this.
> 
> Seemingly I have not enought powers to get statement from Marcel here 
> these days/weeks.
> 
> Davem, would you perhaps be able to step in here?

Marcel, any word on this patchset by chance?

Thanks,

-- 
Jiri Kosina
SUSE Labs, Novell Inc.

^ permalink raw reply

* [PATCH] net: sh_eth: Move off of deprecated I/O routines.
From: Paul Mundt @ 2010-11-01 19:29 UTC (permalink / raw)
  To: David Miller; +Cc: Nobuhiro Iwamatsu, netdev

sh_eth is the last in-tree user of the ctrl_xxx I/O routines. This simply
converts them over to regular MMIO accesors.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

---

 drivers/net/sh_eth.c |  244 +++++++++++++++++++++++++--------------------------
 1 file changed, 122 insertions(+), 122 deletions(-)

diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
index 50259df..b12660d 100644
--- a/drivers/net/sh_eth.c
+++ b/drivers/net/sh_eth.c
@@ -45,9 +45,9 @@ static void sh_eth_set_duplex(struct net_device *ndev)
 	u32 ioaddr = ndev->base_addr;
 
 	if (mdp->duplex) /* Full */
-		ctrl_outl(ctrl_inl(ioaddr + ECMR) | ECMR_DM, ioaddr + ECMR);
+		writel(readl(ioaddr + ECMR) | ECMR_DM, ioaddr + ECMR);
 	else		/* Half */
-		ctrl_outl(ctrl_inl(ioaddr + ECMR) & ~ECMR_DM, ioaddr + ECMR);
+		writel(readl(ioaddr + ECMR) & ~ECMR_DM, ioaddr + ECMR);
 }
 
 static void sh_eth_set_rate(struct net_device *ndev)
@@ -57,10 +57,10 @@ static void sh_eth_set_rate(struct net_device *ndev)
 
 	switch (mdp->speed) {
 	case 10: /* 10BASE */
-		ctrl_outl(ctrl_inl(ioaddr + ECMR) & ~ECMR_RTM, ioaddr + ECMR);
+		writel(readl(ioaddr + ECMR) & ~ECMR_RTM, ioaddr + ECMR);
 		break;
 	case 100:/* 100BASE */
-		ctrl_outl(ctrl_inl(ioaddr + ECMR) | ECMR_RTM, ioaddr + ECMR);
+		writel(readl(ioaddr + ECMR) | ECMR_RTM, ioaddr + ECMR);
 		break;
 	default:
 		break;
@@ -96,9 +96,9 @@ static void sh_eth_set_duplex(struct net_device *ndev)
 	u32 ioaddr = ndev->base_addr;
 
 	if (mdp->duplex) /* Full */
-		ctrl_outl(ctrl_inl(ioaddr + ECMR) | ECMR_DM, ioaddr + ECMR);
+		writel(readl(ioaddr + ECMR) | ECMR_DM, ioaddr + ECMR);
 	else		/* Half */
-		ctrl_outl(ctrl_inl(ioaddr + ECMR) & ~ECMR_DM, ioaddr + ECMR);
+		writel(readl(ioaddr + ECMR) & ~ECMR_DM, ioaddr + ECMR);
 }
 
 static void sh_eth_set_rate(struct net_device *ndev)
@@ -108,10 +108,10 @@ static void sh_eth_set_rate(struct net_device *ndev)
 
 	switch (mdp->speed) {
 	case 10: /* 10BASE */
-		ctrl_outl(0, ioaddr + RTRATE);
+		writel(0, ioaddr + RTRATE);
 		break;
 	case 100:/* 100BASE */
-		ctrl_outl(1, ioaddr + RTRATE);
+		writel(1, ioaddr + RTRATE);
 		break;
 	default:
 		break;
@@ -143,7 +143,7 @@ static struct sh_eth_cpu_data sh_eth_my_cpu_data = {
 static void sh_eth_chip_reset(struct net_device *ndev)
 {
 	/* reset device */
-	ctrl_outl(ARSTR_ARSTR, ARSTR);
+	writel(ARSTR_ARSTR, ARSTR);
 	mdelay(1);
 }
 
@@ -152,10 +152,10 @@ static void sh_eth_reset(struct net_device *ndev)
 	u32 ioaddr = ndev->base_addr;
 	int cnt = 100;
 
-	ctrl_outl(EDSR_ENALL, ioaddr + EDSR);
-	ctrl_outl(ctrl_inl(ioaddr + EDMR) | EDMR_SRST, ioaddr + EDMR);
+	writel(EDSR_ENALL, ioaddr + EDSR);
+	writel(readl(ioaddr + EDMR) | EDMR_SRST, ioaddr + EDMR);
 	while (cnt > 0) {
-		if (!(ctrl_inl(ioaddr + EDMR) & 0x3))
+		if (!(readl(ioaddr + EDMR) & 0x3))
 			break;
 		mdelay(1);
 		cnt--;
@@ -164,14 +164,14 @@ static void sh_eth_reset(struct net_device *ndev)
 		printk(KERN_ERR "Device reset fail\n");
 
 	/* Table Init */
-	ctrl_outl(0x0, ioaddr + TDLAR);
-	ctrl_outl(0x0, ioaddr + TDFAR);
-	ctrl_outl(0x0, ioaddr + TDFXR);
-	ctrl_outl(0x0, ioaddr + TDFFR);
-	ctrl_outl(0x0, ioaddr + RDLAR);
-	ctrl_outl(0x0, ioaddr + RDFAR);
-	ctrl_outl(0x0, ioaddr + RDFXR);
-	ctrl_outl(0x0, ioaddr + RDFFR);
+	writel(0x0, ioaddr + TDLAR);
+	writel(0x0, ioaddr + TDFAR);
+	writel(0x0, ioaddr + TDFXR);
+	writel(0x0, ioaddr + TDFFR);
+	writel(0x0, ioaddr + RDLAR);
+	writel(0x0, ioaddr + RDFAR);
+	writel(0x0, ioaddr + RDFXR);
+	writel(0x0, ioaddr + RDFFR);
 }
 
 static void sh_eth_set_duplex(struct net_device *ndev)
@@ -180,9 +180,9 @@ static void sh_eth_set_duplex(struct net_device *ndev)
 	u32 ioaddr = ndev->base_addr;
 
 	if (mdp->duplex) /* Full */
-		ctrl_outl(ctrl_inl(ioaddr + ECMR) | ECMR_DM, ioaddr + ECMR);
+		writel(readl(ioaddr + ECMR) | ECMR_DM, ioaddr + ECMR);
 	else		/* Half */
-		ctrl_outl(ctrl_inl(ioaddr + ECMR) & ~ECMR_DM, ioaddr + ECMR);
+		writel(readl(ioaddr + ECMR) & ~ECMR_DM, ioaddr + ECMR);
 }
 
 static void sh_eth_set_rate(struct net_device *ndev)
@@ -192,13 +192,13 @@ static void sh_eth_set_rate(struct net_device *ndev)
 
 	switch (mdp->speed) {
 	case 10: /* 10BASE */
-		ctrl_outl(GECMR_10, ioaddr + GECMR);
+		writel(GECMR_10, ioaddr + GECMR);
 		break;
 	case 100:/* 100BASE */
-		ctrl_outl(GECMR_100, ioaddr + GECMR);
+		writel(GECMR_100, ioaddr + GECMR);
 		break;
 	case 1000: /* 1000BASE */
-		ctrl_outl(GECMR_1000, ioaddr + GECMR);
+		writel(GECMR_1000, ioaddr + GECMR);
 		break;
 	default:
 		break;
@@ -283,9 +283,9 @@ static void sh_eth_reset(struct net_device *ndev)
 {
 	u32 ioaddr = ndev->base_addr;
 
-	ctrl_outl(ctrl_inl(ioaddr + EDMR) | EDMR_SRST, ioaddr + EDMR);
+	writel(readl(ioaddr + EDMR) | EDMR_SRST, ioaddr + EDMR);
 	mdelay(3);
-	ctrl_outl(ctrl_inl(ioaddr + EDMR) & ~EDMR_SRST, ioaddr + EDMR);
+	writel(readl(ioaddr + EDMR) & ~EDMR_SRST, ioaddr + EDMR);
 }
 #endif
 
@@ -336,10 +336,10 @@ static void update_mac_address(struct net_device *ndev)
 {
 	u32 ioaddr = ndev->base_addr;
 
-	ctrl_outl((ndev->dev_addr[0] << 24) | (ndev->dev_addr[1] << 16) |
+	writel((ndev->dev_addr[0] << 24) | (ndev->dev_addr[1] << 16) |
 		  (ndev->dev_addr[2] << 8) | (ndev->dev_addr[3]),
 		  ioaddr + MAHR);
-	ctrl_outl((ndev->dev_addr[4] << 8) | (ndev->dev_addr[5]),
+	writel((ndev->dev_addr[4] << 8) | (ndev->dev_addr[5]),
 		  ioaddr + MALR);
 }
 
@@ -358,12 +358,12 @@ static void read_mac_address(struct net_device *ndev, unsigned char *mac)
 	if (mac[0] || mac[1] || mac[2] || mac[3] || mac[4] || mac[5]) {
 		memcpy(ndev->dev_addr, mac, 6);
 	} else {
-		ndev->dev_addr[0] = (ctrl_inl(ioaddr + MAHR) >> 24);
-		ndev->dev_addr[1] = (ctrl_inl(ioaddr + MAHR) >> 16) & 0xFF;
-		ndev->dev_addr[2] = (ctrl_inl(ioaddr + MAHR) >> 8) & 0xFF;
-		ndev->dev_addr[3] = (ctrl_inl(ioaddr + MAHR) & 0xFF);
-		ndev->dev_addr[4] = (ctrl_inl(ioaddr + MALR) >> 8) & 0xFF;
-		ndev->dev_addr[5] = (ctrl_inl(ioaddr + MALR) & 0xFF);
+		ndev->dev_addr[0] = (readl(ioaddr + MAHR) >> 24);
+		ndev->dev_addr[1] = (readl(ioaddr + MAHR) >> 16) & 0xFF;
+		ndev->dev_addr[2] = (readl(ioaddr + MAHR) >> 8) & 0xFF;
+		ndev->dev_addr[3] = (readl(ioaddr + MAHR) & 0xFF);
+		ndev->dev_addr[4] = (readl(ioaddr + MALR) >> 8) & 0xFF;
+		ndev->dev_addr[5] = (readl(ioaddr + MALR) & 0xFF);
 	}
 }
 
@@ -379,19 +379,19 @@ struct bb_info {
 /* PHY bit set */
 static void bb_set(u32 addr, u32 msk)
 {
-	ctrl_outl(ctrl_inl(addr) | msk, addr);
+	writel(readl(addr) | msk, addr);
 }
 
 /* PHY bit clear */
 static void bb_clr(u32 addr, u32 msk)
 {
-	ctrl_outl((ctrl_inl(addr) & ~msk), addr);
+	writel((readl(addr) & ~msk), addr);
 }
 
 /* PHY bit read */
 static int bb_read(u32 addr, u32 msk)
 {
-	return (ctrl_inl(addr) & msk) != 0;
+	return (readl(addr) & msk) != 0;
 }
 
 /* Data I/O pin control */
@@ -506,9 +506,9 @@ static void sh_eth_ring_format(struct net_device *ndev)
 		rxdesc->buffer_length = ALIGN(mdp->rx_buf_sz, 16);
 		/* Rx descriptor address set */
 		if (i == 0) {
-			ctrl_outl(mdp->rx_desc_dma, ioaddr + RDLAR);
+			writel(mdp->rx_desc_dma, ioaddr + RDLAR);
 #if defined(CONFIG_CPU_SUBTYPE_SH7763)
-			ctrl_outl(mdp->rx_desc_dma, ioaddr + RDFAR);
+			writel(mdp->rx_desc_dma, ioaddr + RDFAR);
 #endif
 		}
 	}
@@ -528,9 +528,9 @@ static void sh_eth_ring_format(struct net_device *ndev)
 		txdesc->buffer_length = 0;
 		if (i == 0) {
 			/* Tx descriptor address set */
-			ctrl_outl(mdp->tx_desc_dma, ioaddr + TDLAR);
+			writel(mdp->tx_desc_dma, ioaddr + TDLAR);
 #if defined(CONFIG_CPU_SUBTYPE_SH7763)
-			ctrl_outl(mdp->tx_desc_dma, ioaddr + TDFAR);
+			writel(mdp->tx_desc_dma, ioaddr + TDFAR);
 #endif
 		}
 	}
@@ -623,71 +623,71 @@ static int sh_eth_dev_init(struct net_device *ndev)
 	/* Descriptor format */
 	sh_eth_ring_format(ndev);
 	if (mdp->cd->rpadir)
-		ctrl_outl(mdp->cd->rpadir_value, ioaddr + RPADIR);
+		writel(mdp->cd->rpadir_value, ioaddr + RPADIR);
 
 	/* all sh_eth int mask */
-	ctrl_outl(0, ioaddr + EESIPR);
+	writel(0, ioaddr + EESIPR);
 
 #if defined(__LITTLE_ENDIAN__)
 	if (mdp->cd->hw_swap)
-		ctrl_outl(EDMR_EL, ioaddr + EDMR);
+		writel(EDMR_EL, ioaddr + EDMR);
 	else
 #endif
-		ctrl_outl(0, ioaddr + EDMR);
+		writel(0, ioaddr + EDMR);
 
 	/* FIFO size set */
-	ctrl_outl(mdp->cd->fdr_value, ioaddr + FDR);
-	ctrl_outl(0, ioaddr + TFTR);
+	writel(mdp->cd->fdr_value, ioaddr + FDR);
+	writel(0, ioaddr + TFTR);
 
 	/* Frame recv control */
-	ctrl_outl(mdp->cd->rmcr_value, ioaddr + RMCR);
+	writel(mdp->cd->rmcr_value, ioaddr + RMCR);
 
 	rx_int_var = mdp->rx_int_var = DESC_I_RINT8 | DESC_I_RINT5;
 	tx_int_var = mdp->tx_int_var = DESC_I_TINT2;
-	ctrl_outl(rx_int_var | tx_int_var, ioaddr + TRSCER);
+	writel(rx_int_var | tx_int_var, ioaddr + TRSCER);
 
 	if (mdp->cd->bculr)
-		ctrl_outl(0x800, ioaddr + BCULR);	/* Burst sycle set */
+		writel(0x800, ioaddr + BCULR);	/* Burst sycle set */
 
-	ctrl_outl(mdp->cd->fcftr_value, ioaddr + FCFTR);
+	writel(mdp->cd->fcftr_value, ioaddr + FCFTR);
 
 	if (!mdp->cd->no_trimd)
-		ctrl_outl(0, ioaddr + TRIMD);
+		writel(0, ioaddr + TRIMD);
 
 	/* Recv frame limit set register */
-	ctrl_outl(RFLR_VALUE, ioaddr + RFLR);
+	writel(RFLR_VALUE, ioaddr + RFLR);
 
-	ctrl_outl(ctrl_inl(ioaddr + EESR), ioaddr + EESR);
-	ctrl_outl(mdp->cd->eesipr_value, ioaddr + EESIPR);
+	writel(readl(ioaddr + EESR), ioaddr + EESR);
+	writel(mdp->cd->eesipr_value, ioaddr + EESIPR);
 
 	/* PAUSE Prohibition */
-	val = (ctrl_inl(ioaddr + ECMR) & ECMR_DM) |
+	val = (readl(ioaddr + ECMR) & ECMR_DM) |
 		ECMR_ZPF | (mdp->duplex ? ECMR_DM : 0) | ECMR_TE | ECMR_RE;
 
-	ctrl_outl(val, ioaddr + ECMR);
+	writel(val, ioaddr + ECMR);
 
 	if (mdp->cd->set_rate)
 		mdp->cd->set_rate(ndev);
 
 	/* E-MAC Status Register clear */
-	ctrl_outl(mdp->cd->ecsr_value, ioaddr + ECSR);
+	writel(mdp->cd->ecsr_value, ioaddr + ECSR);
 
 	/* E-MAC Interrupt Enable register */
-	ctrl_outl(mdp->cd->ecsipr_value, ioaddr + ECSIPR);
+	writel(mdp->cd->ecsipr_value, ioaddr + ECSIPR);
 
 	/* Set MAC address */
 	update_mac_address(ndev);
 
 	/* mask reset */
 	if (mdp->cd->apr)
-		ctrl_outl(APR_AP, ioaddr + APR);
+		writel(APR_AP, ioaddr + APR);
 	if (mdp->cd->mpr)
-		ctrl_outl(MPR_MP, ioaddr + MPR);
+		writel(MPR_MP, ioaddr + MPR);
 	if (mdp->cd->tpauser)
-		ctrl_outl(TPAUSER_UNLIMITED, ioaddr + TPAUSER);
+		writel(TPAUSER_UNLIMITED, ioaddr + TPAUSER);
 
 	/* Setting the Rx mode will start the Rx process. */
-	ctrl_outl(EDRRR_R, ioaddr + EDRRR);
+	writel(EDRRR_R, ioaddr + EDRRR);
 
 	netif_start_queue(ndev);
 
@@ -811,8 +811,8 @@ static int sh_eth_rx(struct net_device *ndev)
 
 	/* Restart Rx engine if stopped. */
 	/* If we don't need to check status, don't. -KDU */
-	if (!(ctrl_inl(ndev->base_addr + EDRRR) & EDRRR_R))
-		ctrl_outl(EDRRR_R, ndev->base_addr + EDRRR);
+	if (!(readl(ndev->base_addr + EDRRR) & EDRRR_R))
+		writel(EDRRR_R, ndev->base_addr + EDRRR);
 
 	return 0;
 }
@@ -827,8 +827,8 @@ static void sh_eth_error(struct net_device *ndev, int intr_status)
 	u32 mask;
 
 	if (intr_status & EESR_ECI) {
-		felic_stat = ctrl_inl(ioaddr + ECSR);
-		ctrl_outl(felic_stat, ioaddr + ECSR);	/* clear int */
+		felic_stat = readl(ioaddr + ECSR);
+		writel(felic_stat, ioaddr + ECSR);	/* clear int */
 		if (felic_stat & ECSR_ICD)
 			mdp->stats.tx_carrier_errors++;
 		if (felic_stat & ECSR_LCHNG) {
@@ -839,25 +839,25 @@ static void sh_eth_error(struct net_device *ndev, int intr_status)
 				else
 					link_stat = PHY_ST_LINK;
 			} else {
-				link_stat = (ctrl_inl(ioaddr + PSR));
+				link_stat = (readl(ioaddr + PSR));
 				if (mdp->ether_link_active_low)
 					link_stat = ~link_stat;
 			}
 			if (!(link_stat & PHY_ST_LINK)) {
 				/* Link Down : disable tx and rx */
-				ctrl_outl(ctrl_inl(ioaddr + ECMR) &
+				writel(readl(ioaddr + ECMR) &
 					  ~(ECMR_RE | ECMR_TE), ioaddr + ECMR);
 			} else {
 				/* Link Up */
-				ctrl_outl(ctrl_inl(ioaddr + EESIPR) &
+				writel(readl(ioaddr + EESIPR) &
 					  ~DMAC_M_ECI, ioaddr + EESIPR);
 				/*clear int */
-				ctrl_outl(ctrl_inl(ioaddr + ECSR),
+				writel(readl(ioaddr + ECSR),
 					  ioaddr + ECSR);
-				ctrl_outl(ctrl_inl(ioaddr + EESIPR) |
+				writel(readl(ioaddr + EESIPR) |
 					  DMAC_M_ECI, ioaddr + EESIPR);
 				/* enable tx and rx */
-				ctrl_outl(ctrl_inl(ioaddr + ECMR) |
+				writel(readl(ioaddr + ECMR) |
 					  (ECMR_RE | ECMR_TE), ioaddr + ECMR);
 			}
 		}
@@ -888,8 +888,8 @@ static void sh_eth_error(struct net_device *ndev, int intr_status)
 		/* Receive Descriptor Empty int */
 		mdp->stats.rx_over_errors++;
 
-		if (ctrl_inl(ioaddr + EDRRR) ^ EDRRR_R)
-			ctrl_outl(EDRRR_R, ioaddr + EDRRR);
+		if (readl(ioaddr + EDRRR) ^ EDRRR_R)
+			writel(EDRRR_R, ioaddr + EDRRR);
 		dev_err(&ndev->dev, "Receive Descriptor Empty\n");
 	}
 	if (intr_status & EESR_RFE) {
@@ -903,7 +903,7 @@ static void sh_eth_error(struct net_device *ndev, int intr_status)
 		mask &= ~EESR_ADE;
 	if (intr_status & mask) {
 		/* Tx error */
-		u32 edtrr = ctrl_inl(ndev->base_addr + EDTRR);
+		u32 edtrr = readl(ndev->base_addr + EDTRR);
 		/* dmesg */
 		dev_err(&ndev->dev, "TX error. status=%8.8x cur_tx=%8.8x ",
 				intr_status, mdp->cur_tx);
@@ -915,7 +915,7 @@ static void sh_eth_error(struct net_device *ndev, int intr_status)
 		/* SH7712 BUG */
 		if (edtrr ^ EDTRR_TRNS) {
 			/* tx dma start */
-			ctrl_outl(EDTRR_TRNS, ndev->base_addr + EDTRR);
+			writel(EDTRR_TRNS, ndev->base_addr + EDTRR);
 		}
 		/* wakeup */
 		netif_wake_queue(ndev);
@@ -934,12 +934,12 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev)
 	spin_lock(&mdp->lock);
 
 	/* Get interrpt stat */
-	intr_status = ctrl_inl(ioaddr + EESR);
+	intr_status = readl(ioaddr + EESR);
 	/* Clear interrupt */
 	if (intr_status & (EESR_FRC | EESR_RMAF | EESR_RRF |
 			EESR_RTLF | EESR_RTSF | EESR_PRE | EESR_CERF |
 			cd->tx_check | cd->eesr_err_check)) {
-		ctrl_outl(intr_status, ioaddr + EESR);
+		writel(intr_status, ioaddr + EESR);
 		ret = IRQ_HANDLED;
 	} else
 		goto other_irq;
@@ -1000,7 +1000,7 @@ static void sh_eth_adjust_link(struct net_device *ndev)
 				mdp->cd->set_rate(ndev);
 		}
 		if (mdp->link == PHY_DOWN) {
-			ctrl_outl((ctrl_inl(ioaddr + ECMR) & ~ECMR_TXF)
+			writel((readl(ioaddr + ECMR) & ~ECMR_TXF)
 					| ECMR_DM, ioaddr + ECMR);
 			new_state = 1;
 			mdp->link = phydev->link;
@@ -1125,7 +1125,7 @@ static void sh_eth_tx_timeout(struct net_device *ndev)
 
 	/* worning message out. */
 	printk(KERN_WARNING "%s: transmit timed out, status %8.8x,"
-	       " resetting...\n", ndev->name, (int)ctrl_inl(ioaddr + EESR));
+	       " resetting...\n", ndev->name, (int)readl(ioaddr + EESR));
 
 	/* tx_errors count up */
 	mdp->stats.tx_errors++;
@@ -1196,8 +1196,8 @@ static int sh_eth_start_xmit(struct sk_buff *skb, struct net_device *ndev)
 
 	mdp->cur_tx++;
 
-	if (!(ctrl_inl(ndev->base_addr + EDTRR) & EDTRR_TRNS))
-		ctrl_outl(EDTRR_TRNS, ndev->base_addr + EDTRR);
+	if (!(readl(ndev->base_addr + EDTRR) & EDTRR_TRNS))
+		writel(EDTRR_TRNS, ndev->base_addr + EDTRR);
 
 	return NETDEV_TX_OK;
 }
@@ -1212,11 +1212,11 @@ static int sh_eth_close(struct net_device *ndev)
 	netif_stop_queue(ndev);
 
 	/* Disable interrupts by clearing the interrupt mask. */
-	ctrl_outl(0x0000, ioaddr + EESIPR);
+	writel(0x0000, ioaddr + EESIPR);
 
 	/* Stop the chip's Tx and Rx processes. */
-	ctrl_outl(0, ioaddr + EDTRR);
-	ctrl_outl(0, ioaddr + EDRRR);
+	writel(0, ioaddr + EDTRR);
+	writel(0, ioaddr + EDRRR);
 
 	/* PHY Disconnect */
 	if (mdp->phydev) {
@@ -1251,20 +1251,20 @@ static struct net_device_stats *sh_eth_get_stats(struct net_device *ndev)
 
 	pm_runtime_get_sync(&mdp->pdev->dev);
 
-	mdp->stats.tx_dropped += ctrl_inl(ioaddr + TROCR);
-	ctrl_outl(0, ioaddr + TROCR);	/* (write clear) */
-	mdp->stats.collisions += ctrl_inl(ioaddr + CDCR);
-	ctrl_outl(0, ioaddr + CDCR);	/* (write clear) */
-	mdp->stats.tx_carrier_errors += ctrl_inl(ioaddr + LCCR);
-	ctrl_outl(0, ioaddr + LCCR);	/* (write clear) */
+	mdp->stats.tx_dropped += readl(ioaddr + TROCR);
+	writel(0, ioaddr + TROCR);	/* (write clear) */
+	mdp->stats.collisions += readl(ioaddr + CDCR);
+	writel(0, ioaddr + CDCR);	/* (write clear) */
+	mdp->stats.tx_carrier_errors += readl(ioaddr + LCCR);
+	writel(0, ioaddr + LCCR);	/* (write clear) */
 #if defined(CONFIG_CPU_SUBTYPE_SH7763)
-	mdp->stats.tx_carrier_errors += ctrl_inl(ioaddr + CERCR);/* CERCR */
-	ctrl_outl(0, ioaddr + CERCR);	/* (write clear) */
-	mdp->stats.tx_carrier_errors += ctrl_inl(ioaddr + CEECR);/* CEECR */
-	ctrl_outl(0, ioaddr + CEECR);	/* (write clear) */
+	mdp->stats.tx_carrier_errors += readl(ioaddr + CERCR);/* CERCR */
+	writel(0, ioaddr + CERCR);	/* (write clear) */
+	mdp->stats.tx_carrier_errors += readl(ioaddr + CEECR);/* CEECR */
+	writel(0, ioaddr + CEECR);	/* (write clear) */
 #else
-	mdp->stats.tx_carrier_errors += ctrl_inl(ioaddr + CNDCR);
-	ctrl_outl(0, ioaddr + CNDCR);	/* (write clear) */
+	mdp->stats.tx_carrier_errors += readl(ioaddr + CNDCR);
+	writel(0, ioaddr + CNDCR);	/* (write clear) */
 #endif
 	pm_runtime_put_sync(&mdp->pdev->dev);
 
@@ -1295,11 +1295,11 @@ static void sh_eth_set_multicast_list(struct net_device *ndev)
 
 	if (ndev->flags & IFF_PROMISC) {
 		/* Set promiscuous. */
-		ctrl_outl((ctrl_inl(ioaddr + ECMR) & ~ECMR_MCT) | ECMR_PRM,
+		writel((readl(ioaddr + ECMR) & ~ECMR_MCT) | ECMR_PRM,
 			  ioaddr + ECMR);
 	} else {
 		/* Normal, unicast/broadcast-only mode. */
-		ctrl_outl((ctrl_inl(ioaddr + ECMR) & ~ECMR_PRM) | ECMR_MCT,
+		writel((readl(ioaddr + ECMR) & ~ECMR_PRM) | ECMR_MCT,
 			  ioaddr + ECMR);
 	}
 }
@@ -1307,30 +1307,30 @@ static void sh_eth_set_multicast_list(struct net_device *ndev)
 /* SuperH's TSU register init function */
 static void sh_eth_tsu_init(u32 ioaddr)
 {
-	ctrl_outl(0, ioaddr + TSU_FWEN0);	/* Disable forward(0->1) */
-	ctrl_outl(0, ioaddr + TSU_FWEN1);	/* Disable forward(1->0) */
-	ctrl_outl(0, ioaddr + TSU_FCM);	/* forward fifo 3k-3k */
-	ctrl_outl(0xc, ioaddr + TSU_BSYSL0);
-	ctrl_outl(0xc, ioaddr + TSU_BSYSL1);
-	ctrl_outl(0, ioaddr + TSU_PRISL0);
-	ctrl_outl(0, ioaddr + TSU_PRISL1);
-	ctrl_outl(0, ioaddr + TSU_FWSL0);
-	ctrl_outl(0, ioaddr + TSU_FWSL1);
-	ctrl_outl(TSU_FWSLC_POSTENU | TSU_FWSLC_POSTENL, ioaddr + TSU_FWSLC);
+	writel(0, ioaddr + TSU_FWEN0);	/* Disable forward(0->1) */
+	writel(0, ioaddr + TSU_FWEN1);	/* Disable forward(1->0) */
+	writel(0, ioaddr + TSU_FCM);	/* forward fifo 3k-3k */
+	writel(0xc, ioaddr + TSU_BSYSL0);
+	writel(0xc, ioaddr + TSU_BSYSL1);
+	writel(0, ioaddr + TSU_PRISL0);
+	writel(0, ioaddr + TSU_PRISL1);
+	writel(0, ioaddr + TSU_FWSL0);
+	writel(0, ioaddr + TSU_FWSL1);
+	writel(TSU_FWSLC_POSTENU | TSU_FWSLC_POSTENL, ioaddr + TSU_FWSLC);
 #if defined(CONFIG_CPU_SUBTYPE_SH7763)
-	ctrl_outl(0, ioaddr + TSU_QTAG0);	/* Disable QTAG(0->1) */
-	ctrl_outl(0, ioaddr + TSU_QTAG1);	/* Disable QTAG(1->0) */
+	writel(0, ioaddr + TSU_QTAG0);	/* Disable QTAG(0->1) */
+	writel(0, ioaddr + TSU_QTAG1);	/* Disable QTAG(1->0) */
 #else
-	ctrl_outl(0, ioaddr + TSU_QTAGM0);	/* Disable QTAG(0->1) */
-	ctrl_outl(0, ioaddr + TSU_QTAGM1);	/* Disable QTAG(1->0) */
+	writel(0, ioaddr + TSU_QTAGM0);	/* Disable QTAG(0->1) */
+	writel(0, ioaddr + TSU_QTAGM1);	/* Disable QTAG(1->0) */
 #endif
-	ctrl_outl(0, ioaddr + TSU_FWSR);	/* all interrupt status clear */
-	ctrl_outl(0, ioaddr + TSU_FWINMK);	/* Disable all interrupt */
-	ctrl_outl(0, ioaddr + TSU_TEN);	/* Disable all CAM entry */
-	ctrl_outl(0, ioaddr + TSU_POST1);	/* Disable CAM entry [ 0- 7] */
-	ctrl_outl(0, ioaddr + TSU_POST2);	/* Disable CAM entry [ 8-15] */
-	ctrl_outl(0, ioaddr + TSU_POST3);	/* Disable CAM entry [16-23] */
-	ctrl_outl(0, ioaddr + TSU_POST4);	/* Disable CAM entry [24-31] */
+	writel(0, ioaddr + TSU_FWSR);	/* all interrupt status clear */
+	writel(0, ioaddr + TSU_FWINMK);	/* Disable all interrupt */
+	writel(0, ioaddr + TSU_TEN);	/* Disable all CAM entry */
+	writel(0, ioaddr + TSU_POST1);	/* Disable CAM entry [ 0- 7] */
+	writel(0, ioaddr + TSU_POST2);	/* Disable CAM entry [ 8-15] */
+	writel(0, ioaddr + TSU_POST3);	/* Disable CAM entry [16-23] */
+	writel(0, ioaddr + TSU_POST4);	/* Disable CAM entry [24-31] */
 }
 #endif /* SH_ETH_HAS_TSU */
 

^ permalink raw reply related

* [PATCH] net: check queue_index from sock is valid for device
From: Tom Herbert @ 2010-11-01 19:53 UTC (permalink / raw)
  To: davem, netdev

In dev_pick_tx recompute the queue index if the value stored in the
socket is greater than or equal to the number of real queues for the
device.  The saved index in the sock structure is not guaranteed to
be appropriate for the egress device (this could happen on a route
change or in presence of tunnelling).  The result of the queue index
being bad would be to return a bogus queue (crash could prersumably
follow).

Signed-off-by: Tom Herbert <therbert@google.com>
---
 net/core/dev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 78b5a89..dc2a307 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2135,7 +2135,7 @@ static struct netdev_queue *dev_pick_tx(struct net_device *dev,
 	} else {
 		struct sock *sk = skb->sk;
 		queue_index = sk_tx_queue_get(sk);
-		if (queue_index < 0) {
+		if (queue_index < 0 || queue_index >= dev->real_num_tx_queues) {
 
 			queue_index = 0;
 			if (dev->real_num_tx_queues > 1)
-- 
1.7.3.1


^ permalink raw reply related

* Re: [PATCH] net: check queue_index from sock is valid for device
From: David Miller @ 2010-11-01 19:56 UTC (permalink / raw)
  To: therbert; +Cc: netdev
In-Reply-To: <alpine.DEB.1.00.1011011249590.5368@pokey.mtv.corp.google.com>

From: Tom Herbert <therbert@google.com>
Date: Mon, 1 Nov 2010 12:53:32 -0700 (PDT)

> In dev_pick_tx recompute the queue index if the value stored in the
> socket is greater than or equal to the number of real queues for the
> device.  The saved index in the sock structure is not guaranteed to
> be appropriate for the egress device (this could happen on a route
> change or in presence of tunnelling).  The result of the queue index
> being bad would be to return a bogus queue (crash could prersumably
> follow).
> 
> Signed-off-by: Tom Herbert <therbert@google.com>

Looks good, applied, thanks Tom.

^ permalink raw reply

* Re: [PATCH 1/3] offloading: Make scatter/gather more tolerant of vlans.
From: Ben Hutchings @ 2010-11-01 20:06 UTC (permalink / raw)
  To: Jesse Gross; +Cc: David Miller, netdev
In-Reply-To: <1288390495-28923-1-git-send-email-jesse@nicira.com>

On Fri, 2010-10-29 at 15:14 -0700, Jesse Gross wrote:
> When checking if it is necessary to linearize a packet, we currently
> use vlan_features if the packet contains either an in-band or out-
> of-band vlan tag.  However, in-band tags aren't special in any way
> for scatter/gather since they are part of the packet buffer and are
> simply more data to DMA.  Therefore, only use vlan_features for out-
> of-band tags, which could potentially have some interaction with
> scatter/gather.
> 
> Signed-off-by: Jesse Gross <jesse@nicira.com>
> CC: Ben Hutchings <bhutchings@solarflare.com>
[...]

Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply

* Re: [RFC PATCH 1/1] vhost: TX used buffer guest signal accumulation
From: Shirley Ma @ 2010-11-01 20:17 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: David Miller, netdev, kvm, linux-kernel
In-Reply-To: <20101030200603.GA19033@redhat.com>

On Sat, 2010-10-30 at 22:06 +0200, Michael S. Tsirkin wrote:
> On Fri, Oct 29, 2010 at 08:43:08AM -0700, Shirley Ma wrote:
> > On Fri, 2010-10-29 at 10:10 +0200, Michael S. Tsirkin wrote:
> > > Hmm. I don't yet understand. We are still doing copies into the
> per-vq
> > > buffer, and the data copied is really small.  Is it about cache
> line
> > > bounces?  Could you try figuring it out?
> > 
> > per-vq buffer is much less expensive than 3 put_copy() call. I will
> > collect the profiling data to show that.
> 
> What about __put_user? Maybe the access checks are the ones
> that add the cost here? I attach patches to strip access checks:
> they are not needed as we do them on setup time already, anyway.
> Can you try them out and see if performance is improved for you
> please?
> On top of this, we will need to add some scheme to accumulate signals,
> but that is a separate issue.

Yes, moving from put_user/get_user to __put_user/__get_user does improve
the performance by removing the checking.

My concern here is whether checking only in set up would be sufficient
for security? Would be there is a case guest could corrupt the ring
later? If not, that's OK.

> > > > > 2. How about flushing out queued stuff before we exit
> > > > >    the handle_tx loop? That would address most of
> > > > >    the spec issue. 
> > > > 
> > > > The performance is almost as same as the previous patch. I will
> > > resubmit
> > > > the modified one, adding vhost_add_used_and_signal_n after
> handle_tx
> > > > loop for processing pending queue.
> > > > 
> > > > This patch was a part of modified macvtap zero copy which I
> haven't
> > > > submitted yet. I found this helped vhost TX in general. This
> pending
> > > > queue will be used by DMA done later, so I put it in vq instead
> of a
> > > > local variable in handle_tx.
> > > > 
> > > > Thanks
> > > > Shirley
> > > 
> > > BTW why do we need another array? Isn't heads field exactly what
> we
> > > need
> > > here?
> > 
> > head field is only for up to 32, the more used buffers add and
> signal
> > accumulated the better performance is from test results.
> 
> I think we should separate the used update and signalling.  Interrupts
> are expensive so I can believe accumulating even up to 100 of them
> helps. But used head copies are already prety cheap. If we cut the
> overhead by x32, that should make them almost free?

I can separate the used update and signaling to see the best
performance.

> > That's was one
> > of the reason I didn't use heads. The other reason was I used these
> > buffer for pending dma done in mavctap zero copy patch. It could be
> up
> > to vq->num in worse case.
> 
> We can always increase that, not an issue. 

Good, I will change heads up to vq->num and use it.

Thanks
Shirley


^ permalink raw reply

* Re: [PATCH 2/3] offloading: Support multiple vlan tags in GSO.
From: Ben Hutchings @ 2010-11-01 20:33 UTC (permalink / raw)
  To: Jesse Gross; +Cc: David Miller, netdev
In-Reply-To: <1288390495-28923-2-git-send-email-jesse@nicira.com>

On Fri, 2010-10-29 at 15:14 -0700, Jesse Gross wrote:
> We assume that hardware TSO can't support multiple levels of vlan tags
> but we allow it to be done.  Therefore, enable GSO to parse these tags
> so we can fallback to software.
> 
> Signed-off-by: Jesse Gross <jesse@nicira.com>
> CC: Ben Hutchings <bhutchings@solarflare.com>
[...]

I can't see how TSO would be enabled on a second-level VLAN device;
presumably you're thinking about GSO being enabled there?

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply

* [PATCH 1/2] solos: Add 'Firmware' attribute for Traverse overall firmware version
From: David Woodhouse @ 2010-11-01 20:34 UTC (permalink / raw)
  To: davem, netdev

The existing 'FirmwareVersion' attribute only covers the DSP firmware as
provided by Conexant; not the overall version of the device firmware. We
do want to be able to see the full version number too.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
---
 drivers/atm/solos-attrlist.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/atm/solos-attrlist.c b/drivers/atm/solos-attrlist.c
index 1a9332e..9a676ee 100644
--- a/drivers/atm/solos-attrlist.c
+++ b/drivers/atm/solos-attrlist.c
@@ -1,6 +1,7 @@
 SOLOS_ATTR_RO(DriverVersion)
 SOLOS_ATTR_RO(APIVersion)
 SOLOS_ATTR_RO(FirmwareVersion)
+SOLOS_ATTR_RO(Version)
 // SOLOS_ATTR_RO(DspVersion)
 // SOLOS_ATTR_RO(CommonHandshake)
 SOLOS_ATTR_RO(Connected)
-- 
1.7.3.1


-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse@intel.com                              Intel Corporation


^ permalink raw reply related

* [PATCH 2/2] solos: Refuse to upgrade firmware with older FPGA. It doesn't work.
From: David Woodhouse @ 2010-11-01 20:35 UTC (permalink / raw)
  To: davem, netdev

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
---
 drivers/atm/solos-pci.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
index f46138a..40062df 100644
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
@@ -1161,6 +1161,14 @@ static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	dev_info(&dev->dev, "Solos FPGA Version %d.%02d svn-%d\n",
 		 major_ver, minor_ver, fpga_ver);
 
+	if (fpga_ver < 37 && (fpga_upgrade || firmware_upgrade ||
+			      db_fpga_upgrade || db_firmware_upgrade)) {
+		dev_warn(&dev->dev,
+			 "FPGA too old; cannot upgrade flash. Use JTAG.\n");
+		fpga_upgrade = firmware_upgrade = 0;
+		db_fpga_upgrade = db_firmware_upgrade = 0;
+	}
+
 	if (card->fpga_version >= DMA_SUPPORTED){
 		card->using_dma = 1;
 	} else {
-- 
1.7.3.1



^ permalink raw reply related

* Re: [PATCH 1/2] solos: Add 'Firmware' attribute for Traverse overall firmware version
From: Stephen Hemminger @ 2010-11-01 20:49 UTC (permalink / raw)
  To: David Woodhouse; +Cc: davem, netdev
In-Reply-To: <1288643669.5977.21.camel@macbook.infradead.org>

On Mon, 01 Nov 2010 16:34:29 -0400
David Woodhouse <dwmw2@infradead.org> wrote:

> The existing 'FirmwareVersion' attribute only covers the DSP firmware as
> provided by Conexant; not the overall version of the device firmware. We
> do want to be able to see the full version number too.
> 
> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
> ---
>  drivers/atm/solos-attrlist.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/atm/solos-attrlist.c b/drivers/atm/solos-attrlist.c
> index 1a9332e..9a676ee 100644
> --- a/drivers/atm/solos-attrlist.c
> +++ b/drivers/atm/solos-attrlist.c
> @@ -1,6 +1,7 @@
>  SOLOS_ATTR_RO(DriverVersion)
>  SOLOS_ATTR_RO(APIVersion)
>  SOLOS_ATTR_RO(FirmwareVersion)
> +SOLOS_ATTR_RO(Version)
>  // SOLOS_ATTR_RO(DspVersion)
>  // SOLOS_ATTR_RO(CommonHandshake)
>  SOLOS_ATTR_RO(Connected)

There is a firware version in ethtool, does this driver supply it?

^ permalink raw reply

* Re: [PATCH 1/2] solos: Add 'Firmware' attribute for Traverse overall firmware version
From: David Woodhouse @ 2010-11-01 20:50 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: davem, netdev
In-Reply-To: <20101101164938.5807e4c3@s6510>

On Mon, 2010-11-01 at 16:49 -0400, Stephen Hemminger wrote:
> There is a firware version in ethtool, does this driver supply it? 

This is an ATM driver, so no.

-- 
dwmw2


^ permalink raw reply

* Re: [PATCH 05/11] vxge: add support for ethtool firmware flashing
From: Ben Hutchings @ 2010-11-01 20:51 UTC (permalink / raw)
  To: Jon Mason
  Cc: David Miller, netdev, Sivakumar Subramani, Sreenivasa Honnur,
	Ram Vepa
In-Reply-To: <1288318786-12319-5-git-send-email-jon.mason@exar.com>

On Thu, 2010-10-28 at 21:19 -0500, Jon Mason wrote:
> Add the ability in the vxge driver to flash firmware via ethtool.
[...]
> +enum vxge_hw_status
> +vxge_update_fw_image(struct __vxge_hw_device *hldev, const u8 *fwdata, int size)
> +{
> +	u64 data0 = 0, data1 = 0, steer_ctrl = 0;
> +	struct __vxge_hw_virtualpath *vpath;
> +	enum vxge_hw_status status;
> +	int ret_code, sec_code, i;
> +
> +	vpath = &hldev->virtual_paths[hldev->first_vp_id];
> +
> +	/* send upgrade start command */
> +	status = vxge_hw_vpath_fw_api(vpath,
> +				      VXGE_HW_FW_UPGRADE_ACTION,
> +				      VXGE_HW_FW_UPGRADE_MEMO,
> +				      VXGE_HW_FW_UPGRADE_OFFSET_START,
> +				      &data0, &data1, &steer_ctrl);
> +	if (status != VXGE_HW_OK) {
> +		vxge_debug_init(VXGE_ERR, " %s: Upgrade start cmd failed",
> +				__func__);
> +		return status;
> +	}
> +
> +	/* Transfer fw image to adapter 16 bytes at a time */
> +	for (; size > 0; size -= VXGE_HW_FW_UPGRADE_BLK_SIZE) {
> +		data0 = data1 = steer_ctrl = 0;
> +
> +		/* send 16 bytes at a time */
> +		for (i = 0; i < VXGE_HW_BYTES_PER_U64; i++) {
> +			data0 |= (u64)fwdata[i] << (i * VXGE_HW_BYTES_PER_U64);

You apparently mean to multiply i by the number of bits in a byte here.
This happens to be equal to VXGE_HW_BYTES_PER_U64 but it still doesn't
make sense to use that name for it.

[...]
> diff --git a/drivers/net/vxge/vxge-ethtool.c b/drivers/net/vxge/vxge-ethtool.c
> index 6194fd9..c5ab375 100644
> --- a/drivers/net/vxge/vxge-ethtool.c
> +++ b/drivers/net/vxge/vxge-ethtool.c
> @@ -11,7 +11,7 @@
>   *                 Virtualized Server Adapter.
>   * Copyright(c) 2002-2010 Exar Corp.
>   ******************************************************************************/
> -#include<linux/ethtool.h>
> +#include <linux/ethtool.h>
>  #include <linux/slab.h>
>  #include <linux/pci.h>
>  #include <linux/etherdevice.h>
> @@ -29,7 +29,6 @@
>   * Return value:
>   * 0 on success.
>   */
> -
>  static int vxge_ethtool_sset(struct net_device *dev, struct ethtool_cmd *info)
>  {
>  	/* We currently only support 10Gb/FULL */
> @@ -148,8 +147,7 @@ static void vxge_ethtool_gregs(struct net_device *dev,
>  static int vxge_ethtool_idnic(struct net_device *dev, u32 data)
>  {
>  	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
> -	struct __vxge_hw_device  *hldev = (struct __vxge_hw_device  *)
> -			pci_get_drvdata(vdev->pdev);
> +	struct __vxge_hw_device *hldev = vdev->devh;
>  
>  	vxge_hw_device_flick_link_led(hldev, VXGE_FLICKER_ON);
>  	msleep_interruptible(data ? (data * HZ) : VXGE_MAX_FLICKER_TIME);
> @@ -168,11 +166,10 @@ static int vxge_ethtool_idnic(struct net_device *dev, u32 data)
>   *  void
>   */
>  static void vxge_ethtool_getpause_data(struct net_device *dev,
> -					struct ethtool_pauseparam *ep)
> +				       struct ethtool_pauseparam *ep)
>  {
>  	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
> -	struct __vxge_hw_device  *hldev = (struct __vxge_hw_device  *)
> -			pci_get_drvdata(vdev->pdev);
> +	struct __vxge_hw_device *hldev = vdev->devh;
>  
>  	vxge_hw_device_getpause_data(hldev, 0, &ep->tx_pause, &ep->rx_pause);
>  }
> @@ -188,11 +185,10 @@ static void vxge_ethtool_getpause_data(struct net_device *dev,
>   * int, returns 0 on Success
>   */
>  static int vxge_ethtool_setpause_data(struct net_device *dev,
> -					struct ethtool_pauseparam *ep)
> +				      struct ethtool_pauseparam *ep)
>  {
>  	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
> -	struct __vxge_hw_device  *hldev = (struct __vxge_hw_device  *)
> -			pci_get_drvdata(vdev->pdev);
> +	struct __vxge_hw_device *hldev = vdev->devh;
>  
>  	vxge_hw_device_setpause_data(hldev, 0, ep->tx_pause, ep->rx_pause);
>  
> @@ -211,7 +207,7 @@ static void vxge_get_ethtool_stats(struct net_device *dev,
>  	struct vxge_vpath *vpath = NULL;
>  
>  	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
> -	struct __vxge_hw_device  *hldev = vdev->devh;
> +	struct __vxge_hw_device *hldev = vdev->devh;
>  	struct vxge_hw_xmac_stats *xmac_stats;
>  	struct vxge_hw_device_stats_sw_info *sw_stats;
>  	struct vxge_hw_device_stats_hw_info *hw_stats;

These changes seem to be entirely unrelated to the patch description.

> @@ -1153,6 +1149,25 @@ static int vxge_set_flags(struct net_device *dev, u32 data)
>  	return 0;
>  }
>  
> +static int vxge_fw_flash(struct net_device *dev, struct ethtool_flash *parms)
> +{
> +	struct vxgedev *vdev = (struct vxgedev *)netdev_priv(dev);
> +
> +	if (vdev->max_vpath_supported != VXGE_HW_MAX_VIRTUAL_PATHS) {
> +		printk(KERN_INFO "Single Function Mode is required to flash the"
> +		       " firmware\n");
> +		return -EINVAL;
> +	}
> +
> +	if (netif_running(dev)) {
> +		printk(KERN_INFO "Interface %s must be down to flash the "
> +		       "firmware\n", dev->name);
> +		return -EINVAL;
> +	}
> +
> +	return vxge_fw_upgrade(vdev, parms->data, 1);
> +}

I think EBUSY is a more appropriate error code.  There is nothing wrong
with the arguments, only the current state of the device.

[...]
> diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
> index d977a63..52a48e7 100644
> --- a/drivers/net/vxge/vxge-main.c
> +++ b/drivers/net/vxge/vxge-main.c
[...]
> @@ -3277,30 +3279,23 @@ vxge_device_unregister(struct __vxge_hw_device *hldev)
>  	struct vxgedev *vdev;
>  	struct net_device *dev;
>  	char buf[IFNAMSIZ];
> -#if ((VXGE_DEBUG_INIT & VXGE_DEBUG_MASK) || \
> -	(VXGE_DEBUG_ENTRYEXIT & VXGE_DEBUG_MASK))
> -	u32 level_trace;
> -#endif
>  
>  	dev = hldev->ndev;
>  	vdev = netdev_priv(dev);
> -#if ((VXGE_DEBUG_INIT & VXGE_DEBUG_MASK) || \
> -	(VXGE_DEBUG_ENTRYEXIT & VXGE_DEBUG_MASK))
> -	level_trace = vdev->level_trace;
> -#endif
> -	vxge_debug_entryexit(level_trace,
> -		"%s: %s:%d", vdev->ndev->name, __func__, __LINE__);
> +	vxge_debug_entryexit(vdev->level_trace,	"%s: %s:%d", dev->name,
> +			     __func__, __LINE__);
>  
> -	memcpy(buf, vdev->ndev->name, IFNAMSIZ);
> +	memcpy(buf, dev->name, IFNAMSIZ);
>  
>  	/* in 2.6 will call stop() if device is up */
>  	unregister_netdev(dev);
>  
>  	flush_scheduled_work();
>  
> -	vxge_debug_init(level_trace, "%s: ethernet device unregistered", buf);
> -	vxge_debug_entryexit(level_trace,
> -		"%s: %s:%d  Exiting...", buf, __func__, __LINE__);
> +	vxge_debug_init(vdev->level_trace, "%s: ethernet device unregistered",
> +			buf);
> +	vxge_debug_entryexit(vdev->level_trace,	"%s: %s:%d  Exiting...", buf,
> +			     __func__, __LINE__);
>  }
>  
>  /*

More apparently unrelated changes.

> @@ -3924,6 +3919,142 @@ static inline u32 vxge_get_num_vfs(u64 function_mode)
>  	return num_functions;
>  }
>  
> +int vxge_fw_upgrade(struct vxgedev *vdev, char *fw_name, int override)
> +{
> +	struct __vxge_hw_device *hldev = vdev->devh;
> +	u32 maj, min, bld, cmaj, cmin, cbld;
> +	enum vxge_hw_status status;
> +	const struct firmware *fw;
> +	int ret;
> +
> +	ret = request_firmware(&fw, fw_name, &vdev->pdev->dev);
> +	if (ret) {
> +		vxge_debug_init(VXGE_ERR, "%s: Firmware file '%s' not found",
> +				VXGE_DRIVER_NAME, fw_name);
> +		goto out;
> +	}
> +
> +	/* Load the new firmware onto the adapter */
> +	status = vxge_update_fw_image(hldev, fw->data, fw->size);
> +	if (status != VXGE_HW_OK) {
> +		vxge_debug_init(VXGE_ERR,
> +				"%s: FW image download to adapter failed '%s'.",
> +				VXGE_DRIVER_NAME, fw_name);
> +		ret = -EFAULT;

Surely EIO or EINVAL.

> +		goto out;
> +	}
> +
> +	/* Read the version of the new firmware */
> +	status = vxge_hw_upgrade_read_version(hldev, &maj, &min, &bld);
> +	if (status != VXGE_HW_OK) {
> +		vxge_debug_init(VXGE_ERR,
> +				"%s: Upgrade read version failed '%s'.",
> +				VXGE_DRIVER_NAME, fw_name);
> +		ret = -EFAULT;

EIO.

> +		goto out;
> +	}
> +
> +	cmaj = vdev->config.device_hw_info.fw_version.major;
> +	cmin = vdev->config.device_hw_info.fw_version.minor;
> +	cbld = vdev->config.device_hw_info.fw_version.build;
> +	/* It's possible the version in /lib/firmware is not the latest version.
> +	 * If so, we could get into a loop of trying to upgrade to the latest
> +	 * and flashing the older version.
> +	 */
> +	if (VXGE_FW_VER(maj, min, bld) == VXGE_FW_VER(cmaj, cmin, cbld) &&
> +	    !override) {
> +		ret = -EINVAL;
> +		goto out;
> +	}
> +
> +	printk(KERN_NOTICE "Upgrade to firmware version %d.%d.%d commencing\n",
> +	       maj, min, bld);
> +
> +	/* Flash the adapter with the new firmware */
> +	status = vxge_hw_flash_fw(hldev);
> +	if (status != VXGE_HW_OK) {
> +		vxge_debug_init(VXGE_ERR, "%s: Upgrade commit failed '%s'.",
> +				VXGE_DRIVER_NAME, fw_name);
> +		ret = -EFAULT;
> +		goto out;
> +	}
> +
> +	printk(KERN_NOTICE "Upgrade of firmware successful!  Adapter must be "
> +	       "hard reset before using, thus requiring a system reboot or a "
> +	       "hotplug event.\n");

Then what is the point of having the driver manage this?  And how can
you be sure the user will even see this message?

[...]
> +static int vxge_probe_fw_update(struct vxgedev *vdev)
> +{
[...]
> +	ret = vxge_fw_upgrade(vdev, fw_name, 0);
> +	/* -EINVAL and -ENOENT are not fatal errors for flashing firmware on
> +	 * probe, so ignore them
> +	 */
> +	if (ret != -EINVAL && ret != -ENOENT)
> +		return -EFAULT;
[..]

EIO.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply

* [PATCH net-2.6 2/3] cxgb4: remove call to stop TX queues at load time.
From: Divy Le Ray @ 2010-11-01 20:59 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-kernel, dm, leedom, swise
In-Reply-To: <20101101205940.27716.24553.stgit@speedy5.asicdesigners.com>

From: Divy Le Ray <divy@chelsio.com>

Remove racy queue stopping after device registration.

Signed-off-by: Dimitris Michailidis <dm@chelsio.com>

---

 drivers/net/cxgb4/cxgb4_main.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)


diff --git a/drivers/net/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c
index f17703f..f50bc98 100644
--- a/drivers/net/cxgb4/cxgb4_main.c
+++ b/drivers/net/cxgb4/cxgb4_main.c
@@ -3736,7 +3736,6 @@ static int __devinit init_one(struct pci_dev *pdev,
 
 			__set_bit(i, &adapter->registered_device_map);
 			adapter->chan_map[adap2pinfo(adapter, i)->tx_chan] = i;
-			netif_tx_stop_all_queues(adapter->port[i]);
 		}
 	}
 	if (!adapter->registered_device_map) {

^ permalink raw reply related

* [PATCH net-2.6 3/3] cxgb4vf: remove call to stop TX queues at load time.
From: Divy Le Ray @ 2010-11-01 20:59 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-kernel, dm, leedom, swise
In-Reply-To: <20101101205940.27716.24553.stgit@speedy5.asicdesigners.com>

From: Divy Le Ray <divy@chelsio.com>

Stopping TX queues at driver load time is not necessary.

Signed-off-by: Casey Leedom <leedom@chelsio.com>

---

 drivers/net/cxgb4vf/cxgb4vf_main.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)


diff --git a/drivers/net/cxgb4vf/cxgb4vf_main.c b/drivers/net/cxgb4vf/cxgb4vf_main.c
index 555ecc5..6de5e2e 100644
--- a/drivers/net/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/cxgb4vf/cxgb4vf_main.c
@@ -2600,7 +2600,6 @@ static int __devinit cxgb4vf_pci_probe(struct pci_dev *pdev,
 		pi->xact_addr_filt = -1;
 		pi->rx_offload = RX_CSO;
 		netif_carrier_off(netdev);
-		netif_tx_stop_all_queues(netdev);
 		netdev->irq = pdev->irq;
 
 		netdev->features = (NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6 |

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox