]> Pileus Git - ~andy/linux/log
~andy/linux
12 years agoixgbe: update copyright to 2012
Don Skidmore [Fri, 6 Jan 2012 03:24:16 +0000 (03:24 +0000)]
ixgbe: update copyright to 2012

New year so bump the copyright date.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
12 years agocan: replace the dev_dbg/info/err/... with the new netdev_xxx macros
Wolfgang Grandegger [Wed, 1 Feb 2012 10:02:05 +0000 (11:02 +0100)]
can: replace the dev_dbg/info/err/... with the new netdev_xxx macros

Cc: uclinux-dist-devel@blackfin.uclinux.org
Cc: Anant Gole <anantgole@ti.com>
Cc: Chris Elston <celston@katalix.com>
Cc: Sebastian Haas <haas@ems-wuensche.com>
Cc: Matthias Fuchs <matthias.fuchs@esd.eu>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Acked-by: Sebastian Haas <dev@sebastianhaas.info>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
12 years agocan: bfin_can/ti_hecc/mscan: add missing do_get_berr_counter callback
Wolfgang Grandegger [Wed, 1 Feb 2012 10:14:13 +0000 (11:14 +0100)]
can: bfin_can/ti_hecc/mscan: add missing do_get_berr_counter callback

Cc: Anant Gole <anantgole@ti.com>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
12 years agocan: Kconfig: add more information about Intel EG20T PCH CAN controller
Tomoya MORINAGA [Fri, 27 Jan 2012 11:05:22 +0000 (20:05 +0900)]
can: Kconfig: add more information about Intel EG20T PCH CAN controller

Current menu description, not easy to understand what the description
means. So, add information about the device.

Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com>
[mkl: Added space before opening parentheses in Kconfig.
      Make commit message more descriptive.]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
12 years agocan: pch_can: Change company name OKI SEMICONDUCTOR to LAPIS Semiconductor
Tomoya MORINAGA [Fri, 27 Jan 2012 11:05:21 +0000 (20:05 +0900)]
can: pch_can: Change company name OKI SEMICONDUCTOR to LAPIS Semiconductor

On October 1 in 2011,
    OKI SEMICONDUCTOR Co., Ltd. changed the company name in to LAPIS Semiconductor

Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
12 years agocan: plx_pci: add support for IXXAT PCI cards
James Kime [Mon, 12 Dec 2011 12:45:58 +0000 (13:45 +0100)]
can: plx_pci: add support for IXXAT PCI cards

This patch adds support for IXXAT passive CAN controllers

Signed-off-by: James Kime <kime@ixxat.de>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
12 years agocan: ems_usb: Improved memory handling on ems_usb_start
Sebastian Haas [Thu, 22 Dec 2011 22:58:34 +0000 (23:58 +0100)]
can: ems_usb: Improved memory handling on ems_usb_start

Do not return from ems_usb_start if allocation fails. If not all URBs
could be allocated use the one already submitted.

Signed-off-by: Sebastian Haas <dev@sebastianhaas.info>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
12 years agocan: flexcan: Fix CAN_RAW_RECV_OWN_MSGS and CAN_RAW_LOOPBACK
Reuben Dowle [Mon, 31 Oct 2011 22:18:03 +0000 (11:18 +1300)]
can: flexcan: Fix CAN_RAW_RECV_OWN_MSGS and CAN_RAW_LOOPBACK

Currently the flexcan driver uses hardware local echo. This blindly
echos all transmitted frames to all receiving sockets, regardless what
CAN_RAW_RECV_OWN_MSGS and CAN_RAW_LOOPBACK are set to.

This patch now submits transmitted frames to be echoed in the transmit
complete interrupt, preserving the reference to the sending
socket. This allows the can protocol to correctly handle the local
echo.

Further this patch moves tx_bytes statistic accounting into the tx_complete
handler.

Signed-off-by: Reuben Dowle <reuben.dowle@navico.com>
[mkl: move tx_bytes accounting into tx_complete handler; cleanups]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
12 years agocan: dev: let can_get_echo_skb() return dlc of CAN frame
Marc Kleine-Budde [Mon, 10 Oct 2011 21:43:53 +0000 (23:43 +0200)]
can: dev: let can_get_echo_skb() return dlc of CAN frame

can_get_echo_skb() is usually called in the TX complete handler.
The stats->tx_packets and stats->tx_bytes should be updated there, too.
This patch simplifies to figure out the size of the sent CAN frame.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
12 years agocan: ems_usb: Removed double netif_device_detach
Sebastian Haas [Thu, 22 Dec 2011 22:57:49 +0000 (23:57 +0100)]
can: ems_usb: Removed double netif_device_detach

netif_device_attched is called twice when ems_usb_start fails with -ENODEV

Signed-off-by: Sebastian Haas <dev@sebastianhaas.info>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
12 years agocan: peak_pci: Fix the way channels are linked together
Stephane Grosjean [Wed, 1 Feb 2012 10:05:48 +0000 (11:05 +0100)]
can: peak_pci: Fix the way channels are linked together

Change the way channels objects are linked together by peak_pci_probe()
avoiding any kernel oops when driver is removed. Side effect is that
the list is now browsed from last to first channel.

Signed-off-by: Stephane Grosjean <s.grosjean@peak-system.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
12 years agocan: ems_usb: Removed double netif_device_detach
Sebastian Haas [Thu, 22 Dec 2011 22:57:49 +0000 (23:57 +0100)]
can: ems_usb: Removed double netif_device_detach

netif_device_attched is called twice when ems_usb_start fails with -ENODEV

Signed-off-by: Sebastian Haas <dev@sebastianhaas.info>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
12 years agocan: pch_can: fix error passive level test
Xi Wang [Mon, 12 Dec 2011 07:16:20 +0000 (02:16 -0500)]
can: pch_can: fix error passive level test

The test (((errc & PCH_REC) >> 8) > 127) would always be false because
the receive error counter ((errc & PCH_REC) >> 8) is at most 127, where
PCH_REC is defined as 0x7f00.  To test whether the receive error counter
has reached the error passive level, the RP bit (15) should be used.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
12 years agocan: ti_hecc: use netif_rx in the interrupt
Wolfgang Grandegger [Wed, 1 Feb 2012 09:50:23 +0000 (10:50 +0100)]
can: ti_hecc: use netif_rx in the interrupt

This patch fixes locking problems by using netif_rx() instead of
netif_receive_skb() in ti_hecc_error() called from the interrupt
context.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
12 years agocan: cc770: Fix indirect access deadlock on ISA cards
Wolfgang Zarre [Sun, 15 Jan 2012 12:21:34 +0000 (13:21 +0100)]
can: cc770: Fix indirect access deadlock on ISA cards

This fix avoids a deadlock if an interrupt occurs
during consecutive port operations on ISA cards
utilising indirect access via address and data
port.

Tested on a B&R ISA card.

