Commit Graph

648417 Commits

Author SHA1 Message Date
Bin Liu 6def85a396 usb: musb: core: add clear_ep_rxintr() to musb_platform_ops
During dma teardown for dequque urb, if musb load is high, musb might
generate bogus rx ep interrupt even when the rx fifo is flushed. In such
case any of the follow log messages could happen.

	musb_host_rx 1853: BOGUS RX2 ready, csr 0000, count 0

	musb_host_rx 1936: RX3 dma busy, csr 2020

As mentioned in the current inline comment, clearing ep interrupt in the
teardown path avoids the bogus interrupt.

Clearing ep interrupt is platform dependent, so this patch adds a
platform callback to allow glue driver to clear the ep interrupt.

This bug seems to be existing since the initial driver for musb support,
but I only validated the fix back to v4.1, so only cc stable for v4.1+.

cc: stable@vger.kernel.org # 4.1+
Signed-off-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-05 19:18:05 +01:00
Eric S. Stone 457c005aaf staging: gdm724x: update HCI structs with new bitwise types
Update the driver's HCI structs and associated endian-converter
functions with new driver-specific bitwise types. The new types
encourage correct endian-handling within the driver by triggering
sparse warnings when mixing with other types. The driver's
endian-converters provide correct and warning-free conversions.

Driver-specific bitwise types are used instead of the standard
endian-specific types because the attached device can be of either
endian. This is also why the driver has its own endian-conversion
functions, which consider endianness of both the cpu and the attached
device.

Introducing the new types to the converters fixes the sparse warnings:

CHECK   drivers/staging/gdm724x/gdm_endian.c
drivers/staging/gdm724x/gdm_endian.c:28:24: warning: incorrect type in return expression (different base types)
drivers/staging/gdm724x/gdm_endian.c:28:24:    expected unsigned short
drivers/staging/gdm724x/gdm_endian.c:28:24:    got restricted __le16 [usertype] <noident>
drivers/staging/gdm724x/gdm_endian.c:30:24: warning: incorrect type in return expression (different base types)
drivers/staging/gdm724x/gdm_endian.c:30:24:    expected unsigned short
drivers/staging/gdm724x/gdm_endian.c:30:24:    got restricted __be16 [usertype] <noident>
drivers/staging/gdm724x/gdm_endian.c:36:24: warning: cast to restricted __le16
drivers/staging/gdm724x/gdm_endian.c:38:24: warning: cast to restricted __be16
drivers/staging/gdm724x/gdm_endian.c:44:24: warning: incorrect type in return expression (different base types)
drivers/staging/gdm724x/gdm_endian.c:44:24:    expected unsigned int
drivers/staging/gdm724x/gdm_endian.c:44:24:    got restricted __le32 [usertype] <noident>
drivers/staging/gdm724x/gdm_endian.c:46:24: warning: incorrect type in return expression (different base types)
drivers/staging/gdm724x/gdm_endian.c:46:24:    expected unsigned int
drivers/staging/gdm724x/gdm_endian.c:46:24:    got restricted __be32 [usertype] <noident>
drivers/staging/gdm724x/gdm_endian.c:52:24: warning: cast to restricted __le32
drivers/staging/gdm724x/gdm_endian.c:54:24: warning: cast to restricted __be32

Signed-off-by: Eric S. Stone <esstone@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-05 18:50:05 +01:00
Ivan Safonov 64cd405ac9 staging:r8188eu: eleminate recovery attemp using skb_clone after netdev_alloc_skb fail
It is wrong to create new skb using skb_clone instead netdev_alloc_skb,
because buffer data will be changed later.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-05 18:50:05 +01:00
Ivan Safonov 80c96e08c4 staging:r8188eu: remove unused WIFI_MP_*STATE and WIFI_MP_CTX* definitions
fw_state member of struct mlme_priv never obtain WIFI_MP_STATE value,
so code only for (fw_state == WIFI_MP_STATE) is dead.
Remove it, WIFI_MP_*STATE and WIFI_MP_CTX* definitions.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-05 18:50:05 +01:00
Ivan Safonov c3747e003f staging:r8188eu: remove (NDEV|ADPT)_(FMT|ARG) definitions
(NDEV|ADPT)_(FMT|ARG) definitions does not used. Remove it.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-05 18:50:05 +01:00
Ivan Safonov e84741a938 staging:r8188eu: remove rtw_update_mem_stat definition
rtw_update_mem_stat definition does not used. Remove it.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-05 18:50:05 +01:00
Ivan Safonov c27fb88256 staging:r8188eu: remove RTW_STATUS_CODE()
RTW_STATUS_CODE() does not used. Remove it.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-05 18:50:05 +01:00
David Binder 746fb137c1 staging: unisys: visorbus: visorchipset.c: Don't check for more than PAGE_SIZE length
Since a sysfs entry is allocated 1 page of memory (4096 bytes) by default,
there is no need to enforce this limit in the driver. This patch corrects
visorbus/visorchipset.c.

Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-05 18:48:03 +01:00
David Binder 7a41385e68 staging: unisys: visorbus: Don't check for more than PAGE_SIZE length in visorbus
Since a sysfs entry is allocated 1 page of memory (4096 bytes) by default,
there is no need to enforce this limit in the driver. This patch corrects
visorbus/visorbus_main.c.

Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-05 18:48:03 +01:00
Galo Navarro 401579c22c staging: rtl8188eu: fix incorrect ERROR tags from logs
Several lifecycle events in the rtl8188eu driver are logged using the
DBG_88E_LEVEL macro from rtw_debug.h, which is tagged as ERROR
regardless of the actual level.  Below are dmesg excerpts after loading
and unloading the module, the messages are misleading as there was no
error.

    [517434.916239] usbcore: registered new interface driver r8188eu
    [517435.680653] R8188EU: ERROR indicate disassoc
    [517437.122606] R8188EU: ERROR assoc success
    [517797.735611] usbcore: deregistering interface driver r8188eu
    [517797.736069] R8188EU: ERROR indicate disassoc

