firefly-linux-kernel-4.4.55.git
12 years agoath9k: enable ANI for ar9100 chips
Nikolay Martynov [Wed, 7 Dec 2011 02:57:17 +0000 (21:57 -0500)]
ath9k: enable ANI for ar9100 chips

  Enable ANI for ar9100 since it seems to be working fine (and as a
matter of fact ANI was always performed for ar9100 since code which
was supposed to disable it didn't achieve this goal).
  This patch sets config.enable_ani to default (true) value for
ar9100.

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: use config.enable_ani to check if ani should be performed
Nikolay Martynov [Sat, 3 Dec 2011 03:39:16 +0000 (22:39 -0500)]
ath9k: use config.enable_ani to check if ani should be performed

  Currently in ath9k code there is an attempt which is meant to
disable ANI for ar9100 and ar9340. But it doesn't really achieve
this. All it does is disable ANI init and setup (i.e. calls to
ath9k_hw_ani_setup and ath9k_hw_ani_init). Since ath9k_hw_ani_setup is
not called ah->config.ani_poll_interval is never initialized (i.e. it
is always zero) and ath_ani_calibrate always executes ANI procedures
(over uninitialized ANI parameters).
  Moreover, ath_ani_calibrate is being called each 1ms because
common->ani.timer is set to zero interval because
ah->config.ani_poll_interval==0 (and thus smallest value of all
intervals). Normally it should not be called this often.
  This patch changes the code so config.enable_ani is used to check if
ANI should be performed.
  config.enable_ani is initialized to true by default. This patch sets
it to false for ar9100 and ar9340.

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: change calibration debug log to output all calibration types
Nikolay Martynov [Sat, 3 Dec 2011 03:39:15 +0000 (22:39 -0500)]
ath9k: change calibration debug log to output all calibration types

  To help debugging write a log entry when long calibration, short
calibration or ANI is performed.

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: trivial: cosmetic fix in calibration debug log
Nikolay Martynov [Sat, 3 Dec 2011 03:39:14 +0000 (22:39 -0500)]
ath9k: trivial: cosmetic fix in calibration debug log

  Add missed space and change typo in calibration debugging log.

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: cancel all workqueue activity when going idle
Felix Fietkau [Wed, 16 Nov 2011 12:08:43 +0000 (13:08 +0100)]
ath9k: cancel all workqueue activity when going idle

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: only drop packets in drv_flush when asked to
Felix Fietkau [Wed, 16 Nov 2011 12:08:42 +0000 (13:08 +0100)]
ath9k: only drop packets in drv_flush when asked to

Recently more places in mac80211 call drv_flush to ensure proper order
for state changes wrt. powersave, channel changes, etc. On some systems
such calls lead to spurious logspam about failing to stop tx dma, as well
as hardware resets that go along with that.
Instead of dropping packets in a place where it's completely unnecessary,
only do it when drop == true.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: rework power state handling
Felix Fietkau [Wed, 16 Nov 2011 12:08:41 +0000 (13:08 +0100)]
ath9k: rework power state handling

Turning off the radio when mac80211 tells the driver that it's idle is not
a good idea, as idle interfaces might still occasionally scan or send packets.
The only time the radio can be safely turned off is when drv_stop has been
called. In the mean time, use sc->ps_idle only to indicate network sleep vs
full sleep.
Move the LED GPIO changes out of the PCI suspend/resume path, the start/stop
functions already take care of that.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: always issue a full hw reset after waking up from full-sleep mode
Felix Fietkau [Wed, 16 Nov 2011 12:08:40 +0000 (13:08 +0100)]
ath9k: always issue a full hw reset after waking up from full-sleep mode

After waking up from full sleep, registers are accessible, but rx/tx
typically fails. A fast channel change will not recover from this, so
ensure that a full-sleep -> wake transition is always followed by a full
reset.

The reason why this hasn't created any serious problems yet is that it's
hidden by the (wrong) behavior of enabling/disabling the radio when the
wiphy idle state changes.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobnx2x: fix typo in fcoe stats collection
Barak Witkowski [Wed, 7 Dec 2011 03:45:36 +0000 (03:45 +0000)]
bnx2x: fix typo in fcoe stats collection

Signed-off-by: Barak Witkowski <barak@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
David S. Miller [Wed, 7 Dec 2011 02:10:05 +0000 (21:10 -0500)]
Merge git://git./linux/kernel/git/davem/net

12 years agocaif: Replace BUG_ON with WARN_ON.
Roar Førde [Tue, 6 Dec 2011 12:15:44 +0000 (12:15 +0000)]
caif: Replace BUG_ON with WARN_ON.

BUG_ON is too strict in a number of circumstances,
use WARN_ON instead. Protocol errors should not halt the system.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agocaif-shm: Bugfixes for caif_shmcore.c
sjur.brandeland@stericsson.com [Tue, 6 Dec 2011 12:15:43 +0000 (12:15 +0000)]
caif-shm: Bugfixes for caif_shmcore.c

Various bugfixes for caif_shmcore.c:
- fix deadlocks due to improper usage of spin-lock
- add missing spin-lock init
- don't call dev_kfree_skb() with irqs disabled,
  use dev_kfree_skb_irq() instead.
- fix potential skb null pointer de-reference.

Squashed original patches from:
Rabin Vincent <rabin.vincent@stericsson.com>
Durga Prasada Rao BATHINA <durgaprasadarao.b@stericcson.com>
Arun Murthy <arun.murthy@stericsson.com>
Bibek Basu <bibek.basu@stericsson.com>

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agocaif: Bad assert triggering false positive.
sjur.brandeland@stericsson.com [Tue, 6 Dec 2011 12:15:42 +0000 (12:15 +0000)]
caif: Bad assert triggering false positive.

Fix bad assert on fragment size triggering false positive.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agocaif-hsi: Remove wake line modification when flushing FIFO
Christian Auby [Tue, 6 Dec 2011 12:15:41 +0000 (12:15 +0000)]
caif-hsi: Remove wake line modification when flushing FIFO

Raising wake before flushing FIFO and lowering it after caused a
spike on AC wake that were sometimes detected and acted upon by the
modem. Fixed this by remove wake line modification when flushing FIFO.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoipv6: Move xfrm_lookup() call down into icmp6_dst_alloc().
David S. Miller [Tue, 6 Dec 2011 22:04:13 +0000 (17:04 -0500)]
ipv6: Move xfrm_lookup() call down into icmp6_dst_alloc().

And return error pointers.

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoipv6: Make third arg to anycast_dst_alloc() bool.
David S. Miller [Tue, 6 Dec 2011 21:48:14 +0000 (16:48 -0500)]
ipv6: Make third arg to anycast_dst_alloc() bool.

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobnx2x: Fix compile errors if CONFIG_CNIC is not set
Michael Chan [Tue, 6 Dec 2011 10:58:08 +0000 (10:58 +0000)]
bnx2x: Fix compile errors if CONFIG_CNIC is not set

Don't provide FCoE and iSCSI statistics to management firmware if
CONFIG_CNIC is not set.  Some needed structure fields are not defined
without CONFIG_CNIC.

Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agomac80211: Remove WARN_ON in apply-ht-override logic.
Ben Greear [Mon, 5 Dec 2011 19:15:55 +0000 (11:15 -0800)]
mac80211: Remove WARN_ON in apply-ht-override logic.

AP interfaces routinely call this logic, so just silently
return when this happens instead of splatting the kernel
logs.

Reported-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobcma: pci: use fixed windows when possible
Rafał Miłecki [Mon, 5 Dec 2011 18:13:39 +0000 (19:13 +0100)]
bcma: pci: use fixed windows when possible

Some cores are mapped in the fixed way, they registers can be accessed
all the time.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: accept public action frames with mismatched BSSID
Johannes Berg [Tue, 6 Dec 2011 09:39:40 +0000 (10:39 +0100)]
mac80211: accept public action frames with mismatched BSSID

Arik's patch "mac80211: allow action frames with unknown
BSSID in GO mode" allowed any action frames in P2P mode
to go through, but only to cooked monitor interfaces as
the IEEE80211_RX_RA_MATCH was still cleared. As a result
my no-monitor patches broke invitation responses.

Instead of allowing any action frames in P2P GO mode to
go through with a wrong BSSID like that patch did, allow
all public action frames. They will never be processed
by mac80211, but can be reported via nl80211 then.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: fix retransmit
Johannes Berg [Fri, 2 Dec 2011 21:08:52 +0000 (22:08 +0100)]
mac80211: fix retransmit

This fixes another regression from my "pass all
fragments to driver at once" patches -- if the
packet is being retransmitted then we don't go
through all handlers, but we still need to move
it to the skbs list, otherwise we run into the
first warning in __ieee80211_tx() and leak the
skb.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlwifi: move ucode notification from iwl_priv to iwl_shared
Don Fry [Fri, 2 Dec 2011 16:48:40 +0000 (08:48 -0800)]
iwlwifi: move ucode notification from iwl_priv to iwl_shared

Move the notification structures for ucode operations from the
iwl_priv structure to the iwl_shared structure, with associated
code changes.

Signed-off-by: Don Fry <donald.h.fry@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: move ucode_type from iwl_priv to iwl_shared
Don Fry [Fri, 2 Dec 2011 16:48:39 +0000 (08:48 -0800)]
iwlwifi: move ucode_type from iwl_priv to iwl_shared

Move the ucode_type variable from the iwl_priv to the iwl_shared
structure with associated code changes.

Signed-off-by: Don Fry <donald.h.fry@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: replace iwl_priv reference with iwl_trans for ucode.
Don Fry [Fri, 2 Dec 2011 16:48:38 +0000 (08:48 -0800)]
iwlwifi: replace iwl_priv reference with iwl_trans for ucode.

Replace the references to the iwl_priv structure with the iwl_trans
structure as the priv structure is never referenced other than to
access the trans structure.  Rename from iwlagn to iwl.

Signed-off-by: Don Fry <donald.h.fry@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: rename iwl-agn-ucode as iwl-ucode
Don Fry [Fri, 2 Dec 2011 16:48:37 +0000 (08:48 -0800)]
iwlwifi: rename iwl-agn-ucode as iwl-ucode

iwl-agn-ucode is generic ucode operations, not limited just to iwlagn.

Signed-off-by: Don Fry <donald.h.fry@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: Rename file name from iwl-sv-open.c to iwl-testmode.c
Wey-Yi Guy [Fri, 2 Dec 2011 16:48:36 +0000 (08:48 -0800)]
iwlwifi: Rename file name from iwl-sv-open.c to iwl-testmode.c

The file dealing with all the operations through testmode, rename it.

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 WOWLAN uCode loading support by testmode
Hsu, Kenny [Fri, 2 Dec 2011 16:48:35 +0000 (08:48 -0800)]
iwlwifi: add WOWLAN uCode loading support by testmode

Create new tm command for WOWLAN uCode loading to support
further debugging function in userspace.

- IWL_TM_CMD_APP2DEV_LOAD_WOWLAN_FW

Signed-off-by: Kenny Hsu <kenny.hsu@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 agoiwlagn: make debug levels more readable
Johannes Berg [Fri, 2 Dec 2011 16:48:34 +0000 (08:48 -0800)]
iwlagn: make debug levels more readable

Using the actual shifted constants here allows
one to read and or them more easily.

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 agoiwlagn: remove MACDUMP debug
Johannes Berg [Fri, 2 Dec 2011 16:48:33 +0000 (08:48 -0800)]
iwlagn: remove MACDUMP debug

This is only used for TX debugging where there
already is more debugging and tracing is more
useful anyway, so remove 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 agoiwlagn: remove HC_DUMP debug
Johannes Berg [Fri, 2 Dec 2011 16:48:32 +0000 (08:48 -0800)]
iwlagn: remove HC_DUMP debug

This debug level is unused, remove 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 agoiwlagn: remove TX_REPLY_LIMIT debug
Johannes Berg [Fri, 2 Dec 2011 16:48:31 +0000 (08:48 -0800)]
iwlagn: remove TX_REPLY_LIMIT debug

This macro is unused right now.

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: declare static for iwl_sram_cleanup function
Wey-Yi Guy [Fri, 2 Dec 2011 16:48:29 +0000 (08:48 -0800)]
iwlwifi: declare static for iwl_sram_cleanup function

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 generic chunk size of tm dumpit packet
Hsu, Kenny [Fri, 2 Dec 2011 16:48:28 +0000 (08:48 -0800)]
iwlwifi: add generic chunk size of tm dumpit packet

Use generic chunk size of dumpit packet for
all necessary testmode commands instead of
add declaration individually.

Signed-off-by: Kenny Hsu <kenny.hsu@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 range checking in tm sram read command
Kenny Hsu [Fri, 2 Dec 2011 16:48:27 +0000 (08:48 -0800)]
iwlwifi: add range checking in tm sram read command

The size of sram may alter according to ucode type.
Retrieve the maximum sram size by current ucode
type for range checking to prevent wrong data access.

Signed-off-by: Kenny Hsu <kenny.hsu@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 tm commands for sram reading by dumpit
Hsu, Kenny [Fri, 2 Dec 2011 16:48:26 +0000 (08:48 -0800)]
iwlwifi: add tm commands for sram reading by dumpit

Create new testmode commands and attributes to suppot
sram data reading. Because the amount of sram data
may exceed single skb packet size. Using the nl80211
dump it funtion to deliver sram data to userspace.

- IWL_TM_CMD_APP2DEV_READ_SRAM
- IWL_TM_CMD_APP2DEV_DUMP_SRAM
- IWL_TM_ATTR_SRAM_ADDR
- IWL_TM_ATTR_SRAM_SIZE
- IWL_TM_ATTR_SRAM_DUMP

Signed-off-by: Kenny Hsu <kenny.hsu@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 agoath9k: clarify max_streams for AR9462
Mohammed Shafi Shajakhan [Thu, 1 Dec 2011 12:44:01 +0000 (18:14 +0530)]
ath9k: clarify max_streams for AR9462

max_streams for AR9462 is '2'. it does not fixes anything, but
improves the code readability

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k_hw: sync to latest AR9462 INI
Mohammed Shafi Shajakhan [Thu, 1 Dec 2011 05:44:19 +0000 (11:14 +0530)]
ath9k_hw: sync to latest AR9462 INI

based on systems change to improve rx dynamic range,
and enables heavy clip for 5G HT40 MCS0 to improve
spectral mask power. also remove an unused function
declaration

Cc: Wilson Tsao <wtsao@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agortl8192c: Do not log firmware load message unless actually done
Larry Finger [Wed, 30 Nov 2011 16:58:14 +0000 (10:58 -0600)]
rtl8192c: Do not log firmware load message unless actually done

A previous commit fixed a problem whereby the rtl8192c driver loaded the
firmware from disk many times; however, the log message was not moved.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: Add HT operation modes for IBSS
Alexander Simon [Wed, 30 Nov 2011 15:56:34 +0000 (16:56 +0100)]
mac80211: Add HT operation modes for IBSS

The HT mode is set by iw (previous patchsets).
The interface is set into the specified HT mode.
HT mode and capabilities are announced in beacons.

If we add a station that uses HT also, the fastest matching HT mode will
be used for transmission. That means if we are using HT40+ and we add a station
running on HT40-, we would transfer at HT20.

If we join an IBSS with HT40, but the secondary channel is not
available, we will fall back into HT20 as well.

Allow frame aggregation to start in IBSS mode.

Signed-off-by: Alexander Simon <an.alexsimon@googlemail.com>
[siwu@hrz.tu-chemnitz.de: Updates]
* remove implicit channel_type enum assumptions
* use rate_control_rate_init() if channel type changed
* remove channel flags check
* activate HT IBSS feature support
* slightly reword commit message
* rebase on wireless-testing

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agomac80211: handle protection mode, RIFS and ADDBA for HT IBSS
Simon Wunderlich [Wed, 30 Nov 2011 15:56:33 +0000 (16:56 +0100)]
mac80211: handle protection mode, RIFS and ADDBA for HT IBSS

* Follow 802.11n-2009 9.13.3.1 for protection mode and ADDBA
* Send ADDBA only to HT STAs - implement 11.5.1.1 partially

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agonl80211: Parse channel type attribute in an ibss join request
Alexander Simon [Wed, 30 Nov 2011 15:56:32 +0000 (16:56 +0100)]
nl80211: Parse channel type attribute in an ibss join request

Prepare cfg80211 for IBSS HT:
 * extend cfg80211 ibss struct with channel_type
 * Check if extension channel can be used
 * Export can_beacon_sec_chan for use in mac80211 (will be called
   from ibss.c later).

Signed-off-by: Alexander Simon <an.alexsimon@googlemail.com>
[siwu@hrz.tu-chemnitz.de: Updates]
* fix cfg80211_can_beacon_ext_chan comment
* remove implicit channel_type enum assumptions
* remove radar channel flags check
* add HT IBSS feature flag
* reword commit message

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwlegacy: Use kcalloc instead of kzalloc to allocate array
Thomas Meyer [Tue, 29 Nov 2011 21:08:00 +0000 (22:08 +0100)]
iwlegacy: Use kcalloc instead of kzalloc to allocate array

The advantage of kcalloc is, that will prevent integer overflows which could
result from the multiplication of number of elements and size and it is also
a bit nicer to read.

The semantic patch that makes this change is available
in https://lkml.org/lkml/2011/11/25/107

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agort2x00: Use kcalloc instead of kzalloc to allocate array
Thomas Meyer [Tue, 29 Nov 2011 21:08:00 +0000 (22:08 +0100)]
rt2x00: Use kcalloc instead of kzalloc to allocate array

The advantage of kcalloc is, that will prevent integer overflows which could
result from the multiplication of number of elements and size and it is also
a bit nicer to read.

The semantic patch that makes this change is available
in https://lkml.org/lkml/2011/11/25/107

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/padovan/blueto...
John W. Linville [Tue, 6 Dec 2011 21:02:05 +0000 (16:02 -0500)]
Merge branch 'master' of git://git./linux/kernel/git/padovan/bluetooth-next

12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Linus Torvalds [Tue, 6 Dec 2011 20:03:54 +0000 (12:03 -0800)]
Merge git://git./linux/kernel/git/davem/net

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
  net: Silence seq_scale() unused warning
  ipv4:correct description for tcp_max_syn_backlog
  pasemi_mac: Fix building as module
  netback: Fix alert message.
  r8169: fix Rx index race between FIFO overflow recovery and NAPI handler.
  r8169: Rx FIFO overflow fixes.
  ipv4: Fix peer validation on cached lookup.
  ipv4: make sure RTO_ONLINK is saved in routing cache
  iwlwifi: change the default behavior of watchdog timer
  iwlwifi: do not re-configure HT40 after associated
  iwlagn: fix HW crypto for TX-only keys
  Revert "mac80211: clear sta.drv_priv on reconfiguration"
  mac80211: fill rate filter for internal scan requests
  cfg80211: amend regulatory NULL dereference fix
  cfg80211: fix race on init and driver registration

12 years agoMerge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Tue, 6 Dec 2011 19:54:33 +0000 (11:54 -0800)]
Merge branch 'perf-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  ftrace: Fix hash record accounting bug
  perf: Fix parsing of __print_flags() in TP_printk()
  jump_label: jump_label_inc may return before the code is patched
  ftrace: Remove force undef config value left for testing
  tracing: Restore system filter behavior
  tracing: fix event_subsystem ref counting

