firefly-linux-kernel-4.4.55.git
12 years agonet: wireless: bcmdhd: Fix sending ctrl packet
Dmitry Shmidt [Tue, 28 Aug 2012 23:17:37 +0000 (16:17 -0700)]
net: wireless: bcmdhd: Fix sending ctrl packet

- Schedule dpc thread to send ctrl frame if we cannot
  send ctrl packet immediately.

Change-Id: I5ae8b705a6ccddcc1f5c86b4c094342b57d26c7f
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Add ASSOC event processing
Dmitry Shmidt [Tue, 28 Aug 2012 00:38:43 +0000 (17:38 -0700)]
net: wireless: bcmdhd: Add ASSOC event processing

Change-Id: Ide0b887ba52af56d0aaa415111df5ba16265c8d8
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Update to version 5.90.195.104
Dmitry Shmidt [Mon, 27 Aug 2012 20:55:15 +0000 (13:55 -0700)]
net: wireless: bcmdhd: Update to version 5.90.195.104

- Fix p2p support for new wpa_supplicant
- Propagate disconnect error code for cfg80211

Change-Id: I9643fbad7b6170b0e794fd7854201931d5eefb22
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agocfg80211: allow registering to beacons
Johannes Berg [Fri, 4 Nov 2011 10:18:17 +0000 (11:18 +0100)]
cfg80211: allow registering to beacons

Add the ability to register to received beacon frames
to allow implementing OLBC logic in userspace. The
registration is per wiphy since there's no point in
receiving the same frame multiple times.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agonl80211: add API to probe a client
Johannes Berg [Fri, 4 Nov 2011 10:18:15 +0000 (11:18 +0100)]
nl80211: add API to probe a client

When the AP SME in hostapd is used it wants to
probe the clients when they have been idle for
some time. Add explicit API to support this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agonl80211: allow subscribing to unexpected class3 frames
Johannes Berg [Fri, 4 Nov 2011 10:18:12 +0000 (11:18 +0100)]
nl80211: allow subscribing to unexpected class3 frames

To implement AP mode without monitor interfaces we
need to be able to send a deauth to stations that
send frames without being associated. Enable this
by adding a new nl80211 event for such frames that
an application can subscribe to.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agonl80211: advertise device AP SME
Johannes Berg [Mon, 7 Nov 2011 11:39:33 +0000 (12:39 +0100)]
nl80211: advertise device AP SME

Add the ability to advertise that the device
contains the AP SME and what features it can
support. There are currently no features in
the bitmap -- probe response offload will be
advertised by a few patches Arik is working
on now (who took over from Guy Eilam) and a
device with AP SME will typically implement
and require response offload.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Conflicts:

drivers/net/wireless/ath/ath6kl/init.c

Change-Id: Ib1a65814860cf97cadd142c17be0e91f43743832

12 years agonl80211: advertise GTK rekey support, new triggers
Johannes Berg [Wed, 13 Jul 2011 08:48:55 +0000 (10:48 +0200)]
nl80211: advertise GTK rekey support, new triggers

Since we now have the necessary API in place to support
GTK rekeying, applications will need to know whether it
is supported by a device. Add a pseudo-trigger that is
used only to advertise that capability. Also, add some
new triggers that match what iwlagn devices can do.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agonl80211: support sending TDLS commands/frames
Arik Nemtsov [Wed, 28 Sep 2011 11:12:50 +0000 (14:12 +0300)]
nl80211: support sending TDLS commands/frames

Add support for sending high-level TDLS commands and TDLS frames via
NL80211_CMD_TDLS_OPER and NL80211_CMD_TDLS_MGMT, respectively. Add
appropriate cfg80211 callbacks for lower level drivers.

Add wiphy capability flags for TDLS support and advertise them via
nl80211.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Conflicts:

include/linux/nl80211.h
include/net/cfg80211.h
net/wireless/nl80211.c

Change-Id: I08e4de6e92680aed35b98838aa999d31963b6d50

12 years agocfg80211/nl80211: Add PMKSA caching candidate event
Jouni Malinen [Fri, 16 Sep 2011 15:56:23 +0000 (18:56 +0300)]
cfg80211/nl80211: Add PMKSA caching candidate event

When the driver (or most likely firmware) decides which AP to use
for roaming based on internal scan result processing, user space
needs to be notified of PMKSA caching candidates to allow RSN
pre-authentication to be used.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Conflicts:

include/linux/nl80211.h

Change-Id: I31aa113747b75f5f35658b857fdfe8d9a75e4534

12 years agocfg80211/nl80211: support GTK rekey offload
Johannes Berg [Tue, 5 Jul 2011 14:35:40 +0000 (16:35 +0200)]
cfg80211/nl80211: support GTK rekey offload

In certain circumstances, like WoWLAN scenarios,
devices may implement (partial) GTK rekeying on
the device to avoid waking up the host for it.

In order to successfully go through GTK rekeying,
the KEK, KCK and the replay counter are required.

Add API to let the supplicant hand the parameters
to the driver which may store it for future GTK
rekey operations.

Note that, of course, if GTK rekeying is done by
the device, the EAP frame must not be passed up
to userspace, instead a rekey event needs to be
sent to let userspace update its replay counter.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Conflicts:

include/linux/nl80211.h
net/wireless/nl80211.c

Change-Id: Icd3a157742b08c01a3be20d46d4112e5d4b93a58

12 years agonet: wireless: bcmdhd: Remove WIPHY_FLAG_SUPPORTS_FW_ROAM flag
Dmitry Shmidt [Wed, 22 Aug 2012 23:09:09 +0000 (16:09 -0700)]
net: wireless: bcmdhd: Remove WIPHY_FLAG_SUPPORTS_FW_ROAM flag

If driver advertises FW_ROAM, the supplicant wouldn't send
the BSSID & Freq in the connect command allowing the driver
to choose the AP to connect to. But unless we support ROAM_CACHE
in firware this will delay the ASSOC as the FW need to do a full
scan before attempting to connect.

Change-Id: Iebc88a60243196b9ad27b8302f2b1473710308f6
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Remove PMKID_CACHE and TXFAIL events for CFG80211
Dmitry Shmidt [Wed, 22 Aug 2012 20:56:14 +0000 (13:56 -0700)]
net: wireless: bcmdhd: Remove PMKID_CACHE and TXFAIL events for CFG80211