Remove the ERROR prefix from the logs.  After the patch, logs are:

    [517949.873976] usbcore: registered new interface driver r8188eu
    [517950.592845] R8188EU: indicate disassoc
    [517951.993973] R8188EU: assoc success
    [521778.784448] usbcore: deregistering interface driver r8188eu
    [521778.784838] R8188EU: indicate disassoc

Signed-off-by: Galo Navarro <anglorvaroa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-05 18:48:03 +01:00
Ramiro Oliveira cbe50fc432 staging: most: change dma_buf variable to __le16
dma_buf is being cast to __le16 *, but it was defined as u16 *.
sparse reported this error as:
drivers/staging/most/hdm-usb/hdm_usb.c:158:16: warning: cast to restricted
__le16

This patch changes dma_buf from u16 to __le16.

Signed-off-by: Ramiro Oliveira <Ramiro.Oliveira@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-05 18:48:03 +01:00
Scott Matheina c887e69d90 staging:iio:addac Fixes Alignment should match open parenthesis
Fixes style issue where Alignment doesn't match open parenthesis

Signed-off-by: Scott Matheina <scott@matheina.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-05 18:42:15 +01:00
Gustavo A. R. Silva 4ee5a460a3 Staging: lustre: lustre: lmv: Compress return logic into one line.
Simplify return logic to avoid unnecessary variable assignments.
These issues were detected using Coccinelle and the following semantic patch:

@@
local idexpression ret;
expression e;
@@

-ret =
+return
     e;
