]> git.ipfire.org Git - thirdparty/kernel/stable.git/log
thirdparty/kernel/stable.git
9 years agonet: phy: micrel: add device-type abstraction
Johan Hovold [Wed, 19 Nov 2014 11:59:15 +0000 (12:59 +0100)] 
net: phy: micrel: add device-type abstraction

Add structured device-type information and support for generic led-mode
setup to the generic config_init callback.

This is a first step in ultimately getting rid of device-type specific
callbacks.

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: phy: add static data field to struct phy_driver
Johan Hovold [Wed, 19 Nov 2014 11:59:14 +0000 (12:59 +0100)] 
net: phy: add static data field to struct phy_driver

Add static driver-data field to struct phy_driver, which can be used to
store structured device-type information.

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agosky2: use new netdev_rss_key_fill() helper
Ian Morris [Wed, 19 Nov 2014 09:06:51 +0000 (09:06 +0000)] 
sky2: use new netdev_rss_key_fill() helper

Switch to a random RSS key rather than a fixed one.
Using netdev_rss_key_fill helper also ensures that all ports share
a common key.

See also commit 960fb622f85180f36d3aff82af53e2be3db2f888.

Signed-off-by: Ian Morris <ipm@chirality.org.uk>
Cc: Mirko Lindner <mlindner@marvell.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: Eric Dumazet <edumazet@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoenic: support skb->xmit_more
Govindarajulu Varadarajan [Wed, 19 Nov 2014 07:29:32 +0000 (12:59 +0530)] 
enic: support skb->xmit_more

Check and update posted_index only when skb->xmit_more is 0 or tx queue is full.

v2:
use txq_map instead of skb_get_queue_mapping(skb)

Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agomISDN: Deletion of unnecessary checks before the function call "vfree"
Markus Elfring [Wed, 19 Nov 2014 19:48:26 +0000 (20:48 +0100)] 
mISDN: Deletion of unnecessary checks before the function call "vfree"

The vfree() function performs also input parameter validation. Thus the test
around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
David S. Miller [Fri, 21 Nov 2014 17:17:35 +0000 (12:17 -0500)] 
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

9 years agovirtio-net: validate features during probe
Jason Wang [Thu, 20 Nov 2014 09:03:05 +0000 (17:03 +0800)] 
virtio-net: validate features during probe

We currently trigger BUG when VIRTIO_NET_F_CTRL_VQ
is not set but one of features depending on it is.
That's not a friendly way to report errors to
hypervisors.
Let's check, and fail probe instead.

Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf
David S. Miller [Fri, 21 Nov 2014 05:12:39 +0000 (00:12 -0500)] 
Merge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf

Pablo Neira Ayuso says:

====================
Netfilter fixes for net

The following patchset contains two bugfixes for your net tree, they are:

1) Validate netlink group from nfnetlink to avoid an out of bound array
   access. This should only happen with superuser priviledges though.
   Discovered by Andrey Ryabinin using trinity.

2) Don't push ethernet header before calling the netfilter output hook
   for multicast traffic, this breaks ebtables since it expects to see
   skb->data pointing to the network header, patch from Linus Luessing.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge tag 'master-2014-11-20' of git://git.kernel.org/pub/scm/linux/kernel/git/linvil...
David S. Miller [Fri, 21 Nov 2014 05:07:51 +0000 (00:07 -0500)] 
Merge tag 'master-2014-11-20' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless

John W. Linville says:

====================
pull request: wireless 2014-11-20

Please full this little batch of fixes intended for the 3.18 stream!

For the mac80211 patch, Johannes says:

"Here's another last minute fix, for minstrel HT crashing
depending on the value of some uninitialised stack."

On top of that...

Ben Greear fixes an ath9k regression in which a BSSID mask is
miscalculated.

Dmitry Torokhov corrects an error handling routing in brcmfmac which
was checking an unsigned variable for a negative value.

Johannes Berg avoids a build problem in brcmfmac for arches where
linux/unaligned/access_ok.h and asm/unaligned.h conflict.

Mathy Vanhoef addresses another brcmfmac issue so as to eliminate a
use-after-free of the URB transfer buffer if a timeout occurs.

Please let me know if there are problems!
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agocxgb4 : Fix DCB priority groups being returned in wrong order
Anish Bhatt [Fri, 21 Nov 2014 01:11:46 +0000 (17:11 -0800)] 
cxgb4 : Fix DCB priority groups being returned in wrong order

Peer priority groups were being reversed, but this was missed in the previous
fix sent out for this issue.

v2 : Previous patch was doing extra unnecessary work, result is the same.
Please ignore previous patch

Fixes : ee7bc3cdc270 ('cxgb4 : dcb open-lldp interop fixes')

Signed-off-by: Anish Bhatt <anish@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoipx: fix locking regression in ipx_sendmsg and ipx_recvmsg
Jiri Bohac [Wed, 19 Nov 2014 22:05:49 +0000 (23:05 +0100)] 
ipx: fix locking regression in ipx_sendmsg and ipx_recvmsg

This fixes an old regression introduced by commit
b0d0d915 (ipx: remove the BKL).

When a recvmsg syscall blocks waiting for new data, no data can be sent on the
same socket with sendmsg because ipx_recvmsg() sleeps with the socket locked.

This breaks mars-nwe (NetWare emulator):
- the ncpserv process reads the request using recvmsg
- ncpserv forks and spawns nwconn
- ncpserv calls a (blocking) recvmsg and waits for new requests
- nwconn deadlocks in sendmsg on the same socket

Commit b0d0d915 has simply replaced BKL locking with
lock_sock/release_sock. Unlike now, BKL got unlocked while
sleeping, so a blocking recvmsg did not block a concurrent
sendmsg.

Only keep the socket locked while actually working with the socket data and
release it prior to calling skb_recv_datagram().

Signed-off-by: Jiri Bohac <jbohac@suse.cz>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoopenvswitch: Don't validate IPv6 label masks.
Joe Stringer [Wed, 19 Nov 2014 21:54:49 +0000 (13:54 -0800)] 
openvswitch: Don't validate IPv6 label masks.

When userspace doesn't provide a mask, OVS datapath generates a fully
unwildcarded mask for the flow by copying the flow and setting all bits
in all fields. For IPv6 label, this creates a mask that matches on the
upper 12 bits, causing the following error:

openvswitch: netlink: Invalid IPv6 flow label value (value=ffffffff, max=fffff)

This patch ignores the label validation check for masks, avoiding this
error.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agopptp: fix stack info leak in pptp_getname()
Mathias Krause [Wed, 19 Nov 2014 17:05:26 +0000 (18:05 +0100)] 
pptp: fix stack info leak in pptp_getname()

pptp_getname() only partially initializes the stack variable sa,
particularly only fills the pptp part of the sa_addr union. The code
thereby discloses 16 bytes of kernel stack memory via getsockname().

Fix this by memset(0)'ing the union before.

