Linux 4.4.197
Greg KH
maintainerI'm announcing the release of the 4.4.197 kernel.
All users of the 4.4 kernel series must upgrade.
The updated 4.4.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.4.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Documentation/usb/rio.txt | 138 ----- MAINTAINERS | 7 Makefile | 2 arch/arm/configs/badge4_defconfig | 1 arch/arm/configs/corgi_defconfig | 1 arch/arm/configs/s3c2410_defconfig | 1 arch/arm/configs/spitz_defconfig | 1 arch/arm64/include/asm/cpufeature.h | 29 - arch/arm64/kernel/cpufeature.c | 35 - arch/arm64/kernel/debug-monitors.c | 2 arch/arm64/kvm/sys_regs.c | 2 arch/arm64/mm/context.c | 3 arch/mips/configs/mtx1_defconfig | 1 arch/mips/configs/rm200_defconfig | 1 arch/powerpc/platforms/powernv/opal.c | 11 arch/s390/kernel/topology.c | 3 arch/s390/kvm/kvm-s390.c | 2 arch/x86/include/asm/mwait.h | 2 arch/x86/kvm/vmx.c | 2 arch/x86/lib/delay.c | 4 drivers/crypto/caam/caamalg.c | 11 drivers/crypto/qat/qat_common/adf_common_drv.h | 2 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 3 drivers/iio/adc/ad799x.c | 4 drivers/iio/light/opt3001.c | 6 drivers/media/usb/stkwebcam/stk-webcam.c | 3 drivers/net/can/spi/mcp251x.c | 19 drivers/net/ieee802154/atusb.c | 3 drivers/s390/cio/ccwgroup.c | 2 drivers/s390/cio/css.c | 2 drivers/staging/fbtft/fbtft-core.c | 7 drivers/staging/vt6655/device_main.c | 4 drivers/thermal/thermal_core.c | 2 drivers/tty/serial/uartlite.c | 3 drivers/usb/class/usblp.c | 8 drivers/usb/gadget/udc/dummy_hcd.c | 3 drivers/usb/host/xhci.c | 32 - drivers/usb/image/microtek.c | 4 drivers/usb/misc/Kconfig | 10 drivers/usb/misc/Makefile | 1 drivers/usb/misc/adutux.c | 26 - drivers/usb/misc/chaoskey.c | 5 drivers/usb/misc/iowarrior.c | 16 drivers/usb/misc/ldusb.c | 24 - drivers/usb/misc/legousbtower.c | 58 +- drivers/usb/misc/rio500.c | 578 ------------------------- drivers/usb/misc/rio500_usb.h | 37 - drivers/usb/misc/usblcd.c | 33 + drivers/usb/misc/yurex.c | 18 drivers/usb/renesas_usbhs/common.h | 1 drivers/usb/renesas_usbhs/fifo.c | 2 drivers/usb/renesas_usbhs/fifo.h | 1 drivers/usb/renesas_usbhs/mod_gadget.c | 18 drivers/usb/renesas_usbhs/pipe.c | 15 drivers/usb/renesas_usbhs/pipe.h | 1 drivers/usb/serial/ftdi_sio.c | 3 drivers/usb/serial/ftdi_sio_ids.h | 9 drivers/usb/serial/keyspan.c | 4 drivers/usb/serial/option.c | 11 drivers/usb/serial/usb-serial.c | 5 drivers/usb/usb-skeleton.c | 15 drivers/xen/pci.c | 21 fs/9p/vfs_file.c | 3 fs/ceph/inode.c | 7 fs/cifs/dir.c | 8 fs/cifs/file.c | 6 fs/cifs/inode.c | 28 + fs/fuse/cuse.c | 1 fs/nfs/nfs4xdr.c | 2 fs/xfs/xfs_super.c | 10 include/linux/ieee80211.h | 53 ++ include/sound/soc-dapm.h | 2 kernel/elfcore.c | 1 kernel/fork.c | 4 kernel/panic.c | 1 kernel/trace/trace.c | 17 net/wireless/nl80211.c | 39 + net/wireless/reg.c | 2 net/wireless/wext-compat.c | 2 security/integrity/ima/ima_crypto.c | 5 sound/soc/codecs/sgtl5000.c | 232 ++++++++-- tools/lib/traceevent/event-parse.c | 3 tools/perf/builtin-stat.c | 2 tools/perf/util/llvm-utils.c | 6 84 files changed, 718 insertions(+), 994 deletions(-)
Alan Stern (1):
USB: yurex: Don't retry on unexpected errors
Alexander Sverdlin (1):
crypto: qat - Silence smp_processor_id() warning
Andrew Donnellan (1):
powerpc/powernv: Restrict OPAL symbol map to only be readable by root
Bastien Nocera (1):
USB: rio500: Remove Rio 500 kernel driver
Beni Mahler (1):
USB: serial: ftdi_sio: add device IDs for Sienna and Echelon PL-20
Chengguang Xu (1):
9p: avoid attaching writeback_fid on mmap with type PRIVATE
Colin Ian King (1):
USB: adutux: remove redundant variable minor
Daniele Palmas (1):
USB: serial: option: add Telit FN980 compositions
Dave Chinner (1):
xfs: clear sb->s_fs_info on mount failure
David Frey (1):
iio: light: opt3001: fix mutex unlock race
Greg Kroah-Hartman (1):
Linux 4.4.197
Horia Geantă (1):
crypto: caam - fix concurrency issue in givencrypt descriptor
Ian Rogers (1):
perf llvm: Don't access out-of-scope array
Ido Schimmel (1):
thermal: Fix use-after-free when unregistering thermal zone device
Igor Druzhinin (1):
xen/pci: reserve MCFG areas earlier
Jack Wang (1):
KVM: nVMX: handle page fault in vmread fix
[email protected] (1):
USB: dummy-hcd: fix power budget for SuperSpeed mode
Jan Schmidt (1):
xhci: Check all endpoints for LPM timeout
Janakarajan Natarajan (1):
x86/asm: Fix MWAITX C-state hint value
Jia-Ju Bai (1):
fs: nfs: Fix possible null-pointer dereferences in encode_attrs()
Johan Hovold (23):
ieee802154: atusb: fix use-after-free at disconnect
USB: yurex: fix NULL-derefs on disconnect
USB: usb-skeleton: fix runtime PM after driver unbind
USB: usb-skeleton: fix NULL-deref on disconnect
USB: adutux: fix use-after-free on disconnect
USB: adutux: fix NULL-derefs on disconnect
USB: adutux: fix use-after-free on release
USB: iowarrior: fix use-after-free on disconnect
USB: iowarrior: fix use-after-free on release
USB: iowarrior: fix use-after-free after driver unbind
USB: usblp: fix runtime PM after driver unbind
USB: chaoskey: fix use-after-free on release
USB: ldusb: fix NULL-derefs on driver unbind
USB: serial: keyspan: fix NULL-derefs on open() and write()
USB: serial: fix runtime PM after driver unbind
USB: usblcd: fix I/O after disconnect
USB: microtek: fix info-leak at probe
USB: legousbtower: fix slab info leak at probe
USB: legousbtower: fix deadlock on disconnect
USB: legousbtower: fix potential NULL-deref on disconnect
USB: legousbtower: fix open after failed reset request
USB: legousbtower: fix use-after-free on release
media: stkwebcam: fix runtime PM after driver unbind
Johannes Berg (3):
cfg80211: initialize on-stack chandefs
cfg80211: add and use strongly typed element iteration macros
nl80211: validate beacon head
Jouni Malinen (1):
cfg80211: Use const more consistently in for_each_element macros
Kai-Heng Feng (1):
xhci: Increase STS_SAVE timeout in xhci_suspend()
Luis Henriques (1):
ceph: fix directories inode i_blkbits initialization
Marc Kleine-Budde (1):
can: mcp251x: mcp251x_hw_reset(): allow more time after a reset
Marco Felsch (1):
iio: adc: ad799x: fix probe error handling
Mathias Nyman (1):
xhci: Prevent device initiated U1/U2 link pm if exit latency is too long
Michal Hocko (1):
kernel/sysctl.c: do not override max_threads provided by userspace
Navid Emamdoost (2):
staging: vt6655: Fix memory leak in vt6655_probe
Staging: fbtft: fix memory leak in fbtft_framebuffer_alloc
Oleksandr Suvorov (2):
ASoC: Define a set of DAPM pre/post-up events
ASoC: sgtl5000: Improve VAG power and mute control
Pavel Shilovsky (3):
CIFS: Gracefully handle QueryInfo errors during open
CIFS: Force reval dentry if LOOKUP_REVAL flag is set
CIFS: Force revalidate inode when dentry is stale
Randy Dunlap (1):
serial: uartlite: fix exit path null pointer
Reinhard Speyerer (1):
USB: serial: option: add support for Cinterion CLS8 devices
Rick Tseng (1):
usb: xhci: wait for CNR controller not ready bit in xhci resume
Ross Lagerwall (1):
cifs: Check uniqueid for SMB2+ and return -ESTALE if necessary
Sascha Hauer (1):
ima: always return negative code for error
Srikar Dronamraju (1):
perf stat: Fix a segmentation fault when using repeat forever
Steven Rostedt (VMware) (2):
tools lib traceevent: Do not free tep->cmdlines in add_new_comm() on failure
tracing: Get trace_array reference for available_tracers files
Suzuki K Poulose (2):
arm64: capabilities: Handle sign of the feature bit
arm64: Rename cpuid_feature field extract routines
Thomas Huth (1):
KVM: s390: Test for bad access register and size at the start of S390_MEM_OP
Trek (1):
drm/amdgpu: Check for valid number of registers to read
Valdis Kletnieks (1):
kernel/elfcore.c: include proper prototypes
Vasily Gorbik (3):
s390/topology: avoid firing events before kobjs are created s390/cio: avoid calling strlen on null pointer s390/cio: exclude subchannels with no parent from pseudo check
Will Deacon (1):
panic: ensure preemption is disabled during panic()
Yoshihiro Shimoda (2):
usb: renesas_usbhs: gadget: Do not discard queues in usb_ep_set_{halt,wedge}()
usb: renesas_usbhs: gadget: Fix usb_ep_set_{halt,wedge}() behavior
zhengbin (1):
fuse: fix memleak in cuse_channel_open
Greg KH
maintainerDocumentation/usb/rio.txt deleted +0 -138
@@ -1,138 +0,0 @@ -Copyright (C) 1999, 2000 Bruce Tenison -Portions Copyright (C) 1999, 2000 David Nelson -Thanks to David Nelson for guidance and the usage of the scanner.txt -and scanner.c files to model our driver and this informative file. - -Mar. 2, 2000 - -CHANGES - -- Initial Revision - - -OVERVIEW - -This README will address issues regarding how to configure the kernel -to access a RIO 500 mp3 player. -Before I explain how to use this to access the Rio500 please be warned: - -W A R N I N G: --------------- - -Please note that this software is still under development. The authors -are in no way responsible for any damage that may occur, no matter how -inconsequential. - -It seems that the Rio has a problem when sending .mp3 with low batteries. -I suggest when the batteries are low and you want to transfer stuff that you -replace it with a fresh one. In my case, what happened is I lost two 16kb -blocks (they are no longer usable to store information to it). But I don't -know if that's normal or not; it could simply be a problem with the flash -memory. - -In an extreme case, I left my Rio playing overnight and the batteries wore -down to nothing and appear to have corrupted the flash memory. My RIO -needed to be replaced as a result. Diamond tech support is aware of the -problem. Do NOT allow your batteries to wear down to nothing before -changing them. It appears RIO 500 firmware does not handle low battery -power well at all. - -On systems with OHCI controllers, the kernel OHCI code appears to have -power on problems with some chipsets. If you are having problems -connecting to your RIO 500, try turning it on first and then plugging it -into the USB cable. - -Contact information: --------------------- - - The main page for the project is hosted at sourceforge.net in the following - URL: <http://rio500.sourceforge.net>. You can also go to the project's - sourceforge home page at: <http://sourceforge.net/projects/rio500/>. - There is also a mailing list: [email protected] - -Authors: -------- - -Most of the code was written by Cesar Miquel <[email protected]>. Keith -Clayton <[email protected]> is incharge of the PPC port and making sure -things work there. Bruce Tenison <[email protected]> is adding support -for .fon files and also does testing. The program will mostly sure be -re-written and Pete Ikusz along with the rest will re-design it. I would -also like to thank Tri Nguyen <[email protected]> who provided use -with some important information regarding the communication with the Rio. - -ADDITIONAL INFORMATION and Userspace tools - -http://rio500.sourceforge.net/ - - -REQUIREMENTS - -A host with a USB port. Ideally, either a UHCI (Intel) or OHCI -(Compaq and others) hardware port should work. - -A Linux development kernel (2.3.x) with USB support enabled or a -backported version to linux-2.2.x. See http://www.linux-usb.org for -more information on accomplishing this. - -A Linux kernel with RIO 500 support enabled. - -'lspci' which is only needed to determine the type of USB hardware -available in your machine. - -CONFIGURATION - -Using `lspci -v`, determine the type of USB hardware available. - - If you see something like: - - USB Controller: ...... - Flags: ..... - I/O ports at .... - - Then you have a UHCI based controller. - - If you see something like: - - USB Controller: ..... - Flags: .... - Memory at ..... - - Then you have a OHCI based controller. - -Using `make menuconfig` or your preferred method for configuring the -kernel, select 'Support for USB', 'OHCI/UHCI' depending on your -hardware (determined from the steps above), 'USB Diamond Rio500 support', and -'Preliminary USB device filesystem'. Compile and install the modules -(you may need to execute `depmod -a` to update the module -dependencies). - -Add a device for the USB rio500: - `mknod /dev/usb/rio500 c 180 64` - -Set appropriate permissions for /dev/usb/rio500 (don't forget about -group and world permissions). Both read and write permissions are -required for proper operation. - -Load the appropriate modules (if compiled as modules): - - OHCI: - modprobe usbcore - modprobe usb-ohci - modprobe rio500 - - UHCI: - modprobe usbcore - modprobe usb-uhci (or uhci) - modprobe rio500 - -That's it. The Rio500 Utils at: http://rio500.sourceforge.net should -be able to access the rio500. - -BUGS - -If you encounter any problems feel free to drop me an email. - -Bruce Tenison [email protected] -
MAINTAINERS +0 -7
@@ -11100,13 +11100,6 @@ W: http://www.linux-usb.org/usbnet S: Maintained F: drivers/net/usb/dm9601.c -USB DIAMOND RIO500 DRIVER -M: Cesar Miquel <[email protected]> -L: [email protected] -W: http://rio500.sourceforge.net -S: Maintained -F: drivers/usb/misc/rio500* - USB EHCI DRIVER M: Alan Stern <[email protected]> L: [email protected]
Makefile +1 -1
@@ -1,6 +1,6 @@ VERSION = 4 PATCHLEVEL = 4 -SUBLEVEL = 196 +SUBLEVEL = 197 EXTRAVERSION = NAME = Blurry Fish Butt
arch/arm/configs/badge4_defconfig +0 -1
@@ -97,7 +97,6 @@ CONFIG_USB_SERIAL_PL2303=m CONFIG_USB_SERIAL_CYBERJACK=m CONFIG_USB_SERIAL_XIRCOM=m CONFIG_USB_SERIAL_OMNINET=m -CONFIG_USB_RIO500=m CONFIG_EXT2_FS=m CONFIG_EXT3_FS=m CONFIG_MSDOS_FS=y
arch/arm/configs/corgi_defconfig +0 -1
@@ -207,7 +207,6 @@ CONFIG_USB_SERIAL_XIRCOM=m CONFIG_USB_SERIAL_OMNINET=m CONFIG_USB_EMI62=m CONFIG_USB_EMI26=m -CONFIG_USB_RIO500=m CONFIG_USB_LEGOTOWER=m CONFIG_USB_LCD=m CONFIG_USB_LED=m
arch/arm/configs/s3c2410_defconfig +0 -1
@@ -354,7 +354,6 @@ CONFIG_USB_EMI62=m CONFIG_USB_EMI26=m CONFIG_USB_ADUTUX=m CONFIG_USB_SEVSEG=m -CONFIG_USB_RIO500=m CONFIG_USB_LEGOTOWER=m CONFIG_USB_LCD=m CONFIG_USB_LED=m
arch/arm/configs/spitz_defconfig +0 -1
@@ -202,7 +202,6 @@ CONFIG_USB_SERIAL_XIRCOM=m CONFIG_USB_SERIAL_OMNINET=m CONFIG_USB_EMI62=m CONFIG_USB_EMI26=m -CONFIG_USB_RIO500=m CONFIG_USB_LEGOTOWER=m CONFIG_USB_LCD=m CONFIG_USB_LED=m
arch/arm64/include/asm/cpufeature.h +18 -11
@@ -88,9 +88,10 @@ struct arm64_cpu_capabilities {struct {/* Feature register checking */ u32 sys_reg; -int field_pos; -int min_field_value; -int hwcap_type; +u8 field_pos; +u8 min_field_value; +u8 hwcap_type; +bool sign;unsigned long hwcap; }; };
@@ -120,15 +121,15 @@ static inline void cpus_set_cap(unsigned int num) } static inline int __attribute_const__ -cpuid_feature_extract_field_width (u64 features,int field,int width) +cpuid_feature_extract_signed_field_width (u64 features,int field,int width) {return (s64)(features << (64 - width - field)) >> (64 - width); } static inline int __attribute_const__ -cpuid_feature_extract_field (u64 features,int field) +cpuid_feature_extract_signed_field (u64 features,int field) { -return cpuid_feature_extract_field_width (features, field,4 ); +return cpuid_feature_extract_signed_field_width (features, field,4 ); }static inline unsigned int __attribute_const__
@@ -148,17 +149,23 @@ static inline u64 arm64_ftr_mask(struct arm64_ftr_bits *ftrp)return (u64 )GENMASK (ftrp->shift + ftrp->width -1 , ftrp->shift); } +static inline int __attribute_const__ +cpuid_feature_extract_field (u64 features,int field,bool sign) +{ +return (sign) ? +cpuid_feature_extract_signed_field (features, field) : +cpuid_feature_extract_unsigned_field (features, field); +} +static inline s64 arm64_ftr_value (struct arm64_ftr_bits *ftrp,u64 val) { -return ftrp->sign ? -cpuid_feature_extract_field_width (val, ftrp->shift, ftrp->width) : -cpuid_feature_extract_unsigned_field_width (val, ftrp->shift, ftrp->width); +return (s64 )cpuid_feature_extract_field (val, ftrp->shift, ftrp->sign); }static inline bool id_aa64mmfr0_mixed_endian_el0 (u64 mmfr0) { -return cpuid_feature_extract_field (mmfr0,ID_AA64MMFR0_BIGENDEL_SHIFT ) ==0x1 || -cpuid_feature_extract_field (mmfr0,ID_AA64MMFR0_BIGENDEL0_SHIFT ) ==0x1 ; +return cpuid_feature_extract_unsigned_field (mmfr0,ID_AA64MMFR0_BIGENDEL_SHIFT ) ==0x1 || +cpuid_feature_extract_unsigned_field (mmfr0,ID_AA64MMFR0_BIGENDEL0_SHIFT ) ==0x1 ; }void __init setup_cpu_features (void );
arch/arm64/kernel/cpufeature.c +20 -15
@@ -600,7 +600,7 @@ u64 read_system_reg(u32 id)static bool feature_matches (u64 reg,const struct arm64_cpu_capabilities *entry) { -int val =cpuid_feature_extract_field (reg, entry->field_pos); +int val =cpuid_feature_extract_field (reg, entry->field_pos, entry->sign);return val >= entry->min_field_value; }
@@ -636,6 +636,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .matches = has_useable_gicv3_cpuif, .sys_reg = SYS_ID_AA64PFR0_EL1, .field_pos = ID_AA64PFR0_GIC_SHIFT, + .sign = FTR_UNSIGNED, .min_field_value = 1, },#ifdef CONFIG_ARM64_PAN
@@ -645,6 +646,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .matches = has_cpuid_feature, .sys_reg = SYS_ID_AA64MMFR1_EL1, .field_pos = ID_AA64MMFR1_PAN_SHIFT, + .sign = FTR_UNSIGNED, .min_field_value = 1, .enable = cpu_enable_pan, },
@@ -656,6 +658,7 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .matches = has_cpuid_feature, .sys_reg = SYS_ID_AA64ISAR0_EL1, .field_pos = ID_AA64ISAR0_ATOMICS_SHIFT, + .sign = FTR_UNSIGNED, .min_field_value = 2, },#endif /* CONFIG_AS_LSE && CONFIG_ARM64_LSE_ATOMICS */
@@ -665,37 +668,39 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .matches = has_cpuid_feature, .sys_reg = SYS_ID_AA64PFR0_EL1, .field_pos = ID_AA64PFR0_EL0_SHIFT, + .sign = FTR_UNSIGNED, .min_field_value = ID_AA64PFR0_EL0_32BIT_64BIT, }, {}, }; -#define HWCAP_CAP (reg, field, min_value, type, cap) \ +#define HWCAP_CAP (reg, field, s, min_value, type, cap) \ { \ .desc = #cap, \ .matches = has_cpuid_feature, \ .sys_reg = reg, \ .field_pos = field, \ + .sign = s, \ .min_field_value = min_value, \ .hwcap_type = type, \ .hwcap = cap, \ }static const struct arm64_cpu_capabilities arm64_hwcaps[] = { -HWCAP_CAP (SYS_ID_AA64ISAR0_EL1 ,ID_AA64ISAR0_AES_SHIFT ,2 ,CAP_HWCAP ,HWCAP_PMULL ), -HWCAP_CAP (SYS_ID_AA64ISAR0_EL1 ,ID_AA64ISAR0_AES_SHIFT ,1 ,CAP_HWCAP ,HWCAP_AES ), -HWCAP_CAP (SYS_ID_AA64ISAR0_EL1 ,ID_AA64ISAR0_SHA1_SHIFT ,1 ,CAP_HWCAP ,HWCAP_SHA1 ), -HWCAP_CAP (SYS_ID_AA64ISAR0_EL1 ,ID_AA64ISAR0_SHA2_SHIFT ,1 ,CAP_HWCAP ,HWCAP_SHA2 ), -HWCAP_CAP (SYS_ID_AA64ISAR0_EL1 ,ID_AA64ISAR0_CRC32_SHIFT ,1 ,CAP_HWCAP ,HWCAP_CRC32 ), -HWCAP_CAP (SYS_ID_AA64ISAR0_EL1 ,ID_AA64ISAR0_ATOMICS_SHIFT ,2 ,CAP_HWCAP ,HWCAP_ATOMICS ), -HWCAP_CAP (SYS_ID_AA64PFR0_EL1 ,ID_AA64PFR0_FP_SHIFT ,0 ,CAP_HWCAP ,HWCAP_FP ), -HWCAP_CAP (SYS_ID_AA64PFR0_EL1 ,ID_AA64PFR0_ASIMD_SHIFT ,0 ,CAP_HWCAP ,HWCAP_ASIMD ), +HWCAP_CAP (SYS_ID_AA64ISAR0_EL1 ,ID_AA64ISAR0_AES_SHIFT ,FTR_UNSIGNED ,2 ,CAP_HWCAP ,HWCAP_PMULL ), +HWCAP_CAP (SYS_ID_AA64ISAR0_EL1 ,ID_AA64ISAR0_AES_SHIFT ,FTR_UNSIGNED ,1 ,CAP_HWCAP ,HWCAP_AES ), +HWCAP_CAP (SYS_ID_AA64ISAR0_EL1 ,ID_AA64ISAR0_SHA1_SHIFT ,FTR_UNSIGNED ,1 ,CAP_HWCAP ,HWCAP_SHA1 ), +HWCAP_CAP (SYS_ID_AA64ISAR0_EL1 ,ID_AA64ISAR0_SHA2_SHIFT ,FTR_UNSIGNED ,1 ,CAP_HWCAP ,HWCAP_SHA2 ), +HWCAP_CAP (SYS_ID_AA64ISAR0_EL1 ,ID_AA64ISAR0_CRC32_SHIFT ,FTR_UNSIGNED ,1 ,CAP_HWCAP ,HWCAP_CRC32 ), +HWCAP_CAP (SYS_ID_AA64ISAR0_EL1 ,ID_AA64ISAR0_ATOMICS_SHIFT ,FTR_UNSIGNED ,2 ,CAP_HWCAP ,HWCAP_ATOMICS ), +HWCAP_CAP (SYS_ID_AA64PFR0_EL1 ,ID_AA64PFR0_FP_SHIFT ,FTR_SIGNED ,0 ,CAP_HWCAP ,HWCAP_FP ), +HWCAP_CAP (SYS_ID_AA64PFR0_EL1 ,ID_AA64PFR0_ASIMD_SHIFT ,FTR_SIGNED ,0 ,CAP_HWCAP ,HWCAP_ASIMD ), #ifdef CONFIG_COMPAT -HWCAP_CAP (SYS_ID_ISAR5_EL1 ,ID_ISAR5_AES_SHIFT ,2 ,CAP_COMPAT_HWCAP2 ,COMPAT_HWCAP2_PMULL ), -HWCAP_CAP (SYS_ID_ISAR5_EL1 ,ID_ISAR5_AES_SHIFT ,1 ,CAP_COMPAT_HWCAP2 ,COMPAT_HWCAP2_AES ), -HWCAP_CAP (SYS_ID_ISAR5_EL1 ,ID_ISAR5_SHA1_SHIFT ,1 ,CAP_COMPAT_HWCAP2 ,COMPAT_HWCAP2_SHA1 ), -HWCAP_CAP (SYS_ID_ISAR5_EL1 ,ID_ISAR5_SHA2_SHIFT ,1 ,CAP_COMPAT_HWCAP2 ,COMPAT_HWCAP2_SHA2 ), -HWCAP_CAP (SYS_ID_ISAR5_EL1 ,ID_ISAR5_CRC32_SHIFT ,1 ,CAP_COMPAT_HWCAP2 ,COMPAT_HWCAP2_CRC32 ), +HWCAP_CAP (SYS_ID_ISAR5_EL1 ,ID_ISAR5_AES_SHIFT ,FTR_UNSIGNED ,2 ,CAP_COMPAT_HWCAP2 ,COMPAT_HWCAP2_PMULL ), +HWCAP_CAP (SYS_ID_ISAR5_EL1 ,ID_ISAR5_AES_SHIFT ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP2 ,COMPAT_HWCAP2_AES ), +HWCAP_CAP (SYS_ID_ISAR5_EL1 ,ID_ISAR5_SHA1_SHIFT ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP2 ,COMPAT_HWCAP2_SHA1 ), +HWCAP_CAP (SYS_ID_ISAR5_EL1 ,ID_ISAR5_SHA2_SHIFT ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP2 ,COMPAT_HWCAP2_SHA2 ), +HWCAP_CAP (SYS_ID_ISAR5_EL1 ,ID_ISAR5_CRC32_SHIFT ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP2 ,COMPAT_HWCAP2_CRC32 ), #endif {}, };
arch/arm64/kernel/debug-monitors.c +1 -1
@@ -34,7 +34,7 @@/* Determine debug architecture. */ u8 debug_monitors_arch (void ) { -return cpuid_feature_extract_field (read_system_reg (SYS_ID_AA64DFR0_EL1 ), +return cpuid_feature_extract_unsigned_field (read_system_reg (SYS_ID_AA64DFR0_EL1 ),ID_AA64DFR0_DEBUGVER_SHIFT ); }
arch/arm64/kvm/sys_regs.c +1 -1
@@ -687,7 +687,7 @@ static bool trap_dbgidr(struct kvm_vcpu *vcpu, }else {u64 dfr =read_system_reg (SYS_ID_AA64DFR0_EL1 );u64 pfr =read_system_reg (SYS_ID_AA64PFR0_EL1 ); -u32 el3 = !!cpuid_feature_extract_field (pfr,ID_AA64PFR0_EL3_SHIFT ); +u32 el3 = !!cpuid_feature_extract_unsigned_field (pfr,ID_AA64PFR0_EL3_SHIFT ); p->regval = ((((dfr >> ID_AA64DFR0_WRPS_SHIFT) & 0xf) << 28) | (((dfr >> ID_AA64DFR0_BRPS_SHIFT) & 0xf) << 24) |
arch/arm64/mm/context.c +2 -1
@@ -187,7 +187,8 @@ switch_mm_fastpath:static int asids_init (void ) { -int fld =cpuid_feature_extract_field (read_cpuid (ID_AA64MMFR0_EL1 ),4 ); +int fld =cpuid_feature_extract_unsigned_field (read_cpuid (ID_AA64MMFR0_EL1 ), +ID_AA64MMFR0_ASID_SHIFT );switch (fld) {default :
arch/mips/configs/mtx1_defconfig +0 -1
@@ -638,7 +638,6 @@ CONFIG_USB_SERIAL_OMNINET=m CONFIG_USB_EMI62=m CONFIG_USB_EMI26=m CONFIG_USB_ADUTUX=m -CONFIG_USB_RIO500=m CONFIG_USB_LEGOTOWER=m CONFIG_USB_LCD=m CONFIG_USB_LED=m
arch/mips/configs/rm200_defconfig +0 -1
@@ -351,7 +351,6 @@ CONFIG_USB_SERIAL_SAFE_PADDED=y CONFIG_USB_SERIAL_CYBERJACK=m CONFIG_USB_SERIAL_XIRCOM=m CONFIG_USB_SERIAL_OMNINET=m -CONFIG_USB_RIO500=m CONFIG_USB_LEGOTOWER=m CONFIG_USB_LCD=m CONFIG_USB_LED=m
arch/powerpc/platforms/powernv/opal.c +7 -4
@@ -580,7 +580,10 @@ static ssize_t symbol_map_read(struct file *fp, struct kobject *kobj, bin_attr->size); } -static BIN_ATTR_RO(symbol_map, 0); +static struct bin_attribute symbol_map_attr = { + .attr = {.name ="symbol_map" , .mode =0400 }, + .read = symbol_map_read +};static void opal_export_symmap (void ) {
@@ -597,10 +600,10 @@ static void opal_export_symmap(void)return ;/* Setup attributes */ - bin_attr_symbol_map.private =__va (be64_to_cpu (syms[0 ])); - bin_attr_symbol_map.size =be64_to_cpu (syms[1 ]); + symbol_map_attr.private =__va (be64_to_cpu (syms[0 ])); + symbol_map_attr.size =be64_to_cpu (syms[1 ]); - rc =sysfs_create_bin_file (opal_kobj, &bin_attr_symbol_map); + rc =sysfs_create_bin_file (opal_kobj, &symbol_map_attr);if (rc)pr_warn ("Error %d creating OPAL symbols file\n" , rc); }
arch/s390/kernel/topology.c +2 -1
@@ -291,7 +291,8 @@ int arch_update_cpu_topology(void)topology_update_polarization_simple ();for_each_online_cpu (cpu) { dev =get_cpu_device (cpu); -kobject_uevent (&dev->kobj,KOBJ_CHANGE ); +if (dev) +kobject_uevent (&dev->kobj,KOBJ_CHANGE ); }return rc; }
arch/s390/kvm/kvm-s390.c +1 -1
@@ -2471,7 +2471,7 @@ static long kvm_s390_guest_mem_op(struct kvm_vcpu *vcpu,const u64 supported_flags =KVM_S390_MEMOP_F_INJECT_EXCEPTION |KVM_S390_MEMOP_F_CHECK_ONLY ; -if (mop->flags & ~supported_flags) +if (mop->flags & ~supported_flags || mop->ar >=NUM_ACRS || !mop->size)return -EINVAL ;if (mop->size >MEM_OP_MAX_SIZE )
arch/x86/include/asm/mwait.h +1 -1
@@ -19,7 +19,7 @@#define MWAIT_ECX_INTERRUPT_BREAK 0x1#define MWAITX_ECX_TIMER_ENABLE BIT(1)#define MWAITX_MAX_LOOPS ((u32)-1) -#define MWAITX_DISABLE_CSTATES 0xf +#define MWAITX_DISABLE_CSTATES 0xf0static inline void __monitor (const void *eax,unsigned long ecx,unsigned long edx)
arch/x86/kvm/vmx.c +1 -1
@@ -7276,7 +7276,7 @@ static int handle_vmread(struct kvm_vcpu *vcpu)/* _system ok, as nested_vmx_check_permission verified cpl=0 */ if (kvm_write_guest_virt_system (vcpu, gva, &field_value, (is_long_mode (vcpu) ?8 :4 ), -NULL )) + &e))kvm_inject_page_fault (vcpu, &e); }
arch/x86/lib/delay.c +2 -2
@@ -112,8 +112,8 @@ static void delay_mwaitx(unsigned long __loops)__monitorx (this_cpu_ptr (&cpu_tss),0 ,0 );/* -* AMD, like Intel, supports the EAX hint and EAX=0xf -* means, do not enter any deep C-state and we use it +* AMD, like Intel's MWAIT version, supports the EAX hint and +* EAX=0xf0 means, do not enter any deep C-state and we use it * here in delay() to minimize wakeup latency. */ __mwaitx (MWAITX_DISABLE_CSTATES , delay,MWAITX_ECX_TIMER_ENABLE );
drivers/crypto/caam/caamalg.c +10 -1
@@ -75,7 +75,7 @@#define DESC_AEAD_BASE (4 * CAAM_CMD_SZ)#define DESC_AEAD_ENC_LEN (DESC_AEAD_BASE + 11 * CAAM_CMD_SZ)#define DESC_AEAD_DEC_LEN (DESC_AEAD_BASE + 15 * CAAM_CMD_SZ) -#define DESC_AEAD_GIVENC_LEN (DESC_AEAD_ENC_LEN + 9 * CAAM_CMD_SZ) +#define DESC_AEAD_GIVENC_LEN (DESC_AEAD_ENC_LEN + 10 * CAAM_CMD_SZ)/* Note: Nonce is counted in enckeylen */ #define DESC_AEAD_CTR_RFC3686_LEN (4 * CAAM_CMD_SZ)
@@ -437,6 +437,7 @@ static int aead_set_sh_desc(struct crypto_aead *aead)u32 geniv, moveiv;u32 ctx1_iv_off =0 ;u32 *desc; +u32 *wait_cmd;const bool ctr_mode = ((ctx->class1_alg_type &OP_ALG_AAI_MASK ) ==OP_ALG_AAI_CTR_MOD128 );const bool is_rfc3686 = alg->caam.rfc3686;
@@ -702,6 +703,14 @@ copy_iv:/* Will read cryptlen */ append_math_add (desc,VARSEQINLEN ,SEQINLEN ,REG0 ,CAAM_CMD_SZ ); + +/* +* Wait for IV transfer (ofifo -> class2) to finish before starting +* ciphertext transfer (ofifo -> external memory). +*/ + wait_cmd =append_jump (desc,JUMP_JSL |JUMP_TEST_ALL |JUMP_COND_NIFP ); +set_jump_tgt_here (desc, wait_cmd); +append_seq_fifo_load (desc,0 ,FIFOLD_CLASS_BOTH |KEY_VLF |FIFOLD_TYPE_MSG1OUT2 |FIFOLD_TYPE_LASTBOTH );append_seq_fifo_store (desc,0 ,FIFOST_TYPE_MESSAGE_DATA |KEY_VLF );
drivers/crypto/qat/qat_common/adf_common_drv.h +1 -1
@@ -95,7 +95,7 @@ struct service_hndl {static inline int get_current_node (void ) { -return topology_physical_package_id (smp_processor_id ()); +return topology_physical_package_id (raw_smp_processor_id ()); }int adf_service_register (struct service_hndl *service);
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +3 -0
@@ -406,6 +406,9 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_fileif (sh_num ==AMDGPU_INFO_MMR_SH_INDEX_MASK ) sh_num =0xffffffff ; +if (info->read_mmr_reg.count >128 ) +return -EINVAL ; + regs =kmalloc_array (info->read_mmr_reg.count,sizeof (*regs),GFP_KERNEL );if (!regs)return -ENOMEM ;
drivers/iio/adc/ad799x.c +2 -2
@@ -822,10 +822,10 @@ static int ad799x_probe(struct i2c_client *client, ret =ad799x_write_config (st, st->chip_config->default_config);if (ret <0 ) - goto error_disable_reg; + goto error_disable_vref; ret =ad799x_read_config (st);if (ret <0 ) - goto error_disable_reg; + goto error_disable_vref; st->config = ret; ret = iio_triggered_buffer_setup(indio_dev, NULL,
drivers/iio/light/opt3001.c +5 -1
@@ -646,6 +646,7 @@ static irqreturn_t opt3001_irq(int irq, void *_iio)struct iio_dev *iio = _iio;struct opt3001 *opt =iio_priv (iio);int ret; +bool wake_result_ready_queue = false;if (!opt->ok_to_ignore_lock)mutex_lock (&opt->lock);
@@ -680,13 +681,16 @@ static irqreturn_t opt3001_irq(int irq, void *_iio) } opt->result = ret; opt->result_ready = true; -wake_up (&opt->result_ready_queue); + wake_result_ready_queue = true; } out:if (!opt->ok_to_ignore_lock)mutex_unlock (&opt->lock); +if (wake_result_ready_queue) +wake_up (&opt->result_ready_queue); +return IRQ_HANDLED ; }
drivers/media/usb/stkwebcam/stk-webcam.c +1 -2
@@ -642,8 +642,7 @@ static int v4l_stk_release(struct file *fp) dev->owner =NULL ; } -if (is_present (dev)) -usb_autopm_put_interface (dev->interface); +usb_autopm_put_interface (dev->interface);mutex_unlock (&dev->lock);return v4l2_fh_release (fp); }
drivers/net/can/spi/mcp251x.c +14 -5
@@ -627,7 +627,7 @@ static int mcp251x_setup(struct net_device *net, struct mcp251x_priv *priv,static int mcp251x_hw_reset (struct spi_device *spi) {struct mcp251x_priv *priv =spi_get_drvdata (spi); -u8 reg; +unsigned long timeout;int ret;/* Wait for oscillator startup timer after power up */
@@ -641,10 +641,19 @@ static int mcp251x_hw_reset(struct spi_device *spi)/* Wait for oscillator startup timer after reset */ mdelay (MCP251X_OST_DELAY_MS ); - reg =mcp251x_read_reg (spi,CANSTAT ); -if ((reg &CANCTRL_REQOP_MASK ) !=CANCTRL_REQOP_CONF ) -return -ENODEV ; - +/* Wait for reset to finish */ + timeout = jiffies +HZ ; +while ((mcp251x_read_reg (spi,CANSTAT ) &CANCTRL_REQOP_MASK ) != +CANCTRL_REQOP_CONF ) { +usleep_range (MCP251X_OST_DELAY_MS *1000 , +MCP251X_OST_DELAY_MS *1000 *2 ); + +if (time_after (jiffies, timeout)) { +dev_err (&spi->dev, +"MCP251x didn't enter in conf mode after reset\n" ); +return -EBUSY ; + } + }return 0 ; }
drivers/net/ieee802154/atusb.c +2 -1
@@ -756,10 +756,11 @@ static void atusb_disconnect(struct usb_interface *interface)ieee802154_unregister_hw (atusb->hw); +usb_put_dev (atusb->usb_dev); +ieee802154_free_hw (atusb->hw);usb_set_intfdata (interface,NULL ); -usb_put_dev (atusb->usb_dev);pr_debug ("atusb_disconnect done\n" ); }
drivers/s390/cio/ccwgroup.c +1 -1
@@ -369,7 +369,7 @@ int ccwgroup_create_dev(struct device *parent, struct ccwgroup_driver *gdrv, goto error; }/* Check for trailing stuff. */ -if (i == num_devices &&strlen (buf) >0 ) { +if (i == num_devices && buf &&strlen (buf) >0 ) { rc = -EINVAL ; goto error; }
drivers/s390/cio/css.c +2 -0
@@ -1120,6 +1120,8 @@ device_initcall(cio_settle_init);int sch_is_pseudo_sch (struct subchannel *sch) { +if (!sch->dev.parent) +return 0 ;return sch ==to_css (sch->dev.parent)->pseudo_subchannel; }
drivers/staging/fbtft/fbtft-core.c +5 -2
@@ -813,7 +813,7 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display,if (par->gamma.curves && gamma) {if (fbtft_gamma_parse_str (par, par->gamma.curves, gamma,strlen (gamma))) - goto alloc_fail; + goto release_framebuf; }/* Transmit buffer */
@@ -836,7 +836,7 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display, txbuf =devm_kzalloc (par->info->device, txbuflen,GFP_KERNEL ); }if (!txbuf) - goto alloc_fail; + goto release_framebuf; par->txbuf.buf = txbuf; par->txbuf.len = txbuflen; }
@@ -872,6 +872,9 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display,return info; +release_framebuf: +framebuffer_release (info); + alloc_fail:vfree (vmem);
drivers/staging/vt6655/device_main.c +3 -1
@@ -1668,8 +1668,10 @@ vt6655_probe(struct pci_dev *pcid, const struct pci_device_id *ent) priv->hw->max_signal =100 ; -if (vnt_init (priv)) +if (vnt_init (priv)) { +device_free_info (priv);return -ENODEV ; + }device_print_info (priv);pci_set_drvdata (pcid, priv);
drivers/thermal/thermal_core.c +1 -1
@@ -402,7 +402,7 @@ static void thermal_zone_device_set_polling(struct thermal_zone_device *tz,mod_delayed_work (system_freezable_wq, &tz->poll_queue,msecs_to_jiffies (delay)); else - cancel_delayed_work(&tz->poll_queue); + cancel_delayed_work_sync(&tz->poll_queue); }static void monitor_thermal_zone (struct thermal_zone_device *tz)
drivers/tty/serial/uartlite.c +2 -1
@@ -701,7 +701,8 @@ err_uart: static void __exit ulite_exit(void) {platform_driver_unregister (&ulite_platform_driver); -uart_unregister_driver (&ulite_uart_driver); +if (ulite_uart_driver.state) +uart_unregister_driver (&ulite_uart_driver); }module_init (ulite_init);
drivers/usb/class/usblp.c +5 -3
@@ -474,10 +474,12 @@ static int usblp_release(struct inode *inode, struct file *file)mutex_lock (&usblp_mutex); usblp->used =0 ; -if (usblp->present) { +if (usblp->present)usblp_unlink_urbs (usblp); -usb_autopm_put_interface (usblp->intf); - }else /* finish cleanup from disconnect */ + +usb_autopm_put_interface (usblp->intf); + +if (!usblp->present)/* finish cleanup from disconnect */ usblp_cleanup (usblp);mutex_unlock (&usblp_mutex);return 0 ;
drivers/usb/gadget/udc/dummy_hcd.c +2 -1
@@ -50,6 +50,7 @@#define DRIVER_VERSION "02 May 2005"#define POWER_BUDGET 500/* in mA; use 8 for low-power port testing */ +#define POWER_BUDGET_3 900/* in mA */ static const char driver_name[] ="dummy_hcd" ;static const char driver_desc[] ="USB Host+Gadget Emulator" ;
@@ -2435,7 +2436,7 @@ static int dummy_start_ss(struct dummy_hcd *dum_hcd) dum_hcd->rh_state =DUMMY_RH_RUNNING ; dum_hcd->stream_en_ep =0 ;INIT_LIST_HEAD (&dum_hcd->urbp_list); -dummy_hcd_to_hcd (dum_hcd)->power_budget =POWER_BUDGET ; +dummy_hcd_to_hcd (dum_hcd)->power_budget =POWER_BUDGET_3 ;dummy_hcd_to_hcd (dum_hcd)->state =HC_STATE_RUNNING ;dummy_hcd_to_hcd (dum_hcd)->uses_new_polling =1 ;#ifdef CONFIG_USB_OTG
drivers/usb/host/xhci.c +23 -9
@@ -981,7 +981,7 @@ int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup) command |=CMD_CSS ;writel (command, &xhci->op_regs->command);if (xhci_handshake (&xhci->op_regs->status, -STS_SAVE ,0 ,10 *1000 )) { +STS_SAVE ,0 ,20 *1000 )) {xhci_warn (xhci,"WARN: xHC save state timeout\n" );spin_unlock_irq (&xhci->lock);return -ETIMEDOUT ;
@@ -1041,6 +1041,18 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) hibernated = true;if (!hibernated) { +/* +* Some controllers might lose power during suspend, so wait +* for controller not ready bit to clear, just as in xHC init. +*/ + retval =xhci_handshake (&xhci->op_regs->status, +STS_CNR ,0 ,10 *1000 *1000 ); +if (retval) { +xhci_warn (xhci,"Controller not ready at resume %d\n" , + retval); +spin_unlock_irq (&xhci->lock); +return retval; + }/* step 1: restore register */ xhci_restore_registers (xhci);/* step 2: initialize command ring buffer */
@@ -4529,12 +4541,12 @@ static int xhci_update_timeout_for_endpoint(struct xhci_hcd *xhci, alt_timeout =xhci_call_host_update_timeout_for_endpoint (xhci, udev, desc, state, timeout); -/* If we found we can't enable hub-initiated LPM, or +/* If we found we can't enable hub-initiated LPM, and * the U1 or U2 exit latency was too high to allow -* device-initiated LPM as well, just stop searching. +* device-initiated LPM as well, then we will disable LPM +* for this device, so stop searching any further. */ -if (alt_timeout ==USB3_LPM_DISABLED || - alt_timeout ==USB3_LPM_DEVICE_INITIATED ) { +if (alt_timeout ==USB3_LPM_DISABLED ) { *timeout = alt_timeout;return -E2BIG ; }
@@ -4645,10 +4657,12 @@ static u16 xhci_calculate_lpm_timeout(struct usb_hcd *hcd,if (intf->dev.driver) { driver =to_usb_driver (intf->dev.driver);if (driver && driver->disable_hub_initiated_lpm) { -dev_dbg (&udev->dev,"Hub-initiated %s disabled " -"at request of driver %s\n" , - state_name, driver->name); -return xhci_get_timeout_no_hub_lpm (udev, state); +dev_dbg (&udev->dev,"Hub-initiated %s disabled at request of driver %s\n" , + state_name, driver->name); + timeout =xhci_get_timeout_no_hub_lpm (udev, + state); +if (timeout ==USB3_LPM_DISABLED ) +return timeout; } }
drivers/usb/image/microtek.c +4 -0
@@ -724,6 +724,10 @@ static int mts_usb_probe(struct usb_interface *intf, } +if (ep_in_current != &ep_in_set[2 ]) { +MTS_WARNING ("couldn't find two input bulk endpoints. Bailing out.\n" ); +return -ENODEV ; + }if ( ep_out ==-1 ) {MTS_WARNING ("couldn't find an output bulk endpoint. Bailing out.\n" );
drivers/usb/misc/Kconfig +0 -10
@@ -46,16 +46,6 @@ config USB_SEVSEG To compile this driver as a module, choose M here: the module will be called usbsevseg. -config USB_RIO500 - tristate "USB Diamond Rio500 support" - help - Say Y here if you want to connect a USB Rio500 mp3 player to your - computer's USB port. Please read <file:Documentation/usb/rio.txt> - for more information. - - To compile this driver as a module, choose M here: the - module will be called rio500. - config USB_LEGOTOWER tristate "USB Lego Infrared Tower support" help
drivers/usb/misc/Makefile +0 -1
@@ -17,7 +17,6 @@ obj-$(CONFIG_USB_LCD) += usblcd.o obj-$(CONFIG_USB_LD) += ldusb.o obj-$(CONFIG_USB_LED) += usbled.o obj-$(CONFIG_USB_LEGOTOWER) += legousbtower.o -obj-$(CONFIG_USB_RIO500) += rio500.o obj-$(CONFIG_USB_TEST) += usbtest.o obj-$(CONFIG_USB_EHSET_TEST_FIXTURE) += ehset.o obj-$(CONFIG_USB_TRANCEVIBRATOR) += trancevibrator.o
drivers/usb/misc/adutux.c +15 -11
@@ -80,6 +80,7 @@ struct adu_device {char serial_number[8 ];int open_count;/* number of times this port has been opened */ + unsigned long disconnected:1;char *read_buffer_primary;int read_buffer_length;
@@ -121,7 +122,7 @@ static void adu_abort_transfers(struct adu_device *dev) {unsigned long flags; -if (dev->udev ==NULL ) +if (dev->disconnected)return ;/* shutdown transfer */
@@ -151,6 +152,7 @@ static void adu_delete(struct adu_device *dev)kfree (dev->read_buffer_secondary);kfree (dev->interrupt_in_buffer);kfree (dev->interrupt_out_buffer); +usb_put_dev (dev->udev);kfree (dev); }
@@ -244,7 +246,7 @@ static int adu_open(struct inode *inode, struct file *file) } dev =usb_get_intfdata (interface); -if (!dev || !dev->udev) { +if (!dev) { retval = -ENODEV ; goto exit_no_device; }
@@ -327,7 +329,7 @@ static int adu_release(struct inode *inode, struct file *file) }adu_release_internal (dev); -if (dev->udev ==NULL ) { +if (dev->disconnected) {/* the device was unplugged before the file was released */ if (!dev->open_count)/* ... and we're the last user */ adu_delete (dev);
@@ -356,7 +358,7 @@ static ssize_t adu_read(struct file *file, __user char *buffer, size_t count,return -ERESTARTSYS ;/* verify that the device wasn't unplugged */ -if (dev->udev ==NULL ) { +if (dev->disconnected) { retval = -ENODEV ;pr_err ("No device or device unplugged %d\n" , retval); goto exit;
@@ -525,7 +527,7 @@ static ssize_t adu_write(struct file *file, const __user char *buffer, goto exit_nolock;/* verify that the device wasn't unplugged */ -if (dev->udev ==NULL ) { +if (dev->disconnected) { retval = -ENODEV ;pr_err ("No device or device unplugged %d\n" , retval); goto exit;
@@ -680,7 +682,7 @@ static int adu_probe(struct usb_interface *interface,mutex_init (&dev->mtx);spin_lock_init (&dev->buflock); - dev->udev = udev; + dev->udev =usb_get_dev (udev);init_waitqueue_head (&dev->read_wait);init_waitqueue_head (&dev->write_wait);
@@ -800,19 +802,21 @@ error:static void adu_disconnect (struct usb_interface *interface) {struct adu_device *dev; -int minor; dev =usb_get_intfdata (interface); -mutex_lock (&dev->mtx);/* not interruptible */ - dev->udev =NULL ;/* poison */ - minor = dev->minor;usb_deregister_dev (interface, &adu_class); -mutex_unlock (&dev->mtx); + +usb_poison_urb (dev->interrupt_in_urb); +usb_poison_urb (dev->interrupt_out_urb);mutex_lock (&adutux_mutex);usb_set_intfdata (interface,NULL ); +mutex_lock (&dev->mtx);/* not interruptible */ + dev->disconnected =1 ; +mutex_unlock (&dev->mtx); +/* if the device is not opened, then we clean up right now */ if (!dev->open_count)adu_delete (dev);
drivers/usb/misc/chaoskey.c +3 -2
@@ -96,6 +96,7 @@ static void chaoskey_free(struct chaoskey *dev)usb_dbg (dev->interface,"free" );kfree (dev->name);kfree (dev->buf); +usb_put_intf (dev->interface);kfree (dev); }
@@ -144,6 +145,8 @@ static int chaoskey_probe(struct usb_interface *interface,if (dev ==NULL )return -ENOMEM ; + dev->interface =usb_get_intf (interface); + dev->buf =kmalloc (size,GFP_KERNEL );if (dev->buf ==NULL ) {
@@ -169,8 +172,6 @@ static int chaoskey_probe(struct usb_interface *interface,strcat (dev->name, udev->serial); } - dev->interface = interface; - dev->in_ep = in_ep; dev->size = size;
drivers/usb/misc/iowarrior.c +11 -5
@@ -89,6 +89,7 @@ struct iowarrior {char chip_serial[9 ];/* the serial number string of the chip connected */ int report_size;/* number of bytes in a report */ u16 product_id; +struct usb_anchor submitted; };/*--------------*/
@@ -248,6 +249,7 @@ static inline void iowarrior_delete(struct iowarrior *dev)kfree (dev->int_in_buffer);usb_free_urb (dev->int_in_urb);kfree (dev->read_queue); +usb_put_intf (dev->interface);kfree (dev); }
@@ -436,11 +438,13 @@ static ssize_t iowarrior_write(struct file *file, retval = -EFAULT ; goto error; } +usb_anchor_urb (int_out_urb, &dev->submitted); retval =usb_submit_urb (int_out_urb,GFP_KERNEL );if (retval) {dev_dbg (&dev->interface->dev,"submit error %d for urb nr.%d\n" , retval,atomic_read (&dev->write_busy)); +usb_unanchor_urb (int_out_urb); goto error; }/* submit was ok */
@@ -782,11 +786,13 @@ static int iowarrior_probe(struct usb_interface *interface,init_waitqueue_head (&dev->write_wait); dev->udev = udev; - dev->interface = interface; + dev->interface =usb_get_intf (interface); iface_desc = interface->cur_altsetting; dev->product_id =le16_to_cpu (udev->descriptor.idProduct); +init_usb_anchor (&dev->submitted); +/* set up the endpoint information */ for (i =0 ; i < iface_desc->desc.bNumEndpoints; ++i) { endpoint = &iface_desc->endpoint[i].desc;
@@ -898,8 +904,6 @@ static void iowarrior_disconnect(struct usb_interface *interface) dev =usb_get_intfdata (interface);mutex_lock (&iowarrior_open_disc_lock);usb_set_intfdata (interface,NULL ); -/* prevent device read, write and ioctl */ - dev->present =0 ; minor = dev->minor;mutex_unlock (&iowarrior_open_disc_lock);
@@ -910,8 +914,7 @@ static void iowarrior_disconnect(struct usb_interface *interface)mutex_lock (&dev->mutex);/* prevent device read, write and ioctl */ - -mutex_unlock (&dev->mutex); + dev->present =0 ;if (dev->opened) {/* There is a process that holds a filedescriptor to the device ,
@@ -919,10 +922,13 @@ static void iowarrior_disconnect(struct usb_interface *interface)Deleting the device is postponed until close() was called. */ usb_kill_urb (dev->int_in_urb); +usb_kill_anchored_urbs (&dev->submitted);wake_up_interruptible (&dev->read_wait);wake_up_interruptible (&dev->write_wait); +mutex_unlock (&dev->mutex); }else {/* no process is using the device, cleanup now */ +mutex_unlock (&dev->mutex);iowarrior_delete (dev); }
drivers/usb/misc/ldusb.c +12 -12
@@ -158,6 +158,7 @@ MODULE_PARM_DESC(min_interrupt_out_interval, "Minimum interrupt out interval instruct ld_usb {struct mutex mutex;/* locks this structure */ struct usb_interface * intf;/* save off the usb interface pointer */ +unsigned long disconnected:1 ;int open_count;/* number of times this port has been opened */
@@ -197,12 +198,10 @@ static void ld_usb_abort_transfers(struct ld_usb *dev)/* shutdown transfer */ if (dev->interrupt_in_running) { dev->interrupt_in_running =0 ; -if (dev->intf) -usb_kill_urb (dev->interrupt_in_urb); +usb_kill_urb (dev->interrupt_in_urb); }if (dev->interrupt_out_busy) -if (dev->intf) -usb_kill_urb (dev->interrupt_out_urb); +usb_kill_urb (dev->interrupt_out_urb); }/**
@@ -210,8 +209,6 @@ static void ld_usb_abort_transfers(struct ld_usb *dev)*/ static void ld_usb_delete (struct ld_usb *dev) { -ld_usb_abort_transfers (dev); -/* free data structures */ usb_free_urb (dev->interrupt_in_urb);usb_free_urb (dev->interrupt_out_urb);
@@ -267,7 +264,7 @@ static void ld_usb_interrupt_in_callback(struct urb *urb) resubmit:/* resubmit if we're still running */ -if (dev->interrupt_in_running && !dev->buffer_overflow && dev->intf) { +if (dev->interrupt_in_running && !dev->buffer_overflow) { retval =usb_submit_urb (dev->interrupt_in_urb,GFP_ATOMIC );if (retval) { dev_err(&dev->intf->dev,
@@ -396,7 +393,7 @@ static int ld_usb_release(struct inode *inode, struct file *file) retval = -ENODEV ; goto unlock_exit; } -if (dev->intf ==NULL ) { +if (dev->disconnected) {/* the device was unplugged before the file was released */ mutex_unlock (&dev->mutex);/* unlock here as ld_usb_delete frees dev */
@@ -427,7 +424,7 @@ static unsigned int ld_usb_poll(struct file *file, poll_table *wait) dev = file->private_data; -if (!dev->intf) +if (dev->disconnected)return POLLERR |POLLHUP ;poll_wait (file, &dev->read_wait, wait);
@@ -466,7 +463,7 @@ static ssize_t ld_usb_read(struct file *file, char __user *buffer, size_t count, }/* verify that the device wasn't unplugged */ -if (dev->intf ==NULL ) { +if (dev->disconnected) { retval = -ENODEV ;printk (KERN_ERR "ldusb: No device or device unplugged %d\n" , retval); goto unlock_exit;
@@ -546,7 +543,7 @@ static ssize_t ld_usb_write(struct file *file, const char __user *buffer, }/* verify that the device wasn't unplugged */ -if (dev->intf ==NULL ) { +if (dev->disconnected) { retval = -ENODEV ;printk (KERN_ERR "ldusb: No device or device unplugged %d\n" , retval); goto unlock_exit;
@@ -782,6 +779,9 @@ static void ld_usb_disconnect(struct usb_interface *intf)/* give back our minor */ usb_deregister_dev (intf, &ld_usb_class); +usb_poison_urb (dev->interrupt_in_urb); +usb_poison_urb (dev->interrupt_out_urb); +mutex_lock (&dev->mutex);/* if the device is not opened, then we clean up right now */
@@ -789,7 +789,7 @@ static void ld_usb_disconnect(struct usb_interface *intf)mutex_unlock (&dev->mutex);ld_usb_delete (dev); }else { - dev->intf =NULL ; + dev->disconnected =1 ;/* wake up pollers */ wake_up_interruptible_all (&dev->read_wait);wake_up_interruptible_all (&dev->write_wait);
drivers/usb/misc/legousbtower.c +25 -33
206 lines not on this page · raw message
drivers/usb/misc/rio500.c deleted +0 -578
578 lines not on this page · raw message
drivers/usb/misc/rio500_usb.h deleted +0 -37
@@ -1,37 +0,0 @@ -/* ---------------------------------------------------------------------- - -Copyright (C) 2000 Cesar Miquel ([email protected]) - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - ----------------------------------------------------------------------- */ - - - -#define RIO_SEND_COMMAND 0x1 -#define RIO_RECV_COMMAND 0x2 - -#define RIO_DIR_OUT 0x0 -#define RIO_DIR_IN 0x1 - -struct RioCommand { -short length; -int request; -int requesttype; -int value; -int index; -void __user *buffer; -int timeout; -};
drivers/usb/misc/usblcd.c +31 -2
@@ -17,6 +17,7 @@#include <linux/slab.h> #include <linux/errno.h> #include <linux/mutex.h> +#include <linux/rwsem.h> #include <linux/uaccess.h> #include <linux/usb.h>
@@ -56,6 +57,8 @@ struct usb_lcd {using up all RAM */ struct usb_anchor submitted;/* URBs to wait for before suspend */ +struct rw_semaphore io_rwsem; + unsigned long disconnected:1; };#define to_lcd_dev (d) container_of(d, struct usb_lcd, kref)
@@ -141,6 +144,13 @@ static ssize_t lcd_read(struct file *file, char __user * buffer, dev = file->private_data; +down_read (&dev->io_rwsem); + +if (dev->disconnected) { + retval = -ENODEV ; + goto out_up_io; + } +/* do a blocking bulk read to get data from the device */ retval = usb_bulk_msg(dev->udev, usb_rcvbulkpipe(dev->udev,
@@ -157,6 +167,9 @@ static ssize_t lcd_read(struct file *file, char __user * buffer, retval = bytes_read; } +out_up_io: +up_read (&dev->io_rwsem); +return retval; }
@@ -236,11 +249,18 @@ static ssize_t lcd_write(struct file *file, const char __user * user_buffer,if (r <0 )return -EINTR ; +down_read (&dev->io_rwsem); + +if (dev->disconnected) { + retval = -ENODEV ; + goto err_up_io; + } +/* create a urb, and a buffer for it, and copy the data to the urb */ urb =usb_alloc_urb (0 ,GFP_KERNEL );if (!urb) { retval = -ENOMEM ; - goto err_no_buf; + goto err_up_io; } buf = usb_alloc_coherent(dev->udev, count, GFP_KERNEL,
@@ -277,6 +297,7 @@ static ssize_t lcd_write(struct file *file, const char __user * user_buffer,the USB core will eventually free it entirely */ usb_free_urb (urb); +up_read (&dev->io_rwsem); exit:return count; error_unanchor:
@@ -284,7 +305,8 @@ error_unanchor: error:usb_free_coherent (dev->udev, count, buf, urb->transfer_dma);usb_free_urb (urb); -err_no_buf: +err_up_io: +up_read (&dev->io_rwsem);up (&dev->limit_sem);return retval; }
@@ -327,6 +349,7 @@ static int lcd_probe(struct usb_interface *interface, }kref_init (&dev->kref);sema_init (&dev->limit_sem,USB_LCD_CONCURRENT_WRITES ); +init_rwsem (&dev->io_rwsem);init_usb_anchor (&dev->submitted); dev->udev =usb_get_dev (interface_to_usbdev (interface));
@@ -437,6 +460,12 @@ static void lcd_disconnect(struct usb_interface *interface)/* give back our minor */ usb_deregister_dev (interface, &lcd_class); +down_write (&dev->io_rwsem); + dev->disconnected =1 ; +up_write (&dev->io_rwsem); + +usb_kill_anchored_urbs (&dev->submitted); +/* decrement our usage count */ kref_put (&dev->kref, lcd_delete);
drivers/usb/misc/yurex.c +11 -7
@@ -64,6 +64,7 @@ struct usb_yurex {struct kref kref;struct mutex io_mutex; + unsigned long disconnected:1;struct fasync_struct *async_queue;wait_queue_head_t waitq;
@@ -111,6 +112,7 @@ static void yurex_delete(struct kref *kref) dev->int_buffer, dev->urb->transfer_dma);usb_free_urb (dev->urb); } +usb_put_intf (dev->interface);usb_put_dev (dev->udev);kfree (dev); }
@@ -136,6 +138,7 @@ static void yurex_interrupt(struct urb *urb)switch (status) {case 0 :/*success*/ break ; +/* The device is terminated or messed up, give up */ case -EOVERFLOW : dev_err(&dev->interface->dev, "%s - overflow with length %d, actual length is %d\n",
@@ -144,12 +147,13 @@ static void yurex_interrupt(struct urb *urb)case -ENOENT :case -ESHUTDOWN :case -EILSEQ : -/* The device is terminated, clean up */ +case -EPROTO : +case -ETIME :return ;default :dev_err (&dev->interface->dev,"%s - unknown status received: %d\n" , __func__, status); - goto exit; +return ; }/* handle received message */
@@ -181,7 +185,6 @@ static void yurex_interrupt(struct urb *urb)break ; } -exit: retval =usb_submit_urb (dev->urb,GFP_ATOMIC );if (retval) { dev_err(&dev->interface->dev, "%s - usb_submit_urb failed: %d\n",
@@ -210,7 +213,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_init_waitqueue_head (&dev->waitq); dev->udev =usb_get_dev (interface_to_usbdev (interface)); - dev->interface = interface; + dev->interface =usb_get_intf (interface);/* set up the endpoint information */ iface_desc = interface->cur_altsetting;
@@ -333,8 +336,9 @@ static void yurex_disconnect(struct usb_interface *interface)/* prevent more I/O from starting */ usb_poison_urb (dev->urb); +usb_poison_urb (dev->cntl_urb);mutex_lock (&dev->io_mutex); - dev->interface =NULL ; + dev->disconnected =1 ;mutex_unlock (&dev->io_mutex);/* wakeup waiters */
@@ -422,7 +426,7 @@ static ssize_t yurex_read(struct file *file, char __user *buffer, size_t count, dev = file->private_data;mutex_lock (&dev->io_mutex); -if (!dev->interface) {/* already disconnected */ +if (dev->disconnected) {/* already disconnected */ mutex_unlock (&dev->io_mutex);return -ENODEV ; }
@@ -457,7 +461,7 @@ static ssize_t yurex_write(struct file *file, const char __user *user_buffer, goto error;mutex_lock (&dev->io_mutex); -if (!dev->interface) {/* already disconnected */ +if (dev->disconnected) {/* already disconnected */ mutex_unlock (&dev->io_mutex); retval = -ENODEV ; goto error;
drivers/usb/renesas_usbhs/common.h +1 -0
@@ -213,6 +213,7 @@ struct usbhs_priv;/* DCPCTR */ #define BSTS (1 << 15)/* Buffer Status */ #define SUREQ (1 << 14)/* Sending SETUP Token */ +#define INBUFM (1 << 14)/* (PIPEnCTR) Transfer Buffer Monitor */ #define CSSTS (1 << 12)/* CSSTS Status */ #define ACLRM (1 << 9)/* Buffer Auto-Clear Mode */ #define SQCLR (1 << 8)/* Toggle Bit Clear */
drivers/usb/renesas_usbhs/fifo.c +1 -1
@@ -98,7 +98,7 @@ static void __usbhsf_pkt_del(struct usbhs_pkt *pkt)list_del_init (&pkt->node); } -static struct usbhs_pkt *__usbhsf_pkt_get (struct usbhs_pipe *pipe) +struct usbhs_pkt *__usbhsf_pkt_get (struct usbhs_pipe *pipe) {if (list_empty (&pipe->list))return NULL ;
drivers/usb/renesas_usbhs/fifo.h +1 -0
@@ -106,5 +106,6 @@ void usbhs_pkt_push(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt, void *buf, int len, int zero, int sequence);struct usbhs_pkt *usbhs_pkt_pop (struct usbhs_pipe *pipe,struct usbhs_pkt *pkt);void usbhs_pkt_start (struct usbhs_pipe *pipe); +struct usbhs_pkt *__usbhsf_pkt_get (struct usbhs_pipe *pipe);#endif /* RENESAS_USB_FIFO_H */
drivers/usb/renesas_usbhs/mod_gadget.c +15 -3
@@ -731,8 +731,7 @@ static int __usbhsg_ep_set_halt_wedge(struct usb_ep *ep, int halt, int wedge)struct usbhs_priv *priv =usbhsg_gpriv_to_priv (gpriv);struct device *dev =usbhsg_gpriv_to_dev (gpriv);unsigned long flags; - -usbhsg_pipe_disable (uep); +int ret =0 ;dev_dbg (dev,"set halt %d (pipe %d)\n" , halt,usbhs_pipe_number (pipe));
@@ -740,6 +739,18 @@ static int __usbhsg_ep_set_halt_wedge(struct usb_ep *ep, int halt, int wedge)/******************** spin lock ********************/ usbhs_lock (priv, flags); +/* +* According to usb_ep_set_halt()'s description, this function should +* return -EAGAIN if the IN endpoint has any queue or data. Note +* that the usbhs_pipe_is_dir_in() returns false if the pipe is an +* IN endpoint in the gadget mode. +*/ +if (!usbhs_pipe_is_dir_in (pipe) && (__usbhsf_pkt_get (pipe) || +usbhs_pipe_contains_transmittable_data (pipe))) { + ret = -EAGAIN ; + goto out; + } +if (halt)usbhs_pipe_stall (pipe);else
@@ -750,10 +761,11 @@ static int __usbhsg_ep_set_halt_wedge(struct usb_ep *ep, int halt, int wedge)else usbhsg_status_clr (gpriv,USBHSG_STATUS_WEDGE ); +out:usbhs_unlock (priv, flags);/******************** spin unlock ******************/ -return 0 ; +return ret; }static int usbhsg_ep_set_halt (struct usb_ep *ep,int value)
drivers/usb/renesas_usbhs/pipe.c +15 -0
@@ -279,6 +279,21 @@ int usbhs_pipe_is_accessible(struct usbhs_pipe *pipe)return -EBUSY ; } +bool usbhs_pipe_contains_transmittable_data (struct usbhs_pipe *pipe) +{ +u16 val; + +/* Do not support for DCP pipe */ +if (usbhs_pipe_is_dcp (pipe)) +return false; + + val =usbhsp_pipectrl_get (pipe); +if (val &INBUFM ) +return true; + +return false; +} +/* * PID ctrl */
drivers/usb/renesas_usbhs/pipe.h +1 -0
@@ -89,6 +89,7 @@ void usbhs_pipe_init(struct usbhs_priv *priv,int usbhs_pipe_get_maxpacket (struct usbhs_pipe *pipe);void usbhs_pipe_clear (struct usbhs_pipe *pipe);int usbhs_pipe_is_accessible (struct usbhs_pipe *pipe); +bool usbhs_pipe_contains_transmittable_data (struct usbhs_pipe *pipe);void usbhs_pipe_enable (struct usbhs_pipe *pipe);void usbhs_pipe_disable (struct usbhs_pipe *pipe);void usbhs_pipe_stall (struct usbhs_pipe *pipe);
drivers/usb/serial/ftdi_sio.c +3 -0
@@ -1025,6 +1025,9 @@ static const struct usb_device_id id_table_combined[] = {/* EZPrototypes devices */ { USB_DEVICE(EZPROTOTYPES_VID, HJELMSLUND_USB485_ISO_PID) }, { USB_DEVICE_INTERFACE_NUMBER(UNJO_VID, UNJO_ISODEBUG_V1_PID, 1) }, +/* Sienna devices */ + { USB_DEVICE(FTDI_VID, FTDI_SIENNA_PID) }, + { USB_DEVICE(ECHELON_VID, ECHELON_U20_PID) }, { } /* Terminating entry */ };
drivers/usb/serial/ftdi_sio_ids.h +9 -0
@@ -38,6 +38,9 @@#define FTDI_LUMEL_PD12_PID 0x6002 +/* Sienna Serial Interface by Secyourit GmbH */ +#define FTDI_SIENNA_PID 0x8348 +/* Cyber Cortex AV by Fabulous Silicon (http://fabuloussilicon.com) */ #define CYBER_CORTEX_AV_PID 0x8698
@@ -687,6 +690,12 @@#define BANDB_TTL3USB9M_PID 0xAC50#define BANDB_ZZ_PROG1_USB_PID 0xBA02 +/* +* Echelon USB Serial Interface +*/ +#define ECHELON_VID 0x0920 +#define ECHELON_U20_PID 0x7500 +/* * Intrepid Control Systems (http://www.intrepidcs.com/) ValueCAN and NeoVI */
drivers/usb/serial/keyspan.c +2 -2
@@ -1249,8 +1249,8 @@ static struct urb *keyspan_setup_urb(struct usb_serial *serial, int endpoint, ep_desc =find_ep (serial, endpoint);if (!ep_desc) { -/* leak the urb, something's wrong and the callers don't care */ -return urb; +usb_free_urb (urb); +return NULL ; }if (usb_endpoint_xfer_int (ep_desc)) { ep_type_name ="INT" ;
drivers/usb/serial/option.c +11 -0
@@ -421,6 +421,7 @@ static void option_instat_callback(struct urb *urb);#define CINTERION_PRODUCT_PH8_AUDIO 0x0083#define CINTERION_PRODUCT_AHXX_2RMNET 0x0084#define CINTERION_PRODUCT_AHXX_AUDIO 0x0085 +#define CINTERION_PRODUCT_CLS8 0x00b0/* Olivetti products */ #define OLIVETTI_VENDOR_ID 0x0b3c
@@ -1149,6 +1150,14 @@ static const struct usb_device_id option_ids[] = { .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) | RSVD(3) }, { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, TELIT_PRODUCT_LE922_USBCFG5, 0xff), .driver_info = RSVD(0) | RSVD(1) | NCTRL(2) | RSVD(3) }, + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1050, 0xff), /* Telit FN980 (rmnet) */ + .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) }, + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1051, 0xff), /* Telit FN980 (MBIM) */ + .driver_info = NCTRL(0) | RSVD(1) }, + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1052, 0xff), /* Telit FN980 (RNDIS) */ + .driver_info = NCTRL(2) | RSVD(3) }, + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1053, 0xff), /* Telit FN980 (ECM) */ + .driver_info = NCTRL(0) | RSVD(1) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910), .driver_info = NCTRL(0) | RSVD(1) | RSVD(3) }, { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM),
@@ -1842,6 +1851,8 @@ static const struct usb_device_id option_ids[] = { .driver_info = RSVD(4) }, { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AHXX_2RMNET, 0xff) }, { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AHXX_AUDIO, 0xff) }, + { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_CLS8, 0xff), + .driver_info = RSVD(0) | RSVD(4) }, { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) }, { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) }, { USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDM) },
drivers/usb/serial/usb-serial.c +1 -4
@@ -314,10 +314,7 @@ static void serial_cleanup(struct tty_struct *tty) serial = port->serial; owner = serial->type->driver.owner; -mutex_lock (&serial->disc_mutex); -if (!serial->disconnected) -usb_autopm_put_interface (serial->interface); -mutex_unlock (&serial->disc_mutex); +usb_autopm_put_interface (serial->interface);usb_serial_put (serial);module_put (owner);
drivers/usb/usb-skeleton.c +7 -8
@@ -63,6 +63,7 @@ struct usb_skel {spinlock_t err_lock;/* lock for errors */ struct kref kref;struct mutex io_mutex;/* synchronize I/O with disconnect */ + unsigned long disconnected:1;wait_queue_head_t bulk_in_wait;/* to wait for an ongoing read */ };#define to_skel_dev (d) container_of(d, struct usb_skel, kref)
@@ -75,6 +76,7 @@ static void skel_delete(struct kref *kref)struct usb_skel *dev =to_skel_dev (kref);usb_free_urb (dev->bulk_in_urb); +usb_put_intf (dev->interface);usb_put_dev (dev->udev);kfree (dev->bulk_in_buffer);kfree (dev);
@@ -126,10 +128,7 @@ static int skel_release(struct inode *inode, struct file *file)return -ENODEV ;/* allow the device to be autosuspended */ -mutex_lock (&dev->io_mutex); -if (dev->interface) -usb_autopm_put_interface (dev->interface); -mutex_unlock (&dev->io_mutex); +usb_autopm_put_interface (dev->interface);/* decrement the count on our device */ kref_put (&dev->kref, skel_delete);
@@ -241,7 +240,7 @@ static ssize_t skel_read(struct file *file, char *buffer, size_t count,if (rv <0 )return rv; -if (!dev->interface) {/* disconnect() was called */ +if (dev->disconnected) {/* disconnect() was called */ rv = -ENODEV ; goto exit; }
@@ -422,7 +421,7 @@ static ssize_t skel_write(struct file *file, const char *user_buffer,/* this lock makes sure we don't submit URBs to gone devices */ mutex_lock (&dev->io_mutex); -if (!dev->interface) {/* disconnect() was called */ +if (dev->disconnected) {/* disconnect() was called */ mutex_unlock (&dev->io_mutex); retval = -ENODEV ; goto error;
@@ -511,7 +510,7 @@ static int skel_probe(struct usb_interface *interface,init_waitqueue_head (&dev->bulk_in_wait); dev->udev =usb_get_dev (interface_to_usbdev (interface)); - dev->interface = interface; + dev->interface =usb_get_intf (interface);/* set up the endpoint information */ /* use only the first bulk-in and bulk-out endpoints */
@@ -590,7 +589,7 @@ static void skel_disconnect(struct usb_interface *interface)/* prevent more I/O from starting */ mutex_lock (&dev->io_mutex); - dev->interface =NULL ; + dev->disconnected =1 ;mutex_unlock (&dev->io_mutex);usb_kill_anchored_urbs (&dev->submitted);
drivers/xen/pci.c +15 -6
@@ -29,6 +29,8 @@#include "../pci/pci.h" #ifdef CONFIG_PCI_MMCONFIG #include <asm/pci_x86.h> + +static int xen_mcfg_late (void );#endif static bool __read_mostly pci_seg_supported = true;
@@ -40,7 +42,18 @@ static int xen_add_device(struct device *dev)#ifdef CONFIG_PCI_IOV struct pci_dev *physfn = pci_dev->physfn;#endif - +#ifdef CONFIG_PCI_MMCONFIG +static bool pci_mcfg_reserved = false; +/* +* Reserve MCFG areas in Xen on first invocation due to this being +* potentially called from inside of acpi_init immediately after +* MCFG table has been finally parsed. +*/ +if (!pci_mcfg_reserved) { +xen_mcfg_late (); + pci_mcfg_reserved = true; + } +#endif if (pci_seg_supported) {struct {struct physdev_pci_device_add add;
@@ -213,7 +226,7 @@ static int __init register_xen_pci_notifier(void)arch_initcall (register_xen_pci_notifier);#ifdef CONFIG_PCI_MMCONFIG -static int __init xen_mcfg_late (void ) +static int xen_mcfg_late (void ) {struct pci_mmcfg_region *cfg;int rc;
@@ -252,8 +265,4 @@ static int __init xen_mcfg_late(void) }return 0 ; } -/* -* Needs to be done after acpi_init which are subsys_initcall. -*/ -subsys_initcall_sync (xen_mcfg_late);#endif
fs/9p/vfs_file.c +3 -0
@@ -528,6 +528,7 @@ v9fs_mmap_file_mmap(struct file *filp, struct vm_area_struct *vma) v9inode =V9FS_I (inode);mutex_lock (&v9inode->v_mutex);if (!v9inode->writeback_fid && + (vma->vm_flags &VM_SHARED ) && (vma->vm_flags &VM_WRITE )) {/* * clone a fid and add it to writeback_fid
@@ -629,6 +630,8 @@ static void v9fs_mmap_vm_close(struct vm_area_struct *vma) (vma->vm_end - vma->vm_start - 1), }; +if (!(vma->vm_flags &VM_SHARED )) +return ;p9_debug (P9_DEBUG_VFS ,"9p VMA close, %p, flushing" , vma);
fs/ceph/inode.c +6 -1
@@ -725,7 +725,12 @@ static int fill_inode(struct inode *inode, struct page *locked_page, ci->i_version =le64_to_cpu (info->version); inode->i_version++; inode->i_rdev =le32_to_cpu (info->rdev); - inode->i_blkbits =fls (le32_to_cpu (info->layout.fl_stripe_unit)) -1 ; +/* directories have fl_stripe_unit set to zero */ +if (le32_to_cpu (info->layout.fl_stripe_unit)) + inode->i_blkbits = +fls (le32_to_cpu (info->layout.fl_stripe_unit)) -1 ; +else + inode->i_blkbits =CEPH_BLOCK_SHIFT ;if ((new_version || (new_issued &CEPH_CAP_AUTH_SHARED )) && (issued &CEPH_CAP_AUTH_EXCL ) ==0 ) {
fs/cifs/dir.c +7 -1
@@ -830,10 +830,16 @@ lookup_out:static int cifs_d_revalidate (struct dentry *direntry,unsigned int flags) { +struct inode *inode; +if (flags &LOOKUP_RCU )return -ECHILD ;if (d_really_is_positive (direntry)) { + inode =d_inode (direntry); +if ((flags &LOOKUP_REVAL ) && !CIFS_CACHE_READ (CIFS_I (inode))) +CIFS_I (inode)->time =0 ;/* force reval */ +if (cifs_revalidate_dentry (direntry))return 0 ;else {
@@ -844,7 +850,7 @@ cifs_d_revalidate(struct dentry *direntry, unsigned int flags)* attributes will have been updated by * cifs_revalidate_dentry(). */ -if (IS_AUTOMOUNT (d_inode (direntry)) && +if (IS_AUTOMOUNT (inode) && !(direntry->d_flags &DCACHE_NEED_AUTOMOUNT )) {spin_lock (&direntry->d_lock); direntry->d_flags |=DCACHE_NEED_AUTOMOUNT ;
fs/cifs/file.c +6 -0
@@ -252,6 +252,12 @@ cifs_nt_open(char *full_path, struct inode *inode, struct cifs_sb_info *cifs_sb, rc =cifs_get_inode_info (&inode, full_path, buf, inode->i_sb, xid, fid); +if (rc) { + server->ops->close (xid, tcon, fid); +if (rc == -ESTALE ) + rc = -EOPENSTALE ; + } + out:kfree (buf);return rc;
fs/cifs/inode.c +26 -2
@@ -405,6 +405,7 @@ int cifs_get_inode_info_unix(struct inode **pinode,/* if uniqueid is different, return error */ if (unlikely (cifs_sb->mnt_cifs_flags &CIFS_MOUNT_SERVER_INUM &&CIFS_I (*pinode)->uniqueid != fattr.cf_uniqueid)) { +CIFS_I (*pinode)->time =0 ;/* force reval */ rc = -ESTALE ; goto cgiiu_exit; }
@@ -412,6 +413,7 @@ int cifs_get_inode_info_unix(struct inode **pinode,/* if filetype is different, return error */ if (unlikely (((*pinode)->i_mode &S_IFMT ) != (fattr.cf_mode &S_IFMT ))) { +CIFS_I (*pinode)->time =0 ;/* force reval */ rc = -ESTALE ; goto cgiiu_exit; }
@@ -829,8 +831,21 @@ cifs_get_inode_info(struct inode **inode, const char *full_path, } }else fattr.cf_uniqueid =iunique (sb,ROOT_I ); - }else - fattr.cf_uniqueid =CIFS_I (*inode)->uniqueid; + }else { +if ((cifs_sb->mnt_cifs_flags &CIFS_MOUNT_SERVER_INUM ) && + validinum == false && server->ops->get_srv_inum) { +/* +* Pass a NULL tcon to ensure we don't make a round +* trip to the server. This only works for SMB2+. +*/ + tmprc = server->ops->get_srv_inum (xid, +NULL , cifs_sb, full_path, + &fattr.cf_uniqueid, data); +if (tmprc) + fattr.cf_uniqueid =CIFS_I (*inode)->uniqueid; + }else + fattr.cf_uniqueid =CIFS_I (*inode)->uniqueid; + }/* query for SFU type info if supported and needed */ if (fattr.cf_cifsattrs & ATTR_SYSTEM &&
@@ -871,9 +886,18 @@ cifs_get_inode_info(struct inode **inode, const char *full_path, }else {/* we already have inode, update it */ +/* if uniqueid is different, return error */ +if (unlikely (cifs_sb->mnt_cifs_flags &CIFS_MOUNT_SERVER_INUM && +CIFS_I (*inode)->uniqueid != fattr.cf_uniqueid)) { +CIFS_I (*inode)->time =0 ;/* force reval */ + rc = -ESTALE ; + goto cgii_exit; + } +/* if filetype is different, return error */ if (unlikely (((*inode)->i_mode &S_IFMT ) != (fattr.cf_mode &S_IFMT ))) { +CIFS_I (*inode)->time =0 ;/* force reval */ rc = -ESTALE ; goto cgii_exit; }
fs/fuse/cuse.c +1 -0
@@ -513,6 +513,7 @@ static int cuse_channel_open(struct inode *inode, struct file *file) rc =cuse_send_init (cc);if (rc) {fuse_dev_free (fud); +fuse_conn_put (&cc->fc);return rc; } file->private_data = fud;
fs/nfs/nfs4xdr.c +1 -1
@@ -1123,7 +1123,7 @@ static void encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, }else *p++ =cpu_to_be32 (NFS4_SET_TO_SERVER_TIME ); } -if (bmval[2 ] &FATTR4_WORD2_SECURITY_LABEL ) { +if (label && (bmval[2 ] &FATTR4_WORD2_SECURITY_LABEL )) { *p++ =cpu_to_be32 (label->lfs); *p++ =cpu_to_be32 (label->pi); *p++ =cpu_to_be32 (label->len);
fs/xfs/xfs_super.c +10 -0
@@ -1572,6 +1572,7 @@ xfs_fs_fill_super( out_close_devices:xfs_close_devices (mp); out_free_fsname: + sb->s_fs_info =NULL ;xfs_free_fsname (mp);kfree (mp); out:
@@ -1589,6 +1590,10 @@ xfs_fs_put_super( {struct xfs_mount *mp =XFS_M (sb); +/* if ->fill_super failed, we have no mount to tear down */ +if (!sb->s_fs_info) +return ; +xfs_notice (mp,"Unmounting Filesystem" );xfs_filestream_unmount (mp);xfs_unmountfs (mp);
@@ -1598,6 +1603,8 @@ xfs_fs_put_super(xfs_destroy_percpu_counters (mp);xfs_destroy_mount_workqueues (mp);xfs_close_devices (mp); + + sb->s_fs_info =NULL ;xfs_free_fsname (mp);kfree (mp); }
@@ -1617,6 +1624,9 @@ xfs_fs_nr_cached_objects( struct super_block *sb, struct shrink_control *sc) { +/* Paranoia: catch incorrect calls during mount setup or teardown */ +if (WARN_ON_ONCE (!sb->s_fs_info)) +return 0 ;return xfs_reclaim_inodes_count (XFS_M (sb)); }
include/linux/ieee80211.h +53 -0
57 lines not on this page · raw message
include/sound/soc-dapm.h +2 -0
@@ -335,6 +335,8 @@ struct device;#define SND_SOC_DAPM_WILL_PMD 0x80/* called at start of sequence */ #define SND_SOC_DAPM_PRE_POST_PMD \ (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD) +#define SND_SOC_DAPM_PRE_POST_PMU \ + (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU)/* convenience event type detection */ #define SND_SOC_DAPM_EVENT_ON (e) \
kernel/elfcore.c +1 -0
@@ -2,6 +2,7 @@#include <linux/fs.h> #include <linux/mm.h> #include <linux/binfmts.h> +#include <linux/elfcore.h> Elf_Half __weak elf_core_extra_phdrs (void ) {
kernel/fork.c +2 -2
@@ -2152,7 +2152,7 @@ int sysctl_max_threads(struct ctl_table *table, int write,struct ctl_table t;int ret;int threads = max_threads; -int min =MIN_THREADS ; +int min =1 ;int max =MAX_THREADS ; t = *table;
@@ -2164,7 +2164,7 @@ int sysctl_max_threads(struct ctl_table *table, int write,if (ret || !write)return ret; -set_max_threads (threads); + max_threads = threads;return 0 ; }
kernel/panic.c +1 -0
@@ -84,6 +84,7 @@ void panic(const char *fmt, ...)* after the panic_lock is acquired) from invoking panic again. */ local_irq_disable (); +preempt_disable_notrace ();/* * It's possible to come here directly from a panic-assertion and
kernel/trace/trace.c +15 -2
@@ -3370,9 +3370,14 @@ static int show_traces_open(struct inode *inode, struct file *file)if (tracing_disabled)return -ENODEV ; +if (trace_array_get (tr) <0 ) +return -ENODEV ; + ret =seq_open (file, &show_traces_seq_ops); -if (ret) +if (ret) { +trace_array_put (tr);return ret; + } m = file->private_data; m->private = tr;
@@ -3380,6 +3385,14 @@ static int show_traces_open(struct inode *inode, struct file *file)return 0 ; } +static int show_traces_release (struct inode *inode,struct file *file) +{ +struct trace_array *tr = inode->i_private; + +trace_array_put (tr); +return seq_release (inode, file); +} +static ssize_t tracing_write_stub (struct file *filp,const char __user *ubuf,size_t count,loff_t *ppos)
@@ -3410,8 +3423,8 @@ static const struct file_operations tracing_fops = {static const struct file_operations show_traces_fops = { .open = show_traces_open, .read = seq_read, - .release = seq_release, .llseek = seq_lseek, + .release = show_traces_release, }; static ssize_t
net/wireless/nl80211.c +38 -1
@@ -210,6 +210,36 @@ cfg80211_get_dev_from_info(struct net *netns, struct genl_info *info)return __cfg80211_rdev_from_attrs (netns, info->attrs); } +static int validate_beacon_head (const struct nlattr *attr) +{ +const u8 *data =nla_data (attr); +unsigned int len =nla_len (attr); +const struct element *elem; +const struct ieee80211_mgmt *mgmt = (void *)data; +unsigned int fixedlen = offsetof(struct ieee80211_mgmt , + u.beacon.variable); + +if (len < fixedlen) + goto err; + +if (ieee80211_hdrlen (mgmt->frame_control) != + offsetof(struct ieee80211_mgmt, u.beacon)) + goto err; + + data += fixedlen; + len -= fixedlen; + +for_each_element (elem, data, len) { +/* nothing */ + } + +if (for_each_element_completed (elem, data, len)) +return 0 ; + +err: +return -EINVAL ; +} +/* policy for the attributes */ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR ] = { [NL80211_ATTR_WIPHY ] = { .type =NLA_U32 },
@@ -1934,6 +1964,8 @@ static int nl80211_parse_chandef(struct cfg80211_registered_device *rdev, control_freq =nla_get_u32 (info->attrs[NL80211_ATTR_WIPHY_FREQ ]); +memset (chandef,0 ,sizeof (*chandef)); + chandef->chan =ieee80211_get_channel (&rdev->wiphy, control_freq); chandef->width =NL80211_CHAN_WIDTH_20_NOHT ; chandef->center_freq1 = control_freq;
@@ -2402,7 +2434,7 @@ static int nl80211_send_iface(struct sk_buff *msg, u32 portid, u32 seq, int flagif (rdev->ops->get_channel) {int ret; -struct cfg80211_chan_def chandef; +struct cfg80211_chan_def chandef = {}; ret =rdev_get_channel (rdev, wdev, &chandef);if (ret ==0 ) {
@@ -3212,6 +3244,11 @@ static int nl80211_parse_beacon(struct nlattr *attrs[],memset (bcn,0 ,sizeof (*bcn));if (attrs[NL80211_ATTR_BEACON_HEAD ]) { +int ret =validate_beacon_head (attrs[NL80211_ATTR_BEACON_HEAD ]); + +if (ret) +return ret; + bcn->head =nla_data (attrs[NL80211_ATTR_BEACON_HEAD ]); bcn->head_len =nla_len (attrs[NL80211_ATTR_BEACON_HEAD ]);if (!bcn->head_len)
net/wireless/reg.c +1 -1
@@ -1604,7 +1604,7 @@ static void reg_call_notifier(struct wiphy *wiphy,static bool reg_wdev_chan_valid (struct wiphy *wiphy,struct wireless_dev *wdev) { -struct cfg80211_chan_def chandef; +struct cfg80211_chan_def chandef = {};struct cfg80211_registered_device *rdev =wiphy_to_rdev (wiphy);enum nl80211_iftype iftype;
net/wireless/wext-compat.c +1 -1
@@ -821,7 +821,7 @@ static int cfg80211_wext_giwfreq(struct net_device *dev, {struct wireless_dev *wdev = dev->ieee80211_ptr;struct cfg80211_registered_device *rdev =wiphy_to_rdev (wdev->wiphy); -struct cfg80211_chan_def chandef; +struct cfg80211_chan_def chandef = {};int ret;switch (wdev->iftype) {
security/integrity/ima/ima_crypto.c +4 -1
@@ -298,8 +298,11 @@ static int ima_calc_file_hash_atfm(struct file *file, rbuf_len =min_t (loff_t, i_size - offset, rbuf_size[active]); rc =integrity_kernel_read (file, offset, rbuf[active], rbuf_len); -if (rc != rbuf_len) +if (rc != rbuf_len) { +if (rc >=0 ) + rc = -EINVAL ; goto out3; + }if (rbuf[1 ] && offset) {/* Using two buffers, and it is not the first
sound/soc/codecs/sgtl5000.c +202 -30
282 lines not on this page · raw message
tools/lib/traceevent/event-parse.c +1 -2
@@ -265,10 +265,10 @@ static int add_new_comm(struct pevent *pevent, const char *comm, int pid) errno =ENOMEM ;return -1 ; } + pevent->cmdlines = cmdlines; cmdlines[pevent->cmdline_count].comm =strdup (comm);if (!cmdlines[pevent->cmdline_count].comm) { -free (cmdlines); errno =ENOMEM ;return -1 ; }
@@ -279,7 +279,6 @@ static int add_new_comm(struct pevent *pevent, const char *comm, int pid) pevent->cmdline_count++;qsort (cmdlines, pevent->cmdline_count,sizeof (*cmdlines), cmdline_cmp); - pevent->cmdlines = cmdlines;return 0 ; }
tools/perf/builtin-stat.c +1 -1
@@ -1416,7 +1416,7 @@ int cmd_stat(int argc, const char **argv, const char *prefix __maybe_unused) run_idx + 1); status =run_perf_stat (argc, argv); -if (forever && status !=-1 ) { +if (forever && status !=-1 && !interval) {print_counters (NULL , argc, argv);perf_stat__reset_stats (); }
tools/perf/util/llvm-utils.c +3 -3
@@ -214,14 +214,14 @@ static int detect_kbuild_dir(char **kbuild_dir)const char *prefix_dir ="" ;const char *suffix_dir ="" ; +/* _UTSNAME_LENGTH is 65 */ +char release[128 ]; +char *autoconf_path;int err;if (!test_dir) { -/* _UTSNAME_LENGTH is 65 */ -char release[128 ]; - err =fetch_kernel_version (NULL , release,sizeof (release));if (err)