-return ret;

Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-05 18:42:15 +01:00
Luca Ceresoli e1d7149832 staging: rtl8188eu: remove unused function _linked_rx_signal_strehgth_display
Not referenced anymore since commit 9fe7b29c6c ("staging: rtl8188eu:
remove unused field bRxRSSIDisplay in struct adapter").

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ivan Safonov <insafonov@gmail.com>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-05 18:42:15 +01:00
Nicholas Piggin 9e3596b0c6 kbuild: initramfs cleanup, set target from Kconfig
Rather than keep a list of all possible compression types in the
Makefile, set the target explicitly from Kconfig.

Reviewed-by: Francisco Blas Izquierdo Riera (klondike) <klondike@klondike.es>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-01-05 09:40:16 -08:00
Nicholas Piggin ae30ab4cd7 kbuild: initramfs fix dependency checking for compressed target
When using initramfs compression, the data file compression suffix
gets quotes pulled in from Kconfig, e.g., initramfs_data.cpio".gz"
which make does not match a target and causes rebuild.

Fix this by filtering out quotes from the Kconfig string.

Fixes: 35e669e1a2 ("initramfs: select builtin initram compression algorithm on KConfig instead of Makefile")
Reviewed-by: Francisco Blas Izquierdo Riera (klondike) <klondike@klondike.es>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-01-05 09:40:16 -08:00
Emmanuil Chatzipetru 588bfea910 staging: greybus: log: Fix line over 80 characters.
Fix coding style issue caught by checkpatch.pl related to the following
warning:
	- CHECK: WARNING: line over 80 characters
This is done by dropping a redundant cast and by replacing the format specifier
in dev_err(); to "%zu" instead of "%d", in order to silence the warnings of the
compiler.

Also, while at it, drop the redundant cast in the comparison as well to maintain
consistency.

Signed-off-by: Emmanuil Chatzipetru <chatzi.emanuel@gmail.com>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-05 18:22:20 +01:00
Emmanuil Chatzipetru 8a983614ca staging: greybus: audio_topology: Fix spaces between operator and string
Fix coding style issue caught by checkpatch.pl related to the following
warning:
	- "CHECK: spaces preferred around that '*' (ctx:VxV) "

Signed-off-by: Emmanuil Chatzipetru <chatzi.emanuel@gmail.com>
Acked-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-05 18:22:20 +01:00
Greg Kroah-Hartman c8d204b38a USB-serial fixes for v4.10-rc3
These fixes address a number of long-standing issues in various
 USB-serial drivers which would lead to crashes should a malicious device
 lack the expected endpoints.
 
 Included are also a few related fixes, and a couple of unrelated ones
 that were found during my survey (e.g. a memleak and a
 sleep-while-atomic).
 
 A compiler warning revealed an error-handling issue in the new f81534
 driver which is also fixed.
 
 Signed-off-by: Johan Hovold <johan@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQIuBAABCAAYBQJYbludERxqb2hhbkBrZXJuZWwub3JnAAoJEEEN5E/e4bSV9TsP
 /0ksvJrvpRxqCN5WWgEm5pb4kH/Cq8KPtGAVraAyC7+fVOTab++33ehEb3BxEDQN
 53fQhfPPuHP98Fkp52CtoKbxJNkpmojTp/kkI9QTnnRdujAe9XURHrr1KCBB4+Ve
 Wg6uCOSqSSbOxlp8Qp/vY5yiaev6CFAFZ6Gn4tG8J8chQwpeK8jk2AX0S2+RcCOv
 ICyAwOFJ7GgV/DSDqPLXviFzLEOexMD/9us9eRSF1OiP5zv7s+m/f0hrsZGnfMhS
 B5D+3z28PAMED1U/OkVXCLRO5jdZDOF8O93t4QPbayliQEvY0SMNwpTj/fRuhzar
 EBHUszcYPMcmPqODzRDqBr+e6yoqiLGj98BJqFI2FDg/AXNCKdOWHmCmmBQ27ijr
 YI2MfpbhnJ9xtXsfAaPutd9D27TtJvVMQ1gvPNmEtn+ic+BNeEnWKwCmeYoxhn4O
 j6ZcZxRzTZj1JA8olbKCBQ/kzrnW+aQj3IPxoFW3oqgp9KwhV4t946dQdd1q8jq5
 cs8uBWQe+jofHxTqx9DN4i3LPFNB93OBl5zue69i11KgKem2GPKfK1a3y9k1P7Eg
 dBQOTWTaiqH2Asz8QYHVkAz9wq3K92QBdwPANZodrEedDpgJ5/+JeaXKfsIuMfXa
 EhBu79t6wDrF+x9yuKnWDaWzSTvclrqhFXe9bt5/zZC6
 =eRM2
 -----END PGP SIGNATURE-----

Merge tag 'usb-serial-4.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus

Johan writes:

USB-serial fixes for v4.10-rc3

These fixes address a number of long-standing issues in various
USB-serial drivers which would lead to crashes should a malicious device
lack the expected endpoints.

Included are also a few related fixes, and a couple of unrelated ones
that were found during my survey (e.g. a memleak and a
sleep-while-atomic).

A compiler warning revealed an error-handling issue in the new f81534
driver which is also fixed.

Signed-off-by: Johan Hovold <johan@kernel.org>
2017-01-05 17:41:16 +01:00
Rafael J. Wysocki 696c7f8e03 ACPI / DMAR: Avoid passing NULL to acpi_put_table()
Linus reported that commit 174cc7187e "ACPICA: Tables: Back port
acpi_get_table_with_size() and early_acpi_os_unmap_memory() from
Linux kernel" added a new warning on his desktop system:

 ACPI Warning: Table ffffffff9fe6c0a0, Validation count is zero before decrement

which turns out to come from the acpi_put_table() in
detect_intel_iommu().

This happens if the DMAR table is not present in which case NULL is
passed to acpi_put_table() which doesn't check against that and
attempts to handle it regardless.

For this reason, check the pointer passed to acpi_put_table()
before invoking it.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Tested-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Fixes: 6b11d1d677 ("ACPI / osl: Remove acpi_get_table_with_size()/early_acpi_os_unmap_memory() users")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-01-05 15:10:52 +01:00
Jan Dakinevich 69130ea1e6 KVM: VMX: remove duplicated declaration
Declaration of VMX_VPID_EXTENT_SUPPORTED_MASK occures twice in the code.
Probably, it was happened after unsuccessful merge.

Signed-off-by: Jan Dakinevich <jan.dakinevich@gmail.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
2017-01-05 15:08:48 +01:00
James Hogan 32eb12a6c1 KVM: MIPS: Flush KVM entry code from icache globally
Flush the KVM entry code from the icache on all CPUs, not just the one
that built the entry code.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Cc: <stable@vger.kernel.org> # 3.16.x-
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
2017-01-05 14:56:32 +01:00
James Hogan 4c881451d3 KVM: MIPS: Don't clobber CP0_Status.UX
On 64-bit kernels, MIPS KVM will clear CP0_Status.UX to prevent the
guest (running in user mode) from accessing the 64-bit memory segments.
However the previous value of CP0_Status.UX is never restored when
exiting from the guest.

If the user process uses 64-bit addressing (the n64 ABI) this can result
in address error exceptions from the kernel if it needs to deliver a
signal before returning to user mode, as the kernel will need to write a
sigframe to high user addresses on the user stack which are disallowed
by CP0_Status.UX=0.

This is fixed by explicitly setting SX and UX again when exiting from
the guest, and explicitly clearing those bits when returning to the
guest. Having the SX and UX bits set when handling guest exits (rather
than only when exiting to userland) will be helpful when we support VZ,
since we shouldn't need to directly read or write guest memory, so it
will be valid for cache management IPIs to access host user addresses.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Cc: <stable@vger.kernel.org> # 4.8.x-
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
2017-01-05 14:56:32 +01:00
Michal Marek c7858bf16c asm-prototypes: Clear any CPP defines before declaring the functions
The asm-prototypes.h file is used to provide dummy function declarations
for genksyms, when processing asm files with EXPORT_SYMBOL. Make sure
that any architecture defines get out of our way. x86 currently has an
issue with memcpy on 64bit with CONFIG_KMEMCHECK=y and with
memset/__memset on 32bit:

	$ cat init/test.c
	#include <asm/asm-prototypes.h>
	$ make -s init/test.o
	In file included from ./arch/x86/include/asm/string.h:4:0,
			 from ./include/linux/string.h:18,
			 from ./include/linux/bitmap.h:8,
			 from ./include/linux/cpumask.h:11,
			 from ./arch/x86/include/asm/cpumask.h:4,
			 from ./arch/x86/include/asm/msr.h:10,
			 from ./arch/x86/include/asm/processor.h:20,
			 from ./arch/x86/include/asm/cpufeature.h:4,
			 from ./arch/x86/include/asm/thread_info.h:52,
			 from ./include/linux/thread_info.h:25,
			 from ./arch/x86/include/asm/preempt.h:6,
			 from ./include/linux/preempt.h:59,
			 from ./include/linux/spinlock.h:50,
			 from ./include/linux/seqlock.h:35,
			 from ./include/linux/time.h:5,
			 from ./include/uapi/linux/timex.h:56,
			 from ./include/linux/timex.h:56,
			 from ./include/linux/sched.h:19,
			 from ./include/linux/uaccess.h:4,
			 from ./arch/x86/include/asm/asm-prototypes.h:2,
			 from init/test.c:1:
	./arch/x86/include/asm/string_64.h:52:47: error: expected declaration specifiers or ‘...’ before ‘(’ token
	 #define memcpy(dst, src, len) __inline_memcpy((dst), (src), (len))
	 ./include/asm-generic/asm-prototypes.h:6:14: note: in expansion of macro ‘memcpy’
	  extern void *memcpy(void *, const void *, __kernel_size_t);

						       ^
	...

During real build, this manifests itself by genksyms segfaulting.

Fixes: 334bb77387 ("x86/kbuild: enable modversions for symbols exported from asm")
Reported-and-tested-by: Borislav Petkov <bp@alien8.de>
Cc: Adam Borowski <kilobyte@angband.pl>
Signed-off-by: Michal Marek <mmarek@suse.com>
2017-01-05 12:57:42 +01:00
Takashi Sakamoto e4f34cf6d5 Revert "ALSA: firewire-lib: change structure member with proper type"
This reverts commit 6b7e95d133. This commit
is based on a concern about value of the given parameter. It's expected
to be ORed value with some enumeration-constants, thus often it can not be
one of the enumeration-constants. I understood that this is out of
specification and causes implementation-dependent issues.

In C language specification, enumerated type can be interpreted as an
integer type, in which all of enumeration-constants in corresponding
enumerator-list can be stored. Implementations can select one of char,
signed int and unsigned int as its type, and this selection is
implementation-dependent.

In GCC, a signed integer is selected when at least one of
enumeration-constants has negative value, else an unsigned integer is
selected. This behaviour can be switched by -fshort-enums to short type.
Anyway, the type can be decided after scanning all of
enumeration-constants.

Totally, there's no rules to constrain the value of enumerated type to
be one of enumeration-constants. In short, in enumerated type, decision
of actual type for the type is the most important and
enumeration-constants are just used for the decision, thus it's permitted
to have an integer value in a range of enumeration-constants. In our case,
actual type for the type is currently deterministic to be either char or
unsigned int. Under GCC, it's unsigned int.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-05 08:39:47 +01:00
Ioan-Adrian Ratiu 13a6c8328e ALSA: usb-audio: test EP_FLAG_RUNNING at urb completion
Testing EP_FLAG_RUNNING in snd_complete_urb() before running the completion
logic allows us to save a few cpu cycles by returning early, skipping the
pending urb in case the stream was stopped; the stop logic handles the urb
and sets the completion callbacks to NULL.

Signed-off-by: Ioan-Adrian Ratiu <adi@adirat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-05 07:35:17 +01:00
Ioan-Adrian Ratiu 1d0f953086 ALSA: usb-audio: Fix irq/process data synchronization
Commit 16200948d8 ("ALSA: usb-audio: Fix race at stopping the stream") was
incomplete causing another more severe kernel panic, so it got reverted.
This fixes both the original problem and its fallout kernel race/crash.

The original fix is to move the endpoint member NULL clearing logic inside
wait_clear_urbs() so the irq triggering the urb completion doesn't call
retire_capture/playback_urb() after the NULL clearing and generate a panic.

However this creates a new race between snd_usb_endpoint_start()'s call
to wait_clear_urbs() and the irq urb completion handler which again calls
retire_capture/playback_urb() leading to a new NULL dereference.

We keep the EP deactivation code in snd_usb_endpoint_start() because
removing it will break the EP reference counting (see [1] [2] for info),
however we don't need the "can_sleep" mechanism anymore because a new
function was introduced (snd_usb_endpoint_sync_pending_stop()) which
synchronizes pending stops and gets called inside the pcm prepare callback.

It also makes sense to remove can_sleep because it was also removed from
deactivate_urbs() signature in [3] so we benefit from more simplification.

[1] commit 015618b90 ("ALSA: snd-usb: Fix URB cancellation at stream start")
[2] commit e9ba389c5 ("ALSA: usb-audio: Fix scheduling-while-atomic bug in PCM capture stream")
[3] commit ccc1696d5 ("ALSA: usb-audio: simplify endpoint deactivation code")

Fixes: f8114f8583 ("Revert "ALSA: usb-audio: Fix race at stopping the stream"")

Signed-off-by: Ioan-Adrian Ratiu <adi@adirat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-05 07:35:00 +01:00
Linus Torvalds e02003b515 Contained in this update:
- Fixes for crashes and double-cleanup errors
 - XFS maintainership handover
 - Fix to prevent absurdly large block reservations
 - Fix broken sysfs getter/setters
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCgAGBQJYbH10AAoJEPh/dxk0SrTrozkQAIo1ikGMKI0x52izCJyKA+HP
 gUfqqFnFDOsz0pWBDhRMBBGXbQlgU6uPRMicTdkNSRq3BnKPyfC7EK8WkXlOGT8A
 JGQhz96sfr4gShuo4lul2nhgfThOyL7M3Vu+xHL7wgrrOV1Y4Haz2m2FKYzNentj
 2ca2WeNCcuEQLdWwtwkeOnsjnC2gV9cA5pRsx59rktr/t6fU1Q+AcBSjpwDX43op
 cQ0uTqiBB51pWe2tbw+VHSsYzyakkjsNsiYCZNOghN+p/5g4QpgT7LgiO9r5CVvu
 UhAXv6285K4pVsD7cIy2yHvSFbYNz1khM1Tvv26npg72NoQxMXhxAaPkke03u2lT
 4nakgqLpxybrrnviVsJy2VbnmVYN5mcXSV2XTmRdAtxZmrW9C6H2PCs9pQYSV1Ji
 H6UT7kqusqp4ceQUBb5dtFCaUndNGnLxKDrmNOz/It7PPpI0zSRMiv+IC+qrQ/ci
 oEExMUtRLLah5zXOXQej2IchZmP2SBXm/a2JhmQywTIyLiSPoDwKsNET9zT4CiXw
 CHQj3spGh8uE7rh0QbujWjD7odE1IWDvOZ9Zh5vXVrwqTIeVOlxjfBqO/9J0z2Ak
 z7WpRrQ2IhWMwD6pHg0oDUD9oB02LxnW24telQs35wgqgdZm5TfG6BaiKutzA7KH
 nVlR22SQ4m+eTD8+IFMO
 =TgC5
 -----END PGP SIGNATURE-----

Merge tag 'xfs-for-linus-4.10-rc3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux

Pull xfs fixes from Darrick Wong:

 - fixes for crashes and double-cleanup errors

 - XFS maintainership handover

 - fix to prevent absurdly large block reservations

 - fix broken sysfs getter/setters

* tag 'xfs-for-linus-4.10-rc3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
  xfs: fix max_retries _show and _store functions
  xfs: update MAINTAINERS
  xfs: fix crash and data corruption due to removal of busy COW extents
  xfs: use the actual AG length when reserving blocks
  xfs: fix double-cleanup when CUI recovery fails
2017-01-04 18:33:35 -08:00
Hoan Tran e11b6293a8 cpufreq: dt: Add support for APM X-Gene 2
Add the compatible string for supporting the generic device tree cpufreq-dt
driver on APM's X-Gene 2 SoC.

Signed-off-by: Hoan Tran <hotran@apm.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-01-05 00:27:51 +01:00
Linus Torvalds 4cf184638b Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller:

 1) stmmac_drv_probe() can race with stmmac_open() because we register
    the netdevice too early. Fix from Florian Fainelli.

 2) UFO handling in __ip6_append_data() and ip6_finish_output() use
    different tests for deciding whether a frame will be fragmented or
    not, put them in sync. Fix from Zheng Li.

 3) The rtnetlink getstats handlers need to validate that the netlink
    request is large enough, fix from Mathias Krause.

 4) Use after free in mlx4 driver, from Jack Morgenstein.

 5) Fix setting of garbage UID value in sockets during setattr() calls,
    from Eric Biggers.

 6) Packet drop_monitor doesn't format the netlink messages properly
    such that nlmsg_next fails to work, fix from Reiter Wolfgang.

 7) Fix handling of wildcard addresses in l2tp lookups, from Guillaume
    Nault.

 8) __skb_flow_dissect() can crash on pptp packets, from Ian Kumlien.

 9) IGMP code doesn't reset group query timers properly, from Michal
    Tesar.

