* Re: [PATCH] 8139cp: re-enable interrupts after tx timeout
From: David Woodhouse @ 2012-11-24 23:27 UTC (permalink / raw)
To: Francois Romieu; +Cc: netdev, jasowang, gilboad, jgarzik
In-Reply-To: <20121124225855.GA17340@electric-eye.fr.zoreil.com>
[-- Attachment #1: Type: text/plain, Size: 379 bytes --]
On Sat, 2012-11-24 at 23:58 +0100, Francois Romieu wrote:
> While you are at it, do you see what would prevent the watchdog
> timer and the rx napi handler to race on two different CPUs
Hm, good point. Is it sufficient just to stick napi_disable() and
napi_enable() in there? And should we try to reset the TX state machine
without stomping on RX at all?
--
dwmw2
[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 6171 bytes --]
^ permalink raw reply
* Re: [PATCH] 8139cp: re-enable interrupts after tx timeout
From: Francois Romieu @ 2012-11-24 22:58 UTC (permalink / raw)
To: David Woodhouse; +Cc: netdev, jasowang, gilboad, jgarzik
In-Reply-To: <1353795081.26346.287.camel@shinybook.infradead.org>
David Woodhouse <dwmw2@infradead.org> :
> Recovery doesn't work too well if we leave interrupts disabled...
>
> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Acked-by: Francois Romieu <romieu@fr.zoreil.com>
While you are at it, do you see what would prevent the watchdog
timer and the rx napi handler to race on two different CPUs
("using a Geode" could be an answer :o) ) ?
> ---
> For stable too, I suppose.
Yes. Watch for http://patchwork.ozlabs.org/bundle/davem/stable/
--
Ueimor
^ permalink raw reply
* [PATCH] 8139cp: re-enable interrupts after tx timeout
From: David Woodhouse @ 2012-11-24 22:11 UTC (permalink / raw)
To: Francois Romieu; +Cc: netdev, jasowang, gilboad, jgarzik
In-Reply-To: <20121124213348.GA8313@electric-eye.fr.zoreil.com>
[-- Attachment #1: Type: text/plain, Size: 735 bytes --]
Recovery doesn't work too well if we leave interrupts disabled...
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
---
For stable too, I suppose.
diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c
index 1c81825..ad6afc3 100644
--- a/drivers/net/ethernet/realtek/8139cp.c
+++ b/drivers/net/ethernet/realtek/8139cp.c
@@ -1192,6 +1192,7 @@ static void cp_tx_timeout(struct net_device *dev)
cp_clean_rings(cp);
rc = cp_init_rings(cp);
cp_start_hw(cp);
+ cp_enable_irq(cp);
netif_wake_queue(dev);
--
David Woodhouse Open Source Technology Centre
David.Woodhouse@intel.com Intel Corporation
[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 6171 bytes --]
^ permalink raw reply related
* Re: 8139cp TX stall, timeout, failed recovery
From: Francois Romieu @ 2012-11-24 21:33 UTC (permalink / raw)
To: David Woodhouse; +Cc: netdev, jasowang, gilboad, jgarzik
In-Reply-To: <1353782365.26346.266.camel@shinybook.infradead.org>
David Woodhouse <dwmw2@infradead.org> :
[...]
> To reproduce this, I send a *large* flood of packets (ping -l 1000) from
> inside my network to the ADSL router. Its internal-facing interface is
> an 8139cp. It seems to work best if the packets are destined for the
> outside world over the ADSL lines, rather than the router itself. But
> it's hard to tell. I need between 10 and 30 runs of 'ping -l 1000
> $outside' before it happens. Or sometimes more...
Did you try pktgen as well ?
[...]
> Looking at it now... do we wrap around the Rx ring buffer at 28498.055
> and process some of the packets more than once? Or is the hardware
> genuinely keeping up with us as we suck out, descriptors 51-63, 0-63,
> and 0-39 again all off the same interrupt? Perhaps there lies the root
> of the problem?
Rx slots are always spaced by ~50 us, i.e. more than needed to get a 98 bytes
packets. I do not like the lack of barrier wrt opts2 and opts1 writes for rx
descriptors but it does nprobably not matter for your problem.
If the r8169 experience is any guide, cp_tx_timeout is too light. It should
imho match the init sequence more closely, especially wrt descriptor rings
addresses and CpCmd.
--
Ueimor
^ permalink raw reply
* Re: 8139cp TX stall, timeout, failed recovery
From: David Woodhouse @ 2012-11-24 21:39 UTC (permalink / raw)
To: netdev; +Cc: romieu, jasowang, gilboad, jgarzik, nathan
In-Reply-To: <1353782365.26346.266.camel@shinybook.infradead.org>
[-- Attachment #1: Type: text/plain, Size: 1672 bytes --]
On Sat, 2012-11-24 at 18:39 +0000, David Woodhouse wrote:
> This seems to be a consistent pattern — when we get that 0x0080
> interrupt and it dies, it's *very* soon after queueing a new tx:
Once I realise that the 'tx queued' message actually prints the number
of the *next* slot that'll be used, not the slot that was just filled,
that becomes obvious. The hardware takes only 30µs or so to consume the
descriptor that was just submitted. It isn't just coincidence that one
packet completes just as the *next* one is being submitted, as I
originally thought.
The hardware seems to asserts the 0x80 'Tx Descriptor Unavailable'
interrupt first, and the other bits (0x404) come later. I *often* get
into cp_tx() with only 0x80 in the IntrStatus bits, and the other bits
are often set before my heavily-debug-laden cp_tx() has even finished
running).
Register 0x82 indicates the low bits of the address of the most recently
consumed Tx descriptor, and always seems to agree with the driver's
processing of the ring. When we get a 0x80 interrupt, the most recently
consumed descriptor is always the one before tx_head, as you'd expect.
And tx_head always looks sane and (as long as you read it quickly) still
has the 'Own' bit set, as it should.
Eventually I get a 0x80 interrupt which *isn't* immediately followed by
the other 0x404 bits. And then the hardware has crapped itself and is no
longer eating descriptors. We submit more to the queue and we bang on
the TxPoll register *every* time, but that doesn't wake it.
Adding a cp_enable_irq() into the cp_tx_timeout() function at least
makes it recover *eventually*.
--
dwmw2
[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 6171 bytes --]
^ permalink raw reply
* Re: [PATCH 1/7] batman-adv: Move soft-interface initialization to ndo_init
From: Sven Eckelmann @ 2012-11-24 21:23 UTC (permalink / raw)
To: David Miller
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r
In-Reply-To: <20121124.155902.1261596975089040930.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 145 bytes --]
On Saturday 24 November 2012 15:59:02 David Miller wrote:
> No pull request?
They didn't apply it yet. (sry for Cc'ing you)
Kind regards,
Sven
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* [PATCH] MAINTAINERS: Add Q: patchwork entries for net/ and drivers/net/
From: Joe Perches @ 2012-11-24 21:18 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Add the netdev patchwork entries for networking drivers.
Change the W: entry to Q:for networking.
Signed-off-by: Joe Perches <joe@perches.com>
---
MAINTAINERS | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index a9c794c..7549075 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5056,7 +5056,7 @@ NETWORKING [GENERAL]
M: "David S. Miller" <davem@davemloft.net>
L: netdev@vger.kernel.org
W: http://www.linuxfoundation.org/en/Net
-W: http://patchwork.ozlabs.org/project/netdev/list/
+Q: http://patchwork.ozlabs.org/project/netdev/list/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
S: Maintained
@@ -5116,6 +5116,7 @@ F: drivers/net/wireless/
NETWORKING DRIVERS
L: netdev@vger.kernel.org
W: http://www.linuxfoundation.org/en/Net
+Q: http://patchwork.ozlabs.org/project/netdev/list/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
S: Odd Fixes
^ permalink raw reply related
* Re: [PATCH 1/7] batman-adv: Move soft-interface initialization to ndo_init
From: David Miller @ 2012-11-24 20:59 UTC (permalink / raw)
To: sven; +Cc: b.a.t.m.a.n, netdev
In-Reply-To: <1353715332-4284-1-git-send-email-sven@narfation.org>
No pull request?
^ permalink raw reply
* Re: BQL support in gianfar causes network hickup
From: Tino Keitel @ 2012-11-24 20:42 UTC (permalink / raw)
To: netdev
In-Reply-To: <50AFA599.9040108@windriver.com>
Paul Gortmaker <paul.gortmaker <at> windriver.com> writes:
>
> On 12-11-23 10:58 AM, Keitel, Tino (ALC NetworX GmbH) wrote:
> > Hi,
> >
> > commit d8a0f1b0af67679bba886784de10d8c21acc4e0e causes the following
> > trace on a Freescale RDB8313 board:
>
> Thanks for the report.
>
> >
> > NETDEV WATCHDOG: eth1 (fsl-gianfar): transmit queue 0 timed out
> > ------------[ cut here ]------------
> > WARNING:
> > at /home/keitelt1/src/git/linux-stable/net/sched/sch_generic.c:255
> > Modules linked in:
> > NIP: c02448b0 LR: c02448b0 CTR: c01c19b8
> > REGS: c7ffbe40 TRAP: 0700 Not tainted (3.7.0-rc6-rt18)
> ^^^^^^^^^^^^^^^
> I almost overlooked the above. It would have been nice to
> see more explicit information on what kernel you are running.
> I say that because the above concerns me. For several reasons.
>
> 1) it looks to be not mainline, but preempt_rt
> 2) There is no RT on 3.7 yet, so I'm assuming this is a custom
> forward port of the 250 odd RT patches. (The RT is 3.6.7-rt18,
> i.e. based on the 3.6 gregKH stable tree.)
Sorry for the confusion. This was a 3.7.0-rc6 tree, and I forgot git clean after
trying the rt-patches and git reset --hard v3.7.0-rc6, so the localversion file
for -rt was still present, and the kernel was named 3.7.0-rc6-rt18. If I got
this right, this should be a normal kernel with just the version file modified.
I tried kernel 3.3, which doesnt have the issue. I tried 3.4, 3.6.7 and 3.7-rc6,
which all show the kernel trace and ptp client misbehaviour. I tried 3.4, 3.6.7,
3.7-rc6 and 3.6.5-rt18 with the patch I posted, and they were ok.
The patch I posted is for 3.7-rc6.
Regards,
Tino
^ permalink raw reply
* 8139cp TX stall, timeout, failed recovery
From: David Woodhouse @ 2012-11-24 18:39 UTC (permalink / raw)
To: netdev; +Cc: romieu, jasowang, gilboad, jgarzik
[-- Attachment #1: Type: text/plain, Size: 33253 bytes --]
When I stress it hard, I see a Tx timeout that it doesn't recover from.
This is 3.6.7, with or without my recent init path patch (and with or
without my BQL patch).
To reproduce this, I send a *large* flood of packets (ping -l 1000) from
inside my network to the ADSL router. Its internal-facing interface is
an 8139cp. It seems to work best if the packets are destined for the
outside world over the ADSL lines, rather than the router itself. But
it's hard to tell. I need between 10 and 30 runs of 'ping -l 1000
$outside' before it happens. Or sometimes more...
Log shows it all running fine, followed by a flood of incoming packets
starting at around 28498.05. At 28498.060901 we queue a new tx, and
*immediately* afterwards (28498.060936) we get an interrupt with status
0x0080 (Tx Descriptor Unavailable, but no Tx Done). That's the last
tx-related interrupt we ever get.
This seems to be a consistent pattern — when we get that 0x0080
interrupt and it dies, it's *very* soon after queueing a new tx:
8139dead2.cap-[27538.841952] 8139cp 0000:00:0b.0: eth1: tx queued, slot 54, skblen 98
8139dead2.cap:[27538.841985] 8139cp 0000:00:0b.0: eth1: intr, status 0080 cmd 0c cpcmd 002b
--
8139dead3a.cap-[28498.060901] 8139cp 0000:00:0b.0: eth1: tx queued, slot 12, skblen 98
8139dead3a.cap:[28498.060936] 8139cp 0000:00:0b.0: eth1: intr, status 0080 cmd 0c cpcmd 002b
--
8139dead4.cap-[30230.248780] 8139cp 0000:00:0b.0: eth1: tx queued, slot 27, skblen 98
8139dead4.cap:[30230.248816] 8139cp 0000:00:0b.0: eth1: intr, status 0080 cmd 0c cpcmd 002b
--
8139dead.cap-[ 228.119159] 8139cp 0000:00:0b.0: eth1: tx queued, slot 63, skblen 98
8139dead.cap:[ 228.119195] 8139cp 0000:00:0b.0: eth1: intr, status 0080 cmd 0c cpcmd 002b
Here's a full log of one of those, showing the failure to recover too...
Looking at it now... do we wrap around the Rx ring buffer at 28498.055
and process some of the packets more than once? Or is the hardware
genuinely keeping up with us as we suck out, descriptors 51-63, 0-63,
and 0-39 again all off the same interrupt? Perhaps there lies the root
of the problem?
[28497.924957] 8139cp 0000:00:0b.0: eth1: rx slot 44 status 0x320141d8 len 468
[28498.032253] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28498.032300] 8139cp 0000:00:0b.0: eth1: rx slot 45 status 0x32022062 len 94
[28498.040770] 8139cp 0000:00:0b.0: eth1: tx queued, slot 7, skblen 110
[28498.040816] 8139cp 0000:00:0b.0: eth1: intr, status 0484 cmd 0c cpcmd 002b
[28498.040836] 8139cp 0000:00:0b.0: eth1: tx done, slot 6
[28498.041048] 8139cp 0000:00:0b.0: eth1: tx queued, slot 8, skblen 1514
[28498.041090] 8139cp 0000:00:0b.0: eth1: intr, status 0484 cmd 0c cpcmd 002b
[28498.041108] 8139cp 0000:00:0b.0: eth1: tx done, slot 7
[28498.041177] 8139cp 0000:00:0b.0: eth1: tx queued, slot 9, skblen 1514
[28498.041218] 8139cp 0000:00:0b.0: eth1: intr, status 0484 cmd 0c cpcmd 002b
[28498.041236] 8139cp 0000:00:0b.0: eth1: tx done, slot 8
[28498.041677] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28498.041709] 8139cp 0000:00:0b.0: eth1: rx slot 46 status 0x3200e04e len 74
[28498.041846] 8139cp 0000:00:0b.0: eth1: tx queued, slot 10, skblen 533
[28498.041882] 8139cp 0000:00:0b.0: eth1: intr, status 0484 cmd 0c cpcmd 002b
[28498.041901] 8139cp 0000:00:0b.0: eth1: tx done, slot 9
[28498.043028] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28498.043056] 8139cp 0000:00:0b.0: eth1: rx slot 47 status 0x3200e04e len 74
[28498.043264] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28498.043291] 8139cp 0000:00:0b.0: eth1: rx slot 48 status 0x3200e04e len 74
[28498.043456] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28498.043483] 8139cp 0000:00:0b.0: eth1: rx slot 49 status 0x3200e04e len 74
[28498.043905] 8139cp 0000:00:0b.0: eth1: tx queued, slot 11, skblen 245
[28498.043941] 8139cp 0000:00:0b.0: eth1: intr, status 0484 cmd 0c cpcmd 002b
[28498.043960] 8139cp 0000:00:0b.0: eth1: tx done, slot 10
[28498.051129] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28498.051165] 8139cp 0000:00:0b.0: eth1: rx slot 50 status 0x32036066 len 98
[28498.051333] 8139cp 0000:00:0b.0: eth1: rx slot 51 status 0x32036066 len 98
[28498.051394] 8139cp 0000:00:0b.0: eth1: rx slot 52 status 0x32036066 len 98
[28498.051451] 8139cp 0000:00:0b.0: eth1: rx slot 53 status 0x32036066 len 98
[28498.051523] 8139cp 0000:00:0b.0: eth1: rx slot 54 status 0x32036066 len 98
[28498.051575] 8139cp 0000:00:0b.0: eth1: rx slot 55 status 0x32036066 len 98
[28498.051623] 8139cp 0000:00:0b.0: eth1: rx slot 56 status 0x32036066 len 98
[28498.051672] 8139cp 0000:00:0b.0: eth1: rx slot 57 status 0x32036066 len 98
[28498.051720] 8139cp 0000:00:0b.0: eth1: rx slot 58 status 0x32036066 len 98
[28498.051771] 8139cp 0000:00:0b.0: eth1: rx slot 59 status 0x32036066 len 98
[28498.051821] 8139cp 0000:00:0b.0: eth1: rx slot 60 status 0x32036066 len 98
[28498.051871] 8139cp 0000:00:0b.0: eth1: rx slot 61 status 0x32036066 len 98
[28498.051962] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28498.051989] 8139cp 0000:00:0b.0: eth1: rx slot 62 status 0x32036066 len 98
[28498.052041] 8139cp 0000:00:0b.0: eth1: rx slot 63 status 0x72036066 len 98
[28498.052089] 8139cp 0000:00:0b.0: eth1: rx slot 0 status 0x32036066 len 98
[28498.052139] 8139cp 0000:00:0b.0: eth1: rx slot 1 status 0x32036066 len 98
[28498.052189] 8139cp 0000:00:0b.0: eth1: rx slot 2 status 0x32036066 len 98
[28498.052238] 8139cp 0000:00:0b.0: eth1: rx slot 3 status 0x32036066 len 98
[28498.052287] 8139cp 0000:00:0b.0: eth1: rx slot 4 status 0x32036066 len 98
[28498.052370] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28498.052396] 8139cp 0000:00:0b.0: eth1: rx slot 5 status 0x32036066 len 98
[28498.052446] 8139cp 0000:00:0b.0: eth1: rx slot 6 status 0x32036066 len 98
[28498.052496] 8139cp 0000:00:0b.0: eth1: rx slot 7 status 0x32036066 len 98
[28498.052562] 8139cp 0000:00:0b.0: eth1: rx slot 8 status 0x32036066 len 98
[28498.052612] 8139cp 0000:00:0b.0: eth1: rx slot 9 status 0x32036066 len 98
[28498.052661] 8139cp 0000:00:0b.0: eth1: rx slot 10 status 0x32036066 len 98
[28498.052711] 8139cp 0000:00:0b.0: eth1: rx slot 11 status 0x32036066 len 98
[28498.052760] 8139cp 0000:00:0b.0: eth1: rx slot 12 status 0x32036066 len 98
[28498.052810] 8139cp 0000:00:0b.0: eth1: rx slot 13 status 0x32036066 len 98
[28498.052860] 8139cp 0000:00:0b.0: eth1: rx slot 14 status 0x32036066 len 98
[28498.052975] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28498.053001] 8139cp 0000:00:0b.0: eth1: rx slot 15 status 0x32036066 len 98
[28498.053053] 8139cp 0000:00:0b.0: eth1: rx slot 16 status 0x32036066 len 98
[28498.053103] 8139cp 0000:00:0b.0: eth1: rx slot 17 status 0x32036066 len 98
[28498.053151] 8139cp 0000:00:0b.0: eth1: rx slot 18 status 0x32036066 len 98
[28498.053201] 8139cp 0000:00:0b.0: eth1: rx slot 19 status 0x32036066 len 98
[28498.053249] 8139cp 0000:00:0b.0: eth1: rx slot 20 status 0x32036066 len 98
[28498.053299] 8139cp 0000:00:0b.0: eth1: rx slot 21 status 0x32036066 len 98
[28498.053348] 8139cp 0000:00:0b.0: eth1: rx slot 22 status 0x32036066 len 98
[28498.053397] 8139cp 0000:00:0b.0: eth1: rx slot 23 status 0x32036066 len 98
[28498.053446] 8139cp 0000:00:0b.0: eth1: rx slot 24 status 0x32036066 len 98
[28498.053495] 8139cp 0000:00:0b.0: eth1: rx slot 25 status 0x32036066 len 98
[28498.053561] 8139cp 0000:00:0b.0: eth1: rx slot 26 status 0x32036066 len 98
[28498.053611] 8139cp 0000:00:0b.0: eth1: rx slot 27 status 0x32036066 len 98
[28498.053661] 8139cp 0000:00:0b.0: eth1: rx slot 28 status 0x32036066 len 98
[28498.053711] 8139cp 0000:00:0b.0: eth1: rx slot 29 status 0x32036066 len 98
[28498.053760] 8139cp 0000:00:0b.0: eth1: rx slot 30 status 0x32036066 len 98
[28498.053810] 8139cp 0000:00:0b.0: eth1: rx slot 31 status 0x32036066 len 98
[28498.053860] 8139cp 0000:00:0b.0: eth1: rx slot 32 status 0x32036066 len 98
[28498.053947] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28498.053973] 8139cp 0000:00:0b.0: eth1: rx slot 33 status 0x32036066 len 98
[28498.054025] 8139cp 0000:00:0b.0: eth1: rx slot 34 status 0x32036066 len 98
[28498.054074] 8139cp 0000:00:0b.0: eth1: rx slot 35 status 0x32036066 len 98
[28498.054123] 8139cp 0000:00:0b.0: eth1: rx slot 36 status 0x32036066 len 98
[28498.054173] 8139cp 0000:00:0b.0: eth1: rx slot 37 status 0x32036066 len 98
[28498.054222] 8139cp 0000:00:0b.0: eth1: rx slot 38 status 0x32036066 len 98
[28498.054272] 8139cp 0000:00:0b.0: eth1: rx slot 39 status 0x32036066 len 98
[28498.054320] 8139cp 0000:00:0b.0: eth1: rx slot 40 status 0x32036066 len 98
[28498.054405] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28498.054432] 8139cp 0000:00:0b.0: eth1: rx slot 41 status 0x32036066 len 98
[28498.054482] 8139cp 0000:00:0b.0: eth1: rx slot 42 status 0x32036066 len 98
[28498.054548] 8139cp 0000:00:0b.0: eth1: rx slot 43 status 0x32036066 len 98
[28498.054597] 8139cp 0000:00:0b.0: eth1: rx slot 44 status 0x32036066 len 98
[28498.054648] 8139cp 0000:00:0b.0: eth1: rx slot 45 status 0x32036066 len 98
[28498.054697] 8139cp 0000:00:0b.0: eth1: rx slot 46 status 0x32036066 len 98
[28498.054747] 8139cp 0000:00:0b.0: eth1: rx slot 47 status 0x32036066 len 98
[28498.054796] 8139cp 0000:00:0b.0: eth1: rx slot 48 status 0x32036066 len 98
[28498.054846] 8139cp 0000:00:0b.0: eth1: rx slot 49 status 0x32036066 len 98
[28498.054895] 8139cp 0000:00:0b.0: eth1: rx slot 50 status 0x32036066 len 98
[28498.055030] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28498.055057] 8139cp 0000:00:0b.0: eth1: rx slot 51 status 0x32036066 len 98
[28498.055109] 8139cp 0000:00:0b.0: eth1: rx slot 52 status 0x32036066 len 98
[28498.055158] 8139cp 0000:00:0b.0: eth1: rx slot 53 status 0x32036066 len 98
[28498.055206] 8139cp 0000:00:0b.0: eth1: rx slot 54 status 0x32036066 len 98
[28498.055256] 8139cp 0000:00:0b.0: eth1: rx slot 55 status 0x32036066 len 98
[28498.055305] 8139cp 0000:00:0b.0: eth1: rx slot 56 status 0x32036066 len 98
[28498.055355] 8139cp 0000:00:0b.0: eth1: rx slot 57 status 0x32036066 len 98
[28498.055403] 8139cp 0000:00:0b.0: eth1: rx slot 58 status 0x32036066 len 98
[28498.055453] 8139cp 0000:00:0b.0: eth1: rx slot 59 status 0x32036066 len 98
[28498.055519] 8139cp 0000:00:0b.0: eth1: rx slot 60 status 0x32036066 len 98
[28498.055568] 8139cp 0000:00:0b.0: eth1: rx slot 61 status 0x32036066 len 98
[28498.055617] 8139cp 0000:00:0b.0: eth1: rx slot 62 status 0x32036066 len 98
[28498.055666] 8139cp 0000:00:0b.0: eth1: rx slot 63 status 0x72036066 len 98
[28498.055715] 8139cp 0000:00:0b.0: eth1: rx slot 0 status 0x32036066 len 98
[28498.055763] 8139cp 0000:00:0b.0: eth1: rx slot 1 status 0x32036066 len 98
[28498.055812] 8139cp 0000:00:0b.0: eth1: rx slot 2 status 0x32036066 len 98
[28498.055861] 8139cp 0000:00:0b.0: eth1: rx slot 3 status 0x32036066 len 98
[28498.055910] 8139cp 0000:00:0b.0: eth1: rx slot 4 status 0x32036066 len 98
[28498.055958] 8139cp 0000:00:0b.0: eth1: rx slot 5 status 0x32036066 len 98
[28498.056007] 8139cp 0000:00:0b.0: eth1: rx slot 6 status 0x32036066 len 98
[28498.056056] 8139cp 0000:00:0b.0: eth1: rx slot 7 status 0x32036066 len 98
[28498.056105] 8139cp 0000:00:0b.0: eth1: rx slot 8 status 0x32036066 len 98
[28498.056154] 8139cp 0000:00:0b.0: eth1: rx slot 9 status 0x32036066 len 98
[28498.056202] 8139cp 0000:00:0b.0: eth1: rx slot 10 status 0x32036066 len 98
[28498.056251] 8139cp 0000:00:0b.0: eth1: rx slot 11 status 0x32036066 len 98
[28498.056300] 8139cp 0000:00:0b.0: eth1: rx slot 12 status 0x32036066 len 98
[28498.056349] 8139cp 0000:00:0b.0: eth1: rx slot 13 status 0x32036066 len 98
[28498.056398] 8139cp 0000:00:0b.0: eth1: rx slot 14 status 0x32036066 len 98
[28498.056447] 8139cp 0000:00:0b.0: eth1: rx slot 15 status 0x32036066 len 98
[28498.056495] 8139cp 0000:00:0b.0: eth1: rx slot 16 status 0x32036066 len 98
[28498.056544] 8139cp 0000:00:0b.0: eth1: rx slot 17 status 0x32036066 len 98
[28498.056593] 8139cp 0000:00:0b.0: eth1: rx slot 18 status 0x32036066 len 98
[28498.056678] 8139cp 0000:00:0b.0: eth1: rx slot 19 status 0x32036066 len 98
[28498.056728] 8139cp 0000:00:0b.0: eth1: rx slot 20 status 0x32036066 len 98
[28498.056777] 8139cp 0000:00:0b.0: eth1: rx slot 21 status 0x32036066 len 98
[28498.056826] 8139cp 0000:00:0b.0: eth1: rx slot 22 status 0x32036066 len 98
[28498.056875] 8139cp 0000:00:0b.0: eth1: rx slot 23 status 0x32036066 len 98
[28498.056923] 8139cp 0000:00:0b.0: eth1: rx slot 24 status 0x32036066 len 98
[28498.056972] 8139cp 0000:00:0b.0: eth1: rx slot 25 status 0x32036066 len 98
[28498.057020] 8139cp 0000:00:0b.0: eth1: rx slot 26 status 0x32036066 len 98
[28498.057069] 8139cp 0000:00:0b.0: eth1: rx slot 27 status 0x32036066 len 98
[28498.057117] 8139cp 0000:00:0b.0: eth1: rx slot 28 status 0x32036066 len 98
[28498.057166] 8139cp 0000:00:0b.0: eth1: rx slot 29 status 0x32036066 len 98
[28498.057214] 8139cp 0000:00:0b.0: eth1: rx slot 30 status 0x32036066 len 98
[28498.057263] 8139cp 0000:00:0b.0: eth1: rx slot 31 status 0x32036066 len 98
[28498.057312] 8139cp 0000:00:0b.0: eth1: rx slot 32 status 0x32036066 len 98
[28498.057362] 8139cp 0000:00:0b.0: eth1: rx slot 33 status 0x32036066 len 98
[28498.057410] 8139cp 0000:00:0b.0: eth1: rx slot 34 status 0x32036066 len 98
[28498.057459] 8139cp 0000:00:0b.0: eth1: rx slot 35 status 0x32036066 len 98
[28498.057508] 8139cp 0000:00:0b.0: eth1: rx slot 36 status 0x32036066 len 98
[28498.057557] 8139cp 0000:00:0b.0: eth1: rx slot 37 status 0x32036066 len 98
[28498.057606] 8139cp 0000:00:0b.0: eth1: rx slot 38 status 0x32036066 len 98
[28498.057654] 8139cp 0000:00:0b.0: eth1: rx slot 39 status 0x32036066 len 98
[28498.057703] 8139cp 0000:00:0b.0: eth1: rx slot 40 status 0x32036066 len 98
[28498.057752] 8139cp 0000:00:0b.0: eth1: rx slot 41 status 0x32036066 len 98
[28498.057800] 8139cp 0000:00:0b.0: eth1: rx slot 42 status 0x32036066 len 98
[28498.057848] 8139cp 0000:00:0b.0: eth1: rx slot 43 status 0x32036066 len 98
[28498.057897] 8139cp 0000:00:0b.0: eth1: rx slot 44 status 0x32036066 len 98
[28498.057946] 8139cp 0000:00:0b.0: eth1: rx slot 45 status 0x32036066 len 98
[28498.057994] 8139cp 0000:00:0b.0: eth1: rx slot 46 status 0x32036066 len 98
[28498.058043] 8139cp 0000:00:0b.0: eth1: rx slot 47 status 0x32036066 len 98
[28498.058091] 8139cp 0000:00:0b.0: eth1: rx slot 48 status 0x32036066 len 98
[28498.058141] 8139cp 0000:00:0b.0: eth1: rx slot 49 status 0x32036066 len 98
[28498.058190] 8139cp 0000:00:0b.0: eth1: rx slot 50 status 0x32036066 len 98
[28498.058238] 8139cp 0000:00:0b.0: eth1: rx slot 51 status 0x32036066 len 98
[28498.058287] 8139cp 0000:00:0b.0: eth1: rx slot 52 status 0x32036066 len 98
[28498.058337] 8139cp 0000:00:0b.0: eth1: rx slot 53 status 0x32036066 len 98
[28498.058385] 8139cp 0000:00:0b.0: eth1: rx slot 54 status 0x32036066 len 98
[28498.058434] 8139cp 0000:00:0b.0: eth1: rx slot 55 status 0x32036066 len 98
[28498.058482] 8139cp 0000:00:0b.0: eth1: rx slot 56 status 0x32036066 len 98
[28498.058531] 8139cp 0000:00:0b.0: eth1: rx slot 57 status 0x32036066 len 98
[28498.058579] 8139cp 0000:00:0b.0: eth1: rx slot 58 status 0x32036066 len 98
[28498.058629] 8139cp 0000:00:0b.0: eth1: rx slot 59 status 0x32036066 len 98
[28498.058678] 8139cp 0000:00:0b.0: eth1: rx slot 60 status 0x32036066 len 98
[28498.058727] 8139cp 0000:00:0b.0: eth1: rx slot 61 status 0x32036066 len 98
[28498.058775] 8139cp 0000:00:0b.0: eth1: rx slot 62 status 0x32036066 len 98
[28498.058824] 8139cp 0000:00:0b.0: eth1: rx slot 63 status 0x72036066 len 98
[28498.058872] 8139cp 0000:00:0b.0: eth1: rx slot 0 status 0x32036066 len 98
[28498.058921] 8139cp 0000:00:0b.0: eth1: rx slot 1 status 0x32036066 len 98
[28498.058969] 8139cp 0000:00:0b.0: eth1: rx slot 2 status 0x32036066 len 98
[28498.059018] 8139cp 0000:00:0b.0: eth1: rx slot 3 status 0x32036066 len 98
[28498.059066] 8139cp 0000:00:0b.0: eth1: rx slot 4 status 0x32036066 len 98
[28498.059115] 8139cp 0000:00:0b.0: eth1: rx slot 5 status 0x32036066 len 98
[28498.059164] 8139cp 0000:00:0b.0: eth1: rx slot 6 status 0x32036066 len 98
[28498.059212] 8139cp 0000:00:0b.0: eth1: rx slot 7 status 0x32036066 len 98
[28498.059261] 8139cp 0000:00:0b.0: eth1: rx slot 8 status 0x32036066 len 98
[28498.059309] 8139cp 0000:00:0b.0: eth1: rx slot 9 status 0x32036066 len 98
[28498.059358] 8139cp 0000:00:0b.0: eth1: rx slot 10 status 0x32036066 len 98
[28498.059407] 8139cp 0000:00:0b.0: eth1: rx slot 11 status 0x32036066 len 98
[28498.059455] 8139cp 0000:00:0b.0: eth1: rx slot 12 status 0x32036066 len 98
[28498.059504] 8139cp 0000:00:0b.0: eth1: rx slot 13 status 0x32036066 len 98
[28498.059553] 8139cp 0000:00:0b.0: eth1: rx slot 14 status 0x32036066 len 98
[28498.059602] 8139cp 0000:00:0b.0: eth1: rx slot 15 status 0x32036066 len 98
[28498.059651] 8139cp 0000:00:0b.0: eth1: rx slot 16 status 0x32036066 len 98
[28498.059700] 8139cp 0000:00:0b.0: eth1: rx slot 17 status 0x32036066 len 98
[28498.059748] 8139cp 0000:00:0b.0: eth1: rx slot 18 status 0x32036066 len 98
[28498.059814] 8139cp 0000:00:0b.0: eth1: rx slot 19 status 0x32036066 len 98
[28498.059863] 8139cp 0000:00:0b.0: eth1: rx slot 20 status 0x32036066 len 98
[28498.059913] 8139cp 0000:00:0b.0: eth1: rx slot 21 status 0x32036066 len 98
[28498.059961] 8139cp 0000:00:0b.0: eth1: rx slot 22 status 0x32036066 len 98
[28498.060011] 8139cp 0000:00:0b.0: eth1: rx slot 23 status 0x32036066 len 98
[28498.060059] 8139cp 0000:00:0b.0: eth1: rx slot 24 status 0x32036066 len 98
[28498.060108] 8139cp 0000:00:0b.0: eth1: rx slot 25 status 0x32036066 len 98
[28498.060156] 8139cp 0000:00:0b.0: eth1: rx slot 26 status 0x32036066 len 98
[28498.060205] 8139cp 0000:00:0b.0: eth1: rx slot 27 status 0x32036066 len 98
[28498.060253] 8139cp 0000:00:0b.0: eth1: rx slot 28 status 0x32036066 len 98
[28498.060302] 8139cp 0000:00:0b.0: eth1: rx slot 29 status 0x32036066 len 98
[28498.060350] 8139cp 0000:00:0b.0: eth1: rx slot 30 status 0x32036066 len 98
[28498.060399] 8139cp 0000:00:0b.0: eth1: rx slot 31 status 0x32036066 len 98
[28498.060447] 8139cp 0000:00:0b.0: eth1: rx slot 32 status 0x32036066 len 98
[28498.060496] 8139cp 0000:00:0b.0: eth1: rx slot 33 status 0x32036066 len 98
[28498.060544] 8139cp 0000:00:0b.0: eth1: rx slot 34 status 0x32036066 len 98
[28498.060594] 8139cp 0000:00:0b.0: eth1: rx slot 35 status 0x32036066 len 98
[28498.060642] 8139cp 0000:00:0b.0: eth1: rx slot 36 status 0x32036066 len 98
[28498.060691] 8139cp 0000:00:0b.0: eth1: rx slot 37 status 0x32036066 len 98
[28498.060740] 8139cp 0000:00:0b.0: eth1: rx slot 38 status 0x32036066 len 98
[28498.060789] 8139cp 0000:00:0b.0: eth1: rx slot 39 status 0x32036066 len 98
[28498.060901] 8139cp 0000:00:0b.0: eth1: tx queued, slot 12, skblen 98
[28498.060936] 8139cp 0000:00:0b.0: eth1: intr, status 0080 cmd 0c cpcmd 002b
[28498.061814] 8139cp 0000:00:0b.0: eth1: tx queued, slot 13, skblen 98
[28498.064007] 8139cp 0000:00:0b.0: eth1: tx queued, slot 14, skblen 98
[28498.065750] 8139cp 0000:00:0b.0: eth1: tx queued, slot 15, skblen 98
[28498.067472] 8139cp 0000:00:0b.0: eth1: tx queued, slot 16, skblen 98
[28498.068062] 8139cp 0000:00:0b.0: eth1: tx queued, slot 17, skblen 79
[28498.068221] 8139cp 0000:00:0b.0: eth1: tx queued, slot 18, skblen 74
[28498.070711] 8139cp 0000:00:0b.0: eth1: tx queued, slot 19, skblen 98
[28498.072137] 8139cp 0000:00:0b.0: eth1: tx queued, slot 20, skblen 98
[28498.074369] 8139cp 0000:00:0b.0: eth1: tx queued, slot 21, skblen 98
[28498.075829] 8139cp 0000:00:0b.0: eth1: tx queued, slot 22, skblen 98
[28498.078074] 8139cp 0000:00:0b.0: eth1: tx queued, slot 23, skblen 98
[28498.079772] 8139cp 0000:00:0b.0: eth1: tx queued, slot 24, skblen 98
[28498.082254] 8139cp 0000:00:0b.0: eth1: tx queued, slot 25, skblen 98
[28498.120915] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28498.120946] 8139cp 0000:00:0b.0: eth1: rx slot 40 status 0x3201404e len 74
[28498.140144] 8139cp 0000:00:0b.0: eth1: tx queued, slot 26, skblen 74
[28498.182530] 8139cp 0000:00:0b.0: eth1: tx queued, slot 27, skblen 66
[28498.276742] 8139cp 0000:00:0b.0: eth1: tx queued, slot 28, skblen 79
[28498.421426] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28498.421454] 8139cp 0000:00:0b.0: eth1: rx slot 41 status 0x320141d8 len 468
[28498.485291] 8139cp 0000:00:0b.0: eth1: tx queued, slot 29, skblen 74
[28498.578432] 8139cp 0000:00:0b.0: eth1: tx queued, slot 30, skblen 66
[28498.646429] 8139cp 0000:00:0b.0: eth1: tx queued, slot 31, skblen 118
[28498.649979] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28498.650008] 8139cp 0000:00:0b.0: eth1: rx slot 42 status 0x32036094 len 144
[28498.650098] 8139cp 0000:00:0b.0: eth1: rx slot 43 status 0x32036096 len 146
[28498.650165] 8139cp 0000:00:0b.0: eth1: rx slot 44 status 0x32036094 len 144
[28498.696744] 8139cp 0000:00:0b.0: eth1: tx queued, slot 32, skblen 79
[28498.804309] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28498.804338] 8139cp 0000:00:0b.0: eth1: rx slot 45 status 0x320140a0 len 156
[28498.885404] 8139cp 0000:00:0b.0: eth1: tx queued, slot 33, skblen 125
[28499.086435] 8139cp 0000:00:0b.0: eth1: tx queued, slot 34, skblen 74
[28499.098211] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28499.098239] 8139cp 0000:00:0b.0: eth1: rx slot 46 status 0x32014046 len 66
[28499.108839] 8139cp 0000:00:0b.0: eth1: tx queued, slot 35, skblen 66
[28499.121567] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28499.121596] 8139cp 0000:00:0b.0: eth1: rx slot 47 status 0x3201404e len 74
[28499.121992] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28499.122018] 8139cp 0000:00:0b.0: eth1: rx slot 48 status 0x3200e0a0 len 156
[28499.139903] 8139cp 0000:00:0b.0: eth1: tx queued, slot 36, skblen 74
[28499.401749] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28499.401777] 8139cp 0000:00:0b.0: eth1: rx slot 49 status 0x320141d8 len 468
[28499.558938] 8139cp 0000:00:0b.0: eth1: tx queued, slot 37, skblen 66
[28499.775920] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28499.775948] 8139cp 0000:00:0b.0: eth1: rx slot 50 status 0x3203605e len 90
[28499.888841] 8139cp 0000:00:0b.0: eth1: tx queued, slot 38, skblen 116
[28500.286470] 8139cp 0000:00:0b.0: eth1: tx queued, slot 39, skblen 74
[28500.353205] 8139cp 0000:00:0b.0: eth1: tx queued, slot 40, skblen 66
[28501.125519] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28501.125553] 8139cp 0000:00:0b.0: eth1: rx slot 51 status 0x3201404e len 74
[28501.143803] 8139cp 0000:00:0b.0: eth1: tx queued, slot 41, skblen 74
[28501.373644] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28501.373673] 8139cp 0000:00:0b.0: eth1: rx slot 52 status 0x320141d8 len 468
[28501.530366] 8139cp 0000:00:0b.0: eth1: tx queued, slot 42, skblen 66
[28501.648615] 8139cp 0000:00:0b.0: eth1: tx queued, slot 43, skblen 112
[28501.888561] 8139cp 0000:00:0b.0: eth1: tx queued, slot 44, skblen 121
[28502.094862] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28502.094891] 8139cp 0000:00:0b.0: eth1: rx slot 53 status 0x32014046 len 66
[28502.105856] 8139cp 0000:00:0b.0: eth1: tx queued, slot 45, skblen 66
[28502.113535] 8139cp 0000:00:0b.0: eth1: tx queued, slot 46, skblen 94
[28502.221163] 8139cp 0000:00:0b.0: eth1: tx queued, slot 47, skblen 58
[28502.507301] SysRq : Changing Loglevel
[28502.511000] Loglevel set to 9
[28502.690951] 8139cp 0000:00:0b.0: eth1: tx queued, slot 48, skblen 74
[28502.725709] 8139cp 0000:00:0b.0: eth1: tx queued, slot 49, skblen 62
[28502.891993] 8139cp 0000:00:0b.0: eth1: tx queued, slot 50, skblen 116
[28502.997597] 8139cp 0000:00:0b.0: eth1: tx queued, slot 51, skblen 102
[28504.652076] 8139cp 0000:00:0b.0: eth1: tx queued, slot 52, skblen 118
[28504.886623] 8139cp 0000:00:0b.0: eth1: tx queued, slot 53, skblen 147
[28504.894552] 8139cp 0000:00:0b.0: eth1: tx queued, slot 54, skblen 123
[28505.133020] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28505.140825] 8139cp 0000:00:0b.0: eth1: rx slot 54 status 0x3201404e len 74
[28505.149255] 8139cp 0000:00:0b.0: eth1: tx queued, slot 55, skblen 147
[28505.167408] 8139cp 0000:00:0b.0: eth1: tx queued, slot 56, skblen 74
[28505.317183] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28505.325489] 8139cp 0000:00:0b.0: eth1: rx slot 55 status 0x320141d8 len 468
[28508.094647] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28508.101681] 8139cp 0000:00:0b.0: eth1: rx slot 56 status 0x32014046 len 66
[28508.913790] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28508.921135] 8139cp 0000:00:0b.0: eth1: rx slot 57 status 0x32022040 len 60
[28510.009002] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28510.016533] 8139cp 0000:00:0b.0: eth1: rx slot 58 status 0x3201406b len 103
[28510.239735] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28510.246717] 8139cp 0000:00:0b.0: eth1: rx slot 59 status 0x3201406b len 103
[28510.702856] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28510.709886] 8139cp 0000:00:0b.0: eth1: rx slot 60 status 0x3201406b len 103
[28511.098502] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28511.105396] 8139cp 0000:00:0b.0: eth1: rx slot 61 status 0x3202205d len 89
[28511.629295] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28511.636190] 8139cp 0000:00:0b.0: eth1: rx slot 62 status 0x3201406b len 103
[28511.898925] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28511.905833] 8139cp 0000:00:0b.0: eth1: rx slot 63 status 0x7202205d len 89
[28512.011147] 8139cp 0000:00:0b.0: eth1: intr, status 0001 cmd 0c cpcmd 002b
[28512.018063] 8139cp 0000:00:0b.0: eth1: rx slot 0 status 0x3202206b len 103
[28513.017313] 8139cp 0000:00:0b.0: eth1: Transmit timeout, status c 2b 0 80ff
[28513.025121] 8139cp 0000:00:0b.0: eth1: tx queued, slot 1, skblen 66
[28513.031420] 8139cp 0000:00:0b.0: eth1: tx queued, slot 2, skblen 111
[28513.037801] 8139cp 0000:00:0b.0: eth1: tx queued, slot 3, skblen 116
[28513.044164] 8139cp 0000:00:0b.0: eth1: tx queued, slot 4, skblen 109
[28513.050549] 8139cp 0000:00:0b.0: eth1: tx queued, slot 5, skblen 118
[28513.056912] 8139cp 0000:00:0b.0: eth1: tx queued, slot 6, skblen 111
[28513.063300] 8139cp 0000:00:0b.0: eth1: tx queued, slot 7, skblen 114
[28513.069685] 8139cp 0000:00:0b.0: eth1: tx queued, slot 8, skblen 125
[28513.076049] 8139cp 0000:00:0b.0: eth1: tx queued, slot 9, skblen 147
[28513.082426] 8139cp 0000:00:0b.0: eth1: tx queued, slot 10, skblen 66
[28513.088804] 8139cp 0000:00:0b.0: eth1: tx queued, slot 11, skblen 147
[28513.095254] 8139cp 0000:00:0b.0: eth1: tx queued, slot 12, skblen 74
[28513.101631] 8139cp 0000:00:0b.0: eth1: tx queued, slot 13, skblen 66
[28513.108009] 8139cp 0000:00:0b.0: eth1: tx queued, slot 14, skblen 147
[28513.114461] 8139cp 0000:00:0b.0: eth1: tx queued, slot 15, skblen 66
[28513.120846] 8139cp 0000:00:0b.0: eth1: tx queued, slot 16, skblen 66
[28513.127210] 8139cp 0000:00:0b.0: eth1: tx queued, slot 17, skblen 94
[28513.133595] 8139cp 0000:00:0b.0: eth1: tx queued, slot 18, skblen 66
[28513.139973] 8139cp 0000:00:0b.0: eth1: tx queued, slot 19, skblen 108
[28513.146425] 8139cp 0000:00:0b.0: eth1: tx queued, slot 20, skblen 110
[28513.152897] 8139cp 0000:00:0b.0: eth1: tx queued, slot 21, skblen 62
[28513.159273] 8139cp 0000:00:0b.0: eth1: tx queued, slot 22, skblen 66
[28513.165639] 8139cp 0000:00:0b.0: eth1: tx queued, slot 23, skblen 110
[28513.172111] 8139cp 0000:00:0b.0: eth1: tx queued, slot 24, skblen 147
[28513.178575] 8139cp 0000:00:0b.0: eth1: tx queued, slot 25, skblen 135
[28513.185027] 8139cp 0000:00:0b.0: eth1: tx queued, slot 26, skblen 70
[28513.191411] 8139cp 0000:00:0b.0: eth1: tx queued, slot 27, skblen 70
[28513.661282] 8139cp 0000:00:0b.0: eth1: tx queued, slot 28, skblen 110
[28513.902182] 8139cp 0000:00:0b.0: eth1: tx queued, slot 29, skblen 114
[28514.152998] 8139cp 0000:00:0b.0: eth1: tx queued, slot 30, skblen 62
[28514.904881] 8139cp 0000:00:0b.0: eth1: tx queued, slot 31, skblen 109
[28515.996046] 8139cp 0000:00:0b.0: eth1: tx queued, slot 32, skblen 70
[28516.664680] 8139cp 0000:00:0b.0: eth1: tx queued, slot 33, skblen 125
[28516.904608] 8139cp 0000:00:0b.0: eth1: tx queued, slot 34, skblen 126
[28517.916878] 8139cp 0000:00:0b.0: eth1: tx queued, slot 35, skblen 115
[28518.352300] 8139cp 0000:00:0b.0: eth1: tx queued, slot 36, skblen 66
[28519.028318] 8139cp 0000:00:0b.0: eth1: tx queued, slot 37, skblen 102
[28519.339446] 8139cp 0000:00:0b.0: eth1: tx queued, slot 38, skblen 141
[28519.668103] 8139cp 0000:00:0b.0: eth1: tx queued, slot 39, skblen 112
[28519.756759] 8139cp 0000:00:0b.0: eth1: tx queued, slot 40, skblen 141
[28519.907770] 8139cp 0000:00:0b.0: eth1: tx queued, slot 41, skblen 109
[28520.188635] 8139cp 0000:00:0b.0: eth1: tx queued, slot 42, skblen 62
[28520.596861] 8139cp 0000:00:0b.0: eth1: tx queued, slot 43, skblen 141
[28520.635544] 8139cp 0000:00:0b.0: eth1: tx queued, slot 44, skblen 147
[28520.911469] 8139cp 0000:00:0b.0: eth1: tx queued, slot 45, skblen 125
[28531.018105] 8139cp 0000:00:0b.0: eth1: Transmit timeout, status c 2b 485 0
[28531.025915] 8139cp 0000:00:0b.0: eth1: tx queued, slot 1, skblen 141
[28531.032305] 8139cp 0000:00:0b.0: eth1: tx queued, slot 2, skblen 117
[28531.038685] 8139cp 0000:00:0b.0: eth1: tx queued, slot 3, skblen 115
[28531.045049] 8139cp 0000:00:0b.0: eth1: tx queued, slot 4, skblen 117
[28531.051433] 8139cp 0000:00:0b.0: eth1: tx queued, slot 5, skblen 126
[28531.057797] 8139cp 0000:00:0b.0: eth1: tx queued, slot 6, skblen 112
[28531.064184] 8139cp 0000:00:0b.0: eth1: tx queued, slot 7, skblen 121
[28531.070559] 8139cp 0000:00:0b.0: eth1: tx queued, slot 8, skblen 118
[28531.076925] 8139cp 0000:00:0b.0: eth1: tx queued, slot 9, skblen 118
[28531.083310] 8139cp 0000:00:0b.0: eth1: tx queued, slot 10, skblen 115
[28531.089779] 8139cp 0000:00:0b.0: eth1: tx queued, slot 11, skblen 79
[28531.096148] 8139cp 0000:00:0b.0: eth1: tx queued, slot 12, skblen 141
[28531.102613] 8139cp 0000:00:0b.0: eth1: tx queued, slot 13, skblen 94
[28531.108990] 8139cp 0000:00:0b.0: eth1: tx queued, slot 14, skblen 42
[28531.115354] 8139cp 0000:00:0b.0: eth1: tx queued, slot 15, skblen 42
[28531.121738] 8139cp 0000:00:0b.0: eth1: tx queued, slot 16, skblen 42
[28531.128116] 8139cp 0000:00:0b.0: eth1: tx queued, slot 17, skblen 42
[28531.858156] 8139cp 0000:00:0b.0: eth1: tx queued, slot 18, skblen 42
[28532.256232] 8139cp 0000:00:0b.0: eth1: tx queued, slot 19, skblen 141
[28532.858193] 8139cp 0000:00:0b.0: eth1: tx queued, slot 20, skblen 42
[28533.862354] 8139cp 0000:00:0b.0: eth1: tx queued, slot 21, skblen 42
[28534.858290] 8139cp 0000:00:0b.0: eth1: tx queued, slot 22, skblen 42
[28535.858336] 8139cp 0000:00:0b.0: eth1: tx queued, slot 23, skblen 42
[28536.634367] 8139cp 0000:00:0b.0: eth1: tx queued, slot 24, skblen 147
[28537.684826] 8139cp 0000:00:0b.0: eth1: tx queued, slot 25, skblen 42
[28538.678444] 8139cp 0000:00:0b.0: eth1: tx queued, slot 26, skblen 42
[28539.678487] 8139cp 0000:00:0b.0: eth1: tx queued, slot 27, skblen 42
[28540.688218] 8139cp 0000:00:0b.0: eth1: tx queued, slot 28, skblen 42
[28541.678581] 8139cp 0000:00:0b.0: eth1: tx queued, slot 29, skblen 42
[28542.678622] 8139cp 0000:00:0b.0: eth1: tx queued, slot 30, skblen 42
[28543.690661] 8139cp 0000:00:0b.0: eth1: tx queued, slot 31, skblen 42
[28544.688708] 8139cp 0000:00:0b.0: eth1: tx queued, slot 32, skblen 42
[28545.575351] 8139cp 0000:00:0b.0: eth1: tx queued, slot 33, skblen 141
[28545.688766] 8139cp 0000:00:0b.0: eth1: tx queued, slot 34, skblen 42
[28546.694068] 8139cp 0000:00:0b.0: eth1: tx queued, slot 35, skblen 42
[28547.688840] 8139cp 0000:00:0b.0: eth1: tx queued, slot 36, skblen 42
[28548.688882] 8139cp 0000:00:0b.0: eth1: tx queued, slot 37, skblen 42
[28549.697713] 8139cp 0000:00:0b.0: eth1: tx queued, slot 38, skblen 42
[28550.579007] 8139cp 0000:00:0b.0: eth1: tx queued, slot 39, skblen 86
[28550.688971] 8139cp 0000:00:0b.0: eth1: tx queued, slot 40, skblen 42
[28550.811035] SysRq : Changing Loglevel
[28550.814730] Loglevel set to 1
[28551.579045] 8139cp 0000:00:0b.0: eth1: tx queued, slot 41, skblen 86
[28551.689016] 8139cp 0000:00:0b.0: eth1: tx queued, slot 42, skblen 42
[28551.719077] 8139cp 0000:00:0b.0: eth1: tx queued, slot 43, skblen 79
[28552.579071] 8139cp 0000:00:0b.0: eth1: tx queued, slot 44, skblen 86
[28552.701599] 8139cp 0000:00:0b.0: eth1: tx queued, slot 45, skblen 42
[28555.116322] 8139cp 0000:00:0b.0: eth1: disabling interface
[28555.116663] br-lan: port 2(eth1) entered disabled state
[28555.120239] device eth1 left promiscuous mode
[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 6171 bytes --]
^ permalink raw reply
* [PATCH v6 6/6] USB: forbid memory allocation with I/O during bus reset
From: Ming Lei @ 2012-11-24 12:59 UTC (permalink / raw)
To: linux-kernel
Cc: Alan Stern, Oliver Neukum, Minchan Kim, Greg Kroah-Hartman,
Rafael J. Wysocki, Jens Axboe, David S. Miller, Andrew Morton,
netdev, linux-usb, linux-pm, linux-mm, Ming Lei
In-Reply-To: <1353761958-12810-1-git-send-email-ming.lei@canonical.com>
If one storage interface or usb network interface(iSCSI case)
exists in current configuration, memory allocation with
GFP_KERNEL during usb_device_reset() might trigger I/O transfer
on the storage interface itself and cause deadlock because
the 'us->dev_mutex' is held in .pre_reset() and the storage
interface can't do I/O transfer when the reset is triggered
by other interface, or the error handling can't be completed
if the reset is triggered by the storage itself(error handling path).
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Oliver Neukum <oneukum@suse.de>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
v5:
- use inline memalloc_noio_save()
v4:
- mark current memalloc_noio for every usb device reset
---
drivers/usb/core/hub.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 90accde..2d5cc1c 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -5040,6 +5040,7 @@ int usb_reset_device(struct usb_device *udev)
{
int ret;
int i;
+ unsigned int noio_flag;
struct usb_host_config *config = udev->actconfig;
if (udev->state == USB_STATE_NOTATTACHED ||
@@ -5049,6 +5050,17 @@ int usb_reset_device(struct usb_device *udev)
return -EINVAL;
}
+ /*
+ * Don't allocate memory with GFP_KERNEL in current
+ * context to avoid possible deadlock if usb mass
+ * storage interface or usbnet interface(iSCSI case)
+ * is included in current configuration. The easist
+ * approach is to do it for every device reset,
+ * because the device 'memalloc_noio' flag may have
+ * not been set before reseting the usb device.
+ */
+ noio_flag = memalloc_noio_save();
+
/* Prevent autosuspend during the reset */
usb_autoresume_device(udev);
@@ -5093,6 +5105,7 @@ int usb_reset_device(struct usb_device *udev)
}
usb_autosuspend_device(udev);
+ memalloc_noio_restore(noio_flag);
return ret;
}
EXPORT_SYMBOL_GPL(usb_reset_device);
--
1.7.9.5
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related
* [PATCH v6 5/6] PM / Runtime: force memory allocation with no I/O during Runtime PM callbcack
From: Ming Lei @ 2012-11-24 12:59 UTC (permalink / raw)
To: linux-kernel
Cc: Alan Stern, Oliver Neukum, Minchan Kim, Greg Kroah-Hartman,
Rafael J. Wysocki, Jens Axboe, David S. Miller, Andrew Morton,
netdev, linux-usb, linux-pm, linux-mm, Ming Lei
In-Reply-To: <1353761958-12810-1-git-send-email-ming.lei@canonical.com>
This patch applies the introduced memalloc_noio_save() and
memalloc_noio_restore() to force memory allocation with no I/O
during runtime_resume/runtime_suspend callback on device with
the flag of 'memalloc_noio' set.
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Oliver Neukum <oneukum@suse.de>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
v5:
- use inline memalloc_noio_save()
v4:
- runtime_suspend need this too because rpm_resume may wait for
completion of concurrent runtime_suspend, so deadlock still may
be triggered in runtime_suspend path.
---
drivers/base/power/runtime.c | 32 ++++++++++++++++++++++++++++++--
1 file changed, 30 insertions(+), 2 deletions(-)
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 3e198a0..96d99ea 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -371,6 +371,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
int (*callback)(struct device *);
struct device *parent = NULL;
int retval;
+ unsigned int noio_flag;
trace_rpm_suspend(dev, rpmflags);
@@ -480,7 +481,20 @@ static int rpm_suspend(struct device *dev, int rpmflags)
if (!callback && dev->driver && dev->driver->pm)
callback = dev->driver->pm->runtime_suspend;
- retval = rpm_callback(callback, dev);
+ /*
+ * Deadlock might be caused if memory allocation with GFP_KERNEL
+ * happens inside runtime_suspend callback of one block device's
+ * ancestor or the block device itself. Network device might be
+ * thought as part of iSCSI block device, so network device and
+ * its ancestor should be marked as memalloc_noio.
+ */
+ if (dev->power.memalloc_noio) {
+ noio_flag = memalloc_noio_save();
+ retval = rpm_callback(callback, dev);
+ memalloc_noio_restore(noio_flag);
+ } else {
+ retval = rpm_callback(callback, dev);
+ }
if (retval)
goto fail;
@@ -563,6 +577,7 @@ static int rpm_resume(struct device *dev, int rpmflags)
int (*callback)(struct device *);
struct device *parent = NULL;
int retval = 0;
+ unsigned int noio_flag;
trace_rpm_resume(dev, rpmflags);
@@ -712,7 +727,20 @@ static int rpm_resume(struct device *dev, int rpmflags)
if (!callback && dev->driver && dev->driver->pm)
callback = dev->driver->pm->runtime_resume;
- retval = rpm_callback(callback, dev);
+ /*
+ * Deadlock might be caused if memory allocation with GFP_KERNEL
+ * happens inside runtime_resume callback of one block device's
+ * ancestor or the block device itself. Network device might be
+ * thought as part of iSCSI block device, so network device and
+ * its ancestor should be marked as memalloc_noio.
+ */
+ if (dev->power.memalloc_noio) {
+ noio_flag = memalloc_noio_save();
+ retval = rpm_callback(callback, dev);
+ memalloc_noio_restore(noio_flag);
+ } else {
+ retval = rpm_callback(callback, dev);
+ }
if (retval) {
__update_runtime_status(dev, RPM_SUSPENDED);
pm_runtime_cancel_pending(dev);
--
1.7.9.5
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related
* [PATCH v6 4/6] net/core: apply pm_runtime_set_memalloc_noio on network devices
From: Ming Lei @ 2012-11-24 12:59 UTC (permalink / raw)
To: linux-kernel
Cc: Alan Stern, Oliver Neukum, Minchan Kim, Greg Kroah-Hartman,
Rafael J. Wysocki, Jens Axboe, David S. Miller, Andrew Morton,
netdev, linux-usb, linux-pm, linux-mm, Ming Lei, Eric Dumazet,
David Decotigny, Tom Herbert, Ingo Molnar
In-Reply-To: <1353761958-12810-1-git-send-email-ming.lei@canonical.com>
Deadlock might be caused by allocating memory with GFP_KERNEL in
runtime_resume and runtime_suspend callback of network devices in
iSCSI situation, so mark network devices and its ancestor as
'memalloc_noio' with the introduced pm_runtime_set_memalloc_noio().
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Decotigny <david.decotigny@google.com>
Cc: Tom Herbert <therbert@google.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
v4:
- call pm_runtime_set_memalloc_noio(ddev, true) after
device_add
---
net/core/net-sysfs.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index bcf02f6..a55d255 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -22,6 +22,7 @@
#include <linux/vmalloc.h>
#include <linux/export.h>
#include <linux/jiffies.h>
+#include <linux/pm_runtime.h>
#include <net/wext.h>
#include "net-sysfs.h"
@@ -1386,6 +1387,8 @@ void netdev_unregister_kobject(struct net_device * net)
remove_queue_kobjects(net);
+ pm_runtime_set_memalloc_noio(dev, false);
+
device_del(dev);
}
@@ -1421,6 +1424,8 @@ int netdev_register_kobject(struct net_device *net)
return error;
}
+ pm_runtime_set_memalloc_noio(dev, true);
+
return error;
}
--
1.7.9.5
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related
* [PATCH v6 3/6] block/genhd.c: apply pm_runtime_set_memalloc_noio on block devices
From: Ming Lei @ 2012-11-24 12:59 UTC (permalink / raw)
To: linux-kernel
Cc: Alan Stern, Oliver Neukum, Minchan Kim, Greg Kroah-Hartman,
Rafael J. Wysocki, Jens Axboe, David S. Miller, Andrew Morton,
netdev, linux-usb, linux-pm, linux-mm, Ming Lei
In-Reply-To: <1353761958-12810-1-git-send-email-ming.lei@canonical.com>
This patch applyes the introduced pm_runtime_set_memalloc_noio on
block device so that PM core will teach mm to not allocate memory with
GFP_IOFS when calling the runtime_resume and runtime_suspend callback
for block devices and its ancestors.
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
v5:
- fix code style and one typo
v4:
- call pm_runtime_set_memalloc_noio(ddev, true) after device_add
---
block/genhd.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/block/genhd.c b/block/genhd.c
index 9a289d7..1905966 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -18,6 +18,7 @@
#include <linux/mutex.h>
#include <linux/idr.h>
#include <linux/log2.h>
+#include <linux/pm_runtime.h>
#include "blk.h"
@@ -532,6 +533,14 @@ static void register_disk(struct gendisk *disk)
return;
}
}
+
+ /*
+ * avoid probable deadlock caused by allocating memory with
+ * GFP_KERNEL in runtime_resume callback of its all ancestor
+ * devices
+ */
+ pm_runtime_set_memalloc_noio(ddev, true);
+
disk->part0.holder_dir = kobject_create_and_add("holders", &ddev->kobj);
disk->slave_dir = kobject_create_and_add("slaves", &ddev->kobj);
@@ -661,6 +670,7 @@ void del_gendisk(struct gendisk *disk)
disk->driverfs_dev = NULL;
if (!sysfs_deprecated)
sysfs_remove_link(block_depr, dev_name(disk_to_dev(disk)));
+ pm_runtime_set_memalloc_noio(disk_to_dev(disk), false);
device_del(disk_to_dev(disk));
}
EXPORT_SYMBOL(del_gendisk);
--
1.7.9.5
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related
* [PATCH v6 2/6] PM / Runtime: introduce pm_runtime_set_memalloc_noio()
From: Ming Lei @ 2012-11-24 12:59 UTC (permalink / raw)
To: linux-kernel
Cc: Alan Stern, Oliver Neukum, Minchan Kim, Greg Kroah-Hartman,
Rafael J. Wysocki, Jens Axboe, David S. Miller, Andrew Morton,
netdev, linux-usb, linux-pm, linux-mm, Ming Lei
In-Reply-To: <1353761958-12810-1-git-send-email-ming.lei@canonical.com>
The patch introduces the flag of memalloc_noio in 'struct dev_pm_info'
to help PM core to teach mm not allocating memory with GFP_KERNEL
flag for avoiding probable deadlock.
As explained in the comment, any GFP_KERNEL allocation inside
runtime_resume() or runtime_suspend() on any one of device in
the path from one block or network device to the root device
in the device tree may cause deadlock, the introduced
pm_runtime_set_memalloc_noio() sets or clears the flag on
device in the path recursively.
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
v5:
- fix code style error
- add comment on clear the device memalloc_noio flag
v4:
- rename memalloc_noio_resume as memalloc_noio
- remove pm_runtime_get_memalloc_noio()
- add comments on pm_runtime_set_memalloc_noio
v3:
- introduce pm_runtime_get_memalloc_noio()
- hold one global lock on pm_runtime_set_memalloc_noio
- hold device power lock when accessing memalloc_noio_resume
flag suggested by Alan Stern
- implement pm_runtime_set_memalloc_noio without recursion
suggested by Alan Stern
v2:
- introduce pm_runtime_set_memalloc_noio()
---
drivers/base/power/runtime.c | 60 ++++++++++++++++++++++++++++++++++++++++++
include/linux/pm.h | 1 +
include/linux/pm_runtime.h | 3 +++
3 files changed, 64 insertions(+)
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 3148b10..3e198a0 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -124,6 +124,66 @@ unsigned long pm_runtime_autosuspend_expiration(struct device *dev)
}
EXPORT_SYMBOL_GPL(pm_runtime_autosuspend_expiration);
+static int dev_memalloc_noio(struct device *dev, void *data)
+{
+ return dev->power.memalloc_noio;
+}
+
+/*
+ * pm_runtime_set_memalloc_noio - Set a device's memalloc_noio flag.
+ * @dev: Device to handle.
+ * @enable: True for setting the flag and False for clearing the flag.
+ *
+ * Set the flag for all devices in the path from the device to the
+ * root device in the device tree if @enable is true, otherwise clear
+ * the flag for devices in the path whose siblings don't set the flag.
+ *
+ * The function should only be called by block device, or network
+ * device driver for solving the deadlock problem during runtime
+ * resume/suspend:
+ *
+ * If memory allocation with GFP_KERNEL is called inside runtime
+ * resume/suspend callback of any one of its ancestors(or the
+ * block device itself), the deadlock may be triggered inside the
+ * memory allocation since it might not complete until the block
+ * device becomes active and the involed page I/O finishes. The
+ * situation is pointed out first by Alan Stern. Network device
+ * are involved in iSCSI kind of situation.
+ *
+ * The lock of dev_hotplug_mutex is held in the function for handling
+ * hotplug race because pm_runtime_set_memalloc_noio() may be called
+ * in async probe().
+ *
+ * The function should be called between device_add() and device_del()
+ * on the affected device(block/network device).
+ */
+void pm_runtime_set_memalloc_noio(struct device *dev, bool enable)
+{
+ static DEFINE_MUTEX(dev_hotplug_mutex);
+
+ mutex_lock(&dev_hotplug_mutex);
+ for (;;) {
+ /* hold power lock since bitfield is not SMP-safe. */
+ spin_lock_irq(&dev->power.lock);
+ dev->power.memalloc_noio = enable;
+ spin_unlock_irq(&dev->power.lock);
+
+ dev = dev->parent;
+
+ /*
+ * clear flag of the parent device only if all the
+ * children don't set the flag because ancestor's
+ * flag was set by any one of the descendants.
+ */
+ if (!dev || (!enable &&
+ device_for_each_child(dev, NULL,
+ dev_memalloc_noio)))
+ break;
+ }
+ mutex_unlock(&dev_hotplug_mutex);
+}
+EXPORT_SYMBOL_GPL(pm_runtime_set_memalloc_noio);
+
/**
* rpm_check_suspend_allowed - Test whether a device may be suspended.
* @dev: Device to test.
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 03d7bb1..1a8a69d 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -538,6 +538,7 @@ struct dev_pm_info {
unsigned int irq_safe:1;
unsigned int use_autosuspend:1;
unsigned int timer_autosuspends:1;
+ unsigned int memalloc_noio:1;
enum rpm_request request;
enum rpm_status runtime_status;
int runtime_error;
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index f271860..775e063 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -47,6 +47,7 @@ extern void pm_runtime_set_autosuspend_delay(struct device *dev, int delay);
extern unsigned long pm_runtime_autosuspend_expiration(struct device *dev);
extern void pm_runtime_update_max_time_suspended(struct device *dev,
s64 delta_ns);
+extern void pm_runtime_set_memalloc_noio(struct device *dev, bool enable);
static inline bool pm_children_suspended(struct device *dev)
{
@@ -149,6 +150,8 @@ static inline void pm_runtime_set_autosuspend_delay(struct device *dev,
int delay) {}
static inline unsigned long pm_runtime_autosuspend_expiration(
struct device *dev) { return 0; }
+static inline void pm_runtime_set_memalloc_noio(struct device *dev,
+ bool enable){}
#endif /* !CONFIG_PM_RUNTIME */
--
1.7.9.5
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related
* [PATCH v6 1/6] mm: teach mm by current context info to not do I/O during memory allocation
From: Ming Lei @ 2012-11-24 12:59 UTC (permalink / raw)
To: linux-kernel
Cc: Alan Stern, Oliver Neukum, Minchan Kim, Greg Kroah-Hartman,
Rafael J. Wysocki, Jens Axboe, David S. Miller, Andrew Morton,
netdev, linux-usb, linux-pm, linux-mm, Ming Lei, Jiri Kosina,
Mel Gorman, KAMEZAWA Hiroyuki, Michal Hocko, Ingo Molnar,
Peter Zijlstra
In-Reply-To: <1353761958-12810-1-git-send-email-ming.lei@canonical.com>
This patch introduces PF_MEMALLOC_NOIO on process flag('flags' field of
'struct task_struct'), so that the flag can be set by one task
to avoid doing I/O inside memory allocation in the task's context.
The patch trys to solve one deadlock problem caused by block device,
and the problem may happen at least in the below situations:
- during block device runtime resume, if memory allocation with
GFP_KERNEL is called inside runtime resume callback of any one
of its ancestors(or the block device itself), the deadlock may be
triggered inside the memory allocation since it might not complete
until the block device becomes active and the involed page I/O finishes.
The situation is pointed out first by Alan Stern. It is not a good
approach to convert all GFP_KERNEL[1] in the path into GFP_NOIO because
several subsystems may be involved(for example, PCI, USB and SCSI may
be involved for usb mass stoarage device, network devices involved too
in the iSCSI case)
- during block device runtime suspend, because runtime resume need
to wait for completion of concurrent runtime suspend.
- during error handling of usb mass storage deivce, USB bus reset
will be put on the device, so there shouldn't have any
memory allocation with GFP_KERNEL during USB bus reset, otherwise
the deadlock similar with above may be triggered. Unfortunately, any
usb device may include one mass storage interface in theory, so it
requires all usb interface drivers to handle the situation. In fact,
most usb drivers don't know how to handle bus reset on the device
and don't provide .pre_set() and .post_reset() callback at all, so
USB core has to unbind and bind driver for these devices. So it
is still not practical to resort to GFP_NOIO for solving the problem.
Also the introduced solution can be used by block subsystem or block
drivers too, for example, set the PF_MEMALLOC_NOIO flag before doing
actual I/O transfer.
It is not a good idea to convert all these GFP_KERNEL in the
affected path into GFP_NOIO because these functions doing that may be
implemented as library and will be called in many other contexts.
In fact, memalloc_noio_flags() can convert some of current static GFP_NOIO
allocation into GFP_KERNEL back in other non-affected contexts, at least
almost all GFP_NOIO in USB subsystem can be converted into GFP_KERNEL
after applying the approach and make allocation with GFP_NOIO
only happen in runtime resume/bus reset/block I/O transfer contexts
generally.
[1], several GFP_KERNEL allocation examples in runtime resume path
- pci subsystem
acpi_os_allocate
<-acpi_ut_allocate
<-ACPI_ALLOCATE_ZEROED
<-acpi_evaluate_object
<-__acpi_bus_set_power
<-acpi_bus_set_power
<-acpi_pci_set_power_state
<-platform_pci_set_power_state
<-pci_platform_power_transition
<-__pci_complete_power_transition
<-pci_set_power_state
<-pci_restore_standard_config
<-pci_pm_runtime_resume
- usb subsystem
usb_get_status
<-finish_port_resume
<-usb_port_resume
<-generic_resume
<-usb_resume_device
<-usb_resume_both
<-usb_runtime_resume
- some individual usb drivers
usblp, uvc, gspca, most of dvb-usb-v2 media drivers, cpia2, az6007, ....
That is just what I have found. Unfortunately, this allocation can
only be found by human being now, and there should be many not found
since any function in the resume path(call tree) may allocate memory
with GFP_KERNEL.
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Oliver Neukum <oneukum@suse.de>
Cc: Jiri Kosina <jiri.kosina@suse.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
v6:
- replace GFP_IO with __GFP_IO to fix compile failure
v5:
- use inline instead of macro to define memalloc_noio_*
- replace memalloc_noio() with memalloc_noio_flags() to
make code neater
- don't clear GFP_FS because no GFP_IO means
that allocation won't enter device driver as pointed by
Andrew Morton
v4:
- fix comment
v3:
- no change
v2:
- remove changes on 'may_writepage' and 'may_swap' because that
isn't related with the patchset, and can't introduce I/O in
allocation path if GFP_IOFS is unset, so handing 'may_swap'
and may_writepage on GFP_NOIO or GFP_NOFS should be a
mm internal thing, and let mm guys deal with that, :-).
Looks clearing the two may_XXX flag only excludes dirty pages
and anon pages for relaiming, and the behaviour should be decided
by GFP FLAG, IMO.
- unset GFP_IOFS in try_to_free_pages() path since
alloc_page_buffers()
and dma_alloc_from_contiguous may drop into the path, as
pointed by KAMEZAWA Hiroyuki
v1:
- take Minchan's change to avoid the check in alloc_page hot
path
- change the helpers' style into save/restore as suggested by
Alan Stern
---
include/linux/sched.h | 22 ++++++++++++++++++++++
mm/page_alloc.c | 9 ++++++++-
mm/vmscan.c | 4 ++--
3 files changed, 32 insertions(+), 3 deletions(-)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 85d14e1..c9bb377 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -51,6 +51,7 @@ struct sched_param {
#include <linux/cred.h>
#include <linux/llist.h>
#include <linux/uidgid.h>
+#include <linux/gfp.h>
#include <asm/processor.h>
@@ -1810,6 +1811,7 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *
#define PF_FROZEN 0x00010000 /* frozen for system suspend */
#define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */
#define PF_KSWAPD 0x00040000 /* I am kswapd */
+#define PF_MEMALLOC_NOIO 0x00080000 /* Allocating memory without IO involved */
#define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */
#define PF_KTHREAD 0x00200000 /* I am a kernel thread */
#define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */
@@ -1847,6 +1849,26 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *
#define tsk_used_math(p) ((p)->flags & PF_USED_MATH)
#define used_math() tsk_used_math(current)
+/* __GFP_IO isn't allowed if PF_MEMALLOC_NOIO is set in current->flags */
+static inline gfp_t memalloc_noio_flags(gfp_t flags)
+{
+ if (unlikely(current->flags & PF_MEMALLOC_NOIO))
+ flags &= ~__GFP_IO;
+ return flags;
+}
+
+static inline gfp_t memalloc_noio_save(void)
+{
+ gfp_t flags = current->flags & PF_MEMALLOC_NOIO;
+ current->flags |= PF_MEMALLOC_NOIO;
+ return flags;
+}
+
+static inline void memalloc_noio_restore(gfp_t flags)
+{
+ current->flags = (current->flags & ~PF_MEMALLOC_NOIO) | flags;
+}
+
/*
* task->jobctl flags
*/
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 4d077f0..4e485b1 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2644,10 +2644,17 @@ retry_cpuset:
page = get_page_from_freelist(gfp_mask|__GFP_HARDWALL, nodemask, order,
zonelist, high_zoneidx, alloc_flags,
preferred_zone, migratetype);
- if (unlikely(!page))
+ if (unlikely(!page)) {
+ /*
+ * Runtime PM, block IO and its error handling path
+ * can deadlock because I/O on the device might not
+ * complete.
+ */
+ gfp_mask = memalloc_noio_flags(gfp_mask);
page = __alloc_pages_slowpath(gfp_mask, order,
zonelist, high_zoneidx, nodemask,
preferred_zone, migratetype);
+ }
trace_mm_page_alloc(page, order, gfp_mask, migratetype);
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 9ca84e2..b1296c4 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2270,7 +2270,7 @@ unsigned long try_to_free_pages(struct zonelist *zonelist, int order,
{
unsigned long nr_reclaimed;
struct scan_control sc = {
- .gfp_mask = gfp_mask,
+ .gfp_mask = (gfp_mask = memalloc_noio_flags(gfp_mask)),
.may_writepage = !laptop_mode,
.nr_to_reclaim = SWAP_CLUSTER_MAX,
.may_unmap = 1,
@@ -3277,7 +3277,7 @@ static int __zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order)
.may_swap = 1,
.nr_to_reclaim = max_t(unsigned long, nr_pages,
SWAP_CLUSTER_MAX),
- .gfp_mask = gfp_mask,
+ .gfp_mask = (gfp_mask = memalloc_noio_flags(gfp_mask)),
.order = order,
.priority = ZONE_RECLAIM_PRIORITY,
};
--
1.7.9.5
^ permalink raw reply related
* [PATCH v6 0/6] solve deadlock caused by memory allocation with I/O
From: Ming Lei @ 2012-11-24 12:59 UTC (permalink / raw)
To: linux-kernel
Cc: Alan Stern, Oliver Neukum, Minchan Kim, Greg Kroah-Hartman,
Rafael J. Wysocki, Jens Axboe, David S. Miller, Andrew Morton,
netdev, linux-usb, linux-pm, linux-mm
Hi,
This patchset try to solve one deadlock problem which might be caused
by memory allocation with block I/O during runtime PM and block device
error handling path. Traditionly, the problem is addressed by passing
GFP_NOIO statically to mm, but that is not a effective solution, see
detailed description in patch 1's commit log.
This patch set introduces one process flag and trys to fix the deadlock
problem on block device/network device during runtime PM or usb bus reset.
The 1st one is the change on include/sched.h and mm.
The 2nd patch introduces the flag of memalloc_noio on 'dev_pm_info',
and pm_runtime_set_memalloc_noio(), so that PM Core can teach mm to not
allocate mm with GFP_IO during the runtime_resume callback only on
device with the flag set.
The following 2 patches apply the introduced pm_runtime_set_memalloc_noio()
to mark all devices as memalloc_noio_resume in the path from the block or
network device to the root device in device tree.
The last 2 patches are applied again PM and USB subsystem to demonstrate
how to use the introduced mechanism to fix the deadlock problem.
Andrew, could you queue these patches into your tree since V6 fixes all
your concerns and looks no one objects these patches?
Change logs:
V6:
- fix one compile failure(1/6), and only one line change
V5:
- don't clear GFP_FS
- coding style fix
- add comments
- see details in individual change logs
V4:
- patches from the 2nd to the 6th changed
- call pm_runtime_set_memalloc_noio() after device_add() as pointed
by Alan
- set PF_MEMALLOC_NOIO during runtime_suspend()
V3:
- patch 2/6 and 5/6 changed, see their commit log
- remove RFC from title since several guys have expressed that
it is a reasonable solution
V2:
- remove changes on 'may_writepage' and 'may_swap'(1/6)
- unset GFP_IOFS in try_to_free_pages() path(1/6)
- introduce pm_runtime_set_memalloc_noio()
- only apply the meachnism on block/network device and its ancestors
for runtime resume context
V1:
- take Minchan's change to avoid the check in alloc_page hot path
- change the helpers' style into save/restore as suggested by Alan
- memory allocation with no io in usb bus reset path for all devices
as suggested by Greg and Oliver
block/genhd.c | 10 +++++
drivers/base/power/runtime.c | 92 +++++++++++++++++++++++++++++++++++++++++-
drivers/usb/core/hub.c | 13 ++++++
include/linux/pm.h | 1 +
include/linux/pm_runtime.h | 3 ++
include/linux/sched.h | 22 ++++++++++
mm/page_alloc.c | 9 ++++-
mm/vmscan.c | 4 +-
net/core/net-sysfs.c | 5 +++
9 files changed, 154 insertions(+), 5 deletions(-)
Thanks,
--
Ming Lei
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply
* [PATCH] bonding: make arp_ip_target parameter checks consistent with sysfs
From: Nikolay Aleksandrov @ 2012-11-24 12:21 UTC (permalink / raw)
To: netdev; +Cc: andy, fubar, davem
The module can be loaded with arp_ip_target="255.255.255.255" which makes it
impossible to remove as the function in sysfs checks for that value, so we make
the parameter checks consistent with sysfs.
Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
---
drivers/net/bonding/bond_main.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 5f5b69f..940eac8 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4706,12 +4706,14 @@ static int bond_check_params(struct bond_params *params)
arp_ip_count++) {
/* not complete check, but should be good enough to
catch mistakes */
- if (!isdigit(arp_ip_target[arp_ip_count][0])) {
+ __be32 ip = in_aton(arp_ip_target[arp_ip_count]);
+ if (!isdigit(arp_ip_target[arp_ip_count][0])
+ || ip == 0
+ || ip == htonl(INADDR_BROADCAST)) {
pr_warning("Warning: bad arp_ip_target module parameter (%s), ARP monitoring will not be performed\n",
arp_ip_target[arp_ip_count]);
arp_interval = 0;
} else {
- __be32 ip = in_aton(arp_ip_target[arp_ip_count]);
arp_target[arp_ip_count] = ip;
}
}
--
1.7.11.7
^ permalink raw reply related
* Re: [PATCH] net: sched: enable CAN Identifier to be build into kernel
From: Marc Kleine-Budde @ 2012-11-24 12:22 UTC (permalink / raw)
To: David Miller; +Cc: netdev, linux-can
In-Reply-To: <20121123.142258.816355331172102352.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 807 bytes --]
On 11/23/2012 08:22 PM, David Miller wrote:
> From: Marc Kleine-Budde <mkl@pengutronix.de>
> Date: Fri, 23 Nov 2012 11:44:57 +0100
>
>> This patch makes it possible to build the CAN Identifier into the kernel, even
>> if the CAN support is build as a module.
>>
>> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
>
> Why is this so critical that you're asking me to merge this into
> the 'net' tree mere days before Linus makes a release?
Sorry my fault. I intended post that patch against net-next.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 261 bytes --]
^ permalink raw reply
* [PATCH] bonding: fix race condition in bonding_store_slaves_active
From: Nikolay Aleksandrov @ 2012-11-24 12:19 UTC (permalink / raw)
To: netdev; +Cc: andy, fubar, davem
Race between bonding_store_slaves_active() and slave manipulation functions
The bond_for_each_slave use in bonding_store_slaves_active() is not protected
by any synchronization mechanism. NULL pointer dereference is easy to reach.
Fixed by acquiring the bond->lock for the slave walk.
Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
---
drivers/net/bonding/bond_sysfs.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index ef8d2a0..ba4f95b 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -1582,6 +1582,7 @@ static ssize_t bonding_store_slaves_active(struct device *d,
goto out;
}
+ read_lock(&bond->lock);
bond_for_each_slave(bond, slave, i) {
if (!bond_is_active_slave(slave)) {
if (new_value)
@@ -1590,6 +1591,7 @@ static ssize_t bonding_store_slaves_active(struct device *d,
slave->inactive = 1;
}
}
+ read_unlock(&bond->lock);
out:
return ret;
}
--
1.7.11.7
^ permalink raw reply related
* [PATCH] bonding: fix miimon and arp_interval delayed work race conditions
From: Nikolay Aleksandrov @ 2012-11-24 12:17 UTC (permalink / raw)
To: netdev; +Cc: andy, fubar, davem
First I would give three observations which will be used later.
Observation 1: if (delayed_work_pending(wq)) cancel_delayed_work(wq)
This usage is wrong because the pending bit is cleared just before the work's fn is
executed and if the function re-arms itself we might end up with the work still
running. It is safe to call cancel_delayed_work_sync() even if the work is not queued
at all.
Observation 2: Use of INIT_DELAYED_WORK()
Work needs to be initialized only once prior to (de/en)queueing.
Observation 3: IFF_UP is set only after ndo_open is called
Related race conditions:
1. Race between bonding_store_miimon() and bonding_store_arp_interval()
Because of Obs.1 we can end up having both works enqueued.
2. Multiple races with INIT_DELAYED_WORK()
Since the works are not protected by anything between INIT_DELAYED_WORK() and
calls to (en/de)queue it is possible for races between the following functions:
(races are also possible between the calls to INIT_DELAYED_WORK() and workqueue code)
bonding_store_miimon() - bonding_store_arp_interval(), bond_close(), bond_open(),
enqueued functions
bonding_store_arp_interval() - bonding_store_miimon(), bond_close(), bond_open(),
enqueued functions
3. By Obs.1 we need to change bond_cancel_all()
Bugs 1 and 2 are fixed by moving all work initializations in bond_open which by
Obs. 2 and Obs. 3 and the fact that we make sure that all works are cancelled in
bond_close(), is guaranteed not to have any work enqueued. Also RTNL lock is now
acquired in bonding_store_miimon/arp_interval so they can't race with bond_close
and bond_open. The opposing work is cancelled only if the IFF_UP flag is set
and it is cancelled unconditionally. The opposing work is already cancelled if
the interface is down so no need to cancel it again. This way we don't need new
synchronizations for the bonding workqueue. These bug (and fixes) are tied
together and belong in the same patch.
Note: I have left 1 line intentionally over 80 characters (84) because I didn't
like how it looks broken down. If you'd prefer it otherwise, then simply
break it.
Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
---
drivers/net/bonding/bond_main.c | 88 ++++++++++++----------------------------
drivers/net/bonding/bond_sysfs.c | 34 +++++-----------
2 files changed, 36 insertions(+), 86 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 5f5b69f..1445c7d 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -3459,6 +3459,28 @@ static int bond_xmit_hash_policy_l34(struct sk_buff *skb, int count)
/*-------------------------- Device entry points ----------------------------*/
+static void bond_work_init_all(struct bonding *bond)
+{
+ INIT_DELAYED_WORK(&bond->mcast_work,
+ bond_resend_igmp_join_requests_delayed);
+ INIT_DELAYED_WORK(&bond->alb_work, bond_alb_monitor);
+ INIT_DELAYED_WORK(&bond->mii_work, bond_mii_monitor);
+ if (bond->params.mode == BOND_MODE_ACTIVEBACKUP)
+ INIT_DELAYED_WORK(&bond->arp_work, bond_activebackup_arp_mon);
+ else
+ INIT_DELAYED_WORK(&bond->arp_work, bond_loadbalance_arp_mon);
+ INIT_DELAYED_WORK(&bond->ad_work, bond_3ad_state_machine_handler);
+}
+
+static void bond_work_cancel_all(struct bonding *bond)
+{
+ cancel_delayed_work_sync(&bond->mii_work);
+ cancel_delayed_work_sync(&bond->arp_work);
+ cancel_delayed_work_sync(&bond->alb_work);
+ cancel_delayed_work_sync(&bond->ad_work);
+ cancel_delayed_work_sync(&bond->mcast_work);
+}
+
static int bond_open(struct net_device *bond_dev)
{
struct bonding *bond = netdev_priv(bond_dev);
@@ -3481,41 +3503,27 @@ static int bond_open(struct net_device *bond_dev)
}
read_unlock(&bond->lock);
- INIT_DELAYED_WORK(&bond->mcast_work, bond_resend_igmp_join_requests_delayed);
+ bond_work_init_all(bond);
if (bond_is_lb(bond)) {
/* bond_alb_initialize must be called before the timer
* is started.
*/
- if (bond_alb_initialize(bond, (bond->params.mode == BOND_MODE_ALB))) {
- /* something went wrong - fail the open operation */
+ if (bond_alb_initialize(bond, (bond->params.mode == BOND_MODE_ALB)))
return -ENOMEM;
- }
-
- INIT_DELAYED_WORK(&bond->alb_work, bond_alb_monitor);
queue_delayed_work(bond->wq, &bond->alb_work, 0);
}
- if (bond->params.miimon) { /* link check interval, in milliseconds. */
- INIT_DELAYED_WORK(&bond->mii_work, bond_mii_monitor);
+ if (bond->params.miimon) /* link check interval, in milliseconds. */
queue_delayed_work(bond->wq, &bond->mii_work, 0);
- }
if (bond->params.arp_interval) { /* arp interval, in milliseconds. */
- if (bond->params.mode == BOND_MODE_ACTIVEBACKUP)
- INIT_DELAYED_WORK(&bond->arp_work,
- bond_activebackup_arp_mon);
- else
- INIT_DELAYED_WORK(&bond->arp_work,
- bond_loadbalance_arp_mon);
-
queue_delayed_work(bond->wq, &bond->arp_work, 0);
if (bond->params.arp_validate)
bond->recv_probe = bond_arp_rcv;
}
if (bond->params.mode == BOND_MODE_8023AD) {
- INIT_DELAYED_WORK(&bond->ad_work, bond_3ad_state_machine_handler);
queue_delayed_work(bond->wq, &bond->ad_work, 0);
/* register to receive LACPDUs */
bond->recv_probe = bond_3ad_lacpdu_recv;
@@ -3530,34 +3538,10 @@ static int bond_close(struct net_device *bond_dev)
struct bonding *bond = netdev_priv(bond_dev);
write_lock_bh(&bond->lock);
-
bond->send_peer_notif = 0;
-
write_unlock_bh(&bond->lock);
- if (bond->params.miimon) { /* link check interval, in milliseconds. */
- cancel_delayed_work_sync(&bond->mii_work);
- }
-
- if (bond->params.arp_interval) { /* arp interval, in milliseconds. */
- cancel_delayed_work_sync(&bond->arp_work);
- }
-
- switch (bond->params.mode) {
- case BOND_MODE_8023AD:
- cancel_delayed_work_sync(&bond->ad_work);
- break;
- case BOND_MODE_TLB:
- case BOND_MODE_ALB:
- cancel_delayed_work_sync(&bond->alb_work);
- break;
- default:
- break;
- }
-
- if (delayed_work_pending(&bond->mcast_work))
- cancel_delayed_work_sync(&bond->mcast_work);
-
+ bond_work_cancel_all(bond);
if (bond_is_lb(bond)) {
/* Must be called only after all
* slaves have been released
@@ -4436,26 +4420,6 @@ static void bond_setup(struct net_device *bond_dev)
bond_dev->features |= bond_dev->hw_features;
}
-static void bond_work_cancel_all(struct bonding *bond)
-{
- if (bond->params.miimon && delayed_work_pending(&bond->mii_work))
- cancel_delayed_work_sync(&bond->mii_work);
-
- if (bond->params.arp_interval && delayed_work_pending(&bond->arp_work))
- cancel_delayed_work_sync(&bond->arp_work);
-
- if (bond->params.mode == BOND_MODE_ALB &&
- delayed_work_pending(&bond->alb_work))
- cancel_delayed_work_sync(&bond->alb_work);
-
- if (bond->params.mode == BOND_MODE_8023AD &&
- delayed_work_pending(&bond->ad_work))
- cancel_delayed_work_sync(&bond->ad_work);
-
- if (delayed_work_pending(&bond->mcast_work))
- cancel_delayed_work_sync(&bond->mcast_work);
-}
-
/*
* Destroy a bonding device.
* Must be under rtnl_lock when this function is called.
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index ef8d2a0..3327a07 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -513,6 +513,8 @@ static ssize_t bonding_store_arp_interval(struct device *d,
int new_value, ret = count;
struct bonding *bond = to_bond(d);
+ if (!rtnl_trylock())
+ return restart_syscall();
if (sscanf(buf, "%d", &new_value) != 1) {
pr_err("%s: no arp_interval value specified.\n",
bond->dev->name);
@@ -539,10 +541,6 @@ static ssize_t bonding_store_arp_interval(struct device *d,
pr_info("%s: ARP monitoring cannot be used with MII monitoring. %s Disabling MII monitoring.\n",
bond->dev->name, bond->dev->name);
bond->params.miimon = 0;
- if (delayed_work_pending(&bond->mii_work)) {
- cancel_delayed_work(&bond->mii_work);
- flush_workqueue(bond->wq);
- }
}
if (!bond->params.arp_targets[0]) {
pr_info("%s: ARP monitoring has been set up, but no ARP targets have been specified.\n",
@@ -554,19 +552,12 @@ static ssize_t bonding_store_arp_interval(struct device *d,
* timer will get fired off when the open function
* is called.
*/
- if (!delayed_work_pending(&bond->arp_work)) {
- if (bond->params.mode == BOND_MODE_ACTIVEBACKUP)
- INIT_DELAYED_WORK(&bond->arp_work,
- bond_activebackup_arp_mon);
- else
- INIT_DELAYED_WORK(&bond->arp_work,
- bond_loadbalance_arp_mon);
-
- queue_delayed_work(bond->wq, &bond->arp_work, 0);
- }
+ cancel_delayed_work_sync(&bond->mii_work);
+ queue_delayed_work(bond->wq, &bond->arp_work, 0);
}
out:
+ rtnl_unlock();
return ret;
}
static DEVICE_ATTR(arp_interval, S_IRUGO | S_IWUSR,
@@ -962,6 +953,8 @@ static ssize_t bonding_store_miimon(struct device *d,
int new_value, ret = count;
struct bonding *bond = to_bond(d);
+ if (!rtnl_trylock())
+ return restart_syscall();
if (sscanf(buf, "%d", &new_value) != 1) {
pr_err("%s: no miimon value specified.\n",
bond->dev->name);
@@ -993,10 +986,6 @@ static ssize_t bonding_store_miimon(struct device *d,
bond->params.arp_validate =
BOND_ARP_VALIDATE_NONE;
}
- if (delayed_work_pending(&bond->arp_work)) {
- cancel_delayed_work(&bond->arp_work);
- flush_workqueue(bond->wq);
- }
}
if (bond->dev->flags & IFF_UP) {
@@ -1005,15 +994,12 @@ static ssize_t bonding_store_miimon(struct device *d,
* timer will get fired off when the open function
* is called.
*/
- if (!delayed_work_pending(&bond->mii_work)) {
- INIT_DELAYED_WORK(&bond->mii_work,
- bond_mii_monitor);
- queue_delayed_work(bond->wq,
- &bond->mii_work, 0);
- }
+ cancel_delayed_work_sync(&bond->arp_work);
+ queue_delayed_work(bond->wq, &bond->mii_work, 0);
}
}
out:
+ rtnl_unlock();
return ret;
}
static DEVICE_ATTR(miimon, S_IRUGO | S_IWUSR,
--
1.7.11.7
^ permalink raw reply related
* [PATCH] ewrk3: silence GCC warning
From: Paul Bolle @ 2012-11-24 12:12 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
Building ewrk3.o triggers this GCC warning:
drivers/net/ethernet/dec/ewrk3.c: In function '__check_irq':
drivers/net/ethernet/dec/ewrk3.c:1915:1: warning: return from incompatible pointer type [enabled by default]
This can be trivially fixed by changing the 'irq' parameter from int to
byte (which is the alias for unsigned char for module parameters).
While we're touching this code also drop an outdated comment, that
should have been dropped with the patch named "MODULE_PARM conversions"
from early 2005.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
---
Compile tested only.
drivers/net/ethernet/dec/ewrk3.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/dec/ewrk3.c b/drivers/net/ethernet/dec/ewrk3.c
index 17ae8c6..9f992b9 100644
--- a/drivers/net/ethernet/dec/ewrk3.c
+++ b/drivers/net/ethernet/dec/ewrk3.c
@@ -1910,9 +1910,8 @@ static struct net_device *ewrk3_devs[MAX_NUM_EWRK3S];
static int ndevs;
static int io[MAX_NUM_EWRK3S+1] = { 0x300, 0, };
-/* '21' below should really be 'MAX_NUM_EWRK3S' */
module_param_array(io, int, NULL, 0);
-module_param_array(irq, int, NULL, 0);
+module_param_array(irq, byte, NULL, 0);
MODULE_PARM_DESC(io, "EtherWORKS 3 I/O base address(es)");
MODULE_PARM_DESC(irq, "EtherWORKS 3 IRQ number(s)");
--
1.7.7.6
^ permalink raw reply related
* Re: [RFC net-next PATCH V1 1/9] net: frag evictor, avoid killing warm frag queues
From: Jesper Dangaard Brouer @ 2012-11-24 11:36 UTC (permalink / raw)
To: Florian Westphal
Cc: Eric Dumazet, David S. Miller, netdev, Pablo Neira Ayuso,
Thomas Graf, Cong Wang, Patrick McHardy, Paul E. McKenney,
Herbert Xu
In-Reply-To: <20121123195815.GA32625@breakpoint.cc>
On Fri, 2012-11-23 at 20:58 +0100, Florian Westphal wrote:
> Jesper Dangaard Brouer <brouer@redhat.com> wrote:
> > +// TODO: Idea what about also looking at flag INET_FRAG_FIRST_IN
> > +// just as safe-guard against frags with a dropped "head" packet
> > + if (!force && q->creation_ts == (u32) jiffies) {
>
> I think we should not rely on head fragment arriving first.
Good point. Lets keep the current approach.
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Sr. Network Kernel Developer at Red Hat
Author of http://www.iptv-analyzer.org
LinkedIn: http://www.linkedin.com/in/brouer
^ permalink raw reply
* [PATCH] smsc: Add logging message newlines
From: Joe Perches @ 2012-11-24 11:27 UTC (permalink / raw)
To: Steve Glendinning; +Cc: Greg Kroah-Hartman, netdev, linux-usb, LKML
Avoid any possible message logging interleaving by adding
missing newlines.
Align arguments.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/usb/smsc75xx.c | 403 ++++++++++++++++++++++----------------------
drivers/net/usb/smsc95xx.c | 184 ++++++++++----------
2 files changed, 296 insertions(+), 291 deletions(-)
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
index c5353cf..953c4f4 100644
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -103,8 +103,8 @@ static int __must_check __smsc75xx_read_reg(struct usbnet *dev, u32 index,
| 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);
+ netdev_warn(dev->net, "Failed to read reg index 0x%08x: %d\n",
+ index, ret);
le32_to_cpus(&buf);
*data = buf;
@@ -133,8 +133,8 @@ static int __must_check __smsc75xx_write_reg(struct usbnet *dev, u32 index,
| 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);
+ netdev_warn(dev->net, "Failed to write reg index 0x%08x: %d\n",
+ index, ret);
return ret;
}
@@ -193,7 +193,7 @@ static int smsc75xx_phy_wait_not_busy(struct usbnet *dev)
do {
ret = smsc75xx_read_reg(dev, MII_ACCESS, &val);
- check_warn_return(ret, "Error reading MII_ACCESS");
+ check_warn_return(ret, "Error reading MII_ACCESS\n");
if (!(val & MII_ACCESS_BUSY))
return 0;
@@ -212,7 +212,7 @@ static int smsc75xx_mdio_read(struct net_device *netdev, int phy_id, int idx)
/* confirm MII not busy */
ret = smsc75xx_phy_wait_not_busy(dev);
- check_warn_goto_done(ret, "MII is busy in smsc75xx_mdio_read");
+ check_warn_goto_done(ret, "MII is busy in smsc75xx_mdio_read\n");
/* set the address, index & direction (read from PHY) */
phy_id &= dev->mii.phy_id_mask;
@@ -221,13 +221,13 @@ static int smsc75xx_mdio_read(struct net_device *netdev, int phy_id, int idx)
| ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR)
| MII_ACCESS_READ | MII_ACCESS_BUSY;
ret = smsc75xx_write_reg(dev, MII_ACCESS, addr);
- check_warn_goto_done(ret, "Error writing MII_ACCESS");
+ check_warn_goto_done(ret, "Error writing MII_ACCESS\n");
ret = smsc75xx_phy_wait_not_busy(dev);
- check_warn_goto_done(ret, "Timed out reading MII reg %02X", idx);
+ check_warn_goto_done(ret, "Timed out reading MII reg %02X\n", idx);
ret = smsc75xx_read_reg(dev, MII_DATA, &val);
- check_warn_goto_done(ret, "Error reading MII_DATA");
+ check_warn_goto_done(ret, "Error reading MII_DATA\n");
ret = (u16)(val & 0xFFFF);
@@ -247,11 +247,11 @@ static void smsc75xx_mdio_write(struct net_device *netdev, int phy_id, int idx,
/* confirm MII not busy */
ret = smsc75xx_phy_wait_not_busy(dev);
- check_warn_goto_done(ret, "MII is busy in smsc75xx_mdio_write");
+ check_warn_goto_done(ret, "MII is busy in smsc75xx_mdio_write\n");
val = regval;
ret = smsc75xx_write_reg(dev, MII_DATA, val);
- check_warn_goto_done(ret, "Error writing MII_DATA");
+ check_warn_goto_done(ret, "Error writing MII_DATA\n");
/* set the address, index & direction (write to PHY) */
phy_id &= dev->mii.phy_id_mask;
@@ -260,10 +260,10 @@ static void smsc75xx_mdio_write(struct net_device *netdev, int phy_id, int idx,
| ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR)
| MII_ACCESS_WRITE | MII_ACCESS_BUSY;
ret = smsc75xx_write_reg(dev, MII_ACCESS, addr);
- check_warn_goto_done(ret, "Error writing MII_ACCESS");
+ check_warn_goto_done(ret, "Error writing MII_ACCESS\n");
ret = smsc75xx_phy_wait_not_busy(dev);
- check_warn_goto_done(ret, "Timed out writing MII reg %02X", idx);
+ check_warn_goto_done(ret, "Timed out writing MII reg %02X\n", idx);
done:
mutex_unlock(&dev->phy_mutex);
@@ -277,7 +277,7 @@ static int smsc75xx_wait_eeprom(struct usbnet *dev)
do {
ret = smsc75xx_read_reg(dev, E2P_CMD, &val);
- check_warn_return(ret, "Error reading E2P_CMD");
+ check_warn_return(ret, "Error reading E2P_CMD\n");
if (!(val & E2P_CMD_BUSY) || (val & E2P_CMD_TIMEOUT))
break;
@@ -285,7 +285,7 @@ static int smsc75xx_wait_eeprom(struct usbnet *dev)
} while (!time_after(jiffies, start_time + HZ));
if (val & (E2P_CMD_TIMEOUT | E2P_CMD_BUSY)) {
- netdev_warn(dev->net, "EEPROM read operation timeout");
+ netdev_warn(dev->net, "EEPROM read operation timeout\n");
return -EIO;
}
@@ -300,7 +300,7 @@ static int smsc75xx_eeprom_confirm_not_busy(struct usbnet *dev)
do {
ret = smsc75xx_read_reg(dev, E2P_CMD, &val);
- check_warn_return(ret, "Error reading E2P_CMD");
+ check_warn_return(ret, "Error reading E2P_CMD\n");
if (!(val & E2P_CMD_BUSY))
return 0;
@@ -308,7 +308,7 @@ static int smsc75xx_eeprom_confirm_not_busy(struct usbnet *dev)
udelay(40);
} while (!time_after(jiffies, start_time + HZ));
- netdev_warn(dev->net, "EEPROM is busy");
+ netdev_warn(dev->net, "EEPROM is busy\n");
return -EIO;
}
@@ -328,14 +328,14 @@ static int smsc75xx_read_eeprom(struct usbnet *dev, u32 offset, u32 length,
for (i = 0; i < length; i++) {
val = E2P_CMD_BUSY | E2P_CMD_READ | (offset & E2P_CMD_ADDR);
ret = smsc75xx_write_reg(dev, E2P_CMD, val);
- check_warn_return(ret, "Error writing E2P_CMD");
+ check_warn_return(ret, "Error writing E2P_CMD\n");
ret = smsc75xx_wait_eeprom(dev);
if (ret < 0)
return ret;
ret = smsc75xx_read_reg(dev, E2P_DATA, &val);
- check_warn_return(ret, "Error reading E2P_DATA");
+ check_warn_return(ret, "Error reading E2P_DATA\n");
data[i] = val & 0xFF;
offset++;
@@ -360,7 +360,7 @@ static int smsc75xx_write_eeprom(struct usbnet *dev, u32 offset, u32 length,
/* Issue write/erase enable command */
val = E2P_CMD_BUSY | E2P_CMD_EWEN;
ret = smsc75xx_write_reg(dev, E2P_CMD, val);
- check_warn_return(ret, "Error writing E2P_CMD");
+ check_warn_return(ret, "Error writing E2P_CMD\n");
ret = smsc75xx_wait_eeprom(dev);
if (ret < 0)
@@ -371,12 +371,12 @@ static int smsc75xx_write_eeprom(struct usbnet *dev, u32 offset, u32 length,
/* Fill data register */
val = data[i];
ret = smsc75xx_write_reg(dev, E2P_DATA, val);
- check_warn_return(ret, "Error writing E2P_DATA");
+ check_warn_return(ret, "Error writing E2P_DATA\n");
/* Send "write" command */
val = E2P_CMD_BUSY | E2P_CMD_WRITE | (offset & E2P_CMD_ADDR);
ret = smsc75xx_write_reg(dev, E2P_CMD, val);
- check_warn_return(ret, "Error writing E2P_CMD");
+ check_warn_return(ret, "Error writing E2P_CMD\n");
ret = smsc75xx_wait_eeprom(dev);
if (ret < 0)
@@ -395,7 +395,7 @@ static int smsc75xx_dataport_wait_not_busy(struct usbnet *dev)
for (i = 0; i < 100; i++) {
u32 dp_sel;
ret = smsc75xx_read_reg(dev, DP_SEL, &dp_sel);
- check_warn_return(ret, "Error reading DP_SEL");
+ check_warn_return(ret, "Error reading DP_SEL\n");
if (dp_sel & DP_SEL_DPRDY)
return 0;
@@ -403,7 +403,7 @@ static int smsc75xx_dataport_wait_not_busy(struct usbnet *dev)
udelay(40);
}
- netdev_warn(dev->net, "smsc75xx_dataport_wait_not_busy timed out");
+ netdev_warn(dev->net, "smsc75xx_dataport_wait_not_busy timed out\n");
return -EIO;
}
@@ -418,28 +418,28 @@ static int smsc75xx_dataport_write(struct usbnet *dev, u32 ram_select, u32 addr,
mutex_lock(&pdata->dataport_mutex);
ret = smsc75xx_dataport_wait_not_busy(dev);
- check_warn_goto_done(ret, "smsc75xx_dataport_write busy on entry");
+ check_warn_goto_done(ret, "smsc75xx_dataport_write busy on entry\n");
ret = smsc75xx_read_reg(dev, DP_SEL, &dp_sel);
- check_warn_goto_done(ret, "Error reading DP_SEL");
+ check_warn_goto_done(ret, "Error reading DP_SEL\n");
dp_sel &= ~DP_SEL_RSEL;
dp_sel |= ram_select;
ret = smsc75xx_write_reg(dev, DP_SEL, dp_sel);
- check_warn_goto_done(ret, "Error writing DP_SEL");
+ check_warn_goto_done(ret, "Error writing DP_SEL\n");
for (i = 0; i < length; i++) {
ret = smsc75xx_write_reg(dev, DP_ADDR, addr + i);
- check_warn_goto_done(ret, "Error writing DP_ADDR");
+ check_warn_goto_done(ret, "Error writing DP_ADDR\n");
ret = smsc75xx_write_reg(dev, DP_DATA, buf[i]);
- check_warn_goto_done(ret, "Error writing DP_DATA");
+ check_warn_goto_done(ret, "Error writing DP_DATA\n");
ret = smsc75xx_write_reg(dev, DP_CMD, DP_CMD_WRITE);
- check_warn_goto_done(ret, "Error writing DP_CMD");
+ check_warn_goto_done(ret, "Error writing DP_CMD\n");
ret = smsc75xx_dataport_wait_not_busy(dev);
- check_warn_goto_done(ret, "smsc75xx_dataport_write timeout");
+ check_warn_goto_done(ret, "smsc75xx_dataport_write timeout\n");
}
done:
@@ -460,14 +460,14 @@ static void smsc75xx_deferred_multicast_write(struct work_struct *param)
struct usbnet *dev = pdata->dev;
int ret;
- netif_dbg(dev, drv, dev->net, "deferred multicast write 0x%08x",
- pdata->rfe_ctl);
+ netif_dbg(dev, drv, dev->net, "deferred multicast write 0x%08x\n",
+ pdata->rfe_ctl);
smsc75xx_dataport_write(dev, DP_SEL_VHF, DP_SEL_VHF_VLAN_LEN,
DP_SEL_VHF_HASH_LEN, pdata->multicast_hash_table);
ret = smsc75xx_write_reg(dev, RFE_CTL, pdata->rfe_ctl);
- check_warn(ret, "Error writing RFE_CRL");
+ check_warn(ret, "Error writing RFE_CRL\n");
}
static void smsc75xx_set_multicast(struct net_device *netdev)
@@ -487,15 +487,15 @@ static void smsc75xx_set_multicast(struct net_device *netdev)
pdata->multicast_hash_table[i] = 0;
if (dev->net->flags & IFF_PROMISC) {
- netif_dbg(dev, drv, dev->net, "promiscuous mode enabled");
+ netif_dbg(dev, drv, dev->net, "promiscuous mode enabled\n");
pdata->rfe_ctl |= RFE_CTL_AM | RFE_CTL_AU;
} else if (dev->net->flags & IFF_ALLMULTI) {
- netif_dbg(dev, drv, dev->net, "receive all multicast enabled");
+ netif_dbg(dev, drv, dev->net, "receive all multicast enabled\n");
pdata->rfe_ctl |= RFE_CTL_AM | RFE_CTL_DPF;
} else if (!netdev_mc_empty(dev->net)) {
struct netdev_hw_addr *ha;
- netif_dbg(dev, drv, dev->net, "receive multicast hash filter");
+ netif_dbg(dev, drv, dev->net, "receive multicast hash filter\n");
pdata->rfe_ctl |= RFE_CTL_MHF | RFE_CTL_DPF;
@@ -505,7 +505,7 @@ static void smsc75xx_set_multicast(struct net_device *netdev)
(1 << (bitnum % 32));
}
} else {
- netif_dbg(dev, drv, dev->net, "receive own packets only");
+ netif_dbg(dev, drv, dev->net, "receive own packets only\n");
pdata->rfe_ctl |= RFE_CTL_DPF;
}
@@ -533,18 +533,18 @@ static int smsc75xx_update_flowcontrol(struct usbnet *dev, u8 duplex,
if (cap & FLOW_CTRL_RX)
flow |= FLOW_RX_FCEN;
- netif_dbg(dev, link, dev->net, "rx pause %s, tx pause %s",
- (cap & FLOW_CTRL_RX ? "enabled" : "disabled"),
- (cap & FLOW_CTRL_TX ? "enabled" : "disabled"));
+ netif_dbg(dev, link, dev->net, "rx pause %s, tx pause %s\n",
+ (cap & FLOW_CTRL_RX ? "enabled" : "disabled"),
+ (cap & FLOW_CTRL_TX ? "enabled" : "disabled"));
} else {
- netif_dbg(dev, link, dev->net, "half duplex");
+ netif_dbg(dev, link, dev->net, "half duplex\n");
}
ret = smsc75xx_write_reg(dev, FLOW, flow);
- check_warn_return(ret, "Error writing FLOW");
+ check_warn_return(ret, "Error writing FLOW\n");
ret = smsc75xx_write_reg(dev, FCT_FLOW, fct_flow);
- check_warn_return(ret, "Error writing FCT_FLOW");
+ check_warn_return(ret, "Error writing FCT_FLOW\n");
return 0;
}
@@ -561,16 +561,15 @@ static int smsc75xx_link_reset(struct usbnet *dev)
PHY_INT_SRC_CLEAR_ALL);
ret = smsc75xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL);
- check_warn_return(ret, "Error writing INT_STS");
+ check_warn_return(ret, "Error writing INT_STS\n");
mii_check_media(mii, 1, 1);
mii_ethtool_gset(&dev->mii, &ecmd);
lcladv = smsc75xx_mdio_read(dev->net, mii->phy_id, MII_ADVERTISE);
rmtadv = smsc75xx_mdio_read(dev->net, mii->phy_id, MII_LPA);
- netif_dbg(dev, link, dev->net, "speed: %u duplex: %d lcladv: %04x"
- " rmtadv: %04x", ethtool_cmd_speed(&ecmd),
- ecmd.duplex, lcladv, rmtadv);
+ netif_dbg(dev, link, dev->net, "speed: %u duplex: %d lcladv: %04x rmtadv: %04x\n",
+ ethtool_cmd_speed(&ecmd), ecmd.duplex, lcladv, rmtadv);
return smsc75xx_update_flowcontrol(dev, ecmd.duplex, lcladv, rmtadv);
}
@@ -580,21 +579,21 @@ static void smsc75xx_status(struct usbnet *dev, struct urb *urb)
u32 intdata;
if (urb->actual_length != 4) {
- netdev_warn(dev->net,
- "unexpected urb length %d", urb->actual_length);
+ netdev_warn(dev->net, "unexpected urb length %d\n",
+ urb->actual_length);
return;
}
memcpy(&intdata, urb->transfer_buffer, 4);
le32_to_cpus(&intdata);
- netif_dbg(dev, link, dev->net, "intdata: 0x%08X", intdata);
+ netif_dbg(dev, link, dev->net, "intdata: 0x%08X\n", intdata);
if (intdata & INT_ENP_PHY_INT)
usbnet_defer_kevent(dev, EVENT_LINK_RESET);
else
- netdev_warn(dev->net,
- "unexpected interrupt, intdata=0x%08X", intdata);
+ netdev_warn(dev->net, "unexpected interrupt, intdata=0x%08X\n",
+ intdata);
}
static int smsc75xx_ethtool_get_eeprom_len(struct net_device *net)
@@ -618,8 +617,8 @@ static int smsc75xx_ethtool_set_eeprom(struct net_device *netdev,
struct usbnet *dev = netdev_priv(netdev);
if (ee->magic != LAN75XX_EEPROM_MAGIC) {
- netdev_warn(dev->net,
- "EEPROM: magic value mismatch: 0x%x", ee->magic);
+ netdev_warn(dev->net, "EEPROM: magic value mismatch: 0x%x\n",
+ ee->magic);
return -EINVAL;
}
@@ -679,14 +678,14 @@ static void smsc75xx_init_mac_address(struct usbnet *dev)
if (is_valid_ether_addr(dev->net->dev_addr)) {
/* eeprom values are valid so use them */
netif_dbg(dev, ifup, dev->net,
- "MAC address read from EEPROM");
+ "MAC address read from EEPROM\n");
return;
}
}
/* no eeprom, or eeprom values are invalid. generate random MAC */
eth_hw_addr_random(dev->net);
- netif_dbg(dev, ifup, dev->net, "MAC address set to eth_random_addr");
+ netif_dbg(dev, ifup, dev->net, "MAC address set to eth_random_addr\n");
}
static int smsc75xx_set_mac_address(struct usbnet *dev)
@@ -696,17 +695,17 @@ static int smsc75xx_set_mac_address(struct usbnet *dev)
u32 addr_hi = dev->net->dev_addr[4] | dev->net->dev_addr[5] << 8;
int ret = smsc75xx_write_reg(dev, RX_ADDRH, addr_hi);
- check_warn_return(ret, "Failed to write RX_ADDRH: %d", ret);
+ check_warn_return(ret, "Failed to write RX_ADDRH: %d\n", ret);
ret = smsc75xx_write_reg(dev, RX_ADDRL, addr_lo);
- check_warn_return(ret, "Failed to write RX_ADDRL: %d", ret);
+ check_warn_return(ret, "Failed to write RX_ADDRL: %d\n", ret);
addr_hi |= ADDR_FILTX_FB_VALID;
ret = smsc75xx_write_reg(dev, ADDR_FILTX, addr_hi);
- check_warn_return(ret, "Failed to write ADDR_FILTX: %d", ret);
+ check_warn_return(ret, "Failed to write ADDR_FILTX: %d\n", ret);
ret = smsc75xx_write_reg(dev, ADDR_FILTX + 4, addr_lo);
- check_warn_return(ret, "Failed to write ADDR_FILTX+4: %d", ret);
+ check_warn_return(ret, "Failed to write ADDR_FILTX+4: %d\n", ret);
return 0;
}
@@ -730,12 +729,12 @@ static int smsc75xx_phy_initialize(struct usbnet *dev)
do {
msleep(10);
bmcr = smsc75xx_mdio_read(dev->net, dev->mii.phy_id, MII_BMCR);
- check_warn_return(bmcr, "Error reading MII_BMCR");
+ check_warn_return(bmcr, "Error reading MII_BMCR\n");
timeout++;
} while ((bmcr & BMCR_RESET) && (timeout < 100));
if (timeout >= 100) {
- netdev_warn(dev->net, "timeout on PHY Reset");
+ netdev_warn(dev->net, "timeout on PHY Reset\n");
return -EIO;
}
@@ -747,14 +746,14 @@ static int smsc75xx_phy_initialize(struct usbnet *dev)
/* read and write to clear phy interrupt status */
ret = smsc75xx_mdio_read(dev->net, dev->mii.phy_id, PHY_INT_SRC);
- check_warn_return(ret, "Error reading PHY_INT_SRC");
+ check_warn_return(ret, "Error reading PHY_INT_SRC\n");
smsc75xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_SRC, 0xffff);
smsc75xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_MASK,
PHY_INT_MASK_DEFAULT);
mii_nway_restart(&dev->mii);
- netif_dbg(dev, ifup, dev->net, "phy initialised successfully");
+ netif_dbg(dev, ifup, dev->net, "phy initialised successfully\n");
return 0;
}
@@ -765,14 +764,14 @@ static int smsc75xx_set_rx_max_frame_length(struct usbnet *dev, int size)
bool rxenabled;
ret = smsc75xx_read_reg(dev, MAC_RX, &buf);
- check_warn_return(ret, "Failed to read MAC_RX: %d", ret);
+ check_warn_return(ret, "Failed to read MAC_RX: %d\n", ret);
rxenabled = ((buf & MAC_RX_RXEN) != 0);
if (rxenabled) {
buf &= ~MAC_RX_RXEN;
ret = smsc75xx_write_reg(dev, MAC_RX, buf);
- check_warn_return(ret, "Failed to write MAC_RX: %d", ret);
+ check_warn_return(ret, "Failed to write MAC_RX: %d\n", ret);
}
/* add 4 to size for FCS */
@@ -780,12 +779,12 @@ static int smsc75xx_set_rx_max_frame_length(struct usbnet *dev, int size)
buf |= (((size + 4) << MAC_RX_MAX_SIZE_SHIFT) & MAC_RX_MAX_SIZE);
ret = smsc75xx_write_reg(dev, MAC_RX, buf);
- check_warn_return(ret, "Failed to write MAC_RX: %d", ret);
+ check_warn_return(ret, "Failed to write MAC_RX: %d\n", ret);
if (rxenabled) {
buf |= MAC_RX_RXEN;
ret = smsc75xx_write_reg(dev, MAC_RX, buf);
- check_warn_return(ret, "Failed to write MAC_RX: %d", ret);
+ check_warn_return(ret, "Failed to write MAC_RX: %d\n", ret);
}
return 0;
@@ -796,7 +795,7 @@ static int smsc75xx_change_mtu(struct net_device *netdev, int new_mtu)
struct usbnet *dev = netdev_priv(netdev);
int ret = smsc75xx_set_rx_max_frame_length(dev, new_mtu);
- check_warn_return(ret, "Failed to set mac rx frame length");
+ check_warn_return(ret, "Failed to set mac rx frame length\n");
return usbnet_change_mtu(netdev, new_mtu);
}
@@ -821,7 +820,7 @@ static int smsc75xx_set_features(struct net_device *netdev,
/* it's racing here! */
ret = smsc75xx_write_reg(dev, RFE_CTL, pdata->rfe_ctl);
- check_warn_return(ret, "Error writing RFE_CTL");
+ check_warn_return(ret, "Error writing RFE_CTL\n");
return 0;
}
@@ -836,7 +835,7 @@ static int smsc75xx_wait_ready(struct usbnet *dev, int in_pm)
ret = __smsc75xx_read_reg(dev, PMT_CTL, &buf, in_pm);
- check_warn_return(ret, "Failed to read PMT_CTL: %d", ret);
+ check_warn_return(ret, "Failed to read PMT_CTL: %d\n", ret);
if (buf & PMT_CTL_DEV_RDY)
return 0;
@@ -845,7 +844,7 @@ static int smsc75xx_wait_ready(struct usbnet *dev, int in_pm)
timeout++;
} while (timeout < 100);
- netdev_warn(dev->net, "timeout waiting for device ready");
+ netdev_warn(dev->net, "timeout waiting for device ready\n");
return -EIO;
}
@@ -855,79 +854,81 @@ static int smsc75xx_reset(struct usbnet *dev)
u32 buf;
int ret = 0, timeout;
- netif_dbg(dev, ifup, dev->net, "entering smsc75xx_reset");
+ netif_dbg(dev, ifup, dev->net, "entering smsc75xx_reset\n");
ret = smsc75xx_wait_ready(dev, 0);
- check_warn_return(ret, "device not ready in smsc75xx_reset");
+ check_warn_return(ret, "device not ready in smsc75xx_reset\n");
ret = smsc75xx_read_reg(dev, HW_CFG, &buf);
- check_warn_return(ret, "Failed to read HW_CFG: %d", ret);
+ check_warn_return(ret, "Failed to read HW_CFG: %d\n", ret);
buf |= HW_CFG_LRST;
ret = smsc75xx_write_reg(dev, HW_CFG, buf);
- check_warn_return(ret, "Failed to write HW_CFG: %d", ret);
+ check_warn_return(ret, "Failed to write HW_CFG: %d\n", ret);
timeout = 0;
do {
msleep(10);
ret = smsc75xx_read_reg(dev, HW_CFG, &buf);
- check_warn_return(ret, "Failed to read HW_CFG: %d", ret);
+ check_warn_return(ret, "Failed to read HW_CFG: %d\n", ret);
timeout++;
} while ((buf & HW_CFG_LRST) && (timeout < 100));
if (timeout >= 100) {
- netdev_warn(dev->net, "timeout on completion of Lite Reset");
+ netdev_warn(dev->net, "timeout on completion of Lite Reset\n");
return -EIO;
}
- netif_dbg(dev, ifup, dev->net, "Lite reset complete, resetting PHY");
+ netif_dbg(dev, ifup, dev->net, "Lite reset complete, resetting PHY\n");
ret = smsc75xx_read_reg(dev, PMT_CTL, &buf);
- check_warn_return(ret, "Failed to read PMT_CTL: %d", ret);
+ check_warn_return(ret, "Failed to read PMT_CTL: %d\n", ret);
buf |= PMT_CTL_PHY_RST;
ret = smsc75xx_write_reg(dev, PMT_CTL, buf);
- check_warn_return(ret, "Failed to write PMT_CTL: %d", ret);
+ check_warn_return(ret, "Failed to write PMT_CTL: %d\n", ret);
timeout = 0;
do {
msleep(10);
ret = smsc75xx_read_reg(dev, PMT_CTL, &buf);
- check_warn_return(ret, "Failed to read PMT_CTL: %d", ret);
+ check_warn_return(ret, "Failed to read PMT_CTL: %d\n", ret);
timeout++;
} while ((buf & PMT_CTL_PHY_RST) && (timeout < 100));
if (timeout >= 100) {
- netdev_warn(dev->net, "timeout waiting for PHY Reset");
+ netdev_warn(dev->net, "timeout waiting for PHY Reset\n");
return -EIO;
}
- netif_dbg(dev, ifup, dev->net, "PHY reset complete");
+ netif_dbg(dev, ifup, dev->net, "PHY reset complete\n");
smsc75xx_init_mac_address(dev);
ret = smsc75xx_set_mac_address(dev);
- check_warn_return(ret, "Failed to set mac address");
+ check_warn_return(ret, "Failed to set mac address\n");
- netif_dbg(dev, ifup, dev->net, "MAC Address: %pM", dev->net->dev_addr);
+ netif_dbg(dev, ifup, dev->net, "MAC Address: %pM\n",
+ dev->net->dev_addr);
ret = smsc75xx_read_reg(dev, HW_CFG, &buf);
- check_warn_return(ret, "Failed to read HW_CFG: %d", ret);
+ check_warn_return(ret, "Failed to read HW_CFG: %d\n", ret);
- netif_dbg(dev, ifup, dev->net, "Read Value from HW_CFG : 0x%08x", buf);
+ netif_dbg(dev, ifup, dev->net, "Read Value from HW_CFG : 0x%08x\n",
+ buf);
buf |= HW_CFG_BIR;
ret = smsc75xx_write_reg(dev, HW_CFG, buf);
- check_warn_return(ret, "Failed to write HW_CFG: %d", ret);
+ check_warn_return(ret, "Failed to write HW_CFG: %d\n", ret);
ret = smsc75xx_read_reg(dev, HW_CFG, &buf);
- check_warn_return(ret, "Failed to read HW_CFG: %d", ret);
+ check_warn_return(ret, "Failed to read HW_CFG: %d\n", ret);
- netif_dbg(dev, ifup, dev->net, "Read Value from HW_CFG after "
- "writing HW_CFG_BIR: 0x%08x", buf);
+ netif_dbg(dev, ifup, dev->net, "Read Value from HW_CFG after writing HW_CFG_BIR: 0x%08x\n",
+ buf);
if (!turbo_mode) {
buf = 0;
@@ -940,99 +941,102 @@ static int smsc75xx_reset(struct usbnet *dev)
dev->rx_urb_size = DEFAULT_FS_BURST_CAP_SIZE;
}
- netif_dbg(dev, ifup, dev->net, "rx_urb_size=%ld",
- (ulong)dev->rx_urb_size);
+ netif_dbg(dev, ifup, dev->net, "rx_urb_size=%ld\n",
+ (ulong)dev->rx_urb_size);
ret = smsc75xx_write_reg(dev, BURST_CAP, buf);
- check_warn_return(ret, "Failed to write BURST_CAP: %d", ret);
+ check_warn_return(ret, "Failed to write BURST_CAP: %d\n", ret);
ret = smsc75xx_read_reg(dev, BURST_CAP, &buf);
- check_warn_return(ret, "Failed to read BURST_CAP: %d", ret);
+ check_warn_return(ret, "Failed to read BURST_CAP: %d\n", ret);
netif_dbg(dev, ifup, dev->net,
- "Read Value from BURST_CAP after writing: 0x%08x", buf);
+ "Read Value from BURST_CAP after writing: 0x%08x\n", buf);
ret = smsc75xx_write_reg(dev, BULK_IN_DLY, DEFAULT_BULK_IN_DELAY);
- check_warn_return(ret, "Failed to write BULK_IN_DLY: %d", ret);
+ check_warn_return(ret, "Failed to write BULK_IN_DLY: %d\n", ret);
ret = smsc75xx_read_reg(dev, BULK_IN_DLY, &buf);
- check_warn_return(ret, "Failed to read BULK_IN_DLY: %d", ret);
+ check_warn_return(ret, "Failed to read BULK_IN_DLY: %d\n", ret);
netif_dbg(dev, ifup, dev->net,
- "Read Value from BULK_IN_DLY after writing: 0x%08x", buf);
+ "Read Value from BULK_IN_DLY after writing: 0x%08x\n", buf);
if (turbo_mode) {
ret = smsc75xx_read_reg(dev, HW_CFG, &buf);
- check_warn_return(ret, "Failed to read HW_CFG: %d", ret);
+ check_warn_return(ret, "Failed to read HW_CFG: %d\n", ret);
- netif_dbg(dev, ifup, dev->net, "HW_CFG: 0x%08x", buf);
+ netif_dbg(dev, ifup, dev->net, "HW_CFG: 0x%08x\n", buf);
buf |= (HW_CFG_MEF | HW_CFG_BCE);
ret = smsc75xx_write_reg(dev, HW_CFG, buf);
- check_warn_return(ret, "Failed to write HW_CFG: %d", ret);
+ check_warn_return(ret, "Failed to write HW_CFG: %d\n", ret);
ret = smsc75xx_read_reg(dev, HW_CFG, &buf);
- check_warn_return(ret, "Failed to read HW_CFG: %d", ret);
+ check_warn_return(ret, "Failed to read HW_CFG: %d\n", ret);
- netif_dbg(dev, ifup, dev->net, "HW_CFG: 0x%08x", buf);
+ netif_dbg(dev, ifup, dev->net, "HW_CFG: 0x%08x\n", buf);
}
/* set FIFO sizes */
buf = (MAX_RX_FIFO_SIZE - 512) / 512;
ret = smsc75xx_write_reg(dev, FCT_RX_FIFO_END, buf);
- check_warn_return(ret, "Failed to write FCT_RX_FIFO_END: %d", ret);
+ check_warn_return(ret, "Failed to write FCT_RX_FIFO_END: %d\n", ret);
- netif_dbg(dev, ifup, dev->net, "FCT_RX_FIFO_END set to 0x%08x", buf);
+ netif_dbg(dev, ifup, dev->net, "FCT_RX_FIFO_END set to 0x%08x\n", buf);
buf = (MAX_TX_FIFO_SIZE - 512) / 512;
ret = smsc75xx_write_reg(dev, FCT_TX_FIFO_END, buf);
- check_warn_return(ret, "Failed to write FCT_TX_FIFO_END: %d", ret);
+ check_warn_return(ret, "Failed to write FCT_TX_FIFO_END: %d\n", ret);
- netif_dbg(dev, ifup, dev->net, "FCT_TX_FIFO_END set to 0x%08x", buf);
+ netif_dbg(dev, ifup, dev->net, "FCT_TX_FIFO_END set to 0x%08x\n", buf);
ret = smsc75xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL);
- check_warn_return(ret, "Failed to write INT_STS: %d", ret);
+ check_warn_return(ret, "Failed to write INT_STS: %d\n", ret);
ret = smsc75xx_read_reg(dev, ID_REV, &buf);
- check_warn_return(ret, "Failed to read ID_REV: %d", ret);
+ check_warn_return(ret, "Failed to read ID_REV: %d\n", ret);
- netif_dbg(dev, ifup, dev->net, "ID_REV = 0x%08x", buf);
+ netif_dbg(dev, ifup, dev->net, "ID_REV = 0x%08x\n", buf);
ret = smsc75xx_read_reg(dev, E2P_CMD, &buf);
- check_warn_return(ret, "Failed to read E2P_CMD: %d", ret);
+ check_warn_return(ret, "Failed to read E2P_CMD: %d\n", ret);
/* only set default GPIO/LED settings if no EEPROM is detected */
if (!(buf & E2P_CMD_LOADED)) {
ret = smsc75xx_read_reg(dev, LED_GPIO_CFG, &buf);
- check_warn_return(ret, "Failed to read LED_GPIO_CFG: %d", ret);
+ check_warn_return(ret, "Failed to read LED_GPIO_CFG: %d\n",
+ ret);
buf &= ~(LED_GPIO_CFG_LED2_FUN_SEL | LED_GPIO_CFG_LED10_FUN_SEL);
buf |= LED_GPIO_CFG_LEDGPIO_EN | LED_GPIO_CFG_LED2_FUN_SEL;
ret = smsc75xx_write_reg(dev, LED_GPIO_CFG, buf);
- check_warn_return(ret, "Failed to write LED_GPIO_CFG: %d", ret);
+ check_warn_return(ret, "Failed to write LED_GPIO_CFG: %d\n",
+ ret);
}
ret = smsc75xx_write_reg(dev, FLOW, 0);
- check_warn_return(ret, "Failed to write FLOW: %d", ret);
+ check_warn_return(ret, "Failed to write FLOW: %d\n", ret);
ret = smsc75xx_write_reg(dev, FCT_FLOW, 0);
- check_warn_return(ret, "Failed to write FCT_FLOW: %d", ret);
+ check_warn_return(ret, "Failed to write FCT_FLOW: %d\n", ret);
/* Don't need rfe_ctl_lock during initialisation */
ret = smsc75xx_read_reg(dev, RFE_CTL, &pdata->rfe_ctl);
- check_warn_return(ret, "Failed to read RFE_CTL: %d", ret);
+ check_warn_return(ret, "Failed to read RFE_CTL: %d\n", ret);
pdata->rfe_ctl |= RFE_CTL_AB | RFE_CTL_DPF;
ret = smsc75xx_write_reg(dev, RFE_CTL, pdata->rfe_ctl);
- check_warn_return(ret, "Failed to write RFE_CTL: %d", ret);
+ check_warn_return(ret, "Failed to write RFE_CTL: %d\n", ret);
ret = smsc75xx_read_reg(dev, RFE_CTL, &pdata->rfe_ctl);
- check_warn_return(ret, "Failed to read RFE_CTL: %d", ret);
+ check_warn_return(ret, "Failed to read RFE_CTL: %d\n", ret);
- netif_dbg(dev, ifup, dev->net, "RFE_CTL set to 0x%08x", pdata->rfe_ctl);
+ netif_dbg(dev, ifup, dev->net, "RFE_CTL set to 0x%08x\n",
+ pdata->rfe_ctl);
/* Enable or disable checksum offload engines */
smsc75xx_set_features(dev->net, dev->net->features);
@@ -1040,69 +1044,69 @@ static int smsc75xx_reset(struct usbnet *dev)
smsc75xx_set_multicast(dev->net);
ret = smsc75xx_phy_initialize(dev);
- check_warn_return(ret, "Failed to initialize PHY: %d", ret);
+ check_warn_return(ret, "Failed to initialize PHY: %d\n", ret);
ret = smsc75xx_read_reg(dev, INT_EP_CTL, &buf);
- check_warn_return(ret, "Failed to read INT_EP_CTL: %d", ret);
+ check_warn_return(ret, "Failed to read INT_EP_CTL: %d\n", ret);
/* enable PHY interrupts */
buf |= INT_ENP_PHY_INT;
ret = smsc75xx_write_reg(dev, INT_EP_CTL, buf);
- check_warn_return(ret, "Failed to write INT_EP_CTL: %d", ret);
+ check_warn_return(ret, "Failed to write INT_EP_CTL: %d\n", ret);
/* allow mac to detect speed and duplex from phy */
ret = smsc75xx_read_reg(dev, MAC_CR, &buf);
- check_warn_return(ret, "Failed to read MAC_CR: %d", ret);
+ check_warn_return(ret, "Failed to read MAC_CR: %d\n", ret);
buf |= (MAC_CR_ADD | MAC_CR_ASD);
ret = smsc75xx_write_reg(dev, MAC_CR, buf);
- check_warn_return(ret, "Failed to write MAC_CR: %d", ret);
+ check_warn_return(ret, "Failed to write MAC_CR: %d\n", ret);
ret = smsc75xx_read_reg(dev, MAC_TX, &buf);
- check_warn_return(ret, "Failed to read MAC_TX: %d", ret);
+ check_warn_return(ret, "Failed to read MAC_TX: %d\n", ret);
buf |= MAC_TX_TXEN;
ret = smsc75xx_write_reg(dev, MAC_TX, buf);
- check_warn_return(ret, "Failed to write MAC_TX: %d", ret);
+ check_warn_return(ret, "Failed to write MAC_TX: %d\n", ret);
- netif_dbg(dev, ifup, dev->net, "MAC_TX set to 0x%08x", buf);
+ netif_dbg(dev, ifup, dev->net, "MAC_TX set to 0x%08x\n", buf);
ret = smsc75xx_read_reg(dev, FCT_TX_CTL, &buf);
- check_warn_return(ret, "Failed to read FCT_TX_CTL: %d", ret);
+ check_warn_return(ret, "Failed to read FCT_TX_CTL: %d\n", ret);
buf |= FCT_TX_CTL_EN;
ret = smsc75xx_write_reg(dev, FCT_TX_CTL, buf);
- check_warn_return(ret, "Failed to write FCT_TX_CTL: %d", ret);
+ check_warn_return(ret, "Failed to write FCT_TX_CTL: %d\n", ret);
- netif_dbg(dev, ifup, dev->net, "FCT_TX_CTL set to 0x%08x", buf);
+ netif_dbg(dev, ifup, dev->net, "FCT_TX_CTL set to 0x%08x\n", buf);
ret = smsc75xx_set_rx_max_frame_length(dev, 1514);
- check_warn_return(ret, "Failed to set max rx frame length");
+ check_warn_return(ret, "Failed to set max rx frame length\n");
ret = smsc75xx_read_reg(dev, MAC_RX, &buf);
- check_warn_return(ret, "Failed to read MAC_RX: %d", ret);
+ check_warn_return(ret, "Failed to read MAC_RX: %d\n", ret);
buf |= MAC_RX_RXEN;
ret = smsc75xx_write_reg(dev, MAC_RX, buf);
- check_warn_return(ret, "Failed to write MAC_RX: %d", ret);
+ check_warn_return(ret, "Failed to write MAC_RX: %d\n", ret);
- netif_dbg(dev, ifup, dev->net, "MAC_RX set to 0x%08x", buf);
+ netif_dbg(dev, ifup, dev->net, "MAC_RX set to 0x%08x\n", buf);
ret = smsc75xx_read_reg(dev, FCT_RX_CTL, &buf);
- check_warn_return(ret, "Failed to read FCT_RX_CTL: %d", ret);
+ check_warn_return(ret, "Failed to read FCT_RX_CTL: %d\n", ret);
buf |= FCT_RX_CTL_EN;
ret = smsc75xx_write_reg(dev, FCT_RX_CTL, buf);
- check_warn_return(ret, "Failed to write FCT_RX_CTL: %d", ret);
+ check_warn_return(ret, "Failed to write FCT_RX_CTL: %d\n", ret);
- netif_dbg(dev, ifup, dev->net, "FCT_RX_CTL set to 0x%08x", buf);
+ netif_dbg(dev, ifup, dev->net, "FCT_RX_CTL set to 0x%08x\n", buf);
- netif_dbg(dev, ifup, dev->net, "smsc75xx_reset, return 0");
+ netif_dbg(dev, ifup, dev->net, "smsc75xx_reset, return 0\n");
return 0;
}
@@ -1127,14 +1131,14 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf)
printk(KERN_INFO SMSC_CHIPNAME " v" SMSC_DRIVER_VERSION "\n");
ret = usbnet_get_endpoints(dev, intf);
- check_warn_return(ret, "usbnet_get_endpoints failed: %d", ret);
+ check_warn_return(ret, "usbnet_get_endpoints failed: %d\n", ret);
dev->data[0] = (unsigned long)kzalloc(sizeof(struct smsc75xx_priv),
GFP_KERNEL);
pdata = (struct smsc75xx_priv *)(dev->data[0]);
if (!pdata) {
- netdev_warn(dev->net, "Unable to allocate smsc75xx_priv");
+ netdev_warn(dev->net, "Unable to allocate smsc75xx_priv\n");
return -ENOMEM;
}
@@ -1172,7 +1176,7 @@ static void smsc75xx_unbind(struct usbnet *dev, struct usb_interface *intf)
{
struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]);
if (pdata) {
- netif_dbg(dev, ifdown, dev->net, "free pdata");
+ netif_dbg(dev, ifdown, dev->net, "free pdata\n");
kfree(pdata);
pdata = NULL;
dev->data[0] = 0;
@@ -1192,19 +1196,19 @@ static int smsc75xx_write_wuff(struct usbnet *dev, int filter, u32 wuf_cfg,
int ret;
ret = smsc75xx_write_reg(dev, cfg_base, wuf_cfg);
- check_warn_return(ret, "Error writing WUF_CFGX");
+ check_warn_return(ret, "Error writing WUF_CFGX\n");
ret = smsc75xx_write_reg(dev, mask_base, wuf_mask1);
- check_warn_return(ret, "Error writing WUF_MASKX");
+ check_warn_return(ret, "Error writing WUF_MASKX\n");
ret = smsc75xx_write_reg(dev, mask_base + 4, 0);
- check_warn_return(ret, "Error writing WUF_MASKX");
+ check_warn_return(ret, "Error writing WUF_MASKX\n");
ret = smsc75xx_write_reg(dev, mask_base + 8, 0);
- check_warn_return(ret, "Error writing WUF_MASKX");
+ check_warn_return(ret, "Error writing WUF_MASKX\n");
ret = smsc75xx_write_reg(dev, mask_base + 12, 0);
- check_warn_return(ret, "Error writing WUF_MASKX");
+ check_warn_return(ret, "Error writing WUF_MASKX\n");
return 0;
}
@@ -1217,38 +1221,38 @@ static int smsc75xx_suspend(struct usb_interface *intf, pm_message_t message)
u32 val;
ret = usbnet_suspend(intf, message);
- check_warn_return(ret, "usbnet_suspend error");
+ check_warn_return(ret, "usbnet_suspend error\n");
/* if no wol options set, enter lowest power SUSPEND2 mode */
if (!(pdata->wolopts & SUPPORTED_WAKE)) {
- netdev_info(dev->net, "entering SUSPEND2 mode");
+ netdev_info(dev->net, "entering SUSPEND2 mode\n");
/* disable energy detect (link up) & wake up events */
ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
- check_warn_return(ret, "Error reading WUCSR");
+ check_warn_return(ret, "Error reading WUCSR\n");
val &= ~(WUCSR_MPEN | WUCSR_WUEN);
ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
- check_warn_return(ret, "Error writing WUCSR");
+ check_warn_return(ret, "Error writing WUCSR\n");
ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val);
- check_warn_return(ret, "Error reading PMT_CTL");
+ check_warn_return(ret, "Error reading PMT_CTL\n");
val &= ~(PMT_CTL_ED_EN | PMT_CTL_WOL_EN);
ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val);
- check_warn_return(ret, "Error writing PMT_CTL");
+ check_warn_return(ret, "Error writing PMT_CTL\n");
/* enter suspend2 mode */
ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val);
- check_warn_return(ret, "Error reading PMT_CTL");
+ check_warn_return(ret, "Error reading PMT_CTL\n");
val &= ~(PMT_CTL_SUS_MODE | PMT_CTL_WUPS | PMT_CTL_PHY_RST);
val |= PMT_CTL_SUS_MODE_2;
ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val);
- check_warn_return(ret, "Error writing PMT_CTL");
+ check_warn_return(ret, "Error writing PMT_CTL\n");
return 0;
}
@@ -1259,120 +1263,120 @@ 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_nopm(dev, WUF_CFGX + i * 4, 0);
- check_warn_return(ret, "Error writing WUF_CFGX");
+ check_warn_return(ret, "Error writing WUF_CFGX\n");
}
if (pdata->wolopts & WAKE_MCAST) {
const u8 mcast[] = {0x01, 0x00, 0x5E};
- netdev_info(dev->net, "enabling multicast detection");
+ netdev_info(dev->net, "enabling multicast detection\n");
val = WUF_CFGX_EN | WUF_CFGX_ATYPE_MULTICAST
| smsc_crc(mcast, 3);
ret = smsc75xx_write_wuff(dev, filter++, val, 0x0007);
- check_warn_return(ret, "Error writing wakeup filter");
+ check_warn_return(ret, "Error writing wakeup filter\n");
}
if (pdata->wolopts & WAKE_ARP) {
const u8 arp[] = {0x08, 0x06};
- netdev_info(dev->net, "enabling ARP detection");
+ netdev_info(dev->net, "enabling ARP detection\n");
val = WUF_CFGX_EN | WUF_CFGX_ATYPE_ALL | (0x0C << 16)
| smsc_crc(arp, 2);
ret = smsc75xx_write_wuff(dev, filter++, val, 0x0003);
- check_warn_return(ret, "Error writing wakeup filter");
+ check_warn_return(ret, "Error writing wakeup filter\n");
}
/* clear any pending pattern match packet status */
ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
- check_warn_return(ret, "Error reading WUCSR");
+ check_warn_return(ret, "Error reading WUCSR\n");
val |= WUCSR_WUFR;
ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
- check_warn_return(ret, "Error writing WUCSR");
+ check_warn_return(ret, "Error writing WUCSR\n");
- netdev_info(dev->net, "enabling packet match detection");
+ netdev_info(dev->net, "enabling packet match detection\n");
ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
- check_warn_return(ret, "Error reading WUCSR");
+ check_warn_return(ret, "Error reading WUCSR\n");
val |= WUCSR_WUEN;
ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
- check_warn_return(ret, "Error writing WUCSR");
+ check_warn_return(ret, "Error writing WUCSR\n");
} else {
- netdev_info(dev->net, "disabling packet match detection");
+ netdev_info(dev->net, "disabling packet match detection\n");
ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
- check_warn_return(ret, "Error reading WUCSR");
+ check_warn_return(ret, "Error reading WUCSR\n");
val &= ~WUCSR_WUEN;
ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
- check_warn_return(ret, "Error writing WUCSR");
+ check_warn_return(ret, "Error writing WUCSR\n");
}
/* disable magic, bcast & unicast wakeup sources */
ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
- check_warn_return(ret, "Error reading WUCSR");
+ check_warn_return(ret, "Error reading WUCSR\n");
val &= ~(WUCSR_MPEN | WUCSR_BCST_EN | WUCSR_PFDA_EN);
ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
- check_warn_return(ret, "Error writing WUCSR");
+ check_warn_return(ret, "Error writing WUCSR\n");
if (pdata->wolopts & WAKE_MAGIC) {
- netdev_info(dev->net, "enabling magic packet wakeup");
+ netdev_info(dev->net, "enabling magic packet wakeup\n");
ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
- check_warn_return(ret, "Error reading WUCSR");
+ check_warn_return(ret, "Error reading WUCSR\n");
/* clear any pending magic packet status */
val |= WUCSR_MPR | WUCSR_MPEN;
ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
- check_warn_return(ret, "Error writing WUCSR");
+ check_warn_return(ret, "Error writing WUCSR\n");
}
if (pdata->wolopts & WAKE_BCAST) {
- netdev_info(dev->net, "enabling broadcast detection");
+ netdev_info(dev->net, "enabling broadcast detection\n");
ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
- check_warn_return(ret, "Error reading WUCSR");
+ check_warn_return(ret, "Error reading WUCSR\n");
val |= WUCSR_BCAST_FR | WUCSR_BCST_EN;
ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
- check_warn_return(ret, "Error writing WUCSR");
+ check_warn_return(ret, "Error writing WUCSR\n");
}
if (pdata->wolopts & WAKE_UCAST) {
- netdev_info(dev->net, "enabling unicast detection");
+ netdev_info(dev->net, "enabling unicast detection\n");
ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
- check_warn_return(ret, "Error reading WUCSR");
+ check_warn_return(ret, "Error reading WUCSR\n");
val |= WUCSR_WUFR | WUCSR_PFDA_EN;
ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
- check_warn_return(ret, "Error writing WUCSR");
+ check_warn_return(ret, "Error writing WUCSR\n");
}
/* enable receiver to enable frame reception */
ret = smsc75xx_read_reg_nopm(dev, MAC_RX, &val);
- check_warn_return(ret, "Failed to read MAC_RX: %d", ret);
+ check_warn_return(ret, "Failed to read MAC_RX: %d\n", ret);
val |= MAC_RX_RXEN;
ret = smsc75xx_write_reg_nopm(dev, MAC_RX, val);
- check_warn_return(ret, "Failed to write MAC_RX: %d", ret);
+ check_warn_return(ret, "Failed to write MAC_RX: %d\n", ret);
/* some wol options are enabled, so enter SUSPEND0 */
- netdev_info(dev->net, "entering SUSPEND0 mode");
+ netdev_info(dev->net, "entering SUSPEND0 mode\n");
ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val);
- check_warn_return(ret, "Error reading PMT_CTL");
+ check_warn_return(ret, "Error reading PMT_CTL\n");
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_nopm(dev, PMT_CTL, val);
- check_warn_return(ret, "Error writing PMT_CTL");
+ check_warn_return(ret, "Error writing PMT_CTL\n");
smsc75xx_set_feature(dev, USB_DEVICE_REMOTE_WAKEUP);
@@ -1387,43 +1391,43 @@ static int smsc75xx_resume(struct usb_interface *intf)
u32 val;
if (pdata->wolopts) {
- netdev_info(dev->net, "resuming from SUSPEND0");
+ netdev_info(dev->net, "resuming from SUSPEND0\n");
smsc75xx_clear_feature(dev, USB_DEVICE_REMOTE_WAKEUP);
/* Disable wakeup sources */
ret = smsc75xx_read_reg_nopm(dev, WUCSR, &val);
- check_warn_return(ret, "Error reading WUCSR");
+ check_warn_return(ret, "Error reading WUCSR\n");
val &= ~(WUCSR_WUEN | WUCSR_MPEN | WUCSR_PFDA_EN
| WUCSR_BCST_EN);
ret = smsc75xx_write_reg_nopm(dev, WUCSR, val);
- check_warn_return(ret, "Error writing WUCSR");
+ check_warn_return(ret, "Error writing WUCSR\n");
/* clear wake-up status */
ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val);
- check_warn_return(ret, "Error reading PMT_CTL");
+ check_warn_return(ret, "Error reading PMT_CTL\n");
val &= ~PMT_CTL_WOL_EN;
val |= PMT_CTL_WUPS;
ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val);
- check_warn_return(ret, "Error writing PMT_CTL");
+ check_warn_return(ret, "Error writing PMT_CTL\n");
} else {
- netdev_info(dev->net, "resuming from SUSPEND2");
+ netdev_info(dev->net, "resuming from SUSPEND2\n");
ret = smsc75xx_read_reg_nopm(dev, PMT_CTL, &val);
- check_warn_return(ret, "Error reading PMT_CTL");
+ check_warn_return(ret, "Error reading PMT_CTL\n");
val |= PMT_CTL_PHY_PWRUP;
ret = smsc75xx_write_reg_nopm(dev, PMT_CTL, val);
- check_warn_return(ret, "Error writing PMT_CTL");
+ check_warn_return(ret, "Error writing PMT_CTL\n");
}
ret = smsc75xx_wait_ready(dev, 1);
- check_warn_return(ret, "device not ready in smsc75xx_resume");
+ check_warn_return(ret, "device not ready in smsc75xx_resume\n");
return usbnet_resume(intf);
}
@@ -1463,7 +1467,7 @@ static int smsc75xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
if (unlikely(rx_cmd_a & RX_CMD_A_RED)) {
netif_dbg(dev, rx_err, dev->net,
- "Error rx_cmd_a=0x%08x", rx_cmd_a);
+ "Error rx_cmd_a=0x%08x\n", rx_cmd_a);
dev->net->stats.rx_errors++;
dev->net->stats.rx_dropped++;
@@ -1475,7 +1479,8 @@ static int smsc75xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
/* ETH_FRAME_LEN + 4(CRC) + 2(COE) + 4(Vlan) */
if (unlikely(size > (ETH_FRAME_LEN + 12))) {
netif_dbg(dev, rx_err, dev->net,
- "size err rx_cmd_a=0x%08x", rx_cmd_a);
+ "size err rx_cmd_a=0x%08x\n",
+ rx_cmd_a);
return 0;
}
@@ -1492,7 +1497,7 @@ static int smsc75xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
ax_skb = skb_clone(skb, GFP_ATOMIC);
if (unlikely(!ax_skb)) {
- netdev_warn(dev->net, "Error allocating skb");
+ netdev_warn(dev->net, "Error allocating skb\n");
return 0;
}
@@ -1517,7 +1522,7 @@ static int smsc75xx_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
}
if (unlikely(skb->len < 0)) {
- netdev_warn(dev->net, "invalid rx length<0 %d", skb->len);
+ netdev_warn(dev->net, "invalid rx length<0 %d\n", skb->len);
return 0;
}
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index bf88543..79d495d 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -95,8 +95,8 @@ static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index,
| 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);
+ netdev_warn(dev->net, "Failed to read reg index 0x%08x: %d\n",
+ index, ret);
le32_to_cpus(&buf);
*data = buf;
@@ -125,8 +125,8 @@ static int __must_check __smsc95xx_write_reg(struct usbnet *dev, u32 index,
| 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);
+ netdev_warn(dev->net, "Failed to write reg index 0x%08x: %d\n",
+ index, ret);
return ret;
}
@@ -185,7 +185,7 @@ static int __must_check __smsc95xx_phy_wait_not_busy(struct usbnet *dev,
do {
ret = __smsc95xx_read_reg(dev, MII_ADDR, &val, in_pm);
- check_warn_return(ret, "Error reading MII_ACCESS");
+ check_warn_return(ret, "Error reading MII_ACCESS\n");
if (!(val & MII_BUSY_))
return 0;
} while (!time_after(jiffies, start_time + HZ));
@@ -204,20 +204,20 @@ static int __smsc95xx_mdio_read(struct net_device *netdev, int phy_id, int idx,
/* confirm MII not busy */
ret = __smsc95xx_phy_wait_not_busy(dev, in_pm);
- check_warn_goto_done(ret, "MII is busy in smsc95xx_mdio_read");
+ check_warn_goto_done(ret, "MII is busy in smsc95xx_mdio_read\n");
/* set the address, index & direction (read from PHY) */
phy_id &= dev->mii.phy_id_mask;
idx &= dev->mii.reg_num_mask;
addr = (phy_id << 11) | (idx << 6) | MII_READ_ | MII_BUSY_;
ret = __smsc95xx_write_reg(dev, MII_ADDR, addr, in_pm);
- check_warn_goto_done(ret, "Error writing MII_ADDR");
+ check_warn_goto_done(ret, "Error writing MII_ADDR\n");
ret = __smsc95xx_phy_wait_not_busy(dev, in_pm);
- check_warn_goto_done(ret, "Timed out reading MII reg %02X", idx);
+ check_warn_goto_done(ret, "Timed out reading MII reg %02X\n", idx);
ret = __smsc95xx_read_reg(dev, MII_DATA, &val, in_pm);
- check_warn_goto_done(ret, "Error reading MII_DATA");
+ check_warn_goto_done(ret, "Error reading MII_DATA\n");
ret = (u16)(val & 0xFFFF);
@@ -237,21 +237,21 @@ static void __smsc95xx_mdio_write(struct net_device *netdev, int phy_id,
/* confirm MII not busy */
ret = __smsc95xx_phy_wait_not_busy(dev, in_pm);
- check_warn_goto_done(ret, "MII is busy in smsc95xx_mdio_write");
+ check_warn_goto_done(ret, "MII is busy in smsc95xx_mdio_write\n");
val = regval;
ret = __smsc95xx_write_reg(dev, MII_DATA, val, in_pm);
- check_warn_goto_done(ret, "Error writing MII_DATA");
+ check_warn_goto_done(ret, "Error writing MII_DATA\n");
/* set the address, index & direction (write to PHY) */
phy_id &= dev->mii.phy_id_mask;
idx &= dev->mii.reg_num_mask;
addr = (phy_id << 11) | (idx << 6) | MII_WRITE_ | MII_BUSY_;
ret = __smsc95xx_write_reg(dev, MII_ADDR, addr, in_pm);
- check_warn_goto_done(ret, "Error writing MII_ADDR");
+ check_warn_goto_done(ret, "Error writing MII_ADDR\n");
ret = __smsc95xx_phy_wait_not_busy(dev, in_pm);
- check_warn_goto_done(ret, "Timed out writing MII reg %02X", idx);
+ check_warn_goto_done(ret, "Timed out writing MII reg %02X\n", idx);
done:
mutex_unlock(&dev->phy_mutex);
@@ -288,7 +288,7 @@ static int __must_check smsc95xx_wait_eeprom(struct usbnet *dev)
do {
ret = smsc95xx_read_reg(dev, E2P_CMD, &val);
- check_warn_return(ret, "Error reading E2P_CMD");
+ check_warn_return(ret, "Error reading E2P_CMD\n");
if (!(val & E2P_CMD_BUSY_) || (val & E2P_CMD_TIMEOUT_))
break;
udelay(40);
@@ -310,7 +310,7 @@ static int __must_check smsc95xx_eeprom_confirm_not_busy(struct usbnet *dev)
do {
ret = smsc95xx_read_reg(dev, E2P_CMD, &val);
- check_warn_return(ret, "Error reading E2P_CMD");
+ check_warn_return(ret, "Error reading E2P_CMD\n");
if (!(val & E2P_CMD_BUSY_))
return 0;
@@ -338,14 +338,14 @@ static int smsc95xx_read_eeprom(struct usbnet *dev, u32 offset, u32 length,
for (i = 0; i < length; i++) {
val = E2P_CMD_BUSY_ | E2P_CMD_READ_ | (offset & E2P_CMD_ADDR_);
ret = smsc95xx_write_reg(dev, E2P_CMD, val);
- check_warn_return(ret, "Error writing E2P_CMD");
+ check_warn_return(ret, "Error writing E2P_CMD\n");
ret = smsc95xx_wait_eeprom(dev);
if (ret < 0)
return ret;
ret = smsc95xx_read_reg(dev, E2P_DATA, &val);
- check_warn_return(ret, "Error reading E2P_DATA");
+ check_warn_return(ret, "Error reading E2P_DATA\n");
data[i] = val & 0xFF;
offset++;
@@ -370,7 +370,7 @@ static int smsc95xx_write_eeprom(struct usbnet *dev, u32 offset, u32 length,
/* Issue write/erase enable command */
val = E2P_CMD_BUSY_ | E2P_CMD_EWEN_;
ret = smsc95xx_write_reg(dev, E2P_CMD, val);
- check_warn_return(ret, "Error writing E2P_DATA");
+ check_warn_return(ret, "Error writing E2P_DATA\n");
ret = smsc95xx_wait_eeprom(dev);
if (ret < 0)
@@ -381,12 +381,12 @@ static int smsc95xx_write_eeprom(struct usbnet *dev, u32 offset, u32 length,
/* Fill data register */
val = data[i];
ret = smsc95xx_write_reg(dev, E2P_DATA, val);
- check_warn_return(ret, "Error writing E2P_DATA");
+ check_warn_return(ret, "Error writing E2P_DATA\n");
/* Send "write" command */
val = E2P_CMD_BUSY_ | E2P_CMD_WRITE_ | (offset & E2P_CMD_ADDR_);
ret = smsc95xx_write_reg(dev, E2P_CMD, val);
- check_warn_return(ret, "Error writing E2P_CMD");
+ check_warn_return(ret, "Error writing E2P_CMD\n");
ret = smsc95xx_wait_eeprom(dev);
if (ret < 0)
@@ -469,13 +469,13 @@ static void smsc95xx_set_multicast(struct net_device *netdev)
/* Initiate async writes, as we can't wait for completion here */
ret = smsc95xx_write_reg_async(dev, HASHH, &pdata->hash_hi);
- check_warn(ret, "failed to initiate async write to HASHH");
+ check_warn(ret, "failed to initiate async write to HASHH\n");
ret = smsc95xx_write_reg_async(dev, HASHL, &pdata->hash_lo);
- check_warn(ret, "failed to initiate async write to HASHL");
+ check_warn(ret, "failed to initiate async write to HASHL\n");
ret = smsc95xx_write_reg_async(dev, MAC_CR, &pdata->mac_cr);
- check_warn(ret, "failed to initiate async write to MAC_CR");
+ check_warn(ret, "failed to initiate async write to MAC_CR\n");
}
static int smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex,
@@ -484,7 +484,7 @@ static int smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex,
u32 flow, afc_cfg = 0;
int ret = smsc95xx_read_reg(dev, AFC_CFG, &afc_cfg);
- check_warn_return(ret, "Error reading AFC_CFG");
+ check_warn_return(ret, "Error reading AFC_CFG\n");
if (duplex == DUPLEX_FULL) {
u8 cap = mii_resolve_flowctrl_fdx(lcladv, rmtadv);
@@ -509,10 +509,10 @@ static int smsc95xx_phy_update_flowcontrol(struct usbnet *dev, u8 duplex,
}
ret = smsc95xx_write_reg(dev, FLOW, flow);
- check_warn_return(ret, "Error writing FLOW");
+ check_warn_return(ret, "Error writing FLOW\n");
ret = smsc95xx_write_reg(dev, AFC_CFG, afc_cfg);
- check_warn_return(ret, "Error writing AFC_CFG");
+ check_warn_return(ret, "Error writing AFC_CFG\n");
return 0;
}
@@ -528,10 +528,10 @@ static int smsc95xx_link_reset(struct usbnet *dev)
/* clear interrupt status */
ret = smsc95xx_mdio_read(dev->net, mii->phy_id, PHY_INT_SRC);
- check_warn_return(ret, "Error reading PHY_INT_SRC");
+ check_warn_return(ret, "Error reading PHY_INT_SRC\n");
ret = smsc95xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL_);
- check_warn_return(ret, "Error writing INT_STS");
+ check_warn_return(ret, "Error writing INT_STS\n");
mii_check_media(mii, 1, 1);
mii_ethtool_gset(&dev->mii, &ecmd);
@@ -553,10 +553,10 @@ static int smsc95xx_link_reset(struct usbnet *dev)
spin_unlock_irqrestore(&pdata->mac_cr_lock, flags);
ret = smsc95xx_write_reg(dev, MAC_CR, pdata->mac_cr);
- check_warn_return(ret, "Error writing MAC_CR");
+ check_warn_return(ret, "Error writing MAC_CR\n");
ret = smsc95xx_phy_update_flowcontrol(dev, ecmd.duplex, lcladv, rmtadv);
- check_warn_return(ret, "Error updating PHY flow control");
+ check_warn_return(ret, "Error updating PHY flow control\n");
return 0;
}
@@ -821,7 +821,7 @@ static int smsc95xx_phy_initialize(struct usbnet *dev)
/* read to clear */
ret = smsc95xx_mdio_read(dev->net, dev->mii.phy_id, PHY_INT_SRC);
- check_warn_return(ret, "Failed to read PHY_INT_SRC during init");
+ check_warn_return(ret, "Failed to read PHY_INT_SRC during init\n");
smsc95xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_MASK,
PHY_INT_MASK_DEFAULT_);
@@ -875,14 +875,14 @@ static int smsc95xx_reset(struct usbnet *dev)
if (ret < 0)
return ret;
- netif_dbg(dev, ifup, dev->net,
- "MAC Address: %pM\n", dev->net->dev_addr);
+ netif_dbg(dev, ifup, dev->net, "MAC Address: %pM\n",
+ dev->net->dev_addr);
ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf);
check_warn_return(ret, "Failed to read HW_CFG: %d\n", ret);
- netif_dbg(dev, ifup, dev->net,
- "Read Value from HW_CFG : 0x%08x\n", read_buf);
+ netif_dbg(dev, ifup, dev->net, "Read Value from HW_CFG : 0x%08x\n",
+ read_buf);
read_buf |= HW_CFG_BIR_;
@@ -906,8 +906,8 @@ static int smsc95xx_reset(struct usbnet *dev)
dev->rx_urb_size = DEFAULT_FS_BURST_CAP_SIZE;
}
- netif_dbg(dev, ifup, dev->net,
- "rx_urb_size=%ld\n", (ulong)dev->rx_urb_size);
+ netif_dbg(dev, ifup, dev->net, "rx_urb_size=%ld\n",
+ (ulong)dev->rx_urb_size);
ret = smsc95xx_write_reg(dev, BURST_CAP, burst_cap);
check_warn_return(ret, "Failed to write BURST_CAP: %d\n", ret);
@@ -932,8 +932,8 @@ static int smsc95xx_reset(struct usbnet *dev)
ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf);
check_warn_return(ret, "Failed to read HW_CFG: %d\n", ret);
- netif_dbg(dev, ifup, dev->net,
- "Read Value from HW_CFG: 0x%08x\n", read_buf);
+ netif_dbg(dev, ifup, dev->net, "Read Value from HW_CFG: 0x%08x\n",
+ read_buf);
if (turbo_mode)
read_buf |= (HW_CFG_MEF_ | HW_CFG_BCE_);
@@ -983,12 +983,12 @@ static int smsc95xx_reset(struct usbnet *dev)
/* Enable or disable checksum offload engines */
ret = smsc95xx_set_features(dev->net, dev->net->features);
- check_warn_return(ret, "Failed to set checksum offload features");
+ check_warn_return(ret, "Failed to set checksum offload features\n");
smsc95xx_set_multicast(dev->net);
ret = smsc95xx_phy_initialize(dev);
- check_warn_return(ret, "Failed to init PHY");
+ check_warn_return(ret, "Failed to init PHY\n");
ret = smsc95xx_read_reg(dev, INT_EP_CTL, &read_buf);
check_warn_return(ret, "Failed to read INT_EP_CTL: %d\n", ret);
@@ -1000,10 +1000,10 @@ static int smsc95xx_reset(struct usbnet *dev)
check_warn_return(ret, "Failed to write INT_EP_CTL: %d\n", ret);
ret = smsc95xx_start_tx_path(dev);
- check_warn_return(ret, "Failed to start TX path");
+ check_warn_return(ret, "Failed to start TX path\n");
ret = smsc95xx_start_rx_path(dev, 0);
- check_warn_return(ret, "Failed to start RX path");
+ check_warn_return(ret, "Failed to start RX path\n");
netif_dbg(dev, ifup, dev->net, "smsc95xx_reset, return 0\n");
return 0;
@@ -1098,15 +1098,15 @@ static int smsc95xx_enable_phy_wakeup_interrupts(struct usbnet *dev, u16 mask)
struct mii_if_info *mii = &dev->mii;
int ret;
- netdev_dbg(dev->net, "enabling PHY wakeup interrupts");
+ netdev_dbg(dev->net, "enabling PHY wakeup interrupts\n");
/* read to clear */
ret = smsc95xx_mdio_read_nopm(dev->net, mii->phy_id, PHY_INT_SRC);
- check_warn_return(ret, "Error reading PHY_INT_SRC");
+ check_warn_return(ret, "Error reading PHY_INT_SRC\n");
/* enable interrupt source */
ret = smsc95xx_mdio_read_nopm(dev->net, mii->phy_id, PHY_INT_MASK);
- check_warn_return(ret, "Error reading PHY_INT_MASK");
+ check_warn_return(ret, "Error reading PHY_INT_MASK\n");
ret |= mask;
@@ -1122,10 +1122,10 @@ static int smsc95xx_link_ok_nopm(struct usbnet *dev)
/* first, a dummy read, needed to latch some MII phys */
ret = smsc95xx_mdio_read_nopm(dev->net, mii->phy_id, MII_BMSR);
- check_warn_return(ret, "Error reading MII_BMSR");
+ check_warn_return(ret, "Error reading MII_BMSR\n");
ret = smsc95xx_mdio_read_nopm(dev->net, mii->phy_id, MII_BMSR);
- check_warn_return(ret, "Error reading MII_BMSR");
+ check_warn_return(ret, "Error reading MII_BMSR\n");
return !!(ret & BMSR_LSTATUS);
}
@@ -1137,13 +1137,13 @@ static int smsc95xx_enter_suspend0(struct usbnet *dev)
int ret;
ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
- check_warn_return(ret, "Error reading PM_CTRL");
+ check_warn_return(ret, "Error reading PM_CTRL\n");
val &= (~(PM_CTL_SUS_MODE_ | PM_CTL_WUPS_ | PM_CTL_PHY_RST_));
val |= PM_CTL_SUS_MODE_0;
ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
- check_warn_return(ret, "Error writing PM_CTRL");
+ check_warn_return(ret, "Error writing PM_CTRL\n");
/* clear wol status */
val &= ~PM_CTL_WUPS_;
@@ -1154,11 +1154,11 @@ static int smsc95xx_enter_suspend0(struct usbnet *dev)
val |= PM_CTL_WUPS_ED_;
ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
- check_warn_return(ret, "Error writing PM_CTRL");
+ check_warn_return(ret, "Error writing PM_CTRL\n");
/* read back PM_CTRL */
ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
- check_warn_return(ret, "Error reading PM_CTRL");
+ check_warn_return(ret, "Error reading PM_CTRL\n");
smsc95xx_set_feature(dev, USB_DEVICE_REMOTE_WAKEUP);
@@ -1181,7 +1181,7 @@ static int smsc95xx_enter_suspend1(struct usbnet *dev)
/* enable energy detect power-down mode */
ret = smsc95xx_mdio_read_nopm(dev->net, mii->phy_id, PHY_MODE_CTRL_STS);
- check_warn_return(ret, "Error reading PHY_MODE_CTRL_STS");
+ check_warn_return(ret, "Error reading PHY_MODE_CTRL_STS\n");
ret |= MODE_CTRL_STS_EDPWRDOWN_;
@@ -1189,20 +1189,20 @@ static int smsc95xx_enter_suspend1(struct usbnet *dev)
/* enter SUSPEND1 mode */
ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
- check_warn_return(ret, "Error reading PM_CTRL");
+ check_warn_return(ret, "Error reading PM_CTRL\n");
val &= ~(PM_CTL_SUS_MODE_ | PM_CTL_WUPS_ | PM_CTL_PHY_RST_);
val |= PM_CTL_SUS_MODE_1;
ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
- check_warn_return(ret, "Error writing PM_CTRL");
+ check_warn_return(ret, "Error writing PM_CTRL\n");
/* clear wol status, enable energy detection */
val &= ~PM_CTL_WUPS_;
val |= (PM_CTL_WUPS_ED_ | PM_CTL_ED_EN_);
ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
- check_warn_return(ret, "Error writing PM_CTRL");
+ check_warn_return(ret, "Error writing PM_CTRL\n");
smsc95xx_set_feature(dev, USB_DEVICE_REMOTE_WAKEUP);
@@ -1215,13 +1215,13 @@ static int smsc95xx_enter_suspend2(struct usbnet *dev)
int ret;
ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
- check_warn_return(ret, "Error reading PM_CTRL");
+ check_warn_return(ret, "Error reading PM_CTRL\n");
val &= ~(PM_CTL_SUS_MODE_ | PM_CTL_WUPS_ | PM_CTL_PHY_RST_);
val |= PM_CTL_SUS_MODE_2;
ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
- check_warn_return(ret, "Error writing PM_CTRL");
+ check_warn_return(ret, "Error writing PM_CTRL\n");
return 0;
}
@@ -1234,7 +1234,7 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
int ret;
ret = usbnet_suspend(intf, message);
- check_warn_return(ret, "usbnet_suspend error");
+ check_warn_return(ret, "usbnet_suspend error\n");
/* determine if link is up using only _nopm functions */
link_up = smsc95xx_link_ok_nopm(dev);
@@ -1244,24 +1244,24 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
*/
if (!(pdata->wolopts & SUPPORTED_WAKE) ||
!(link_up || (pdata->wolopts & WAKE_PHY))) {
- netdev_info(dev->net, "entering SUSPEND2 mode");
+ netdev_info(dev->net, "entering SUSPEND2 mode\n");
/* disable energy detect (link up) & wake up events */
ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val);
- check_warn_return(ret, "Error reading WUCSR");
+ check_warn_return(ret, "Error reading WUCSR\n");
val &= ~(WUCSR_MPEN_ | WUCSR_WAKE_EN_);
ret = smsc95xx_write_reg_nopm(dev, WUCSR, val);
- check_warn_return(ret, "Error writing WUCSR");
+ check_warn_return(ret, "Error writing WUCSR\n");
ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
- check_warn_return(ret, "Error reading PM_CTRL");
+ check_warn_return(ret, "Error reading PM_CTRL\n");
val &= ~(PM_CTL_ED_EN_ | PM_CTL_WOL_EN_);
ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
- check_warn_return(ret, "Error writing PM_CTRL");
+ check_warn_return(ret, "Error writing PM_CTRL\n");
return smsc95xx_enter_suspend2(dev);
}
@@ -1269,13 +1269,13 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
if (pdata->wolopts & WAKE_PHY) {
ret = smsc95xx_enable_phy_wakeup_interrupts(dev,
(PHY_INT_MASK_ANEG_COMP_ | PHY_INT_MASK_LINK_DOWN_));
- check_warn_return(ret, "error enabling PHY wakeup ints");
+ check_warn_return(ret, "error enabling PHY wakeup ints\n");
/* if link is down then configure EDPD and enter SUSPEND1,
* otherwise enter SUSPEND0 below
*/
if (!link_up) {
- netdev_info(dev->net, "entering SUSPEND1 mode");
+ netdev_info(dev->net, "entering SUSPEND1 mode\n");
return smsc95xx_enter_suspend1(dev);
}
}
@@ -1296,7 +1296,7 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
if (pdata->wolopts & WAKE_BCAST) {
const u8 bcast[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
- netdev_info(dev->net, "enabling broadcast detection");
+ netdev_info(dev->net, "enabling broadcast detection\n");
filter_mask[filter * 4] = 0x003F;
filter_mask[filter * 4 + 1] = 0x00;
filter_mask[filter * 4 + 2] = 0x00;
@@ -1309,7 +1309,7 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
if (pdata->wolopts & WAKE_MCAST) {
const u8 mcast[] = {0x01, 0x00, 0x5E};
- netdev_info(dev->net, "enabling multicast detection");
+ netdev_info(dev->net, "enabling multicast detection\n");
filter_mask[filter * 4] = 0x0007;
filter_mask[filter * 4 + 1] = 0x00;
filter_mask[filter * 4 + 2] = 0x00;
@@ -1322,7 +1322,7 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
if (pdata->wolopts & WAKE_ARP) {
const u8 arp[] = {0x08, 0x06};
- netdev_info(dev->net, "enabling ARP detection");
+ netdev_info(dev->net, "enabling ARP detection\n");
filter_mask[filter * 4] = 0x0003;
filter_mask[filter * 4 + 1] = 0x00;
filter_mask[filter * 4 + 2] = 0x00;
@@ -1334,7 +1334,7 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
}
if (pdata->wolopts & WAKE_UCAST) {
- netdev_info(dev->net, "enabling unicast detection");
+ netdev_info(dev->net, "enabling unicast detection\n");
filter_mask[filter * 4] = 0x003F;
filter_mask[filter * 4 + 1] = 0x00;
filter_mask[filter * 4 + 2] = 0x00;
@@ -1349,72 +1349,72 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
ret = smsc95xx_write_reg_nopm(dev, WUFF, filter_mask[i]);
if (ret < 0)
kfree(filter_mask);
- check_warn_return(ret, "Error writing WUFF");
+ check_warn_return(ret, "Error writing WUFF\n");
}
kfree(filter_mask);
for (i = 0; i < (wuff_filter_count / 4); i++) {
ret = smsc95xx_write_reg_nopm(dev, WUFF, command[i]);
- check_warn_return(ret, "Error writing WUFF");
+ check_warn_return(ret, "Error writing WUFF\n");
}
for (i = 0; i < (wuff_filter_count / 4); i++) {
ret = smsc95xx_write_reg_nopm(dev, WUFF, offset[i]);
- check_warn_return(ret, "Error writing WUFF");
+ check_warn_return(ret, "Error writing WUFF\n");
}
for (i = 0; i < (wuff_filter_count / 2); i++) {
ret = smsc95xx_write_reg_nopm(dev, WUFF, crc[i]);
- check_warn_return(ret, "Error writing WUFF");
+ check_warn_return(ret, "Error writing WUFF\n");
}
/* clear any pending pattern match packet status */
ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val);
- check_warn_return(ret, "Error reading WUCSR");
+ check_warn_return(ret, "Error reading WUCSR\n");
val |= WUCSR_WUFR_;
ret = smsc95xx_write_reg_nopm(dev, WUCSR, val);
- check_warn_return(ret, "Error writing WUCSR");
+ check_warn_return(ret, "Error writing WUCSR\n");
}
if (pdata->wolopts & WAKE_MAGIC) {
/* clear any pending magic packet status */
ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val);
- check_warn_return(ret, "Error reading WUCSR");
+ check_warn_return(ret, "Error reading WUCSR\n");
val |= WUCSR_MPR_;
ret = smsc95xx_write_reg_nopm(dev, WUCSR, val);
- check_warn_return(ret, "Error writing WUCSR");
+ check_warn_return(ret, "Error writing WUCSR\n");
}
/* enable/disable wakeup sources */
ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val);
- check_warn_return(ret, "Error reading WUCSR");
+ check_warn_return(ret, "Error reading WUCSR\n");
if (pdata->wolopts & (WAKE_BCAST | WAKE_MCAST | WAKE_ARP | WAKE_UCAST)) {
- netdev_info(dev->net, "enabling pattern match wakeup");
+ netdev_info(dev->net, "enabling pattern match wakeup\n");
val |= WUCSR_WAKE_EN_;
} else {
- netdev_info(dev->net, "disabling pattern match wakeup");
+ netdev_info(dev->net, "disabling pattern match wakeup\n");
val &= ~WUCSR_WAKE_EN_;
}
if (pdata->wolopts & WAKE_MAGIC) {
- netdev_info(dev->net, "enabling magic packet wakeup");
+ netdev_info(dev->net, "enabling magic packet wakeup\n");
val |= WUCSR_MPEN_;
} else {
- netdev_info(dev->net, "disabling magic packet wakeup");
+ netdev_info(dev->net, "disabling magic packet wakeup\n");
val &= ~WUCSR_MPEN_;
}
ret = smsc95xx_write_reg_nopm(dev, WUCSR, val);
- check_warn_return(ret, "Error writing WUCSR");
+ check_warn_return(ret, "Error writing WUCSR\n");
/* enable wol wakeup source */
ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
- check_warn_return(ret, "Error reading PM_CTRL");
+ check_warn_return(ret, "Error reading PM_CTRL\n");
val |= PM_CTL_WOL_EN_;
@@ -1423,13 +1423,13 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message)
val |= PM_CTL_ED_EN_;
ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
- check_warn_return(ret, "Error writing PM_CTRL");
+ check_warn_return(ret, "Error writing PM_CTRL\n");
/* enable receiver to enable frame reception */
smsc95xx_start_rx_path(dev, 1);
/* some wol options are enabled, so enter SUSPEND0 */
- netdev_info(dev->net, "entering SUSPEND0 mode");
+ netdev_info(dev->net, "entering SUSPEND0 mode\n");
return smsc95xx_enter_suspend0(dev);
}
@@ -1447,26 +1447,26 @@ static int smsc95xx_resume(struct usb_interface *intf)
/* clear wake-up sources */
ret = smsc95xx_read_reg_nopm(dev, WUCSR, &val);
- check_warn_return(ret, "Error reading WUCSR");
+ check_warn_return(ret, "Error reading WUCSR\n");
val &= ~(WUCSR_WAKE_EN_ | WUCSR_MPEN_);
ret = smsc95xx_write_reg_nopm(dev, WUCSR, val);
- check_warn_return(ret, "Error writing WUCSR");
+ check_warn_return(ret, "Error writing WUCSR\n");
/* clear wake-up status */
ret = smsc95xx_read_reg_nopm(dev, PM_CTRL, &val);
- check_warn_return(ret, "Error reading PM_CTRL");
+ check_warn_return(ret, "Error reading PM_CTRL\n");
val &= ~PM_CTL_WOL_EN_;
val |= PM_CTL_WUPS_;
ret = smsc95xx_write_reg_nopm(dev, PM_CTRL, val);
- check_warn_return(ret, "Error writing PM_CTRL");
+ check_warn_return(ret, "Error writing PM_CTRL\n");
}
ret = usbnet_resume(intf);
- check_warn_return(ret, "usbnet_resume error");
+ check_warn_return(ret, "usbnet_resume error\n");
return 0;
}
^ permalink raw reply related
* Re: [PATCH RFC 3/5] printk: modify printk interface for syslog_namespace
From: Libo Chen @ 2012-11-24 11:22 UTC (permalink / raw)
To: Serge E. Hallyn
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
Eric W. Biederman
On 2012/11/22 1:49, Serge E. Hallyn wrote:
> I notice that you haven't made any changes to the struct cont. I
> suspect this means that to-be-continued msgs from one ns can be
> erroneously mixed with another ns.
>
Yes, I confirmed this problem. There will be erroneously mixed with another ns.
Thank you very much.
> You said you don't mind putting the syslogns into the userns. If
> there's no reason not to do that, then we should do so as it will
> remove a bunch of code (plus the use of a new CLONE flag) from your
> patch, and the new syslog(NEW_NS) command from mine.
>
I agree with you, both are removable.
> Now IMO the ideal place for syslog_ns would be in the devices ns,
> but that does not yet exist, and may never. The bonus to that would
> be that the consoles sort of belong there. I avoid this by not
> having consoles in child syslog namespaces. You put the console in
> the ns. I haven't looked closely enough to see if what you do is
> ok (will do so soon).
>
> WOuld you mind looking through my patch to see if it suffices for
> your needs? Where it does not, patches would be greatly appreciated
> if simple enough.
follow your patch, I can see inject message by "dmesg call" in container, is right?
I am worry that I debug or see messages from serial ports console in some embedded system,
since console belongs to init_syslog, so the message in container can`t be printed.
> Note I'm not at all wedded to my patchset. I'm happy to go with
> something else entirely. My set was just a proof of concept.
>
>
^ 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