12 years agonet: Silence seq_scale() unused warning
Stephen Boyd [Tue, 6 Dec 2011 08:04:40 +0000 (08:04 +0000)]
net: Silence seq_scale() unused warning

On a CONFIG_NET=y build

net/core/secure_seq.c:22: warning: 'seq_scale' defined but not
used

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agosock_diag: Move the sock_ code to net/core/
Pavel Emelyanov [Tue, 6 Dec 2011 07:59:52 +0000 (07:59 +0000)]
sock_diag: Move the sock_ code to net/core/

This patch moves the sock_ code from inet_diag.c to generic sock_diag.c
file and provides necessary request_module-s calls and a pointer on
inet_diag_compat dumping routine.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoinet_diag: Cleanup type2proto last user
Pavel Emelyanov [Tue, 6 Dec 2011 07:59:32 +0000 (07:59 +0000)]
inet_diag: Cleanup type2proto last user

Now all the code works with sock_diag_req-compatible structs, so it's
possible to stop using the inet_diag_type2proto in inet_csk_diag_fill.
Pass the inet_diag_req into it and use the sdiag_protocol field. At the
same time remove the explicit ext argument, since it's also on the req.

However, this conversion is still required in _compat code, so just move
this routine, not remove.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoinet_diag: Introduce socket family checks
Pavel Emelyanov [Tue, 6 Dec 2011 07:59:15 +0000 (07:59 +0000)]
inet_diag: Introduce socket family checks