Cc: linux-can@vger.kernel.org
Cc: netdev@vger.kernel.org
Signed-off-by: Wolfgang Zarre <lkdev@essax.com>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
12 years agocan: cc770: store echo skb before starting the transfer
Wolfgang Grandegger [Mon, 12 Dec 2011 15:07:16 +0000 (16:07 +0100)]
can: cc770: store echo skb before starting the transfer

On slow systems and high CAN bitrates, the error message
"can_put_echo_skb: BUG! echo_skb is occupied!" did show up because
can_put_echo_skb() was called after starting the transfer.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
12 years agocan: flexcan: fix irq flooding by clearing all interrupt sources
Wolfgang Grandegger [Mon, 12 Dec 2011 15:09:28 +0000 (16:09 +0100)]
can: flexcan: fix irq flooding by clearing all interrupt sources

As pointed out by Reuben Dowle and Lothar Waßmann, the TWRN_INT,
RWRN_INT, BOFF_INT interrupt sources need to be cleared as well
to avoid interrupt flooding, at least for the Flexcan on i.MX28
SOCs. Furthermore, the interrupts are only cleared, if really one
of those interrupt sources are pending (which is not the case for
rx and tx done).

Cc: Reuben Dowle <Reuben.Dowle@navico.com>
Cc: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
12 years agoeicon: fix -Warray-bounds warning
Danny Kukawka [Thu, 2 Feb 2012 03:20:28 +0000 (03:20 +0000)]
eicon: fix -Warray-bounds warning

Fix for a -Warray-bounds warning. mixer_notify_update() tries to
write to ((CAPI_MSG *) msg)->info.facility_req.structs[3] while
structs is defined as byte structs[1]. Set all 'structs' which are
part of the typdefs in the info union to 'byte structs[0]'.

v2: set all info.*.structs to byte structs[0]

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoqeth: Move away from using neighbour entries in qeth_l3_fill_header()
David Miller [Wed, 1 Feb 2012 10:49:17 +0000 (10:49 +0000)]
qeth: Move away from using neighbour entries in qeth_l3_fill_header()

We've moving to a model where dst_entry objects to not have
a reference to the associated neighbour entry, instead such
neighbours must be looked up on-demand.

Here in qeth_l3_fill_header() it's actually much simpler to
use the information in the route itself.  The code is
already conditionalized upon protocol type.

Signed-off-by: David S. Miller <davem@davemloft.net>
Tested-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
12 years agocaif: Bugfix double kfree_skb upon xmit failure
Dmitry Tarnyagin [Thu, 2 Feb 2012 01:21:03 +0000 (01:21 +0000)]
caif: Bugfix double kfree_skb upon xmit failure

SKB is freed twice upon send error. The Network stack consumes SKB even
when it returns error code.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agocaif: Bugfix list_del_rcu race in cfmuxl_ctrlcmd.
sjur.brandeland@stericsson.com [Thu, 2 Feb 2012 01:21:02 +0000 (01:21 +0000)]
caif: Bugfix list_del_rcu race in cfmuxl_ctrlcmd.

Always use cfmuxl_remove_uplayer when removing a up-layer.
cfmuxl_ctrlcmd() can be called independently and in parallel with
cfmuxl_remove_uplayer(). The race between them could cause list_del_rcu
to be called on a node which has been already taken out from the list.
That lead to a (rare) crash on accessing poisoned node->prev inside
list_del_rcu.

This fix ensures that deletion are done holding the same lock.

Reported-by: Dmitry Tarnyagin <dmitry.tarnyagin@stericsson.com>
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet/hyperv: Fix the page buffer when an RNDIS message goes beyond page boundary
Haiyang Zhang [Thu, 2 Feb 2012 07:18:00 +0000 (07:18 +0000)]
net/hyperv: Fix the page buffer when an RNDIS message goes beyond page boundary

There is a possible data corruption if an RNDIS message goes beyond page
boundary in the sending code path. This patch fixes the problem.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet/hyperv: Use netif_tx_disable() instead of netif_stop_queue() when necessary
Haiyang Zhang [Thu, 2 Feb 2012 07:17:59 +0000 (07:17 +0000)]
net/hyperv: Use netif_tx_disable() instead of netif_stop_queue() when necessary

For code path not on the xmit, use netif_tx_disable() instead of
netif_stop_queue() to ensure other CPUs are not doing xmit.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agodrivers/net/ethernet/ti: Move call to PTR_ERR after reassignment
Julia Lawall [Thu, 2 Feb 2012 04:53:01 +0000 (04:53 +0000)]
drivers/net/ethernet/ti: Move call to PTR_ERR after reassignment

PTR_ERR should be called before its argument is cleared.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e,e1;
constant c;
@@

*e = c
... when != e = e1
    when != &e
    when != true IS_ERR(e)
*PTR_ERR(e)
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Reported-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet/hyperv: fix the issue that large packets be dropped under bridge
Wei Yongjun [Wed, 1 Feb 2012 20:17:23 +0000 (20:17 +0000)]
net/hyperv: fix the issue that large packets be dropped under bridge

The packets with size larger than 1452 will be dropped by bridge
which with two hyperv netdevice ports. This cause by hyperv netvsc
driver always copy the trailer padding to the data packet, and then
the skb received from netdevice may include wrong skb->len (20 bytes
larger than the real size normally). The captured packet may like
this:

  Ethernet II, Src: Microsof_00:00:07 (00:15:5d:00:00:07),
               Dst: HewlettP_00:00:4e (00:1f:29:00:00:4e)
    Destination: HewlettP_e6:00:4e (00:1f:29:00:00:4e)
    Source: Microsof_f6:6d:07 (00:15:5d:f6:6d:07)
    Type: IP (0x0800)
    Trailer: 1415161718191A1B1C1D1E1F20212223
    Frame check sequence: 0x24252627 [incorrect, should be 0x7c2e5a5e]

The following command help to reproduction it, and the ping ICMP
packets will be dropped by bridge.
  $ ping ip -s 1453

This patch fixed it by removing the trailer padding from the data
packet.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotcp: properly initialize tcp memory limits
Jason Wang [Thu, 2 Feb 2012 00:07:00 +0000 (00:07 +0000)]
tcp: properly initialize tcp memory limits

Commit 4acb4190 tries to fix the using uninitialized value
introduced by commit 3dc43e3,  but it would make the
per-socket memory limits too small.

This patch fixes this and also remove the redundant codes
introduced in 4acb4190.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Glauber Costa <glommer@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobna: Implement ethtool flash_device entry point.
Krishna Gudipati [Wed, 1 Feb 2012 15:02:41 +0000 (15:02 +0000)]
bna: Implement ethtool flash_device entry point.

Incorporated review comments from Ben Hutchings.

Change details:
- Implement ethtool flash_device() entry point to write the
  firmware image to the flash firmware partition.

Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoatm: clip: Convert over to dst_neigh_lookup().
David S. Miller [Wed, 1 Feb 2012 22:23:11 +0000 (17:23 -0500)]
atm: clip: Convert over to dst_neigh_lookup().

