* Re: [PATCH 8/9] isdn: Remove unused variable causing a compile build warning
From: David Miller @ 2012-11-04 17:30 UTC (permalink / raw)
To: lee.jones; +Cc: pebolle, linux-kernel, isdn, netdev
In-Reply-To: <20121104105332.GC27124@gmail.com>
From: Lee Jones <lee.jones@linaro.org>
Date: Sun, 4 Nov 2012 11:53:32 +0100
> On Sun, 04 Nov 2012, Paul Bolle wrote:
>
>> On Sat, 2012-11-03 at 23:48 +0100, Lee Jones wrote:
>> > On Sat, 03 Nov 2012, Paul Bolle wrote:
>> > > On Sat, 2012-11-03 at 23:02 +0100, Lee Jones wrote:
>> > > > This patch fixes:
>> > > > drivers/isdn/i4l/isdn_common.c: In function ‘isdn_ioctl’:
>> > > > drivers/isdn/i4l/isdn_common.c:1278:8: warning: unused variable ‘s’ [-Wunused-variable]
>> > >
>> > > Did you have CONFIG_NETDEVICES not set in this build?
>> >
>> > Ah yes, I see it. The function went down further than I thought
>> > it did. So the real fix is to ensure 's' is defined inside of
>> > some ifdef CONFIG_NETDEVICES guards.
>>
>> What puzzles me is that we only find these "#ifdef CONFIG_NETDEVICES"
>> guards in this file and not in isdn_net.c, were all the ioctl commands
>> guarded that way seem to be calling into. On first glance that doesn't
>> make much sense.
>>
>> (Actually the idea of having ISDN without NETDEVICES is a bit puzzling
>> too. But there are too many parts of the isdn subsystem that I'm
>> unfamiliar with to say whether that can make sense.)
>
> I'm in the same position as you Paul. I just noticed the warning so
> fixed it following the current way of doing things. Any, more
> substantial changes requiring greater knowledge of the subsystem
> would have to be done by someone else.
I think the most appropriate thing to do is make CONFIG_ISDN depend
upon CONFIG_NETDEVICES in the Kconfig file.
^ permalink raw reply
* Re: [B.A.T.M.A.N.] [PATCH 1/9] batman-adv: add UNICAST_4ADDR packet type
From: David Miller @ 2012-11-04 17:26 UTC (permalink / raw)
To: sven; +Cc: b.a.t.m.a.n, ordex, netdev
In-Reply-To: <12758662.vFhVQet4vg@sven-laptop.home.narfation.org>
From: Sven Eckelmann <sven@narfation.org>
Date: Sun, 04 Nov 2012 11:29:29 +0100
> Now also assume following really unusual situation: We get our data from a
> ethernet driver and the skb stores the ethernet header. The start of the
> ethernet header is perfectly aligned (4 or even 16 byte boundary aligned). The
> the header is 14/18 byte long (6 byte src, 6 byte dst, 2 byte ethertype and
> maybe 4 byte vlan). Now the payload starts only on a 2 byte boundary -> it is
> never 4 byte boundary aligned. A 32 bit read now causes different variations
> of problems (reminder: bus error).
Every ethernet driver must provide the networking stack with a modulo 2
aligned ethernet header, which makes sure that everything after the
ethernet header is at least 4 byte aligned.
^ permalink raw reply
* Re: [PATCH v2 net-next] r8169: enable internal ASPM and clock request settings
From: David Miller @ 2012-11-04 17:24 UTC (permalink / raw)
To: romieu; +Cc: hayeswang, netdev, linux-kernel, agnescheng
In-Reply-To: <20121104091752.GA14093@electric-eye.fr.zoreil.com>
From: Francois Romieu <romieu@fr.zoreil.com>
Date: Sun, 4 Nov 2012 10:17:52 +0100
> David Miller <davem@davemloft.net> :
> [...]
>> Francois?
>
> Please apply.
Done, thanks.
^ permalink raw reply
* [PATCH 0/2] net: at91_ether add dt and pinctrl support
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-11-04 15:49 UTC (permalink / raw)
To: linux-arm-kernel
Cc: netdev, devicetree-discuss, Nicolas Ferre, Joachim Eastwood
Hi,
This patch serie add dt and pinctrl support to the at91 ether
this is need to use the network on at91rm9200 as we now have dt
support on it
Jean-Christophe PLAGNIOL-VILLARD (2):
net: at91_ether: add dt support
net: at91_ether: add pinctrl support
Documentation/devicetree/bindings/net/cdns-emac.txt | 23 +++++++++++++++++++++++
drivers/net/ethernet/cadence/at91_ether.c | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
2 files changed, 99 insertions(+), 7 deletions(-)
create mode 100644 Documentation/devicetree/bindings/net/cdns-emac.txt
Best Regards,
J.
^ permalink raw reply
* Re: [PATCH net-next 2/2] cpsw: fix leaking IO mappings
From: Richard Cochran @ 2012-11-04 15:16 UTC (permalink / raw)
To: Cyril Chemparathy
Cc: netdev, linux-arm-kernel, David Miller, Mugunthan V N,
Vaibhav Hiremath
In-Reply-To: <50966C6E.1000507@ti.com>
On Sun, Nov 04, 2012 at 02:23:58PM +0100, Cyril Chemparathy wrote:
> On 11/03/2012 09:25 AM, Richard Cochran wrote:
> >The CPSW driver remaps two different IO regions, but fails to unmap them
> >both. This patch fixes the issue by calling iounmap in the appropriate
> >places.
>
> Any thoughts on using devres helpers to keep the bail out path simpler?
I wasn't aware of devres before, but I just read through the doc. It
looks interesting, and if I were writting a new driver, then I might
use it.
But for this driver, it really isn't very complex. It only looks that
way, but I think this just accidental. I guess that the code was
adapted from the davinci emac driver.
Thanks,
Richard
^ permalink raw reply
* Re: [PATCH v2 5/5] usbnet: make device out of suspend before calling usbnet_read[write]_cmd
From: Sergei Shtylyov @ 2012-11-04 13:55 UTC (permalink / raw)
To: Ming Lei
Cc: David S. Miller, Greg Kroah-Hartman, Oliver Neukum, netdev,
linux-usb
In-Reply-To: <1352027793-6608-6-git-send-email-ming.lei@canonical.com>
Hello.
On 04-11-2012 15:16, Ming Lei wrote:
s/make/wake/ in the subject?
> This patche gets the runtime PM reference count before calling
s/patche/patch/
> usbnet_read[write]_cmd, and puts it after completion of the
> usbnet_read[write]_cmd, so that the usb control message can always
You probably meant usbnet_{read|write}_cmd() here and in the subject?
> be sent to one active device in the non-PM context.
> Signed-off-by: Ming Lei <ming.lei@canonical.com>
> ---
> drivers/net/usb/usbnet.c | 18 ++++++++++++++----
> 1 file changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
> index a7fb074..74caa67 100644
> --- a/drivers/net/usb/usbnet.c
> +++ b/drivers/net/usb/usbnet.c
> @@ -1673,8 +1673,13 @@ out:
> int usbnet_read_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
> u16 value, u16 index, void *data, u16 size)
> {
> - return __usbnet_read_cmd(dev, cmd, reqtype, value, index,
> - data, size);
> + int ret;
Empty line wouldn't hurt here, after declaration block.
> + if (usb_autopm_get_interface(dev->intf) < 0)
> + return -ENODEV;
> + ret = __usbnet_read_cmd(dev, cmd, reqtype, value, index,
> + data, size);
> + usb_autopm_put_interface(dev->intf);
> + return ret;
> }
> EXPORT_SYMBOL_GPL(usbnet_read_cmd);
>
> @@ -1685,8 +1690,13 @@ EXPORT_SYMBOL_GPL(usbnet_read_cmd);
> int usbnet_write_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
> u16 value, u16 index, const void *data, u16 size)
> {
> - return __usbnet_write_cmd(dev, cmd, reqtype, value, index,
> - data, size);
> + int ret;
And here too...
> + if (usb_autopm_get_interface(dev->intf) < 0)
> + return -ENODEV;
> + ret = __usbnet_write_cmd(dev, cmd, reqtype, value, index,
> + data, size);
> + usb_autopm_put_interface(dev->intf);
> + return ret;
> }
> EXPORT_SYMBOL_GPL(usbnet_write_cmd);
WBR, Sergei
^ permalink raw reply
* Re: [PATCH net-next 2/2] cpsw: fix leaking IO mappings
From: Cyril Chemparathy @ 2012-11-04 13:23 UTC (permalink / raw)
To: Richard Cochran
Cc: netdev, linux-arm-kernel, David Miller, Mugunthan V N,
Vaibhav Hiremath
In-Reply-To: <1c915a7d0301355342358db8f84560417609a61c.1351930782.git.richardcochran@gmail.com>
On 11/03/2012 09:25 AM, Richard Cochran wrote:
> The CPSW driver remaps two different IO regions, but fails to unmap them
> both. This patch fixes the issue by calling iounmap in the appropriate
> places.
Any thoughts on using devres helpers to keep the bail out path simpler?
> Signed-off-by: Richard Cochran <richardcochran@gmail.com>
> ---
> drivers/net/ethernet/ti/cpsw.c | 17 ++++++++---------
> 1 files changed, 8 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
> index 6215246..7654a62 100644
> --- a/drivers/net/ethernet/ti/cpsw.c
> +++ b/drivers/net/ethernet/ti/cpsw.c
> @@ -1252,14 +1252,12 @@ static int __devinit cpsw_probe(struct platform_device *pdev)
> ret = -ENOENT;
> goto clean_clk_ret;
> }
> -
> if (!request_mem_region(priv->cpsw_res->start,
> resource_size(priv->cpsw_res), ndev->name)) {
> dev_err(priv->dev, "failed request i/o region\n");
> ret = -ENXIO;
> goto clean_clk_ret;
> }
> -
> regs = ioremap(priv->cpsw_res->start, resource_size(priv->cpsw_res));
> if (!regs) {
> dev_err(priv->dev, "unable to map i/o region\n");
> @@ -1274,16 +1272,14 @@ static int __devinit cpsw_probe(struct platform_device *pdev)
> if (!priv->cpsw_wr_res) {
> dev_err(priv->dev, "error getting i/o resource\n");
> ret = -ENOENT;
> - goto clean_clk_ret;
> + goto clean_iomap_ret;
> }
> -
> if (!request_mem_region(priv->cpsw_wr_res->start,
> resource_size(priv->cpsw_wr_res), ndev->name)) {
> dev_err(priv->dev, "failed request i/o region\n");
> ret = -ENXIO;
> - goto clean_clk_ret;
> + goto clean_iomap_ret;
> }
> -
> regs = ioremap(priv->cpsw_wr_res->start,
> resource_size(priv->cpsw_wr_res));
> if (!regs) {
> @@ -1326,7 +1322,7 @@ static int __devinit cpsw_probe(struct platform_device *pdev)
> if (!priv->dma) {
> dev_err(priv->dev, "error initializing dma\n");
> ret = -ENOMEM;
> - goto clean_iomap_ret;
> + goto clean_wr_iomap_ret;
> }
>
> priv->txch = cpdma_chan_create(priv->dma, tx_chan_num(0),
> @@ -1407,11 +1403,13 @@ clean_dma_ret:
> cpdma_chan_destroy(priv->txch);
> cpdma_chan_destroy(priv->rxch);
> cpdma_ctlr_destroy(priv->dma);
> -clean_iomap_ret:
> - iounmap(priv->regs);
> +clean_wr_iomap_ret:
> + iounmap(priv->wr_regs);
> clean_cpsw_wr_iores_ret:
> release_mem_region(priv->cpsw_wr_res->start,
> resource_size(priv->cpsw_wr_res));
> +clean_iomap_ret:
> + iounmap(priv->regs);
> clean_cpsw_iores_ret:
> release_mem_region(priv->cpsw_res->start,
> resource_size(priv->cpsw_res));
> @@ -1442,6 +1440,7 @@ static int __devexit cpsw_remove(struct platform_device *pdev)
> iounmap(priv->regs);
> release_mem_region(priv->cpsw_res->start,
> resource_size(priv->cpsw_res));
> + iounmap(priv->wr_regs);
> release_mem_region(priv->cpsw_wr_res->start,
> resource_size(priv->cpsw_wr_res));
> pm_runtime_disable(&pdev->dev);
^ permalink raw reply
* Re: [PATCH 1/9] batman-adv: add UNICAST_4ADDR packet type
From: Sven Eckelmann @ 2012-11-04 11:20 UTC (permalink / raw)
To: b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, David Miller
In-Reply-To: <12758662.vFhVQet4vg-S/pmIDWWJIwhrEaHGRlFQnOel7F/LzPIcbWoRP8EXgk@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2472 bytes --]
On Sunday 04 November 2012 11:29:29 Sven Eckelmann wrote:
> On Saturday 03 November 2012 15:22:26 David Miller wrote:
> [...]
>
> > Your packet layouts are very poorly designed and I want you to stop
> > and think seriously about things before extending things further.
>
> You are right about the packet design/layout. But I also have some problems
> with the following statement. Maybe you can help me to resolve it.
>
> > All of this __packed stuff is a serious problem.
> >
> > It means that on RISC system, fields such as your 32-bit sequence
> > number, will be read and written using byte loads and stores.
> >
> > This is terrible.
> >
> > Instead, design the structures so that they are full filled out to
> > at least 4 byte boundaries, so that they and the contents after
> > them, are 4 byte aligned too.
> >
> > Then you won't need to mark all of your packet header structs
> > with __packed, and therefore the compiler can use full 32-bit
> > loads and stores to access 32-bit fields.
>
> Ok, lets assume batman-adv has everything 4 byte aligned and we are running
> on a machine without unaligned r/w access. The machine may issues bus
> errors and so on.
>
> Now also assume following really unusual situation: We get our data from a
> ethernet driver and the skb stores the ethernet header. The start of the
> ethernet header is perfectly aligned (4 or even 16 byte boundary aligned).
> The the header is 14/18 byte long (6 byte src, 6 byte dst, 2 byte ethertype
> and maybe 4 byte vlan). Now the payload starts only on a 2 byte boundary ->
> it is never 4 byte boundary aligned. A 32 bit read now causes different
> variations of problems (reminder: bus error).
>
> This brings me to the question: Why should the "32 bit align everything
> relative to the start of the struct" approach help to resolve the situation
> for the access of 32 bit data structure members? May I am missing some
> information?
To push this question in a direction: May I assume that the driver always
ensures that the ethernet header is 4 byte boundary - NET_IP_ALIGN (2)
aligned?
When yes, this would result in a slight variations of your suggestion:
unicast/bcast headers have to end at 4 bytes boundary + 2 bytes. The reason is
easy to explain. batman-adv unicast/bcast headers are used to encapsulate the
important parts of an ethernet frame:
Ethernet Header for P2P | batman-adv header stuff | ethernet header | payload.
Would you aggree?
Thanks,
Sven
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* Re: [PATCH v1 2/5] usbnet: smsc75xx: apply the introduced usbnet_read[write]_cmd_nopm
From: Ming Lei @ 2012-11-04 11:19 UTC (permalink / raw)
To: David Miller; +Cc: gregkh, oneukum, netdev, linux-usb, steve.glendinning
In-Reply-To: <20121104.015834.655875426096699012.davem@davemloft.net>
On Sun, Nov 4, 2012 at 1:58 PM, David Miller <davem@davemloft.net> wrote:
>
> This gets rejects, you didn't have your net-next tree uptodate
> enough.
Sorry, I just rebased that on 3.7.0-rc3-next-20121102.
The new patchset which is against the latest net-next has been sent out.
Thanks,
--
Ming Lei
^ permalink raw reply
* [PATCH v2 5/5] usbnet: make device out of suspend before calling usbnet_read[write]_cmd
From: Ming Lei @ 2012-11-04 11:16 UTC (permalink / raw)
To: David S. Miller, Greg Kroah-Hartman
Cc: Oliver Neukum, netdev, linux-usb, Ming Lei
In-Reply-To: <1352027793-6608-1-git-send-email-ming.lei@canonical.com>
This patche gets the runtime PM reference count before calling
usbnet_read[write]_cmd, and puts it after completion of the
usbnet_read[write]_cmd, so that the usb control message can always
be sent to one active device in the non-PM context.
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
drivers/net/usb/usbnet.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index a7fb074..74caa67 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1673,8 +1673,13 @@ out:
int usbnet_read_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
u16 value, u16 index, void *data, u16 size)
{
- return __usbnet_read_cmd(dev, cmd, reqtype, value, index,
- data, size);
+ int ret;
+ if (usb_autopm_get_interface(dev->intf) < 0)
+ return -ENODEV;
+ ret = __usbnet_read_cmd(dev, cmd, reqtype, value, index,
+ data, size);
+ usb_autopm_put_interface(dev->intf);
+ return ret;
}
EXPORT_SYMBOL_GPL(usbnet_read_cmd);
@@ -1685,8 +1690,13 @@ EXPORT_SYMBOL_GPL(usbnet_read_cmd);
int usbnet_write_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
u16 value, u16 index, const void *data, u16 size)
{
- return __usbnet_write_cmd(dev, cmd, reqtype, value, index,
- data, size);
+ int ret;
+ if (usb_autopm_get_interface(dev->intf) < 0)
+ return -ENODEV;
+ ret = __usbnet_write_cmd(dev, cmd, reqtype, value, index,
+ data, size);
+ usb_autopm_put_interface(dev->intf);
+ return ret;
}
EXPORT_SYMBOL_GPL(usbnet_write_cmd);
--
1.7.9.5
^ permalink raw reply related
* [PATCH v2 2/5] usbnet: smsc75xx: apply the introduced usbnet_read[write]_cmd_nopm
From: Ming Lei @ 2012-11-04 11:16 UTC (permalink / raw)
To: David S. Miller, Greg Kroah-Hartman
Cc: Oliver Neukum, netdev, linux-usb, Ming Lei, Steve Glendinning
In-Reply-To: <1352027793-6608-1-git-send-email-ming.lei@canonical.com>
This patch applies the introduced usbnet_read_cmd_nopm() and
usbnet_write_cmd_nopm() in the callback of resume and suspend
to avoid deadlock if USB runtime PM is considered into
usbnet_read_cmd() and usbnet_write_cmd().
Cc: Steve Glendinning <steve.glendinning@shawell.net>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
drivers/net/usb/smsc75xx.c | 147 +++++++++++++++++++++++++++-----------------
1 file changed, 90 insertions(+), 57 deletions(-)
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
index 85d70c2..c5353cf 100644
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -85,18 +85,23 @@ static bool turbo_mode = true;
module_param(turbo_mode, bool, 0644);
MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction");
-static int __must_check smsc75xx_read_reg(struct usbnet *dev, u32 index,
- u32 *data)
+static int __must_check __smsc75xx_read_reg(struct usbnet *dev, u32 index,
+ u32 *data, int in_pm)
{
u32 buf;
int ret;
+ int (*fn)(struct usbnet *, u8, u8, u16, u16, void *, u16);
BUG_ON(!dev);
- ret = usbnet_read_cmd(dev, USB_VENDOR_REQUEST_READ_REGISTER,
- USB_DIR_IN | USB_TYPE_VENDOR |
- USB_RECIP_DEVICE,
- 0, index, &buf, 4);
+ if (!in_pm)
+ fn = usbnet_read_cmd;
+ else
+ fn = usbnet_read_cmd_nopm;
+
+ ret = fn(dev, USB_VENDOR_REQUEST_READ_REGISTER, USB_DIR_IN
+ | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+ 0, index, &buf, 4);
if (unlikely(ret < 0))
netdev_warn(dev->net,
"Failed to read reg index 0x%08x: %d", index, ret);
@@ -107,21 +112,26 @@ static int __must_check smsc75xx_read_reg(struct usbnet *dev, u32 index,
return ret;
}
-static int __must_check smsc75xx_write_reg(struct usbnet *dev, u32 index,
- u32 data)
+static int __must_check __smsc75xx_write_reg(struct usbnet *dev, u32 index,
+ u32 data, int in_pm)
{
u32 buf;
int ret;
+ int (*fn)(struct usbnet *, u8, u8, u16, u16, const void *, u16);
BUG_ON(!dev);
+ if (!in_pm)
+ fn = usbnet_write_cmd;
+ else
+ fn = usbnet_write_cmd_nopm;
+
buf = data;
cpu_to_le32s(&buf);
- ret = usbnet_write_cmd(dev, USB_VENDOR_REQUEST_WRITE_REGISTER,
- USB_DIR_OUT | USB_TYPE_VENDOR |
- USB_RECIP_DEVICE,
- 0, index, &buf, 4);
+ ret = fn(dev, USB_VENDOR_REQUEST_WRITE_REGISTER, USB_DIR_OUT
+ | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+ 0, index, &buf, 4);
if (unlikely(ret < 0))
netdev_warn(dev->net,
"Failed to write reg index 0x%08x: %d", index, ret);
@@ -129,16 +139,38 @@ static int __must_check smsc75xx_write_reg(struct usbnet *dev, u32 index,
return ret;
}
+static int __must_check smsc75xx_read_reg_nopm(struct usbnet *dev, u32 index,
+ u32 *data)
+{
+ return __smsc75xx_read_reg(dev, index, data, 1);
+}
+
+static int __must_check smsc75xx_write_reg_nopm(struct usbnet *dev, u32 index,
+ u32 data)
+{
+ return __smsc75xx_write_reg(dev, index, data, 1);
+}
+
+static int __must_check smsc75xx_read_reg(struct usbnet *dev, u32 index,
+ u32 *data)
+{
+ return __smsc75xx_read_reg(dev, index, data, 0);
+}
+
+static int __must_check smsc75xx_write_reg(struct usbnet *dev, u32 index,
+ u32 data)
+{
+ return __smsc75xx_write_reg(dev, index, data, 0);
+}
+
static int smsc75xx_set_feature(struct usbnet *dev, u32 feature)
{
if (WARN_ON_ONCE(!dev))
return -EINVAL;
- cpu_to_le32s(&feature);
-
- return usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0),
- USB_REQ_SET_FEATURE, USB_RECIP_DEVICE, feature, 0, NULL, 0,
- USB_CTRL_SET_TIMEOUT);
+ return usbnet_write_cmd_nopm(dev, USB_REQ_SET_FEATURE,
+ USB_DIR_OUT | USB_RECIP_DEVICE,
+ feature, 0, NULL, 0);
}
static int smsc75xx_clear_feature(struct usbnet *dev, u32 feature)
@@ -146,11 +178,9 @@ static int smsc75xx_clear_feature(struct usbnet *dev, u32 feature)
if (WARN_ON_ONCE(!dev))
return -EINVAL;
- cpu_to_le32s(&feature);
-
- return usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0),
- USB_REQ_CLEAR_FEATURE, USB_RECIP_DEVICE, feature, 0, NULL, 0,
- USB_CTRL_SET_TIMEOUT);
+ return usbnet_write_cmd_nopm(dev, USB_REQ_CLEAR_FEATURE,
+ USB_DIR_OUT | USB_RECIP_DEVICE,
+ feature, 0, NULL, 0);
}
/* Loop until the read is completed with timeout
@@ -796,13 +826,16 @@ static int smsc75xx_set_features(struct net_device *netdev,
return 0;
}
-static int smsc75xx_wait_ready(struct usbnet *dev)
+static int smsc75xx_wait_ready(struct usbnet *dev, int in_pm)
{
int timeout = 0;
do {
u32 buf;
- int ret = smsc75xx_read_reg(dev, PMT_CTL, &buf);
+ int ret;
+
+ ret = __smsc75xx_read_reg(dev, PMT_CTL, &buf, in_pm);
+
check_warn_return(ret, "Failed to read PMT_CTL: %d", ret);
if (buf & PMT_CTL_DEV_RDY)
@@ -824,7 +857,7 @@ static int smsc75xx_reset(struct usbnet *dev)
netif_dbg(dev, ifup, dev->net, "entering smsc75xx_reset");
- ret = smsc75xx_wait_ready(dev);
+ ret = smsc75xx_wait_ready(dev, 0);
check_warn_return(ret, "device not ready in smsc75xx_reset");
ret = smsc75xx_read_reg(dev, HW_CFG, &buf);
@@ -1191,30 +1224,30 @@ static int smsc75xx_suspend(struct usb_interface *intf, pm_message_t message)
netdev_info(dev->net, "entering SUSPEND2 mode");
/* disable energy detect (link up) & wake up events */
- ret = smsc75xx_read_reg(dev, WUCSR, &val);
+ ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
check_warn_return(ret, "Error reading WUCSR");
val &= ~(WUCSR_MPEN | WUCSR_WUEN);
- ret = smsc75xx_write_reg(dev, WUCSR, val);
+ ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
check_warn_return(ret, "Error writing WUCSR");
- ret = smsc75xx_read_reg(dev, PMT_CTL, &val);
+ ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val);
check_warn_return(ret, "Error reading PMT_CTL");
val &= ~(PMT_CTL_ED_EN | PMT_CTL_WOL_EN);
- ret = smsc75xx_write_reg(dev, PMT_CTL, val);
+ ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val);
check_warn_return(ret, "Error writing PMT_CTL");
/* enter suspend2 mode */
- ret = smsc75xx_read_reg(dev, PMT_CTL, &val);
+ ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val);
check_warn_return(ret, "Error reading PMT_CTL");
val &= ~(PMT_CTL_SUS_MODE | PMT_CTL_WUPS | PMT_CTL_PHY_RST);
val |= PMT_CTL_SUS_MODE_2;
- ret = smsc75xx_write_reg(dev, PMT_CTL, val);
+ ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val);
check_warn_return(ret, "Error writing PMT_CTL");
return 0;
@@ -1225,7 +1258,7 @@ static int smsc75xx_suspend(struct usb_interface *intf, pm_message_t message)
/* disable all filters */
for (i = 0; i < WUF_NUM; i++) {
- ret = smsc75xx_write_reg(dev, WUF_CFGX + i * 4, 0);
+ ret = smsc75xx_write_reg_nopm(dev, WUF_CFGX + i * 4, 0);
check_warn_return(ret, "Error writing WUF_CFGX");
}
@@ -1250,95 +1283,95 @@ static int smsc75xx_suspend(struct usb_interface *intf, pm_message_t message)
}
/* clear any pending pattern match packet status */
- ret = smsc75xx_read_reg(dev, WUCSR, &val);
+ ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
check_warn_return(ret, "Error reading WUCSR");
val |= WUCSR_WUFR;
- ret = smsc75xx_write_reg(dev, WUCSR, val);
+ ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
check_warn_return(ret, "Error writing WUCSR");
netdev_info(dev->net, "enabling packet match detection");
- ret = smsc75xx_read_reg(dev, WUCSR, &val);
+ ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
check_warn_return(ret, "Error reading WUCSR");
val |= WUCSR_WUEN;
- ret = smsc75xx_write_reg(dev, WUCSR, val);
+ ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
check_warn_return(ret, "Error writing WUCSR");
} else {
netdev_info(dev->net, "disabling packet match detection");
- ret = smsc75xx_read_reg(dev, WUCSR, &val);
+ ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
check_warn_return(ret, "Error reading WUCSR");
val &= ~WUCSR_WUEN;
- ret = smsc75xx_write_reg(dev, WUCSR, val);
+ ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
check_warn_return(ret, "Error writing WUCSR");
}
/* disable magic, bcast & unicast wakeup sources */
- ret = smsc75xx_read_reg(dev, WUCSR, &val);
+ ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
check_warn_return(ret, "Error reading WUCSR");
val &= ~(WUCSR_MPEN | WUCSR_BCST_EN | WUCSR_PFDA_EN);
- ret = smsc75xx_write_reg(dev, WUCSR, val);
+ ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
check_warn_return(ret, "Error writing WUCSR");
if (pdata->wolopts & WAKE_MAGIC) {
netdev_info(dev->net, "enabling magic packet wakeup");
- ret = smsc75xx_read_reg(dev, WUCSR, &val);
+ ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
check_warn_return(ret, "Error reading WUCSR");
/* clear any pending magic packet status */
val |= WUCSR_MPR | WUCSR_MPEN;
- ret = smsc75xx_write_reg(dev, WUCSR, val);
+ ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
check_warn_return(ret, "Error writing WUCSR");
}
if (pdata->wolopts & WAKE_BCAST) {
netdev_info(dev->net, "enabling broadcast detection");
- ret = smsc75xx_read_reg(dev, WUCSR, &val);
+ ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
check_warn_return(ret, "Error reading WUCSR");
val |= WUCSR_BCAST_FR | WUCSR_BCST_EN;
- ret = smsc75xx_write_reg(dev, WUCSR, val);
+ ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
check_warn_return(ret, "Error writing WUCSR");
}
if (pdata->wolopts & WAKE_UCAST) {
netdev_info(dev->net, "enabling unicast detection");
- ret = smsc75xx_read_reg(dev, WUCSR, &val);
+ ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
check_warn_return(ret, "Error reading WUCSR");
val |= WUCSR_WUFR | WUCSR_PFDA_EN;
- ret = smsc75xx_write_reg(dev, WUCSR, val);
+ ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
check_warn_return(ret, "Error writing WUCSR");
}
/* enable receiver to enable frame reception */
- ret = smsc75xx_read_reg(dev, MAC_RX, &val);
+ ret = smsc75xx_read_reg_nopm(dev, MAC_RX, &val);
check_warn_return(ret, "Failed to read MAC_RX: %d", ret);
val |= MAC_RX_RXEN;
- ret = smsc75xx_write_reg(dev, MAC_RX, val);
+ ret = smsc75xx_write_reg_nopm(dev, MAC_RX, val);
check_warn_return(ret, "Failed to write MAC_RX: %d", ret);
/* some wol options are enabled, so enter SUSPEND0 */
netdev_info(dev->net, "entering SUSPEND0 mode");
- ret = smsc75xx_read_reg(dev, PMT_CTL, &val);
+ ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val);
check_warn_return(ret, "Error reading PMT_CTL");
val &= (~(PMT_CTL_SUS_MODE | PMT_CTL_PHY_RST));
val |= PMT_CTL_SUS_MODE_0 | PMT_CTL_WOL_EN | PMT_CTL_WUPS;
- ret = smsc75xx_write_reg(dev, PMT_CTL, val);
+ ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val);
check_warn_return(ret, "Error writing PMT_CTL");
smsc75xx_set_feature(dev, USB_DEVICE_REMOTE_WAKEUP);
@@ -1359,37 +1392,37 @@ static int smsc75xx_resume(struct usb_interface *intf)
smsc75xx_clear_feature(dev, USB_DEVICE_REMOTE_WAKEUP);
/* Disable wakeup sources */
- ret = smsc75xx_read_reg(dev, WUCSR, &val);
+ ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
check_warn_return(ret, "Error reading WUCSR");
val &= ~(WUCSR_WUEN | WUCSR_MPEN | WUCSR_PFDA_EN
| WUCSR_BCST_EN);
- ret = smsc75xx_write_reg(dev, WUCSR, val);
+ ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
check_warn_return(ret, "Error writing WUCSR");
/* clear wake-up status */
- ret = smsc75xx_read_reg(dev, PMT_CTL, &val);
+ ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val);
check_warn_return(ret, "Error reading PMT_CTL");
val &= ~PMT_CTL_WOL_EN;
val |= PMT_CTL_WUPS;
- ret = smsc75xx_write_reg(dev, PMT_CTL, val);
+ ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val);
check_warn_return(ret, "Error writing PMT_CTL");
} else {
netdev_info(dev->net, "resuming from SUSPEND2");
- ret = smsc75xx_read_reg(dev, PMT_CTL, &val);
+ ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val);
check_warn_return(ret, "Error reading PMT_CTL");
val |= PMT_CTL_PHY_PWRUP;
- ret = smsc75xx_write_reg(dev, PMT_CTL, val);
+ ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val);
check_warn_return(ret, "Error writing PMT_CTL");
}
- ret = smsc75xx_wait_ready(dev);
+ ret = smsc75xx_wait_ready(dev, 1);
check_warn_return(ret, "device not ready in smsc75xx_resume");
return usbnet_resume(intf);
--
1.7.9.5
^ permalink raw reply related
* [PATCH v2 4/5] usbnet: smsc95xx: apply the introduced usbnet_read[write]_cmd_nopm
From: Ming Lei @ 2012-11-04 11:16 UTC (permalink / raw)
To: David S. Miller, Greg Kroah-Hartman
Cc: Oliver Neukum, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-usb-u79uwXL29TY76Z2rM5mHXA, Ming Lei, Steve Glendinning
In-Reply-To: <1352027793-6608-1-git-send-email-ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
This patch applies the introduced usbnet_read_cmd_nopm() and
usbnet_write_cmd_nopm() in the callback of resume and suspend
to avoid deadlock if USB runtime PM is considered into
usbnet_read_cmd() and usbnet_write_cmd().
Cc: Steve Glendinning <steve.glendinning-nksJyM/082jR7s880joybQ@public.gmane.org>
Signed-off-by: Ming Lei <ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
---
drivers/net/usb/smsc95xx.c | 134 ++++++++++++++++++++++++++++----------------
1 file changed, 85 insertions(+), 49 deletions(-)
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index f1f473f..0241db4 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -73,20 +73,26 @@ static bool turbo_mode = true;
module_param(turbo_mode, bool, 0644);
MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction");
-static int __must_check smsc95xx_read_reg(struct usbnet *dev, u32 index,
- u32 *data)
+static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index,
+ u32 *data, int in_pm)
{
u32 buf;
int ret;
+ int (*fn)(struct usbnet *, u8, u8, u16, u16, void *, u16);
BUG_ON(!dev);
- ret = usbnet_read_cmd(dev, USB_VENDOR_REQUEST_READ_REGISTER,
- USB_DIR_IN | USB_TYPE_VENDOR |
- USB_RECIP_DEVICE,
- 0, index, &buf, 4);
+ if (!in_pm)
+ fn = usbnet_read_cmd;
+ else
+ fn = usbnet_read_cmd_nopm;
+
+ ret = fn(dev, USB_VENDOR_REQUEST_READ_REGISTER, USB_DIR_IN
+ | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+ 0, index, &buf, 4);
if (unlikely(ret < 0))
- netdev_warn(dev->net, "Failed to read register index 0x%08x\n", index);
+ netdev_warn(dev->net,
+ "Failed to read reg index 0x%08x: %d", index, ret);
le32_to_cpus(&buf);
*data = buf;
@@ -94,35 +100,64 @@ static int __must_check smsc95xx_read_reg(struct usbnet *dev, u32 index,
return ret;
}
-static int __must_check smsc95xx_write_reg(struct usbnet *dev, u32 index,
- u32 data)
+static int __must_check __smsc95xx_write_reg(struct usbnet *dev, u32 index,
+ u32 data, int in_pm)
{
u32 buf;
int ret;
+ int (*fn)(struct usbnet *, u8, u8, u16, u16, const void *, u16);
BUG_ON(!dev);
+ if (!in_pm)
+ fn = usbnet_write_cmd;
+ else
+ fn = usbnet_write_cmd_nopm;
+
buf = data;
cpu_to_le32s(&buf);
-
- ret = usbnet_write_cmd(dev, USB_VENDOR_REQUEST_WRITE_REGISTER,
- USB_DIR_OUT | USB_TYPE_VENDOR |
- USB_RECIP_DEVICE,
- 0, index, &buf, 4);
+ ret = fn(dev, USB_VENDOR_REQUEST_WRITE_REGISTER, USB_DIR_OUT
+ | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+ 0, index, &buf, 4);
if (unlikely(ret < 0))
- netdev_warn(dev->net, "Failed to write register index 0x%08x\n", index);
+ netdev_warn(dev->net,
+ "Failed to write reg index 0x%08x: %d", index, ret);
return ret;
}
+static int __must_check smsc95xx_read_reg_nopm(struct usbnet *dev, u32 index,
+ u32 *data)
+{
+ return __smsc95xx_read_reg(dev, index, data, 1);
+}
+
+static int __must_check smsc95xx_write_reg_nopm(struct usbnet *dev, u32 index,
+ u32 data)
+{
+ return __smsc95xx_write_reg(dev, index, data, 1);
+}
+
+static int __must_check smsc95xx_read_reg(struct usbnet *dev, u32 index,
+ u32 *data)
+{
+ return __smsc95xx_read_reg(dev, index, data, 0);
+}
+
+static int __must_check smsc95xx_write_reg(struct usbnet *dev, u32 index,
+ u32 data)
+{
+ return __smsc95xx_write_reg(dev, index, data, 0);
+}
static int smsc95xx_set_feature(struct usbnet *dev, u32 feature)
{
if (WARN_ON_ONCE(!dev))
return -EINVAL;
- return usbnet_write_cmd(dev, USB_REQ_SET_FEATURE,
- USB_RECIP_DEVICE, feature, 0, NULL, 0);
+ return usbnet_write_cmd_nopm(dev, USB_REQ_SET_FEATURE,
+ USB_RECIP_DEVICE, feature, 0,
+ NULL, 0);
}
static int smsc95xx_clear_feature(struct usbnet *dev, u32 feature)
@@ -130,8 +165,9 @@ static int smsc95xx_clear_feature(struct usbnet *dev, u32 feature)
if (WARN_ON_ONCE(!dev))
return -EINVAL;
- return usbnet_write_cmd(dev, USB_REQ_CLEAR_FEATURE,
- USB_RECIP_DEVICE, feature, 0, NULL, 0);
+ return usbnet_write_cmd_nopm(dev, USB_REQ_CLEAR_FEATURE,
+ USB_RECIP_DEVICE, feature,
+ 0, NULL, 0);
}
/* Loop until the read is completed with timeout
@@ -708,7 +744,7 @@ static int smsc95xx_start_tx_path(struct usbnet *dev)
}
/* Starts the Receive path */
-static int smsc95xx_start_rx_path(struct usbnet *dev)
+static int smsc95xx_start_rx_path(struct usbnet *dev, int in_pm)
{
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
unsigned long flags;
@@ -718,7 +754,7 @@ static int smsc95xx_start_rx_path(struct usbnet *dev)
pdata->mac_cr |= MAC_CR_RXEN_;
spin_unlock_irqrestore(&pdata->mac_cr_lock, flags);
- ret = smsc95xx_write_reg(dev, MAC_CR, pdata->mac_cr);
+ ret = __smsc95xx_write_reg(dev, MAC_CR, pdata->mac_cr, in_pm);
check_warn_return(ret, "Failed to write MAC_CR: %d\n", ret);
return 0;
@@ -937,7 +973,7 @@ static int smsc95xx_reset(struct usbnet *dev)
ret = smsc95xx_start_tx_path(dev);
check_warn_return(ret, "Failed to start TX path");
- ret = smsc95xx_start_rx_path(dev);
+ ret = smsc95xx_start_rx_path(dev, 0);
check_warn_return(ret, "Failed to start RX path");
netif_dbg(dev, ifup, dev->net, "smsc95xx_reset, return 0\n");
@@ -1039,30 +1075,30 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
netdev_info(dev->net, "entering SUSPEND2 mode");
/* disable energy detect (link up) & wake up events */
- ret = smsc95xx_read_reg(dev, WUCSR, &val);
+ ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val);
check_warn_return(ret, "Error reading WUCSR");
val &= ~(WUCSR_MPEN_ | WUCSR_WAKE_EN_);
- ret = smsc95xx_write_reg(dev, WUCSR, val);
+ ret = smsc95xx_write_reg_nopm(dev, WUCSR, val);
check_warn_return(ret, "Error writing WUCSR");
- ret = smsc95xx_read_reg(dev, PM_CTRL, &val);
+ ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
check_warn_return(ret, "Error reading PM_CTRL");
val &= ~(PM_CTL_ED_EN_ | PM_CTL_WOL_EN_);
- ret = smsc95xx_write_reg(dev, PM_CTRL, val);
+ ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
check_warn_return(ret, "Error writing PM_CTRL");
/* enter suspend2 mode */
- ret = smsc95xx_read_reg(dev, PM_CTRL, &val);
+ ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
check_warn_return(ret, "Error reading PM_CTRL");
val &= ~(PM_CTL_SUS_MODE_ | PM_CTL_WUPS_ | PM_CTL_PHY_RST_);
val |= PM_CTL_SUS_MODE_2;
- ret = smsc95xx_write_reg(dev, PM_CTRL, val);
+ ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
check_warn_return(ret, "Error writing PM_CTRL");
return 0;
@@ -1131,50 +1167,50 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
}
for (i = 0; i < (pdata->wuff_filter_count * 4); i++) {
- ret = smsc95xx_write_reg(dev, WUFF, filter_mask[i]);
+ ret = smsc95xx_write_reg_nopm(dev, WUFF, filter_mask[i]);
check_warn_return(ret, "Error writing WUFF");
}
kfree(filter_mask);
for (i = 0; i < (pdata->wuff_filter_count / 4); i++) {
- ret = smsc95xx_write_reg(dev, WUFF, command[i]);
+ ret = smsc95xx_write_reg_nopm(dev, WUFF, command[i]);
check_warn_return(ret, "Error writing WUFF");
}
for (i = 0; i < (pdata->wuff_filter_count / 4); i++) {
- ret = smsc95xx_write_reg(dev, WUFF, offset[i]);
+ ret = smsc95xx_write_reg_nopm(dev, WUFF, offset[i]);
check_warn_return(ret, "Error writing WUFF");
}
for (i = 0; i < (pdata->wuff_filter_count / 2); i++) {
- ret = smsc95xx_write_reg(dev, WUFF, crc[i]);
+ ret = smsc95xx_write_reg_nopm(dev, WUFF, crc[i]);
check_warn_return(ret, "Error writing WUFF");
}
/* clear any pending pattern match packet status */
- ret = smsc95xx_read_reg(dev, WUCSR, &val);
+ ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val);
check_warn_return(ret, "Error reading WUCSR");
val |= WUCSR_WUFR_;
- ret = smsc95xx_write_reg(dev, WUCSR, val);
+ ret = smsc95xx_write_reg_nopm(dev, WUCSR, val);
check_warn_return(ret, "Error writing WUCSR");
}
if (pdata->wolopts & WAKE_MAGIC) {
/* clear any pending magic packet status */
- ret = smsc95xx_read_reg(dev, WUCSR, &val);
+ ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val);
check_warn_return(ret, "Error reading WUCSR");
val |= WUCSR_MPR_;
- ret = smsc95xx_write_reg(dev, WUCSR, val);
+ ret = smsc95xx_write_reg_nopm(dev, WUCSR, val);
check_warn_return(ret, "Error writing WUCSR");
}
/* enable/disable wakeup sources */
- ret = smsc95xx_read_reg(dev, WUCSR, &val);
+ ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val);
check_warn_return(ret, "Error reading WUCSR");
if (pdata->wolopts & (WAKE_BCAST | WAKE_MCAST | WAKE_ARP | WAKE_UCAST)) {
@@ -1193,41 +1229,41 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
val &= ~WUCSR_MPEN_;
}
- ret = smsc95xx_write_reg(dev, WUCSR, val);
+ ret = smsc95xx_write_reg_nopm(dev, WUCSR, val);
check_warn_return(ret, "Error writing WUCSR");
/* enable wol wakeup source */
- ret = smsc95xx_read_reg(dev, PM_CTRL, &val);
+ ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
check_warn_return(ret, "Error reading PM_CTRL");
val |= PM_CTL_WOL_EN_;
- ret = smsc95xx_write_reg(dev, PM_CTRL, val);
+ ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
check_warn_return(ret, "Error writing PM_CTRL");
/* enable receiver to enable frame reception */
- smsc95xx_start_rx_path(dev);
+ smsc95xx_start_rx_path(dev, 1);
/* some wol options are enabled, so enter SUSPEND0 */
netdev_info(dev->net, "entering SUSPEND0 mode");
- ret = smsc95xx_read_reg(dev, PM_CTRL, &val);
+ ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
check_warn_return(ret, "Error reading PM_CTRL");
val &= (~(PM_CTL_SUS_MODE_ | PM_CTL_WUPS_ | PM_CTL_PHY_RST_));
val |= PM_CTL_SUS_MODE_0;
- ret = smsc95xx_write_reg(dev, PM_CTRL, val);
+ ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
check_warn_return(ret, "Error writing PM_CTRL");
/* clear wol status */
val &= ~PM_CTL_WUPS_;
val |= PM_CTL_WUPS_WOL_;
- ret = smsc95xx_write_reg(dev, PM_CTRL, val);
+ ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
check_warn_return(ret, "Error writing PM_CTRL");
/* read back PM_CTRL */
- ret = smsc95xx_read_reg(dev, PM_CTRL, &val);
+ ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
check_warn_return(ret, "Error reading PM_CTRL");
smsc95xx_set_feature(dev, USB_DEVICE_REMOTE_WAKEUP);
@@ -1248,22 +1284,22 @@ static int smsc95xx_resume(struct usb_interface *intf)
smsc95xx_clear_feature(dev, USB_DEVICE_REMOTE_WAKEUP);
/* clear wake-up sources */
- ret = smsc95xx_read_reg(dev, WUCSR, &val);
+ ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val);
check_warn_return(ret, "Error reading WUCSR");
val &= ~(WUCSR_WAKE_EN_ | WUCSR_MPEN_);
- ret = smsc95xx_write_reg(dev, WUCSR, val);
+ ret = smsc95xx_write_reg_nopm(dev, WUCSR, val);
check_warn_return(ret, "Error writing WUCSR");
/* clear wake-up status */
- ret = smsc95xx_read_reg(dev, PM_CTRL, &val);
+ ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
check_warn_return(ret, "Error reading PM_CTRL");
val &= ~PM_CTL_WOL_EN_;
val |= PM_CTL_WUPS_;
- ret = smsc95xx_write_reg(dev, PM_CTRL, val);
+ ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
check_warn_return(ret, "Error writing PM_CTRL");
}
--
1.7.9.5
--
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 related
* [PATCH v2 3/5] usbnet: smsc95xx: fix memory leak in smsc95xx_suspend
From: Ming Lei @ 2012-11-04 11:16 UTC (permalink / raw)
To: David S. Miller, Greg Kroah-Hartman
Cc: Oliver Neukum, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-usb-u79uwXL29TY76Z2rM5mHXA, Ming Lei, Steve Glendinning
In-Reply-To: <1352027793-6608-1-git-send-email-ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
This patch fixes memory leak in smsc95xx_suspend.
Also, it isn't necessary to bother mm to allocate 8bytes/16byte,
and we can use stack variable safely.
Cc: Steve Glendinning <steve.glendinning-nksJyM/082jR7s880joybQ@public.gmane.org>
Signed-off-by: Ming Lei <ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
---
drivers/net/usb/smsc95xx.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 46cd784..f1f473f 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -1070,11 +1070,15 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
if (pdata->wolopts & (WAKE_BCAST | WAKE_MCAST | WAKE_ARP | WAKE_UCAST)) {
u32 *filter_mask = kzalloc(32, GFP_KERNEL);
- u32 *command = kzalloc(2, GFP_KERNEL);
- u32 *offset = kzalloc(2, GFP_KERNEL);
- u32 *crc = kzalloc(4, GFP_KERNEL);
+ u32 command[2];
+ u32 offset[2];
+ u32 crc[4];
int i, filter = 0;
+ memset(command, 0, sizeof(command));
+ memset(offset, 0, sizeof(offset));
+ memset(crc, 0, sizeof(crc));
+
if (pdata->wolopts & WAKE_BCAST) {
const u8 bcast[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
netdev_info(dev->net, "enabling broadcast detection");
@@ -1131,6 +1135,8 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
check_warn_return(ret, "Error writing WUFF");
}
+ kfree(filter_mask);
+
for (i = 0; i < (pdata->wuff_filter_count / 4); i++) {
ret = smsc95xx_write_reg(dev, WUFF, command[i]);
check_warn_return(ret, "Error writing WUFF");
--
1.7.9.5
--
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 related
* [PATCH v2 1/5] usbnet: introduce usbnet_read[write]_cmd_nopm
From: Ming Lei @ 2012-11-04 11:16 UTC (permalink / raw)
To: David S. Miller, Greg Kroah-Hartman
Cc: Oliver Neukum, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-usb-u79uwXL29TY76Z2rM5mHXA, Ming Lei
In-Reply-To: <1352027793-6608-1-git-send-email-ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
This patch introduces the below two helpers to prepare for solving
the usbnet runtime PM problem, which may cause some network utilities
(ifconfig, ethtool,...) touch a suspended device.
usbnet_read_cmd_nopm()
usbnet_write_cmd_nopm()
The above two helpers should be called by usbnet resume/suspend
callback to avoid deadlock.
Signed-off-by: Ming Lei <ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
---
drivers/net/usb/usbnet.c | 62 ++++++++++++++++++++++++++++++++++++++++----
include/linux/usb/usbnet.h | 4 +++
2 files changed, 61 insertions(+), 5 deletions(-)
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 09ea47a..a7fb074 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1614,8 +1614,8 @@ void usbnet_device_suggests_idle(struct usbnet *dev)
EXPORT_SYMBOL(usbnet_device_suggests_idle);
/*-------------------------------------------------------------------------*/
-int usbnet_read_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
- u16 value, u16 index, void *data, u16 size)
+static int __usbnet_read_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
+ u16 value, u16 index, void *data, u16 size)
{
void *buf = NULL;
int err = -ENOMEM;
@@ -1639,10 +1639,10 @@ int usbnet_read_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
out:
return err;
}
-EXPORT_SYMBOL_GPL(usbnet_read_cmd);
-int usbnet_write_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
- u16 value, u16 index, const void *data, u16 size)
+static int __usbnet_write_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
+ u16 value, u16 index, const void *data,
+ u16 size)
{
void *buf = NULL;
int err = -ENOMEM;
@@ -1665,8 +1665,56 @@ int usbnet_write_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
out:
return err;
}
+
+/*
+ * The function can't be called inside suspend/resume callback,
+ * otherwise deadlock will be caused.
+ */
+int usbnet_read_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
+ u16 value, u16 index, void *data, u16 size)
+{
+ return __usbnet_read_cmd(dev, cmd, reqtype, value, index,
+ data, size);
+}
+EXPORT_SYMBOL_GPL(usbnet_read_cmd);
+
+/*
+ * The function can't be called inside suspend/resume callback,
+ * otherwise deadlock will be caused.
+ */
+int usbnet_write_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
+ u16 value, u16 index, const void *data, u16 size)
+{
+ return __usbnet_write_cmd(dev, cmd, reqtype, value, index,
+ data, size);
+}
EXPORT_SYMBOL_GPL(usbnet_write_cmd);
+/*
+ * The function can be called inside suspend/resume callback safely
+ * and should only be called by suspend/resume callback generally.
+ */
+int usbnet_read_cmd_nopm(struct usbnet *dev, u8 cmd, u8 reqtype,
+ u16 value, u16 index, void *data, u16 size)
+{
+ return __usbnet_read_cmd(dev, cmd, reqtype, value, index,
+ data, size);
+}
+EXPORT_SYMBOL_GPL(usbnet_read_cmd_nopm);
+
+/*
+ * The function can be called inside suspend/resume callback safely
+ * and should only be called by suspend/resume callback generally.
+ */
+int usbnet_write_cmd_nopm(struct usbnet *dev, u8 cmd, u8 reqtype,
+ u16 value, u16 index, const void *data,
+ u16 size)
+{
+ return __usbnet_write_cmd(dev, cmd, reqtype, value, index,
+ data, size);
+}
+EXPORT_SYMBOL_GPL(usbnet_write_cmd_nopm);
+
static void usbnet_async_cmd_cb(struct urb *urb)
{
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)urb->context;
@@ -1680,6 +1728,10 @@ static void usbnet_async_cmd_cb(struct urb *urb)
usb_free_urb(urb);
}
+/*
+ * The caller must make sure that device can't be put into suspend
+ * state until the control URB completes.
+ */
int usbnet_write_cmd_async(struct usbnet *dev, u8 cmd, u8 reqtype,
u16 value, u16 index, const void *data, u16 size)
{
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index 4410e416..9bbeabf 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -167,6 +167,10 @@ extern int usbnet_read_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
u16 value, u16 index, void *data, u16 size);
extern int usbnet_write_cmd(struct usbnet *dev, u8 cmd, u8 reqtype,
u16 value, u16 index, const void *data, u16 size);
+extern int usbnet_read_cmd_nopm(struct usbnet *dev, u8 cmd, u8 reqtype,
+ u16 value, u16 index, void *data, u16 size);
+extern int usbnet_write_cmd_nopm(struct usbnet *dev, u8 cmd, u8 reqtype,
+ u16 value, u16 index, const void *data, u16 size);
extern int usbnet_write_cmd_async(struct usbnet *dev, u8 cmd, u8 reqtype,
u16 value, u16 index, const void *data, u16 size);
--
1.7.9.5
--
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 related
* [PATCH v2 0/5] usbnet: avoiding access auto-suspended device
From: Ming Lei @ 2012-11-04 11:16 UTC (permalink / raw)
To: David S. Miller, Greg Kroah-Hartman
Cc: Oliver Neukum, netdev-u79uwXL29TY76Z2rM5mHXA,
linux-usb-u79uwXL29TY76Z2rM5mHXA
Thip patchset avoids accessing auto-suspended device in ioctl path,
which is generally triggered by some network utility(ethtool, ifconfig,
...)
Most of network devices have the problem, but as discussed in the
thread:
http://marc.info/?t=135054860600003&r=1&w=2
the problem should be solved inside driver.
Considered that only smsc75xx and smsc95xx calls usbnet_read_cmd()
and usbnet_write_cmd() inside its resume and suspend callback, the
patcheset introduce the nopm version of the two functions which
should be called only in the resume and suspend callback. So we
can solve the problem by runtime resuming device before doing
control message things.
The patchset is against 3.7.0-rc3-next-20121102, and has been tested
OK on smsc95xx usbnet device.
Change logs:
V2:
- rebased on the latest net-next tree, only 2/5 changed
V1:
- rebased on 3.7.0-rc3-next-20121102, only patch 4/5 changed
- fix one memory leak during smsc95xx_suspend, patch 3/5 added
drivers/net/usb/smsc75xx.c | 147 +++++++++++++++++++++++++++-----------------
drivers/net/usb/smsc95xx.c | 146 +++++++++++++++++++++++++++----------------
drivers/net/usb/usbnet.c | 72 ++++++++++++++++++++--
include/linux/usb/usbnet.h | 4 ++
4 files changed, 255 insertions(+), 114 deletions(-)
Thanks,
--
Ming Lei
--
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 8/9] isdn: Remove unused variable causing a compile build warning
From: Lee Jones @ 2012-11-04 10:53 UTC (permalink / raw)
To: Paul Bolle; +Cc: linux-kernel, Karsten Keil, netdev
In-Reply-To: <1352024091.1434.17.camel@x61.thuisdomein>
On Sun, 04 Nov 2012, Paul Bolle wrote:
> On Sat, 2012-11-03 at 23:48 +0100, Lee Jones wrote:
> > On Sat, 03 Nov 2012, Paul Bolle wrote:
> > > On Sat, 2012-11-03 at 23:02 +0100, Lee Jones wrote:
> > > > This patch fixes:
> > > > drivers/isdn/i4l/isdn_common.c: In function ‘isdn_ioctl’:
> > > > drivers/isdn/i4l/isdn_common.c:1278:8: warning: unused variable ‘s’ [-Wunused-variable]
> > >
> > > Did you have CONFIG_NETDEVICES not set in this build?
> >
> > Ah yes, I see it. The function went down further than I thought
> > it did. So the real fix is to ensure 's' is defined inside of
> > some ifdef CONFIG_NETDEVICES guards.
>
> What puzzles me is that we only find these "#ifdef CONFIG_NETDEVICES"
> guards in this file and not in isdn_net.c, were all the ioctl commands
> guarded that way seem to be calling into. On first glance that doesn't
> make much sense.
>
> (Actually the idea of having ISDN without NETDEVICES is a bit puzzling
> too. But there are too many parts of the isdn subsystem that I'm
> unfamiliar with to say whether that can make sense.)
I'm in the same position as you Paul. I just noticed the warning so
fixed it following the current way of doing things. Any, more
substantial changes requiring greater knowledge of the subsystem
would have to be done by someone else.
--
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply
* (unknown),
From: Email Account Maintenance/Update @ 2012-11-04 16:25 UTC (permalink / raw)
Dear Account Owner,
This message is from webmail hosting messaging center to all our
account owners. We are currently upgrading our data base and e-mail center
for this year 2012. We are deleting all unused account to create more
space for new one and to prevent spam mails. To prevent your account from
closing you will have to update it below so that we will know that it's a
present used account.
Warning!!! E-mail owner that refuses to update his or her Email,within
48hrs of receiving this warning will lose his or her E-mail permanently.
You are required to send us the below information via email below.
CONFIRM YOUR E-MAIL IDENTITY BELOW:
First Name:____________________________
Last Name:_____________________________
E-mail Username:________________________
E-mail Password:_______________________
Click on reply and send us the above details.
Warning!!!
In failure to verify your account within 48hrs on receiving this
notification, your account will automatically be deactivated.
Thank you for using webmail Account.
Warning Code: QATO8B52AXV
Kind Regards,
Webmail Account Service Team Management.
Thanks for your co-operation.
Copyright @2012 WEBMAIL OFFICE All rights reserved.
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
^ permalink raw reply
* Re: [PATCH 1/9] batman-adv: add UNICAST_4ADDR packet type
From: Sven Eckelmann @ 2012-11-04 10:29 UTC (permalink / raw)
To: b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, David Miller
In-Reply-To: <20121103.152226.244759041688205348.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1825 bytes --]
On Saturday 03 November 2012 15:22:26 David Miller wrote:
[...]
> Your packet layouts are very poorly designed and I want you to stop
> and think seriously about things before extending things further.
You are right about the packet design/layout. But I also have some problems
with the following statement. Maybe you can help me to resolve it.
> All of this __packed stuff is a serious problem.
>
> It means that on RISC system, fields such as your 32-bit sequence
> number, will be read and written using byte loads and stores.
>
> This is terrible.
>
> Instead, design the structures so that they are full filled out to
> at least 4 byte boundaries, so that they and the contents after
> them, are 4 byte aligned too.
>
> Then you won't need to mark all of your packet header structs
> with __packed, and therefore the compiler can use full 32-bit
> loads and stores to access 32-bit fields.
Ok, lets assume batman-adv has everything 4 byte aligned and we are running on
a machine without unaligned r/w access. The machine may issues bus errors and
so on.
Now also assume following really unusual situation: We get our data from a
ethernet driver and the skb stores the ethernet header. The start of the
ethernet header is perfectly aligned (4 or even 16 byte boundary aligned). The
the header is 14/18 byte long (6 byte src, 6 byte dst, 2 byte ethertype and
maybe 4 byte vlan). Now the payload starts only on a 2 byte boundary -> it is
never 4 byte boundary aligned. A 32 bit read now causes different variations
of problems (reminder: bus error).
This brings me to the question: Why should the "32 bit align everything
relative to the start of the struct" approach help to resolve the situation
for the access of 32 bit data structure members? May I am missing some
information?
Kind regards,
Sven
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* [PATCH v2 8/9] isdn: Remove unused variable causing a compile build warning
From: Lee Jones @ 2012-11-04 10:28 UTC (permalink / raw)
To: Paul Bolle; +Cc: linux-kernel, Karsten Keil, netdev
In-Reply-To: <1351982441.1434.5.camel@x61.thuisdomein>
Thanks for reviewing Paul. Here's the result:
Author: Lee Jones <lee.jones@linaro.org>
Date: Sat Nov 3 22:06:02 2012 +0100
isdn: Encapsulate variable 's' in same CONFIG_NETDEVICES guards as code using it
In the current case, variable 's' of type 'char *' is defined but then
not used if !CONFIG_NETDEVICES, casing the compile-time warning below.
In this change we surround the declaration using the same guards as
the pre-processed code which makes use of it.
This patch fixes:
drivers/isdn/i4l/isdn_common.c: In function ‘isdn_ioctl’:
drivers/isdn/i4l/isdn_common.c:1278:8: warning: unused variable ‘s’ [-Wunused-variable]
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: netdev@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index 8c610fa..2875f31 100644
--- a/drivers/isdn/i4l/isdn_common.c
+++ b/drivers/isdn/i4l/isdn_common.c
@@ -1275,7 +1275,6 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg)
int ret;
int i;
char __user *p;
- char *s;
union iocpar {
char name[10];
char bname[22];
@@ -1284,6 +1283,9 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg)
isdn_net_ioctl_cfg cfg;
} iocpar;
void __user *argp = (void __user *)arg;
+#ifdef CONFIG_NETDEVICES
+ char *s;
+#endif
#define name iocpar.name
#define bname iocpar.bname
^ permalink raw reply related
* Re: [PATCH 8/9] isdn: Remove unused variable causing a compile build warning
From: Paul Bolle @ 2012-11-04 10:14 UTC (permalink / raw)
To: Lee Jones; +Cc: linux-kernel, Karsten Keil, netdev
In-Reply-To: <20121103224832.GA24262@gmail.com>
On Sat, 2012-11-03 at 23:48 +0100, Lee Jones wrote:
> On Sat, 03 Nov 2012, Paul Bolle wrote:
> > On Sat, 2012-11-03 at 23:02 +0100, Lee Jones wrote:
> > > This patch fixes:
> > > drivers/isdn/i4l/isdn_common.c: In function ‘isdn_ioctl’:
> > > drivers/isdn/i4l/isdn_common.c:1278:8: warning: unused variable ‘s’ [-Wunused-variable]
> >
> > Did you have CONFIG_NETDEVICES not set in this build?
>
> Ah yes, I see it. The function went down further than I thought
> it did. So the real fix is to ensure 's' is defined inside of
> some ifdef CONFIG_NETDEVICES guards.
What puzzles me is that we only find these "#ifdef CONFIG_NETDEVICES"
guards in this file and not in isdn_net.c, were all the ioctl commands
guarded that way seem to be calling into. On first glance that doesn't
make much sense.
(Actually the idea of having ISDN without NETDEVICES is a bit puzzling
too. But there are too many parts of the isdn subsystem that I'm
unfamiliar with to say whether that can make sense.)
Paul Bolle
^ permalink raw reply
* Re: [PATCH v2 net-next] r8169: enable internal ASPM and clock request settings
From: Francois Romieu @ 2012-11-04 9:17 UTC (permalink / raw)
To: David Miller; +Cc: hayeswang, netdev, linux-kernel, agnescheng
In-Reply-To: <20121104.010135.1162785749638710718.davem@davemloft.net>
David Miller <davem@davemloft.net> :
[...]
> Francois?
Please apply.
Thanks.
--
Ueimor
^ permalink raw reply
* Re: [PATCH] wireless: iwlwifi - add dma_mapping_error() checks to avoid warnings
From: Johannes Berg @ 2012-11-04 9:16 UTC (permalink / raw)
To: shuah.khan
Cc: johannes.berg, wey-yi.w.guy, linville, ilw, emmanuel.grumbach,
donald.h.fry, linux-wireless, netdev, LKML, shuahkhan
In-Reply-To: <1351993233.4369.2.camel@lorien2>
On Sat, 2012-11-03 at 19:40 -0600, Shuah Khan wrote:
> Add missing dma_mapping_error() checks to validate dma addresses returned by
> dma_map_page() calls to avoid the following warning:
>
> [ 28.475686] WARNING: at lib/dma-debug.c:933 check_unmap+0x459/0x8a0()
> [ 28.475688] Hardware name: HP EliteBook 6930p
> [ 28.475690] iwlwifi 0000:03:00.0: DMA-API: device driver failed to check map error[device address=0x00000000ffffa000] [size=8192 bytes] [mapped as page]
> [ 28.475691] Modules linked in: arc4 bnep rfcomm iwldvm mac80211 snd_hda_codec_analog radeon snd_hda_intel snd_hda_codec coretemp kvm_intel snd_hwdep snd_pcm iwlwifi kvm btusb bluetooth snd_seq_midi snd_rawmidi ttm cfg80211 snd_seq_midi_event drm_kms_helper pata_pcmcia drm snd_seq binfmt_misc pcmcia snd_timer snd_seq_device tpm_infineon snd dm_multipath yenta_socket joydev pcmcia_rsrc pcmcia_core hp_wmi psmouse hp_accel microcode soundcore i2c_algo_bit sparse_keymap wmi ppdev lpc_ich lis3lv02d snd_page_alloc video tpm_tis serio_raw parport_pc input_polldev mac_hid lp parport firewire_ohci firewire_core crc_itu_t sdhci_pci sdhci e1000e
Thanks for the report. Since I think doing BUG_ON() in such a scenario
is a really bad idea, I've applied a different patch with your
Reported-by.
johannes
^ permalink raw reply
* Re: [4/4] arm: mvebu: enable Ethernet controllers on Armada 370/XP eval boards
From: Thomas Petazzoni @ 2012-11-04 9:12 UTC (permalink / raw)
To: Jason Gunthorpe
Cc: Lior Amsalem, Andrew Lunn, Jason Cooper, netdev, Maen Suleiman,
Gregory Clement, linux-arm-kernel, Ian Molton
In-Reply-To: <20121104020311.GA26747@obsidianresearch.com>
Hello Jason,
On Sat, 3 Nov 2012 20:03:11 -0600, Jason Gunthorpe wrote:
> We've been using the patches from Ian Molton for the mv643xx driver
> that make it use the more standard, separately described MDIO
> bus..
[...]
> Where the MDIO bus is explicit, the PHY, its address and parameters
> are explicit - the PHY has an of_node pointer - and phy-handle is used
> to connect them.
>
> I'm not sure having the MDIO bus as a distinct top level item is
> great, considering how the registers overlap.. It might be better
> to put it under the egiga0 block? But that is a minor nit :)
Thanks for your comment. I'll see what I can come up with to make the
phy a separate DT entity.
Thanks!
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
^ permalink raw reply
* Re: [PATCH 9/9] Avoid 'statement with no effect' compiler warnings
From: Lee Jones @ 2012-11-04 7:55 UTC (permalink / raw)
To: David Miller; +Cc: linux-kernel, shemminger, bridge, netdev
In-Reply-To: <20121104.010043.1842614952525101679.davem@davemloft.net>
On Sun, 04 Nov 2012, David Miller wrote:
> From: Lee Jones <lee.jones@linaro.org>
> Date: Sat, 3 Nov 2012 23:02:30 +0100
>
> > Instead of issuing (0) statements when !CONFIG_SYSFS which will cause
> > 'warning: ', we'll use inline statements instead. This will effectively
> > do the same thing, but suppress any unnecessary warnings.
> >
> > Cc: Stephen Hemminger <shemminger@vyatta.com>
> > Cc: bridge@lists.linux-foundation.org
> > Cc: netdev@vger.kernel.org
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>
>
> Applied, but please use more informative subject lines.
>
> You should prefix your subject line after [PATCH ...] with
> the name of the subsystem you are touching, a ": " then
> the headline description.
>
> So here you would have used "bridge: " and that's what I added when I
> commited this patch.
Yes, of course I should have done, and usually do.
This was an oversight, sorry about that.
--
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply
* some nodes in a cluster has higher frame value in ifconfig
From: Hiroyuki Yamada @ 2012-11-04 7:37 UTC (permalink / raw)
To: netdev
I am running a cluster consisting of 22 nodes.
(22 nodes under the same 1Gbps switch.)
I noticed some nodes in the cluster has higher "frame" value in
ifconfig like the following.
some nodes (higher frame):
eth0 Link encap:Ethernet HWaddr 90:B1:1C:09:D2:F8
inet addr:192.168.121.20 Bcast:192.168.121.255 Mask:255.255.255.0
inet6 addr: fe80::92b1:1cff:fe09:d2f8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:643150667 errors:0 dropped:790 overruns:0 frame:280072
TX packets:908361364 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:377424658828 (351.5 GiB) TX bytes:864099883266 (804.7 GiB)
Interrupt:170 Memory:d91a0000-d91b0000
other nodes (lower frame):
eth0 Link encap:Ethernet HWaddr 24:B6:FD:F6:DF:34
inet addr:192.168.121.3 Bcast:192.168.121.255 Mask:255.255.255.0
inet6 addr: fe80::26b6:fdff:fef6:df34/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1126524649 errors:0 dropped:118 overruns:0 frame:43775
TX packets:847071691 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:992080311726 (923.9 GiB) TX bytes:385366462299 (358.9 GiB)
Interrupt:170 Memory:d91a0000-d91b0000
What might be wrong with it ?
I also ran ethtool and
"rxbds_empty" value is the same value as frame in ifconfig.
whta is rxbds_empty ?
I have investigated rxbds_empty, but there is almost no information about it.
The weird thing is newly added 6 nodes have that higher value.
Also, I noticed some program runs slower than before we added those 6 nodes.
What the program is doing is that
every node requests huge amount of short messages
to other random nodes in parallel.
Ideally, every node has the some completion time with the program,
but the added 6 nodes run slower than others.
Could anyone give me any advice ?
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox