2013-03-18 21:06:24

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 00/75] 3.8.4-stable review

This is the start of the stable review cycle for the 3.8.4 release.
There are 75 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 Wed Mar 20 21:04:55 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.8.4-rc1.gz
and the diffstat can be found below.

thanks,

greg k-h

-------------
Pseudo-Shortlog of commits:

Greg Kroah-Hartman <[email protected]>
Linux 3.8.4-rc1

Greg Kroah-Hartman <[email protected]>
Revert "drm/i915: reorder setup sequence to have irqs for output setup"

Greg Kroah-Hartman <[email protected]>
Revert "drm/i915: enable irqs earlier when resuming"

YOSHIFUJI Hideaki <[email protected]>
6lowpan: Fix endianness issue in is_addr_link_local().

Mathias Krause <[email protected]>
dcbnl: fix various netlink info leaks

Mathias Krause <[email protected]>
rtnl: fix info leak on RTM_GETLINK request for VF devices

Mathias Krause <[email protected]>
bridge: fix mdb info leaks

Hannes Frederic Sowa <[email protected]>
ipv6: stop multicast forwarding to process interface scoped addresses

Cristian Bercaru <[email protected]>
bridging: fix rx_handlers return code

Paul Moore <[email protected]>
netlabel: correctly list all the static label mappings

Vlad Yasevich <[email protected]>
macvlan: Set IFF_UNICAST_FLT flag to prevent unnecessary promisc mode.

Vlad Yasevich <[email protected]>
team: unsyc the devices addresses when port is removed

Veaceslav Falico <[email protected]>
bonding: fire NETDEV_RELEASE event only on 0 slaves

Zang MingJie <[email protected]>
vxlan: fix oops when delete netns containing vxlan

Eric Dumazet <[email protected]>
tun: add a missing nf_reset() in tun_net_xmit()

Neal Cardwell <[email protected]>
tcp: fix double-counted receiver RTT when leaving receiver fast path

Lorenzo Colitti <[email protected]>
net: ipv6: Don't purge default router if accept_ra=2

Cong Wang <[email protected]>
rds: limit the size allocated by rds_message_alloc()

Huang, Xiong <[email protected]>
atl1c: restore buffer state

Guillaume Nault <[email protected]>
l2tp: Restore socket refcount when sendmsg succeeds

Guenter Roeck <[email protected]>
net/sctp: Validate parameter size for SCTP_GET_ASSOC_STATS

Guo Chao <[email protected]>
loopdev: remove an user triggerable oops

Guo Chao <[email protected]>
loopdev: fix a deadlock

Guo Chao <[email protected]>
block: use i_size_write() in bd_set_size()

Amir Vadai <[email protected]>
net/mlx4_en: Disable RFS when running in SRIOV mode

Amir Vadai <[email protected]>
net/mlx4_en: Initialize RFS filters lock and list in init_netdev

Johan Hovold <[email protected]>
atmel_lcdfb: fix 16-bpp modes on older SOCs

Sam Ravnborg <[email protected]>
kbuild: fix make headers_check with make 3.80

Brian Norris <[email protected]>
mtd: nand: reintroduce NAND_NO_READRDY as NAND_NEED_READRDY

Eric Sandeen <[email protected]>
btrfs: use rcu_barrier() to wait for bdev puts at unmount

Heiko Carstens <[email protected]>
s390/mm: fix flush_tlb_kernel_range()

Martin Schwidefsky <[email protected]>
s390: critical section cleanup vs. machine checks

David Rientjes <[email protected]>
perf,x86: fix link failure for non-Intel configs

Linus Torvalds <[email protected]>
perf,x86: fix wrmsr_on_cpu() warning on suspend/resume

Dan Carpenter <[email protected]>
selinux: use GFP_ATOMIC under spin_lock

Matt Porter <[email protected]>
ARM: davinci: edma: fix dmaengine induced null pointer dereference on da830

Aneesh Kumar K.V <[email protected]>
powerpc: Rename USER_ESID_BITS* to ESID_BITS*

Aneesh Kumar K.V <[email protected]>
powerpc: Update kernel VSID range

Aneesh Kumar K.V <[email protected]>
powerpc: Make VSID_BITS* dependency explicit

Benjamin Herrenschmidt <[email protected]>
powerpc: Fix cputable entry for 970MP rev 1.0

Benjamin Herrenschmidt <[email protected]>
powerpc: Fix STAB initialization

Marcin Jurkowski <[email protected]>
w1: fix oops when w1_search is called from netlink connector

Johan Hovold <[email protected]>
w1-gpio: remove erroneous __exit and __exit_p()

Axel Lin <[email protected]>
hwmon: (lineage-pem) Add missing terminating entry for pem_[input|fan]_attributes

Guenter Roeck <[email protected]>
hwmon: (pmbus/ltc2978) Fix temperature reporting

Johan Hovold <[email protected]>
ARM: w1-gpio: fix erroneous gpio requests

Takashi Iwai <[email protected]>
ALSA: seq: Fix missing error handling in snd_seq_timer_open()

Stephane Eranian <[email protected]>
perf,x86: fix kernel crash with PEBS/BTS after suspend/resume

Sebastian Hesselbarth <[email protected]>
ARM: kirkwood: fix to retain gbe MAC addresses for DT kernels

Scott Ashcroft <[email protected]>
Fix 4 port and add support for 8 port 'Unknown' PCI serial port cards

Jiri Slaby <[email protected]>
TTY: do not reset master's packet mode

Jiri Slaby <[email protected]>
TTY: disable debugging warning

Ley Foon Tan <[email protected]>
tty/serial: Add support for Altera serial port

Paul Bolle <[email protected]>
tty: serial: fix typo "SERIAL_S3C2412"

Paul Bolle <[email protected]>
tty: serial: fix typo "ARCH_S5P6450"

Wang YanQing <[email protected]>
serial: 8250_pci: add support for another kind of NetMos Technology PCI 9835 Multi-I/O Controller

Josh Boyer <[email protected]>
serial: 8250: Keep 8250.<xxxx> module options functional after driver rename

Sean Young <[email protected]>
tty/8250_pnp: serial port detection regression since v3.7

Lars-Peter Clausen <[email protected]>
ext3: Fix format string issues

Kees Cook <[email protected]>
signal: always clear sa_restorer on execve

Dan Williams <[email protected]>
qcserial: bind to DM/DIAG port on Gobi 1K devices

Ian Abbott <[email protected]>
staging: comedi: dt9812: use CR_CHAN() for channel number

Malcolm Priestley <[email protected]>
staging: vt6656: Fix oops on resume from suspend.

Alan Stern <[email protected]>
USB: EHCI: don't check DMA values in QH overlays

Alan Stern <[email protected]>
USB: EHCI: work around silicon bug in Intel's EHCI controllers

Bjørn Mork <[email protected]>
USB: storage: fix Huawei mode switching regression

Steve Conklin <[email protected]>
usb: serial: Add Rigblaster Advantage to device table

Christian Schmiedl <[email protected]>
USB: added support for Cinterion's products AH6 and PLS8

Matwey V. Kornilov <[email protected]>
usb: cp210x new Vendor/Device IDs

Felipe Balbi <[email protected]>
usb: dwc3: core: don't forget to free coherent memory

Maxin B. John <[email protected]>
tools: usb: ffs-test: Fix build failure

Oliver Neukum <[email protected]>
USB: cdc-wdm: fix buffer overflow

Bjørn Mork <[email protected]>
USB: option: add Huawei E5331

Amit Shah <[email protected]>
virtio: rng: disallow multiple device registrations, fixes crashes

Konrad Rzeszutek Wilk <[email protected]>
xen/pciback: Don't disable a PCI device that is already disabled.

Dan Williams <[email protected]>
qcaux: add Franklin U600


-------------

Diffstat:

.../devicetree/bindings/tty/serial/of-serial.txt | 3 +
Makefile | 4 +-
arch/arm/mach-at91/board-foxg20.c | 1 +
arch/arm/mach-at91/board-stamp9g20.c | 1 +
arch/arm/mach-davinci/dma.c | 3 +
arch/arm/mach-ixp4xx/vulcan-setup.c | 1 +
arch/arm/mach-kirkwood/board-dt.c | 24 +-
arch/arm/mach-pxa/raumfeld.c | 1 +
arch/powerpc/include/asm/mmu-hash64.h | 128 ++++----
arch/powerpc/kernel/cputable.c | 2 +-
arch/powerpc/kernel/exceptions-64s.S | 34 ++-
arch/powerpc/kvm/book3s_64_mmu_host.c | 4 +-
arch/powerpc/mm/hash_utils_64.c | 22 +-
arch/powerpc/mm/mmu_context_hash64.c | 11 +-
arch/powerpc/mm/pgtable_64.c | 2 +-
arch/powerpc/mm/slb_low.S | 50 ++--
arch/powerpc/mm/tlb_hash64.c | 2 +-
arch/s390/include/asm/tlbflush.h | 2 -
arch/s390/kernel/entry.S | 3 +-
arch/s390/kernel/entry64.S | 5 +-
arch/x86/kernel/cpu/perf_event_intel_ds.c | 10 +
arch/x86/power/cpu.c | 2 +
drivers/block/loop.c | 24 +-
drivers/char/hw_random/virtio-rng.c | 13 +-
drivers/gpu/drm/i915/i915_dma.c | 23 +-
drivers/gpu/drm/i915/i915_drv.c | 13 +-
drivers/gpu/drm/i915/i915_drv.h | 1 -
drivers/gpu/drm/i915/i915_irq.c | 4 -
drivers/hwmon/lineage-pem.c | 2 +
drivers/hwmon/pmbus/ltc2978.c | 14 +-
drivers/mtd/nand/nand_base.c | 16 +
drivers/mtd/nand/nand_ids.c | 80 ++---
drivers/net/bonding/bond_main.c | 5 +-
drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 2 +-
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 16 +-
drivers/net/macvlan.c | 1 +
drivers/net/team/team.c | 2 +
drivers/net/tun.c | 2 +
drivers/net/vxlan.c | 9 +
drivers/staging/comedi/drivers/dt9812.c | 16 +-
drivers/staging/vt6656/main_usb.c | 4 -
drivers/tty/pty.c | 1 -
drivers/tty/serial/8250/8250.c | 52 +++-
drivers/tty/serial/8250/8250_pci.c | 21 +-
drivers/tty/serial/8250/8250_pnp.c | 12 +-
drivers/tty/serial/Kconfig | 4 +-
drivers/tty/serial/of_serial.c | 6 +
drivers/tty/tty_buffer.c | 2 +-
drivers/usb/class/cdc-wdm.c | 23 +-
drivers/usb/dwc3/core.c | 1 +
drivers/usb/host/ehci-hcd.c | 6 +-
drivers/usb/host/ehci-q.c | 36 ++-
drivers/usb/serial/cp210x.c | 20 ++
drivers/usb/serial/option.c | 5 +
drivers/usb/serial/qcaux.c | 1 +
drivers/usb/serial/qcserial.c | 7 +-
drivers/usb/storage/initializers.c | 76 +----
drivers/usb/storage/initializers.h | 4 +-
drivers/usb/storage/unusual_devs.h | 329 ++++++++++++++++++++-
drivers/video/atmel_lcdfb.c | 22 +-
drivers/w1/masters/w1-gpio.c | 4 +-
drivers/w1/w1.c | 3 +-
drivers/xen/xen-pciback/pciback_ops.c | 3 +-
fs/block_dev.c | 4 +-
fs/btrfs/volumes.c | 6 +
fs/ext3/super.c | 4 +-
include/linux/mtd/nand.h | 7 +
include/linux/perf_event.h | 6 +
include/uapi/linux/serial_core.h | 5 +-
include/video/atmel_lcdc.h | 1 +
kernel/signal.c | 3 +
net/bridge/br_mdb.c | 4 +
net/core/dev.c | 1 +
net/core/rtnetlink.c | 1 +
net/dcb/dcbnl.c | 8 +
net/ieee802154/6lowpan.h | 2 +-
net/ipv4/tcp_input.c | 6 +-
net/ipv6/ip6_input.c | 3 +-
net/ipv6/route.c | 3 +-
net/l2tp/l2tp_ppp.c | 1 +
net/netlabel/netlabel_unlabeled.c | 27 +-
net/rds/message.c | 3 +
net/sctp/socket.c | 6 +-
scripts/Makefile.headersinst | 11 +-
security/selinux/xfrm.c | 2 +-
sound/core/seq/seq_timer.c | 8 +-
tools/usb/ffs-test.c | 2 +-
87 files changed, 920 insertions(+), 404 deletions(-)


2013-03-18 21:06:46

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 21/75] serial: 8250_pci: add support for another kind of NetMos Technology PCI 9835 Multi-I/O Controller

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Wang YanQing <[email protected]>

commit 8d2f8cd424ca0b99001f3ff4f5db87c4e525f366 upstream.

01:08.0 Communication controller: NetMos Technology PCI 9835 Multi-I/O Controller (rev 01)
Subsystem: Device [1000:0012]
Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Interrupt: pin A routed to IRQ 20
Region 0: I/O ports at e050 [size=8]
Region 1: I/O ports at e040 [size=8]
Region 2: I/O ports at e030 [size=8]
Region 3: I/O ports at e020 [size=8]
Region 4: I/O ports at e010 [size=8]
Region 5: I/O ports at e000 [size=16]

Signed-off-by: Wang YanQing <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/tty/serial/8250/8250_pci.c | 4 ++++
1 file changed, 4 insertions(+)

--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -4449,6 +4449,10 @@ static struct pci_device_id serial_pci_t
PCI_VENDOR_ID_IBM, 0x0299,
0, 0, pbn_b0_bt_2_115200 },

+ { PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9835,
+ 0x1000, 0x0012,
+ 0, 0, pbn_b0_bt_2_115200 },
+
{ PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9901,
0xA000, 0x1000,
0, 0, pbn_b0_1_115200 },

2013-03-18 21:07:08

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 43/75] perf,x86: fix wrmsr_on_cpu() warning on suspend/resume

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Linus Torvalds <[email protected]>

commit 2a6e06b2aed6995af401dcd4feb5e79a0c7ea554 upstream.

Commit 1d9d8639c063 ("perf,x86: fix kernel crash with PEBS/BTS after
suspend/resume") fixed a crash when doing PEBS performance profiling
after resuming, but in using init_debug_store_on_cpu() to restore the
DS_AREA mtrr it also resulted in a new WARN_ON() triggering.

init_debug_store_on_cpu() uses "wrmsr_on_cpu()", which in turn uses CPU
cross-calls to do the MSR update. Which is not really valid at the
early resume stage, and the warning is quite reasonable. Now, it all
happens to _work_, for the simple reason that smp_call_function_single()
ends up just doing the call directly on the CPU when the CPU number
matches, but we really should just do the wrmsr() directly instead.

This duplicates the wrmsr() logic, but hopefully we can just remove the
wrmsr_on_cpu() version eventually.

Reported-and-tested-by: Parag Warudkar <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
arch/x86/kernel/cpu/perf_event_intel_ds.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

--- a/arch/x86/kernel/cpu/perf_event_intel_ds.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c
@@ -732,8 +732,10 @@ void intel_ds_init(void)

void perf_restore_debug_store(void)
{
+ struct debug_store *ds = __this_cpu_read(cpu_hw_events.ds);
+
if (!x86_pmu.bts && !x86_pmu.pebs)
return;

- init_debug_store_on_cpu(smp_processor_id());
+ wrmsrl(MSR_IA32_DS_AREA, (unsigned long)ds);
}

2013-03-18 21:07:11

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 49/75] kbuild: fix make headers_check with make 3.80

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Sam Ravnborg <[email protected]>

commit c4619bc6fa5149a6ab39be845a39142b6a996ea5 upstream.