10) Fix overzealous MAIN/LOCAL route table combining in ipv4, from
    Alexander Duyck.

11) vxlan offload check needs to be more strict in be2net driver, from
    Sabrina Dubroca.

12) Moving l3mdev to packet hooks lost RX stat counters unintentionally,
    fix from David Ahern.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (52 commits)
  sh_eth: enable RX descriptor word 0 shift on SH7734
  sfc: don't report RX hash keys to ethtool when RSS wasn't enabled
  dpaa_eth: Initialize CGR structure before init
  dpaa_eth: cleanup after init_phy() failure
  net: systemport: Pad packet before inserting TSB
  net: systemport: Utilize skb_put_padto()
  LiquidIO VF: s/select/imply/ for PTP_1588_CLOCK
  libcxgb: fix error check for ip6_route_output()
  net: usb: asix_devices: add .reset_resume for USB PM
  net: vrf: Add missing Rx counters
  drop_monitor: consider inserted data in genlmsg_end
  benet: stricter vxlan offloading check in be_features_check
  ipv4: Do not allow MAIN to be alias for new LOCAL w/ custom rules
  net: macb: Updated resource allocation function calls to new version of API.
  net: stmmac: dwmac-oxnas: use generic pm implementation
  net: stmmac: dwmac-oxnas: fix fixed-link-phydev leaks
  net: stmmac: dwmac-oxnas: fix of-node leak
  Documentation/networking: fix typo in mpls-sysctl
  igmp: Make igmp group member RFC 3376 compliant
  flow_dissector: Update pptp handling to avoid null pointer deref.
  ...