The new API will specify family to work with. Teach the existing
socket walking code to bypass not interesting ones.

To preserve compatibility with existing behavior the _compat code
sets interesting family to AF_UNSPEC to dump them all.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoinet_diag: Switch the _dump to work with new header
Pavel Emelyanov [Tue, 6 Dec 2011 07:58:58 +0000 (07:58 +0000)]
inet_diag: Switch the _dump to work with new header

Make inet_diag_dumo work with given header instead of calculating
one from the nl message.

The SOCK_DIAG_BY_FAMILY just passes skb's one through, the compat code
converts the old header to new one.

Also fix the bytecode calculation to find one at proper offset.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoinet_diag: Switch the _get_exact to work with new header
Pavel Emelyanov [Tue, 6 Dec 2011 07:58:39 +0000 (07:58 +0000)]
inet_diag: Switch the _get_exact to work with new header

Make inet_diag_get_exact work with given header instead of calculating
one from the nl message.

The SOCK_DIAG_BY_FAMILY just passes skb's one through, the compat code
converts the old header to new one.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoinet_diag: Introduce new inet_diag_req header
Pavel Emelyanov [Tue, 6 Dec 2011 07:58:21 +0000 (07:58 +0000)]
inet_diag: Introduce new inet_diag_req header

This one coinsides with the sock_diag_req in the beginning and
contains only used fields from its previous analogue.