Cc: Dmitry Kozlov <xeb@mail.ru>
Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'drm-fixes-3.18' of git://people.freedesktop.org/~agd5f/linux into drm...
Dave Airlie [Fri, 21 Nov 2014 02:19:19 +0000 (12:19 +1000)] 
Merge branch 'drm-fixes-3.18' of git://people.freedesktop.org/~agd5f/linux into drm-fixes

fix one regression and one endian issue.

* 'drm-fixes-3.18' of git://people.freedesktop.org/~agd5f/linux:
  drm/radeon: fix endian swapping in vbios fetch for tdp table
  drm/radeon: disable native backlight control on pre-r6xx asics (v2)

9 years agoi40e: trigger SW INT with no ITR wait
Shannon Nelson [Tue, 11 Nov 2014 20:04:35 +0000 (20:04 +0000)] 
i40e: trigger SW INT with no ITR wait

Since we want the SW INT to go off as soon as possible, write the
extra bits that will turn off the ITR wait for the interrupt.

Change-ID: I6d5382ba60840fa32abb7dea17c839eb4b5f68f7
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40evf: remove unnecessary else
Mitch Williams [Tue, 11 Nov 2014 20:03:13 +0000 (20:03 +0000)] 
i40evf: remove unnecessary else

Since the if part of this statement contains a break, there's no reason
for the else. Clean up the code and make it more obvious that the delay
happens each time through the loop.

Change-ID: I9292eaf7dd687688bdc401b8bd8d1d14f6944460
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40evf: make comparisons consistent
Mitch Williams [Tue, 11 Nov 2014 20:02:52 +0000 (20:02 +0000)] 
i40evf: make comparisons consistent

Most of the null-checking in this driver is of the style if (!foo),
except these few. Make these checks consistent with the rest of the
code.

Change-ID: I991924f34072fa607a1b626a8b3f1fa5195d43e9
Reported-by: Joe Perches <joe@perches.com>
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40evf: make checkpatch happy
Mitch Williams [Tue, 11 Nov 2014 20:02:42 +0000 (20:02 +0000)] 
i40evf: make checkpatch happy

This patch is the result of running checkpatch on the i40evf driver with
the --strict option. The vast majority of changes are adding/removing
blank lines, aligning function parameters, and correcting over-long
lines.

The only possible functional change is changing the flags member of the
adapter structure to be non-volatile. However, according to the kernel
documentation, this is not necessary and the volatile should be removed.

Change-ID: Ie8c6414800924f529bef831e8845292b970fe2ed
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40evf: update header comments
Mitch Williams [Tue, 11 Nov 2014 20:02:31 +0000 (20:02 +0000)] 
i40evf: update header comments

No code changes. Update comments to match actual function declarations.

Change-ID: Ib830d2f154ee917a104955c0914267fc98f3d2c8
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: don't overload fields
Mitch Williams [Tue, 11 Nov 2014 20:02:19 +0000 (20:02 +0000)] 
i40e: don't overload fields

Overloading the msg_size field in the arq_event_info struct is just a
bad idea. It leads to repeated bugs when the structure is used in a
loop, since the input value (buffer size) is overwritten by the output
value (actual message length).

Fix this by splitting the field into two and renaming to indicate the
actual function of each field.

Since the arq_event struct has now changed, we need to change the drivers
to support this. Note that we no longer need to initialize the buffer size
each time we go through a loop as this value is no longer destroyed by
arq processing.

In the process, we also fix a bug in i40evf_verify_api_ver where the
buffer size was not correctly reinitialized each time through the loop.

Change-ID: Ic7f9633cdd6f871f93e698dfb095e29c696f5581
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-by: Ashish Shah <ashish.n.shah@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoixgbevf: add netpoll support
Emil Tantilov [Sat, 8 Nov 2014 01:39:56 +0000 (01:39 +0000)] 
ixgbevf: add netpoll support

This patch adds ixgbevf_netpoll() a callback for .ndo_poll_controller to
allow for the VF interface to be used with netconsole.

CC: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoixgbevf: compare total_rx_packets and budget in ixgbevf_clean_rx_irq
Emil Tantilov [Sat, 8 Nov 2014 01:39:51 +0000 (01:39 +0000)] 
ixgbevf: compare total_rx_packets and budget in ixgbevf_clean_rx_irq

total_rx_packets is the number of packets we had cleaned, and budget is
the total number of packets that we could clean per poll. Instead of
altering both of these values we can save ourselves one write to memory by
just comparing total_rx_packets to the budget and as long as we are less
than budget we continue cleaning.

Also change the do{}while logic to while{} in order to avoid processing
packets when budget is 0.

CC: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoixgbevf: Change receive model to use double buffered page based receives
Emil Tantilov [Fri, 21 Nov 2014 02:57:15 +0000 (02:57 +0000)] 
ixgbevf: Change receive model to use double buffered page based receives

This patch changes the basic receive path for ixgbevf so that instead of
receiving the data into an skb it is received into a double buffered page.
The main change is that the receives will be done in pages only and then
pull the header out of the page and copy it into the sk_buff data.

This has the advantages of reduced cache misses and improved performance on
IOMMU enabled systems.

v2:
- added pfmemalloc check to a new function for reusable page
- moved atomic_inc outside of #if/else in ixgbevf_add_rx_frag()
- reverted the removal of the api check in ixgbevf_change_mtu()

CC: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoixgbevf: Update Rx next to clean in real time
Emil Tantilov [Sat, 8 Nov 2014 01:39:41 +0000 (01:39 +0000)] 
ixgbevf: Update Rx next to clean in real time

Since the next_to_clean value is only accessed by the Rx interrupt handler
we can save on stack space by just storing our updated values back in
next_to_clean instead of using the stack variable i.  This should help to
reduce stack space and we can further collapse the size of the function.

Also removed  non_eop_descs counter as it was never shown in the stats.

CC: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoixgbevf: reorder main loop in ixgbe_clean_rx_irq to allow for do/while/continue
Emil Tantilov [Sat, 8 Nov 2014 01:39:35 +0000 (01:39 +0000)] 
ixgbevf: reorder main loop in ixgbe_clean_rx_irq to allow for do/while/continue

This change allows us to go from a loop based on the descriptor to one
primarily based on the budget. The advantage to this is that we can avoid
carrying too many values from one iteration to the next.

CC: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoixgbevf: Cleanup variable usage, improve stack performance
Emil Tantilov [Sat, 8 Nov 2014 01:39:30 +0000 (01:39 +0000)] 
ixgbevf: Cleanup variable usage, improve stack performance

This change is meant to help cleanup the usage of temporary variables
within the Rx hot-path by removing unnecessary variables and reducing
the scope of variables that do not need to exist outside the main loop.

CC: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoixgbevf: Combine the logic for post Rx processing into single function
Emil Tantilov [Sat, 8 Nov 2014 01:39:25 +0000 (01:39 +0000)] 
ixgbevf: Combine the logic for post Rx processing into single function

This patch cleans up ixgbevf_clean_rx_irq() by merging several similar
operations into a new function - ixgbevf_process_skb_fields().