2017-01-04 14:14:53 -08:00
Sergei Shtylyov 71eae1ca77 sh_eth: enable RX descriptor word 0 shift on SH7734
The RX descriptor word 0 on SH7734 has the RFS[9:0] field in bits 16-25
(bits  0-15 usually used for that are occupied by the packet checksum).
Thus  we need to set the 'shift_rd0'  field in the SH7734 SoC data...

Fixes: f0e81fecd4 ("net: sh_eth: Add support SH7734")
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-01-04 16:12:14 -05:00
Takashi Iwai c7efff9284 ALSA: hda - Apply asus-mode8 fixup to ASUS X71SL
Although the old quirk table showed ASUS X71SL with ALC663 codec being
compatible with asus-mode3 fixup, the bugzilla reporter explained that
asus-model8 fits better for the dual headphone controls.  So be it.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=191781
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-01-04 21:38:16 +01:00
Paul Gortmaker c6ef7fd40e vfio-mdev: fix non-standard ioctl return val causing i386 build fail
What appears to be a copy and paste error from the line above gets
the ioctl a ssize_t return value instead of the traditional "int".

The associated sample code used "long" which meant it would compile
for x86-64 but not i386, with the latter failing as follows:

  CC [M]  samples/vfio-mdev/mtty.o
samples/vfio-mdev/mtty.c:1418:20: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
  .ioctl          = mtty_ioctl,
                    ^