Change-Id: I82b6a1c9941485f3b47bc5978873379ab8853601
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Update to Version 5.90.195.98
Dmitry Shmidt [Wed, 22 Aug 2012 18:29:44 +0000 (11:29 -0700)]
net: wireless: bcmdhd: Update to Version 5.90.195.98

Change-Id: I2854300bc03b133d8276bea2f36f4c5253c551a1
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agoARM: disable preemption in machine_shutdown
Mike J. Chen [Thu, 24 May 2012 22:12:36 +0000 (15:12 -0700)]
ARM: disable preemption in machine_shutdown

Since the smp call to stop the other cpus are handled in those
cpus in interrupt context, there's a potential for those smp
handlers to interrupt threads holding spin locks (such as the
one a mutex holds).  This prevents those threads from ever
releasing their spin lock, so if the cpu doing the shutdown
is allowed to switch to another thread that tries to grab the
same lock/mutex, we could get into a deadlock (the spin lock
call is called with preemption disabled in the mutex lock code).

To avoid that possibility, disable preemption before doing the
smp_send_stop().

Change-Id: I7976c5382d7173fcb3cd14da8cc5083d442b2544
Signed-off-by: Mike J. Chen <mjchen@google.com>
12 years agoUSB: gadget: f_audio_source: Fix compilation error
Mike Lockwood [Thu, 16 Aug 2012 20:13:20 +0000 (13:13 -0700)]
USB: gadget: f_audio_source: Fix compilation error

Change-Id: I1b785c47bda03208d396473a9d1c94631f5624d9
Signed-off-by: Mike Lockwood <lockwood@google.com>
12 years agoUSB: gadget: f_audio_source: Fix use after free in audio_unbind
Mike Lockwood [Thu, 16 Aug 2012 02:58:28 +0000 (19:58 -0700)]
USB: gadget: f_audio_source: Fix use after free in audio_unbind

When USB was disconnected, we were freeing our audio_dev struct in audio_unbind
before the audio system had cleaned up, resulting in a hang in audio_pcm_close.
We now statically allocate the audio_dev struct to avoid this problem.

Change-Id: I58ad21eaa20dcf4aa74ee614ef3b6ed2c91d52a1
Signed-off-by: Mike Lockwood <lockwood@google.com>
12 years agoHID: uhid: Fix sending events with invalid data
Vinicius Costa Gomes [Sat, 14 Jul 2012 21:59:25 +0000 (18:59 -0300)]
HID: uhid: Fix sending events with invalid data

This was detected because events with invalid types were arriving
to userspace.

The code before this patch would only work for the first event in the
queue (when uhid->tail is 0).

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Reviewed-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
12 years agoHID: uhid: silence gcc warning
Jiri Kosina [Mon, 18 Jun 2012 15:08:08 +0000 (17:08 +0200)]
HID: uhid: silence gcc warning

gcc is giving me:

drivers/hid/uhid.c: In function ‘uhid_hid_get_raw’:
drivers/hid/uhid.c:157: warning: ‘len’ may be used uninitialized in this function

which is clearly bogus, as

- when used as memcpy() argument, it's initialized properly
- the code is structured in a way that either 'ret' or 'len'
  is always initialized, so the return statement always has
  an initialized value.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
12 years agoMAINTAINERS: add UHID entry
David Herrmann [Sun, 10 Jun 2012 13:16:28 +0000 (15:16 +0200)]
MAINTAINERS: add UHID entry

Add an UHID entry to the MAINTAINERS file.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
12 years agoHID: uhid: add example program
David Herrmann [Sun, 10 Jun 2012 13:16:27 +0000 (15:16 +0200)]
HID: uhid: add example program

This adds an example user-space program that emulates a 3 button mouse
with wheel. It detects keyboard presses and moves the mouse accordingly.

It register a fake HID device to feed the raw HID reports into the kernel.
In this example, you could use uinput to get the same result, but this
shows how to get the same behavior with uhid so you don't need HID parsers
in user-space.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
12 years agoHID: uhid: add documentation
David Herrmann [Sun, 10 Jun 2012 13:16:26 +0000 (15:16 +0200)]
HID: uhid: add documentation

This describes the protocol used by uhid for user-space applications. It
describes the details like non-blocking I/O and readv/writev for multiple
events per syscall.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
12 years agoHID: uhid: implement feature requests
David Herrmann [Sun, 10 Jun 2012 13:16:25 +0000 (15:16 +0200)]
HID: uhid: implement feature requests

HID standard allows sending a feature request to the device which is
answered by an HID report. uhid implements this by sending a UHID_FEATURE
event to user-space which then must answer with UHID_FEATURE_ANSWER. If it
doesn't do this in a timely manner, the request is discarded silently.

We serialize the feature requests, that is, there is always only a single
active feature-request sent to user-space, other requests have to wait.
HIDP and USB-HID do it the same way.

Because we discard feature-requests silently, we must make sure to match
a response to the corresponding request. We use sequence-IDs for this so
user-space must copy the ID from the request into the answer.
Feature-answers are ignored if they do not contain the same ID as the
currently pending feature request.

Internally, we must make sure that feature-requests are synchronized with
UHID_DESTROY and close() events. We must not dead-lock when closing the
HID device, either, so we have to use separate locks.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
12 years agoHID: uhid: forward raw output reports to user-space
David Herrmann [Sun, 10 Jun 2012 13:16:24 +0000 (15:16 +0200)]
HID: uhid: forward raw output reports to user-space

Some drivers that use non-standard HID features require raw output reports
sent to the device. We now forward these requests directly to user-space
so the transport-level driver can correctly send it to the device or
handle it correspondingly.

There is no way to signal back whether the transmission was successful,
moreover, there might be lots of messages coming out from the driver
flushing the output-queue. However, there is currently no driver that
causes this so we are safe. If some drivers need to transmit lots of data
this way, we need a method to synchronize this and can implement another
UHID_OUTPUT_SYNC event.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
12 years agoHID: uhid: forward output request to user-space
David Herrmann [Sun, 10 Jun 2012 13:16:23 +0000 (15:16 +0200)]
HID: uhid: forward output request to user-space

If the hid-driver wants to send standardized data to the device it uses a
linux input_event. We forward this to the user-space transport-level
driver so they can perform the requested action on the device.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
12 years agoHID: uhid: forward open/close events to user-space
David Herrmann [Sun, 10 Jun 2012 13:16:22 +0000 (15:16 +0200)]
HID: uhid: forward open/close events to user-space