CC: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoixgbevf: Test Rx status bits directly out of the descriptor
Emil Tantilov [Sat, 8 Nov 2014 01:39:20 +0000 (01:39 +0000)] 
ixgbevf: Test Rx status bits directly out of the descriptor

Instead of keeping a local copy of the status bits from the descriptor
we can just read them directly - this is accomplished with the addition
of ixgbevf_test_staterr().

In addition instead of doing a byteswap on the status bits value, we
can byteswap the constant values we are testing since that can be done
at compile time which should help to improve performance on big-endian
systems.

CC: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoixgbevf: Update ixgbevf_alloc_rx_buffers to handle clearing of status bits
Emil Tantilov [Sat, 8 Nov 2014 01:39:15 +0000 (01:39 +0000)] 
ixgbevf: Update ixgbevf_alloc_rx_buffers to handle clearing of status bits

Instead of clearing the status bits in the cleanup it makes more sense to
just clear the status bits on allocation.  This way we can leave the Rx
descriptor rings as a read only memory block until we actually have buffers
to give back to the hardware.

CC: Alexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agox86, syscall: Fix _TIF_NOHZ handling in syscall_trace_enter_phase1
Andy Lutomirski [Wed, 19 Nov 2014 21:56:19 +0000 (13:56 -0800)] 
x86, syscall: Fix _TIF_NOHZ handling in syscall_trace_enter_phase1

TIF_NOHZ is 19 (i.e. _TIF_SYSCALL_TRACE | _TIF_NOTIFY_RESUME |
_TIF_SINGLESTEP), not (1<<19).

This code is involved in Dave's trinity lockup, but I don't see why
it would cause any of the problems he's seeing, except inadvertently
by causing a different path through entry_64.S's syscall handling.

Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Dave Jones <davej@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/a6cd3b60a3f53afb6e1c8081b0ec30ff19003dd7.1416434075.git.luto@amacapital.net
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
9 years agomwifiex: Add USB8766 support
Kristian Evensen [Thu, 20 Nov 2014 15:52:58 +0000 (16:52 +0100)] 
mwifiex: Add USB8766 support

Adds new VID/PID for the Marvell 88W8766. The kernel currently only supports
the device as PCI, but it is also available using USB. An example of a device
delivered with the 88W8766 as USB is the Globalscale Mirabox.

TX buffer size is set to driver default (2K), as we do not know the firmware
requirement.

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agonet: brcm80211: Deletion of unnecessary checks before two function calls
Markus Elfring [Thu, 20 Nov 2014 15:42:51 +0000 (16:42 +0100)] 
net: brcm80211: Deletion of unnecessary checks before two function calls

The functions brcmu_pkt_buf_free_skb() and release_firmware() test whether
their argument is NULL and then return immediately. Thus the test around
the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agoMerge tag 'mac80211-next-for-john-2014-11-20' of git://git.kernel.org/pub/scm/linux...
John W. Linville [Thu, 20 Nov 2014 21:09:30 +0000 (16:09 -0500)] 
Merge tag 'mac80211-next-for-john-2014-11-20' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next

Johannes Berg <johannes@sipsolutions.net> says:

"It has been a while since my last pull request, so we accumulated
another relatively large set of changes:
 * TDLS off-channel support set from Arik/Liad, with some support
   patches I did
 * custom regulatory fixes from Arik
 * minstrel VHT fix (and a small optimisation) from Felix
 * add back radiotap vendor namespace support (myself)
 * random MAC address scanning for cfg80211/mac80211/hwsim (myself)
 * CSA improvements (Luca)
 * WoWLAN Net Detect (wake on network found) support (Luca)
 * and lots of other smaller changes from many people"

Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agobrcmfmac: don't include linux/unaligned/access_ok.h
Johannes Berg [Wed, 19 Nov 2014 21:13:10 +0000 (22:13 +0100)] 
brcmfmac: don't include linux/unaligned/access_ok.h

This is a specific implementation, <asm/unaligned.h> is the
multiplexer that has the arch-specific knowledge of which
of the implementations needs to be used, so include that.

This issue was revealed by kbuild testing
when <asm/unaligned.h> was added in <linux/ieee80211.h>
resulting in redefinition of get_unaligned_be16 (and
probably others).

Cc: stable@vger.kernel.org # v3.17
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agodrm/radeon: fix endian swapping in vbios fetch for tdp table
Alex Deucher [Thu, 13 Nov 2014 00:17:02 +0000 (19:17 -0500)] 
drm/radeon: fix endian swapping in vbios fetch for tdp table

Value needs to be swapped on BE.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
9 years agodrm/radeon: disable native backlight control on pre-r6xx asics (v2)
Alex Deucher [Wed, 19 Nov 2014 18:12:54 +0000 (13:12 -0500)] 
drm/radeon: disable native backlight control on pre-r6xx asics (v2)

Just use the acpi interface.  That's what windows uses on this
generation and it's the only thing that seems to work reliably
on these generation parts.

You can still force the native backlight interface by setting
radeon.backlight=1

Bug:
https://bugzilla.kernel.org/show_bug.cgi?id=88501

v2: merge into above if/else block

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
9 years agoof/selftest: Fix testing when /aliases is missing
Grant Likely [Wed, 19 Nov 2014 17:13:44 +0000 (17:13 +0000)] 
of/selftest: Fix testing when /aliases is missing

The /aliases node isn't always present in the device tree, but the
unittest code assumes that /aliases is there. Add a check when inserting
the testcase data to see if of_aliases needs to be updated, and undo the
settings when the nodes are removed.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Gaurav Minocha <gaurav.minocha.os@gmail.com>
Cc: <stable@vger.kernel.org>
9 years agonetfilter: nfnetlink_log: Make use of pr_fmt where applicable
Marcelo Leitner [Thu, 6 Nov 2014 11:32:30 +0000 (12:32 +0100)] 
netfilter: nfnetlink_log: Make use of pr_fmt where applicable

Signed-off-by: Marcelo Ricardo Leitner <mleitner@redhat.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
9 years agonetfilter: Deletion of unnecessary checks before two function calls
Markus Elfring [Tue, 18 Nov 2014 19:37:05 +0000 (20:37 +0100)] 
netfilter: Deletion of unnecessary checks before two function calls

The functions free_percpu() and module_put() test whether their argument
is NULL and then return immediately. Thus the test around the call is
not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Julian Anastasov <ja@ssi.bg>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
9 years agoIB/isert: Adjust CQ size to HW limits
Chris Moore [Tue, 4 Nov 2014 16:28:29 +0000 (16:28 +0000)] 
IB/isert: Adjust CQ size to HW limits

isert has an issue of trying to create a CQ with more CQEs than are
supported by the hardware, that currently results in failures during
isert_device creation during first session login.

This is the isert version of the patch that Minh Tran submitted for
iser, and is simple a workaround required to function with existing
ocrdma hardware.