samples/vfio-mdev/mtty.c:1418:20: note: (near initialization for ‘mdev_fops.ioctl’)
cc1: some warnings being treated as errors

Since in this case, vfio is working with struct file_operations; as such:

    long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
    long (*compat_ioctl) (struct file *, unsigned int, unsigned long);

...and so here we just standardize on long vs. the normal int that user
space typically sees and documents as per "man ioctl" and similar.

Fixes: 9d1a546c53 ("docs: Sample driver to demonstrate how to use Mediated device framework.")
Cc: Kirti Wankhede <kwankhede@nvidia.com>
Cc: Neo Jia <cjia@nvidia.com>
Cc: kvm@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2017-01-04 13:22:38 -07:00
Edward Cree 4fdda95893 sfc: don't report RX hash keys to ethtool when RSS wasn't enabled
If we failed to set up RSS on EF10 (e.g. because firmware declared
 RX_RSS_LIMITED), ethtool --show-nfc $dev rx-flow-hash ... should report
 no fields, rather than confusingly reporting what fields we _would_ be
 hashing on if RSS was working.

Fixes: dcb4123cbe ("sfc: disable RSS when unsupported")
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-01-04 14:18:19 -05:00
David S. Miller aa9773be2a Merge branch 'dpaa_eth-fixes'
Madalin Bucur says:

====================
dpaa_eth: a couple of fixes

