* [ 000/123] 3.7.2-stable review
@ 2013-01-09 20:33 Greg Kroah-Hartman
2013-01-09 20:34 ` [ 001/123] net: fix a race in gro_cell_poll() Greg Kroah-Hartman
` (125 more replies)
0 siblings, 126 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:33 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, torvalds, akpm, alan
Note, there are still a lot of patches submitted for inclusion in the
stable releases that I have not gotten to yet. I wanted to get this
release out now, instead of delaying for a week or so while I dig
through all of the pending patches.
This is the start of the stable review cycle for the 3.7.2 release.
There are 123 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 Fri Jan 11 20:11:16 UTC 2013.
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.7.2-rc1.gz
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Linux 3.7.2-rc1
Jeff Layton <jlayton@redhat.com>
cifs: don't compare uniqueids in cifs_prime_dcache unless server inode numbers are in use
Jeff Layton <jlayton@redhat.com>
cifs: rename cifs_readdir_lookup to cifs_prime_dcache and make it void return
Alexander Stein <alexander.stein@systec-electronic.com>
can: Do not call dev_put if restart timer is running upon close
Ben Hutchings <ben@decadent.org.uk>
HID: Add Apple wireless keyboard 2011 ANSI to special driver list
Guenter Roeck <linux@roeck-us.net>
linux/kernel.h: fix DIV_ROUND_CLOSEST with unsigned divisors
Michal Hocko <mhocko@suse.cz>
mm: limit mmu_gather batching to fix soft lockups on !CONFIG_PREEMPT
Tony Prisk <linux@prisktech.co.nz>
drivers/rtc/rtc-vt8500.c: fix handling of data passed in struct rtc_time
Tony Prisk <linux@prisktech.co.nz>
drivers/rtc/rtc-vt8500.c: correct handling of CR_24H bitfield
Andrew Morton <akpm@linux-foundation.org>
revert "rtc: recycle id when unloading a rtc driver"
Corey Minyard <cminyard@mvista.com>
CRIS: fix I/O macros
Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
proc: pid/status: show all supplementary groups
Stephen Boyd <sboyd@codeaurora.org>
lib: atomic64: Initialize locks statically to fix early users
Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Revert "Bluetooth: Fix possible deadlock in SCO code"
Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Bluetooth: cancel power_on work when unregistering the device
Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Bluetooth: Add missing lock nesting notation
Jeff Cook <jeff@deserettechnology.com>
Bluetooth: Add support for BCM20702A0 [0b05, 17b5]
Myron Stowe <myron.stowe@redhat.com>
PCI: Work around Stratus ftServer broken PCIe hierarchy (fix DMI check)
Huang Ying <ying.huang@intel.com>
PCI/PM: Do not suspend port if any subordinate device needs PME polling
Andy Lutomirski <luto@amacapital.net>
PCI: Reduce Ricoh 0xe822 SD card reader base clock frequency to 50MHz
Huang Ying <ying.huang@intel.com>
PCI/PM: Keep runtime PM enabled for unbound PCI devices
David Woodhouse <dwmw2@infradead.org>
solos-pci: fix double-free of TX skb in DMA mode
Jeff Layton <jlayton@redhat.com>
cifs: adjust sequence number downward after signing NT_CANCEL request
Jeff Layton <jlayton@redhat.com>
cifs: move check for NULL socket into smb_send_rqst
Jan Kara <jack@suse.cz>
fs: Fix imbalance in freeze protection in mark_files_ro()
Will Deacon <will.deacon@arm.com>
ARM: 7606/1: cache: flush to LoUU instead of LoUIS on uniprocessor CPUs
Will Deacon <will.deacon@arm.com>
ARM: 7607/1: realview: fix private peripheral memory base for EB rev. B boards
Al Viro <viro@ZenIV.linux.org.uk>
ARM: missing ->mmap_sem around find_vma() in swp_emulate.c
Will Deacon <will.deacon@arm.com>
ARM: mm: use pteval_t to represent page protection values
Al Viro <viro@ZenIV.linux.org.uk>
arm64: compat for clock_adjtime(2) is miswired
Dave Chinner <dchinner@redhat.com>
xfs: fix stray dquot unlock when reclaiming dquots
Dave Chinner <dchinner@redhat.com>
xfs: fix direct IO nested transaction deadlock.
Oleg Nesterov <oleg@redhat.com>
signals: sys_ssetmask() uses uninitialized newmask
Roland Dreier <roland@purestorage.com>
printk: fix incorrect length from print_time() when seconds > 99999
Eric Dumazet <edumazet@google.com>
tcp: fix MSG_SENDPAGE_NOTLAST logic
Daniel Borkmann <dborkman@redhat.com>
sctp: jsctp_sf_eat_sack: fix jprobes function signature mismatch
Stefan Hasko <hasko.stevo@gmail.com>
net: sched: integer overflow fix
Alexander Aring <alex.aring@googlemail.com>
mac802154: fix NOHZ local_softirq_pending 08 warning
Duan Jiong <djduanjiong@gmail.com>
ipv6: Change skb->data before using icmpv6_notify() to propagate redirect
Christoph Paasch <christoph.paasch@uclouvain.be>
inet: Fix kmemleak in tcp_v4/6_syn_recv_sock and dccp_v4/6_request_recv_sock
Akinobu Mita <akinobu.mita@gmail.com>
batman-adv: fix random jitter calculation
David S. Miller <davem@davemloft.net>
sparc64: Set CRYPTO_TFM_REQ_MAY_SLEEP consistently in CAMELLIA code.
David S. Miller <davem@davemloft.net>
sparc64: Set CRYPTO_TFM_REQ_MAY_SLEEP consistently in DES code.
David S. Miller <davem@davemloft.net>
sparc64: Fix ECB looping constructs in AES code.
David S. Miller <davem@davemloft.net>
sparc64: Set CRYPTO_TFM_REQ_MAY_SLEEP consistently in AES code.
David S. Miller <davem@davemloft.net>
sparc64: Fix AES ctr mode block size.
David S. Miller <davem@davemloft.net>
sparc64: Fix unrolled AES 256-bit key loops.
Dave Kleikamp <dave.kleikamp@oracle.com>
sparc: huge_ptep_set_* functions need to call set_huge_pte_at()
Tejun Heo <tj@kernel.org>
freezer: add missing mb's to freezer_count() and freezer_should_skip()
Steve French <smfrench@gmail.com>
SMB3 mounts fail with access denied to some servers
Andy Gross <andy.gross@ti.com>
staging: drm/omap: Fix include error during make
Jianguo Wu <wujianguo@huawei.com>
mm/hugetlb: create hugetlb cgroup file in hugetlb_init
Gao feng <gaofeng@cn.fujitsu.com>
cgroup_rm_file: don't delete the uncreated files
Tejun Heo <tj@kernel.org>
cgroup: remove incorrect dget/dput() pair in cgroup_create_dir()
Tejun Heo <tj@kernel.org>
cgroup: cgroup_subsys->fork() should be called after the task is added to css_set
Russell Webb <russell.webb@linux.intel.com>
xhci: Add Lynx Point LP to list of Intel switchable hosts
Alexis R. Cortes <alexis.cortes@ti.com>
usb: host: xhci: Stricter conditional for Z1 system models for Compliance Mode Patch
Alan Stern <stern@rowland.harvard.edu>
USB: fix endpoint-disabling for failed config changes
Julius Werner <jwerner@chromium.org>
xhci: fix null-pointer dereference when destroying half-built segment rings
Sarah Sharp <sarah.a.sharp@linux.intel.com>
xHCI: Fix TD Size calculation on 1.0 hosts.
Sarah Sharp <sarah.a.sharp@linux.intel.com>
xhci: Fix conditional check in bandwidth calculation.
Afzal Mohammed <afzal@ti.com>
Revert "usb: musb: dsps: remove explicit NOP device creation"
Sergei Shtylyov <sshtylyov@ru.mvista.com>
usb: musb: cppi_dma: export cppi_interrupt()
Thomas Gleixner <tglx@linutronix.de>
genirq: Always force thread affinity
Dmitry Torokhov <dmitry.torokhov@gmail.com>
Input: gpio_keys - defer probing if GPIO probing is deferred
Gabor Juhos <juhosg@openwrt.org>
Input: gpio_keys_polled - defer probing if GPIO probing is deferred
Christophe TORDEUX <christophe@tordeux.net>
Input: sentelic - only report position of first finger as ST coordinates
Diego Calleja <diegocg@gmail.com>
Input: wacom - fix touch support for Bamboo Fun CTH-461
Peter Popovec <popovec@oko.fei.tuke.sk>
Input: walkera0701 - fix crash on startup
NeilBrown <neilb@suse.de>
vfs: d_obtain_alias() needs to use "/" as default name.
Nickolai Zeldovich <nickolai@csail.mit.edu>
nfs: avoid dereferencing null pointer in initiate_bulk_draining
Trond Myklebust <Trond.Myklebust@netapp.com>
NFS: Ensure that we free the rpc_task after read and write cleanups are done
Xi Wang <xi.wang@gmail.com>
nfs: fix null checking in nfs_get_option_str()
Yanchuan Nian <ycnian@gmail.com>
pnfs: Increase the refcount when LAYOUTGET fails the first time
Weston Andros Adamson <dros@netapp.com>
NFS: Fix access to suid/sgid executables
Neil Brown <neilb@suse.de>
nfsd: avoid permission checks on EXCLUSIVE_CREATE replay
J. Bruce Fields <bfields@redhat.com>
nfsd4: fix oops on unusual readlike compound
J. Bruce Fields <bfields@redhat.com>
nfsd: fix v4 reply caching
Yanchuan Nian <ycnian@gmail.com>
nfs: fix wrong object type in lockowner_slab
Trond Myklebust <Trond.Myklebust@netapp.com>
NFS: Don't use SetPageError in the NFS writeback code
Trond Myklebust <Trond.Myklebust@netapp.com>
NFS: Fix calls to drop_nlink()
NeilBrown <neilb@suse.de>
NFS: avoid NULL dereference in nfs_destroy_server
Jeff Layton <jlayton@redhat.com>
nfs: don't zero out the rest of the page if we hit the EOF on a DIO READ
Sven Wegener <sven.wegener@stealer.net>
NFSv4: Check for buffer length in __nfs4_get_acl_uncached
Jeff Layton <jlayton@redhat.com>
nfs: don't extend writes to cover entire page if pagecache is invalid
Bryan Schumaker <bjschuma@netapp.com>
NFS: Add sequence_priviliged_ops for nfs4_proc_sequence()
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPI / scan: Do not use dummy HID for system bus ACPI nodes
Aaron Lu <aaron.lu@intel.com>
libata: restore acpi disable functionality
Zhang Rui <rui.zhang@intel.com>
ACPI: do acpisleep dmi check when CONFIG_ACPI_SLEEP is set
Sebastian Andrzej Siewior <bigeasy@linutronix.de>
usb: gadget: network: fix bind() error path
Sebastian Andrzej Siewior <bigeasy@linutronix.de>
usb: gadget: uvc: fix error path in uvc_function_bind()
Sebastian Andrzej Siewior <bigeasy@linutronix.de>
usb: gadget: tcm_usb_gadget: NULL terminate the FS descriptor list
Sebastian Andrzej Siewior <bigeasy@linutronix.de>
usb: gadget: phonet: free requests in pn_bind()'s error path
Sebastian Andrzej Siewior <bigeasy@linutronix.de>
usb: gadget: midi: free hs descriptors
Lothar Waßmann <LW@KARO-electronics.de>
USB: chipidea: fix use after free bug
Christian Lamparter <chunkeey@googlemail.com>
p54usb: add USBIDs for two more p54usb devices
Tomasz Guszkowski <tsg@o2.pl>
p54usb: add USB ID for T-Com Sinus 154 data II
Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
rtlwifi: fix incorrect use of usb_alloc_coherent with usb_control_msg
Dan Williams <dcbw@redhat.com>
qmi_wwan/cdc_ether: add Dell Wireless 5800 (Novatel E362) USB IDs
David Henningsson <david.henningsson@canonical.com>
ALSA: hda - add mute LED for HP Pavilion 17 (Realtek codec)
Takashi Iwai <tiwai@suse.de>
ALSA: hda - Fix pin configuration of HP Pavilion dv7
Takashi Iwai <tiwai@suse.de>
ALSA: hda - Fix the wrong pincaps set in ALC861VD dallas/hp fixup
Takashi Iwai <tiwai@suse.de>
ALSA: hda - Always turn on pins for HDMI/DP
Takashi Iwai <tiwai@suse.de>
ALSA: hda - Add stereo-dmic fixup for Acer Aspire One 522
Takashi Iwai <tiwai@suse.de>
ALSA: hda - Move runtime PM check to runtime_idle callback
Takashi Iwai <tiwai@suse.de>
ALSA: usb-audio: Fix missing autopm for MIDI input
Takashi Iwai <tiwai@suse.de>
ALSA: usb-audio: Avoid autopm calls after disconnection
Hugh Dickins <hughd@google.com>
tmpfs mempolicy: fix /proc/mounts corrupting memory
Christoffer Dall <cdall@cs.columbia.edu>
mm: Fix PageHead when !CONFIG_PAGEFLAGS_EXTENDED
Sonny Rao <sonnyrao@chromium.org>
mm: fix calculation of dirtyable memory
Will Deacon <will.deacon@arm.com>
virtio: force vring descriptors to be allocated from lowmem
Will Deacon <will.deacon@arm.com>
virtio: 9p: correctly pass physical address to userspace for high pages
Will Deacon <will.deacon@arm.com>
mm: highmem: export kmap_to_page for modules
Ondrej Zary <linux@rainbow-software.org>
x86, 8042: Enable A20 using KBC to fix S3 resume on some MSI laptops
Will Deacon <will.deacon@arm.com>
arm64: signal: push the unwinding prologue on the signal stack
Catalin Marinas <catalin.marinas@arm.com>
arm64: Make !dirty ptes read-only
Kees Cook <keescook@chromium.org>
exec: do not leave bprm->interp on stack
Robin Holt <holt@sgi.com>
SGI-XP: handle non-fatal traps
Alan Cox <alan@lxorguk.ukuu.org.uk>
pnpacpi: fix incorrect TEST_ALPHA() test
Felix Fietkau <nbd@openwrt.org>
b43: fix tx path skb leaks
Larry Finger <Larry.Finger@lwfinger.net>
b43legacy: Fix firmware loading when driver is built into the kernel
Chuansheng Liu <chuansheng.liu@intel.com>
firmware loader: Fix the concurrent request_firmware() race for kref_get/put
Chuansheng Liu <chuansheng.liu@intel.com>
firmware loader: Fix the race FW_STATUS_DONE is followed by class_timeout
Eric Dumazet <edumazet@google.com>
net: fix a race in gro_cell_poll()
-------------
Diffstat:
Makefile | 4 +-
arch/arm/kernel/swp_emulate.c | 2 +
arch/arm/mach-realview/include/mach/board-eb.h | 2 +-
arch/arm/mm/cache-v7.S | 6 +-
arch/arm/mm/mmu.c | 2 +-
arch/arm64/include/asm/pgtable.h | 2 +
arch/arm64/include/asm/unistd32.h | 2 +-
arch/arm64/kernel/signal.c | 37 ++--
arch/cris/include/asm/io.h | 39 +++-
arch/sparc/crypto/aes_asm.S | 20 ++-
arch/sparc/crypto/aes_glue.c | 31 +++-
arch/sparc/crypto/camellia_glue.c | 3 +
arch/sparc/crypto/des_asm.S | 1 +
arch/sparc/crypto/des_glue.c | 6 +
arch/sparc/include/asm/hugetlb.h | 10 +-
arch/x86/pci/common.c | 3 +-
drivers/acpi/scan.c | 2 +-
drivers/acpi/sleep.c | 348 ++++++++++++++++++------------------
drivers/ata/libata-acpi.c | 4 +
drivers/atm/solos-pci.c | 5 +-
drivers/base/firmware_class.c | 30 ++--
drivers/bluetooth/btusb.c | 1 +
drivers/hid/hid-core.c | 1 +
drivers/input/joystick/walkera0701.c | 7 +-
drivers/input/keyboard/gpio_keys.c | 13 +-
drivers/input/keyboard/gpio_keys_polled.c | 13 +-
drivers/input/mouse/sentelic.c | 2 +-
drivers/input/serio/i8042-x86ia64io.h | 9 +
drivers/input/tablet/wacom_wac.c | 3 +-
drivers/misc/sgi-xp/xpc_main.c | 34 +++-
drivers/net/can/dev.c | 3 +-
drivers/net/usb/cdc_ether.c | 15 ++
drivers/net/usb/qmi_wwan.c | 14 ++
drivers/net/wireless/b43/dma.c | 7 +-
drivers/net/wireless/b43/main.c | 12 +-
drivers/net/wireless/b43/pio.c | 4 +-
drivers/net/wireless/b43legacy/b43legacy.h | 5 +
drivers/net/wireless/b43legacy/main.c | 37 +++-
drivers/net/wireless/p54/p54usb.c | 4 +
drivers/net/wireless/rtlwifi/usb.c | 7 +-
drivers/pci/pci-driver.c | 67 ++++---
drivers/pci/pci.c | 2 +
drivers/pci/pcie/portdrv_pci.c | 20 ++-
drivers/pci/quirks.c | 7 +-
drivers/pnp/pnpacpi/core.c | 2 +-
drivers/rtc/class.c | 1 -
drivers/rtc/rtc-vt8500.c | 11 +-
drivers/staging/omapdrm/omap_crtc.c | 2 +-
drivers/usb/chipidea/core.c | 3 +-
drivers/usb/core/message.c | 54 +++---
drivers/usb/gadget/f_ecm.c | 4 +-
drivers/usb/gadget/f_eem.c | 5 +-
drivers/usb/gadget/f_midi.c | 1 +
drivers/usb/gadget/f_ncm.c | 4 +-
drivers/usb/gadget/f_phonet.c | 8 +-
drivers/usb/gadget/f_rndis.c | 4 +-
drivers/usb/gadget/f_subset.c | 4 +-
drivers/usb/gadget/f_uvc.c | 39 ++--
drivers/usb/gadget/tcm_usb_gadget.c | 1 +
drivers/usb/host/ehci-pci.c | 3 +-
drivers/usb/host/pci-quirks.c | 4 +-
drivers/usb/host/xhci-mem.c | 9 +-
drivers/usb/host/xhci-ring.c | 32 ++--
drivers/usb/host/xhci.c | 4 +-
drivers/usb/musb/cppi_dma.c | 1 +
drivers/usb/musb/musb_dsps.c | 3 +-
drivers/virtio/virtio_ring.c | 7 +
fs/binfmt_misc.c | 5 +-
fs/binfmt_script.c | 4 +-
fs/cifs/readdir.c | 59 +++---
fs/cifs/smb1ops.c | 7 +
fs/cifs/smb2pdu.c | 2 +-
fs/cifs/transport.c | 6 +-
fs/dcache.c | 2 +-
fs/exec.c | 15 ++
fs/file_table.c | 2 +-
fs/nfs/callback_proc.c | 2 +-
fs/nfs/client.c | 3 +-
fs/nfs/dir.c | 27 +--
fs/nfs/direct.c | 8 -
fs/nfs/nfs4proc.c | 46 +++--
fs/nfs/pnfs.c | 2 +-
fs/nfs/read.c | 10 +-
fs/nfs/super.c | 2 +-
fs/nfs/write.c | 13 +-
fs/nfsd/nfs4proc.c | 8 +-
fs/nfsd/nfs4state.c | 2 +-
fs/nfsd/nfs4xdr.c | 11 +-
fs/nfsd/nfssvc.c | 2 +-
fs/nfsd/vfs.c | 10 +-
fs/proc/array.c | 2 +-
fs/splice.c | 4 +-
fs/xfs/xfs_aops.c | 81 +++------
fs/xfs/xfs_log.c | 3 +-
fs/xfs/xfs_qm.c | 15 +-
include/asm-generic/tlb.h | 9 +
include/linux/binfmts.h | 1 +
include/linux/cgroup.h | 1 -
include/linux/freezer.h | 50 +++++-
include/linux/hugetlb_cgroup.h | 5 +-
include/linux/kernel.h | 6 +-
include/linux/libata.h | 1 +
include/linux/page-flags.h | 8 +-
include/linux/pci_ids.h | 1 +
include/net/gro_cells.h | 14 +-
include/net/inet_connection_sock.h | 1 +
include/net/ndisc.h | 7 +
kernel/cgroup.c | 76 ++++----
kernel/cgroup_freezer.c | 13 +-
kernel/fork.c | 9 +-
kernel/irq/manage.c | 23 ++-
kernel/printk.c | 5 +-
kernel/signal.c | 1 +
lib/atomic64.c | 17 +-
mm/highmem.c | 1 +
mm/hugetlb.c | 11 +-
mm/hugetlb_cgroup.c | 19 +-
mm/memory.c | 5 +
mm/mempolicy.c | 64 +++----
mm/page-writeback.c | 25 ++-
net/9p/trans_virtio.c | 3 +-
net/batman-adv/bat_iv_ogm.c | 2 +-
net/bluetooth/hci_core.c | 2 +
net/bluetooth/rfcomm/sock.c | 4 +-
net/bluetooth/sco.c | 19 +-
net/dccp/ipv4.c | 4 +-
net/dccp/ipv6.c | 3 +-
net/ipv4/inet_connection_sock.c | 16 ++
net/ipv4/tcp_ipv4.c | 6 +-
net/ipv6/ndisc.c | 17 ++
net/ipv6/tcp_ipv6.c | 3 +-
net/mac802154/wpan.c | 2 +-
net/sched/sch_htb.c | 2 +-
net/sctp/probe.c | 3 +-
sound/pci/hda/hda_intel.c | 19 +-
sound/pci/hda/patch_conexant.c | 1 +
sound/pci/hda/patch_hdmi.c | 18 +-
sound/pci/hda/patch_realtek.c | 34 +++-
sound/pci/hda/patch_sigmatel.c | 2 +-
sound/usb/midi.c | 91 ++++++----
140 files changed, 1280 insertions(+), 749 deletions(-)
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 001/123] net: fix a race in gro_cell_poll()
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 002/123] firmware loader: Fix the race FW_STATUS_DONE is followed by class_timeout Greg Kroah-Hartman
` (124 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Dmitry Kravkov, Eric Dumazet,
David S. Miller
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@google.com>
[ Upstream commit f8e8f97c11d5ff3cc47d85b97c7c35e443dcf490 ]
Dmitry Kravkov reported packet drops for GRE packets since GRO support
was added.
There is a race in gro_cell_poll() because we call napi_complete()
without any synchronization with a concurrent gro_cells_receive()
Once bug was triggered, we queued packets but did not schedule NAPI
poll.
We can fix this issue using the spinlock protected the napi_skbs queue,
as we have to hold it to perform skb dequeue anyway.
As we open-code skb_dequeue(), we no longer need to mask IRQS, as both
producer and consumer run under BH context.
Bug added in commit c9e6bc644e (net: add gro_cells infrastructure)
Reported-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Tested-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/net/gro_cells.h | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
--- a/include/net/gro_cells.h
+++ b/include/net/gro_cells.h
@@ -17,7 +17,6 @@ struct gro_cells {
static inline void gro_cells_receive(struct gro_cells *gcells, struct sk_buff *skb)
{
- unsigned long flags;
struct gro_cell *cell = gcells->cells;
struct net_device *dev = skb->dev;
@@ -35,32 +34,37 @@ static inline void gro_cells_receive(str
return;
}
- spin_lock_irqsave(&cell->napi_skbs.lock, flags);
+ /* We run in BH context */
+ spin_lock(&cell->napi_skbs.lock);
__skb_queue_tail(&cell->napi_skbs, skb);
if (skb_queue_len(&cell->napi_skbs) == 1)
napi_schedule(&cell->napi);
- spin_unlock_irqrestore(&cell->napi_skbs.lock, flags);
+ spin_unlock(&cell->napi_skbs.lock);
}
+/* called unser BH context */
static inline int gro_cell_poll(struct napi_struct *napi, int budget)
{
struct gro_cell *cell = container_of(napi, struct gro_cell, napi);
struct sk_buff *skb;
int work_done = 0;
+ spin_lock(&cell->napi_skbs.lock);
while (work_done < budget) {
- skb = skb_dequeue(&cell->napi_skbs);
+ skb = __skb_dequeue(&cell->napi_skbs);
if (!skb)
break;
-
+ spin_unlock(&cell->napi_skbs.lock);
napi_gro_receive(napi, skb);
work_done++;
+ spin_lock(&cell->napi_skbs.lock);
}
if (work_done < budget)
napi_complete(napi);
+ spin_unlock(&cell->napi_skbs.lock);
return work_done;
}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 002/123] firmware loader: Fix the race FW_STATUS_DONE is followed by class_timeout
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
2013-01-09 20:34 ` [ 001/123] net: fix a race in gro_cell_poll() Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 003/123] firmware loader: Fix the concurrent request_firmware() race for kref_get/put Greg Kroah-Hartman
` (123 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, liu chuansheng, Ming Lei
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chuansheng Liu <chuansheng.liu@intel.com>
commit ce2fcbd99cef580623116bb33531dbc3e6f690b0 upstream.
There is a race as below when calling request_firmware():
CPU1 CPU2
write 0 > loading
mutex_lock(&fw_lock)
...
set_bit FW_STATUS_DONE class_timeout is coming
set_bit FW_STATUS_ABORT
complete_all &completion
...
mutex_unlock(&fw_lock)
In this time, the bit FW_STATUS_DONE and FW_STATUS_ABORT are set,
and request_firmware() will return failure due to condition in
_request_firmware_load():
if (!buf->size || test_bit(FW_STATUS_ABORT, &buf->status))
retval = -ENOENT;
But from the above scenerio, it should be a successful requesting.
So we need judge if the bit FW_STATUS_DONE is already set before
calling fw_load_abort() in timeout function.
As Ming's proposal, we need change the timer into sched_work to
benefit from using &fw_lock mutex also.
Signed-off-by: liu chuansheng <chuansheng.liu@intel.com>
Acked-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/base/firmware_class.c | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -143,7 +143,7 @@ struct fw_cache_entry {
};
struct firmware_priv {
- struct timer_list timeout;
+ struct delayed_work timeout_work;
bool nowait;
struct device dev;
struct firmware_buf *buf;
@@ -667,11 +667,18 @@ static struct bin_attribute firmware_att
.write = firmware_data_write,
};
-static void firmware_class_timeout(u_long data)
+static void firmware_class_timeout_work(struct work_struct *work)
{
- struct firmware_priv *fw_priv = (struct firmware_priv *) data;
+ struct firmware_priv *fw_priv = container_of(work,
+ struct firmware_priv, timeout_work.work);
+ mutex_lock(&fw_lock);
+ if (test_bit(FW_STATUS_DONE, &(fw_priv->buf->status))) {
+ mutex_unlock(&fw_lock);
+ return;
+ }
fw_load_abort(fw_priv);
+ mutex_unlock(&fw_lock);
}
static struct firmware_priv *
@@ -690,8 +697,8 @@ fw_create_instance(struct firmware *firm
fw_priv->nowait = nowait;
fw_priv->fw = firmware;
- setup_timer(&fw_priv->timeout,
- firmware_class_timeout, (u_long) fw_priv);
+ INIT_DELAYED_WORK(&fw_priv->timeout_work,
+ firmware_class_timeout_work);
f_dev = &fw_priv->dev;
@@ -858,7 +865,9 @@ static int _request_firmware_load(struct
dev_dbg(f_dev->parent, "firmware: direct-loading"
" firmware %s\n", buf->fw_id);
+ mutex_lock(&fw_lock);
set_bit(FW_STATUS_DONE, &buf->status);
+ mutex_unlock(&fw_lock);
complete_all(&buf->completion);
direct_load = 1;
goto handle_fw;
@@ -894,15 +903,14 @@ static int _request_firmware_load(struct
dev_set_uevent_suppress(f_dev, false);
dev_dbg(f_dev, "firmware: requesting %s\n", buf->fw_id);
if (timeout != MAX_SCHEDULE_TIMEOUT)
- mod_timer(&fw_priv->timeout,
- round_jiffies_up(jiffies + timeout));
+ schedule_delayed_work(&fw_priv->timeout_work, timeout);
kobject_uevent(&fw_priv->dev.kobj, KOBJ_ADD);
}
wait_for_completion(&buf->completion);
- del_timer_sync(&fw_priv->timeout);
+ cancel_delayed_work_sync(&fw_priv->timeout_work);
handle_fw:
mutex_lock(&fw_lock);
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 003/123] firmware loader: Fix the concurrent request_firmware() race for kref_get/put
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
2013-01-09 20:34 ` [ 001/123] net: fix a race in gro_cell_poll() Greg Kroah-Hartman
2013-01-09 20:34 ` [ 002/123] firmware loader: Fix the race FW_STATUS_DONE is followed by class_timeout Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 004/123] b43legacy: Fix firmware loading when driver is built into the kernel Greg Kroah-Hartman
` (122 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Ming Lei, liu chuansheng
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chuansheng Liu <chuansheng.liu@intel.com>
commit bd9eb7fbe69111ea0ff1f999ef4a5f26d223d1d5 upstream.
There is one race that both request_firmware() with the same
firmware name.
The race scenerio is as below:
CPU1 CPU2
request_firmware() -->
_request_firmware_load() return err another request_firmware() is coming -->
_request_firmware_cleanup is called --> _request_firmware_prepare -->
release_firmware ---> fw_lookup_and_allocate_buf -->
spin_lock(&fwc->lock)
... __fw_lookup_buf() return true
fw_free_buf() will be called --> ...
kref_put -->
decrease the refcount to 0
kref_get(&tmp->ref) ==> it will trigger warning
due to refcount == 0
__fw_free_buf() -->
... spin_unlock(&fwc->lock)
spin_lock(&fwc->lock)
list_del(&buf->list)
spin_unlock(&fwc->lock)
kfree(buf)
After that, the freed buf will be used.
The key race is decreasing refcount to 0 and list_del is not protected together by
fwc->lock, and it is possible another thread try to get it between refcount==0
and list_del.
Fix it here to protect it together.
Acked-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: liu chuansheng <chuansheng.liu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/base/firmware_class.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -246,7 +246,6 @@ static void __fw_free_buf(struct kref *r
__func__, buf->fw_id, buf, buf->data,
(unsigned int)buf->size);
- spin_lock(&fwc->lock);
list_del(&buf->list);
spin_unlock(&fwc->lock);
@@ -263,7 +262,10 @@ static void __fw_free_buf(struct kref *r
static void fw_free_buf(struct firmware_buf *buf)
{
- kref_put(&buf->ref, __fw_free_buf);
+ struct firmware_cache *fwc = buf->fwc;
+ spin_lock(&fwc->lock);
+ if (!kref_put(&buf->ref, __fw_free_buf))
+ spin_unlock(&fwc->lock);
}
/* direct firmware loading support */
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 004/123] b43legacy: Fix firmware loading when driver is built into the kernel
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (2 preceding siblings ...)
2013-01-09 20:34 ` [ 003/123] firmware loader: Fix the concurrent request_firmware() race for kref_get/put Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-11 3:47 ` Ben Hutchings
2013-01-09 20:34 ` [ 005/123] b43: fix tx path skb leaks Greg Kroah-Hartman
` (121 subsequent siblings)
125 siblings, 1 reply; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Larry Finger, John W. Linville
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Larry Finger <Larry.Finger@lwfinger.net>
commit 576d28a7c73013717311cfcb514dbcae27c82eeb upstream.
Recent versions of udev cause synchronous firmware loading from the
probe routine to fail because the request to user space times out.
The original fix for b43legacy (commit a3ea2c7) moved the firmware
load from the probe routine to a work queue, but it still used synchronous
firmware loading. This method is OK when b43legacy is built as a module;
however, it fails when the driver is compiled into the kernel.
This version changes the code to load the initial firmware file
using request_firmware_nowait(). A completion event is used to
hold the work queue until that file is available. The remaining
firmware files are read synchronously.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/wireless/b43legacy/b43legacy.h | 5 +++
drivers/net/wireless/b43legacy/main.c | 37 ++++++++++++++++++++++++-----
2 files changed, 36 insertions(+), 6 deletions(-)
--- a/drivers/net/wireless/b43legacy/b43legacy.h
+++ b/drivers/net/wireless/b43legacy/b43legacy.h
@@ -13,6 +13,7 @@
#include <linux/ssb/ssb.h>
#include <linux/ssb/ssb_driver_chipcommon.h>
+#include <linux/completion.h>
#include <net/mac80211.h>
@@ -733,6 +734,10 @@ struct b43legacy_wldev {
/* Firmware data */
struct b43legacy_firmware fw;
+ const struct firmware *fwp; /* needed to pass fw pointer */
+
+ /* completion struct for firmware loading */
+ struct completion fw_load_complete;
/* Devicelist in struct b43legacy_wl (all 802.11 cores) */
struct list_head list;
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -1513,9 +1513,17 @@ static void b43legacy_print_fw_helptext(
"and download the correct firmware (version 3).\n");
}
+static void b43legacy_fw_cb(const struct firmware *firmware, void *context)
+{
+ struct b43legacy_wldev *dev = context;
+
+ dev->fwp = firmware;
+ complete(&dev->fw_load_complete);
+}
+
static int do_request_fw(struct b43legacy_wldev *dev,
const char *name,
- const struct firmware **fw)
+ const struct firmware **fw, bool async)
{
char path[sizeof(modparam_fwpostfix) + 32];
struct b43legacy_fw_header *hdr;
@@ -1528,7 +1536,24 @@ static int do_request_fw(struct b43legac
snprintf(path, ARRAY_SIZE(path),
"b43legacy%s/%s.fw",
modparam_fwpostfix, name);
- err = request_firmware(fw, path, dev->dev->dev);
+ b43legacyinfo(dev->wl, "Loading firmware %s\n", path);
+ if (async) {
+ init_completion(&dev->fw_load_complete);
+ err = request_firmware_nowait(THIS_MODULE, 1, path,
+ dev->dev->dev, GFP_KERNEL,
+ dev, b43legacy_fw_cb);
+ if (err) {
+ b43legacyerr(dev->wl, "Unable to load firmware\n");
+ return err;
+ }
+ /* stall here until fw ready */
+ wait_for_completion(&dev->fw_load_complete);
+ if (!dev->fwp)
+ err = -EINVAL;
+ *fw = dev->fwp;
+ } else {
+ err = request_firmware(fw, path, dev->dev->dev);
+ }
if (err) {
b43legacyerr(dev->wl, "Firmware file \"%s\" not found "
"or load failed.\n", path);
@@ -1580,7 +1605,7 @@ static void b43legacy_request_firmware(s
filename = "ucode4";
else
filename = "ucode5";
- err = do_request_fw(dev, filename, &fw->ucode);
+ err = do_request_fw(dev, filename, &fw->ucode, true);
if (err)
goto err_load;
}
@@ -1589,7 +1614,7 @@ static void b43legacy_request_firmware(s
filename = "pcm4";
else
filename = "pcm5";
- err = do_request_fw(dev, filename, &fw->pcm);
+ err = do_request_fw(dev, filename, &fw->pcm, false);
if (err)
goto err_load;
}
@@ -1607,7 +1632,7 @@ static void b43legacy_request_firmware(s
default:
goto err_no_initvals;
}
- err = do_request_fw(dev, filename, &fw->initvals);
+ err = do_request_fw(dev, filename, &fw->initvals, false);
if (err)
goto err_load;
}
@@ -1627,7 +1652,7 @@ static void b43legacy_request_firmware(s
default:
goto err_no_initvals;
}
- err = do_request_fw(dev, filename, &fw->initvals_band);
+ err = do_request_fw(dev, filename, &fw->initvals_band, false);
if (err)
goto err_load;
}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 005/123] b43: fix tx path skb leaks
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (3 preceding siblings ...)
2013-01-09 20:34 ` [ 004/123] b43legacy: Fix firmware loading when driver is built into the kernel Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 006/123] pnpacpi: fix incorrect TEST_ALPHA() test Greg Kroah-Hartman
` (120 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Felix Fietkau, John W. Linville
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Felix Fietkau <nbd@openwrt.org>
commit 78f18df4b323d2ac14d6c82e2fc3c8dc4556bccc upstream.
ieee80211_free_txskb() needs to be used instead of dev_kfree_skb_any for
tx packets passed to the driver from mac80211
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/wireless/b43/dma.c | 7 +++++--
drivers/net/wireless/b43/main.c | 12 ++++++++----
drivers/net/wireless/b43/pio.c | 4 ++--
3 files changed, 15 insertions(+), 8 deletions(-)
--- a/drivers/net/wireless/b43/dma.c
+++ b/drivers/net/wireless/b43/dma.c
@@ -409,7 +409,10 @@ static inline
struct b43_dmadesc_meta *meta)
{
if (meta->skb) {
- dev_kfree_skb_any(meta->skb);
+ if (ring->tx)
+ ieee80211_free_txskb(ring->dev->wl->hw, meta->skb);
+ else
+ dev_kfree_skb_any(meta->skb);
meta->skb = NULL;
}
}
@@ -1454,7 +1457,7 @@ int b43_dma_tx(struct b43_wldev *dev, st
if (unlikely(err == -ENOKEY)) {
/* Drop this packet, as we don't have the encryption key
* anymore and must not transmit it unencrypted. */
- dev_kfree_skb_any(skb);
+ ieee80211_free_txskb(dev->wl->hw, skb);
err = 0;
goto out;
}
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -3397,7 +3397,7 @@ static void b43_tx_work(struct work_stru
break;
}
if (unlikely(err))
- dev_kfree_skb(skb); /* Drop it */
+ ieee80211_free_txskb(wl->hw, skb);
err = 0;
}
@@ -3419,7 +3419,7 @@ static void b43_op_tx(struct ieee80211_h
if (unlikely(skb->len < 2 + 2 + 6)) {
/* Too short, this can't be a valid frame. */
- dev_kfree_skb_any(skb);
+ ieee80211_free_txskb(hw, skb);
return;
}
B43_WARN_ON(skb_shinfo(skb)->nr_frags);
@@ -4229,8 +4229,12 @@ redo:
/* Drain all TX queues. */
for (queue_num = 0; queue_num < B43_QOS_QUEUE_NUM; queue_num++) {
- while (skb_queue_len(&wl->tx_queue[queue_num]))
- dev_kfree_skb(skb_dequeue(&wl->tx_queue[queue_num]));
+ while (skb_queue_len(&wl->tx_queue[queue_num])) {
+ struct sk_buff *skb;
+
+ skb = skb_dequeue(&wl->tx_queue[queue_num]);
+ ieee80211_free_txskb(wl->hw, skb);
+ }
}
b43_mac_suspend(dev);
--- a/drivers/net/wireless/b43/pio.c
+++ b/drivers/net/wireless/b43/pio.c
@@ -196,7 +196,7 @@ static void b43_pio_cancel_tx_packets(st
for (i = 0; i < ARRAY_SIZE(q->packets); i++) {
pack = &(q->packets[i]);
if (pack->skb) {
- dev_kfree_skb_any(pack->skb);
+ ieee80211_free_txskb(q->dev->wl->hw, pack->skb);
pack->skb = NULL;
}
}
@@ -552,7 +552,7 @@ int b43_pio_tx(struct b43_wldev *dev, st
if (unlikely(err == -ENOKEY)) {
/* Drop this packet, as we don't have the encryption key
* anymore and must not transmit it unencrypted. */
- dev_kfree_skb_any(skb);
+ ieee80211_free_txskb(dev->wl->hw, skb);
err = 0;
goto out;
}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 006/123] pnpacpi: fix incorrect TEST_ALPHA() test
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (4 preceding siblings ...)
2013-01-09 20:34 ` [ 005/123] b43: fix tx path skb leaks Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 007/123] SGI-XP: handle non-fatal traps Greg Kroah-Hartman
` (119 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Andrew Morton, Rafael J. Wysocki
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
commit cdc87c5a30f407ed1ce43d8a22261116873d5ef1 upstream.
TEST_ALPHA() is broken and always returns 0.
[akpm@linux-foundation.org: return false for '@' as well, per Bjorn]
Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/pnp/pnpacpi/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/pnp/pnpacpi/core.c
+++ b/drivers/pnp/pnpacpi/core.c
@@ -58,7 +58,7 @@ static inline int __init is_exclusive_de
if (!(('0' <= (c) && (c) <= '9') || ('A' <= (c) && (c) <= 'F'))) \
return 0
#define TEST_ALPHA(c) \
- if (!('@' <= (c) || (c) <= 'Z')) \
+ if (!('A' <= (c) && (c) <= 'Z')) \
return 0
static int __init ispnpidacpi(const char *id)
{
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 007/123] SGI-XP: handle non-fatal traps
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (5 preceding siblings ...)
2013-01-09 20:34 ` [ 006/123] pnpacpi: fix incorrect TEST_ALPHA() test Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 008/123] exec: do not leave bprm->interp on stack Greg Kroah-Hartman
` (118 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Robin Holt, Thomas Gleixner,
Ingo Molnar, Andrew Morton, Linus Torvalds
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Robin Holt <holt@sgi.com>
commit 891348ca0f66206f1dc0e30d63757e3df1ae2d15 upstream.
We found a user code which was raising a divide-by-zero trap. That trap
would lead to XPC connections between system-partitions being torn down
due to the die_chain notifier callouts it received.
This also revealed a different issue where multiple callers into
xpc_die_deactivate() would all attempt to do the disconnect in parallel
which would sometimes lock up but often overwhelm the console on very
large machines as each would print at least one line of output at the
end of the deactivate.
I reviewed all the users of the die_chain notifier and changed the code
to ignore the notifier callouts for reasons which will not actually lead
to a system to continue on to call die().
[akpm@linux-foundation.org: fix ia64]
Signed-off-by: Robin Holt <holt@sgi.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/misc/sgi-xp/xpc_main.c | 34 ++++++++++++++++++++++++++++++++--
1 file changed, 32 insertions(+), 2 deletions(-)
--- a/drivers/misc/sgi-xp/xpc_main.c
+++ b/drivers/misc/sgi-xp/xpc_main.c
@@ -53,6 +53,10 @@
#include <linux/kthread.h>
#include "xpc.h"
+#ifdef CONFIG_X86_64
+#include <asm/traps.h>
+#endif
+
/* define two XPC debug device structures to be used with dev_dbg() et al */
struct device_driver xpc_dbg_name = {
@@ -1079,6 +1083,9 @@ xpc_system_reboot(struct notifier_block
return NOTIFY_DONE;
}
+/* Used to only allow one cpu to complete disconnect */
+static unsigned int xpc_die_disconnecting;
+
/*
* Notify other partitions to deactivate from us by first disengaging from all
* references to our memory.
@@ -1092,6 +1099,9 @@ xpc_die_deactivate(void)
long keep_waiting;
long wait_to_print;
+ if (cmpxchg(&xpc_die_disconnecting, 0, 1))
+ return;
+
/* keep xpc_hb_checker thread from doing anything (just in case) */
xpc_exiting = 1;
@@ -1159,7 +1169,7 @@ xpc_die_deactivate(void)
* about the lack of a heartbeat.
*/
static int
-xpc_system_die(struct notifier_block *nb, unsigned long event, void *unused)
+xpc_system_die(struct notifier_block *nb, unsigned long event, void *_die_args)
{
#ifdef CONFIG_IA64 /* !!! temporary kludge */
switch (event) {
@@ -1191,7 +1201,27 @@ xpc_system_die(struct notifier_block *nb
break;
}
#else
- xpc_die_deactivate();
+ struct die_args *die_args = _die_args;
+
+ switch (event) {
+ case DIE_TRAP:
+ if (die_args->trapnr == X86_TRAP_DF)
+ xpc_die_deactivate();
+
+ if (((die_args->trapnr == X86_TRAP_MF) ||
+ (die_args->trapnr == X86_TRAP_XF)) &&
+ !user_mode_vm(die_args->regs))
+ xpc_die_deactivate();
+
+ break;
+ case DIE_INT3:
+ case DIE_DEBUG:
+ break;
+ case DIE_OOPS:
+ case DIE_GPF:
+ default:
+ xpc_die_deactivate();
+ }
#endif
return NOTIFY_DONE;
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 008/123] exec: do not leave bprm->interp on stack
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (6 preceding siblings ...)
2013-01-09 20:34 ` [ 007/123] SGI-XP: handle non-fatal traps Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 009/123] arm64: Make !dirty ptes read-only Greg Kroah-Hartman
` (117 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Kees Cook, halfdog, P J P,
Alexander Viro, Andrew Morton, Linus Torvalds
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <keescook@chromium.org>
commit b66c5984017533316fd1951770302649baf1aa33 upstream.
If a series of scripts are executed, each triggering module loading via
unprintable bytes in the script header, kernel stack contents can leak
into the command line.
Normally execution of binfmt_script and binfmt_misc happens recursively.
However, when modules are enabled, and unprintable bytes exist in the
bprm->buf, execution will restart after attempting to load matching
binfmt modules. Unfortunately, the logic in binfmt_script and
binfmt_misc does not expect to get restarted. They leave bprm->interp
pointing to their local stack. This means on restart bprm->interp is
left pointing into unused stack memory which can then be copied into the
userspace argv areas.
After additional study, it seems that both recursion and restart remains
the desirable way to handle exec with scripts, misc, and modules. As
such, we need to protect the changes to interp.
This changes the logic to require allocation for any changes to the
bprm->interp. To avoid adding a new kmalloc to every exec, the default
value is left as-is. Only when passing through binfmt_script or
binfmt_misc does an allocation take place.
For a proof of concept, see DoTest.sh from:
http://www.halfdog.net/Security/2012/LinuxKernelBinfmtScriptStackDataDisclosure/
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: halfdog <me@halfdog.net>
Cc: P J P <ppandit@redhat.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/binfmt_misc.c | 5 ++++-
fs/binfmt_script.c | 4 +++-
fs/exec.c | 15 +++++++++++++++
include/linux/binfmts.h | 1 +
4 files changed, 23 insertions(+), 2 deletions(-)
--- a/fs/binfmt_misc.c
+++ b/fs/binfmt_misc.c
@@ -176,7 +176,10 @@ static int load_misc_binary(struct linux
goto _error;
bprm->argc ++;
- bprm->interp = iname; /* for binfmt_script */
+ /* Update interp in case binfmt_script needs it. */
+ retval = bprm_change_interp(iname, bprm);
+ if (retval < 0)
+ goto _error;
interp_file = open_exec (iname);
retval = PTR_ERR (interp_file);
--- a/fs/binfmt_script.c
+++ b/fs/binfmt_script.c
@@ -82,7 +82,9 @@ static int load_script(struct linux_binp
retval = copy_strings_kernel(1, &i_name, bprm);
if (retval) return retval;
bprm->argc++;
- bprm->interp = interp;
+ retval = bprm_change_interp(interp, bprm);
+ if (retval < 0)
+ return retval;
/*
* OK, now restart the process with the interpreter's dentry.
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1175,9 +1175,24 @@ void free_bprm(struct linux_binprm *bprm
mutex_unlock(¤t->signal->cred_guard_mutex);
abort_creds(bprm->cred);
}
+ /* If a binfmt changed the interp, free it. */
+ if (bprm->interp != bprm->filename)
+ kfree(bprm->interp);
kfree(bprm);
}
+int bprm_change_interp(char *interp, struct linux_binprm *bprm)
+{
+ /* If a binfmt changed the interp, free it first. */
+ if (bprm->interp != bprm->filename)
+ kfree(bprm->interp);
+ bprm->interp = kstrdup(interp, GFP_KERNEL);
+ if (!bprm->interp)
+ return -ENOMEM;
+ return 0;
+}
+EXPORT_SYMBOL(bprm_change_interp);
+
/*
* install the new credentials for this executable
*/
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -114,6 +114,7 @@ extern int setup_arg_pages(struct linux_
unsigned long stack_top,
int executable_stack);
extern int bprm_mm_init(struct linux_binprm *bprm);
+extern int bprm_change_interp(char *interp, struct linux_binprm *bprm);
extern int copy_strings_kernel(int argc, const char *const *argv,
struct linux_binprm *bprm);
extern int prepare_bprm_creds(struct linux_binprm *bprm);
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 009/123] arm64: Make !dirty ptes read-only
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (7 preceding siblings ...)
2013-01-09 20:34 ` [ 008/123] exec: do not leave bprm->interp on stack Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 010/123] arm64: signal: push the unwinding prologue on the signal stack Greg Kroah-Hartman
` (116 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Catalin Marinas
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Catalin Marinas <catalin.marinas@arm.com>
commit 33eaa58f854770dc9c98411a356c98e3a53edfda upstream.
The AArch64 Linux port relies on the mm code to wrprotect clean ptes.
This however is not the case with newly created ptes and
PAGE_SHARED(_EXEC) is writable but !dirty.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/arm64/include/asm/pgtable.h | 2 ++
1 file changed, 2 insertions(+)
--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -159,6 +159,8 @@ static inline void set_pte_at(struct mm_
{
if (pte_present_exec_user(pte))
__sync_icache_dcache(pte, addr);
+ if (!pte_dirty(pte))
+ pte = pte_wrprotect(pte);
set_pte(ptep, pte);
}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 010/123] arm64: signal: push the unwinding prologue on the signal stack
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (8 preceding siblings ...)
2013-01-09 20:34 ` [ 009/123] arm64: Make !dirty ptes read-only Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 011/123] x86, 8042: Enable A20 using KBC to fix S3 resume on some MSI laptops Greg Kroah-Hartman
` (115 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Will Deacon, Catalin Marinas
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <will.deacon@arm.com>
commit 304ef4e8367244b547734143c792a2ab764831e8 upstream.
To allow debuggers to unwind through signal frames, we create a fake
stack unwinding prologue containing the link register and frame pointer
of the interrupted context. The signal frame is then offset by 16 bytes
to make room for the two saved registers which are pushed onto the frame
of the *interrupted* context, rather than placed directly above the
signal stack.
This doesn't work when an alternative signal stack is set up for a SEGV
handler, which is raised in response to RLIMIT_STACK being reached. In
this case, we try to push the unwinding prologue onto the full stack and
subsequently take a fault which we fail to resolve, causing setup_return
to return -EFAULT and handle_signal to force_sigsegv on the current task.
This patch fixes the problem by including the unwinding prologue as part
of the rt_sigframe definition, which is populated during setup_sigframe,
ensuring that it always ends up on the signal stack.
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/arm64/kernel/signal.c | 37 ++++++++++++++++---------------------
1 file changed, 16 insertions(+), 21 deletions(-)
--- a/arch/arm64/kernel/signal.c
+++ b/arch/arm64/kernel/signal.c
@@ -41,6 +41,8 @@
struct rt_sigframe {
struct siginfo info;
struct ucontext uc;
+ u64 fp;
+ u64 lr;
};
static int preserve_fpsimd_context(struct fpsimd_context __user *ctx)
@@ -175,6 +177,10 @@ static int setup_sigframe(struct rt_sigf
struct aux_context __user *aux =
(struct aux_context __user *)sf->uc.uc_mcontext.__reserved;
+ /* set up the stack frame for unwinding */
+ __put_user_error(regs->regs[29], &sf->fp, err);
+ __put_user_error(regs->regs[30], &sf->lr, err);
+
for (i = 0; i < 31; i++)
__put_user_error(regs->regs[i], &sf->uc.uc_mcontext.regs[i],
err);
@@ -210,9 +216,6 @@ static void __user *get_sigframe(struct
if ((ka->sa.sa_flags & SA_ONSTACK) && !sas_ss_flags(sp))
sp = sp_top = current->sas_ss_sp + current->sas_ss_size;
- /* room for stack frame (FP, LR) */
- sp -= 16;
-
sp = (sp - framesize) & ~15;
frame = (void __user *)sp;
@@ -225,20 +228,14 @@ static void __user *get_sigframe(struct
return frame;
}
-static int setup_return(struct pt_regs *regs, struct k_sigaction *ka,
- void __user *frame, int usig)
+static void setup_return(struct pt_regs *regs, struct k_sigaction *ka,
+ void __user *frame, int usig)
{
- int err = 0;
__sigrestore_t sigtramp;
- unsigned long __user *sp = (unsigned long __user *)regs->sp;
-
- /* set up the stack frame */
- __put_user_error(regs->regs[29], sp - 2, err);
- __put_user_error(regs->regs[30], sp - 1, err);
regs->regs[0] = usig;
- regs->regs[29] = regs->sp - 16;
regs->sp = (unsigned long)frame;
+ regs->regs[29] = regs->sp + offsetof(struct rt_sigframe, fp);
regs->pc = (unsigned long)ka->sa.sa_handler;
if (ka->sa.sa_flags & SA_RESTORER)
@@ -247,8 +244,6 @@ static int setup_return(struct pt_regs *
sigtramp = VDSO_SYMBOL(current->mm->context.vdso, sigtramp);
regs->regs[30] = (unsigned long)sigtramp;
-
- return err;
}
static int setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info,
@@ -272,13 +267,13 @@ static int setup_rt_frame(int usig, stru
err |= __copy_to_user(&frame->uc.uc_stack, &stack, sizeof(stack));
err |= setup_sigframe(frame, regs, set);
- if (err == 0)
- err = setup_return(regs, ka, frame, usig);
-
- if (err == 0 && ka->sa.sa_flags & SA_SIGINFO) {
- err |= copy_siginfo_to_user(&frame->info, info);
- regs->regs[1] = (unsigned long)&frame->info;
- regs->regs[2] = (unsigned long)&frame->uc;
+ if (err == 0) {
+ setup_return(regs, ka, frame, usig);
+ if (ka->sa.sa_flags & SA_SIGINFO) {
+ err |= copy_siginfo_to_user(&frame->info, info);
+ regs->regs[1] = (unsigned long)&frame->info;
+ regs->regs[2] = (unsigned long)&frame->uc;
+ }
}
return err;
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 011/123] x86, 8042: Enable A20 using KBC to fix S3 resume on some MSI laptops
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (9 preceding siblings ...)
2013-01-09 20:34 ` [ 010/123] arm64: signal: push the unwinding prologue on the signal stack Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 012/123] mm: highmem: export kmap_to_page for modules Greg Kroah-Hartman
` (114 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Ondrej Zary, Dmitry Torokhov,
Rafael J. Wysocki, H. Peter Anvin
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ondrej Zary <linux@rainbow-software.org>
commit ad68652412276f68ad4fe3e1ecf5ee6880876783 upstream.
Some MSI laptop BIOSes are broken - INT 15h code uses port 92h to enable A20
line but resume code assumes that KBC was used.
The laptop will not resume from S3 otherwise but powers off after a while
and then powers on again stuck with a blank screen.
Fix it by enabling A20 using KBC in i8042_platform_init for x86.
Fixes https://bugzilla.kernel.org/show_bug.cgi?id=12878
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Link: http://lkml.kernel.org/r/201212112218.06551.linux@rainbow-software.org
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/input/serio/i8042-x86ia64io.h | 9 +++++++++
1 file changed, 9 insertions(+)
--- a/drivers/input/serio/i8042-x86ia64io.h
+++ b/drivers/input/serio/i8042-x86ia64io.h
@@ -921,6 +921,7 @@ static int __init i8042_platform_init(vo
int retval;
#ifdef CONFIG_X86
+ u8 a20_on = 0xdf;
/* Just return if pre-detection shows no i8042 controller exist */
if (!x86_platform.i8042_detect())
return -ENODEV;
@@ -960,6 +961,14 @@ static int __init i8042_platform_init(vo
if (dmi_check_system(i8042_dmi_dritek_table))
i8042_dritek = true;
+
+ /*
+ * A20 was already enabled during early kernel init. But some buggy
+ * BIOSes (in MSI Laptops) require A20 to be enabled using 8042 to
+ * resume from S3. So we do it here and hope that nothing breaks.
+ */
+ i8042_command(&a20_on, 0x10d1);
+ i8042_command(NULL, 0x00ff); /* Null command for SMM firmware */
#endif /* CONFIG_X86 */
return retval;
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 012/123] mm: highmem: export kmap_to_page for modules
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (10 preceding siblings ...)
2013-01-09 20:34 ` [ 011/123] x86, 8042: Enable A20 using KBC to fix S3 resume on some MSI laptops Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 013/123] virtio: 9p: correctly pass physical address to userspace for high pages Greg Kroah-Hartman
` (113 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Will Deacon, Rusty Russell
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <will.deacon@arm.com>
commit f0263d2d222e9e25f2587e51a9dc58c6fb2a9352 upstream.
Some virtio device drivers (9p) need to translate high virtual addresses
to physical addresses, which are inserted into the virtqueue for
processing by userspace.
This patch exports the kmap_to_page symbol, so that the affected drivers
can be compiled as modules.
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
mm/highmem.c | 1 +
1 file changed, 1 insertion(+)
--- a/mm/highmem.c
+++ b/mm/highmem.c
@@ -105,6 +105,7 @@ struct page *kmap_to_page(void *vaddr)
return virt_to_page(addr);
}
+EXPORT_SYMBOL(kmap_to_page);
static void flush_all_zero_pkmaps(void)
{
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 013/123] virtio: 9p: correctly pass physical address to userspace for high pages
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (11 preceding siblings ...)
2013-01-09 20:34 ` [ 012/123] mm: highmem: export kmap_to_page for modules Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 014/123] virtio: force vring descriptors to be allocated from lowmem Greg Kroah-Hartman
` (112 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Will Deacon, Sasha Levin, Rusty Russell
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <will.deacon@arm.com>
commit b9cdc88df8e63e81c723b82c286fc97f5d0dc325 upstream.
When using a virtio transport, the 9p net device may pass the physical
address of a kernel buffer to userspace via a scatterlist inside a
virtqueue. If the kernel buffer is mapped outside of the linear mapping
(e.g. highmem), then virt_to_page will return a bogus value and we will
populate the scatterlist with junk.
This patch uses kmap_to_page when populating the page array for a kernel
buffer.
Signed-off-by: Will Deacon <will.deacon@arm.com>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/9p/trans_virtio.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -39,6 +39,7 @@
#include <linux/inet.h>
#include <linux/idr.h>
#include <linux/file.h>
+#include <linux/highmem.h>
#include <linux/slab.h>
#include <net/9p/9p.h>
#include <linux/parser.h>
@@ -325,7 +326,7 @@ static int p9_get_mapped_pages(struct vi
int count = nr_pages;
while (nr_pages) {
s = rest_of_page(data);
- pages[index++] = virt_to_page(data);
+ pages[index++] = kmap_to_page(data);
data += s;
nr_pages--;
}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 014/123] virtio: force vring descriptors to be allocated from lowmem
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (12 preceding siblings ...)
2013-01-09 20:34 ` [ 013/123] virtio: 9p: correctly pass physical address to userspace for high pages Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 015/123] mm: fix calculation of dirtyable memory Greg Kroah-Hartman
` (111 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Will Deacon, Sasha Levin, Rusty Russell
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <will.deacon@arm.com>
commit b92b1b89a33c172c075edccf6afb0edc41d851fd upstream.
Virtio devices may attempt to add descriptors to a virtqueue from atomic
context using GFP_ATOMIC allocation. This is problematic because such
allocations can fall outside of the lowmem mapping, causing virt_to_phys
to report bogus physical addresses which are subsequently passed to
userspace via the buffers for the virtual device.
This patch masks out __GFP_HIGH and __GFP_HIGHMEM from the requested
flags when allocating descriptors for a virtqueue. If an atomic
allocation is requested and later fails, we will return -ENOSPC which
will be handled by the driver.
Signed-off-by: Will Deacon <will.deacon@arm.com>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/virtio/virtio_ring.c | 7 +++++++
1 file changed, 7 insertions(+)
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -135,6 +135,13 @@ static int vring_add_indirect(struct vri
unsigned head;
int i;
+ /*
+ * We require lowmem mappings for the descriptors because
+ * otherwise virt_to_phys will give us bogus addresses in the
+ * virtqueue.
+ */
+ gfp &= ~(__GFP_HIGHMEM | __GFP_HIGH);
+
desc = kmalloc((out + in) * sizeof(struct vring_desc), gfp);
if (!desc)
return -ENOMEM;
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 015/123] mm: fix calculation of dirtyable memory
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (13 preceding siblings ...)
2013-01-09 20:34 ` [ 014/123] virtio: force vring descriptors to be allocated from lowmem Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 016/123] mm: Fix PageHead when !CONFIG_PAGEFLAGS_EXTENDED Greg Kroah-Hartman
` (110 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Sonny Rao, Puneet Kumar,
Johannes Weiner, Damien Wyart, Andrew Morton, Linus Torvalds
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sonny Rao <sonnyrao@chromium.org>
commit c8b74c2f6604923de91f8aa6539f8bb934736754 upstream.
The system uses global_dirtyable_memory() to calculate number of
dirtyable pages/pages that can be allocated to the page cache. A bug
causes an underflow thus making the page count look like a big unsigned
number. This in turn confuses the dirty writeback throttling to
aggressively write back pages as they become dirty (usually 1 page at a
time). This generally only affects systems with highmem because the
underflowed count gets subtracted from the global count of dirtyable
memory.
The problem was introduced with v3.2-4896-gab8fabd
Fix is to ensure we don't get an underflowed total of either highmem or
global dirtyable memory.
Signed-off-by: Sonny Rao <sonnyrao@chromium.org>
Signed-off-by: Puneet Kumar <puneetster@chromium.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Tested-by: Damien Wyart <damien.wyart@free.fr>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
mm/page-writeback.c | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -201,6 +201,18 @@ static unsigned long highmem_dirtyable_m
zone_reclaimable_pages(z) - z->dirty_balance_reserve;
}
/*
+ * Unreclaimable memory (kernel memory or anonymous memory
+ * without swap) can bring down the dirtyable pages below
+ * the zone's dirty balance reserve and the above calculation
+ * will underflow. However we still want to add in nodes
+ * which are below threshold (negative values) to get a more
+ * accurate calculation but make sure that the total never
+ * underflows.
+ */
+ if ((long)x < 0)
+ x = 0;
+
+ /*
* Make sure that the number of highmem pages is never larger
* than the number of the total dirtyable memory. This can only
* occur in very strange VM situations but we want to make sure
@@ -222,8 +234,8 @@ static unsigned long global_dirtyable_me
{
unsigned long x;
- x = global_page_state(NR_FREE_PAGES) + global_reclaimable_pages() -
- dirty_balance_reserve;
+ x = global_page_state(NR_FREE_PAGES) + global_reclaimable_pages();
+ x -= min(x, dirty_balance_reserve);
if (!vm_highmem_is_dirtyable)
x -= highmem_dirtyable_memory(x);
@@ -290,9 +302,12 @@ static unsigned long zone_dirtyable_memo
* highmem zone can hold its share of dirty pages, so we don't
* care about vm_highmem_is_dirtyable here.
*/
- return zone_page_state(zone, NR_FREE_PAGES) +
- zone_reclaimable_pages(zone) -
- zone->dirty_balance_reserve;
+ unsigned long nr_pages = zone_page_state(zone, NR_FREE_PAGES) +
+ zone_reclaimable_pages(zone);
+
+ /* don't allow this to underflow */
+ nr_pages -= min(nr_pages, zone->dirty_balance_reserve);
+ return nr_pages;
}
/**
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 016/123] mm: Fix PageHead when !CONFIG_PAGEFLAGS_EXTENDED
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (14 preceding siblings ...)
2013-01-09 20:34 ` [ 015/123] mm: fix calculation of dirtyable memory Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 017/123] tmpfs mempolicy: fix /proc/mounts corrupting memory Greg Kroah-Hartman
` (109 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Christoffer Dall, Andrea Arcangeli,
Andrew Morton, Will Deacon, Steve Capper, Christoph Lameter,
Linus Torvalds
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoffer Dall <cdall@cs.columbia.edu>
commit ad4b3fb7ff9940bcdb1e4cd62bd189d10fa636ba upstream.
Unfortunately with !CONFIG_PAGEFLAGS_EXTENDED, (!PageHead) is false, and
(PageHead) is true, for tail pages. If this is indeed the intended
behavior, which I doubt because it breaks cache cleaning on some ARM
systems, then the nomenclature is highly problematic.
This patch makes sure PageHead is only true for head pages and PageTail
is only true for tail pages, and neither is true for non-compound pages.
[ This buglet seems ancient - seems to have been introduced back in Apr
2008 in commit 6a1e7f777f61: "pageflags: convert to the use of new
macros". And the reason nobody noticed is because the PageHead()
tests are almost all about just sanity-checking, and only used on
pages that are actual page heads. The fact that the old code returned
true for tail pages too was thus not really noticeable. - Linus ]
Signed-off-by: Christoffer Dall <cdall@cs.columbia.edu>
Acked-by: Andrea Arcangeli <aarcange@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Will Deacon <Will.Deacon@arm.com>
Cc: Steve Capper <Steve.Capper@arm.com>
Cc: Christoph Lameter <cl@linux.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/page-flags.h | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -362,7 +362,7 @@ static inline void ClearPageCompound(str
* pages on the LRU and/or pagecache.
*/
TESTPAGEFLAG(Compound, compound)
-__PAGEFLAG(Head, compound)
+__SETPAGEFLAG(Head, compound) __CLEARPAGEFLAG(Head, compound)
/*
* PG_reclaim is used in combination with PG_compound to mark the
@@ -374,8 +374,14 @@ __PAGEFLAG(Head, compound)
* PG_compound & PG_reclaim => Tail page
* PG_compound & ~PG_reclaim => Head page
*/
+#define PG_head_mask ((1L << PG_compound))
#define PG_head_tail_mask ((1L << PG_compound) | (1L << PG_reclaim))
+static inline int PageHead(struct page *page)
+{
+ return ((page->flags & PG_head_tail_mask) == PG_head_mask);
+}
+
static inline int PageTail(struct page *page)
{
return ((page->flags & PG_head_tail_mask) == PG_head_tail_mask);
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 017/123] tmpfs mempolicy: fix /proc/mounts corrupting memory
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (15 preceding siblings ...)
2013-01-09 20:34 ` [ 016/123] mm: Fix PageHead when !CONFIG_PAGEFLAGS_EXTENDED Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 018/123] ALSA: usb-audio: Avoid autopm calls after disconnection Greg Kroah-Hartman
` (108 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Hugh Dickins, Linus Torvalds
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hugh Dickins <hughd@google.com>
commit f2a07f40dbc603c15f8b06e6ec7f768af67b424f upstream.
Recently I suggested using "mount -o remount,mpol=local /tmp" in NUMA
mempolicy testing. Very nasty. Reading /proc/mounts, /proc/pid/mounts
or /proc/pid/mountinfo may then corrupt one bit of kernel memory, often
in a page table (causing "Bad swap" or "Bad page map" warning or "Bad
pagetable" oops), sometimes in a vm_area_struct or rbnode or somewhere
worse. "mpol=prefer" and "mpol=prefer:Node" are equally toxic.
Recent NUMA enhancements are not to blame: this dates back to 2.6.35,
when commit e17f74af351c "mempolicy: don't call mpol_set_nodemask() when
no_context" skipped mpol_parse_str()'s call to mpol_set_nodemask(),
which used to initialize v.preferred_node, or set MPOL_F_LOCAL in flags.
With slab poisoning, you can then rely on mpol_to_str() to set the bit
for node 0x6b6b, probably in the next page above the caller's stack.
mpol_parse_str() is only called from shmem_parse_options(): no_context
is always true, so call it unused for now, and remove !no_context code.
Set v.nodes or v.preferred_node or MPOL_F_LOCAL as mpol_to_str() might
expect. Then mpol_to_str() can ignore its no_context argument also,
the mpol being appropriately initialized whether contextualized or not.
Rename its no_context unused too, and let subsequent patch remove them
(that's not needed for stable backporting, which would involve rejects).
I don't understand why MPOL_LOCAL is described as a pseudo-policy:
it's a reasonable policy which suffers from a confusing implementation
in terms of MPOL_PREFERRED with MPOL_F_LOCAL. I believe this would be
much more robust if MPOL_LOCAL were recognized in switch statements
throughout, MPOL_F_LOCAL deleted, and MPOL_PREFERRED use the (possibly
empty) nodes mask like everyone else, instead of its preferred_node
variant (I presume an optimization from the days before MPOL_LOCAL).
But that would take me too long to get right and fully tested.
Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
mm/mempolicy.c | 64 +++++++++++++++++++++++----------------------------------
1 file changed, 26 insertions(+), 38 deletions(-)
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2372,8 +2372,7 @@ void numa_default_policy(void)
*/
/*
- * "local" is pseudo-policy: MPOL_PREFERRED with MPOL_F_LOCAL flag
- * Used only for mpol_parse_str() and mpol_to_str()
+ * "local" is implemented internally by MPOL_PREFERRED with MPOL_F_LOCAL flag.
*/
#define MPOL_LOCAL MPOL_MAX
static const char * const policy_modes[] =
@@ -2388,28 +2387,21 @@ static const char * const policy_modes[]
#ifdef CONFIG_TMPFS
/**
- * mpol_parse_str - parse string to mempolicy
+ * mpol_parse_str - parse string to mempolicy, for tmpfs mpol mount option.
* @str: string containing mempolicy to parse
* @mpol: pointer to struct mempolicy pointer, returned on success.
- * @no_context: flag whether to "contextualize" the mempolicy
+ * @unused: redundant argument, to be removed later.
*
* Format of input:
* <mode>[=<flags>][:<nodelist>]
*
- * if @no_context is true, save the input nodemask in w.user_nodemask in
- * the returned mempolicy. This will be used to "clone" the mempolicy in
- * a specific context [cpuset] at a later time. Used to parse tmpfs mpol
- * mount option. Note that if 'static' or 'relative' mode flags were
- * specified, the input nodemask will already have been saved. Saving
- * it again is redundant, but safe.
- *
* On success, returns 0, else 1
*/
-int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context)
+int mpol_parse_str(char *str, struct mempolicy **mpol, int unused)
{
struct mempolicy *new = NULL;
unsigned short mode;
- unsigned short uninitialized_var(mode_flags);
+ unsigned short mode_flags;
nodemask_t nodes;
char *nodelist = strchr(str, ':');
char *flags = strchr(str, '=');
@@ -2497,24 +2489,23 @@ int mpol_parse_str(char *str, struct mem
if (IS_ERR(new))
goto out;
- if (no_context) {
- /* save for contextualization */
- new->w.user_nodemask = nodes;
- } else {
- int ret;
- NODEMASK_SCRATCH(scratch);
- if (scratch) {
- task_lock(current);
- ret = mpol_set_nodemask(new, &nodes, scratch);
- task_unlock(current);
- } else
- ret = -ENOMEM;
- NODEMASK_SCRATCH_FREE(scratch);
- if (ret) {
- mpol_put(new);
- goto out;
- }
- }
+ /*
+ * Save nodes for mpol_to_str() to show the tmpfs mount options
+ * for /proc/mounts, /proc/pid/mounts and /proc/pid/mountinfo.
+ */
+ if (mode != MPOL_PREFERRED)
+ new->v.nodes = nodes;
+ else if (nodelist)
+ new->v.preferred_node = first_node(nodes);
+ else
+ new->flags |= MPOL_F_LOCAL;
+
+ /*
+ * Save nodes for contextualization: this will be used to "clone"
+ * the mempolicy in a specific context [cpuset] at a later time.
+ */
+ new->w.user_nodemask = nodes;
+
err = 0;
out:
@@ -2534,13 +2525,13 @@ out:
* @buffer: to contain formatted mempolicy string
* @maxlen: length of @buffer
* @pol: pointer to mempolicy to be formatted
- * @no_context: "context free" mempolicy - use nodemask in w.user_nodemask
+ * @unused: redundant argument, to be removed later.
*
* Convert a mempolicy into a string.
* Returns the number of characters in buffer (if positive)
* or an error (negative)
*/
-int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, int no_context)
+int mpol_to_str(char *buffer, int maxlen, struct mempolicy *pol, int unused)
{
char *p = buffer;
int l;
@@ -2566,7 +2557,7 @@ int mpol_to_str(char *buffer, int maxlen
case MPOL_PREFERRED:
nodes_clear(nodes);
if (flags & MPOL_F_LOCAL)
- mode = MPOL_LOCAL; /* pseudo-policy */
+ mode = MPOL_LOCAL;
else
node_set(pol->v.preferred_node, nodes);
break;
@@ -2574,10 +2565,7 @@ int mpol_to_str(char *buffer, int maxlen
case MPOL_BIND:
/* Fall through */
case MPOL_INTERLEAVE:
- if (no_context)
- nodes = pol->w.user_nodemask;
- else
- nodes = pol->v.nodes;
+ nodes = pol->v.nodes;
break;
default:
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 018/123] ALSA: usb-audio: Avoid autopm calls after disconnection
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (16 preceding siblings ...)
2013-01-09 20:34 ` [ 017/123] tmpfs mempolicy: fix /proc/mounts corrupting memory Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 019/123] ALSA: usb-audio: Fix missing autopm for MIDI input Greg Kroah-Hartman
` (107 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Clemens Ladisch, Takashi Iwai
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit 59866da9e4ae54819e3c4e0a8f426bdb0c2ef993 upstream.
Add a similar protection against the disconnection race and the
invalid use of usb instance after disconnection, as well as we've done
for the USB audio PCM.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=51201
Reviewd-by: Clemens Ladisch <clemens@ladisch.de>
Tested-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/usb/midi.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
--- a/sound/usb/midi.c
+++ b/sound/usb/midi.c
@@ -116,6 +116,7 @@ struct snd_usb_midi {
struct list_head list;
struct timer_list error_timer;
spinlock_t disc_lock;
+ struct rw_semaphore disc_rwsem;
struct mutex mutex;
u32 usb_id;
int next_midi_device;
@@ -1038,6 +1039,12 @@ static void substream_open(struct snd_ra
struct snd_usb_midi* umidi = substream->rmidi->private_data;
struct snd_kcontrol *ctl;
+ down_read(&umidi->disc_rwsem);
+ if (umidi->disconnected) {
+ up_read(&umidi->disc_rwsem);
+ return;
+ }
+
mutex_lock(&umidi->mutex);
if (open) {
if (umidi->opened++ == 0 && umidi->roland_load_ctl) {
@@ -1056,6 +1063,7 @@ static void substream_open(struct snd_ra
}
}
mutex_unlock(&umidi->mutex);
+ up_read(&umidi->disc_rwsem);
}
static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream)
@@ -1076,8 +1084,15 @@ static int snd_usbmidi_output_open(struc
snd_BUG();
return -ENXIO;
}
+
+ down_read(&umidi->disc_rwsem);
+ if (umidi->disconnected) {
+ up_read(&umidi->disc_rwsem);
+ return -ENODEV;
+ }
err = usb_autopm_get_interface(umidi->iface);
port->autopm_reference = err >= 0;
+ up_read(&umidi->disc_rwsem);
if (err < 0 && err != -EACCES)
return -EIO;
substream->runtime->private_data = port;
@@ -1092,8 +1107,10 @@ static int snd_usbmidi_output_close(stru
struct usbmidi_out_port *port = substream->runtime->private_data;
substream_open(substream, 0);
- if (port->autopm_reference)
+ down_read(&umidi->disc_rwsem);
+ if (!umidi->disconnected && port->autopm_reference)
usb_autopm_put_interface(umidi->iface);
+ up_read(&umidi->disc_rwsem);
return 0;
}
@@ -1403,9 +1420,12 @@ void snd_usbmidi_disconnect(struct list_
* a timer may submit an URB. To reliably break the cycle
* a flag under lock must be used
*/
+ down_write(&umidi->disc_rwsem);
spin_lock_irq(&umidi->disc_lock);
umidi->disconnected = 1;
spin_unlock_irq(&umidi->disc_lock);
+ up_write(&umidi->disc_rwsem);
+
for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) {
struct snd_usb_midi_endpoint* ep = &umidi->endpoints[i];
if (ep->out)
@@ -2117,6 +2137,7 @@ int snd_usbmidi_create(struct snd_card *
umidi->usb_protocol_ops = &snd_usbmidi_standard_ops;
init_timer(&umidi->error_timer);
spin_lock_init(&umidi->disc_lock);
+ init_rwsem(&umidi->disc_rwsem);
mutex_init(&umidi->mutex);
umidi->usb_id = USB_ID(le16_to_cpu(umidi->dev->descriptor.idVendor),
le16_to_cpu(umidi->dev->descriptor.idProduct));
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 019/123] ALSA: usb-audio: Fix missing autopm for MIDI input
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (17 preceding siblings ...)
2013-01-09 20:34 ` [ 018/123] ALSA: usb-audio: Avoid autopm calls after disconnection Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 020/123] ALSA: hda - Move runtime PM check to runtime_idle callback Greg Kroah-Hartman
` (106 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Clemens Ladisch, Takashi Iwai
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit f5f165418cabf2218eb466c0e94693b8b1aee88b upstream.
The commit [88a8516a: ALSA: usbaudio: implement USB autosuspend] added
the support of autopm for USB MIDI output, but it didn't take the MIDI
input into account.
This patch adds the following for fixing the autopm:
- Manage the URB start at the first MIDI input stream open, instead of
the time of instance creation
- Move autopm code to the common substream_open()
- Make snd_usbmidi_input_start/_stop() more robust and add the running
state check
Reviewd-by: Clemens Ladisch <clemens@ladisch.de>
Tested-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/usb/midi.c | 88 ++++++++++++++++++++++++++++---------------------------
1 file changed, 46 insertions(+), 42 deletions(-)
--- a/sound/usb/midi.c
+++ b/sound/usb/midi.c
@@ -126,8 +126,10 @@ struct snd_usb_midi {
struct snd_usb_midi_in_endpoint *in;
} endpoints[MIDI_MAX_ENDPOINTS];
unsigned long input_triggered;
- unsigned int opened;
+ bool autopm_reference;
+ unsigned int opened[2];
unsigned char disconnected;
+ unsigned char input_running;
struct snd_kcontrol *roland_load_ctl;
};
@@ -149,7 +151,6 @@ struct snd_usb_midi_out_endpoint {
struct snd_usb_midi_out_endpoint* ep;
struct snd_rawmidi_substream *substream;
int active;
- bool autopm_reference;
uint8_t cable; /* cable number << 4 */
uint8_t state;
#define STATE_UNKNOWN 0
@@ -1034,36 +1035,58 @@ static void update_roland_altsetting(str
snd_usbmidi_input_start(&umidi->list);
}
-static void substream_open(struct snd_rawmidi_substream *substream, int open)
+static int substream_open(struct snd_rawmidi_substream *substream, int dir,
+ int open)
{
struct snd_usb_midi* umidi = substream->rmidi->private_data;
struct snd_kcontrol *ctl;
+ int err;
down_read(&umidi->disc_rwsem);
if (umidi->disconnected) {
up_read(&umidi->disc_rwsem);
- return;
+ return open ? -ENODEV : 0;
}
mutex_lock(&umidi->mutex);
if (open) {
- if (umidi->opened++ == 0 && umidi->roland_load_ctl) {
- ctl = umidi->roland_load_ctl;
- ctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_INACTIVE;
- snd_ctl_notify(umidi->card,
+ if (!umidi->opened[0] && !umidi->opened[1]) {
+ err = usb_autopm_get_interface(umidi->iface);
+ umidi->autopm_reference = err >= 0;
+ if (err < 0 && err != -EACCES) {
+ mutex_unlock(&umidi->mutex);
+ up_read(&umidi->disc_rwsem);
+ return -EIO;
+ }
+ if (umidi->roland_load_ctl) {
+ ctl = umidi->roland_load_ctl;
+ ctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_INACTIVE;
+ snd_ctl_notify(umidi->card,
SNDRV_CTL_EVENT_MASK_INFO, &ctl->id);
- update_roland_altsetting(umidi);
+ update_roland_altsetting(umidi);
+ }
}
+ umidi->opened[dir]++;
+ if (umidi->opened[1])
+ snd_usbmidi_input_start(&umidi->list);
} else {
- if (--umidi->opened == 0 && umidi->roland_load_ctl) {
- ctl = umidi->roland_load_ctl;
- ctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
- snd_ctl_notify(umidi->card,
+ umidi->opened[dir]--;
+ if (!umidi->opened[1])
+ snd_usbmidi_input_stop(&umidi->list);
+ if (!umidi->opened[0] && !umidi->opened[1]) {
+ if (umidi->roland_load_ctl) {
+ ctl = umidi->roland_load_ctl;
+ ctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
+ snd_ctl_notify(umidi->card,
SNDRV_CTL_EVENT_MASK_INFO, &ctl->id);
+ }
+ if (umidi->autopm_reference)
+ usb_autopm_put_interface(umidi->iface);
}
}
mutex_unlock(&umidi->mutex);
up_read(&umidi->disc_rwsem);
+ return 0;
}
static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream)
@@ -1071,7 +1094,6 @@ static int snd_usbmidi_output_open(struc
struct snd_usb_midi* umidi = substream->rmidi->private_data;
struct usbmidi_out_port* port = NULL;
int i, j;
- int err;
for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i)
if (umidi->endpoints[i].out)
@@ -1085,33 +1107,14 @@ static int snd_usbmidi_output_open(struc
return -ENXIO;
}
- down_read(&umidi->disc_rwsem);
- if (umidi->disconnected) {
- up_read(&umidi->disc_rwsem);
- return -ENODEV;
- }
- err = usb_autopm_get_interface(umidi->iface);
- port->autopm_reference = err >= 0;
- up_read(&umidi->disc_rwsem);
- if (err < 0 && err != -EACCES)
- return -EIO;
substream->runtime->private_data = port;
port->state = STATE_UNKNOWN;
- substream_open(substream, 1);
- return 0;
+ return substream_open(substream, 0, 1);
}
static int snd_usbmidi_output_close(struct snd_rawmidi_substream *substream)
{
- struct snd_usb_midi* umidi = substream->rmidi->private_data;
- struct usbmidi_out_port *port = substream->runtime->private_data;
-
- substream_open(substream, 0);
- down_read(&umidi->disc_rwsem);
- if (!umidi->disconnected && port->autopm_reference)
- usb_autopm_put_interface(umidi->iface);
- up_read(&umidi->disc_rwsem);
- return 0;
+ return substream_open(substream, 0, 0);
}
static void snd_usbmidi_output_trigger(struct snd_rawmidi_substream *substream, int up)
@@ -1164,14 +1167,12 @@ static void snd_usbmidi_output_drain(str
static int snd_usbmidi_input_open(struct snd_rawmidi_substream *substream)
{
- substream_open(substream, 1);
- return 0;
+ return substream_open(substream, 1, 1);
}
static int snd_usbmidi_input_close(struct snd_rawmidi_substream *substream)
{
- substream_open(substream, 0);
- return 0;
+ return substream_open(substream, 1, 0);
}
static void snd_usbmidi_input_trigger(struct snd_rawmidi_substream *substream, int up)
@@ -2080,12 +2081,15 @@ void snd_usbmidi_input_stop(struct list_
unsigned int i, j;
umidi = list_entry(p, struct snd_usb_midi, list);
+ if (!umidi->input_running)
+ return;
for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i) {
struct snd_usb_midi_endpoint* ep = &umidi->endpoints[i];
if (ep->in)
for (j = 0; j < INPUT_URBS; ++j)
usb_kill_urb(ep->in->urbs[j]);
}
+ umidi->input_running = 0;
}
static void snd_usbmidi_input_start_ep(struct snd_usb_midi_in_endpoint* ep)
@@ -2110,8 +2114,11 @@ void snd_usbmidi_input_start(struct list
int i;
umidi = list_entry(p, struct snd_usb_midi, list);
+ if (umidi->input_running || !umidi->opened[1])
+ return;
for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i)
snd_usbmidi_input_start_ep(umidi->endpoints[i].in);
+ umidi->input_running = 1;
}
/*
@@ -2250,9 +2257,6 @@ int snd_usbmidi_create(struct snd_card *
}
list_add_tail(&umidi->list, midi_list);
-
- for (i = 0; i < MIDI_MAX_ENDPOINTS; ++i)
- snd_usbmidi_input_start_ep(umidi->endpoints[i].in);
return 0;
}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 020/123] ALSA: hda - Move runtime PM check to runtime_idle callback
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (18 preceding siblings ...)
2013-01-09 20:34 ` [ 019/123] ALSA: usb-audio: Fix missing autopm for MIDI input Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 021/123] ALSA: hda - Add stereo-dmic fixup for Acer Aspire One 522 Greg Kroah-Hartman
` (105 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Takashi Iwai
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit 6eb827d23577a4efec2b10a9c4cc9ded268a1d1c upstream.
The runtime_idle callback is the right place to check the suspend
capability, but currently we do it wrongly in the runtime_suspend
callback. This leads to a kernel error message like:
pci_pm_runtime_suspend(): azx_runtime_suspend+0x0/0x50 [snd_hda_intel] returns -11
and the runtime PM core would even repeat the attempts.
Reported-and-tested-by: Borislav Petkov <bp@alien8.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/pci/hda/hda_intel.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2557,10 +2557,6 @@ static int azx_runtime_suspend(struct de
struct snd_card *card = dev_get_drvdata(dev);
struct azx *chip = card->private_data;
- if (!power_save_controller ||
- !(chip->driver_caps & AZX_DCAPS_PM_RUNTIME))
- return -EAGAIN;
-
azx_stop_chip(chip);
azx_clear_irq_pending(chip);
return 0;
@@ -2575,12 +2571,25 @@ static int azx_runtime_resume(struct dev
azx_init_chip(chip, 1);
return 0;
}
+
+static int azx_runtime_idle(struct device *dev)
+{
+ struct snd_card *card = dev_get_drvdata(dev);
+ struct azx *chip = card->private_data;
+
+ if (!power_save_controller ||
+ !(chip->driver_caps & AZX_DCAPS_PM_RUNTIME))
+ return -EBUSY;
+
+ return 0;
+}
+
#endif /* CONFIG_PM_RUNTIME */
#ifdef CONFIG_PM
static const struct dev_pm_ops azx_pm = {
SET_SYSTEM_SLEEP_PM_OPS(azx_suspend, azx_resume)
- SET_RUNTIME_PM_OPS(azx_runtime_suspend, azx_runtime_resume, NULL)
+ SET_RUNTIME_PM_OPS(azx_runtime_suspend, azx_runtime_resume, azx_runtime_idle)
};
#define AZX_PM_OPS &azx_pm
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 021/123] ALSA: hda - Add stereo-dmic fixup for Acer Aspire One 522
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (19 preceding siblings ...)
2013-01-09 20:34 ` [ 020/123] ALSA: hda - Move runtime PM check to runtime_idle callback Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 022/123] ALSA: hda - Always turn on pins for HDMI/DP Greg Kroah-Hartman
` (104 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Takashi Iwai
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit 63a077e27648b4043b1ca1b4e29f0c42d99616b6 upstream.
Acer Aspire One 522 has the infamous digital mic unit that needs the
phase inversion fixup for stereo.
Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=715737
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/pci/hda/patch_conexant.c | 1 +
1 file changed, 1 insertion(+)
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -4453,6 +4453,7 @@ static const struct snd_pci_quirk cxt505
};
static const struct snd_pci_quirk cxt5066_fixups[] = {
+ SND_PCI_QUIRK(0x1025, 0x0543, "Acer Aspire One 522", CXT_FIXUP_STEREO_DMIC),
SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400", CXT_PINCFG_LENOVO_TP410),
SND_PCI_QUIRK(0x17aa, 0x215e, "Lenovo T410", CXT_PINCFG_LENOVO_TP410),
SND_PCI_QUIRK(0x17aa, 0x215f, "Lenovo T510", CXT_PINCFG_LENOVO_TP410),
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 022/123] ALSA: hda - Always turn on pins for HDMI/DP
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (20 preceding siblings ...)
2013-01-09 20:34 ` [ 021/123] ALSA: hda - Add stereo-dmic fixup for Acer Aspire One 522 Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 023/123] ALSA: hda - Fix the wrong pincaps set in ALC861VD dallas/hp fixup Greg Kroah-Hartman
` (103 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Takashi Iwai
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit 6169b673618bf0b2518ce413b54925782a603f06 upstream.
We've seen the broken HDMI *video* output on some machines with GM965,
and the debugging session pointed that the culprit is the disabled
audio output pins. Toggling these pins dynamically on demand caused
flickering of HDMI TV.
This patch changes the behavior to keep the pin ON constantly.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=51421
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/pci/hda/patch_hdmi.c | 18 ++++--------------
1 file changed, 4 insertions(+), 14 deletions(-)
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -431,9 +431,11 @@ static void hdmi_init_pin(struct hda_cod
if (get_wcaps(codec, pin_nid) & AC_WCAP_OUT_AMP)
snd_hda_codec_write(codec, pin_nid, 0,
AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE);
- /* Disable pin out until stream is active*/
+ /* Enable pin out: some machines with GM965 gets broken output when
+ * the pin is disabled or changed while using with HDMI
+ */
snd_hda_codec_write(codec, pin_nid, 0,
- AC_VERB_SET_PIN_WIDGET_CONTROL, 0);
+ AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT);
}
static int hdmi_get_channel_count(struct hda_codec *codec, hda_nid_t cvt_nid)
@@ -1338,7 +1340,6 @@ static int generic_hdmi_playback_pcm_pre
struct hdmi_spec *spec = codec->spec;
int pin_idx = hinfo_to_pin_index(spec, hinfo);
hda_nid_t pin_nid = spec->pins[pin_idx].pin_nid;
- int pinctl;
bool non_pcm;
non_pcm = check_non_pcm_per_cvt(codec, cvt_nid);
@@ -1347,11 +1348,6 @@ static int generic_hdmi_playback_pcm_pre
hdmi_setup_audio_infoframe(codec, pin_idx, non_pcm, substream);
- pinctl = snd_hda_codec_read(codec, pin_nid, 0,
- AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
- snd_hda_codec_write(codec, pin_nid, 0,
- AC_VERB_SET_PIN_WIDGET_CONTROL, pinctl | PIN_OUT);
-
return hdmi_setup_stream(codec, cvt_nid, pin_nid, stream_tag, format);
}
@@ -1371,7 +1367,6 @@ static int hdmi_pcm_close(struct hda_pcm
int cvt_idx, pin_idx;
struct hdmi_spec_per_cvt *per_cvt;
struct hdmi_spec_per_pin *per_pin;
- int pinctl;
if (hinfo->nid) {
cvt_idx = cvt_nid_to_cvt_index(spec, hinfo->nid);
@@ -1388,11 +1383,6 @@ static int hdmi_pcm_close(struct hda_pcm
return -EINVAL;
per_pin = &spec->pins[pin_idx];
- pinctl = snd_hda_codec_read(codec, per_pin->pin_nid, 0,
- AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
- snd_hda_codec_write(codec, per_pin->pin_nid, 0,
- AC_VERB_SET_PIN_WIDGET_CONTROL,
- pinctl & ~PIN_OUT);
snd_hda_spdif_ctls_unassign(codec, pin_idx);
per_pin->chmap_set = false;
memset(per_pin->chmap, 0, sizeof(per_pin->chmap));
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 023/123] ALSA: hda - Fix the wrong pincaps set in ALC861VD dallas/hp fixup
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (21 preceding siblings ...)
2013-01-09 20:34 ` [ 022/123] ALSA: hda - Always turn on pins for HDMI/DP Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 024/123] ALSA: hda - Fix pin configuration of HP Pavilion dv7 Greg Kroah-Hartman
` (102 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Takashi Iwai
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit b78562b10fa66175e30b76073e32a0ad8d92aa83 upstream.
The workaround to force VREF50 for dallas/hp model with ALC861VD
was introduced in commit 8fdcb6fe4204bdb4c6991652717ab5063751414e,
but it contained wrong pincap override bits.
This patch fixes to exclude VREF80 pincap bit correctly.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/pci/hda/patch_realtek.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -6535,8 +6535,8 @@ static void alc861vd_fixup_dallas(struct
const struct alc_fixup *fix, int action)
{
if (action == ALC_FIXUP_ACT_PRE_PROBE) {
- snd_hda_override_pin_caps(codec, 0x18, 0x00001714);
- snd_hda_override_pin_caps(codec, 0x19, 0x0000171c);
+ snd_hda_override_pin_caps(codec, 0x18, 0x00000734);
+ snd_hda_override_pin_caps(codec, 0x19, 0x0000073c);
}
}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 024/123] ALSA: hda - Fix pin configuration of HP Pavilion dv7
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (22 preceding siblings ...)
2013-01-09 20:34 ` [ 023/123] ALSA: hda - Fix the wrong pincaps set in ALC861VD dallas/hp fixup Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 025/123] ALSA: hda - add mute LED for HP Pavilion 17 (Realtek codec) Greg Kroah-Hartman
` (101 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Takashi Iwai
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <tiwai@suse.de>
commit 8ae5865ec77c22462c736846a0679947a6953548 upstream.
Fix the quirk entry for HP Pavilion dv7 in order to make the bass
speaker working.
Reported-and-tested-by: Tomas Pospisek <tpo2@sourcepole.ch>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/pci/hda/patch_sigmatel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -1724,7 +1724,7 @@ static const struct snd_pci_quirk stac92
SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1658,
"HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1659,
- "HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
+ "HP Pavilion dv7", STAC_HP_DV7_4000),
SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x165A,
"HP", STAC_92HD83XXX_HP_cNB11_INTQUAD),
SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x165B,
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 025/123] ALSA: hda - add mute LED for HP Pavilion 17 (Realtek codec)
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (23 preceding siblings ...)
2013-01-09 20:34 ` [ 024/123] ALSA: hda - Fix pin configuration of HP Pavilion dv7 Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 026/123] qmi_wwan/cdc_ether: add Dell Wireless 5800 (Novatel E362) USB IDs Greg Kroah-Hartman
` (100 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, David Henningsson, Takashi Iwai
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Henningsson <david.henningsson@canonical.com>
commit 6d3cd5d444223c41eabb70dccff14fae4e8cb8b1 upstream.
The mute LED is in this case connected to the Mic1 VREF.
The machine also exposes the following string in BIOS:
"HP_Mute_LED_0_A", so if more machines are coming, it probably
makes sense to try to do something more generic, like for the
IDT codec.
BugLink: https://bugs.launchpad.net/bugs/1096789
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
sound/pci/hda/patch_realtek.c | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -5986,6 +5986,30 @@ static void alc269_fixup_quanta_mute(str
spec->automute_hook = alc269_quanta_automute;
}
+/* update mute-LED according to the speaker mute state via mic1 VREF pin */
+static void alc269_fixup_mic1_mute_hook(void *private_data, int enabled)
+{
+ struct hda_codec *codec = private_data;
+ unsigned int pinval = AC_PINCTL_IN_EN + (enabled ?
+ AC_PINCTL_VREF_HIZ : AC_PINCTL_VREF_80);
+ snd_hda_set_pin_ctl_cache(codec, 0x18, pinval);
+}
+
+static void alc269_fixup_mic1_mute(struct hda_codec *codec,
+ const struct alc_fixup *fix, int action)
+{
+ struct alc_spec *spec = codec->spec;
+ switch (action) {
+ case ALC_FIXUP_ACT_BUILD:
+ spec->vmaster_mute.hook = alc269_fixup_mic1_mute_hook;
+ snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute, true);
+ /* fallthru */
+ case ALC_FIXUP_ACT_INIT:
+ snd_hda_sync_vmaster_hook(&spec->vmaster_mute);
+ break;
+ }
+}
+
/* update mute-LED according to the speaker mute state via mic2 VREF pin */
static void alc269_fixup_mic2_mute_hook(void *private_data, int enabled)
{
@@ -6027,6 +6051,7 @@ enum {
ALC269_FIXUP_DMIC,
ALC269VB_FIXUP_AMIC,
ALC269VB_FIXUP_DMIC,
+ ALC269_FIXUP_MIC1_MUTE_LED,
ALC269_FIXUP_MIC2_MUTE_LED,
ALC269_FIXUP_INV_DMIC,
ALC269_FIXUP_LENOVO_DOCK,
@@ -6153,6 +6178,10 @@ static const struct alc_fixup alc269_fix
{ }
},
},
+ [ALC269_FIXUP_MIC1_MUTE_LED] = {
+ .type = ALC_FIXUP_FUNC,
+ .v.func = alc269_fixup_mic1_mute,
+ },
[ALC269_FIXUP_MIC2_MUTE_LED] = {
.type = ALC_FIXUP_FUNC,
.v.func = alc269_fixup_mic2_mute,
@@ -6181,6 +6210,7 @@ static const struct snd_pci_quirk alc269
SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_MIC2_MUTE_LED),
+ SND_PCI_QUIRK(0x103c, 0x1972, "HP Pavilion 17", ALC269_FIXUP_MIC1_MUTE_LED),
SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_DMIC),
SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_DMIC),
SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 026/123] qmi_wwan/cdc_ether: add Dell Wireless 5800 (Novatel E362) USB IDs
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (24 preceding siblings ...)
2013-01-09 20:34 ` [ 025/123] ALSA: hda - add mute LED for HP Pavilion 17 (Realtek codec) Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 027/123] rtlwifi: fix incorrect use of usb_alloc_coherent with usb_control_msg Greg Kroah-Hartman
` (99 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Dan Williams, Bjørn Mork,
David S. Miller
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Williams <dcbw@redhat.com>
commit 0370acd4d4d2595a11b0b0a793acb506e19b9d4c upstream.
Signed-off-by: Dan Williams <dcbw@redhat.com>
Acked-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/usb/cdc_ether.c | 15 +++++++++++++++
drivers/net/usb/qmi_wwan.c | 14 ++++++++++++++
2 files changed, 29 insertions(+)
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -487,6 +487,7 @@ static const struct driver_info wwan_inf
#define HUAWEI_VENDOR_ID 0x12D1
#define NOVATEL_VENDOR_ID 0x1410
#define ZTE_VENDOR_ID 0x19D2
+#define DELL_VENDOR_ID 0x413C
static const struct usb_device_id products [] = {
/*
@@ -618,6 +619,20 @@ static const struct usb_device_id produc
.driver_info = 0,
},
+/* Dell Wireless 5800 (Novatel E362) - handled by qmi_wwan */
+{
+ USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, 0x8195, USB_CLASS_COMM,
+ USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
+ .driver_info = 0,
+},
+
+/* Dell Wireless 5800 (Novatel E362) - handled by qmi_wwan */
+{
+ USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, 0x8196, USB_CLASS_COMM,
+ USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
+ .driver_info = 0,
+},
+
/*
* WHITELIST!!!
*
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -383,6 +383,20 @@ static const struct usb_device_id produc
USB_CDC_PROTO_NONE),
.driver_info = (unsigned long)&qmi_wwan_info,
},
+ { /* Dell Wireless 5800 (Novatel E362) */
+ USB_DEVICE_AND_INTERFACE_INFO(0x413C, 0x8195,
+ USB_CLASS_COMM,
+ USB_CDC_SUBCLASS_ETHERNET,
+ USB_CDC_PROTO_NONE),
+ .driver_info = (unsigned long)&qmi_wwan_info,
+ },
+ { /* Dell Wireless 5800 V2 (Novatel E362) */
+ USB_DEVICE_AND_INTERFACE_INFO(0x413C, 0x8196,
+ USB_CLASS_COMM,
+ USB_CDC_SUBCLASS_ETHERNET,
+ USB_CDC_PROTO_NONE),
+ .driver_info = (unsigned long)&qmi_wwan_info,
+ },
/* 3. Combined interface devices matching on interface number */
{QMI_FIXED_INTF(0x12d1, 0x140c, 1)}, /* Huawei E173 */
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 027/123] rtlwifi: fix incorrect use of usb_alloc_coherent with usb_control_msg
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (25 preceding siblings ...)
2013-01-09 20:34 ` [ 026/123] qmi_wwan/cdc_ether: add Dell Wireless 5800 (Novatel E362) USB IDs Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 028/123] p54usb: add USB ID for T-Com Sinus 154 data II Greg Kroah-Hartman
` (98 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Jussi Kivilinna, Larry Finger,
John W. Linville
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
commit 4c3de5920c486b8eefa6187ee6a181864c161100 upstream.
Incorrect use of usb_alloc_coherent memory as input buffer to usb_control_msg
can cause problems in arch DMA code, for example kernel BUG at
'arch/arm/include/asm/dma-mapping.h:321' on ARM (linux-3.4).
Change _usb_writeN_sync use kmalloc'd buffer instead.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/wireless/rtlwifi/usb.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
--- a/drivers/net/wireless/rtlwifi/usb.c
+++ b/drivers/net/wireless/rtlwifi/usb.c
@@ -210,17 +210,16 @@ static void _usb_writeN_sync(struct rtl_
u16 index = REALTEK_USB_VENQT_CMD_IDX;
int pipe = usb_sndctrlpipe(udev, 0); /* write_out */
u8 *buffer;
- dma_addr_t dma_addr;
- wvalue = (u16)(addr&0x0000ffff);
- buffer = usb_alloc_coherent(udev, (size_t)len, GFP_ATOMIC, &dma_addr);
+ wvalue = (u16)(addr & 0x0000ffff);
+ buffer = kmalloc(len, GFP_ATOMIC);
if (!buffer)
return;
memcpy(buffer, data, len);
usb_control_msg(udev, pipe, request, reqtype, wvalue,
index, buffer, len, 50);
- usb_free_coherent(udev, (size_t)len, buffer, dma_addr);
+ kfree(buffer);
}
static void _rtl_usb_io_handler_init(struct device *dev,
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 028/123] p54usb: add USB ID for T-Com Sinus 154 data II
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (26 preceding siblings ...)
2013-01-09 20:34 ` [ 027/123] rtlwifi: fix incorrect use of usb_alloc_coherent with usb_control_msg Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 029/123] p54usb: add USBIDs for two more p54usb devices Greg Kroah-Hartman
` (97 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Tomasz Guszkowski, Christian Lamparter,
John W. Linville
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomasz Guszkowski <tsg@o2.pl>
commit 3194b7fcdf6caea338b5d2c72d76fed80437649c upstream.
Added USB ID for T-Com Sinus 154 data II.
Signed-off-by: Tomasz Guszkowski <tsg@o2.pl>
Acked-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/wireless/p54/p54usb.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -82,6 +82,7 @@ static struct usb_device_id p54u_table[]
{USB_DEVICE(0x06a9, 0x000e)}, /* Westell 802.11g USB (A90-211WG-01) */
{USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */
{USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */
+ {USB_DEVICE(0x083a, 0x4503)}, /* T-Com Sinus 154 data II */
{USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */
{USB_DEVICE(0x083a, 0xc501)}, /* Zoom Wireless-G 4410 */
{USB_DEVICE(0x083a, 0xf503)}, /* Accton FD7050E ver 1010ec */
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 029/123] p54usb: add USBIDs for two more p54usb devices
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (27 preceding siblings ...)
2013-01-09 20:34 ` [ 028/123] p54usb: add USB ID for T-Com Sinus 154 data II Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 030/123] USB: chipidea: fix use after free bug Greg Kroah-Hartman
` (96 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Christian Lamparter, John W. Linville
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Lamparter <chunkeey@googlemail.com>
commit 4010fe21a315b4223c25376714c6a2b61b722e5c upstream.
This patch adds USBIDs for:
- DrayTek Vigor 530
- Zoom 4410a
It also adds a note about Gemtek WUBI-100GW
and SparkLAN WL-682 USBID conflict [WUBI-100GW
is a ISL3886+NET2280 (LM86 firmare) solution,
whereas WL-682 is a ISL3887 (LM87 firmware)]
device.
Source: <http://www.wikidevi.com/wiki/Intersil/p54/usb/windows>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/wireless/p54/p54usb.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -47,6 +47,7 @@ static struct usb_device_id p54u_table[]
{USB_DEVICE(0x0411, 0x0050)}, /* Buffalo WLI2-USB2-G54 */
{USB_DEVICE(0x045e, 0x00c2)}, /* Microsoft MN-710 */
{USB_DEVICE(0x0506, 0x0a11)}, /* 3COM 3CRWE254G72 */
+ {USB_DEVICE(0x0675, 0x0530)}, /* DrayTek Vigor 530 */
{USB_DEVICE(0x06b9, 0x0120)}, /* Thomson SpeedTouch 120g */
{USB_DEVICE(0x0707, 0xee06)}, /* SMC 2862W-G */
{USB_DEVICE(0x07aa, 0x001c)}, /* Corega CG-WLUSB2GT */
@@ -82,6 +83,7 @@ static struct usb_device_id p54u_table[]
{USB_DEVICE(0x06a9, 0x000e)}, /* Westell 802.11g USB (A90-211WG-01) */
{USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */
{USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */
+ {USB_DEVICE(0x0803, 0x4310)}, /* Zoom 4410a */
{USB_DEVICE(0x083a, 0x4503)}, /* T-Com Sinus 154 data II */
{USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */
{USB_DEVICE(0x083a, 0xc501)}, /* Zoom Wireless-G 4410 */
@@ -102,6 +104,7 @@ static struct usb_device_id p54u_table[]
{USB_DEVICE(0x13B1, 0x000C)}, /* Linksys WUSB54AG */
{USB_DEVICE(0x1413, 0x5400)}, /* Telsey 802.11g USB2.0 Adapter */
{USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */
+ /* {USB_DEVICE(0x15a9, 0x0002)}, * Also SparkLAN WL-682 with 3887 */
{USB_DEVICE(0x1668, 0x1050)}, /* Actiontec 802UIG-1 */
{USB_DEVICE(0x1740, 0x1000)}, /* Senao NUB-350 */
{USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 030/123] USB: chipidea: fix use after free bug
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (28 preceding siblings ...)
2013-01-09 20:34 ` [ 029/123] p54usb: add USBIDs for two more p54usb devices Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 031/123] usb: gadget: midi: free hs descriptors Greg Kroah-Hartman
` (95 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Lothar Waßmann, Alexander Shishkin
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lothar Waßmann <LW@KARO-electronics.de>
commit 98c35534420d3147553bd3071a5fc63cd56de5b1 upstream.
The pointer to a platform_device struct must not be dereferenced after
the device has been unregistered.
This bug produces a crash when unloading the ci13xxx kernel module
compiled with CONFIG_PAGE_POISONING enabled.
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Acked-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/chipidea/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -385,8 +385,9 @@ EXPORT_SYMBOL_GPL(ci13xxx_add_device);
void ci13xxx_remove_device(struct platform_device *pdev)
{
+ int id = pdev->id;
platform_device_unregister(pdev);
- ida_simple_remove(&ci_ida, pdev->id);
+ ida_simple_remove(&ci_ida, id);
}
EXPORT_SYMBOL_GPL(ci13xxx_remove_device);
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 031/123] usb: gadget: midi: free hs descriptors
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (29 preceding siblings ...)
2013-01-09 20:34 ` [ 030/123] USB: chipidea: fix use after free bug Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 032/123] usb: gadget: phonet: free requests in pn_bind()s error path Greg Kroah-Hartman
` (94 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Sebastian Andrzej Siewior, Felipe Balbi
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
commit d185039f7982eb82cf8d03b6fb6689587ca5af24 upstream.
The HS descriptors are only created if HS is supported by the UDC but we
never free them.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/f_midi.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/usb/gadget/f_midi.c
+++ b/drivers/usb/gadget/f_midi.c
@@ -415,6 +415,7 @@ static void f_midi_unbind(struct usb_con
midi->id = NULL;
usb_free_descriptors(f->descriptors);
+ usb_free_descriptors(f->hs_descriptors);
kfree(midi);
}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 032/123] usb: gadget: phonet: free requests in pn_bind()s error path
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (30 preceding siblings ...)
2013-01-09 20:34 ` [ 031/123] usb: gadget: midi: free hs descriptors Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 033/123] usb: gadget: tcm_usb_gadget: NULL terminate the FS descriptor list Greg Kroah-Hartman
` (93 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Sebastian Andrzej Siewior, Felipe Balbi
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
commit d0eca719dd11ad0619e8dd6a1f3eceb95b0216dd upstream.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/f_phonet.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- a/drivers/usb/gadget/f_phonet.c
+++ b/drivers/usb/gadget/f_phonet.c
@@ -531,7 +531,7 @@ int pn_bind(struct usb_configuration *c,
req = usb_ep_alloc_request(fp->out_ep, GFP_KERNEL);
if (!req)
- goto err;
+ goto err_req;
req->complete = pn_rx_complete;
fp->out_reqv[i] = req;
@@ -540,14 +540,18 @@ int pn_bind(struct usb_configuration *c,
/* Outgoing USB requests */
fp->in_req = usb_ep_alloc_request(fp->in_ep, GFP_KERNEL);
if (!fp->in_req)
- goto err;
+ goto err_req;
INFO(cdev, "USB CDC Phonet function\n");
INFO(cdev, "using %s, OUT %s, IN %s\n", cdev->gadget->name,
fp->out_ep->name, fp->in_ep->name);
return 0;
+err_req:
+ for (i = 0; i < phonet_rxq_size && fp->out_reqv[i]; i++)
+ usb_ep_free_request(fp->out_ep, fp->out_reqv[i]);
err:
+
if (fp->out_ep)
fp->out_ep->driver_data = NULL;
if (fp->in_ep)
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 033/123] usb: gadget: tcm_usb_gadget: NULL terminate the FS descriptor list
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (31 preceding siblings ...)
2013-01-09 20:34 ` [ 032/123] usb: gadget: phonet: free requests in pn_bind()s error path Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 034/123] usb: gadget: uvc: fix error path in uvc_function_bind() Greg Kroah-Hartman
` (92 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Sebastian Andrzej Siewior, Felipe Balbi
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
commit fad8deb274edcef1c8ca38946338f5f4f8126fe2 upstream.
The descriptor list for FS speed was not NULL terminated. This patch
fixes this.
While here one of the twe two bAlternateSetting assignments for the BOT
interface. Both assign 0, one is enough.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/tcm_usb_gadget.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/usb/gadget/tcm_usb_gadget.c
+++ b/drivers/usb/gadget/tcm_usb_gadget.c
@@ -2139,6 +2139,7 @@ static struct usb_descriptor_header *uas
(struct usb_descriptor_header *) &uasp_status_pipe_desc,
(struct usb_descriptor_header *) &uasp_fs_cmd_desc,
(struct usb_descriptor_header *) &uasp_cmd_pipe_desc,
+ NULL,
};
static struct usb_descriptor_header *uasp_hs_function_desc[] = {
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 034/123] usb: gadget: uvc: fix error path in uvc_function_bind()
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (32 preceding siblings ...)
2013-01-09 20:34 ` [ 033/123] usb: gadget: tcm_usb_gadget: NULL terminate the FS descriptor list Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 035/123] usb: gadget: network: fix bind() error path Greg Kroah-Hartman
` (91 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Sebastian Andrzej Siewior,
Laurent Pinchart, Bhupesh Sharma, Felipe Balbi
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
commit 0f9df939385527049c8062a099fbfa1479fe7ce0 upstream.
The "video->minor = -1" assigment is done in V4L2 by
video_register_device() so it is removed here.
Now. uvc_function_bind() calls in error case uvc_function_unbind() for
cleanup. The problem is that uvc_function_unbind() frees the uvc struct
and uvc_bind_config() does as well in error case of usb_add_function().
Removing kfree() in usb_add_function() would make the patch smaller but
it would look odd because the new allocated memory is not cleaned up.
However it is not guaranteed that if we call usb_add_function() we also
get to the bind function.
Therefore the patch extracts the conditional cleanup from
uvc_function_unbind() applies to uvc_function_bind().
uvc_function_unbind() now contains only the complete cleanup which is
required once everything has been registrated.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Bhupesh Sharma <bhupesh.sharma@st.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/f_uvc.c | 39 +++++++++++++++++++++------------------
1 file changed, 21 insertions(+), 18 deletions(-)
--- a/drivers/usb/gadget/f_uvc.c
+++ b/drivers/usb/gadget/f_uvc.c
@@ -417,7 +417,6 @@ uvc_register_video(struct uvc_device *uv
return -ENOMEM;
video->parent = &cdev->gadget->dev;
- video->minor = -1;
video->fops = &uvc_v4l2_fops;
video->release = video_device_release;
strncpy(video->name, cdev->gadget->name, sizeof(video->name));
@@ -577,23 +576,12 @@ uvc_function_unbind(struct usb_configura
INFO(cdev, "uvc_function_unbind\n");
- if (uvc->vdev) {
- if (uvc->vdev->minor == -1)
- video_device_release(uvc->vdev);
- else
- video_unregister_device(uvc->vdev);
- uvc->vdev = NULL;
- }
-
- if (uvc->control_ep)
- uvc->control_ep->driver_data = NULL;
- if (uvc->video.ep)
- uvc->video.ep->driver_data = NULL;
+ video_unregister_device(uvc->vdev);
+ uvc->control_ep->driver_data = NULL;
+ uvc->video.ep->driver_data = NULL;
- if (uvc->control_req) {
- usb_ep_free_request(cdev->gadget->ep0, uvc->control_req);
- kfree(uvc->control_buf);
- }
+ usb_ep_free_request(cdev->gadget->ep0, uvc->control_req);
+ kfree(uvc->control_buf);
kfree(f->descriptors);
kfree(f->hs_descriptors);
@@ -740,7 +728,22 @@ uvc_function_bind(struct usb_configurati
return 0;
error:
- uvc_function_unbind(c, f);
+ if (uvc->vdev)
+ video_device_release(uvc->vdev);
+
+ if (uvc->control_ep)
+ uvc->control_ep->driver_data = NULL;
+ if (uvc->video.ep)
+ uvc->video.ep->driver_data = NULL;
+
+ if (uvc->control_req) {
+ usb_ep_free_request(cdev->gadget->ep0, uvc->control_req);
+ kfree(uvc->control_buf);
+ }
+
+ kfree(f->descriptors);
+ kfree(f->hs_descriptors);
+ kfree(f->ss_descriptors);
return ret;
}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 035/123] usb: gadget: network: fix bind() error path
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (33 preceding siblings ...)
2013-01-09 20:34 ` [ 034/123] usb: gadget: uvc: fix error path in uvc_function_bind() Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 036/123] ACPI: do acpisleep dmi check when CONFIG_ACPI_SLEEP is set Greg Kroah-Hartman
` (90 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Sebastian Andrzej Siewior,
Tatyana Brokhman, Felipe Balbi
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
commit e79cc615a9bb44da72c499ccfa2c9c4bbea3aa84 upstream.
I think this is wrong since 72c973dd ("usb: gadget: add
usb_endpoint_descriptor to struct usb_ep"). If we fail to allocate an ep
or bail out early we shouldn't check for the descriptor which is
assigned at ep_enable() time.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Tatyana Brokhman <tlinder@codeaurora.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/gadget/f_ecm.c | 4 ++--
drivers/usb/gadget/f_eem.c | 5 ++---
drivers/usb/gadget/f_ncm.c | 4 ++--
drivers/usb/gadget/f_rndis.c | 4 ++--
drivers/usb/gadget/f_subset.c | 4 ++--
5 files changed, 10 insertions(+), 11 deletions(-)
--- a/drivers/usb/gadget/f_ecm.c
+++ b/drivers/usb/gadget/f_ecm.c
@@ -808,9 +808,9 @@ fail:
/* we might as well release our claims on endpoints */
if (ecm->notify)
ecm->notify->driver_data = NULL;
- if (ecm->port.out_ep->desc)
+ if (ecm->port.out_ep)
ecm->port.out_ep->driver_data = NULL;
- if (ecm->port.in_ep->desc)
+ if (ecm->port.in_ep)
ecm->port.in_ep->driver_data = NULL;
ERROR(cdev, "%s: can't bind, err %d\n", f->name, status);
--- a/drivers/usb/gadget/f_eem.c
+++ b/drivers/usb/gadget/f_eem.c
@@ -319,10 +319,9 @@ fail:
if (f->hs_descriptors)
usb_free_descriptors(f->hs_descriptors);
- /* we might as well release our claims on endpoints */
- if (eem->port.out_ep->desc)
+ if (eem->port.out_ep)
eem->port.out_ep->driver_data = NULL;
- if (eem->port.in_ep->desc)
+ if (eem->port.in_ep)
eem->port.in_ep->driver_data = NULL;
ERROR(cdev, "%s: can't bind, err %d\n", f->name, status);
--- a/drivers/usb/gadget/f_ncm.c
+++ b/drivers/usb/gadget/f_ncm.c
@@ -1259,9 +1259,9 @@ fail:
/* we might as well release our claims on endpoints */
if (ncm->notify)
ncm->notify->driver_data = NULL;
- if (ncm->port.out_ep->desc)
+ if (ncm->port.out_ep)
ncm->port.out_ep->driver_data = NULL;
- if (ncm->port.in_ep->desc)
+ if (ncm->port.in_ep)
ncm->port.in_ep->driver_data = NULL;
ERROR(cdev, "%s: can't bind, err %d\n", f->name, status);
--- a/drivers/usb/gadget/f_rndis.c
+++ b/drivers/usb/gadget/f_rndis.c
@@ -803,9 +803,9 @@ fail:
/* we might as well release our claims on endpoints */
if (rndis->notify)
rndis->notify->driver_data = NULL;
- if (rndis->port.out_ep->desc)
+ if (rndis->port.out_ep)
rndis->port.out_ep->driver_data = NULL;
- if (rndis->port.in_ep->desc)
+ if (rndis->port.in_ep)
rndis->port.in_ep->driver_data = NULL;
ERROR(cdev, "%s: can't bind, err %d\n", f->name, status);
--- a/drivers/usb/gadget/f_subset.c
+++ b/drivers/usb/gadget/f_subset.c
@@ -370,9 +370,9 @@ fail:
usb_free_descriptors(f->hs_descriptors);
/* we might as well release our claims on endpoints */
- if (geth->port.out_ep->desc)
+ if (geth->port.out_ep)
geth->port.out_ep->driver_data = NULL;
- if (geth->port.in_ep->desc)
+ if (geth->port.in_ep)
geth->port.in_ep->driver_data = NULL;
ERROR(cdev, "%s: can't bind, err %d\n", f->name, status);
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 036/123] ACPI: do acpisleep dmi check when CONFIG_ACPI_SLEEP is set
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (34 preceding siblings ...)
2013-01-09 20:34 ` [ 035/123] usb: gadget: network: fix bind() error path Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 037/123] libata: restore acpi disable functionality Greg Kroah-Hartman
` (89 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Zhang Rui, Rafael J. Wysocki
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhang Rui <rui.zhang@intel.com>
commit 0ac1b1d7b7424cd6f129b5454b504b3cae746f0e upstream.
The current acpisleep DMI checks only run when CONFIG_SUSPEND is set.
And this may break hibernation on some platforms when CONFIG_SUSPEND
is cleared.
Move acpisleep DMI check into #ifdef CONFIG_ACPI_SLEEP instead.
[rjw: Added acpi_sleep_dmi_check() and rebased on top of earlier
patches adding entries to acpisleep_dmi_table[].]
References: https://bugzilla.kernel.org/show_bug.cgi?id=45921
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/acpi/sleep.c | 348 +++++++++++++++++++++++++--------------------------
1 file changed, 177 insertions(+), 171 deletions(-)
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -109,6 +109,180 @@ void __init acpi_old_suspend_ordering(vo
old_suspend_ordering = true;
}
+static int __init init_old_suspend_ordering(const struct dmi_system_id *d)
+{
+ acpi_old_suspend_ordering();
+ return 0;
+}
+
+static int __init init_nvs_nosave(const struct dmi_system_id *d)
+{
+ acpi_nvs_nosave();
+ return 0;
+}
+
+static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
+ {
+ .callback = init_old_suspend_ordering,
+ .ident = "Abit KN9 (nForce4 variant)",
+ .matches = {
+ DMI_MATCH(DMI_BOARD_VENDOR, "http://www.abit.com.tw/"),
+ DMI_MATCH(DMI_BOARD_NAME, "KN9 Series(NF-CK804)"),
+ },
+ },
+ {
+ .callback = init_old_suspend_ordering,
+ .ident = "HP xw4600 Workstation",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "HP xw4600 Workstation"),
+ },
+ },
+ {
+ .callback = init_old_suspend_ordering,
+ .ident = "Asus Pundit P1-AH2 (M2N8L motherboard)",
+ .matches = {
+ DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTek Computer INC."),
+ DMI_MATCH(DMI_BOARD_NAME, "M2N8L"),
+ },
+ },
+ {
+ .callback = init_old_suspend_ordering,
+ .ident = "Panasonic CF51-2L",
+ .matches = {
+ DMI_MATCH(DMI_BOARD_VENDOR,
+ "Matsushita Electric Industrial Co.,Ltd."),
+ DMI_MATCH(DMI_BOARD_NAME, "CF51-2L"),
+ },
+ },
+ {
+ .callback = init_nvs_nosave,
+ .ident = "Sony Vaio VGN-FW21E",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FW21E"),
+ },
+ },
+ {
+ .callback = init_nvs_nosave,
+ .ident = "Sony Vaio VPCEB17FX",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB17FX"),
+ },
+ },
+ {
+ .callback = init_nvs_nosave,
+ .ident = "Sony Vaio VGN-SR11M",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR11M"),
+ },
+ },
+ {
+ .callback = init_nvs_nosave,
+ .ident = "Everex StepNote Series",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Everex Systems, Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Everex StepNote Series"),
+ },
+ },
+ {
+ .callback = init_nvs_nosave,
+ .ident = "Sony Vaio VPCEB1Z1E",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1Z1E"),
+ },
+ },
+ {
+ .callback = init_nvs_nosave,
+ .ident = "Sony Vaio VGN-NW130D",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "VGN-NW130D"),
+ },
+ },
+ {
+ .callback = init_nvs_nosave,
+ .ident = "Sony Vaio VPCCW29FX",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "VPCCW29FX"),
+ },
+ },
+ {
+ .callback = init_nvs_nosave,
+ .ident = "Averatec AV1020-ED2",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "AVERATEC"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "1000 Series"),
+ },
+ },
+ {
+ .callback = init_old_suspend_ordering,
+ .ident = "Asus A8N-SLI DELUXE",
+ .matches = {
+ DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
+ DMI_MATCH(DMI_BOARD_NAME, "A8N-SLI DELUXE"),
+ },
+ },
+ {
+ .callback = init_old_suspend_ordering,
+ .ident = "Asus A8N-SLI Premium",
+ .matches = {
+ DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
+ DMI_MATCH(DMI_BOARD_NAME, "A8N-SLI Premium"),
+ },
+ },
+ {
+ .callback = init_nvs_nosave,
+ .ident = "Sony Vaio VGN-SR26GN_P",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR26GN_P"),
+ },
+ },
+ {
+ .callback = init_nvs_nosave,
+ .ident = "Sony Vaio VPCEB1S1E",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1S1E"),
+ },
+ },
+ {
+ .callback = init_nvs_nosave,
+ .ident = "Sony Vaio VGN-FW520F",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FW520F"),
+ },
+ },
+ {
+ .callback = init_nvs_nosave,
+ .ident = "Asus K54C",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "K54C"),
+ },
+ },
+ {
+ .callback = init_nvs_nosave,
+ .ident = "Asus K54HR",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "K54HR"),
+ },
+ },
+ {},
+};
+
+static void acpi_sleep_dmi_check(void)
+{
+ dmi_check_system(acpisleep_dmi_table);
+}
+
/**
* acpi_pm_freeze - Disable the GPEs and suspend EC transactions.
*/
@@ -224,6 +398,7 @@ static void acpi_pm_end(void)
}
#else /* !CONFIG_ACPI_SLEEP */
#define acpi_target_sleep_state ACPI_STATE_S0
+static inline void acpi_sleep_dmi_check(void) {}
#endif /* CONFIG_ACPI_SLEEP */
#ifdef CONFIG_SUSPEND
@@ -382,175 +557,6 @@ static const struct platform_suspend_ops
.end = acpi_pm_end,
.recover = acpi_pm_finish,
};
-
-static int __init init_old_suspend_ordering(const struct dmi_system_id *d)
-{
- old_suspend_ordering = true;
- return 0;
-}
-
-static int __init init_nvs_nosave(const struct dmi_system_id *d)
-{
- acpi_nvs_nosave();
- return 0;
-}
-
-static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
- {
- .callback = init_old_suspend_ordering,
- .ident = "Abit KN9 (nForce4 variant)",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "http://www.abit.com.tw/"),
- DMI_MATCH(DMI_BOARD_NAME, "KN9 Series(NF-CK804)"),
- },
- },
- {
- .callback = init_old_suspend_ordering,
- .ident = "HP xw4600 Workstation",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
- DMI_MATCH(DMI_PRODUCT_NAME, "HP xw4600 Workstation"),
- },
- },
- {
- .callback = init_old_suspend_ordering,
- .ident = "Asus Pundit P1-AH2 (M2N8L motherboard)",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTek Computer INC."),
- DMI_MATCH(DMI_BOARD_NAME, "M2N8L"),
- },
- },
- {
- .callback = init_old_suspend_ordering,
- .ident = "Panasonic CF51-2L",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR,
- "Matsushita Electric Industrial Co.,Ltd."),
- DMI_MATCH(DMI_BOARD_NAME, "CF51-2L"),
- },
- },
- {
- .callback = init_nvs_nosave,
- .ident = "Sony Vaio VGN-FW21E",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
- DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FW21E"),
- },
- },
- {
- .callback = init_nvs_nosave,
- .ident = "Sony Vaio VPCEB17FX",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
- DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB17FX"),
- },
- },
- {
- .callback = init_nvs_nosave,
- .ident = "Sony Vaio VGN-SR11M",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
- DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR11M"),
- },
- },
- {
- .callback = init_nvs_nosave,
- .ident = "Everex StepNote Series",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Everex Systems, Inc."),
- DMI_MATCH(DMI_PRODUCT_NAME, "Everex StepNote Series"),
- },
- },
- {
- .callback = init_nvs_nosave,
- .ident = "Sony Vaio VPCEB1Z1E",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
- DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1Z1E"),
- },
- },
- {
- .callback = init_nvs_nosave,
- .ident = "Sony Vaio VGN-NW130D",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
- DMI_MATCH(DMI_PRODUCT_NAME, "VGN-NW130D"),
- },
- },
- {
- .callback = init_nvs_nosave,
- .ident = "Sony Vaio VPCCW29FX",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
- DMI_MATCH(DMI_PRODUCT_NAME, "VPCCW29FX"),
- },
- },
- {
- .callback = init_nvs_nosave,
- .ident = "Averatec AV1020-ED2",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "AVERATEC"),
- DMI_MATCH(DMI_PRODUCT_NAME, "1000 Series"),
- },
- },
- {
- .callback = init_old_suspend_ordering,
- .ident = "Asus A8N-SLI DELUXE",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
- DMI_MATCH(DMI_BOARD_NAME, "A8N-SLI DELUXE"),
- },
- },
- {
- .callback = init_old_suspend_ordering,
- .ident = "Asus A8N-SLI Premium",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer INC."),
- DMI_MATCH(DMI_BOARD_NAME, "A8N-SLI Premium"),
- },
- },
- {
- .callback = init_nvs_nosave,
- .ident = "Sony Vaio VGN-SR26GN_P",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
- DMI_MATCH(DMI_PRODUCT_NAME, "VGN-SR26GN_P"),
- },
- },
- {
- .callback = init_nvs_nosave,
- .ident = "Sony Vaio VPCEB1S1E",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
- DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1S1E"),
- },
- },
- {
- .callback = init_nvs_nosave,
- .ident = "Sony Vaio VGN-FW520F",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
- DMI_MATCH(DMI_PRODUCT_NAME, "VGN-FW520F"),
- },
- },
- {
- .callback = init_nvs_nosave,
- .ident = "Asus K54C",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
- DMI_MATCH(DMI_PRODUCT_NAME, "K54C"),
- },
- },
- {
- .callback = init_nvs_nosave,
- .ident = "Asus K54HR",
- .matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
- DMI_MATCH(DMI_PRODUCT_NAME, "K54HR"),
- },
- },
- {},
-};
#endif /* CONFIG_SUSPEND */
#ifdef CONFIG_HIBERNATION
@@ -881,13 +887,13 @@ int __init acpi_sleep_init(void)
u8 type_a, type_b;
#ifdef CONFIG_SUSPEND
int i = 0;
-
- dmi_check_system(acpisleep_dmi_table);
#endif
if (acpi_disabled)
return 0;
+ acpi_sleep_dmi_check();
+
sleep_states[ACPI_STATE_S0] = 1;
printk(KERN_INFO PREFIX "(supports S0");
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 037/123] libata: restore acpi disable functionality
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (35 preceding siblings ...)
2013-01-09 20:34 ` [ 036/123] ACPI: do acpisleep dmi check when CONFIG_ACPI_SLEEP is set Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 038/123] ACPI / scan: Do not use dummy HID for system bus ACPI nodes Greg Kroah-Hartman
` (88 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Dimitris Damigos, Aaron Lu, Jeff Garzik
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aaron Lu <aaron.lu@intel.com>
commit 0d0cdb028f9d9771e2b346038707734121f906e3 upstream.
Commit 66fa7f215 "libata-acpi: improve ACPI disabling" introdcued the
behaviour of disabling ATA ACPI if ata_acpi_on_devcfg failed the 2nd
time, but commit 30dcf76ac dropped this behaviour and this caused
problem for Dimitris Damigos, where his laptop can not resume correctly.
The bugzilla page for it is:
https://bugzilla.kernel.org/show_bug.cgi?id=49331
The problem is, ata_dev_push_id will fail the 2nd time it is invoked,
and due to disabling ACPI code is dropped, ata_acpi_on_devcfg which
calls ata_dev_push_id will keep failing and eventually made the device
disabled.
This patch restores the original behaviour, if acpi failed the 2nd time,
disable acpi functionality for the device(and we do not event need to
add a debug message for this as it is still there ;-).
Reported-by: Dimitris Damigos <damigos@freemail.gr>
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/ata/libata-acpi.c | 4 ++++
include/linux/libata.h | 1 +
2 files changed, 5 insertions(+)
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -76,6 +76,9 @@ acpi_handle ata_dev_acpi_handle(struct a
acpi_integer adr;
struct ata_port *ap = dev->link->ap;
+ if (dev->flags & ATA_DFLAG_ACPI_DISABLED)
+ return NULL;
+
if (ap->flags & ATA_FLAG_ACPI_SATA) {
if (!sata_pmp_attached(ap))
adr = SATA_ADR(ap->port_no, NO_PORT_MULT);
@@ -945,6 +948,7 @@ int ata_acpi_on_devcfg(struct ata_device
return rc;
}
+ dev->flags |= ATA_DFLAG_ACPI_DISABLED;
ata_dev_warn(dev, "ACPI: failed the second time, disabled\n");
/* We can safely continue if no _GTF command has been executed
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -163,6 +163,7 @@ enum {
ATA_DFLAG_DA = (1 << 26), /* device supports Device Attention */
ATA_DFLAG_DEVSLP = (1 << 27), /* device supports Device Sleep */
+ ATA_DFLAG_ACPI_DISABLED = (1 << 28), /* ACPI for the device is disabled */
ATA_DEV_UNKNOWN = 0, /* unknown device */
ATA_DEV_ATA = 1, /* ATA device */
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 038/123] ACPI / scan: Do not use dummy HID for system bus ACPI nodes
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (36 preceding siblings ...)
2013-01-09 20:34 ` [ 037/123] libata: restore acpi disable functionality Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 039/123] NFS: Add sequence_priviliged_ops for nfs4_proc_sequence() Greg Kroah-Hartman
` (87 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Rafael J. Wysocki
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
commit 4f5f64cf0cc916220aaa055992e31195470cfe37 upstream.
At one point acpi_device_set_id() checks if acpi_device_hid(device)
returns NULL, but that never happens, so system bus devices with an
empty list of PNP IDs are given the dummy HID ("device") instead of
the "system bus HID" ("LNXSYBUS"). Fix the code to use the right
check.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/acpi/scan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1227,7 +1227,7 @@ static void acpi_device_set_id(struct ac
acpi_add_id(device, ACPI_DOCK_HID);
else if (!acpi_ibm_smbus_match(device))
acpi_add_id(device, ACPI_SMBUS_IBM_HID);
- else if (!acpi_device_hid(device) &&
+ else if (list_empty(&device->pnp.ids) &&
ACPI_IS_ROOT_DEVICE(device->parent)) {
acpi_add_id(device, ACPI_BUS_HID); /* \_SB, LNXSYBUS */
strcpy(device->pnp.device_name, ACPI_BUS_DEVICE_NAME);
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 039/123] NFS: Add sequence_priviliged_ops for nfs4_proc_sequence()
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (37 preceding siblings ...)
2013-01-09 20:34 ` [ 038/123] ACPI / scan: Do not use dummy HID for system bus ACPI nodes Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 040/123] nfs: dont extend writes to cover entire page if pagecache is invalid Greg Kroah-Hartman
` (86 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Bryan Schumaker, Trond Myklebust
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bryan Schumaker <bjschuma@netapp.com>
commit 6bdb5f213c4344324f600dde885f25768fbd14db upstream.
If I mount an NFS v4.1 server to a single client multiple times and then
run xfstests over each mountpoint I usually get the client into a state
where recovery deadlocks. The server informs the client of a
cb_path_down sequence error, the client then does a
bind_connection_to_session and checks the status of the lease.
I found that bind_connection_to_session sets the NFS4_SESSION_DRAINING
flag on the client, but this flag is never unset before
nfs4_check_lease() reaches nfs4_proc_sequence(). This causes the client
to deadlock, halting all NFS activity to the server. nfs4_proc_sequence()
is only called by the state manager, so I can change it to run in privileged
mode to bypass the NFS4_SESSION_DRAINING check and avoid the deadlock.
Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfs/nfs4proc.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -6138,13 +6138,26 @@ static void nfs41_sequence_prepare(struc
rpc_call_start(task);
}
+static void nfs41_sequence_prepare_privileged(struct rpc_task *task, void *data)
+{
+ rpc_task_set_priority(task, RPC_PRIORITY_PRIVILEGED);
+ nfs41_sequence_prepare(task, data);
+}
+
static const struct rpc_call_ops nfs41_sequence_ops = {
.rpc_call_done = nfs41_sequence_call_done,
.rpc_call_prepare = nfs41_sequence_prepare,
.rpc_release = nfs41_sequence_release,
};
-static struct rpc_task *_nfs41_proc_sequence(struct nfs_client *clp, struct rpc_cred *cred)
+static const struct rpc_call_ops nfs41_sequence_privileged_ops = {
+ .rpc_call_done = nfs41_sequence_call_done,
+ .rpc_call_prepare = nfs41_sequence_prepare_privileged,
+ .rpc_release = nfs41_sequence_release,
+};
+
+static struct rpc_task *_nfs41_proc_sequence(struct nfs_client *clp, struct rpc_cred *cred,
+ const struct rpc_call_ops *seq_ops)
{
struct nfs4_sequence_data *calldata;
struct rpc_message msg = {
@@ -6154,7 +6167,7 @@ static struct rpc_task *_nfs41_proc_sequ
struct rpc_task_setup task_setup_data = {
.rpc_client = clp->cl_rpcclient,
.rpc_message = &msg,
- .callback_ops = &nfs41_sequence_ops,
+ .callback_ops = seq_ops,
.flags = RPC_TASK_ASYNC | RPC_TASK_SOFT,
};
@@ -6181,7 +6194,7 @@ static int nfs41_proc_async_sequence(str
if ((renew_flags & NFS4_RENEW_TIMEOUT) == 0)
return 0;
- task = _nfs41_proc_sequence(clp, cred);
+ task = _nfs41_proc_sequence(clp, cred, &nfs41_sequence_ops);
if (IS_ERR(task))
ret = PTR_ERR(task);
else
@@ -6195,7 +6208,7 @@ static int nfs4_proc_sequence(struct nfs
struct rpc_task *task;
int ret;
- task = _nfs41_proc_sequence(clp, cred);
+ task = _nfs41_proc_sequence(clp, cred, &nfs41_sequence_privileged_ops);
if (IS_ERR(task)) {
ret = PTR_ERR(task);
goto out;
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 040/123] nfs: dont extend writes to cover entire page if pagecache is invalid
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (38 preceding siblings ...)
2013-01-09 20:34 ` [ 039/123] NFS: Add sequence_priviliged_ops for nfs4_proc_sequence() Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 041/123] NFSv4: Check for buffer length in __nfs4_get_acl_uncached Greg Kroah-Hartman
` (85 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Jian Li, Jeff Layton, Trond Myklebust
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <jlayton@redhat.com>
commit 81d9bce5309288086b58b4d97a644e495fef75f2 upstream.
Jian reported that the following sequence would leave "testfile" with
corrupt data:
# mount localhost:/export /mnt/nfs/ -o vers=3
# echo abc > /mnt/nfs/testfile; echo def >> /export/testfile; echo ghi >> /mnt/nfs/testfile
# cat -v /export/testfile
abc
^@^@^@^@ghi
While there's no locking involved here, the operations are serialized,
so CTO should prevent corruption.
The first write to the file is fine and writes 4 bytes. The file is then
extended on the server. When it's reopened a GETATTR is issued and the
size change is noticed. This causes NFS_INO_INVALID_DATA to be set on
the file. Because the file is opened for write only,
nfs_want_read_modify_write() returns 0 to nfs_write_begin().
nfs_updatepage then calls nfs_write_pageuptodate() to see if it should
extend the nfs_page to cover the whole page. NFS_INO_INVALID_DATA is
still set on the file at that point, but that flag is ignored and
nfs_pageuptodate erroneously extends the write to cover the whole page,
with the write done on the server side filled in with zeroes.
This patch just has that function check for NFS_INO_INVALID_DATA in
addition to NFS_INO_REVAL_PAGECACHE. This fixes the bug, but looking
over the code, I wonder if we might have a similar bug in
nfs_revalidate_size(). The difference between those two flags is very
subtle, so it seems like we ought to be checking for
NFS_INO_INVALID_DATA in most of the places that we look for
NFS_INO_REVAL_PAGECACHE.
I believe this is regression introduced by commit 8d197a568. The code
did check for NFS_INO_INVALID_DATA prior to that patch.
Original bug report is here:
https://bugzilla.redhat.com/show_bug.cgi?id=885743
Reported-by: Jian Li <jiali@redhat.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfs/write.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -884,7 +884,7 @@ static bool nfs_write_pageuptodate(struc
{
if (nfs_have_delegated_attributes(inode))
goto out;
- if (NFS_I(inode)->cache_validity & NFS_INO_REVAL_PAGECACHE)
+ if (NFS_I(inode)->cache_validity & (NFS_INO_INVALID_DATA|NFS_INO_REVAL_PAGECACHE))
return false;
out:
return PageUptodate(page) != 0;
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 041/123] NFSv4: Check for buffer length in __nfs4_get_acl_uncached
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (39 preceding siblings ...)
2013-01-09 20:34 ` [ 040/123] nfs: dont extend writes to cover entire page if pagecache is invalid Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 042/123] nfs: dont zero out the rest of the page if we hit the EOF on a DIO READ Greg Kroah-Hartman
` (84 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Sven Wegener, Trond Myklebust
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sven Wegener <sven.wegener@stealer.net>
commit 7d3e91a89b7adbc2831334def9e494dd9892f9af upstream.
Commit 1f1ea6c "NFSv4: Fix buffer overflow checking in
__nfs4_get_acl_uncached" accidently dropped the checking for too small
result buffer length.
If someone uses getxattr on "system.nfs4_acl" on an NFSv4 mount
supporting ACLs, the ACL has not been cached and the buffer suplied is
too short, we still copy the complete ACL, resulting in kernel and user
space memory corruption.
Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfs/nfs4proc.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3937,8 +3937,13 @@ static ssize_t __nfs4_get_acl_uncached(s
goto out_free;
}
nfs4_write_cached_acl(inode, pages, res.acl_data_offset, res.acl_len);
- if (buf)
+ if (buf) {
+ if (res.acl_len > buflen) {
+ ret = -ERANGE;
+ goto out_free;
+ }
_copy_from_pages(buf, pages, res.acl_data_offset, res.acl_len);
+ }
out_ok:
ret = res.acl_len;
out_free:
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 042/123] nfs: dont zero out the rest of the page if we hit the EOF on a DIO READ
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (40 preceding siblings ...)
2013-01-09 20:34 ` [ 041/123] NFSv4: Check for buffer length in __nfs4_get_acl_uncached Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 043/123] NFS: avoid NULL dereference in nfs_destroy_server Greg Kroah-Hartman
` (83 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Eryu Guan, Fred Isaman, Jeff Layton,
Trond Myklebust
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <jlayton@redhat.com>
commit 67fad106a219e083c91c79695bd1807dde1bf7b9 upstream.
Eryu provided a test program that would segfault when attempting to read
past the EOF on file that was opened O_DIRECT. The buffer given to the
read() call was on the stack, and when he attempted to read past it it
would scribble over the rest of the stack page.
If we hit the end of the file on a DIO READ request, then we don't want
to zero out the rest of the buffer. These aren't pagecache pages after
all, and there's no guarantee that the buffers that were passed in
represent entire pages.
Reported-by: Eryu Guan <eguan@redhat.com>
Cc: Fred Isaman <iisaman@netapp.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfs/direct.c | 8 --------
1 file changed, 8 deletions(-)
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -266,14 +266,6 @@ static void nfs_direct_read_completion(s
struct nfs_page *req = nfs_list_entry(hdr->pages.next);
struct page *page = req->wb_page;
- if (test_bit(NFS_IOHDR_EOF, &hdr->flags)) {
- if (bytes > hdr->good_bytes)
- zero_user(page, 0, PAGE_SIZE);
- else if (hdr->good_bytes - bytes < PAGE_SIZE)
- zero_user_segment(page,
- hdr->good_bytes & ~PAGE_MASK,
- PAGE_SIZE);
- }
if (!PageCompound(page)) {
if (test_bit(NFS_IOHDR_ERROR, &hdr->flags)) {
if (bytes < hdr->good_bytes)
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 043/123] NFS: avoid NULL dereference in nfs_destroy_server
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (41 preceding siblings ...)
2013-01-09 20:34 ` [ 042/123] nfs: dont zero out the rest of the page if we hit the EOF on a DIO READ Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 044/123] NFS: Fix calls to drop_nlink() Greg Kroah-Hartman
` (82 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, NeilBrown, Trond Myklebust
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: NeilBrown <neilb@suse.de>
commit f259613a1e4b44a0cf85a5dafd931be96ee7c9e5 upstream.
In rare circumstances, nfs_clone_server() of a v2 or v3 server can get
an error between setting server->destory (to nfs_destroy_server), and
calling nfs_start_lockd (which will set server->nlm_host).
If this happens, nfs_clone_server will call nfs_free_server which
will call nfs_destroy_server and thence nlmclnt_done(NULL). This
causes the NULL to be dereferenced.
So add a guard to only call nlmclnt_done() if ->nlm_host is not NULL.
The other guards there are irrelevant as nlm_host can only be non-NULL
if one of these flags are set - so remove those tests. (Thanks to Trond
for this suggestion).
This is suitable for any stable kernel since 2.6.25.
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfs/client.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -615,8 +615,7 @@ EXPORT_SYMBOL_GPL(nfs_create_rpc_client)
*/
static void nfs_destroy_server(struct nfs_server *server)
{
- if (!(server->flags & NFS_MOUNT_LOCAL_FLOCK) ||
- !(server->flags & NFS_MOUNT_LOCAL_FCNTL))
+ if (server->nlm_host)
nlmclnt_done(server->nlm_host);
}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 044/123] NFS: Fix calls to drop_nlink()
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (42 preceding siblings ...)
2013-01-09 20:34 ` [ 043/123] NFS: avoid NULL dereference in nfs_destroy_server Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 045/123] NFS: Dont use SetPageError in the NFS writeback code Greg Kroah-Hartman
` (81 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Trond Myklebust
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <Trond.Myklebust@netapp.com>
commit 1f018458b30b0d5c535c94e577aa0acbb92e1395 upstream.
It is almost always wrong for NFS to call drop_nlink() after removing a
file. What we really want is to mark the inode's attributes for
revalidation, and we want to ensure that the VFS drops it if we're
reasonably sure that this is the final unlink().
Do the former using the usual cache validity flags, and the latter
by testing if inode->i_nlink == 1, and clearing it in that case.
This also fixes the following warning reported by Neil Brown and
Jeff Layton (among others).
[634155.004438] WARNING:
at /home/abuild/rpmbuild/BUILD/kernel-desktop-3.5.0/lin [634155.004442]
Hardware name: Latitude E6510 [634155.004577] crc_itu_t crc32c_intel
snd_hwdep snd_pcm snd_timer snd soundcor [634155.004609] Pid: 13402, comm:
bash Tainted: G W 3.5.0-36-desktop # [634155.004611] Call Trace:
[634155.004630] [<ffffffff8100444a>] dump_trace+0xaa/0x2b0
[634155.004641] [<ffffffff815a23dc>] dump_stack+0x69/0x6f
[634155.004653] [<ffffffff81041a0b>] warn_slowpath_common+0x7b/0xc0
[634155.004662] [<ffffffff811832e4>] drop_nlink+0x34/0x40
[634155.004687] [<ffffffffa05bb6c3>] nfs_dentry_iput+0x33/0x70 [nfs]
[634155.004714] [<ffffffff8118049e>] dput+0x12e/0x230
[634155.004726] [<ffffffff8116b230>] __fput+0x170/0x230
[634155.004735] [<ffffffff81167c0f>] filp_close+0x5f/0x90
[634155.004743] [<ffffffff81167cd7>] sys_close+0x97/0x100
[634155.004754] [<ffffffff815c3b39>] system_call_fastpath+0x16/0x1b
[634155.004767] [<00007f2a73a0d110>] 0x7f2a73a0d10f
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfs/dir.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1156,11 +1156,14 @@ static int nfs_dentry_delete(const struc
}
+/* Ensure that we revalidate inode->i_nlink */
static void nfs_drop_nlink(struct inode *inode)
{
spin_lock(&inode->i_lock);
- if (inode->i_nlink > 0)
- drop_nlink(inode);
+ /* drop the inode if we're reasonably sure this is the last link */
+ if (inode->i_nlink == 1)
+ clear_nlink(inode);
+ NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATTR;
spin_unlock(&inode->i_lock);
}
@@ -1175,8 +1178,8 @@ static void nfs_dentry_iput(struct dentr
NFS_I(inode)->cache_validity |= NFS_INO_INVALID_DATA;
if (dentry->d_flags & DCACHE_NFSFS_RENAMED) {
- drop_nlink(inode);
nfs_complete_unlink(dentry, inode);
+ nfs_drop_nlink(inode);
}
iput(inode);
}
@@ -1647,10 +1650,8 @@ static int nfs_safe_remove(struct dentry
if (inode != NULL) {
NFS_PROTO(inode)->return_delegation(inode);
error = NFS_PROTO(dir)->remove(dir, &dentry->d_name);
- /* The VFS may want to delete this inode */
if (error == 0)
nfs_drop_nlink(inode);
- nfs_mark_for_revalidate(inode);
} else
error = NFS_PROTO(dir)->remove(dir, &dentry->d_name);
if (error == -ENOENT)
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 045/123] NFS: Dont use SetPageError in the NFS writeback code
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (43 preceding siblings ...)
2013-01-09 20:34 ` [ 044/123] NFS: Fix calls to drop_nlink() Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 046/123] nfs: fix wrong object type in lockowner_slab Greg Kroah-Hartman
` (80 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Neil Brown, Trond Myklebust
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <Trond.Myklebust@netapp.com>
commit ada8e20d044c0fa5610e504ce6fb4578ebd3edd9 upstream.
The writeback code is already capable of passing errors back to user space
by means of the open_context->error. In the case of ENOSPC, Neil Brown
is reporting seeing 2 errors being returned.
Neil writes:
"e.g. if /mnt2/ if an nfs mounted filesystem that has no space then
strace dd if=/dev/zero conv=fsync >> /mnt2/afile count=1
reported Input/output error and the relevant parts of the strace output are:
write(1, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 512) = 512
fsync(1) = -1 EIO (Input/output error)
close(1) = -1 ENOSPC (No space left on device)"
Neil then shows that the duplication of error messages appears to be due to
the use of the PageError() mechanism, which causes filemap_fdatawait_range
to return the extra EIO. The regression was introduced by
commit 7b281ee026552f10862b617a2a51acf49c829554 (NFS: fsync() must exit
with an error if page writeback failed).
Fix this by removing the call to SetPageError(), and just relying on
open_context->error reporting the ENOSPC back to fsync().
Reported-by: Neil Brown <neilb@suse.de>
Tested-by: Neil Brown <neilb@suse.de>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfs/write.c | 1 -
1 file changed, 1 deletion(-)
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -202,7 +202,6 @@ out:
/* A writeback failed: mark the page as bad, and invalidate the page cache */
static void nfs_set_pageerror(struct page *page)
{
- SetPageError(page);
nfs_zap_mapping(page_file_mapping(page)->host, page_file_mapping(page));
}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 046/123] nfs: fix wrong object type in lockowner_slab
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (44 preceding siblings ...)
2013-01-09 20:34 ` [ 045/123] NFS: Dont use SetPageError in the NFS writeback code Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 047/123] nfsd: fix v4 reply caching Greg Kroah-Hartman
` (79 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Yanchuan Nian, J. Bruce Fields
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yanchuan Nian <ycnian@gmail.com>
commit 3c40794b2dd0f355ef4e6bf8d85af5dcd7da7ece upstream.
The object type in the cache of lockowner_slab is wrong, and it is
better to fix it.
Signed-off-by: Yanchuan Nian <ycnian@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfsd/nfs4state.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2340,7 +2340,7 @@ nfsd4_init_slabs(void)
if (openowner_slab == NULL)
goto out_nomem;
lockowner_slab = kmem_cache_create("nfsd4_lockowners",
- sizeof(struct nfs4_openowner), 0, 0, NULL);
+ sizeof(struct nfs4_lockowner), 0, 0, NULL);
if (lockowner_slab == NULL)
goto out_nomem;
file_slab = kmem_cache_create("nfsd4_files",
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 047/123] nfsd: fix v4 reply caching
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (45 preceding siblings ...)
2013-01-09 20:34 ` [ 046/123] nfs: fix wrong object type in lockowner_slab Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 048/123] nfsd4: fix oops on unusual readlike compound Greg Kroah-Hartman
` (78 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, J. Bruce Fields
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: "J. Bruce Fields" <bfields@redhat.com>
commit 57d276d71aef7d8305ff002a070cb98deb2edced upstream.
Very embarassing: 1091006c5eb15cba56785bd5b498a8d0b9546903 "nfsd: turn
on reply cache for NFSv4" missed a line, effectively leaving the reply
cache off in the v4 case. I thought I'd tested that, but I guess not.
This time, wrote a pynfs test to confirm it works.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfsd/nfssvc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -640,7 +640,7 @@ nfsd_dispatch(struct svc_rqst *rqstp, __
}
/* Store reply in cache. */
- nfsd_cache_update(rqstp, proc->pc_cachetype, statp + 1);
+ nfsd_cache_update(rqstp, rqstp->rq_cachetype, statp + 1);
return 1;
}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 048/123] nfsd4: fix oops on unusual readlike compound
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (46 preceding siblings ...)
2013-01-09 20:34 ` [ 047/123] nfsd: fix v4 reply caching Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 049/123] nfsd: avoid permission checks on EXCLUSIVE_CREATE replay Greg Kroah-Hartman
` (77 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, J. Bruce Fields
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: "J. Bruce Fields" <bfields@redhat.com>
commit d5f50b0c290431c65377c4afa1c764e2c3fe5305 upstream.
If the argument and reply together exceed the maximum payload size, then
a reply with a read-like operation can overlow the rq_pages array.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfsd/nfs4xdr.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -2946,11 +2946,16 @@ nfsd4_encode_read(struct nfsd4_compoundr
len = maxcount;
v = 0;
while (len > 0) {
- pn = resp->rqstp->rq_resused++;
+ pn = resp->rqstp->rq_resused;
+ if (!resp->rqstp->rq_respages[pn]) { /* ran out of pages */
+ maxcount -= len;
+ break;
+ }
resp->rqstp->rq_vec[v].iov_base =
page_address(resp->rqstp->rq_respages[pn]);
resp->rqstp->rq_vec[v].iov_len =
len < PAGE_SIZE ? len : PAGE_SIZE;
+ resp->rqstp->rq_resused++;
v++;
len -= PAGE_SIZE;
}
@@ -2996,6 +3001,8 @@ nfsd4_encode_readlink(struct nfsd4_compo
return nfserr;
if (resp->xbuf->page_len)
return nfserr_resource;
+ if (!resp->rqstp->rq_respages[resp->rqstp->rq_resused])
+ return nfserr_resource;
page = page_address(resp->rqstp->rq_respages[resp->rqstp->rq_resused++]);
@@ -3045,6 +3052,8 @@ nfsd4_encode_readdir(struct nfsd4_compou
return nfserr;
if (resp->xbuf->page_len)
return nfserr_resource;
+ if (!resp->rqstp->rq_respages[resp->rqstp->rq_resused])
+ return nfserr_resource;
RESERVE_SPACE(NFS4_VERIFIER_SIZE);
savep = p;
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 049/123] nfsd: avoid permission checks on EXCLUSIVE_CREATE replay
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (47 preceding siblings ...)
2013-01-09 20:34 ` [ 048/123] nfsd4: fix oops on unusual readlike compound Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 050/123] NFS: Fix access to suid/sgid executables Greg Kroah-Hartman
` (76 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, NeilBrown, J. Bruce Fields
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Neil Brown <neilb@suse.de>
commit 7007c90fb9fef593b4aeaeee57e6a6754276c97c upstream.
With NFSv4, if we create a file then open it we explicit avoid checking
the permissions on the file during the open because the fact that we
created it ensures we should be allow to open it (the create and the
open should appear to be a single operation).
However if the reply to an EXCLUSIVE create gets lots and the client
resends the create, the current code will perform the permission check -
because it doesn't realise that it did the open already..
This patch should fix this.
Note that I haven't actually seen this cause a problem. I was just
looking at the code trying to figure out a different EXCLUSIVE open
related issue, and this looked wrong.
(Fix confirmed with pynfs 4.0 test OPEN4--bfields)
Signed-off-by: NeilBrown <neilb@suse.de>
[bfields: use OWNER_OVERRIDE and update for 4.1]
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfsd/nfs4proc.c | 8 +++++---
fs/nfsd/vfs.c | 10 ++++++++--
2 files changed, 13 insertions(+), 5 deletions(-)
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -194,6 +194,7 @@ static __be32
do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_open *open)
{
struct svc_fh *resfh;
+ int accmode;
__be32 status;
resfh = kmalloc(sizeof(struct svc_fh), GFP_KERNEL);
@@ -253,9 +254,10 @@ do_open_lookup(struct svc_rqst *rqstp, s
/* set reply cache */
fh_copy_shallow(&open->op_openowner->oo_owner.so_replay.rp_openfh,
&resfh->fh_handle);
- if (!open->op_created)
- status = do_open_permission(rqstp, resfh, open,
- NFSD_MAY_NOP);
+ accmode = NFSD_MAY_NOP;
+ if (open->op_created)
+ accmode |= NFSD_MAY_OWNER_OVERRIDE;
+ status = do_open_permission(rqstp, resfh, open, accmode);
set_change_info(&open->op_cinfo, current_fh);
fh_dup2(current_fh, resfh);
out:
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1485,13 +1485,19 @@ do_nfsd_create(struct svc_rqst *rqstp, s
case NFS3_CREATE_EXCLUSIVE:
if ( dchild->d_inode->i_mtime.tv_sec == v_mtime
&& dchild->d_inode->i_atime.tv_sec == v_atime
- && dchild->d_inode->i_size == 0 )
+ && dchild->d_inode->i_size == 0 ) {
+ if (created)
+ *created = 1;
break;
+ }
case NFS4_CREATE_EXCLUSIVE4_1:
if ( dchild->d_inode->i_mtime.tv_sec == v_mtime
&& dchild->d_inode->i_atime.tv_sec == v_atime
- && dchild->d_inode->i_size == 0 )
+ && dchild->d_inode->i_size == 0 ) {
+ if (created)
+ *created = 1;
goto set_attr;
+ }
/* fallthru */
case NFS3_CREATE_GUARDED:
err = nfserr_exist;
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 050/123] NFS: Fix access to suid/sgid executables
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (48 preceding siblings ...)
2013-01-09 20:34 ` [ 049/123] nfsd: avoid permission checks on EXCLUSIVE_CREATE replay Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 051/123] pnfs: Increase the refcount when LAYOUTGET fails the first time Greg Kroah-Hartman
` (75 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Weston Andros Adamson, Trond Myklebust
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Weston Andros Adamson <dros@netapp.com>
commit f8d9a897d4384b77f13781ea813156568f68b83e upstream.
nfs_open_permission_mask() should only check MAY_EXEC for files that
are opened with __FMODE_EXEC.
Also fix NFSv4 access-in-open path in a similar way -- openflags must be
used because fmode will not always have FMODE_EXEC set.
This patch fixes https://bugzilla.kernel.org/show_bug.cgi?id=49101
Signed-off-by: Weston Andros Adamson <dros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfs/dir.c | 16 ++++++++++------
fs/nfs/nfs4proc.c | 18 +++++++++++-------
2 files changed, 21 insertions(+), 13 deletions(-)
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -2148,12 +2148,16 @@ static int nfs_open_permission_mask(int
{
int mask = 0;
- if ((openflags & O_ACCMODE) != O_WRONLY)
- mask |= MAY_READ;
- if ((openflags & O_ACCMODE) != O_RDONLY)
- mask |= MAY_WRITE;
- if (openflags & __FMODE_EXEC)
- mask |= MAY_EXEC;
+ if (openflags & __FMODE_EXEC) {
+ /* ONLY check exec rights */
+ mask = MAY_EXEC;
+ } else {
+ if ((openflags & O_ACCMODE) != O_WRONLY)
+ mask |= MAY_READ;
+ if ((openflags & O_ACCMODE) != O_RDONLY)
+ mask |= MAY_WRITE;
+ }
+
return mask;
}
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1721,7 +1721,8 @@ static int _nfs4_recover_proc_open(struc
static int nfs4_opendata_access(struct rpc_cred *cred,
struct nfs4_opendata *opendata,
- struct nfs4_state *state, fmode_t fmode)
+ struct nfs4_state *state, fmode_t fmode,
+ int openflags)
{
struct nfs_access_entry cache;
u32 mask;
@@ -1733,11 +1734,14 @@ static int nfs4_opendata_access(struct r
mask = 0;
/* don't check MAY_WRITE - a newly created file may not have
- * write mode bits, but POSIX allows the creating process to write */
- if (fmode & FMODE_READ)
- mask |= MAY_READ;
- if (fmode & FMODE_EXEC)
- mask |= MAY_EXEC;
+ * write mode bits, but POSIX allows the creating process to write.
+ * use openflags to check for exec, because fmode won't
+ * always have FMODE_EXEC set when file open for exec. */
+ if (openflags & __FMODE_EXEC) {
+ /* ONLY check for exec rights */
+ mask = MAY_EXEC;
+ } else if (fmode & FMODE_READ)
+ mask = MAY_READ;
cache.cred = cred;
cache.jiffies = jiffies;
@@ -2009,7 +2013,7 @@ static int _nfs4_do_open(struct inode *d
if (server->caps & NFS_CAP_POSIX_LOCK)
set_bit(NFS_STATE_POSIX_LOCKS, &state->flags);
- status = nfs4_opendata_access(cred, opendata, state, fmode);
+ status = nfs4_opendata_access(cred, opendata, state, fmode, flags);
if (status != 0)
goto err_opendata_put;
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 051/123] pnfs: Increase the refcount when LAYOUTGET fails the first time
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (49 preceding siblings ...)
2013-01-09 20:34 ` [ 050/123] NFS: Fix access to suid/sgid executables Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 052/123] nfs: fix null checking in nfs_get_option_str() Greg Kroah-Hartman
` (74 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Yanchuan Nian, Trond Myklebust
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yanchuan Nian <ycnian@gmail.com>
commit 39e88fcfb1d5c6c4b1ff76ca2ab76cf449b850e8 upstream.
The layout will be set unusable if LAYOUTGET fails. Is it reasonable to
increase the refcount iff LAYOUTGET fails the first time?
Signed-off-by: Yanchuan Nian <ycnian@gmail.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfs/pnfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -254,7 +254,7 @@ static void
pnfs_layout_set_fail_bit(struct pnfs_layout_hdr *lo, int fail_bit)
{
lo->plh_retry_timestamp = jiffies;
- if (test_and_set_bit(fail_bit, &lo->plh_flags))
+ if (!test_and_set_bit(fail_bit, &lo->plh_flags))
atomic_inc(&lo->plh_refcount);
}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 052/123] nfs: fix null checking in nfs_get_option_str()
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (50 preceding siblings ...)
2013-01-09 20:34 ` [ 051/123] pnfs: Increase the refcount when LAYOUTGET fails the first time Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 053/123] NFS: Ensure that we free the rpc_task after read and write cleanups are done Greg Kroah-Hartman
` (73 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Xi Wang, Trond Myklebust
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xi Wang <xi.wang@gmail.com>
commit e25fbe380c4e3c09afa98bcdcd9d3921443adab8 upstream.
The following null pointer check is broken.
*option = match_strdup(args);
return !option;
The pointer `option' must be non-null, and thus `!option' is always false.
Use `!*option' instead.
The bug was introduced in commit c5cb09b6f8 ("Cleanup: Factor out some
cut-and-paste code.").
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfs/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1150,7 +1150,7 @@ static int nfs_get_option_str(substring_
{
kfree(*option);
*option = match_strdup(args);
- return !option;
+ return !*option;
}
static int nfs_get_option_ul(substring_t args[], unsigned long *option)
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 053/123] NFS: Ensure that we free the rpc_task after read and write cleanups are done
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (51 preceding siblings ...)
2013-01-09 20:34 ` [ 052/123] nfs: fix null checking in nfs_get_option_str() Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 054/123] nfs: avoid dereferencing null pointer in initiate_bulk_draining Greg Kroah-Hartman
` (72 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Trond Myklebust, Weston Andros Adamson,
Tejun Heo, Bruce Fields
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <Trond.Myklebust@netapp.com>
commit 6db6dd7d3fd8f7c765dabc376493d6791ab28bd6 upstream.
This patch ensures that we free the rpc_task after the cleanup callbacks
are done in order to avoid a deadlock problem that can be triggered if
the callback needs to wait for another workqueue item to complete.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Weston Andros Adamson <dros@netapp.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Bruce Fields <bfields@fieldses.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfs/read.c | 10 +++++++---
fs/nfs/write.c | 10 +++++++---
2 files changed, 14 insertions(+), 6 deletions(-)
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -91,12 +91,16 @@ void nfs_readdata_release(struct nfs_rea
put_nfs_open_context(rdata->args.context);
if (rdata->pages.pagevec != rdata->pages.page_array)
kfree(rdata->pages.pagevec);
- if (rdata != &read_header->rpc_data)
- kfree(rdata);
- else
+ if (rdata == &read_header->rpc_data) {
rdata->header = NULL;
+ rdata = NULL;
+ }
if (atomic_dec_and_test(&hdr->refcnt))
hdr->completion_ops->completion(hdr);
+ /* Note: we only free the rpc_task after callbacks are done.
+ * See the comment in rpc_free_task() for why
+ */
+ kfree(rdata);
}
EXPORT_SYMBOL_GPL(nfs_readdata_release);
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -126,12 +126,16 @@ void nfs_writedata_release(struct nfs_wr
put_nfs_open_context(wdata->args.context);
if (wdata->pages.pagevec != wdata->pages.page_array)
kfree(wdata->pages.pagevec);
- if (wdata != &write_header->rpc_data)
- kfree(wdata);
- else
+ if (wdata == &write_header->rpc_data) {
wdata->header = NULL;
+ wdata = NULL;
+ }
if (atomic_dec_and_test(&hdr->refcnt))
hdr->completion_ops->completion(hdr);
+ /* Note: we only free the rpc_task after callbacks are done.
+ * See the comment in rpc_free_task() for why
+ */
+ kfree(wdata);
}
EXPORT_SYMBOL_GPL(nfs_writedata_release);
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 054/123] nfs: avoid dereferencing null pointer in initiate_bulk_draining
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (52 preceding siblings ...)
2013-01-09 20:34 ` [ 053/123] NFS: Ensure that we free the rpc_task after read and write cleanups are done Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 055/123] vfs: d_obtain_alias() needs to use "/" as default name Greg Kroah-Hartman
` (71 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Nickolai Zeldovich, Trond Myklebust
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nickolai Zeldovich <nickolai@csail.mit.edu>
commit ecf0eb9edbb607d74f74b73c14af8b43f3729528 upstream.
Fix an inverted null pointer check in initiate_bulk_draining().
Signed-off-by: Nickolai Zeldovich <nickolai@csail.mit.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/nfs/callback_proc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/nfs/callback_proc.c
+++ b/fs/nfs/callback_proc.c
@@ -205,7 +205,7 @@ static u32 initiate_bulk_draining(struct
list_for_each_entry(lo, &server->layouts, plh_layouts) {
ino = igrab(lo->plh_inode);
- if (ino)
+ if (!ino)
continue;
spin_lock(&ino->i_lock);
/* Is this layout in the process of being freed? */
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 055/123] vfs: d_obtain_alias() needs to use "/" as default name.
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (53 preceding siblings ...)
2013-01-09 20:34 ` [ 054/123] nfs: avoid dereferencing null pointer in initiate_bulk_draining Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 056/123] Input: walkera0701 - fix crash on startup Greg Kroah-Hartman
` (70 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, NeilBrown, Trond Myklebust, Al Viro,
Andrew Morton
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: NeilBrown <neilb@suse.de>
commit b911a6bdeef5848c468597d040e3407e0aee04ce upstream.
NFS appears to use d_obtain_alias() to create the root dentry rather than
d_make_root. This can cause 'prepend_path()' to complain that the root
has a weird name if an NFS filesystem is lazily unmounted. e.g. if
"/mnt" is an NFS mount then
{ cd /mnt; umount -l /mnt ; ls -l /proc/self/cwd; }
will cause a WARN message like
WARNING: at /home/git/linux/fs/dcache.c:2624 prepend_path+0x1d7/0x1e0()
...
Root dentry has weird name <>
to appear in kernel logs.
So change d_obtain_alias() to use "/" rather than "" as the anonymous
name.
Signed-off-by: NeilBrown <neilb@suse.de>
Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/dcache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -1583,7 +1583,7 @@ EXPORT_SYMBOL(d_find_any_alias);
*/
struct dentry *d_obtain_alias(struct inode *inode)
{
- static const struct qstr anonstring = { .name = "" };
+ static const struct qstr anonstring = QSTR_INIT("/", 1);
struct dentry *tmp;
struct dentry *res;
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 056/123] Input: walkera0701 - fix crash on startup
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (54 preceding siblings ...)
2013-01-09 20:34 ` [ 055/123] vfs: d_obtain_alias() needs to use "/" as default name Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 057/123] Input: wacom - fix touch support for Bamboo Fun CTH-461 Greg Kroah-Hartman
` (69 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Peter Popovec, Dmitry Torokhov
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Popovec <popovec@oko.fei.tuke.sk>
commit a455e2985f57e2a71566bb8850094af38b2c932d upstream.
The driver's timer must be set up before enabling IRQ handler, otherwise
bad things may happen.
Reported-and-tested-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Peter Popovec <popovec@fei.tuke.sk>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/input/joystick/walkera0701.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--- a/drivers/input/joystick/walkera0701.c
+++ b/drivers/input/joystick/walkera0701.c
@@ -196,6 +196,7 @@ static void walkera0701_close(struct inp
struct walkera_dev *w = input_get_drvdata(dev);
parport_disable_irq(w->parport);
+ hrtimer_cancel(&w->timer);
}
static int walkera0701_connect(struct walkera_dev *w, int parport)
@@ -224,6 +225,9 @@ static int walkera0701_connect(struct wa
if (parport_claim(w->pardevice))
goto init_err1;
+ hrtimer_init(&w->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
+ w->timer.function = timer_handler;
+
w->input_dev = input_allocate_device();
if (!w->input_dev)
goto init_err2;
@@ -254,8 +258,6 @@ static int walkera0701_connect(struct wa
if (err)
goto init_err3;
- hrtimer_init(&w->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
- w->timer.function = timer_handler;
return 0;
init_err3:
@@ -271,7 +273,6 @@ static int walkera0701_connect(struct wa
static void walkera0701_disconnect(struct walkera_dev *w)
{
- hrtimer_cancel(&w->timer);
input_unregister_device(w->input_dev);
parport_release(w->pardevice);
parport_unregister_device(w->pardevice);
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 057/123] Input: wacom - fix touch support for Bamboo Fun CTH-461
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (55 preceding siblings ...)
2013-01-09 20:34 ` [ 056/123] Input: walkera0701 - fix crash on startup Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 058/123] Input: sentelic - only report position of first finger as ST coordinates Greg Kroah-Hartman
` (68 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Diego Calleja, Ping Cheng,
Dmitry Torokhov
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Diego Calleja <diegocg@gmail.com>
commit e12b3cecf221644ccab64d7c30a6df58b7630cb0 upstream.
Commit f393ee2b814e3291c12565000210b3cf10aa5c1d forgot to add the
touch_max property for Wacom Bamboo Fun CTH-461/S, ID 056a:00d2.
This broke the touch functionality for that device. This patch,
(done with help of Ping Cheng), adds the correct value and makes
touch work again.
Signed-off-by: Diego Calleja <diegocg@gmail.com>
Reviewed-by: Ping Cheng <pinglinux@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/input/tablet/wacom_wac.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -2034,7 +2034,8 @@ static const struct wacom_features wacom
.touch_max = 2 };
static const struct wacom_features wacom_features_0xD2 =
{ "Wacom Bamboo Craft", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023,
- 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES };
+ 31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
+ .touch_max = 2 };
static const struct wacom_features wacom_features_0xD3 =
{ "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13700, 1023,
31, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES,
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 058/123] Input: sentelic - only report position of first finger as ST coordinates
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (56 preceding siblings ...)
2013-01-09 20:34 ` [ 057/123] Input: wacom - fix touch support for Bamboo Fun CTH-461 Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 059/123] Input: gpio_keys_polled - defer probing if GPIO probing is deferred Greg Kroah-Hartman
` (67 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Christophe TORDEUX, Dmitry Torokhov
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe TORDEUX <christophe@tordeux.net>
commit a25461659050b913e114d282bf58823682eb56b6 upstream.
Report only the position of the first finger as absolute non-MT coordinates,
instead of reporting both fingers alternatively. Actual MT events are
unaffected.
This fixes horizontal and improves vertical scrolling with the touchpad.
Signed-off-by: Christophe TORDEUX <christophe@tordeux.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/input/mouse/sentelic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/input/mouse/sentelic.c
+++ b/drivers/input/mouse/sentelic.c
@@ -791,7 +791,7 @@ static psmouse_ret_t fsp_process_byte(st
fsp_set_slot(dev, 0, fgrs > 0, abs_x, abs_y);
fsp_set_slot(dev, 1, false, 0, 0);
}
- if (fgrs > 0) {
+ if (fgrs == 1 || (fgrs == 2 && !(packet[0] & FSP_PB0_MFMC_FGR2))) {
input_report_abs(dev, ABS_X, abs_x);
input_report_abs(dev, ABS_Y, abs_y);
}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 059/123] Input: gpio_keys_polled - defer probing if GPIO probing is deferred
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (57 preceding siblings ...)
2013-01-09 20:34 ` [ 058/123] Input: sentelic - only report position of first finger as ST coordinates Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 060/123] Input: gpio_keys " Greg Kroah-Hartman
` (66 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Gabor Juhos, Dmitry Torokhov
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gabor Juhos <juhosg@openwrt.org>
commit d46329a708c1a3301e272a029266b69339c0877f upstream.
If GPIO probing is deferred, the driver tries to claim an invalid GPIO line
which leads to an error message like this:
gpio-keys-polled buttons.2: unable to claim gpio 4294966779, err=-22
gpio-keys-polled: probe of buttons.2 failed with error -22
We should make sure that error code returned by of_get_gpio_flags (including
-EPROBE_DEFER) is propagated up the stack.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/input/keyboard/gpio_keys_polled.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
--- a/drivers/input/keyboard/gpio_keys_polled.c
+++ b/drivers/input/keyboard/gpio_keys_polled.c
@@ -136,6 +136,7 @@ gpio_keys_polled_get_devtree_pdata(struc
i = 0;
for_each_child_of_node(node, pp) {
+ int gpio;
enum of_gpio_flags flags;
if (!of_find_property(pp, "gpios", NULL)) {
@@ -144,9 +145,19 @@ gpio_keys_polled_get_devtree_pdata(struc
continue;
}
+ gpio = of_get_gpio_flags(pp, 0, &flags);
+ if (gpio < 0) {
+ error = gpio;
+ if (error != -EPROBE_DEFER)
+ dev_err(dev,
+ "Failed to get gpio flags, error: %d\n",
+ error);
+ goto err_free_pdata;
+ }
+
button = &pdata->buttons[i++];
- button->gpio = of_get_gpio_flags(pp, 0, &flags);
+ button->gpio = gpio;
button->active_low = flags & OF_GPIO_ACTIVE_LOW;
if (of_property_read_u32(pp, "linux,code", &button->code)) {
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 060/123] Input: gpio_keys - defer probing if GPIO probing is deferred
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (58 preceding siblings ...)
2013-01-09 20:34 ` [ 059/123] Input: gpio_keys_polled - defer probing if GPIO probing is deferred Greg Kroah-Hartman
@ 2013-01-09 20:34 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 061/123] genirq: Always force thread affinity Greg Kroah-Hartman
` (65 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:34 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Gabor Juhos, Dmitry Torokhov
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
commit e324ce61ef483dd26d03502d35666ad48a2e1b33 upstream.
If of_get_gpio_flags() returns an error (as in case when GPIO probe is
deferred) the driver would attempt to claim invalid GPIO. It should
propagate the error code up the stack instead so that the probe either
fails or will be retried later (in case of -EPROBE_DEFER).
Reported-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/input/keyboard/gpio_keys.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -587,6 +587,7 @@ gpio_keys_get_devtree_pdata(struct devic
i = 0;
for_each_child_of_node(node, pp) {
+ int gpio;
enum of_gpio_flags flags;
if (!of_find_property(pp, "gpios", NULL)) {
@@ -595,9 +596,19 @@ gpio_keys_get_devtree_pdata(struct devic
continue;
}
+ gpio = of_get_gpio_flags(pp, 0, &flags);
+ if (gpio < 0) {
+ error = gpio;
+ if (error != -EPROBE_DEFER)
+ dev_err(dev,
+ "Failed to get gpio flags, error: %d\n",
+ error);
+ goto err_free_pdata;
+ }
+
button = &pdata->buttons[i++];
- button->gpio = of_get_gpio_flags(pp, 0, &flags);
+ button->gpio = gpio;
button->active_low = flags & OF_GPIO_ACTIVE_LOW;
if (of_property_read_u32(pp, "linux,code", &button->code)) {
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 061/123] genirq: Always force thread affinity
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (59 preceding siblings ...)
2013-01-09 20:34 ` [ 060/123] Input: gpio_keys " Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 062/123] usb: musb: cppi_dma: export cppi_interrupt() Greg Kroah-Hartman
` (64 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Thomas Gleixner
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <tglx@linutronix.de>
commit 04aa530ec04f61875b99c12721162e2964e3318c upstream.
Sankara reported that the genirq core code fails to adjust the
affinity of an interrupt thread in several cases:
1) On request/setup_irq() the call to setup_affinity() happens before
the new action is registered, so the new thread is not notified.
2) For secondary shared interrupts nothing notifies the new thread to
change its affinity.
3) Interrupts which have the IRQ_NO_BALANCE flag set are not moving
the thread either.
Fix this by setting the thread affinity flag right on thread creation
time. This ensures that under all circumstances the thread moves to
the right place. Requires a check in irq_thread_check_affinity for an
existing affinity mask (CONFIG_CPU_MASK_OFFSTACK=y)
Reported-and-tested-by: Sankara Muthukrishnan <sankara.m@gmail.com>
Link: http://lkml.kernel.org/r/alpine.LFD.2.02.1209041738200.2754@ionos
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/irq/manage.c | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -716,6 +716,7 @@ static void
irq_thread_check_affinity(struct irq_desc *desc, struct irqaction *action)
{
cpumask_var_t mask;
+ bool valid = true;
if (!test_and_clear_bit(IRQTF_AFFINITY, &action->thread_flags))
return;
@@ -730,10 +731,18 @@ irq_thread_check_affinity(struct irq_des
}
raw_spin_lock_irq(&desc->lock);
- cpumask_copy(mask, desc->irq_data.affinity);
+ /*
+ * This code is triggered unconditionally. Check the affinity
+ * mask pointer. For CPU_MASK_OFFSTACK=n this is optimized out.
+ */
+ if (desc->irq_data.affinity)
+ cpumask_copy(mask, desc->irq_data.affinity);
+ else
+ valid = false;
raw_spin_unlock_irq(&desc->lock);
- set_cpus_allowed_ptr(current, mask);
+ if (valid)
+ set_cpus_allowed_ptr(current, mask);
free_cpumask_var(mask);
}
#else
@@ -936,6 +945,16 @@ __setup_irq(unsigned int irq, struct irq
*/
get_task_struct(t);
new->thread = t;
+ /*
+ * Tell the thread to set its affinity. This is
+ * important for shared interrupt handlers as we do
+ * not invoke setup_affinity() for the secondary
+ * handlers as everything is already set up. Even for
+ * interrupts marked with IRQF_NO_BALANCE this is
+ * correct as we want the thread to move to the cpu(s)
+ * on which the requesting code placed the interrupt.
+ */
+ set_bit(IRQTF_AFFINITY, &new->thread_flags);
}
if (!alloc_cpumask_var(&mask, GFP_KERNEL)) {
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 062/123] usb: musb: cppi_dma: export cppi_interrupt()
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (60 preceding siblings ...)
2013-01-09 20:35 ` [ 061/123] genirq: Always force thread affinity Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 063/123] Revert "usb: musb: dsps: remove explicit NOP device creation" Greg Kroah-Hartman
` (63 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Sergei Shtylyov, Felipe Balbi
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
commit 8b416b0b25d5d8ddb3a91c1d20e1373582c50405 upstream.
Now that DaVinci glue layer can be modular, we must export cppi_interrupt()
that it may call...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/musb/cppi_dma.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/usb/musb/cppi_dma.c
+++ b/drivers/usb/musb/cppi_dma.c
@@ -1314,6 +1314,7 @@ irqreturn_t cppi_interrupt(int irq, void
return IRQ_HANDLED;
}
+EXPORT_SYMBOL_GPL(cppi_interrupt);
/* Instantiate a software object representing a DMA controller. */
struct dma_controller *__devinit
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 063/123] Revert "usb: musb: dsps: remove explicit NOP device creation"
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (61 preceding siblings ...)
2013-01-09 20:35 ` [ 062/123] usb: musb: cppi_dma: export cppi_interrupt() Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 064/123] xhci: Fix conditional check in bandwidth calculation Greg Kroah-Hartman
` (62 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Afzal Mohammed, Felipe Balbi
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Afzal Mohammed <afzal@ti.com>
commit d75542263a0b005876d112bbf9ffb23180cc3149 upstream.
This reverts commit d8c3ef256f88b7c6ecd673d03073b5645be9c5e4.
Above mentioned change was made along with multi usb phy change and
adding DT support for nop transceiver. But other two changes did not
make it to mainline. This in effect makes dsps musb wrapper unusable
even for single instance.
Hence revert it so that at least single instance can be supported.
Signed-off-by: Afzal Mohammed <afzal@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/musb/musb_dsps.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -377,7 +377,8 @@ static int dsps_musb_init(struct musb *m
/* mentor core register starts at offset of 0x400 from musb base */
musb->mregs += wrp->musb_core_offset;
- /* Get the NOP PHY */
+ /* NOP driver needs change if supporting dual instance */
+ usb_nop_xceiv_register();
musb->xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
if (IS_ERR_OR_NULL(musb->xceiv))
return -ENODEV;
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 064/123] xhci: Fix conditional check in bandwidth calculation.
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (62 preceding siblings ...)
2013-01-09 20:35 ` [ 063/123] Revert "usb: musb: dsps: remove explicit NOP device creation" Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 065/123] xHCI: Fix TD Size calculation on 1.0 hosts Greg Kroah-Hartman
` (61 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Sarah Sharp, David Binderman
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sarah Sharp <sarah.a.sharp@linux.intel.com>
commit 392a07ae3316f2b90b39ce41e66d6f6b5c95de90 upstream.
David reports that at drivers/usb/host/xhci.c:2257:
static bool xhci_is_sync_in_ep(unsigned int ep_type)
{
return (ep_type == ISOC_IN_EP || ep_type != INT_IN_EP);
}
The static analyser cppcheck says
[linux-3.7-rc2/drivers/usb/host/xhci.c:2257]: (style) Redundant condition: If ep_type == 5, the comparison ep_type != 7 is always true.
Maybe the original programmer intention was something like
static bool xhci_is_sync_in_ep(unsigned int ep_type)
{
return (ep_type == ISOC_IN_EP || ep_type == INT_IN_EP);
}
Fix this.
This patch should be backported to stable kernels as old as 3.2, that
contain the commit 2b69899934c63b7b9432568584fb4c4a2924f40c "xhci: USB
3.0 BW checking."
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/host/xhci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -2254,7 +2254,7 @@ static bool xhci_is_async_ep(unsigned in
static bool xhci_is_sync_in_ep(unsigned int ep_type)
{
- return (ep_type == ISOC_IN_EP || ep_type != INT_IN_EP);
+ return (ep_type == ISOC_IN_EP || ep_type == INT_IN_EP);
}
static unsigned int xhci_get_ss_bw_consumed(struct xhci_bw_info *ep_bw)
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 065/123] xHCI: Fix TD Size calculation on 1.0 hosts.
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (63 preceding siblings ...)
2013-01-09 20:35 ` [ 064/123] xhci: Fix conditional check in bandwidth calculation Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 066/123] xhci: fix null-pointer dereference when destroying half-built segment rings Greg Kroah-Hartman
` (60 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Sarah Sharp, Chintan Mehta,
Shimmer Huang, Bhavik Kothari
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sarah Sharp <sarah.a.sharp@linux.intel.com>
commit 4525c0a10dff7ad3669763c28016c7daffc3900e upstream.
The xHCI 1.0 specification made a change to the TD Size field in TRBs.
The value is now the number of packets that remain to be sent in the TD,
not including this TRB. The TD Size value for the last TRB in a TD must
always be zero.
The xHCI function xhci_v1_0_td_remainder() attempts to calculate this,
but it gets it wrong. First, it erroneously reuses the old
xhci_td_remainder function, which will right shift the value by 10. The
xHCI 1.0 spec as of June 2011 says nothing about right shifting by 10.
Second, it does not set the TD size for the last TRB in a TD to zero.
Third, it uses roundup instead of DIV_ROUND_UP. The total packet count
is supposed to be the total number of bytes in this TD, divided by the
max packet size, rounded up. DIV_ROUND_UP is the right function to use
in that case.
With the old code, a TD on an endpoint with max packet size 1024 would
be set up like so:
TRB 1, TRB length = 600 bytes, TD size = 0
TRB 1, TRB length = 200 bytes, TD size = 0
TRB 1, TRB length = 100 bytes, TD size = 0
With the new code, the TD would be set up like this:
TRB 1, TRB length = 600 bytes, TD size = 1
TRB 1, TRB length = 200 bytes, TD size = 1
TRB 1, TRB length = 100 bytes, TD size = 0
This commit should be backported to kernels as old as 3.0, that contain
the commit 4da6e6f247a2601ab9f1e63424e4d944ed4124f3 "xhci 1.0: Update TD
size field format."
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Reported-by: Chintan Mehta <chintan.mehta@sibridgetech.com>
Reported-by: Shimmer Huang <shimmering.h@gmail.com>
Tested-by: Bhavik Kothari <bhavik.kothari@sibridgetech.com>
Tested-by: Shimmer Huang <shimmering.h@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/host/xhci-ring.c | 32 +++++++++++++++++++-------------
1 file changed, 19 insertions(+), 13 deletions(-)
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -3071,11 +3071,11 @@ static u32 xhci_td_remainder(unsigned in
}
/*
- * For xHCI 1.0 host controllers, TD size is the number of packets remaining in
- * the TD (*not* including this TRB).
+ * For xHCI 1.0 host controllers, TD size is the number of max packet sized
+ * packets remaining in the TD (*not* including this TRB).
*
* Total TD packet count = total_packet_count =
- * roundup(TD size in bytes / wMaxPacketSize)
+ * DIV_ROUND_UP(TD size in bytes / wMaxPacketSize)
*
* Packets transferred up to and including this TRB = packets_transferred =
* rounddown(total bytes transferred including this TRB / wMaxPacketSize)
@@ -3083,15 +3083,16 @@ static u32 xhci_td_remainder(unsigned in
* TD size = total_packet_count - packets_transferred
*
* It must fit in bits 21:17, so it can't be bigger than 31.
+ * The last TRB in a TD must have the TD size set to zero.
*/
-
static u32 xhci_v1_0_td_remainder(int running_total, int trb_buff_len,
- unsigned int total_packet_count, struct urb *urb)
+ unsigned int total_packet_count, struct urb *urb,
+ unsigned int num_trbs_left)
{
int packets_transferred;
/* One TRB with a zero-length data packet. */
- if (running_total == 0 && trb_buff_len == 0)
+ if (num_trbs_left == 0 || (running_total == 0 && trb_buff_len == 0))
return 0;
/* All the TRB queueing functions don't count the current TRB in
@@ -3100,7 +3101,9 @@ static u32 xhci_v1_0_td_remainder(int ru
packets_transferred = (running_total + trb_buff_len) /
usb_endpoint_maxp(&urb->ep->desc);
- return xhci_td_remainder(total_packet_count - packets_transferred);
+ if ((total_packet_count - packets_transferred) > 31)
+ return 31 << 17;
+ return (total_packet_count - packets_transferred) << 17;
}
static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
@@ -3127,7 +3130,7 @@ static int queue_bulk_sg_tx(struct xhci_
num_trbs = count_sg_trbs_needed(xhci, urb);
num_sgs = urb->num_mapped_sgs;
- total_packet_count = roundup(urb->transfer_buffer_length,
+ total_packet_count = DIV_ROUND_UP(urb->transfer_buffer_length,
usb_endpoint_maxp(&urb->ep->desc));
trb_buff_len = prepare_transfer(xhci, xhci->devs[slot_id],
@@ -3210,7 +3213,8 @@ static int queue_bulk_sg_tx(struct xhci_
running_total);
} else {
remainder = xhci_v1_0_td_remainder(running_total,
- trb_buff_len, total_packet_count, urb);
+ trb_buff_len, total_packet_count, urb,
+ num_trbs - 1);
}
length_field = TRB_LEN(trb_buff_len) |
remainder |
@@ -3318,7 +3322,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
start_cycle = ep_ring->cycle_state;
running_total = 0;
- total_packet_count = roundup(urb->transfer_buffer_length,
+ total_packet_count = DIV_ROUND_UP(urb->transfer_buffer_length,
usb_endpoint_maxp(&urb->ep->desc));
/* How much data is in the first TRB? */
addr = (u64) urb->transfer_dma;
@@ -3364,7 +3368,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd *
running_total);
} else {
remainder = xhci_v1_0_td_remainder(running_total,
- trb_buff_len, total_packet_count, urb);
+ trb_buff_len, total_packet_count, urb,
+ num_trbs - 1);
}
length_field = TRB_LEN(trb_buff_len) |
remainder |
@@ -3627,7 +3632,7 @@ static int xhci_queue_isoc_tx(struct xhc
addr = start_addr + urb->iso_frame_desc[i].offset;
td_len = urb->iso_frame_desc[i].length;
td_remain_len = td_len;
- total_packet_count = roundup(td_len,
+ total_packet_count = DIV_ROUND_UP(td_len,
usb_endpoint_maxp(&urb->ep->desc));
/* A zero-length transfer still involves at least one packet. */
if (total_packet_count == 0)
@@ -3706,7 +3711,8 @@ static int xhci_queue_isoc_tx(struct xhc
} else {
remainder = xhci_v1_0_td_remainder(
running_total, trb_buff_len,
- total_packet_count, urb);
+ total_packet_count, urb,
+ (trbs_per_td - j - 1));
}
length_field = TRB_LEN(trb_buff_len) |
remainder |
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 066/123] xhci: fix null-pointer dereference when destroying half-built segment rings
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (64 preceding siblings ...)
2013-01-09 20:35 ` [ 065/123] xHCI: Fix TD Size calculation on 1.0 hosts Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 067/123] USB: fix endpoint-disabling for failed config changes Greg Kroah-Hartman
` (59 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Julius Werner, Sarah Sharp
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Julius Werner <jwerner@chromium.org>
commit 68e5254adb88bede68285f11fb442a4d34fb550c upstream.
xhci_alloc_segments_for_ring() builds a list of xhci_segments and links
the tail to head at the end (forming a ring). When it bails out for OOM
reasons half-way through, it tries to destroy its half-built list with
xhci_free_segments_for_ring(), even though it is not a ring yet. This
causes a null-pointer dereference upon hitting the last element.
Furthermore, one of its callers (xhci_ring_alloc()) mistakenly believes
the output parameters to be valid upon this kind of OOM failure, and
calls xhci_ring_free() on them. Since the (incomplete) list/ring should
already be destroyed in that case, this would lead to a use after free.
This patch fixes those issues by having xhci_alloc_segments_for_ring()
destroy its half-built, non-circular list manually and destroying the
invalid struct xhci_ring in xhci_ring_alloc() with a plain kfree().
This patch should be backported to kernels as old as 2.6.31, that
contains the commit 0ebbab37422315a5d0cb29792271085bafdf38c0 "USB: xhci:
Ring allocation and initialization."
A separate patch will need to be developed for kernels older than 3.4,
since the ring allocation code was refactored in that kernel.
Signed-off-by: Julius Werner <jwerner@chromium.org>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/host/xhci-mem.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -205,7 +205,12 @@ static int xhci_alloc_segments_for_ring(
next = xhci_segment_alloc(xhci, cycle_state, flags);
if (!next) {
- xhci_free_segments_for_ring(xhci, *first);
+ prev = *first;
+ while (prev) {
+ next = prev->next;
+ xhci_segment_free(xhci, prev);
+ prev = next;
+ }
return -ENOMEM;
}
xhci_link_segments(xhci, prev, next, type);
@@ -258,7 +263,7 @@ static struct xhci_ring *xhci_ring_alloc
return ring;
fail:
- xhci_ring_free(xhci, ring);
+ kfree(ring);
return NULL;
}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 067/123] USB: fix endpoint-disabling for failed config changes
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (65 preceding siblings ...)
2013-01-09 20:35 ` [ 066/123] xhci: fix null-pointer dereference when destroying half-built segment rings Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 068/123] usb: host: xhci: Stricter conditional for Z1 system models for Compliance Mode Patch Greg Kroah-Hartman
` (58 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Alan Stern, Sarah Sharp
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <stern@rowland.harvard.edu>
commit 36caff5d795429c572443894e8789c2150dd796b upstream.
This patch (as1631) fixes a bug that shows up when a config change
fails for a device under an xHCI controller. The controller needs to
be told to disable the endpoints that have been enabled for the new
config. The existing code does this, but before storing the
information about which endpoints were enabled! As a result, any
second attempt to install the new config is doomed to fail because
xhci-hcd will refuse to enable an endpoint that is already enabled.
The patch optimistically initializes the new endpoints' device
structures before asking the device to switch to the new config. If
the request fails then the endpoint information is already stored, so
we can use usb_hcd_alloc_bandwidth() to disable the endpoints with no
trouble. The rest of the error path is slightly more complex now; we
have to disable the new interfaces and call put_device() rather than
simply deallocating them.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-and-tested-by: Matthias Schniedermeyer <ms@citd.de>
CC: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/core/message.c | 54 +++++++++++++++++++++++++--------------------
1 file changed, 31 insertions(+), 23 deletions(-)
--- a/drivers/usb/core/message.c
+++ b/drivers/usb/core/message.c
@@ -1806,29 +1806,8 @@ free_interfaces:
goto free_interfaces;
}
- ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
- USB_REQ_SET_CONFIGURATION, 0, configuration, 0,
- NULL, 0, USB_CTRL_SET_TIMEOUT);
- if (ret < 0) {
- /* All the old state is gone, so what else can we do?
- * The device is probably useless now anyway.
- */
- cp = NULL;
- }
-
- dev->actconfig = cp;
- if (!cp) {
- usb_set_device_state(dev, USB_STATE_ADDRESS);
- usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL);
- /* Leave LPM disabled while the device is unconfigured. */
- mutex_unlock(hcd->bandwidth_mutex);
- usb_autosuspend_device(dev);
- goto free_interfaces;
- }
- mutex_unlock(hcd->bandwidth_mutex);
- usb_set_device_state(dev, USB_STATE_CONFIGURED);
-
- /* Initialize the new interface structures and the
+ /*
+ * Initialize the new interface structures and the
* hc/hcd/usbcore interface/endpoint state.
*/
for (i = 0; i < nintf; ++i) {
@@ -1872,6 +1851,35 @@ free_interfaces:
}
kfree(new_interfaces);
+ ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
+ USB_REQ_SET_CONFIGURATION, 0, configuration, 0,
+ NULL, 0, USB_CTRL_SET_TIMEOUT);
+ if (ret < 0 && cp) {
+ /*
+ * All the old state is gone, so what else can we do?
+ * The device is probably useless now anyway.
+ */
+ usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL);
+ for (i = 0; i < nintf; ++i) {
+ usb_disable_interface(dev, cp->interface[i], true);
+ put_device(&cp->interface[i]->dev);
+ cp->interface[i] = NULL;
+ }
+ cp = NULL;
+ }
+
+ dev->actconfig = cp;
+ mutex_unlock(hcd->bandwidth_mutex);
+
+ if (!cp) {
+ usb_set_device_state(dev, USB_STATE_ADDRESS);
+
+ /* Leave LPM disabled while the device is unconfigured. */
+ usb_autosuspend_device(dev);
+ return ret;
+ }
+ usb_set_device_state(dev, USB_STATE_CONFIGURED);
+
if (cp->string == NULL &&
!(dev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS))
cp->string = usb_cache_string(dev, cp->desc.iConfiguration);
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 068/123] usb: host: xhci: Stricter conditional for Z1 system models for Compliance Mode Patch
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (66 preceding siblings ...)
2013-01-09 20:35 ` [ 067/123] USB: fix endpoint-disabling for failed config changes Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 069/123] xhci: Add Lynx Point LP to list of Intel switchable hosts Greg Kroah-Hartman
` (57 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Alexis R. Cortes, Sarah Sharp
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Alexis R. Cortes" <alexis.cortes@ti.com>
commit b0e4e606ff6ff26da0f60826e75577b56ba4e463 upstream.
This minor patch creates a more stricter conditional for the Z1 sytems for applying
the Compliance Mode Patch, this to avoid the quirk to be applied to models that
contain a "Z1" in their dmi product string but are different from Z1 systems.
This patch should be backported to stable kernels as old as 3.2, that
contain the commit 71c731a296f1b08a3724bd1b514b64f1bda87a23 "usb: host:
xhci: Fix Compliance Mode on SN65LVPE502CP Hardware"
Signed-off-by: Alexis R. Cortes <alexis.cortes@ti.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/host/xhci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -480,7 +480,7 @@ static bool compliance_mode_recovery_tim
if (strstr(dmi_product_name, "Z420") ||
strstr(dmi_product_name, "Z620") ||
strstr(dmi_product_name, "Z820") ||
- strstr(dmi_product_name, "Z1"))
+ strstr(dmi_product_name, "Z1 Workstation"))
return true;
return false;
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 069/123] xhci: Add Lynx Point LP to list of Intel switchable hosts
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (67 preceding siblings ...)
2013-01-09 20:35 ` [ 068/123] usb: host: xhci: Stricter conditional for Z1 system models for Compliance Mode Patch Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 070/123] cgroup: cgroup_subsys->fork() should be called after the task is added to css_set Greg Kroah-Hartman
` (56 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Russell Webb, Sarah Sharp
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Russell Webb <russell.webb@linux.intel.com>
commit bb1e5dd7113d2fd178d3af9aca8f480ae0468edf upstream.
Like Lynx Point, Lynx Point LP is also switchable. See
1c12443ab8eba71a658fae4572147e56d1f84f66 for more details.
This patch should be backported to stable kernels as old as 3.0,
that contain commit 69e848c2090aebba5698a1620604c7dccb448684
"Intel xhci: Support EHCI/xHCI port switching."
Signed-off-by: Russell Webb <russell.webb@linux.intel.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/usb/host/ehci-pci.c | 3 ++-
drivers/usb/host/pci-quirks.c | 4 +++-
2 files changed, 5 insertions(+), 2 deletions(-)
--- a/drivers/usb/host/ehci-pci.c
+++ b/drivers/usb/host/ehci-pci.c
@@ -334,7 +334,8 @@ static bool usb_is_intel_switchable_ehci
pdev->vendor == PCI_VENDOR_ID_INTEL &&
(pdev->device == 0x1E26 ||
pdev->device == 0x8C2D ||
- pdev->device == 0x8C26);
+ pdev->device == 0x8C26 ||
+ pdev->device == 0x9C26);
}
static void ehci_enable_xhci_companion(void)
--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -723,6 +723,7 @@ static int handshake(void __iomem *ptr,
}
#define PCI_DEVICE_ID_INTEL_LYNX_POINT_XHCI 0x8C31
+#define PCI_DEVICE_ID_INTEL_LYNX_POINT_LP_XHCI 0x9C31
bool usb_is_intel_ppt_switchable_xhci(struct pci_dev *pdev)
{
@@ -736,7 +737,8 @@ bool usb_is_intel_lpt_switchable_xhci(st
{
return pdev->class == PCI_CLASS_SERIAL_USB_XHCI &&
pdev->vendor == PCI_VENDOR_ID_INTEL &&
- pdev->device == PCI_DEVICE_ID_INTEL_LYNX_POINT_XHCI;
+ (pdev->device == PCI_DEVICE_ID_INTEL_LYNX_POINT_XHCI ||
+ pdev->device == PCI_DEVICE_ID_INTEL_LYNX_POINT_LP_XHCI);
}
bool usb_is_intel_switchable_xhci(struct pci_dev *pdev)
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 070/123] cgroup: cgroup_subsys->fork() should be called after the task is added to css_set
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (68 preceding siblings ...)
2013-01-09 20:35 ` [ 069/123] xhci: Add Lynx Point LP to list of Intel switchable hosts Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 071/123] cgroup: remove incorrect dget/dput() pair in cgroup_create_dir() Greg Kroah-Hartman
` (55 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Tejun Heo, Oleg Nesterov,
Rafael J. Wysocki
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <tj@kernel.org>
commit 5edee61edeaaebafe584f8fb7074c1ef4658596b upstream.
cgroup core has a bug which violates a basic rule about event
notifications - when a new entity needs to be added, you add that to
the notification list first and then make the new entity conform to
the current state. If done in the reverse order, an event happening
inbetween will be lost.
cgroup_subsys->fork() is invoked way before the new task is added to
the css_set. Currently, cgroup_freezer is the only user of ->fork()
and uses it to make new tasks conform to the current state of the
freezer. If FROZEN state is requested while fork is in progress
between cgroup_fork_callbacks() and cgroup_post_fork(), the child
could escape freezing - the cgroup isn't frozen when ->fork() is
called and the freezer couldn't see the new task on the css_set.
This patch moves cgroup_subsys->fork() invocation to
cgroup_post_fork() after the new task is added to the css_set.
cgroup_fork_callbacks() is removed.
Because now a task may be migrated during cgroup_subsys->fork(),
freezer_fork() is updated so that it adheres to the usual RCU locking
and the rather pointless comment on why locking can be different there
is removed (if it doesn't make anything simpler, why even bother?).
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/cgroup.h | 1
kernel/cgroup.c | 62 +++++++++++++++++++++++-------------------------
kernel/cgroup_freezer.c | 13 +++-------
kernel/fork.c | 9 ------
4 files changed, 35 insertions(+), 50 deletions(-)
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -34,7 +34,6 @@ extern int cgroup_lock_is_held(void);
extern bool cgroup_lock_live_group(struct cgroup *cgrp);
extern void cgroup_unlock(void);
extern void cgroup_fork(struct task_struct *p);
-extern void cgroup_fork_callbacks(struct task_struct *p);
extern void cgroup_post_fork(struct task_struct *p);
extern void cgroup_exit(struct task_struct *p, int run_callbacks);
extern int cgroupstats_build(struct cgroupstats *stats,
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -4832,44 +4832,19 @@ void cgroup_fork(struct task_struct *chi
}
/**
- * cgroup_fork_callbacks - run fork callbacks
- * @child: the new task
- *
- * Called on a new task very soon before adding it to the
- * tasklist. No need to take any locks since no-one can
- * be operating on this task.
- */
-void cgroup_fork_callbacks(struct task_struct *child)
-{
- if (need_forkexit_callback) {
- int i;
- for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
- struct cgroup_subsys *ss = subsys[i];
-
- /*
- * forkexit callbacks are only supported for
- * builtin subsystems.
- */
- if (!ss || ss->module)
- continue;
-
- if (ss->fork)
- ss->fork(child);
- }
- }
-}
-
-/**
* cgroup_post_fork - called on a new task after adding it to the task list
* @child: the task in question
*
- * Adds the task to the list running through its css_set if necessary.
- * Has to be after the task is visible on the task list in case we race
- * with the first call to cgroup_iter_start() - to guarantee that the
- * new task ends up on its list.
+ * Adds the task to the list running through its css_set if necessary and
+ * call the subsystem fork() callbacks. Has to be after the task is
+ * visible on the task list in case we race with the first call to
+ * cgroup_iter_start() - to guarantee that the new task ends up on its
+ * list.
*/
void cgroup_post_fork(struct task_struct *child)
{
+ int i;
+
/*
* use_task_css_set_links is set to 1 before we walk the tasklist
* under the tasklist_lock and we read it here after we added the child
@@ -4889,7 +4864,30 @@ void cgroup_post_fork(struct task_struct
task_unlock(child);
write_unlock(&css_set_lock);
}
+
+ /*
+ * Call ss->fork(). This must happen after @child is linked on
+ * css_set; otherwise, @child might change state between ->fork()
+ * and addition to css_set.
+ */
+ if (need_forkexit_callback) {
+ for (i = 0; i < CGROUP_SUBSYS_COUNT; i++) {
+ struct cgroup_subsys *ss = subsys[i];
+
+ /*
+ * fork/exit callbacks are supported only for
+ * builtin subsystems and we don't need further
+ * synchronization as they never go away.
+ */
+ if (!ss || ss->module)
+ continue;
+
+ if (ss->fork)
+ ss->fork(child);
+ }
+ }
}
+
/**
* cgroup_exit - detach cgroup from exiting task
* @tsk: pointer to task_struct of exiting process
--- a/kernel/cgroup_freezer.c
+++ b/kernel/cgroup_freezer.c
@@ -186,23 +186,15 @@ static void freezer_fork(struct task_str
{
struct freezer *freezer;
- /*
- * No lock is needed, since the task isn't on tasklist yet,
- * so it can't be moved to another cgroup, which means the
- * freezer won't be removed and will be valid during this
- * function call. Nevertheless, apply RCU read-side critical
- * section to suppress RCU lockdep false positives.
- */
rcu_read_lock();
freezer = task_freezer(task);
- rcu_read_unlock();
/*
* The root cgroup is non-freezable, so we can skip the
* following check.
*/
if (!freezer->css.cgroup->parent)
- return;
+ goto out;
spin_lock_irq(&freezer->lock);
BUG_ON(freezer->state == CGROUP_FROZEN);
@@ -210,7 +202,10 @@ static void freezer_fork(struct task_str
/* Locking avoids race with FREEZING -> THAWED transitions. */
if (freezer->state == CGROUP_FREEZING)
freeze_task(task);
+
spin_unlock_irq(&freezer->lock);
+out:
+ rcu_read_unlock();
}
/*
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1135,7 +1135,6 @@ static struct task_struct *copy_process(
{
int retval;
struct task_struct *p;
- int cgroup_callbacks_done = 0;
if ((clone_flags & (CLONE_NEWNS|CLONE_FS)) == (CLONE_NEWNS|CLONE_FS))
return ERR_PTR(-EINVAL);
@@ -1393,12 +1392,6 @@ static struct task_struct *copy_process(
INIT_LIST_HEAD(&p->thread_group);
p->task_works = NULL;
- /* Now that the task is set up, run cgroup callbacks if
- * necessary. We need to run them before the task is visible
- * on the tasklist. */
- cgroup_fork_callbacks(p);
- cgroup_callbacks_done = 1;
-
/* Need tasklist lock for parent etc handling! */
write_lock_irq(&tasklist_lock);
@@ -1503,7 +1496,7 @@ bad_fork_cleanup_cgroup:
#endif
if (clone_flags & CLONE_THREAD)
threadgroup_change_end(current);
- cgroup_exit(p, cgroup_callbacks_done);
+ cgroup_exit(p, 0);
delayacct_tsk_free(p);
module_put(task_thread_info(p)->exec_domain->module);
bad_fork_cleanup_count:
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 071/123] cgroup: remove incorrect dget/dput() pair in cgroup_create_dir()
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (69 preceding siblings ...)
2013-01-09 20:35 ` [ 070/123] cgroup: cgroup_subsys->fork() should be called after the task is added to css_set Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 072/123] cgroup_rm_file: dont delete the uncreated files Greg Kroah-Hartman
` (54 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Tejun Heo, Li Zefan
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <tj@kernel.org>
commit 175431635ec09b1d1bba04979b006b99e8305a83 upstream.
cgroup_create_dir() does weird dancing with dentry refcnt. On
success, it gets and then puts it achieving nothing. On failure, it
puts but there isn't no matching get anywhere leading to the following
oops if cgroup_create_file() fails for whatever reason.
------------[ cut here ]------------
kernel BUG at /work/os/work/fs/dcache.c:552!
invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
Modules linked in:
CPU 2
Pid: 697, comm: mkdir Not tainted 3.7.0-rc4-work+ #3 Bochs Bochs
RIP: 0010:[<ffffffff811d9c0c>] [<ffffffff811d9c0c>] dput+0x1dc/0x1e0
RSP: 0018:ffff88001a3ebef8 EFLAGS: 00010246
RAX: 0000000000000000 RBX: ffff88000e5b1ef8 RCX: 0000000000000403
RDX: 0000000000000303 RSI: 2000000000000000 RDI: ffff88000e5b1f58
RBP: ffff88001a3ebf18 R08: ffffffff82c76960 R09: 0000000000000001
R10: ffff880015022080 R11: ffd9bed70f48a041 R12: 00000000ffffffea
R13: 0000000000000001 R14: ffff88000e5b1f58 R15: 00007fff57656d60
FS: 00007ff05fcb3800(0000) GS:ffff88001fd00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000004046f0 CR3: 000000001315f000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process mkdir (pid: 697, threadinfo ffff88001a3ea000, task ffff880015022080)
Stack:
ffff88001a3ebf48 00000000ffffffea 0000000000000001 0000000000000000
ffff88001a3ebf38 ffffffff811cc889 0000000000000001 ffff88000e5b1ef8
ffff88001a3ebf68 ffffffff811d1fc9 ffff8800198d7f18 ffff880019106ef8
Call Trace:
[<ffffffff811cc889>] done_path_create+0x19/0x50
[<ffffffff811d1fc9>] sys_mkdirat+0x59/0x80
[<ffffffff811d2009>] sys_mkdir+0x19/0x20
[<ffffffff81be1e02>] system_call_fastpath+0x16/0x1b
Code: 00 48 8d 90 18 01 00 00 48 89 93 c0 00 00 00 4c 89 a0 18 01 00 00 48 8b 83 a0 00 00 00 83 80 28 01 00 00 01 e8 e6 6f a0 00 eb 92 <0f> 0b 66 90 0f 1f 44 00 00 55 48 89 e5 41 57 41 56 49 89 fe 41
RIP [<ffffffff811d9c0c>] dput+0x1dc/0x1e0
RSP <ffff88001a3ebef8>
---[ end trace 1277bcfd9561ddb0 ]---
Fix it by dropping the unnecessary dget/dput() pair.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Li Zefan <lizefan@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/cgroup.c | 2 --
1 file changed, 2 deletions(-)
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2744,9 +2744,7 @@ static int cgroup_create_dir(struct cgro
dentry->d_fsdata = cgrp;
inc_nlink(parent->d_inode);
rcu_assign_pointer(cgrp->dentry, dentry);
- dget(dentry);
}
- dput(dentry);
return error;
}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 072/123] cgroup_rm_file: dont delete the uncreated files
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (70 preceding siblings ...)
2013-01-09 20:35 ` [ 071/123] cgroup: remove incorrect dget/dput() pair in cgroup_create_dir() Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 073/123] mm/hugetlb: create hugetlb cgroup file in hugetlb_init Greg Kroah-Hartman
` (53 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Gao feng, Li Zefan, Tejun Heo
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gao feng <gaofeng@cn.fujitsu.com>
commit f33fddc2b9573d8359f1007d4bbe5cd587a0c093 upstream.
in cgroup_add_file,when creating files for cgroup,
some of creation may be skipped. So we need to avoid
deleting these uncreated files in cgroup_rm_file,
otherwise the warning msg will be triggered.
"cgroup_addrm_files: failed to remove memory_pressure_enabled, err=-2"
Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Acked-by: Li Zefan <lizefan@huawei.com>
Signed-off-by: Tejun Heo <tj@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/cgroup.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2789,12 +2789,6 @@ static int cgroup_add_file(struct cgroup
simple_xattrs_init(&cft->xattrs);
- /* does @cft->flags tell us to skip creation on @cgrp? */
- if ((cft->flags & CFTYPE_NOT_ON_ROOT) && !cgrp->parent)
- return 0;
- if ((cft->flags & CFTYPE_ONLY_ON_ROOT) && cgrp->parent)
- return 0;
-
if (subsys && !test_bit(ROOT_NOPREFIX, &cgrp->root->flags)) {
strcpy(name, subsys->name);
strcat(name, ".");
@@ -2835,6 +2829,12 @@ static int cgroup_addrm_files(struct cgr
int err, ret = 0;
for (cft = cfts; cft->name[0] != '\0'; cft++) {
+ /* does cft->flags tell us to skip this file on @cgrp? */
+ if ((cft->flags & CFTYPE_NOT_ON_ROOT) && !cgrp->parent)
+ continue;
+ if ((cft->flags & CFTYPE_ONLY_ON_ROOT) && cgrp->parent)
+ continue;
+
if (is_add)
err = cgroup_add_file(cgrp, subsys, cft);
else
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 073/123] mm/hugetlb: create hugetlb cgroup file in hugetlb_init
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (71 preceding siblings ...)
2013-01-09 20:35 ` [ 072/123] cgroup_rm_file: dont delete the uncreated files Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 074/123] staging: drm/omap: Fix include error during make Greg Kroah-Hartman
` (52 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Jianguo Wu, Jiang Liu, Aneesh Kumar K.V,
Michal Hocko, Andrew Morton, Linus Torvalds
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jianguo Wu <wujianguo@huawei.com>
commit 7179e7bf4592ac5a7b30257a7df6259ee81e51da upstream.
Build kernel with CONFIG_HUGETLBFS=y,CONFIG_HUGETLB_PAGE=y and
CONFIG_CGROUP_HUGETLB=y, then specify hugepagesz=xx boot option, system
will fail to boot.
This failure is caused by following code path:
setup_hugepagesz
hugetlb_add_hstate
hugetlb_cgroup_file_init
cgroup_add_cftypes
kzalloc <--slab is *not available* yet
For this path, slab is not available yet, so memory allocated will be
failed, and cause WARN_ON() in hugetlb_cgroup_file_init().
So I move hugetlb_cgroup_file_init() into hugetlb_init().
[akpm@linux-foundation.org: tweak coding-style, remove pointless __init on inlined function]
[akpm@linux-foundation.org: fix warning]
Signed-off-by: Jianguo Wu <wujianguo@huawei.com>
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/hugetlb_cgroup.h | 5 ++---
mm/hugetlb.c | 11 +----------
mm/hugetlb_cgroup.c | 19 +++++++++++++++++--
3 files changed, 20 insertions(+), 15 deletions(-)
--- a/include/linux/hugetlb_cgroup.h
+++ b/include/linux/hugetlb_cgroup.h
@@ -62,7 +62,7 @@ extern void hugetlb_cgroup_uncharge_page
struct page *page);
extern void hugetlb_cgroup_uncharge_cgroup(int idx, unsigned long nr_pages,
struct hugetlb_cgroup *h_cg);
-extern int hugetlb_cgroup_file_init(int idx) __init;
+extern void hugetlb_cgroup_file_init(void) __init;
extern void hugetlb_cgroup_migrate(struct page *oldhpage,
struct page *newhpage);
@@ -111,9 +111,8 @@ hugetlb_cgroup_uncharge_cgroup(int idx,
return;
}
-static inline int __init hugetlb_cgroup_file_init(int idx)
+static inline void hugetlb_cgroup_file_init(void)
{
- return 0;
}
static inline void hugetlb_cgroup_migrate(struct page *oldhpage,
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1906,14 +1906,12 @@ static int __init hugetlb_init(void)
default_hstate.max_huge_pages = default_hstate_max_huge_pages;
hugetlb_init_hstates();
-
gather_bootmem_prealloc();
-
report_hugepages();
hugetlb_sysfs_init();
-
hugetlb_register_all_nodes();
+ hugetlb_cgroup_file_init();
return 0;
}
@@ -1943,13 +1941,6 @@ void __init hugetlb_add_hstate(unsigned
h->next_nid_to_free = first_node(node_states[N_HIGH_MEMORY]);
snprintf(h->name, HSTATE_NAME_LEN, "hugepages-%lukB",
huge_page_size(h)/1024);
- /*
- * Add cgroup control files only if the huge page consists
- * of more than two normal pages. This is because we use
- * page[2].lru.next for storing cgoup details.
- */
- if (order >= HUGETLB_CGROUP_MIN_ORDER)
- hugetlb_cgroup_file_init(hugetlb_max_hstate - 1);
parsed_hstate = h;
}
--- a/mm/hugetlb_cgroup.c
+++ b/mm/hugetlb_cgroup.c
@@ -340,7 +340,7 @@ static char *mem_fmt(char *buf, int size
return buf;
}
-int __init hugetlb_cgroup_file_init(int idx)
+static void __init __hugetlb_cgroup_file_init(int idx)
{
char buf[32];
struct cftype *cft;
@@ -382,7 +382,22 @@ int __init hugetlb_cgroup_file_init(int
WARN_ON(cgroup_add_cftypes(&hugetlb_subsys, h->cgroup_files));
- return 0;
+ return;
+}
+
+void __init hugetlb_cgroup_file_init(void)
+{
+ struct hstate *h;
+
+ for_each_hstate(h) {
+ /*
+ * Add cgroup control files only if the huge page consists
+ * of more than two normal pages. This is because we use
+ * page[2].lru.next for storing cgroup details.
+ */
+ if (huge_page_order(h) >= HUGETLB_CGROUP_MIN_ORDER)
+ __hugetlb_cgroup_file_init(hstate_index(h));
+ }
}
/*
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 074/123] staging: drm/omap: Fix include error during make
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (72 preceding siblings ...)
2013-01-09 20:35 ` [ 073/123] mm/hugetlb: create hugetlb cgroup file in hugetlb_init Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 075/123] SMB3 mounts fail with access denied to some servers Greg Kroah-Hartman
` (51 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Andy Gross
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Gross <andy.gross@ti.com>
commit b9ed9f0ecf1b5675c64d069e9b53effe276b6f01 upstream.
Fixed include error for drm_mode.h
Signed-off-by: Andy Gross <andy.gross@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/staging/omapdrm/omap_crtc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/drivers/staging/omapdrm/omap_crtc.c
+++ b/drivers/staging/omapdrm/omap_crtc.c
@@ -19,7 +19,7 @@
#include "omap_drv.h"
-#include "drm_mode.h"
+#include <drm/drm_mode.h>
#include "drm_crtc.h"
#include "drm_crtc_helper.h"
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 075/123] SMB3 mounts fail with access denied to some servers
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (73 preceding siblings ...)
2013-01-09 20:35 ` [ 074/123] staging: drm/omap: Fix include error during make Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 076/123] freezer: add missing mbs to freezer_count() and freezer_should_skip() Greg Kroah-Hartman
` (50 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Steve French, Jeff Layton
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steve French <smfrench@gmail.com>
commit 52c0f4ad8ed462d81f1d37f56a74a71dc0c9bf0f upstream.
We were checking incorrectly if signatures were required to be sent,
so were always sending signatures after the initial session establishment.
For SMB3 mounts (vers=3.0) this was a problem because we were putting
SMB2 signatures in SMB3 requests which would cause access denied
on mount (the tree connection would fail).
This might also be worth considering for stable (for 3.7), as the
error message on mount (access denied) is confusing to users and
there is no workaround if the server is configured to only
support smb3.0. I am ok either way.
Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/cifs/smb2pdu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -425,7 +425,7 @@ SMB2_negotiate(const unsigned int xid, s
}
cFYI(1, "sec_flags 0x%x", sec_flags);
- if (sec_flags & CIFSSEC_MUST_SIGN) {
+ if ((sec_flags & CIFSSEC_MUST_SIGN) == CIFSSEC_MUST_SIGN) {
cFYI(1, "Signing required");
if (!(server->sec_mode & (SMB2_NEGOTIATE_SIGNING_REQUIRED |
SMB2_NEGOTIATE_SIGNING_ENABLED))) {
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 076/123] freezer: add missing mbs to freezer_count() and freezer_should_skip()
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (74 preceding siblings ...)
2013-01-09 20:35 ` [ 075/123] SMB3 mounts fail with access denied to some servers Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 077/123] sparc: huge_ptep_set_* functions need to call set_huge_pte_at() Greg Kroah-Hartman
` (49 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Tejun Heo, Oleg Nesterov,
Rafael J. Wysocki
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejun Heo <tj@kernel.org>
commit dd67d32dbc5de299d70cc9e10c6c1e29ffa56b92 upstream.
A task is considered frozen enough between freezer_do_not_count() and
freezer_count() and freezers use freezer_should_skip() to test this
condition. This supposedly works because freezer_count() always calls
try_to_freezer() after clearing %PF_FREEZER_SKIP.
However, there currently is nothing which guarantees that
freezer_count() sees %true freezing() after clearing %PF_FREEZER_SKIP
when freezing is in progress, and vice-versa. A task can escape the
freezing condition in effect by freezer_count() seeing !freezing() and
freezer_should_skip() seeing %PF_FREEZER_SKIP.
This patch adds smp_mb()'s to freezer_count() and
freezer_should_skip() such that either %true freezing() is visible to
freezer_count() or !PF_FREEZER_SKIP is visible to
freezer_should_skip().
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/freezer.h | 50 ++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 42 insertions(+), 8 deletions(-)
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -75,28 +75,62 @@ static inline bool cgroup_freezing(struc
*/
-/* Tell the freezer not to count the current task as freezable. */
+/**
+ * freezer_do_not_count - tell freezer to ignore %current
+ *
+ * Tell freezers to ignore the current task when determining whether the
+ * target frozen state is reached. IOW, the current task will be
+ * considered frozen enough by freezers.
+ *
+ * The caller shouldn't do anything which isn't allowed for a frozen task
+ * until freezer_cont() is called. Usually, freezer[_do_not]_count() pair
+ * wrap a scheduling operation and nothing much else.
+ */
static inline void freezer_do_not_count(void)
{
current->flags |= PF_FREEZER_SKIP;
}
-/*
- * Tell the freezer to count the current task as freezable again and try to
- * freeze it.
+/**
+ * freezer_count - tell freezer to stop ignoring %current
+ *
+ * Undo freezer_do_not_count(). It tells freezers that %current should be
+ * considered again and tries to freeze if freezing condition is already in
+ * effect.
*/
static inline void freezer_count(void)
{
current->flags &= ~PF_FREEZER_SKIP;
+ /*
+ * If freezing is in progress, the following paired with smp_mb()
+ * in freezer_should_skip() ensures that either we see %true
+ * freezing() or freezer_should_skip() sees !PF_FREEZER_SKIP.
+ */
+ smp_mb();
try_to_freeze();
}
-/*
- * Check if the task should be counted as freezable by the freezer
+/**
+ * freezer_should_skip - whether to skip a task when determining frozen
+ * state is reached
+ * @p: task in quesion
+ *
+ * This function is used by freezers after establishing %true freezing() to
+ * test whether a task should be skipped when determining the target frozen
+ * state is reached. IOW, if this function returns %true, @p is considered
+ * frozen enough.
*/
-static inline int freezer_should_skip(struct task_struct *p)
+static inline bool freezer_should_skip(struct task_struct *p)
{
- return !!(p->flags & PF_FREEZER_SKIP);
+ /*
+ * The following smp_mb() paired with the one in freezer_count()
+ * ensures that either freezer_count() sees %true freezing() or we
+ * see cleared %PF_FREEZER_SKIP and return %false. This makes it
+ * impossible for a task to slip frozen state testing after
+ * clearing %PF_FREEZER_SKIP.
+ */
+ smp_mb();
+ return p->flags & PF_FREEZER_SKIP;
}
/*
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 077/123] sparc: huge_ptep_set_* functions need to call set_huge_pte_at()
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (75 preceding siblings ...)
2013-01-09 20:35 ` [ 076/123] freezer: add missing mbs to freezer_count() and freezer_should_skip() Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 078/123] sparc64: Fix unrolled AES 256-bit key loops Greg Kroah-Hartman
` (48 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Dave Kleikamp, David S. Miller,
sparclinux
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Kleikamp <dave.kleikamp@oracle.com>
[ Upstream commit 6cb9c3697585c47977c42c5cc1b9fc49247ac530 ]
Modifying the huge pte's requires that all the underlying pte's be
modified.
Version 2: added missing flush_tlb_page()
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/sparc/include/asm/hugetlb.h | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
--- a/arch/sparc/include/asm/hugetlb.h
+++ b/arch/sparc/include/asm/hugetlb.h
@@ -61,14 +61,20 @@ static inline pte_t huge_pte_wrprotect(p
static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
unsigned long addr, pte_t *ptep)
{
- ptep_set_wrprotect(mm, addr, ptep);
+ pte_t old_pte = *ptep;
+ set_huge_pte_at(mm, addr, ptep, pte_wrprotect(old_pte));
}
static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
unsigned long addr, pte_t *ptep,
pte_t pte, int dirty)
{
- return ptep_set_access_flags(vma, addr, ptep, pte, dirty);
+ int changed = !pte_same(*ptep, pte);
+ if (changed) {
+ set_huge_pte_at(vma->vm_mm, addr, ptep, pte);
+ flush_tlb_page(vma, addr);
+ }
+ return changed;
}
static inline pte_t huge_ptep_get(pte_t *ptep)
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 078/123] sparc64: Fix unrolled AES 256-bit key loops.
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (76 preceding siblings ...)
2013-01-09 20:35 ` [ 077/123] sparc: huge_ptep_set_* functions need to call set_huge_pte_at() Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 079/123] sparc64: Fix AES ctr mode block size Greg Kroah-Hartman
` (47 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, David S. Miller
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: "David S. Miller" <davem@davemloft.net>
[ Upstream commit 9f28ffc03e93343ac04874fda9edb7affea45165 ]
The basic scheme of the block mode assembler is that we start by
enabling the FPU, loading the key into the floating point registers,
then iterate calling the encrypt/decrypt routine for each block.
For the 256-bit key cases, we run short on registers in the unrolled
loops.
So the {ENCRYPT,DECRYPT}_256_2() macros reload the key registers that
get clobbered.
The unrolled macros, {ENCRYPT,DECRYPT}_256(), are not mindful of this.
So if we have a mix of multi-block and single-block calls, the
single-block unrolled 256-bit encrypt/decrypt can run with some
of the key registers clobbered.
Handle this by always explicitly loading those registers before using
the non-unrolled 256-bit macro.
This was discovered thanks to all of the new test cases added by
Jussi Kivilinna.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/sparc/crypto/aes_asm.S | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
--- a/arch/sparc/crypto/aes_asm.S
+++ b/arch/sparc/crypto/aes_asm.S
@@ -1024,7 +1024,11 @@ ENTRY(aes_sparc64_ecb_encrypt_256)
add %o2, 0x20, %o2
brlz,pt %o3, 11f
nop
-10: ldx [%o1 + 0x00], %g3
+10: ldd [%o0 + 0xd0], %f56
+ ldd [%o0 + 0xd8], %f58
+ ldd [%o0 + 0xe0], %f60
+ ldd [%o0 + 0xe8], %f62
+ ldx [%o1 + 0x00], %g3
ldx [%o1 + 0x08], %g7
xor %g1, %g3, %g3
xor %g2, %g7, %g7
@@ -1128,9 +1132,9 @@ ENTRY(aes_sparc64_ecb_decrypt_256)
/* %o0=&key[key_len], %o1=input, %o2=output, %o3=len */
ldx [%o0 - 0x10], %g1
subcc %o3, 0x10, %o3
+ ldx [%o0 - 0x08], %g2
be 10f
- ldx [%o0 - 0x08], %g2
- sub %o0, 0xf0, %o0
+ sub %o0, 0xf0, %o0
1: ldx [%o1 + 0x00], %g3
ldx [%o1 + 0x08], %g7
ldx [%o1 + 0x10], %o4
@@ -1154,7 +1158,11 @@ ENTRY(aes_sparc64_ecb_decrypt_256)
add %o2, 0x20, %o2
brlz,pt %o3, 11f
nop
-10: ldx [%o1 + 0x00], %g3
+10: ldd [%o0 + 0x18], %f56
+ ldd [%o0 + 0x10], %f58
+ ldd [%o0 + 0x08], %f60
+ ldd [%o0 + 0x00], %f62
+ ldx [%o1 + 0x00], %g3
ldx [%o1 + 0x08], %g7
xor %g1, %g3, %g3
xor %g2, %g7, %g7
@@ -1511,11 +1519,11 @@ ENTRY(aes_sparc64_ctr_crypt_256)
add %o2, 0x20, %o2
brlz,pt %o3, 11f
nop
- ldd [%o0 + 0xd0], %f56
+10: ldd [%o0 + 0xd0], %f56
ldd [%o0 + 0xd8], %f58
ldd [%o0 + 0xe0], %f60
ldd [%o0 + 0xe8], %f62
-10: xor %g1, %g3, %o5
+ xor %g1, %g3, %o5
MOVXTOD_O5_F0
xor %g2, %g7, %o5
MOVXTOD_O5_F2
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 079/123] sparc64: Fix AES ctr mode block size.
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (77 preceding siblings ...)
2013-01-09 20:35 ` [ 078/123] sparc64: Fix unrolled AES 256-bit key loops Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 080/123] sparc64: Set CRYPTO_TFM_REQ_MAY_SLEEP consistently in AES code Greg Kroah-Hartman
` (46 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, David S. Miller
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: "David S. Miller" <davem@davemloft.net>
[ Upstream commit a8d97cef2168ffe5af1aeed6bf6cdc3ce53f3d0b ]
Like the generic versions, we need to support a block size
of '1' for CTR mode AES.
This was discovered thanks to all of the new test cases added by
Jussi Kivilinna.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/sparc/crypto/aes_glue.c | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
--- a/arch/sparc/crypto/aes_glue.c
+++ b/arch/sparc/crypto/aes_glue.c
@@ -329,6 +329,22 @@ static int cbc_decrypt(struct blkcipher_
return err;
}
+static void ctr_crypt_final(struct crypto_sparc64_aes_ctx *ctx,
+ struct blkcipher_walk *walk)
+{
+ u8 *ctrblk = walk->iv;
+ u64 keystream[AES_BLOCK_SIZE / sizeof(u64)];
+ u8 *src = walk->src.virt.addr;
+ u8 *dst = walk->dst.virt.addr;
+ unsigned int nbytes = walk->nbytes;
+
+ ctx->ops->ecb_encrypt(&ctx->key[0], (const u64 *)ctrblk,
+ keystream, AES_BLOCK_SIZE);
+ crypto_xor((u8 *) keystream, src, nbytes);
+ memcpy(dst, keystream, nbytes);
+ crypto_inc(ctrblk, AES_BLOCK_SIZE);
+}
+
static int ctr_crypt(struct blkcipher_desc *desc,
struct scatterlist *dst, struct scatterlist *src,
unsigned int nbytes)
@@ -338,10 +354,11 @@ static int ctr_crypt(struct blkcipher_de
int err;
blkcipher_walk_init(&walk, dst, src, nbytes);
- err = blkcipher_walk_virt(desc, &walk);
+ err = blkcipher_walk_virt_block(desc, &walk, AES_BLOCK_SIZE);
+ desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
ctx->ops->load_encrypt_keys(&ctx->key[0]);
- while ((nbytes = walk.nbytes)) {
+ while ((nbytes = walk.nbytes) >= AES_BLOCK_SIZE) {
unsigned int block_len = nbytes & AES_BLOCK_MASK;
if (likely(block_len)) {
@@ -353,6 +370,10 @@ static int ctr_crypt(struct blkcipher_de
nbytes &= AES_BLOCK_SIZE - 1;
err = blkcipher_walk_done(desc, &walk, nbytes);
}
+ if (walk.nbytes) {
+ ctr_crypt_final(ctx, &walk);
+ err = blkcipher_walk_done(desc, &walk, 0);
+ }
fprs_write(0);
return err;
}
@@ -418,7 +439,7 @@ static struct crypto_alg algs[] = { {
.cra_driver_name = "ctr-aes-sparc64",
.cra_priority = SPARC_CR_OPCODE_PRIORITY,
.cra_flags = CRYPTO_ALG_TYPE_BLKCIPHER,
- .cra_blocksize = AES_BLOCK_SIZE,
+ .cra_blocksize = 1,
.cra_ctxsize = sizeof(struct crypto_sparc64_aes_ctx),
.cra_alignmask = 7,
.cra_type = &crypto_blkcipher_type,
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 080/123] sparc64: Set CRYPTO_TFM_REQ_MAY_SLEEP consistently in AES code.
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (78 preceding siblings ...)
2013-01-09 20:35 ` [ 079/123] sparc64: Fix AES ctr mode block size Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 081/123] sparc64: Fix ECB looping constructs " Greg Kroah-Hartman
` (45 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, David S. Miller
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: "David S. Miller" <davem@davemloft.net>
[ Upstream commit b35d282ef7345320b594d48d8d70caedfa962a01 ]
We use the FPU and therefore cannot sleep during the crypto
loops.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/sparc/crypto/aes_glue.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/arch/sparc/crypto/aes_glue.c
+++ b/arch/sparc/crypto/aes_glue.c
@@ -222,6 +222,7 @@ static int ecb_encrypt(struct blkcipher_
blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk);
+ desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
ctx->ops->load_encrypt_keys(&ctx->key[0]);
while ((nbytes = walk.nbytes)) {
@@ -251,6 +252,7 @@ static int ecb_decrypt(struct blkcipher_
blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk);
+ desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
ctx->ops->load_decrypt_keys(&ctx->key[0]);
key_end = &ctx->key[ctx->expanded_key_length / sizeof(u64)];
@@ -280,6 +282,7 @@ static int cbc_encrypt(struct blkcipher_
blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk);
+ desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
ctx->ops->load_encrypt_keys(&ctx->key[0]);
while ((nbytes = walk.nbytes)) {
@@ -309,6 +312,7 @@ static int cbc_decrypt(struct blkcipher_
blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk);
+ desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
ctx->ops->load_decrypt_keys(&ctx->key[0]);
key_end = &ctx->key[ctx->expanded_key_length / sizeof(u64)];
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 081/123] sparc64: Fix ECB looping constructs in AES code.
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (79 preceding siblings ...)
2013-01-09 20:35 ` [ 080/123] sparc64: Set CRYPTO_TFM_REQ_MAY_SLEEP consistently in AES code Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 082/123] sparc64: Set CRYPTO_TFM_REQ_MAY_SLEEP consistently in DES code Greg Kroah-Hartman
` (44 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, David S. Miller
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: "David S. Miller" <davem@davemloft.net>
[ Upstream commit ce6889515d5d481a5bd8ce5913dfed18f08310ea ]
Things works better when you increment the source buffer pointer
properly.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/sparc/crypto/des_asm.S | 1 +
1 file changed, 1 insertion(+)
--- a/arch/sparc/crypto/des_asm.S
+++ b/arch/sparc/crypto/des_asm.S
@@ -376,6 +376,7 @@ ENTRY(des3_ede_sparc64_ecb_crypt)
1: ldd [%o1 + 0x00], %f60
DES3_LOOP_BODY(60)
std %f60, [%o2 + 0x00]
+ add %o1, 0x08, %o1
subcc %o3, 0x08, %o3
bne,pt %icc, 1b
add %o2, 0x08, %o2
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 082/123] sparc64: Set CRYPTO_TFM_REQ_MAY_SLEEP consistently in DES code.
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (80 preceding siblings ...)
2013-01-09 20:35 ` [ 081/123] sparc64: Fix ECB looping constructs " Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 083/123] sparc64: Set CRYPTO_TFM_REQ_MAY_SLEEP consistently in CAMELLIA code Greg Kroah-Hartman
` (43 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, David S. Miller
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: "David S. Miller" <davem@davemloft.net>
[ Upstream commit b3a37947074fa0a488d6c7ede58125b2278ab4e8 ]
We use the FPU and therefore cannot sleep during the crypto
loops.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/sparc/crypto/des_glue.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/arch/sparc/crypto/des_glue.c
+++ b/arch/sparc/crypto/des_glue.c
@@ -100,6 +100,7 @@ static int __ecb_crypt(struct blkcipher_
blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk);
+ desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
if (encrypt)
des_sparc64_load_keys(&ctx->encrypt_expkey[0]);
@@ -147,6 +148,7 @@ static int cbc_encrypt(struct blkcipher_
blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk);
+ desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
des_sparc64_load_keys(&ctx->encrypt_expkey[0]);
while ((nbytes = walk.nbytes)) {
@@ -177,6 +179,7 @@ static int cbc_decrypt(struct blkcipher_
blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk);
+ desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
des_sparc64_load_keys(&ctx->decrypt_expkey[0]);
while ((nbytes = walk.nbytes)) {
@@ -266,6 +269,7 @@ static int __ecb3_crypt(struct blkcipher
blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk);
+ desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
if (encrypt)
K = &ctx->encrypt_expkey[0];
@@ -317,6 +321,7 @@ static int cbc3_encrypt(struct blkcipher
blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk);
+ desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
K = &ctx->encrypt_expkey[0];
des3_ede_sparc64_load_keys(K);
@@ -352,6 +357,7 @@ static int cbc3_decrypt(struct blkcipher
blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk);
+ desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
K = &ctx->decrypt_expkey[0];
des3_ede_sparc64_load_keys(K);
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 083/123] sparc64: Set CRYPTO_TFM_REQ_MAY_SLEEP consistently in CAMELLIA code.
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (81 preceding siblings ...)
2013-01-09 20:35 ` [ 082/123] sparc64: Set CRYPTO_TFM_REQ_MAY_SLEEP consistently in DES code Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 084/123] batman-adv: fix random jitter calculation Greg Kroah-Hartman
` (42 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, David S. Miller
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: "David S. Miller" <davem@davemloft.net>
[ Upstream commit 62ba63dc892cf836ecb9ce4fdb7644d45c95070b ]
We use the FPU and therefore cannot sleep during the crypto
loops.
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/sparc/crypto/camellia_glue.c | 3 +++
1 file changed, 3 insertions(+)
--- a/arch/sparc/crypto/camellia_glue.c
+++ b/arch/sparc/crypto/camellia_glue.c
@@ -98,6 +98,7 @@ static int __ecb_crypt(struct blkcipher_
blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk);
+ desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
if (encrypt)
key = &ctx->encrypt_key[0];
@@ -160,6 +161,7 @@ static int cbc_encrypt(struct blkcipher_
blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk);
+ desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
key = &ctx->encrypt_key[0];
camellia_sparc64_load_keys(key, ctx->key_len);
@@ -198,6 +200,7 @@ static int cbc_decrypt(struct blkcipher_
blkcipher_walk_init(&walk, dst, src, nbytes);
err = blkcipher_walk_virt(desc, &walk);
+ desc->flags &= ~CRYPTO_TFM_REQ_MAY_SLEEP;
key = &ctx->decrypt_key[0];
camellia_sparc64_load_keys(key, ctx->key_len);
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 084/123] batman-adv: fix random jitter calculation
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (82 preceding siblings ...)
2013-01-09 20:35 ` [ 083/123] sparc64: Set CRYPTO_TFM_REQ_MAY_SLEEP consistently in CAMELLIA code Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 085/123] inet: Fix kmemleak in tcp_v4/6_syn_recv_sock and dccp_v4/6_request_recv_sock Greg Kroah-Hartman
` (41 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Akinobu Mita, Antonio Quartulli,
Marek Lindner, Simon Wunderlich, David S. Miller, b.a.t.m.a.n,
netdev
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Akinobu Mita <akinobu.mita@gmail.com>
[ Upstream commit 143cdd8f33909ff5a153e3f02048738c5964ba26 ]
batadv_iv_ogm_emit_send_time() attempts to calculates a random integer
in the range of 'orig_interval +- BATADV_JITTER' by the below lines.
msecs = atomic_read(&bat_priv->orig_interval) - BATADV_JITTER;
msecs += (random32() % 2 * BATADV_JITTER);
But it actually gets 'orig_interval' or 'orig_interval - BATADV_JITTER'
because '%' and '*' have same precedence and associativity is
left-to-right.
This adds the parentheses at the appropriate position so that it matches
original intension.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Antonio Quartulli <ordex@autistici.org>
Cc: Marek Lindner <lindner_marek@yahoo.de>
Cc: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Cc: Antonio Quartulli <ordex@autistici.org>
Cc: b.a.t.m.a.n@lists.open-mesh.org
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/batman-adv/bat_iv_ogm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -119,7 +119,7 @@ batadv_iv_ogm_emit_send_time(const struc
unsigned int msecs;
msecs = atomic_read(&bat_priv->orig_interval) - BATADV_JITTER;
- msecs += (random32() % 2 * BATADV_JITTER);
+ msecs += random32() % (2 * BATADV_JITTER);
return jiffies + msecs_to_jiffies(msecs);
}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 085/123] inet: Fix kmemleak in tcp_v4/6_syn_recv_sock and dccp_v4/6_request_recv_sock
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (83 preceding siblings ...)
2013-01-09 20:35 ` [ 084/123] batman-adv: fix random jitter calculation Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 086/123] ipv6: Change skb->data before using icmpv6_notify() to propagate redirect Greg Kroah-Hartman
` (40 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Christoph Paasch, David S. Miller
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoph Paasch <christoph.paasch@uclouvain.be>
[ Upstream commit e337e24d6624e74a558aa69071e112a65f7b5758 ]
If in either of the above functions inet_csk_route_child_sock() or
__inet_inherit_port() fails, the newsk will not be freed:
unreferenced object 0xffff88022e8a92c0 (size 1592):
comm "softirq", pid 0, jiffies 4294946244 (age 726.160s)
hex dump (first 32 bytes):
0a 01 01 01 0a 01 01 02 00 00 00 00 a7 cc 16 00 ................
02 00 03 01 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff8153d190>] kmemleak_alloc+0x21/0x3e
[<ffffffff810ab3e7>] kmem_cache_alloc+0xb5/0xc5
[<ffffffff8149b65b>] sk_prot_alloc.isra.53+0x2b/0xcd
[<ffffffff8149b784>] sk_clone_lock+0x16/0x21e
[<ffffffff814d711a>] inet_csk_clone_lock+0x10/0x7b
[<ffffffff814ebbc3>] tcp_create_openreq_child+0x21/0x481
[<ffffffff814e8fa5>] tcp_v4_syn_recv_sock+0x3a/0x23b
[<ffffffff814ec5ba>] tcp_check_req+0x29f/0x416
[<ffffffff814e8e10>] tcp_v4_do_rcv+0x161/0x2bc
[<ffffffff814eb917>] tcp_v4_rcv+0x6c9/0x701
[<ffffffff814cea9f>] ip_local_deliver_finish+0x70/0xc4
[<ffffffff814cec20>] ip_local_deliver+0x4e/0x7f
[<ffffffff814ce9f8>] ip_rcv_finish+0x1fc/0x233
[<ffffffff814cee68>] ip_rcv+0x217/0x267
[<ffffffff814a7bbe>] __netif_receive_skb+0x49e/0x553
[<ffffffff814a7cc3>] netif_receive_skb+0x50/0x82
This happens, because sk_clone_lock initializes sk_refcnt to 2, and thus
a single sock_put() is not enough to free the memory. Additionally, things
like xfrm, memcg, cookie_values,... may have been initialized.
We have to free them properly.
This is fixed by forcing a call to tcp_done(), ending up in
inet_csk_destroy_sock, doing the final sock_put(). tcp_done() is necessary,
because it ends up doing all the cleanup on xfrm, memcg, cookie_values,
xfrm,...
Before calling tcp_done, we have to set the socket to SOCK_DEAD, to
force it entering inet_csk_destroy_sock. To avoid the warning in
inet_csk_destroy_sock, inet_num has to be set to 0.
As inet_csk_destroy_sock does a dec on orphan_count, we first have to
increase it.
Calling tcp_done() allows us to remove the calls to
tcp_clear_xmit_timer() and tcp_cleanup_congestion_control().
A similar approach is taken for dccp by calling dccp_done().
This is in the kernel since 093d282321 (tproxy: fix hash locking issue
when using port redirection in __inet_inherit_port()), thus since
version >= 2.6.37.
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/net/inet_connection_sock.h | 1 +
net/dccp/ipv4.c | 4 ++--
net/dccp/ipv6.c | 3 ++-
net/ipv4/inet_connection_sock.c | 16 ++++++++++++++++
net/ipv4/tcp_ipv4.c | 6 ++----
net/ipv6/tcp_ipv6.c | 3 ++-
6 files changed, 25 insertions(+), 8 deletions(-)
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
@@ -318,6 +318,7 @@ extern void inet_csk_reqsk_queue_prune(s
const unsigned long max_rto);
extern void inet_csk_destroy_sock(struct sock *sk);
+extern void inet_csk_prepare_forced_close(struct sock *sk);
/*
* LISTEN is a special case for poll..
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -439,8 +439,8 @@ exit:
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS);
return NULL;
put_and_exit:
- bh_unlock_sock(newsk);
- sock_put(newsk);
+ inet_csk_prepare_forced_close(newsk);
+ dccp_done(newsk);
goto exit;
}
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -585,7 +585,8 @@ static struct sock *dccp_v6_request_recv
newinet->inet_rcv_saddr = LOOPBACK4_IPV6;
if (__inet_inherit_port(sk, newsk) < 0) {
- sock_put(newsk);
+ inet_csk_prepare_forced_close(newsk);
+ dccp_done(newsk);
goto out;
}
__inet6_hash(newsk, NULL);
--- a/net/ipv4/inet_connection_sock.c
+++ b/net/ipv4/inet_connection_sock.c
@@ -699,6 +699,22 @@ void inet_csk_destroy_sock(struct sock *
}
EXPORT_SYMBOL(inet_csk_destroy_sock);
+/* This function allows to force a closure of a socket after the call to
+ * tcp/dccp_create_openreq_child().
+ */
+void inet_csk_prepare_forced_close(struct sock *sk)
+{
+ /* sk_clone_lock locked the socket and set refcnt to 2 */
+ bh_unlock_sock(sk);
+ sock_put(sk);
+
+ /* The below has to be done to allow calling inet_csk_destroy_sock */
+ sock_set_flag(sk, SOCK_DEAD);
+ percpu_counter_inc(sk->sk_prot->orphan_count);
+ inet_sk(sk)->inet_num = 0;
+}
+EXPORT_SYMBOL(inet_csk_prepare_forced_close);
+
int inet_csk_listen_start(struct sock *sk, const int nr_table_entries)
{
struct inet_sock *inet = inet_sk(sk);
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1774,10 +1774,8 @@ exit:
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_LISTENDROPS);
return NULL;
put_and_exit:
- tcp_clear_xmit_timers(newsk);
- tcp_cleanup_congestion_control(newsk);
- bh_unlock_sock(newsk);
- sock_put(newsk);
+ inet_csk_prepare_forced_close(newsk);
+ tcp_done(newsk);
goto exit;
}
EXPORT_SYMBOL(tcp_v4_syn_recv_sock);
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1384,7 +1384,8 @@ static struct sock * tcp_v6_syn_recv_soc
#endif
if (__inet_inherit_port(sk, newsk) < 0) {
- sock_put(newsk);
+ inet_csk_prepare_forced_close(newsk);
+ tcp_done(newsk);
goto out;
}
__inet6_hash(newsk, NULL);
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 086/123] ipv6: Change skb->data before using icmpv6_notify() to propagate redirect
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (84 preceding siblings ...)
2013-01-09 20:35 ` [ 085/123] inet: Fix kmemleak in tcp_v4/6_syn_recv_sock and dccp_v4/6_request_recv_sock Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 087/123] mac802154: fix NOHZ local_softirq_pending 08 warning Greg Kroah-Hartman
` (39 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Duan Jiong, David S. Miller
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Duan Jiong <djduanjiong@gmail.com>
[ Upstream commit 093d04d42fa094f6740bb188f0ad0c215ff61e2c ]
In function ndisc_redirect_rcv(), the skb->data points to the transport
header, but function icmpv6_notify() need the skb->data points to the
inner IP packet. So before using icmpv6_notify() to propagate redirect,
change skb->data to point the inner IP packet that triggered the sending
of the Redirect, and introduce struct rd_msg to make it easy.
Signed-off-by: Duan Jiong <djduanjiong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/net/ndisc.h | 7 +++++++
net/ipv6/ndisc.c | 17 +++++++++++++++++
2 files changed, 24 insertions(+)
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -78,6 +78,13 @@ struct ra_msg {
__be32 retrans_timer;
};
+struct rd_msg {
+ struct icmp6hdr icmph;
+ struct in6_addr target;
+ struct in6_addr dest;
+ __u8 opt[0];
+};
+
struct nd_opt_hdr {
__u8 nd_opt_type;
__u8 nd_opt_len;
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1333,6 +1333,12 @@ out:
static void ndisc_redirect_rcv(struct sk_buff *skb)
{
+ u8 *hdr;
+ struct ndisc_options ndopts;
+ struct rd_msg *msg = (struct rd_msg *)skb_transport_header(skb);
+ u32 ndoptlen = skb->tail - (skb->transport_header +
+ offsetof(struct rd_msg, opt));
+
#ifdef CONFIG_IPV6_NDISC_NODETYPE
switch (skb->ndisc_nodetype) {
case NDISC_NODETYPE_HOST:
@@ -1349,6 +1355,17 @@ static void ndisc_redirect_rcv(struct sk
return;
}
+ if (!ndisc_parse_options(msg->opt, ndoptlen, &ndopts))
+ return;
+
+ if (!ndopts.nd_opts_rh)
+ return;
+
+ hdr = (u8 *)ndopts.nd_opts_rh;
+ hdr += 8;
+ if (!pskb_pull(skb, hdr - skb_transport_header(skb)))
+ return;
+
icmpv6_notify(skb, NDISC_REDIRECT, 0, 0);
}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 087/123] mac802154: fix NOHZ local_softirq_pending 08 warning
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (85 preceding siblings ...)
2013-01-09 20:35 ` [ 086/123] ipv6: Change skb->data before using icmpv6_notify() to propagate redirect Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 088/123] net: sched: integer overflow fix Greg Kroah-Hartman
` (38 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Alexander Aring, David S. Miller
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Aring <alex.aring@googlemail.com>
[ Upstream commit 5ff3fec6d3fc848753c2fa30b18607358f89a202 ]
When using nanosleep() in an userspace application we get a
ratelimit warning
NOHZ: local_softirq_pending 08
for 10 times.
This patch replaces netif_rx() with netif_rx_ni() which has
to be used from process/softirq context.
The process/softirq context will be called from fakelb driver.
See linux-kernel commit 481a819 for similar fix.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/mac802154/wpan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/mac802154/wpan.c
+++ b/net/mac802154/wpan.c
@@ -387,7 +387,7 @@ void mac802154_wpan_setup(struct net_dev
static int mac802154_process_data(struct net_device *dev, struct sk_buff *skb)
{
- return netif_rx(skb);
+ return netif_rx_ni(skb);
}
static int
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 088/123] net: sched: integer overflow fix
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (86 preceding siblings ...)
2013-01-09 20:35 ` [ 087/123] mac802154: fix NOHZ local_softirq_pending 08 warning Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 089/123] sctp: jsctp_sf_eat_sack: fix jprobes function signature mismatch Greg Kroah-Hartman
` (37 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Stefan Hasko, Eric Dumazet,
David S. Miller
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefan Hasko <hasko.stevo@gmail.com>
[ Upstream commit d2fe85da52e89b8012ffad010ef352a964725d5f ]
Fixed integer overflow in function htb_dequeue
Signed-off-by: Stefan Hasko <hasko.stevo@gmail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sched/sch_htb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -874,7 +874,7 @@ ok:
q->now = psched_get_time();
start_at = jiffies;
- next_event = q->now + 5 * PSCHED_TICKS_PER_SEC;
+ next_event = q->now + 5LLU * PSCHED_TICKS_PER_SEC;
for (level = 0; level < TC_HTB_MAXDEPTH; level++) {
/* common case optimization - skip event handler quickly */
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 089/123] sctp: jsctp_sf_eat_sack: fix jprobes function signature mismatch
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (87 preceding siblings ...)
2013-01-09 20:35 ` [ 088/123] net: sched: integer overflow fix Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 090/123] tcp: fix MSG_SENDPAGE_NOTLAST logic Greg Kroah-Hartman
` (36 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Vlad Yasevich, Daniel Borkmann,
David S. Miller
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Borkmann <dborkman@redhat.com>
[ Upstream commit 4cb9d6eaf85ecdd266a9a5c6d825c56ca9eefc14 ]
Commit 24cb81a6a (sctp: Push struct net down into all of the
state machine functions) introduced the net structure into all
state machine functions, but jsctp_sf_eat_sack was not updated,
hence when SCTP association probing is enabled in the kernel,
any simple SCTP client/server program from userspace will panic
the kernel.
Cc: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/sctp/probe.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/net/sctp/probe.c
+++ b/net/sctp/probe.c
@@ -122,7 +122,8 @@ static const struct file_operations sctp
.llseek = noop_llseek,
};
-sctp_disposition_t jsctp_sf_eat_sack(const struct sctp_endpoint *ep,
+sctp_disposition_t jsctp_sf_eat_sack(struct net *net,
+ const struct sctp_endpoint *ep,
const struct sctp_association *asoc,
const sctp_subtype_t type,
void *arg,
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 090/123] tcp: fix MSG_SENDPAGE_NOTLAST logic
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (88 preceding siblings ...)
2013-01-09 20:35 ` [ 089/123] sctp: jsctp_sf_eat_sack: fix jprobes function signature mismatch Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 091/123] printk: fix incorrect length from print_time() when seconds > 99999 Greg Kroah-Hartman
` (35 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Willy Tarreau, Eric Dumazet,
David S. Miller
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <edumazet@google.com>
[ Upstream commit ae62ca7b03217be5e74759dc6d7698c95df498b3 ]
commit 35f9c09fe9c72e (tcp: tcp_sendpages() should call tcp_push() once)
added an internal flag : MSG_SENDPAGE_NOTLAST meant to be set on all
frags but the last one for a splice() call.
The condition used to set the flag in pipe_to_sendpage() relied on
splice() user passing the exact number of bytes present in the pipe,
or a smaller one.
But some programs pass an arbitrary high value, and the test fails.
The effect of this bug is a lack of tcp_push() at the end of a
splice(pipe -> socket) call, and possibly very slow or erratic TCP
sessions.
We should both test sd->total_len and fact that another fragment
is in the pipe (pipe->nrbufs > 1)
Many thanks to Willy for providing very clear bug report, bisection
and test programs.
Reported-by: Willy Tarreau <w@1wt.eu>
Bisected-by: Willy Tarreau <w@1wt.eu>
Tested-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/splice.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -696,8 +696,10 @@ static int pipe_to_sendpage(struct pipe_
return -EINVAL;
more = (sd->flags & SPLICE_F_MORE) ? MSG_MORE : 0;
- if (sd->len < sd->total_len)
+
+ if (sd->len < sd->total_len && pipe->nrbufs > 1)
more |= MSG_SENDPAGE_NOTLAST;
+
return file->f_op->sendpage(file, buf->page, buf->offset,
sd->len, &pos, more);
}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 091/123] printk: fix incorrect length from print_time() when seconds > 99999
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (89 preceding siblings ...)
2013-01-09 20:35 ` [ 090/123] tcp: fix MSG_SENDPAGE_NOTLAST logic Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 092/123] signals: sys_ssetmask() uses uninitialized newmask Greg Kroah-Hartman
` (34 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Roland Dreier, Joe Perches,
Sylvain Munaut, Andrew Morton, Linus Torvalds
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Roland Dreier <roland@purestorage.com>
commit 35dac27cedd14c3b6fcd4ba7bc3c31738cfd1831 upstream.
print_prefix() passes a NULL buf to print_time() to get the length of
the time prefix; when printk times are enabled, the current code just
returns the constant 15, which matches the format "[%5lu.%06lu] " used
to print the time value. However, this is obviously incorrect when the
whole seconds part of the time gets beyond 5 digits (100000 seconds is a
bit more than a day of uptime).
The simple fix is to use snprintf(NULL, 0, ...) to calculate the actual
length of the time prefix. This could be micro-optimized but it seems
better to have simpler, more readable code here.
The bug leads to the syslog system call miscomputing which messages fit
into the userspace buffer. If there are enough messages to fill
log_buf_len and some have a timestamp >= 100000, dmesg may fail with:
# dmesg
klogctl: Bad address
When this happens, strace shows that the failure is indeed EFAULT due to
the kernel mistakenly accessing past the end of dmesg's buffer, since
dmesg asks the kernel how big a buffer it needs, allocates a bit more,
and then gets an error when it asks the kernel to fill it:
syslog(0xa, 0, 0) = 1048576
mmap(NULL, 1052672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fa4d25d2000
syslog(0x3, 0x7fa4d25d2010, 0x100008) = -1 EFAULT (Bad address)
As far as I can see, the bug has been there as long as print_time(),
which comes from commit 084681d14e42 ("printk: flush continuation lines
immediately to console") in 3.5-rc5.
Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Joe Perches <joe@perches.com>
Cc: Sylvain Munaut <s.munaut@whatever-company.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/printk.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -847,10 +847,11 @@ static size_t print_time(u64 ts, char *b
if (!printk_time)
return 0;
+ rem_nsec = do_div(ts, 1000000000);
+
if (!buf)
- return 15;
+ return snprintf(NULL, 0, "[%5lu.000000] ", (unsigned long)ts);
- rem_nsec = do_div(ts, 1000000000);
return sprintf(buf, "[%5lu.%06lu] ",
(unsigned long)ts, rem_nsec / 1000);
}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 092/123] signals: sys_ssetmask() uses uninitialized newmask
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (90 preceding siblings ...)
2013-01-09 20:35 ` [ 091/123] printk: fix incorrect length from print_time() when seconds > 99999 Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 093/123] xfs: fix direct IO nested transaction deadlock Greg Kroah-Hartman
` (33 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Oleg Nesterov, Linus Torvalds
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oleg Nesterov <oleg@redhat.com>
commit 5ba53ff648e785445a32ba39112ed07e4cf588d0 upstream.
Commit 77097ae503b1 ("most of set_current_blocked() callers want
SIGKILL/SIGSTOP removed from set") removed the initialization of newmask
by accident, causing ltp to complain like this:
ssetmask01 1 TFAIL : sgetmask() failed: TEST_ERRNO=???(0): Success
Restore the proper initialization.
Reported-and-tested-by: CAI Qian <caiqian@redhat.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
kernel/signal.c | 1 +
1 file changed, 1 insertion(+)
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -3221,6 +3221,7 @@ SYSCALL_DEFINE1(ssetmask, int, newmask)
int old = current->blocked.sig[0];
sigset_t newset;
+ siginitset(&newset, newmask);
set_current_blocked(&newset);
return old;
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 093/123] xfs: fix direct IO nested transaction deadlock.
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (91 preceding siblings ...)
2013-01-09 20:35 ` [ 092/123] signals: sys_ssetmask() uses uninitialized newmask Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 094/123] xfs: fix stray dquot unlock when reclaiming dquots Greg Kroah-Hartman
` (32 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Dave Chinner, Christoph Hellwig,
Andrew Dahl, Ben Myers
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Chinner <dchinner@redhat.com>
commit 437a255aa23766666aec78af63be4c253faa8d57 upstream.
The direct IO path can do a nested transaction reservation when
writing past the EOF. The first transaction is the append
transaction for setting the filesize at IO completion, but we can
also need a transaction for allocation of blocks. If the log is low
on space due to reservations and small log, the append transaction
can be granted after wating for space as the only active transaction
in the system. This then attempts a reservation for an allocation,
which there isn't space in the log for, and the reservation sleeps.
The result is that there is nothing left in the system to wake up
all the processes waiting for log space to come free.
The stack trace that shows this deadlock is relatively innocuous:
xlog_grant_head_wait
xlog_grant_head_check
xfs_log_reserve
xfs_trans_reserve
xfs_iomap_write_direct
__xfs_get_blocks
xfs_get_blocks_direct
do_blockdev_direct_IO
__blockdev_direct_IO
xfs_vm_direct_IO
generic_file_direct_write
xfs_file_dio_aio_writ
xfs_file_aio_write
do_sync_write
vfs_write
This was discovered on a filesystem with a log of only 10MB, and a
log stripe unit of 256k whih increased the base reservations by
512k. Hence a allocation transaction requires 1.2MB of log space to
be available instead of only 260k, and so greatly increased the
chance that there wouldn't be enough log space available for the
nested transaction to succeed. The key to reproducing it is this
mkfs command:
mkfs.xfs -f -d agcount=16,su=256k,sw=12 -l su=256k,size=2560b $SCRATCH_DEV
The test case was a 1000 fsstress processes running with random
freeze and unfreezes every few seconds. Thanks to Eryu Guan
(eguan@redhat.com) for writing the test that found this on a system
with a somewhat unique default configuration....
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andrew Dahl <adahl@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/xfs/xfs_aops.c | 81 +++++++++++++++++++-----------------------------------
fs/xfs/xfs_log.c | 3 +-
2 files changed, 31 insertions(+), 53 deletions(-)
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -124,7 +124,7 @@ xfs_setfilesize_trans_alloc(
ioend->io_append_trans = tp;
/*
- * We will pass freeze protection with a transaction. So tell lockdep
+ * We may pass freeze protection with a transaction. So tell lockdep
* we released it.
*/
rwsem_release(&ioend->io_inode->i_sb->s_writers.lock_map[SB_FREEZE_FS-1],
@@ -149,11 +149,13 @@ xfs_setfilesize(
xfs_fsize_t isize;
/*
- * The transaction was allocated in the I/O submission thread,
- * thus we need to mark ourselves as beeing in a transaction
- * manually.
+ * The transaction may have been allocated in the I/O submission thread,
+ * thus we need to mark ourselves as beeing in a transaction manually.
+ * Similarly for freeze protection.
*/
current_set_flags_nested(&tp->t_pflags, PF_FSTRANS);
+ rwsem_acquire_read(&VFS_I(ip)->i_sb->s_writers.lock_map[SB_FREEZE_FS-1],
+ 0, 1, _THIS_IP_);
xfs_ilock(ip, XFS_ILOCK_EXCL);
isize = xfs_new_eof(ip, ioend->io_offset + ioend->io_size);
@@ -187,7 +189,8 @@ xfs_finish_ioend(
if (ioend->io_type == XFS_IO_UNWRITTEN)
queue_work(mp->m_unwritten_workqueue, &ioend->io_work);
- else if (ioend->io_append_trans)
+ else if (ioend->io_append_trans ||
+ (ioend->io_isdirect && xfs_ioend_is_append(ioend)))
queue_work(mp->m_data_workqueue, &ioend->io_work);
else
xfs_destroy_ioend(ioend);
@@ -205,15 +208,6 @@ xfs_end_io(
struct xfs_inode *ip = XFS_I(ioend->io_inode);
int error = 0;
- if (ioend->io_append_trans) {
- /*
- * We've got freeze protection passed with the transaction.
- * Tell lockdep about it.
- */
- rwsem_acquire_read(
- &ioend->io_inode->i_sb->s_writers.lock_map[SB_FREEZE_FS-1],
- 0, 1, _THIS_IP_);
- }
if (XFS_FORCED_SHUTDOWN(ip->i_mount)) {
ioend->io_error = -EIO;
goto done;
@@ -226,35 +220,31 @@ xfs_end_io(
* range to normal written extens after the data I/O has finished.
*/
if (ioend->io_type == XFS_IO_UNWRITTEN) {
+ error = xfs_iomap_write_unwritten(ip, ioend->io_offset,
+ ioend->io_size);
+ } else if (ioend->io_isdirect && xfs_ioend_is_append(ioend)) {
/*
- * For buffered I/O we never preallocate a transaction when
- * doing the unwritten extent conversion, but for direct I/O
- * we do not know if we are converting an unwritten extent
- * or not at the point where we preallocate the transaction.
+ * For direct I/O we do not know if we need to allocate blocks
+ * or not so we can't preallocate an append transaction as that
+ * results in nested reservations and log space deadlocks. Hence
+ * allocate the transaction here. While this is sub-optimal and
+ * can block IO completion for some time, we're stuck with doing
+ * it this way until we can pass the ioend to the direct IO
+ * allocation callbacks and avoid nesting that way.
*/
- if (ioend->io_append_trans) {
- ASSERT(ioend->io_isdirect);
-
- current_set_flags_nested(
- &ioend->io_append_trans->t_pflags, PF_FSTRANS);
- xfs_trans_cancel(ioend->io_append_trans, 0);
- }
-
- error = xfs_iomap_write_unwritten(ip, ioend->io_offset,
- ioend->io_size);
- if (error) {
- ioend->io_error = -error;
+ error = xfs_setfilesize_trans_alloc(ioend);
+ if (error)
goto done;
- }
+ error = xfs_setfilesize(ioend);
} else if (ioend->io_append_trans) {
error = xfs_setfilesize(ioend);
- if (error)
- ioend->io_error = -error;
} else {
ASSERT(!xfs_ioend_is_append(ioend));
}
done:
+ if (error)
+ ioend->io_error = -error;
xfs_destroy_ioend(ioend);
}
@@ -1432,25 +1422,21 @@ xfs_vm_direct_IO(
size_t size = iov_length(iov, nr_segs);
/*
- * We need to preallocate a transaction for a size update
- * here. In the case that this write both updates the size
- * and converts at least on unwritten extent we will cancel
- * the still clean transaction after the I/O has finished.
+ * We cannot preallocate a size update transaction here as we
+ * don't know whether allocation is necessary or not. Hence we
+ * can only tell IO completion that one is necessary if we are
+ * not doing unwritten extent conversion.
*/
iocb->private = ioend = xfs_alloc_ioend(inode, XFS_IO_DIRECT);
- if (offset + size > XFS_I(inode)->i_d.di_size) {
- ret = xfs_setfilesize_trans_alloc(ioend);
- if (ret)
- goto out_destroy_ioend;
+ if (offset + size > XFS_I(inode)->i_d.di_size)
ioend->io_isdirect = 1;
- }
ret = __blockdev_direct_IO(rw, iocb, inode, bdev, iov,
offset, nr_segs,
xfs_get_blocks_direct,
xfs_end_io_direct_write, NULL, 0);
if (ret != -EIOCBQUEUED && iocb->private)
- goto out_trans_cancel;
+ goto out_destroy_ioend;
} else {
ret = __blockdev_direct_IO(rw, iocb, inode, bdev, iov,
offset, nr_segs,
@@ -1460,15 +1446,6 @@ xfs_vm_direct_IO(
return ret;
-out_trans_cancel:
- if (ioend->io_append_trans) {
- current_set_flags_nested(&ioend->io_append_trans->t_pflags,
- PF_FSTRANS);
- rwsem_acquire_read(
- &inode->i_sb->s_writers.lock_map[SB_FREEZE_FS-1],
- 0, 1, _THIS_IP_);
- xfs_trans_cancel(ioend->io_append_trans, 0);
- }
out_destroy_ioend:
xfs_destroy_ioend(ioend);
return ret;
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -458,7 +458,8 @@ xfs_log_reserve(
tic->t_trans_type = t_type;
*ticp = tic;
- xlog_grant_push_ail(log, tic->t_unit_res * tic->t_cnt);
+ xlog_grant_push_ail(log, tic->t_cnt ? tic->t_unit_res * tic->t_cnt
+ : tic->t_unit_res);
trace_xfs_log_reserve(log, tic);
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 094/123] xfs: fix stray dquot unlock when reclaiming dquots
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (92 preceding siblings ...)
2013-01-09 20:35 ` [ 093/123] xfs: fix direct IO nested transaction deadlock Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 095/123] arm64: compat for clock_adjtime(2) is miswired Greg Kroah-Hartman
` (31 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Dave Chinner, Christoph Hellwig,
Ben Myers
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Chinner <dchinner@redhat.com>
commit b870553cdecb26d5291af09602352b763e323df2 upstream.
When we fail to get a dquot lock during reclaim, we jump to an error
handler that unlocks the dquot. This is wrong as we didn't lock the
dquot, and unlocking it means who-ever is holding the lock has had
it silently taken away, and hence it results in a lock imbalance.
Found by inspection while modifying the code for the numa-lru
patchset. This fixes a random hang I've been seeing on xfstest 232
for the past several months.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/xfs/xfs_qm.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -1453,7 +1453,7 @@ xfs_qm_dqreclaim_one(
int error;
if (!xfs_dqlock_nowait(dqp))
- goto out_busy;
+ goto out_move_tail;
/*
* This dquot has acquired a reference in the meantime remove it from
@@ -1476,7 +1476,7 @@ xfs_qm_dqreclaim_one(
* getting flushed to disk, we don't want to reclaim it.
*/
if (!xfs_dqflock_nowait(dqp))
- goto out_busy;
+ goto out_unlock_move_tail;
if (XFS_DQ_IS_DIRTY(dqp)) {
struct xfs_buf *bp = NULL;
@@ -1487,7 +1487,7 @@ xfs_qm_dqreclaim_one(
if (error) {
xfs_warn(mp, "%s: dquot %p flush failed",
__func__, dqp);
- goto out_busy;
+ goto out_unlock_move_tail;
}
xfs_buf_delwri_queue(bp, buffer_list);
@@ -1496,7 +1496,7 @@ xfs_qm_dqreclaim_one(
* Give the dquot another try on the freelist, as the
* flushing will take some time.
*/
- goto out_busy;
+ goto out_unlock_move_tail;
}
xfs_dqfunlock(dqp);
@@ -1515,14 +1515,13 @@ xfs_qm_dqreclaim_one(
XFS_STATS_INC(xs_qm_dqreclaims);
return;
-out_busy:
- xfs_dqunlock(dqp);
-
/*
* Move the dquot to the tail of the list so that we don't spin on it.
*/
+out_unlock_move_tail:
+ xfs_dqunlock(dqp);
+out_move_tail:
list_move_tail(&dqp->q_lru, &qi->qi_lru_list);
-
trace_xfs_dqreclaim_busy(dqp);
XFS_STATS_INC(xs_qm_dqreclaim_misses);
}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 095/123] arm64: compat for clock_adjtime(2) is miswired
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (93 preceding siblings ...)
2013-01-09 20:35 ` [ 094/123] xfs: fix stray dquot unlock when reclaiming dquots Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 096/123] ARM: mm: use pteval_t to represent page protection values Greg Kroah-Hartman
` (30 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Al Viro, Will Deacon, Catalin Marinas
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Al Viro <viro@ZenIV.linux.org.uk>
commit 18a80376ddb0bdc466995ff58c844d6fd0a65e61 upstream.
struct timex is different on arm and arm64; adjtimex(2) takes care to
convert, clock_adjtime(2) doesn't...
Signed-off-by: Al Viro <viro@ZenIV.linux.org.uk>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/arm64/include/asm/unistd32.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/arm64/include/asm/unistd32.h
+++ b/arch/arm64/include/asm/unistd32.h
@@ -393,7 +393,7 @@ __SYSCALL(368, compat_sys_fanotify_mark_
__SYSCALL(369, sys_prlimit64)
__SYSCALL(370, sys_name_to_handle_at)
__SYSCALL(371, compat_sys_open_by_handle_at)
-__SYSCALL(372, sys_clock_adjtime)
+__SYSCALL(372, compat_sys_clock_adjtime)
__SYSCALL(373, sys_syncfs)
#define __NR_compat_syscalls 374
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 096/123] ARM: mm: use pteval_t to represent page protection values
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (94 preceding siblings ...)
2013-01-09 20:35 ` [ 095/123] arm64: compat for clock_adjtime(2) is miswired Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 097/123] ARM: missing ->mmap_sem around find_vma() in swp_emulate.c Greg Kroah-Hartman
` (29 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Nicolas Pitre, Catalin Marinas,
Will Deacon
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <will.deacon@arm.com>
commit 864aa04cd02979c2c755cb28b5f4fe56039171c0 upstream.
When updating the page protection map after calculating the user_pgprot
value, the base protection map is temporarily stored in an unsigned long
type, causing truncation of the protection bits when LPAE is enabled.
This effectively means that calls to mprotect() will corrupt the upper
page attributes, clearing the XN bit unconditionally.
This patch uses pteval_t to store the intermediate protection values,
preserving the upper bits for 64-bit descriptors.
Acked-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/arm/mm/mmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -488,7 +488,7 @@ static void __init build_mem_type_table(
#endif
for (i = 0; i < 16; i++) {
- unsigned long v = pgprot_val(protection_map[i]);
+ pteval_t v = pgprot_val(protection_map[i]);
protection_map[i] = __pgprot(v | user_pgprot);
}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 097/123] ARM: missing ->mmap_sem around find_vma() in swp_emulate.c
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (95 preceding siblings ...)
2013-01-09 20:35 ` [ 096/123] ARM: mm: use pteval_t to represent page protection values Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 098/123] ARM: 7607/1: realview: fix private peripheral memory base for EB rev. B boards Greg Kroah-Hartman
` (28 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Al Viro, Russell King
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Al Viro <viro@ZenIV.linux.org.uk>
commit 7bf9b7bef881aac820bf1f2e9951a17b09bd7e04 upstream.
find_vma() is *not* safe when somebody else is removing vmas. Not just
the return value might get bogus just as you are getting it (this instance
doesn't try to dereference the resulting vma), the search itself can get
buggered in rather spectacular ways. IOW, ->mmap_sem really, really is
not optional here.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/arm/kernel/swp_emulate.c | 2 ++
1 file changed, 2 insertions(+)
--- a/arch/arm/kernel/swp_emulate.c
+++ b/arch/arm/kernel/swp_emulate.c
@@ -109,10 +109,12 @@ static void set_segfault(struct pt_regs
{
siginfo_t info;
+ down_read(¤t->mm->mmap_sem);
if (find_vma(current->mm, addr) == NULL)
info.si_code = SEGV_MAPERR;
else
info.si_code = SEGV_ACCERR;
+ up_read(¤t->mm->mmap_sem);
info.si_signo = SIGSEGV;
info.si_errno = 0;
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 098/123] ARM: 7607/1: realview: fix private peripheral memory base for EB rev. B boards
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (96 preceding siblings ...)
2013-01-09 20:35 ` [ 097/123] ARM: missing ->mmap_sem around find_vma() in swp_emulate.c Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 099/123] ARM: 7606/1: cache: flush to LoUU instead of LoUIS on uniprocessor CPUs Greg Kroah-Hartman
` (27 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Marc Zyngier, Florian Fainelli,
Will Deacon, Russell King
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <will.deacon@arm.com>
commit e6ee4b2b57a8e0d8e551031173de080b338d3969 upstream.
Commit 34ae6c96a6a7 ("ARM: 7298/1: realview: fix mapping of MPCore
private memory region") accidentally broke the definition for the base
address of the private peripheral region on revision B Realview-EB
boards.
This patch uses the correct address for REALVIEW_EB11MP_PRIV_MEM_BASE.
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Tested-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/arm/mach-realview/include/mach/board-eb.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/arch/arm/mach-realview/include/mach/board-eb.h
+++ b/arch/arm/mach-realview/include/mach/board-eb.h
@@ -47,7 +47,7 @@
#define REALVIEW_EB_USB_BASE 0x4F000000 /* USB */
#ifdef CONFIG_REALVIEW_EB_ARM11MP_REVB
-#define REALVIEW_EB11MP_PRIV_MEM_BASE 0x1F000000
+#define REALVIEW_EB11MP_PRIV_MEM_BASE 0x10100000
#define REALVIEW_EB11MP_L220_BASE 0x10102000 /* L220 registers */
#define REALVIEW_EB11MP_SYS_PLD_CTRL1 0xD8 /* Register offset for MPCore sysctl */
#else
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 099/123] ARM: 7606/1: cache: flush to LoUU instead of LoUIS on uniprocessor CPUs
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (97 preceding siblings ...)
2013-01-09 20:35 ` [ 098/123] ARM: 7607/1: realview: fix private peripheral memory base for EB rev. B boards Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 100/123] fs: Fix imbalance in freeze protection in mark_files_ro() Greg Kroah-Hartman
` (26 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Lorenzo Pieralisi,
Guennadi Liakhovetski, Will Deacon, Russell King
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Will Deacon <will.deacon@arm.com>
commit d056a699dd3d9366dd3b4d9996e7848209199cda upstream.
flush_cache_louis flushes the D-side caches to the point of unification
inner-shareable. On uniprocessor CPUs, this is defined as zero and
therefore no flushing will take place. Rather than invent a new interface
for UP systems, instead use our SMP_ON_UP patching code to read the
LoUU from the CLIDR instead.
Cc: Lorenzo Pieralisi <Lorenzo.Pieralisi@arm.com>
Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/arm/mm/cache-v7.S | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/arch/arm/mm/cache-v7.S
+++ b/arch/arm/mm/cache-v7.S
@@ -44,8 +44,10 @@ ENDPROC(v7_flush_icache_all)
ENTRY(v7_flush_dcache_louis)
dmb @ ensure ordering with previous memory accesses
mrc p15, 1, r0, c0, c0, 1 @ read clidr, r0 = clidr
- ands r3, r0, #0xe00000 @ extract LoUIS from clidr
- mov r3, r3, lsr #20 @ r3 = LoUIS * 2
+ ALT_SMP(ands r3, r0, #(7 << 21)) @ extract LoUIS from clidr
+ ALT_UP(ands r3, r0, #(7 << 27)) @ extract LoUU from clidr
+ ALT_SMP(mov r3, r3, lsr #20) @ r3 = LoUIS * 2
+ ALT_UP(mov r3, r3, lsr #26) @ r3 = LoUU * 2
moveq pc, lr @ return if level == 0
mov r10, #0 @ r10 (starting level) = 0
b flush_levels @ start flushing cache levels
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 100/123] fs: Fix imbalance in freeze protection in mark_files_ro()
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (98 preceding siblings ...)
2013-01-09 20:35 ` [ 099/123] ARM: 7606/1: cache: flush to LoUU instead of LoUIS on uniprocessor CPUs Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 101/123] cifs: move check for NULL socket into smb_send_rqst Greg Kroah-Hartman
` (25 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Zdenek Kabelac, Jan Kara, Al Viro
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <jack@suse.cz>
commit 72651cac884b1e285fa8e8314b10e9f1b8458802 upstream.
File descriptors (even those for writing) do not hold freeze protection.
Thus mark_files_ro() must call __mnt_drop_write() to only drop protection
against remount read-only. Calling mnt_drop_write_file() as we do now
results in:
[ BUG: bad unlock balance detected! ]
3.7.0-rc6-00028-g88e75b6 #101 Not tainted
-------------------------------------
kworker/1:2/79 is trying to release lock (sb_writers) at:
[<ffffffff811b33b4>] mnt_drop_write+0x24/0x30
but there are no more locks to release!
Reported-by: Zdenek Kabelac <zkabelac@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/file_table.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/file_table.c
+++ b/fs/file_table.c
@@ -458,8 +458,8 @@ void mark_files_ro(struct super_block *s
spin_unlock(&f->f_lock);
if (file_check_writeable(f) != 0)
continue;
+ __mnt_drop_write(f->f_path.mnt);
file_release_write(f);
- mnt_drop_write_file(f);
} while_file_list_for_each_entry;
lg_global_unlock(&files_lglock);
}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 101/123] cifs: move check for NULL socket into smb_send_rqst
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (99 preceding siblings ...)
2013-01-09 20:35 ` [ 100/123] fs: Fix imbalance in freeze protection in mark_files_ro() Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 102/123] cifs: adjust sequence number downward after signing NT_CANCEL request Greg Kroah-Hartman
` (24 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Jeff Layton, Steve French
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <jlayton@redhat.com>
commit ea702b80e0bbb2448e201472127288beb82ca2fe upstream.
Cai reported this oops:
[90701.616664] BUG: unable to handle kernel NULL pointer dereference at 0000000000000028
[90701.625438] IP: [<ffffffff814a343e>] kernel_setsockopt+0x2e/0x60
[90701.632167] PGD fea319067 PUD 103fda4067 PMD 0
[90701.637255] Oops: 0000 [#1] SMP
[90701.640878] Modules linked in: des_generic md4 nls_utf8 cifs dns_resolver binfmt_misc tun sg igb iTCO_wdt iTCO_vendor_support lpc_ich pcspkr i2c_i801 i2c_core i7core_edac edac_core ioatdma dca mfd_core coretemp kvm_intel kvm crc32c_intel microcode sr_mod cdrom ata_generic sd_mod pata_acpi crc_t10dif ata_piix libata megaraid_sas dm_mirror dm_region_hash dm_log dm_mod
[90701.677655] CPU 10
[90701.679808] Pid: 9627, comm: ls Tainted: G W 3.7.1+ #10 QCI QSSC-S4R/QSSC-S4R
[90701.688950] RIP: 0010:[<ffffffff814a343e>] [<ffffffff814a343e>] kernel_setsockopt+0x2e/0x60
[90701.698383] RSP: 0018:ffff88177b431bb8 EFLAGS: 00010206
[90701.704309] RAX: ffff88177b431fd8 RBX: 00007ffffffff000 RCX: ffff88177b431bec
[90701.712271] RDX: 0000000000000003 RSI: 0000000000000006 RDI: 0000000000000000
[90701.720223] RBP: ffff88177b431bc8 R08: 0000000000000004 R09: 0000000000000000
[90701.728185] R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000001
[90701.736147] R13: ffff88184ef92000 R14: 0000000000000023 R15: ffff88177b431c88
[90701.744109] FS: 00007fd56a1a47c0(0000) GS:ffff88105fc40000(0000) knlGS:0000000000000000
[90701.753137] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[90701.759550] CR2: 0000000000000028 CR3: 000000104f15f000 CR4: 00000000000007e0
[90701.767512] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[90701.775465] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[90701.783428] Process ls (pid: 9627, threadinfo ffff88177b430000, task ffff88185ca4cb60)
[90701.792261] Stack:
[90701.794505] 0000000000000023 ffff88177b431c50 ffff88177b431c38 ffffffffa014fcb1
[90701.802809] ffff88184ef921bc 0000000000000000 00000001ffffffff ffff88184ef921c0
[90701.811123] ffff88177b431c08 ffffffff815ca3d9 ffff88177b431c18 ffff880857758000
[90701.819433] Call Trace:
[90701.822183] [<ffffffffa014fcb1>] smb_send_rqst+0x71/0x1f0 [cifs]
[90701.828991] [<ffffffff815ca3d9>] ? schedule+0x29/0x70
[90701.834736] [<ffffffffa014fe6d>] smb_sendv+0x3d/0x40 [cifs]
[90701.841062] [<ffffffffa014fe96>] smb_send+0x26/0x30 [cifs]
[90701.847291] [<ffffffffa015801f>] send_nt_cancel+0x6f/0xd0 [cifs]
[90701.854102] [<ffffffffa015075e>] SendReceive+0x18e/0x360 [cifs]
[90701.860814] [<ffffffffa0134a78>] CIFSFindFirst+0x1a8/0x3f0 [cifs]
[90701.867724] [<ffffffffa013f731>] ? build_path_from_dentry+0xf1/0x260 [cifs]
[90701.875601] [<ffffffffa013f731>] ? build_path_from_dentry+0xf1/0x260 [cifs]
[90701.883477] [<ffffffffa01578e6>] cifs_query_dir_first+0x26/0x30 [cifs]
[90701.890869] [<ffffffffa015480d>] initiate_cifs_search+0xed/0x250 [cifs]
[90701.898354] [<ffffffff81195970>] ? fillonedir+0x100/0x100
[90701.904486] [<ffffffffa01554cb>] cifs_readdir+0x45b/0x8f0 [cifs]
[90701.911288] [<ffffffff81195970>] ? fillonedir+0x100/0x100
[90701.917410] [<ffffffff81195970>] ? fillonedir+0x100/0x100
[90701.923533] [<ffffffff81195970>] ? fillonedir+0x100/0x100
[90701.929657] [<ffffffff81195848>] vfs_readdir+0xb8/0xe0
[90701.935490] [<ffffffff81195b9f>] sys_getdents+0x8f/0x110
[90701.941521] [<ffffffff815d3b99>] system_call_fastpath+0x16/0x1b
[90701.948222] Code: 66 90 55 65 48 8b 04 25 f0 c6 00 00 48 89 e5 53 48 83 ec 08 83 fe 01 48 8b 98 48 e0 ff ff 48 c7 80 48 e0 ff ff ff ff ff ff 74 22 <48> 8b 47 28 ff 50 68 65 48 8b 14 25 f0 c6 00 00 48 89 9a 48 e0
[90701.970313] RIP [<ffffffff814a343e>] kernel_setsockopt+0x2e/0x60
[90701.977125] RSP <ffff88177b431bb8>
[90701.981018] CR2: 0000000000000028
[90701.984809] ---[ end trace 24bd602971110a43 ]---
This is likely due to a race vs. a reconnection event.
The current code checks for a NULL socket in smb_send_kvec, but that's
too late. By the time that check is done, the socket will already have
been passed to kernel_setsockopt. Move the check into smb_send_rqst, so
that it's checked earlier.
In truth, this is a bit of a half-assed fix. The -ENOTSOCK error
return here looks like it could bubble back up to userspace. The locking
rules around the ssocket pointer are really unclear as well. There are
cases where the ssocket pointer is changed without holding the srv_mutex,
but I'm not clear whether there's a potential race here yet or not.
This code seems like it could benefit from some fundamental re-think of
how the socket handling should behave. Until then though, this patch
should at least fix the above oops in most cases.
Reported-and-Tested-by: CAI Qian <caiqian@redhat.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/cifs/transport.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -144,9 +144,6 @@ smb_send_kvec(struct TCP_Server_Info *se
*sent = 0;
- if (ssocket == NULL)
- return -ENOTSOCK; /* BB eventually add reconnect code here */
-
smb_msg.msg_name = (struct sockaddr *) &server->dstaddr;
smb_msg.msg_namelen = sizeof(struct sockaddr);
smb_msg.msg_control = NULL;
@@ -291,6 +288,9 @@ smb_send_rqst(struct TCP_Server_Info *se
struct socket *ssocket = server->ssocket;
int val = 1;
+ if (ssocket == NULL)
+ return -ENOTSOCK;
+
cFYI(1, "Sending smb: smb_len=%u", smb_buf_length);
dump_smb(iov[0].iov_base, iov[0].iov_len);
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 102/123] cifs: adjust sequence number downward after signing NT_CANCEL request
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (100 preceding siblings ...)
2013-01-09 20:35 ` [ 101/123] cifs: move check for NULL socket into smb_send_rqst Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 103/123] solos-pci: fix double-free of TX skb in DMA mode Greg Kroah-Hartman
` (23 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Tim Perry, Jeff Layton, Steve French
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <jlayton@redhat.com>
commit 31efee60f489c759c341454d755a9fd13de8c03d upstream.
When a call goes out, the signing code adjusts the sequence number
upward by two to account for the request and the response. An NT_CANCEL
however doesn't get a response of its own, it just hurries the server
along to get it to respond to the original request more quickly.
Therefore, we must adjust the sequence number back down by one after
signing a NT_CANCEL request.
Reported-by: Tim Perry <tdparmor-sambabugs@yahoo.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/cifs/smb1ops.c | 7 +++++++
1 file changed, 7 insertions(+)
--- a/fs/cifs/smb1ops.c
+++ b/fs/cifs/smb1ops.c
@@ -53,6 +53,13 @@ send_nt_cancel(struct TCP_Server_Info *s
mutex_unlock(&server->srv_mutex);
return rc;
}
+
+ /*
+ * The response to this call was already factored into the sequence
+ * number when the call went out, so we must adjust it back downward
+ * after signing here.
+ */
+ --server->sequence_number;
rc = smb_send(server, in_buf, be32_to_cpu(in_buf->smb_buf_length));
mutex_unlock(&server->srv_mutex);
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 103/123] solos-pci: fix double-free of TX skb in DMA mode
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (101 preceding siblings ...)
2013-01-09 20:35 ` [ 102/123] cifs: adjust sequence number downward after signing NT_CANCEL request Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 104/123] PCI/PM: Keep runtime PM enabled for unbound PCI devices Greg Kroah-Hartman
` (22 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, David Woodhouse, David S. Miller
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Woodhouse <dwmw2@infradead.org>
commit cae49ede00ec3d0cda290b03fee55b72b49efc11 upstream.
We weren't clearing card->tx_skb[port] when processing the TX done interrupt.
If there wasn't another skb ready to transmit immediately, this led to a
double-free because we'd free it *again* next time we did have a packet to
send.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/atm/solos-pci.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
@@ -967,10 +967,11 @@ static uint32_t fpga_tx(struct solos_car
for (port = 0; tx_pending; tx_pending >>= 1, port++) {
if (tx_pending & 1) {
struct sk_buff *oldskb = card->tx_skb[port];
- if (oldskb)
+ if (oldskb) {
pci_unmap_single(card->dev, SKB_CB(oldskb)->dma_addr,
oldskb->len, PCI_DMA_TODEVICE);
-
+ card->tx_skb[port] = NULL;
+ }
spin_lock(&card->tx_queue_lock);
skb = skb_dequeue(&card->tx_queue[port]);
if (!skb)
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 104/123] PCI/PM: Keep runtime PM enabled for unbound PCI devices
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (102 preceding siblings ...)
2013-01-09 20:35 ` [ 103/123] solos-pci: fix double-free of TX skb in DMA mode Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 105/123] PCI: Reduce Ricoh 0xe822 SD card reader base clock frequency to 50MHz Greg Kroah-Hartman
` (21 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Huang Ying, Bjorn Helgaas, Alan Stern,
Rafael J. Wysocki
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Huang Ying <ying.huang@intel.com>
commit 967577b062417b4e4b8e27b711220f4124f5153a upstream.
For unbound PCI devices, what we need is:
- Always in D0 state, because some devices do not work again after
being put into D3 by the PCI bus.
- In SUSPENDED state if allowed, so that the parent devices can still
be put into low power state.
To satisfy these requirements, the runtime PM for the unbound PCI
devices are disabled and set to SUSPENDED state. One issue of this
solution is that the PCI devices will be put into SUSPENDED state even
if the SUSPENDED state is forbidden via the sysfs interface
(.../power/control) of the device. This is not an issue for most
devices, because most PCI devices are not used at all if unbound.
But there are exceptions. For example, unbound VGA card can be used
for display, but suspending its parents makes it stop working.
To fix the issue, we keep the runtime PM enabled when the PCI devices
are unbound. But the runtime PM callbacks will do nothing if the PCI
devices are unbound. This way, we can put the PCI devices into
SUSPENDED state without putting the PCI devices into D3 state.
Reference: https://bugzilla.kernel.org/show_bug.cgi?id=48201
Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/pci/pci-driver.c | 69 +++++++++++++++++++++++++++--------------------
drivers/pci/pci.c | 2 +
2 files changed, 43 insertions(+), 28 deletions(-)
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -256,31 +256,26 @@ struct drv_dev_and_id {
static long local_pci_probe(void *_ddi)
{
struct drv_dev_and_id *ddi = _ddi;
- struct device *dev = &ddi->dev->dev;
- struct device *parent = dev->parent;
+ struct pci_dev *pci_dev = ddi->dev;
+ struct pci_driver *pci_drv = ddi->drv;
+ struct device *dev = &pci_dev->dev;
int rc;
- /* The parent bridge must be in active state when probing */
- if (parent)
- pm_runtime_get_sync(parent);
- /* Unbound PCI devices are always set to disabled and suspended.
- * During probe, the device is set to enabled and active and the
- * usage count is incremented. If the driver supports runtime PM,
- * it should call pm_runtime_put_noidle() in its probe routine and
- * pm_runtime_get_noresume() in its remove routine.
- */
- pm_runtime_get_noresume(dev);
- pm_runtime_set_active(dev);
- pm_runtime_enable(dev);
-
- rc = ddi->drv->probe(ddi->dev, ddi->id);
+ /*
+ * Unbound PCI devices are always put in D0, regardless of
+ * runtime PM status. During probe, the device is set to
+ * active and the usage count is incremented. If the driver
+ * supports runtime PM, it should call pm_runtime_put_noidle()
+ * in its probe routine and pm_runtime_get_noresume() in its
+ * remove routine.
+ */
+ pm_runtime_get_sync(dev);
+ pci_dev->driver = pci_drv;
+ rc = pci_drv->probe(pci_dev, ddi->id);
if (rc) {
- pm_runtime_disable(dev);
- pm_runtime_set_suspended(dev);
- pm_runtime_put_noidle(dev);
+ pci_dev->driver = NULL;
+ pm_runtime_put_sync(dev);
}
- if (parent)
- pm_runtime_put(parent);
return rc;
}
@@ -330,10 +325,8 @@ __pci_device_probe(struct pci_driver *dr
id = pci_match_device(drv, pci_dev);
if (id)
error = pci_call_probe(drv, pci_dev, id);
- if (error >= 0) {
- pci_dev->driver = drv;
+ if (error >= 0)
error = 0;
- }
}
return error;
}
@@ -369,9 +362,7 @@ static int pci_device_remove(struct devi
}
/* Undo the runtime PM settings in local_pci_probe() */
- pm_runtime_disable(dev);
- pm_runtime_set_suspended(dev);
- pm_runtime_put_noidle(dev);
+ pm_runtime_put_sync(dev);
/*
* If the device is still on, set the power state as "unknown",
@@ -994,6 +985,13 @@ static int pci_pm_runtime_suspend(struct
pci_power_t prev = pci_dev->current_state;
int error;
+ /*
+ * If pci_dev->driver is not set (unbound), the device should
+ * always remain in D0 regardless of the runtime PM status
+ */
+ if (!pci_dev->driver)
+ return 0;
+
if (!pm || !pm->runtime_suspend)
return -ENOSYS;
@@ -1029,6 +1027,13 @@ static int pci_pm_runtime_resume(struct
struct pci_dev *pci_dev = to_pci_dev(dev);
const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
+ /*
+ * If pci_dev->driver is not set (unbound), the device should
+ * always remain in D0 regardless of the runtime PM status
+ */
+ if (!pci_dev->driver)
+ return 0;
+
if (!pm || !pm->runtime_resume)
return -ENOSYS;
@@ -1046,8 +1051,16 @@ static int pci_pm_runtime_resume(struct
static int pci_pm_runtime_idle(struct device *dev)
{
+ struct pci_dev *pci_dev = to_pci_dev(dev);
const struct dev_pm_ops *pm = dev->driver ? dev->driver->pm : NULL;
+ /*
+ * If pci_dev->driver is not set (unbound), the device should
+ * always remain in D0 regardless of the runtime PM status
+ */
+ if (!pci_dev->driver)
+ goto out;
+
if (!pm)
return -ENOSYS;
@@ -1057,8 +1070,8 @@ static int pci_pm_runtime_idle(struct de
return ret;
}
+out:
pm_runtime_suspend(dev);
-
return 0;
}
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -1900,6 +1900,8 @@ void pci_pm_init(struct pci_dev *dev)
u16 pmc;
pm_runtime_forbid(&dev->dev);
+ pm_runtime_set_active(&dev->dev);
+ pm_runtime_enable(&dev->dev);
device_enable_async_suspend(&dev->dev);
dev->wakeup_prepared = false;
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 105/123] PCI: Reduce Ricoh 0xe822 SD card reader base clock frequency to 50MHz
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (103 preceding siblings ...)
2013-01-09 20:35 ` [ 104/123] PCI/PM: Keep runtime PM enabled for unbound PCI devices Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 106/123] PCI/PM: Do not suspend port if any subordinate device needs PME polling Greg Kroah-Hartman
` (20 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Andy Lutomirski, Bjorn Helgaas,
Chris Ball, Manoj Iyer
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Lutomirski <luto@amacapital.net>
commit 812089e01b9f65f90fc8fc670d8cce72a0e01fbb upstream.
Otherwise it fails like this on cards like the Transcend 16GB SDHC card:
mmc0: new SDHC card at address b368
mmcblk0: mmc0:b368 SDC 15.0 GiB
mmcblk0: error -110 sending status command, retrying
mmcblk0: error -84 transferring data, sector 0, nr 8, cmd response 0x900, card status 0xb0
Tested on my Lenovo x200 laptop.
[bhelgaas: changelog]
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Chris Ball <cjb@laptop.org>
CC: Manoj Iyer <manoj.iyer@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/pci/quirks.c | 7 +++++--
include/linux/pci_ids.h | 1 +
2 files changed, 6 insertions(+), 2 deletions(-)
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -2686,7 +2686,7 @@ static void ricoh_mmc_fixup_r5c832(struc
if (PCI_FUNC(dev->devfn))
return;
/*
- * RICOH 0xe823 SD/MMC card reader fails to recognize
+ * RICOH 0xe822 and 0xe823 SD/MMC card readers fail to recognize
* certain types of SD/MMC cards. Lowering the SD base
* clock frequency from 200Mhz to 50Mhz fixes this issue.
*
@@ -2697,7 +2697,8 @@ static void ricoh_mmc_fixup_r5c832(struc
* 0xf9 - Key register for 0x150
* 0xfc - key register for 0xe1
*/
- if (dev->device == PCI_DEVICE_ID_RICOH_R5CE823) {
+ if (dev->device == PCI_DEVICE_ID_RICOH_R5CE822 ||
+ dev->device == PCI_DEVICE_ID_RICOH_R5CE823) {
pci_write_config_byte(dev, 0xf9, 0xfc);
pci_write_config_byte(dev, 0x150, 0x10);
pci_write_config_byte(dev, 0xf9, 0x00);
@@ -2724,6 +2725,8 @@ static void ricoh_mmc_fixup_r5c832(struc
}
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832);
DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5C832, ricoh_mmc_fixup_r5c832);
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5CE822, ricoh_mmc_fixup_r5c832);
+DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5CE822, ricoh_mmc_fixup_r5c832);
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5CE823, ricoh_mmc_fixup_r5c832);
DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDOR_ID_RICOH, PCI_DEVICE_ID_RICOH_R5CE823, ricoh_mmc_fixup_r5c832);
#endif /*CONFIG_MMC_RICOH_MMC*/
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1568,6 +1568,7 @@
#define PCI_DEVICE_ID_RICOH_RL5C476 0x0476
#define PCI_DEVICE_ID_RICOH_RL5C478 0x0478
#define PCI_DEVICE_ID_RICOH_R5C822 0x0822
+#define PCI_DEVICE_ID_RICOH_R5CE822 0xe822
#define PCI_DEVICE_ID_RICOH_R5CE823 0xe823
#define PCI_DEVICE_ID_RICOH_R5C832 0x0832
#define PCI_DEVICE_ID_RICOH_R5C843 0x0843
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 106/123] PCI/PM: Do not suspend port if any subordinate device needs PME polling
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (104 preceding siblings ...)
2013-01-09 20:35 ` [ 105/123] PCI: Reduce Ricoh 0xe822 SD card reader base clock frequency to 50MHz Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 107/123] PCI: Work around Stratus ftServer broken PCIe hierarchy (fix DMI check) Greg Kroah-Hartman
` (19 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Ulrich Eckhardt, Sarah Sharp,
Huang Ying, Bjorn Helgaas, Rafael J. Wysocki
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Huang Ying <ying.huang@intel.com>
commit c733b77475707cc3980542c86ee0ad5c841d544c upstream.
Ulrich reported that his USB3 cardreader does not work reliably when
connected to the USB3 port. It turns out that USB3 controller failed to
awaken when plugging in the USB3 cardreader. Further experiments found
that the USB3 host controller can only be awakened via polling, not via PME
interrupt. But if the PCIe port to which the USB3 host controller is
connected is suspended, we cannot poll the controller because its config
space is not accessible when the PCIe port is in a low power state.
To solve the issue, the PCIe port will not be suspended if any subordinate
device needs PME polling.
[bhelgaas: use bool consistently rather than mixing int/bool]
Reference: http://lkml.kernel.org/r/50841CCC.9030809@uli-eckhardt.de
Reported-by: Ulrich Eckhardt <usb@uli-eckhardt.de>
Tested-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/pci/pcie/portdrv_pci.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
--- a/drivers/pci/pcie/portdrv_pci.c
+++ b/drivers/pci/pcie/portdrv_pci.c
@@ -134,10 +134,28 @@ static int pcie_port_runtime_resume(stru
return 0;
}
+static int pci_dev_pme_poll(struct pci_dev *pdev, void *data)
+{
+ bool *pme_poll = data;
+
+ if (pdev->pme_poll)
+ *pme_poll = true;
+ return 0;
+}
+
static int pcie_port_runtime_idle(struct device *dev)
{
+ struct pci_dev *pdev = to_pci_dev(dev);
+ bool pme_poll = false;
+
+ /*
+ * If any subordinate device needs pme poll, we should keep
+ * the port in D0, because we need port in D0 to poll it.
+ */
+ pci_walk_bus(pdev->subordinate, pci_dev_pme_poll, &pme_poll);
/* Delay for a short while to prevent too frequent suspend/resume */
- pm_schedule_suspend(dev, 10);
+ if (!pme_poll)
+ pm_schedule_suspend(dev, 10);
return -EBUSY;
}
#else
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 107/123] PCI: Work around Stratus ftServer broken PCIe hierarchy (fix DMI check)
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (105 preceding siblings ...)
2013-01-09 20:35 ` [ 106/123] PCI/PM: Do not suspend port if any subordinate device needs PME polling Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 108/123] Bluetooth: Add support for BCM20702A0 [0b05, 17b5] Greg Kroah-Hartman
` (18 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Fadeeva Marina, Myron Stowe,
Bjorn Helgaas
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Myron Stowe <myron.stowe@redhat.com>
commit 1278998f8ff6d66044ed00b581bbf14aacaba215 upstream.
Commit 284f5f9 was intended to disable the "only_one_child()" optimization
on Stratus ftServer systems, but its DMI check is wrong. It looks for
DMI_SYS_VENDOR that contains "ftServer", when it should look for
DMI_SYS_VENDOR containing "Stratus" and DMI_PRODUCT_NAME containing
"ftServer".
Tested on Stratus ftServer 6400.
Reported-by: Fadeeva Marina <astarta@rat.ru>
Reference: https://bugzilla.kernel.org/show_bug.cgi?id=51331
Signed-off-by: Myron Stowe <myron.stowe@redhat.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/x86/pci/common.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -433,7 +433,8 @@ static const struct dmi_system_id __devi
.callback = set_scan_all,
.ident = "Stratus/NEC ftServer",
.matches = {
- DMI_MATCH(DMI_SYS_VENDOR, "ftServer"),
+ DMI_MATCH(DMI_SYS_VENDOR, "Stratus"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "ftServer"),
},
},
{}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 108/123] Bluetooth: Add support for BCM20702A0 [0b05, 17b5]
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (106 preceding siblings ...)
2013-01-09 20:35 ` [ 107/123] PCI: Work around Stratus ftServer broken PCIe hierarchy (fix DMI check) Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 109/123] Bluetooth: Add missing lock nesting notation Greg Kroah-Hartman
` (17 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Jeff Cook, Gustavo Padovan
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Cook <jeff@deserettechnology.com>
commit 1ee3ff6110c16acfc915a79b1e3feb5013c41e75 upstream.
Vendor-specific ID for BCM20702A0.
Support for bluetooth over Asus Wi-Fi GO!, included with Asus P8Z77-V
Deluxe.
T: Bus=07 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 3 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=0b05 ProdID=17b5 Rev=01.12
S: Manufacturer=Broadcom Corp
S: Product=BCM20702A0
S: SerialNumber=94DBC98AC113
C: #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=0mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
I: If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
I: If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)
Signed-off-by: Jeff Cook <jeff@deserettechnology.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/bluetooth/btusb.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -96,6 +96,7 @@ static struct usb_device_id btusb_table[
{ USB_DEVICE(0x0c10, 0x0000) },
/* Broadcom BCM20702A0 */
+ { USB_DEVICE(0x0b05, 0x17b5) },
{ USB_DEVICE(0x04ca, 0x2003) },
{ USB_DEVICE(0x0489, 0xe042) },
{ USB_DEVICE(0x413c, 0x8197) },
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 109/123] Bluetooth: Add missing lock nesting notation
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (107 preceding siblings ...)
2013-01-09 20:35 ` [ 108/123] Bluetooth: Add support for BCM20702A0 [0b05, 17b5] Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 110/123] Bluetooth: cancel power_on work when unregistering the device Greg Kroah-Hartman
` (16 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Gustavo Padovan
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
commit dc2a0e20fbc85a71c63aa4330b496fda33f6bf80 upstream.
This patch fixes the following report, it happens when accepting rfcomm
connections:
[ 228.165378] =============================================
[ 228.165378] [ INFO: possible recursive locking detected ]
[ 228.165378] 3.7.0-rc1-00536-gc1d5dc4 #120 Tainted: G W
[ 228.165378] ---------------------------------------------
[ 228.165378] bluetoothd/1341 is trying to acquire lock:
[ 228.165378] (sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM){+.+...}, at:
[<ffffffffa0000aa0>] bt_accept_dequeue+0xa0/0x180 [bluetooth]
[ 228.165378]
[ 228.165378] but task is already holding lock:
[ 228.165378] (sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM){+.+...}, at:
[<ffffffffa0205118>] rfcomm_sock_accept+0x58/0x2d0 [rfcomm]
[ 228.165378]
[ 228.165378] other info that might help us debug this:
[ 228.165378] Possible unsafe locking scenario:
[ 228.165378]
[ 228.165378] CPU0
[ 228.165378] ----
[ 228.165378] lock(sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM);
[ 228.165378] lock(sk_lock-AF_BLUETOOTH-BTPROTO_RFCOMM);
[ 228.165378]
[ 228.165378] *** DEADLOCK ***
[ 228.165378]
[ 228.165378] May be due to missing lock nesting notation
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/bluetooth/rfcomm/sock.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/net/bluetooth/rfcomm/sock.c
+++ b/net/bluetooth/rfcomm/sock.c
@@ -467,7 +467,7 @@ static int rfcomm_sock_accept(struct soc
long timeo;
int err = 0;
- lock_sock(sk);
+ lock_sock_nested(sk, SINGLE_DEPTH_NESTING);
if (sk->sk_type != SOCK_STREAM) {
err = -EINVAL;
@@ -504,7 +504,7 @@ static int rfcomm_sock_accept(struct soc
release_sock(sk);
timeo = schedule_timeout(timeo);
- lock_sock(sk);
+ lock_sock_nested(sk, SINGLE_DEPTH_NESTING);
}
__set_current_state(TASK_RUNNING);
remove_wait_queue(sk_sleep(sk), &wait);
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 110/123] Bluetooth: cancel power_on work when unregistering the device
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (108 preceding siblings ...)
2013-01-09 20:35 ` [ 109/123] Bluetooth: Add missing lock nesting notation Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 111/123] Revert "Bluetooth: Fix possible deadlock in SCO code" Greg Kroah-Hartman
` (15 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Sasha Levin, Gustavo Padovan
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
commit b9b5ef188e5a2222cfc16ef62a4703080750b451 upstream.
We need to cancel the hci_power_on work in order to avoid it run when we
try to free the hdev.
[ 1434.201149] ------------[ cut here ]------------
[ 1434.204998] WARNING: at lib/debugobjects.c:261 debug_print_object+0x8e/0xb0()
[ 1434.208324] ODEBUG: free active (active state 0) object type: work_struct hint: hci
_power_on+0x0/0x90
[ 1434.210386] Pid: 8564, comm: trinity-child25 Tainted: G W 3.7.0-rc5-next-
20121112-sasha-00018-g2f4ce0e #127
[ 1434.210760] Call Trace:
[ 1434.210760] [<ffffffff819f3d6e>] ? debug_print_object+0x8e/0xb0
[ 1434.210760] [<ffffffff8110b887>] warn_slowpath_common+0x87/0xb0
[ 1434.210760] [<ffffffff8110b911>] warn_slowpath_fmt+0x41/0x50
[ 1434.210760] [<ffffffff819f3d6e>] debug_print_object+0x8e/0xb0
[ 1434.210760] [<ffffffff8376b750>] ? hci_dev_open+0x310/0x310
[ 1434.210760] [<ffffffff83bf94e5>] ? _raw_spin_unlock_irqrestore+0x55/0xa0
[ 1434.210760] [<ffffffff819f3ee5>] __debug_check_no_obj_freed+0xa5/0x230
[ 1434.210760] [<ffffffff83785db0>] ? bt_host_release+0x10/0x20
[ 1434.210760] [<ffffffff819f4d15>] debug_check_no_obj_freed+0x15/0x20
[ 1434.210760] [<ffffffff8125eee7>] kfree+0x227/0x330
[ 1434.210760] [<ffffffff83785db0>] bt_host_release+0x10/0x20
[ 1434.210760] [<ffffffff81e539e5>] device_release+0x65/0xc0
[ 1434.210760] [<ffffffff819d3975>] kobject_cleanup+0x145/0x190
[ 1434.210760] [<ffffffff819d39cd>] kobject_release+0xd/0x10
[ 1434.210760] [<ffffffff819d33cc>] kobject_put+0x4c/0x60
[ 1434.210760] [<ffffffff81e548b2>] put_device+0x12/0x20
[ 1434.210760] [<ffffffff8376a334>] hci_free_dev+0x24/0x30
[ 1434.210760] [<ffffffff82fd8fe1>] vhci_release+0x31/0x60
[ 1434.210760] [<ffffffff8127be12>] __fput+0x122/0x250
[ 1434.210760] [<ffffffff811cab0d>] ? rcu_user_exit+0x9d/0xd0
[ 1434.210760] [<ffffffff8127bf49>] ____fput+0x9/0x10
[ 1434.210760] [<ffffffff81133402>] task_work_run+0xb2/0xf0
[ 1434.210760] [<ffffffff8106cfa7>] do_notify_resume+0x77/0xa0
[ 1434.210760] [<ffffffff83bfb0ea>] int_signal+0x12/0x17
[ 1434.210760] ---[ end trace a6d57fefbc8a8cc7 ]---
Reported-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/bluetooth/hci_core.c | 2 ++
1 file changed, 2 insertions(+)
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1793,6 +1793,8 @@ void hci_unregister_dev(struct hci_dev *
for (i = 0; i < NUM_REASSEMBLY; i++)
kfree_skb(hdev->reassembly[i]);
+ cancel_work_sync(&hdev->power_on);
+
if (!test_bit(HCI_INIT, &hdev->flags) &&
!test_bit(HCI_SETUP, &hdev->dev_flags)) {
hci_dev_lock(hdev);
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 111/123] Revert "Bluetooth: Fix possible deadlock in SCO code"
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (109 preceding siblings ...)
2013-01-09 20:35 ` [ 110/123] Bluetooth: cancel power_on work when unregistering the device Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 112/123] lib: atomic64: Initialize locks statically to fix early users Greg Kroah-Hartman
` (14 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Chan-yeol Park, Gustavo Padovan
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
commit 0b27a4b97cb1874503c78453c0903df53c0c86b2 upstream.
This reverts commit 269c4845d5b3627b95b1934107251bacbe99bb68.
The commit was causing dead locks and NULL dereferences in the sco code:
[28084.104013] BUG: soft lockup - CPU#0 stuck for 22s! [kworker/u:0H:7]
[28084.104021] Modules linked in: btusb bluetooth <snip [last unloaded:
bluetooth]
...
[28084.104021] [<c160246d>] _raw_spin_lock+0xd/0x10
[28084.104021] [<f920e708>] sco_conn_del+0x58/0x1b0 [bluetooth]
[28084.104021] [<f920f1a9>] sco_connect_cfm+0xb9/0x2b0 [bluetooth]
[28084.104021] [<f91ef289>]
hci_sync_conn_complete_evt.isra.94+0x1c9/0x260 [bluetooth]
[28084.104021] [<f91f1a8d>] hci_event_packet+0x74d/0x2b40 [bluetooth]
[28084.104021] [<c1501abd>] ? __kfree_skb+0x3d/0x90
[28084.104021] [<c1501b46>] ? kfree_skb+0x36/0x90
[28084.104021] [<f91fcb4e>] ? hci_send_to_monitor+0x10e/0x190 [bluetooth]
[28084.104021] [<f91fcb4e>] ? hci_send_to_monitor+0x10e/0x190 [bluetooth]
Reported-by: Chan-yeol Park <chanyeol.park@gmail.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/bluetooth/sco.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -131,15 +131,6 @@ static int sco_conn_del(struct hci_conn
sco_sock_clear_timer(sk);
sco_chan_del(sk, err);
bh_unlock_sock(sk);
-
- sco_conn_lock(conn);
- conn->sk = NULL;
- sco_pi(sk)->conn = NULL;
- sco_conn_unlock(conn);
-
- if (conn->hcon)
- hci_conn_put(conn->hcon);
-
sco_sock_kill(sk);
}
@@ -830,6 +821,16 @@ static void sco_chan_del(struct sock *sk
BT_DBG("sk %p, conn %p, err %d", sk, conn, err);
+ if (conn) {
+ sco_conn_lock(conn);
+ conn->sk = NULL;
+ sco_pi(sk)->conn = NULL;
+ sco_conn_unlock(conn);
+
+ if (conn->hcon)
+ hci_conn_put(conn->hcon);
+ }
+
sk->sk_state = BT_CLOSED;
sk->sk_err = err;
sk->sk_state_change(sk);
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 112/123] lib: atomic64: Initialize locks statically to fix early users
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (110 preceding siblings ...)
2013-01-09 20:35 ` [ 111/123] Revert "Bluetooth: Fix possible deadlock in SCO code" Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 113/123] proc: pid/status: show all supplementary groups Greg Kroah-Hartman
` (13 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Tony Lindgren, Eric W. Biederman,
Stephen Boyd, Linus Torvalds, Andrew Morton
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stephen Boyd <sboyd@codeaurora.org>
commit fcc16882ac4532aaa644bff444f0c5d6228ba71e upstream.
The atomic64 library uses a handful of static spin locks to implement
atomic 64-bit operations on architectures without support for atomic
64-bit instructions.
Unfortunately, the spinlocks are initialized in a pure initcall and that
is too late for the vfs namespace code which wants to use atomic64
operations before the initcall is run.
This became a problem as of commit 8823c079ba71: "vfs: Add setns support
for the mount namespace".
This leads to BUG messages such as:
BUG: spinlock bad magic on CPU#0, swapper/0/0
lock: atomic64_lock+0x240/0x400, .magic: 00000000, .owner: <none>/-1, .owner_cpu: 0
do_raw_spin_lock+0x158/0x198
_raw_spin_lock_irqsave+0x4c/0x58
atomic64_add_return+0x30/0x5c
alloc_mnt_ns.clone.14+0x44/0xac
create_mnt_ns+0xc/0x54
mnt_init+0x120/0x1d4
vfs_caches_init+0xe0/0x10c
start_kernel+0x29c/0x300
coming out early on during boot when spinlock debugging is enabled.
Fix this by initializing the spinlocks statically at compile time.
Reported-and-tested-by: Vaibhav Bedia <vaibhav.bedia@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
lib/atomic64.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
--- a/lib/atomic64.c
+++ b/lib/atomic64.c
@@ -31,7 +31,11 @@
static union {
raw_spinlock_t lock;
char pad[L1_CACHE_BYTES];
-} atomic64_lock[NR_LOCKS] __cacheline_aligned_in_smp;
+} atomic64_lock[NR_LOCKS] __cacheline_aligned_in_smp = {
+ [0 ... (NR_LOCKS - 1)] = {
+ .lock = __RAW_SPIN_LOCK_UNLOCKED(atomic64_lock.lock),
+ },
+};
static inline raw_spinlock_t *lock_addr(const atomic64_t *v)
{
@@ -173,14 +177,3 @@ int atomic64_add_unless(atomic64_t *v, l
return ret;
}
EXPORT_SYMBOL(atomic64_add_unless);
-
-static int init_atomic64_lock(void)
-{
- int i;
-
- for (i = 0; i < NR_LOCKS; ++i)
- raw_spin_lock_init(&atomic64_lock[i].lock);
- return 0;
-}
-
-pure_initcall(init_atomic64_lock);
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 113/123] proc: pid/status: show all supplementary groups
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (111 preceding siblings ...)
2013-01-09 20:35 ` [ 112/123] lib: atomic64: Initialize locks statically to fix early users Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 114/123] CRIS: fix I/O macros Greg Kroah-Hartman
` (12 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Artem Bityutskiy, Serge E. Hallyn,
Kees Cook, Andrew Morton, Linus Torvalds
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
commit 8d238027b87e654be552eabdf492042a34c5c300 upstream.
We display a list of supplementary group for each process in
/proc/<pid>/status. However, we show only the first 32 groups, not all of
them.
Although this is rare, but sometimes processes do have more than 32
supplementary groups, and this kernel limitation breaks user-space apps
that rely on the group list in /proc/<pid>/status.
Number 32 comes from the internal NGROUPS_SMALL macro which defines the
length for the internal kernel "small" groups buffer. There is no
apparent reason to limit to this value.
This patch removes the 32 groups printing limit.
The Linux kernel limits the amount of supplementary groups by NGROUPS_MAX,
which is currently set to 65536. And this is the maximum count of groups
we may possibly print.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/proc/array.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -212,7 +212,7 @@ static inline void task_state(struct seq
group_info = cred->group_info;
task_unlock(p);
- for (g = 0; g < min(group_info->ngroups, NGROUPS_SMALL); g++)
+ for (g = 0; g < group_info->ngroups; g++)
seq_printf(m, "%d ",
from_kgid_munged(user_ns, GROUP_AT(group_info, g)));
put_cred(cred);
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 114/123] CRIS: fix I/O macros
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (112 preceding siblings ...)
2013-01-09 20:35 ` [ 113/123] proc: pid/status: show all supplementary groups Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 115/123] revert "rtc: recycle id when unloading a rtc driver" Greg Kroah-Hartman
` (11 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Corey Minyard, Jesper Nilsson,
Mikael Starvik, Geert Uytterhoeven, Andrew Morton, Linus Torvalds
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Corey Minyard <cminyard@mvista.com>
commit c24bf9b4cc6a0f330ea355d73bfdf1dae7e63a05 upstream.
The inb/outb macros for CRIS are broken from a number of points of view,
missing () around parameters and they have an unprotected if statement
in them. This was breaking the compile of IPMI on CRIS and thus I was
being annoyed by build regressions, so I fixed them.
Plus I don't think they would have worked at all, since the data values
were missing "&" and the outsl had a "3" instead of a "4" for the size.
>>From what I can tell, this stuff is not used at all, so this can't be
any more broken than it was before, anyway.
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Mikael Starvik <starvik@axis.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/cris/include/asm/io.h | 39 +++++++++++++++++++++++++++++++++------
1 file changed, 33 insertions(+), 6 deletions(-)
--- a/arch/cris/include/asm/io.h
+++ b/arch/cris/include/asm/io.h
@@ -133,12 +133,39 @@ static inline void writel(unsigned int b
#define insb(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,1,count) : 0)
#define insw(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,2,count) : 0)
#define insl(port,addr,count) (cris_iops ? cris_iops->read_io(port,addr,4,count) : 0)
-#define outb(data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,1,1)
-#define outw(data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,2,1)
-#define outl(data,port) if (cris_iops) cris_iops->write_io(port,(void*)(unsigned)data,4,1)
-#define outsb(port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,1,count)
-#define outsw(port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,2,count)
-#define outsl(port,addr,count) if(cris_iops) cris_iops->write_io(port,(void*)addr,3,count)
+static inline void outb(unsigned char data, unsigned int port)
+{
+ if (cris_iops)
+ cris_iops->write_io(port, (void *) &data, 1, 1);
+}
+static inline void outw(unsigned short data, unsigned int port)
+{
+ if (cris_iops)
+ cris_iops->write_io(port, (void *) &data, 2, 1);
+}
+static inline void outl(unsigned int data, unsigned int port)
+{
+ if (cris_iops)
+ cris_iops->write_io(port, (void *) &data, 4, 1);
+}
+static inline void outsb(unsigned int port, const void *addr,
+ unsigned long count)
+{
+ if (cris_iops)
+ cris_iops->write_io(port, (void *)addr, 1, count);
+}
+static inline void outsw(unsigned int port, const void *addr,
+ unsigned long count)
+{
+ if (cris_iops)
+ cris_iops->write_io(port, (void *)addr, 2, count);
+}
+static inline void outsl(unsigned int port, const void *addr,
+ unsigned long count)
+{
+ if (cris_iops)
+ cris_iops->write_io(port, (void *)addr, 4, count);
+}
/*
* Convert a physical pointer to a virtual kernel pointer for /dev/mem
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 115/123] revert "rtc: recycle id when unloading a rtc driver"
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (113 preceding siblings ...)
2013-01-09 20:35 ` [ 114/123] CRIS: fix I/O macros Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 116/123] drivers/rtc/rtc-vt8500.c: correct handling of CR_24H bitfield Greg Kroah-Hartman
` (10 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Lothar Waßmann, Alexander Holler,
Vincent Palatin, Andrew Morton, Linus Torvalds
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Morton <akpm@linux-foundation.org>
commit 5abe257af8b95857b95fa0ba694530b446ae32d8 upstream.
Revert commit 2830a6d20139df2198d63235df7957712adb28e5.
We already perform the ida_simple_remove() in rtc_device_release(),
which is an appropriate place. Commit 2830a6d20 ("rtc: recycle id when
unloading a rtc driver") caused the kernel to emit
ida_remove called for id=0 which is not allocated.
warnings when rtc_device_release() tries to release an alread-released
ID.
Let's restore things to their previous state and then work out why
Vincent's kernel wasn't calling rtc_device_release() - presumably a bug
in a specific sub-driver.
Reported-by: Lothar Waßmann <LW@KARO-electronics.de>
Acked-by: Alexander Holler <holler@ahsoftware.de>
Cc: Vincent Palatin <vpalatin@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/rtc/class.c | 1 -
1 file changed, 1 deletion(-)
--- a/drivers/rtc/class.c
+++ b/drivers/rtc/class.c
@@ -244,7 +244,6 @@ void rtc_device_unregister(struct rtc_de
rtc_proc_del_device(rtc);
device_unregister(&rtc->dev);
rtc->ops = NULL;
- ida_simple_remove(&rtc_ida, rtc->id);
mutex_unlock(&rtc->ops_lock);
put_device(&rtc->dev);
}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 116/123] drivers/rtc/rtc-vt8500.c: correct handling of CR_24H bitfield
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (114 preceding siblings ...)
2013-01-09 20:35 ` [ 115/123] revert "rtc: recycle id when unloading a rtc driver" Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 117/123] drivers/rtc/rtc-vt8500.c: fix handling of data passed in struct rtc_time Greg Kroah-Hartman
` (9 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Tony Prisk, Edgar Toernig,
Andrew Morton, Linus Torvalds
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Prisk <linux@prisktech.co.nz>
commit 532db570e5181abc8f4f7bfa6c77c69ec2240198 upstream.
Control register bitfield for 12H/24H mode is handled incorrectly.
Setting CR_24H actually enables 12H mode. This patch renames the define
and changes the initialization code to correctly set 24H mode.
Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
Cc: Edgar Toernig <froese@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/rtc/rtc-vt8500.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/rtc/rtc-vt8500.c
+++ b/drivers/rtc/rtc-vt8500.c
@@ -70,7 +70,7 @@
| ALARM_SEC_BIT)
#define VT8500_RTC_CR_ENABLE (1 << 0) /* Enable RTC */
-#define VT8500_RTC_CR_24H (1 << 1) /* 24h time format */
+#define VT8500_RTC_CR_12H (1 << 1) /* 12h time format */
#define VT8500_RTC_CR_SM_ENABLE (1 << 2) /* Enable periodic irqs */
#define VT8500_RTC_CR_SM_SEC (1 << 3) /* 0: 1Hz/60, 1: 1Hz */
#define VT8500_RTC_CR_CALIB (1 << 4) /* Enable calibration */
@@ -249,7 +249,7 @@ static int __devinit vt8500_rtc_probe(st
}
/* Enable RTC and set it to 24-hour mode */
- writel(VT8500_RTC_CR_ENABLE | VT8500_RTC_CR_24H,
+ writel(VT8500_RTC_CR_ENABLE,
vt8500_rtc->regbase + VT8500_RTC_CR);
vt8500_rtc->rtc = rtc_device_register("vt8500-rtc", &pdev->dev,
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 117/123] drivers/rtc/rtc-vt8500.c: fix handling of data passed in struct rtc_time
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (115 preceding siblings ...)
2013-01-09 20:35 ` [ 116/123] drivers/rtc/rtc-vt8500.c: correct handling of CR_24H bitfield Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 118/123] mm: limit mmu_gather batching to fix soft lockups on !CONFIG_PREEMPT Greg Kroah-Hartman
` (8 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Edgar Toernig, Tony Prisk,
Andrew Morton, Linus Torvalds
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Prisk <linux@prisktech.co.nz>
commit 2f90b68309683f2c5765a1b04ca23d71e51f1494 upstream.
tm_mon is 0..11, whereas vt8500 expects 1..12 for the month field,
causing invalid date errors for January, and causing the day field to
roll over incorrectly.
The century flag is only handled in vt8500_rtc_read_time, but not set in
vt8500_rtc_set_time. This patch corrects the behaviour of the century
flag.
Signed-off-by: Edgar Toernig <froese@gmx.de>
Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/rtc/rtc-vt8500.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--- a/drivers/rtc/rtc-vt8500.c
+++ b/drivers/rtc/rtc-vt8500.c
@@ -119,7 +119,7 @@ static int vt8500_rtc_read_time(struct d
tm->tm_min = bcd2bin((time & TIME_MIN_MASK) >> TIME_MIN_S);
tm->tm_hour = bcd2bin((time & TIME_HOUR_MASK) >> TIME_HOUR_S);
tm->tm_mday = bcd2bin(date & DATE_DAY_MASK);
- tm->tm_mon = bcd2bin((date & DATE_MONTH_MASK) >> DATE_MONTH_S);
+ tm->tm_mon = bcd2bin((date & DATE_MONTH_MASK) >> DATE_MONTH_S) - 1;
tm->tm_year = bcd2bin((date & DATE_YEAR_MASK) >> DATE_YEAR_S)
+ ((date >> DATE_CENTURY_S) & 1 ? 200 : 100);
tm->tm_wday = (time & TIME_DOW_MASK) >> TIME_DOW_S;
@@ -138,8 +138,9 @@ static int vt8500_rtc_set_time(struct de
}
writel((bin2bcd(tm->tm_year - 100) << DATE_YEAR_S)
- | (bin2bcd(tm->tm_mon) << DATE_MONTH_S)
- | (bin2bcd(tm->tm_mday)),
+ | (bin2bcd(tm->tm_mon + 1) << DATE_MONTH_S)
+ | (bin2bcd(tm->tm_mday))
+ | ((tm->tm_year >= 200) << DATE_CENTURY_S),
vt8500_rtc->regbase + VT8500_RTC_DS);
writel((bin2bcd(tm->tm_wday) << TIME_DOW_S)
| (bin2bcd(tm->tm_hour) << TIME_HOUR_S)
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 118/123] mm: limit mmu_gather batching to fix soft lockups on !CONFIG_PREEMPT
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (116 preceding siblings ...)
2013-01-09 20:35 ` [ 117/123] drivers/rtc/rtc-vt8500.c: fix handling of data passed in struct rtc_time Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 119/123] linux/kernel.h: fix DIV_ROUND_CLOSEST with unsigned divisors Greg Kroah-Hartman
` (7 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Michal Hocko, Mel Gorman, Rik van Riel,
Peter Zijlstra, Andrew Morton, Linus Torvalds
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Hocko <mhocko@suse.cz>
commit 53a59fc67f97374758e63a9c785891ec62324c81 upstream.
Since commit e303297e6c3a ("mm: extended batches for generic
mmu_gather") we are batching pages to be freed until either
tlb_next_batch cannot allocate a new batch or we are done.
This works just fine most of the time but we can get in troubles with
non-preemptible kernel (CONFIG_PREEMPT_NONE or CONFIG_PREEMPT_VOLUNTARY)
on large machines where too aggressive batching might lead to soft
lockups during process exit path (exit_mmap) because there are no
scheduling points down the free_pages_and_swap_cache path and so the
freeing can take long enough to trigger the soft lockup.
The lockup is harmless except when the system is setup to panic on
softlockup which is not that unusual.
The simplest way to work around this issue is to limit the maximum
number of batches in a single mmu_gather. 10k of collected pages should
be safe to prevent from soft lockups (we would have 2ms for one) even if
they are all freed without an explicit scheduling point.
This patch doesn't add any new explicit scheduling points because it
relies on zap_pmd_range during page tables zapping which calls
cond_resched per PMD.
The following lockup has been reported for 3.0 kernel with a huge
process (in order of hundreds gigs but I do know any more details).
BUG: soft lockup - CPU#56 stuck for 22s! [kernel:31053]
Modules linked in: af_packet nfs lockd fscache auth_rpcgss nfs_acl sunrpc mptctl mptbase autofs4 binfmt_misc dm_round_robin dm_multipath bonding cpufreq_conservative cpufreq_userspace cpufreq_powersave pcc_cpufreq mperf microcode fuse loop osst sg sd_mod crc_t10dif st qla2xxx scsi_transport_fc scsi_tgt netxen_nic i7core_edac iTCO_wdt joydev e1000e serio_raw pcspkr edac_core iTCO_vendor_support acpi_power_meter rtc_cmos hpwdt hpilo button container usbhid hid dm_mirror dm_region_hash dm_log linear uhci_hcd ehci_hcd usbcore usb_common scsi_dh_emc scsi_dh_alua scsi_dh_hp_sw scsi_dh_rdac scsi_dh dm_snapshot pcnet32 mii edd dm_mod raid1 ext3 mbcache jbd fan thermal processor thermal_sys hwmon cciss scsi_mod
Supported: Yes
CPU 56
Pid: 31053, comm: kernel Not tainted 3.0.31-0.9-default #1 HP ProLiant DL580 G7
RIP: 0010: _raw_spin_unlock_irqrestore+0x8/0x10
RSP: 0018:ffff883ec1037af0 EFLAGS: 00000206
RAX: 0000000000000e00 RBX: ffffea01a0817e28 RCX: ffff88803ffd9e80
RDX: 0000000000000200 RSI: 0000000000000206 RDI: 0000000000000206
RBP: 0000000000000002 R08: 0000000000000001 R09: ffff887ec724a400
R10: 0000000000000000 R11: dead000000200200 R12: ffffffff8144c26e
R13: 0000000000000030 R14: 0000000000000297 R15: 000000000000000e
FS: 00007ed834282700(0000) GS:ffff88c03f200000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 000000000068b240 CR3: 0000003ec13c5000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process kernel (pid: 31053, threadinfo ffff883ec1036000, task ffff883ebd5d4100)
Call Trace:
release_pages+0xc5/0x260
free_pages_and_swap_cache+0x9d/0xc0
tlb_flush_mmu+0x5c/0x80
tlb_finish_mmu+0xe/0x50
exit_mmap+0xbd/0x120
mmput+0x49/0x120
exit_mm+0x122/0x160
do_exit+0x17a/0x430
do_group_exit+0x3d/0xb0
get_signal_to_deliver+0x247/0x480
do_signal+0x71/0x1b0
do_notify_resume+0x98/0xb0
int_signal+0x12/0x17
DWARF2 unwinder stuck at int_signal+0x12/0x17
Signed-off-by: Michal Hocko <mhocko@suse.cz>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Rik van Riel <riel@redhat.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/asm-generic/tlb.h | 9 +++++++++
mm/memory.c | 5 +++++
2 files changed, 14 insertions(+)
--- a/include/asm-generic/tlb.h
+++ b/include/asm-generic/tlb.h
@@ -78,6 +78,14 @@ struct mmu_gather_batch {
#define MAX_GATHER_BATCH \
((PAGE_SIZE - sizeof(struct mmu_gather_batch)) / sizeof(void *))
+/*
+ * Limit the maximum number of mmu_gather batches to reduce a risk of soft
+ * lockups for non-preemptible kernels on huge machines when a lot of memory
+ * is zapped during unmapping.
+ * 10K pages freed at once should be safe even without a preemption point.
+ */
+#define MAX_GATHER_BATCH_COUNT (10000UL/MAX_GATHER_BATCH)
+
/* struct mmu_gather is an opaque type used by the mm code for passing around
* any data needed by arch specific code for tlb_remove_page.
*/
@@ -96,6 +104,7 @@ struct mmu_gather {
struct mmu_gather_batch *active;
struct mmu_gather_batch local;
struct page *__pages[MMU_GATHER_BUNDLE];
+ unsigned int batch_count;
};
#define HAVE_GENERIC_MMU_GATHER
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -182,10 +182,14 @@ static int tlb_next_batch(struct mmu_gat
return 1;
}
+ if (tlb->batch_count == MAX_GATHER_BATCH_COUNT)
+ return 0;
+
batch = (void *)__get_free_pages(GFP_NOWAIT | __GFP_NOWARN, 0);
if (!batch)
return 0;
+ tlb->batch_count++;
batch->next = NULL;
batch->nr = 0;
batch->max = MAX_GATHER_BATCH;
@@ -214,6 +218,7 @@ void tlb_gather_mmu(struct mmu_gather *t
tlb->local.nr = 0;
tlb->local.max = ARRAY_SIZE(tlb->__pages);
tlb->active = &tlb->local;
+ tlb->batch_count = 0;
#ifdef CONFIG_HAVE_RCU_TABLE_FREE
tlb->batch = NULL;
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 119/123] linux/kernel.h: fix DIV_ROUND_CLOSEST with unsigned divisors
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (117 preceding siblings ...)
2013-01-09 20:35 ` [ 118/123] mm: limit mmu_gather batching to fix soft lockups on !CONFIG_PREEMPT Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:35 ` [ 120/123] HID: Add Apple wireless keyboard 2011 ANSI to special driver list Greg Kroah-Hartman
` (6 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Guenter Roeck, Juergen Beisert,
Jean Delvare, Andrew Morton, Linus Torvalds
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Guenter Roeck <linux@roeck-us.net>
commit c4e18497d8fd92eef2c6e7eadcc1a107ccd115ea upstream.
Commit 263a523d18bc ("linux/kernel.h: Fix warning seen with W=1 due to
change in DIV_ROUND_CLOSEST") fixes a warning seen with W=1 due to
change in DIV_ROUND_CLOSEST.
Unfortunately, the C compiler converts divide operations with unsigned
divisors to unsigned, even if the dividend is signed and negative (for
example, -10 / 5U = 858993457). The C standard says "If one operand has
unsigned int type, the other operand is converted to unsigned int", so
the compiler is not to blame. As a result, DIV_ROUND_CLOSEST(0, 2U) and
similar operations now return bad values, since the automatic conversion
of expressions such as "0 - 2U/2" to unsigned was not taken into
account.
Fix by checking for the divisor variable type when deciding which
operation to perform. This fixes DIV_ROUND_CLOSEST(0, 2U), but still
returns bad values for negative dividends divided by unsigned divisors.
Mark the latter case as unsupported.
One observed effect of this problem is that the s2c_hwmon driver reports
a value of 4198403 instead of 0 if the ADC reads 0.
Other impact is unpredictable. Problem is seen if the divisor is an
unsigned variable or constant and the dividend is less than (divisor/2).
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reported-by: Juergen Beisert <jbe@pengutronix.de>
Tested-by: Juergen Beisert <jbe@pengutronix.de>
Cc: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
include/linux/kernel.h | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -77,13 +77,15 @@
/*
* Divide positive or negative dividend by positive divisor and round
- * to closest integer. Result is undefined for negative divisors.
+ * to closest integer. Result is undefined for negative divisors and
+ * for negative dividends if the divisor variable type is unsigned.
*/
#define DIV_ROUND_CLOSEST(x, divisor)( \
{ \
typeof(x) __x = x; \
typeof(divisor) __d = divisor; \
- (((typeof(x))-1) > 0 || (__x) > 0) ? \
+ (((typeof(x))-1) > 0 || \
+ ((typeof(divisor))-1) > 0 || (__x) > 0) ? \
(((__x) + ((__d) / 2)) / (__d)) : \
(((__x) - ((__d) / 2)) / (__d)); \
} \
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 120/123] HID: Add Apple wireless keyboard 2011 ANSI to special driver list
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (118 preceding siblings ...)
2013-01-09 20:35 ` [ 119/123] linux/kernel.h: fix DIV_ROUND_CLOSEST with unsigned divisors Greg Kroah-Hartman
@ 2013-01-09 20:35 ` Greg Kroah-Hartman
2013-01-09 20:36 ` [ 121/123] can: Do not call dev_put if restart timer is running upon close Greg Kroah-Hartman
` (5 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:35 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Ari Pollak, Ben Hutchings, Jiri Kosina
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ben Hutchings <ben@decadent.org.uk>
commit f9af7b9edccb87d4d80b58687ab63e58f3b64c4c upstream.
Commit 0a97e1e9f9a6 ('HID: apple: Add Apple wireless keyboard 2011 ANSI PID')
did not update the special driver list in hid-core.c, so hid-generic may
still bind to this device.
Reported-by: Ari Pollak <ari@scvngr.com>
References: http://bugs.debian.org/694546
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/hid/hid-core.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1538,6 +1538,7 @@ static const struct hid_device_id hid_ha
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) },
+ { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ANSI) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_ISO) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) },
{ HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 121/123] can: Do not call dev_put if restart timer is running upon close
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (119 preceding siblings ...)
2013-01-09 20:35 ` [ 120/123] HID: Add Apple wireless keyboard 2011 ANSI to special driver list Greg Kroah-Hartman
@ 2013-01-09 20:36 ` Greg Kroah-Hartman
2013-01-09 20:36 ` [ 122/123] cifs: rename cifs_readdir_lookup to cifs_prime_dcache and make it void return Greg Kroah-Hartman
` (4 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:36 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Greg Kroah-Hartman, alan, Alexander Stein, Marc Kleine-Budde
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Stein <alexander.stein@systec-electronic.com>
commit ab48b03ec9ae1840a1e427e2375bd0d9d554b4ed upstream.
If the restart timer is running due to BUS-OFF and the device is
disconnected an dev_put will decrease the usage counter to -1 thus
blocking the interface removal, resulting in the following dmesg
lines repeating every 10s:
can: notifier: receive list not found for dev can0
can: notifier: receive list not found for dev can0
can: notifier: receive list not found for dev can0
unregister_netdevice: waiting for can0 to become free. Usage count = -1
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/can/dev.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -609,8 +609,7 @@ void close_candev(struct net_device *dev
{
struct can_priv *priv = netdev_priv(dev);
- if (del_timer_sync(&priv->restart_timer))
- dev_put(dev);
+ del_timer_sync(&priv->restart_timer);
can_flush_echo_skb(dev);
}
EXPORT_SYMBOL_GPL(close_candev);
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 122/123] cifs: rename cifs_readdir_lookup to cifs_prime_dcache and make it void return
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (120 preceding siblings ...)
2013-01-09 20:36 ` [ 121/123] can: Do not call dev_put if restart timer is running upon close Greg Kroah-Hartman
@ 2013-01-09 20:36 ` Greg Kroah-Hartman
2013-01-09 20:36 ` [ 123/123] cifs: dont compare uniqueids in cifs_prime_dcache unless server inode numbers are in use Greg Kroah-Hartman
` (3 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:36 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Jeff Layton, Steve French
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <jlayton@redhat.com>
commit eb1b3fa5cdb9c27bdec8f262acf757a06588eb2d upstream.
The caller doesn't do anything with the dentry, so there's no point in
holding a reference to it on return. Also cifs_prime_dcache better
describes the actual purpose of the function.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/cifs/readdir.c | 42 ++++++++++++++++++------------------------
1 file changed, 18 insertions(+), 24 deletions(-)
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -66,18 +66,20 @@ static inline void dump_cifs_file_struct
#endif /* DEBUG2 */
/*
+ * Attempt to preload the dcache with the results from the FIND_FIRST/NEXT
+ *
* Find the dentry that matches "name". If there isn't one, create one. If it's
* a negative dentry or the uniqueid changed, then drop it and recreate it.
*/
-static struct dentry *
-cifs_readdir_lookup(struct dentry *parent, struct qstr *name,
+static void
+cifs_prime_dcache(struct dentry *parent, struct qstr *name,
struct cifs_fattr *fattr)
{
struct dentry *dentry, *alias;
struct inode *inode;
struct super_block *sb = parent->d_inode->i_sb;
- cFYI(1, "For %s", name->name);
+ cFYI(1, "%s: for %s", __func__, name->name);
if (parent->d_op && parent->d_op->d_hash)
parent->d_op->d_hash(parent, parent->d_inode, name);
@@ -87,37 +89,32 @@ cifs_readdir_lookup(struct dentry *paren
dentry = d_lookup(parent, name);
if (dentry) {
int err;
+
inode = dentry->d_inode;
/* update inode in place if i_ino didn't change */
if (inode && CIFS_I(inode)->uniqueid == fattr->cf_uniqueid) {
cifs_fattr_to_inode(inode, fattr);
- return dentry;
+ goto out;
}
err = d_invalidate(dentry);
dput(dentry);
if (err)
- return NULL;
+ return;
}
dentry = d_alloc(parent, name);
- if (dentry == NULL)
- return NULL;
+ if (!dentry)
+ return;
inode = cifs_iget(sb, fattr);
- if (!inode) {
- dput(dentry);
- return NULL;
- }
+ if (!inode)
+ goto out;
alias = d_materialise_unique(dentry, inode);
- if (alias != NULL) {
- dput(dentry);
- if (IS_ERR(alias))
- return NULL;
- dentry = alias;
- }
-
- return dentry;
+ if (alias && !IS_ERR(alias))
+ dput(alias);
+out:
+ dput(dentry);
}
static void
@@ -652,7 +649,6 @@ static int cifs_filldir(char *find_entry
struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
struct cifs_dirent de = { NULL, };
struct cifs_fattr fattr;
- struct dentry *dentry;
struct qstr name;
int rc = 0;
ino_t ino;
@@ -723,13 +719,11 @@ static int cifs_filldir(char *find_entry
*/
fattr.cf_flags |= CIFS_FATTR_NEED_REVAL;
- ino = cifs_uniqueid_to_ino_t(fattr.cf_uniqueid);
- dentry = cifs_readdir_lookup(file->f_dentry, &name, &fattr);
+ cifs_prime_dcache(file->f_dentry, &name, &fattr);
+ ino = cifs_uniqueid_to_ino_t(fattr.cf_uniqueid);
rc = filldir(dirent, name.name, name.len, file->f_pos, ino,
fattr.cf_dtype);
-
- dput(dentry);
return rc;
}
^ permalink raw reply [flat|nested] 131+ messages in thread
* [ 123/123] cifs: dont compare uniqueids in cifs_prime_dcache unless server inode numbers are in use
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (121 preceding siblings ...)
2013-01-09 20:36 ` [ 122/123] cifs: rename cifs_readdir_lookup to cifs_prime_dcache and make it void return Greg Kroah-Hartman
@ 2013-01-09 20:36 ` Greg Kroah-Hartman
2013-01-10 15:32 ` [ 000/123] 3.7.2-stable review Paul Bolle
` (2 subsequent siblings)
125 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-09 20:36 UTC (permalink / raw)
To: linux-kernel, stable; +Cc: Greg Kroah-Hartman, alan, Jeff Layton, Steve French
3.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jeff Layton <jlayton@redhat.com>
commit 2f2591a34db6c9361faa316c91a6e320cb4e6aee upstream.
Oliver reported that commit cd60042c caused his cifs mounts to
continually thrash through new inodes on readdir. His servers are not
sending inode numbers (or he's not using them), and the new test in
that function doesn't account for that sort of setup correctly.
If we're not using server inode numbers, then assume that the inode
attached to the dentry hasn't changed. Go ahead and update the
attributes in place, but keep the same inode number.
Reported-and-Tested-by: Oliver Mössinger <Oliver.Moessinger@ichaus.de>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
fs/cifs/readdir.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -78,6 +78,7 @@ cifs_prime_dcache(struct dentry *parent,
struct dentry *dentry, *alias;
struct inode *inode;
struct super_block *sb = parent->d_inode->i_sb;
+ struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
cFYI(1, "%s: for %s", __func__, name->name);
@@ -91,10 +92,20 @@ cifs_prime_dcache(struct dentry *parent,
int err;
inode = dentry->d_inode;
- /* update inode in place if i_ino didn't change */
- if (inode && CIFS_I(inode)->uniqueid == fattr->cf_uniqueid) {
- cifs_fattr_to_inode(inode, fattr);
- goto out;
+ if (inode) {
+ /*
+ * If we're generating inode numbers, then we don't
+ * want to clobber the existing one with the one that
+ * the readdir code created.
+ */
+ if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM))
+ fattr->cf_uniqueid = CIFS_I(inode)->uniqueid;
+
+ /* update inode in place if i_ino didn't change */
+ if (CIFS_I(inode)->uniqueid == fattr->cf_uniqueid) {
+ cifs_fattr_to_inode(inode, fattr);
+ goto out;
+ }
}
err = d_invalidate(dentry);
dput(dentry);
^ permalink raw reply [flat|nested] 131+ messages in thread
* Re: [ 000/123] 3.7.2-stable review
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (122 preceding siblings ...)
2013-01-09 20:36 ` [ 123/123] cifs: dont compare uniqueids in cifs_prime_dcache unless server inode numbers are in use Greg Kroah-Hartman
@ 2013-01-10 15:32 ` Paul Bolle
2013-01-10 15:56 ` Paul Bolle
2013-01-10 18:04 ` Shuah Khan
2013-01-11 14:43 ` Satoru Takeuchi
125 siblings, 1 reply; 131+ messages in thread
From: Paul Bolle @ 2013-01-10 15:32 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, stable, torvalds, akpm, alan
On Wed, 2013-01-09 at 12:33 -0800, Greg Kroah-Hartman wrote:
> Note, there are still a lot of patches submitted for inclusion in the
> stable releases that I have not gotten to yet. I wanted to get this
> release out now, instead of delaying for a week or so while I dig
> through all of the pending patches.
>
> This is the start of the stable review cycle for the 3.7.2 release.
> There are 123 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 Fri Jan 11 20:11:16 UTC 2013.
> Anything received after that time might be too late.
My first build of v3.7.2-rc1 panics at boot (on x86_64). I haven't
investigated in depth what happened, so this can even be something dumb
on my side during build. For what's worth the (last?) backtrace starts
with (copied manually):
WARNING at arch/x86/kernel/apic/ipi.c:113 default_send_IPI_mask_logical+0xde/0xf0().
But there seems to be preceding trouble.
I hope to dive in deeper later this day (perhaps I can catch this panic
over a serial line). Currently I have no idea what's going on.
Paul Bolle
^ permalink raw reply [flat|nested] 131+ messages in thread
* Re: [ 000/123] 3.7.2-stable review
2013-01-10 15:32 ` [ 000/123] 3.7.2-stable review Paul Bolle
@ 2013-01-10 15:56 ` Paul Bolle
0 siblings, 0 replies; 131+ messages in thread
From: Paul Bolle @ 2013-01-10 15:56 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, stable, torvalds, akpm, alan
On Thu, 2013-01-10 at 16:32 +0100, Paul Bolle wrote:
> I haven't investigated in depth what happened, so this can even be something dumb
> on my side during build.
Not during build but definitely dumb and on my side. (Please don't ask.)
Apologies for the noise.
Paul Bolle
^ permalink raw reply [flat|nested] 131+ messages in thread
* Re: [ 000/123] 3.7.2-stable review
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (123 preceding siblings ...)
2013-01-10 15:32 ` [ 000/123] 3.7.2-stable review Paul Bolle
@ 2013-01-10 18:04 ` Shuah Khan
2013-01-10 19:45 ` Jonathan Nieder
2013-01-11 14:43 ` Satoru Takeuchi
125 siblings, 1 reply; 131+ messages in thread
From: Shuah Khan @ 2013-01-10 18:04 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, stable, torvalds, akpm, alan
On Wed, Jan 9, 2013 at 1:33 PM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> Note, there are still a lot of patches submitted for inclusion in the
> stable releases that I have not gotten to yet. I wanted to get this
> release out now, instead of delaying for a week or so while I dig
> through all of the pending patches.
>
> This is the start of the stable review cycle for the 3.7.2 release.
> There are 123 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 Fri Jan 11 20:11:16 UTC 2013.
> 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.7.2-rc1.gz
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h
Patches applied cleanly to 3.0.y, 3.4.y, and 3.7.y.
Compiled and booted on the following systems:
HP EliteBook 6930p Intel(R) Core(TM)2 Duo CPU T9400 @ 2.53GHz
HP ProBook 6475b AMD A10-4600M APU with Radeon(tm) HD Graphics
Cross-compile tests:
alpha: defconfig passed on all
arm: defconfig passed on all
arm64: not applicable to 3.0.y, 3.4.y. defconfig passed on 3.7.y
c6x: not applicable to 3.0.y, defconfig passed on the rest three
mips: defconfig passed on all
mipsel: defconfig passed on all
powerpc: wii_defconfig passed on all
sh: defconfig passed on all
sparc: defconfig passed on all
tile: tilegx_defconfig passed on all
-- Shuah
^ permalink raw reply [flat|nested] 131+ messages in thread
* Re: [ 000/123] 3.7.2-stable review
2013-01-10 18:04 ` Shuah Khan
@ 2013-01-10 19:45 ` Jonathan Nieder
0 siblings, 0 replies; 131+ messages in thread
From: Jonathan Nieder @ 2013-01-10 19:45 UTC (permalink / raw)
To: Shuah Khan; +Cc: Greg Kroah-Hartman, linux-kernel, stable, torvalds, akpm, alan
Shuah Khan wrote:
> Patches applied cleanly to 3.0.y, 3.4.y, and 3.7.y.
> Compiled and booted on the following systems:
> HP EliteBook 6930p Intel(R) Core(TM)2 Duo CPU T9400 @ 2.53GHz
> HP ProBook 6475b AMD A10-4600M APU with Radeon(tm) HD Graphics
>
> Cross-compile tests:
Thanks much for these sanity checks.
^ permalink raw reply [flat|nested] 131+ messages in thread
* Re: [ 004/123] b43legacy: Fix firmware loading when driver is built into the kernel
2013-01-09 20:34 ` [ 004/123] b43legacy: Fix firmware loading when driver is built into the kernel Greg Kroah-Hartman
@ 2013-01-11 3:47 ` Ben Hutchings
2013-01-11 13:38 ` Greg Kroah-Hartman
0 siblings, 1 reply; 131+ messages in thread
From: Ben Hutchings @ 2013-01-11 3:47 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: linux-kernel, stable, alan, Larry Finger, John W. Linville
[-- Attachment #1: Type: text/plain, Size: 655 bytes --]
On Wed, 2013-01-09 at 12:34 -0800, Greg Kroah-Hartman wrote:
> 3.7-stable review patch. If anyone has any objections, please let me know.
>
> ------------------
>
> From: Larry Finger <Larry.Finger@lwfinger.net>
>
> commit 576d28a7c73013717311cfcb514dbcae27c82eeb upstream.
>
> Recent versions of udev cause synchronous firmware loading from the
> probe routine to fail because the request to user space times out.
[...]
This has since been fixed in udev, and the kernel can also load firmware
directly. So is this still worth doing?
Ben.
--
Ben Hutchings
If you seem to know what you are doing, you'll be given more to do.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 131+ messages in thread
* Re: [ 004/123] b43legacy: Fix firmware loading when driver is built into the kernel
2013-01-11 3:47 ` Ben Hutchings
@ 2013-01-11 13:38 ` Greg Kroah-Hartman
0 siblings, 0 replies; 131+ messages in thread
From: Greg Kroah-Hartman @ 2013-01-11 13:38 UTC (permalink / raw)
To: Ben Hutchings; +Cc: linux-kernel, stable, alan, Larry Finger, John W. Linville
On Fri, Jan 11, 2013 at 03:47:57AM +0000, Ben Hutchings wrote:
> On Wed, 2013-01-09 at 12:34 -0800, Greg Kroah-Hartman wrote:
> > 3.7-stable review patch. If anyone has any objections, please let me know.
> >
> > ------------------
> >
> > From: Larry Finger <Larry.Finger@lwfinger.net>
> >
> > commit 576d28a7c73013717311cfcb514dbcae27c82eeb upstream.
> >
> > Recent versions of udev cause synchronous firmware loading from the
> > probe routine to fail because the request to user space times out.
> [...]
>
> This has since been fixed in udev, and the kernel can also load firmware
> directly. So is this still worth doing?
I think so, as not all systems have, or can, update their version of
udev.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 131+ messages in thread
* Re: [ 000/123] 3.7.2-stable review
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
` (124 preceding siblings ...)
2013-01-10 18:04 ` Shuah Khan
@ 2013-01-11 14:43 ` Satoru Takeuchi
125 siblings, 0 replies; 131+ messages in thread
From: Satoru Takeuchi @ 2013-01-11 14:43 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, stable, torvalds, akpm, alan
At Wed, 9 Jan 2013 12:33:59 -0800,
Greg Kroah-Hartman wrote:
>
> Note, there are still a lot of patches submitted for inclusion in the
> stable releases that I have not gotten to yet. I wanted to get this
> release out now, instead of delaying for a week or so while I dig
> through all of the pending patches.
>
> This is the start of the stable review cycle for the 3.7.2 release.
> There are 123 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.
This kernel can be built and boot without any problem.
Building a kernel with this kernel also works fine.
- Build Machine: debian wheezy x86_64
CPU: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz x 4
memory: 8GB
- Test machine: debian wheezy x86_64(KVM guest on the Build Machine)
vCPU: x2
memory: 2GB
Thanks,
Satoru
>
> Responses should be made by Fri Jan 11 20:11:16 UTC 2013.
> 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.7.2-rc1.gz
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h
>
> -------------
> Pseudo-Shortlog of commits:
>
> Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Linux 3.7.2-rc1
>
> Jeff Layton <jlayton@redhat.com>
> cifs: don't compare uniqueids in cifs_prime_dcache unless server inode numbers are in use
>
> Jeff Layton <jlayton@redhat.com>
> cifs: rename cifs_readdir_lookup to cifs_prime_dcache and make it void return
>
> Alexander Stein <alexander.stein@systec-electronic.com>
> can: Do not call dev_put if restart timer is running upon close
>
> Ben Hutchings <ben@decadent.org.uk>
> HID: Add Apple wireless keyboard 2011 ANSI to special driver list
>
> Guenter Roeck <linux@roeck-us.net>
> linux/kernel.h: fix DIV_ROUND_CLOSEST with unsigned divisors
>
> Michal Hocko <mhocko@suse.cz>
> mm: limit mmu_gather batching to fix soft lockups on !CONFIG_PREEMPT
>
> Tony Prisk <linux@prisktech.co.nz>
> drivers/rtc/rtc-vt8500.c: fix handling of data passed in struct rtc_time
>
> Tony Prisk <linux@prisktech.co.nz>
> drivers/rtc/rtc-vt8500.c: correct handling of CR_24H bitfield
>
> Andrew Morton <akpm@linux-foundation.org>
> revert "rtc: recycle id when unloading a rtc driver"
>
> Corey Minyard <cminyard@mvista.com>
> CRIS: fix I/O macros
>
> Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
> proc: pid/status: show all supplementary groups
>
> Stephen Boyd <sboyd@codeaurora.org>
> lib: atomic64: Initialize locks statically to fix early users
>
> Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> Revert "Bluetooth: Fix possible deadlock in SCO code"
>
> Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> Bluetooth: cancel power_on work when unregistering the device
>
> Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> Bluetooth: Add missing lock nesting notation
>
> Jeff Cook <jeff@deserettechnology.com>
> Bluetooth: Add support for BCM20702A0 [0b05, 17b5]
>
> Myron Stowe <myron.stowe@redhat.com>
> PCI: Work around Stratus ftServer broken PCIe hierarchy (fix DMI check)
>
> Huang Ying <ying.huang@intel.com>
> PCI/PM: Do not suspend port if any subordinate device needs PME polling
>
> Andy Lutomirski <luto@amacapital.net>
> PCI: Reduce Ricoh 0xe822 SD card reader base clock frequency to 50MHz
>
> Huang Ying <ying.huang@intel.com>
> PCI/PM: Keep runtime PM enabled for unbound PCI devices
>
> David Woodhouse <dwmw2@infradead.org>
> solos-pci: fix double-free of TX skb in DMA mode
>
> Jeff Layton <jlayton@redhat.com>
> cifs: adjust sequence number downward after signing NT_CANCEL request
>
> Jeff Layton <jlayton@redhat.com>
> cifs: move check for NULL socket into smb_send_rqst
>
> Jan Kara <jack@suse.cz>
> fs: Fix imbalance in freeze protection in mark_files_ro()
>
> Will Deacon <will.deacon@arm.com>
> ARM: 7606/1: cache: flush to LoUU instead of LoUIS on uniprocessor CPUs
>
> Will Deacon <will.deacon@arm.com>
> ARM: 7607/1: realview: fix private peripheral memory base for EB rev. B boards
>
> Al Viro <viro@ZenIV.linux.org.uk>
> ARM: missing ->mmap_sem around find_vma() in swp_emulate.c
>
> Will Deacon <will.deacon@arm.com>
> ARM: mm: use pteval_t to represent page protection values
>
> Al Viro <viro@ZenIV.linux.org.uk>
> arm64: compat for clock_adjtime(2) is miswired
>
> Dave Chinner <dchinner@redhat.com>
> xfs: fix stray dquot unlock when reclaiming dquots
>
> Dave Chinner <dchinner@redhat.com>
> xfs: fix direct IO nested transaction deadlock.
>
> Oleg Nesterov <oleg@redhat.com>
> signals: sys_ssetmask() uses uninitialized newmask
>
> Roland Dreier <roland@purestorage.com>
> printk: fix incorrect length from print_time() when seconds > 99999
>
> Eric Dumazet <edumazet@google.com>
> tcp: fix MSG_SENDPAGE_NOTLAST logic
>
> Daniel Borkmann <dborkman@redhat.com>
> sctp: jsctp_sf_eat_sack: fix jprobes function signature mismatch
>
> Stefan Hasko <hasko.stevo@gmail.com>
> net: sched: integer overflow fix
>
> Alexander Aring <alex.aring@googlemail.com>
> mac802154: fix NOHZ local_softirq_pending 08 warning
>
> Duan Jiong <djduanjiong@gmail.com>
> ipv6: Change skb->data before using icmpv6_notify() to propagate redirect
>
> Christoph Paasch <christoph.paasch@uclouvain.be>
> inet: Fix kmemleak in tcp_v4/6_syn_recv_sock and dccp_v4/6_request_recv_sock
>
> Akinobu Mita <akinobu.mita@gmail.com>
> batman-adv: fix random jitter calculation
>
> David S. Miller <davem@davemloft.net>
> sparc64: Set CRYPTO_TFM_REQ_MAY_SLEEP consistently in CAMELLIA code.
>
> David S. Miller <davem@davemloft.net>
> sparc64: Set CRYPTO_TFM_REQ_MAY_SLEEP consistently in DES code.
>
> David S. Miller <davem@davemloft.net>
> sparc64: Fix ECB looping constructs in AES code.
>
> David S. Miller <davem@davemloft.net>
> sparc64: Set CRYPTO_TFM_REQ_MAY_SLEEP consistently in AES code.
>
> David S. Miller <davem@davemloft.net>
> sparc64: Fix AES ctr mode block size.
>
> David S. Miller <davem@davemloft.net>
> sparc64: Fix unrolled AES 256-bit key loops.
>
> Dave Kleikamp <dave.kleikamp@oracle.com>
> sparc: huge_ptep_set_* functions need to call set_huge_pte_at()
>
> Tejun Heo <tj@kernel.org>
> freezer: add missing mb's to freezer_count() and freezer_should_skip()
>
> Steve French <smfrench@gmail.com>
> SMB3 mounts fail with access denied to some servers
>
> Andy Gross <andy.gross@ti.com>
> staging: drm/omap: Fix include error during make
>
> Jianguo Wu <wujianguo@huawei.com>
> mm/hugetlb: create hugetlb cgroup file in hugetlb_init
>
> Gao feng <gaofeng@cn.fujitsu.com>
> cgroup_rm_file: don't delete the uncreated files
>
> Tejun Heo <tj@kernel.org>
> cgroup: remove incorrect dget/dput() pair in cgroup_create_dir()
>
> Tejun Heo <tj@kernel.org>
> cgroup: cgroup_subsys->fork() should be called after the task is added to css_set
>
> Russell Webb <russell.webb@linux.intel.com>
> xhci: Add Lynx Point LP to list of Intel switchable hosts
>
> Alexis R. Cortes <alexis.cortes@ti.com>
> usb: host: xhci: Stricter conditional for Z1 system models for Compliance Mode Patch
>
> Alan Stern <stern@rowland.harvard.edu>
> USB: fix endpoint-disabling for failed config changes
>
> Julius Werner <jwerner@chromium.org>
> xhci: fix null-pointer dereference when destroying half-built segment rings
>
> Sarah Sharp <sarah.a.sharp@linux.intel.com>
> xHCI: Fix TD Size calculation on 1.0 hosts.
>
> Sarah Sharp <sarah.a.sharp@linux.intel.com>
> xhci: Fix conditional check in bandwidth calculation.
>
> Afzal Mohammed <afzal@ti.com>
> Revert "usb: musb: dsps: remove explicit NOP device creation"
>
> Sergei Shtylyov <sshtylyov@ru.mvista.com>
> usb: musb: cppi_dma: export cppi_interrupt()
>
> Thomas Gleixner <tglx@linutronix.de>
> genirq: Always force thread affinity
>
> Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Input: gpio_keys - defer probing if GPIO probing is deferred
>
> Gabor Juhos <juhosg@openwrt.org>
> Input: gpio_keys_polled - defer probing if GPIO probing is deferred
>
> Christophe TORDEUX <christophe@tordeux.net>
> Input: sentelic - only report position of first finger as ST coordinates
>
> Diego Calleja <diegocg@gmail.com>
> Input: wacom - fix touch support for Bamboo Fun CTH-461
>
> Peter Popovec <popovec@oko.fei.tuke.sk>
> Input: walkera0701 - fix crash on startup
>
> NeilBrown <neilb@suse.de>
> vfs: d_obtain_alias() needs to use "/" as default name.
>
> Nickolai Zeldovich <nickolai@csail.mit.edu>
> nfs: avoid dereferencing null pointer in initiate_bulk_draining
>
> Trond Myklebust <Trond.Myklebust@netapp.com>
> NFS: Ensure that we free the rpc_task after read and write cleanups are done
>
> Xi Wang <xi.wang@gmail.com>
> nfs: fix null checking in nfs_get_option_str()
>
> Yanchuan Nian <ycnian@gmail.com>
> pnfs: Increase the refcount when LAYOUTGET fails the first time
>
> Weston Andros Adamson <dros@netapp.com>
> NFS: Fix access to suid/sgid executables
>
> Neil Brown <neilb@suse.de>
> nfsd: avoid permission checks on EXCLUSIVE_CREATE replay
>
> J. Bruce Fields <bfields@redhat.com>
> nfsd4: fix oops on unusual readlike compound
>
> J. Bruce Fields <bfields@redhat.com>
> nfsd: fix v4 reply caching
>
> Yanchuan Nian <ycnian@gmail.com>
> nfs: fix wrong object type in lockowner_slab
>
> Trond Myklebust <Trond.Myklebust@netapp.com>
> NFS: Don't use SetPageError in the NFS writeback code
>
> Trond Myklebust <Trond.Myklebust@netapp.com>
> NFS: Fix calls to drop_nlink()
>
> NeilBrown <neilb@suse.de>
> NFS: avoid NULL dereference in nfs_destroy_server
>
> Jeff Layton <jlayton@redhat.com>
> nfs: don't zero out the rest of the page if we hit the EOF on a DIO READ
>
> Sven Wegener <sven.wegener@stealer.net>
> NFSv4: Check for buffer length in __nfs4_get_acl_uncached
>
> Jeff Layton <jlayton@redhat.com>
> nfs: don't extend writes to cover entire page if pagecache is invalid
>
> Bryan Schumaker <bjschuma@netapp.com>
> NFS: Add sequence_priviliged_ops for nfs4_proc_sequence()
>
> Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ACPI / scan: Do not use dummy HID for system bus ACPI nodes
>
> Aaron Lu <aaron.lu@intel.com>
> libata: restore acpi disable functionality
>
> Zhang Rui <rui.zhang@intel.com>
> ACPI: do acpisleep dmi check when CONFIG_ACPI_SLEEP is set
>
> Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> usb: gadget: network: fix bind() error path
>
> Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> usb: gadget: uvc: fix error path in uvc_function_bind()
>
> Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> usb: gadget: tcm_usb_gadget: NULL terminate the FS descriptor list
>
> Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> usb: gadget: phonet: free requests in pn_bind()'s error path
>
> Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> usb: gadget: midi: free hs descriptors
>
> Lothar Waßmann <LW@KARO-electronics.de>
> USB: chipidea: fix use after free bug
>
> Christian Lamparter <chunkeey@googlemail.com>
> p54usb: add USBIDs for two more p54usb devices
>
> Tomasz Guszkowski <tsg@o2.pl>
> p54usb: add USB ID for T-Com Sinus 154 data II
>
> Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
> rtlwifi: fix incorrect use of usb_alloc_coherent with usb_control_msg
>
> Dan Williams <dcbw@redhat.com>
> qmi_wwan/cdc_ether: add Dell Wireless 5800 (Novatel E362) USB IDs
>
> David Henningsson <david.henningsson@canonical.com>
> ALSA: hda - add mute LED for HP Pavilion 17 (Realtek codec)
>
> Takashi Iwai <tiwai@suse.de>
> ALSA: hda - Fix pin configuration of HP Pavilion dv7
>
> Takashi Iwai <tiwai@suse.de>
> ALSA: hda - Fix the wrong pincaps set in ALC861VD dallas/hp fixup
>
> Takashi Iwai <tiwai@suse.de>
> ALSA: hda - Always turn on pins for HDMI/DP
>
> Takashi Iwai <tiwai@suse.de>
> ALSA: hda - Add stereo-dmic fixup for Acer Aspire One 522
>
> Takashi Iwai <tiwai@suse.de>
> ALSA: hda - Move runtime PM check to runtime_idle callback
>
> Takashi Iwai <tiwai@suse.de>
> ALSA: usb-audio: Fix missing autopm for MIDI input
>
> Takashi Iwai <tiwai@suse.de>
> ALSA: usb-audio: Avoid autopm calls after disconnection
>
> Hugh Dickins <hughd@google.com>
> tmpfs mempolicy: fix /proc/mounts corrupting memory
>
> Christoffer Dall <cdall@cs.columbia.edu>
> mm: Fix PageHead when !CONFIG_PAGEFLAGS_EXTENDED
>
> Sonny Rao <sonnyrao@chromium.org>
> mm: fix calculation of dirtyable memory
>
> Will Deacon <will.deacon@arm.com>
> virtio: force vring descriptors to be allocated from lowmem
>
> Will Deacon <will.deacon@arm.com>
> virtio: 9p: correctly pass physical address to userspace for high pages
>
> Will Deacon <will.deacon@arm.com>
> mm: highmem: export kmap_to_page for modules
>
> Ondrej Zary <linux@rainbow-software.org>
> x86, 8042: Enable A20 using KBC to fix S3 resume on some MSI laptops
>
> Will Deacon <will.deacon@arm.com>
> arm64: signal: push the unwinding prologue on the signal stack
>
> Catalin Marinas <catalin.marinas@arm.com>
> arm64: Make !dirty ptes read-only
>
> Kees Cook <keescook@chromium.org>
> exec: do not leave bprm->interp on stack
>
> Robin Holt <holt@sgi.com>
> SGI-XP: handle non-fatal traps
>
> Alan Cox <alan@lxorguk.ukuu.org.uk>
> pnpacpi: fix incorrect TEST_ALPHA() test
>
> Felix Fietkau <nbd@openwrt.org>
> b43: fix tx path skb leaks
>
> Larry Finger <Larry.Finger@lwfinger.net>
> b43legacy: Fix firmware loading when driver is built into the kernel
>
> Chuansheng Liu <chuansheng.liu@intel.com>
> firmware loader: Fix the concurrent request_firmware() race for kref_get/put
>
> Chuansheng Liu <chuansheng.liu@intel.com>
> firmware loader: Fix the race FW_STATUS_DONE is followed by class_timeout
>
> Eric Dumazet <edumazet@google.com>
> net: fix a race in gro_cell_poll()
>
>
> -------------
>
> Diffstat:
>
> Makefile | 4 +-
> arch/arm/kernel/swp_emulate.c | 2 +
> arch/arm/mach-realview/include/mach/board-eb.h | 2 +-
> arch/arm/mm/cache-v7.S | 6 +-
> arch/arm/mm/mmu.c | 2 +-
> arch/arm64/include/asm/pgtable.h | 2 +
> arch/arm64/include/asm/unistd32.h | 2 +-
> arch/arm64/kernel/signal.c | 37 ++--
> arch/cris/include/asm/io.h | 39 +++-
> arch/sparc/crypto/aes_asm.S | 20 ++-
> arch/sparc/crypto/aes_glue.c | 31 +++-
> arch/sparc/crypto/camellia_glue.c | 3 +
> arch/sparc/crypto/des_asm.S | 1 +
> arch/sparc/crypto/des_glue.c | 6 +
> arch/sparc/include/asm/hugetlb.h | 10 +-
> arch/x86/pci/common.c | 3 +-
> drivers/acpi/scan.c | 2 +-
> drivers/acpi/sleep.c | 348 ++++++++++++++++++------------------
> drivers/ata/libata-acpi.c | 4 +
> drivers/atm/solos-pci.c | 5 +-
> drivers/base/firmware_class.c | 30 ++--
> drivers/bluetooth/btusb.c | 1 +
> drivers/hid/hid-core.c | 1 +
> drivers/input/joystick/walkera0701.c | 7 +-
> drivers/input/keyboard/gpio_keys.c | 13 +-
> drivers/input/keyboard/gpio_keys_polled.c | 13 +-
> drivers/input/mouse/sentelic.c | 2 +-
> drivers/input/serio/i8042-x86ia64io.h | 9 +
> drivers/input/tablet/wacom_wac.c | 3 +-
> drivers/misc/sgi-xp/xpc_main.c | 34 +++-
> drivers/net/can/dev.c | 3 +-
> drivers/net/usb/cdc_ether.c | 15 ++
> drivers/net/usb/qmi_wwan.c | 14 ++
> drivers/net/wireless/b43/dma.c | 7 +-
> drivers/net/wireless/b43/main.c | 12 +-
> drivers/net/wireless/b43/pio.c | 4 +-
> drivers/net/wireless/b43legacy/b43legacy.h | 5 +
> drivers/net/wireless/b43legacy/main.c | 37 +++-
> drivers/net/wireless/p54/p54usb.c | 4 +
> drivers/net/wireless/rtlwifi/usb.c | 7 +-
> drivers/pci/pci-driver.c | 67 ++++---
> drivers/pci/pci.c | 2 +
> drivers/pci/pcie/portdrv_pci.c | 20 ++-
> drivers/pci/quirks.c | 7 +-
> drivers/pnp/pnpacpi/core.c | 2 +-
> drivers/rtc/class.c | 1 -
> drivers/rtc/rtc-vt8500.c | 11 +-
> drivers/staging/omapdrm/omap_crtc.c | 2 +-
> drivers/usb/chipidea/core.c | 3 +-
> drivers/usb/core/message.c | 54 +++---
> drivers/usb/gadget/f_ecm.c | 4 +-
> drivers/usb/gadget/f_eem.c | 5 +-
> drivers/usb/gadget/f_midi.c | 1 +
> drivers/usb/gadget/f_ncm.c | 4 +-
> drivers/usb/gadget/f_phonet.c | 8 +-
> drivers/usb/gadget/f_rndis.c | 4 +-
> drivers/usb/gadget/f_subset.c | 4 +-
> drivers/usb/gadget/f_uvc.c | 39 ++--
> drivers/usb/gadget/tcm_usb_gadget.c | 1 +
> drivers/usb/host/ehci-pci.c | 3 +-
> drivers/usb/host/pci-quirks.c | 4 +-
> drivers/usb/host/xhci-mem.c | 9 +-
> drivers/usb/host/xhci-ring.c | 32 ++--
> drivers/usb/host/xhci.c | 4 +-
> drivers/usb/musb/cppi_dma.c | 1 +
> drivers/usb/musb/musb_dsps.c | 3 +-
> drivers/virtio/virtio_ring.c | 7 +
> fs/binfmt_misc.c | 5 +-
> fs/binfmt_script.c | 4 +-
> fs/cifs/readdir.c | 59 +++---
> fs/cifs/smb1ops.c | 7 +
> fs/cifs/smb2pdu.c | 2 +-
> fs/cifs/transport.c | 6 +-
> fs/dcache.c | 2 +-
> fs/exec.c | 15 ++
> fs/file_table.c | 2 +-
> fs/nfs/callback_proc.c | 2 +-
> fs/nfs/client.c | 3 +-
> fs/nfs/dir.c | 27 +--
> fs/nfs/direct.c | 8 -
> fs/nfs/nfs4proc.c | 46 +++--
> fs/nfs/pnfs.c | 2 +-
> fs/nfs/read.c | 10 +-
> fs/nfs/super.c | 2 +-
> fs/nfs/write.c | 13 +-
> fs/nfsd/nfs4proc.c | 8 +-
> fs/nfsd/nfs4state.c | 2 +-
> fs/nfsd/nfs4xdr.c | 11 +-
> fs/nfsd/nfssvc.c | 2 +-
> fs/nfsd/vfs.c | 10 +-
> fs/proc/array.c | 2 +-
> fs/splice.c | 4 +-
> fs/xfs/xfs_aops.c | 81 +++------
> fs/xfs/xfs_log.c | 3 +-
> fs/xfs/xfs_qm.c | 15 +-
> include/asm-generic/tlb.h | 9 +
> include/linux/binfmts.h | 1 +
> include/linux/cgroup.h | 1 -
> include/linux/freezer.h | 50 +++++-
> include/linux/hugetlb_cgroup.h | 5 +-
> include/linux/kernel.h | 6 +-
> include/linux/libata.h | 1 +
> include/linux/page-flags.h | 8 +-
> include/linux/pci_ids.h | 1 +
> include/net/gro_cells.h | 14 +-
> include/net/inet_connection_sock.h | 1 +
> include/net/ndisc.h | 7 +
> kernel/cgroup.c | 76 ++++----
> kernel/cgroup_freezer.c | 13 +-
> kernel/fork.c | 9 +-
> kernel/irq/manage.c | 23 ++-
> kernel/printk.c | 5 +-
> kernel/signal.c | 1 +
> lib/atomic64.c | 17 +-
> mm/highmem.c | 1 +
> mm/hugetlb.c | 11 +-
> mm/hugetlb_cgroup.c | 19 +-
> mm/memory.c | 5 +
> mm/mempolicy.c | 64 +++----
> mm/page-writeback.c | 25 ++-
> net/9p/trans_virtio.c | 3 +-
> net/batman-adv/bat_iv_ogm.c | 2 +-
> net/bluetooth/hci_core.c | 2 +
> net/bluetooth/rfcomm/sock.c | 4 +-
> net/bluetooth/sco.c | 19 +-
> net/dccp/ipv4.c | 4 +-
> net/dccp/ipv6.c | 3 +-
> net/ipv4/inet_connection_sock.c | 16 ++
> net/ipv4/tcp_ipv4.c | 6 +-
> net/ipv6/ndisc.c | 17 ++
> net/ipv6/tcp_ipv6.c | 3 +-
> net/mac802154/wpan.c | 2 +-
> net/sched/sch_htb.c | 2 +-
> net/sctp/probe.c | 3 +-
> sound/pci/hda/hda_intel.c | 19 +-
> sound/pci/hda/patch_conexant.c | 1 +
> sound/pci/hda/patch_hdmi.c | 18 +-
> sound/pci/hda/patch_realtek.c | 34 +++-
> sound/pci/hda/patch_sigmatel.c | 2 +-
> sound/usb/midi.c | 91 ++++++----
> 140 files changed, 1280 insertions(+), 749 deletions(-)
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 131+ messages in thread
end of thread, other threads:[~2013-01-11 14:43 UTC | newest]
Thread overview: 131+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-09 20:33 [ 000/123] 3.7.2-stable review Greg Kroah-Hartman
2013-01-09 20:34 ` [ 001/123] net: fix a race in gro_cell_poll() Greg Kroah-Hartman
2013-01-09 20:34 ` [ 002/123] firmware loader: Fix the race FW_STATUS_DONE is followed by class_timeout Greg Kroah-Hartman
2013-01-09 20:34 ` [ 003/123] firmware loader: Fix the concurrent request_firmware() race for kref_get/put Greg Kroah-Hartman
2013-01-09 20:34 ` [ 004/123] b43legacy: Fix firmware loading when driver is built into the kernel Greg Kroah-Hartman
2013-01-11 3:47 ` Ben Hutchings
2013-01-11 13:38 ` Greg Kroah-Hartman
2013-01-09 20:34 ` [ 005/123] b43: fix tx path skb leaks Greg Kroah-Hartman
2013-01-09 20:34 ` [ 006/123] pnpacpi: fix incorrect TEST_ALPHA() test Greg Kroah-Hartman
2013-01-09 20:34 ` [ 007/123] SGI-XP: handle non-fatal traps Greg Kroah-Hartman
2013-01-09 20:34 ` [ 008/123] exec: do not leave bprm->interp on stack Greg Kroah-Hartman
2013-01-09 20:34 ` [ 009/123] arm64: Make !dirty ptes read-only Greg Kroah-Hartman
2013-01-09 20:34 ` [ 010/123] arm64: signal: push the unwinding prologue on the signal stack Greg Kroah-Hartman
2013-01-09 20:34 ` [ 011/123] x86, 8042: Enable A20 using KBC to fix S3 resume on some MSI laptops Greg Kroah-Hartman
2013-01-09 20:34 ` [ 012/123] mm: highmem: export kmap_to_page for modules Greg Kroah-Hartman
2013-01-09 20:34 ` [ 013/123] virtio: 9p: correctly pass physical address to userspace for high pages Greg Kroah-Hartman
2013-01-09 20:34 ` [ 014/123] virtio: force vring descriptors to be allocated from lowmem Greg Kroah-Hartman
2013-01-09 20:34 ` [ 015/123] mm: fix calculation of dirtyable memory Greg Kroah-Hartman
2013-01-09 20:34 ` [ 016/123] mm: Fix PageHead when !CONFIG_PAGEFLAGS_EXTENDED Greg Kroah-Hartman
2013-01-09 20:34 ` [ 017/123] tmpfs mempolicy: fix /proc/mounts corrupting memory Greg Kroah-Hartman
2013-01-09 20:34 ` [ 018/123] ALSA: usb-audio: Avoid autopm calls after disconnection Greg Kroah-Hartman
2013-01-09 20:34 ` [ 019/123] ALSA: usb-audio: Fix missing autopm for MIDI input Greg Kroah-Hartman
2013-01-09 20:34 ` [ 020/123] ALSA: hda - Move runtime PM check to runtime_idle callback Greg Kroah-Hartman
2013-01-09 20:34 ` [ 021/123] ALSA: hda - Add stereo-dmic fixup for Acer Aspire One 522 Greg Kroah-Hartman
2013-01-09 20:34 ` [ 022/123] ALSA: hda - Always turn on pins for HDMI/DP Greg Kroah-Hartman
2013-01-09 20:34 ` [ 023/123] ALSA: hda - Fix the wrong pincaps set in ALC861VD dallas/hp fixup Greg Kroah-Hartman
2013-01-09 20:34 ` [ 024/123] ALSA: hda - Fix pin configuration of HP Pavilion dv7 Greg Kroah-Hartman
2013-01-09 20:34 ` [ 025/123] ALSA: hda - add mute LED for HP Pavilion 17 (Realtek codec) Greg Kroah-Hartman
2013-01-09 20:34 ` [ 026/123] qmi_wwan/cdc_ether: add Dell Wireless 5800 (Novatel E362) USB IDs Greg Kroah-Hartman
2013-01-09 20:34 ` [ 027/123] rtlwifi: fix incorrect use of usb_alloc_coherent with usb_control_msg Greg Kroah-Hartman
2013-01-09 20:34 ` [ 028/123] p54usb: add USB ID for T-Com Sinus 154 data II Greg Kroah-Hartman
2013-01-09 20:34 ` [ 029/123] p54usb: add USBIDs for two more p54usb devices Greg Kroah-Hartman
2013-01-09 20:34 ` [ 030/123] USB: chipidea: fix use after free bug Greg Kroah-Hartman
2013-01-09 20:34 ` [ 031/123] usb: gadget: midi: free hs descriptors Greg Kroah-Hartman
2013-01-09 20:34 ` [ 032/123] usb: gadget: phonet: free requests in pn_bind()s error path Greg Kroah-Hartman
2013-01-09 20:34 ` [ 033/123] usb: gadget: tcm_usb_gadget: NULL terminate the FS descriptor list Greg Kroah-Hartman
2013-01-09 20:34 ` [ 034/123] usb: gadget: uvc: fix error path in uvc_function_bind() Greg Kroah-Hartman
2013-01-09 20:34 ` [ 035/123] usb: gadget: network: fix bind() error path Greg Kroah-Hartman
2013-01-09 20:34 ` [ 036/123] ACPI: do acpisleep dmi check when CONFIG_ACPI_SLEEP is set Greg Kroah-Hartman
2013-01-09 20:34 ` [ 037/123] libata: restore acpi disable functionality Greg Kroah-Hartman
2013-01-09 20:34 ` [ 038/123] ACPI / scan: Do not use dummy HID for system bus ACPI nodes Greg Kroah-Hartman
2013-01-09 20:34 ` [ 039/123] NFS: Add sequence_priviliged_ops for nfs4_proc_sequence() Greg Kroah-Hartman
2013-01-09 20:34 ` [ 040/123] nfs: dont extend writes to cover entire page if pagecache is invalid Greg Kroah-Hartman
2013-01-09 20:34 ` [ 041/123] NFSv4: Check for buffer length in __nfs4_get_acl_uncached Greg Kroah-Hartman
2013-01-09 20:34 ` [ 042/123] nfs: dont zero out the rest of the page if we hit the EOF on a DIO READ Greg Kroah-Hartman
2013-01-09 20:34 ` [ 043/123] NFS: avoid NULL dereference in nfs_destroy_server Greg Kroah-Hartman
2013-01-09 20:34 ` [ 044/123] NFS: Fix calls to drop_nlink() Greg Kroah-Hartman
2013-01-09 20:34 ` [ 045/123] NFS: Dont use SetPageError in the NFS writeback code Greg Kroah-Hartman
2013-01-09 20:34 ` [ 046/123] nfs: fix wrong object type in lockowner_slab Greg Kroah-Hartman
2013-01-09 20:34 ` [ 047/123] nfsd: fix v4 reply caching Greg Kroah-Hartman
2013-01-09 20:34 ` [ 048/123] nfsd4: fix oops on unusual readlike compound Greg Kroah-Hartman
2013-01-09 20:34 ` [ 049/123] nfsd: avoid permission checks on EXCLUSIVE_CREATE replay Greg Kroah-Hartman
2013-01-09 20:34 ` [ 050/123] NFS: Fix access to suid/sgid executables Greg Kroah-Hartman
2013-01-09 20:34 ` [ 051/123] pnfs: Increase the refcount when LAYOUTGET fails the first time Greg Kroah-Hartman
2013-01-09 20:34 ` [ 052/123] nfs: fix null checking in nfs_get_option_str() Greg Kroah-Hartman
2013-01-09 20:34 ` [ 053/123] NFS: Ensure that we free the rpc_task after read and write cleanups are done Greg Kroah-Hartman
2013-01-09 20:34 ` [ 054/123] nfs: avoid dereferencing null pointer in initiate_bulk_draining Greg Kroah-Hartman
2013-01-09 20:34 ` [ 055/123] vfs: d_obtain_alias() needs to use "/" as default name Greg Kroah-Hartman
2013-01-09 20:34 ` [ 056/123] Input: walkera0701 - fix crash on startup Greg Kroah-Hartman
2013-01-09 20:34 ` [ 057/123] Input: wacom - fix touch support for Bamboo Fun CTH-461 Greg Kroah-Hartman
2013-01-09 20:34 ` [ 058/123] Input: sentelic - only report position of first finger as ST coordinates Greg Kroah-Hartman
2013-01-09 20:34 ` [ 059/123] Input: gpio_keys_polled - defer probing if GPIO probing is deferred Greg Kroah-Hartman
2013-01-09 20:34 ` [ 060/123] Input: gpio_keys " Greg Kroah-Hartman
2013-01-09 20:35 ` [ 061/123] genirq: Always force thread affinity Greg Kroah-Hartman
2013-01-09 20:35 ` [ 062/123] usb: musb: cppi_dma: export cppi_interrupt() Greg Kroah-Hartman
2013-01-09 20:35 ` [ 063/123] Revert "usb: musb: dsps: remove explicit NOP device creation" Greg Kroah-Hartman
2013-01-09 20:35 ` [ 064/123] xhci: Fix conditional check in bandwidth calculation Greg Kroah-Hartman
2013-01-09 20:35 ` [ 065/123] xHCI: Fix TD Size calculation on 1.0 hosts Greg Kroah-Hartman
2013-01-09 20:35 ` [ 066/123] xhci: fix null-pointer dereference when destroying half-built segment rings Greg Kroah-Hartman
2013-01-09 20:35 ` [ 067/123] USB: fix endpoint-disabling for failed config changes Greg Kroah-Hartman
2013-01-09 20:35 ` [ 068/123] usb: host: xhci: Stricter conditional for Z1 system models for Compliance Mode Patch Greg Kroah-Hartman
2013-01-09 20:35 ` [ 069/123] xhci: Add Lynx Point LP to list of Intel switchable hosts Greg Kroah-Hartman
2013-01-09 20:35 ` [ 070/123] cgroup: cgroup_subsys->fork() should be called after the task is added to css_set Greg Kroah-Hartman
2013-01-09 20:35 ` [ 071/123] cgroup: remove incorrect dget/dput() pair in cgroup_create_dir() Greg Kroah-Hartman
2013-01-09 20:35 ` [ 072/123] cgroup_rm_file: dont delete the uncreated files Greg Kroah-Hartman
2013-01-09 20:35 ` [ 073/123] mm/hugetlb: create hugetlb cgroup file in hugetlb_init Greg Kroah-Hartman
2013-01-09 20:35 ` [ 074/123] staging: drm/omap: Fix include error during make Greg Kroah-Hartman
2013-01-09 20:35 ` [ 075/123] SMB3 mounts fail with access denied to some servers Greg Kroah-Hartman
2013-01-09 20:35 ` [ 076/123] freezer: add missing mbs to freezer_count() and freezer_should_skip() Greg Kroah-Hartman
2013-01-09 20:35 ` [ 077/123] sparc: huge_ptep_set_* functions need to call set_huge_pte_at() Greg Kroah-Hartman
2013-01-09 20:35 ` [ 078/123] sparc64: Fix unrolled AES 256-bit key loops Greg Kroah-Hartman
2013-01-09 20:35 ` [ 079/123] sparc64: Fix AES ctr mode block size Greg Kroah-Hartman
2013-01-09 20:35 ` [ 080/123] sparc64: Set CRYPTO_TFM_REQ_MAY_SLEEP consistently in AES code Greg Kroah-Hartman
2013-01-09 20:35 ` [ 081/123] sparc64: Fix ECB looping constructs " Greg Kroah-Hartman
2013-01-09 20:35 ` [ 082/123] sparc64: Set CRYPTO_TFM_REQ_MAY_SLEEP consistently in DES code Greg Kroah-Hartman
2013-01-09 20:35 ` [ 083/123] sparc64: Set CRYPTO_TFM_REQ_MAY_SLEEP consistently in CAMELLIA code Greg Kroah-Hartman
2013-01-09 20:35 ` [ 084/123] batman-adv: fix random jitter calculation Greg Kroah-Hartman
2013-01-09 20:35 ` [ 085/123] inet: Fix kmemleak in tcp_v4/6_syn_recv_sock and dccp_v4/6_request_recv_sock Greg Kroah-Hartman
2013-01-09 20:35 ` [ 086/123] ipv6: Change skb->data before using icmpv6_notify() to propagate redirect Greg Kroah-Hartman
2013-01-09 20:35 ` [ 087/123] mac802154: fix NOHZ local_softirq_pending 08 warning Greg Kroah-Hartman
2013-01-09 20:35 ` [ 088/123] net: sched: integer overflow fix Greg Kroah-Hartman
2013-01-09 20:35 ` [ 089/123] sctp: jsctp_sf_eat_sack: fix jprobes function signature mismatch Greg Kroah-Hartman
2013-01-09 20:35 ` [ 090/123] tcp: fix MSG_SENDPAGE_NOTLAST logic Greg Kroah-Hartman
2013-01-09 20:35 ` [ 091/123] printk: fix incorrect length from print_time() when seconds > 99999 Greg Kroah-Hartman
2013-01-09 20:35 ` [ 092/123] signals: sys_ssetmask() uses uninitialized newmask Greg Kroah-Hartman
2013-01-09 20:35 ` [ 093/123] xfs: fix direct IO nested transaction deadlock Greg Kroah-Hartman
2013-01-09 20:35 ` [ 094/123] xfs: fix stray dquot unlock when reclaiming dquots Greg Kroah-Hartman
2013-01-09 20:35 ` [ 095/123] arm64: compat for clock_adjtime(2) is miswired Greg Kroah-Hartman
2013-01-09 20:35 ` [ 096/123] ARM: mm: use pteval_t to represent page protection values Greg Kroah-Hartman
2013-01-09 20:35 ` [ 097/123] ARM: missing ->mmap_sem around find_vma() in swp_emulate.c Greg Kroah-Hartman
2013-01-09 20:35 ` [ 098/123] ARM: 7607/1: realview: fix private peripheral memory base for EB rev. B boards Greg Kroah-Hartman
2013-01-09 20:35 ` [ 099/123] ARM: 7606/1: cache: flush to LoUU instead of LoUIS on uniprocessor CPUs Greg Kroah-Hartman
2013-01-09 20:35 ` [ 100/123] fs: Fix imbalance in freeze protection in mark_files_ro() Greg Kroah-Hartman
2013-01-09 20:35 ` [ 101/123] cifs: move check for NULL socket into smb_send_rqst Greg Kroah-Hartman
2013-01-09 20:35 ` [ 102/123] cifs: adjust sequence number downward after signing NT_CANCEL request Greg Kroah-Hartman
2013-01-09 20:35 ` [ 103/123] solos-pci: fix double-free of TX skb in DMA mode Greg Kroah-Hartman
2013-01-09 20:35 ` [ 104/123] PCI/PM: Keep runtime PM enabled for unbound PCI devices Greg Kroah-Hartman
2013-01-09 20:35 ` [ 105/123] PCI: Reduce Ricoh 0xe822 SD card reader base clock frequency to 50MHz Greg Kroah-Hartman
2013-01-09 20:35 ` [ 106/123] PCI/PM: Do not suspend port if any subordinate device needs PME polling Greg Kroah-Hartman
2013-01-09 20:35 ` [ 107/123] PCI: Work around Stratus ftServer broken PCIe hierarchy (fix DMI check) Greg Kroah-Hartman
2013-01-09 20:35 ` [ 108/123] Bluetooth: Add support for BCM20702A0 [0b05, 17b5] Greg Kroah-Hartman
2013-01-09 20:35 ` [ 109/123] Bluetooth: Add missing lock nesting notation Greg Kroah-Hartman
2013-01-09 20:35 ` [ 110/123] Bluetooth: cancel power_on work when unregistering the device Greg Kroah-Hartman
2013-01-09 20:35 ` [ 111/123] Revert "Bluetooth: Fix possible deadlock in SCO code" Greg Kroah-Hartman
2013-01-09 20:35 ` [ 112/123] lib: atomic64: Initialize locks statically to fix early users Greg Kroah-Hartman
2013-01-09 20:35 ` [ 113/123] proc: pid/status: show all supplementary groups Greg Kroah-Hartman
2013-01-09 20:35 ` [ 114/123] CRIS: fix I/O macros Greg Kroah-Hartman
2013-01-09 20:35 ` [ 115/123] revert "rtc: recycle id when unloading a rtc driver" Greg Kroah-Hartman
2013-01-09 20:35 ` [ 116/123] drivers/rtc/rtc-vt8500.c: correct handling of CR_24H bitfield Greg Kroah-Hartman
2013-01-09 20:35 ` [ 117/123] drivers/rtc/rtc-vt8500.c: fix handling of data passed in struct rtc_time Greg Kroah-Hartman
2013-01-09 20:35 ` [ 118/123] mm: limit mmu_gather batching to fix soft lockups on !CONFIG_PREEMPT Greg Kroah-Hartman
2013-01-09 20:35 ` [ 119/123] linux/kernel.h: fix DIV_ROUND_CLOSEST with unsigned divisors Greg Kroah-Hartman
2013-01-09 20:35 ` [ 120/123] HID: Add Apple wireless keyboard 2011 ANSI to special driver list Greg Kroah-Hartman
2013-01-09 20:36 ` [ 121/123] can: Do not call dev_put if restart timer is running upon close Greg Kroah-Hartman
2013-01-09 20:36 ` [ 122/123] cifs: rename cifs_readdir_lookup to cifs_prime_dcache and make it void return Greg Kroah-Hartman
2013-01-09 20:36 ` [ 123/123] cifs: dont compare uniqueids in cifs_prime_dcache unless server inode numbers are in use Greg Kroah-Hartman
2013-01-10 15:32 ` [ 000/123] 3.7.2-stable review Paul Bolle
2013-01-10 15:56 ` Paul Bolle
2013-01-10 18:04 ` Shuah Khan
2013-01-10 19:45 ` Jonathan Nieder
2013-01-11 14:43 ` Satoru Takeuchi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).