The existing code is patched to use the _compat version of it
for now.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agosock_diag: Initial skeleton
Pavel Emelyanov [Tue, 6 Dec 2011 07:58:03 +0000 (07:58 +0000)]
sock_diag: Initial skeleton

When receiving the SOCK_DIAG_BY_FAMILY message we have to find the
handler for provided family and pass the nl message to it.

This patch describes an infrastructure to work with such nandlers
and implements stubs for AF_INET(6) ones.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoinet_diag: Switch from _GETSOCK to IPPROTO_ numbers
Pavel Emelyanov [Tue, 6 Dec 2011 08:05:24 +0000 (08:05 +0000)]
inet_diag: Switch from _GETSOCK to IPPROTO_ numbers

Sorry, but the vger didn't let this message go to the list. Re-sending it with
less spam-filter-prone subject.

When dumping the AF_INET/AF_INET6 sockets user will also specify the protocol,
so prepare the protocol diag handlers to work with IPPROTO_ constants.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoinet_diag: Move byte-code finding up the call-stack
Pavel Emelyanov [Tue, 6 Dec 2011 07:57:26 +0000 (07:57 +0000)]
inet_diag: Move byte-code finding up the call-stack

Current code calculates it at fixed offset. This offset will change, so
move the BC calculation upper to make the further patching simpler.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agosock_diag: Introduce new message type
Pavel Emelyanov [Tue, 6 Dec 2011 07:57:06 +0000 (07:57 +0000)]
sock_diag: Introduce new message type