Add cleanup on PHY initialization failure path, avoid using
uninitialized memory at CGR init.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2017-01-04 13:45:09 -05:00
Roy Pledge 0fbb0f24dd dpaa_eth: Initialize CGR structure before init
The QBMan CGR options needs to be zeroed before calling the init
function

Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-01-04 13:45:09 -05:00
Madalin Bucur 3fe61f0940 dpaa_eth: cleanup after init_phy() failure
Signed-off-by: Madalin Bucur <madalin.bucur@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-01-04 13:45:08 -05:00
David S. Miller c030af878f Merge branch 'systemport-padding-and-TSB-insertion'
Florian Fainelli says:

====================
net: systemport: Fix padding vs. TSB insertion

This patch series fixes how we pad the packets submitted to the SYSTEMPORT
adapter, and how the transmit status block (prepended 8 bytes) fits in the
picture. The first patch is not technically a bug fix, but is required for the
second path to be applied and to greatly simplify the skb length calculation.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2017-01-04 13:33:30 -05:00
Florian Fainelli 38e5a85562 net: systemport: Pad packet before inserting TSB
Inserting the TSB means adding an extra 8 bytes in front the of packet
that is going to be used as metadata information by the TDMA engine, but
stripped off, so it does not really help with the packet padding.

For some odd packet sizes that fall below the 60 bytes payload (e.g: ARP)
we can end-up padding them after the TSB insertion, thus making them 64
bytes, but with the TDMA stripping off the first 8 bytes, they could
still be smaller than 64 bytes which is required to ingress the switch.

Fix this by swapping the padding and TSB insertion, guaranteeing that
the packets have the right sizes.