Commit 10b63956 ("UAPI: Plumb the UAPI Kbuilds into the user header
installation and checking") introduced a dependency of make 3.81
due to use of $(or ...)

We do not want to lift the requirement to gmake 3.81 just yet...
Included are a straightforward conversion to $(if ...)

Bisected-and-tested-by: Tetsuo Handa <[email protected]>
Cc: David Howells <[email protected]>
Signed-off-by: Sam Ravnborg <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
scripts/Makefile.headersinst | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

--- a/scripts/Makefile.headersinst
+++ b/scripts/Makefile.headersinst
@@ -8,7 +8,7 @@
# ==========================================================================

# called may set destination dir (when installing to asm/)
-_dst := $(or $(destination-y),$(dst),$(obj))
+_dst := $(if $(destination-y),$(destination-y),$(if $(dst),$(dst),$(obj)))

# generated header directory
gen := $(if $(gen),$(gen),$(subst include/,include/generated/,$(obj)))
@@ -48,13 +48,14 @@ all-files := $(header-y) $(genhdr-y)
output-files := $(addprefix $(installdir)/, $(all-files))

input-files := $(foreach hdr, $(header-y), \
- $(or \
+ $(if $(wildcard $(srcdir)/$(hdr)), \
$(wildcard $(srcdir)/$(hdr)), \
- $(wildcard $(oldsrcdir)/$(hdr)), \
- $(error Missing UAPI file $(srcdir)/$(hdr)) \
+ $(if $(wildcard $(oldsrcdir)/$(hdr)), \
+ $(wildcard $(oldsrcdir)/$(hdr)), \
+ $(error Missing UAPI file $(srcdir)/$(hdr))) \
)) \
$(foreach hdr, $(genhdr-y), \
- $(or \
+ $(if $(wildcard $(gendir)/$(hdr)), \
$(wildcard $(gendir)/$(hdr)), \
$(error Missing generated UAPI file $(gendir)/$(hdr)) \
))

2013-03-18 21:07:30

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 72/75] dcbnl: fix various netlink info leaks

3.8-stable review patch. If anyone has any objections, please let me know.

------------------


From: Mathias Krause <[email protected]>

[ Upstream commit 29cd8ae0e1a39e239a3a7b67da1986add1199fc0 ]

The dcb netlink interface leaks stack memory in various places:
* perm_addr[] buffer is only filled at max with 12 of the 32 bytes but
copied completely,
* no in-kernel driver fills all fields of an IEEE 802.1Qaz subcommand,
so we're leaking up to 58 bytes for ieee_ets structs, up to 136 bytes
for ieee_pfc structs, etc.,
* the same is true for CEE -- no in-kernel driver fills the whole
struct,

Prevent all of the above stack info leaks by properly initializing the
buffers/structures involved.

Signed-off-by: Mathias Krause <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
net/dcb/dcbnl.c | 8 ++++++++
1 file changed, 8 insertions(+)

--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -284,6 +284,7 @@ static int dcbnl_getperm_hwaddr(struct n
if (!netdev->dcbnl_ops->getpermhwaddr)
return -EOPNOTSUPP;

+ memset(perm_addr, 0, sizeof(perm_addr));
netdev->dcbnl_ops->getpermhwaddr(netdev, perm_addr);

return nla_put(skb, DCB_ATTR_PERM_HWADDR, sizeof(perm_addr), perm_addr);
@@ -1042,6 +1043,7 @@ static int dcbnl_ieee_fill(struct sk_buf

if (ops->ieee_getets) {
struct ieee_ets ets;
+ memset(&ets, 0, sizeof(ets));
err = ops->ieee_getets(netdev, &ets);
if (!err &&
nla_put(skb, DCB_ATTR_IEEE_ETS, sizeof(ets), &ets))
@@ -1050,6 +1052,7 @@ static int dcbnl_ieee_fill(struct sk_buf

if (ops->ieee_getmaxrate) {
struct ieee_maxrate maxrate;
+ memset(&maxrate, 0, sizeof(maxrate));
err = ops->ieee_getmaxrate(netdev, &maxrate);
if (!err) {
err = nla_put(skb, DCB_ATTR_IEEE_MAXRATE,
@@ -1061,6 +1064,7 @@ static int dcbnl_ieee_fill(struct sk_buf

if (ops->ieee_getpfc) {
struct ieee_pfc pfc;
+ memset(&pfc, 0, sizeof(pfc));
err = ops->ieee_getpfc(netdev, &pfc);
if (!err &&
nla_put(skb, DCB_ATTR_IEEE_PFC, sizeof(pfc), &pfc))
@@ -1094,6 +1098,7 @@ static int dcbnl_ieee_fill(struct sk_buf
/* get peer info if available */
if (ops->ieee_peer_getets) {
struct ieee_ets ets;
+ memset(&ets, 0, sizeof(ets));
err = ops->ieee_peer_getets(netdev, &ets);
if (!err &&
nla_put(skb, DCB_ATTR_IEEE_PEER_ETS, sizeof(ets), &ets))
@@ -1102,6 +1107,7 @@ static int dcbnl_ieee_fill(struct sk_buf

if (ops->ieee_peer_getpfc) {
struct ieee_pfc pfc;
+ memset(&pfc, 0, sizeof(pfc));
err = ops->ieee_peer_getpfc(netdev, &pfc);
if (!err &&
nla_put(skb, DCB_ATTR_IEEE_PEER_PFC, sizeof(pfc), &pfc))
@@ -1280,6 +1286,7 @@ static int dcbnl_cee_fill(struct sk_buff
/* peer info if available */
if (ops->cee_peer_getpg) {
struct cee_pg pg;
+ memset(&pg, 0, sizeof(pg));
err = ops->cee_peer_getpg(netdev, &pg);
if (!err &&
nla_put(skb, DCB_ATTR_CEE_PEER_PG, sizeof(pg), &pg))
@@ -1288,6 +1295,7 @@ static int dcbnl_cee_fill(struct sk_buff

if (ops->cee_peer_getpfc) {
struct cee_pfc pfc;
+ memset(&pfc, 0, sizeof(pfc));
err = ops->cee_peer_getpfc(netdev, &pfc);
if (!err &&
nla_put(skb, DCB_ATTR_CEE_PEER_PFC, sizeof(pfc), &pfc))

2013-03-18 21:11:41

by Stephane Eranian

[permalink] [raw]
Subject: Re: [ 29/75] perf,x86: fix kernel crash with PEBS/BTS after suspend/resume

On Mon, Mar 18, 2013 at 10:06 PM, Greg Kroah-Hartman
<[email protected]> wrote:
> 3.8-stable review patch. If anyone has any objections, please let me know.
>
Greg, you also need to pick David Rientjes patch to fix compilation on
non X86 architectures.
Thanks.
> ------------------
>
> From: Stephane Eranian <[email protected]>
>
> commit 1d9d8639c063caf6efc2447f5f26aa637f844ff6 upstream.
>
> This patch fixes a kernel crash when using precise sampling (PEBS)
> after a suspend/resume. Turns out the CPU notifier code is not invoked
> on CPU0 (BP). Therefore, the DS_AREA (used by PEBS) is not restored properly
> by the kernel and keeps it power-on/resume value of 0 causing any PEBS
> measurement to crash when running on CPU0.
>
> The workaround is to add a hook in the actual resume code to restore
> the DS Area MSR value. It is invoked for all CPUS. So for all but CPU0,
> the DS_AREA will be restored twice but this is harmless.
>
> Reported-by: Linus Torvalds <[email protected]>
> Signed-off-by: Stephane Eranian <[email protected]>
> Signed-off-by: Linus Torvalds <[email protected]>
> Signed-off-by: Greg Kroah-Hartman <[email protected]>
>
> ---
> arch/x86/kernel/cpu/perf_event_intel_ds.c | 8 ++++++++
> arch/x86/power/cpu.c | 2 ++
> include/linux/perf_event.h | 2 ++
> 3 files changed, 12 insertions(+)
>
> --- a/arch/x86/kernel/cpu/perf_event_intel_ds.c
> +++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c
> @@ -729,3 +729,11 @@ void intel_ds_init(void)
> }
> }
> }
> +
> +void perf_restore_debug_store(void)
> +{
> + if (!x86_pmu.bts && !x86_pmu.pebs)
> + return;
> +
> + init_debug_store_on_cpu(smp_processor_id());
> +}
> --- a/arch/x86/power/cpu.c
> +++ b/arch/x86/power/cpu.c
> @@ -11,6 +11,7 @@
> #include <linux/suspend.h>
> #include <linux/export.h>
> #include <linux/smp.h>
> +#include <linux/perf_event.h>
>
> #include <asm/pgtable.h>
> #include <asm/proto.h>
> @@ -228,6 +229,7 @@ static void __restore_processor_state(st
> do_fpu_end();
> x86_platform.restore_sched_clock_state();
> mtrr_bp_restore();
> + perf_restore_debug_store();
> }
>
> /* Needed by apm.c */
> --- a/include/linux/perf_event.h
> +++ b/include/linux/perf_event.h
> @@ -753,6 +753,7 @@ extern void perf_event_enable(struct per
> extern void perf_event_disable(struct perf_event *event);
> extern int __perf_event_disable(void *info);
> extern void perf_event_task_tick(void);
> +extern void perf_restore_debug_store(void);
> #else
> static inline void
> perf_event_task_sched_in(struct task_struct *prev,
> @@ -792,6 +793,7 @@ static inline void perf_event_enable(str
> static inline void perf_event_disable(struct perf_event *event) { }
> static inline int __perf_event_disable(void *info) { return -1; }
> static inline void perf_event_task_tick(void) { }
> +static inline void perf_restore_debug_store(void) { }
> #endif
>
> #define perf_output_put(handle, x) perf_output_copy((handle), &(x), sizeof(x))
>
>

2013-03-18 21:19:37

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [ 29/75] perf,x86: fix kernel crash with PEBS/BTS after suspend/resume

On Mon, Mar 18, 2013 at 10:11:28PM +0100, Stephane Eranian wrote:
> On Mon, Mar 18, 2013 at 10:06 PM, Greg Kroah-Hartman
> <[email protected]> wrote:
> > 3.8-stable review patch. If anyone has any objections, please let me know.
> >
> Greg, you also need to pick David Rientjes patch to fix compilation on
> non X86 architectures.

What git commit id would that be? I thought I picked up everything that
was needed after this one went in, what did I miss?

thanks,

greg k-h

2013-03-18 21:35:34

by Stephane Eranian

[permalink] [raw]
Subject: Re: [ 29/75] perf,x86: fix kernel crash with PEBS/BTS after suspend/resume

On Mon, Mar 18, 2013 at 10:20 PM, Greg Kroah-Hartman
<[email protected]> wrote:
> On Mon, Mar 18, 2013 at 10:11:28PM +0100, Stephane Eranian wrote:
>> On Mon, Mar 18, 2013 at 10:06 PM, Greg Kroah-Hartman
>> <[email protected]> wrote:
>> > 3.8-stable review patch. If anyone has any objections, please let me know.
>> >
>> Greg, you also need to pick David Rientjes patch to fix compilation on
>> non X86 architectures.
>
> What git commit id would that be? I thought I picked up everything that
> was needed after this one went in, what did I miss?
>
Talking about this particular patch: https://lkml.org/lkml/2013/3/17/183
Don't know if it's in already.

2013-03-18 21:07:28

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 59/75] rds: limit the size allocated by rds_message_alloc()

3.8-stable review patch. If anyone has any objections, please let me know.

------------------


From: Cong Wang <[email protected]>

[ Upstream commit ece6b0a2b25652d684a7ced4ae680a863af041e0 ]

Dave Jones reported the following bug:

"When fed mangled socket data, rds will trust what userspace gives it,
and tries to allocate enormous amounts of memory larger than what
kmalloc can satisfy."

WARNING: at mm/page_alloc.c:2393 __alloc_pages_nodemask+0xa0d/0xbe0()
Hardware name: GA-MA78GM-S2H
Modules linked in: vmw_vsock_vmci_transport vmw_vmci vsock fuse bnep dlci bridge 8021q garp stp mrp binfmt_misc l2tp_ppp l2tp_core rfcomm s
Pid: 24652, comm: trinity-child2 Not tainted 3.8.0+ #65
Call Trace:
[<ffffffff81044155>] warn_slowpath_common+0x75/0xa0
[<ffffffff8104419a>] warn_slowpath_null+0x1a/0x20
[<ffffffff811444ad>] __alloc_pages_nodemask+0xa0d/0xbe0
[<ffffffff8100a196>] ? native_sched_clock+0x26/0x90
[<ffffffff810b2128>] ? trace_hardirqs_off_caller+0x28/0xc0
[<ffffffff810b21cd>] ? trace_hardirqs_off+0xd/0x10
[<ffffffff811861f8>] alloc_pages_current+0xb8/0x180
[<ffffffff8113eaaa>] __get_free_pages+0x2a/0x80
[<ffffffff811934fe>] kmalloc_order_trace+0x3e/0x1a0
[<ffffffff81193955>] __kmalloc+0x2f5/0x3a0
[<ffffffff8104df0c>] ? local_bh_enable_ip+0x7c/0xf0
[<ffffffffa0401ab3>] rds_message_alloc+0x23/0xb0 [rds]
[<ffffffffa04043a1>] rds_sendmsg+0x2b1/0x990 [rds]
[<ffffffff810b21cd>] ? trace_hardirqs_off+0xd/0x10
[<ffffffff81564620>] sock_sendmsg+0xb0/0xe0
[<ffffffff810b2052>] ? get_lock_stats+0x22/0x70
[<ffffffff810b24be>] ? put_lock_stats.isra.23+0xe/0x40
[<ffffffff81567f30>] sys_sendto+0x130/0x180
[<ffffffff810b872d>] ? trace_hardirqs_on+0xd/0x10
[<ffffffff816c547b>] ? _raw_spin_unlock_irq+0x3b/0x60
[<ffffffff816cd767>] ? sysret_check+0x1b/0x56
[<ffffffff810b8695>] ? trace_hardirqs_on_caller+0x115/0x1a0
[<ffffffff81341d8e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[<ffffffff816cd742>] system_call_fastpath+0x16/0x1b
---[ end trace eed6ae990d018c8b ]---

Reported-by: Dave Jones <[email protected]>
Cc: Dave Jones <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Venkat Venkatsubra <[email protected]>
Signed-off-by: Cong Wang <[email protected]>
Acked-by: Venkat Venkatsubra <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
net/rds/message.c | 3 +++
1 file changed, 3 insertions(+)

--- a/net/rds/message.c
+++ b/net/rds/message.c
@@ -197,6 +197,9 @@ struct rds_message *rds_message_alloc(un
{
struct rds_message *rm;

+ if (extra_len > KMALLOC_MAX_SIZE - sizeof(struct rds_message))
+ return NULL;
+
rm = kzalloc(sizeof(struct rds_message) + extra_len, gfp);
if (!rm)
goto out;

2013-03-18 21:07:25

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 63/75] vxlan: fix oops when delete netns containing vxlan

3.8-stable review patch. If anyone has any objections, please let me know.

------------------


From: Zang MingJie <[email protected]>

[ Upstream commit 9cb6cb7ed11cd3b69c47bb414983603a6ff20b1d ]

The following script will produce a kernel oops:

sudo ip netns add v
sudo ip netns exec v ip ad add 127.0.0.1/8 dev lo
sudo ip netns exec v ip link set lo up
sudo ip netns exec v ip ro add 224.0.0.0/4 dev lo
sudo ip netns exec v ip li add vxlan0 type vxlan id 42 group 239.1.1.1 dev lo
sudo ip netns exec v ip link set vxlan0 up
sudo ip netns del v

where inspect by gdb:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 107]
0xffffffffa0289e33 in ?? ()
(gdb) bt
#0 vxlan_leave_group (dev=0xffff88001bafa000) at drivers/net/vxlan.c:533
#1 vxlan_stop (dev=0xffff88001bafa000) at drivers/net/vxlan.c:1087
#2 0xffffffff812cc498 in __dev_close_many (head=head@entry=0xffff88001f2e7dc8) at net/core/dev.c:1299
#3 0xffffffff812cd920 in dev_close_many (head=head@entry=0xffff88001f2e7dc8) at net/core/dev.c:1335
#4 0xffffffff812cef31 in rollback_registered_many (head=head@entry=0xffff88001f2e7dc8) at net/core/dev.c:4851
#5 0xffffffff812cf040 in unregister_netdevice_many (head=head@entry=0xffff88001f2e7dc8) at net/core/dev.c:5752
#6 0xffffffff812cf1ba in default_device_exit_batch (net_list=0xffff88001f2e7e18) at net/core/dev.c:6170
#7 0xffffffff812cab27 in cleanup_net (work=<optimized out>) at net/core/net_namespace.c:302
#8 0xffffffff810540ef in process_one_work (worker=0xffff88001ba9ed40, work=0xffffffff8167d020) at kernel/workqueue.c:2157
#9 0xffffffff810549d0 in worker_thread (__worker=__worker@entry=0xffff88001ba9ed40) at kernel/workqueue.c:2276
#10 0xffffffff8105870c in kthread (_create=0xffff88001f2e5d68) at kernel/kthread.c:168
#11 <signal handler called>
#12 0x0000000000000000 in ?? ()
#13 0x0000000000000000 in ?? ()
(gdb) fr 0
#0 vxlan_leave_group (dev=0xffff88001bafa000) at drivers/net/vxlan.c:533
533 struct sock *sk = vn->sock->sk;
(gdb) l
528 static int vxlan_leave_group(struct net_device *dev)
529 {
530 struct vxlan_dev *vxlan = netdev_priv(dev);
531 struct vxlan_net *vn = net_generic(dev_net(dev), vxlan_net_id);
532 int err = 0;
533 struct sock *sk = vn->sock->sk;
534 struct ip_mreqn mreq = {
535 .imr_multiaddr.s_addr = vxlan->gaddr,
536 .imr_ifindex = vxlan->link,
537 };
(gdb) p vn->sock
$4 = (struct socket *) 0x0

The kernel calls `vxlan_exit_net` when deleting the netns before shutting down
vxlan interfaces. Later the removal of all vxlan interfaces, where `vn->sock`
is already gone causes the oops. so we should manually shutdown all interfaces
before deleting `vn->sock` as the patch does.

Signed-off-by: Zang MingJie <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/net/vxlan.c | 9 +++++++++
1 file changed, 9 insertions(+)

--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -1491,6 +1491,15 @@ static __net_init int vxlan_init_net(str
static __net_exit void vxlan_exit_net(struct net *net)
{
struct vxlan_net *vn = net_generic(net, vxlan_net_id);
+ struct vxlan_dev *vxlan;
+ struct hlist_node *pos;
+ unsigned h;
+
+ rtnl_lock();
+ for (h = 0; h < VNI_HASH_SIZE; ++h)
+ hlist_for_each_entry(vxlan, pos, &vn->vni_list[h], hlist)
+ dev_close(vxlan->dev);
+ rtnl_unlock();

if (vn->sock) {
sk_release_kernel(vn->sock->sk);

2013-03-18 21:46:03

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 65/75] team: unsyc the devices addresses when port is removed

3.8-stable review patch. If anyone has any objections, please let me know.

------------------


From: Vlad Yasevich <[email protected]>

[ Upstream commit ba81276b1a5e3cf0674cb0e6d9525e5ae0c98695 ]

When a team port is removed, unsync all devices addresses that may have
been synched to the port devices.

CC: Jiri Pirko <[email protected]>
Signed-off-by: Vlad Yasevich <[email protected]>
Acked-by: Jiri Pirko <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/net/team/team.c | 2 ++
1 file changed, 2 insertions(+)

--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -1139,6 +1139,8 @@ static int team_port_del(struct team *te
netdev_set_master(port_dev, NULL);
team_port_disable_netpoll(port);
vlan_vids_del_by_dev(port_dev, dev);
+ dev_uc_unsync(port_dev, dev);
+ dev_mc_unsync(port_dev, dev);
dev_close(port_dev);
team_port_leave(team, port);
team_port_set_orig_dev_addr(port);

2013-03-18 21:07:23

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 60/75] net: ipv6: Dont purge default router if accept_ra=2

3.8-stable review patch. If anyone has any objections, please let me know.

------------------


From: Lorenzo Colitti <[email protected]>

[ Upstream commit 3e8b0ac3e41e3c882222a5522d5df7212438ab51 ]

Setting net.ipv6.conf.<interface>.accept_ra=2 causes the kernel
to accept RAs even when forwarding is enabled. However, enabling
forwarding purges all default routes on the system, breaking
connectivity until the next RA is received. Fix this by not
purging default routes on interfaces that have accept_ra=2.

Signed-off-by: Lorenzo Colitti <[email protected]>
Acked-by: YOSHIFUJI Hideaki <[email protected]>
Acked-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
net/ipv6/route.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1990,7 +1990,8 @@ void rt6_purge_dflt_routers(struct net *
restart:
read_lock_bh(&table->tb6_lock);
for (rt = table->tb6_root.leaf; rt; rt = rt->dst.rt6_next) {
- if (rt->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF)) {
+ if (rt->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF) &&
+ (!rt->rt6i_idev || rt->rt6i_idev->cnf.accept_ra != 2)) {
dst_hold(&rt->dst);
read_unlock_bh(&table->tb6_lock);
ip6_del_rt(rt);

2013-03-18 21:46:27

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 74/75] Revert "drm/i915: enable irqs earlier when resuming"

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

This reverts commit 31f14f4219d2a74b7a6d86c7798f49141b5eccbe which was
commit 15239099d7a7a9ecdc1ccb5b187ae4cda5488ff9 upstream.

It caused problems in the 3.8-stable series, but 3.9-rc is just fine.

Signed-off-by: Greg Kroah-Hartman <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: Mika Kuoppala <[email protected]>
Cc: Ilya Tumaykin <[email protected]>
Cc: Daniel Vetter <[email protected]>

---
drivers/gpu/drm/i915/i915_drv.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)

--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -486,7 +486,6 @@ static int i915_drm_freeze(struct drm_de
intel_modeset_disable(dev);

drm_irq_uninstall(dev);
- dev_priv->enable_hotplug_processing = false;
}

i915_save_state(dev);
@@ -563,19 +562,9 @@ static int __i915_drm_thaw(struct drm_de
error = i915_gem_init_hw(dev);
mutex_unlock(&dev->struct_mutex);

- /* We need working interrupts for modeset enabling ... */
- drm_irq_install(dev);
-
intel_modeset_init_hw(dev);
intel_modeset_setup_hw_state(dev, false);
-
- /*
- * ... but also need to make sure that hotplug processing
- * doesn't cause havoc. Like in the driver load code we don't
- * bother with the tiny race here where we might loose hotplug
- * notifications.
- * */
- dev_priv->enable_hotplug_processing = true;
+ drm_irq_install(dev);
}

intel_opregion_init(dev);

2013-03-18 21:46:46

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 73/75] 6lowpan: Fix endianness issue in is_addr_link_local().

3.8-stable review patch. If anyone has any objections, please let me know.

------------------


From: YOSHIFUJI Hideaki <[email protected]>

[ Upstream commit 9026c4927254f5bea695cc3ef2e255280e6a3011 ]

Signed-off-by: YOSHIFUJI Hideaki <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
net/ieee802154/6lowpan.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/ieee802154/6lowpan.h
+++ b/net/ieee802154/6lowpan.h
@@ -84,7 +84,7 @@
(memcmp(addr1, addr2, length >> 3) == 0)

/* local link, i.e. FE80::/10 */
-#define is_addr_link_local(a) (((a)->s6_addr16[0]) == 0x80FE)
+#define is_addr_link_local(a) (((a)->s6_addr16[0]) == htons(0xFE80))

/*
* check whether we can compress the IID to 16 bits,

2013-03-18 21:07:21

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 61/75] tcp: fix double-counted receiver RTT when leaving receiver fast path

3.8-stable review patch. If anyone has any objections, please let me know.

------------------


From: Neal Cardwell <[email protected]>

[ Upstream commit aab2b4bf224ef8358d262f95b568b8ad0cecf0a0 ]

We should not update ts_recent and call tcp_rcv_rtt_measure_ts() both
before and after going to step5. That wastes CPU and double-counts the
receiver-side RTT sample.

Signed-off-by: Neal Cardwell <[email protected]>
Acked-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
net/ipv4/tcp_input.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -5498,6 +5498,9 @@ int tcp_rcv_established(struct sock *sk,
if (tcp_checksum_complete_user(sk, skb))
goto csum_error;

+ if ((int)skb->truesize > sk->sk_forward_alloc)
+ goto step5;
+
/* Predicted packet is in window by definition.
* seq == rcv_nxt and rcv_wup <= rcv_nxt.
* Hence, check seq<=rcv_wup reduces to:
@@ -5509,9 +5512,6 @@ int tcp_rcv_established(struct sock *sk,

tcp_rcv_rtt_measure_ts(sk, skb);

- if ((int)skb->truesize > sk->sk_forward_alloc)
- goto step5;
-
NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPHPHITS);

/* Bulk data transfer: receiver */

2013-03-18 21:47:01

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 71/75] rtnl: fix info leak on RTM_GETLINK request for VF devices

3.8-stable review patch. If anyone has any objections, please let me know.

------------------


From: Mathias Krause <[email protected]>

[ Upstream commit 84d73cd3fb142bf1298a8c13fd4ca50fd2432372 ]

Initialize the mac address buffer with 0 as the driver specific function
will probably not fill the whole buffer. In fact, all in-kernel drivers
fill only ETH_ALEN of the MAX_ADDR_LEN bytes, i.e. 6 of the 32 possible
bytes. Therefore we currently leak 26 bytes of stack memory to userland
via the netlink interface.

Signed-off-by: Mathias Krause <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
net/core/rtnetlink.c | 1 +
1 file changed, 1 insertion(+)

--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -976,6 +976,7 @@ static int rtnl_fill_ifinfo(struct sk_bu
* report anything.
*/
ivi.spoofchk = -1;
+ memset(ivi.mac, 0, sizeof(ivi.mac));
if (dev->netdev_ops->ndo_get_vf_config(dev, i, &ivi))
break;
vf_mac.vf =

2013-03-18 21:47:38

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 70/75] bridge: fix mdb info leaks

3.8-stable review patch. If anyone has any objections, please let me know.

------------------


From: Mathias Krause <[email protected]>

[ Upstream commit c085c49920b2f900ba716b4ca1c1a55ece9872cc ]

The bridging code discloses heap and stack bytes via the RTM_GETMDB
netlink interface and via the notify messages send to group RTNLGRP_MDB
afer a successful add/del.

Fix both cases by initializing all unset members/padding bytes with
memset(0).

Cc: Stephen Hemminger <[email protected]>
Signed-off-by: Mathias Krause <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
net/bridge/br_mdb.c | 4 ++++
1 file changed, 4 insertions(+)

--- a/net/bridge/br_mdb.c
+++ b/net/bridge/br_mdb.c
@@ -82,6 +82,7 @@ static int br_mdb_fill_info(struct sk_bu
port = p->port;
if (port) {
struct br_mdb_entry e;
+ memset(&e, 0, sizeof(e));
e.ifindex = port->dev->ifindex;
e.state = p->state;
if (p->addr.proto == htons(ETH_P_IP))
@@ -138,6 +139,7 @@ static int br_mdb_dump(struct sk_buff *s
break;

bpm = nlmsg_data(nlh);
+ memset(bpm, 0, sizeof(*bpm));
bpm->ifindex = dev->ifindex;
if (br_mdb_fill_info(skb, cb, dev) < 0)
goto out;
@@ -173,6 +175,7 @@ static int nlmsg_populate_mdb_fill(struc
return -EMSGSIZE;

bpm = nlmsg_data(nlh);
+ memset(bpm, 0, sizeof(*bpm));
bpm->family = AF_BRIDGE;
bpm->ifindex = dev->ifindex;
nest = nla_nest_start(skb, MDBA_MDB);
@@ -230,6 +233,7 @@ void br_mdb_notify(struct net_device *de
{
struct br_mdb_entry entry;

+ memset(&entry, 0, sizeof(entry));
entry.ifindex = port->dev->ifindex;
entry.addr.proto = group->proto;
entry.addr.u.ip4 = group->u.ip4;

2013-03-18 21:47:55

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 69/75] ipv6: stop multicast forwarding to process interface scoped addresses

3.8-stable review patch. If anyone has any objections, please let me know.

------------------


From: Hannes Frederic Sowa <[email protected]>

[ Upstream commit ddf64354af4a702ee0b85d0a285ba74c7278a460 ]

v2:
a) used struct ipv6_addr_props

v3:
a) reverted changes for ipv6_addr_props

v4:
a) do not use __ipv6_addr_needs_scope_id

Cc: YOSHIFUJI Hideaki <[email protected]>
Signed-off-by: Hannes Frederic Sowa <[email protected]>
Acked-by: YOSHIFUJI Hideaki <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
net/ipv6/ip6_input.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -270,7 +270,8 @@ int ip6_mc_input(struct sk_buff *skb)
* IPv6 multicast router mode is now supported ;)
*/
if (dev_net(skb->dev)->ipv6.devconf_all->mc_forwarding &&
- !(ipv6_addr_type(&hdr->daddr) & IPV6_ADDR_LINKLOCAL) &&
+ !(ipv6_addr_type(&hdr->daddr) &
+ (IPV6_ADDR_LOOPBACK|IPV6_ADDR_LINKLOCAL)) &&
likely(!(IP6CB(skb)->flags & IP6SKB_FORWARDED))) {
/*
* Okay, we try to forward - split and duplicate

2013-03-18 21:48:13

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 68/75] bridging: fix rx_handlers return code

3.8-stable review patch. If anyone has any objections, please let me know.

------------------


From: Cristian Bercaru <[email protected]>

[ Upstream commit 3bc1b1add7a8484cc4a261c3e128dbe1528ce01f ]

The frames for which rx_handlers return RX_HANDLER_CONSUMED are no longer
counted as dropped. They are counted as successfully received by
'netif_receive_skb'.

This allows network interface drivers to correctly update their RX-OK and
RX-DRP counters based on the result of 'netif_receive_skb'.

Signed-off-by: Cristian Bercaru <[email protected]>
Signed-off-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
net/core/dev.c | 1 +
1 file changed, 1 insertion(+)

--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3419,6 +3419,7 @@ ncls:
}
switch (rx_handler(&skb)) {
case RX_HANDLER_CONSUMED:
+ ret = NET_RX_SUCCESS;
goto unlock;
case RX_HANDLER_ANOTHER:
goto another_round;

2013-03-18 21:48:33

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 66/75] macvlan: Set IFF_UNICAST_FLT flag to prevent unnecessary promisc mode.

3.8-stable review patch. If anyone has any objections, please let me know.

------------------


From: Vlad Yasevich <[email protected]>

[ Upstream commit 87ab7f6f2874f1115817e394a7ed2dea1c72549e ]

Macvlan already supports hw address filters. Set the IFF_UNICAST_FLT
so that it doesn't needlesly enter PROMISC mode when macvlans are
stacked.

Signed-of-by: Vlad Yasevich <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/net/macvlan.c | 1 +
1 file changed, 1 insertion(+)

--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -628,6 +628,7 @@ void macvlan_common_setup(struct net_dev
ether_setup(dev);

dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
+ dev->priv_flags |= IFF_UNICAST_FLT;
dev->netdev_ops = &macvlan_netdev_ops;
dev->destructor = free_netdev;
dev->header_ops = &macvlan_hard_header_ops,

2013-03-18 21:48:32

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 67/75] netlabel: correctly list all the static label mappings

3.8-stable review patch. If anyone has any objections, please let me know.

------------------


From: Paul Moore <[email protected]>

[ Upstream commits 0c1233aba1e948c37f6dc7620cb7c253fcd71ce9 and
a6a8fe950e1b8596bb06f2c89c3a1a4bf2011ba9 ]

When we have a large number of static label mappings that spill across
the netlink message boundary we fail to properly save our state in the
netlink_callback struct which causes us to repeat the same listings.
This patch fixes this problem by saving the state correctly between
calls to the NetLabel static label netlink "dumpit" routines.

Signed-off-by: Paul Moore <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
net/netlabel/netlabel_unlabeled.c | 27 +++++++++++----------------
1 file changed, 11 insertions(+), 16 deletions(-)

--- a/net/netlabel/netlabel_unlabeled.c
+++ b/net/netlabel/netlabel_unlabeled.c
@@ -1189,8 +1189,6 @@ static int netlbl_unlabel_staticlist(str
struct netlbl_unlhsh_walk_arg cb_arg;
u32 skip_bkt = cb->args[0];
u32 skip_chain = cb->args[1];
- u32 skip_addr4 = cb->args[2];
- u32 skip_addr6 = cb->args[3];
u32 iter_bkt;
u32 iter_chain = 0, iter_addr4 = 0, iter_addr6 = 0;
struct netlbl_unlhsh_iface *iface;
@@ -1215,7 +1213,7 @@ static int netlbl_unlabel_staticlist(str
continue;
netlbl_af4list_foreach_rcu(addr4,
&iface->addr4_list) {
- if (iter_addr4++ < skip_addr4)
+ if (iter_addr4++ < cb->args[2])
continue;
if (netlbl_unlabel_staticlist_gen(
NLBL_UNLABEL_C_STATICLIST,
@@ -1231,7 +1229,7 @@ static int netlbl_unlabel_staticlist(str
#if IS_ENABLED(CONFIG_IPV6)
netlbl_af6list_foreach_rcu(addr6,
&iface->addr6_list) {
- if (iter_addr6++ < skip_addr6)
+ if (iter_addr6++ < cb->args[3])
continue;
if (netlbl_unlabel_staticlist_gen(
NLBL_UNLABEL_C_STATICLIST,
@@ -1250,10 +1248,10 @@ static int netlbl_unlabel_staticlist(str

unlabel_staticlist_return:
rcu_read_unlock();
- cb->args[0] = skip_bkt;
- cb->args[1] = skip_chain;
- cb->args[2] = skip_addr4;
- cb->args[3] = skip_addr6;
+ cb->args[0] = iter_bkt;
+ cb->args[1] = iter_chain;
+ cb->args[2] = iter_addr4;
+ cb->args[3] = iter_addr6;
return skb->len;
}

@@ -1273,12 +1271,9 @@ static int netlbl_unlabel_staticlistdef(
{
struct netlbl_unlhsh_walk_arg cb_arg;
struct netlbl_unlhsh_iface *iface;
- u32 skip_addr4 = cb->args[0];
- u32 skip_addr6 = cb->args[1];
- u32 iter_addr4 = 0;
+ u32 iter_addr4 = 0, iter_addr6 = 0;
struct netlbl_af4list *addr4;
#if IS_ENABLED(CONFIG_IPV6)
- u32 iter_addr6 = 0;
struct netlbl_af6list *addr6;
#endif

@@ -1292,7 +1287,7 @@ static int netlbl_unlabel_staticlistdef(
goto unlabel_staticlistdef_return;

netlbl_af4list_foreach_rcu(addr4, &iface->addr4_list) {
- if (iter_addr4++ < skip_addr4)
+ if (iter_addr4++ < cb->args[0])
continue;
if (netlbl_unlabel_staticlist_gen(NLBL_UNLABEL_C_STATICLISTDEF,
iface,
@@ -1305,7 +1300,7 @@ static int netlbl_unlabel_staticlistdef(
}
#if IS_ENABLED(CONFIG_IPV6)
netlbl_af6list_foreach_rcu(addr6, &iface->addr6_list) {
- if (iter_addr6++ < skip_addr6)
+ if (iter_addr6++ < cb->args[1])
continue;
if (netlbl_unlabel_staticlist_gen(NLBL_UNLABEL_C_STATICLISTDEF,
iface,
@@ -1320,8 +1315,8 @@ static int netlbl_unlabel_staticlistdef(

unlabel_staticlistdef_return:
rcu_read_unlock();
- cb->args[0] = skip_addr4;
- cb->args[1] = skip_addr6;
+ cb->args[0] = iter_addr4;
+ cb->args[1] = iter_addr6;
return skb->len;
}


2013-03-18 21:07:17

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 62/75] tun: add a missing nf_reset() in tun_net_xmit()

3.8-stable review patch. If anyone has any objections, please let me know.

------------------


From: Eric Dumazet <[email protected]>

[ Upstream commit f8af75f3517a24838a36eb5797a1a3e60bf9e276 ]

Dave reported following crash :

general protection fault: 0000 [#1] SMP
CPU 2
Pid: 25407, comm: qemu-kvm Not tainted 3.7.9-205.fc18.x86_64 #1 Hewlett-Packard HP Z400 Workstation/0B4Ch
RIP: 0010:[<ffffffffa0399bd5>] [<ffffffffa0399bd5>] destroy_conntrack+0x35/0x120 [nf_conntrack]
RSP: 0018:ffff880276913d78 EFLAGS: 00010206
RAX: 50626b6b7876376c RBX: ffff88026e530d68 RCX: ffff88028d158e00
RDX: ffff88026d0d5470 RSI: 0000000000000011 RDI: 0000000000000002
RBP: ffff880276913d88 R08: 0000000000000000 R09: ffff880295002900
R10: 0000000000000000 R11: 0000000000000003 R12: ffffffff81ca3b40
R13: ffffffff8151a8e0 R14: ffff880270875000 R15: 0000000000000002
FS: 00007ff3bce38a00(0000) GS:ffff88029fc40000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 00007fd1430bd000 CR3: 000000027042b000 CR4: 00000000000027e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process qemu-kvm (pid: 25407, threadinfo ffff880276912000, task ffff88028c369720)
Stack:
ffff880156f59100 ffff880156f59100 ffff880276913d98 ffffffff815534f7
ffff880276913db8 ffffffff8151a74b ffff880270875000 ffff880156f59100
ffff880276913dd8 ffffffff8151a5a6 ffff880276913dd8 ffff88026d0d5470
Call Trace:
[<ffffffff815534f7>] nf_conntrack_destroy+0x17/0x20
[<ffffffff8151a74b>] skb_release_head_state+0x7b/0x100
[<ffffffff8151a5a6>] __kfree_skb+0x16/0xa0
[<ffffffff8151a666>] kfree_skb+0x36/0xa0
[<ffffffff8151a8e0>] skb_queue_purge+0x20/0x40
[<ffffffffa02205f7>] __tun_detach+0x117/0x140 [tun]
[<ffffffffa022184c>] tun_chr_close+0x3c/0xd0 [tun]
[<ffffffff8119669c>] __fput+0xec/0x240
[<ffffffff811967fe>] ____fput+0xe/0x10
[<ffffffff8107eb27>] task_work_run+0xa7/0xe0
[<ffffffff810149e1>] do_notify_resume+0x71/0xb0
[<ffffffff81640152>] int_signal+0x12/0x17
Code: 00 00 04 48 89 e5 41 54 53 48 89 fb 4c 8b a7 e8 00 00 00 0f 85 de 00 00 00 0f b6 73 3e 0f b7 7b 2a e8 10 40 00 00 48 85 c0 74 0e <48> 8b 40 28 48 85 c0 74 05 48 89 df ff d0 48 c7 c7 08 6a 3a a0
RIP [<ffffffffa0399bd5>] destroy_conntrack+0x35/0x120 [nf_conntrack]
RSP <ffff880276913d78>

This is because tun_net_xmit() needs to call nf_reset()
before queuing skb into receive_queue

Reported-by: Dave Jones <[email protected]>
Signed-off-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/net/tun.c | 2 ++
1 file changed, 2 insertions(+)

--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -748,6 +748,8 @@ static netdev_tx_t tun_net_xmit(struct s
goto drop;
skb_orphan(skb);

+ nf_reset(skb);
+
/* Enqueue packet */
skb_queue_tail(&tfile->socket.sk->sk_receive_queue, skb);


2013-03-18 21:48:59

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 75/75] Revert "drm/i915: reorder setup sequence to have irqs for output setup"

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

Revert commit 2a9810441fcc26cf3f006f015f8a62094fe57a90 which is
commit 52d7ecedac3f96fb562cb482c139015372728638 upstream.

This caused problems in 3.8-stable, but all is fine in 3.9-rc.

Signed-off-by: Greg Kroah-Hartman <[email protected]>
Cc: Imre Deak <[email protected]>
Cc: Daniel Vetter <[email protected]>

---
drivers/gpu/drm/i915/i915_dma.c | 23 +++++++++--------------
drivers/gpu/drm/i915/i915_drv.h | 1 -
drivers/gpu/drm/i915/i915_irq.c | 4 ----
3 files changed, 9 insertions(+), 19 deletions(-)

--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1297,21 +1297,19 @@ static int i915_load_modeset_init(struct
if (ret)
goto cleanup_vga_switcheroo;

- ret = drm_irq_install(dev);
- if (ret)
- goto cleanup_gem_stolen;
-
- /* Important: The output setup functions called by modeset_init need
- * working irqs for e.g. gmbus and dp aux transfers. */
intel_modeset_init(dev);

ret = i915_gem_init(dev);
if (ret)
- goto cleanup_irq;
+ goto cleanup_gem_stolen;
+
+ intel_modeset_gem_init(dev);

INIT_WORK(&dev_priv->console_resume_work, intel_console_resume);

- intel_modeset_gem_init(dev);
+ ret = drm_irq_install(dev);
+ if (ret)
+ goto cleanup_gem;

/* Always safe in the mode setting case. */
/* FIXME: do pre/post-mode set stuff in core KMS code */
@@ -1319,10 +1317,7 @@ static int i915_load_modeset_init(struct

ret = intel_fbdev_init(dev);
if (ret)
- goto cleanup_gem;
-
- /* Only enable hotplug handling once the fbdev is fully set up. */
- dev_priv->enable_hotplug_processing = true;
+ goto cleanup_irq;

drm_kms_helper_poll_init(dev);

@@ -1331,13 +1326,13 @@ static int i915_load_modeset_init(struct

return 0;

+cleanup_irq:
+ drm_irq_uninstall(dev);
cleanup_gem:
mutex_lock(&dev->struct_mutex);
i915_gem_cleanup_ringbuffer(dev);
mutex_unlock(&dev->struct_mutex);
i915_gem_cleanup_aliasing_ppgtt(dev);
-cleanup_irq:
- drm_irq_uninstall(dev);
cleanup_gem_stolen:
i915_gem_cleanup_stolen(dev);
cleanup_vga_switcheroo:
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -672,7 +672,6 @@ typedef struct drm_i915_private {

u32 hotplug_supported_mask;
struct work_struct hotplug_work;
- bool enable_hotplug_processing;

int num_pipe;
int num_pch_pll;
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -287,10 +287,6 @@ static void i915_hotplug_work_func(struc
struct drm_mode_config *mode_config = &dev->mode_config;
struct intel_encoder *encoder;

- /* HPD irq before everything is fully set up. */
- if (!dev_priv->enable_hotplug_processing)
- return;
-
mutex_lock(&mode_config->mutex);
DRM_DEBUG_KMS("running encoder hotplug functions\n");


2013-03-18 21:49:27

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 55/75] loopdev: remove an user triggerable oops

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Guo Chao <[email protected]>

commit b1a6650406875b9097a032eed89af50682fe1160 upstream.

When loopdev is built as module and we pass an invalid parameter,
loop_init() will return directly without deregister misc device, which
will cause an oops when insert loop module next time because we left some
garbage in the misc device list.

Test case:
sudo modprobe loop max_part=1024
(failed due to invalid parameter)
sudo modprobe loop
(oops)

Clean up nicely to avoid such oops.

Signed-off-by: Guo Chao <[email protected]>
Cc: Alexander Viro <[email protected]>
Cc: Guo Chao <[email protected]>
Cc: M. Hindess <[email protected]>
Cc: Nikanth Karthikesan <[email protected]>
Cc: Jens Axboe <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Acked-by: Jeff Mahoney <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/block/loop.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)

--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1856,11 +1856,15 @@ static int __init loop_init(void)
max_part = (1UL << part_shift) - 1;
}

- if ((1UL << part_shift) > DISK_MAX_PARTS)
- return -EINVAL;
+ if ((1UL << part_shift) > DISK_MAX_PARTS) {
+ err = -EINVAL;
+ goto misc_out;
+ }

- if (max_loop > 1UL << (MINORBITS - part_shift))
- return -EINVAL;
+ if (max_loop > 1UL << (MINORBITS - part_shift)) {
+ err = -EINVAL;
+ goto misc_out;
+ }

/*
* If max_loop is specified, create that many devices upfront.
@@ -1878,8 +1882,10 @@ static int __init loop_init(void)
range = 1UL << MINORBITS;
}

- if (register_blkdev(LOOP_MAJOR, "loop"))
- return -EIO;
+ if (register_blkdev(LOOP_MAJOR, "loop")) {
+ err = -EIO;
+ goto misc_out;
+ }

blk_register_region(MKDEV(LOOP_MAJOR, 0), range,
THIS_MODULE, loop_probe, NULL, NULL);
@@ -1892,6 +1898,10 @@ static int __init loop_init(void)

printk(KERN_INFO "loop: module loaded\n");
return 0;
+
+misc_out:
+ misc_deregister(&loop_misc);
+ return err;
}

static int loop_exit_cb(int id, void *ptr, void *data)

2013-03-18 21:49:40

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 64/75] bonding: fire NETDEV_RELEASE event only on 0 slaves

3.8-stable review patch. If anyone has any objections, please let me know.

------------------


From: Veaceslav Falico <[email protected]>

[ Upstream commit 80028ea1c0afc24d4ddeb8dd2a9992fff03616ca ]

Currently, if we set up netconsole over bonding and release a slave,
netconsole will stop logging on the whole bonding device. Change the
behavior to stop the netconsole only when the last slave is released.

Signed-off-by: Veaceslav Falico <[email protected]>
Acked-by: Neil Horman <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/net/bonding/bond_main.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1943,7 +1943,6 @@ int bond_release(struct net_device *bond
}

block_netpoll_tx();
- call_netdevice_notifiers(NETDEV_RELEASE, bond_dev);
write_lock_bh(&bond->lock);

slave = bond_get_slave_by_dev(bond, slave_dev);
@@ -2047,8 +2046,10 @@ int bond_release(struct net_device *bond
write_unlock_bh(&bond->lock);
unblock_netpoll_tx();

- if (bond->slave_cnt == 0)
+ if (bond->slave_cnt == 0) {
call_netdevice_notifiers(NETDEV_CHANGEADDR, bond->dev);
+ call_netdevice_notifiers(NETDEV_RELEASE, bond->dev);
+ }

bond_compute_features(bond);
if (!(bond_dev->features & NETIF_F_VLAN_CHALLENGED) &&

2013-03-18 21:49:56

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 58/75] atl1c: restore buffer state

3.8-stable review patch. If anyone has any objections, please let me know.

------------------


From: "Huang, Xiong" <[email protected]>

[ Upstream commit 7cb08d7f3a5ea6131f4f243c2080530ac41cb293 ]

in the previous commit : f1f220ea1dda078, the BUSY state of buffer is wrongly
deleted. this patch just restore it.

Signed-off-by: xiong <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
@@ -2075,7 +2075,7 @@ static int atl1c_tx_map(struct atl1c_ada
if (unlikely(pci_dma_mapping_error(adapter->pdev,
buffer_info->dma)))
goto err_dma;
-
+ ATL1C_SET_BUFFER_STATE(buffer_info, ATL1C_BUFFER_BUSY);
ATL1C_SET_PCIMAP_TYPE(buffer_info, ATL1C_PCIMAP_SINGLE,
ATL1C_PCIMAP_TODEVICE);
mapped_len += map_len;

2013-03-18 21:50:28

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 57/75] l2tp: Restore socket refcount when sendmsg succeeds

3.8-stable review patch. If anyone has any objections, please let me know.

------------------


From: Guillaume Nault <[email protected]>

[ Upstream commit 8b82547e33e85fc24d4d172a93c796de1fefa81a ]

The sendmsg() syscall handler for PPPoL2TP doesn't decrease the socket
reference counter after successful transmissions. Any successful
sendmsg() call from userspace will then increase the reference counter
forever, thus preventing the kernel's session and tunnel data from
being freed later on.

The problem only happens when writing directly on L2TP sockets.
PPP sockets attached to L2TP are unaffected as the PPP subsystem
uses pppol2tp_xmit() which symmetrically increase/decrease reference
counters.

This patch adds the missing call to sock_put() before returning from
pppol2tp_sendmsg().

Signed-off-by: Guillaume Nault <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
net/l2tp/l2tp_ppp.c | 1 +
1 file changed, 1 insertion(+)

--- a/net/l2tp/l2tp_ppp.c
+++ b/net/l2tp/l2tp_ppp.c
@@ -355,6 +355,7 @@ static int pppol2tp_sendmsg(struct kiocb
l2tp_xmit_skb(session, skb, session->hdr_len);

sock_put(ps->tunnel_sock);
+ sock_put(sk);

return error;


2013-03-18 21:07:09

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 47/75] btrfs: use rcu_barrier() to wait for bdev puts at unmount

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Eric Sandeen <[email protected]>

commit bc178622d40d87e75abc131007342429c9b03351 upstream.

Doing this would reliably fail with -EBUSY for me:

# mount /dev/sdb2 /mnt/scratch; umount /mnt/scratch; mkfs.btrfs -f /dev/sdb2
...
unable to open /dev/sdb2: Device or resource busy

because mkfs.btrfs tries to open the device O_EXCL, and somebody still has it.

Using systemtap to track bdev gets & puts shows a kworker thread doing a
blkdev put after mkfs attempts a get; this is left over from the unmount
path:

btrfs_close_devices
__btrfs_close_devices
call_rcu(&device->rcu, free_device);
free_device
INIT_WORK(&device->rcu_work, __free_device);
schedule_work(&device->rcu_work);

so unmount might complete before __free_device fires & does its blkdev_put.

Adding an rcu_barrier() to btrfs_close_devices() causes unmount to wait
until all blkdev_put()s are done, and the device is truly free once
unmount completes.

Signed-off-by: Eric Sandeen <[email protected]>
Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
fs/btrfs/volumes.c | 6 ++++++
1 file changed, 6 insertions(+)

--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -681,6 +681,12 @@ int btrfs_close_devices(struct btrfs_fs_
__btrfs_close_devices(fs_devices);
free_fs_devices(fs_devices);
}
+ /*
+ * Wait for rcu kworkers under __btrfs_close_devices
+ * to finish all blkdev_puts so device is really
+ * free when umount is done.
+ */
+ rcu_barrier();
return ret;
}


2013-03-18 21:50:51

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 56/75] net/sctp: Validate parameter size for SCTP_GET_ASSOC_STATS

3.8-stable review patch. If anyone has any objections, please let me know.

------------------


From: Guenter Roeck <[email protected]>

commit 726bc6b092da4c093eb74d13c07184b18c1af0f1 upstream.

Building sctp may fail with:

In function ‘copy_from_user’,
inlined from ‘sctp_getsockopt_assoc_stats’ at
net/sctp/socket.c:5656:20:
arch/x86/include/asm/uaccess_32.h:211:26: error: call to
‘copy_from_user_overflow’ declared with attribute error: copy_from_user()
buffer size is not provably correct

if built with W=1 due to a missing parameter size validation
before the call to copy_from_user.

Signed-off-by: Guenter Roeck <[email protected]>
Acked-by: Vlad Yasevich <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
net/sctp/socket.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -5653,6 +5653,9 @@ static int sctp_getsockopt_assoc_stats(s
if (len < sizeof(sctp_assoc_t))
return -EINVAL;

+ /* Allow the struct to grow and fill in as much as possible */
+ len = min_t(size_t, len, sizeof(sas));
+
if (copy_from_user(&sas, optval, len))
return -EFAULT;

@@ -5686,9 +5689,6 @@ static int sctp_getsockopt_assoc_stats(s
/* Mark beginning of a new observation period */
asoc->stats.max_obs_rto = asoc->rto_min;

- /* Allow the struct to grow and fill in as much as possible */
- len = min_t(size_t, len, sizeof(sas));
-
if (put_user(len, optlen))
return -EFAULT;


2013-03-18 21:51:15

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 46/75] s390/mm: fix flush_tlb_kernel_range()

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Heiko Carstens <[email protected]>

commit f6a70a07079518280022286a1dceb797d12e1edf upstream.

Our flush_tlb_kernel_range() implementation calls __tlb_flush_mm() with
&init_mm as argument. __tlb_flush_mm() however will only flush tlbs
for the passed in mm if its mm_cpumask is not empty.

For the init_mm however its mm_cpumask has never any bits set. Which in
turn means that our flush_tlb_kernel_range() implementation doesn't
work at all.

This can be easily verified with a vmalloc/vfree loop which allocates
a page, writes to it and then frees the page again. A crash will follow
almost instantly.

To fix this remove the cpumask_empty() check in __tlb_flush_mm() since
there shouldn't be too many mms with a zero mm_cpumask, besides the
init_mm of course.

Signed-off-by: Heiko Carstens <[email protected]>
Signed-off-by: Martin Schwidefsky <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
arch/s390/include/asm/tlbflush.h | 2 --
1 file changed, 2 deletions(-)

--- a/arch/s390/include/asm/tlbflush.h
+++ b/arch/s390/include/asm/tlbflush.h
@@ -74,8 +74,6 @@ static inline void __tlb_flush_idte(unsi

static inline void __tlb_flush_mm(struct mm_struct * mm)
{
- if (unlikely(cpumask_empty(mm_cpumask(mm))))
- return;
/*
* If the machine has IDTE we prefer to do a per mm flush
* on all cpus instead of doing a local flush if the mm

2013-03-18 21:51:32

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 54/75] loopdev: fix a deadlock

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Guo Chao <[email protected]>

commit 5370019dc2d2c2ff90e95d181468071362934f3a upstream.

bd_mutex and lo_ctl_mutex can be held in different order.

Path #1:

blkdev_open
blkdev_get
__blkdev_get (hold bd_mutex)
lo_open (hold lo_ctl_mutex)

Path #2:

blkdev_ioctl
lo_ioctl (hold lo_ctl_mutex)
lo_set_capacity (hold bd_mutex)

Lockdep does not report it, because path #2 actually holds a subclass of
lo_ctl_mutex. This subclass seems creep into the code by mistake. The
patch author actually just mentioned it in the changelog, see commit
f028f3b2 ("loop: fix circular locking in loop_clr_fd()"), also see:

http://marc.info/?l=linux-kernel&m=123806169129727&w=2

Path #2 hold bd_mutex to call bd_set_size(), I've protected it
with i_mutex in a previous patch, so drop bd_mutex at this site.

Signed-off-by: Guo Chao <[email protected]>
Cc: Alexander Viro <[email protected]>
Cc: Guo Chao <[email protected]>
Cc: M. Hindess <[email protected]>
Cc: Nikanth Karthikesan <[email protected]>
Cc: Jens Axboe <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Acked-by: Jeff Mahoney <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/block/loop.c | 2 --
1 file changed, 2 deletions(-)

--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1285,11 +1285,9 @@ static int loop_set_capacity(struct loop
/* the width of sector_t may be narrow for bit-shift */
sz = sec;
sz <<= 9;
- mutex_lock(&bdev->bd_mutex);
bd_set_size(bdev, sz);
/* let user-space know about the new size */
kobject_uevent(&disk_to_dev(bdev->bd_disk)->kobj, KOBJ_CHANGE);
- mutex_unlock(&bdev->bd_mutex);

out:
return err;

2013-03-18 21:51:50

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 53/75] block: use i_size_write() in bd_set_size()

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Guo Chao <[email protected]>

commit d646a02a9d44d1421f273ae3923d97b47b918176 upstream.

blkdev_ioctl(GETBLKSIZE) uses i_size_read() to read size of block device.
If we update block size directly, reader may see intermediate result in
some machines and configurations. Use i_size_write() instead.

Signed-off-by: Guo Chao <[email protected]>
Cc: Alexander Viro <[email protected]>
Cc: Guo Chao <[email protected]>
Cc: M. Hindess <[email protected]>
Cc: Nikanth Karthikesan <[email protected]>
Cc: Jens Axboe <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Acked-by: Jeff Mahoney <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
fs/block_dev.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1033,7 +1033,9 @@ void bd_set_size(struct block_device *bd
{
unsigned bsize = bdev_logical_block_size(bdev);

- bdev->bd_inode->i_size = size;
+ mutex_lock(&bdev->bd_inode->i_mutex);
+ i_size_write(bdev->bd_inode, size);
+ mutex_unlock(&bdev->bd_inode->i_mutex);
while (bsize < PAGE_CACHE_SIZE) {
if (size & bsize)
break;

2013-03-18 21:52:26

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 52/75] net/mlx4_en: Disable RFS when running in SRIOV mode

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Amir Vadai <[email protected]>

commit a229e488ac3f904d06c20d8d3f47831db3c7a15a upstream.

Commit 37706996 "mlx4_en: fix allocation of CPU affinity reverse-map" fixed
a bug when mlx4_dev->caps.comp_pool is larger from the device rx rings, but
introduced a regression.

When the mlx4_core is activating its "legacy mode" (e.g when running in SRIOV
mode) w.r.t to EQs/IRQs usage, comp_pool becomes zero and we're crashing on
divide by zero alloc_cpu_rmap.

Fix that by enabling RFS only when running in non-legacy mode.

Reported-by: Yan Burman <[email protected]>
Cc: Kleber Sacilotto de Souza <[email protected]>
Signed-off-by: Amir Vadai <[email protected]>
Signed-off-by: Or Gerlitz <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -1434,9 +1434,11 @@ int mlx4_en_alloc_resources(struct mlx4_
}

#ifdef CONFIG_RFS_ACCEL
- priv->dev->rx_cpu_rmap = alloc_irq_cpu_rmap(priv->mdev->dev->caps.comp_pool);
- if (!priv->dev->rx_cpu_rmap)
- goto err;
+ if (priv->mdev->dev->caps.comp_pool) {
+ priv->dev->rx_cpu_rmap = alloc_irq_cpu_rmap(priv->mdev->dev->caps.comp_pool);
+ if (!priv->dev->rx_cpu_rmap)
+ goto err;
+ }
#endif

return 0;

2013-03-18 21:52:39

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 51/75] net/mlx4_en: Initialize RFS filters lock and list in init_netdev

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Amir Vadai <[email protected]>

commit 78fb2de711ec28997bf38bcf3e48e108e907be77 upstream.

filters_lock might have been used while it was re-initialized.
Moved filters_lock and filters_list initialization to init_netdev instead of
alloc_resources which is called every time the device is configured.

Signed-off-by: Amir Vadai <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Or Gerlitz <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -1437,9 +1437,6 @@ int mlx4_en_alloc_resources(struct mlx4_
priv->dev->rx_cpu_rmap = alloc_irq_cpu_rmap(priv->mdev->dev->caps.comp_pool);
if (!priv->dev->rx_cpu_rmap)
goto err;
-
- INIT_LIST_HEAD(&priv->filters);
- spin_lock_init(&priv->filters_lock);
#endif

return 0;
@@ -1634,6 +1631,11 @@ int mlx4_en_init_netdev(struct mlx4_en_d
if (err)
goto out;

+#ifdef CONFIG_RFS_ACCEL
+ INIT_LIST_HEAD(&priv->filters);
+ spin_lock_init(&priv->filters_lock);
+#endif
+
/* Allocate page for receive rings */
err = mlx4_alloc_hwq_res(mdev->dev, &priv->res,
MLX4_EN_PAGE_SIZE, MLX4_EN_PAGE_SIZE);

2013-03-18 21:07:06

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 34/75] w1-gpio: remove erroneous __exit and __exit_p()

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Johan Hovold <[email protected]>

commit 01230551e7c2fb9a1c2519b356d703851049cbe0 upstream.

Commit 8a1861d997 ("w1-gpio: Simplify & get rid of defines") changed
(apparently unknowingly) the driver to a hotpluggable platform-device
driver but did not not update the section markers for probe and remove
(to __devinit/exit, which have since been removed). A later commit fixed
the section mismatch for probe, but left remove marked with __exit.

Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/w1/masters/w1-gpio.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/w1/masters/w1-gpio.c
+++ b/drivers/w1/masters/w1-gpio.c
@@ -158,7 +158,7 @@ static int w1_gpio_probe(struct platform
return err;
}

-static int __exit w1_gpio_remove(struct platform_device *pdev)
+static int w1_gpio_remove(struct platform_device *pdev)
{
struct w1_bus_master *master = platform_get_drvdata(pdev);
struct w1_gpio_platform_data *pdata = pdev->dev.platform_data;
@@ -210,7 +210,7 @@ static struct platform_driver w1_gpio_dr
.of_match_table = of_match_ptr(w1_gpio_dt_ids),
},
.probe = w1_gpio_probe,
- .remove = __exit_p(w1_gpio_remove),
+ .remove = w1_gpio_remove,
.suspend = w1_gpio_suspend,
.resume = w1_gpio_resume,
};

2013-03-18 21:52:58

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 50/75] atmel_lcdfb: fix 16-bpp modes on older SOCs

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Johan Hovold <[email protected]>

commit a79eac7165ed62114e6ca197195aa5060a54f137 upstream.

Fix regression introduced by commit 787f9fd23283 ("atmel_lcdfb: support
16bit BGR:565 mode, remove unsupported 15bit modes") which broke 16-bpp
modes for older SOCs which use IBGR:555 (msb is intensity) rather
than BGR:565.

Use SOC-type to determine the pixel layout.

Tested on at91sam9263 and at91sam9g45.

Acked-by: Peter Korsgaard <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Nicolas Ferre <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/video/atmel_lcdfb.c | 22 +++++++++++++++-------
include/video/atmel_lcdc.h | 1 +
2 files changed, 16 insertions(+), 7 deletions(-)

--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -422,17 +422,22 @@ static int atmel_lcdfb_check_var(struct
= var->bits_per_pixel;
break;
case 16:
+ /* Older SOCs use IBGR:555 rather than BGR:565. */
+ if (sinfo->have_intensity_bit)
+ var->green.length = 5;
+ else
+ var->green.length = 6;
+
if (sinfo->lcd_wiring_mode == ATMEL_LCDC_WIRING_RGB) {
- /* RGB:565 mode */
- var->red.offset = 11;
+ /* RGB:5X5 mode */
+ var->red.offset = var->green.length + 5;
var->blue.offset = 0;
} else {
- /* BGR:565 mode */
+ /* BGR:5X5 mode */
var->red.offset = 0;
- var->blue.offset = 11;
+ var->blue.offset = var->green.length + 5;
}
var->green.offset = 5;
- var->green.length = 6;
var->red.length = var->blue.length = 5;
break;
case 32:
@@ -679,8 +684,7 @@ static int atmel_lcdfb_setcolreg(unsigne

case FB_VISUAL_PSEUDOCOLOR:
if (regno < 256) {
- if (cpu_is_at91sam9261() || cpu_is_at91sam9263()
- || cpu_is_at91sam9rl()) {
+ if (sinfo->have_intensity_bit) {
/* old style I+BGR:555 */
val = ((red >> 11) & 0x001f);
val |= ((green >> 6) & 0x03e0);
@@ -870,6 +874,10 @@ static int __init atmel_lcdfb_probe(stru
}
sinfo->info = info;
sinfo->pdev = pdev;
+ if (cpu_is_at91sam9261() || cpu_is_at91sam9263() ||
+ cpu_is_at91sam9rl()) {
+ sinfo->have_intensity_bit = true;
+ }

strcpy(info->fix.id, sinfo->pdev->name);
info->flags = ATMEL_LCDFB_FBINFO_DEFAULT;
--- a/include/video/atmel_lcdc.h
+++ b/include/video/atmel_lcdc.h
@@ -62,6 +62,7 @@ struct atmel_lcdfb_info {
void (*atmel_lcdfb_power_control)(int on);
struct fb_monspecs *default_monspecs;
u32 pseudo_palette[16];
+ bool have_intensity_bit;
};

#define ATMEL_LCDC_DMABADDR1 0x00

2013-03-18 21:53:18

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 48/75] mtd: nand: reintroduce NAND_NO_READRDY as NAND_NEED_READRDY

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Brian Norris <[email protected]>

commit 5bc7c33ca93a285dcfe7b7fd64970f6314440ad1 upstream.

This partially reverts commit 1696e6bc2ae83734e64e206ac99766ea19e9a14e
("mtd: nand: kill NAND_NO_READRDY").

In that patch I overlooked a few things.

The original documentation for NAND_NO_READRDY included "True for all
large page devices, as they do not support autoincrement." I was
conflating "not support autoincrement" with the NAND_NO_AUTOINCR option,
which was in fact doing nothing. So, when I dropped NAND_NO_AUTOINCR, I
concluded that I then could harmlessly drop NAND_NO_READRDY. But of
course the fact the NAND_NO_AUTOINCR was doing nothing didn't mean
NAND_NO_READRDY was doing nothing...

So, NAND_NO_READRDY is re-introduced as NAND_NEED_READRDY and applied
only to those few remaining small-page NAND which needed it in the first
place.

Reported-by: Alexander Shiyan <[email protected]>
Tested-by: Alexander Shiyan <[email protected]>
Signed-off-by: Brian Norris <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/mtd/nand/nand_base.c | 16 ++++++++
drivers/mtd/nand/nand_ids.c | 78 ++++++++++++++++++++++---------------------
include/linux/mtd/nand.h | 7 +++
3 files changed, 63 insertions(+), 38 deletions(-)

--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -1527,6 +1527,14 @@ static int nand_do_read_ops(struct mtd_i
oobreadlen -= toread;
}
}
+
+ if (chip->options & NAND_NEED_READRDY) {
+ /* Apply delay or wait for ready/busy pin */
+ if (!chip->dev_ready)
+ udelay(chip->chip_delay);
+ else
+ nand_wait_ready(mtd);
+ }
} else {
memcpy(buf, chip->buffers->databuf + col, bytes);
buf += bytes;
@@ -1791,6 +1799,14 @@ static int nand_do_read_oob(struct mtd_i
len = min(len, readlen);
buf = nand_transfer_oob(chip, buf, ops, len);

+ if (chip->options & NAND_NEED_READRDY) {
+ /* Apply delay or wait for ready/busy pin */
+ if (!chip->dev_ready)
+ udelay(chip->chip_delay);
+ else
+ nand_wait_ready(mtd);
+ }
+
readlen -= len;
if (!readlen)
break;
--- a/drivers/mtd/nand/nand_ids.c
+++ b/drivers/mtd/nand/nand_ids.c
@@ -22,49 +22,51 @@
* 512 512 Byte page size
*/
struct nand_flash_dev nand_flash_ids[] = {
+#define SP_OPTIONS NAND_NEED_READRDY
+#define SP_OPTIONS16 (SP_OPTIONS | NAND_BUSWIDTH_16)

#ifdef CONFIG_MTD_NAND_MUSEUM_IDS
- {"NAND 1MiB 5V 8-bit", 0x6e, 256, 1, 0x1000, 0},
- {"NAND 2MiB 5V 8-bit", 0x64, 256, 2, 0x1000, 0},
- {"NAND 4MiB 5V 8-bit", 0x6b, 512, 4, 0x2000, 0},
- {"NAND 1MiB 3,3V 8-bit", 0xe8, 256, 1, 0x1000, 0},
- {"NAND 1MiB 3,3V 8-bit", 0xec, 256, 1, 0x1000, 0},
- {"NAND 2MiB 3,3V 8-bit", 0xea, 256, 2, 0x1000, 0},
- {"NAND 4MiB 3,3V 8-bit", 0xd5, 512, 4, 0x2000, 0},
- {"NAND 4MiB 3,3V 8-bit", 0xe3, 512, 4, 0x2000, 0},
- {"NAND 4MiB 3,3V 8-bit", 0xe5, 512, 4, 0x2000, 0},
- {"NAND 8MiB 3,3V 8-bit", 0xd6, 512, 8, 0x2000, 0},
-
- {"NAND 8MiB 1,8V 8-bit", 0x39, 512, 8, 0x2000, 0},
- {"NAND 8MiB 3,3V 8-bit", 0xe6, 512, 8, 0x2000, 0},
- {"NAND 8MiB 1,8V 16-bit", 0x49, 512, 8, 0x2000, NAND_BUSWIDTH_16},
- {"NAND 8MiB 3,3V 16-bit", 0x59, 512, 8, 0x2000, NAND_BUSWIDTH_16},
+ {"NAND 1MiB 5V 8-bit", 0x6e, 256, 1, 0x1000, SP_OPTIONS},
+ {"NAND 2MiB 5V 8-bit", 0x64, 256, 2, 0x1000, SP_OPTIONS},
+ {"NAND 4MiB 5V 8-bit", 0x6b, 512, 4, 0x2000, SP_OPTIONS},
+ {"NAND 1MiB 3,3V 8-bit", 0xe8, 256, 1, 0x1000, SP_OPTIONS},
+ {"NAND 1MiB 3,3V 8-bit", 0xec, 256, 1, 0x1000, SP_OPTIONS},
+ {"NAND 2MiB 3,3V 8-bit", 0xea, 256, 2, 0x1000, SP_OPTIONS},
+ {"NAND 4MiB 3,3V 8-bit", 0xd5, 512, 4, 0x2000, SP_OPTIONS},
+ {"NAND 4MiB 3,3V 8-bit", 0xe3, 512, 4, 0x2000, SP_OPTIONS},
+ {"NAND 4MiB 3,3V 8-bit", 0xe5, 512, 4, 0x2000, SP_OPTIONS},
+ {"NAND 8MiB 3,3V 8-bit", 0xd6, 512, 8, 0x2000, SP_OPTIONS},
+
+ {"NAND 8MiB 1,8V 8-bit", 0x39, 512, 8, 0x2000, SP_OPTIONS},
+ {"NAND 8MiB 3,3V 8-bit", 0xe6, 512, 8, 0x2000, SP_OPTIONS},
+ {"NAND 8MiB 1,8V 16-bit", 0x49, 512, 8, 0x2000, SP_OPTIONS16},
+ {"NAND 8MiB 3,3V 16-bit", 0x59, 512, 8, 0x2000, SP_OPTIONS16},
#endif

- {"NAND 16MiB 1,8V 8-bit", 0x33, 512, 16, 0x4000, 0},
- {"NAND 16MiB 3,3V 8-bit", 0x73, 512, 16, 0x4000, 0},
- {"NAND 16MiB 1,8V 16-bit", 0x43, 512, 16, 0x4000, NAND_BUSWIDTH_16},
- {"NAND 16MiB 3,3V 16-bit", 0x53, 512, 16, 0x4000, NAND_BUSWIDTH_16},
-
- {"NAND 32MiB 1,8V 8-bit", 0x35, 512, 32, 0x4000, 0},
- {"NAND 32MiB 3,3V 8-bit", 0x75, 512, 32, 0x4000, 0},
- {"NAND 32MiB 1,8V 16-bit", 0x45, 512, 32, 0x4000, NAND_BUSWIDTH_16},
- {"NAND 32MiB 3,3V 16-bit", 0x55, 512, 32, 0x4000, NAND_BUSWIDTH_16},
-
- {"NAND 64MiB 1,8V 8-bit", 0x36, 512, 64, 0x4000, 0},
- {"NAND 64MiB 3,3V 8-bit", 0x76, 512, 64, 0x4000, 0},
- {"NAND 64MiB 1,8V 16-bit", 0x46, 512, 64, 0x4000, NAND_BUSWIDTH_16},
- {"NAND 64MiB 3,3V 16-bit", 0x56, 512, 64, 0x4000, NAND_BUSWIDTH_16},
-
- {"NAND 128MiB 1,8V 8-bit", 0x78, 512, 128, 0x4000, 0},
- {"NAND 128MiB 1,8V 8-bit", 0x39, 512, 128, 0x4000, 0},
- {"NAND 128MiB 3,3V 8-bit", 0x79, 512, 128, 0x4000, 0},
- {"NAND 128MiB 1,8V 16-bit", 0x72, 512, 128, 0x4000, NAND_BUSWIDTH_16},
- {"NAND 128MiB 1,8V 16-bit", 0x49, 512, 128, 0x4000, NAND_BUSWIDTH_16},
- {"NAND 128MiB 3,3V 16-bit", 0x74, 512, 128, 0x4000, NAND_BUSWIDTH_16},
- {"NAND 128MiB 3,3V 16-bit", 0x59, 512, 128, 0x4000, NAND_BUSWIDTH_16},
+ {"NAND 16MiB 1,8V 8-bit", 0x33, 512, 16, 0x4000, SP_OPTIONS},
+ {"NAND 16MiB 3,3V 8-bit", 0x73, 512, 16, 0x4000, SP_OPTIONS},
+ {"NAND 16MiB 1,8V 16-bit", 0x43, 512, 16, 0x4000, SP_OPTIONS16},
+ {"NAND 16MiB 3,3V 16-bit", 0x53, 512, 16, 0x4000, SP_OPTIONS16},
+
+ {"NAND 32MiB 1,8V 8-bit", 0x35, 512, 32, 0x4000, SP_OPTIONS},
+ {"NAND 32MiB 3,3V 8-bit", 0x75, 512, 32, 0x4000, SP_OPTIONS},
+ {"NAND 32MiB 1,8V 16-bit", 0x45, 512, 32, 0x4000, SP_OPTIONS16},
+ {"NAND 32MiB 3,3V 16-bit", 0x55, 512, 32, 0x4000, SP_OPTIONS16},
+
+ {"NAND 64MiB 1,8V 8-bit", 0x36, 512, 64, 0x4000, SP_OPTIONS},
+ {"NAND 64MiB 3,3V 8-bit", 0x76, 512, 64, 0x4000, SP_OPTIONS},
+ {"NAND 64MiB 1,8V 16-bit", 0x46, 512, 64, 0x4000, SP_OPTIONS16},
+ {"NAND 64MiB 3,3V 16-bit", 0x56, 512, 64, 0x4000, SP_OPTIONS16},
+
+ {"NAND 128MiB 1,8V 8-bit", 0x78, 512, 128, 0x4000, SP_OPTIONS},
+ {"NAND 128MiB 1,8V 8-bit", 0x39, 512, 128, 0x4000, SP_OPTIONS},
+ {"NAND 128MiB 3,3V 8-bit", 0x79, 512, 128, 0x4000, SP_OPTIONS},
+ {"NAND 128MiB 1,8V 16-bit", 0x72, 512, 128, 0x4000, SP_OPTIONS16},
+ {"NAND 128MiB 1,8V 16-bit", 0x49, 512, 128, 0x4000, SP_OPTIONS16},
+ {"NAND 128MiB 3,3V 16-bit", 0x74, 512, 128, 0x4000, SP_OPTIONS16},
+ {"NAND 128MiB 3,3V 16-bit", 0x59, 512, 128, 0x4000, SP_OPTIONS16},

- {"NAND 256MiB 3,3V 8-bit", 0x71, 512, 256, 0x4000, 0},
+ {"NAND 256MiB 3,3V 8-bit", 0x71, 512, 256, 0x4000, SP_OPTIONS},

/*
* These are the new chips with large page size. The pagesize and the
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -187,6 +187,13 @@ typedef enum {
* This happens with the Renesas AG-AND chips, possibly others.
*/
#define BBT_AUTO_REFRESH 0x00000080
+/*
+ * Chip requires ready check on read (for auto-incremented sequential read).
+ * True only for small page devices; large page devices do not support
+ * autoincrement.
+ */
+#define NAND_NEED_READRDY 0x00000100
+
/* Chip does not allow subpage writes */
#define NAND_NO_SUBPAGE_WRITE 0x00000200


2013-03-18 21:07:00

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 38/75] powerpc: Make VSID_BITS* dependency explicit

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: "Aneesh Kumar K.V" <[email protected]>

commit e39d1a471484662620651cd9520250d33843f235 upstream.

VSID_BITS and VSID_BITS_1T depends on the context bits and user esid
bits. Make the dependency explicit

Acked-by: Paul Mackerras <[email protected]>
Signed-off-by: Aneesh Kumar K.V <[email protected]>
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
arch/powerpc/include/asm/mmu-hash64.h | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

--- a/arch/powerpc/include/asm/mmu-hash64.h
+++ b/arch/powerpc/include/asm/mmu-hash64.h
@@ -381,21 +381,22 @@ extern void slb_set_size(u16 size);
* hash collisions.
*/

+#define CONTEXT_BITS 19
+#define USER_ESID_BITS 18
+#define USER_ESID_BITS_1T 6
+
/*
* This should be computed such that protovosid * vsid_mulitplier
* doesn't overflow 64 bits. It should also be co-prime to vsid_modulus
*/
#define VSID_MULTIPLIER_256M ASM_CONST(12538073) /* 24-bit prime */
-#define VSID_BITS_256M 38
+#define VSID_BITS_256M (CONTEXT_BITS + USER_ESID_BITS + 1)
#define VSID_MODULUS_256M ((1UL<<VSID_BITS_256M)-1)

#define VSID_MULTIPLIER_1T ASM_CONST(12538073) /* 24-bit prime */
-#define VSID_BITS_1T 26
+#define VSID_BITS_1T (CONTEXT_BITS + USER_ESID_BITS_1T + 1)
#define VSID_MODULUS_1T ((1UL<<VSID_BITS_1T)-1)

-#define CONTEXT_BITS 19
-#define USER_ESID_BITS 18
-#define USER_ESID_BITS_1T 6

#define USER_VSID_RANGE (1UL << (USER_ESID_BITS + SID_SHIFT))


2013-03-18 21:54:16

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 42/75] selinux: use GFP_ATOMIC under spin_lock

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Dan Carpenter <[email protected]>

commit 4502403dcf8f5c76abd4dbab8726c8e4ecb5cd34 upstream.

The call tree here is:

sk_clone_lock() <- takes bh_lock_sock(newsk);
xfrm_sk_clone_policy()
__xfrm_sk_clone_policy()
clone_policy() <- uses GFP_ATOMIC for allocations
security_xfrm_policy_clone()
security_ops->xfrm_policy_clone_security()
selinux_xfrm_policy_clone()

Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: James Morris <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
security/selinux/xfrm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/security/selinux/xfrm.c
+++ b/security/selinux/xfrm.c
@@ -310,7 +310,7 @@ int selinux_xfrm_policy_clone(struct xfr

if (old_ctx) {
new_ctx = kmalloc(sizeof(*old_ctx) + old_ctx->ctx_len,
- GFP_KERNEL);
+ GFP_ATOMIC);
if (!new_ctx)
return -ENOMEM;


2013-03-18 21:54:38

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 41/75] ARM: davinci: edma: fix dmaengine induced null pointer dereference on da830

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Matt Porter <[email protected]>

commit 069552777a121eb39da29de4bc0383483dbe1f7e upstream.

This adds additional error checking to the private edma api implementation
to catch the case where the edma_alloc_slot() has an invalid controller
parameter. The edma dmaengine wrapper driver relies on this condition
being handled in order to avoid setting up a second edma dmaengine
instance on DA830.

Verfied using a DA850 with the second EDMA controller platform instance
removed to simulate a DA830 which only has a single EDMA controller.

Reported-by: Tomas Novotny <[email protected]>
Signed-off-by: Matt Porter <[email protected]>
Tested-by: Tomas Novotny <[email protected]>
Signed-off-by: Sekhar Nori <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
arch/arm/mach-davinci/dma.c | 3 +++
1 file changed, 3 insertions(+)

--- a/arch/arm/mach-davinci/dma.c
+++ b/arch/arm/mach-davinci/dma.c
@@ -743,6 +743,9 @@ EXPORT_SYMBOL(edma_free_channel);
*/
int edma_alloc_slot(unsigned ctlr, int slot)
{
+ if (!edma_cc[ctlr])
+ return -EINVAL;
+
if (slot >= 0)
slot = EDMA_CHAN_SLOT(slot);


2013-03-18 21:54:58

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 39/75] powerpc: Update kernel VSID range

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: "Aneesh Kumar K.V" <[email protected]>

commit c60ac5693c47df32a2b4b18af97fca5635def015 upstream.

This patch change the kernel VSID range so that we limit VSID_BITS to 37.
This enables us to support 64TB with 65 bit VA (37+28). Without this patch
we have boot hangs on platforms that only support 65 bit VA.

With this patch we now have proto vsid generated as below:

We first generate a 37-bit "proto-VSID". Proto-VSIDs are generated
from mmu context id and effective segment id of the address.

For user processes max context id is limited to ((1ul << 19) - 5)
for kernel space, we use the top 4 context ids to map address as below
0x7fffc - [ 0xc000000000000000 - 0xc0003fffffffffff ]
0x7fffd - [ 0xd000000000000000 - 0xd0003fffffffffff ]
0x7fffe - [ 0xe000000000000000 - 0xe0003fffffffffff ]
0x7ffff - [ 0xf000000000000000 - 0xf0003fffffffffff ]

Acked-by: Paul Mackerras <[email protected]>
Signed-off-by: Aneesh Kumar K.V <[email protected]>
Tested-by: Geoff Levand <[email protected]>
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
arch/powerpc/include/asm/mmu-hash64.h | 121 +++++++++++++++++-----------------
arch/powerpc/kernel/exceptions-64s.S | 34 +++++++--
arch/powerpc/mm/hash_utils_64.c | 20 ++++-
arch/powerpc/mm/mmu_context_hash64.c | 11 ---
arch/powerpc/mm/slb_low.S | 50 +++++++-------
arch/powerpc/mm/tlb_hash64.c | 2
6 files changed, 129 insertions(+), 109 deletions(-)

--- a/arch/powerpc/include/asm/mmu-hash64.h
+++ b/arch/powerpc/include/asm/mmu-hash64.h
@@ -343,17 +343,16 @@ extern void slb_set_size(u16 size);
/*
* VSID allocation (256MB segment)
*
- * We first generate a 38-bit "proto-VSID". For kernel addresses this
- * is equal to the ESID | 1 << 37, for user addresses it is:
- * (context << USER_ESID_BITS) | (esid & ((1U << USER_ESID_BITS) - 1)
- *
- * This splits the proto-VSID into the below range
- * 0 - (2^(CONTEXT_BITS + USER_ESID_BITS) - 1) : User proto-VSID range
- * 2^(CONTEXT_BITS + USER_ESID_BITS) - 2^(VSID_BITS) : Kernel proto-VSID range
- *
- * We also have CONTEXT_BITS + USER_ESID_BITS = VSID_BITS - 1
- * That is, we assign half of the space to user processes and half
- * to the kernel.
+ * We first generate a 37-bit "proto-VSID". Proto-VSIDs are generated
+ * from mmu context id and effective segment id of the address.
+ *
+ * For user processes max context id is limited to ((1ul << 19) - 5)
+ * for kernel space, we use the top 4 context ids to map address as below
+ * NOTE: each context only support 64TB now.
+ * 0x7fffc - [ 0xc000000000000000 - 0xc0003fffffffffff ]
+ * 0x7fffd - [ 0xd000000000000000 - 0xd0003fffffffffff ]
+ * 0x7fffe - [ 0xe000000000000000 - 0xe0003fffffffffff ]
+ * 0x7ffff - [ 0xf000000000000000 - 0xf0003fffffffffff ]
*
* The proto-VSIDs are then scrambled into real VSIDs with the
* multiplicative hash:
@@ -363,22 +362,19 @@ extern void slb_set_size(u16 size);
* VSID_MULTIPLIER is prime, so in particular it is
* co-prime to VSID_MODULUS, making this a 1:1 scrambling function.
* Because the modulus is 2^n-1 we can compute it efficiently without
- * a divide or extra multiply (see below).
- *
- * This scheme has several advantages over older methods:
- *
- * - We have VSIDs allocated for every kernel address
- * (i.e. everything above 0xC000000000000000), except the very top
- * segment, which simplifies several things.
- *
- * - We allow for USER_ESID_BITS significant bits of ESID and
- * CONTEXT_BITS bits of context for user addresses.
- * i.e. 64T (46 bits) of address space for up to half a million contexts.
- *
- * - The scramble function gives robust scattering in the hash
- * table (at least based on some initial results). The previous
- * method was more susceptible to pathological cases giving excessive
- * hash collisions.
+ * a divide or extra multiply (see below). The scramble function gives
+ * robust scattering in the hash table (at least based on some initial
+ * results).
+ *
+ * We also consider VSID 0 special. We use VSID 0 for slb entries mapping
+ * bad address. This enables us to consolidate bad address handling in
+ * hash_page.
+ *
+ * We also need to avoid the last segment of the last context, because that
+ * would give a protovsid of 0x1fffffffff. That will result in a VSID 0
+ * because of the modulo operation in vsid scramble. But the vmemmap
+ * (which is what uses region 0xf) will never be close to 64TB in size
+ * (it's 56 bytes per page of system memory).
*/

#define CONTEXT_BITS 19
@@ -386,15 +382,25 @@ extern void slb_set_size(u16 size);
#define USER_ESID_BITS_1T 6

/*
+ * 256MB segment
+ * The proto-VSID space has 2^(CONTEX_BITS + USER_ESID_BITS) - 1 segments
+ * available for user + kernel mapping. The top 4 contexts are used for
+ * kernel mapping. Each segment contains 2^28 bytes. Each
+ * context maps 2^46 bytes (64TB) so we can support 2^19-1 contexts
+ * (19 == 37 + 28 - 46).
+ */
+#define MAX_USER_CONTEXT ((ASM_CONST(1) << CONTEXT_BITS) - 5)
+
+/*
* This should be computed such that protovosid * vsid_mulitplier
* doesn't overflow 64 bits. It should also be co-prime to vsid_modulus
*/
#define VSID_MULTIPLIER_256M ASM_CONST(12538073) /* 24-bit prime */
-#define VSID_BITS_256M (CONTEXT_BITS + USER_ESID_BITS + 1)
+#define VSID_BITS_256M (CONTEXT_BITS + USER_ESID_BITS)
#define VSID_MODULUS_256M ((1UL<<VSID_BITS_256M)-1)

#define VSID_MULTIPLIER_1T ASM_CONST(12538073) /* 24-bit prime */
-#define VSID_BITS_1T (CONTEXT_BITS + USER_ESID_BITS_1T + 1)
+#define VSID_BITS_1T (CONTEXT_BITS + USER_ESID_BITS_1T)
#define VSID_MODULUS_1T ((1UL<<VSID_BITS_1T)-1)


@@ -422,7 +428,8 @@ extern void slb_set_size(u16 size);
srdi rx,rt,VSID_BITS_##size; \
clrldi rt,rt,(64-VSID_BITS_##size); \
add rt,rt,rx; /* add high and low bits */ \
- /* Now, r3 == VSID (mod 2^36-1), and lies between 0 and \
+ /* NOTE: explanation based on VSID_BITS_##size = 36 \
+ * Now, r3 == VSID (mod 2^36-1), and lies between 0 and \
* 2^36-1+2^28-1. That in particular means that if r3 >= \
* 2^36-1, then r3+1 has the 2^36 bit set. So, if r3+1 has \
* the bit clear, r3 already has the answer we want, if it \
@@ -514,34 +521,6 @@ typedef struct {
})
#endif /* 1 */

-/*
- * This is only valid for addresses >= PAGE_OFFSET
- * The proto-VSID space is divided into two class
- * User: 0 to 2^(CONTEXT_BITS + USER_ESID_BITS) -1
- * kernel: 2^(CONTEXT_BITS + USER_ESID_BITS) to 2^(VSID_BITS) - 1
- *
- * With KERNEL_START at 0xc000000000000000, the proto vsid for
- * the kernel ends up with 0xc00000000 (36 bits). With 64TB
- * support we need to have kernel proto-VSID in the
- * [2^37 to 2^38 - 1] range due to the increased USER_ESID_BITS.
- */
-static inline unsigned long get_kernel_vsid(unsigned long ea, int ssize)
-{
- unsigned long proto_vsid;
- /*
- * We need to make sure proto_vsid for the kernel is
- * >= 2^(CONTEXT_BITS + USER_ESID_BITS[_1T])
- */
- if (ssize == MMU_SEGSIZE_256M) {
- proto_vsid = ea >> SID_SHIFT;
- proto_vsid |= (1UL << (CONTEXT_BITS + USER_ESID_BITS));
- return vsid_scramble(proto_vsid, 256M);
- }
- proto_vsid = ea >> SID_SHIFT_1T;
- proto_vsid |= (1UL << (CONTEXT_BITS + USER_ESID_BITS_1T));
- return vsid_scramble(proto_vsid, 1T);
-}
-
/* Returns the segment size indicator for a user address */
static inline int user_segment_size(unsigned long addr)
{
@@ -551,10 +530,15 @@ static inline int user_segment_size(unsi
return MMU_SEGSIZE_256M;
}

-/* This is only valid for user addresses (which are below 2^44) */
static inline unsigned long get_vsid(unsigned long context, unsigned long ea,
int ssize)
{
+ /*
+ * Bad address. We return VSID 0 for that
+ */
+ if ((ea & ~REGION_MASK) >= PGTABLE_RANGE)
+ return 0;
+
if (ssize == MMU_SEGSIZE_256M)
return vsid_scramble((context << USER_ESID_BITS)
| (ea >> SID_SHIFT), 256M);
@@ -562,6 +546,25 @@ static inline unsigned long get_vsid(uns
| (ea >> SID_SHIFT_1T), 1T);
}

+/*
+ * This is only valid for addresses >= PAGE_OFFSET
+ *
+ * For kernel space, we use the top 4 context ids to map address as below
+ * 0x7fffc - [ 0xc000000000000000 - 0xc0003fffffffffff ]
+ * 0x7fffd - [ 0xd000000000000000 - 0xd0003fffffffffff ]
+ * 0x7fffe - [ 0xe000000000000000 - 0xe0003fffffffffff ]
+ * 0x7ffff - [ 0xf000000000000000 - 0xf0003fffffffffff ]
+ */
+static inline unsigned long get_kernel_vsid(unsigned long ea, int ssize)
+{
+ unsigned long context;
+
+ /*
+ * kernel take the top 4 context from the available range
+ */
+ context = (MAX_USER_CONTEXT) + ((ea >> 60) - 0xc) + 1;
+ return get_vsid(context, ea, ssize);
+}
#endif /* __ASSEMBLY__ */

#endif /* _ASM_POWERPC_MMU_HASH64_H_ */
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -1268,20 +1268,36 @@ do_ste_alloc:
_GLOBAL(do_stab_bolted)
stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */
std r11,PACA_EXSLB+EX_SRR0(r13) /* save SRR0 in exc. frame */
+ mfspr r11,SPRN_DAR /* ea */

+ /*
+ * check for bad kernel/user address
+ * (ea & ~REGION_MASK) >= PGTABLE_RANGE
+ */
+ rldicr. r9,r11,4,(63 - 46 - 4)
+ li r9,0 /* VSID = 0 for bad address */
+ bne- 0f
+
+ /*
+ * Calculate VSID:
+ * This is the kernel vsid, we take the top for context from
+ * the range. context = (MAX_USER_CONTEXT) + ((ea >> 60) - 0xc) + 1
+ * Here we know that (ea >> 60) == 0xc
+ */
+ lis r9,(MAX_USER_CONTEXT + 1)@ha
+ addi r9,r9,(MAX_USER_CONTEXT + 1)@l
+
+ srdi r10,r11,SID_SHIFT
+ rldimi r10,r9,USER_ESID_BITS,0 /* proto vsid */
+ ASM_VSID_SCRAMBLE(r10, r9, 256M)
+ rldic r9,r10,12,16 /* r9 = vsid << 12 */
+
+0:
/* Hash to the primary group */
ld r10,PACASTABVIRT(r13)
- mfspr r11,SPRN_DAR
- srdi r11,r11,28
+ srdi r11,r11,SID_SHIFT
rldimi r10,r11,7,52 /* r10 = first ste of the group */

- /* Calculate VSID */
- /* This is a kernel address, so protovsid = ESID | 1 << 37 */
- li r9,0x1
- rldimi r11,r9,(CONTEXT_BITS + USER_ESID_BITS),0
- ASM_VSID_SCRAMBLE(r11, r9, 256M)
- rldic r9,r11,12,16 /* r9 = vsid << 12 */
-
/* Search the primary group for a free entry */
1: ld r11,0(r10) /* Test valid bit of the current ste */
andi. r11,r11,0x80
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -194,6 +194,11 @@ int htab_bolt_mapping(unsigned long vsta
unsigned long vpn = hpt_vpn(vaddr, vsid, ssize);
unsigned long tprot = prot;

+ /*
+ * If we hit a bad address return error.
+ */
+ if (!vsid)
+ return -1;
/* Make kernel text executable */
if (overlaps_kernel_text(vaddr, vaddr + step))
tprot &= ~HPTE_R_N;
@@ -923,11 +928,6 @@ int hash_page(unsigned long ea, unsigned
DBG_LOW("hash_page(ea=%016lx, access=%lx, trap=%lx\n",
ea, access, trap);

- if ((ea & ~REGION_MASK) >= PGTABLE_RANGE) {
- DBG_LOW(" out of pgtable range !\n");
- return 1;
- }
-
/* Get region & vsid */
switch (REGION_ID(ea)) {
case USER_REGION_ID:
@@ -958,6 +958,11 @@ int hash_page(unsigned long ea, unsigned
}
DBG_LOW(" mm=%p, mm->pgdir=%p, vsid=%016lx\n", mm, mm->pgd, vsid);

+ /* Bad address. */
+ if (!vsid) {
+ DBG_LOW("Bad address!\n");
+ return 1;
+ }
/* Get pgdir */
pgdir = mm->pgd;
if (pgdir == NULL)
@@ -1127,6 +1132,8 @@ void hash_preload(struct mm_struct *mm,
/* Get VSID */
ssize = user_segment_size(ea);
vsid = get_vsid(mm->context.id, ea, ssize);
+ if (!vsid)
+ return;

/* Hash doesn't like irqs */
local_irq_save(flags);
@@ -1219,6 +1226,9 @@ static void kernel_map_linear_page(unsig
hash = hpt_hash(vpn, PAGE_SHIFT, mmu_kernel_ssize);
hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP);

+ /* Don't create HPTE entries for bad address */
+ if (!vsid)
+ return;
ret = ppc_md.hpte_insert(hpteg, vpn, __pa(vaddr),
mode, HPTE_V_BOLTED,
mmu_linear_psize, mmu_kernel_ssize);
--- a/arch/powerpc/mm/mmu_context_hash64.c
+++ b/arch/powerpc/mm/mmu_context_hash64.c
@@ -29,15 +29,6 @@
static DEFINE_SPINLOCK(mmu_context_lock);
static DEFINE_IDA(mmu_context_ida);

-/*
- * 256MB segment
- * The proto-VSID space has 2^(CONTEX_BITS + USER_ESID_BITS) - 1 segments
- * available for user mappings. Each segment contains 2^28 bytes. Each
- * context maps 2^46 bytes (64TB) so we can support 2^19-1 contexts
- * (19 == 37 + 28 - 46).
- */
-#define MAX_CONTEXT ((1UL << CONTEXT_BITS) - 1)
-
int __init_new_context(void)
{
int index;
@@ -56,7 +47,7 @@ again:
else if (err)
return err;

- if (index > MAX_CONTEXT) {
+ if (index > MAX_USER_CONTEXT) {
spin_lock(&mmu_context_lock);
ida_remove(&mmu_context_ida, index);
spin_unlock(&mmu_context_lock);
--- a/arch/powerpc/mm/slb_low.S
+++ b/arch/powerpc/mm/slb_low.S
@@ -31,10 +31,15 @@
* No other registers are examined or changed.
*/
_GLOBAL(slb_allocate_realmode)
- /* r3 = faulting address */
+ /*
+ * check for bad kernel/user address
+ * (ea & ~REGION_MASK) >= PGTABLE_RANGE
+ */
+ rldicr. r9,r3,4,(63 - 46 - 4)
+ bne- 8f

srdi r9,r3,60 /* get region */
- srdi r10,r3,28 /* get esid */
+ srdi r10,r3,SID_SHIFT /* get esid */
cmpldi cr7,r9,0xc /* cmp PAGE_OFFSET for later use */

/* r3 = address, r10 = esid, cr7 = <> PAGE_OFFSET */
@@ -56,12 +61,14 @@ _GLOBAL(slb_allocate_realmode)
*/
_GLOBAL(slb_miss_kernel_load_linear)
li r11,0
- li r9,0x1
/*
- * for 1T we shift 12 bits more. slb_finish_load_1T will do
- * the necessary adjustment
+ * context = (MAX_USER_CONTEXT) + ((ea >> 60) - 0xc) + 1
+ * r9 = region id.
*/
- rldimi r10,r9,(CONTEXT_BITS + USER_ESID_BITS),0
+ addis r9,r9,(MAX_USER_CONTEXT - 0xc + 1)@ha
+ addi r9,r9,(MAX_USER_CONTEXT - 0xc + 1)@l
+
+
BEGIN_FTR_SECTION
b slb_finish_load
END_MMU_FTR_SECTION_IFCLR(MMU_FTR_1T_SEGMENT)
@@ -91,24 +98,19 @@ _GLOBAL(slb_miss_kernel_load_vmemmap)
_GLOBAL(slb_miss_kernel_load_io)
li r11,0
6:
- li r9,0x1
/*
- * for 1T we shift 12 bits more. slb_finish_load_1T will do
- * the necessary adjustment
+ * context = (MAX_USER_CONTEXT) + ((ea >> 60) - 0xc) + 1
+ * r9 = region id.
*/
- rldimi r10,r9,(CONTEXT_BITS + USER_ESID_BITS),0
+ addis r9,r9,(MAX_USER_CONTEXT - 0xc + 1)@ha
+ addi r9,r9,(MAX_USER_CONTEXT - 0xc + 1)@l
+
BEGIN_FTR_SECTION
b slb_finish_load
END_MMU_FTR_SECTION_IFCLR(MMU_FTR_1T_SEGMENT)
b slb_finish_load_1T

-0: /* user address: proto-VSID = context << 15 | ESID. First check
- * if the address is within the boundaries of the user region
- */
- srdi. r9,r10,USER_ESID_BITS
- bne- 8f /* invalid ea bits set */
-
-
+0:
/* when using slices, we extract the psize off the slice bitmaps
* and then we need to get the sllp encoding off the mmu_psize_defs
* array.
@@ -164,15 +166,13 @@ END_MMU_FTR_SECTION_IFCLR(MMU_FTR_1T_SEG
ld r9,PACACONTEXTID(r13)
BEGIN_FTR_SECTION
cmpldi r10,0x1000
-END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEGMENT)
- rldimi r10,r9,USER_ESID_BITS,0
-BEGIN_FTR_SECTION
bge slb_finish_load_1T
END_MMU_FTR_SECTION_IFSET(MMU_FTR_1T_SEGMENT)
b slb_finish_load

8: /* invalid EA */
li r10,0 /* BAD_VSID */
+ li r9,0 /* BAD_VSID */
li r11,SLB_VSID_USER /* flags don't much matter */
b slb_finish_load

@@ -221,8 +221,6 @@ _GLOBAL(slb_allocate_user)

/* get context to calculate proto-VSID */
ld r9,PACACONTEXTID(r13)
- rldimi r10,r9,USER_ESID_BITS,0
-
/* fall through slb_finish_load */

#endif /* __DISABLED__ */
@@ -231,9 +229,10 @@ _GLOBAL(slb_allocate_user)
/*
* Finish loading of an SLB entry and return
*
- * r3 = EA, r10 = proto-VSID, r11 = flags, clobbers r9, cr7 = <> PAGE_OFFSET
+ * r3 = EA, r9 = context, r10 = ESID, r11 = flags, clobbers r9, cr7 = <> PAGE_OFFSET
*/
slb_finish_load:
+ rldimi r10,r9,USER_ESID_BITS,0
ASM_VSID_SCRAMBLE(r10,r9,256M)
/*
* bits above VSID_BITS_256M need to be ignored from r10
@@ -298,10 +297,11 @@ _GLOBAL(slb_compare_rr_to_size)
/*
* Finish loading of a 1T SLB entry (for the kernel linear mapping) and return.
*
- * r3 = EA, r10 = proto-VSID, r11 = flags, clobbers r9
+ * r3 = EA, r9 = context, r10 = ESID(256MB), r11 = flags, clobbers r9
*/
slb_finish_load_1T:
- srdi r10,r10,40-28 /* get 1T ESID */
+ srdi r10,r10,(SID_SHIFT_1T - SID_SHIFT) /* get 1T ESID */
+ rldimi r10,r9,USER_ESID_BITS_1T,0
ASM_VSID_SCRAMBLE(r10,r9,1T)
/*
* bits above VSID_BITS_1T need to be ignored from r10
--- a/arch/powerpc/mm/tlb_hash64.c
+++ b/arch/powerpc/mm/tlb_hash64.c
@@ -82,11 +82,11 @@ void hpte_need_flush(struct mm_struct *m
if (!is_kernel_addr(addr)) {
ssize = user_segment_size(addr);
vsid = get_vsid(mm->context.id, addr, ssize);
- WARN_ON(vsid == 0);
} else {
vsid = get_kernel_vsid(addr, mmu_kernel_ssize);
ssize = mmu_kernel_ssize;
}
+ WARN_ON(vsid == 0);
vpn = hpt_vpn(addr, vsid, ssize);
rpte = __real_pte(__pte(pte), ptep);


2013-03-18 21:54:56

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 40/75] powerpc: Rename USER_ESID_BITS* to ESID_BITS*

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: "Aneesh Kumar K.V" <[email protected]>

commit af81d7878c641629f2693ae3fdaf74b4af14dfca upstream.

Now we use ESID_BITS of kernel address to build proto vsid. So rename
USER_ESIT_BITS to ESID_BITS

Acked-by: Paul Mackerras <[email protected]>
Signed-off-by: Aneesh Kumar K.V <[email protected]>
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
arch/powerpc/include/asm/mmu-hash64.h | 16 ++++++++--------
arch/powerpc/kernel/exceptions-64s.S | 2 +-
arch/powerpc/kvm/book3s_64_mmu_host.c | 4 ++--
arch/powerpc/mm/pgtable_64.c | 2 +-
arch/powerpc/mm/slb_low.S | 4 ++--
5 files changed, 14 insertions(+), 14 deletions(-)

--- a/arch/powerpc/include/asm/mmu-hash64.h
+++ b/arch/powerpc/include/asm/mmu-hash64.h
@@ -378,12 +378,12 @@ extern void slb_set_size(u16 size);
*/

#define CONTEXT_BITS 19
-#define USER_ESID_BITS 18
-#define USER_ESID_BITS_1T 6
+#define ESID_BITS 18
+#define ESID_BITS_1T 6

/*
* 256MB segment
- * The proto-VSID space has 2^(CONTEX_BITS + USER_ESID_BITS) - 1 segments
+ * The proto-VSID space has 2^(CONTEX_BITS + ESID_BITS) - 1 segments
* available for user + kernel mapping. The top 4 contexts are used for
* kernel mapping. Each segment contains 2^28 bytes. Each
* context maps 2^46 bytes (64TB) so we can support 2^19-1 contexts
@@ -396,15 +396,15 @@ extern void slb_set_size(u16 size);
* doesn't overflow 64 bits. It should also be co-prime to vsid_modulus
*/
#define VSID_MULTIPLIER_256M ASM_CONST(12538073) /* 24-bit prime */
-#define VSID_BITS_256M (CONTEXT_BITS + USER_ESID_BITS)
+#define VSID_BITS_256M (CONTEXT_BITS + ESID_BITS)
#define VSID_MODULUS_256M ((1UL<<VSID_BITS_256M)-1)

#define VSID_MULTIPLIER_1T ASM_CONST(12538073) /* 24-bit prime */
-#define VSID_BITS_1T (CONTEXT_BITS + USER_ESID_BITS_1T)
+#define VSID_BITS_1T (CONTEXT_BITS + ESID_BITS_1T)
#define VSID_MODULUS_1T ((1UL<<VSID_BITS_1T)-1)


-#define USER_VSID_RANGE (1UL << (USER_ESID_BITS + SID_SHIFT))
+#define USER_VSID_RANGE (1UL << (ESID_BITS + SID_SHIFT))

/*
* This macro generates asm code to compute the VSID scramble
@@ -540,9 +540,9 @@ static inline unsigned long get_vsid(uns
return 0;

if (ssize == MMU_SEGSIZE_256M)
- return vsid_scramble((context << USER_ESID_BITS)
+ return vsid_scramble((context << ESID_BITS)
| (ea >> SID_SHIFT), 256M);
- return vsid_scramble((context << USER_ESID_BITS_1T)
+ return vsid_scramble((context << ESID_BITS_1T)
| (ea >> SID_SHIFT_1T), 1T);
}

--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -1288,7 +1288,7 @@ _GLOBAL(do_stab_bolted)
addi r9,r9,(MAX_USER_CONTEXT + 1)@l

srdi r10,r11,SID_SHIFT
- rldimi r10,r9,USER_ESID_BITS,0 /* proto vsid */
+ rldimi r10,r9,ESID_BITS,0 /* proto vsid */
ASM_VSID_SCRAMBLE(r10, r9, 256M)
rldic r9,r10,12,16 /* r9 = vsid << 12 */

--- a/arch/powerpc/kvm/book3s_64_mmu_host.c
+++ b/arch/powerpc/kvm/book3s_64_mmu_host.c
@@ -326,8 +326,8 @@ int kvmppc_mmu_init(struct kvm_vcpu *vcp
vcpu3s->context_id[0] = err;

vcpu3s->proto_vsid_max = ((vcpu3s->context_id[0] + 1)
- << USER_ESID_BITS) - 1;
- vcpu3s->proto_vsid_first = vcpu3s->context_id[0] << USER_ESID_BITS;
+ << ESID_BITS) - 1;
+ vcpu3s->proto_vsid_first = vcpu3s->context_id[0] << ESID_BITS;
vcpu3s->proto_vsid_next = vcpu3s->proto_vsid_first;

kvmppc_mmu_hpte_init(vcpu);
--- a/arch/powerpc/mm/pgtable_64.c
+++ b/arch/powerpc/mm/pgtable_64.c
@@ -61,7 +61,7 @@
#endif

#ifdef CONFIG_PPC_STD_MMU_64
-#if TASK_SIZE_USER64 > (1UL << (USER_ESID_BITS + SID_SHIFT))
+#if TASK_SIZE_USER64 > (1UL << (ESID_BITS + SID_SHIFT))
#error TASK_SIZE_USER64 exceeds user VSID range
#endif
#endif
--- a/arch/powerpc/mm/slb_low.S
+++ b/arch/powerpc/mm/slb_low.S
@@ -232,7 +232,7 @@ _GLOBAL(slb_allocate_user)
* r3 = EA, r9 = context, r10 = ESID, r11 = flags, clobbers r9, cr7 = <> PAGE_OFFSET
*/
slb_finish_load:
- rldimi r10,r9,USER_ESID_BITS,0
+ rldimi r10,r9,ESID_BITS,0
ASM_VSID_SCRAMBLE(r10,r9,256M)
/*
* bits above VSID_BITS_256M need to be ignored from r10
@@ -301,7 +301,7 @@ _GLOBAL(slb_compare_rr_to_size)
*/
slb_finish_load_1T:
srdi r10,r10,(SID_SHIFT_1T - SID_SHIFT) /* get 1T ESID */
- rldimi r10,r9,USER_ESID_BITS_1T,0
+ rldimi r10,r9,ESID_BITS_1T,0
ASM_VSID_SCRAMBLE(r10,r9,1T)
/*
* bits above VSID_BITS_1T need to be ignored from r10

2013-03-18 21:06:57

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 35/75] w1: fix oops when w1_search is called from netlink connector

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Marcin Jurkowski <[email protected]>

commit 9d1817cab2f030f6af360e961cc69bb1da8ad765 upstream.

On Sat, Mar 02, 2013 at 10:45:10AM +0100, Sven Geggus wrote:
> This is the bad commit I found doing git bisect:
> 04f482faf50535229a5a5c8d629cf963899f857c is the first bad commit
> commit 04f482faf50535229a5a5c8d629cf963899f857c
> Author: Patrick McHardy <[email protected]>
> Date: Mon Mar 28 08:39:36 2011 +0000

Good job. I was too lazy to bisect for bad commit;)

Reading the code I found problematic kthread_should_stop call from netlink
connector which causes the oops. After applying a patch, I've been testing
owfs+w1 setup for nearly two days and it seems to work very reliable (no
hangs, no memleaks etc).
More detailed description and possible fix is given below:

Function w1_search can be called from either kthread or netlink callback.
While the former works fine, the latter causes oops due to kthread_should_stop
invocation.

This patch adds a check if w1_search is serving netlink command, skipping
kthread_should_stop invocation if so.

Signed-off-by: Marcin Jurkowski <[email protected]>
Acked-by: Evgeniy Polyakov <[email protected]>
Cc: Josh Boyer <[email protected]>
Tested-by: Sven Geggus <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/w1/w1.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -924,7 +924,8 @@ void w1_search(struct w1_master *dev, u8
tmp64 = (triplet_ret >> 2);
rn |= (tmp64 << i);

- if (kthread_should_stop()) {
+ /* ensure we're called from kthread and not by netlink callback */
+ if (!dev->priv && kthread_should_stop()) {
mutex_unlock(&dev->bus_mutex);
dev_dbg(&dev->dev, "Abort w1_search\n");
return;

2013-03-18 21:55:41

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 37/75] powerpc: Fix cputable entry for 970MP rev 1.0

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Benjamin Herrenschmidt <[email protected]>

commit d63ac5f6cf31c8a83170a9509b350c1489a7262b upstream.

Commit 44ae3ab3358e962039c36ad4ae461ae9fb29596c forgot to update
the entry for the 970MP rev 1.0 processor when moving some CPU
features bits to the MMU feature bit mask. This breaks booting
on some rare G5 models using that chip revision.

Reported-by: Phileas Fogg <[email protected]>
Signed-off-by: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
arch/powerpc/kernel/cputable.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -275,7 +275,7 @@ static struct cpu_spec __initdata cpu_sp
.cpu_features = CPU_FTRS_PPC970,
.cpu_user_features = COMMON_USER_POWER4 |
PPC_FEATURE_HAS_ALTIVEC_COMP,
- .mmu_features = MMU_FTR_HPTE_TABLE,
+ .mmu_features = MMU_FTRS_PPC970,
.icache_bsize = 128,
.dcache_bsize = 128,
.num_pmcs = 8,

2013-03-18 21:56:03

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 36/75] powerpc: Fix STAB initialization

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Benjamin Herrenschmidt <[email protected]>

commit 13938117a57f88a22f0df9722a5db7271fda85cd upstream.

Commit f5339277eb8d3aed37f12a27988366f68ab68930 accidentally removed
more than just iSeries bits and took out the call to stab_initialize()
thus breaking support for POWER3 processors.

Put it back. (Yes, nobody noticed until now ...)

Signed-off-by: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
arch/powerpc/mm/hash_utils_64.c | 2 ++
1 file changed, 2 insertions(+)

--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -758,6 +758,8 @@ void __init early_init_mmu(void)
/* Initialize stab / SLB management */
if (mmu_has_feature(MMU_FTR_SLB))
slb_initialize();
+ else
+ stab_initialize(get_paca()->stab_real);
}

#ifdef CONFIG_SMP

2013-03-18 21:06:55

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 23/75] tty: serial: fix typo "SERIAL_S3C2412"

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Paul Bolle <[email protected]>

commit c51d41a1dd8f23a06a4ed651ebb9617de7f59368 upstream.

The Kconfig symbol SERIAL_S3C2412 got removed in commit
da121506eb03ee5daea55404709110b798bd61d9 ("serial: samsung: merge
probe() function from all SoC specific extensions"). But it also added a
last reference to that symbol. The commit and the tree make clear that
CPU_S3C2412 should have been used instead.

Signed-off-by: Paul Bolle <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/tty/serial/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -209,7 +209,7 @@ config SERIAL_SAMSUNG
config SERIAL_SAMSUNG_UARTS_4
bool
depends on PLAT_SAMSUNG
- default y if !(CPU_S3C2410 || SERIAL_S3C2412 || CPU_S3C2440 || CPU_S3C2442)
+ default y if !(CPU_S3C2410 || CPU_S3C2412 || CPU_S3C2440 || CPU_S3C2442)
help
Internal node for the common case of 4 Samsung compatible UARTs


2013-03-18 21:56:31

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 45/75] s390: critical section cleanup vs. machine checks

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Martin Schwidefsky <[email protected]>

commit 6551fbdfd8b85d1ab5822ac98abb4fb449bcfae0 upstream.

The current machine check code uses the registers stored by the machine
in the lowcore at __LC_GPREGS_SAVE_AREA as the registers of the interrupted
context. The registers 0-7 of a user process can get clobbered if a machine
checks interrupts the execution of a critical section in entry[64].S.

The reason is that the critical section cleanup code may need to modify
the PSW and the registers for the previous context to get to the end of a
critical section. If registers 0-7 have to be replaced the relevant copy
will be in the registers, which invalidates the copy in the lowcore. The
machine check handler needs to explicitly store registers 0-7 to the stack.

Signed-off-by: Martin Schwidefsky <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
arch/s390/kernel/entry.S | 3 ++-
arch/s390/kernel/entry64.S | 5 +++--
2 files changed, 5 insertions(+), 3 deletions(-)

--- a/arch/s390/kernel/entry.S
+++ b/arch/s390/kernel/entry.S
@@ -636,7 +636,8 @@ ENTRY(mcck_int_handler)
UPDATE_VTIME %r14,%r15,__LC_MCCK_ENTER_TIMER
mcck_skip:
SWITCH_ASYNC __LC_GPREGS_SAVE_AREA+32,__LC_PANIC_STACK,PAGE_SHIFT
- mvc __PT_R0(64,%r11),__LC_GPREGS_SAVE_AREA
+ stm %r0,%r7,__PT_R0(%r11)
+ mvc __PT_R8(32,%r11),__LC_GPREGS_SAVE_AREA+32
stm %r8,%r9,__PT_PSW(%r11)
xc __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15)
l %r1,BASED(.Ldo_machine_check)
--- a/arch/s390/kernel/entry64.S
+++ b/arch/s390/kernel/entry64.S
@@ -678,8 +678,9 @@ ENTRY(mcck_int_handler)
UPDATE_VTIME %r14,__LC_MCCK_ENTER_TIMER
LAST_BREAK %r14
mcck_skip:
- lghi %r14,__LC_GPREGS_SAVE_AREA
- mvc __PT_R0(128,%r11),0(%r14)
+ lghi %r14,__LC_GPREGS_SAVE_AREA+64
+ stmg %r0,%r7,__PT_R0(%r11)
+ mvc __PT_R8(64,%r11),0(%r14)
stmg %r8,%r9,__PT_PSW(%r11)
xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15)
lgr %r2,%r11 # pass pointer to pt_regs

2013-03-18 21:06:53

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 29/75] perf,x86: fix kernel crash with PEBS/BTS after suspend/resume

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Stephane Eranian <[email protected]>

commit 1d9d8639c063caf6efc2447f5f26aa637f844ff6 upstream.

This patch fixes a kernel crash when using precise sampling (PEBS)
after a suspend/resume. Turns out the CPU notifier code is not invoked
on CPU0 (BP). Therefore, the DS_AREA (used by PEBS) is not restored properly
by the kernel and keeps it power-on/resume value of 0 causing any PEBS
measurement to crash when running on CPU0.

The workaround is to add a hook in the actual resume code to restore
the DS Area MSR value. It is invoked for all CPUS. So for all but CPU0,
the DS_AREA will be restored twice but this is harmless.

Reported-by: Linus Torvalds <[email protected]>
Signed-off-by: Stephane Eranian <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
arch/x86/kernel/cpu/perf_event_intel_ds.c | 8 ++++++++
arch/x86/power/cpu.c | 2 ++
include/linux/perf_event.h | 2 ++
3 files changed, 12 insertions(+)

--- a/arch/x86/kernel/cpu/perf_event_intel_ds.c
+++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c
@@ -729,3 +729,11 @@ void intel_ds_init(void)
}
}
}
+
+void perf_restore_debug_store(void)
+{
+ if (!x86_pmu.bts && !x86_pmu.pebs)
+ return;
+
+ init_debug_store_on_cpu(smp_processor_id());
+}
--- a/arch/x86/power/cpu.c
+++ b/arch/x86/power/cpu.c
@@ -11,6 +11,7 @@
#include <linux/suspend.h>
#include <linux/export.h>
#include <linux/smp.h>
+#include <linux/perf_event.h>

#include <asm/pgtable.h>
#include <asm/proto.h>
@@ -228,6 +229,7 @@ static void __restore_processor_state(st
do_fpu_end();
x86_platform.restore_sched_clock_state();
mtrr_bp_restore();
+ perf_restore_debug_store();
}

/* Needed by apm.c */
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -753,6 +753,7 @@ extern void perf_event_enable(struct per
extern void perf_event_disable(struct perf_event *event);
extern int __perf_event_disable(void *info);
extern void perf_event_task_tick(void);
+extern void perf_restore_debug_store(void);
#else
static inline void
perf_event_task_sched_in(struct task_struct *prev,
@@ -792,6 +793,7 @@ static inline void perf_event_enable(str
static inline void perf_event_disable(struct perf_event *event) { }
static inline int __perf_event_disable(void *info) { return -1; }
static inline void perf_event_task_tick(void) { }
+static inline void perf_restore_debug_store(void) { }
#endif

#define perf_output_put(handle, x) perf_output_copy((handle), &(x), sizeof(x))

2013-03-18 21:56:47

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 44/75] perf,x86: fix link failure for non-Intel configs

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: David Rientjes <[email protected]>

commit 6c4d3bc99b3341067775efd4d9d13cc8e655fd7c upstream.

Commit 1d9d8639c063 ("perf,x86: fix kernel crash with PEBS/BTS after
suspend/resume") introduces a link failure since
perf_restore_debug_store() is only defined for CONFIG_CPU_SUP_INTEL:

arch/x86/power/built-in.o: In function `restore_processor_state':
(.text+0x45c): undefined reference to `perf_restore_debug_store'

Fix it by defining the dummy function appropriately.

Signed-off-by: David Rientjes <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
include/linux/perf_event.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -753,7 +753,6 @@ extern void perf_event_enable(struct per
extern void perf_event_disable(struct perf_event *event);
extern int __perf_event_disable(void *info);
extern void perf_event_task_tick(void);
-extern void perf_restore_debug_store(void);
#else
static inline void
perf_event_task_sched_in(struct task_struct *prev,
@@ -793,6 +792,11 @@ static inline void perf_event_enable(str
static inline void perf_event_disable(struct perf_event *event) { }
static inline int __perf_event_disable(void *info) { return -1; }
static inline void perf_event_task_tick(void) { }
+#endif
+
+#if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_CPU_SUP_INTEL)
+extern void perf_restore_debug_store(void);
+#else
static inline void perf_restore_debug_store(void) { }
#endif


2013-03-18 21:57:06

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 32/75] hwmon: (pmbus/ltc2978) Fix temperature reporting

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Guenter Roeck <[email protected]>

commit 8c958c703ef8804093437959221951eaf0e1e664 upstream.

On LTC2978, only READ_TEMPERATURE is supported. It reports
the internal junction temperature. This register is unpaged.

On LTC3880, READ_TEMPERATURE and READ_TEMPERATURE2 are supported.
READ_TEMPERATURE is paged and reports external temperatures.
READ_TEMPERATURE2 is unpaged and reports the internal junction
temperature.

Signed-off-by: Guenter Roeck <[email protected]>
Acked-by: Jean Delvare <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/hwmon/pmbus/ltc2978.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

--- a/drivers/hwmon/pmbus/ltc2978.c
+++ b/drivers/hwmon/pmbus/ltc2978.c
@@ -59,7 +59,7 @@ enum chips { ltc2978, ltc3880 };
struct ltc2978_data {
enum chips id;
int vin_min, vin_max;
- int temp_min, temp_max;
+ int temp_min, temp_max[2];
int vout_min[8], vout_max[8];
int iout_max[2];
int temp2_max;
@@ -113,9 +113,10 @@ static int ltc2978_read_word_data_common
ret = pmbus_read_word_data(client, page,
LTC2978_MFR_TEMPERATURE_PEAK);
if (ret >= 0) {
- if (lin11_to_val(ret) > lin11_to_val(data->temp_max))
- data->temp_max = ret;
- ret = data->temp_max;
+ if (lin11_to_val(ret)
+ > lin11_to_val(data->temp_max[page]))
+ data->temp_max[page] = ret;
+ ret = data->temp_max[page];
}
break;
case PMBUS_VIRT_RESET_VOUT_HISTORY:
@@ -266,7 +267,7 @@ static int ltc2978_write_word_data(struc
break;
case PMBUS_VIRT_RESET_TEMP_HISTORY:
data->temp_min = 0x7bff;
- data->temp_max = 0x7c00;
+ data->temp_max[page] = 0x7c00;
ret = ltc2978_clear_peaks(client, page, data->id);
break;
default:
@@ -323,7 +324,8 @@ static int ltc2978_probe(struct i2c_clie
data->vin_min = 0x7bff;
data->vin_max = 0x7c00;
data->temp_min = 0x7bff;
- data->temp_max = 0x7c00;
+ for (i = 0; i < ARRAY_SIZE(data->temp_max); i++)
+ data->temp_max[i] = 0x7c00;
data->temp2_max = 0x7c00;

switch (data->id) {

2013-03-18 21:57:28

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 31/75] ARM: w1-gpio: fix erroneous gpio requests

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Johan Hovold <[email protected]>

commit 2d798a3f20ae992b0b69a2b68c04ada397c32ed4 upstream.

Fix regression introduced by commit d2323cf773 ("onewire: w1-gpio: add
ext_pullup_enable pin in platform data") which added a gpio entry to the
platform data, but did not add the required initialisers to the board
files using it. Consequently, the driver would request gpio 0 at probe,
which could break other uses of the corresponding pin.

On AT91 requesting gpio 0 changes the pin muxing for PIOA0, which, for
instance, breaks SPI0 on at91sam9g20.

Signed-off-by: Johan Hovold <[email protected]>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
arch/arm/mach-at91/board-foxg20.c | 1 +
arch/arm/mach-at91/board-stamp9g20.c | 1 +
arch/arm/mach-ixp4xx/vulcan-setup.c | 1 +
arch/arm/mach-pxa/raumfeld.c | 1 +
4 files changed, 4 insertions(+)

--- a/arch/arm/mach-at91/board-foxg20.c
+++ b/arch/arm/mach-at91/board-foxg20.c
@@ -176,6 +176,7 @@ static struct w1_gpio_platform_data w1_g
/* If you choose to use a pin other than PB16 it needs to be 3.3V */
.pin = AT91_PIN_PB16,
.is_open_drain = 1,
+ .ext_pullup_enable_pin = -EINVAL,
};

static struct platform_device w1_device = {
--- a/arch/arm/mach-at91/board-stamp9g20.c
+++ b/arch/arm/mach-at91/board-stamp9g20.c
@@ -188,6 +188,7 @@ static struct spi_board_info portuxg20_s
static struct w1_gpio_platform_data w1_gpio_pdata = {
.pin = AT91_PIN_PA29,
.is_open_drain = 1,
+ .ext_pullup_enable_pin = -EINVAL,
};

static struct platform_device w1_device = {
--- a/arch/arm/mach-ixp4xx/vulcan-setup.c
+++ b/arch/arm/mach-ixp4xx/vulcan-setup.c
@@ -163,6 +163,7 @@ static struct platform_device vulcan_max

static struct w1_gpio_platform_data vulcan_w1_gpio_pdata = {
.pin = 14,
+ .ext_pullup_enable_pin = -EINVAL,
};

static struct platform_device vulcan_w1_gpio = {
--- a/arch/arm/mach-pxa/raumfeld.c
+++ b/arch/arm/mach-pxa/raumfeld.c
@@ -505,6 +505,7 @@ static struct w1_gpio_platform_data w1_g
.pin = GPIO_ONE_WIRE,
.is_open_drain = 0,
.enable_external_pullup = w1_enable_external_pullup,
+ .ext_pullup_enable_pin = -EINVAL,
};

struct platform_device raumfeld_w1_gpio_device = {

2013-03-18 21:06:50

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 33/75] hwmon: (lineage-pem) Add missing terminating entry for pem_[input|fan]_attributes

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Axel Lin <[email protected]>

commit df069079c153d22adf6c28dcc0b1cf62bba75167 upstream.

Signed-off-by: Axel Lin <[email protected]>
Acked-by: Jean Delvare <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/hwmon/lineage-pem.c | 2 ++
1 file changed, 2 insertions(+)

--- a/drivers/hwmon/lineage-pem.c
+++ b/drivers/hwmon/lineage-pem.c
@@ -422,6 +422,7 @@ static struct attribute *pem_input_attri
&sensor_dev_attr_in2_input.dev_attr.attr,
&sensor_dev_attr_curr1_input.dev_attr.attr,
&sensor_dev_attr_power1_input.dev_attr.attr,
+ NULL
};

static const struct attribute_group pem_input_group = {
@@ -432,6 +433,7 @@ static struct attribute *pem_fan_attribu
&sensor_dev_attr_fan1_input.dev_attr.attr,
&sensor_dev_attr_fan2_input.dev_attr.attr,
&sensor_dev_attr_fan3_input.dev_attr.attr,
+ NULL
};

static const struct attribute_group pem_fan_group = {

2013-03-18 21:57:43

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 30/75] ALSA: seq: Fix missing error handling in snd_seq_timer_open()

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Takashi Iwai <[email protected]>

commit 66efdc71d95887b652a742a5dae51fa834d71465 upstream.

snd_seq_timer_open() didn't catch the whole error path but let through
if the timer id is a slave. This may lead to Oops by accessing the
uninitialized pointer.

BUG: unable to handle kernel NULL pointer dereference at 00000000000002ae
IP: [<ffffffff819b3477>] snd_seq_timer_open+0xe7/0x130
PGD 785cd067 PUD 76964067 PMD 0
Oops: 0002 [#4] SMP
CPU 0
Pid: 4288, comm: trinity-child7 Tainted: G D W 3.9.0-rc1+ #100 Bochs Bochs
RIP: 0010:[<ffffffff819b3477>] [<ffffffff819b3477>] snd_seq_timer_open+0xe7/0x130
RSP: 0018:ffff88006ece7d38 EFLAGS: 00010246
RAX: 0000000000000286 RBX: ffff88007851b400 RCX: 0000000000000000
RDX: 000000000000ffff RSI: ffff88006ece7d58 RDI: ffff88006ece7d38
RBP: ffff88006ece7d98 R08: 000000000000000a R09: 000000000000fffe
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: ffff8800792c5400 R14: 0000000000e8f000 R15: 0000000000000007
FS: 00007f7aaa650700(0000) GS:ffff88007f800000(0000) GS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000000002ae CR3: 000000006efec000 CR4: 00000000000006f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process trinity-child7 (pid: 4288, threadinfo ffff88006ece6000, task ffff880076a8a290)
Stack:
0000000000000286 ffffffff828f2be0 ffff88006ece7d58 ffffffff810f354d
65636e6575716573 2065756575712072 ffff8800792c0030 0000000000000000
ffff88006ece7d98 ffff8800792c5400 ffff88007851b400 ffff8800792c5520
Call Trace:
[<ffffffff810f354d>] ? trace_hardirqs_on+0xd/0x10
[<ffffffff819b17e9>] snd_seq_queue_timer_open+0x29/0x70
[<ffffffff819ae01a>] snd_seq_ioctl_set_queue_timer+0xda/0x120
[<ffffffff819acb9b>] snd_seq_do_ioctl+0x9b/0xd0
[<ffffffff819acbe0>] snd_seq_ioctl+0x10/0x20
[<ffffffff811b9542>] do_vfs_ioctl+0x522/0x570
[<ffffffff8130a4b3>] ? file_has_perm+0x83/0xa0
[<ffffffff810f354d>] ? trace_hardirqs_on+0xd/0x10
[<ffffffff811b95ed>] sys_ioctl+0x5d/0xa0
[<ffffffff813663fe>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[<ffffffff81faed69>] system_call_fastpath+0x16/0x1b

Reported-and-tested-by: Tommi Rantala <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
sound/core/seq/seq_timer.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

--- a/sound/core/seq/seq_timer.c
+++ b/sound/core/seq/seq_timer.c
@@ -290,10 +290,10 @@ int snd_seq_timer_open(struct snd_seq_qu
tid.device = SNDRV_TIMER_GLOBAL_SYSTEM;
err = snd_timer_open(&t, str, &tid, q->queue);
}
- if (err < 0) {
- snd_printk(KERN_ERR "seq fatal error: cannot create timer (%i)\n", err);
- return err;
- }
+ }
+ if (err < 0) {
+ snd_printk(KERN_ERR "seq fatal error: cannot create timer (%i)\n", err);
+ return err;
}
t->callback = snd_seq_timer_interrupt;
t->callback_data = q;

2013-03-18 21:58:04

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 28/75] ARM: kirkwood: fix to retain gbe MAC addresses for DT kernels

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Sebastian Hesselbarth <[email protected]>

commit 7bf5b408b419fc849578e6e9fbd221bf43638eb6 upstream.

The ethernet controller used on kirkwood looses its MAC address
register contents when the corresponding clock is gated. As soon as
mv643xx_eth is built as module, the clock gets gated and when loading
the module, the MAC address is gone.

Proper DT support for the mv643xx_eth driver is expected soon, so we add
a workaround to always enable ge0/ge1 clocks on kirkwood. This workaround
is also already used on non-DT kirkwood kernels.

Reported-by: Simon Baatz <[email protected]>
Signed-off-by: Sebastian Hesselbarth <[email protected]>
Tested-by: Simon Baatz <[email protected]>
Signed-off-by: Jason Cooper <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
arch/arm/mach-kirkwood/board-dt.c | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)

--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -41,16 +41,12 @@ static void __init kirkwood_legacy_clk_i

struct device_node *np = of_find_compatible_node(
NULL, NULL, "marvell,kirkwood-gating-clock");
-
struct of_phandle_args clkspec;
+ struct clk *clk;

clkspec.np = np;
clkspec.args_count = 1;

- clkspec.args[0] = CGC_BIT_GE0;
- orion_clkdev_add(NULL, "mv643xx_eth_port.0",
- of_clk_get_from_provider(&clkspec));
-
clkspec.args[0] = CGC_BIT_PEX0;
orion_clkdev_add("0", "pcie",
of_clk_get_from_provider(&clkspec));
@@ -63,14 +59,24 @@ static void __init kirkwood_legacy_clk_i
orion_clkdev_add("1", "pcie",
of_clk_get_from_provider(&clkspec));

- clkspec.args[0] = CGC_BIT_GE1;
- orion_clkdev_add(NULL, "mv643xx_eth_port.1",
- of_clk_get_from_provider(&clkspec));
-
clkspec.args[0] = CGC_BIT_SDIO;
orion_clkdev_add(NULL, "mvsdio",
of_clk_get_from_provider(&clkspec));

+ /*
+ * The ethernet interfaces forget the MAC address assigned by
+ * u-boot if the clocks are turned off. Until proper DT support
+ * is available we always enable them for now.
+ */
+ clkspec.args[0] = CGC_BIT_GE0;
+ clk = of_clk_get_from_provider(&clkspec);
+ orion_clkdev_add(NULL, "mv643xx_eth_port.0", clk);
+ clk_prepare_enable(clk);
+
+ clkspec.args[0] = CGC_BIT_GE1;
+ clk = of_clk_get_from_provider(&clkspec);
+ orion_clkdev_add(NULL, "mv643xx_eth_port.1", clk);
+ clk_prepare_enable(clk);
}

static void __init kirkwood_of_clk_init(void)

2013-03-18 21:58:25

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 27/75] Fix 4 port and add support for 8 port Unknown PCI serial port cards

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Scott Ashcroft <[email protected]>

commit d13402a4a944e72612a9ec5c9190e35717c02a9d upstream.

I've managed to find an 8 port version of the card 4 port card which was discussed here:

http://marc.info/?l=linux-serial&m=120760744205314&w=2

Looking back at that thread there were two issues in the original patch.

1) The I/O ports for the UARTs are within BAR2 not BAR0. This can been seen in the original post.
2) A serial quirk isn't needed as these cards have no memory in BAR0 which makes pci_plx9050_init just return.

This patch fixes the 4 port support to use BAR2, removes the bogus quirk and adds support for the 8 port card.

$ lspci -vvv -n -s 00:08.0
00:08.0 0780: 10b5:9050 (rev 01)
Subsystem: 10b5:1588
Control: I/O+ Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Interrupt: pin A routed to IRQ 17
Region 1: I/O ports at ff00 [size=128]
Region 2: I/O ports at fe00 [size=64]
Region 3: I/O ports at fd00 [size=8]
Capabilities: <access denied>
Kernel driver in use: serial

$ dmesg | grep 0000:00:08.0:
[ 0.083320] pci 0000:00:08.0: [10b5:9050] type 0 class 0x000780
[ 0.083355] pci 0000:00:08.0: reg 14: [io 0xff00-0xff7f]
[ 0.083369] pci 0000:00:08.0: reg 18: [io 0xfe00-0xfe3f]
[ 0.083382] pci 0000:00:08.0: reg 1c: [io 0xfd00-0xfd07]
[ 0.083460] pci 0000:00:08.0: PME# supported from D0 D3hot
[ 1.212867] 0000:00:08.0: ttyS4 at I/O 0xfe00 (irq = 17) is a 16550A
[ 1.233073] 0000:00:08.0: ttyS5 at I/O 0xfe08 (irq = 17) is a 16550A
[ 1.253270] 0000:00:08.0: ttyS6 at I/O 0xfe10 (irq = 17) is a 16550A
[ 1.273468] 0000:00:08.0: ttyS7 at I/O 0xfe18 (irq = 17) is a 16550A
[ 1.293666] 0000:00:08.0: ttyS8 at I/O 0xfe20 (irq = 17) is a 16550A
[ 1.313863] 0000:00:08.0: ttyS9 at I/O 0xfe28 (irq = 17) is a 16550A
[ 1.334061] 0000:00:08.0: ttyS10 at I/O 0xfe30 (irq = 17) is a 16550A
[ 1.354258] 0000:00:08.0: ttyS11 at I/O 0xfe38 (irq = 17) is a 16550A

Signed-off-by: Scott Ashcroft <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/tty/serial/8250/8250_pci.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)

--- a/drivers/tty/serial/8250/8250_pci.c
+++ b/drivers/tty/serial/8250/8250_pci.c
@@ -1321,6 +1321,7 @@ pci_wch_ch353_setup(struct serial_privat

/* Unknown vendors/cards - this should not be in linux/pci_ids.h */
#define PCI_SUBDEVICE_ID_UNKNOWN_0x1584 0x1584
+#define PCI_SUBDEVICE_ID_UNKNOWN_0x1588 0x1588

/*
* Master list of serial port init/setup/exit quirks.
@@ -1592,15 +1593,6 @@ static struct pci_serial_quirk pci_seria
},
{
.vendor = PCI_VENDOR_ID_PLX,
- .device = PCI_DEVICE_ID_PLX_9050,
- .subvendor = PCI_VENDOR_ID_PLX,
- .subdevice = PCI_SUBDEVICE_ID_UNKNOWN_0x1584,
- .init = pci_plx9050_init,
- .setup = pci_default_setup,
- .exit = pci_plx9050_exit,
- },
- {
- .vendor = PCI_VENDOR_ID_PLX,
.device = PCI_DEVICE_ID_PLX_ROMULUS,
.subvendor = PCI_VENDOR_ID_PLX,
.subdevice = PCI_DEVICE_ID_PLX_ROMULUS,
@@ -3456,7 +3448,12 @@ static struct pci_device_id serial_pci_t
{ PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
PCI_VENDOR_ID_PLX,
PCI_SUBDEVICE_ID_UNKNOWN_0x1584, 0, 0,
- pbn_b0_4_115200 },
+ pbn_b2_4_115200 },
+ /* Unknown card - subdevice 0x1588 */
+ { PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
+ PCI_VENDOR_ID_PLX,
+ PCI_SUBDEVICE_ID_UNKNOWN_0x1588, 0, 0,
+ pbn_b2_8_115200 },
{ PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9050,
PCI_SUBVENDOR_ID_KEYSPAN,
PCI_SUBDEVICE_ID_KEYSPAN_SX2, 0, 0,

2013-03-18 21:06:48

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 24/75] tty/serial: Add support for Altera serial port

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Ley Foon Tan <[email protected]>

commit e06c93cacb82dd147266fd1bdb2d0a0bd45ff2c1 upstream.

Add support for Altera 8250/16550 compatible serial port.

Signed-off-by: Ley Foon Tan <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
Documentation/devicetree/bindings/tty/serial/of-serial.txt | 3 +
drivers/tty/serial/8250/8250.c | 23 ++++++++++++-
drivers/tty/serial/of_serial.c | 6 +++
include/uapi/linux/serial_core.h | 5 ++
4 files changed, 35 insertions(+), 2 deletions(-)

--- a/Documentation/devicetree/bindings/tty/serial/of-serial.txt
+++ b/Documentation/devicetree/bindings/tty/serial/of-serial.txt
@@ -11,6 +11,9 @@ Required properties:
- "nvidia,tegra20-uart"
- "nxp,lpc3220-uart"
- "ibm,qpace-nwp-serial"
+ - "altr,16550-FIFO32"
+ - "altr,16550-FIFO64"
+ - "altr,16550-FIFO128"
- "serial" if the port type is unknown.
- reg : offset and length of the register set for the device.
- interrupts : should contain uart interrupt.
--- a/drivers/tty/serial/8250/8250.c
+++ b/drivers/tty/serial/8250/8250.c
@@ -308,7 +308,28 @@ static const struct serial8250_config ua
},
[PORT_8250_CIR] = {
.name = "CIR port"
- }
+ },
+ [PORT_ALTR_16550_F32] = {
+ .name = "Altera 16550 FIFO32",
+ .fifo_size = 32,
+ .tx_loadsz = 32,
+ .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
+ .flags = UART_CAP_FIFO | UART_CAP_AFE,
+ },
+ [PORT_ALTR_16550_F64] = {
+ .name = "Altera 16550 FIFO64",
+ .fifo_size = 64,
+ .tx_loadsz = 64,
+ .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
+ .flags = UART_CAP_FIFO | UART_CAP_AFE,
+ },
+ [PORT_ALTR_16550_F128] = {
+ .name = "Altera 16550 FIFO128",
+ .fifo_size = 128,
+ .tx_loadsz = 128,
+ .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
+ .flags = UART_CAP_FIFO | UART_CAP_AFE,
+ },
};

/* Uart divisor latch read */
--- a/drivers/tty/serial/of_serial.c
+++ b/drivers/tty/serial/of_serial.c
@@ -240,6 +240,12 @@ static struct of_device_id of_platform_s
{ .compatible = "ns16850", .data = (void *)PORT_16850, },
{ .compatible = "nvidia,tegra20-uart", .data = (void *)PORT_TEGRA, },
{ .compatible = "nxp,lpc3220-uart", .data = (void *)PORT_LPC3220, },
+ { .compatible = "altr,16550-FIFO32",
+ .data = (void *)PORT_ALTR_16550_F32, },
+ { .compatible = "altr,16550-FIFO64",
+ .data = (void *)PORT_ALTR_16550_F64, },
+ { .compatible = "altr,16550-FIFO128",
+ .data = (void *)PORT_ALTR_16550_F128, },
#ifdef CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL
{ .compatible = "ibm,qpace-nwp-serial",
.data = (void *)PORT_NWPSERIAL, },
--- a/include/uapi/linux/serial_core.h
+++ b/include/uapi/linux/serial_core.h
@@ -51,7 +51,10 @@
#define PORT_8250_CIR 23 /* CIR infrared port, has its own driver */
#define PORT_XR17V35X 24 /* Exar XR17V35x UARTs */
#define PORT_BRCM_TRUMANAGE 25
-#define PORT_MAX_8250 25 /* max port ID */
+#define PORT_ALTR_16550_F32 26 /* Altera 16550 UART with 32 FIFOs */
+#define PORT_ALTR_16550_F64 27 /* Altera 16550 UART with 64 FIFOs */
+#define PORT_ALTR_16550_F128 28 /* Altera 16550 UART with 128 FIFOs */
+#define PORT_MAX_8250 28 /* max port ID */

/*
* ARM specific type numbers. These are not currently guaranteed

2013-03-18 21:58:43

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 26/75] TTY: do not reset masters packet mode

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Jiri Slaby <[email protected]>

commit b81273a132177edd806476b953f6afeb17b786d5 upstream.

Now that login from util-linux is forced to drop all references to a
TTY which it wants to hangup (to reach reference count 1) we are
seeing issues with telnet. When login closes its last reference to the
slave PTY, it also resets packet mode on the *master* side. And we
have a race here.

What telnet does is fork+exec of `login'. Then there are two
scenarios:
* `login' closes the slave TTY and resets thus master's packet mode,
but even now telnet properly sets the mode, or
* `telnetd' sets packet mode on the master, `login' closes the slave
TTY and resets master's packet mode.

The former case is OK. However the latter happens in much more cases,
by the order of magnitude to be precise. So when one tries to login to
such a messed telnet setup, they see the following:
inux login:
ogin incorrect

Note the missing first letters -- telnet thinks it is still in the
packet mode, so when it receives "linux login" from `login', it
considers "l" as the type of the packet and strips it.

SuS does not mention how the implementation should behave. Both BSDs I
checked (Free and Net) do not reset the flag upon the last close.

By this I am resurrecting an old bug, see References. We are hitting
it regularly now, i.e. with updated util-linux, ergo login.

Here, I am changing a behavior introduced back in 2.1 times. It would
better have a long time testing before goes upstream.

Signed-off-by: Jiri Slaby <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Bryan Mason <[email protected]>
References: https://lkml.org/lkml/2009/11/11/223
References: https://bugzilla.redhat.com/show_bug.cgi?id=504703
References: https://bugzilla.novell.com/show_bug.cgi?id=797042
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/tty/pty.c | 1 -
1 file changed, 1 deletion(-)

--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -47,7 +47,6 @@ static void pty_close(struct tty_struct
/* Review - krefs on tty_link ?? */
if (!tty->link)
return;
- tty->link->packet = 0;
set_bit(TTY_OTHER_CLOSED, &tty->link->flags);
wake_up_interruptible(&tty->link->read_wait);
wake_up_interruptible(&tty->link->write_wait);

2013-03-18 21:59:05

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 25/75] TTY: disable debugging warning

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Jiri Slaby <[email protected]>

commit 34dcfb8479ab3c3669561eb9279284cb0eda2572 upstream.

We added a warning to flush_to_ldisc to report cases when it is called
with a NULL tty. It was for debugging purposes and it lead to a
patchset from Peter Hurley. The patchset however did not make it to
3.9, so disable the warning now to not disturb people.

We can re-add it when the series is in and we are hunting for another
bugs.

Reported-by: David Miller <[email protected]>
Signed-off-by: Jiri Slaby <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/tty/tty_buffer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/tty/tty_buffer.c
+++ b/drivers/tty/tty_buffer.c
@@ -473,7 +473,7 @@ static void flush_to_ldisc(struct work_s
struct tty_ldisc *disc;

tty = port->itty;
- if (WARN_RATELIMIT(tty == NULL, "tty is NULL\n"))
+ if (tty == NULL)
return;

disc = tty_ldisc_ref(tty);

2013-03-18 21:59:34

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 22/75] tty: serial: fix typo "ARCH_S5P6450"

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Paul Bolle <[email protected]>

commit 827aa0d36d486f359808c8fb931cf7a71011a09d upstream.

This could have been either ARCH_S5P64X0 or CPU_S5P6450. Looking at
commit 2555e663b367b8d555e76023f4de3f6338c28d6c ("ARM: S5P64X0: Add UART
serial support for S5P6450") - which added this typo - makes clear this
should be CPU_S5P6450.

Signed-off-by: Paul Bolle <[email protected]>
Acked-by: Kukjin Kim <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/tty/serial/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -216,7 +216,7 @@ config SERIAL_SAMSUNG_UARTS_4
config SERIAL_SAMSUNG_UARTS
int
depends on PLAT_SAMSUNG
- default 6 if ARCH_S5P6450
+ default 6 if CPU_S5P6450
default 4 if SERIAL_SAMSUNG_UARTS_4 || CPU_S3C2416
default 3
help

2013-03-18 21:59:32

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 13/75] USB: EHCI: dont check DMA values in QH overlays

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Alan Stern <[email protected]>

commit feca7746d5d9e84b105a613b7f3b6ad00d327372 upstream.

This patch (as1661) fixes a rather obscure bug in ehci-hcd. In a
couple of places, the driver compares the DMA address stored in a QH's
overlay region with the address of a particular qTD, in order to see
whether that qTD is the one currently being processed by the hardware.
(If it is then the status in the QH's overlay region is more
up-to-date than the status in the qTD, and if it isn't then the
overlay's value needs to be adjusted when the QH is added back to the
active schedule.)

However, DMA address in the overlay region isn't always valid. It
sometimes will contain a stale value, which may happen by coincidence
to be equal to a qTD's DMA address. Instead of checking the DMA
address, we should check whether the overlay region is active and
valid. The patch tests the ACTIVE bit in the overlay, and clears this
bit when the overlay becomes invalid (which happens when the
currently-executing URB is unlinked).

This is the second part of a fix for the regression reported at:

https://bugs.launchpad.net/bugs/1088733

Signed-off-by: Alan Stern <[email protected]>
Reported-by: Joseph Salisbury <[email protected]>
Reported-and-tested-by: Stephen Thirlwall <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/usb/host/ehci-q.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)

--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -135,7 +135,7 @@ qh_refresh (struct ehci_hcd *ehci, struc
* qtd is updated in qh_completions(). Update the QH
* overlay here.
*/
- if (cpu_to_hc32(ehci, qtd->qtd_dma) == qh->hw->hw_current) {
+ if (qh->hw->hw_token & ACTIVE_BIT(ehci)) {
qh->hw->hw_qtd_next = qtd->hw_next;
qtd = NULL;
}
@@ -449,11 +449,19 @@ qh_completions (struct ehci_hcd *ehci, s
else if (last_status == -EINPROGRESS && !urb->unlinked)
continue;

- /* qh unlinked; token in overlay may be most current */
- if (state == QH_STATE_IDLE
- && cpu_to_hc32(ehci, qtd->qtd_dma)
- == hw->hw_current) {
+ /*
+ * If this was the active qtd when the qh was unlinked
+ * and the overlay's token is active, then the overlay
+ * hasn't been written back to the qtd yet so use its
+ * token instead of the qtd's. After the qtd is
+ * processed and removed, the overlay won't be valid
+ * any more.
+ */
+ if (state == QH_STATE_IDLE &&
+ qh->qtd_list.next == &qtd->qtd_list &&
+ (hw->hw_token & ACTIVE_BIT(ehci))) {
token = hc32_to_cpu(ehci, hw->hw_token);
+ hw->hw_token &= ~ACTIVE_BIT(ehci);

/* An unlink may leave an incomplete
* async transaction in the TT buffer.

2013-03-18 21:06:44

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 17/75] signal: always clear sa_restorer on execve

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Kees Cook <[email protected]>

commit 2ca39528c01a933f6689cd6505ce65bd6d68a530 upstream.

When the new signal handlers are set up, the location of sa_restorer is
not cleared, leaking a parent process's address space location to
children. This allows for a potential bypass of the parent's ASLR by
examining the sa_restorer value returned when calling sigaction().

Based on what should be considered "secret" about addresses, it only
matters across the exec not the fork (since the VMAs haven't changed
until the exec). But since exec sets SIG_DFL and keeps sa_restorer,
this is where it should be fixed.

Given the few uses of sa_restorer, a "set" function was not written
since this would be the only use. Instead, we use
__ARCH_HAS_SA_RESTORER, as already done in other places.

Example of the leak before applying this patch:

$ cat /proc/$$/maps
...
7fb9f3083000-7fb9f3238000 r-xp 00000000 fd:01 404469 .../libc-2.15.so
...
$ ./leak
...
7f278bc74000-7f278be29000 r-xp 00000000 fd:01 404469 .../libc-2.15.so
...
1 0 (nil) 0x7fb9f30b94a0
2 4000000 (nil) 0x7f278bcaa4a0
3 4000000 (nil) 0x7f278bcaa4a0
4 0 (nil) 0x7fb9f30b94a0
...

[[email protected]: use SA_RESTORER for backportability]
Signed-off-by: Kees Cook <[email protected]>
Reported-by: Emese Revfy <[email protected]>
Cc: Emese Revfy <[email protected]>
Cc: PaX Team <[email protected]>
Cc: Al Viro <[email protected]>
Cc: Oleg Nesterov <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Cc: Serge Hallyn <[email protected]>
Cc: Julien Tinnes <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
kernel/signal.c | 3 +++
1 file changed, 3 insertions(+)

--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -485,6 +485,9 @@ flush_signal_handlers(struct task_struct
if (force_default || ka->sa.sa_handler != SIG_IGN)
ka->sa.sa_handler = SIG_DFL;
ka->sa.sa_flags = 0;
+#ifdef SA_RESTORER
+ ka->sa.sa_restorer = NULL;
+#endif
sigemptyset(&ka->sa.sa_mask);
ka++;
}

2013-03-18 22:00:04

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 20/75] serial: 8250: Keep 8250.<xxxx> module options functional after driver rename

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Josh Boyer <[email protected]>

commit f2b8dfd9e480c3db3bad0c25c590a5d11b31f4ef upstream.

With commit 835d844d1 (8250_pnp: do pnp probe before legacy probe), the
8250 driver was renamed to 8250_core. This means any existing usage of
the 8259.<xxxx> module parameters or as a kernel command line switch is
now broken, as the 8250_core driver doesn't parse options belonging to
something called "8250".

To solve this, we redefine the module options in a dummy function using
a redefined MODULE_PARAM_PREFX when built into the kernel. In the case
where we're building as a module, we provide an alias to the old 8250
name. The dummy function prevents compiler errors due to global variable
redefinitions that happen as part of the module_param_ macro expansions.

Signed-off-by: Josh Boyer <[email protected]>
Acked-by: Jiri Slaby <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/tty/serial/8250/8250.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)

--- a/drivers/tty/serial/8250/8250.c
+++ b/drivers/tty/serial/8250/8250.c
@@ -3430,3 +3430,32 @@ module_param_array(probe_rsa, ulong, &pr
MODULE_PARM_DESC(probe_rsa, "Probe I/O ports for RSA");
#endif
MODULE_ALIAS_CHARDEV_MAJOR(TTY_MAJOR);
+
+#ifndef MODULE
+/* This module was renamed to 8250_core in 3.7. Keep the old "8250" name
+ * working as well for the module options so we don't break people. We
+ * need to keep the names identical and the convenient macros will happily
+ * refuse to let us do that by failing the build with redefinition errors
+ * of global variables. So we stick them inside a dummy function to avoid
+ * those conflicts. The options still get parsed, and the redefined
+ * MODULE_PARAM_PREFIX lets us keep the "8250." syntax alive.
+ *
+ * This is hacky. I'm sorry.
+ */
+static void __used s8250_options(void)
+{
+#undef MODULE_PARAM_PREFIX
+#define MODULE_PARAM_PREFIX "8250."
+
+ module_param_cb(share_irqs, &param_ops_uint, &share_irqs, 0644);
+ module_param_cb(nr_uarts, &param_ops_uint, &nr_uarts, 0644);
+ module_param_cb(skip_txen_test, &param_ops_uint, &skip_txen_test, 0644);
+#ifdef CONFIG_SERIAL_8250_RSA
+ __module_param_call(MODULE_PARAM_PREFIX, probe_rsa,
+ &param_array_ops, .arr = &__param_arr_probe_rsa,
+ 0444, -1);
+#endif
+}
+#else
+MODULE_ALIAS("8250");
+#endif

2013-03-18 22:00:44

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 18/75] ext3: Fix format string issues

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Lars-Peter Clausen <[email protected]>

commit 8d0c2d10dd72c5292eda7a06231056a4c972e4cc upstream.

ext3_msg() takes the printk prefix as the second parameter and the
format string as the third parameter. Two callers of ext3_msg omit the
prefix and pass the format string as the second parameter and the first
parameter to the format string as the third parameter. In both cases
this string comes from an arbitrary source. Which means the string may
contain format string characters, which will
lead to undefined and potentially harmful behavior.

The issue was introduced in commit 4cf46b67eb("ext3: Unify log messages
in ext3") and is fixed by this patch.

Signed-off-by: Lars-Peter Clausen <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
fs/ext3/super.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -353,7 +353,7 @@ static struct block_device *ext3_blkdev_
return bdev;

fail:
- ext3_msg(sb, "error: failed to open journal device %s: %ld",
+ ext3_msg(sb, KERN_ERR, "error: failed to open journal device %s: %ld",
__bdevname(dev, b), PTR_ERR(bdev));

return NULL;
@@ -887,7 +887,7 @@ static ext3_fsblk_t get_sb_block(void **
/*todo: use simple_strtoll with >32bit ext3 */
sb_block = simple_strtoul(options, &options, 0);
if (*options && *options != ',') {
- ext3_msg(sb, "error: invalid sb specification: %s",
+ ext3_msg(sb, KERN_ERR, "error: invalid sb specification: %s",
(char *) *data);
return 1;
}

2013-03-18 22:00:41

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 19/75] tty/8250_pnp: serial port detection regression since v3.7

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Sean Young <[email protected]>

commit 77e372a3d82e5e4878ce1962207edd766773cc76 upstream.

The InsydeH2O BIOS (version dated 09/12/2011) has the following in
its pnp resouces for its serial ports:

$ cat /sys/bus/pnp/devices/00:0b/resources
state = active
io disabled
irq disabled

We do not check if the resources are disabled, and create a bogus
ttyS* device. Since commit 835d844d1a28e (8250_pnp: do pnp probe
before legacy probe) we get a bogus ttyS0, which prevents the legacy
probe from detecting it.

Note, the BIOS can also be upgraded, fixing this problem, but for people
who can't do that, this fix is needed.

Reported-by: Vincent Deffontaines <[email protected]>
Tested-by: Vincent Deffontaines <[email protected]>
Signed-off-by: Sean Young <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/tty/serial/8250/8250_pnp.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

--- a/drivers/tty/serial/8250/8250_pnp.c
+++ b/drivers/tty/serial/8250/8250_pnp.c
@@ -429,6 +429,7 @@ serial_pnp_probe(struct pnp_dev *dev, co
{
struct uart_8250_port uart;
int ret, line, flags = dev_id->driver_data;
+ struct resource *res = NULL;

if (flags & UNKNOWN_DEV) {
ret = serial_pnp_guess_board(dev);
@@ -439,11 +440,12 @@ serial_pnp_probe(struct pnp_dev *dev, co
memset(&uart, 0, sizeof(uart));
if (pnp_irq_valid(dev, 0))
uart.port.irq = pnp_irq(dev, 0);
- if ((flags & CIR_PORT) && pnp_port_valid(dev, 2)) {
- uart.port.iobase = pnp_port_start(dev, 2);
- uart.port.iotype = UPIO_PORT;
- } else if (pnp_port_valid(dev, 0)) {
- uart.port.iobase = pnp_port_start(dev, 0);
+ if ((flags & CIR_PORT) && pnp_port_valid(dev, 2))
+ res = pnp_get_resource(dev, IORESOURCE_IO, 2);
+ else if (pnp_port_valid(dev, 0))
+ res = pnp_get_resource(dev, IORESOURCE_IO, 0);
+ if (pnp_resource_enabled(res)) {
+ uart.port.iobase = res->start;
uart.port.iotype = UPIO_PORT;
} else if (pnp_mem_valid(dev, 0)) {
uart.port.mapbase = pnp_mem_start(dev, 0);

2013-03-18 21:06:41

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 14/75] staging: vt6656: Fix oops on resume from suspend.

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Malcolm Priestley <[email protected]>

commit 6987a6dabfc40222ef767f67b57212fe3a0225fb upstream.

Remove usb_put_dev from vt6656_suspend and usb_get_dev
from vt6566_resume.

These are not normally in suspend/resume functions.

Signed-off-by: Malcolm Priestley <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/staging/vt6656/main_usb.c | 4 ----
1 file changed, 4 deletions(-)

--- a/drivers/staging/vt6656/main_usb.c
+++ b/drivers/staging/vt6656/main_usb.c
@@ -644,8 +644,6 @@ static int vt6656_suspend(struct usb_int
if (device->flags & DEVICE_FLAGS_OPENED)
device_close(device->dev);

- usb_put_dev(interface_to_usbdev(intf));
-
return 0;
}

@@ -656,8 +654,6 @@ static int vt6656_resume(struct usb_inte
if (!device || !device->dev)
return -ENODEV;

- usb_get_dev(interface_to_usbdev(intf));
-
if (!(device->flags & DEVICE_FLAGS_OPENED))
device_open(device->dev);


2013-03-18 22:01:22

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 16/75] qcserial: bind to DM/DIAG port on Gobi 1K devices

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Dan Williams <[email protected]>

commit 3f8bc5e4da29c7e05edeca6b475abb4fb01a5a13 upstream.

Turns out we just need altsetting 1 and then we can talk to it.

Signed-off-by: Dan Williams <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/usb/serial/qcserial.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

--- a/drivers/usb/serial/qcserial.c
+++ b/drivers/usb/serial/qcserial.c
@@ -197,12 +197,15 @@ static int qcprobe(struct usb_serial *se

if (is_gobi1k) {
/* Gobi 1K USB layout:
- * 0: serial port (doesn't respond)
+ * 0: DM/DIAG (use libqcdm from ModemManager for communication)
* 1: serial port (doesn't respond)
* 2: AT-capable modem port
* 3: QMI/net
*/
- if (ifnum == 2)
+ if (ifnum == 0) {
+ dev_dbg(dev, "Gobi 1K DM/DIAG interface found\n");
+ altsetting = 1;
+ } else if (ifnum == 2)
dev_dbg(dev, "Modem port found\n");
else
altsetting = -1;

2013-03-18 21:06:39

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 03/75] virtio: rng: disallow multiple device registrations, fixes crashes

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Amit Shah <[email protected]>

commit e84e7a56a3aa2963db506299e29a5f3f09377f9b upstream.

The code currently only supports one virtio-rng device at a time.
Invoking guests with multiple devices causes the guest to blow up.

Check if we've already registered and initialised the driver. Also
cleanup in case of registration errors or hot-unplug so that a new
device can be used.

Reported-by: Peter Krempa <[email protected]>
Reported-by: <[email protected]>
Signed-off-by: Amit Shah <[email protected]>
Signed-off-by: Rusty Russell <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/char/hw_random/virtio-rng.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)

--- a/drivers/char/hw_random/virtio-rng.c
+++ b/drivers/char/hw_random/virtio-rng.c
@@ -92,14 +92,22 @@ static int probe_common(struct virtio_de
{
int err;

+ if (vq) {
+ /* We only support one device for now */
+ return -EBUSY;
+ }
/* We expect a single virtqueue. */
vq = virtio_find_single_vq(vdev, random_recv_done, "input");
- if (IS_ERR(vq))
- return PTR_ERR(vq);
+ if (IS_ERR(vq)) {
+ err = PTR_ERR(vq);
+ vq = NULL;
+ return err;
+ }

err = hwrng_register(&virtio_hwrng);
if (err) {
vdev->config->del_vqs(vdev);
+ vq = NULL;
return err;
}

@@ -112,6 +120,7 @@ static void remove_common(struct virtio_
busy = false;
hwrng_unregister(&virtio_hwrng);
vdev->config->del_vqs(vdev);
+ vq = NULL;
}

static int virtrng_probe(struct virtio_device *vdev)

2013-03-18 22:01:46

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 15/75] staging: comedi: dt9812: use CR_CHAN() for channel number

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Ian Abbott <[email protected]>

commit 564c526a1bed5e42b5cd52cfe1752c4296ef17a6 upstream.

As pointed out by Dan Carpenper in
<http://driverdev.linuxdriverproject.org/pipermail/devel/2013-February/036025.html>,
the dt9812 comedi driver's use of the `chanspec` member of `struct
comedi_insn` as a channel number is incorrect. Change it to use
`CR_CHAN(insn->chanspec)` as the channel number (where `insn` is a
pointer to the `struct comedi_insn` being processed).

Reported-by: Dan Carpenter <[email protected]>
Cc: Anders Blomdell <[email protected]>
Signed-off-by: Ian Abbott <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/staging/comedi/drivers/dt9812.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)

--- a/drivers/staging/comedi/drivers/dt9812.c
+++ b/drivers/staging/comedi/drivers/dt9812.c
@@ -948,12 +948,13 @@ static int dt9812_di_rinsn(struct comedi
unsigned int *data)
{
struct comedi_dt9812 *devpriv = dev->private;
+ unsigned int channel = CR_CHAN(insn->chanspec);
int n;
u8 bits = 0;

dt9812_digital_in(devpriv->slot, &bits);
for (n = 0; n < insn->n; n++)
- data[n] = ((1 << insn->chanspec) & bits) != 0;
+ data[n] = ((1 << channel) & bits) != 0;
return n;
}

@@ -962,12 +963,13 @@ static int dt9812_do_winsn(struct comedi
unsigned int *data)
{
struct comedi_dt9812 *devpriv = dev->private;
+ unsigned int channel = CR_CHAN(insn->chanspec);
int n;
u8 bits = 0;

dt9812_digital_out_shadow(devpriv->slot, &bits);
for (n = 0; n < insn->n; n++) {
- u8 mask = 1 << insn->chanspec;
+ u8 mask = 1 << channel;

bits &= ~mask;
if (data[n])
@@ -982,13 +984,13 @@ static int dt9812_ai_rinsn(struct comedi
unsigned int *data)
{
struct comedi_dt9812 *devpriv = dev->private;
+ unsigned int channel = CR_CHAN(insn->chanspec);
int n;

for (n = 0; n < insn->n; n++) {
u16 value = 0;

- dt9812_analog_in(devpriv->slot, insn->chanspec, &value,
- DT9812_GAIN_1);
+ dt9812_analog_in(devpriv->slot, channel, &value, DT9812_GAIN_1);
data[n] = value;
}
return n;
@@ -999,12 +1001,13 @@ static int dt9812_ao_rinsn(struct comedi
unsigned int *data)
{
struct comedi_dt9812 *devpriv = dev->private;
+ unsigned int channel = CR_CHAN(insn->chanspec);
int n;
u16 value;

for (n = 0; n < insn->n; n++) {
value = 0;
- dt9812_analog_out_shadow(devpriv->slot, insn->chanspec, &value);
+ dt9812_analog_out_shadow(devpriv->slot, channel, &value);
data[n] = value;
}
return n;
@@ -1015,10 +1018,11 @@ static int dt9812_ao_winsn(struct comedi
unsigned int *data)
{
struct comedi_dt9812 *devpriv = dev->private;
+ unsigned int channel = CR_CHAN(insn->chanspec);
int n;

for (n = 0; n < insn->n; n++)
- dt9812_analog_out(devpriv->slot, insn->chanspec, data[n]);
+ dt9812_analog_out(devpriv->slot, channel, data[n]);
return n;
}


2013-03-18 22:02:07

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 12/75] USB: EHCI: work around silicon bug in Intels EHCI controllers

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Alan Stern <[email protected]>

commit 6402c796d3b4205d3d7296157956c5100a05d7d6 upstream.

This patch (as1660) works around a hardware problem present in some
(if not all) Intel EHCI controllers. After a QH has been unlinked
from the async schedule and the corresponding IAA interrupt has
occurred, the controller is not supposed access the QH and its qTDs.
There certainly shouldn't be any more DMA writes to those structures.
Nevertheless, Intel's controllers have been observed to perform a
final writeback to the QH's overlay region and to the most recent qTD.
For more information and a test program to determine whether this
problem is present in a particular controller, see

http://marc.info/?l=linux-usb&m=135492071812265&w=2
http://marc.info/?l=linux-usb&m=136182570800963&w=2

This patch works around the problem by always waiting for two IAA
cycles when unlinking an async QH. The extra IAA delay gives the
controller time to perform its final writeback.

Surprisingly enough, the effects of this silicon bug have gone
undetected until quite recently. More through luck than anything
else, it hasn't caused any apparent problems. However, it does
interact badly with the path that follows this one, so it needs to be
addressed.

This is the first part of a fix for the regression reported at:

https://bugs.launchpad.net/bugs/1088733

Signed-off-by: Alan Stern <[email protected]>
Tested-by: Stephen Thirlwall <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/usb/host/ehci-hcd.c | 6 ++----
drivers/usb/host/ehci-q.c | 18 ++++++++++++++----
2 files changed, 16 insertions(+), 8 deletions(-)

--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -748,11 +748,9 @@ static irqreturn_t ehci_irq (struct usb_
/* guard against (alleged) silicon errata */
if (cmd & CMD_IAAD)
ehci_dbg(ehci, "IAA with IAAD still set?\n");
- if (ehci->async_iaa) {
+ if (ehci->async_iaa)
COUNT(ehci->stats.iaa);
- end_unlink_async(ehci);
- } else
- ehci_dbg(ehci, "IAA with nothing unlinked?\n");
+ end_unlink_async(ehci);
}

/* remote wakeup [4.3.1] */
--- a/drivers/usb/host/ehci-q.c
+++ b/drivers/usb/host/ehci-q.c
@@ -1170,7 +1170,7 @@ static void single_unlink_async(struct e
struct ehci_qh *prev;

/* Add to the end of the list of QHs waiting for the next IAAD */
- qh->qh_state = QH_STATE_UNLINK;
+ qh->qh_state = QH_STATE_UNLINK_WAIT;
if (ehci->async_unlink)
ehci->async_unlink_last->unlink_next = qh;
else
@@ -1213,9 +1213,19 @@ static void start_iaa_cycle(struct ehci_

/* Do only the first waiting QH (nVidia bug?) */
qh = ehci->async_unlink;
- ehci->async_iaa = qh;
- ehci->async_unlink = qh->unlink_next;
- qh->unlink_next = NULL;
+
+ /*
+ * Intel (?) bug: The HC can write back the overlay region
+ * even after the IAA interrupt occurs. In self-defense,
+ * always go through two IAA cycles for each QH.
+ */
+ if (qh->qh_state == QH_STATE_UNLINK_WAIT) {
+ qh->qh_state = QH_STATE_UNLINK;
+ } else {
+ ehci->async_iaa = qh;
+ ehci->async_unlink = qh->unlink_next;
+ qh->unlink_next = NULL;
+ }

/* Make sure the unlinks are all visible to the hardware */
wmb();

2013-03-18 22:02:39

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 11/75] USB: storage: fix Huawei mode switching regression

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Bjørn Mork <[email protected]>

commit ab4b71644a26d1ab92b987b2fd30e17c25e89f85 upstream.

This reverts commit 200e0d99 ("USB: storage: optimize to match the
Huawei USB storage devices and support new switch command" and the
followup bugfix commit cd060956 ("USB: storage: properly handle
the endian issues of idProduct").

The commit effectively added a large number of Huawei devices to
the deprecated usb-storage mode switching logic. Many of these
devices have been in use and supported by the userspace
usb_modeswitch utility for years. Forcing the switching inside
the kernel causes a number of regressions as a result of ignoring
existing onfigurations, and also completely takes away the ability
to configure mode switching per device/system/user.

Known regressions caused by this:
- Some of the devices support multiple modes, using different
switching commands. There are existing configurations taking
advantage of this.

- There is a real use case for disabling mode switching and
instead mounting the exposed storage device. This becomes
impossible with switching logic inside the usb-storage driver.

- At least on device fail as a result of the usb-storage switching
command, becoming completely unswitchable. This is possibly a
firmware bug, but still a regression because the device work as
expected using usb_modeswitch defaults.

In-kernel mode switching was deprecated years ago with the
development of the more user friendly userspace alternatives. The
existing list of devices in usb-storage was only kept to prevent
breaking already working systems. The long term plan is to remove
the list, not to add to it. Ref:
http://permalink.gmane.org/gmane.linux.usb.general/28543

Signed-off-by: Bjørn Mork <[email protected]>
Cc: <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/usb/storage/initializers.c | 76 --------
drivers/usb/storage/initializers.h | 4
drivers/usb/storage/unusual_devs.h | 329 ++++++++++++++++++++++++++++++++++++-
3 files changed, 331 insertions(+), 78 deletions(-)

--- a/drivers/usb/storage/initializers.c
+++ b/drivers/usb/storage/initializers.c
@@ -92,8 +92,8 @@ int usb_stor_ucr61s2b_init(struct us_dat
return 0;
}

-/* This places the HUAWEI usb dongles in multi-port mode */
-static int usb_stor_huawei_feature_init(struct us_data *us)
+/* This places the HUAWEI E220 devices in multi-port mode */
+int usb_stor_huawei_e220_init(struct us_data *us)
{
int result;

@@ -104,75 +104,3 @@ static int usb_stor_huawei_feature_init(
US_DEBUGP("Huawei mode set result is %d\n", result);
return 0;
}
-
-/*
- * It will send a scsi switch command called rewind' to huawei dongle.
- * When the dongle receives this command at the first time,
- * it will reboot immediately. After rebooted, it will ignore this command.
- * So it is unnecessary to read its response.
- */
-static int usb_stor_huawei_scsi_init(struct us_data *us)
-{
- int result = 0;
- int act_len = 0;
- struct bulk_cb_wrap *bcbw = (struct bulk_cb_wrap *) us->iobuf;
- char rewind_cmd[] = {0x11, 0x06, 0x20, 0x00, 0x00, 0x01, 0x01, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-
- bcbw->Signature = cpu_to_le32(US_BULK_CB_SIGN);
- bcbw->Tag = 0;
- bcbw->DataTransferLength = 0;
- bcbw->Flags = bcbw->Lun = 0;
- bcbw->Length = sizeof(rewind_cmd);
- memset(bcbw->CDB, 0, sizeof(bcbw->CDB));
- memcpy(bcbw->CDB, rewind_cmd, sizeof(rewind_cmd));
-
- result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe, bcbw,
- US_BULK_CB_WRAP_LEN, &act_len);
- US_DEBUGP("transfer actual length=%d, result=%d\n", act_len, result);
- return result;
-}
-
-/*
- * It tries to find the supported Huawei USB dongles.
- * In Huawei, they assign the following product IDs
- * for all of their mobile broadband dongles,
- * including the new dongles in the future.
- * So if the product ID is not included in this list,
- * it means it is not Huawei's mobile broadband dongles.
- */
-static int usb_stor_huawei_dongles_pid(struct us_data *us)
-{
- struct usb_interface_descriptor *idesc;
- int idProduct;
-
- idesc = &us->pusb_intf->cur_altsetting->desc;
- idProduct = le16_to_cpu(us->pusb_dev->descriptor.idProduct);
- /* The first port is CDROM,
- * means the dongle in the single port mode,
- * and a switch command is required to be sent. */
- if (idesc && idesc->bInterfaceNumber == 0) {
- if ((idProduct == 0x1001)
- || (idProduct == 0x1003)
- || (idProduct == 0x1004)
- || (idProduct >= 0x1401 && idProduct <= 0x1500)
- || (idProduct >= 0x1505 && idProduct <= 0x1600)
- || (idProduct >= 0x1c02 && idProduct <= 0x2202)) {
- return 1;
- }
- }
- return 0;
-}
-
-int usb_stor_huawei_init(struct us_data *us)
-{
- int result = 0;
-
- if (usb_stor_huawei_dongles_pid(us)) {
- if (le16_to_cpu(us->pusb_dev->descriptor.idProduct) >= 0x1446)
- result = usb_stor_huawei_scsi_init(us);
- else
- result = usb_stor_huawei_feature_init(us);
- }
- return result;
-}
--- a/drivers/usb/storage/initializers.h
+++ b/drivers/usb/storage/initializers.h
@@ -46,5 +46,5 @@ int usb_stor_euscsi_init(struct us_data
* flash reader */
int usb_stor_ucr61s2b_init(struct us_data *us);

-/* This places the HUAWEI usb dongles in multi-port mode */
-int usb_stor_huawei_init(struct us_data *us);
+/* This places the HUAWEI E220 devices in multi-port mode */
+int usb_stor_huawei_e220_init(struct us_data *us);
--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -1527,10 +1527,335 @@ UNUSUAL_DEV( 0x1210, 0x0003, 0x0100, 0x
/* Reported by fangxiaozhi <[email protected]>
* This brings the HUAWEI data card devices into multi-port mode
*/
-UNUSUAL_VENDOR_INTF(0x12d1, 0x08, 0x06, 0x50,
+UNUSUAL_DEV( 0x12d1, 0x1001, 0x0000, 0x0000,
"HUAWEI MOBILE",
"Mass Storage",
- USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_init,
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1003, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1004, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1401, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1402, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1403, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1404, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1405, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1406, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1407, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1408, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1409, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x140A, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x140B, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x140C, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x140D, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x140E, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x140F, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1410, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1411, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1412, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1413, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1414, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1415, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1416, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1417, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1418, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1419, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x141A, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x141B, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x141C, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x141D, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x141E, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x141F, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1420, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1421, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1422, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1423, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1424, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1425, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1426, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1427, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1428, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1429, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x142A, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x142B, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x142C, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x142D, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x142E, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x142F, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1430, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1431, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1432, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1433, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1434, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1435, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1436, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1437, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1438, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x1439, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x143A, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x143B, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x143C, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x143D, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x143E, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
+ 0),
+UNUSUAL_DEV( 0x12d1, 0x143F, 0x0000, 0x0000,
+ "HUAWEI MOBILE",
+ "Mass Storage",
+ USB_SC_DEVICE, USB_PR_DEVICE, usb_stor_huawei_e220_init,
0),

/* Reported by Vilius Bilinkevicius <vilisas AT xxx DOT lt) */

2013-03-18 21:06:36

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 07/75] usb: dwc3: core: dont forget to free coherent memory

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Felipe Balbi <[email protected]>

commit d9b4330adec006c2e8907bdcacd9dcc0e8874d18 upstream.

commit 3921426 (usb: dwc3: core: move
event buffer allocation out of
dwc3_core_init()) introduced a memory leak
of the coherent memory we use as event
buffers on dwc3 driver.

If the driver is compiled as a dynamically
loadable module and use constantly loads
and unloads the driver, we will continue
to leak the coherent memory allocated during
->probe() because dwc3_free_event_buffers()
is never called during ->remove().

Signed-off-by: Felipe Balbi <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/usb/dwc3/core.c | 1 +
1 file changed, 1 insertion(+)

--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -575,6 +575,7 @@ static int dwc3_remove(struct platform_d
break;
}

+ dwc3_free_event_buffers(dwc);
dwc3_core_exit(dwc);

return 0;

2013-03-18 22:03:08

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 10/75] usb: serial: Add Rigblaster Advantage to device table

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Steve Conklin <[email protected]>

commit a57e82a18779ab8a5e5a1f5841cef937cf578913 upstream.

The Rigblaster Advantage is an amateur radio interface sold by West Mountain
Radio. It contains a cp210x serial interface but the device ID is not in
the driver.

Signed-off-by: Steve Conklin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/usb/serial/cp210x.c | 1 +
1 file changed, 1 insertion(+)

--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -85,6 +85,7 @@ static const struct usb_device_id id_tab
{ USB_DEVICE(0x10C4, 0x813F) }, /* Tams Master Easy Control */
{ USB_DEVICE(0x10C4, 0x814A) }, /* West Mountain Radio RIGblaster P&P */
{ USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */
+ { USB_DEVICE(0x2405, 0x0003) }, /* West Mountain Radio RIGblaster Advantage */
{ USB_DEVICE(0x10C4, 0x8156) }, /* B&G H3000 link cable */
{ USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */
{ USB_DEVICE(0x10C4, 0x815F) }, /* Timewave HamLinkUSB */

2013-03-18 21:06:34

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 05/75] USB: cdc-wdm: fix buffer overflow

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Oliver Neukum <[email protected]>

commit c0f5ecee4e741667b2493c742b60b6218d40b3aa upstream.

The buffer for responses must not overflow.
If this would happen, set a flag, drop the data and return
an error after user space has read all remaining data.

Signed-off-by: Oliver Neukum <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/usb/class/cdc-wdm.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)

--- a/drivers/usb/class/cdc-wdm.c
+++ b/drivers/usb/class/cdc-wdm.c
@@ -56,6 +56,7 @@ MODULE_DEVICE_TABLE (usb, wdm_ids);
#define WDM_RESPONDING 7
#define WDM_SUSPENDING 8
#define WDM_RESETTING 9
+#define WDM_OVERFLOW 10

#define WDM_MAX 16

@@ -155,6 +156,7 @@ static void wdm_in_callback(struct urb *
{
struct wdm_device *desc = urb->context;
int status = urb->status;
+ int length = urb->actual_length;

spin_lock(&desc->iuspin);
clear_bit(WDM_RESPONDING, &desc->flags);
@@ -185,9 +187,17 @@ static void wdm_in_callback(struct urb *
}

desc->rerr = status;
- desc->reslength = urb->actual_length;
- memmove(desc->ubuf + desc->length, desc->inbuf, desc->reslength);
- desc->length += desc->reslength;
+ if (length + desc->length > desc->wMaxCommand) {
+ /* The buffer would overflow */
+ set_bit(WDM_OVERFLOW, &desc->flags);
+ } else {
+ /* we may already be in overflow */
+ if (!test_bit(WDM_OVERFLOW, &desc->flags)) {
+ memmove(desc->ubuf + desc->length, desc->inbuf, length);
+ desc->length += length;
+ desc->reslength = length;
+ }
+ }
skip_error:
wake_up(&desc->wait);

@@ -435,6 +445,11 @@ retry:
rv = -ENODEV;
goto err;
}
+ if (test_bit(WDM_OVERFLOW, &desc->flags)) {
+ clear_bit(WDM_OVERFLOW, &desc->flags);
+ rv = -ENOBUFS;
+ goto err;
+ }
i++;
if (file->f_flags & O_NONBLOCK) {
if (!test_bit(WDM_READ, &desc->flags)) {
@@ -478,6 +493,7 @@ retry:
spin_unlock_irq(&desc->iuspin);
goto retry;
}
+
if (!desc->reslength) { /* zero length read */
dev_dbg(&desc->intf->dev, "%s: zero length - clearing WDM_READ\n", __func__);
clear_bit(WDM_READ, &desc->flags);
@@ -1004,6 +1020,7 @@ static int wdm_post_reset(struct usb_int
struct wdm_device *desc = wdm_find_device(intf);
int rv;

+ clear_bit(WDM_OVERFLOW, &desc->flags);
clear_bit(WDM_RESETTING, &desc->flags);
rv = recover_from_urb_loss(desc);
mutex_unlock(&desc->wlock);

2013-03-18 22:03:36

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 09/75] USB: added support for Cinterions products AH6 and PLS8

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Christian Schmiedl <[email protected]>

commit 1941138e1c024ecb5bd797d414928d3eb94d8662 upstream.

add support for Cinterion's products AH6 and PLS8 by adding Product IDs
and USB_DEVICE tuples.

Signed-off-by: Christian Schmiedl <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/usb/serial/option.c | 4 ++++
1 file changed, 4 insertions(+)

--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -341,6 +341,8 @@ static void option_instat_callback(struc
#define CINTERION_PRODUCT_EU3_E 0x0051
#define CINTERION_PRODUCT_EU3_P 0x0052
#define CINTERION_PRODUCT_PH8 0x0053
+#define CINTERION_PRODUCT_AH6 0x0055
+#define CINTERION_PRODUCT_PLS8 0x0060

/* Olivetti products */
#define OLIVETTI_VENDOR_ID 0x0b3c
@@ -1261,6 +1263,8 @@ static const struct usb_device_id option
{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_E) },
{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_EU3_P) },
{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PH8) },
+ { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_AH6) },
+ { USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_PLS8) },
{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDM) },
{ USB_DEVICE(CINTERION_VENDOR_ID, CINTERION_PRODUCT_HC28_MDMNET) },
{ USB_DEVICE(SIEMENS_VENDOR_ID, CINTERION_PRODUCT_HC25_MDM) },

2013-03-18 22:03:57

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 08/75] usb: cp210x new Vendor/Device IDs

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: "Matwey V. Kornilov" <[email protected]>

commit be3101c23394af59694c8a2aae6d07f5da62fea5 upstream.

This patch adds support for the Lake Shore Cryotronics devices to
the CP210x driver.

These lines are ported from cp210x driver distributed by Lake Shore web site:
http://www.lakeshore.com/Documents/Lake%20Shore%20cp210x-3.0.0.tar.gz
and licensed under the terms of GPLv2.

Moreover, I've tested this changes with Lake Shore 335 in my labs.

Signed-off-by: Matwey V. Kornilov <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/usb/serial/cp210x.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -150,6 +150,25 @@ static const struct usb_device_id id_tab
{ USB_DEVICE(0x1BE3, 0x07A6) }, /* WAGO 750-923 USB Service Cable */
{ USB_DEVICE(0x1E29, 0x0102) }, /* Festo CPX-USB */
{ USB_DEVICE(0x1E29, 0x0501) }, /* Festo CMSP */
+ { USB_DEVICE(0x1FB9, 0x0100) }, /* Lake Shore Model 121 Current Source */
+ { USB_DEVICE(0x1FB9, 0x0200) }, /* Lake Shore Model 218A Temperature Monitor */
+ { USB_DEVICE(0x1FB9, 0x0201) }, /* Lake Shore Model 219 Temperature Monitor */
+ { USB_DEVICE(0x1FB9, 0x0202) }, /* Lake Shore Model 233 Temperature Transmitter */
+ { USB_DEVICE(0x1FB9, 0x0203) }, /* Lake Shore Model 235 Temperature Transmitter */
+ { USB_DEVICE(0x1FB9, 0x0300) }, /* Lake Shore Model 335 Temperature Controller */
+ { USB_DEVICE(0x1FB9, 0x0301) }, /* Lake Shore Model 336 Temperature Controller */
+ { USB_DEVICE(0x1FB9, 0x0302) }, /* Lake Shore Model 350 Temperature Controller */
+ { USB_DEVICE(0x1FB9, 0x0303) }, /* Lake Shore Model 371 AC Bridge */
+ { USB_DEVICE(0x1FB9, 0x0400) }, /* Lake Shore Model 411 Handheld Gaussmeter */
+ { USB_DEVICE(0x1FB9, 0x0401) }, /* Lake Shore Model 425 Gaussmeter */
+ { USB_DEVICE(0x1FB9, 0x0402) }, /* Lake Shore Model 455A Gaussmeter */
+ { USB_DEVICE(0x1FB9, 0x0403) }, /* Lake Shore Model 475A Gaussmeter */
+ { USB_DEVICE(0x1FB9, 0x0404) }, /* Lake Shore Model 465 Three Axis Gaussmeter */
+ { USB_DEVICE(0x1FB9, 0x0600) }, /* Lake Shore Model 625A Superconducting MPS */
+ { USB_DEVICE(0x1FB9, 0x0601) }, /* Lake Shore Model 642A Magnet Power Supply */
+ { USB_DEVICE(0x1FB9, 0x0602) }, /* Lake Shore Model 648 Magnet Power Supply */
+ { USB_DEVICE(0x1FB9, 0x0700) }, /* Lake Shore Model 737 VSM Controller */
+ { USB_DEVICE(0x1FB9, 0x0701) }, /* Lake Shore Model 776 Hall Matrix */
{ USB_DEVICE(0x3195, 0xF190) }, /* Link Instruments MSO-19 */
{ USB_DEVICE(0x3195, 0xF280) }, /* Link Instruments MSO-28 */
{ USB_DEVICE(0x3195, 0xF281) }, /* Link Instruments MSO-28 */

2013-03-18 21:06:33

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 06/75] tools: usb: ffs-test: Fix build failure

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: "Maxin B. John" <[email protected]>

commit a0f11aceee531d444f58b939e6a537ee5e2b9cc5 upstream.

Fixes this build failure:
gcc -Wall -Wextra -g -lpthread -I../include -o testusb testusb.c
gcc -Wall -Wextra -g -lpthread -I../include -o ffs-test ffs-test.c
In file included from ffs-test.c:41:0:
../../include/linux/usb/functionfs.h:4:39: fatal error:
uapi/linux/usb/functionfs.h: No such file or directory
compilation terminated.
make: *** [ffs-test] Error 1

Signed-off-by: Maxin B. John <[email protected]>
Acked-by: Michal Nazarewicz <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
tools/usb/ffs-test.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/tools/usb/ffs-test.c
+++ b/tools/usb/ffs-test.c
@@ -38,7 +38,7 @@
#include <unistd.h>
#include <tools/le_byteshift.h>

-#include "../../include/linux/usb/functionfs.h"
+#include "../../include/uapi/linux/usb/functionfs.h"


/******************** Little Endian Handling ********************************/

2013-03-18 21:06:30

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 01/75] qcaux: add Franklin U600

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Dan Williams <[email protected]>

commit 2d90e63603ac235aecd7d20e234616e0682c8b1f upstream.

4 ports; AT/PPP is standard CDC-ACM. The other three (added by this
patch) are QCDM/DIAG, possibly GPS, and unknown.

Signed-off-by: Dan Williams <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/usb/serial/qcaux.c | 1 +
1 file changed, 1 insertion(+)

--- a/drivers/usb/serial/qcaux.c
+++ b/drivers/usb/serial/qcaux.c
@@ -69,6 +69,7 @@ static struct usb_device_id id_table[] =
{ USB_VENDOR_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, 0xff, 0xfd, 0xff) }, /* NMEA */
{ USB_VENDOR_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, 0xff, 0xfe, 0xff) }, /* WMC */
{ USB_VENDOR_AND_INTERFACE_INFO(UTSTARCOM_VENDOR_ID, 0xff, 0xff, 0xff) }, /* DIAG */
+ { USB_DEVICE_AND_INTERFACE_INFO(0x1fac, 0x0151, 0xff, 0xff, 0xff) },
{ },
};
MODULE_DEVICE_TABLE(usb, id_table);

2013-03-18 22:04:56

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 04/75] USB: option: add Huawei E5331

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Bjørn Mork <[email protected]>

commit daec90e7382cbd0e73eb6861109b3da91e5ab1f3 upstream.

Another device using CDC ACM with vendor specific protocol to mark
serial functions.

Signed-off-by: Bjørn Mork <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/usb/serial/option.c | 1 +
1 file changed, 1 insertion(+)

--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -579,6 +579,7 @@ static const struct usb_device_id option
{ USB_DEVICE(QUANTA_VENDOR_ID, 0xea42),
.driver_info = (kernel_ulong_t)&net_intf4_blacklist },
{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1c05, USB_CLASS_COMM, 0x02, 0xff) },
+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1c1f, USB_CLASS_COMM, 0x02, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x1c23, USB_CLASS_COMM, 0x02, 0xff) },
{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E173, 0xff, 0xff, 0xff),
.driver_info = (kernel_ulong_t) &net_intf1_blacklist },

2013-03-18 22:05:43

by Greg Kroah-Hartman

[permalink] [raw]
Subject: [ 02/75] xen/pciback: Dont disable a PCI device that is already disabled.

3.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: Konrad Rzeszutek Wilk <[email protected]>

commit bdc5c1812cea6efe1aaefb3131fcba28cd0b2b68 upstream.

While shuting down a HVM guest with pci devices passed through we
get this:

pciback 0000:04:00.0: restoring config space at offset 0x4 (was 0x100000, writing 0x100002)
------------[ cut here ]------------
WARNING: at drivers/pci/pci.c:1397 pci_disable_device+0x88/0xa0()
Hardware name: MS-7640
Device pciback
disabling already-disabled device
Modules linked in:
Pid: 53, comm: xenwatch Not tainted 3.9.0-rc1-20130304a+ #1
Call Trace:
[<ffffffff8106994a>] warn_slowpath_common+0x7a/0xc0
[<ffffffff81069a31>] warn_slowpath_fmt+0x41/0x50
[<ffffffff813cf288>] pci_disable_device+0x88/0xa0
[<ffffffff814554a7>] xen_pcibk_reset_device+0x37/0xd0
[<ffffffff81454b6f>] ? pcistub_put_pci_dev+0x6f/0x120
[<ffffffff81454b8d>] pcistub_put_pci_dev+0x8d/0x120
[<ffffffff814582a9>] __xen_pcibk_release_devices+0x59/0xa0

This fixes the bug.

Reported-and-Tested-by: Sander Eikelenboom <[email protected]>
Signed-off-by: Konrad Rzeszutek Wilk <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
drivers/xen/xen-pciback/pciback_ops.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/xen/xen-pciback/pciback_ops.c
+++ b/drivers/xen/xen-pciback/pciback_ops.c
@@ -113,7 +113,8 @@ void xen_pcibk_reset_device(struct pci_d
if (dev->msi_enabled)
pci_disable_msi(dev);
#endif
- pci_disable_device(dev);
+ if (pci_is_enabled(dev))
+ pci_disable_device(dev);

pci_write_config_word(dev, PCI_COMMAND, 0);


2013-03-18 22:59:16

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [ 29/75] perf,x86: fix kernel crash with PEBS/BTS after suspend/resume

On Mon, Mar 18, 2013 at 10:35:27PM +0100, Stephane Eranian wrote:
> On Mon, Mar 18, 2013 at 10:20 PM, Greg Kroah-Hartman
> <[email protected]> wrote:
> > On Mon, Mar 18, 2013 at 10:11:28PM +0100, Stephane Eranian wrote:
> >> On Mon, Mar 18, 2013 at 10:06 PM, Greg Kroah-Hartman
> >> <[email protected]> wrote:
> >> > 3.8-stable review patch. If anyone has any objections, please let me know.
> >> >
> >> Greg, you also need to pick David Rientjes patch to fix compilation on
> >> non X86 architectures.
> >
> > What git commit id would that be? I thought I picked up everything that
> > was needed after this one went in, what did I miss?
> >
> Talking about this particular patch: https://lkml.org/lkml/2013/3/17/183
> Don't know if it's in already.

Yes, it is.

thanks,

greg k-h

2013-03-19 00:51:40

by Shuah Khan

[permalink] [raw]
Subject: Re: [ 00/75] 3.8.4-stable review

On Mon, Mar 18, 2013 at 3:06 PM, Greg Kroah-Hartman
<[email protected]> wrote:
> This is the start of the stable review cycle for the 3.8.4 release.
> There are 75 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 Wed Mar 20 21:04:55 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.8.4-rc1.gz
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h
>

Here is the warn from 3.8.4-rc1
[ 700.009112] Component: resume devices, time: 10004
[ 700.009204] Modules linked in: ip6table_filter ip6_tables
ebtable_nat ebtables nf_conntrack_ipv4 nf_defrag_ipv4 xt_state
nf_conntrack ipt_REJECT xt_CHECKSUM iptable_mangle xt_tcpudp
iptable_filter ip_tables x_tables bridge stp llc bnep rfcomm bluetooth
arc4 iwldvm snd_hda_codec_analog radeon snd_hda_intel mac80211
coretemp snd_hda_codec kvm_intel kvm snd_hwdep binfmt_misc snd_pcm
snd_seq_midi iwlwifi snd_rawmidi ttm snd_seq_midi_event cfg80211
drm_kms_helper pata_pcmcia snd_seq tpm_infineon drm psmouse snd_timer
joydev pcmcia snd_seq_device snd yenta_socket tpm_tis microcode
pcmcia_rsrc pcmcia_core ppdev dm_multipath i2c_algo_bit video hp_wmi
mac_hid sparse_keymap serio_raw soundcore snd_page_alloc lpc_ich wmi
hp_accel lis3lv02d input_polldev parport_pc lp parport firewire_ohci
sdhci_pci sdhci firewire_core crc_itu_t e1000e
[ 700.009212] Pid: 2637, comm: bash Not tainted 3.8.4-rc1+ #8
[ 700.009213] Call Trace:
[ 700.009225] [<ffffffff8105821f>] warn_slowpath_common+0x7f/0xc0
[ 700.009231] [<ffffffff81058316>] warn_slowpath_fmt+0x46/0x50
[ 700.009237] [<ffffffff810a3196>] suspend_test_finish+0x86/0x90
[ 700.009243] [<ffffffff810a2d3e>] suspend_devices_and_enter+0x16e/0x330
[ 700.009248] [<ffffffff810a308f>] pm_suspend+0x18f/0x1f0
[ 700.009254] [<ffffffff810a208e>] state_store+0x8e/0xf0
[ 700.009261] [<ffffffff8133218f>] kobj_attr_store+0xf/0x30
[ 700.009268] [<ffffffff811fae0f>] sysfs_write_file+0xef/0x170
[ 700.009274] [<ffffffff811879e3>] vfs_write+0xb3/0x180
[ 700.009278] [<ffffffff81187d22>] sys_write+0x52/0xa0
[ 700.009284] [<ffffffff811a4810>] ? __close_fd+0x90/0xc0
[ 700.009291] [<ffffffff816b4bd9>] system_call_fastpath+0x16/0x1b
[ 700.009294] ---[ end trace f7ca5ea4ac88428b ]---
[ 700.009728] PM: Finishing wakeup.
[ 700.009731] Restarting tasks ... done.

-- Shuah

2013-03-19 00:56:09

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [ 00/75] 3.8.4-stable review

On Mon, Mar 18, 2013 at 06:51:37PM -0600, Shuah Khan wrote:
> On Mon, Mar 18, 2013 at 3:06 PM, Greg Kroah-Hartman
> <[email protected]> wrote:
> > This is the start of the stable review cycle for the 3.8.4 release.
> > There are 75 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 Wed Mar 20 21:04:55 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.8.4-rc1.gz
> > and the diffstat can be found below.
> >
> > thanks,
> >
> > greg k-h
> >
>
> Here is the warn from 3.8.4-rc1
> [ 700.009112] Component: resume devices, time: 10004
> [ 700.009204] Modules linked in: ip6table_filter ip6_tables
> ebtable_nat ebtables nf_conntrack_ipv4 nf_defrag_ipv4 xt_state
> nf_conntrack ipt_REJECT xt_CHECKSUM iptable_mangle xt_tcpudp
> iptable_filter ip_tables x_tables bridge stp llc bnep rfcomm bluetooth
> arc4 iwldvm snd_hda_codec_analog radeon snd_hda_intel mac80211
> coretemp snd_hda_codec kvm_intel kvm snd_hwdep binfmt_misc snd_pcm
> snd_seq_midi iwlwifi snd_rawmidi ttm snd_seq_midi_event cfg80211
> drm_kms_helper pata_pcmcia snd_seq tpm_infineon drm psmouse snd_timer
> joydev pcmcia snd_seq_device snd yenta_socket tpm_tis microcode
> pcmcia_rsrc pcmcia_core ppdev dm_multipath i2c_algo_bit video hp_wmi
> mac_hid sparse_keymap serio_raw soundcore snd_page_alloc lpc_ich wmi
> hp_accel lis3lv02d input_polldev parport_pc lp parport firewire_ohci
> sdhci_pci sdhci firewire_core crc_itu_t e1000e
> [ 700.009212] Pid: 2637, comm: bash Not tainted 3.8.4-rc1+ #8

Do you get this same warning on 3.9-rc3?

I thought I got all of the needed fixes for this warning, what am I
missing here?

thanks,

greg k-h

2013-03-19 01:09:14

by Shuah Khan

[permalink] [raw]
Subject: Re: [ 00/75] 3.8.4-stable review

On Mon, Mar 18, 2013 at 6:57 PM, Greg Kroah-Hartman
<[email protected]> wrote:
> On Mon, Mar 18, 2013 at 06:51:37PM -0600, Shuah Khan wrote:
>> On Mon, Mar 18, 2013 at 3:06 PM, Greg Kroah-Hartman
>> <[email protected]> wrote:
>> > This is the start of the stable review cycle for the 3.8.4 release.
>> > There are 75 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 Wed Mar 20 21:04:55 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.8.4-rc1.gz
>> > and the diffstat can be found below.
>> >
>> > thanks,
>> >
>> > greg k-h
>> >
>>
>> Here is the warn from 3.8.4-rc1
>> [ 700.009112] Component: resume devices, time: 10004
>> [ 700.009204] Modules linked in: ip6table_filter ip6_tables
>> ebtable_nat ebtables nf_conntrack_ipv4 nf_defrag_ipv4 xt_state
>> nf_conntrack ipt_REJECT xt_CHECKSUM iptable_mangle xt_tcpudp
>> iptable_filter ip_tables x_tables bridge stp llc bnep rfcomm bluetooth
>> arc4 iwldvm snd_hda_codec_analog radeon snd_hda_intel mac80211
>> coretemp snd_hda_codec kvm_intel kvm snd_hwdep binfmt_misc snd_pcm
>> snd_seq_midi iwlwifi snd_rawmidi ttm snd_seq_midi_event cfg80211
>> drm_kms_helper pata_pcmcia snd_seq tpm_infineon drm psmouse snd_timer
>> joydev pcmcia snd_seq_device snd yenta_socket tpm_tis microcode
>> pcmcia_rsrc pcmcia_core ppdev dm_multipath i2c_algo_bit video hp_wmi
>> mac_hid sparse_keymap serio_raw soundcore snd_page_alloc lpc_ich wmi
>> hp_accel lis3lv02d input_polldev parport_pc lp parport firewire_ohci
>> sdhci_pci sdhci firewire_core crc_itu_t e1000e
>> [ 700.009212] Pid: 2637, comm: bash Not tainted 3.8.4-rc1+ #8
>
> Do you get this same warning on 3.9-rc3?
>
> I thought I got all of the needed fixes for this warning, what am I
> missing here?
>
> thanks,
>
> greg k-h

I think this is a new one. You did pull in the two patches you needed.
I am getting ready to test it in 3.9.0-rc1. Will let you know in a
bit. I have to do a git pull for the latest and do a compile.

-- Shuah

2013-03-19 01:59:06

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [ 00/75] 3.8.4-stable review

On Mon, Mar 18, 2013 at 07:09:11PM -0600, Shuah Khan wrote:
> On Mon, Mar 18, 2013 at 6:57 PM, Greg Kroah-Hartman
> <[email protected]> wrote:
> > On Mon, Mar 18, 2013 at 06:51:37PM -0600, Shuah Khan wrote:
> >> On Mon, Mar 18, 2013 at 3:06 PM, Greg Kroah-Hartman
> >> <[email protected]> wrote:
> >> > This is the start of the stable review cycle for the 3.8.4 release.
> >> > There are 75 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 Wed Mar 20 21:04:55 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.8.4-rc1.gz
> >> > and the diffstat can be found below.
> >> >
> >> > thanks,
> >> >
> >> > greg k-h
> >> >
> >>
> >> Here is the warn from 3.8.4-rc1
> >> [ 700.009112] Component: resume devices, time: 10004
> >> [ 700.009204] Modules linked in: ip6table_filter ip6_tables
> >> ebtable_nat ebtables nf_conntrack_ipv4 nf_defrag_ipv4 xt_state
> >> nf_conntrack ipt_REJECT xt_CHECKSUM iptable_mangle xt_tcpudp
> >> iptable_filter ip_tables x_tables bridge stp llc bnep rfcomm bluetooth
> >> arc4 iwldvm snd_hda_codec_analog radeon snd_hda_intel mac80211
> >> coretemp snd_hda_codec kvm_intel kvm snd_hwdep binfmt_misc snd_pcm
> >> snd_seq_midi iwlwifi snd_rawmidi ttm snd_seq_midi_event cfg80211
> >> drm_kms_helper pata_pcmcia snd_seq tpm_infineon drm psmouse snd_timer
> >> joydev pcmcia snd_seq_device snd yenta_socket tpm_tis microcode
> >> pcmcia_rsrc pcmcia_core ppdev dm_multipath i2c_algo_bit video hp_wmi
> >> mac_hid sparse_keymap serio_raw soundcore snd_page_alloc lpc_ich wmi
> >> hp_accel lis3lv02d input_polldev parport_pc lp parport firewire_ohci
> >> sdhci_pci sdhci firewire_core crc_itu_t e1000e
> >> [ 700.009212] Pid: 2637, comm: bash Not tainted 3.8.4-rc1+ #8
> >
> > Do you get this same warning on 3.9-rc3?
> >
> > I thought I got all of the needed fixes for this warning, what am I
> > missing here?
> >
> > thanks,
> >
> > greg k-h
>
> I think this is a new one. You did pull in the two patches you needed.
> I am getting ready to test it in 3.9.0-rc1. Will let you know in a
> bit. I have to do a git pull for the latest and do a compile.

Please try 3.9-rc3, -rc1 didn't have the original patch that caused the
warning to show up in it.

thanks,

greg k-h

2013-03-19 04:00:35

by Shuah Khan

[permalink] [raw]
Subject: Re: [ 00/75] 3.8.4-stable review

On Mon, Mar 18, 2013 at 8:00 PM, Greg Kroah-Hartman
<[email protected]> wrote:
> On Mon, Mar 18, 2013 at 07:09:11PM -0600, Shuah Khan wrote:
>> On Mon, Mar 18, 2013 at 6:57 PM, Greg Kroah-Hartman
>> <[email protected]> wrote:
>> > On Mon, Mar 18, 2013 at 06:51:37PM -0600, Shuah Khan wrote:
>> >> On Mon, Mar 18, 2013 at 3:06 PM, Greg Kroah-Hartman
>> >> <[email protected]> wrote:
>> >> > This is the start of the stable review cycle for the 3.8.4 release.
>> >> > There are 75 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 Wed Mar 20 21:04:55 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.8.4-rc1.gz
>> >> > and the diffstat can be found below.
>> >> >
>> >> > thanks,
>> >> >
>> >> > greg k-h
>> >> >
>> >>
>> >> Here is the warn from 3.8.4-rc1
>> >> [ 700.009112] Component: resume devices, time: 10004
>> >> [ 700.009204] Modules linked in: ip6table_filter ip6_tables
>> >> ebtable_nat ebtables nf_conntrack_ipv4 nf_defrag_ipv4 xt_state
>> >> nf_conntrack ipt_REJECT xt_CHECKSUM iptable_mangle xt_tcpudp
>> >> iptable_filter ip_tables x_tables bridge stp llc bnep rfcomm bluetooth
>> >> arc4 iwldvm snd_hda_codec_analog radeon snd_hda_intel mac80211
>> >> coretemp snd_hda_codec kvm_intel kvm snd_hwdep binfmt_misc snd_pcm
>> >> snd_seq_midi iwlwifi snd_rawmidi ttm snd_seq_midi_event cfg80211
>> >> drm_kms_helper pata_pcmcia snd_seq tpm_infineon drm psmouse snd_timer
>> >> joydev pcmcia snd_seq_device snd yenta_socket tpm_tis microcode
>> >> pcmcia_rsrc pcmcia_core ppdev dm_multipath i2c_algo_bit video hp_wmi
>> >> mac_hid sparse_keymap serio_raw soundcore snd_page_alloc lpc_ich wmi
>> >> hp_accel lis3lv02d input_polldev parport_pc lp parport firewire_ohci
>> >> sdhci_pci sdhci firewire_core crc_itu_t e1000e
>> >> [ 700.009212] Pid: 2637, comm: bash Not tainted 3.8.4-rc1+ #8
>> >
>> > Do you get this same warning on 3.9-rc3?
>> >
>> > I thought I got all of the needed fixes for this warning, what am I
>> > missing here?
>> >
>> > thanks,
>> >
>> > greg k-h
>>
>> I think this is a new one. You did pull in the two patches you needed.
>> I am getting ready to test it in 3.9.0-rc1. Will let you know in a
>> bit. I have to do a git pull for the latest and do a compile.
>
> Please try 3.9-rc3, -rc1 didn't have the original patch that caused the
> warning to show up in it.
>
> thanks,
>
> greg k-h

Seeing the same on 3.9-rc3. I reverted the three commits and re-ran
the test, still see the same warnings. From what I can tell, this
warning on my test system has nothing to do with these commits.

6c4d3bc99b3341067775efd4d9d13cc8e655fd7c
2a6e06b2aed6995af401dcd4feb5e79a0c7ea554
1d9d8639c063caf6efc2447f5f26aa637f844ff6

With this warning resolved to be an existing condition on my test
system, 3.0.70-rc1, 3.4.37-rc1, and 3.8.4-rc1 booted on both my test
systems and cross-compile tests passed. dmesgs look good and no
regressions from the previous round.

Please let me know if I should do the revert test on 3.0.70-rc1,
3.4.37-rc1, and 3.8.4-rc1. I can get to that tomorrow.

Thanks,
-- Shuah

2013-03-19 04:06:43

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [ 00/75] 3.8.4-stable review

On Mon, Mar 18, 2013 at 10:00:32PM -0600, Shuah Khan wrote:
> On Mon, Mar 18, 2013 at 8:00 PM, Greg Kroah-Hartman
> <[email protected]> wrote:
> > On Mon, Mar 18, 2013 at 07:09:11PM -0600, Shuah Khan wrote:
> >> On Mon, Mar 18, 2013 at 6:57 PM, Greg Kroah-Hartman
> >> <[email protected]> wrote:
> >> > On Mon, Mar 18, 2013 at 06:51:37PM -0600, Shuah Khan wrote:
> >> >> On Mon, Mar 18, 2013 at 3:06 PM, Greg Kroah-Hartman
> >> >> <[email protected]> wrote:
> >> >> > This is the start of the stable review cycle for the 3.8.4 release.
> >> >> > There are 75 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 Wed Mar 20 21:04:55 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.8.4-rc1.gz
> >> >> > and the diffstat can be found below.
> >> >> >
> >> >> > thanks,
> >> >> >
> >> >> > greg k-h
> >> >> >
> >> >>
> >> >> Here is the warn from 3.8.4-rc1
> >> >> [ 700.009112] Component: resume devices, time: 10004
> >> >> [ 700.009204] Modules linked in: ip6table_filter ip6_tables
> >> >> ebtable_nat ebtables nf_conntrack_ipv4 nf_defrag_ipv4 xt_state
> >> >> nf_conntrack ipt_REJECT xt_CHECKSUM iptable_mangle xt_tcpudp
> >> >> iptable_filter ip_tables x_tables bridge stp llc bnep rfcomm bluetooth
> >> >> arc4 iwldvm snd_hda_codec_analog radeon snd_hda_intel mac80211
> >> >> coretemp snd_hda_codec kvm_intel kvm snd_hwdep binfmt_misc snd_pcm
> >> >> snd_seq_midi iwlwifi snd_rawmidi ttm snd_seq_midi_event cfg80211
> >> >> drm_kms_helper pata_pcmcia snd_seq tpm_infineon drm psmouse snd_timer
> >> >> joydev pcmcia snd_seq_device snd yenta_socket tpm_tis microcode
> >> >> pcmcia_rsrc pcmcia_core ppdev dm_multipath i2c_algo_bit video hp_wmi
> >> >> mac_hid sparse_keymap serio_raw soundcore snd_page_alloc lpc_ich wmi
> >> >> hp_accel lis3lv02d input_polldev parport_pc lp parport firewire_ohci
> >> >> sdhci_pci sdhci firewire_core crc_itu_t e1000e
> >> >> [ 700.009212] Pid: 2637, comm: bash Not tainted 3.8.4-rc1+ #8
> >> >
> >> > Do you get this same warning on 3.9-rc3?
> >> >
> >> > I thought I got all of the needed fixes for this warning, what am I
> >> > missing here?
> >> >
> >> > thanks,
> >> >
> >> > greg k-h
> >>
> >> I think this is a new one. You did pull in the two patches you needed.
> >> I am getting ready to test it in 3.9.0-rc1. Will let you know in a
> >> bit. I have to do a git pull for the latest and do a compile.
> >
> > Please try 3.9-rc3, -rc1 didn't have the original patch that caused the
> > warning to show up in it.
> >
> > thanks,
> >
> > greg k-h
>
> Seeing the same on 3.9-rc3. I reverted the three commits and re-ran
> the test, still see the same warnings. From what I can tell, this
> warning on my test system has nothing to do with these commits.
>
> 6c4d3bc99b3341067775efd4d9d13cc8e655fd7c
> 2a6e06b2aed6995af401dcd4feb5e79a0c7ea554
> 1d9d8639c063caf6efc2447f5f26aa637f844ff6

Good to know, thanks for testing.

> With this warning resolved to be an existing condition on my test
> system, 3.0.70-rc1, 3.4.37-rc1, and 3.8.4-rc1 booted on both my test
> systems and cross-compile tests passed. dmesgs look good and no
> regressions from the previous round.
>
> Please let me know if I should do the revert test on 3.0.70-rc1,
> 3.4.37-rc1, and 3.8.4-rc1. I can get to that tomorrow.

Does 3.8.3 show the same warning? That would be the easiest thing to
test.

thanks,

greg k-h

2013-03-19 15:51:55

by Shuah Khan

[permalink] [raw]
Subject: Re: [ 00/75] 3.8.4-stable review

On Mon, Mar 18, 2013 at 10:07 PM, Greg Kroah-Hartman
<[email protected]> wrote:
> On Mon, Mar 18, 2013 at 10:00:32PM -0600, Shuah Khan wrote:
>> On Mon, Mar 18, 2013 at 8:00 PM, Greg Kroah-Hartman
>> <[email protected]> wrote:
>> > On Mon, Mar 18, 2013 at 07:09:11PM -0600, Shuah Khan wrote:
>> >> On Mon, Mar 18, 2013 at 6:57 PM, Greg Kroah-Hartman
>> >> <[email protected]> wrote:
>> >> > On Mon, Mar 18, 2013 at 06:51:37PM -0600, Shuah Khan wrote:
>> >> >> On Mon, Mar 18, 2013 at 3:06 PM, Greg Kroah-Hartman
>> >> >> <[email protected]> wrote:
>> >> >> > This is the start of the stable review cycle for the 3.8.4 release.
>> >> >> > There are 75 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 Wed Mar 20 21:04:55 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.8.4-rc1.gz
>> >> >> > and the diffstat can be found below.
>> >> >> >
>> >> >> > thanks,
>> >> >> >
>> >> >> > greg k-h
>> >> >> >
>> >> >>
>> >> >> Here is the warn from 3.8.4-rc1
>> >> >> [ 700.009112] Component: resume devices, time: 10004
>> >> >> [ 700.009204] Modules linked in: ip6table_filter ip6_tables
>> >> >> ebtable_nat ebtables nf_conntrack_ipv4 nf_defrag_ipv4 xt_state
>> >> >> nf_conntrack ipt_REJECT xt_CHECKSUM iptable_mangle xt_tcpudp
>> >> >> iptable_filter ip_tables x_tables bridge stp llc bnep rfcomm bluetooth
>> >> >> arc4 iwldvm snd_hda_codec_analog radeon snd_hda_intel mac80211
>> >> >> coretemp snd_hda_codec kvm_intel kvm snd_hwdep binfmt_misc snd_pcm
>> >> >> snd_seq_midi iwlwifi snd_rawmidi ttm snd_seq_midi_event cfg80211
>> >> >> drm_kms_helper pata_pcmcia snd_seq tpm_infineon drm psmouse snd_timer
>> >> >> joydev pcmcia snd_seq_device snd yenta_socket tpm_tis microcode
>> >> >> pcmcia_rsrc pcmcia_core ppdev dm_multipath i2c_algo_bit video hp_wmi
>> >> >> mac_hid sparse_keymap serio_raw soundcore snd_page_alloc lpc_ich wmi
>> >> >> hp_accel lis3lv02d input_polldev parport_pc lp parport firewire_ohci
>> >> >> sdhci_pci sdhci firewire_core crc_itu_t e1000e
>> >> >> [ 700.009212] Pid: 2637, comm: bash Not tainted 3.8.4-rc1+ #8
>> >> >
>> >> > Do you get this same warning on 3.9-rc3?
>> >> >
>> >> > I thought I got all of the needed fixes for this warning, what am I
>> >> > missing here?
>> >> >
>> >> > thanks,
>> >> >
>> >> > greg k-h
>> >>
>> >> I think this is a new one. You did pull in the two patches you needed.
>> >> I am getting ready to test it in 3.9.0-rc1. Will let you know in a
>> >> bit. I have to do a git pull for the latest and do a compile.
>> >
>> > Please try 3.9-rc3, -rc1 didn't have the original patch that caused the
>> > warning to show up in it.
>> >
>> > thanks,
>> >
>> > greg k-h
>>
>> Seeing the same on 3.9-rc3. I reverted the three commits and re-ran
>> the test, still see the same warnings. From what I can tell, this
>> warning on my test system has nothing to do with these commits.
>>
>> 6c4d3bc99b3341067775efd4d9d13cc8e655fd7c
>> 2a6e06b2aed6995af401dcd4feb5e79a0c7ea554
>> 1d9d8639c063caf6efc2447f5f26aa637f844ff6
>
> Good to know, thanks for testing.
>
>> With this warning resolved to be an existing condition on my test
>> system, 3.0.70-rc1, 3.4.37-rc1, and 3.8.4-rc1 booted on both my test
>> systems and cross-compile tests passed. dmesgs look good and no
>> regressions from the previous round.
>>
>> Please let me know if I should do the revert test on 3.0.70-rc1,
>> 3.4.37-rc1, and 3.8.4-rc1. I can get to that tomorrow.
>
> Does 3.8.3 show the same warning? That would be the easiest thing to
> test.
>
> thanks,
>
> greg k-h

Easier than I thought it would be. I thought I removed the older
releases and turns out still have them installed. 3.8.3, 3.4.36, and
3.0.69 show the the same warning after resume on my system.

-- Shuah

2013-03-19 16:25:40

by Luis Henriques

[permalink] [raw]
Subject: Re: [ 41/75] ARM: davinci: edma: fix dmaengine induced null pointer dereference on da830

On Mon, Mar 18, 2013 at 02:07:04PM -0700, Greg Kroah-Hartman wrote:
> 3.8-stable review patch. If anyone has any objections, please let me know.
>
> ------------------
>
> From: Matt Porter <[email protected]>
>
> commit 069552777a121eb39da29de4bc0383483dbe1f7e upstream.
>
> This adds additional error checking to the private edma api implementation
> to catch the case where the edma_alloc_slot() has an invalid controller
> parameter. The edma dmaengine wrapper driver relies on this condition
> being handled in order to avoid setting up a second edma dmaengine
> instance on DA830.
>
> Verfied using a DA850 with the second EDMA controller platform instance
> removed to simulate a DA830 which only has a single EDMA controller.
>
> Reported-by: Tomas Novotny <[email protected]>
> Signed-off-by: Matt Porter <[email protected]>
> Tested-by: Tomas Novotny <[email protected]>
> Signed-off-by: Sekhar Nori <[email protected]>
> Signed-off-by: Greg Kroah-Hartman <[email protected]>
>
> ---
> arch/arm/mach-davinci/dma.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> --- a/arch/arm/mach-davinci/dma.c
> +++ b/arch/arm/mach-davinci/dma.c
> @@ -743,6 +743,9 @@ EXPORT_SYMBOL(edma_free_channel);
> */
> int edma_alloc_slot(unsigned ctlr, int slot)
> {
> + if (!edma_cc[ctlr])
> + return -EINVAL;
> +
> if (slot >= 0)
> slot = EDMA_CHAN_SLOT(slot);

I couldn't figure out the reason why this is tagged for v3.7.x+ only.
Shouldn't this be applied to 3.2, 3.4 and 3.5 as well?

Cheers,
--
Luis

2013-03-19 16:34:55

by Sven Joachim

[permalink] [raw]
Subject: Re: [ 12/75] USB: EHCI: work around silicon bug in Intels EHCI controllers

On 2013-03-18 22:06 +0100, Greg Kroah-Hartman wrote:

> 3.8-stable review patch. If anyone has any objections, please let me know.

This patch breaks resume from suspend on my system if the following
device is plugged in:

,----
| $ lsusb | head -n1
| Bus 005 Device 002: ID 07d1:3c03 D-Link System AirPlus G DWL-G122 Wireless Adapter(rev.C1) [Ralink RT2571W]
`----

The same problem exists in 3.9-rc3, FWIW.

Detailed lsusb output follows, I'll be happy to provide more information
if needed.

,----
| # lsusb -s 005: -v
| Bus 005 Device 002: ID 07d1:3c03 D-Link System AirPlus G DWL-G122 Wireless Adapter(rev.C1) [Ralink RT2571W]
| Device Descriptor:
| bLength 18
| bDescriptorType 1
| bcdUSB 2.00
| bDeviceClass 0 (Defined at Interface level)
| bDeviceSubClass 0
| bDeviceProtocol 0
| bMaxPacketSize0 64
| idVendor 0x07d1 D-Link System
| idProduct 0x3c03 AirPlus G DWL-G122 Wireless Adapter(rev.C1) [Ralink RT2571W]
| bcdDevice 0.01
| iManufacturer 1 Ralink
| iProduct 2 802.11 bg WLAN
| iSerial 0
| bNumConfigurations 1
| Configuration Descriptor:
| bLength 9
| bDescriptorType 2
| wTotalLength 32
| bNumInterfaces 1
| bConfigurationValue 1
| iConfiguration 0
| bmAttributes 0x80
| (Bus Powered)
| MaxPower 300mA
| Interface Descriptor:
| bLength 9
| bDescriptorType 4
| bInterfaceNumber 0
| bAlternateSetting 0
| bNumEndpoints 2
| bInterfaceClass 255 Vendor Specific Class
| bInterfaceSubClass 255 Vendor Specific Subclass
| bInterfaceProtocol 255 Vendor Specific Protocol
| iInterface 0
| Endpoint Descriptor:
| bLength 7
| bDescriptorType 5
| bEndpointAddress 0x81 EP 1 IN
| bmAttributes 2
| Transfer Type Bulk
| Synch Type None
| Usage Type Data
| wMaxPacketSize 0x0200 1x 512 bytes
| bInterval 0
| Endpoint Descriptor:
| bLength 7
| bDescriptorType 5
| bEndpointAddress 0x01 EP 1 OUT
| bmAttributes 2
| Transfer Type Bulk
| Synch Type None
| Usage Type Data
| wMaxPacketSize 0x0200 1x 512 bytes
| bInterval 0
| Device Qualifier (for other device speed):
| bLength 10
| bDescriptorType 6
| bcdUSB 2.00
| bDeviceClass 0 (Defined at Interface level)
| bDeviceSubClass 0
| bDeviceProtocol 0
| bMaxPacketSize0 64
| bNumConfigurations 1
| Device Status: 0x0000
| (Bus Powered)
|
| Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
| Device Descriptor:
| bLength 18
| bDescriptorType 1
| bcdUSB 2.00
| bDeviceClass 9 Hub
| bDeviceSubClass 0 Unused
| bDeviceProtocol 0 Full speed (or root) hub
| bMaxPacketSize0 64
| idVendor 0x1d6b Linux Foundation
| idProduct 0x0002 2.0 root hub
| bcdDevice 3.08
| iManufacturer 3 Linux 3.8.3-nouveau ehci_hcd
| iProduct 2 EHCI Host Controller
| iSerial 1 0000:00:1d.7
| bNumConfigurations 1
| Configuration Descriptor:
| bLength 9
| bDescriptorType 2
| wTotalLength 25
| bNumInterfaces 1
| bConfigurationValue 1
| iConfiguration 0
| bmAttributes 0xe0
| Self Powered
| Remote Wakeup
| MaxPower 0mA
| Interface Descriptor:
| bLength 9
| bDescriptorType 4
| bInterfaceNumber 0
| bAlternateSetting 0
| bNumEndpoints 1
| bInterfaceClass 9 Hub
| bInterfaceSubClass 0 Unused
| bInterfaceProtocol 0 Full speed (or root) hub
| iInterface 0
| Endpoint Descriptor:
| bLength 7
| bDescriptorType 5
| bEndpointAddress 0x81 EP 1 IN
| bmAttributes 3
| Transfer Type Interrupt
| Synch Type None
| Usage Type Data
| wMaxPacketSize 0x0004 1x 4 bytes
| bInterval 12
| Hub Descriptor:
| bLength 11
| bDescriptorType 41
| nNbrPorts 8
| wHubCharacteristic 0x000a
| No power switching (usb 1.0)
| Per-port overcurrent protection
| bPwrOn2PwrGood 10 * 2 milli seconds
| bHubContrCurrent 0 milli Ampere
| DeviceRemovable 0x00 0x00
| PortPwrCtrlMask 0xff 0xff
| Hub Port Status:
| Port 1: 0000.0100 power
| Port 2: 0000.0100 power
| Port 3: 0000.0100 power
| Port 4: 0000.0100 power
| Port 5: 0000.0100 power
| Port 6: 0000.0503 highspeed power enable connect
| Port 7: 0000.0100 power
| Port 8: 0000.0100 power
| Device Status: 0x0001
| Self Powered
`----

Cheers,
Sven


> From: Alan Stern <[email protected]>
>
> commit 6402c796d3b4205d3d7296157956c5100a05d7d6 upstream.
>
> This patch (as1660) works around a hardware problem present in some
> (if not all) Intel EHCI controllers. After a QH has been unlinked
> from the async schedule and the corresponding IAA interrupt has
> occurred, the controller is not supposed access the QH and its qTDs.
> There certainly shouldn't be any more DMA writes to those structures.
> Nevertheless, Intel's controllers have been observed to perform a
> final writeback to the QH's overlay region and to the most recent qTD.
> For more information and a test program to determine whether this
> problem is present in a particular controller, see
>
> http://marc.info/?l=linux-usb&m=135492071812265&w=2
> http://marc.info/?l=linux-usb&m=136182570800963&w=2
>
> This patch works around the problem by always waiting for two IAA
> cycles when unlinking an async QH. The extra IAA delay gives the
> controller time to perform its final writeback.
>
> Surprisingly enough, the effects of this silicon bug have gone
> undetected until quite recently. More through luck than anything
> else, it hasn't caused any apparent problems. However, it does
> interact badly with the path that follows this one, so it needs to be
> addressed.
>
> This is the first part of a fix for the regression reported at:
>
> https://bugs.launchpad.net/bugs/1088733
>
> Signed-off-by: Alan Stern <[email protected]>
> Tested-by: Stephen Thirlwall <[email protected]>
> Signed-off-by: Greg Kroah-Hartman <[email protected]>
>
> ---
> drivers/usb/host/ehci-hcd.c | 6 ++----
> drivers/usb/host/ehci-q.c | 18 ++++++++++++++----
> 2 files changed, 16 insertions(+), 8 deletions(-)
>
> --- a/drivers/usb/host/ehci-hcd.c
> +++ b/drivers/usb/host/ehci-hcd.c
> @@ -748,11 +748,9 @@ static irqreturn_t ehci_irq (struct usb_
> /* guard against (alleged) silicon errata */
> if (cmd & CMD_IAAD)
> ehci_dbg(ehci, "IAA with IAAD still set?\n");
> - if (ehci->async_iaa) {
> + if (ehci->async_iaa)
> COUNT(ehci->stats.iaa);
> - end_unlink_async(ehci);
> - } else
> - ehci_dbg(ehci, "IAA with nothing unlinked?\n");
> + end_unlink_async(ehci);
> }
>
> /* remote wakeup [4.3.1] */
> --- a/drivers/usb/host/ehci-q.c
> +++ b/drivers/usb/host/ehci-q.c
> @@ -1170,7 +1170,7 @@ static void single_unlink_async(struct e
> struct ehci_qh *prev;
>
> /* Add to the end of the list of QHs waiting for the next IAAD */
> - qh->qh_state = QH_STATE_UNLINK;
> + qh->qh_state = QH_STATE_UNLINK_WAIT;
> if (ehci->async_unlink)
> ehci->async_unlink_last->unlink_next = qh;
> else
> @@ -1213,9 +1213,19 @@ static void start_iaa_cycle(struct ehci_
>
> /* Do only the first waiting QH (nVidia bug?) */
> qh = ehci->async_unlink;
> - ehci->async_iaa = qh;
> - ehci->async_unlink = qh->unlink_next;
> - qh->unlink_next = NULL;
> +
> + /*
> + * Intel (?) bug: The HC can write back the overlay region
> + * even after the IAA interrupt occurs. In self-defense,
> + * always go through two IAA cycles for each QH.
> + */
> + if (qh->qh_state == QH_STATE_UNLINK_WAIT) {
> + qh->qh_state = QH_STATE_UNLINK;
> + } else {
> + ehci->async_iaa = qh;
> + ehci->async_unlink = qh->unlink_next;
> + qh->unlink_next = NULL;
> + }
>
> /* Make sure the unlinks are all visible to the hardware */
> wmb();

2013-03-19 17:25:59

by Matt Porter

[permalink] [raw]
Subject: Re: [ 41/75] ARM: davinci: edma: fix dmaengine induced null pointer dereference on da830

On Tue, Mar 19, 2013 at 04:25:35PM +0000, Luis Henriques wrote:
> On Mon, Mar 18, 2013 at 02:07:04PM -0700, Greg Kroah-Hartman wrote:
> > 3.8-stable review patch. If anyone has any objections, please let me know.
> >
> > ------------------
> >
> > From: Matt Porter <[email protected]>
> >
> > commit 069552777a121eb39da29de4bc0383483dbe1f7e upstream.
> >
> > This adds additional error checking to the private edma api implementation
> > to catch the case where the edma_alloc_slot() has an invalid controller
> > parameter. The edma dmaengine wrapper driver relies on this condition
> > being handled in order to avoid setting up a second edma dmaengine
> > instance on DA830.
> >
> > Verfied using a DA850 with the second EDMA controller platform instance
> > removed to simulate a DA830 which only has a single EDMA controller.
> >
> > Reported-by: Tomas Novotny <[email protected]>
> > Signed-off-by: Matt Porter <[email protected]>
> > Tested-by: Tomas Novotny <[email protected]>
> > Signed-off-by: Sekhar Nori <[email protected]>
> > Signed-off-by: Greg Kroah-Hartman <[email protected]>
> >
> > ---
> > arch/arm/mach-davinci/dma.c | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > --- a/arch/arm/mach-davinci/dma.c
> > +++ b/arch/arm/mach-davinci/dma.c
> > @@ -743,6 +743,9 @@ EXPORT_SYMBOL(edma_free_channel);
> > */
> > int edma_alloc_slot(unsigned ctlr, int slot)
> > {
> > + if (!edma_cc[ctlr])
> > + return -EINVAL;
> > +
> > if (slot >= 0)
> > slot = EDMA_CHAN_SLOT(slot);
>
> I couldn't figure out the reason why this is tagged for v3.7.x+ only.
> Shouldn't this be applied to 3.2, 3.4 and 3.5 as well?

The bug being fixed is triggered by the edma dmaengine driver (and only
on one board) that was introduced in 3.7. Prior to that it is just a
theoretical bug.

-Matt

2013-03-19 18:03:42

by Stephen Warren

[permalink] [raw]
Subject: Re: [ 12/75] USB: EHCI: work around silicon bug in Intels EHCI controllers

On 03/18/2013 03:06 PM, Greg Kroah-Hartman wrote:
> 3.8-stable review patch. If anyone has any objections, please let me know.

This patch causes reboot/shutdown to fail on Tegra-based systems in 3.9-rc3.

I reported this at:

http://www.spinics.net/lists/linux-usb/msg82518.html

although there's been no discussion there yet, and I haven't had time to
investigate exactly what the problem is.

> ------------------
>
> From: Alan Stern <[email protected]>
>
> commit 6402c796d3b4205d3d7296157956c5100a05d7d6 upstream.
>
> This patch (as1660) works around a hardware problem present in some
> (if not all) Intel EHCI controllers. After a QH has been unlinked
> from the async schedule and the corresponding IAA interrupt has
> occurred, the controller is not supposed access the QH and its qTDs.
> There certainly shouldn't be any more DMA writes to those structures.
> Nevertheless, Intel's controllers have been observed to perform a
> final writeback to the QH's overlay region and to the most recent qTD.
> For more information and a test program to determine whether this
> problem is present in a particular controller, see
>
> http://marc.info/?l=linux-usb&m=135492071812265&w=2
> http://marc.info/?l=linux-usb&m=136182570800963&w=2
>
> This patch works around the problem by always waiting for two IAA
> cycles when unlinking an async QH. The extra IAA delay gives the
> controller time to perform its final writeback.
>
> Surprisingly enough, the effects of this silicon bug have gone
> undetected until quite recently. More through luck than anything
> else, it hasn't caused any apparent problems. However, it does
> interact badly with the path that follows this one, so it needs to be
> addressed.
>
> This is the first part of a fix for the regression reported at:
>
> https://bugs.launchpad.net/bugs/1088733

2013-03-19 18:17:13

by Alan Stern

[permalink] [raw]
Subject: Re: [ 12/75] USB: EHCI: work around silicon bug in Intels EHCI controllers

On Tue, 19 Mar 2013, Sven Joachim wrote:

> On 2013-03-18 22:06 +0100, Greg Kroah-Hartman wrote:
>
> > 3.8-stable review patch. If anyone has any objections, please let me know.
>
> This patch breaks resume from suspend on my system if the following
> device is plugged in:
>
> ,----
> | $ lsusb | head -n1
> | Bus 005 Device 002: ID 07d1:3c03 D-Link System AirPlus G DWL-G122 Wireless Adapter(rev.C1) [Ralink RT2571W]
> `----
>
> The same problem exists in 3.9-rc3, FWIW.
>
> Detailed lsusb output follows, I'll be happy to provide more information
> if needed.

In what way is resume broken?

Alan Stern

2013-03-19 18:25:21

by Luis Henriques

[permalink] [raw]
Subject: Re: [ 41/75] ARM: davinci: edma: fix dmaengine induced null pointer dereference on da830

On Tue, Mar 19, 2013 at 01:27:14PM -0400, Matt Porter wrote:
> On Tue, Mar 19, 2013 at 04:25:35PM +0000, Luis Henriques wrote:
> > On Mon, Mar 18, 2013 at 02:07:04PM -0700, Greg Kroah-Hartman wrote:
> > > 3.8-stable review patch. If anyone has any objections, please let me know.
> > >
> > > ------------------
> > >
> > > From: Matt Porter <[email protected]>
> > >
> > > commit 069552777a121eb39da29de4bc0383483dbe1f7e upstream.
> > >
> > > This adds additional error checking to the private edma api implementation
> > > to catch the case where the edma_alloc_slot() has an invalid controller
> > > parameter. The edma dmaengine wrapper driver relies on this condition
> > > being handled in order to avoid setting up a second edma dmaengine
> > > instance on DA830.
> > >
> > > Verfied using a DA850 with the second EDMA controller platform instance
> > > removed to simulate a DA830 which only has a single EDMA controller.
> > >
> > > Reported-by: Tomas Novotny <[email protected]>
> > > Signed-off-by: Matt Porter <[email protected]>
> > > Tested-by: Tomas Novotny <[email protected]>
> > > Signed-off-by: Sekhar Nori <[email protected]>
> > > Signed-off-by: Greg Kroah-Hartman <[email protected]>
> > >
> > > ---
> > > arch/arm/mach-davinci/dma.c | 3 +++
> > > 1 file changed, 3 insertions(+)
> > >
> > > --- a/arch/arm/mach-davinci/dma.c
> > > +++ b/arch/arm/mach-davinci/dma.c
> > > @@ -743,6 +743,9 @@ EXPORT_SYMBOL(edma_free_channel);
> > > */
> > > int edma_alloc_slot(unsigned ctlr, int slot)
> > > {
> > > + if (!edma_cc[ctlr])
> > > + return -EINVAL;
> > > +
> > > if (slot >= 0)
> > > slot = EDMA_CHAN_SLOT(slot);
> >
> > I couldn't figure out the reason why this is tagged for v3.7.x+ only.
> > Shouldn't this be applied to 3.2, 3.4 and 3.5 as well?
>
> The bug being fixed is triggered by the edma dmaengine driver (and only
> on one board) that was introduced in 3.7. Prior to that it is just a
> theoretical bug.

Great, thanks for the clarification.

Cheers,
--
Luis

2013-03-19 18:43:38

by Sven Joachim

[permalink] [raw]
Subject: Re: [ 12/75] USB: EHCI: work around silicon bug in Intels EHCI controllers

On 2013-03-19 19:17 +0100, Alan Stern wrote:

> On Tue, 19 Mar 2013, Sven Joachim wrote:
>
>> On 2013-03-18 22:06 +0100, Greg Kroah-Hartman wrote:
>>
>> > 3.8-stable review patch. If anyone has any objections, please let me know.
>>
>> This patch breaks resume from suspend on my system if the following
>> device is plugged in:
>>
>> ,----
>> | $ lsusb | head -n1
>> | Bus 005 Device 002: ID 07d1:3c03 D-Link System AirPlus G DWL-G122 Wireless Adapter(rev.C1) [Ralink RT2571W]
>> `----
>>
>> The same problem exists in 3.9-rc3, FWIW.
>>
>> Detailed lsusb output follows, I'll be happy to provide more information
>> if needed.
>
> In what way is resume broken?

The kernel comes back, but the screen is black. Manually switching VT's
is possible, and if I type something I can see it on the screen, but
there is no response and the cursor does not blink. It looks as if the
VT is not switched backed on resume, and userspace tasks are not
restarted. Sysrq combinations apparently work, but produce no output.

Cheers,
Sven

2013-03-19 20:10:12

by Alan Stern

[permalink] [raw]
Subject: Re: [ 12/75] USB: EHCI: work around silicon bug in Intels EHCI controllers

On Tue, 19 Mar 2013, Sven Joachim wrote:

> > In what way is resume broken?
>
> The kernel comes back, but the screen is black. Manually switching VT's
> is possible, and if I type something I can see it on the screen, but
> there is no response and the cursor does not blink. It looks as if the
> VT is not switched backed on resume, and userspace tasks are not
> restarted. Sysrq combinations apparently work, but produce no output.

Are there any other problems? For example, even before you do a
suspend, if you type Alt-SysRq-W do you see any processes listed?

There was another report on the linux-usb mailing list today of this
same patch causing the khubd task to hang. I'm thinking that you might
be facing a similar problem.

Alan Stern

2013-03-19 20:28:37

by Sven Joachim

[permalink] [raw]
Subject: Re: [ 12/75] USB: EHCI: work around silicon bug in Intels EHCI controllers

On 2013-03-19 21:10 +0100, Alan Stern wrote:

> On Tue, 19 Mar 2013, Sven Joachim wrote:
>
>> > In what way is resume broken?
>>
>> The kernel comes back, but the screen is black. Manually switching VT's
>> is possible, and if I type something I can see it on the screen, but
>> there is no response and the cursor does not blink. It looks as if the
>> VT is not switched backed on resume, and userspace tasks are not
>> restarted. Sysrq combinations apparently work, but produce no output.
>
> Are there any other problems? For example, even before you do a
> suspend, if you type Alt-SysRq-W do you see any processes listed?

No.

> There was another report on the linux-usb mailing list today of this
> same patch causing the khubd task to hang. I'm thinking that you might
> be facing a similar problem.

Maybe, but before the suspend everything seems to be normal.

Cheers,
Sven

2013-03-19 21:00:46

by Alan Stern

[permalink] [raw]
Subject: Re: [ 12/75] USB: EHCI: work around silicon bug in Intels EHCI controllers

On Tue, 19 Mar 2013, Sven Joachim wrote:

> On 2013-03-19 21:10 +0100, Alan Stern wrote:
>
> > On Tue, 19 Mar 2013, Sven Joachim wrote:
> >
> >> > In what way is resume broken?
> >>
> >> The kernel comes back, but the screen is black. Manually switching VT's
> >> is possible, and if I type something I can see it on the screen, but
> >> there is no response and the cursor does not blink. It looks as if the
> >> VT is not switched backed on resume, and userspace tasks are not
> >> restarted. Sysrq combinations apparently work, but produce no output.
> >
> > Are there any other problems? For example, even before you do a
> > suspend, if you type Alt-SysRq-W do you see any processes listed?
>
> No.
>
> > There was another report on the linux-usb mailing list today of this
> > same patch causing the khubd task to hang. I'm thinking that you might
> > be facing a similar problem.
>
> Maybe, but before the suspend everything seems to be normal.

Just out of curiosity, does the patch posted here:

http://marc.info/?l=linux-usb&m=136361874807411&w=2

make any difference?

Alan Stern

2013-03-19 21:49:39

by Sven Joachim

[permalink] [raw]
Subject: Re: [ 12/75] USB: EHCI: work around silicon bug in Intels EHCI controllers

On 2013-03-19 22:00 +0100, Alan Stern wrote:

> On Tue, 19 Mar 2013, Sven Joachim wrote:
>
>> On 2013-03-19 21:10 +0100, Alan Stern wrote:
>>
>> > On Tue, 19 Mar 2013, Sven Joachim wrote:
>> >
>> >> > In what way is resume broken?
>> >>
>> >> The kernel comes back, but the screen is black. Manually switching VT's
>> >> is possible, and if I type something I can see it on the screen, but
>> >> there is no response and the cursor does not blink. It looks as if the
>> >> VT is not switched backed on resume, and userspace tasks are not
>> >> restarted. Sysrq combinations apparently work, but produce no output.
>> >
>> > Are there any other problems? For example, even before you do a
>> > suspend, if you type Alt-SysRq-W do you see any processes listed?
>>
>> No.
>>
>> > There was another report on the linux-usb mailing list today of this
>> > same patch causing the khubd task to hang. I'm thinking that you might
>> > be facing a similar problem.
>>
>> Maybe, but before the suspend everything seems to be normal.
>
> Just out of curiosity, does the patch posted here:
>
> http://marc.info/?l=linux-usb&m=136361874807411&w=2
>
> make any difference?

It fixes the problem for me, thanks. :-)

Cheers,
Sven

2013-03-20 20:07:45

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [ 12/75] USB: EHCI: work around silicon bug in Intels EHCI controllers

On Tue, Mar 19, 2013 at 10:44:30PM +0100, Sven Joachim wrote:
> On 2013-03-19 22:00 +0100, Alan Stern wrote:
>
> > On Tue, 19 Mar 2013, Sven Joachim wrote:
> >
> >> On 2013-03-19 21:10 +0100, Alan Stern wrote:
> >>
> >> > On Tue, 19 Mar 2013, Sven Joachim wrote:
> >> >
> >> >> > In what way is resume broken?
> >> >>
> >> >> The kernel comes back, but the screen is black. Manually switching VT's
> >> >> is possible, and if I type something I can see it on the screen, but
> >> >> there is no response and the cursor does not blink. It looks as if the
> >> >> VT is not switched backed on resume, and userspace tasks are not
> >> >> restarted. Sysrq combinations apparently work, but produce no output.
> >> >
> >> > Are there any other problems? For example, even before you do a
> >> > suspend, if you type Alt-SysRq-W do you see any processes listed?
> >>
> >> No.
> >>
> >> > There was another report on the linux-usb mailing list today of this
> >> > same patch causing the khubd task to hang. I'm thinking that you might
> >> > be facing a similar problem.
> >>
> >> Maybe, but before the suspend everything seems to be normal.
> >
> > Just out of curiosity, does the patch posted here:
> >
> > http://marc.info/?l=linux-usb&m=136361874807411&w=2
> >
> > make any difference?
>
> It fixes the problem for me, thanks. :-)

Ok, I'll postpone this patch for the next stable release, in time for
the fix to be put in at the same time.

thanks,

greg k-h

2013-03-20 20:14:51

by Sven Joachim

[permalink] [raw]
Subject: Re: [ 12/75] USB: EHCI: work around silicon bug in Intels EHCI controllers

On 2013-03-20 21:08 +0100, Greg Kroah-Hartman wrote:

> On Tue, Mar 19, 2013 at 10:44:30PM +0100, Sven Joachim wrote:
>> On 2013-03-19 22:00 +0100, Alan Stern wrote:
>>
>> > On Tue, 19 Mar 2013, Sven Joachim wrote:
>> >
>> >> On 2013-03-19 21:10 +0100, Alan Stern wrote:
>> >>
>> >> > On Tue, 19 Mar 2013, Sven Joachim wrote:
>> >> >
>> >> >> > In what way is resume broken?
>> >> >>
>> >> >> The kernel comes back, but the screen is black. Manually switching VT's
>> >> >> is possible, and if I type something I can see it on the screen, but
>> >> >> there is no response and the cursor does not blink. It looks as if the
>> >> >> VT is not switched backed on resume, and userspace tasks are not
>> >> >> restarted. Sysrq combinations apparently work, but produce no output.
>> >> >
>> >> > Are there any other problems? For example, even before you do a
>> >> > suspend, if you type Alt-SysRq-W do you see any processes listed?
>> >>
>> >> No.
>> >>
>> >> > There was another report on the linux-usb mailing list today of this
>> >> > same patch causing the khubd task to hang. I'm thinking that you might
>> >> > be facing a similar problem.
>> >>
>> >> Maybe, but before the suspend everything seems to be normal.
>> >
>> > Just out of curiosity, does the patch posted here:
>> >
>> > http://marc.info/?l=linux-usb&m=136361874807411&w=2
>> >
>> > make any difference?
>>
>> It fixes the problem for me, thanks. :-)
>
> Ok, I'll postpone this patch for the next stable release, in time for
> the fix to be put in at the same time.

I think patch 13/75 ("USB: EHCI: dont check DMA values in QH overlays")
should also be postponed then, at least Alan said so in
<[email protected]>.

Cheers,
Sven

2013-03-20 20:26:53

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [ 12/75] USB: EHCI: work around silicon bug in Intels EHCI controllers

On Wed, Mar 20, 2013 at 09:14:38PM +0100, Sven Joachim wrote:
> On 2013-03-20 21:08 +0100, Greg Kroah-Hartman wrote:
>
> > On Tue, Mar 19, 2013 at 10:44:30PM +0100, Sven Joachim wrote:
> >> On 2013-03-19 22:00 +0100, Alan Stern wrote:
> >>
> >> > On Tue, 19 Mar 2013, Sven Joachim wrote:
> >> >
> >> >> On 2013-03-19 21:10 +0100, Alan Stern wrote:
> >> >>
> >> >> > On Tue, 19 Mar 2013, Sven Joachim wrote:
> >> >> >
> >> >> >> > In what way is resume broken?
> >> >> >>
> >> >> >> The kernel comes back, but the screen is black. Manually switching VT's
> >> >> >> is possible, and if I type something I can see it on the screen, but
> >> >> >> there is no response and the cursor does not blink. It looks as if the
> >> >> >> VT is not switched backed on resume, and userspace tasks are not
> >> >> >> restarted. Sysrq combinations apparently work, but produce no output.
> >> >> >
> >> >> > Are there any other problems? For example, even before you do a
> >> >> > suspend, if you type Alt-SysRq-W do you see any processes listed?
> >> >>
> >> >> No.
> >> >>
> >> >> > There was another report on the linux-usb mailing list today of this
> >> >> > same patch causing the khubd task to hang. I'm thinking that you might
> >> >> > be facing a similar problem.
> >> >>
> >> >> Maybe, but before the suspend everything seems to be normal.
> >> >
> >> > Just out of curiosity, does the patch posted here:
> >> >
> >> > http://marc.info/?l=linux-usb&m=136361874807411&w=2
> >> >
> >> > make any difference?
> >>
> >> It fixes the problem for me, thanks. :-)
> >
> > Ok, I'll postpone this patch for the next stable release, in time for
> > the fix to be put in at the same time.
>
> I think patch 13/75 ("USB: EHCI: dont check DMA values in QH overlays")
> should also be postponed then, at least Alan said so in
> <[email protected]>.

Crap, I didn't postpone that one, hopefully it doesn't cause as many
problems...

greg k-h

2013-03-20 20:41:24

by Alan Stern

[permalink] [raw]
Subject: Re: [ 12/75] USB: EHCI: work around silicon bug in Intels EHCI controllers

On Wed, 20 Mar 2013, Greg Kroah-Hartman wrote:

> > > Ok, I'll postpone this patch for the next stable release, in time for
> > > the fix to be put in at the same time.
> >
> > I think patch 13/75 ("USB: EHCI: dont check DMA values in QH overlays")
> > should also be postponed then, at least Alan said so in
> > <[email protected]>.
>
> Crap, I didn't postpone that one, hopefully it doesn't cause as many
> problems...

I haven't tested this combination of changes, except in a highly
artificial setting (i.e., running the usbtest suite), so I don't know
how it will behave under normal use. In any case, it's too late to do
anything now except issue another -stable release.

I just saw that the "dont check DMA values" patch did get into the
3.0-stable and 3.4-stable releases. I didn't realize at the time, but
it shouldn't be in any kernel earlier than 3.6. I guess the best thing
to do is queue up a reversion for those two series.

Alan Stern

2013-03-20 22:28:48

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [ 12/75] USB: EHCI: work around silicon bug in Intels EHCI controllers

On Wed, Mar 20, 2013 at 04:41:21PM -0400, Alan Stern wrote:
> On Wed, 20 Mar 2013, Greg Kroah-Hartman wrote:
>
> > > > Ok, I'll postpone this patch for the next stable release, in time for
> > > > the fix to be put in at the same time.
> > >
> > > I think patch 13/75 ("USB: EHCI: dont check DMA values in QH overlays")
> > > should also be postponed then, at least Alan said so in
> > > <[email protected]>.
> >
> > Crap, I didn't postpone that one, hopefully it doesn't cause as many
> > problems...
>
> I haven't tested this combination of changes, except in a highly
> artificial setting (i.e., running the usbtest suite), so I don't know
> how it will behave under normal use. In any case, it's too late to do
> anything now except issue another -stable release.
>
> I just saw that the "dont check DMA values" patch did get into the
> 3.0-stable and 3.4-stable releases. I didn't realize at the time, but
> it shouldn't be in any kernel earlier than 3.6. I guess the best thing
> to do is queue up a reversion for those two series.

I've now done this, thanks.

greg k-h

2013-03-21 14:35:34

by Alan Stern

[permalink] [raw]
Subject: Re: [ 12/75] USB: EHCI: work around silicon bug in Intels EHCI controllers

On Wed, 20 Mar 2013, Greg Kroah-Hartman wrote:

> On Wed, Mar 20, 2013 at 04:41:21PM -0400, Alan Stern wrote:
> > On Wed, 20 Mar 2013, Greg Kroah-Hartman wrote:
> >
> > > > > Ok, I'll postpone this patch for the next stable release, in time for
> > > > > the fix to be put in at the same time.
> > > >
> > > > I think patch 13/75 ("USB: EHCI: dont check DMA values in QH overlays")
> > > > should also be postponed then, at least Alan said so in
> > > > <[email protected]>.
> > >
> > > Crap, I didn't postpone that one, hopefully it doesn't cause as many
> > > problems...
> >
> > I haven't tested this combination of changes, except in a highly
> > artificial setting (i.e., running the usbtest suite), so I don't know
> > how it will behave under normal use. In any case, it's too late to do
> > anything now except issue another -stable release.
> >
> > I just saw that the "dont check DMA values" patch did get into the
> > 3.0-stable and 3.4-stable releases. I didn't realize at the time, but
> > it shouldn't be in any kernel earlier than 3.6. I guess the best thing
> > to do is queue up a reversion for those two series.
>
> I've now done this, thanks.

Sorry I didn't catch those things at the time. I should have been
looking more closely at your -stable queue.

Alan Stern

2013-03-27 15:45:57

by Ilya Tumaykin

[permalink] [raw]
Subject: Re: [ 74/75] Revert "drm/i915: enable irqs earlier when resuming"

On 18.03.13 14:07:37 Greg Kroah-Hartman wrote:
> 3.8-stable review patch. If anyone has any objections, please let me know.

Hello, Greg.

The original "drm/i915: enable irqs earlier when resuming" commit was
introduced in order to fix bug appeared in 3.8 kernels. Reverting this commit
you also bring back that bug. Bugzilla link:
https://bugzilla.kernel.org/show_bug.cgi?id=54691#c17

Sorry for late reply, I wasn't sure if this is simple revert or another
mechanism was introduced by devs to avoid mentioned bug and that fix became
unnecessary. Please undo this revert.

> ------------------
>
> This reverts commit 31f14f4219d2a74b7a6d86c7798f49141b5eccbe which was
> commit 15239099d7a7a9ecdc1ccb5b187ae4cda5488ff9 upstream.
>
> It caused problems in the 3.8-stable series, but 3.9-rc is just fine.
>
> Signed-off-by: Greg Kroah-Hartman <[email protected]>
> Cc: Chris Wilson <[email protected]>
> Cc: Mika Kuoppala <[email protected]>
> Cc: Ilya Tumaykin <[email protected]>
> Cc: Daniel Vetter <[email protected]>
>
> ---
> drivers/gpu/drm/i915/i915_drv.c | 13 +------------
> 1 file changed, 1 insertion(+), 12 deletions(-)
>
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -486,7 +486,6 @@ static int i915_drm_freeze(struct drm_de
> intel_modeset_disable(dev);
>
> drm_irq_uninstall(dev);
> - dev_priv->enable_hotplug_processing = false;
> }
>
> i915_save_state(dev);
> @@ -563,19 +562,9 @@ static int __i915_drm_thaw(struct drm_de
> error = i915_gem_init_hw(dev);
> mutex_unlock(&dev->struct_mutex);
>
> - /* We need working interrupts for modeset enabling ... */
> - drm_irq_install(dev);
> -
> intel_modeset_init_hw(dev);
> intel_modeset_setup_hw_state(dev, false);
> -
> - /*
> - * ... but also need to make sure that hotplug processing
> - * doesn't cause havoc. Like in the driver load code we don't
> - * bother with the tiny race here where we might loose hotplug
> - * notifications.
> - * */
> - dev_priv->enable_hotplug_processing = true;
> + drm_irq_install(dev);
> }
>
> intel_opregion_init(dev);
--
Best regards.
Tumaykin Ilya.

2013-03-27 16:52:18

by Daniel Vetter

[permalink] [raw]
Subject: Re: [ 74/75] Revert "drm/i915: enable irqs earlier when resuming"

On Wed, Mar 27, 2013 at 4:45 PM, Ilya Tumaykin <[email protected]> wrote:
> On 18.03.13 14:07:37 Greg Kroah-Hartman wrote:
>> 3.8-stable review patch. If anyone has any objections, please let me know.
>
> Hello, Greg.
>
> The original "drm/i915: enable irqs earlier when resuming" commit was
> introduced in order to fix bug appeared in 3.8 kernels. Reverting this commit
> you also bring back that bug. Bugzilla link:
> https://bugzilla.kernel.org/show_bug.cgi?id=54691#c17
>
> Sorry for late reply, I wasn't sure if this is simple revert or another
> mechanism was introduced by devs to avoid mentioned bug and that fix became
> unnecessary. Please undo this revert.

Nack.

This thing blew up all over the place and caused about 5 different
regressions. It works all correctly in 3.9 due to the different
context (completely revamped init sequence around irq handling).

I realize that this means that ilk rc6 is broken in 3.8 (and we can't
really fix it without either going back to the ilk rc6 code in 3.6 or
copying the entire 3.9 irq init sequence, both a bit too intrusive for
stable). But:
- ilk rc6 is known to hang machines
- ilk rc6 is (opposed to rc6 on snb+) not know to do anything good
like safe power

And so disabled by default. So I hope that regression is bearable,
feel free to beat the drm/i915 guys as usual for their failings ;-)
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch