deliverable/linux.git
8 years agoixgbe: Correct length check for round up
Mark Rustad [Mon, 14 Mar 2016 18:05:51 +0000 (11:05 -0700)] 
ixgbe: Correct length check for round up

The function ixgbe_host_interface_command actually uses a multiple
of word sized buffer to do its business, but only checks against
the actual length passed in. This means that on read operations it
could be possible to modify locations beyond the length passed in.
Change the check to round up in the same way, just to avoid any
possible hazard.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoixgbe: Change the lan_id and func fields to a u8 to avoid casts
Mark Rustad [Mon, 14 Mar 2016 18:05:46 +0000 (11:05 -0700)] 
ixgbe: Change the lan_id and func fields to a u8 to avoid casts

Since the lan_id and func fields only ever hold small values, make
them u8 to avoid casts used to silence warnings.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoixgbe: Delete some unused register definitions
Mark Rustad [Mon, 14 Mar 2016 18:05:40 +0000 (11:05 -0700)] 
ixgbe: Delete some unused register definitions

I noticed the SRAMREL registers are not referenced for any device,
so delete the definitions.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agosock: make lockdep_sock_is_held static inline
Hannes Frederic Sowa [Thu, 7 Apr 2016 21:53:35 +0000 (23:53 +0200)] 
sock: make lockdep_sock_is_held static inline

I forgot to add inline to lockdep_sock_is_held, so it generated all
kinds of build warnings if not build with lockdep support.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch 'tipc-next'
David S. Miller [Thu, 7 Apr 2016 21:00:14 +0000 (17:00 -0400)] 
Merge branch 'tipc-next'

Jon Maloy says:

====================
tipc: some small fixes

When fix a minor buffer leak, and ensure that bearers filter packets
correctly while they are being shut down.

v2: Corrected typos in commit #3, as per feedback from S. Shtylyov
v3: Removed commit #3 from the series. Improved version will be
    re-submitted later.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agotipc: stricter filtering of packets in bearer layer
Jon Paul Maloy [Thu, 7 Apr 2016 14:09:14 +0000 (10:09 -0400)] 
tipc: stricter filtering of packets in bearer layer

Resetting a bearer/interface, with the consequence of resetting all its
pertaining links, is not an atomic action. This becomes particularly
evident in very large clusters, where a lot of traffic may happen on the
remaining links while we are busy shutting them down. In extreme cases,
we may even see links being re-created and re-established before we are
finished with the job.

To solve this, we now introduce a solution where we temporarily detach
the bearer from the interface when the bearer is reset. This inhibits
all packet reception, while sending still is possible. For the latter,
we use the fact that the device's user pointer now is zero to filter out
which packets can be sent during this situation; i.e., outgoing RESET
messages only.  This filtering serves to speed up the neighbors'
detection of the loss event, and saves us from unnecessary probing.

Acked-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agotipc: eliminate buffer leak in bearer layer
Jon Paul Maloy [Thu, 7 Apr 2016 14:09:13 +0000 (10:09 -0400)] 
tipc: eliminate buffer leak in bearer layer

When enabling a bearer we create a 'neigbor discoverer' instance by
calling the function tipc_disc_create() before the bearer is actually
registered in the list of enabled bearers. Because of this, the very
first discovery broadcast message, created by the mentioned function,
is lost, since it cannot find any valid bearer to use. Furthermore,
the used send function, tipc_bearer_xmit_skb() does not free the given
buffer when it cannot find a  bearer, resulting in the leak of exactly
one send buffer each time a bearer is enabled.

This commit fixes this problem by introducing two changes:

1) Instead of attemting to send the discovery message directly, we let
   tipc_disc_create() return the discovery buffer to the calling
   function, tipc_enable_bearer(), so that the latter can send it
   when the enabling sequence is finished.

2) In tipc_bearer_xmit_skb(), as well as in the two other transmit
   functions at the bearer layer, we now free the indicated buffer or
   buffer chain when a valid bearer cannot be found.

Acked-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoRDS: fix congestion map corruption for PAGE_SIZE > 4k
shamir rabinovitch [Thu, 7 Apr 2016 11:57:36 +0000 (07:57 -0400)] 
RDS: fix congestion map corruption for PAGE_SIZE > 4k

When PAGE_SIZE > 4k single page can contain 2 RDS fragments. If
'rds_ib_cong_recv' ignore the RDS fragment offset in to the page it
then read the data fragment as far congestion map update and lead to
corruption of the RDS connection far congestion map.

Signed-off-by: Shamir Rabinovitch <shamir.rabinovitch@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoRDS: memory allocated must be align to 8
shamir rabinovitch [Thu, 7 Apr 2016 11:57:35 +0000 (07:57 -0400)] 
RDS: memory allocated must be align to 8

Fix issue in 'rds_ib_cong_recv' when accessing unaligned memory
allocated by 'rds_page_remainder_alloc' using uint64_t pointer.

Signed-off-by: Shamir Rabinovitch <shamir.rabinovitch@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoGRE: Disable segmentation offloads w/ CSUM and we are encapsulated via FOU
Alexander Duyck [Tue, 5 Apr 2016 16:13:39 +0000 (09:13 -0700)] 
GRE: Disable segmentation offloads w/ CSUM and we are encapsulated via FOU

This patch fixes an issue I found in which we were dropping frames if we
had enabled checksums on GRE headers that were encapsulated by either FOU
or GUE.  Without this patch I was barely able to get 1 Gb/s of throughput.
With this patch applied I am now at least getting around 6 Gb/s.

The issue is due to the fact that with FOU or GUE applied we do not provide
a transport offset pointing to the GRE header, nor do we offload it in
software as the GRE header is completely skipped by GSO and treated like a
VXLAN or GENEVE type header.  As such we need to prevent the stack from
generating it and also prevent GRE from generating it via any interface we
create.

Fixes: c3483384ee511 ("gro: Allow tunnel stacking in the case of FOU/GUE")
Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch 'gro-in-udp'
David S. Miller [Thu, 7 Apr 2016 20:53:37 +0000 (16:53 -0400)] 
Merge branch 'gro-in-udp'

Tom Herbert says:

====================
udp: GRO in UDP sockets

This patch set adds GRO functions (gro_receive and gro_complete) to UDP
sockets and removes udp_offload infrastructure.