Signed-off-by: Chris Moore <chris.moore@emulex.com>
Reviewied-by: Sagi Grimberg <sagig@mellanox.com>
Cc: <stable@vger.kernel.org> # 3.10+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
9 years agoMerge tag 'drm-intel-fixes-2014-11-19' of git://anongit.freedesktop.org/drm-intel...
Dave Airlie [Thu, 20 Nov 2014 02:58:11 +0000 (12:58 +1000)] 
Merge tag 'drm-intel-fixes-2014-11-19' of git://anongit.freedesktop.org/drm-intel into drm-fixes

two regression fixes.

* tag 'drm-intel-fixes-2014-11-19' of git://anongit.freedesktop.org/drm-intel:
  drm/i915: Kick fbdev before vgacon
  drm/i915: drop WaSetupGtModeTdRowDispatch:snb

9 years agoACPI / PM: Ignore wakeup setting if the ACPI companion can't wake up
Rafael J. Wysocki [Wed, 19 Nov 2014 00:44:11 +0000 (01:44 +0100)] 
ACPI / PM: Ignore wakeup setting if the ACPI companion can't wake up

As reported by Dmitry, on some Chromebooks there are devices with
corresponding ACPI objects and with unusual system wakeup
configuration.  Namely, they technically are wakeup-capable, but the
wakeup is handled via a platform-specific out-of-band mechanism and
the ACPI PM layer has no information on the wakeup capability.  As
a result, device_may_wakeup(dev) called from acpi_dev_suspend_late()
returns 'true' for those devices, but the wakeup.flags.valid flag is
unset for the corresponding ACPI device objects, so acpi_device_wakeup()
reproducibly fails for them causing acpi_dev_suspend_late() to return
an error code.  The entire system suspend is then aborted and the
machines in question cannot suspend at all.

Address the problem by ignoring the device_may_wakeup(dev) return
value in acpi_dev_suspend_late() if the ACPI companion of the device
being handled has wakeup.flags.valid unset (in which case it is clear
that the wakeup is supposed to be handled by other means).

This fixes a regression introduced by commit a76e9bd89ae7 (i2c:
attach/detach I2C client device to the ACPI power domain) as the
affected systems could suspend and resume successfully before that
commit.

Fixes: a76e9bd89ae7 (i2c: attach/detach I2C client device to the ACPI power domain)
Reported-by: Dmitry Torokhov <dtor@chromium.org>
Reviewed-by: Dmitry Torokhov <dtor@chromium.org>
Cc: 3.13+ <stable@vger.kernel.org> # 3.13+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
9 years agoMerge branch 'bonding_4ad'
David S. Miller [Thu, 20 Nov 2014 00:10:17 +0000 (19:10 -0500)] 
Merge branch 'bonding_4ad'

Xie Jianhua says:

====================
bonding: Introduce 4 AD link speed

The speed field of AD Port Key was based on bitmask, it supported 5
kinds of link speed at most, as there were only 5 bits in the speed
field of the AD Port Key.  This patches series change the speed type
(AD_LINK_SPEED_BITMASK) from bitmask to enum type in order to enhance
speed type from 5 to 32, and then introduce 4 AD link speed to fix
agg_bandwidth.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobonding: Introduce 4 AD link speed to fix agg_bandwidth
Jianhua Xie [Wed, 19 Nov 2014 08:48:59 +0000 (16:48 +0800)] 
bonding: Introduce 4 AD link speed to fix agg_bandwidth

This patch adds [2.5|20|40|56] Gbps enum definition, and fixes
aggregated bandwidth calculation based on above slave links.

CC: Jay Vosburgh <j.vosburgh@gmail.com>
CC: Veaceslav Falico <vfalico@gmail.com>
CC: Andy Gospodarek <andy@greyhouse.net>
CC: David S. Miller <davem@davemloft.net>
Signed-off-by: Jianhua Xie <jianhua.xie@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobonding: change AD_LINK_SPEED_BITMASK to enum to suport more speed
Jianhua Xie [Wed, 19 Nov 2014 08:48:58 +0000 (16:48 +0800)] 
bonding: change AD_LINK_SPEED_BITMASK to enum to suport more speed

Port Key was determined as 16 bits according to the link speed,
duplex and user key (which is yet not supported).  In the old
speed field, 5 bits are for speed [1|10|100|1000|10000]Mbps as
below:
--------------------------------------------------------------
Port key :| User key        | Speed         |       Duplex|
--------------------------------------------------------------
    16                  6               1               0
This patch keeps the old layout, but changes AD_LINK_SPEED_BITMASK
from bit type to an enum type.  In this way, the speed field can
expand speed type from 5 to 32.

CC: Jay Vosburgh <j.vosburgh@gmail.com>
CC: Veaceslav Falico <vfalico@gmail.com>
CC: Andy Gospodarek <andy@greyhouse.net>
CC: David S. Miller <davem@davemloft.net>
Signed-off-by: Jianhua Xie <jianhua.xie@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agocxgb4i : Don't block unload/cxgb4 unload when remote closes TCP connection
Anish Bhatt [Wed, 19 Nov 2014 03:09:51 +0000 (19:09 -0800)] 
cxgb4i : Don't block unload/cxgb4 unload when remote closes TCP connection

cxgb4i was returning wrong error and not releasing module reference if remote
end abruptly closed TCP connection. This prevents the cxgb4 network module from
being unloaded, further affecting other network drivers dependent on cxgb4

Sending to net as this affects all cxgb4 based network drivers.

Signed-off-by: Anish Bhatt <anish@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoipv6: delete protocol and unregister rtnetlink when cleanup
Duan Jiong [Wed, 19 Nov 2014 01:35:39 +0000 (09:35 +0800)] 
ipv6: delete protocol and unregister rtnetlink when cleanup

pim6_protocol was added when initiation, but it not deleted.
Similarly, unregister RTNL_FAMILY_IP6MR rtnetlink.

Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Reviewed-by: Cong Wang <cwang@twopensource.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoPCI: Support 64-bit bridge windows if we have 64-bit dma_addr_t
Yinghai Lu [Wed, 19 Nov 2014 21:30:32 +0000 (14:30 -0700)] 
PCI: Support 64-bit bridge windows if we have 64-bit dma_addr_t

Aaron reported that a 32-bit x86 kernel with Physical Address Extension
(PAE) support complains about bridge prefetchable memory windows above 4GB:

  pci_bus 0000:00: root bus resource [mem 0x380000000000-0x383fffffffff]
  ...
  pci 0000:03:00.0: reg 0x10: [mem 0x383fffc00000-0x383fffdfffff 64bit pref]
  pci 0000:03:00.0: reg 0x20: [mem 0x383fffe04000-0x383fffe07fff 64bit pref]
  pci 0000:03:00.1: reg 0x10: [mem 0x383fffa00000-0x383fffbfffff 64bit pref]
  pci 0000:03:00.1: reg 0x20: [mem 0x383fffe00000-0x383fffe03fff 64bit pref]
  pci 0000:00:02.2: PCI bridge to [bus 03-04]
  pci 0000:00:02.2:   bridge window [io  0x1000-0x1fff]
  pci 0000:00:02.2:   bridge window [mem 0x91900000-0x91cfffff]
  pci 0000:00:02.2: can't handle 64-bit address space for bridge