Fixes: 80105befdb ("net: systemport: add Broadcom SYSTEMPORT Ethernet MAC driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-01-04 13:33:29 -05:00
Florian Fainelli bb7da333d0 net: systemport: Utilize skb_put_padto()
Since we need to pad our packets, utilize skb_put_padto() which
increases skb->len by how much we need to pad, allowing us to eliminate
the test on skb->len right below.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-01-04 13:33:28 -05:00
Nicolas Pitre cd7aeb1f97 LiquidIO VF: s/select/imply/ for PTP_1588_CLOCK
Fix a minor fallout from the merge of the timers and the networking
trees. The following error may result if the PTP_1588_CLOCK
prerequisites are not available:

drivers/built-in.o: In function `ptp_clock_unregister':
(.text+0x40e0a5): undefined reference to `pps_unregister_source'
drivers/built-in.o: In function `ptp_clock_unregister':
(.text+0x40e0cc): undefined reference to `posix_clock_unregister'
drivers/built-in.o: In function `ptp_clock_event':
(.text+0x40e249): undefined reference to `pps_event'
drivers/built-in.o: In function `ptp_clock_register':
(.text+0x40e5e1): undefined reference to `pps_register_source'
drivers/built-in.o: In function `ptp_clock_register':
(.text+0x40e62c): undefined reference to `posix_clock_register'
drivers/built-in.o: In function `ptp_clock_register':
(.text+0x40e68d): undefined reference to `pps_unregister_source'

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-01-04 13:27:16 -05:00
Varun Prakash a9a8cdb368 libcxgb: fix error check for ip6_route_output()
ip6_route_output() never returns NULL so
check dst->error instead of !dst.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-01-04 13:25:53 -05:00
Peter Chen 63dfb0dac9 net: usb: asix_devices: add .reset_resume for USB PM
The USB core may call reset_resume when it fails to resume asix device.
And USB core can recovery this abnormal resume at low level driver,
the same .resume at asix driver can work too. Add .reset_resume can
avoid disconnecting after backing from system resume, and NFS can
still be mounted after this commit.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-01-04 13:03:08 -05:00
Brian Norris b577fafc43 nvmem: fix nvmem_cell_read() return type doc
nvmem_cell_read() returns void *, not char *. This is a cleanup that got
left out of commit a6c5091250 ("nvmem: Declare nvmem_cell_read()
consistently").

Signed-off-by: Brian Norris <briannorris@chromium.org>
Fixes: a6c5091250 ("nvmem: Declare nvmem_cell_read() consistently")
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-04 18:22:47 +01:00
Daniel Schultz 14ba972842 nvmem: imx-ocotp: Fix wrong register size
All i.MX6 SoCs have an OCOTP Controller with 4kbit fuses. The i.MX6SL is
an exception and has only 2kbit fuses.

In the TRM for the i.MX6DQ (IMX6QDRM - Rev 2, 06/2014) the fuses size is
described in chapter 46.1.1 with:
"32-bit word restricted program and read to 4Kbits of eFuse OTP(512x8)."

In the TRM for the i.MX6SL (IMX6SLRM - Rev 2, 06/2015) the fuses size is
described in chapter 34.1.1 with:
"32-bit word restricted program and read to 2 kbit of eFuse OTP(128x8)."

Since the Freescale Linux kernel OCOTP driver works with a fuses size of
2 kbit for the i.MX6SL, it looks like the TRM is wrong and the formula
to calculate the correct fuses size has to be 256x8.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-04 18:22:47 +01:00
Vivek Gautam 01d0d2c42a nvmem: qfprom: Allow single byte accesses for read/write
The nvmem core driver supports to read and write single
byte. So, allow qfprom to support this feature.
This change helps in extracting a required value based
on bit-offset and number of bits for the required value
in the nvmem cell.

Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-04 18:22:47 +01:00
Alexander Usyskin e09ee853c9 mei: move write cb to completion on credentials failures
The credentials handling was pushed to the write handlers
but error handling wasn't done properly.
Move write callbacks to completion queue to destroy them
and to notify a blocked writer about the failure

Fixes: 136698e535 (mei: push credentials inside the irq write handler)
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-04 18:22:44 +01:00
Alexander Usyskin 5026c9cb07 mei: bus: fix mei_cldev_enable KDoc
Adjust function name in KDoc.

Fixes: d49dc5e76f (mei: bus: use mei_cldev_ prefix for the API functions)
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-04 18:22:43 +01:00
Linus Torvalds 62f8c40592 Merge branch 'for-linus' of git://git.kernel.dk/linux-block
Pull block layer fixes from Jens Axboe:
 "A set of fixes for the current series, one fixing a regression with
  block size < page cache size in the alias series from Jan. Outside of
  that, two small cleanups for wbt from Bart, a nvme pull request from
  Christoph, and a few small fixes of documentation updates"

* 'for-linus' of git://git.kernel.dk/linux-block:
  block: fix up io_poll documentation
  block: Avoid that sparse complains about context imbalance in __wbt_wait()
  block: Make wbt_wait() definition consistent with declaration
  clean_bdev_aliases: Prevent cleaning blocks that are not in block range
  genhd: remove dead and duplicated scsi code
  block: add back plugging in __blkdev_direct_IO
  nvmet/fcloop: remove some logically dead code performing redundant ret checks
  nvmet: fix KATO offset in Set Features
  nvme/fc: simplify error handling of nvme_fc_create_hw_io_queues
  nvme/fc: correct some printk information
  nvme/scsi: Remove START STOP emulation
  nvme/pci: Delete misleading queue-wrap comment
  nvme/pci: Fix whitespace problem
  nvme: simplify stripe quirk
  nvme: update maintainers information
2017-01-04 09:03:37 -08:00
Linus Torvalds 9f7445197a fbdev fixes for v4.10-rc2:
- bring fbdev subsystem back into Maintained mode
 - add missing devm_ioremap() error checking to cobalt_lcdfb driver
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABCAAGBQJYbOonAAoJEH4ztj+gR8IL2u4P/1jQUhkSd8Fm124VsVZVkzHR
 Qjr+l7iXkF8I9MsHF5m9UVLO7bhuRsOtLbp1zeDf6OswidMutAKSOvHJ8Qym2v/6
 fwgCOVLABjdIJaoFXcOD/6Hh05UIr64bS6WGK/UaNkQakaTbqyv/Dmn8nFllxodo
 pWDoeqFGiL3uVFi8mCDBV2yDBgWmPOPbFVGIosbWbIsgGVnYYaYXIJNfwEBGBL4X
 4XpmrfhmFyf8RCpKsSzuKNUd+AHIFqJoWLtukQQIe6hnO+E0u18wBx/f1bM7OGIF
 NPZ1ZklH5IILCuSBChznArKhmN6nQWTZ1+JOrQNOfRDX8r5nn50dMYQ2+oNYoBRd
 zt0wzK0L5kB6xeVOXjUjhy+zlAc96os7lZ2f54QUyMflkpTCJgnqxARpBtwlfKle
 dL5RW5g1SYBnwTc8XeHKPIZt95Oxa3aZ5du+gHulLNu4Oh+sTK8yfwV8kboHC0xQ
 w7zU1wgncrynUvB5ef2SXXPpPr3jWWXYjeCPQJ1Ife1rrYnjNn/cPdAgFOn5KZYz
 n0TMKXbEGJFCXMnuBKj+9mKTR8KBOgm8VlrFmzkcHQYKPqMEERSwtqlJa3wo7s7n
 Ksf1WUD12JZN4UVBWcXCct0RfZfrpZObnHRcqg1/aOZo9ajfFo2YuEh3q4sKQYaS
 d5DihcH03h6mF5dvGuAr
 =v+HB
 -----END PGP SIGNATURE-----

Merge tag 'fbdev-v4.10-rc2' of git://github.com/bzolnier/linux

Pull fbdev fixes from Bartlomiej Zolnierkiewicz:

 - bring fbdev subsystem back into Maintained mode

 - add missing devm_ioremap() error checking to cobalt_lcdfb driver

* tag 'fbdev-v4.10-rc2' of git://github.com/bzolnier/linux:
  video: fbdev: cobalt_lcdfb: Handle return NULL error from devm_ioremap
  MAINTAINERS: add myself as maintainer of fbdev
2017-01-04 09:00:57 -08:00