This type will run the family+protocol based socket dumping.
Also prepare the stub function for it.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoinet_diag: Partly rename inet_ to sock_
Pavel Emelyanov [Tue, 6 Dec 2011 07:56:43 +0000 (07:56 +0000)]
inet_diag: Partly rename inet_ to sock_

The ultimate goal is to get the sock_diag module, that works in
family+protocol terms. Currently this is suitable to do on the
inet_diag basis, so rename parts of the code. It will be moved
to sock_diag.c later.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobatman-adv: format multi-line if in the correct way
Antonio Quartulli [Fri, 2 Dec 2011 16:38:52 +0000 (17:38 +0100)]
batman-adv: format multi-line if in the correct way

in an multi-line if statement leading edges should line up to the opening
parenthesis

Reported-by: David Miller <davem@davemloft.net>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
12 years agobatman-adv: remove extra negation in gw_out_of_range()
Dan Carpenter [Tue, 29 Nov 2011 06:09:09 +0000 (09:09 +0300)]
batman-adv: remove extra negation in gw_out_of_range()

There is a typo here where an extra '!' made the check to the opposite
of what was intended.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
12 years agocaif-spi: Bugfix for dump upon device removal
Erwan Bracq [Tue, 6 Dec 2011 07:25:05 +0000 (07:25 +0000)]
caif-spi: Bugfix for dump upon device removal

Fix dump upon device removal, by moving deinitialization from
platform-device-remove to network-interface-uninit.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville...
David S. Miller [Tue, 6 Dec 2011 18:31:19 +0000 (13:31 -0500)]
Merge branch 'for-davem' of git://git./linux/kernel/git/linville/wireless-next

12 years agobnx2x: fix crash while ethtool -t
Dmitry Kravkov [Tue, 6 Dec 2011 02:05:12 +0000 (02:05 +0000)]
bnx2x: fix crash while ethtool -t

commit 2df1a70aaf70e8dff11b89b938a5f317556ee640  "bnx2x: Support
for byte queue limits" has introduced an asymmetry in usage of
netdev_tx_completed_queue and netdev_tx_sent_queue. Missing
call to netdev_tx_sent_queue causes the crash during ethtool -t.

The patch adds the missing call.

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonetback: fix typo in comment
Wei Liu [Tue, 6 Dec 2011 02:04:50 +0000 (02:04 +0000)]
netback: fix typo in comment

"variables a used" should be "variables are used".

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonetback: remove redundant assignment
Wei Liu [Tue, 6 Dec 2011 00:08:20 +0000 (00:08 +0000)]
netback: remove redundant assignment

New value for netbk->mmap_pages[pending_idx] is assigned in
xen_netbk_alloc_page(), no need for a second assignment which
exposes internal to the outside world.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobnx2x, cnic: support DRV_INFO upon FW request
Barak Witkowski [Mon, 5 Dec 2011 22:41:50 +0000 (22:41 +0000)]
bnx2x, cnic: support DRV_INFO upon FW request

Add support to send driver capabilities, settings and statistics to
management firmware.