In this kernel, unsigned long is 32 bits and dma_addr_t is 64 bits.
Previously we used "unsigned long" to hold the bridge window address.  But
this is a bus address, so we should use dma_addr_t instead.

Use dma_addr_t to hold the bridge window base and limit.

The question of whether the CPU can actually *address* the window is
separate and depends on what the physical address space of the CPU is and
whether the host bridge does any address translation.

[bhelgaas: fix "shift count > width of type", changelog, stable tag]
Fixes: d56dbf5bab8c ("PCI: Allocate 64-bit BARs above 4G when possible")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=88131
Reported-by: Aaron Ma <mapengyu@gmail.com>
Tested-by: Aaron Ma <mapengyu@gmail.com>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
CC: stable@vger.kernel.org # v3.14+
9 years agobury skb_copy_to_page()
Al Viro [Mon, 10 Nov 2014 22:30:00 +0000 (17:30 -0500)] 
bury skb_copy_to_page()

no callers since 3.0

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
9 years agofold verify_iovec() into copy_msghdr_from_user()
Al Viro [Tue, 11 Nov 2014 01:23:13 +0000 (20:23 -0500)] 
fold verify_iovec() into copy_msghdr_from_user()

... and do the same on the compat side of things.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
9 years ago{compat_,}verify_iovec(): switch to generic copying of iovecs
Al Viro [Mon, 10 Nov 2014 03:33:45 +0000 (22:33 -0500)] 
{compat_,}verify_iovec(): switch to generic copying of iovecs

use {compat_,}rw_copy_check_uvector().  As the result, we are
guaranteed that all iovecs seen in ->msg_iov by ->sendmsg()
and ->recvmsg() will pass access_ok().

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
9 years agoseparate kernel- and userland-side msghdr
Al Viro [Sun, 6 Apr 2014 18:03:05 +0000 (14:03 -0400)] 
separate kernel- and userland-side msghdr

Kernel-side struct msghdr is (currently) using the same layout as
userland one, but it's not a one-to-one copy - even without considering
32bit compat issues, we have msg_iov, msg_name and msg_control copied
to kernel[1].  It's fairly localized, so we get away with a few functions
where that knowledge is needed (and we could shrink that set even
more).  Pretty much everything deals with the kernel-side variant and
the few places that want userland one just use a bunch of force-casts
to paper over the differences.

The thing is, kernel-side definition of struct msghdr is *not* exposed
in include/uapi - libc doesn't see it, etc.  So we can add struct user_msghdr,
with proper annotations and let the few places that ever deal with those
beasts use it for userland pointers.  Saner typechecking aside, that will
allow to change the layout of kernel-side msghdr - e.g. replace
msg_iov/msg_iovlen there with struct iov_iter, getting rid of the need
to modify the iovec as we copy data to/from it, etc.

We could introduce kernel_msghdr instead, but that would create much more
noise - the absolute majority of the instances would need to have the
type switched to kernel_msghdr and definition of struct msghdr in
include/linux/socket.h is not going to be seen by userland anyway.

This commit just introduces user_msghdr and switches the few places that
are dealing with userland-side msghdr to it.

[1] actually, it's even trickier than that - we copy msg_control for
sendmsg, but keep the userland address on recvmsg.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
9 years agoath9k_common: make sure DEBUG_FS and RELAY enabled
Oleksij Rempel [Wed, 19 Nov 2014 11:30:28 +0000 (12:30 +0100)] 
ath9k_common: make sure DEBUG_FS and RELAY enabled

currently ath9k_common depends on this components.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agoMerge tag 'mac80211-for-john-2014-11-18' of git://git.kernel.org/pub/scm/linux/kernel...
John W. Linville [Wed, 19 Nov 2014 20:44:40 +0000 (15:44 -0500)] 
Merge tag 'mac80211-for-john-2014-11-18' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211

Johannes Berg <johannes@sipsolutions.net> says:

"Here's another last minute fix, for minstrel HT crashing
depending on the value of some uninitialised stack."

Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agobpf: fix arraymap NULL deref and missing overflow and zero size checks
Alexei Starovoitov [Wed, 19 Nov 2014 01:32:16 +0000 (17:32 -0800)] 
bpf: fix arraymap NULL deref and missing overflow and zero size checks

- fix NULL pointer dereference:
kernel/bpf/arraymap.c:41 array_map_alloc() error: potential null dereference 'array'.  (kzalloc returns null)
kernel/bpf/arraymap.c:41 array_map_alloc() error: we previously assumed 'array' could be null (see line 40)

- integer overflow check was missing in arraymap
(hashmap checks for overflow via kmalloc_array())

- arraymap can round_up(value_size, 8) to zero. check was missing.

- hashmap was missing zero size check as well, since roundup_pow_of_two() can
truncate into zero

- found a typo in the arraymap comment and unnecessary empty line

Fix all of these issues and make both overflow checks explicit U32 in size.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge commit '4e6ce4dc7ce71d0886908d55129d5d6482a27ff9' of git://git.kernel.org/pub...
John W. Linville [Wed, 19 Nov 2014 20:38:48 +0000 (15:38 -0500)] 
Merge commit '4e6ce4dc7ce71d0886908d55129d5d6482a27ff9' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless

9 years agoMerge tag 'linux-can-fixes-for-3.18-20141118' of git://gitorious.org/linux-can/linux-can
David S. Miller [Wed, 19 Nov 2014 20:28:58 +0000 (15:28 -0500)] 
Merge tag 'linux-can-fixes-for-3.18-20141118' of git://gitorious.org/linux-can/linux-can

Marc Kleine-Budde says:

====================
pull-request: can 2014-11-18

this is a pull request of 17 patches for net/master for the v3.18 release
cycle.