Add GRO functions (gro_receive and gro_complete) to UDP sockets. In
udp_gro_receive and udp_gro_complete a socket lookup is done instead of
looking up the port number in udp_offloads.  If a socket is found and
there are GRO functions for it then those are called. This feature
allows binding GRO functions to more than just a port number.
Eventually, we will be able to use this technique to allow application
defined GRO for an application protocol by attaching BPF porgrams to UDP
sockets for doing GRO.

In order to implement these functions, we added exported
udp6_lib_lookup_skb and udp4_lib_lookup_skb functions in ipv4/udp.c and
ipv6/udp.c. Also, inet_iif and references to skb_dst() were changed to
check that dst is set in skbuf before derefencing. In the GRO path there
is now a UDP socket lookup performed before dst is set, to the get the
device in that case we simply use skb->dev.

Tested:

Ran various combinations of VXLAN and GUE TCP_STREAM and TCP_RR tests.
Did not see any material regression.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoudp: Remove udp_offloads
Tom Herbert [Tue, 5 Apr 2016 15:22:56 +0000 (08:22 -0700)] 
udp: Remove udp_offloads

Now that the UDP encapsulation GRO functions have been moved to the UDP
socket we not longer need the udp_offload insfrastructure so removing it.

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agogeneve: change to use UDP socket GRO
Tom Herbert [Tue, 5 Apr 2016 15:22:55 +0000 (08:22 -0700)] 
geneve: change to use UDP socket GRO

Adapt geneve_gro_receive, geneve_gro_complete to take a socket argument.
Set these functions in tunnel_config.  Don't set udp_offloads any more.

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agofou: change to use UDP socket GRO
Tom Herbert [Tue, 5 Apr 2016 15:22:54 +0000 (08:22 -0700)] 
fou: change to use UDP socket GRO

Adapt gue_gro_receive, gue_gro_complete to take a socket argument.
Don't set udp_offloads any more.

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agovxlan: change vxlan to use UDP socket GRO
Tom Herbert [Tue, 5 Apr 2016 15:22:53 +0000 (08:22 -0700)] 
vxlan: change vxlan to use UDP socket GRO

Adapt vxlan_gro_receive, vxlan_gro_complete to take a socket argument.
Set these functions in tunnel_config.  Don't set udp_offloads any more.

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoudp: Add socket based GRO and config
Tom Herbert [Tue, 5 Apr 2016 15:22:52 +0000 (08:22 -0700)] 
udp: Add socket based GRO and config

Add gro_receive and  gro_complete to struct udp_tunnel_sock_cfg.

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoudp: Add GRO functions to UDP socket
Tom Herbert [Tue, 5 Apr 2016 15:22:51 +0000 (08:22 -0700)] 
udp: Add GRO functions to UDP socket

This patch adds GRO functions (gro_receive and gro_complete) to UDP
sockets. udp_gro_receive is changed to perform socket lookup on a
packet. If a socket is found the related GRO functions are called.

This features obsoletes using UDP offload infrastructure for GRO
(udp_offload). This has the advantage of not being limited to provide
offload on a per port basis, GRO is now applied to whatever individual
UDP sockets are bound to.  This also allows the possbility of
"application defined GRO"-- that is we can attach something like
a BPF program to a UDP socket to perfrom GRO on an application
layer protocol.

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoudp: Add udp6_lib_lookup_skb and udp4_lib_lookup_skb
Tom Herbert [Tue, 5 Apr 2016 15:22:50 +0000 (08:22 -0700)] 
udp: Add udp6_lib_lookup_skb and udp4_lib_lookup_skb

Add externally visible functions to lookup a UDP socket by skb. This
will be used for GRO in UDP sockets. These functions also check
if skb->dst is set, and if it is not skb->dev is used to get dev_net.
This allows calling lookup functions before dst has been set on the
skbuff.

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: Checks skb_dst to be NULL in inet_iif
Tom Herbert [Tue, 5 Apr 2016 15:22:49 +0000 (08:22 -0700)] 
net: Checks skb_dst to be NULL in inet_iif

In inet_iif check if skb_rtable is NULL for the skb and return
skb->skb_iif if it is.

This change allows inet_iif to be called before the dst
information has been set in the skb (e.g. when doing socket based
UDP GRO).

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch 'sock-lockdep-tightening'
David S. Miller [Thu, 7 Apr 2016 20:44:15 +0000 (16:44 -0400)] 
Merge branch 'sock-lockdep-tightening'

Hannes Frederic Sowa says:

====================
sock: lockdep tightening

First patch is from Eric Dumazet and improves lockdep accuracy for
socket locks. After that, second patch introduces lockdep_sock_is_held
and uses it. Final patch reverts and reworks the lockdep fix from Daniel
in the filter code, as we now have tighter lockdep support.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agotun: use socket locks for sk_{attach,detatch}_filter
Hannes Frederic Sowa [Tue, 5 Apr 2016 15:10:16 +0000 (17:10 +0200)] 
tun: use socket locks for sk_{attach,detatch}_filter