[ Redone using many local variables, removed many unnecessary inlines,
  and put #defines at the left margin suggested by Joe Perches ]

Signed-off-by: Barak Witkowski <barak@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobnx2x: support classification config query
Ariel Elior [Mon, 5 Dec 2011 21:52:24 +0000 (21:52 +0000)]
bnx2x: support classification config query

To support copying MAC addresses to firmware query structure.

[ Fixed up style and formatting errors noted by DaveM and Joe Perches ]

Signed-off-by: Ariel Elior <ariele@broadcom.com>
Signed-off-by: Barak Witkowski <barak@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobnx2x: add fcoe statistics
Barak Witkowski [Mon, 5 Dec 2011 21:52:23 +0000 (21:52 +0000)]
bnx2x: add fcoe statistics

Add FCoE statistics support for FCoE capable devices.

Signed-off-by: Barak Witkowski <barak@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobnx2x: add PFC statistics
Barak Witkowski [Mon, 5 Dec 2011 21:52:22 +0000 (21:52 +0000)]
bnx2x: add PFC statistics

Add Priority flow control counters for ethtool -S.

Signed-off-by: Barak Witkowski <barak@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoipv4:correct description for tcp_max_syn_backlog
Peter Pan(潘卫平) [Mon, 5 Dec 2011 21:39:41 +0000 (21:39 +0000)]
ipv4:correct description for tcp_max_syn_backlog

Since commit c5ed63d66f24(tcp: fix three tcp sysctls tuning),
sysctl_max_syn_backlog is determined by tcp_hashinfo->ehash_mask,
and the minimal value is 128, and it will increase in proportion to the
memory of machine.
The original description for tcp_max_syn_backlog and sysctl_max_syn_backlog
are out of date.

Changelog:
V2: update description for sysctl_max_syn_backlog

Signed-off-by: Weiping Pan <panweiping3@gmail.com>
Reviewed-by: Shan Wei <shanwei88@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoopenvswitch: small potential memory leak in ovs_vport_alloc()
Dan Carpenter [Mon, 5 Dec 2011 20:27:07 +0000 (20:27 +0000)]
openvswitch: small potential memory leak in ovs_vport_alloc()

We're unlikely to hit this leak, but the static checkers complain if we
don't take care of it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
John W. Linville [Tue, 6 Dec 2011 15:47:12 +0000 (10:47 -0500)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-next into for-davem

12 years agopasemi_mac: Fix building as module
Ben Hutchings [Mon, 5 Dec 2011 19:44:22 +0000 (19:44 +0000)]
pasemi_mac: Fix building as module

Commit ded19addf9c937d83b9bfb4d73a836732569041b ('pasemic_mac*: Move
the PA Semi driver') inadvertently split pasemi_mac into two separate
modules with unresolved symbols.  Change it back into a single module.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoipv4: arp: Cleanup in arp.c
Igor Maravic [Mon, 5 Dec 2011 02:25:57 +0000 (02:25 +0000)]
ipv4: arp: Cleanup in arp.c

Use "IS_ENABLED(CONFIG_FOO)" macro instead of
"defined(CONFIG_FOO) || defined(CONFIG_FOO_MODULE)"

Signed-off-by: Igor Maravic <igorm@etf.rs>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonetback: Fix alert message.
Wei Liu [Mon, 5 Dec 2011 06:57:44 +0000 (06:57 +0000)]
netback: Fix alert message.

The original message in netback_init was 'kthread_run() fails', which should be
'kthread_create() fails'.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86
Linus Torvalds [Tue, 6 Dec 2011 01:27:55 +0000 (17:27 -0800)]
Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86

* 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86:
  toshiba_acpi: Fix machines that don't support HCI_SYSTEM_EVENT

12 years agoMerge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Tue, 6 Dec 2011 00:54:15 +0000 (16:54 -0800)]
Merge branch 'x86-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  intr_remapping: Fix section mismatch in ir_dev_scope_init()
  intel-iommu: Fix section mismatch in dmar_parse_rmrr_atsr_dev()
  x86, amd: Fix up numa_node information for AMD CPU family 15h model 0-0fh northbridge functions
  x86, AMD: Correct align_va_addr documentation
  x86/rtc, mrst: Don't register a platform RTC device for for Intel MID platforms
  x86/mrst: Battery fixes
  x86/paravirt: PTE updates in k(un)map_atomic need to be synchronous, regardless of lazy_mmu mode
  x86: Fix "Acer Aspire 1" reboot hang
  x86/mtrr: Resolve inconsistency with Intel processor manual
  x86: Document rdmsr_safe restrictions
  x86, microcode: Fix the failure path of microcode update driver init code
  Add TAINT_FIRMWARE_WORKAROUND on MTRR fixup
  x86/mpparse: Account for bus types other than ISA and PCI
  x86, mrst: Change the pmic_gpio device type to IPC
  mrst: Added some platform data for the SFI translations
  x86,mrst: Power control commands update
  x86/reboot: Blacklist Dell OptiPlex 990 known to require PCI reboot
  x86, UV: Fix UV2 hub part number
  x86: Add user_mode_vm check in stack_overflow_check

12 years agoMerge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Tue, 6 Dec 2011 00:54:00 +0000 (16:54 -0800)]
Merge branch 'perf-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf: Fix loss of notification with multi-event
  perf, x86: Force IBS LVT offset assignment for family 10h
  perf, x86: Disable PEBS on SandyBridge chips
  trace_events_filter: Use rcu_assign_pointer() when setting ftrace_event_call->filter
  perf session: Fix crash with invalid CPU list
  perf python: Fix undefined symbol problem
  perf/x86: Enable raw event access to Intel offcore events
  perf: Don't use -ENOSPC for out of PMU resources
  perf: Do not set task_ctx pointer in cpuctx if there are no events in the context
  perf/x86: Fix PEBS instruction unwind
  oprofile, x86: Fix crash when unloading module (nmi timer mode)
  oprofile: Fix crash when unloading module (hr timer mode)

12 years agoMerge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Tue, 6 Dec 2011 00:53:43 +0000 (16:53 -0800)]
Merge branch 'timers-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  clockevents: Set noop handler in clockevents_exchange_device()
  tick-broadcast: Stop active broadcast device when replacing it
  clocksource: Fix bug with max_deferment margin calculation
  rtc: Fix some bugs that allowed accumulating time drift in suspend/resume
  rtc: Disable the alarm in the hardware

12 years agoMerge branches 'core-urgent-for-linus' and 'irq-urgent-for-linus' of git://git.kernel...
Linus Torvalds [Tue, 6 Dec 2011 00:51:21 +0000 (16:51 -0800)]
Merge branches 'core-urgent-for-linus' and 'irq-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

* 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  slab, lockdep: Fix silly bug

* 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  genirq: Fix race condition when stopping the irq thread

12 years agoMerge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Tue, 6 Dec 2011 00:50:24 +0000 (16:50 -0800)]
Merge branch 'sched-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  sched, x86: Avoid unnecessary overflow in sched_clock
  sched: Fix buglet in return_cfs_rq_runtime()
  sched: Avoid SMT siblings in select_idle_sibling() if possible
  sched: Set the command name of the idle tasks in SMP kernels
  sched, rt: Provide means of disabling cross-cpu bandwidth sharing
  sched: Document wait_for_completion_*() return values
  sched_fair: Fix a typo in the comment describing update_sd_lb_stats
  sched: Add a comment to effective_load() since it's a pain