CLIP only support ipv4, and this is evidenced by the fact that it
is a device specific extension of arp_tbl, so this conversion is
pretty straightforward.

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agodecnet: Add missing neigh->ha locking to dn_neigh_output_packet()
David S. Miller [Wed, 1 Feb 2012 21:34:25 +0000 (16:34 -0500)]
decnet: Add missing neigh->ha locking to dn_neigh_output_packet()

Basically, mirror the logic in neigh_connected_output().

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoipv6: Remove never used function inet6_ac_check().
David S. Miller [Wed, 1 Feb 2012 21:14:17 +0000 (16:14 -0500)]
ipv6: Remove never used function inet6_ac_check().

It went from unused, to commented out, and never changing after
that.

Just get rid of it, if someone wants it they can unearth it from
the history.

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoPATCH V2 net-next] net: dev: Convert printks to pr_<level>
Joe Perches [Wed, 1 Feb 2012 10:54:43 +0000 (10:54 +0000)]
PATCH V2 net-next] net: dev: Convert printks to pr_<level>

Use the current logging style.
Coalesce formats where appropriate.
Update grammar where appropriate.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agomac80211: timeout a single frame in the rx reorder buffer
Eliad Peller [Wed, 1 Feb 2012 16:48:09 +0000 (18:48 +0200)]
mac80211: timeout a single frame in the rx reorder buffer

The current code checks for stored_mpdu_num > 1, causing
the reorder_timer to be triggered indefinitely, but the
frame is never timed-out (until the next packet is received)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Cc: <stable@vger.kernel.org>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: don't mess up QoS counters with non-QoS frames
Emmanuel Grumbach [Wed, 1 Feb 2012 15:01:32 +0000 (07:01 -0800)]
iwlwifi: don't mess up QoS counters with non-QoS frames

In my AMPDU rework, I rely on the sequence numbers of frames. But
I didn't check that the frame has a valid tid before updating the
tracking counters. As a result, the Tx queues were stalled. People
who hit this bug saw that we simply didn't let any data out.

This bug was introduced in 3.3.

This patch fixes that and checks that the frame is a QoS frame before
looking at its tid and changing the counters.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agossb: fix cardbus slot in hostmode
Hauke Mehrtens [Tue, 31 Jan 2012 23:13:53 +0000 (00:13 +0100)]
ssb: fix cardbus slot in hostmode

ssb supports one extra device on the cardbus. This results in two
devices in total, one beeing the host controller itself and the other
the external device connected to the hostcontroller over cardbus.

This makes the cardbus slot work on the Linksys WRT150N.

Reported-by: Aaron Z <aaronz@pls-net.org>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: make "Tx aggregation enabled on ra =" be at DEBUG level
John W. Linville [Tue, 31 Jan 2012 19:40:49 +0000 (14:40 -0500)]
iwlwifi: make "Tx aggregation enabled on ra =" be at DEBUG level

Average users either don't care or they think that message indicates a
problem...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agort2800lib: fix wrong -128dBm when signal is stronger than -12dBm
Luigi Tarenga [Tue, 31 Jan 2012 17:51:23 +0000 (18:51 +0100)]
rt2800lib: fix wrong -128dBm when signal is stronger than -12dBm

This patch correct the type of variables containing the rssi
values read from the rxwi.

In function rt2800_agc_to_rssi() 3 variables (rssi0, rssi1, rss2)
defined as int was assigned a 16bit signed values as unsigned.
From a test with a hi-gain antenna I verified that the rxwi
contains signed rssi values in the  range -13/+81 (inclusive)
with 0 as an error condition. In case of negative values a
condition is triggered and the function return -128dBm while
the signal is at its maximum. This patch correct the cast so
negative values are not treated as very high positive values
(ex. -13 does not become 243).

Signed-off-by: Luigi Tarenga <luigi.tarenga@gmail.com>
Reviewed-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobcma: Fix mem leak in bcma_bus_scan()
Jesper Juhl [Sun, 29 Jan 2012 20:34:04 +0000 (21:34 +0100)]
bcma: Fix mem leak in bcma_bus_scan()

bcma_bus_scan() leaks 'struct bcma_device' bytes if
bcma_get_next_core() returns error.

Restructure the code so we always kfree() the memory we allocate to
the variable 'core' before it goes out of scope.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoethtool: Null-terminate filename passed to ethtool_ops::flash_device
Ben Hutchings [Wed, 1 Feb 2012 09:32:25 +0000 (09:32 +0000)]
ethtool: Null-terminate filename passed to ethtool_ops::flash_device

The parameters for ETHTOOL_FLASHDEV include a filename, which ought to
be null-terminated.  Currently the only driver that implements
ethtool_ops::flash_device attempts to add a null terminator if
necessary, but does it wrongly.  Do it in the ethtool core instead.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agovmxnet3: Fix typo in vmxnet3_drv.c
Masanari Iida [Wed, 1 Feb 2012 03:13:59 +0000 (03:13 +0000)]
vmxnet3: Fix typo in vmxnet3_drv.c

Correct spelling in "uncommited" to "uncommitted" in
drivers/net/vmxnet3/vmxnet3_drv.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoatm: Fix typo in lanai.c
Masanari Iida [Wed, 1 Feb 2012 03:05:13 +0000 (03:05 +0000)]
atm: Fix typo in lanai.c

Correct spelling "reseting" to resetting" in
drivers/atm/lanai.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet: Disambiguate kernel message
Arun Sharma [Mon, 30 Jan 2012 22:16:06 +0000 (14:16 -0800)]
net: Disambiguate kernel message

Some of our machines were reporting:

TCP: too many of orphaned sockets

even when the number of orphaned sockets was well below the
limit.

We print a different message depending on whether we're out
of TCP memory or there are too many orphaned sockets.

Also move the check out of line and cleanup the messages
that were printed.

Signed-off-by: Arun Sharma <asharma@fb.com>
Suggested-by: Mohan Srinivasan <mohan@fb.com>
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: David Miller <davem@davemloft.net>
Cc: Glauber Costa <glommer@parallels.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agohamradio: fix incompatible pointer in module parameter
Danny Kukawka [Mon, 30 Jan 2012 12:00:18 +0000 (12:00 +0000)]
hamradio: fix incompatible pointer in module parameter

Fixed 'warning: return from incompatible pointer type' related
to module parameters.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet/hyperv: rx_bytes should account the ether header size
Wei Yongjun [Sun, 29 Jan 2012 22:14:02 +0000 (22:14 +0000)]
net/hyperv: rx_bytes should account the ether header size

skb->len after call eth_type_trans() does not include the ether
header size, but rx_bytes should account it.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobe2net: add descriptions for stat counters reported via ethtool
Sathya Perla [Sun, 29 Jan 2012 20:17:39 +0000 (20:17 +0000)]
be2net: add descriptions for stat counters reported via ethtool