This reverts commit 5a5abb1fa3b05dd ("tun, bpf: fix suspicious RCU usage
in tun_{attach, detach}_filter") and replaces it to use lock_sock around
sk_{attach,detach}_filter. The checks inside filter.c are updated with
lockdep_sock_is_held to check for proper socket locks.

It keeps the code cleaner by ensuring that only one lock governs the
socket filter instead of two independent locks.

Cc: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: introduce lockdep_is_held and update various places to use it
Hannes Frederic Sowa [Tue, 5 Apr 2016 15:10:15 +0000 (17:10 +0200)] 
net: introduce lockdep_is_held and update various places to use it

The socket is either locked if we hold the slock spin_lock for
lock_sock_fast and unlock_sock_fast or we own the lock (sk_lock.owned
!= 0). Check for this and at the same time improve that the current
thread/cpu is really holding the lock.

Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agosock: fix lockdep annotation in release_sock
Hannes Frederic Sowa [Tue, 5 Apr 2016 15:10:14 +0000 (17:10 +0200)] 
sock: fix lockdep annotation in release_sock

During release_sock we use callbacks to finish the processing
of outstanding skbs on the socket. We actually are still locked,
sk_locked.owned == 1, but we already told lockdep that the mutex
is released. This could lead to false positives in lockdep for
lockdep_sock_is_held (we don't hold the slock spinlock during processing
the outstanding skbs).

I took over this patch from Eric Dumazet and tested it.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoPM / wakeirq: fix wakeirq setting after wakup re-configuration from sysfs
Strashko, Grygorii [Wed, 6 Apr 2016 11:45:53 +0000 (14:45 +0300)] 
PM / wakeirq: fix wakeirq setting after wakup re-configuration from sysfs

Now wakeirq stops working for device if wakeup option for
this device will be reconfigured through sysfs, like:

echo disabled > /sys/devices/platform/extcon_usb1/power/wakeup
echo enabled > /sys/devices/platform/extcon_usb1/power/wakeup

Once above set of commands is executed the device's wakeup_source
opject will be recreated and dev->power.wakeup->wakeirq field will
contain NULL. As result, device_wakeup_arm_wake_irqs() will not arm
wakeirq for the affected device.

Hece, lets try to fix it in the following way:
  check for dev->wakeirq field when device_wakeup_attach() is called
  and if !NULL re-attach wakeirq to the device

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 years agotools/power turbostat: work around RC6 counter wrap
Len Brown [Wed, 6 Apr 2016 21:16:00 +0000 (17:16 -0400)] 
tools/power turbostat: work around RC6 counter wrap

Sometimes the rc6 sysfs counter spontaneously resets,
causing turbostat prints a very large number
as it tries to calcuate % = 100 * (old - new) / interval

When we see (old > new), print ***.**% instead
of a bogus huge number.

Note that this detection is not fool-proof, as the counter
could reset several times and still result in new > old.

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 years agotools/power turbostat: initial KBL support
Len Brown [Wed, 6 Apr 2016 21:15:59 +0000 (17:15 -0400)] 
tools/power turbostat: initial KBL support

KBL is similar to SKL

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 years agotools/power turbostat: initial SKX support
Len Brown [Wed, 6 Apr 2016 21:15:58 +0000 (17:15 -0400)] 
tools/power turbostat: initial SKX support

SKX has a lot in common with HSX

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 years agotools/power turbostat: decode BXT TSC frequency via CPUID
Len Brown [Wed, 6 Apr 2016 21:15:57 +0000 (17:15 -0400)] 
tools/power turbostat: decode BXT TSC frequency via CPUID

Hard-code BXT ART to 19200MHz, so turbostat --debug
can fully enumerate TSC:

CPUID(0x15): eax_crystal: 3 ebx_tsc: 186 ecx_crystal_hz: 0
TSC: 1190 MHz (19200000 Hz * 186 / 3 / 1000000)

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 years agotools/power turbostat: initial BXT support
Len Brown [Wed, 6 Apr 2016 21:15:56 +0000 (17:15 -0400)] 
tools/power turbostat: initial BXT support

Broxton has a lot in common with SKL

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 years agotools/power turbostat: print IRTL MSRs
Len Brown [Wed, 6 Apr 2016 21:15:55 +0000 (17:15 -0400)] 
tools/power turbostat: print IRTL MSRs

Some processors use the Interrupt Response Time Limit (IRTL) MSR value
to describe the maximum IRQ response time latency for deep
package C-states.  (Though others have the register, but do not use it)
Lets print it out to give insight into the cases where it is used.

IRTL begain in SNB, with PC3/PC6/PC7, and HSW added PC8/PC9/PC10.

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 years agotools/power turbostat: SGX state should print only if --debug
Len Brown [Wed, 6 Apr 2016 21:15:54 +0000 (17:15 -0400)] 
tools/power turbostat: SGX state should print only if --debug

The CPUID.SGX bit was printed, even if --debug was used

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 years agointel_idle: Add KBL support
Len Brown [Wed, 6 Apr 2016 21:00:59 +0000 (17:00 -0400)] 
intel_idle: Add KBL support

KBL is similar to SKL

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 years agointel_idle: Add SKX support
Len Brown [Wed, 6 Apr 2016 21:00:58 +0000 (17:00 -0400)] 
intel_idle: Add SKX support

SKX is similar to BDX

Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 years agointel_idle: Clean up all registered devices on exit.
Richard Cochran [Wed, 6 Apr 2016 21:00:57 +0000 (17:00 -0400)] 
intel_idle: Clean up all registered devices on exit.

This driver registers cpuidle devices when a CPU comes online, but it
leaves the registrations in place when a CPU goes offline.  The module
exit code only unregisters the currently online CPUs, leaving the
devices for offline CPUs dangling.

This patch changes the driver to clean up all registrations on exit,
even those from CPUs that are offline.

Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 years agointel_idle: Propagate hot plug errors.
Richard Cochran [Wed, 6 Apr 2016 21:00:56 +0000 (17:00 -0400)] 
intel_idle: Propagate hot plug errors.

If a cpuidle registration error occurs during the hot plug notifier
callback, we should really inform the hot plug machinery instead of
just ignoring the error.  This patch changes the callback to properly
return on error.

Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 years agointel_idle: Don't overreact to a cpuidle registration failure.
Richard Cochran [Wed, 6 Apr 2016 21:00:55 +0000 (17:00 -0400)] 
intel_idle: Don't overreact to a cpuidle registration failure.

The helper function, intel_idle_cpu_init, registers one new device
with the cpuidle layer.  If the registration should fail, that
function immediately calls intel_idle_cpuidle_devices_uninit() to
unregister every last CPU's device.  However, it makes no sense to do
so, when called from the hot plug notifier callback.

This patch moves the call to intel_idle_cpuidle_devices_uninit()
outside of the helper function to the one call site that actually
needs to perform the de-registrations.

Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 years agointel_idle: Setup the timer broadcast only on successful driver load.
Richard Cochran [Wed, 6 Apr 2016 21:00:54 +0000 (17:00 -0400)] 
intel_idle: Setup the timer broadcast only on successful driver load.

This driver sets the broadcast tick quite early on during probe and does
not clean up again in cast of failure.  This patch moves the setup call
after the registration, placing the on_each_cpu() calls within the global
CPU lock region.

Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 years agointel_idle: Avoid a double free of the per-CPU data.
Richard Cochran [Wed, 6 Apr 2016 21:00:53 +0000 (17:00 -0400)] 
intel_idle: Avoid a double free of the per-CPU data.

The helper function, intel_idle_cpuidle_devices_uninit, frees the
globally allocated per-CPU data.  However, this function is invoked
from the hot plug notifier callback at a time when freeing that data
is not safe.

If the call to cpuidle_register_driver() should fail (say, due to lack
of memory), then the driver will free its per-CPU region.  On the
*next* CPU_ONLINE event, the driver will happily use the region again
and even free it again if the failure repeats.

This patch fixes the issue by moving the call to free_percpu() outside
of the helper function at the two call sites that actually need to
free the per-CPU data.

Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 years agointel_idle: Fix dangling registration on error path.
Richard Cochran [Wed, 6 Apr 2016 21:00:52 +0000 (17:00 -0400)] 
intel_idle: Fix dangling registration on error path.

In the module_init() method, if the per-CPU allocation fails, then the
active cpuidle registration is not cleaned up.  This patch fixes the
issue by attempting the allocation before registration, and then
cleaning it up again on registration failure.

Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 years agointel_idle: Fix deallocation order on the driver exit path.
Richard Cochran [Wed, 6 Apr 2016 21:00:51 +0000 (17:00 -0400)] 
intel_idle: Fix deallocation order on the driver exit path.

In the module_exit() method, this driver first frees its per-CPU
pointer, then unregisters a callback making use of the pointer.
Furthermore, the function, intel_idle_cpuidle_devices_uninit, is racy
against CPU hot plugging as it calls for_each_online_cpu().

This patch corrects the issues by unregistering first on the exit path
while holding the hot plug lock.

Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 years agointel_idle: Remove redundant initialization calls.
Richard Cochran [Wed, 6 Apr 2016 21:00:50 +0000 (17:00 -0400)] 
intel_idle: Remove redundant initialization calls.

The function, intel_idle_cpuidle_driver_init, makes calls on each CPU
to auto_demotion_disable() and c1e_promotion_disable().  These calls
are redundant, as intel_idle_cpu_init() does the same calls just a bit
later on.  They are also premature, as the driver registration may yet
fail.

This patch removes the redundant code.

Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 years agointel_idle: Fix a helper function's return value.
Richard Cochran [Wed, 6 Apr 2016 21:00:49 +0000 (17:00 -0400)] 
intel_idle: Fix a helper function's return value.

The function, intel_idle_cpuidle_driver_init, delivers no error codes
at all.  This patch changes the function to return 'void' instead of
returning zero.

Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 years agointel_idle: remove useless return from void function.
Richard Cochran [Wed, 6 Apr 2016 21:00:48 +0000 (17:00 -0400)] 
intel_idle: remove useless return from void function.

Signed-off-by: Richard Cochran <rcochran@linutronix.de>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
8 years agoMerge ath-next from ath.git
Kalle Valo [Thu, 7 Apr 2016 18:44:37 +0000 (21:44 +0300)] 
Merge ath-next from ath.git

ath.git patches for 4.7. Major changes:

ath10k

* implement push-pull tx model using mac80211 software queuing support
* enable scan in AP mode (NL80211_FEATURE_AP_SCAN)

wil6210

* add basic PBSS (Personal Basic Service Set) support
* add initial P2P support
* add oob_mode module parameter

8 years agomwifiex: dump pcie scratch registers
Xinming Hu [Tue, 5 Apr 2016 08:04:40 +0000 (01:04 -0700)] 
mwifiex: dump pcie scratch registers

This patch prints pcie scratch registers during firmware dump. They
will be useful for analysing firmware status.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: AMSDU Rx frame handling in AP mode
Xinming Hu [Tue, 5 Apr 2016 08:04:39 +0000 (01:04 -0700)] 
mwifiex: AMSDU Rx frame handling in AP mode

This patch processes sub AMSDU frame received in AP mode.

If a packet is multicast/broadcast, it is sent to kernel/upper
layer as well as queued back to AP TX queue so that it can be
sent to other associated stations.

If a packet is unicast and RA is present in associated station list,
it is again requeued into AP TX queue.

If a packet is unicast and RA is not in associated station list,
packet is forwarded to kernel to handle routing logic.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: schedule main workqueue for transmitting bridge packets
Xinming Hu [Tue, 5 Apr 2016 08:04:38 +0000 (01:04 -0700)] 
mwifiex: schedule main workqueue for transmitting bridge packets

Bridge packets are enqueued to wmm tx queue, but will not be sent
until main workqeue is scheduled for new interrupt or other
reason. This adds unnecessary delay during traffic.

We will schedule main workqueue when bridge packet is queued.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: remove redundant GFP_DMA flag
Xinming Hu [Tue, 5 Apr 2016 08:04:37 +0000 (01:04 -0700)] 
mwifiex: remove redundant GFP_DMA flag

skb forwarded to TCP/IP stack doesn't need to allocate in DMA ZONE.
This patch removes GFP_DMA flag in this case to save precious DMA
memory.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: check revision id while choosing PCIe firmware
Shengzhen Li [Tue, 5 Apr 2016 08:04:36 +0000 (01:04 -0700)] 
mwifiex: check revision id while choosing PCIe firmware

Some of the chipsets have two revisions. This patch
selects appropriate firmware by checking revision id.

Signed-off-by: Shengzhen Li <szli@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: add support for wakeup on GTK rekey failure
Ganapathi Bhat [Tue, 5 Apr 2016 08:04:35 +0000 (01:04 -0700)] 
mwifiex: add support for wakeup on GTK rekey failure

User can configure wakeup on GTK rekey fail with wowlan.
Added corresponding wakeup reason.

Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: add support for GTK rekey offload
Ganapathi Bhat [Tue, 5 Apr 2016 08:04:34 +0000 (01:04 -0700)] 
mwifiex: add support for GTK rekey offload

Added driver functionality to offload GTK rekey to firmware. When
AP sends new GTK, firmware will update it.

Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Do not set LDOA15 / LDOV12 on 8192eu
Jes Sorensen [Thu, 31 Mar 2016 21:08:42 +0000 (17:08 -0400)] 
rtl8xxxu: Do not set LDOA15 / LDOV12 on 8192eu

Per the vendor driver, it looks like the 8192eu doesn't have LDOA15 /
LDOV12 registers.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Use correct H2C calls for 8192eu
Jes Sorensen [Thu, 31 Mar 2016 21:08:41 +0000 (17:08 -0400)] 
rtl8xxxu: Use correct H2C calls for 8192eu

The 8192eu uses the same H2C API as the 8723bu. Call the correct
functions for update_rate_mask() and report_connect().

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Identify 8192eu rev A/B parts correctly
Jes Sorensen [Thu, 31 Mar 2016 21:08:40 +0000 (17:08 -0400)] 
rtl8xxxu: Identify 8192eu rev A/B parts correctly

8192eu A/B cut parts were incorrectly identified as 8192cu devices.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Use enums for chip version numbers
Jes Sorensen [Thu, 31 Mar 2016 21:08:39 +0000 (17:08 -0400)] 
rtl8xxxu: Use enums for chip version numbers

With support for more chips being added, use an enum to specify the
chip version.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Update some register definitions
Jes Sorensen [Thu, 31 Mar 2016 21:08:38 +0000 (17:08 -0400)] 
rtl8xxxu: Update some register definitions

Improve descriptive names of some registers and add some additional
registers only found on nextgen chips.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: 8192eu uses txdesc40
Jes Sorensen [Thu, 31 Mar 2016 21:08:37 +0000 (17:08 -0400)] 
rtl8xxxu: 8192eu uses txdesc40

8192eu uses the new TX descriptor format

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: TXDESC_SHORT_GI is txdesc32 only
Jes Sorensen [Thu, 31 Mar 2016 21:08:36 +0000 (17:08 -0400)] 
rtl8xxxu: TXDESC_SHORT_GI is txdesc32 only

This is no short GI bit in the txdesc40 format.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Correct txdesc40 gid definition
Jes Sorensen [Thu, 31 Mar 2016 21:08:35 +0000 (17:08 -0400)] 
rtl8xxxu: Correct txdesc40 gid definition

txdesc40 dword2 gid is a 6 bit field, not a single bit

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Rename TX descriptor bits to map them to 32/40 byte descriptors
Jes Sorensen [Thu, 31 Mar 2016 21:08:34 +0000 (17:08 -0400)] 
rtl8xxxu: Rename TX descriptor bits to map them to 32/40 byte descriptors

With the size based naming of TX descriptors. Change the bit
definition namings to indicate which descriptor format they match,
rather than having a device name in the bit name.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl8xxxu: Change name of struct tx_desc to be more decriptive
Jes Sorensen [Thu, 31 Mar 2016 21:08:33 +0000 (17:08 -0400)] 
rtl8xxxu: Change name of struct tx_desc to be more decriptive

There are two major types of TX descriptor formats for the RTL parts,
the old 32 byte descriptor, and the newer 40 byte descriptor used by
the 8723bu, 8192eu, and 88xx series.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: fix NULL pointer dereference error
Wei-Ning Huang [Wed, 30 Mar 2016 10:14:55 +0000 (18:14 +0800)] 
mwifiex: fix NULL pointer dereference error

In mwifiex_enable_hs, we need to check if
priv->wdev.wiphy->wowlan_config is NULL before accessing its member.
This sometimes cause kernel panic when suspend/resume.

Signed-off-by: Wei-Ning Huang <wnhuang@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: ie_list is an array, so no need to check if NULL
Colin Ian King [Mon, 28 Mar 2016 15:53:33 +0000 (16:53 +0100)] 
mwifiex: ie_list is an array, so no need to check if NULL

ap_ie->ie_list is an array of struct mwifiex_ie and can never
be null, so the null check on this array is redundant and can
be removed.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoiwl4965: Fix more memory leaks in __il4965_up()
Julian Calaby [Fri, 18 Mar 2016 02:29:11 +0000 (13:29 +1100)] 
iwl4965: Fix more memory leaks in __il4965_up()

In some of the non-success return paths, the memory allocated by
iwl4965_sta_alloc_lq() in iwl4965_alloc_bcast_station() is not freed.

In particular:
 - if the card isn't ready after il4965_prepare_card_hw()
 - if the card is hardware-rfkilled

In the hardware rfkilled path, the driver enables the rfkill
interrupt. When the card is unrfkilled and this interrupt is raised
we end up calling il4965_bg_restart() which calls __il4965_up() which
calls iwl4965_alloc_bcast_station() again.

Suggested-by: Jia-Ju Bai <baijiaju1990@163.com>
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoiwl4965: Fix a memory leak in error handling code of __il4965_up
Jia-Ju Bai [Fri, 18 Mar 2016 02:28:33 +0000 (13:28 +1100)] 
iwl4965: Fix a memory leak in error handling code of __il4965_up

When il4965_hw_nic_init in __il4965_up fails, the memory allocated by
iwl4965_sta_alloc_lq in iwl4965_alloc_bcast_station is not freed.

This patches adds il_dealloc_bcast_stations in the error handling code of
__il4965_up to fix this problem.

This patch has been tested in real device, and it actually fixes the bug.

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agorsi: Move variable initialisation into error code
Markus Elfring [Fri, 18 Mar 2016 02:27:31 +0000 (13:27 +1100)] 
rsi: Move variable initialisation into error code

In rsi_send_data_pkt(), it's a little more logical to assign 'status' in
the actual error handling code as opposed to at the top of the functon.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
[Deleted controversial bits, rewrote commit message]
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agorsi: Delete unnecessary variable initialisation
Markus Elfring [Fri, 18 Mar 2016 02:25:33 +0000 (13:25 +1100)] 
rsi: Delete unnecessary variable initialisation

In rsi_send_data_pkt(), the following variables are assigned to
before they're used:

 * tmp_hdr - Assigned on line 47, first used on line 48
 * bss - Assigned on line 41, first used on line 44
 * extnd_size - Assigned on line 50, first used on line 52
 * seq_num - Assigned on line 48, first used on line 96

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
[Rewrote commit message]
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agorsi: Delete unnecessary variable initialisation
Markus Elfring [Fri, 18 Mar 2016 02:25:13 +0000 (13:25 +1100)] 
rsi: Delete unnecessary variable initialisation

In rsi_send_mgmt_pkt(), the following variables are assigned to
before they're used:

 * wh - Assigned on line 161, first used on line 180
 * bss - Assigned on line 160, first used on line 196
 * msg - Assigned on line 168, first used on line 175
 * extnd_size - Assigned on line 139, first used on line 142

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
[Rewrote commit message]
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortl818x_pci: Disable pci device in error handling code
Jia-Ju Bai [Fri, 18 Mar 2016 02:24:51 +0000 (13:24 +1100)] 
rtl818x_pci: Disable pci device in error handling code

When pci_request_regions in rtl8180_probe fails, pci_disable_device is not
called to disable the device which is enabled by pci_enbale_device.

This patch fixes the problem by adding a new lable in error handling code.

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
Acked-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agob43: Fix memory leaks in b43_bus_dev_ssb_init and b43_bus_dev_bcma_init
Jia-Ju Bai [Fri, 18 Mar 2016 02:24:28 +0000 (13:24 +1100)] 
b43: Fix memory leaks in b43_bus_dev_ssb_init and b43_bus_dev_bcma_init

The memory allocated by kzalloc in b43_bus_dev_ssb_init and
b43_bus_dev_bcma_init is not freed.
This patch fixes the bug by adding kfree in b43_ssb_remove,
b43_bcma_remove and error handling code of b43_bcma_probe.

Thanks Michael for his suggestion.

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
Tested-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoiwl4965: Fix a null pointer dereference in il_tx_queue_free and il_cmd_queue_free
Jia-Ju Bai [Fri, 18 Mar 2016 02:24:06 +0000 (13:24 +1100)] 
iwl4965: Fix a null pointer dereference in il_tx_queue_free and il_cmd_queue_free

If "txq->cmd = kzalloc(...)" in il_tx_queue_init fails,
"kfree(txq->cmd[i])" in il_tx_queue_free and il_cmd_queue_free
in iwl4965_hw_txq_ctx_free will causes a null pointer dereference,
because txq->cmd is NULL at that time.

This patch fixes this problem by adding a if-check before kfree.
To avoid double free in il_tx_queue_free and il_cmd_queue_free
caused by the fixing, txq->meta and txq->cmd in error handling code
of il_tx_queue_init are assigned null values.
Otherwise, a double free will occur.

This patch has been tested in real device, and it actually fixes the bug.
Thanks Stanislaw for his suggestion.

Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoiwlegacy: Return directly if allocation fails in il_eeprom_init()
Markus Elfring [Fri, 18 Mar 2016 02:23:46 +0000 (13:23 +1100)] 
iwlegacy: Return directly if allocation fails in il_eeprom_init()

Also remove an unused label.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
[Rewrote commit message]
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobrcmfmac: Delete unnecessary variable initialisation
Markus Elfring [Fri, 18 Mar 2016 02:23:24 +0000 (13:23 +1100)] 
brcmfmac: Delete unnecessary variable initialisation

In brcmf_sdio_download_firmware(), bcmerror is set by the call to
brcmf_sdio_download_code_file(), before it's checked in the following
line.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Arend van Spriel <arend@broadcom.com>
[Rewrote commit message]
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoath9k_htc: Delete unnecessary variable initialisation
Markus Elfring [Fri, 18 Mar 2016 02:22:52 +0000 (13:22 +1100)] 
ath9k_htc: Delete unnecessary variable initialisation

In ath9k_hif_usb_rx_stream(), i is initialised in the for loop it's
used in.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
[Rewrote commit message]
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortlwifi: use to_delayed_work()
Geliang Tang [Fri, 18 Mar 2016 02:22:24 +0000 (13:22 +1100)] 
rtlwifi: use to_delayed_work()

Use to_delayed_work() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
[Update commit message]
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agowl1251: use to_delayed_work()
Geliang Tang [Fri, 18 Mar 2016 02:22:03 +0000 (13:22 +1100)] 
wl1251: use to_delayed_work()

Use to_delayed_work() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
[Update commit message]
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agowlcore: use to_delayed_work()
Geliang Tang [Fri, 18 Mar 2016 02:21:28 +0000 (13:21 +1100)] 
wlcore: use to_delayed_work()

Use to_delayed_work() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
[Update commit message]
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoipw2x00: use to_pci_dev()
Geliang Tang [Fri, 18 Mar 2016 02:20:59 +0000 (13:20 +1100)] 
ipw2x00: use to_pci_dev()

Use to_pci_dev() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Acked-by: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoath9k: Remove unnecessary ?: operator
Ivan Safonov [Fri, 18 Mar 2016 02:16:26 +0000 (13:16 +1100)] 
ath9k: Remove unnecessary ?: operator

"(thermometer < 0) ? 0 : (thermometer == X)" is equivalent to
"thermometer == X" for X >= 0.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
[Updated commit message]
Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agotcp/dccp: fix inet_reuseport_add_sock()
Eric Dumazet [Thu, 7 Apr 2016 05:07:34 +0000 (22:07 -0700)] 
tcp/dccp: fix inet_reuseport_add_sock()

David Ahern reported panics in __inet_hash() caused by my recent commit.

The reason is inet_reuseport_add_sock() was still using
sk_nulls_for_each_rcu() instead of sk_for_each_rcu().
SO_REUSEPORT enabled listeners were causing an instant crash.

While chasing this bug, I found that I forgot to clear SOCK_RCU_FREE
flag, as it is inherited from the parent at clone time.

Fixes: 3b24d854cb35 ("tcp/dccp: do not touch listener sk_refcnt under synflood")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: David Ahern <dsa@cumulusnetworks.com>
Tested-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next...
David S. Miller [Thu, 7 Apr 2016 15:50:30 +0000 (11:50 -0400)] 
Merge branch '1GbE' of git://git./linux/kernel/git/jkirsher/next-queue

Jeff Kirsher says:

====================
1GbE Intel Wired LAN Driver Updates 2016-04-06

This series contains updates to e1000, e1000e, igb and Kconfig.

Alex fixes igb where we were casting the MAC address as __beXX and then
passing it into le32_to_cpu, when we could simply cast as __lexx to
maintain consistency since it is already little endian.  Then enabled
bulk free in transmit cleanup for igb.

John Holland enables igb to pickup the MAC address from a device tree
blob when CONFIG_OF has been enabled.

Doron Shikmoni fixes a bug in the output of "ethtool -m ethX" where
the data byte appeared duplicated.

Stefan fixes up e1000 and e1000e ethtool offline tests which were calling
dev_close() which causes IFF_UP to be cleared which removes teh interface
routes and some addresses, so use ndo_stop() instead.

Jiri Benc cleans up some old links in the Kconfig for Intel drivers where
we referred to a URL which is no longer valid.  I am so glad Jiri has the
time in his day to spend clicking on and testing all the URL links in the
the kernel.

Arika Chen reverts the addition of a 'rtnl_unlock()' which had a unmatched
'rtnl_lock()' call before it.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoath10k: fix unconditional num_mpdus_ready subtraction
Rajkumar Manoharan [Thu, 7 Apr 2016 06:37:31 +0000 (12:07 +0530)] 
ath10k: fix unconditional num_mpdus_ready subtraction

Decrement num_mpdus_ready only when rx amsdu is processed successfully.
Not doing so, will result in leak and impact stabilty under low memory
cases. Also commit 3128b3d8a2b9 ("ath10k: speedup htt rx descriptor
processing for rx_ind") missed to removed unused skb list rx_q.

Fixes: 3128b3d8a2b9 ("ath10k: speedup htt rx descriptor processing for rx_ind")
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: remove unnecessary warning for probe response drops
Rajkumar Manoharan [Thu, 7 Apr 2016 06:37:30 +0000 (12:07 +0530)] 
ath10k: remove unnecessary warning for probe response drops

qca99x0 and qca4019 solutions limit probe responses transmissions.
Logging warning message for each probe response drop is flooding
kernel log unnecessary with " failed to increase tx mgmt pending
count: -16, dropping". Hence reducing log level to debug.

Reported-by: Sebastian Gottschall <s.gottschall@dd-wrt.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: fix calibration init sequence of qca99x0
Rajkumar Manoharan [Thu, 7 Apr 2016 06:37:29 +0000 (12:07 +0530)] 
ath10k: fix calibration init sequence of qca99x0

pre-calibration is meant for qca4019 which contains only caldata
whereas calibration file is used by ar9888 and qca99x0 that contains
both board data and caldata. So by definition both pre-cal-file and
cal-file can not coexist. Keeping them in shared memory (union), is
breaking boot sequence of qca99x0. Fix it by storing both binaries
in separate memories. This issue is reported in ipq8064 platform which
includes caldata in flash memory.

Fixes: 3d9195ea19e4 ("ath10k: incorporate qca4019 cal data download sequence")
Reported-by: Sebastian Gottschall <s.gottschall@dd-wrt.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoMerge tag 'fixes-for-v4.6-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi...
Greg Kroah-Hartman [Thu, 7 Apr 2016 15:31:43 +0000 (08:31 -0700)] 
Merge tag 'fixes-for-v4.6-rc3' of git://git./linux/kernel/git/balbi/usb into usb-linus

Felipe writes:

usb: fixes for v4.6-rc3

We have two more fixes to f_midi. It should now
behave much better.

dwc3-keystone.c has gotten a fix which now allows it
to work on keystone device when running in
peripheral mode. A similar fix for DMA configuration
was made for udc-core, too.

We have a new PCI ID for Intel's Broxton
platform. DWC3 can run on those platforms as well.

And we also have some dwc2 got a fix for dr_mode
usage, while renesas controller got 3 important
fixes: a NULL pointer deref fix, IRQ <-> DMA race
fix, and a fix to prevent a situation where we would
queue a request to a disabled endpoint.

8 years agoiommu/vt-d: Silence an uninitialized variable warning
Dan Carpenter [Wed, 6 Apr 2016 18:38:56 +0000 (21:38 +0300)] 
iommu/vt-d: Silence an uninitialized variable warning

My static checker complains that "dma_alias" is uninitialized unless we
are dealing with a pci device.  This is true but harmless.  Anyway, we
can flip the condition around to silence the warning.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
8 years agoiommu/rockchip: Fix "is stall active" check
John Keeping [Tue, 5 Apr 2016 14:05:46 +0000 (15:05 +0100)] 
iommu/rockchip: Fix "is stall active" check

Since commit cd6438c5f844 ("iommu/rockchip: Reconstruct to support multi
slaves") rk_iommu_is_stall_active() always returns false because the
bitwise AND operates on the boolean flag promoted to an integer and a
value that is either zero or BIT(2).

Explicitly convert the right-hand value to a boolean so that both sides
are guaranteed to be either zero or one.

rk_iommu_is_paging_enabled() does not suffer from the same problem since
RK_MMU_STATUS_PAGING_ENABLED is BIT(0), but let's apply the same change
for consistency and to make it clear that it's correct without needing
to lookup the value.

Fixes: cd6438c5f844 ("iommu/rockchip: Reconstruct to support multi slaves")
Signed-off-by: John Keeping <john@metanate.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
8 years agoiommu: Don't overwrite domain pointer when there is no default_domain
Joerg Roedel [Mon, 4 Apr 2016 13:47:48 +0000 (15:47 +0200)] 
iommu: Don't overwrite domain pointer when there is no default_domain

IOMMU drivers that do not support default domains, but make
use of the the group->domain pointer can get that pointer
overwritten with NULL on device add/remove.

Make sure this can't happen by only overwriting the domain
pointer when it is NULL.

Cc: stable@vger.kernel.org # v4.4+
Fixes: 1228236de5f9 ('iommu: Move default domain allocation to iommu_group_get_for_dev()')
Signed-off-by: Joerg Roedel <jroedel@suse.de>
8 years agovirtio: add VIRTIO_CONFIG_S_NEEDS_RESET device status bit
Stefan Hajnoczi [Tue, 29 Mar 2016 15:43:45 +0000 (16:43 +0100)] 
virtio: add VIRTIO_CONFIG_S_NEEDS_RESET device status bit

The VIRTIO 1.0 specification added the DEVICE_NEEDS_RESET device status
bit in "VIRTIO-98: Add DEVICE_NEEDS_RESET".  This patch defines the
device status bit in the uapi header file so that both the kernel and
userspace applications can use it.

The bit is currently unused by the virtio guest drivers and vhost.
According to the spec "a good implementation will try to recover by
issuing a reset".  This is not attempted here because it requires
auditing the virtio drivers to ensure there are no resource leaks or
crashes if the device needs to be reset mid-operation.

See "2.1 Device Status Field" in the VIRTIO 1.0 specification for
details.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
8 years agoMAINTAINERS: add entry for QEMU
Michael S. Tsirkin [Tue, 5 Apr 2016 08:26:44 +0000 (11:26 +0300)] 
MAINTAINERS: add entry for QEMU

Gabriel merged support for QEMU FW CFG interface, but there's apparently
no official maintainer. It's also possible that this will grow more
interfaces in future.  I'll happily co-maintain it and handle pull
requests together with the rest of the PV stuff I maintain.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Gabriel Somlo <somlo@cmu.edu>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Gabriel Somlo <somlo@cmu.edu>
8 years agofirmware: qemu_fw_cfg.c: hold ACPI global lock during device access
Gabriel Somlo [Tue, 8 Mar 2016 18:30:50 +0000 (13:30 -0500)] 
firmware: qemu_fw_cfg.c: hold ACPI global lock during device access

Allowing for the future possibility of implementing AML-based
(i.e., firmware-triggered) access to the QEMU fw_cfg device,
acquire the global ACPI lock when accessing the device on behalf
of the guest-side sysfs driver, to prevent any potential race
conditions.

Suggested-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Gabriel Somlo <somlo@cmu.edu>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
8 years agovirtio: virtio 1.0 cs04 spec compliance for reset
Michael S. Tsirkin [Sun, 3 Apr 2016 12:23:37 +0000 (15:23 +0300)] 
virtio: virtio 1.0 cs04 spec compliance for reset

The spec says: after writing 0 to device_status, the driver MUST wait
for a read of device_status to return 0 before reinitializing the
device.

Cc: stable@vger.kernel.org
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
8 years agoqemu_fw_cfg: don't leak kobj on init error
Michael S. Tsirkin [Sun, 3 Apr 2016 12:22:08 +0000 (15:22 +0300)] 
qemu_fw_cfg: don't leak kobj on init error

If platform_driver_register fails, we should
cleanup fw_cfg_top_ko before exiting.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Gabriel Somlo <somlo@cmu.edu>
8 years agoUSB: option: add "D-Link DWM-221 B1" device id
Bjørn Mork [Thu, 7 Apr 2016 10:09:17 +0000 (12:09 +0200)] 
USB: option: add "D-Link DWM-221 B1" device id

Thomas reports:
"Windows:

00 diagnostics
01 modem
02 at-port
03 nmea
04 nic

Linux:

T:  Bus=02 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#=  4 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=2001 ProdID=7e19 Rev=02.32
S:  Manufacturer=Mobile Connect
S:  Product=Mobile Connect
S:  SerialNumber=0123456789ABCDEF
C:  #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
I:  If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
I:  If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
I:  If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
I:  If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan
I:  If#= 5 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage"

Reported-by: Thomas Schäfer <tschaefer@t-online.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Johan Hovold <johan@kernel.org>
8 years agoUSB: serial: cp210x: Adding GE Healthcare Device ID
Martyn Welch [Tue, 29 Mar 2016 16:47:29 +0000 (17:47 +0100)] 
USB: serial: cp210x: Adding GE Healthcare Device ID

The CP2105 is used in the GE Healthcare Remote Alarm Box, with the
Manufacturer ID of 0x1901 and Product ID of 0x0194.

Signed-off-by: Martyn Welch <martyn.welch@collabora.co.uk>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
8 years agoUSB: serial: ftdi_sio: Add support for ICP DAS I-756xU devices
Josh Boyer [Thu, 10 Mar 2016 14:48:52 +0000 (09:48 -0500)] 
USB: serial: ftdi_sio: Add support for ICP DAS I-756xU devices

A Fedora user reports that the ftdi_sio driver works properly for the
ICP DAS I-7561U device.  Further, the user manual for these devices
instructs users to load the driver and add the ids using the sysfs
interface.

Add support for these in the driver directly so that the devices work
out of the box instead of needing manual configuration.

Reported-by: <thesource@mail.ru>
CC: stable <stable@vger.kernel.org>
Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
8 years agoMerge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next...
David S. Miller [Thu, 7 Apr 2016 04:06:38 +0000 (00:06 -0400)] 
Merge branch '40GbE' of git://git./linux/kernel/git/jkirsher/next-queue

Jeff Kirsher says:

====================
40GbE Intel Wired LAN Driver Updates 2016-04-06

This series contains updates to i40e and i40evf.

Deepthi adds a debug message to display the MSIx vector count for hardware
capabilities.

Shannon removed the setting of debug_mask at startup to take care of an
issue where all the device capabilities getting printed when we had not
asked for it.  Moved the NVM status out of the admin queue structure,
since it should really stay with the other NVM data structures.

Akeem added the flush routine to the end of the reset flow to avoid
problems in the pass-through routines.

Jesse moves a local variable deeper into the depths of the driver
where the light is low and the context is great.  Then cleaned up
the tx_ring argument since it was not making good arguments.  Improved
performance by not "checking for FCoE" by re-ordering the FCoE checks.

Anjali adds the support for changing a VF from non-trusted to trusted
and vice-versa.

Mitch adds opcodes and structures to support RSS configuration by PF
driver on behalf of the VF driver.  Fixed how the VLAN feature flags
are set.

Kiran added defines for RSS, flow director, flexible payload and IPv6.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoRevert "igb: Fix a deadlock in igb_sriov_reinit"
Arika Chen [Thu, 7 Apr 2016 04:02:11 +0000 (21:02 -0700)] 
Revert "igb: Fix a deadlock in igb_sriov_reinit"

This reverts commit 3eb14ea8d958 ("igb: Fix a deadlock in
igb_sriov_reinit")
It is the same as commit f468adc944ef ("igb: missing rtnl_unlock in
igb_sriov_reinit()")
There is no rtnl_lock() in igb_resume before, rtnl_unlock will cause a
deadlock.

Signed-off-by: Arika Chen <arika.chen@huawei.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agonet: intel: remove dead links
Jiri Benc [Tue, 5 Apr 2016 14:25:07 +0000 (16:25 +0200)] 
net: intel: remove dead links

The Kconfig for Intel NICs references two different URLs for the "Adapter
& Driver ID Guide". Neither of those two links works. The current URL seems
to be
http://www.intel.com/content/www/us/en/support/network-and-i-o/ethernet-products/000005584.html
but given it's apparently constantly changing, there's no point in having it
in the help text.

Just keep a generic pointer to http://support.intel.com. Hopefully, this one
will have a longer live. It still works, at least.

Furthermore, remove a link to "the latest Intel PRO/100 network driver for
Linux", this has no place in the mainline kernel and the latest Linux driver
it offers is from 2006, anyway.

Signed-off-by: Jiri Benc <jbenc@redhat.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoi40evf: properly handle VLAN features
Mitch Williams [Fri, 1 Apr 2016 20:34:31 +0000 (13:34 -0700)] 
i40evf: properly handle VLAN features

Correctly set the VLAN feature flags after setting the rest of the
netdev flags. And don't set them in hw_features, because these can't be
controlled by the VF driver.

Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This page took 0.051812 seconds and 5 git commands to generate.