12 years agoMerge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6
Linus Torvalds [Mon, 5 Dec 2011 23:35:16 +0000 (15:35 -0800)]
Merge branch 'for-linus' of git://git390.marist.edu/linux-2.6

* 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6:
  [S390] ap: Setup timer for sending messages after reset.
  [S390] cio: fix chsc_chp_vary
  [S390] cio: provide fake irb for transport mode IO
  [S390] cio: disallow driver io for known to be broken paths
  [S390] hibernate: directly trigger subchannel evaluation
  [S390] remove reset of system call restart on psw changes
  [S390] add missing .set function for NT_S390_LAST_BREAK regset
  [S390] fix page change underindication in pgste_update_all
  [S390] ptrace inferior call interactions with TIF_SYSCALL
  [S390] kdump: Replace is_kdump_kernel() with OLDMEM_BASE check

12 years agor8169: fix Rx index race between FIFO overflow recovery and NAPI handler.
françois romieu [Sun, 4 Dec 2011 20:30:52 +0000 (20:30 +0000)]
r8169: fix Rx index race between FIFO overflow recovery and NAPI handler.

Since 92fc43b4159b518f5baae57301f26d770b0834c9, rtl8169_tx_timeout ends up
resetting Rx and Tx indexes and thus racing with the NAPI handler via
-> rtl8169_hw_reset
   -> rtl_hw_reset
      -> rtl8169_init_ring_indexes

What about returning to the original state ?

rtl_hw_reset is only used by rtl8169_hw_reset and rtl8169_init_one.

The latter does not need rtl8169_init_ring_indexes because the indexes
still contain their original values from the newly allocated network
device private data area (i.e. 0).

rtl8169_hw_reset is used by:
1. rtl8169_down
   Helper for rtl8169_close. rtl8169_open explicitely inits the indexes
   anyway.
2. rtl8169_pcierr_interrupt
   Indexes are set by rtl8169_reinit_task.
3. rtl8169_interrupt
   rtl8169_hw_reset is needed when the device goes down. See 1.
4. rtl_shutdown
   System shutdown handler. Indexes are irrelevant.
5. rtl8169_reset_task
   Indexes must be set before rtl_hw_start is called.
6. rtl8169_tx_timeout
   Indexes should not be set. This is the job of rtl8169_reset_task anyway.

The removal of rtl8169_hw_reset in rtl8169_tx_timeout and its move in
rtl8169_reset_task do not change the analysis.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: hayeswang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agor8169: Rx FIFO overflow fixes.
françois romieu [Sun, 4 Dec 2011 20:30:45 +0000 (20:30 +0000)]
r8169: Rx FIFO overflow fixes.

Realtek has specified that the post 8168c gigabit chips and the post
8105e fast ethernet chips recover automatically from a Rx FIFO overflow.
The driver does not need to clear the RxFIFOOver bit of IntrStatus and
it should rather avoid messing it.

The implementation deserves some explanation:
1. events outside of the intr_event bit mask are now ignored. It enforces
   a no-processing policy for the events that either should not be there
   or should be ignored.

2. RxFIFOOver was already ignored in rtl_cfg_infos[RTL_CFG_1] for the
   whole 8168 line of chips with two exceptions:
   - RTL_GIGA_MAC_VER_22 since b5ba6d12bdac21bc0620a5089e0f24e362645efd
     ("use RxFIFO overflow workaround for 8168c chipset.").
     This one should now be correctly handled.
   - RTL_GIGA_MAC_VER_11 (8168b) which requires a different Rx FIFO
     overflow processing.

   Though it does not conform to Realtek suggestion above, the updated
   driver includes no change for RTL_GIGA_MAC_VER_12 and RTL_GIGA_MAC_VER_17.
   Both are 8168b. RTL_GIGA_MAC_VER_12 is common and a bit old so I'd rather
   wait for experimental evidence that the change suggested by Realtek really
   helps or does not hurt in unexpected ways.

   Removed case statements in rtl8169_interrupt are only 8168 relevant.

3. RxFIFOOver is masked for post 8105e 810x chips, namely the sole 8105e
   (RTL_GIGA_MAC_VER_30) itself.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: hayeswang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agogpio: fix a build failure on KS8695 GPIO
Linus Walleij [Mon, 5 Dec 2011 13:47:48 +0000 (14:47 +0100)]
gpio: fix a build failure on KS8695 GPIO

I screwed up by compiling that driver for the machine rather
than the arch. Correcting this fixes the build error.

Cc: Grant Likely <grant.likely@secretlab.ca>
Reported-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agotcp: remove TCP_OFF and TCP_PAGE macros
Eric Dumazet [Mon, 5 Dec 2011 01:07:15 +0000 (01:07 +0000)]
tcp: remove TCP_OFF and TCP_PAGE macros

As mentioned by Joe Perches, TCP_OFF() and TCP_PAGE() macros are
useless.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agobql: fix CONFIG_XPS=n build
Eric Dumazet [Sun, 4 Dec 2011 12:38:00 +0000 (12:38 +0000)]
bql: fix CONFIG_XPS=n build

netdev_queue_release() should be called even if CONFIG_XPS=n
to properly release device reference.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agotcp: fix tcp_trim_head()
Eric Dumazet [Sun, 4 Dec 2011 08:51:08 +0000 (08:51 +0000)]
tcp: fix tcp_trim_head()

commit f07d960df3 (tcp: avoid frag allocation for small frames)
breaked assumption in tcp stack that skb is either linear (skb->data_len
== 0), or fully fragged (skb->data_len == skb->len)

tcp_trim_head() made this assumption, we must fix it.