Also rename a few counters appropritely and delete 2 counters that are not
implemented in HW.

vlan_mismatch_drops does not exist in BE3 and is accounted for in
address_mismatch_drops. Do the same thing for BE2 and Lancer.

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoixgbe: Add module parameter to allow untested and unsafe SFP+ modules
Peter P Waskiewicz Jr [Wed, 1 Feb 2012 09:19:21 +0000 (09:19 +0000)]
ixgbe: Add module parameter to allow untested and unsafe SFP+ modules

The X520 family of network devices, with the 82599 chip, support a
small number of Intel-verified SFP+ modules on their NICs.  To maintain
stability and quality, the current devices restrict untested 3rd party
SFP+ modules.

This patch introduces a module parameter for ixgbe to allow these untested
modules at the user's peril.  It also includes a warning to the syslog
alerting users that the modules aren't supported, and results may
vary.

CC: Jesper Dangaard Brouer <hawk@comx.dk>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonetpoll: Neaten MAX_SKB_SIZE macro
Joe Perches [Sun, 29 Jan 2012 15:50:44 +0000 (15:50 +0000)]
netpoll: Neaten MAX_SKB_SIZE macro

Add the types in the packet layout order.

Signed-off-by: Joe Perches <joe@perches.com>
Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonetpoll: Convert printks to np_<level> and add pr_fmt
Joe Perches [Sun, 29 Jan 2012 15:50:43 +0000 (15:50 +0000)]
netpoll: Convert printks to np_<level> and add pr_fmt

Use a more current message logging style.
Add pr_fmt to prefix dmesg output with "netpoll: "
Add macros to print np->name.

Signed-off-by: Joe Perches <joe@perches.com>
Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agomISDN: use memchr_inv
Akinobu Mita [Fri, 27 Jan 2012 04:24:55 +0000 (04:24 +0000)]
mISDN: use memchr_inv

Use memchr_inv to check if the data contains all same bytes.  It is
faster than looping for each byte.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Karsten Keil <isdn@linux-pingi.de>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotcp: md5: RST: getting md5 key from listener
Shawn Lu [Tue, 31 Jan 2012 22:35:48 +0000 (22:35 +0000)]
tcp: md5: RST: getting md5 key from listener

TCP RST mechanism is broken in TCP md5(RFC2385). When
connection is gone, md5 key is lost, sending RST
without md5 hash is deem to ignored by peer. This can
be a problem since RST help protocal like bgp to fast
recove from peer crash.

In most case, users of tcp md5, such as bgp and ldp,
have listener on both sides to accept connection from peer.
md5 keys for peers are saved in listening socket.

There are two cases in finding md5 key when connection is
lost:
1.Passive receive RST: The message is send to well known port,
tcp will associate it with listner. md5 key is gotten from
listener.

2.Active receive RST (no sock): The message is send to ative
side, there is no socket associated with the message. In this
case, finding listener from source port, then find md5 key from
listener.

we are not loosing sercuriy here:
packet is checked with md5 hash. No RST is generated
if md5 hash doesn't match or no md5 key can be found.

Signed-off-by: Shawn Lu <shawn.lu@ericsson.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoxfrm6: remove unneeded NULL check in __xfrm6_output()
Dan Carpenter [Tue, 31 Jan 2012 21:45:26 +0000 (21:45 +0000)]
xfrm6: remove unneeded NULL check in __xfrm6_output()

We don't check for NULL consistently in __xfrm6_output().  If "x" were
NULL here it would lead to an OOPs later.  I asked Steffen Klassert
about this and he suggested that we remove the NULL check.

