3.4.82-stable review
Subsystems (2)
Greg Kroah-Hartman
maintainercover 3.4.82-stable review
This is the start of the stable review cycle for the 3.4.82 release. There are 25 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat Feb 22 23:48:32 UTC 2014. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.4.82-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 3.4.82-rc1
Paul Gortmaker <[email protected]>
genirq: Add missing irq_to_desc export for CONFIG_SPARSE_IRQ=n
Steven Rostedt (Red Hat) <[email protected]>
ring-buffer: Fix first commit on sub-buffer having non-zero delta
Krzysztof Kozlowski <[email protected]>
power: max17040: Fix NULL pointer dereference when there is no platform_data
Mikulas Patocka <[email protected]>
time: Fix overflow when HZ is smaller than 60
Oleg Nesterov <[email protected]>
md/raid5: Fix CPU hotplug callback registration
Dan Carpenter <[email protected]>
KVM: return an error code in kvm_vm_ioctl_register_coalesced_mmio()
Mike Marciniszyn <[email protected]>
IB/qib: Add missing serdes init sequence
Jens Axboe <[email protected]>
block: add cond_resched() to potentially long running ioctl discard loop
Jan Moskyto Matejka <[email protected]>
Modpost: fixed USB alias generation for ranges including 0x9 and 0xA
Raymond Wanyoike <[email protected]>
usb: option: blacklist ZTE MF667 net interface
Alan Stern <[email protected]>
usb-storage: enable multi-LUN scanning when needed
Alan Stern <[email protected]>
usb-storage: restrict bcdDevice range for Super Top in Cypress ATACB
Alan Stern <[email protected]>
usb-storage: add unusual-devs entry for BlackBerry 9000
Ulrich Hahn <[email protected]>
USB: ftdi_sio: add Tagsys RFID Reader IDs
Bjørn Mork <[email protected]>
usb: ftdi_sio: add Mindstorms EV3 console adapter
Hartmut Knaack <[email protected]>
staging:iio:ad799x fix error_free_irq which was freeing an irq that may not have been requested
Lars Poeschel <[email protected]>
tty: n_gsm: Fix for modems with brk in modem status control
NeilBrown <[email protected]>
lockd: send correct lock when granting a delayed lock.
Paul Bolle <[email protected]>
raw: test against runtime value of max_raw_minors
Geert Uytterhoeven <[email protected]>
spi: Fix crash with double message finalisation on error handling
Martin Schwidefsky <[email protected]>
s390: fix kernel crash due to linkage stack instructions
Michael Holzheu <[email protected]>
s390/dump: Fix dump memory detection
Johannes Berg <[email protected]>
mac80211: fix fragmentation code, particularly for encryption
Eric W. Biederman <[email protected]>
fs/file.c:fdtable: avoid triggering OOMs from alloc_fdmem
David Vrabel <[email protected]>
xen-blkfront: handle backend CLOSED without CLOSING
-------------
Diffstat:
Makefile | 4 +- arch/s390/kernel/head64.S | 7 ++- arch/s390/mm/page-states.c | 10 ++++ block/blk-lib.c | 8 +++ drivers/block/xen-blkfront.c | 5 +- drivers/char/raw.c | 2 +- drivers/infiniband/hw/qib/qib_iba7322.c | 5 ++ drivers/md/raid5.c | 90 ++++++++++++++++----------------- drivers/power/max17040_battery.c | 5 +- drivers/spi/spi.c | 4 +- drivers/staging/iio/adc/ad799x_core.c | 3 +- drivers/tty/n_gsm.c | 11 ++++ drivers/usb/serial/ftdi_sio.c | 3 ++ drivers/usb/serial/ftdi_sio_ids.h | 7 +++ drivers/usb/serial/option.c | 3 +- drivers/usb/storage/Kconfig | 4 +- drivers/usb/storage/scsiglue.c | 6 +++ drivers/usb/storage/unusual_cypress.h | 2 +- drivers/usb/storage/unusual_devs.h | 7 +++ fs/file.c | 2 +- fs/lockd/svclock.c | 8 +++ kernel/irq/irqdesc.c | 1 + kernel/time/jiffies.c | 6 +++ kernel/trace/ring_buffer.c | 7 +++ net/mac80211/tx.c | 2 +- scripts/mod/file2alias.c | 4 +- virt/kvm/coalesced_mmio.c | 8 +-- 27 files changed, 153 insertions(+), 71 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/25 xen-blkfront: handle backend CLOSED without CLOSING
3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Vrabel <[email protected]>
commit 3661371701e714f0cea4120f6a365340858fb4e4 upstream.
Backend drivers shouldn't transistion to CLOSED unless the frontend is CLOSED. If a backend does transition to CLOSED too soon then the frontend may not see the CLOSING state and will not properly shutdown.
So, treat an unexpected backend CLOSED state the same as CLOSING.
--- drivers/block/xen-blkfront.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/block/xen-blkfront.c +4 -1
@@ -1303,13 +1303,16 @@ static void blkback_changed(struct xenbucase XenbusStateReconfiguring:case XenbusStateReconfigured:case XenbusStateUnknown: -case XenbusStateClosed:break ;case XenbusStateConnected:blkfront_connect (info);break ; +case XenbusStateClosed: +if (dev->state == XenbusStateClosed) +break ; +/* Missed the backend's Closing state -- fallthrough */ case XenbusStateClosing:blkfront_closing (info);break ;
Greg Kroah-Hartman
maintainerPATCH 10/25 staging:iio:ad799x fix error_free_irq which was freeing an irq that may not have been requested
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hartmut Knaack <[email protected]>
commit 38408d056188be29a6c4e17f3703c796551bb330 upstream.
Only free an IRQ in error_free_irq, if it has been requested previously.
--- drivers/staging/iio/adc/ad799x_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/iio/adc/ad799x_core.c +2 -1
@@ -873,7 +873,8 @@ static int __devinit ad799x_probe(structreturn 0 ; error_free_irq: -free_irq (client->irq, indio_dev); +if (client->irq >0 ) +free_irq (client->irq, indio_dev); error_cleanup_ring:ad799x_ring_cleanup (indio_dev); error_disable_reg:
Greg Kroah-Hartman
maintainerPATCH 13/25 usb-storage: add unusual-devs entry for BlackBerry 9000
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit c5637e5119c43452a00e27c274356b072263ecbb upstream.
This patch adds an unusual-devs entry for the BlackBerry 9000. This fixes Bugzilla #22442.
--- drivers/usb/storage/unusual_devs.h | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/usb/storage/unusual_devs.h +7 -0
@@ -1441,6 +1441,13 @@ UNUSUAL_DEV( 0x0f88, 0x042e, 0x0100, 0x0 USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_FIX_CAPACITY ), +/* Reported by Moritz Moeller-Herrmann <[email protected]> */ +UNUSUAL_DEV (0x0fca ,0x8004 ,0x0201 ,0x0201 , +"Research In Motion" , +"BlackBerry Bold 9000" , +USB_SC_DEVICE ,USB_PR_DEVICE ,NULL , +US_FL_MAX_SECTORS_64 ), +/* Reported by Michael Stattmann <[email protected]> */ UNUSUAL_DEV( 0x0fce, 0xd008, 0x0000, 0x0000, "Sony Ericsson",
Greg Kroah-Hartman
maintainerPATCH 12/25 USB: ftdi_sio: add Tagsys RFID Reader IDs
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ulrich Hahn <[email protected]>
commit 76f24e3f39a1a94bab0d54e98899d64abcd9f69c upstream.
Adding two more IDs to the ftdi_sio usb serial driver. It now connects Tagsys RFID readers.
There might be more IDs out there for other Tagsys models.
--- drivers/usb/serial/ftdi_sio.c | 2 ++ drivers/usb/serial/ftdi_sio_ids.h | 6 ++++++ 2 files changed, 8 insertions(+)
drivers/usb/serial/ftdi_sio.c +2 -0
@@ -205,6 +205,8 @@ static struct usb_device_id id_table_com { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) }, { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) }, { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) }, + { USB_DEVICE(FTDI_VID, FTDI_TAGSYS_LP101_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_TAGSYS_P200X_PID) }, { USB_DEVICE(FTDI_VID, FTDI_LENZ_LIUSB_PID) }, { USB_DEVICE(FTDI_VID, FTDI_XF_632_PID) }, { USB_DEVICE(FTDI_VID, FTDI_XF_634_PID) },
drivers/usb/serial/ftdi_sio_ids.h +6 -0
@@ -364,6 +364,12 @@/* Sprog II (Andrew Crosland's SprogII DCC interface) */ #define FTDI_SPROG_II 0xF0C8 +/* +* Two of the Tagsys RFID Readers +*/ +#define FTDI_TAGSYS_LP101_PID 0xF0E9/* Tagsys L-P101 RFID*/ +#define FTDI_TAGSYS_P200X_PID 0xF0EE/* Tagsys Medio P200x RFID*/ +/* an infrared receiver for user access control with IR tags */ #define FTDI_PIEGROUP_PID 0xF208/* Product Id */
Greg Kroah-Hartman
maintainerPATCH 2/25 fs/file.c:fdtable: avoid triggering OOMs from alloc_fdmem
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Eric W. Biederman" <[email protected]>
commit 96c7a2ff21501691587e1ae969b83cbec8b78e08 upstream.
Recently due to a spike in connections per second memcached on 3 separate boxes triggered the OOM killer from accept. At the time the OOM killer was triggered there was 4GB out of 36GB free in zone 1. The problem was that alloc_fdtable was allocating an order 3 page (32KiB) to hold a bitmap, and there was sufficient fragmentation that the largest page available was 8KiB.
I find the logic that PAGE_ALLOC_COSTLY_ORDER can't fail pretty dubious but I do agree that order 3 allocations are very likely to succeed.
There are always pathologies where order > 0 allocations can fail when there are copious amounts of free memory available. Using the pigeon hole principle it is easy to show that it requires 1 page more than 50% of the pages being free to guarantee an order 1 (8KiB) allocation will succeed, 1 page more than 75% of the pages being free to guarantee an order 2 (16KiB) allocation will succeed and 1 page more than 87.5% of the pages being free to guarantee an order 3 allocate will succeed.
A server churning memory with a lot of small requests and replies like memcached is a common case that if anything can will skew the odds against large pages being available.
Therefore let's not give external applications a practical way to kill linux server applications, and specify __GFP_NORETRY to the kmalloc in alloc_fdmem. Unless I am misreading the code and by the time the code reaches should_alloc_retry in __alloc_pages_slowpath (where __GFP_NORETRY becomes signification). We have already tried everything reasonable to allocate a page and the only thing left to do is wait. So not waiting and falling back to vmalloc immediately seems like the reasonable thing to do even if there wasn't a chance of triggering the OOM killer.
--- fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/file.c +1 -1
@@ -47,7 +47,7 @@ static void *alloc_fdmem(size_t size)* vmalloc() if the allocation size will be considered "large" by the VM. */ if (size <= (PAGE_SIZE <<PAGE_ALLOC_COSTLY_ORDER )) { -void *data =kmalloc (size,GFP_KERNEL |__GFP_NOWARN); +void *data =kmalloc (size,GFP_KERNEL |__GFP_NOWARN|__GFP_NORETRY);if (data !=NULL )return data; }
Greg Kroah-Hartman
maintainerPATCH 20/25 KVM: return an error code in kvm_vm_ioctl_register_coalesced_mmio()
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit aac5c4226e7136c331ed384c25d5560204da10a0 upstream.
If kvm_io_bus_register_dev() fails then it returns success but it should return an error code.
I also did a little cleanup like removing an impossible NULL test.
--- virt/kvm/coalesced_mmio.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
virt/kvm/coalesced_mmio.c +2 -6
@@ -154,17 +154,13 @@ int kvm_vm_ioctl_register_coalesced_mmiolist_add_tail (&dev->list, &kvm->coalesced_zones);mutex_unlock (&kvm->slots_lock); -return ret; +return 0 ; out_free_dev:mutex_unlock (&kvm->slots_lock); -kfree (dev); -if (dev ==NULL ) -return -ENXIO ; - -return 0 ; +return ret; } int kvm_vm_ioctl_unregister_coalesced_mmio(struct kvm *kvm,
Greg Kroah-Hartman
maintainerPATCH 24/25 ring-buffer: Fix first commit on sub-buffer having non-zero delta
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Steven Rostedt (Red Hat)" <[email protected]>
commit d651aa1d68a2f0a7ee65697b04c6a92f8c0a12f2 upstream.
Each sub-buffer (buffer page) has a full 64 bit timestamp. The events on that page use a 27 bit delta against that timestamp in order to save on bits written to the ring buffer. If the time between events is larger than what the 27 bits can hold, a "time extend" event is added to hold the entire 64 bit timestamp again and the events after that hold a delta from that timestamp.
As a "time extend" is always paired with an event, it is logical to just allocate the event with the time extend, to make things a bit more efficient.
Unfortunately, when the pairing code was written, it removed the "delta = 0" from the first commit on a page, causing the events on the page to be slightly skewed.
--- kernel/trace/ring_buffer.c | 7 +++++++ 1 file changed, 7 insertions(+)
kernel/trace/ring_buffer.c +7 -0
@@ -2008,6 +2008,13 @@ __rb_reserve_next(struct ring_buffer_per write &=RB_WRITE_MASK ; tail = write - length; +/* +* If this is the first commit on the page, then it has the same +* timestamp as the page itself. +*/ +if (!tail) + delta =0 ; +/* See if we shot pass the end of this buffer page */ if (unlikely (write >BUF_PAGE_SIZE )) return rb_move_tail(cpu_buffer, length, tail,
Greg Kroah-Hartman
maintainerPATCH 4/25 s390/dump: Fix dump memory detection
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Holzheu <[email protected]>
commit d7736ff5be31edaa4fe5ab62810c64529a24b149 upstream.
Dumps created by kdump or zfcpdump can contain invalid memory holes when dumping z/VM systems that have memory pressure.
For example:
# zgetdump -i /proc/vmcore. Memory map: 0000000000000000 - 0000000000bfffff (12 MB) 0000000000e00000 - 00000000014fffff (7 MB) 000000000bd00000 - 00000000f3bfffff (3711 MB)
The memory detection function find_memory_chunks() issues tprot to find valid memory chunks. In case of CMM it can happen that pages are marked as unstable via set_page_unstable() in arch_free_page(). If z/VM has released that pages, tprot returns -EFAULT and indicates a memory hole.
So fix this and switch off CMM in case of kdump or zfcpdump.
--- arch/s390/mm/page-states.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/s390/mm/page-states.c +10 -0
@@ -12,6 +12,8 @@#include <linux/mm.h> #include <linux/gfp.h> #include <linux/init.h> +#include <asm/setup.h> +#include <asm/ipl.h> #define ESSA_SET_STABLE 1#define ESSA_SET_UNUSED 2
@@ -41,6 +43,14 @@ void __init cmma_init(void)if (!cmma_flag)return ; +/* +* Disable CMM for dump, otherwise the tprot based memory +* detection can fail because of unstable pages. +*/ +if (OLDMEM_BASE || ipl_info.type ==IPL_TYPE_FCP_DUMP ) { + cmma_flag =0 ; +return ; + } asmvolatile (" .insn rrf,0xb9ab0000,%1,%1,0,0\n" "0: la %0,0\n"
Greg Kroah-Hartman
maintainerPATCH 8/25 lockd: send correct lock when granting a delayed lock.
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: NeilBrown <[email protected]>
commit 2ec197db1a56c9269d75e965f14c344b58b2a4f6 upstream.
If an NFS client attempts to get a lock (using NLM) and the lock is not available, the server will remember the request and when the lock becomes available it will send a GRANT request to the client to provide the lock.
If the client already held an adjacent lock, the GRANT callback will report the union of the existing and new locks, which can confuse the client.
This happens because __posix_lock_file (called by vfs_lock_file) updates the passed-in file_lock structure when adjacent or over-lapping locks are found.
To avoid this problem we take a copy of the two fields that can be changed (fl_start and fl_end) before the call and restore them afterwards.
An alternate would be to allocate a 'struct file_lock', initialise it, use locks_copy_lock() to take a copy, then locks_release_private() after the vfs_lock_file() call. But that is a lot more work.
--
v1 had a couple of issues (large on-stack struct and didn't really work properly). This version is much better tested.
--- fs/lockd/svclock.c | 8 ++++++++ 1 file changed, 8 insertions(+)
fs/lockd/svclock.c +8 -0
@@ -769,6 +769,7 @@ nlmsvc_grant_blocked(struct nlm_block *bstruct nlm_file *file = block->b_file;struct nlm_lock *lock = &block->b_call->a_args.lock;int error; +loff_t fl_start, fl_end;dprintk ("lockd: grant blocked lock %p\n" , block);
@@ -786,9 +787,16 @@ nlmsvc_grant_blocked(struct nlm_block *b }/* Try the lock operation again */ +/* vfs_lock_file() can mangle fl_start and fl_end, but we need +* them unchanged for the GRANT_MSG +*/ lock->fl.fl_flags |=FL_SLEEP ; + fl_start = lock->fl.fl_start; + fl_end = lock->fl.fl_end; error =vfs_lock_file (file->f_file,F_SETLK , &lock->fl,NULL ); lock->fl.fl_flags &= ~FL_SLEEP ; + lock->fl.fl_start = fl_start; + lock->fl.fl_end = fl_end;switch (error) {case 0 :
Greg Kroah-Hartman
maintainerPATCH 3/25 mac80211: fix fragmentation code, particularly for encryption
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
commit 338f977f4eb441e69bb9a46eaa0ac715c931a67f upstream.
The "new" fragmentation code (since my rewrite almost 5 years ago) erroneously sets skb->len rather than using skb_trim() to adjust the length of the first fragment after copying out all the others. This leaves the skb tail pointer pointing to after where the data originally ended, and thus causes the encryption MIC to be written at that point, rather than where it belongs: immediately after the data.
The impact of this is that if software encryption is done, then
a) encryption doesn't work for the first fragment, the connection becomes unusable as the first fragment will never be properly verified at the receiver, the MIC is practically guaranteed to be wrong
b) we leak up to 8 bytes of plaintext (!) of the packet out into the air
This is only mitigated by the fact that many devices are capable of doing encryption in hardware, in which case this can't happen as the tail pointer is irrelevant in that case. Additionally, fragmentation is not used very frequently and would normally have to be configured manually.
Fix this by using skb_trim() properly.
--- net/mac80211/tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/tx.c +1 -1
@@ -907,7 +907,7 @@ static int ieee80211_fragment(struct iee }/* adjust first fragment's length */ - skb->len = hdrlen + per_fragm; +skb_trim (skb, hdrlen + per_fragm);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 5/25 s390: fix kernel crash due to linkage stack instructions
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Martin Schwidefsky <[email protected]>
commit 8d7f6690cedb83456edd41c9bd583783f0703bf0 upstream.
The kernel currently crashes with a low-address-protection exception if a user space process executes an instruction that tries to use the linkage stack. Set the base-ASTE origin and the subspace-ASTE origin of the dispatchable-unit-control-table to point to a dummy ASTE. Set up control register 15 to point to an empty linkage stack with no room left.
A user space process with a linkage stack instruction will still crash but with a different exception which is correctly translated to a segmentation fault instead of a kernel oops.
--- arch/s390/kernel/head64.S | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
arch/s390/kernel/head64.S +5 -2
@@ -61,7 +61,7 @@ ENTRY(startup_continue) .quad 0 # cr12: tracing off .quad 0 # cr13: home space segment table .quad 0xc0000000 # cr14: machine check handling off - .quad 0 # cr15: linkage stack operations + .quad .Llinkage_stack # cr15: linkage stack operations .Lpcmsk:.quad 0x0000000180000000 .L4malign:.quad 0xffffffffffc00000 .Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8
@@ -69,12 +69,15 @@ ENTRY(startup_continue) .Lparmaddr: .quad PARMAREA .align 64 -.Lduct: .long 0,0,0,0,.Lduald,0,0,0 +.Lduct: .long 0,.Laste,.Laste,0,.Lduald,0,0,0 .long 0,0,0,0,0,0,0,0 +.Laste: .quad 0,0xffffffffffffffff,0,0,0,0,0,0 .align 128 .Lduald:.rept 8 .long 0x80000000,0,0,0 # invalid access-list entries .endr +.Llinkage_stack: + .long 0,0,0x89000000,0,0,0,0x8a000000,0 ENTRY(_ehead)
Greg Kroah-Hartman
maintainerPATCH 6/25 spi: Fix crash with double message finalisation on error handling
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
commit 1f802f8249a0da536877842c43c7204064c4de8b upstream.
This reverts commit e120cc0dcf2880a4c5c0a6cb27b655600a1cfa1d.
It causes a NULL pointer dereference with drivers using the generic spi_transfer_one_message(), which always calls spi_finalize_current_message(), which zeroes master->cur_msg.
Drivers implementing transfer_one_message() theirselves must always call spi_finalize_current_message(), even if the transfer failed:
* @transfer_one_message: the subsystem calls the driver to transfer a single
* message while queuing transfers that arrive in the meantime. When the * driver is finished with this message, it must call * spi_finalize_current_message() so the subsystem can issue the next * transfer
--- drivers/spi/spi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/spi/spi.c +1 -3
@@ -572,9 +572,7 @@ static void spi_pump_messages(struct kth ret = master->transfer_one_message (master, master->cur_msg);if (ret) {dev_err (&master->dev, -"failed to transfer one message from queue: %d\n" , ret); - master->cur_msg->status = ret; -spi_finalize_current_message (master); +"failed to transfer one message from queue\n" );return ; } }
Greg Kroah-Hartman
maintainerPATCH 7/25 raw: test against runtime value of max_raw_minors
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Bolle <[email protected]>
commit 5bbb2ae3d6f896f8d2082d1eceb6131c2420b7cf upstream.
bind_get() checks the device number it is called with. It uses MAX_RAW_MINORS for the upper bound. But MAX_RAW_MINORS is set at compile time while the actual number of raw devices can be set at runtime. This means the test can either be too strict or too lenient. And if the test ends up being too lenient bind_get() might try to access memory beyond what was allocated for "raw_devices".
So check against the runtime value (max_raw_minors) in this function.
--- drivers/char/raw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/raw.c +1 -1
@@ -190,7 +190,7 @@ static int bind_get(int number, dev_t *dstruct raw_device_data *rawdev;struct block_device *bdev; -if (number <=0 || number >=MAX_RAW_MINORS ) +if (number <=0 || number >= max_raw_minors)return -EINVAL ; rawdev = &raw_devices[number];
Greg Kroah-Hartman
maintainerPATCH 9/25 tty: n_gsm: Fix for modems with brk in modem status control
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lars Poeschel <[email protected]>
commit 3ac06b905655b3ef2fd2196bab36e4587e1e4e4f upstream.
3GPP TS 07.10 states in section 5.4.6.3.7:
"The length byte contains the value 2 or 3 ... depending on the break signal." The break byte is optional and if it is sent, the length is
3. In fact the driver was not able to work with modems that send this break byte in their modem status control message. If the modem just sends the break byte if it is really set, then weird things might happen.
The code for deconding the modem status to the internal linux presentation in gsm_process_modem has already a big comment about this 2 or 3 byte length thing and it is already able to decode the brk, but the code calling the gsm_process_modem function in gsm_control_modem does not encode it and hand it over the right way. This patch fixes this.
Without this fix if the modem sends the brk byte in it's modem status control message the driver will hang when opening a muxed channel.
--- drivers/tty/n_gsm.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/tty/n_gsm.c +11 -0
@@ -1091,6 +1091,7 @@ static void gsm_control_modem(struct gsm {unsigned int addr =0 ;unsigned int modem =0 ; +unsigned int brk =0 ;struct gsm_dlci *dlci;int len = clen;u8 *dp = data;
@@ -1117,6 +1118,16 @@ static void gsm_control_modem(struct gsmif (len ==0 )return ; } + len--; +if (len >0 ) { +while (gsm_read_ea (&brk, *dp++) ==0 ) { + len--; +if (len ==0 ) +return ; + } + modem <<=7 ; + modem |= (brk &0x7f ); + } tty =tty_port_tty_get (&dlci->port);gsm_process_modem (tty, dlci, modem, clen);if (tty) {
Greg Kroah-Hartman
maintainerPATCH 14/25 usb-storage: restrict bcdDevice range for Super Top in Cypress ATACB
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit a9c143c82608bee2a36410caa56d82cd86bdc7fa upstream.
The Cypress ATACB unusual-devs entry for the Super Top SATA bridge causes problems. Although it was originally reported only for bcdDevice = 0x160, its range was much larger. This resulted in a bug report for bcdDevice 0x220, so the range was capped at 0x219. Now Milan reports errors with bcdDevice 0x150.
Therefore this patch restricts the range to just 0x160.
--- drivers/usb/storage/unusual_cypress.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/storage/unusual_cypress.h +1 -1
@@ -31,7 +31,7 @@ UNUSUAL_DEV( 0x04b4, 0x6831, 0x0000, 0x "Cypress ISD-300LP", USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0), -UNUSUAL_DEV (0x14cd ,0x6116 ,0x0000 ,0x0219 , +UNUSUAL_DEV (0x14cd ,0x6116 ,0x0160 ,0x0160 ,"Super Top" ,"USB 2.0 SATA BRIDGE" , USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0),
Greg Kroah-Hartman
maintainerPATCH 15/25 usb-storage: enable multi-LUN scanning when needed
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit 823d12c95c666fa7ab7dad208d735f6bc6afabdc upstream.
People sometimes create their own custom-configured kernels and forget to enable CONFIG_SCSI_MULTI_LUN. This causes problems when they plug in a USB storage device (such as a card reader) with more than one LUN.
Fortunately, we can tell fairly easily when a storage device claims to have more than one LUN. When that happens, this patch asks the SCSI layer to probe all the LUNs automatically, regardless of the config setting.
The patch also updates the Kconfig help text for usb-storage, explaining that CONFIG_SCSI_MULTI_LUN may be necessary.
--- drivers/usb/storage/Kconfig | 4 +++- drivers/usb/storage/scsiglue.c | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-)
drivers/usb/storage/Kconfig +3 -1
@@ -19,7 +19,9 @@ config USB_STORAGE This option depends on 'SCSI' support being enabled, but you probably also need 'SCSI device support: SCSI disk support' - (BLK_DEV_SD) for most USB storage devices. + (BLK_DEV_SD) for most USB storage devices. Some devices also + will require 'Probe all LUNs on each SCSI device' + (SCSI_MULTI_LUN). To compile this driver as a module, choose M here: the module will be called usb-storage.
drivers/usb/storage/scsiglue.c +6 -0
@@ -78,6 +78,8 @@ static const char* host_info(struct Scsistatic int slave_alloc (struct scsi_device *sdev) { +struct us_data *us =host_to_us (sdev->host); +/* * Set the INQUIRY transfer length to 36. We don't use any of * the extra data and many devices choke if asked for more or
@@ -102,6 +104,10 @@ static int slave_alloc (struct scsi_devi*/ blk_queue_update_dma_alignment (sdev->request_queue, (512 -1 )); +/* Tell the SCSI layer if we know there is more than one LUN */ +if (us->protocol ==USB_PR_BULK && us->max_lun >0 ) + sdev->sdev_bflags |=BLIST_FORCELUN ; +return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 16/25 usb: option: blacklist ZTE MF667 net interface
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Raymond Wanyoike <[email protected]>
commit 3635c7e2d59f7861afa6fa5e87e2a58860ff514d upstream.
Interface #5 of 19d2:1270 is a net interface which has been submitted to the qmi_wwan driver so consequently remove it from the option driver.
--- drivers/usb/serial/option.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/serial/option.c +2 -1
@@ -1376,7 +1376,8 @@ static const struct usb_device_id option { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1267, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1268, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1269, 0xff, 0xff, 0xff) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1270, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1270, 0xff, 0xff, 0xff), + .driver_info = (kernel_ulong_t)&net_intf5_blacklist }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1271, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1272, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1273, 0xff, 0xff, 0xff) },
Greg Kroah-Hartman
maintainerPATCH 17/25 Modpost: fixed USB alias generation for ranges including 0x9 and 0xA
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Moskyto Matejka <[email protected]>
commit 03b56329f9bb5a1cb73d7dc659d529a9a9bf3acc upstream.
Commit afe2dab4f6 ("USB: add hex/bcd detection to usb modalias generation") changed the routine that generates alias ranges. Before that change, only digits 0-9 were supported; the commit tried to fix the case when the range includes higher values than 0x9.
Unfortunately, the commit didn't fix the case when the range includes both 0x9 and 0xA, meaning that the final range must look like [x-9A-y] where x <= 0x9 and y >= 0xA -- instead the [x-9A-x] range was produced.
Modprobe doesn't complain as it sees no difference between no-match and bad-pattern results of fnmatch().
Fixing this simple bug to fix the aliases.
Also changing the hardcoded beginning of the range to uppercase as all the other letters are also uppercase in the device version numbers.
Fortunately, this affects only the dvb-usb-dib0700 module, AFAIK.
--- scripts/mod/file2alias.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/mod/file2alias.c +2 -2
@@ -186,8 +186,8 @@ static void do_usb_entry(struct usb_devi range_lo <0x9 ?"[%X-9" :"[%X" , range_lo);sprintf (alias +strlen (alias), - range_hi >0xA ?"a-%X]" :"%X]" , - range_lo); + range_hi >0xA ?"A-%X]" :"%X]" , + range_hi); } }if (bcdDevice_initial_digits < (sizeof (id->bcdDevice_lo) *2 -1 ))
Greg Kroah-Hartman
maintainerPATCH 18/25 block: add cond_resched() to potentially long running ioctl discard loop
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jens Axboe <[email protected]>
commit c8123f8c9cb517403b51aa41c3c46ff5e10b2c17 upstream.
When mkfs issues a full device discard and the device only supports discards of a smallish size, we can loop in blkdev_issue_discard() for a long time. If preempt isn't enabled, this can turn into a softlock situation and the kernel will start complaining.
Add an explicit cond_resched() at the end of the loop to avoid that.
--- block/blk-lib.c | 8 ++++++++ 1 file changed, 8 insertions(+)
block/blk-lib.c +8 -0
@@ -101,6 +101,14 @@ int blkdev_issue_discard(struct block_deatomic_inc (&bb.done);submit_bio (type, bio); + +/* +* We can loop for a long time in here, if someone does +* full device discards (like mkfs). Be nice and allow +* us to schedule out to avoid softlocking if preempt +* is disabled. +*/ +cond_resched (); }/* Wait for bios in-flight */
Greg Kroah-Hartman
maintainerPATCH 19/25 IB/qib: Add missing serdes init sequence
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Marciniszyn <[email protected]>
commit 2f75e12c4457a9b3d042c0a0d748fa198dc2ffaf upstream.
Research has shown that commit a77fcf895046 ("IB/qib: Use a single txselect module parameter for serdes tuning") missed a key serdes init sequence.
This patch add that sequence.
--- drivers/infiniband/hw/qib/qib_iba7322.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/infiniband/hw/qib/qib_iba7322.c +5 -0
@@ -2279,6 +2279,11 @@ static int qib_7322_bringup_serdes(strucqib_write_kreg_port (ppd, krp_ibcctrl_a, ppd->cpspec->ibcctrl_a);qib_write_kreg (dd, kr_scratch,0ULL ); +/* ensure previous Tx parameters are not still forced */ +qib_write_kreg_port (ppd, krp_tx_deemph_override, +SYM_MASK (IBSD_TX_DEEMPHASIS_OVERRIDE_0 , + reset_tx_deemphasis_override)); +if (qib_compat_ddr_negotiate) { ppd->cpspec->ibdeltainprog =1 ; ppd->cpspec->ibsymsnap = read_7322_creg32_port(ppd,
Greg Kroah-Hartman
maintainerPATCH 21/25 md/raid5: Fix CPU hotplug callback registration
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleg Nesterov <[email protected]>
commit 789b5e0315284463617e106baad360cb9e8db3ac upstream.
Subsystems that want to register CPU hotplug callbacks, as well as perform initialization for the CPUs that are already online, often do it as shown below:
get_online_cpus(); for_each_online_cpu(cpu) init_cpu(cpu); register_cpu_notifier(&foobar_cpu_notifier); put_online_cpus();
This is wrong, since it is prone to ABBA deadlocks involving the cpu_add_remove_lock and the cpu_hotplug.lock (when running concurrently with CPU hotplug operations).
Interestingly, the raid5 code can actually prevent double initialization and hence can use the following simplified form of callback registration:
register_cpu_notifier(&foobar_cpu_notifier); get_online_cpus(); for_each_online_cpu(cpu) init_cpu(cpu); put_online_cpus();
A hotplug operation that occurs between registering the notifier and calling get_online_cpus(), won't disrupt anything, because the code takes care to perform the memory allocations only once.
So reorganize the code in raid5 this way to fix the deadlock with callback registration.
[Srivatsa: Fixed the unregister_cpu_notifier() deadlock, added the free_scratch_buffer() helper to condense code further and wrote the changelog.]
--- drivers/md/raid5.c | 90 +++++++++++++++++++++++++---------------------------- 1 file changed, 44 insertions(+), 46 deletions(-)
drivers/md/raid5.c +44 -46
@@ -4678,23 +4678,43 @@ raid5_size(struct mddev *mddev, sector_treturn sectors * (raid_disks - conf->max_degraded); } +static void free_scratch_buffer (struct r5conf *conf,struct raid5_percpu *percpu) +{ +safe_put_page (percpu->spare_page); +kfree (percpu->scribble); + percpu->spare_page =NULL ; + percpu->scribble =NULL ; +} + +static int alloc_scratch_buffer (struct r5conf *conf,struct raid5_percpu *percpu) +{ +if (conf->level ==6 && !percpu->spare_page) + percpu->spare_page =alloc_page (GFP_KERNEL ); +if (!percpu->scribble) + percpu->scribble =kmalloc (conf->scribble_len,GFP_KERNEL ); + +if (!percpu->scribble || (conf->level ==6 && !percpu->spare_page)) { +free_scratch_buffer (conf, percpu); +return -ENOMEM ; + } + +return 0 ; +} +static void raid5_free_percpu (struct r5conf *conf) { -struct raid5_percpu *percpu;unsigned long cpu;if (!conf->percpu)return ; -get_online_cpus (); -for_each_possible_cpu (cpu) { - percpu =per_cpu_ptr (conf->percpu, cpu); -safe_put_page (percpu->spare_page); -kfree (percpu->scribble); - }#ifdef CONFIG_HOTPLUG_CPU unregister_cpu_notifier (&conf->cpu_notify);#endif + +get_online_cpus (); +for_each_possible_cpu (cpu) +free_scratch_buffer (conf,per_cpu_ptr (conf->percpu, cpu));put_online_cpus ();free_percpu (conf->percpu);
@@ -4720,15 +4740,7 @@ static int raid456_cpu_notify(struct notswitch (action) {case CPU_UP_PREPARE :case CPU_UP_PREPARE_FROZEN : -if (conf->level ==6 && !percpu->spare_page) - percpu->spare_page =alloc_page (GFP_KERNEL ); -if (!percpu->scribble) - percpu->scribble =kmalloc (conf->scribble_len,GFP_KERNEL ); - -if (!percpu->scribble || - (conf->level ==6 && !percpu->spare_page)) { -safe_put_page (percpu->spare_page); -kfree (percpu->scribble); +if (alloc_scratch_buffer (conf, percpu)) {pr_err ("%s: failed memory allocation for cpu%ld\n" , __func__, cpu);return notifier_from_errno (-ENOMEM );
@@ -4736,10 +4748,7 @@ static int raid456_cpu_notify(struct notbreak ;case CPU_DEAD :case CPU_DEAD_FROZEN : -safe_put_page (percpu->spare_page); -kfree (percpu->scribble); - percpu->spare_page =NULL ; - percpu->scribble =NULL ; +free_scratch_buffer (conf,per_cpu_ptr (conf->percpu, cpu));break ;default :break ;
@@ -4751,40 +4760,29 @@ static int raid456_cpu_notify(struct notstatic int raid5_alloc_percpu (struct r5conf *conf) {unsigned long cpu; -struct page *spare_page; -struct raid5_percpu __percpu *allcpus; -void *scribble; -int err; +int err =0 ; - allcpus = alloc_percpu(struct raid5_percpu); -if (!allcpus) + conf->percpu = alloc_percpu(struct raid5_percpu); +if (!conf->percpu)return -ENOMEM ; - conf->percpu = allcpus; + +#ifdef CONFIG_HOTPLUG_CPU + conf->cpu_notify.notifier_call = raid456_cpu_notify; + conf->cpu_notify.priority =0 ; + err =register_cpu_notifier (&conf->cpu_notify); +if (err) +return err; +#endif get_online_cpus (); - err =0 ;for_each_present_cpu (cpu) { -if (conf->level ==6 ) { - spare_page =alloc_page (GFP_KERNEL ); -if (!spare_page) { - err = -ENOMEM ; -break ; - } -per_cpu_ptr (conf->percpu, cpu)->spare_page = spare_page; - } - scribble =kmalloc (conf->scribble_len,GFP_KERNEL ); -if (!scribble) { - err = -ENOMEM ; + err =alloc_scratch_buffer (conf,per_cpu_ptr (conf->percpu, cpu)); +if (err) { +pr_err ("%s: failed memory allocation for cpu%ld\n" , + __func__, cpu);break ; } -per_cpu_ptr (conf->percpu, cpu)->scribble = scribble; } -#ifdef CONFIG_HOTPLUG_CPU - conf->cpu_notify.notifier_call = raid456_cpu_notify; - conf->cpu_notify.priority =0 ; -if (err ==0 ) - err =register_cpu_notifier (&conf->cpu_notify); -#endif put_online_cpus ();return err;
Greg Kroah-Hartman
maintainerPATCH 22/25 time: Fix overflow when HZ is smaller than 60
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <[email protected]>
commit 80d767d770fd9c697e434fd080c2db7b5c60c6dd upstream.
When compiling for the IA-64 ski emulator, HZ is set to 32 because the emulation is slow and we don't want to waste too many cycles processing timers. Alpha also has an option to set HZ to 32.
This causes integer underflow inkernel/time/jiffies.c:kernel/time/jiffies.c:66:2: warning: large integer implicitly truncated to unsigned type [-Woverflow]
.mult = NSEC_PER_JIFFY << JIFFIES_SHIFT, /* details above */
^
This patch reduces the JIFFIES_SHIFT value to avoid the overflow.
--- kernel/time/jiffies.c | 6 ++++++ 1 file changed, 6 insertions(+)
kernel/time/jiffies.c +6 -0
@@ -51,7 +51,13 @@* HZ shrinks, so values greater than 8 overflow 32bits when * HZ=100. */ +#if HZ <34 +#define JIFFIES_SHIFT 6 +#elif HZ <67 +#define JIFFIES_SHIFT 7 +#else #define JIFFIES_SHIFT 8 +#endif static cycle_t jiffies_read (struct clocksource *cs) {
Greg Kroah-Hartman
maintainerPATCH 23/25 power: max17040: Fix NULL pointer dereference when there is no platform_data
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <[email protected]>
commit ac323d8d807060f7c95a685a9fe861e7b6300993 upstream.
Fix NULL pointer dereference of "chip->pdata" if platform_data was not supplied to the driver.
The driver during probe stored the pointer to the platform_data:
chip->pdata = client->dev.platform_data;
Later it was dereferenced in max17040_get_online() and max17040_get_status().
If platform_data was not supplied, the NULL pointer exception would happen:
[ 6.626094] Unable to handle kernel of a at virtual address 00000000 [ 6.628557] pgd = c0004000 [ 6.632868] [00000000] *pgd=66262564 [ 6.634636] Unable to handle kernel paging request at virtual address e6262000 [ 6.642014] pgd = de468000 [ 6.644700] [e6262000] *pgd=00000000 [ 6.648265] Internal error: Oops: 5 [#1] PREEMPT SMP ARM [ 6.653552] Modules linked in: [ 6.656598] CPU: 0 PID: 31 Comm: kworker/0:1 Not tainted 3.10.14-02717-gc58b4b4 #505 [ 6.664334] Workqueue: events max17040_work [ 6.668488] task: dfa11b80 ti: df9f6000 task.ti: df9f6000 [ 6.673873] PC is at show_pte+0x80/0xb8 [ 6.677687] LR is at show_pte+0x3c/0xb8 [ 6.681503] pc : [<c001b7b8>] lr : [<c001b774>] psr: 600f0113 [ 6.681503] sp : df9f7d58 ip : 600f0113 fp : 00000009 [ 6.692965] r10: 00000000 r9 : 00000000 r8 : dfa11b80 [ 6.698171] r7 : df9f7ea0 r6 : e6262000 r5 : 00000000 r4 : 00000000 [ 6.704680] r3 : 00000000 r2 : e6262000 r1 : 600f0193 r0 : c05b3750 [ 6.711194] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel [ 6.718485] Control: 10c53c7d Table: 5e46806a DAC: 00000015 [ 6.724218] Process kworker/0:1 (pid: 31, stack limit = 0xdf9f6238) [ 6.730465] Stack: (0xdf9f7d58 to 0xdf9f8000) [ 6.914325] [<c001b7b8>] (show_pte+0x80/0xb8) from [<c047107c>] (__do_kernel_fault.part.9+0x44/0x74) [ 6.923425] [<c047107c>] (__do_kernel_fault.part.9+0x44/0x74) from [<c001bb7c>] (do_page_fault+0x2c4/0x360) [ 6.933144] [<c001bb7c>] (do_page_fault+0x2c4/0x360) from [<c0008400>] (do_DataAbort+0x34/0x9c) [ 6.941825] [<c0008400>] (do_DataAbort+0x34/0x9c) from [<c000e5d8>] (__dabt_svc+0x38/0x60) [ 6.950058] Exception stack(0xdf9f7ea0 to 0xdf9f7ee8) [ 6.955099] 7ea0: df0c1790 00000000 00000002 00000000 df0c1794 df0c1790 df0c1790 00000042 [ 6.963271] 7ec0: df0c1794 00000001 00000000 00000009 00000000 df9f7ee8 c0306268 c0306270 [ 6.971419] 7ee0: a00f0113 ffffffff [ 6.974902] [<c000e5d8>] (__dabt_svc+0x38/0x60) from [<c0306270>] (max17040_work+0x8c/0x144) [ 6.983317] [<c0306270>] (max17040_work+0x8c/0x144) from [<c003f364>] (process_one_work+0x138/0x440) [ 6.992429] [<c003f364>] (process_one_work+0x138/0x440) from [<c003fa64>] (worker_thread+0x134/0x3b8) [ 7.001628] [<c003fa64>] (worker_thread+0x134/0x3b8) from [<c00454bc>] (kthread+0xa4/0xb0) [ 7.009875] [<c00454bc>] (kthread+0xa4/0xb0) from [<c000eb28>] (ret_from_fork+0x14/0x2c) [ 7.017943] Code: e1a03005 e2422480 e0826104 e59f002c (e7922104) [ 7.024017] ---[ end trace 73bc7006b9cc5c79 ]---
--- drivers/power/max17040_battery.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/power/max17040_battery.c +3 -2
@@ -148,7 +148,7 @@ static void max17040_get_online(struct i {struct max17040_chip *chip =i2c_get_clientdata (client); -if (chip->pdata->battery_online) +if (chip->pdata && chip->pdata->battery_online) chip->online = chip->pdata->battery_online ();else chip->online =1 ;
@@ -158,7 +158,8 @@ static void max17040_get_status(struct i {struct max17040_chip *chip =i2c_get_clientdata (client); -if (!chip->pdata->charger_online || !chip->pdata->charger_enable) { +if (!chip->pdata || !chip->pdata->charger_online + || !chip->pdata->charger_enable) { chip->status =POWER_SUPPLY_STATUS_UNKNOWN ;return ; }
Greg Kroah-Hartman
maintainerPATCH 25/25 genirq: Add missing irq_to_desc export for CONFIG_SPARSE_IRQ=n
In reply to Greg Kroah-Hartman3.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Gortmaker <[email protected]>
commit 2c45aada341121438affc4cb8d5b4cfaa2813d3d upstream.
In allmodconfig builds for sparc and any other arch which does not set CONFIG_SPARSE_IRQ, the following will be seen at modpost:
CC [M] lib/cpu-notifier-error-inject.o
CC [M] lib/pm-notifier-error-inject.o
ERROR: "irq_to_desc" [drivers/gpio/gpio-mcp23s08.ko] undefined! make[2]: *** [__modpost] Error 1
This happens because commit 3911ff30f5 ("genirq: export handle_edge_irq() and irq_to_desc()") added one export for it, but there were actually two instances of it, in an if/else clause for CONFIG_SPARSE_IRQ. Add the second one.
--- kernel/irq/irqdesc.c | 1 + 1 file changed, 1 insertion(+)
kernel/irq/irqdesc.c +1 -0
@@ -274,6 +274,7 @@ struct irq_desc *irq_to_desc(unsigned in {return (irq <NR_IRQS ) ? irq_desc + irq :NULL ; } +EXPORT_SYMBOL (irq_to_desc);static void free_desc (unsigned int irq) {
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.4.82 release. There are 25 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat Feb 22 23:48:32 UTC 2014. Anything received after that time might be too late.
Build results:
total: 119 pass: 97 skipped: 18 fail: 4
qemu tests all passed. Results are as expected.
Details are available at http://server.roeck-us.net:8010/builders.
Guenter
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.4.82 release. There are 25 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat Feb 22 23:48:32 UTC 2014. Anything received after that time might be too late.
Quoted 8 lines
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.4.82-rc1.gzand the diffstat can be found below.
thanks,
greg k-h
Compile tests and boot tests passed. No dmesg regressions: emerg, crit, alert, err are clean. No regressions in warn.
-- Shuah
Signature · 4 lines
Shuah Khan Senior Linux Kernel Developer - Open Source Group Samsung Research America(Silicon Valley) [email protected] | (970) 672-0658
Greg KH
maintainerQuoted 2 lines · Shuah Khan
Compile tests and boot tests passed. No dmesg regressions: emerg, crit, alert, err are clean. No regressions in warn.
Quoted 6 lines · Guenter Roeck
Build results:
total: 119 pass: 97 skipped: 18 fail: 4qemu tests all passed. Results are as expected.
Details are available at http://server.roeck-us.net:8010/builders.
Thanks for testing and letting me know.
greg k-h