Thanks to Vijay for providing a very detailed explanation.

Reported-by: Vijay Subramanian <subramanian.vijay@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agocaif: Stash away hijacked skb destructor and call it later
sjur.brandeland@stericsson.com [Sun, 4 Dec 2011 11:22:55 +0000 (11:22 +0000)]
caif: Stash away hijacked skb destructor and call it later

This patch adds functionality for avoiding orphaning SKB too early.
The original skb is stashed away and the original destructor is called
from the hi-jacked flow-on callback. If CAIF interface goes down and a
hi-jacked SKB exists, the original skb->destructor is restored.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agocaif: Add support for flow-control on device's tx-queue
sjur.brandeland@stericsson.com [Sun, 4 Dec 2011 11:22:54 +0000 (11:22 +0000)]
caif: Add support for flow-control on device's tx-queue

Flow control is implemented by inspecting the qdisc queue length
in order to detect potential overflow on the TX queue. When a threshold
is reached flow-off is sent upwards in the CAIF stack. At the same time
the skb->destructor is hi-jacked by orphaning the SKB and the original
destructor is replaced with a "flow-on" callback. When the "hi-jacked"
SKB is consumed the queue should be empty, and the "flow-on" callback
is called and xon is sent upwards in the CAIF stack.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agocaif: Add support for CAIF over CDC NCM USB interface
sjur.brandeland@stericsson.com [Sun, 4 Dec 2011 11:22:53 +0000 (11:22 +0000)]
caif: Add support for CAIF over CDC NCM USB interface

NCM 1.0 does not support anything but Ethernet framing, hence
CAIF payload will be put into Ethernet frames.

Discovery is based on fixed USB vendor 0x04cc (ST-Ericsson),
product-id 0x230f (NCM). In this variant only CAIF payload is sent over
the NCM interface.

The CAIF stack (cfusbl.c) will when USB interface register first check if
we got a CDC NCM USB interface with the right VID, PID.
It will then read the device's Ethernet address and create a 'template'
Ethernet TX header, using a broadcast address as the destination address,
and EthType 0x88b5 (802.1 Local Experimental - vendor specific).

A protocol handler for 0x88b5 is setup for reception of CAIF frames from
the CDC NCM USB interface.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoif_ether.h: Add IEEE 802.1 Local Experimental Ethertype 1.
sjur.brandeland@stericsson.com [Sun, 4 Dec 2011 11:22:52 +0000 (11:22 +0000)]
if_ether.h: Add IEEE 802.1 Local Experimental Ethertype 1.

Add EthType 0x88b5.
This Ethertype value is available for public use for prototype and
vendor-specific protocol development,as defined in Amendment 802a
to IEEE Std 802.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net...
David S. Miller [Mon, 5 Dec 2011 23:27:28 +0000 (18:27 -0500)]
Merge branch 'master' of git://git./linux/kernel/git/jkirsher/net-next

12 years agoinfiniband: ipoib: Sanitize neighbour handling in ipoib_main.c
David Miller [Fri, 2 Dec 2011 16:52:44 +0000 (16:52 +0000)]
infiniband: ipoib: Sanitize neighbour handling in ipoib_main.c

Reduce the number of dst_get_neighbour_noref() calls within a single
call chain.  Primarily by passing the neighbour pointer down to the
helper functions.

Handle dst_get_neighbour_noref() returning NULL in ipoib_start_xmit()
by incrementing the dropped counter and freeing the packet.  We don't
want it to fall through into the ARP/RARP/multicast handling, since
that should only happen when skb_dst() is NULL.

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Roland Dreier <roland@purestorage.com>
12 years agocxgb4i: Handle dst_get_neighbour_noref() returning NULL.
David Miller [Fri, 2 Dec 2011 16:52:39 +0000 (16:52 +0000)]
cxgb4i: Handle dst_get_neighbour_noref() returning NULL.

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Roland Dreier <roland@purestorage.com>
12 years agolibcxgbi: Handle dst_get_neighbour_noref() returning NULL.
David Miller [Fri, 2 Dec 2011 16:52:35 +0000 (16:52 +0000)]
libcxgbi: Handle dst_get_neighbour_noref() returning NULL.

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Roland Dreier <roland@purestorage.com>
12 years agoinfiniband: cxgb4: Consolidate 3 copies of the same operation into 1 helper function.
David Miller [Fri, 2 Dec 2011 16:52:31 +0000 (16:52 +0000)]
infiniband: cxgb4: Consolidate 3 copies of the same operation into 1 helper function.

Three pieces of code do the same thing, create a l2t entry and then
import this information into the c4iw_ep object.

Create a helper function and call it from these 3 locations instead.

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Roland Dreier <roland@purestorage.com>
12 years agoinfiniband: nes: Use dst's neighbour entry.
David Miller [Fri, 2 Dec 2011 16:52:27 +0000 (16:52 +0000)]
infiniband: nes: Use dst's neighbour entry.

Do this instead of performing a by-hand lookup.

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Roland Dreier <roland@purestorage.com>
12 years agocxgb3: Handle NULL dst neighbour in cxgb3_offload.c
David Miller [Fri, 2 Dec 2011 16:52:22 +0000 (16:52 +0000)]
cxgb3: Handle NULL dst neighbour in cxgb3_offload.c

Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agocxgb3: Rework t3_l2t_get to take a dst_entry instead of a neighbour.
David Miller [Fri, 2 Dec 2011 16:52:18 +0000 (16:52 +0000)]
cxgb3: Rework t3_l2t_get to take a dst_entry instead of a neighbour.

This way we consolidate the RCU locking down into the place where it
actually matters, and also we can make the code handle
dst_get_neighbour_noref() returning NULL properly.

Signed-off-by: David S. Miller <davem@davemloft.net>