On 10/29/11, Steffen Klassert <steffen.klassert@secunet.com> wrote:
>> net/ipv6/xfrm6_output.c
>>    148
>>    149 if ((x && x->props.mode == XFRM_MODE_TUNNEL) &&
>>                           ^
>
> x can't be null here. It would be a bug if __xfrm6_output() is called
> without a xfrm_state attached to the skb. I think we can just remove
> this null check.

Cc: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotcp: md5: protects md5sig_info with RCU
Eric Dumazet [Tue, 31 Jan 2012 18:45:40 +0000 (18:45 +0000)]
tcp: md5: protects md5sig_info with RCU

This patch makes sure we use appropriate memory barriers before
publishing tp->md5sig_info, allowing tcp_md5_do_lookup() being used from
tcp_v4_send_reset() without holding socket lock (upcoming patch from
Shawn Lu)

Note we also need to respect rcu grace period before its freeing, since
we can free socket without this grace period thanks to
SLAB_DESTROY_BY_RCU

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Shawn Lu <shawn.lu@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agodrivers/net: Remove alloc_etherdev error messages
Joe Perches [Sun, 29 Jan 2012 13:47:52 +0000 (13:47 +0000)]
drivers/net: Remove alloc_etherdev error messages

alloc_etherdev has a generic OOM/unable to alloc message.
Remove the duplicative messages after alloc_etherdev calls.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agodrivers/net: Remove unnecessary k.alloc/v.alloc OOM messages
Joe Perches [Sun, 29 Jan 2012 12:56:23 +0000 (12:56 +0000)]
drivers/net: Remove unnecessary k.alloc/v.alloc OOM messages

alloc failures use dump_stack so emitting an additional
out-of-memory message is an unnecessary duplication.

Remove the allocation failure messages.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet: fec: correct phy_name buffer length when init phy_name
Richard Zhao [Sun, 29 Jan 2012 22:08:12 +0000 (22:08 +0000)]
net: fec: correct phy_name buffer length when init phy_name

Fix the bug that we got wrong phy_name on imx6q sabrelite board.
snprintf used wrong length of phy_name.
phy_name length is MII_BUS_ID_SIZE + 3 rather not MII_BUS_ID_SIZE.
I change it to sizeof(phy_name).

Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotcp: md5: use sock_kmalloc() to limit md5 keys
Eric Dumazet [Tue, 31 Jan 2012 10:56:48 +0000 (10:56 +0000)]
tcp: md5: use sock_kmalloc() to limit md5 keys

There is no limit on number of MD5 keys an application can attach to a
tcp socket.

This patch adds a per tcp socket limit based
on /proc/sys/net/core/optmem_max

With current default optmem_max values, this allows about 150 keys on
64bit arches, and 88 keys on 32bit arches.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge tag 'for-linus' of git://github.com/prasad-joshi/logfs_upstream
Linus Torvalds [Tue, 31 Jan 2012 17:23:59 +0000 (09:23 -0800)]
Merge tag 'for-linus' of git://github.com/prasad-joshi/logfs_upstream

There are few important bug fixes for LogFS

* tag 'for-linus' of git://github.com/prasad-joshi/logfs_upstream:
  Logfs: Allow NULL block_isbad() methods
  logfs: Grow inode in delete path
  logfs: Free areas before calling generic_shutdown_super()
  logfs: remove useless BUG_ON
  MAINTAINERS: Add Prasad Joshi in LogFS maintiners
  logfs: Propagate page parameter to __logfs_write_inode
  logfs: set superblock shutdown flag after generic sb shutdown
  logfs: take write mutex lock during fsync and sync
  logfs: Prevent memory corruption
  logfs: update page reference count for pined pages

Fix up conflict in fs/logfs/dev_mtd.c due to semantic change in what
"mtd->block_isbad" means in commit f2933e86ad93: "Logfs: Allow NULL
block_isbad() methods" clashing with the abstraction changes in the
commits 7086c19d0742: "mtd: introduce mtd_block_isbad interface" and
d58b27ed58a3: "logfs: do not use 'mtd->block_isbad' directly".

This resolution takes the semantics from commit f2933e86ad93, and just
makes mtd_block_isbad() return zero (false) if the 'block_isbad'
function is NULL.  But that also means that now "mtd_can_have_bb()"
always returns 0.

Now, "mtd_block_markbad()" will obviously return an error if the
low-level driver doesn't support bad blocks, so this is somewhat
non-symmetric, but it actually makes sense if a NULL "block_isbad"
function is considered to mean "I assume that all my blocks are always
good".

12 years agotcp: md5: rcu conversion
Eric Dumazet [Tue, 31 Jan 2012 05:18:33 +0000 (05:18 +0000)]
tcp: md5: rcu conversion

In order to be able to support proper RST messages for TCP MD5 flows, we
need to allow access to MD5 keys without locking listener socket.

This conversion is a nice cleanup, and shrinks size of timewait sockets
by 80 bytes.

IPv6 code reuses generic code found in IPv4 instead of duplicating it.

Control path uses GFP_KERNEL allocations instead of GFP_ATOMIC.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Shawn Lu <shawn.lu@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotcp: md5: remove obsolete md5_add() method
Eric Dumazet [Tue, 31 Jan 2012 01:04:42 +0000 (01:04 +0000)]
tcp: md5: remove obsolete md5_add() method

We no longer use md5_add() method from struct tcp_sock_af_ops

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agor8169: spinlock redux.
Francois Romieu [Tue, 31 Jan 2012 10:20:34 +0000 (11:20 +0100)]
r8169: spinlock redux.

rtl8169_get_regs operates under RTNL and rtl task mutex whereas
rtl_set_rx_mode is either called under RTNL or rtl task mutex protection.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes Wang <hayeswang@realtek.com>
12 years agor8169: avoid a useless work scheduling.
Francois Romieu [Tue, 31 Jan 2012 10:09:21 +0000 (11:09 +0100)]
r8169: avoid a useless work scheduling.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Suggested-by: Michał Mirosław <mirqus@gmail.com>
Cc: Hayes Wang <hayeswang@realtek.com>
12 years agor8169: move task enable boolean to bitfield.
Francois Romieu [Tue, 31 Jan 2012 09:56:44 +0000 (10:56 +0100)]
r8169: move task enable boolean to bitfield.

Simpler, more consistent, with negligible cost in non-critical paths.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Suggested-by: Michał Mirosław <mirqus@gmail.com>
Cc: Hayes Wang <hayeswang@realtek.com>
12 years agor8169: bh locking redux and task scheduling.
Francois Romieu [Tue, 31 Jan 2012 09:47:34 +0000 (10:47 +0100)]
r8169: bh locking redux and task scheduling.

- atomic bit operations are globally visible
- pending status is always cleared before execution
- scheduled works are either idempotent or only required to happen once
  after a series of originating events, say link events for instance

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Suggested-by: Michał Mirosław <mirqus@gmail.com>
Cc: Hayes Wang <hayeswang@realtek.com>
12 years agor8169: fix early queue wake-up.
Francois Romieu [Mon, 30 Jan 2012 23:00:19 +0000 (00:00 +0100)]
r8169: fix early queue wake-up.

With infinite gratitude to Eric Dumazet for allowing me to identify
the error.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Hayes Wang <hayeswang@realtek.com>
12 years agoMerge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groec...
Linus Torvalds [Tue, 31 Jan 2012 01:08:40 +0000 (17:08 -0800)]
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging

* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (w83627ehf) Disable setting DC mode for pwm2, pwm3 on NCT6776F
  hwmon: (sht15) fix bad error code
  MAINTAINERS: Drop maintainer for MAX1668 hwmon driver
  MAINTAINERS: Add hwmon entries for Wolfson
  hwmon: (f71805f) Fix clamping of temperature limits

12 years agoMerge branch 'for-torvalds' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
Linus Torvalds [Tue, 31 Jan 2012 01:06:26 +0000 (17:06 -0800)]
Merge branch 'for-torvalds' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Here are some fixes to the pin control system that has accumulated since
-rc1.  Mainly Tony Lindgren fixed the module load/unload logic and the
rest are minor fixes and documentation.

* 'for-torvalds' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  pinctrl: add checks for empty function names
  pinctrl: fix pinmux_hog_maps when ctrl_dev_name is not set
  pinctrl: fix some pinmux typos
  pinctrl: free debugfs entries when unloading a pinmux driver
  pinctrl: unbreak error messages
  Documentation/pinctrl: fix a few syntax errors in code examples
  pinctrl: fix pinconf_pins_show iteration

12 years agoMerge tag 'tty-3.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Linus Torvalds [Mon, 30 Jan 2012 23:17:21 +0000 (15:17 -0800)]
Merge tag 'tty-3.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty

Here are some tty/serial patches for 3.3-rc1

Big thing here is the movement of the 8250 serial drivers to their own
directory, now that the patch churn has calmed down.

Other than that, only minor stuff (omap patches were reverted as they
were found to be wrong), and another broken driver removed from the
system.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* tag 'tty-3.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  serial: Kill off Moorestown code
  Revert "tty: serial: OMAP: ensure FIFO levels are set correctly in non-DMA mode"
  Revert "tty: serial: OMAP: transmit FIFO threshold interrupts don't wake the chip"
  serial: Fix wakeup init logic to speed up startup
  docbook: don't use serial_core.h in device-drivers book
  serial: amba-pl011: lock console writes against interrupts
  amba-pl011: do not disable RTS during shutdown
  tty: serial: OMAP: transmit FIFO threshold interrupts don't wake the chip
  tty: serial: OMAP: ensure FIFO levels are set correctly in non-DMA mode
  omap-serial: make serial_omap_restore_context depend on CONFIG_PM_RUNTIME
  omap-serial :Make the suspend/resume functions depend on CONFIG_PM_SLEEP.
  TTY: fix UV serial console regression
  jsm: Fixed EEH recovery error
  Updated TTY MAINTAINERS info
  serial: group all the 8250 related code together

12 years agortlwifi: Convert to asynchronous firmware load master-2012-01-30
Larry Finger [Mon, 30 Jan 2012 15:54:49 +0000 (09:54 -0600)]
rtlwifi: Convert to asynchronous firmware load

This patch addresses a kernel bugzilla report and two recent mail threads.

The kernel bugzilla report is https://bugzilla.kernel.org/show_bug.cgi?id=42632,
which reports a udev timeout on boot.

The first mail thread, which was on LKML (http://lkml.indiana.edu/hypermail/
linux/kernel/1112.3/00965.html) was for a WARNING that occurs after a
suspend/resume cycle for rtl8192cu.

The scond mail thread (http://marc.info/?l=linux-wireless&m=132655490826766&w=2)
concerned changes in udev that break drivers that delay while firmware is loaded
on modprobe.

This patch converts all rtlwifi-based drivers to use the asynchronous firmware
loading mechanism. Drivers rtl8192ce, rtl8192cu and rtl8192de share a common
callback routine. Driver rtl8192se needs different handling of the firmware,
thus it has its own code.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: Print the correct channel mode
Sujith Manoharan [Mon, 30 Jan 2012 08:51:42 +0000 (14:21 +0530)]
ath9k: Print the correct channel mode

channelFlags doesn't contain the operating HT mode.
Use IS_CHAN_HT40 to determine if the current channel is
in HT40 mode.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k_htc: Load firmware asynchronously
Sujith Manoharan [Mon, 30 Jan 2012 08:47:18 +0000 (14:17 +0530)]
ath9k_htc: Load firmware asynchronously

This patch modifies ath9k_htc to load the needed
firmware in an asynchronous manner, fixing timeouts
that were introduced with the new udev changes.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoMAINTAINERS: update b43(legacy) mailing list
Rafał Miłecki [Sun, 29 Jan 2012 10:59:42 +0000 (11:59 +0100)]
MAINTAINERS: update b43(legacy) mailing list

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: always restrict scan dwell in P2P
Johannes Berg [Sat, 28 Jan 2012 16:30:52 +0000 (08:30 -0800)]
iwlwifi: always restrict scan dwell in P2P

Whenever the PAN (P2P) context is active, it
has timers in the uCode that prevent sleep,
so scanning can't be out of channel for more
than the beacon interval programmed into the
device.

Before this patch, a full scan including any
passive channels when P2P was active would
stall forever because it wouldn't find time
to execute the passive requests (for default
beacon intervals of 100 TU.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: add option to disalbe LED
Wey-Yi Guy [Sat, 28 Jan 2012 16:30:51 +0000 (08:30 -0800)]
iwlwifi: add option to disalbe LED

Led has no use for some platform.
Add additional module parameter option to disable LED

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: fix uCode event tracing
Johannes Berg [Sat, 28 Jan 2012 16:30:50 +0000 (08:30 -0800)]
iwlwifi: fix uCode event tracing

Fix multiple bugs in event tracing:

1) If you enable uCode tracing with the device down,
   it will still attempt to access the device and
   continuously log "MAC is in deep sleep!" errors.
   Fix this by only starting logging when the device
   is actually alive.

2) Now you can set the flag when the device is down,
   but logging doesn't happen when you bring it up.
   To fix that, start logging when the device comes
   alive. This means we don't log before -- we could
   do that but I don't need it right now.

3) For some reason we read the error instead of the
   event log -- use the right pointer.