The last patch of this pull request ("can: m_can: update to support CAN FD
features") adds, as the description says, a new feature to the m_can driver. As
the m_can driver has been added in v3.18 there is no risk of causing a
regression. Give me a note if this is not okay and I'll create a new pull
request without it.

There is a patch for the CAN infrastructure by Thomas Körper which fixes
calling kfree_skb() from interrupt context. Roman Fietze fixes a typo also in
the infrastructure. A patch by Dong Aisheng adds a generic helper function to
tell if a skb is normal CAN or CAN-FD frame. Alexey Khoroshilov of the Linux
Driver Verification project fixes a memory leak in the esd_usb2 driver. Two
patches by Sudip Mukherjee remove unused variables and fixe the signess of a
variable. Three patches by me add the missing .ndo_change_mtu callback to the
xilinx_can, rcar_can and gs_usb driver.

The remaining patches improve the m_can driver: David Cohen adds the missing
CONFIG_HAS_IOMEM dependency. Dong Aisheng provides 6 bugfix patches (most
important: missing RAM init, sleep in NAPI poll, dlc in RTR). While the last of
his patches adds CAN FD support to the driver.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonetlink: Deletion of an unnecessary check before the function call "__module_get"
Markus Elfring [Tue, 18 Nov 2014 20:03:13 +0000 (21:03 +0100)] 
netlink: Deletion of an unnecessary check before the function call "__module_get"

The __module_get() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: pktgen: Deletion of an unnecessary check before the function call "proc_remove"
Markus Elfring [Tue, 18 Nov 2014 19:10:34 +0000 (20:10 +0100)] 
net: pktgen: Deletion of an unnecessary check before the function call "proc_remove"

The proc_remove() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agousbnet: rtl8150: remove unused variable
Sudip Mukherjee [Tue, 18 Nov 2014 16:25:21 +0000 (21:55 +0530)] 
usbnet: rtl8150: remove unused variable

remove unused variable

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet/mlx4_en: Add VXLAN ndo calls to the PF net device ops too
Or Gerlitz [Tue, 18 Nov 2014 15:51:27 +0000 (17:51 +0200)] 
net/mlx4_en: Add VXLAN ndo calls to the PF net device ops too

This is currently missing, which results in a crash when one attempts
to set VXLAN tunnel over the mlx4_en when acting as PF.

[ 2408.785472] BUG: unable to handle kernel NULL pointer dereference at (null)
[...]
[ 2408.994104] Call Trace:
[ 2408.996584]  [<ffffffffa021f7f5>] ? vxlan_get_rx_port+0xd6/0x103 [vxlan]
[ 2409.003316]  [<ffffffffa021f71f>] ? vxlan_lowerdev_event+0xf2/0xf2 [vxlan]
[ 2409.010225]  [<ffffffffa0630358>] mlx4_en_start_port+0x862/0x96a [mlx4_en]
[ 2409.017132]  [<ffffffffa063070f>] mlx4_en_open+0x17f/0x1b8 [mlx4_en]

While here, make sure to invoke vxlan_get_rx_port() only when VXLAN
offloads are actually enabled and not when they are only supported.

Reported-by: Ido Shamay <idos@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobonding: fix curr_active_slave/carrier with loadbalance arp monitoring
Nikolay Aleksandrov [Tue, 18 Nov 2014 14:14:44 +0000 (15:14 +0100)] 
bonding: fix curr_active_slave/carrier with loadbalance arp monitoring

Since commit 6fde8f037e60 ("bonding: fix locking in
bond_loadbalance_arp_mon()") we can have a stale bond carrier state and
stale curr_active_slave when using arp monitoring in loadbalance modes. The
reason is that in bond_loadbalance_arp_mon() we can't have
do_failover == true but slave_state_changed == false, whenever do_failover
is true then slave_state_changed is also true. Then the following piece
from bond_loadbalance_arp_mon():
                if (slave_state_changed) {
                        bond_slave_state_change(bond);
                        if (BOND_MODE(bond) == BOND_MODE_XOR)
                                bond_update_slave_arr(bond, NULL);
                } else if (do_failover) {
                        block_netpoll_tx();
                        bond_select_active_slave(bond);
                        unblock_netpoll_tx();
                }

will execute only the first branch, always and regardless of do_failover.
Since these two events aren't related in such way, we need to decouple and
consider them separately.

For example this issue could lead to the following result:
Bonding Mode: load balancing (round-robin)
*MII Status: down*
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
ARP Polling Interval (ms): 100
ARP IP target/s (n.n.n.n form): 192.168.9.2

Slave Interface: ens12
*MII Status: up*
Speed: 10000 Mbps
Duplex: full
Link Failure Count: 2
Permanent HW addr: 00:0f:53:01:42:2c
Slave queue ID: 0

Slave Interface: eth1
*MII Status: up*
Speed: Unknown
Duplex: Unknown
Link Failure Count: 70
Permanent HW addr: 52:54:00:2f:0f:8e
Slave queue ID: 0

Since some interfaces are up, then the status of the bond should also be
up, but it will never change unless something invokes bond_set_carrier()
(i.e. enslave, bond_select_active_slave etc). Now, if I force the
calling of bond_select_active_slave via for example changing
primary_reselect (it can change in any mode), then the MII status goes to
"up" because it calls bond_select_active_slave() which should've been done
from bond_loadbalance_arp_mon() itself.

CC: Veaceslav Falico <vfalico@gmail.com>
CC: Jay Vosburgh <j.vosburgh@gmail.com>
CC: Andy Gospodarek <andy@greyhouse.net>
CC: Ding Tianhong <dingtianhong@huawei.com>
Fixes: 6fde8f037e60 ("bonding: fix locking in bond_loadbalance_arp_mon()")
Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com>
Acked-by: Veaceslav Falico <vfalico@gmail.com>
Acked-by: Andy Gospodarek <gospo@cumulusnetworks.com>
Acked-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'stmmac-next'
David S. Miller [Wed, 19 Nov 2014 20:04:58 +0000 (15:04 -0500)] 
Merge branch 'stmmac-next'

Giuseppe Cavallaro says:

====================
stmmac: update driver documentation

Recently many changes have been done inside the driver
so this patch updates the driver's doc for example reviewing
information for the rx and tx processes that are managed
by napi method, adding new information for missing glue-logic files
etc.
Also this reviews and fixes what is reported when run kernel-doc script.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agostmmac: review driver when run kernel-doc
Giuseppe CAVALLARO [Tue, 18 Nov 2014 08:47:01 +0000 (09:47 +0100)] 
stmmac: review driver when run kernel-doc

When run ./scripts/kernel-doc several warnings are reported
so this patch fix them.
Also it reviews many comments and adds new ones.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agostmmac: document common header file
Giuseppe CAVALLARO [Tue, 18 Nov 2014 08:47:00 +0000 (09:47 +0100)] 
stmmac: document common header file

This patch adds some useful comments inside the common header
file to provide information about the APIs exposed by the driver.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agostmmac: update driver documentation
Giuseppe CAVALLARO [Tue, 18 Nov 2014 08:46:59 +0000 (09:46 +0100)] 
stmmac: update driver documentation

Recently many changes have been done inside the driver
so this patch updates the driver's doc for example reviewing
information for the rx and tx processes that are managed
by napi method, adding new information for missing glue-logic files
etc.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotcp: make connect() mem charging friendly
Eric Dumazet [Tue, 18 Nov 2014 07:06:20 +0000 (23:06 -0800)] 
tcp: make connect() mem charging friendly

While working on sk_forward_alloc problems reported by Denys
Fedoryshchenko, we found that tcp connect() (and fastopen) do not call
sk_wmem_schedule() for SYN packet (and/or SYN/DATA packet), so
sk_forward_alloc is negative while connect is in progress.

We can fix this by calling regular sk_stream_alloc_skb() both for the
SYN packet (in tcp_connect()) and the syn_data packet in
tcp_send_syn_data()

Then, tcp_send_syn_data() can avoid copying syn_data as we simply
can manipulate syn_data->cb[] to remove SYN flag (and increment seq)

Instead of open coding memcpy_fromiovecend(), simply use this helper.

This leaves in socket write queue clean fast clone skbs.

This was tested against our fastopen packetdrill tests.

Reported-by: Denys Fedoryshchenko <nuclearcat@nuclearcat.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotun: return NET_XMIT_DROP for dropped packets
Jason Wang [Tue, 18 Nov 2014 05:20:41 +0000 (13:20 +0800)] 
tun: return NET_XMIT_DROP for dropped packets

After commit 5d097109257c03a71845729f8db6b5770c4bbedc
("tun: only queue packets on device"), NETDEV_TX_OK was returned for
dropped packets. This will confuse pktgen since dropped packets were
counted as sent ones.

Fixing this by returning NET_XMIT_DROP to let pktgen count it as error
packet.

Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agomac80211: minstrel_ht: add a small optimization to minstrel_aggr_check
Felix Fietkau [Sat, 15 Nov 2014 23:27:55 +0000 (00:27 +0100)] 
mac80211: minstrel_ht: add a small optimization to minstrel_aggr_check

Check the queue mapping earlier, skb->queue_mapping is more likely than
skb->data to still be in d-cache.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: notify drivers on sta rate table changes
Johannes Berg [Tue, 18 Nov 2014 23:10:42 +0000 (00:10 +0100)] 
mac80211: notify drivers on sta rate table changes

This allows drivers with a firmware or chip-based rate lookup table to
use the most recent default rate selection without having to get it from
per-packet data or explicit ieee80211_get_tx_rate calls

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agonl80211: Broadcast CMD_NEW_INTERFACE and CMD_DEL_INTERFACE
Tomasz Bursztyka [Wed, 12 Nov 2014 14:26:45 +0000 (16:26 +0200)] 
nl80211: Broadcast CMD_NEW_INTERFACE and CMD_DEL_INTERFACE

Let the other listeners being notified when a new or del interface
command has been issued, thus reducing later necessary request to be in
sync with current context.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211-hwsim: Add HWSIM_CMD_GET_RADIO command
Patrik Flykt [Wed, 12 Nov 2014 14:42:40 +0000 (16:42 +0200)] 
mac80211-hwsim: Add HWSIM_CMD_GET_RADIO command

HWSIM_CMD_GET_RADIO returns information about a specific radio id or
all of them in response to a dump. Create the netlink skb or use the
one provided by the dump functionality. Use the existing attribute
appending function to fill in the same attributes when creating a
new hwsim radio.

Save alpha2 and struct ieee80211_regdomain in the hwsim data or else
they will be lost in the depths of regulatory infrastructure.

Signed-off-by: Patrik Flykt <patrik.flykt@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211-hwsim: Factor out netlink attribute appending
Patrik Flykt [Wed, 12 Nov 2014 14:42:39 +0000 (16:42 +0200)] 
mac80211-hwsim: Factor out netlink attribute appending

Factor out netlink message attribute appending in order to reuse it
with later code. As a result move netlink skb allocation to the
calling function.

Signed-off-by: Patrik Flykt <patrik.flykt@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agonl80211: Replace interface socket owner attribute with more generic one
Jukka Rissanen [Thu, 13 Nov 2014 15:25:14 +0000 (17:25 +0200)] 
nl80211: Replace interface socket owner attribute with more generic one

Replace NL80211_ATTR_IFACE_SOCKET_OWNER attribute with more generic
NL80211_ATTR_SOCKET_OWNER that can be used with other commands
that interface creation.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211-hwsim: remove unnecessary hwname check
Johannes Berg [Wed, 19 Nov 2014 17:51:55 +0000 (18:51 +0100)] 
mac80211-hwsim: remove unnecessary hwname check

The hwname will always be set if idx is negative (as it's
a u32 read into an s64 it can't overflow either) so we can
remove the unnecessary check for hwname being non-NULL.

This was reported by smatch.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211-hwsim: hwname is always known so use the value from wiphy
Jukka Rissanen [Fri, 14 Nov 2014 11:16:34 +0000 (13:16 +0200)] 
mac80211-hwsim: hwname is always known so use the value from wiphy

We can always know the hwname of the radio so use the value
from wiphy.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: protect fools returning NULL in add_virtual_intf
Rafał Miłecki [Fri, 14 Nov 2014 17:43:28 +0000 (18:43 +0100)] 
cfg80211: protect fools returning NULL in add_virtual_intf

Callback add_virtual_intf is supposed to return ERR_PTR and trying to
return NULL results in some "Unable to handle kernel paging request",
etc. As it may be complicated to debug & trace, let's catch it (WARN).

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: explicitly initialize some fields in custom reg path
Arik Nemtsov [Sun, 16 Nov 2014 14:37:47 +0000 (16:37 +0200)] 
cfg80211: explicitly initialize some fields in custom reg path

Explicitly initialize the DFS state and beacon found state when handling
channels in the custom regulatory path.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Acked-by: Luis R. Rodriguez <mcgrof@suse.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: update missing fields in custom regulatory path
Arik Nemtsov [Sun, 16 Nov 2014 14:37:46 +0000 (16:37 +0200)] 
cfg80211: update missing fields in custom regulatory path

Some channels fields were not being updated in the custom regulatory
path. Update them according to the code in handle_channel().

Signed-off-by: Jonathan Doron <jonathanx.doron@intel.com>
Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Acked-by: Luis R. Rodriguez <mcgrof@suse.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: skip legacy rate mask handling for VHT rates
Felix Fietkau [Sat, 15 Nov 2014 02:48:54 +0000 (03:48 +0100)] 
mac80211: skip legacy rate mask handling for VHT rates

The rate mask code currently assumes that a rate is legacy if
IEEE80211_TX_RC_MCS is not set. This might be the cause of bogus VHT
rates being reported with minstrel_ht.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: don't allow 40MHz tx rates in case of 20MHz chandef
Eliad Peller [Tue, 11 Nov 2014 16:11:22 +0000 (18:11 +0200)] 
mac80211: don't allow 40MHz tx rates in case of 20MHz chandef

When 20MHz chandef is used, 40MHz rates shouldn't be
used (by the rate-control algorithm), even if the sta
ht capabilities indicate support for it.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Singed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211_hwsim: support scanning with random MAC address
Johannes Berg [Thu, 12 Jun 2014 20:41:00 +0000 (22:41 +0200)] 
mac80211_hwsim: support scanning with random MAC address

This adds support for scanning with random MAC address for
both software and hardware scan.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: allow drivers to support NL80211_SCAN_FLAG_RANDOM_ADDR
Johannes Berg [Thu, 12 Jun 2014 20:24:31 +0000 (22:24 +0200)] 
mac80211: allow drivers to support NL80211_SCAN_FLAG_RANDOM_ADDR

Allow drivers to support NL80211_SCAN_FLAG_RANDOM_ADDR with software
based scanning and generate a random MAC address for them for every
scan request with the flag.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: rcu-ify scan and scheduled scan request pointers
Johannes Berg [Wed, 19 Nov 2014 10:55:49 +0000 (11:55 +0100)] 
mac80211: rcu-ify scan and scheduled scan request pointers

In order to use the scan and scheduled scan request pointers during
RX to check for randomisation, make them accessible using RCU.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: allow drivers to support random MAC addresses for scan
Johannes Berg [Thu, 12 Jun 2014 19:39:05 +0000 (21:39 +0200)] 
cfg80211: allow drivers to support random MAC addresses for scan

Add the necessary feature flags and a scan flag to support using
random MAC addresses for scan while unassociated.

The configuration for this supports an arbitrary MAC address
value and mask, so that any kind of configuration (e.g. fixed
OUI or full 46-bit random) can be requested. Full 46-bit random
is the default when no other configuration is passed.

Also add a small helper function to use the addr/mask correctly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: remove redundant check
Eliad Peller [Wed, 12 Nov 2014 08:08:29 +0000 (10:08 +0200)] 
mac80211: remove redundant check

local->scan_req was tested in the previous line, so it
can't be NULL.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: add wowlan net-detect support
Luciano Coelho [Wed, 17 Sep 2014 08:55:28 +0000 (11:55 +0300)] 
cfg80211: add wowlan net-detect support

Add a new WoWLAN API to enable net-detect as a wake up trigger.
Net-detect allows the device to scan in the background while the
host is asleep to wake up the host system when a matching network
is found.

Reuse the scheduled scan attributes to specify how the scan is
performed while suspended and the matches that will trigger a
wake event.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: refactor nl80211_start_sched_scan so it can be reused
Luciano Coelho [Mon, 10 Nov 2014 14:13:46 +0000 (16:13 +0200)] 
cfg80211: refactor nl80211_start_sched_scan so it can be reused

For net detect, we will need to reuse most of the scheduled scan
parsing function, but not all, so split out the attributes parsing
part out of the main start sched_scan function.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: synchronously reserve TID per station
Liad Kaufman [Wed, 19 Nov 2014 11:47:38 +0000 (13:47 +0200)] 
mac80211: synchronously reserve TID per station

In TDLS (e.g., TDLS off-channel) there is a requirement for
some drivers to supply an unused TID between the AP and the
device to the FW, to allow sending PTI requests and to allow
the FW to aggregate on a specific TID for better throughput.

To ensure that the allocated TID is indeed unused, this patch
introduces an API for blocking the driver from TXing on that
TID.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: add specific-queue flushing support
Liad Kaufman [Sun, 9 Nov 2014 16:50:21 +0000 (18:50 +0200)] 
mac80211: add specific-queue flushing support

If the HW supports IEEE80211_HW_QUEUE_CONTROL, allow
flushing only specific queues rather than all of them.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: add TDLS channel-switch Rx flow
Arik Nemtsov [Sun, 9 Nov 2014 16:50:20 +0000 (18:50 +0200)] 
mac80211: add TDLS channel-switch Rx flow

When receiving a TDLS channel switch request or response, parse the frame
and call a new tdls_recv_channel_switch op in the low level driver with
the parsed data.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: introduce TDLS channel switch ops
Arik Nemtsov [Sun, 9 Nov 2014 16:50:19 +0000 (18:50 +0200)] 
mac80211: introduce TDLS channel switch ops

Implement the cfg80211 TDLS channel switch ops and introduce new mac80211
ones for low-level drivers.
Verify low-level driver support for the new ops when using the relevant
wiphy feature bit. Also verify the peer supports channel switching before
passing the command down.

Add a new STA flag to track the off-channel state with the TDLS peer and
make sure to cancel the channel-switch if the peer STA is unexpectedly
removed.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: add parsing of TDLS specific IEs
Arik Nemtsov [Sun, 9 Nov 2014 16:50:18 +0000 (18:50 +0200)] 
mac80211: add parsing of TDLS specific IEs

These are used in TDLS channel switching code.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: introduce TDLS channel switch commands
Arik Nemtsov [Wed, 19 Nov 2014 10:54:26 +0000 (12:54 +0200)] 
cfg80211: introduce TDLS channel switch commands

Introduce commands to initiate and cancel TDLS channel-switching. Once
TDLS channel-switching is started, the lower level driver is responsible
for continually initiating channel-switch operations and returning to
the base (AP) channel to listen for beacons from time to time.

Upon cancellation of the channel-switch all communication between the
relevant TDLS peers will continue on the base channel.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: prepare TDLS mgmt code for channel-switch templates
Arik Nemtsov [Sun, 9 Nov 2014 16:50:16 +0000 (18:50 +0200)] 
mac80211: prepare TDLS mgmt code for channel-switch templates

Split the data-generating from the Tx-sending functionality, as we do
not want to send templates to the lower driver. Also add an optional
chandef argument to the data-generating portion. It will be used for
channel-switch templates.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: track AP and peer STA TDLS chan-switch support
Arik Nemtsov [Sun, 9 Nov 2014 16:50:15 +0000 (18:50 +0200)] 
mac80211: track AP and peer STA TDLS chan-switch support

The AP or peer can prohibit TDLS channel switch via a bit in the
extended capabilities IE. Parse the IE and track this bit. Set an
appropriate STA flag if both the AP and peer STA support TDLS
channel-switching.

Add the new STA flag and the missing TDLS_INITIATOR to debugfs.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg/mac80211: define TDLS channel switch feature bit
Arik Nemtsov [Sun, 9 Nov 2014 16:50:14 +0000 (18:50 +0200)] 
cfg/mac80211: define TDLS channel switch feature bit

Define some related TDLS protocol constants and advertise channel switch
support in the extended-capabilities IE when the feature bit is defined.

Actually supporting TDLS channel-switching also requires support for
some new nl80211 commands, to be introduced by future patches.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: add BSS coex IE to TDLS setup frames
Arik Nemtsov [Sun, 9 Nov 2014 16:50:13 +0000 (18:50 +0200)] 
mac80211: add BSS coex IE to TDLS setup frames

Add the BSS coex IE in case we support HT40 channels, as mandated by
section 8.5.13 in IEEE802.11 2012.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: add supported channels IE during TDLS setup
Arik Nemtsov [Sun, 9 Nov 2014 16:50:12 +0000 (18:50 +0200)] 
mac80211: add supported channels IE during TDLS setup

This information element is mandatory in case TDLS channel-switching is to
be supported. The channels given are ones supported and allowed to be
active in the current regulatory setting.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: add function to create data frame template including key
Johannes Berg [Sun, 9 Nov 2014 16:50:11 +0000 (18:50 +0200)] 
mac80211: add function to create data frame template including key

For some TDLS channel switch implementations data frames need to be
sent by the firmware based on a template. This template should be
created by mac80211, and thus needs to properly be built from an
802.3 frame into an 802.11 frame. In addition, the device will need
the key information so the select_key handler needs to be run.
However, the driver/device will be responsible for all of the crypto
encapsulation, as the sequence numbers etc. cannot be built by the
host anyway in this case since it's a template to be used multiple
times.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>