HID core notifies us with *_open/*_close callbacks when there is an actual
user of our device. We forward these to user-space so they can react on
this. This allows user-space to skip I/O unless they receive an OPEN
event. When they receive a CLOSE event they can stop I/O again to save
energy.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
12 years agoHID: uhid: add UHID_START and UHID_STOP events
David Herrmann [Sun, 10 Jun 2012 13:16:21 +0000 (15:16 +0200)]
HID: uhid: add UHID_START and UHID_STOP events

We send UHID_START and UHID_STOP events to user-space when the HID core
starts/stops the device. This notifies user-space about driver readiness
and data-I/O can start now.

This directly forwards the callbacks from hid-core to user-space.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
12 years agoHID: uhid: forward hid report-descriptor to hid core
David Herrmann [Sun, 10 Jun 2012 13:16:20 +0000 (15:16 +0200)]
HID: uhid: forward hid report-descriptor to hid core

When the uhid_hid_parse callback is called we simply forward it to
hid_parse_report() with the data that we got in the UHID_CREATE event.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
12 years agoHID: uhid: allow feeding input data into uhid devices
David Herrmann [Sun, 10 Jun 2012 13:16:19 +0000 (15:16 +0200)]
HID: uhid: allow feeding input data into uhid devices

This adds a new event type UHID_INPUT which allows user-space to feed raw
HID reports into the HID subsystem. We copy the data into kernel memory
and directly feed it into the HID core.

There is no error handling of the events couldn't be parsed so user-space
should consider all events successfull unless read() returns an error.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
12 years agoHID: uhid: add UHID_CREATE and UHID_DESTROY events
David Herrmann [Sun, 10 Jun 2012 13:16:18 +0000 (15:16 +0200)]
HID: uhid: add UHID_CREATE and UHID_DESTROY events

UHID_CREATE and UHID_DESTROY are used to create and destroy a device on an
open uhid char-device. Internally, we allocate and register an HID device
with the HID core and immediately start the device. From now on events may
be received or sent to the device.

The UHID_CREATE event has a payload similar to the data used by
Bluetooth-HIDP when creating a new connection.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
12 years agoHID: uhid: implement write() on uhid devices
David Herrmann [Sun, 10 Jun 2012 13:16:17 +0000 (15:16 +0200)]
HID: uhid: implement write() on uhid devices

Similar to read() you can only write() a single event with one call to an
uhid device. To write multiple events use writev() which is supported by
uhid.

We currently always return -EOPNOTSUPP but other events will be added in
later patches.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
12 years agoHID: uhid: implement read() on uhid devices
David Herrmann [Sun, 10 Jun 2012 13:16:16 +0000 (15:16 +0200)]
HID: uhid: implement read() on uhid devices

User-space can use read() to get a single event from uhid devices. read()
does never return multiple events. This allows us to extend the event
structure and still keep backwards compatibility.

If user-space wants to get multiple events in one syscall, they should use
the readv()/writev() syscalls which are supported by uhid.

This introduces a new lock which helps us synchronizing simultaneous reads
from user-space. We also correctly return -EINVAL/-EFAULT only on errors
and retry the read() when some other thread captured the event faster than
we did.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
12 years agoHID: uhid: allow poll()'ing on uhid devices
David Herrmann [Sun, 10 Jun 2012 13:16:15 +0000 (15:16 +0200)]
HID: uhid: allow poll()'ing on uhid devices

As long as the internal buffer is not empty, we return POLLIN to
user-space.

uhid->head and uhid->tail are no atomics so the comparison may return
inexact results. However, this doesn't matter here as user-space would
need to poll() in two threads simultaneously to trigger this. And in this
case it doesn't matter if a cached result is returned or the exact new
result as user-space does not know which thread returns first from poll()
and the following read(). So it is safe to compare the values without
locking.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
12 years agoHID: uhid: add internal message buffer
David Herrmann [Sun, 10 Jun 2012 13:16:14 +0000 (15:16 +0200)]
HID: uhid: add internal message buffer

When receiving messages from the HID subsystem, we need to process them
and store them in an internal buffer so user-space can read() on the char
device to retrieve the messages.

This adds a static buffer for 32 messages to each uhid device. Each
message is dynamically allocated so the uhid_device structure does not get
too big.

uhid_queue() adds a message to the buffer. If the buffer is full, the
message is discarded. uhid_queue_event() is an helper for messages without
payload.

This also adds a public header: uhid.h. It contains the declarations for
the user-space API. It is built around "struct uhid_event" which contains
a type field which specifies the event type and each event can then add a
variable-length payload. For now, there is only a dummy event but later
patches will add new event types and payloads.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
12 years agoHID: uhid: introduce user-space I/O driver support for HID
David Herrmann [Sun, 10 Jun 2012 13:16:13 +0000 (15:16 +0200)]
HID: uhid: introduce user-space I/O driver support for HID

This adds a dummy driver that will support user-space I/O drivers for the
HID subsystem. This allows to write transport-level drivers like USB-HID
and Bluetooth-HID in user-space.

Low-Energy Bluetooth needs this to feed HID data that is parsed in
user-space back into the kernel.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
12 years agommc: Make sure host is disabled on suspend
Dmitry Shmidt [Thu, 16 Aug 2012 17:34:01 +0000 (10:34 -0700)]
mmc: Make sure host is disabled on suspend

Change-Id: Ie0bf2004e173cef8dad66722a152658d7727ab65
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcm4329: Remove obsolete files
Dmitry Shmidt [Mon, 13 Aug 2012 20:59:22 +0000 (13:59 -0700)]
net: wireless: bcm4329: Remove obsolete files

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonetfilter: xt_IDLETIMER: Rename INTERFACE to LABEL in netlink notification.
Ashish Sharma [Mon, 13 Aug 2012 18:38:49 +0000 (11:38 -0700)]
netfilter: xt_IDLETIMER: Rename INTERFACE to LABEL in netlink notification.

Signed-off-by: Ashish Sharma <ashishsharma@google.com>
12 years agonet: wireless: bcmdhd: Use correct time from boot for TSF
Dmitry Shmidt [Mon, 13 Aug 2012 18:37:43 +0000 (11:37 -0700)]
net: wireless: bcmdhd: Use correct time from boot for TSF

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agoscripts/Kbuild.include: Fix portability problem of "echo -e"
Bernhard Walle [Sun, 26 Feb 2012 17:35:18 +0000 (18:35 +0100)]
scripts/Kbuild.include: Fix portability problem of "echo -e"

"echo -e" is a GNU extension. When cross-compiling the kernel on a
BSD-like operating system (Mac OS X in my case), this doesn't work.

One could install a GNU version of echo, put that in the $PATH before
the system echo and use "/usr/bin/env echo", but the solution with
printf is simpler.

Since it is no disadvantage on Linux, I hope that gets accepted even if
cross-compiling the Linux kernel on another Unix operating system is
quite a rare use case.

Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
Andreas Bießmann <andreas@biessmann.de>
Signed-off-by: Michal Marek <mmarek@suse.cz>
12 years agoUSB: gadget: f_audio_source: Fix error handling and increase packet size
Mike Lockwood [Thu, 2 Aug 2012 18:22:05 +0000 (11:22 -0700)]
USB: gadget: f_audio_source: Fix error handling and increase packet size

Fixes watchdog reset on USB disconnect
Larger packet size fixes performance in fullspeed mode

Signed-off-by: Mike Lockwood <lockwood@google.com>
12 years agonet: wireless: bcmdhd: Fill station_info packet fields
Dmitry Shmidt [Fri, 27 Jul 2012 01:02:38 +0000 (18:02 -0700)]
net: wireless: bcmdhd: Fill station_info packet fields

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Prevent HT Avail request failure to flood the log
Dmitry Shmidt [Wed, 18 Jul 2012 18:15:10 +0000 (11:15 -0700)]
net: wireless: bcmdhd: Prevent HT Avail request failure to flood the log

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Use proper jiffie-related functions
Dmitry Shmidt [Fri, 13 Jul 2012 21:30:33 +0000 (14:30 -0700)]
net: wireless: bcmdhd: Use proper jiffie-related functions

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Conflicts:

drivers/net/wireless/bcmdhd/wl_cfg80211.c
drivers/net/wireless/bcmdhd/wl_iw.c

12 years agonet: wireless: bcmdhd: Adjust driver/fw/chip info format
Dmitry Shmidt [Fri, 13 Jul 2012 21:38:32 +0000 (14:38 -0700)]
net: wireless: bcmdhd: Adjust driver/fw/chip info format

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agox86: Call idle notifiers
German Monroy [Tue, 15 May 2012 00:14:19 +0000 (17:14 -0700)]
x86: Call idle notifiers

BZ: 35303

Google patched the idle loop for x86-64 (commit 1fd57f722c) and for ARM
(commit 41fa406c26), but they forgot x86-32.

This is preventing their interactive governor from upshifting CPU
frequencies in intel's SOC platforms (e.g. Medfield, etc.).

Fixing that.

NOTE: The notifier calls are not located in the same exact place in the
idle loop for x86-64 and ARM.  The notifier is called inside the
`while(!need_resched)' loop in x86-64 and outside of it in ARM.  Since
Google has likely tuned this governor for ARM, leaving it as in ARM.

Change-Id: Ibefd0c8f08e4b4c24c4a5c32dcdc574f9090b2b9
Signed-off-by: German Monroy <german.monroy@intel.com>
12 years agonet: wireless: bcmdhd: Add info_string param with driver/fw/chip info
Dmitry Shmidt [Thu, 12 Jul 2012 23:58:00 +0000 (16:58 -0700)]
net: wireless: bcmdhd: Add info_string param with driver/fw/chip info

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Remove country update from wl_update_wiphybands
Dmitry Shmidt [Wed, 11 Jul 2012 17:17:59 +0000 (10:17 -0700)]
net: wireless: bcmdhd: Remove country update from wl_update_wiphybands

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Fix P2P GO hang issue
Neeraj Kumar Garg [Mon, 9 Jul 2012 19:18:39 +0000 (12:18 -0700)]
net: wireless: bcmdhd: Fix P2P GO hang issue

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Update wiphy bands on band change
Dmitry Shmidt [Mon, 9 Jul 2012 18:14:42 +0000 (11:14 -0700)]
net: wireless: bcmdhd: Update wiphy bands on band change

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Init locks in dhd_attach() at the beginning
Andrey Vagin [Mon, 9 Jul 2012 17:46:55 +0000 (10:46 -0700)]
net: wireless: bcmdhd: Init locks in dhd_attach() at the beginning

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcm4329: Init locks in dhd_attach() at the beginning
Andrey Vagin [Mon, 9 Jul 2012 17:31:06 +0000 (10:31 -0700)]
net: wireless: bcm4329: Init locks in dhd_attach() at the beginning

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Add mutex to wl_update_wiphybands()
Dmitry Shmidt [Fri, 29 Jun 2012 16:31:18 +0000 (09:31 -0700)]
net: wireless: bcmdhd: Add mutex to wl_update_wiphybands()

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Skip country setting if unnecessary
Dmitry Shmidt [Thu, 28 Jun 2012 23:38:27 +0000 (16:38 -0700)]
net: wireless: bcmdhd: Skip country setting if unnecessary

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Return wl_construct_reginfo() call
Dmitry Shmidt [Thu, 28 Jun 2012 23:27:31 +0000 (16:27 -0700)]
net: wireless: bcmdhd: Return wl_construct_reginfo() call

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Add wiphyband update for country change
Dmitry Shmidt [Thu, 28 Jun 2012 23:26:07 +0000 (16:26 -0700)]
net: wireless: bcmdhd: Add wiphyband update for country change

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Skip inaccurate wl_construct_reginfo() call
Dmitry Shmidt [Thu, 28 Jun 2012 17:25:25 +0000 (10:25 -0700)]
net: wireless: bcmdhd: Skip inaccurate wl_construct_reginfo() call

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Ignore error if "chanspecs" command is not supported
Dmitry Shmidt [Wed, 20 Jun 2012 17:22:51 +0000 (10:22 -0700)]
net: wireless: bcmdhd: Ignore error if "chanspecs" command is not supported

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Reduce priority for dhd_dpc and watchdog
Dmitry Shmidt [Thu, 14 Jun 2012 18:32:15 +0000 (11:32 -0700)]
net: wireless: bcmdhd: Reduce priority for dhd_dpc and watchdog

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Reload FW in case of constant scan failure
Dmitry Shmidt [Thu, 14 Jun 2012 17:59:25 +0000 (10:59 -0700)]
net: wireless: bcmdhd: Reload FW in case of constant scan failure

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Combined P2P fixes
Dmitry Shmidt [Wed, 13 Jun 2012 18:22:56 +0000 (11:22 -0700)]
net: wireless: bcmdhd: Combined P2P fixes

- Fix p2p scan
- Fix p2p processing for channels 12 and 13
- Fix service discovery

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agoext4: add missing save_error_info() to ext4_error()
Theodore Ts'o [Thu, 31 May 2012 03:03:56 +0000 (23:03 -0400)]
ext4: add missing save_error_info() to ext4_error()

The ext4_error() function is missing a call to save_error_info().
Since this is the function which marks the file system as containing
an error, this oversight (which was introduced in 2.6.36) is quite
significant, and should be backported to older stable kernels with
high urgency.

Change-Id: Ia1eb8d91f37ceb67faf3b79d6bc79b899f1d6bfc
Reported-by: Ken Sumrall <ksumrall@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: ksumrall@google.com
Cc: stable@kernel.org
Signed-off-by: Ken Sumrall <ksumrall@android.com>
12 years agonet: wireless: bcmdhd: Update to version 5.90.195.75
Dmitry Shmidt [Thu, 31 May 2012 21:06:50 +0000 (14:06 -0700)]
net: wireless: bcmdhd: Update to version 5.90.195.75

- Fix false PCB-OVERLAP issue
- Fix simultanious connect request on two P2P devices

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Fix P2P driver crash for MFG firmware
Leslie Yu [Tue, 29 May 2012 22:18:17 +0000 (15:18 -0700)]
net: wireless: bcmdhd: Fix P2P driver crash for MFG firmware

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Make responce waiting uninterruptible
Dmitry Shmidt [Tue, 29 May 2012 22:05:33 +0000 (15:05 -0700)]
net: wireless: bcmdhd: Make responce waiting uninterruptible

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agoUSB: gadget: f_audio_source: Adjust packet timing to reduce glitches
Mike Lockwood [Sun, 27 May 2012 22:41:53 +0000 (15:41 -0700)]
USB: gadget: f_audio_source: Adjust packet timing to reduce glitches

Increase max packet size and clean up timing logic so we can better
recover from not getting an interrupt in time for a SOF.

Signed-off-by: Mike Lockwood <lockwood@google.com>
12 years agousb: gadget: android: Fix product name
Benoit Goby [Tue, 29 May 2012 20:57:27 +0000 (13:57 -0700)]
usb: gadget: android: Fix product name

Product names may contain spaces and scanf %s only matches the 1st word.
Use strlcpy instead.

Change-Id: Ie8703fea9775f7fc17fe615a42597ca3816d36b0
Signed-off-by: Benoit Goby <benoit@android.com>
12 years agonet: wireless: bcmdhd: Fix WPS PBC overlap failure
Neeraj Kumar Garg [Thu, 24 May 2012 19:19:18 +0000 (12:19 -0700)]
net: wireless: bcmdhd: Fix WPS PBC overlap failure

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agousb: gadget: composite: Fix corruption when changing configuration
Benoit Goby [Wed, 16 May 2012 03:44:33 +0000 (20:44 -0700)]
usb: gadget: composite: Fix corruption when changing configuration

Remove the config from the configs list before releasing the spinlock.
Otherwise the other cpu might be processing a SET_CONFIGURATION that
will switch to the configuration that is being released.

Bug: 6521576
Change-Id: Id4da0d0e18ead63e20cb236cd1d3e8e6d116acce
Signed-off-by: Benoit Goby <benoit@android.com>
12 years agonet: wireless: bcmdhd: Ignore signal_pending() while waiting in IOCTL
Dmitry Shmidt [Wed, 16 May 2012 23:50:06 +0000 (16:50 -0700)]
net: wireless: bcmdhd: Ignore signal_pending() while waiting in IOCTL

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Check return value from dhd_dev_init_ioctl()
Dmitry Shmidt [Wed, 16 May 2012 18:26:24 +0000 (11:26 -0700)]
net: wireless: bcmdhd: Check return value from dhd_dev_init_ioctl()

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Fix WARN_ON(!res->pub.channel)
Dmitry Shmidt [Tue, 15 May 2012 20:20:25 +0000 (13:20 -0700)]
net: wireless: bcmdhd: Fix WARN_ON(!res->pub.channel)

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agonet: wireless: bcmdhd: Change singal pending return value from -110 to -4
Dmitry Shmidt [Tue, 15 May 2012 19:22:48 +0000 (12:22 -0700)]
net: wireless: bcmdhd: Change singal pending return value from -110 to -4

- ETIMEDOUT is interpreted as FW is not responding,
  so return EINTR instead

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agoUSB: gadget: f_audio_source: New gadget driver for audio output
Mike Lockwood [Fri, 11 May 2012 16:01:08 +0000 (09:01 -0700)]
USB: gadget: f_audio_source: New gadget driver for audio output

This driver presents a standard USB audio class interface to the host
and an ALSA PCM device to userspace

Signed-off-by: Mike Lockwood <lockwood@google.com>
12 years agoUSB: gadget: f_accessory: Add support for HID input devices
Mike Lockwood [Mon, 26 Mar 2012 18:03:55 +0000 (11:03 -0700)]
USB: gadget: f_accessory: Add support for HID input devices

Signed-off-by: Mike Lockwood <lockwood@google.com>
12 years agoAdd ACCESSORY_SET_AUDIO_MODE control request and ioctl
Mike Lockwood [Fri, 11 May 2012 16:00:40 +0000 (09:00 -0700)]
Add ACCESSORY_SET_AUDIO_MODE control request and ioctl

The control request will be used by the host to enable/disable USB audio
and the ioctl will be used by userspace to read the audio mode

Signed-off-by: Mike Lockwood <lockwood@google.com>
12 years agocpufreq: interactive: fixup trace of string params
Todd Poynor [Fri, 11 May 2012 18:06:09 +0000 (11:06 -0700)]
cpufreq: interactive: fixup trace of string params

Change-Id: Iac47f62437e61b13724afbbf9df1a0729f58f236
Signed-off-by: Todd Poynor <toddpoynor@google.com>
12 years agocpufreq: interactive: restart above_hispeed_delay at each hispeed load
Todd Poynor [Fri, 11 May 2012 06:28:06 +0000 (23:28 -0700)]
cpufreq: interactive: restart above_hispeed_delay at each hispeed load

Change-Id: I2e5b91d45e8806b0ab94ca2301ed671c9af9ab13
Signed-off-by: Todd Poynor <toddpoynor@google.com>
12 years agonet: wireless: bcmdhd: Fix filtering setting in case of P2P
Dmitry Shmidt [Thu, 10 May 2012 20:20:40 +0000 (13:20 -0700)]
net: wireless: bcmdhd: Fix filtering setting in case of P2P

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
12 years agoipv6: check return value for dst_alloc
Madalin Bucur [Mon, 26 Sep 2011 07:04:56 +0000 (07:04 +0000)]
ipv6: check return value for dst_alloc

return value of dst_alloc must be checked before use

Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agonet: check return value for dst_alloc
Madalin Bucur [Mon, 26 Sep 2011 07:04:36 +0000 (07:04 +0000)]
net: check return value for dst_alloc

return value of dst_alloc must be checked before use

Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoMerge commit 'v3.0.31' into android-3.0
Todd Poynor [Tue, 8 May 2012 18:36:40 +0000 (11:36 -0700)]
Merge commit 'v3.0.31' into android-3.0

12 years agoLinux 3.0.31
Greg Kroah-Hartman [Mon, 7 May 2012 16:02:36 +0000 (09:02 -0700)]
Linux 3.0.31

12 years agohfsplus: Fix potential buffer overflows
Greg Kroah-Hartman [Fri, 4 May 2012 19:09:39 +0000 (12:09 -0700)]
hfsplus: Fix potential buffer overflows

commit 6f24f892871acc47b40dd594c63606a17c714f77 upstream.

Commit ec81aecb2966 ("hfs: fix a potential buffer overflow") fixed a few
potential buffer overflows in the hfs filesystem.  But as Timo Warns
pointed out, these changes also need to be made on the hfsplus
filesystem as well.

Reported-by: Timo Warns <warns@pre-sense.de>
Acked-by: WANG Cong <amwang@redhat.com>
Cc: Alexey Khoroshilov <khoroshilov@ispras.ru>
Cc: Miklos Szeredi <mszeredi@suse.cz>
Cc: Sage Weil <sage@newdream.net>
Cc: Eugene Teo <eteo@redhat.com>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Dave Anderson <anderson@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agosched: Fix nohz load accounting -- again!
Peter Zijlstra [Thu, 1 Mar 2012 14:04:46 +0000 (15:04 +0100)]
sched: Fix nohz load accounting -- again!

commit c308b56b5398779cd3da0f62ab26b0453494c3d4 upstream.
[ backported to 3.0 by Kerin Millar <kerframil@gmail.com>]

Various people reported nohz load tracking still being wrecked, but Doug
spotted the actual problem. We fold the nohz remainder in too soon,
causing us to loose samples and under-account.

So instead of playing catch-up up-front, always do a single load-fold
with whatever state we encounter and only then fold the nohz remainder
and play catch-up.

Reported-by: Doug Smythies <dsmythies@telus.net>
Reported-by: LesÅ=82aw Kope=C4=87 <leslaw.kopec@nasza-klasa.pl>
Reported-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-4v31etnhgg9kwd6ocgx3rxl8@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Kerin Millar <kerframil@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agowl1251: fix crash on remove due to leftover work item
Grazvydas Ignotas [Thu, 26 Apr 2012 20:07:44 +0000 (23:07 +0300)]
wl1251: fix crash on remove due to leftover work item

commit 4c1bcdb5a3354b250b82a67549f57ac27a3bb85f upstream.

This driver currently leaves elp_work behind when stopping, which
occasionally results in data corruption because work function ends
up accessing freed memory, typical symptoms of this are various
worker_thread crashes. Fix it by cancelling elp_work.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agowl1251: fix crash on remove due to premature kfree
Grazvydas Ignotas [Thu, 26 Apr 2012 20:07:43 +0000 (23:07 +0300)]
wl1251: fix crash on remove due to premature kfree

commit 328c32f0f85467af5a6c4c3289e168d9ad2555af upstream.

Currently SDIO glue frees it's own structure before calling
wl1251_free_hw(), which in turn calls ieee80211_unregister_hw().
The later call may result in a need to communicate with the chip
to stop it (as it happens now if the interface is still up before
rmmod), which means calls are made back to the glue, resulting in
freed memory access.

Fix this by freeing glue data last.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agortlwifi: Fix oops on unload
Larry Finger [Fri, 20 Apr 2012 02:39:06 +0000 (21:39 -0500)]
rtlwifi: Fix oops on unload

commit 44eb65cfd8da4b9c231238998729e858e963a980 upstream.

Under some circumstances, a PCI-based driver reports the following OOPs:

Mar 19 08:14:35 kvothe kernel: [ 6584.626011] Oops: 0000 [#1] SMP
--snip--
Mar 19 08:14:35 kvothe kernel: [ 6584.626011] Pid: 19627, comm: rmmod
Not tainted 3.2.9-2.fc16.x86_64 #1 LENOVO 05962RU/05962RU
Mar 19 08:14:35 kvothe kernel: [ 6584.626011] RIP:
0010:[<ffffffffa0418d39>]  [<ffffffffa0418d39>]
rtl92ce_get_desc+0x19/0xd0 [rtl8192ce]
--snip--
Mar 19 08:14:35 kvothe kernel: [ 6584.626011] Process rmmod (pid:
19627, threadinfo ffff880050262000, task ffff8801156d5cc0)
Mar 19 08:14:35 kvothe kernel: [ 6584.626011] Stack:
Mar 19 08:14:35 kvothe kernel: [ 6584.626011]  0000000000000002
ffff8801176c2540 ffff880050263ca8 ffffffffa03348e7
Mar 19 08:14:35 kvothe kernel: [ 6584.626011]  0000000000000282
0000000180150014 ffff880050263fd8 ffff8801176c2810
Mar 19 08:14:35 kvothe kernel: [ 6584.626011]  ffff880050263bc8
ffffffff810550e2 00000000000002c0 ffff8801176c0d40
Mar 19 08:14:35 kvothe kernel: [ 6584.626011] Call Trace:
Mar 19 08:14:35 kvothe kernel: [ 6584.626011]  [<ffffffffa03348e7>]
_rtl_pci_rx_interrupt+0x187/0x650 [rtlwifi]
--snip--
Mar 19 08:14:35 kvothe kernel: [ 6584.626011] Code: ff 09 d0 89 07 48
83 c4 08 5b 5d c3 66 0f 1f 44 00 00 55 48 89 e5 53 48 83 ec 08 66 66
66 66 90 40 84 f6 89 d3 74 13 84 d2 75 57 <8b> 07 48 83 c4 08 5b 5d c1
e8 1f c3 0f 1f 00 84 d2 74 ed 80 fa
Mar 19 08:14:35 kvothe kernel: [ 6584.626011] RIP
[<ffffffffa0418d39>] rtl92ce_get_desc+0x19/0xd0 [rtl8192ce]
Mar 19 08:14:35 kvothe kernel: [ 6584.626011]  RSP <ffff880050263b58>
Mar 19 08:14:35 kvothe kernel: [ 6584.626011] CR2: 00000000000006e0
Mar 19 08:14:35 kvothe kernel: [ 6584.646491] ---[ end trace
8636c766dcfbe0e6 ]---

This oops is due to interrupts not being disabled in this particular path.

Reported-by: Dave Airlie <airlied@gmail.com>
Tested-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agomac80211: fix AP mode EAP tx for VLAN stations
Felix Fietkau [Sun, 29 Apr 2012 13:44:16 +0000 (15:44 +0200)]
mac80211: fix AP mode EAP tx for VLAN stations

commit 66f2c99af3d6f2d0aa1120884cf1c60613ef61c0 upstream.

EAP frames for stations in an AP VLAN are sent on the main AP interface
to avoid race conditions wrt. moving stations.
For that to work properly, sta_info_get_bss must be used instead of
sta_info_get when sending EAP packets.
Previously this was only done for cooked monitor injected packets, so
this patch adds a check for tx->skb->protocol to the same place.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoipw2200: Fix race condition in the command completion acknowledge
Stanislav Yakovlev [Thu, 19 Apr 2012 19:55:09 +0000 (15:55 -0400)]
ipw2200: Fix race condition in the command completion acknowledge

commit dd447319895d0c0af423e483d9b63f84f3f8869a upstream.

Driver incorrectly validates command completion: instead of waiting
for a command to be acknowledged it continues execution.  Most of the
time driver gets acknowledge of the command completion in a tasklet
before it executes the next one. But sometimes it sends the next
command before it gets acknowledge for the previous one. In such a
case one of the following error messages appear in the log:

Failed to send SYSTEM_CONFIG: Already sending a command.
Failed to send ASSOCIATE: Already sending a command.
Failed to send TX_POWER: Already sending a command.

After that you need to reload the driver to get it working again.

This bug occurs during roaming (reported by Sam Varshavchik)
https://bugzilla.redhat.com/show_bug.cgi?id=738508
and machine booting (reported by Tom Gundersen and Mads Kiilerich)
https://bugs.archlinux.org/task/28097
https://bugzilla.redhat.com/show_bug.cgi?id=802106

This patch doesn't fix the delay issue during firmware load.
But at least device now works as usual after boot.

Signed-off-by: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoi2c: pnx: Disable clk in suspend
Roland Stigge [Wed, 4 Apr 2012 08:34:37 +0000 (10:34 +0200)]
i2c: pnx: Disable clk in suspend

commit 6c557cfee08751d22aed34840f389b846f0f4508 upstream.

In the driver's suspend function, clk_enable() was used instead of
clk_disable(). This is corrected with this patch.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
[wsa: reworded commit header slightly]
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agolibata: skip old error history when counting probe trials
Lin Ming [Thu, 3 May 2012 14:15:07 +0000 (22:15 +0800)]
libata: skip old error history when counting probe trials

commit 6868225e3e92399068be9a5f1635752d91012ad5 upstream.

Commit d902747("[libata] Add ATA transport class") introduced
ATA_EFLAG_OLD_ER to mark entries in the error ring as cleared.

But ata_count_probe_trials_cb() didn't check this flag and it still
counts the old error history. So wrong probe trials count is returned
and it causes problem, for example, SATA link speed is slowed down from
3.0Gbps to 1.5Gbps.

Fix it by checking ATA_EFLAG_OLD_ER in ata_count_probe_trials_cb().

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agohwmon: (coretemp) fix oops on cpu unplug
Kirill A. Shutemov [Mon, 30 Apr 2012 13:18:01 +0000 (09:18 -0400)]
hwmon: (coretemp) fix oops on cpu unplug

commit b704871124b477807966f06789c2b32f2de58bf7 upstream.

coretemp tries to access core_data array beyond bounds on cpu unplug if
core id of the cpu if more than NUM_REAL_CORES-1.

BUG: unable to handle kernel NULL pointer dereference at 000000000000013c
IP: [<ffffffffa00159af>] coretemp_cpu_callback+0x93/0x1ba [coretemp]
PGD 673e5a067 PUD 66e9b3067 PMD 0
Oops: 0000 [#1] SMP
CPU 79
Modules linked in: sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf bnep bluetooth rfkill ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter nf_conntrack_ipv4 nf_defrag_ipv4 ip6_tables xt_state nf_conntrack coretemp crc32c_intel asix tpm_tis pcspkr usbnet iTCO_wdt i2c_i801 microcode mii joydev tpm i2c_core iTCO_vendor_support tpm_bios i7core_edac igb ioatdma edac_core dca megaraid_sas [last unloaded: oprofile]

Pid: 3315, comm: set-cpus Tainted: G        W    3.4.0-rc5+ #2 QCI QSSC-S4R/QSSC-S4R
RIP: 0010:[<ffffffffa00159af>]  [<ffffffffa00159af>] coretemp_cpu_callback+0x93/0x1ba [coretemp]
RSP: 0018:ffff880472fb3d48  EFLAGS: 00010246
RAX: 0000000000000124 RBX: 0000000000000034 RCX: 00000000ffffffff
RDX: 0000000000000000 RSI: 0000000000000046 RDI: 0000000000000246
RBP: ffff880472fb3d88 R08: ffff88077fcd36c0 R09: 0000000000000001
R10: ffffffff8184bc48 R11: 0000000000000000 R12: ffff880273095800
R13: 0000000000000013 R14: ffff8802730a1810 R15: 0000000000000000
FS:  00007f694a20f720(0000) GS:ffff88077fcc0000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 000000000000013c CR3: 000000067209b000 CR4: 00000000000007e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process set-cpus (pid: 3315, threadinfo ffff880472fb2000, task ffff880471fa0000)
Stack:
 ffff880277b4c308 0000000000000003 ffff880472fb3d88 0000000000000005
 0000000000000034 00000000ffffffd1 ffffffff81cadc70 ffff880472fb3e14
 ffff880472fb3dc8 ffffffff8161f48d ffff880471fa0000 0000000000000034
Call Trace:
 [<ffffffff8161f48d>] notifier_call_chain+0x4d/0x70
 [<ffffffff8107f1be>] __raw_notifier_call_chain+0xe/0x10
 [<ffffffff81059d30>] __cpu_notify+0x20/0x40
 [<ffffffff815fa251>] _cpu_down+0x81/0x270
 [<ffffffff815fa477>] cpu_down+0x37/0x50
 [<ffffffff815fd6a3>] store_online+0x63/0xc0
 [<ffffffff813c7078>] dev_attr_store+0x18/0x30
 [<ffffffff811f02cf>] sysfs_write_file+0xef/0x170
 [<ffffffff81180443>] vfs_write+0xb3/0x180
 [<ffffffff8118076a>] sys_write+0x4a/0x90
 [<ffffffff816236a9>] system_call_fastpath+0x16/0x1b
Code: 48 c7 c7 94 60 01 a0 44 0f b7 ac 10 ac 00 00 00 31 c0 e8 41 b7 5f e1 41 83 c5 02 49 63 c5 49 8b 44 c4 10 48 85 c0 74 56 45 31 ff <39> 58 18 75 4e eb 1f 49 63 d7 4c 89 f7 48 89 45 c8 48 6b d2 28
RIP  [<ffffffffa00159af>] coretemp_cpu_callback+0x93/0x1ba [coretemp]
 RSP <ffff880472fb3d48>
CR2: 000000000000013c

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agohwmon: (coretemp) Increase CPU core limit
Guenter Roeck [Tue, 1 May 2012 15:15:42 +0000 (08:15 -0700)]
hwmon: (coretemp) Increase CPU core limit

commit bdc71c9a87b898e4c380c23b2e3e18071312ecde upstream.

CPU core ID is used to index the core_data[] array. The core ID is, however, not
sequential; 10-core CPUS can have a core ID as high as 25. Increase the limit to
32 to be able to deal with current CPUs.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoefivars: Improve variable validation
Matthew Garrett [Thu, 3 May 2012 20:50:46 +0000 (16:50 -0400)]
efivars: Improve variable validation

commit 54b3a4d311c98ad94b737802a8b5f2c8c6bfd627 upstream.

Ben Hutchings pointed out that the validation in efivars was inadequate -
most obviously, an entry with size 0 would server as a DoS against the
kernel. Improve this based on his suggestions.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoefi: Validate UEFI boot variables
Matthew Garrett [Mon, 30 Apr 2012 20:11:30 +0000 (16:11 -0400)]
efi: Validate UEFI boot variables

commit fec6c20b570bcf541e581fc97f2e0cbdb9725b98 upstream.

A common flaw in UEFI systems is a refusal to POST triggered by a malformed
boot variable. Once in this state, machines may only be restored by
reflashing their firmware with an external hardware device. While this is
obviously a firmware bug, the serious nature of the outcome suggests that
operating systems should filter their variable writes in order to prevent
a malicious user from rendering the machine unusable.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoefivars: fix warnings when CONFIG_PSTORE=n
Tony Luck [Tue, 2 Aug 2011 22:08:30 +0000 (15:08 -0700)]
efivars: fix warnings when CONFIG_PSTORE=n

commit b728a5c806fb36f9adebf2a862bbd015e074afca upstream.

drivers/firmware/efivars.c:161: warning: ‘utf16_strlen’ defined but not used
utf16_strlen() is only used inside CONFIG_PSTORE - make this "static inline"
to shut the compiler up [thanks to hpa for the suggestion].

drivers/firmware/efivars.c:602: warning: initialization from incompatible pointer type
Between v1 and v2 of this patch series we decided to make the "part" number
unsigned - but missed fixing the stub version of efi_pstore_write()

Acked-by: Matthew Garrett <mjg@redhat.com>
Acked-by: Mike Waychison <mikew@google.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
[took the static part of the patch, not the pstore part, for 3.0-stable,
to fix the compiler warning we had - gregkh]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoefivars: String functions
Mike Waychison [Thu, 21 Jul 2011 20:57:57 +0000 (16:57 -0400)]
efivars: String functions

commit a2940908391f3cee72e38769b30e829b22742b5b upstream.

Fix the string functions in the efivars driver to be called utf16_*
instead of utf8_* as the encoding is utf16, not utf8.

As well, rename utf16_strlen to utf16_strnlen as it takes a maxlength
argument and the name should be consistent with the standard C function
names.  utf16_strlen is still provided for convenience in a subsequent
patch.

Signed-off-by: Mike Waychison <mikew@google.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoefi: Add new variable attributes
Matthew Garrett [Mon, 30 Apr 2012 20:11:29 +0000 (16:11 -0400)]
efi: Add new variable attributes

commit 41b3254c93acc56adc3c4477fef7c9512d47659e upstream.

More recent versions of the UEFI spec have added new attributes for
variables. Add them.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 years agoSCSI: libsas: fix false positive 'device attached' conditions
Dan Williams [Tue, 20 Mar 2012 17:50:27 +0000 (10:50 -0700)]
SCSI: libsas: fix false positive 'device attached' conditions

commit 7d1d865181185bdf1316d236b1b4bd02c9020729 upstream.

Normalize phy->attached_sas_addr to return a zero-address in the case
when device-type == NO_DEVICE or the linkrate is invalid to handle
expanders that put non-zero sas addresses in the discovery response:

 sas: ex 5001b4da000f903f phy02:U:0 attached: 0100000000000000 (no device)
 sas: ex 5001b4da000f903f phy01:U:0 attached: 0100000000000000 (no device)
 sas: ex 5001b4da000f903f phy03:U:0 attached: 0100000000000000 (no device)
 sas: ex 5001b4da000f903f phy00:U:0 attached: 0100000000000000 (no device)

Reported-by: Andrzej Jakowski <andrzej.jakowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>