4) Optimise SRAM reading of event log header.

5) Fix reading write pointer == capacity, which can
   happen due to racy SRAM access

6) Most importantly: fix an error where we would try
   to read WAY too many events (like 2^32-300) when
   we read the wrap counter before it is updated by
   the uCode -- this does happen in practice and will
   cause the driver to hang the machine.

7) Finally, change the timer to 10ms instead of 100ms
   as 100ms is too slow to capture all data with a
   normal event log and with 100ms the log will wrap
   multiple times before we have a chance to read it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: fix typo
Wey-Yi Guy [Sat, 28 Jan 2012 16:30:49 +0000 (08:30 -0800)]
iwlwifi: fix typo

Fix few places of typo

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: Move num_sta_ps counter decrement after synchronize_rcu
Helmut Schaa [Fri, 27 Jan 2012 10:02:53 +0000 (11:02 +0100)]
mac80211: Move num_sta_ps counter decrement after synchronize_rcu

Unted the assumption that the sta struct is still accessible before the
synchronize_rcu call we should move the num_sta_ps counter decrement
after synchronize_rcu to avoid incorrect decrements if num_sta_ps.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: add support for mcs masks
Simon Wunderlich [Sat, 28 Jan 2012 16:25:33 +0000 (17:25 +0100)]
mac80211: add support for mcs masks

* Handle MCS masks set by the user.
* Match rates provided by the rate control algorithm to the mask set,
  also in HT mode, and switch back to legacy mode if necessary.
* add debugfs files to observate the rate selection

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agonl80211: add support for mcs masks
Simon Wunderlich [Sat, 28 Jan 2012 16:25:32 +0000 (17:25 +0100)]
nl80211: add support for mcs masks

Allow to set mcs masks through nl80211. We also allow to set MCS
rates but no legacy rates (and vice versa).

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agortlwifi: Move pr_fmt macros to a single location
Larry Finger [Fri, 27 Jan 2012 19:59:25 +0000 (13:59 -0600)]
rtlwifi: Move pr_fmt macros to a single location

Although the rtlwifi family of devices contains 11 copies of the pr_fmt
macro, the macro is not defined for all routines that need it. By moving
the macro to wifi.h, a single copy is available for all routines.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: Fix incorrect num_sta_ps decrement in ap_sta_ps_end
Helmut Schaa [Mon, 30 Jan 2012 14:18:00 +0000 (15:18 +0100)]
mac80211: Fix incorrect num_sta_ps decrement in ap_sta_ps_end

If the driver blocked this specific STA with the help of
ieee80211_sta_block_awake we won't clear WLAN_STA_PS_STA later but
still decrement num_sta_ps. Hence, the next data frame from this
STA will trigger ap_sta_ps_end again and also decrement num_sta_ps
again leading to an incorrect num_sta_ps counter.

This can result in problems with powersaving clients not waking up
from PS because the TIM calculation might be skipped due to the
incorrect num_sta_ps counter.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: Fix incorrect num_sta_ps decrement in __sta_info_destroy
Helmut Schaa [Fri, 27 Jan 2012 10:02:51 +0000 (11:02 +0100)]
mac80211: Fix incorrect num_sta_ps decrement in __sta_info_destroy

When WLAN_STA_PS_DRIVER is set by ieee80211_sta_block_awake the
num_sta_ps counter is not incremented. Hence, we shouldn't decrement
it in __sta_info_destroy if only WLAN_STA_PS_DRIVER is set. This
could result in an incorrect num_sta_ps counter leading to strange side
effects with associated powersaving clients.

Fix this by only decrementing num_sta_ps when WLAN_STA_PS_STA was set
before.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoMerge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc...
David S. Miller [Mon, 30 Jan 2012 20:47:57 +0000 (15:47 -0500)]
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc-next

12 years agomac80211: station state transition error handling
Johannes Berg [Thu, 12 Jan 2012 08:31:10 +0000 (09:31 +0100)]
mac80211: station state transition error handling

In the future, when we start notifying drivers,
state transitions could potentially fail. To make
it easier to distinguish between programming bugs
and driver failures:
 * rename sta_info_move_state() to
   sta_info_pre_move_state() which can only be
   called before the station is inserted (and
   check this with a new station flag).
 * rename sta_info_move_state_checked() to just
   plain sta_info_move_state(), as it will be
   the regular function that can fail for more
   than just one reason (bad transition or an
   error from the driver)

This makes the programming model easier -- one of
the functions can only be called before insertion
and can't fail, the other can fail.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoRevert "mac80211: Do not scan for IBSS merge with a fixed BSSID."
John W. Linville [Mon, 30 Jan 2012 20:28:11 +0000 (15:28 -0500)]
Revert "mac80211: Do not scan for IBSS merge with a fixed BSSID."

This reverts commit f1e3be1561c43b6bbe2426e34849fb1486dc313b.

Johannes Berg <johannes@sipsolutions.net> thinks that this patch is
incorrect.  I'll defer to his judgment.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agonet: Deinline __nlmsg_put and genlmsg_put. -7k code on i386 defconfig.
Denys Vlasenko [Mon, 30 Jan 2012 20:22:06 +0000 (15:22 -0500)]
net: Deinline __nlmsg_put and genlmsg_put. -7k code on i386 defconfig.

   text    data     bss     dec     hex filename
8455963  532732 1810804 10799499 a4c98b vmlinux.o.before
8448899  532732 1810804 10792435 a4adf3 vmlinux.o

This change also removes commented-out copy of __nlmsg_put
which was last touched in 2005 with "Enable once all users
have been converted" comment on top.

Changes in v2: rediffed against net-next.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge tag 'usb-3.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Linus Torvalds [Mon, 30 Jan 2012 19:38:28 +0000 (11:38 -0800)]
Merge tag 'usb-3.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

Here are a bunch of USB patches for 3.3-rc1.

Nothing major, largest thing here is the removal of some drivers that
did not work at all.  Other than that, the normal collection of bugfixes
and new device ids.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* tag 'usb-3.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (52 commits)
  uwb & wusb: fix kconfig error
  USB: Realtek cr: fix autopm scheduling while atomic
  USB: ftdi_sio: Add more identifiers
  xHCI: Cleanup isoc transfer ring when TD length mismatch found
  usb: musb: omap2430: minor cleanups.
  qcaux: add more Pantech UML190 and UML290 ports
  Revert "drivers: usb: Fix dependency for USB_HWA_HCD"
  usb: mv-otg - Fix build if CONFIG_USB is not set
  USB: cdc-wdm: Avoid hanging on interface with no USB_CDC_DMM_TYPE
  usb: add support for STA2X11 host driver
  drivers: usb: Fix dependency for USB_HWA_HCD
  kernel-doc: fix new warning in usb.h
  USB: OHCI: fix new compiler warnings
  usb: serial: kobil_sct: fix compile warning:
  drivers/usb/host/ehci-fsl.c: add missing iounmap
  USB: cdc-wdm: better allocate a buffer that is at least as big as we tell the USB core
  USB: cdc-wdm: call wake_up_all to allow driver to shutdown on device removal
  USB: cdc-wdm: use two mutexes to allow simultaneous read and write
  USB: cdc-wdm: updating desc->length must be protected by spin_lock
  USB: usbsevseg: fix max length
  ...

12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Linus Torvalds [Mon, 30 Jan 2012 18:53:20 +0000 (10:53 -0800)]
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

1) Setting link attributes can modify the size of the attributes that
   would be reported on a subsequent getlink netlink operation,
   therefore min_ifinfo_dump_size needs to be adjusted.  From Stefan
   Gula.

2) Resegmentation of TSO frames while trimming can violate invariants
   expected by callers, namely that the number of segments can only stay
   the same or decrease, never increase.  If MSS changes, however, we
   can trim data but then end up with more segments.  Fix this by only
   segmenting to the MSS already recorded in the SKB.  That's the
   simplest fix for now and if we want to get more fancy in the future
   that's a more involved change.

   This probably explains some retransmit counter inaccuracies.

   From Neal Cardwell.

3) Fix too-many-wakeups in POLL with AF_UNIX sockets, from Eric Dumazet.

4) Fix CAIF crashes wrt.  namespace handling.  From Eric Dumazet and
   Eric W. Biederman.

5) TCP port selection fixes from Flavio Leitner.

6) More socket memory cgroup build fixes in certain randonfig
   situations.  From Glauber Costa.

7) Fix TCP memory sysctl regression reported by Ingo Molnar, also from
   Glauber Costa.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
  af_unix: fix EPOLLET regression for stream sockets
  tcp: fix tcp_trim_head() to adjust segment count with skb MSS
  net/tcp: Fix tcp memory limits initialization when !CONFIG_SYSCTL
  net caif: Register properly as a pernet subsystem.
  netns: Fail conspicously if someone uses net_generic at an inappropriate time.
  net: explicitly add jump_label.h header to sock.h
  net: RTNETLINK adjusting values of min_ifinfo_dump_size
  ipv6: Fix ip_gre lockless xmits.
  xen-netfront: correct MAX_TX_TARGET calculation.
  netns: fix net_alloc_generic()
  tcp: bind() optimize port allocation
  tcp: bind() fix autoselection to share ports
  l2tp: l2tp_ip - fix possible oops on packet receive
  iwlwifi: fix PCI-E transport "inta" race
  mac80211: set bss_conf.idle when vif is connected
  mac80211: update oper_channel on ibss join

12 years agoMerge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Linus Torvalds [Mon, 30 Jan 2012 18:16:25 +0000 (10:16 -0800)]
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

This fixes an integration issue with the regulator device tree bindings
which shook out in -rc.  The bindings were overly enthusiatic when
deciding to set a voltage on a regulator and would try to set zero volts
on an unconfigured regulator which isn't supported.

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: Set apply_uV only when min and max voltages are defined

12 years agoipv6: fix RFC5722 comment
Eric Dumazet [Mon, 30 Jan 2012 04:29:24 +0000 (04:29 +0000)]
ipv6: fix RFC5722 comment

RFC5722 Section 4 was amended by Errata 3089

Our implementation did the right thing anyway...

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet: Allow ipv6 proxies and arp proxies be shown with iproute2
Tony Zelenoff [Thu, 26 Jan 2012 22:28:58 +0000 (22:28 +0000)]
net: Allow ipv6 proxies and arp proxies be shown with iproute2

Add ability to return neighbour proxies list to caller if
it sent full ndmsg structure and has NTF_PROXY flag set.

Before this patch (and before iproute2 patches):
$ ip neigh add proxy 2001::1 dev eth0
$ ip -6 neigh show
$

After it and with applied iproute2 patches:
$ ip neigh add proxy 2001::1 dev eth0
$ ip -6 neigh show
2001::1 dev eth0  proxy
$

Compatibility with old versions of iproute2 is not broken,
kernel checks for incoming structure size and properly
works if old structure is came.

[v2]
* changed comments style.
* removed useless line with continue and curly bracket.
* changed incoming message size check from equal to more or
  equal.

CC: davem@davemloft.net
CC: kuznet@ms2.inr.ac.ru
CC: netdev@vger.kernel.org
CC: xemul@parallels.com
Signed-off-by: Tony Zelenoff <antonz@parallels.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agodrivers/net: strip unused module code from sun3_82586.c
Paul Gortmaker [Fri, 27 Jan 2012 13:55:46 +0000 (13:55 +0000)]
drivers/net: strip unused module code from sun3_82586.c

This code is clearly unused, since it has a #error right
in it.  Given the vintage of sun3 hardware, it is probably
safe to assume that there is little interest in adding new
functionality to the driver now, so just delete the unused
block of code.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Sam Creasey <sammy@sammy.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agodrivers/net: fix up stale paths from driver reorg
Paul Gortmaker [Fri, 27 Jan 2012 13:36:01 +0000 (13:36 +0000)]
drivers/net: fix up stale paths from driver reorg

The reorganization of the driver layout in drivers/net
left behind some stale paths in comments and in Kconfig
help text.  Bring them up to date.  No actual change to
any code takes place here.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoaf_unix: fix EPOLLET regression for stream sockets
Eric Dumazet [Sat, 28 Jan 2012 16:11:03 +0000 (16:11 +0000)]
af_unix: fix EPOLLET regression for stream sockets

Commit 0884d7aa24 (AF_UNIX: Fix poll blocking problem when reading from
a stream socket) added a regression for epoll() in Edge Triggered mode
(EPOLLET)

Appropriate fix is to use skb_peek()/skb_unlink() instead of
skb_dequeue(), and only call skb_unlink() when skb is fully consumed.

This remove the need to requeue a partial skb into sk_receive_queue head
and the extra sk->sk_data_ready() calls that added the regression.

This is safe because once skb is given to sk_receive_queue, it is not
modified by a writer, and readers are serialized by u->readlock mutex.

This also reduce number of spinlock acquisition for small reads or
MSG_PEEK users so should improve overall performance.

Reported-by: Nick Mathewson <nickm@freehaven.net>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Alexey Moiseytsev <himeraster@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotcp: fix tcp_trim_head() to adjust segment count with skb MSS
Neal Cardwell [Sat, 28 Jan 2012 17:29:46 +0000 (17:29 +0000)]
tcp: fix tcp_trim_head() to adjust segment count with skb MSS

This commit fixes tcp_trim_head() to recalculate the number of
segments in the skb with the skb's existing MSS, so trimming the head
causes the skb segment count to be monotonically non-increasing - it
should stay the same or go down, but not increase.

Previously tcp_trim_head() used the current MSS of the connection. But
if there was a decrease in MSS between original transmission and ACK
(e.g. due to PMTUD), this could cause tcp_trim_head() to
counter-intuitively increase the segment count when trimming bytes off
the head of an skb. This violated assumptions in tcp_tso_acked() that
tcp_trim_head() only decreases the packet count, so that packets_acked
in tcp_tso_acked() could underflow, leading tcp_clean_rtx_queue() to
pass u32 pkts_acked values as large as 0xffffffff to
ca_ops->pkts_acked().

As an aside, if tcp_trim_head() had really wanted the skb to reflect
the current MSS, it should have called tcp_set_skb_tso_segs()
unconditionally, since a decrease in MSS would mean that a
single-packet skb should now be sliced into multiple segments.

Signed-off-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Nandita Dukkipati <nanditad@google.com>
Acked-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet/tcp: Fix tcp memory limits initialization when !CONFIG_SYSCTL
Glauber Costa [Mon, 30 Jan 2012 01:20:17 +0000 (01:20 +0000)]
net/tcp: Fix tcp memory limits initialization when !CONFIG_SYSCTL

sysctl_tcp_mem() initialization was moved to sysctl_tcp_ipv4.c
in commit 3dc43e3e4d0b52197d3205214fe8f162f9e0c334, since it
became a per-ns value.

That code, however, will never run when CONFIG_SYSCTL is
disabled, leading to bogus values on those fields - causing hung
TCP sockets.

This patch fixes it by keeping an initialization code in
tcp_init(). It will be overwritten by the first net namespace
init if CONFIG_SYSCTL is compiled in, and do the right thing if
it is compiled out.

It is also named properly as tcp_init_mem(), to properly signal
its non-sysctl side effect on TCP limits.

Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Glauber Costa <glommer@parallels.com>
Cc: David S. Miller <davem@davemloft.net>
Link: http://lkml.kernel.org/r/4F22D05A.8030604@parallels.com
[ renamed the function, tidied up the changelog a bit ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge branch 'davem-next.r8169' of git://violet.fr.zoreil.com/romieu/linux
David S. Miller [Mon, 30 Jan 2012 17:39:17 +0000 (12:39 -0500)]
Merge branch 'davem-next.r8169' of git://violet.fr.zoreil.com/romieu/linux

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Linus Torvalds [Mon, 30 Jan 2012 17:02:10 +0000 (09:02 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  [S390] dasd: revalidate server for new pathgroup
  [S390] dasd: revert LCU optimization
  [S390] cleanup entry point definition

12 years agoMerge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze
Linus Torvalds [Mon, 30 Jan 2012 16:59:46 +0000 (08:59 -0800)]
Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze

* 'next' of git://git.monstr.eu/linux-2.6-microblaze:
  microblaze: generic atomic64 support

12 years agosfc: Use a more sensible cast in efx_rx_buf_offset()
Ben Hutchings [Mon, 30 Jan 2012 16:55:05 +0000 (16:55 +0000)]
sfc: Use a more sensible cast in efx_rx_buf_offset()

This function returns the page offset of the buffer, which can be
calculated based on either its DMA address or its virtual address.  It
used to use the virtual address and we would cast that to unsigned
long, as anything smaller would result in a compiler warning.  Now
that it's using the DMA address we should use unsigned int, matching
the return type.  It is also unnecessary to use __force.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
12 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Mon, 30 Jan 2012 16:56:41 +0000 (08:56 -0800)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  vmwgfx: Fix assignment in vmw_framebuffer_create_handle
  drm/radeon/kms: Fix device tree linkage of i2c buses
  drm: Pass the real error code back during GEM bo initialisation
  Revert "drm/i810: cleanup reclaim_buffers"

12 years agosfc: MTD: Leave the DEBUG macro alone
Ben Hutchings [Mon, 30 Jan 2012 16:53:37 +0000 (16:53 +0000)]
sfc: MTD: Leave the DEBUG macro alone

<linux/mtd/mtd.h> no longer defines DEBUG so we do not need to
un-define it here.

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