[PATCH 07/12] PCI Hotplug: the ibm driver is not dependant on PCI_LEGACY

2008-02-14 Thread Greg Kroah-Hartman
This was marked incorrectly for some reason.  Allow the ibmphp driver to
be built even if PCI_LEGACY is not enabled.

Cc: Kristen Carlson Accardi [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]
---
 drivers/pci/hotplug/Kconfig |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/pci/hotplug/Kconfig b/drivers/pci/hotplug/Kconfig
index 17fb3d6..eacfb13 100644
--- a/drivers/pci/hotplug/Kconfig
+++ b/drivers/pci/hotplug/Kconfig
@@ -63,7 +63,7 @@ config HOTPLUG_PCI_COMPAQ_NVRAM
 
 config HOTPLUG_PCI_IBM
tristate IBM PCI Hotplug driver
-   depends on X86_IO_APIC  X86  PCI_BIOS  PCI_LEGACY
+   depends on X86_IO_APIC  X86  PCI_BIOS
help
  Say Y here if you have a motherboard with a IBM PCI Hotplug
  controller.
-- 
1.5.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 08/12] PCI: remove initial bios sort of PCI devices on x86

2008-02-14 Thread Greg Kroah-Hartman
We currently keep 2 lists of PCI devices in the system, one in the
driver core, and one all on its own.  This second list is sorted at boot
time, in BIOS order, to try to remain compatible with older kernels
(2.2 and earlier days).  There was also a nosort option to turn this
sorting off, to remain compatible with even older kernel versions, but
that just ends up being what we have been doing from 2.5 days...

Unfortunately, the second list of devices is not really ever used to
determine the probing order of PCI devices or drivers[1].  That is done
using the driver core list instead.  This change happened back in the
early 2.5 days.

Relying on BIOS ording for the binding of drivers to specific device
names is problematic for many reasons, and userspace tools like udev
exist to properly name devices in a persistant manner if that is needed,
no reliance on the BIOS is needed.

Matt Domsch and others at Dell noticed this back in 2006, and added a
boot option to sort the PCI device lists (both of them) in a
breadth-first manner to help remain compatible with the 2.4 order, if
needed for any reason.  This option is not going away, as some systems
rely on them.

This patch removes the sorting of the internal PCI device list in BIOS
mode, as it's not needed at all anymore, and hasn't for many years.
I've also removed the PCI flags for this from some other arches that for
some reason defined them, but never used them.

This should not change the ordering of any drivers or device probing.

[1] The old-style pci_get_device and pci_find_device() still used this
sorting order, but there are very few drivers that use these functions,
as they are deprecated for use in this manner.  If for some reason, a
driver rely on the order and uses these functions, the breadth-first
boot option will resolve any problem.

Cc: Matt Domsch [EMAIL PROTECTED]
Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]
---
 Documentation/kernel-parameters.txt |4 --
 arch/frv/mb93090-mb00/pci-frv.h |2 -
 arch/mn10300/unit-asb2305/pci-asb2305.h |2 -
 arch/sh/drivers/pci/pci-sh4.h   |2 -
 arch/x86/pci/common.c   |7 ---
 arch/x86/pci/pcbios.c   |   72 ---
 arch/x86/pci/pci.h  |3 -
 include/asm-sh/mpc1211/pci.h|2 -
 8 files changed, 0 insertions(+), 94 deletions(-)

diff --git a/Documentation/kernel-parameters.txt 
b/Documentation/kernel-parameters.txt
index a4fc7fc..c64dfd7 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1393,10 +1393,6 @@ and is between 256 and 4096 characters. It is defined in 
the file
nomsi   [MSI] If the PCI_MSI kernel config parameter is
enabled, this kernel boot option can be used to
disable the use of MSI interrupts system-wide.
-   nosort  [X86-32] Don't sort PCI devices according to
-   order given by the PCI BIOS. This sorting is
-   done to get a device order compatible with
-   older kernels.
biosirq [X86-32] Use PCI BIOS calls to get the interrupt
routing table. These calls are known to be buggy
on several machines and they hang the machine
diff --git a/arch/frv/mb93090-mb00/pci-frv.h b/arch/frv/mb93090-mb00/pci-frv.h
index 7481797..0c7bf39 100644
--- a/arch/frv/mb93090-mb00/pci-frv.h
+++ b/arch/frv/mb93090-mb00/pci-frv.h
@@ -17,8 +17,6 @@
 #define PCI_PROBE_BIOS 0x0001
 #define PCI_PROBE_CONF10x0002
 #define PCI_PROBE_CONF20x0004
-#define PCI_NO_SORT0x0100
-#define PCI_BIOS_SORT  0x0200
 #define PCI_NO_CHECKS  0x0400
 #define PCI_ASSIGN_ROMS0x1000
 #define PCI_BIOS_IRQ_SCAN  0x2000
diff --git a/arch/mn10300/unit-asb2305/pci-asb2305.h 
b/arch/mn10300/unit-asb2305/pci-asb2305.h
index 84634fa..9763d1c 100644
--- a/arch/mn10300/unit-asb2305/pci-asb2305.h
+++ b/arch/mn10300/unit-asb2305/pci-asb2305.h
@@ -23,8 +23,6 @@
 #define PCI_PROBE_BIOS 1
 #define PCI_PROBE_CONF1 2
 #define PCI_PROBE_CONF2 4
-#define PCI_NO_SORT 0x100
-#define PCI_BIOS_SORT 0x200
 #define PCI_NO_CHECKS 0x400
 #define PCI_ASSIGN_ROMS 0x1000
 #define PCI_BIOS_IRQ_SCAN 0x2000
diff --git a/arch/sh/drivers/pci/pci-sh4.h b/arch/sh/drivers/pci/pci-sh4.h
index 4925c79..5f43bc9 100644
--- a/arch/sh/drivers/pci/pci-sh4.h
+++ b/arch/sh/drivers/pci/pci-sh4.h
@@ -15,8 +15,6 @@
 #define PCI_PROBE_BIOS 1
 #define PCI_PROBE_CONF12
 #define PCI_PROBE_CONF24
-#define PCI_NO_SORT0x100
-#define PCI_BIOS_SORT  0x200
 #define PCI_NO_CHECKS  0x400
 #define PCI_ASSIGN_ROMS0x1000
 #define PCI_BIOS_IRQ_SCAN  0x2000
diff --git a/arch/x86/pci

[PATCH 09/12] PCI: make no_pci_devices() use the pci_bus_type list

2008-02-14 Thread Greg Kroah-Hartman
no_pci_devices() should use the driver core list of PCI devices, not our
separate one.

Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]
---
 drivers/pci/probe.c |   17 ++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 4d23b9f..5fd662e 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -22,16 +22,27 @@ EXPORT_SYMBOL(pci_root_buses);
 
 LIST_HEAD(pci_devices);
 
+
+static int find_anything(struct device *dev, void *data)
+{
+   return 1;
+}
+
 /*
  * Some device drivers need know if pci is initiated.
  * Basically, we think pci is not initiated when there
- * is no device in list of pci_devices.
+ * is no device to be found on the pci_bus_type.
  */
 int no_pci_devices(void)
 {
-   return list_empty(pci_devices);
-}
+   struct device *dev;
+   int no_devices;
 
+   dev = bus_find_device(pci_bus_type, NULL, NULL, find_anything);
+   no_devices = (dev == NULL);
+   put_device(dev);
+   return no_devices;
+}
 EXPORT_SYMBOL(no_pci_devices);
 
 #ifdef HAVE_PCI_LEGACY
-- 
1.5.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 10/12] PCI: add is_added flag to struct pci_dev

2008-02-14 Thread Greg Kroah-Hartman
This lets us check if the device is really added to the driver core or
not, which is what we need when walking some of the bus lists.  The flag
is there in anticipation of getting rid of the other PCI device list,
which is what we used to check in this situation.

Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]
---
 arch/powerpc/platforms/pseries/pci_dlpar.c |7 ++-
 drivers/pci/bus.c  |   11 ---
 drivers/pci/probe.c|2 +-
 drivers/pci/remove.c   |6 ++
 include/linux/pci.h|1 +
 5 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/pci_dlpar.c 
b/arch/powerpc/platforms/pseries/pci_dlpar.c
index 5a5a19e..d26a7bc 100644
--- a/arch/powerpc/platforms/pseries/pci_dlpar.c
+++ b/arch/powerpc/platforms/pseries/pci_dlpar.c
@@ -88,11 +88,8 @@ pcibios_fixup_new_pci_devices(struct pci_bus *bus)
struct pci_dev *dev;
 
list_for_each_entry(dev, bus-devices, bus_list) {
-   /*
-* Skip already-present devices (which are on the
-* global device list.)
-*/
-   if (list_empty(dev-global_list)) {
+   /* Skip already-added devices */
+   if (!dev-is_added) {
int i;
 
/* Fill device archdata and setup iommu table */
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c
index ef5a6a2..f2eae65 100644
--- a/drivers/pci/bus.c
+++ b/drivers/pci/bus.c
@@ -84,6 +84,7 @@ int pci_bus_add_device(struct pci_dev *dev)
if (retval)
return retval;
 
+   dev-is_added = 1;
down_write(pci_bus_sem);
list_add_tail(dev-global_list, pci_devices);
up_write(pci_bus_sem);
@@ -112,11 +113,8 @@ void pci_bus_add_devices(struct pci_bus *bus)
int retval;
 
list_for_each_entry(dev, bus-devices, bus_list) {
-   /*
-* Skip already-present devices (which are on the
-* global device list.)
-*/
-   if (!list_empty(dev-global_list))
+   /* Skip already-added devices */
+   if (dev-is_added)
continue;
retval = pci_bus_add_device(dev);
if (retval)
@@ -124,8 +122,7 @@ void pci_bus_add_devices(struct pci_bus *bus)
}
 
list_for_each_entry(dev, bus-devices, bus_list) {
-
-   BUG_ON(list_empty(dev-global_list));
+   BUG_ON(!dev-is_added);
 
/*
 * If there is an unattached subordinate bus, attach
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 5fd662e..7a1efc1 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -984,7 +984,7 @@ EXPORT_SYMBOL(pci_scan_single_device);
  *
  * Scan a PCI slot on the specified PCI bus for devices, adding
  * discovered devices to the @bus-devices list.  New devices
- * will have an empty dev-global_list head.
+ * will not have is_added set.
  */
 int pci_scan_slot(struct pci_bus *bus, int devfn)
 {
diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c
index 9684e1b..d3c77cb 100644
--- a/drivers/pci/remove.c
+++ b/drivers/pci/remove.c
@@ -18,13 +18,11 @@ static void pci_free_resources(struct pci_dev *dev)
 
 static void pci_stop_dev(struct pci_dev *dev)
 {
-   if (!dev-global_list.next)
-   return;
-
-   if (!list_empty(dev-global_list)) {
+   if (dev-is_added) {
pci_proc_detach_device(dev);
pci_remove_sysfs_dev_files(dev);
device_unregister(dev-dev);
+   dev-is_added = 0;
down_write(pci_bus_sem);
list_del(dev-global_list);
dev-global_list.next = dev-global_list.prev = NULL;
diff --git a/include/linux/pci.h b/include/linux/pci.h
index a38c855..b567d37 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -181,6 +181,7 @@ struct pci_dev {
unsigned inttransparent:1;  /* Transparent PCI bridge */
unsigned intmultifunction:1;/* Part of multi-function device */
/* keep track of device state */
+   unsigned intis_added:1;
unsigned intis_busmaster:1; /* device is busmaster */
unsigned intno_msi:1;   /* device may not use msi */
unsigned intno_d1d2:1;   /* only allow d0 or d3 */
-- 
1.5.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 11/12] PCI: remove pcibious_fixup_ghosts()

2008-02-14 Thread Greg Kroah-Hartman
This function was obviously never being used since early 2.5 days as any
device that it would try to remove would never really be removed from
the system due to the PCI device list being held in the driver core, not
the general list of PCI devices.

As we have not had a single report of a problem here in 4 years, I think
it's safe to remove now.

Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]
---
 arch/frv/mb93090-mb00/pci-vdk.c |   53 --
 arch/x86/pci/common.c   |   54 ---
 2 files changed, 0 insertions(+), 107 deletions(-)

diff --git a/arch/frv/mb93090-mb00/pci-vdk.c b/arch/frv/mb93090-mb00/pci-vdk.c
index 6d51f13..f003cfa 100644
--- a/arch/frv/mb93090-mb00/pci-vdk.c
+++ b/arch/frv/mb93090-mb00/pci-vdk.c
@@ -199,58 +199,6 @@ static struct pci_ops * __init pci_check_direct(void)
 }
 
 /*
- * Several buggy motherboards address only 16 devices and mirror
- * them to next 16 IDs. We try to detect this `feature' on all
- * primary buses (those containing host bridges as they are
- * expected to be unique) and remove the ghost devices.
- */
-
-static void __init pcibios_fixup_ghosts(struct pci_bus *b)
-{
-   struct list_head *ln, *mn;
-   struct pci_dev *d, *e;
-   int mirror = PCI_DEVFN(16,0);
-   int seen_host_bridge = 0;
-   int i;
-
-   for (ln=b-devices.next; ln != b-devices; ln=ln-next) {
-   d = pci_dev_b(ln);
-   if ((d-class  8) == PCI_CLASS_BRIDGE_HOST)
-   seen_host_bridge++;
-   for (mn=ln-next; mn != b-devices; mn=mn-next) {
-   e = pci_dev_b(mn);
-   if (e-devfn != d-devfn + mirror ||
-   e-vendor != d-vendor ||
-   e-device != d-device ||
-   e-class != d-class)
-   continue;
-   for(i=0; iPCI_NUM_RESOURCES; i++)
-   if (e-resource[i].start != 
d-resource[i].start ||
-   e-resource[i].end != d-resource[i].end ||
-   e-resource[i].flags != 
d-resource[i].flags)
-   continue;
-   break;
-   }
-   if (mn == b-devices)
-   return;
-   }
-   if (!seen_host_bridge)
-   return;
-   printk(PCI: Ignoring ghost devices on bus %02x\n, b-number);
-
-   ln = b-devices;
-   while (ln-next != b-devices) {
-   d = pci_dev_b(ln-next);
-   if (d-devfn = mirror) {
-   list_del(d-global_list);
-   list_del(d-bus_list);
-   kfree(d);
-   } else
-   ln = ln-next;
-   }
-}
-
-/*
  * Discover remaining PCI buses in case there are peer host bridges.
  * We use the number of last PCI bus provided by the PCI BIOS.
  */
@@ -356,7 +304,6 @@ void __init pcibios_fixup_bus(struct pci_bus *bus)
 #if 0
printk(### PCIBIOS_FIXUP_BUS(%d)\n,bus-number);
 #endif
-   pcibios_fixup_ghosts(bus);
pci_read_bridge_bases(bus);
 
if (bus-number == 0) {
diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c
index a67c1fe..86430d1 100644
--- a/arch/x86/pci/common.c
+++ b/arch/x86/pci/common.c
@@ -77,59 +77,6 @@ int pcibios_scanned;
  */
 DEFINE_SPINLOCK(pci_config_lock);
 
-/*
- * Several buggy motherboards address only 16 devices and mirror
- * them to next 16 IDs. We try to detect this `feature' on all
- * primary buses (those containing host bridges as they are
- * expected to be unique) and remove the ghost devices.
- */
-
-static void __devinit pcibios_fixup_ghosts(struct pci_bus *b)
-{
-   struct list_head *ln, *mn;
-   struct pci_dev *d, *e;
-   int mirror = PCI_DEVFN(16,0);
-   int seen_host_bridge = 0;
-   int i;
-
-   DBG(PCI: Scanning for ghost devices on bus %d\n, b-number);
-   list_for_each(ln, b-devices) {
-   d = pci_dev_b(ln);
-   if ((d-class  8) == PCI_CLASS_BRIDGE_HOST)
-   seen_host_bridge++;
-   for (mn=ln-next; mn != b-devices; mn=mn-next) {
-   e = pci_dev_b(mn);
-   if (e-devfn != d-devfn + mirror ||
-   e-vendor != d-vendor ||
-   e-device != d-device ||
-   e-class != d-class)
-   continue;
-   for(i=0; iPCI_NUM_RESOURCES; i++)
-   if (e-resource[i].start != 
d-resource[i].start ||
-   e-resource[i].end != d-resource[i].end ||
-   e-resource[i].flags != 
d-resource[i].flags)
-   continue;
-   break;
-   }
-   if (mn

[PATCH 12/12] PCI: remove global list of PCI devices

2008-02-14 Thread Greg Kroah-Hartman
This patch finally removes the global list of PCI devices.  We are
relying entirely on the list held in the driver core now, and do not
need a separate shadow list as no one uses it.

Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED]
---
 drivers/pci/bus.c|4 
 drivers/pci/probe.c  |   39 +--
 drivers/pci/remove.c |4 
 include/linux/pci.h  |3 ---
 4 files changed, 1 insertions(+), 49 deletions(-)

diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c
index f2eae65..2a3ad5d 100644
--- a/drivers/pci/bus.c
+++ b/drivers/pci/bus.c
@@ -85,10 +85,6 @@ int pci_bus_add_device(struct pci_dev *dev)
return retval;
 
dev-is_added = 1;
-   down_write(pci_bus_sem);
-   list_add_tail(dev-global_list, pci_devices);
-   up_write(pci_bus_sem);
-
pci_proc_attach_device(dev);
pci_create_sysfs_dev_files(dev);
return 0;
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 7a1efc1..1076876 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -20,8 +20,6 @@
 LIST_HEAD(pci_root_buses);
 EXPORT_SYMBOL(pci_root_buses);
 
-LIST_HEAD(pci_devices);
-
 
 static int find_anything(struct device *dev, void *data)
 {
@@ -860,7 +858,6 @@ struct pci_dev *alloc_pci_dev(void)
if (!dev)
return NULL;
 
-   INIT_LIST_HEAD(dev-global_list);
INIT_LIST_HEAD(dev-bus_list);
 
pci_msi_init_pci_dev(dev);
@@ -957,7 +954,6 @@ void pci_device_add(struct pci_dev *dev, struct pci_bus 
*bus)
 * Add the device to our list of discovered devices
 * and the bus list for fixup functions, etc.
 */
-   INIT_LIST_HEAD(dev-global_list);
down_write(pci_bus_sem);
list_add_tail(dev-bus_list, bus-devices);
up_write(pci_bus_sem);
@@ -1186,7 +1182,7 @@ static void __init pci_insertion_sort_klist(struct 
pci_dev *a, struct list_head
list_move_tail(a-dev.knode_bus.n_node, list);
 }
 
-static void __init pci_sort_breadthfirst_klist(void)
+void __init pci_sort_breadthfirst(void)
 {
LIST_HEAD(sorted_devices);
struct list_head *pos, *tmp;
@@ -1207,36 +1203,3 @@ static void __init pci_sort_breadthfirst_klist(void)
list_splice(sorted_devices, device_klist-k_list);
spin_unlock(device_klist-k_lock);
 }
-
-static void __init pci_insertion_sort_devices(struct pci_dev *a, struct 
list_head *list)
-{
-   struct pci_dev *b;
-
-   list_for_each_entry(b, list, global_list) {
-   if (pci_sort_bf_cmp(a, b) = 0) {
-   list_move_tail(a-global_list, b-global_list);
-   return;
-   }
-   }
-   list_move_tail(a-global_list, list);
-}
-
-static void __init pci_sort_breadthfirst_devices(void)
-{
-   LIST_HEAD(sorted_devices);
-   struct pci_dev *dev, *tmp;
-
-   down_write(pci_bus_sem);
-   list_for_each_entry_safe(dev, tmp, pci_devices, global_list) {
-   pci_insertion_sort_devices(dev, sorted_devices);
-   }
-   list_splice(sorted_devices, pci_devices);
-   up_write(pci_bus_sem);
-}
-
-void __init pci_sort_breadthfirst(void)
-{
-   pci_sort_breadthfirst_devices();
-   pci_sort_breadthfirst_klist();
-}
-
diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c
index d3c77cb..b682483 100644
--- a/drivers/pci/remove.c
+++ b/drivers/pci/remove.c
@@ -23,10 +23,6 @@ static void pci_stop_dev(struct pci_dev *dev)
pci_remove_sysfs_dev_files(dev);
device_unregister(dev-dev);
dev-is_added = 0;
-   down_write(pci_bus_sem);
-   list_del(dev-global_list);
-   dev-global_list.next = dev-global_list.prev = NULL;
-   up_write(pci_bus_sem);
}
 }
 
diff --git a/include/linux/pci.h b/include/linux/pci.h
index b567d37..511edbf 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -132,7 +132,6 @@ struct pci_cap_saved_state {
  * The pci_dev structure is used to describe PCI devices.
  */
 struct pci_dev {
-   struct list_head global_list;   /* node in list of all PCI devices */
struct list_head bus_list;  /* node in per-bus list */
struct pci_bus  *bus;   /* bus this device is on */
struct pci_bus  *subordinate;   /* bus this device bridges to */
@@ -206,7 +205,6 @@ struct pci_dev {
 
 extern struct pci_dev *alloc_pci_dev(void);
 
-#define pci_dev_g(n) list_entry(n, struct pci_dev, global_list)
 #define pci_dev_b(n) list_entry(n, struct pci_dev, bus_list)
 #defineto_pci_dev(n) container_of(n, struct pci_dev, dev)
 #define for_each_pci_dev(d) while ((d = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, 
d)) != NULL)
@@ -439,7 +437,6 @@ extern struct bus_type pci_bus_type;
 /* Do NOT directly access these two variables, unless you are arch specific pci
  * code, or pci core code. */
 extern struct list_head pci_root_buses;/* list of all known PCI buses 
*/
-extern struct

[ 000/101] 3.6.5-stable review

2012-10-29 Thread Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.6.5 release.
There are 101 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 Oct 31 21:31:45 UTC 2012.
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.6.5-rc1.gz
and the diffstat can be found below.

thanks,

greg k-h

-
Pseudo-Shortlog of commits:

Greg Kroah-Hartman gre...@linuxfoundation.org
Linux 3.6.5-rc1

Peng Tao bergw...@gmail.com
pnfsblock: fix non-aligned DIO write

Peng Tao bergw...@gmail.com
pnfsblock: fix non-aligned DIO read

Yinghai Lu ying...@kernel.org
x86, mm: Use memblock memory loop instead of e820_RAM

Olof Johansson o...@lixom.net
x86: efi: Turn off efi_enabled after setup on mixed fw/kernel

Josh Triplett j...@joshtriplett.org
efi: Defer freeing boot services memory until after ACPI init

Stanislaw Gruszka sgrus...@redhat.com
cfg80211/mac80211: avoid state mishmash on deauth

Yinghai Lu ying...@kernel.org
x86, mm: Undo incorrect revert in arch/x86/mm/init.c

Jacob Shin jacob.s...@amd.com
x86, mm: Find_early_table_space based on ranges that are actually being 
mapped

Felix Fietkau n...@openwrt.org
Revert ath9k_hw: Updated AR9003 tx gain table for 5GHz

Andreas Herrmann andreas.herrma...@amd.com
cpufreq / powernow-k8: Remove usage of smp_processor_id() in preemptible 
code

Stanislav Yakovlev stas.yakov...@gmail.com
net/wireless: ipw2200: Fix panic occurring in ipw_handle_promiscuous_tx()

Piotr Haber pha...@broadcom.com
bcma: fix unregistration of cores

Johannes Berg johannes.b...@intel.com
iwlwifi: fix 6000 series channel switch command

Wei Yongjun yongjun_...@trendmicro.com.cn
dmaengine: imx-dma: fix missing unlock on error in imxdma_xfer_desc()

Barry Song baohua.s...@csr.com
dmaengine: sirf: fix a typo in moving running dma_desc to active queue

Barry Song baohua.s...@csr.com
dmaengine: sirf: fix a typo in dma_prep_interleaved

Oleg Nesterov o...@redhat.com
freezer: exec should clear PF_NOFREEZE along with PF_KTHREAD

Dan Williams d...@redhat.com
qmi_wwan/cdc_ether: move Novatel 551 and E362 to qmi_wwan

Johan Hedberg johan.hedb...@intel.com
Bluetooth: SMP: Fix setting unknown auth_req bits

Chris Metcalf cmetc...@tilera.com
tilegx: fix some issues in the SW TSO support

Larry Finger larry.fin...@lwfinger.net
b43: Fix oops on unload when firmware not found

Felix Fietkau n...@openwrt.org
mac80211: use ieee80211_free_txskb in a few more places

Stanislaw Gruszka sgrus...@redhat.com
mac80211: check if key has TKIP type before updating IV

Johannes Berg johannes.b...@intel.com
mac80211: connect with HT20 if HT40 is not permitted

Nicolas Ferre nicolas.fe...@atmel.com
ARM: at91: fix external interrupt specification in board code

Nicolas Ferre nicolas.fe...@atmel.com
ARM: at91: fix external interrupts in non-DT case

Ivan Shugov ivan.shu...@gmail.com
ARM: at91: at91sam9g10: fix SOC type detection

Bo Shen voice.s...@atmel.com
ARM: at91/i2c: change id to let i2c-gpio work

Josh Wu josh...@atmel.com
ARM: at91/tc: fix typo in the DT document

Heiko Stuebner he...@sntech.de
ARM: SAMSUNG: Add naming of s3c64xx-spi devices

Michael S. Tsirkin m...@redhat.com
vhost: fix mergeable bufs on BE hosts

Johan Hovold jhov...@gmail.com
USB: mos7840: remove invalid disconnect handling

Johan Hovold jhov...@gmail.com
USB: mos7840: remove NULL-urb submission

Johan Hovold jhov...@gmail.com
USB: mos7840: fix port-device leak in error path

Johan Hovold jhov...@gmail.com
USB: mos7840: fix urb leak at release

Johan Hovold jhov...@gmail.com
USB: sierra: fix port-data memory leak

Johan Hovold jhov...@gmail.com
USB: sierra: fix memory leak in probe error path

Johan Hovold jhov...@gmail.com
USB: sierra: fix memory leak in attach error path

Lennart Sorensen lsore...@csclub.uwaterloo.ca
USB: serial: Fix memory leak in sierra_release()

Johan Hovold jhov...@gmail.com
USB: quatech2: fix io after disconnect

Johan Hovold jhov...@gmail.com
USB: quatech2: fix close and disconnect urb handling

Johan Hovold jhov...@gmail.com
USB: quatech2: fix port-data memory leaks

Johan Hovold jhov...@gmail.com
USB: quatech2: fix memory leak in error path

Johan Hovold jhov...@gmail.com
USB: mos7720: fix port-data memory leak

Johan Hovold jhov...@gmail.com
USB: metro-usb: fix io after disconnect

Johan Hovold jhov...@gmail.com
USB: metro-usb: fix port-data memory leak

Johan Hovold jhov...@gmail.com
USB: opticon: fix memory leak in error path

Johan Hovold jhov...@gmail.com
USB: opticon: fix DMA from stack

Johan Hovold jhov...@gmail.com
USB: whiteheat: fix port-data memory leak

Johan Hovold jhov...@gmail.com
USB

[ 001/101] drm/radeon: add some new SI PCI ids

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Alex Deucher alexander.deuc...@amd.com

commit b6aa22db7857ab7ed042d6c56b800bfc727cfdff upstream.

Signed-off-by: Alex Deucher alexander.deuc...@amd.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 include/drm/drm_pciids.h |3 +++
 1 file changed, 3 insertions(+)

--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -205,6 +205,8 @@
{0x1002, 0x6788, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
{0x1002, 0x678A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
{0x1002, 0x6790, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
+   {0x1002, 0x6791, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
+   {0x1002, 0x6792, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
{0x1002, 0x6798, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
{0x1002, 0x6799, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
{0x1002, 0x679A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
@@ -217,6 +219,7 @@
{0x1002, 0x6808, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \
{0x1002, 0x6809, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \
{0x1002, 0x6810, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \
+   {0x1002, 0x6811, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \
{0x1002, 0x6816, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \
{0x1002, 0x6817, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \
{0x1002, 0x6818, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 002/101] drm/radeon: add error output if VM CS fails on cayman

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Alex Deucher alexander.deuc...@amd.com

commit c71721324c612f7f040657ce9917d87f530f9784 upstream.

So we know why the CS was rejected.

Signed-off-by: Alex Deucher alexander.deuc...@amd.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/gpu/drm/radeon/evergreen_cs.c |1 +
 1 file changed, 1 insertion(+)

--- a/drivers/gpu/drm/radeon/evergreen_cs.c
+++ b/drivers/gpu/drm/radeon/evergreen_cs.c
@@ -2829,6 +2829,7 @@ static bool evergreen_vm_reg_valid(u32 r
case CAYMAN_SQ_EX_ALLOC_TABLE_SLOTS:
return true;
default:
+   DRM_ERROR(Invalid register 0x%x in CS\n, reg);
return false;
}
 }


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 011/101] x86-64: Fix page table accounting

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Jan Beulich jbeul...@suse.com

commit 876ee61aadf01aa0db981b5d249cbdd53dc28b5e upstream.

Commit 20167d3421a089a1bf1bd680b150dc69c9506810 (x86-64: Fix
accounting in kernel_physical_mapping_init()) went a little too
far by entirely removing the counting of pre-populated page
tables: this should be done at boot time (to cover the page
tables set up in early boot code), but shouldn't be done during
memory hot add.

Hence, re-add the removed increments of pages, but make them
and the one in phys_pte_init() conditional upon !after_bootmem.

Reported-Acked-and-Tested-by: Hugh Dickins hu...@google.com
Signed-off-by: Jan Beulich jbeul...@suse.com
Link: http://lkml.kernel.org/r/506dafba02780009f...@nat28.tlf.novell.com
Signed-off-by: Ingo Molnar mi...@kernel.org
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 arch/x86/mm/init_64.c |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -386,7 +386,8 @@ phys_pte_init(pte_t *pte_page, unsigned
 * these mappings are more intelligent.
 */
if (pte_val(*pte)) {
-   pages++;
+   if (!after_bootmem)
+   pages++;
continue;
}
 
@@ -451,6 +452,8 @@ phys_pmd_init(pmd_t *pmd_page, unsigned
 * attributes.
 */
if (page_size_mask  (1  PG_LEVEL_2M)) {
+   if (!after_bootmem)
+   pages++;
last_map_addr = next;
continue;
}
@@ -526,6 +529,8 @@ phys_pud_init(pud_t *pud_page, unsigned
 * attributes.
 */
if (page_size_mask  (1  PG_LEVEL_1G)) {
+   if (!after_bootmem)
+   pages++;
last_map_addr = next;
continue;
}


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 019/101] SUNRPC: Prevent races in xs_abort_connection()

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Trond Myklebust trond.mykleb...@netapp.com

commit 4bc1e68ed6a8b59be8a79eb719be515a55c7bc68 upstream.

The call to xprt_disconnect_done() that is triggered by a successful
connection reset will trigger another automatic wakeup of all tasks
on the xprt-pending rpc_wait_queue. In particular it will cause an
early wake up of the task that called xprt_connect().

All we really want to do here is clear all the socket-specific state
flags, so we split that functionality out of xs_sock_mark_closed()
into a helper that can be called by xs_abort_connection()

Reported-by: Chris Perl chris.p...@gmail.com
Signed-off-by: Trond Myklebust trond.mykleb...@netapp.com
Tested-by: Chris Perl chris.p...@gmail.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 net/sunrpc/xprtsock.c |   13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1459,7 +1459,7 @@ static void xs_tcp_cancel_linger_timeout
xprt_clear_connecting(xprt);
 }
 
-static void xs_sock_mark_closed(struct rpc_xprt *xprt)
+static void xs_sock_reset_connection_flags(struct rpc_xprt *xprt)
 {
smp_mb__before_clear_bit();
clear_bit(XPRT_CONNECTION_ABORT, xprt-state);
@@ -1467,6 +1467,11 @@ static void xs_sock_mark_closed(struct r
clear_bit(XPRT_CLOSE_WAIT, xprt-state);
clear_bit(XPRT_CLOSING, xprt-state);
smp_mb__after_clear_bit();
+}
+
+static void xs_sock_mark_closed(struct rpc_xprt *xprt)
+{
+   xs_sock_reset_connection_flags(xprt);
/* Mark transport as closed and wake up all pending tasks */
xprt_disconnect_done(xprt);
 }
@@ -2042,10 +2047,8 @@ static void xs_abort_connection(struct s
any.sa_family = AF_UNSPEC;
result = kernel_connect(transport-sock, any, sizeof(any), 0);
if (!result)
-   xs_sock_mark_closed(transport-xprt);
-   else
-   dprintk(RPC:   AF_UNSPEC connect return code %d\n,
-   result);
+   xs_sock_reset_connection_flags(transport-xprt);
+   dprintk(RPC:   AF_UNSPEC connect return code %d\n, result);
 }
 
 static void xs_tcp_reuse_connection(struct sock_xprt *transport)


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 027/101] staging: zram: Fix handling of incompressible pages

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Nitin Gupta ngu...@vflare.org

commit c8f2f0db1d0294aaf37e8a85bea9bbc4aaf5c0fe upstream.

Change 130f315a (staging: zram: remove special handle of uncompressed page)
introduced a bug in the handling of incompressible pages which resulted in
memory allocation failure for such pages.

When a page expands on compression, say from 4K to 4K+30, we were trying to
do zsmalloc(pool, 4K+30). However, the maximum size which zsmalloc can
allocate is PAGE_SIZE (for obvious reasons), so such allocation requests
always return failure (0).

For a page that has compressed size larger than the original size (this may
happen with already compressed or random data), there is no point storing
the compressed version as that would take more space and would also require
time for decompression when needed again. So, the fix is to store any page,
whose compressed size exceeds a threshold (max_zpage_size), as-it-is i.e.
without compression.  Memory required for storing this uncompressed page can
then be requested from zsmalloc which supports PAGE_SIZE sized allocations.

Lastly, the fix checks that we do not attempt to decompress the page which
we stored in the uncompressed form -- we just memcpy() out such pages.

Signed-off-by: Nitin Gupta ngu...@vflare.org
Reported-by: viech...@gmail.com
Reported-by: paer...@gmail.com
Reported-by: wu.to...@gmail.com
Acked-by: Minchan Kim minc...@kernel.org
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/staging/zram/zram_drv.c |   12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

--- a/drivers/staging/zram/zram_drv.c
+++ b/drivers/staging/zram/zram_drv.c
@@ -223,8 +223,13 @@ static int zram_bvec_read(struct zram *z
cmem = zs_map_object(zram-mem_pool, zram-table[index].handle,
ZS_MM_RO);
 
-   ret = lzo1x_decompress_safe(cmem, zram-table[index].size,
+   if (zram-table[index].size == PAGE_SIZE) {
+   memcpy(uncmem, cmem, PAGE_SIZE);
+   ret = LZO_E_OK;
+   } else {
+   ret = lzo1x_decompress_safe(cmem, zram-table[index].size,
uncmem, clen);
+   }
 
if (is_partial_io(bvec)) {
memcpy(user_mem + bvec-bv_offset, uncmem + offset,
@@ -342,8 +347,11 @@ static int zram_bvec_write(struct zram *
goto out;
}
 
-   if (unlikely(clen  max_zpage_size))
+   if (unlikely(clen  max_zpage_size)) {
zram_stat_inc(zram-stats.bad_compress);
+   src = uncmem;
+   clen = PAGE_SIZE;
+   }
 
handle = zs_malloc(zram-mem_pool, clen);
if (!handle) {


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 032/101] staging: comedi: amplc_pc263: fix possible NULL deref during detach

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Ian Abbott abbo...@mev.co.uk

commit 1d1171ffda585c1cab7bd7cf4bd8f8fd5923fb4a upstream.

`pc263_detach()` is called by the comedi core to clean up if either
`pc263_attach()` or `pc263_attach_pci()` returns an error.  It sets
`thisboard` to the return value of `comedi_board(dev)` and assumes it is
non-null.  This is a valid assumption if `pc263_attach()` fails, but not
if `pc263_attach_pci()` fails, leading to a possible NULL pointer
dereference.

Check `thisboard` at the top of `pc263_detach()` and return early if it
is `NULL`.  This is okay because no other resources need cleaning up in
this case.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/staging/comedi/drivers/amplc_pc263.c |3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/staging/comedi/drivers/amplc_pc263.c
+++ b/drivers/staging/comedi/drivers/amplc_pc263.c
@@ -310,8 +310,11 @@ static int __devinit pc263_attach_pci(st
 
 static void pc263_detach(struct comedi_device *dev)
 {
+   const struct pc263_board *thisboard = comedi_board(dev);
struct pci_dev *pcidev = comedi_to_pci_dev(dev);
 
+   if (!thisboard)
+   return;
if (pcidev) {
if (dev-iobase)
comedi_pci_disable(pcidev);


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 038/101] ehci: fix Lucid nohandoff pci quirk to be more generic with BIOS versions

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Anisse Astier ani...@astier.eu

commit c323dc023b9501e5d09582ec7efd1d40a9001d99 upstream.

BIOS vendors keep changing the BIOS versions. Only match the beginning
of the string to match all Lucid tablets with board name M11JB.

Signed-off-by: Anisse Astier ani...@astier.eu
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/usb/host/pci-quirks.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -545,7 +545,7 @@ static const struct dmi_system_id __devi
/*  Pegatron Lucid (Ordissimo AIRIS) */
.matches = {
DMI_MATCH(DMI_BOARD_NAME, M11JB),
-   DMI_MATCH(DMI_BIOS_VERSION, Lucid-GE-133),
+   DMI_MATCH(DMI_BIOS_VERSION, Lucid-),
},
},
{ }


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 051/101] USB: qcserial: fix interface-data memory leak in error path

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Johan Hovold jhov...@gmail.com

commit 961be09e1ead58509ed4bed0d5819a15d8613d8d upstream.

Move interface data allocation to attach so that it is deallocated
should usb-serial probe fail.

Signed-off-by: Johan Hovold jhov...@gmail.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/usb/serial/qcserial.c |   31 ---
 1 file changed, 16 insertions(+), 15 deletions(-)

--- a/drivers/usb/serial/qcserial.c
+++ b/drivers/usb/serial/qcserial.c
@@ -140,7 +140,6 @@ MODULE_DEVICE_TABLE(usb, id_table);
 
 static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id)
 {
-   struct usb_wwan_intf_private *data;
struct usb_host_interface *intf = serial-interface-cur_altsetting;
struct device *dev = serial-dev-dev;
int retval = -ENODEV;
@@ -156,13 +155,6 @@ static int qcprobe(struct usb_serial *se
ifnum = intf-desc.bInterfaceNumber;
dev_dbg(dev, This Interface = %d\n, ifnum);
 
-   data = kzalloc(sizeof(struct usb_wwan_intf_private),
-GFP_KERNEL);
-   if (!data)
-   return -ENOMEM;
-
-   spin_lock_init(data-susp_lock);
-
if (nintf == 1) {
/* QDL mode */
/* Gobi 2000 has a single altsetting, older ones have two */
@@ -255,20 +247,28 @@ done:
}
}
 
-   /* Set serial-private if not returning error */
-   if (retval == 0)
-   usb_set_serial_data(serial, data);
-   else
-   kfree(data);
-
return retval;
 }
 
+static int qc_attach(struct usb_serial *serial)
+{
+   struct usb_wwan_intf_private *data;
+
+   data = kzalloc(sizeof(*data), GFP_KERNEL);
+   if (!data)
+   return -ENOMEM;
+
+   spin_lock_init(data-susp_lock);
+
+   usb_set_serial_data(serial, data);
+
+   return 0;
+}
+
 static void qc_release(struct usb_serial *serial)
 {
struct usb_wwan_intf_private *priv = usb_get_serial_data(serial);
 
-   /* Free the private data allocated in qcprobe */
usb_set_serial_data(serial, NULL);
kfree(priv);
 }
@@ -287,6 +287,7 @@ static struct usb_serial_driver qcdevice
.write   = usb_wwan_write,
.write_room  = usb_wwan_write_room,
.chars_in_buffer = usb_wwan_chars_in_buffer,
+   .attach  = qc_attach,
.release = qc_release,
.port_probe  = usb_wwan_port_probe,
.port_remove = usb_wwan_port_remove,


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 067/101] USB: mos7840: fix urb leak at release

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Johan Hovold jhov...@gmail.com

commit 65a4cdbb170e4ec1a7fa0e94936d47e24a17b0e8 upstream.

Make sure control urb is freed at release.

Signed-off-by: Johan Hovold jhov...@gmail.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

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

--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -2754,6 +2754,7 @@ static void mos7840_release(struct usb_s
del_timer_sync(mos7840_port-led_timer1);
del_timer_sync(mos7840_port-led_timer2);
}
+   usb_free_urb(mos7840_port-control_urb);
kfree(mos7840_port-ctrl_buf);
kfree(mos7840_port-dr);
kfree(mos7840_port);


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 081/101] b43: Fix oops on unload when firmware not found

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Larry Finger larry.fin...@lwfinger.net

commit f89ff6441df06abc2d95f3ef67525923032d6283 upstream.

When b43 fails to find firmware when loaded, a subsequent unload will
oops due to calling ieee80211_unregister_hw() when the corresponding
register call was never made.

Commit 2d838bb608e2d1f6cb4280e76748cb812dc822e7 fixed the same problem
for b43legacy.

Signed-off-by: Larry Finger larry.fin...@lwfinger.net
Tested-by: Markus Kanet dvmail...@gmx.eu
Cc: Markus Kanet dvmail...@gmx.eu
Signed-off-by: John W. Linville linvi...@tuxdriver.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/net/wireless/b43/main.c |4 
 1 file changed, 4 insertions(+)

--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -5374,6 +5374,8 @@ static void b43_bcma_remove(struct bcma_
cancel_work_sync(wldev-restart_work);
 
B43_WARN_ON(!wl);
+   if (!wldev-fw.ucode.data)
+   return; /* NULL if firmware never loaded */
if (wl-current_dev == wldev  wl-hw_registred) {
b43_leds_stop(wldev);
ieee80211_unregister_hw(wl-hw);
@@ -5448,6 +5450,8 @@ static void b43_ssb_remove(struct ssb_de
cancel_work_sync(wldev-restart_work);
 
B43_WARN_ON(!wl);
+   if (!wldev-fw.ucode.data)
+   return; /* NULL if firmware never loaded */
if (wl-current_dev == wldev  wl-hw_registred) {
b43_leds_stop(wldev);
ieee80211_unregister_hw(wl-hw);


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 098/101] x86: efi: Turn off efi_enabled after setup on mixed fw/kernel

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Olof Johansson o...@lixom.net

commit 5189c2a7c7769ee9d037d76c1a7b8550ccf3481c upstream.

When 32-bit EFI is used with 64-bit kernel (or vice versa), turn off
efi_enabled once setup is done. Beyond setup, it is normally used to
determine if runtime services are available and we will have none.

This will resolve issues stemming from efivars modprobe panicking on a
32/64-bit setup, as well as some reboot issues on similar setups.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=45991

Reported-by: Marko Kohtala marko.koht...@gmail.com
Reported-by: Maxim Kammerer m...@dee.su
Signed-off-by: Olof Johansson o...@lixom.net
Acked-by: Maarten Lankhorst maarten.lankho...@canonical.com
Cc: Matthew Garrett m...@redhat.com
Signed-off-by: Matt Fleming matt.flem...@intel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 arch/x86/include/asm/efi.h  |1 +
 arch/x86/kernel/setup.c |   12 
 arch/x86/platform/efi/efi.c |   18 ++
 3 files changed, 23 insertions(+), 8 deletions(-)

--- a/arch/x86/include/asm/efi.h
+++ b/arch/x86/include/asm/efi.h
@@ -98,6 +98,7 @@ extern void efi_set_executable(efi_memor
 extern int efi_memblock_x86_reserve_range(void);
 extern void efi_call_phys_prelog(void);
 extern void efi_call_phys_epilog(void);
+extern void efi_unmap_memmap(void);
 
 #ifndef CONFIG_EFI
 /*
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -1047,6 +1047,18 @@ void __init setup_arch(char **cmdline_p)
mcheck_init();
 
arch_init_ideal_nops();
+
+#ifdef CONFIG_EFI
+   /* Once setup is done above, disable efi_enabled on mismatched
+* firmware/kernel archtectures since there is no support for
+* runtime services.
+*/
+   if (efi_enabled  IS_ENABLED(CONFIG_X86_64) != efi_64bit) {
+   pr_info(efi: Setup done, disabling due to 32/64-bit 
mismatch\n);
+   efi_unmap_memmap();
+   efi_enabled = 0;
+   }
+#endif
 }
 
 #ifdef CONFIG_X86_32
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -69,11 +69,15 @@ EXPORT_SYMBOL(efi);
 struct efi_memory_map memmap;
 
 bool efi_64bit;
-static bool efi_native;
 
 static struct efi efi_phys __initdata;
 static efi_system_table_t efi_systab __initdata;
 
+static inline bool efi_is_native(void)
+{
+   return IS_ENABLED(CONFIG_X86_64) == efi_64bit;
+}
+
 static int __init setup_noefi(char *arg)
 {
efi_enabled = 0;
@@ -419,7 +423,7 @@ void __init efi_reserve_boot_services(vo
}
 }
 
-static void __init efi_unmap_memmap(void)
+void __init efi_unmap_memmap(void)
 {
if (memmap.map) {
early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size);
@@ -431,7 +435,7 @@ void __init efi_free_boot_services(void)
 {
void *p;
 
-   if (!efi_native)
+   if (!efi_is_native())
return;
 
for (p = memmap.map; p  memmap.map_end; p += memmap.desc_size) {
@@ -683,12 +687,10 @@ void __init efi_init(void)
return;
}
efi_phys.systab = (efi_system_table_t *)boot_params.efi_info.efi_systab;
-   efi_native = !efi_64bit;
 #else
efi_phys.systab = (efi_system_table_t *)
  (boot_params.efi_info.efi_systab |
  ((__u64)boot_params.efi_info.efi_systab_hi32));
-   efi_native = efi_64bit;
 #endif
 
if (efi_systab_init(efi_phys.systab)) {
@@ -722,7 +724,7 @@ void __init efi_init(void)
 * that doesn't match the kernel 32/64-bit mode.
 */
 
-   if (!efi_native)
+   if (!efi_is_native())
pr_info(No EFI runtime due to 32/64-bit mismatch with 
kernel\n);
else if (efi_runtime_init()) {
efi_enabled = 0;
@@ -734,7 +736,7 @@ void __init efi_init(void)
return;
}
 #ifdef CONFIG_X86_32
-   if (efi_native) {
+   if (efi_is_native()) {
x86_platform.get_wallclock = efi_get_time;
x86_platform.set_wallclock = efi_set_rtc_mmss;
}
@@ -800,7 +802,7 @@ void __init efi_enter_virtual_mode(void)
 * non-native EFI
 */
 
-   if (!efi_native) {
+   if (!efi_is_native()) {
efi_unmap_memmap();
return;
}


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 100/101] pnfsblock: fix non-aligned DIO read

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Peng Tao bergw...@gmail.com

commit f742dc4a32587bff50b13dde9d8894b96851951a upstream.

For DIO read, if it is not sector aligned, we should reject it
and resend via MDS. Otherwise there might be data corruption.
Also teach bl_read_pagelist to handle partial page reads for DIO.

Signed-off-by: Peng Tao tao.p...@emc.com
Signed-off-by: Trond Myklebust trond.mykleb...@netapp.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 fs/nfs/blocklayout/blocklayout.c |   77 +++
 1 file changed, 46 insertions(+), 31 deletions(-)

--- a/fs/nfs/blocklayout/blocklayout.c
+++ b/fs/nfs/blocklayout/blocklayout.c
@@ -242,14 +242,6 @@ bl_end_par_io_read(void *data, int unuse
schedule_work(rdata-task.u.tk_work);
 }
 
-static bool
-bl_check_alignment(u64 offset, u32 len, unsigned long blkmask)
-{
-   if ((offset  blkmask) || (len  blkmask))
-   return false;
-   return true;
-}
-
 static enum pnfs_try_status
 bl_read_pagelist(struct nfs_read_data *rdata)
 {
@@ -260,15 +252,15 @@ bl_read_pagelist(struct nfs_read_data *r
sector_t isect, extent_length = 0;
struct parallel_io *par;
loff_t f_offset = rdata-args.offset;
+   size_t bytes_left = rdata-args.count;
+   unsigned int pg_offset, pg_len;
struct page **pages = rdata-args.pages;
int pg_index = rdata-args.pgbase  PAGE_CACHE_SHIFT;
+   const bool is_dio = (header-dreq != NULL);
 
dprintk(%s enter nr_pages %u offset %lld count %u\n, __func__,
   rdata-pages.npages, f_offset, (unsigned int)rdata-args.count);
 
-   if (!bl_check_alignment(f_offset, rdata-args.count, PAGE_CACHE_MASK))
-   goto use_mds;
-
par = alloc_parallel(rdata);
if (!par)
goto use_mds;
@@ -298,36 +290,53 @@ bl_read_pagelist(struct nfs_read_data *r
extent_length = min(extent_length, cow_length);
}
}
+
+   if (is_dio) {
+   pg_offset = f_offset  ~PAGE_CACHE_MASK;
+   if (pg_offset + bytes_left  PAGE_CACHE_SIZE)
+   pg_len = PAGE_CACHE_SIZE - pg_offset;
+   else
+   pg_len = bytes_left;
+
+   f_offset += pg_len;
+   bytes_left -= pg_len;
+   isect += (pg_offset  SECTOR_SHIFT);
+   } else {
+   pg_offset = 0;
+   pg_len = PAGE_CACHE_SIZE;
+   }
+
hole = is_hole(be, isect);
if (hole  !cow_read) {
bio = bl_submit_bio(READ, bio);
/* Fill hole w/ zeroes w/o accessing device */
dprintk(%s Zeroing page for hole\n, __func__);
-   zero_user_segment(pages[i], 0, PAGE_CACHE_SIZE);
+   zero_user_segment(pages[i], pg_offset, pg_len);
print_page(pages[i]);
SetPageUptodate(pages[i]);
} else {
struct pnfs_block_extent *be_read;
 
be_read = (hole  cow_read) ? cow_read : be;
-   bio = bl_add_page_to_bio(bio, rdata-pages.npages - i,
+   bio = do_add_page_to_bio(bio, rdata-pages.npages - i,
 READ,
 isect, pages[i], be_read,
-bl_end_io_read, par);
+bl_end_io_read, par,
+pg_offset, pg_len);
if (IS_ERR(bio)) {
header-pnfs_error = PTR_ERR(bio);
bio = NULL;
goto out;
}
}
-   isect += PAGE_CACHE_SECTORS;
+   isect += (pg_len  SECTOR_SHIFT);
extent_length -= PAGE_CACHE_SECTORS;
}
if ((isect  SECTOR_SHIFT) = header-inode-i_size) {
rdata-res.eof = 1;
-   rdata-res.count = header-inode-i_size - f_offset;
+   rdata-res.count = header-inode-i_size - rdata-args.offset;
} else {
-   rdata-res.count = (isect  SECTOR_SHIFT) - f_offset;
+   rdata-res.count = (isect  SECTOR_SHIFT) - rdata-args.offset;
}
 out:
bl_put_extent(be);
@@ -676,7 +685,7 @@ bl_write_pagelist(struct nfs_write_data
struct bio *bio = NULL;
struct pnfs_block_extent *be = NULL, *cow_read = NULL;
sector_t isect, last_isect = 0, extent_length = 0;
-   struct parallel_io *par = NULL;
+   struct parallel_io *par

[ 079/101] mac80211: check if key has TKIP type before updating IV

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Stanislaw Gruszka sgrus...@redhat.com

commit 4045f72bcf3c293c7c5932ef001742d8bb5ded76 upstream.

This patch fix corruption which can manifest itself by following crash
when switching on rfkill switch with rt2x00 driver:
https://bugzilla.redhat.com/attachment.cgi?id=615362

Pointer key-u.ccmp.tfm of group key get corrupted in:

ieee80211_rx_h_michael_mic_verify():

/* update IV in key information to be able to detect replays */
rx-key-u.tkip.rx[rx-security_idx].iv32 = rx-tkip_iv32;
rx-key-u.tkip.rx[rx-security_idx].iv16 = rx-tkip_iv16;

because rt2x00 always set RX_FLAG_MMIC_STRIPPED, even if key is not TKIP.

We already check type of the key in different path in
ieee80211_rx_h_michael_mic_verify() function, so adding additional
check here is reasonable.

Signed-off-by: Stanislaw Gruszka sgrus...@redhat.com
Signed-off-by: John W. Linville linvi...@tuxdriver.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 net/mac80211/wpa.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/net/mac80211/wpa.c
+++ b/net/mac80211/wpa.c
@@ -106,7 +106,8 @@ ieee80211_rx_h_michael_mic_verify(struct
if (status-flag  RX_FLAG_MMIC_ERROR)
goto mic_fail;
 
-   if (!(status-flag  RX_FLAG_IV_STRIPPED)  rx-key)
+   if (!(status-flag  RX_FLAG_IV_STRIPPED)  rx-key 
+   rx-key-conf.cipher == WLAN_CIPHER_SUITE_TKIP)
goto update_iv;
 
return RX_CONTINUE;


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 096/101] cfg80211/mac80211: avoid state mishmash on deauth

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Stanislaw Gruszka sgrus...@redhat.com

commit 6863255bd0e48bc41ae5a066d5c771801e92735a upstream.

Avoid situation when we are on associate state in mac80211 and
on disassociate state in cfg80211. This can results on crash
during modules unload (like showed on this thread:
http://marc.info/?t=13437397631r=1w=2) and possibly other
problems.

Reported-by: Pedro Francisco pedrogfranci...@gmail.com
Cc: sta...@vger.kernel.org
Signed-off-by: Stanislaw Gruszka sgrus...@redhat.com
Signed-off-by: Johannes Berg johannes.b...@intel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 include/net/cfg80211.h |1 +
 net/mac80211/mlme.c|5 +++--
 net/wireless/mlme.c|   12 +++-
 3 files changed, 7 insertions(+), 11 deletions(-)

--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1217,6 +1217,7 @@ struct cfg80211_deauth_request {
const u8 *ie;
size_t ie_len;
u16 reason_code;
+   bool local_state_change;
 };
 
 /**
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -3467,6 +3467,7 @@ int ieee80211_mgd_deauth(struct ieee8021
 {
struct ieee80211_if_managed *ifmgd = sdata-u.mgd;
u8 frame_buf[DEAUTH_DISASSOC_LEN];
+   bool tx = !req-local_state_change;
 
mutex_lock(ifmgd-mtx);
 
@@ -3483,11 +3484,11 @@ int ieee80211_mgd_deauth(struct ieee8021
if (ifmgd-associated 
ether_addr_equal(ifmgd-associated-bssid, req-bssid))
ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH,
-  req-reason_code, true, frame_buf);
+  req-reason_code, tx, frame_buf);
else
ieee80211_send_deauth_disassoc(sdata, req-bssid,
   IEEE80211_STYPE_DEAUTH,
-  req-reason_code, true,
+  req-reason_code, tx,
   frame_buf);
mutex_unlock(ifmgd-mtx);
 
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -457,20 +457,14 @@ int __cfg80211_mlme_deauth(struct cfg802
.reason_code = reason,
.ie = ie,
.ie_len = ie_len,
+   .local_state_change = local_state_change,
};
 
ASSERT_WDEV_LOCK(wdev);
 
-   if (local_state_change) {
-   if (wdev-current_bss 
-   ether_addr_equal(wdev-current_bss-pub.bssid, bssid)) {
-   cfg80211_unhold_bss(wdev-current_bss);
-   cfg80211_put_bss(wdev-current_bss-pub);
-   wdev-current_bss = NULL;
-   }
-
+   if (local_state_change  (!wdev-current_bss ||
+   !ether_addr_equal(wdev-current_bss-pub.bssid, bssid)))
return 0;
-   }
 
return rdev-ops-deauth(rdev-wiphy, dev, req);
 }


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 099/101] x86, mm: Use memblock memory loop instead of e820_RAM

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Yinghai Lu ying...@kernel.org

commit 1f2ff682ac951ed82cc043cf140d2851084512df upstream.

We need to handle E820_RAM and E820_RESERVED_KERNEL at the same time.

Also memblock has page aligned range for ram, so we could avoid mapping
partial pages.

Signed-off-by: Yinghai Lu ying...@kernel.org
Link: 
http://lkml.kernel.org/r/cae9fiqvzirvabmfyrfxmmwechbksicqehz4vawuv0xfck51...@mail.gmail.com
Acked-by: Jacob Shin jacob.s...@amd.com
Signed-off-by: H. Peter Anvin h...@linux.intel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 arch/x86/kernel/setup.c |   15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -920,18 +920,19 @@ void __init setup_arch(char **cmdline_p)
 #ifdef CONFIG_X86_64
if (max_pfn  max_low_pfn) {
int i;
-   for (i = 0; i  e820.nr_map; i++) {
-   struct e820entry *ei = e820.map[i];
+   unsigned long start, end;
+   unsigned long start_pfn, end_pfn;
 
-   if (ei-addr + ei-size = 1UL  32)
-   continue;
+   for_each_mem_pfn_range(i, MAX_NUMNODES, start_pfn, end_pfn,
+NULL) {
 
-   if (ei-type == E820_RESERVED)
+   end = PFN_PHYS(end_pfn);
+   if (end = (1UL32))
continue;
 
+   start = PFN_PHYS(start_pfn);
max_pfn_mapped = init_memory_mapping(
-   ei-addr  1UL  32 ? 1UL  32 : ei-addr,
-   ei-addr + ei-size);
+   max((1UL32), start), end);
}
 
/* can we preseve max_low_pfn ?*/


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 101/101] pnfsblock: fix non-aligned DIO write

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Peng Tao bergw...@gmail.com

commit 96c9eae638765c2bf2ca4f5a6325484f9bb69aa7 upstream.

For DIO writes, if it is not blocksize aligned, we need to do
internal serialization. It may slow down writers anyway. So we
just bail them out and resend to MDS.

Signed-off-by: Peng Tao tao.p...@emc.com
Signed-off-by: Trond Myklebust trond.mykleb...@netapp.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 fs/nfs/blocklayout/blocklayout.c |   34 +++---
 1 file changed, 31 insertions(+), 3 deletions(-)

--- a/fs/nfs/blocklayout/blocklayout.c
+++ b/fs/nfs/blocklayout/blocklayout.c
@@ -685,7 +685,7 @@ bl_write_pagelist(struct nfs_write_data
struct bio *bio = NULL;
struct pnfs_block_extent *be = NULL, *cow_read = NULL;
sector_t isect, last_isect = 0, extent_length = 0;
-   struct parallel_io *par;
+   struct parallel_io *par = NULL;
loff_t offset = wdata-args.offset;
size_t count = wdata-args.count;
unsigned int pg_offset, pg_len, saved_len;
@@ -697,6 +697,13 @@ bl_write_pagelist(struct nfs_write_data
NFS_SERVER(header-inode)-pnfs_blksize  PAGE_CACHE_SHIFT;
 
dprintk(%s enter, %Zu@%lld\n, __func__, count, offset);
+
+   if (header-dreq != NULL 
+   (!IS_ALIGNED(offset, NFS_SERVER(header-inode)-pnfs_blksize) ||
+!IS_ALIGNED(count, NFS_SERVER(header-inode)-pnfs_blksize))) {
+   dprintk(pnfsblock nonblock aligned DIO writes. Resend MDS\n);
+   goto out_mds;
+   }
/* At this point, wdata-pages is a (sequential) list of nfs_pages.
 * We want to write each, and if there is an error set pnfs_error
 * to have it redone using nfs.
@@ -1197,6 +1204,27 @@ bl_pg_test_read(struct nfs_pageio_descri
return pnfs_generic_pg_test(pgio, prev, req);
 }
 
+void
+bl_pg_init_write(struct nfs_pageio_descriptor *pgio, struct nfs_page *req)
+{
+   if (pgio-pg_dreq != NULL 
+   !is_aligned_req(req, PAGE_CACHE_SIZE))
+   nfs_pageio_reset_write_mds(pgio);
+   else
+   pnfs_generic_pg_init_write(pgio, req);
+}
+
+static bool
+bl_pg_test_write(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev,
+struct nfs_page *req)
+{
+   if (pgio-pg_dreq != NULL 
+   !is_aligned_req(req, PAGE_CACHE_SIZE))
+   return false;
+
+   return pnfs_generic_pg_test(pgio, prev, req);
+}
+
 static const struct nfs_pageio_ops bl_pg_read_ops = {
.pg_init = bl_pg_init_read,
.pg_test = bl_pg_test_read,
@@ -1204,8 +1232,8 @@ static const struct nfs_pageio_ops bl_pg
 };
 
 static const struct nfs_pageio_ops bl_pg_write_ops = {
-   .pg_init = pnfs_generic_pg_init_write,
-   .pg_test = pnfs_generic_pg_test,
+   .pg_init = bl_pg_init_write,
+   .pg_test = bl_pg_test_write,
.pg_doio = pnfs_generic_pg_writepages,
 };
 


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 091/101] net/wireless: ipw2200: Fix panic occurring in ipw_handle_promiscuous_tx()

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Stanislav Yakovlev stas.yakov...@gmail.com

commit bf11315eeda510ea4fc1a2bf972d8155d31d89b4 upstream.

The driver does not count space of radiotap fields when allocating skb for
radiotap packet. This leads to kernel panic with the following call trace:

...
[67607.676067] [c152f90f] error_code+0x67/0x6c
[67607.676067] [c142f831] ? skb_put+0x91/0xa0
[67607.676067] [f8cf5e5b] ? ipw_handle_promiscuous_tx+0x16b/0x2d0 [ipw2200]
[67607.676067] [f8cf5e5b] ipw_handle_promiscuous_tx+0x16b/0x2d0 [ipw2200]
[67607.676067] [f8cf899b] ipw_net_hard_start_xmit+0x8b/0x90 [ipw2200]
[67607.676067] [f8741c5a] libipw_xmit+0x55a/0x980 [libipw]
[67607.676067] [c143d3e8] dev_hard_start_xmit+0x218/0x4d0
...

This bug was found by VittGam.
https://bugzilla.kernel.org/show_bug.cgi?id=43255

Signed-off-by: Stanislav Yakovlev stas.yakov...@gmail.com
Signed-off-by: John W. Linville linvi...@tuxdriver.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/net/wireless/ipw2x00/ipw2200.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -10479,7 +10479,7 @@ static void ipw_handle_promiscuous_tx(st
} else
len = src-len;
 
-   dst = alloc_skb(len + sizeof(*rt_hdr), GFP_ATOMIC);
+   dst = alloc_skb(len + sizeof(*rt_hdr) + sizeof(u16)*2, 
GFP_ATOMIC);
if (!dst)
continue;
 


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 097/101] efi: Defer freeing boot services memory until after ACPI init

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Josh Triplett j...@joshtriplett.org

commit 785107923a83d8456bbd8564e288a24d84109a46 upstream.

Some new ACPI 5.0 tables reference resources stored in boot services
memory, so keep that memory around until we have ACPI and can extract
data from it.

Signed-off-by: Josh Triplett j...@joshtriplett.org
Link: 
http://lkml.kernel.org/r/baaa6d44bdc4eb0c58e5d1b4ccd2c729f854ac55.1348876882.git.j...@joshtriplett.org
Signed-off-by: H. Peter Anvin h...@linux.intel.com
Cc: Matt Fleming m...@console-pimps.org
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 arch/x86/platform/efi/efi.c |   31 ++-
 include/linux/efi.h |5 +
 init/main.c |3 +++
 3 files changed, 26 insertions(+), 13 deletions(-)

--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -419,10 +419,21 @@ void __init efi_reserve_boot_services(vo
}
 }
 
-static void __init efi_free_boot_services(void)
+static void __init efi_unmap_memmap(void)
+{
+   if (memmap.map) {
+   early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size);
+   memmap.map = NULL;
+   }
+}
+
+void __init efi_free_boot_services(void)
 {
void *p;
 
+   if (!efi_native)
+   return;
+
for (p = memmap.map; p  memmap.map_end; p += memmap.desc_size) {
efi_memory_desc_t *md = p;
unsigned long long start = md-phys_addr;
@@ -438,6 +449,8 @@ static void __init efi_free_boot_service
 
free_bootmem_late(start, size);
}
+
+   efi_unmap_memmap();
 }
 
 static int __init efi_systab_init(void *phys)
@@ -787,8 +800,10 @@ void __init efi_enter_virtual_mode(void)
 * non-native EFI
 */
 
-   if (!efi_native)
-   goto out;
+   if (!efi_native) {
+   efi_unmap_memmap();
+   return;
+   }
 
/* Merge contiguous regions of the same type and attribute */
for (p = memmap.map; p  memmap.map_end; p += memmap.desc_size) {
@@ -878,13 +893,6 @@ void __init efi_enter_virtual_mode(void)
}
 
/*
-* Thankfully, it does seem that no runtime services other than
-* SetVirtualAddressMap() will touch boot services code, so we can
-* get rid of it all at this point
-*/
-   efi_free_boot_services();
-
-   /*
 * Now that EFI is in virtual mode, update the function
 * pointers in the runtime service table to the new virtual addresses.
 *
@@ -907,9 +915,6 @@ void __init efi_enter_virtual_mode(void)
if (__supported_pte_mask  _PAGE_NX)
runtime_code_page_mkexec();
 
-out:
-   early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size);
-   memmap.map = NULL;
kfree(new_memmap);
 }
 
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -496,6 +496,11 @@ extern void efi_map_pal_code (void);
 extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg);
 extern void efi_gettimeofday (struct timespec *ts);
 extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, 
if possible */
+#ifdef CONFIG_X86
+extern void efi_free_boot_services(void);
+#else
+static inline void efi_free_boot_services(void) {}
+#endif
 extern u64 efi_get_iobase (void);
 extern u32 efi_mem_type (unsigned long phys_addr);
 extern u64 efi_mem_attributes (unsigned long phys_addr);
--- a/init/main.c
+++ b/init/main.c
@@ -631,6 +631,9 @@ asmlinkage void __init start_kernel(void
acpi_early_init(); /* before LAPIC and SMP init */
sfi_init_late();
 
+   if (efi_enabled)
+   efi_free_boot_services();
+
ftrace_init();
 
/* Do the rest non-__init'ed, we're now alive */


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 095/101] x86, mm: Undo incorrect revert in arch/x86/mm/init.c

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Yinghai Lu ying...@kernel.org

commit f82f64dd9f485e13f29f369772d4a0e868e5633a upstream.

Commit

844ab6f9 x86, mm: Find_early_table_space based on ranges that are actually 
being mapped

added back some lines back wrongly that has been removed in commit

7b16bbf97 Revert x86/mm: Fix the size calculation of mapping tables

remove them again.

Signed-off-by: Yinghai Lu ying...@kernel.org
Link: 
http://lkml.kernel.org/r/CAE9FiQW_vuaYQbmagVnxT2DGsYc=9tneabdbq53sykitpow...@mail.gmail.com
Acked-by: Jacob Shin jacob.s...@amd.com
Signed-off-by: H. Peter Anvin h...@linux.intel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 arch/x86/mm/init.c |4 
 1 file changed, 4 deletions(-)

--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -65,10 +65,6 @@ static void __init find_early_table_spac
 #ifdef CONFIG_X86_32
extra += PMD_SIZE;
 #endif
-   /* The first 2/4M doesn't use large pages. */
-   if (mr[i].start  PMD_SIZE)
-   extra += range;
-
ptes += (extra + PAGE_SIZE - 1)  PAGE_SHIFT;
} else {
ptes += (range + PAGE_SIZE - 1)  PAGE_SHIFT;


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 094/101] x86, mm: Find_early_table_space based on ranges that are actually being mapped

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Jacob Shin jacob.s...@amd.com

commit 844ab6f993b1d32eb40512503d35ff6ad0c57030 upstream.

Current logic finds enough space for direct mapping page tables from 0
to end. Instead, we only need to find enough space to cover mr[0].start
to mr[nr_range].end -- the range that is actually being mapped by
init_memory_mapping()

This is needed after 1e779aabe1f0768c2bf8f8c0a5583679b54a, to address
the panic reported here:

  https://lkml.org/lkml/2012/10/20/160
  https://lkml.org/lkml/2012/10/21/157

Signed-off-by: Jacob Shin jacob.s...@amd.com
Link: http://lkml.kernel.org/r/20121024195311.GB11779@jshin-Toonie
Tested-by: Tom Rini tr...@ti.com
Signed-off-by: H. Peter Anvin h...@linux.intel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 arch/x86/mm/init.c |   70 +++--
 1 file changed, 41 insertions(+), 29 deletions(-)

--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -29,36 +29,54 @@ int direct_gbpages
 #endif
 ;
 
-static void __init find_early_table_space(unsigned long end, int use_pse,
- int use_gbpages)
+struct map_range {
+   unsigned long start;
+   unsigned long end;
+   unsigned page_size_mask;
+};
+
+/*
+ * First calculate space needed for kernel direct mapping page tables to cover
+ * mr[0].start to mr[nr_range - 1].end, while accounting for possible 2M and 
1GB
+ * pages. Then find enough contiguous space for those page tables.
+ */
+static void __init find_early_table_space(struct map_range *mr, int nr_range)
 {
-   unsigned long puds, pmds, ptes, tables, start = 0, good_end = end;
+   int i;
+   unsigned long puds = 0, pmds = 0, ptes = 0, tables;
+   unsigned long start = 0, good_end;
phys_addr_t base;
 
-   puds = (end + PUD_SIZE - 1)  PUD_SHIFT;
-   tables = roundup(puds * sizeof(pud_t), PAGE_SIZE);
+   for (i = 0; i  nr_range; i++) {
+   unsigned long range, extra;
 
-   if (use_gbpages) {
-   unsigned long extra;
+   range = mr[i].end - mr[i].start;
+   puds += (range + PUD_SIZE - 1)  PUD_SHIFT;
 
-   extra = end - ((endPUD_SHIFT)  PUD_SHIFT);
-   pmds = (extra + PMD_SIZE - 1)  PMD_SHIFT;
-   } else
-   pmds = (end + PMD_SIZE - 1)  PMD_SHIFT;
-
-   tables += roundup(pmds * sizeof(pmd_t), PAGE_SIZE);
+   if (mr[i].page_size_mask  (1  PG_LEVEL_1G)) {
+   extra = range - ((range  PUD_SHIFT)  PUD_SHIFT);
+   pmds += (extra + PMD_SIZE - 1)  PMD_SHIFT;
+   } else {
+   pmds += (range + PMD_SIZE - 1)  PMD_SHIFT;
+   }
 
-   if (use_pse) {
-   unsigned long extra;
-
-   extra = end - ((endPMD_SHIFT)  PMD_SHIFT);
+   if (mr[i].page_size_mask  (1  PG_LEVEL_2M)) {
+   extra = range - ((range  PMD_SHIFT)  PMD_SHIFT);
 #ifdef CONFIG_X86_32
-   extra += PMD_SIZE;
+   extra += PMD_SIZE;
 #endif
-   ptes = (extra + PAGE_SIZE - 1)  PAGE_SHIFT;
-   } else
-   ptes = (end + PAGE_SIZE - 1)  PAGE_SHIFT;
+   /* The first 2/4M doesn't use large pages. */
+   if (mr[i].start  PMD_SIZE)
+   extra += range;
+
+   ptes += (extra + PAGE_SIZE - 1)  PAGE_SHIFT;
+   } else {
+   ptes += (range + PAGE_SIZE - 1)  PAGE_SHIFT;
+   }
+   }
 
+   tables = roundup(puds * sizeof(pud_t), PAGE_SIZE);
+   tables += roundup(pmds * sizeof(pmd_t), PAGE_SIZE);
tables += roundup(ptes * sizeof(pte_t), PAGE_SIZE);
 
 #ifdef CONFIG_X86_32
@@ -76,7 +94,7 @@ static void __init find_early_table_spac
pgt_buf_top = pgt_buf_start + (tables  PAGE_SHIFT);
 
printk(KERN_DEBUG kernel direct mapping tables up to %#lx @ [mem 
%#010lx-%#010lx]\n,
-   end - 1, pgt_buf_start  PAGE_SHIFT,
+   mr[nr_range - 1].end - 1, pgt_buf_start  PAGE_SHIFT,
(pgt_buf_top  PAGE_SHIFT) - 1);
 }
 
@@ -85,12 +103,6 @@ void __init native_pagetable_reserve(u64
memblock_reserve(start, end - start);
 }
 
-struct map_range {
-   unsigned long start;
-   unsigned long end;
-   unsigned page_size_mask;
-};
-
 #ifdef CONFIG_X86_32
 #define NR_RANGE_MR 3
 #else /* CONFIG_X86_64 */
@@ -263,7 +275,7 @@ unsigned long __init_refok init_memory_m
 * nodes are discovered.
 */
if (!after_bootmem)
-   find_early_table_space(end, use_pse, use_gbpages);
+   find_early_table_space(mr, nr_range);
 
for (i = 0; i  nr_range; i++)
ret = kernel_physical_mapping_init(mr[i].start, mr[i].end,


--
To unsubscribe from this list: send the line

[ 093/101] Revert ath9k_hw: Updated AR9003 tx gain table for 5GHz

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Felix Fietkau n...@openwrt.org

commit 73b26df5fa1a6245d6fc982362518b620bc7c2fe upstream.

This reverts commit a240dc7b3c7463bd60cf0a9b2a90f52f78aae0fd.

This commit is reducing tx power by at least 10 db on some devices,
e.g. the Buffalo WZR-HP-G450H.

Signed-off-by: Felix Fietkau n...@openwrt.org
Cc: rmano...@qca.qualcomm.com
Signed-off-by: John W. Linville linvi...@tuxdriver.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h |  164 +--
 1 file changed, 82 insertions(+), 82 deletions(-)

--- a/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
@@ -534,107 +534,107 @@ static const u32 ar9300_2p2_baseband_cor
 
 static const u32 ar9300Modes_high_power_tx_gain_table_2p2[][5] = {
/* Addr  5G_HT20 5G_HT40 2G_HT40 2G_HT20   */
-   {0xa2dc, 0x000cfff0, 0x000cfff0, 0x03aaa352, 0x03aaa352},
-   {0xa2e0, 0x000f, 0x000f, 0x03ccc584, 0x03ccc584},
-   {0xa2e4, 0x03f0, 0x03f0, 0x03f0f800, 0x03f0f800},
+   {0xa2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352},
+   {0xa2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584},
+   {0xa2e4, 0x03fc, 0x03fc, 0x03f0f800, 0x03f0f800},
{0xa2e8, 0x, 0x, 0x03ff, 0x03ff},
{0xa410, 0x50d9, 0x50d9, 0x50d9, 0x50d9},
{0xa500, 0x, 0x, 0x, 0x},
{0xa504, 0x0603, 0x0603, 0x0402, 0x0402},
{0xa508, 0x0a20, 0x0a20, 0x0804, 0x0804},
{0xa50c, 0x1023, 0x1023, 0x0b000200, 0x0b000200},
-   {0xa510, 0x1528, 0x1528, 0x0f000202, 0x0f000202},
-   {0xa514, 0x1b2b, 0x1b2b, 0x12000400, 0x12000400},
-   {0xa518, 0x1f020028, 0x1f020028, 0x16000402, 0x16000402},
-   {0xa51c, 0x2502002b, 0x2502002b, 0x19000404, 0x19000404},
-   {0xa520, 0x2a04002a, 0x2a04002a, 0x1c000603, 0x1c000603},
-   {0xa524, 0x2e06002a, 0x2e06002a, 0x21000a02, 0x21000a02},
-   {0xa528, 0x3302202d, 0x3302202d, 0x25000a04, 0x25000a04},
-   {0xa52c, 0x3804202c, 0x3804202c, 0x28000a20, 0x28000a20},
-   {0xa530, 0x3c06202c, 0x3c06202c, 0x2c000e20, 0x2c000e20},
-   {0xa534, 0x4108202d, 0x4108202d, 0x3e22, 0x3e22},
-   {0xa538, 0x4506402d, 0x4506402d, 0x34000e24, 0x34000e24},
-   {0xa53c, 0x4906222d, 0x4906222d, 0x38001640, 0x38001640},
-   {0xa540, 0x4d062231, 0x4d062231, 0x3c001660, 0x3c001660},
-   {0xa544, 0x50082231, 0x50082231, 0x3f001861, 0x3f001861},
-   {0xa548, 0x5608422e, 0x5608422e, 0x43001a81, 0x43001a81},
-   {0xa54c, 0x5a08442e, 0x5a08442e, 0x47001a83, 0x47001a83},
-   {0xa550, 0x5e0a4431, 0x5e0a4431, 0x4a001c84, 0x4a001c84},
-   {0xa554, 0x640a4432, 0x640a4432, 0x4e001ce3, 0x4e001ce3},
-   {0xa558, 0x680a4434, 0x680a4434, 0x52001ce5, 0x52001ce5},
-   {0xa55c, 0x6c0a6434, 0x6c0a6434, 0x56001ce9, 0x56001ce9},
-   {0xa560, 0x6f0a6633, 0x6f0a6633, 0x5a001ceb, 0x5a001ceb},
-   {0xa564, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
-   {0xa568, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
-   {0xa56c, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
-   {0xa570, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
-   {0xa574, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
-   {0xa578, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
-   {0xa57c, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
+   {0xa510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202},
+   {0xa514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400},
+   {0xa518, 0x21002220, 0x21002220, 0x16000402, 0x16000402},
+   {0xa51c, 0x27002223, 0x27002223, 0x19000404, 0x19000404},
+   {0xa520, 0x2b00, 0x2b00, 0x1c000603, 0x1c000603},
+   {0xa524, 0x2f02, 0x2f02, 0x21000a02, 0x21000a02},
+   {0xa528, 0x3405, 0x3405, 0x25000a04, 0x25000a04},
+   {0xa52c, 0x3a0a, 0x3a0a, 0x28000a20, 0x28000a20},
+   {0xa530, 0x3e0c, 0x3e0c, 0x2c000e20, 0x2c000e20},
+   {0xa534, 0x4202242a, 0x4202242a, 0x3e22, 0x3e22},
+   {0xa538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24},
+   {0xa53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640},
+   {0xa540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660},
+   {0xa544, 0x52022470, 0x52022470, 0x3f001861, 0x3f001861},
+   {0xa548, 0x55022490, 0x55022490, 0x43001a81, 0x43001a81},
+   {0xa54c, 0x59022492, 0x59022492, 0x47001a83, 0x47001a83},
+   {0xa550, 0x5d022692, 0x5d022692, 0x4a001c84, 0x4a001c84

[ 01/54] drm/radeon: add some new SI PCI ids

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Alex Deucher alexander.deuc...@amd.com

commit b6aa22db7857ab7ed042d6c56b800bfc727cfdff upstream.

Signed-off-by: Alex Deucher alexander.deuc...@amd.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 include/drm/drm_pciids.h |3 +++
 1 file changed, 3 insertions(+)

--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -209,6 +209,8 @@
{0x1002, 0x6788, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
{0x1002, 0x678A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
{0x1002, 0x6790, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
+   {0x1002, 0x6791, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
+   {0x1002, 0x6792, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
{0x1002, 0x6798, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
{0x1002, 0x6799, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
{0x1002, 0x679A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
@@ -221,6 +223,7 @@
{0x1002, 0x6808, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \
{0x1002, 0x6809, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \
{0x1002, 0x6810, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \
+   {0x1002, 0x6811, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \
{0x1002, 0x6816, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \
{0x1002, 0x6817, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \
{0x1002, 0x6818, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 
CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 02/54] drm/radeon: add error output if VM CS fails on cayman

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Alex Deucher alexander.deuc...@amd.com

commit c71721324c612f7f040657ce9917d87f530f9784 upstream.

So we know why the CS was rejected.

Signed-off-by: Alex Deucher alexander.deuc...@amd.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/gpu/drm/radeon/evergreen_cs.c |1 +
 1 file changed, 1 insertion(+)

--- a/drivers/gpu/drm/radeon/evergreen_cs.c
+++ b/drivers/gpu/drm/radeon/evergreen_cs.c
@@ -2775,6 +2775,7 @@ static bool evergreen_vm_reg_valid(u32 r
case CAYMAN_SQ_EX_ALLOC_TABLE_SLOTS:
return true;
default:
+   DRM_ERROR(Invalid register 0x%x in CS\n, reg);
return false;
}
 }


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 24/54] USB: whiteheat: fix memory leak in error path

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Johan Hovold jhov...@gmail.com

commit c129197c99550d356cf5f69b046994dd53cd1b9d upstream.

Make sure command buffer is deallocated in case of errors during attach.

Signed-off-by: Johan Hovold jhov...@gmail.com
Cc: supp...@connecttech.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

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

--- a/drivers/usb/serial/whiteheat.c
+++ b/drivers/usb/serial/whiteheat.c
@@ -525,6 +525,7 @@ no_firmware:
%s: please contact supp...@connecttech.com\n,
serial-type-description);
kfree(result);
+   kfree(command);
return -ENODEV;
 
 no_command_private:


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 35/54] ARM: SAMSUNG: Add naming of s3c64xx-spi devices

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Heiko Stuebner he...@sntech.de

commit 308b3afb97dc342e9c4f958d8b4c459ae0e22bd7 upstream.

Commit a5238e360b71 (spi: s3c64xx: move controller information into driver
data) introduced separate device names for the different subtypes of the
spi controller but forgot to set these in the relevant machines.

To fix this introduce a s3c64xx_spi_setname function and populate all
Samsung arches with the correct names. The function resides in a new
header, as the s3c64xx-spi.h contains driver platform data and should
therefore at some later point move out of the Samsung include dir.

Tested on a s3c2416-based machine.

Signed-off-by: Heiko Stuebner he...@sntech.de
Reviewed-by: Sylwester Nawrocki s.nawro...@samsung.com
[s.nawro...@samsung.com: tested on mach-exynos]
Tested-by: Sylwester Nawrocki s.nawro...@samsung.com
Signed-off-by: Kukjin Kim kgene@samsung.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 arch/arm/mach-exynos/common.c |5 
 arch/arm/mach-s3c24xx/s3c2416.c   |2 +
 arch/arm/mach-s3c24xx/s3c2443.c   |4 +++
 arch/arm/mach-s5p64x0/common.c|3 ++
 arch/arm/mach-s5pc100/common.c|3 ++
 arch/arm/mach-s5pv210/common.c|3 ++
 arch/arm/plat-samsung/include/plat/spi-core.h |   30 ++
 7 files changed, 50 insertions(+)

--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -44,6 +44,7 @@
 #include plat/fimc-core.h
 #include plat/iic-core.h
 #include plat/tv-core.h
+#include plat/spi-core.h
 #include plat/regs-serial.h
 
 #include common.h
@@ -338,6 +339,8 @@ static void __init exynos4_map_io(void)
 
s5p_fb_setname(0, exynos4-fb);
s5p_hdmi_setname(exynos4-hdmi);
+
+   s3c64xx_spi_setname(exynos4210-spi);
 }
 
 static void __init exynos5_map_io(void)
@@ -358,6 +361,8 @@ static void __init exynos5_map_io(void)
s3c_i2c0_setname(s3c2440-i2c);
s3c_i2c1_setname(s3c2440-i2c);
s3c_i2c2_setname(s3c2440-i2c);
+
+   s3c64xx_spi_setname(exynos4210-spi);
 }
 
 static void __init exynos4_init_clocks(int xtal)
--- a/arch/arm/mach-s3c24xx/s3c2416.c
+++ b/arch/arm/mach-s3c24xx/s3c2416.c
@@ -61,6 +61,7 @@
 #include plat/nand-core.h
 #include plat/adc-core.h
 #include plat/rtc-core.h
+#include plat/spi-core.h
 
 static struct map_desc s3c2416_iodesc[] __initdata = {
IODESC_ENT(WATCHDOG),
@@ -131,6 +132,7 @@ void __init s3c2416_map_io(void)
/* initialize device information early */
s3c2416_default_sdhci0();
s3c2416_default_sdhci1();
+   s3c64xx_spi_setname(s3c2443-spi);
 
iotable_init(s3c2416_iodesc, ARRAY_SIZE(s3c2416_iodesc));
 }
--- a/arch/arm/mach-s3c24xx/s3c2443.c
+++ b/arch/arm/mach-s3c24xx/s3c2443.c
@@ -43,6 +43,7 @@
 #include plat/nand-core.h
 #include plat/adc-core.h
 #include plat/rtc-core.h
+#include plat/spi-core.h
 
 static struct map_desc s3c2443_iodesc[] __initdata = {
IODESC_ENT(WATCHDOG),
@@ -100,6 +101,9 @@ void __init s3c2443_map_io(void)
s3c24xx_gpiocfg_default.set_pull = s3c2443_gpio_setpull;
s3c24xx_gpiocfg_default.get_pull = s3c2443_gpio_getpull;
 
+   /* initialize device information early */
+   s3c64xx_spi_setname(s3c2443-spi);
+
iotable_init(s3c2443_iodesc, ARRAY_SIZE(s3c2443_iodesc));
 }
 
--- a/arch/arm/mach-s5p64x0/common.c
+++ b/arch/arm/mach-s5p64x0/common.c
@@ -44,6 +44,7 @@
 #include plat/sdhci.h
 #include plat/adc-core.h
 #include plat/fb-core.h
+#include plat/spi-core.h
 #include plat/gpio-cfg.h
 #include plat/regs-irqtype.h
 #include plat/regs-serial.h
@@ -179,6 +180,7 @@ void __init s5p6440_map_io(void)
/* initialize any device information early */
s3c_adc_setname(s3c64xx-adc);
s3c_fb_setname(s5p64x0-fb);
+   s3c64xx_spi_setname(s5p64x0-spi);
 
s5p64x0_default_sdhci0();
s5p64x0_default_sdhci1();
@@ -193,6 +195,7 @@ void __init s5p6450_map_io(void)
/* initialize any device information early */
s3c_adc_setname(s3c64xx-adc);
s3c_fb_setname(s5p64x0-fb);
+   s3c64xx_spi_setname(s5p64x0-spi);
 
s5p64x0_default_sdhci0();
s5p64x0_default_sdhci1();
--- a/arch/arm/mach-s5pc100/common.c
+++ b/arch/arm/mach-s5pc100/common.c
@@ -45,6 +45,7 @@
 #include plat/fb-core.h
 #include plat/iic-core.h
 #include plat/onenand-core.h
+#include plat/spi-core.h
 #include plat/regs-serial.h
 #include plat/watchdog-reset.h
 
@@ -165,6 +166,8 @@ void __init s5pc100_map_io(void)
s3c_onenand_setname(s5pc100-onenand);
s3c_fb_setname(s5pc100-fb);
s3c_cfcon_setname(s5pc100-pata);
+
+   s3c64xx_spi_setname(s5pc100-spi);
 }
 
 void __init s5pc100_init_clocks(int xtal)
--- a/arch/arm/mach-s5pv210/common.c
+++ b/arch/arm/mach-s5pv210/common.c
@@ -43,6 +43,7 @@
 #include plat/iic-core.h
 #include plat/keypad

[ 46/54] cpufreq / powernow-k8: Remove usage of smp_processor_id() in preemptible code

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Andreas Herrmann andreas.herrma...@amd.com

commit e4df1cbcc1f329e53a1fff7450b2229e0addff20 upstream.

Commit 6889125b8b4e09c5e53e6ecab3433bed1ce198c9
(cpufreq/powernow-k8: workqueue user shouldn't migrate the kworker to another 
CPU)
causes powernow-k8 to trigger a preempt warning, e.g.:

  BUG: using smp_processor_id() in preemptible [] code: cpufreq/3776
  caller is powernowk8_target+0x20/0x49
  Pid: 3776, comm: cpufreq Not tainted 3.6.0 #9
  Call Trace:
   [8125b447] debug_smp_processor_id+0xc7/0xe0
   [814877e7] powernowk8_target+0x20/0x49
   [81482b02] __cpufreq_driver_target+0x82/0x8a
   [81484fc6] cpufreq_governor_performance+0x4e/0x54
   [81482c50] __cpufreq_governor+0x8c/0xc9
   [81482e6f] __cpufreq_set_policy+0x1a9/0x21e
   [814839af] store_scaling_governor+0x16f/0x19b
   [81484f16] ? cpufreq_update_policy+0x124/0x124
   [8162b4a5] ? _raw_spin_unlock_irqrestore+0x2c/0x49
   [81483640] store+0x60/0x88
   [811708c0] sysfs_write_file+0xf4/0x130
   [8111243b] vfs_write+0xb5/0x151
   [811126e0] sys_write+0x4a/0x71
   [816319a9] system_call_fastpath+0x16/0x1b

Fix this by by always using work_on_cpu().

Signed-off-by: Andreas Herrmann andreas.herrma...@amd.com
Signed-off-by: Rafael J. Wysocki rafael.j.wyso...@intel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/cpufreq/powernow-k8.c |9 +
 1 file changed, 1 insertion(+), 8 deletions(-)

--- a/drivers/cpufreq/powernow-k8.c
+++ b/drivers/cpufreq/powernow-k8.c
@@ -1223,14 +1223,7 @@ static int powernowk8_target(struct cpuf
struct powernowk8_target_arg pta = { .pol = pol, .targfreq = targfreq,
 .relation = relation };
 
-   /*
-* Must run on @pol-cpu.  cpufreq core is responsible for ensuring
-* that we're bound to the current CPU and pol-cpu stays online.
-*/
-   if (smp_processor_id() == pol-cpu)
-   return powernowk8_target_fn(pta);
-   else
-   return work_on_cpu(pol-cpu, powernowk8_target_fn, pta);
+   return work_on_cpu(pol-cpu, powernowk8_target_fn, pta);
 }
 
 /* Driver entry point to verify the policy and range of frequencies */


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 52/54] staging: comedi: amplc_pc236: fix invalid register access during detach

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Ian Abbott abbo...@mev.co.uk

commit aaeb61a97b7159ebe30b18a422d04eeabfa8790b upstream.

`pc236_detach()` is called by the comedi core if it attempted to attach
a device and failed.  `pc236_detach()` calls `pc236_intr_disable()` if
the comedi device private data pointer (`devpriv`) is non-null.  This
test is insufficient as `pc236_intr_disable()` accesses hardware
registers and the attach routine may have failed before it has saved
their I/O base addresses.

Fix it by checking `dev-iobase` is non-zero before calling
`pc236_intr_disable()` as that means the I/O base addresses have been
saved and the hardware registers can be accessed.  It also implies the
comedi device private data pointer is valid, so there is no need to
check it.

Signed-off-by: Ian Abbott abbo...@mev.co.uk
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/staging/comedi/drivers/amplc_pc236.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/staging/comedi/drivers/amplc_pc236.c
+++ b/drivers/staging/comedi/drivers/amplc_pc236.c
@@ -468,7 +468,7 @@ static int pc236_detach(struct comedi_de
 {
printk(KERN_DEBUG comedi%d: %s: detach\n, dev-minor,
   PC236_DRIVER_NAME);
-   if (devpriv)
+   if (dev-iobase)
pc236_intr_disable(dev);
 
if (dev-irq)


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 49/54] x86, mm: Undo incorrect revert in arch/x86/mm/init.c

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Yinghai Lu ying...@kernel.org

commit f82f64dd9f485e13f29f369772d4a0e868e5633a upstream.

Commit

844ab6f9 x86, mm: Find_early_table_space based on ranges that are actually 
being mapped

added back some lines back wrongly that has been removed in commit

7b16bbf97 Revert x86/mm: Fix the size calculation of mapping tables

remove them again.

Signed-off-by: Yinghai Lu ying...@kernel.org
Link: 
http://lkml.kernel.org/r/CAE9FiQW_vuaYQbmagVnxT2DGsYc=9tneabdbq53sykitpow...@mail.gmail.com
Acked-by: Jacob Shin jacob.s...@amd.com
Signed-off-by: H. Peter Anvin h...@linux.intel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 arch/x86/mm/init.c |4 
 1 file changed, 4 deletions(-)

--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -65,10 +65,6 @@ static void __init find_early_table_spac
 #ifdef CONFIG_X86_32
extra += PMD_SIZE;
 #endif
-   /* The first 2/4M doesn't use large pages. */
-   if (mr[i].start  PMD_SIZE)
-   extra += range;
-
ptes += (extra + PAGE_SIZE - 1)  PAGE_SHIFT;
} else {
ptes += (range + PAGE_SIZE - 1)  PAGE_SHIFT;


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 53/54] x86, mm: Use memblock memory loop instead of e820_RAM

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Yinghai Lu ying...@kernel.org

commit 1f2ff682ac951ed82cc043cf140d2851084512df upstream.

We need to handle E820_RAM and E820_RESERVED_KERNEL at the same time.

Also memblock has page aligned range for ram, so we could avoid mapping
partial pages.

Signed-off-by: Yinghai Lu ying...@kernel.org
Link: 
http://lkml.kernel.org/r/cae9fiqvzirvabmfyrfxmmwechbksicqehz4vawuv0xfck51...@mail.gmail.com
Acked-by: Jacob Shin jacob.s...@amd.com
Signed-off-by: H. Peter Anvin h...@linux.intel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 arch/x86/kernel/setup.c |   15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -928,18 +928,19 @@ void __init setup_arch(char **cmdline_p)
 #ifdef CONFIG_X86_64
if (max_pfn  max_low_pfn) {
int i;
-   for (i = 0; i  e820.nr_map; i++) {
-   struct e820entry *ei = e820.map[i];
+   unsigned long start, end;
+   unsigned long start_pfn, end_pfn;
 
-   if (ei-addr + ei-size = 1UL  32)
-   continue;
+   for_each_mem_pfn_range(i, MAX_NUMNODES, start_pfn, end_pfn,
+NULL) {
 
-   if (ei-type == E820_RESERVED)
+   end = PFN_PHYS(end_pfn);
+   if (end = (1UL32))
continue;
 
+   start = PFN_PHYS(start_pfn);
max_pfn_mapped = init_memory_mapping(
-   ei-addr  1UL  32 ? 1UL  32 : ei-addr,
-   ei-addr + ei-size);
+   max((1UL32), start), end);
}
 
/* can we preseve max_low_pfn ?*/


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 50/54] efi: Defer freeing boot services memory until after ACPI init

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Josh Triplett j...@joshtriplett.org

commit 785107923a83d8456bbd8564e288a24d84109a46 upstream.

Some new ACPI 5.0 tables reference resources stored in boot services
memory, so keep that memory around until we have ACPI and can extract
data from it.

Signed-off-by: Josh Triplett j...@joshtriplett.org
Link: 
http://lkml.kernel.org/r/baaa6d44bdc4eb0c58e5d1b4ccd2c729f854ac55.1348876882.git.j...@joshtriplett.org
Signed-off-by: H. Peter Anvin h...@linux.intel.com
Cc: Matt Fleming m...@console-pimps.org
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 arch/x86/platform/efi/efi.c |   31 ++-
 include/linux/efi.h |5 +
 init/main.c |3 +++
 3 files changed, 26 insertions(+), 13 deletions(-)

--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -419,10 +419,21 @@ void __init efi_reserve_boot_services(vo
}
 }
 
-static void __init efi_free_boot_services(void)
+static void __init efi_unmap_memmap(void)
+{
+   if (memmap.map) {
+   early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size);
+   memmap.map = NULL;
+   }
+}
+
+void __init efi_free_boot_services(void)
 {
void *p;
 
+   if (!efi_native)
+   return;
+
for (p = memmap.map; p  memmap.map_end; p += memmap.desc_size) {
efi_memory_desc_t *md = p;
unsigned long long start = md-phys_addr;
@@ -438,6 +449,8 @@ static void __init efi_free_boot_service
 
free_bootmem_late(start, size);
}
+
+   efi_unmap_memmap();
 }
 
 static int __init efi_systab_init(void *phys)
@@ -787,8 +800,10 @@ void __init efi_enter_virtual_mode(void)
 * non-native EFI
 */
 
-   if (!efi_native)
-   goto out;
+   if (!efi_native) {
+   efi_unmap_memmap();
+   return;
+   }
 
/* Merge contiguous regions of the same type and attribute */
for (p = memmap.map; p  memmap.map_end; p += memmap.desc_size) {
@@ -878,13 +893,6 @@ void __init efi_enter_virtual_mode(void)
}
 
/*
-* Thankfully, it does seem that no runtime services other than
-* SetVirtualAddressMap() will touch boot services code, so we can
-* get rid of it all at this point
-*/
-   efi_free_boot_services();
-
-   /*
 * Now that EFI is in virtual mode, update the function
 * pointers in the runtime service table to the new virtual addresses.
 *
@@ -907,9 +915,6 @@ void __init efi_enter_virtual_mode(void)
if (__supported_pte_mask  _PAGE_NX)
runtime_code_page_mkexec();
 
-out:
-   early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size);
-   memmap.map = NULL;
kfree(new_memmap);
 }
 
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -496,6 +496,11 @@ extern void efi_map_pal_code (void);
 extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg);
 extern void efi_gettimeofday (struct timespec *ts);
 extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, 
if possible */
+#ifdef CONFIG_X86
+extern void efi_free_boot_services(void);
+#else
+static inline void efi_free_boot_services(void) {}
+#endif
 extern u64 efi_get_iobase (void);
 extern u32 efi_mem_type (unsigned long phys_addr);
 extern u64 efi_mem_attributes (unsigned long phys_addr);
--- a/init/main.c
+++ b/init/main.c
@@ -630,6 +630,9 @@ asmlinkage void __init start_kernel(void
acpi_early_init(); /* before LAPIC and SMP init */
sfi_init_late();
 
+   if (efi_enabled)
+   efi_free_boot_services();
+
ftrace_init();
 
/* Do the rest non-__init'ed, we're now alive */


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 51/54] x86: efi: Turn off efi_enabled after setup on mixed fw/kernel

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Olof Johansson o...@lixom.net

commit 5189c2a7c7769ee9d037d76c1a7b8550ccf3481c upstream.

When 32-bit EFI is used with 64-bit kernel (or vice versa), turn off
efi_enabled once setup is done. Beyond setup, it is normally used to
determine if runtime services are available and we will have none.

This will resolve issues stemming from efivars modprobe panicking on a
32/64-bit setup, as well as some reboot issues on similar setups.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=45991

Reported-by: Marko Kohtala marko.koht...@gmail.com
Reported-by: Maxim Kammerer m...@dee.su
Signed-off-by: Olof Johansson o...@lixom.net
Acked-by: Maarten Lankhorst maarten.lankho...@canonical.com
Cc: Matthew Garrett m...@redhat.com
Signed-off-by: Matt Fleming matt.flem...@intel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 arch/x86/include/asm/efi.h  |1 +
 arch/x86/kernel/setup.c |   12 
 arch/x86/platform/efi/efi.c |   18 ++
 3 files changed, 23 insertions(+), 8 deletions(-)

--- a/arch/x86/include/asm/efi.h
+++ b/arch/x86/include/asm/efi.h
@@ -98,6 +98,7 @@ extern void efi_set_executable(efi_memor
 extern int efi_memblock_x86_reserve_range(void);
 extern void efi_call_phys_prelog(void);
 extern void efi_call_phys_epilog(void);
+extern void efi_unmap_memmap(void);
 
 #ifndef CONFIG_EFI
 /*
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -1053,6 +1053,18 @@ void __init setup_arch(char **cmdline_p)
mcheck_init();
 
arch_init_ideal_nops();
+
+#ifdef CONFIG_EFI
+   /* Once setup is done above, disable efi_enabled on mismatched
+* firmware/kernel archtectures since there is no support for
+* runtime services.
+*/
+   if (efi_enabled  IS_ENABLED(CONFIG_X86_64) != efi_64bit) {
+   pr_info(efi: Setup done, disabling due to 32/64-bit 
mismatch\n);
+   efi_unmap_memmap();
+   efi_enabled = 0;
+   }
+#endif
 }
 
 #ifdef CONFIG_X86_32
--- a/arch/x86/platform/efi/efi.c
+++ b/arch/x86/platform/efi/efi.c
@@ -69,11 +69,15 @@ EXPORT_SYMBOL(efi);
 struct efi_memory_map memmap;
 
 bool efi_64bit;
-static bool efi_native;
 
 static struct efi efi_phys __initdata;
 static efi_system_table_t efi_systab __initdata;
 
+static inline bool efi_is_native(void)
+{
+   return IS_ENABLED(CONFIG_X86_64) == efi_64bit;
+}
+
 static int __init setup_noefi(char *arg)
 {
efi_enabled = 0;
@@ -419,7 +423,7 @@ void __init efi_reserve_boot_services(vo
}
 }
 
-static void __init efi_unmap_memmap(void)
+void __init efi_unmap_memmap(void)
 {
if (memmap.map) {
early_iounmap(memmap.map, memmap.nr_map * memmap.desc_size);
@@ -431,7 +435,7 @@ void __init efi_free_boot_services(void)
 {
void *p;
 
-   if (!efi_native)
+   if (!efi_is_native())
return;
 
for (p = memmap.map; p  memmap.map_end; p += memmap.desc_size) {
@@ -683,12 +687,10 @@ void __init efi_init(void)
return;
}
efi_phys.systab = (efi_system_table_t *)boot_params.efi_info.efi_systab;
-   efi_native = !efi_64bit;
 #else
efi_phys.systab = (efi_system_table_t *)
  (boot_params.efi_info.efi_systab |
  ((__u64)boot_params.efi_info.efi_systab_hi32));
-   efi_native = efi_64bit;
 #endif
 
if (efi_systab_init(efi_phys.systab)) {
@@ -722,7 +724,7 @@ void __init efi_init(void)
 * that doesn't match the kernel 32/64-bit mode.
 */
 
-   if (!efi_native)
+   if (!efi_is_native())
pr_info(No EFI runtime due to 32/64-bit mismatch with 
kernel\n);
else if (efi_runtime_init()) {
efi_enabled = 0;
@@ -734,7 +736,7 @@ void __init efi_init(void)
return;
}
 #ifdef CONFIG_X86_32
-   if (efi_native) {
+   if (efi_is_native()) {
x86_platform.get_wallclock = efi_get_time;
x86_platform.set_wallclock = efi_set_rtc_mmss;
}
@@ -800,7 +802,7 @@ void __init efi_enter_virtual_mode(void)
 * non-native EFI
 */
 
-   if (!efi_native) {
+   if (!efi_is_native()) {
efi_unmap_memmap();
return;
}


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 54/54] drm/i915: no lvds quirk for Zotac ZDBOX SD ID12/ID13

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Sjoerd Simons sjoerd.sim...@collabora.co.uk

commit 9756fe38d10b2bf90c81dc4d2f17d5632e135364 upstream.

This box claims to have an LVDS interface but doesn't
actually have one.

Signed-off-by: Sjoerd Simons sjoerd.sim...@collabora.co.uk
Signed-off-by: Daniel Vetter daniel.vet...@ffwll.ch
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/gpu/drm/i915/intel_lvds.c |8 
 1 file changed, 8 insertions(+)

--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -777,6 +777,14 @@ static const struct dmi_system_id intel_
DMI_MATCH(DMI_BOARD_NAME, MS-7469),
},
},
+   {
+   .callback = intel_no_lvds_dmi_callback,
+   .ident = ZOTAC ZBOXSD-ID12/ID13,
+   .matches = {
+   DMI_MATCH(DMI_BOARD_VENDOR, ZOTAC),
+   DMI_MATCH(DMI_BOARD_NAME, ZBOXSD-ID12/ID13),
+   },
+   },
 
{ } /* terminating entry */
 };


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 45/54] bcma: fix unregistration of cores

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Piotr Haber pha...@broadcom.com

commit 1fffa905adffbf0d3767fc978ef09afb830275eb upstream.

When cores are unregistered, entries
need to be removed from cores list in a safe manner.

Reported-by: Stanislaw Gruszka sgrus...@redhat.com
Reviewed-by: Arend Van Spriel ar...@broadcom.com
Signed-off-by: Piotr Haber pha...@broadcom.com
Signed-off-by: John W. Linville linvi...@tuxdriver.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/bcma/main.c |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -131,9 +131,10 @@ static int bcma_register_cores(struct bc
 
 static void bcma_unregister_cores(struct bcma_bus *bus)
 {
-   struct bcma_device *core;
+   struct bcma_device *core, *tmp;
 
-   list_for_each_entry(core, bus-cores, list) {
+   list_for_each_entry_safe(core, tmp, bus-cores, list) {
+   list_del(core-list);
if (core-dev_registered)
device_unregister(core-dev);
}


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 48/54] x86, mm: Find_early_table_space based on ranges that are actually being mapped

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Jacob Shin jacob.s...@amd.com

commit 844ab6f993b1d32eb40512503d35ff6ad0c57030 upstream.

Current logic finds enough space for direct mapping page tables from 0
to end. Instead, we only need to find enough space to cover mr[0].start
to mr[nr_range].end -- the range that is actually being mapped by
init_memory_mapping()

This is needed after 1e779aabe1f0768c2bf8f8c0a5583679b54a, to address
the panic reported here:

  https://lkml.org/lkml/2012/10/20/160
  https://lkml.org/lkml/2012/10/21/157

Signed-off-by: Jacob Shin jacob.s...@amd.com
Link: http://lkml.kernel.org/r/20121024195311.GB11779@jshin-Toonie
Tested-by: Tom Rini tr...@ti.com
Signed-off-by: H. Peter Anvin h...@linux.intel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 arch/x86/mm/init.c |   73 +++--
 1 file changed, 43 insertions(+), 30 deletions(-)

--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -29,36 +29,54 @@ int direct_gbpages
 #endif
 ;
 
-static void __init find_early_table_space(unsigned long end, int use_pse,
- int use_gbpages)
+struct map_range {
+   unsigned long start;
+   unsigned long end;
+   unsigned page_size_mask;
+};
+
+/*
+ * First calculate space needed for kernel direct mapping page tables to cover
+ * mr[0].start to mr[nr_range - 1].end, while accounting for possible 2M and 
1GB
+ * pages. Then find enough contiguous space for those page tables.
+ */
+static void __init find_early_table_space(struct map_range *mr, int nr_range)
 {
-   unsigned long puds, pmds, ptes, tables, start = 0, good_end = end;
+   int i;
+   unsigned long puds = 0, pmds = 0, ptes = 0, tables;
+   unsigned long start = 0, good_end;
phys_addr_t base;
 
-   puds = (end + PUD_SIZE - 1)  PUD_SHIFT;
-   tables = roundup(puds * sizeof(pud_t), PAGE_SIZE);
+   for (i = 0; i  nr_range; i++) {
+   unsigned long range, extra;
 
-   if (use_gbpages) {
-   unsigned long extra;
+   range = mr[i].end - mr[i].start;
+   puds += (range + PUD_SIZE - 1)  PUD_SHIFT;
 
-   extra = end - ((endPUD_SHIFT)  PUD_SHIFT);
-   pmds = (extra + PMD_SIZE - 1)  PMD_SHIFT;
-   } else
-   pmds = (end + PMD_SIZE - 1)  PMD_SHIFT;
-
-   tables += roundup(pmds * sizeof(pmd_t), PAGE_SIZE);
+   if (mr[i].page_size_mask  (1  PG_LEVEL_1G)) {
+   extra = range - ((range  PUD_SHIFT)  PUD_SHIFT);
+   pmds += (extra + PMD_SIZE - 1)  PMD_SHIFT;
+   } else {
+   pmds += (range + PMD_SIZE - 1)  PMD_SHIFT;
+   }
 
-   if (use_pse) {
-   unsigned long extra;
-
-   extra = end - ((endPMD_SHIFT)  PMD_SHIFT);
+   if (mr[i].page_size_mask  (1  PG_LEVEL_2M)) {
+   extra = range - ((range  PMD_SHIFT)  PMD_SHIFT);
 #ifdef CONFIG_X86_32
-   extra += PMD_SIZE;
+   extra += PMD_SIZE;
 #endif
-   ptes = (extra + PAGE_SIZE - 1)  PAGE_SHIFT;
-   } else
-   ptes = (end + PAGE_SIZE - 1)  PAGE_SHIFT;
+   /* The first 2/4M doesn't use large pages. */
+   if (mr[i].start  PMD_SIZE)
+   extra += range;
+
+   ptes += (extra + PAGE_SIZE - 1)  PAGE_SHIFT;
+   } else {
+   ptes += (range + PAGE_SIZE - 1)  PAGE_SHIFT;
+   }
+   }
 
+   tables = roundup(puds * sizeof(pud_t), PAGE_SIZE);
+   tables += roundup(pmds * sizeof(pmd_t), PAGE_SIZE);
tables += roundup(ptes * sizeof(pte_t), PAGE_SIZE);
 
 #ifdef CONFIG_X86_32
@@ -75,8 +93,9 @@ static void __init find_early_table_spac
pgt_buf_end = pgt_buf_start;
pgt_buf_top = pgt_buf_start + (tables  PAGE_SHIFT);
 
-   printk(KERN_DEBUG kernel direct mapping tables up to %lx @ %lx-%lx\n,
-   end, pgt_buf_start  PAGE_SHIFT, pgt_buf_top  PAGE_SHIFT);
+   printk(KERN_DEBUG kernel direct mapping tables up to %#lx @ [mem 
%#010lx-%#010lx]\n,
+   mr[nr_range - 1].end - 1, pgt_buf_start  PAGE_SHIFT,
+   (pgt_buf_top  PAGE_SHIFT) - 1);
 }
 
 void __init native_pagetable_reserve(u64 start, u64 end)
@@ -84,12 +103,6 @@ void __init native_pagetable_reserve(u64
memblock_reserve(start, end - start);
 }
 
-struct map_range {
-   unsigned long start;
-   unsigned long end;
-   unsigned page_size_mask;
-};
-
 #ifdef CONFIG_X86_32
 #define NR_RANGE_MR 3
 #else /* CONFIG_X86_64 */
@@ -261,7 +274,7 @@ unsigned long __init_refok init_memory_m
 * nodes are discovered.
 */
if (!after_bootmem)
-   find_early_table_space(end, use_pse, use_gbpages

[ 47/54] Revert ath9k_hw: Updated AR9003 tx gain table for 5GHz

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Felix Fietkau n...@openwrt.org

commit 73b26df5fa1a6245d6fc982362518b620bc7c2fe upstream.

This reverts commit a240dc7b3c7463bd60cf0a9b2a90f52f78aae0fd.

This commit is reducing tx power by at least 10 db on some devices,
e.g. the Buffalo WZR-HP-G450H.

Signed-off-by: Felix Fietkau n...@openwrt.org
Cc: rmano...@qca.qualcomm.com
Signed-off-by: John W. Linville linvi...@tuxdriver.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h |  164 +--
 1 file changed, 82 insertions(+), 82 deletions(-)

--- a/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
+++ b/drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h
@@ -533,107 +533,107 @@ static const u32 ar9300_2p2_baseband_cor
 
 static const u32 ar9300Modes_high_power_tx_gain_table_2p2[][5] = {
/* Addr  5G_HT20 5G_HT40 2G_HT40 2G_HT20   */
-   {0xa2dc, 0x000cfff0, 0x000cfff0, 0x03aaa352, 0x03aaa352},
-   {0xa2e0, 0x000f, 0x000f, 0x03ccc584, 0x03ccc584},
-   {0xa2e4, 0x03f0, 0x03f0, 0x03f0f800, 0x03f0f800},
+   {0xa2dc, 0x00033800, 0x00033800, 0x03aaa352, 0x03aaa352},
+   {0xa2e0, 0x0003c000, 0x0003c000, 0x03ccc584, 0x03ccc584},
+   {0xa2e4, 0x03fc, 0x03fc, 0x03f0f800, 0x03f0f800},
{0xa2e8, 0x, 0x, 0x03ff, 0x03ff},
{0xa410, 0x50d9, 0x50d9, 0x50d9, 0x50d9},
{0xa500, 0x, 0x, 0x, 0x},
{0xa504, 0x0603, 0x0603, 0x0402, 0x0402},
{0xa508, 0x0a20, 0x0a20, 0x0804, 0x0804},
{0xa50c, 0x1023, 0x1023, 0x0b000200, 0x0b000200},
-   {0xa510, 0x1528, 0x1528, 0x0f000202, 0x0f000202},
-   {0xa514, 0x1b2b, 0x1b2b, 0x12000400, 0x12000400},
-   {0xa518, 0x1f020028, 0x1f020028, 0x16000402, 0x16000402},
-   {0xa51c, 0x2502002b, 0x2502002b, 0x19000404, 0x19000404},
-   {0xa520, 0x2a04002a, 0x2a04002a, 0x1c000603, 0x1c000603},
-   {0xa524, 0x2e06002a, 0x2e06002a, 0x21000a02, 0x21000a02},
-   {0xa528, 0x3302202d, 0x3302202d, 0x25000a04, 0x25000a04},
-   {0xa52c, 0x3804202c, 0x3804202c, 0x28000a20, 0x28000a20},
-   {0xa530, 0x3c06202c, 0x3c06202c, 0x2c000e20, 0x2c000e20},
-   {0xa534, 0x4108202d, 0x4108202d, 0x3e22, 0x3e22},
-   {0xa538, 0x4506402d, 0x4506402d, 0x34000e24, 0x34000e24},
-   {0xa53c, 0x4906222d, 0x4906222d, 0x38001640, 0x38001640},
-   {0xa540, 0x4d062231, 0x4d062231, 0x3c001660, 0x3c001660},
-   {0xa544, 0x50082231, 0x50082231, 0x3f001861, 0x3f001861},
-   {0xa548, 0x5608422e, 0x5608422e, 0x43001a81, 0x43001a81},
-   {0xa54c, 0x5a08442e, 0x5a08442e, 0x47001a83, 0x47001a83},
-   {0xa550, 0x5e0a4431, 0x5e0a4431, 0x4a001c84, 0x4a001c84},
-   {0xa554, 0x640a4432, 0x640a4432, 0x4e001ce3, 0x4e001ce3},
-   {0xa558, 0x680a4434, 0x680a4434, 0x52001ce5, 0x52001ce5},
-   {0xa55c, 0x6c0a6434, 0x6c0a6434, 0x56001ce9, 0x56001ce9},
-   {0xa560, 0x6f0a6633, 0x6f0a6633, 0x5a001ceb, 0x5a001ceb},
-   {0xa564, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
-   {0xa568, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
-   {0xa56c, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
-   {0xa570, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
-   {0xa574, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
-   {0xa578, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
-   {0xa57c, 0x730c6634, 0x730c6634, 0x5d001eec, 0x5d001eec},
+   {0xa510, 0x16000220, 0x16000220, 0x0f000202, 0x0f000202},
+   {0xa514, 0x1c000223, 0x1c000223, 0x12000400, 0x12000400},
+   {0xa518, 0x21002220, 0x21002220, 0x16000402, 0x16000402},
+   {0xa51c, 0x27002223, 0x27002223, 0x19000404, 0x19000404},
+   {0xa520, 0x2b00, 0x2b00, 0x1c000603, 0x1c000603},
+   {0xa524, 0x2f02, 0x2f02, 0x21000a02, 0x21000a02},
+   {0xa528, 0x3405, 0x3405, 0x25000a04, 0x25000a04},
+   {0xa52c, 0x3a0a, 0x3a0a, 0x28000a20, 0x28000a20},
+   {0xa530, 0x3e0c, 0x3e0c, 0x2c000e20, 0x2c000e20},
+   {0xa534, 0x4202242a, 0x4202242a, 0x3e22, 0x3e22},
+   {0xa538, 0x4702244a, 0x4702244a, 0x34000e24, 0x34000e24},
+   {0xa53c, 0x4b02244c, 0x4b02244c, 0x38001640, 0x38001640},
+   {0xa540, 0x4e02246c, 0x4e02246c, 0x3c001660, 0x3c001660},
+   {0xa544, 0x52022470, 0x52022470, 0x3f001861, 0x3f001861},
+   {0xa548, 0x55022490, 0x55022490, 0x43001a81, 0x43001a81},
+   {0xa54c, 0x59022492, 0x59022492, 0x47001a83, 0x47001a83},
+   {0xa550, 0x5d022692, 0x5d022692, 0x4a001c84, 0x4a001c84

[ 36/54] ARM: at91/tc: fix typo in the DT document

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Josh Wu josh...@atmel.com

commit 11930c530f3edf81160e4962e363d579f5cdce7e upstream.

Signed-off-by: Josh Wu josh...@atmel.com
Signed-off-by: Nicolas Ferre nicolas.fe...@atmel.com
Acked-by: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 Documentation/devicetree/bindings/arm/atmel-at91.txt |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/Documentation/devicetree/bindings/arm/atmel-at91.txt
+++ b/Documentation/devicetree/bindings/arm/atmel-at91.txt
@@ -8,7 +8,7 @@ PIT Timer required properties:
   shared across all System Controller members.
 
 TC/TCLIB Timer required properties:
-- compatible: Should be atmel,chip-pit.
+- compatible: Should be atmel,chip-tcb.
   chip can be at91rm9200 or at91sam9x5
 - reg: Should contain registers location and length
 - interrupts: Should contain all interrupts for the TC block


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 21/54] ehci: Add yet-another Lucid nohandoff pci quirk

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Anisse Astier ani...@astier.eu

commit 8daf8b6086f9d575200cd0aa3797e26137255609 upstream.

Board name changed on another shipping Lucid tablet.

Signed-off-by: Anisse Astier ani...@astier.eu
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/usb/host/pci-quirks.c |7 +++
 1 file changed, 7 insertions(+)

--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -548,6 +548,13 @@ static const struct dmi_system_id __devi
DMI_MATCH(DMI_BIOS_VERSION, Lucid-),
},
},
+   {
+   /*  Pegatron Lucid (Ordissimo) */
+   .matches = {
+   DMI_MATCH(DMI_BOARD_NAME, Ordissimo),
+   DMI_MATCH(DMI_BIOS_VERSION, Lucid-),
+   },
+   },
{ }
 };
 


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 33/54] USB: mos7840: remove invalid disconnect handling

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Johan Hovold jhov...@gmail.com

commit e681b66f2e19fadbe8a7e2a17900978cb6bc921f upstream.

Remove private zombie flag used to signal disconnect and to prevent
control urb from being submitted from interrupt urb completion handler.

The control urb will not be re-submitted as both the control urb and the
interrupt urb is killed on disconnect.

Signed-off-by: Johan Hovold jhov...@gmail.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/usb/serial/mos7840.c |   13 +
 1 file changed, 1 insertion(+), 12 deletions(-)

--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -239,7 +239,6 @@ struct moschip_port {
__u8 shadowMCR; /* last MCR value received */
char open;
char open_ports;
-   char zombie;
wait_queue_head_t wait_chase;   /* for handling sleeping while waiting 
for chase to finish */
wait_queue_head_t delta_msr_wait;   /* for handling sleeping while 
waiting for msr change to happen */
int delta_msr_cond;
@@ -642,14 +641,7 @@ static void mos7840_interrupt_callback(s
wreg = MODEM_STATUS_REGISTER;
break;
}
-   spin_lock(mos7840_port-pool_lock);
-   if (!mos7840_port-zombie) {
-   rv = mos7840_get_reg(mos7840_port, 
wval, wreg, Data);
-   } else {
-   spin_unlock(mos7840_port-pool_lock);
-   return;
-   }
-   spin_unlock(mos7840_port-pool_lock);
+   rv = mos7840_get_reg(mos7840_port, wval, wreg, 
Data);
}
}
}
@@ -2607,9 +2599,6 @@ static void mos7840_disconnect(struct us
mos7840_port = mos7840_get_port_private(serial-port[i]);
dbg (mos7840_port %d = %p, i, mos7840_port);
if (mos7840_port) {
-   spin_lock_irqsave(mos7840_port-pool_lock, flags);
-   mos7840_port-zombie = 1;
-   spin_unlock_irqrestore(mos7840_port-pool_lock, flags);
usb_kill_urb(mos7840_port-control_urb);
}
}


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 44/54] dmaengine: imx-dma: fix missing unlock on error in imxdma_xfer_desc()

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Wei Yongjun yongjun_...@trendmicro.com.cn

commit 720dfd250e48a8c7fd1b2b8645955413989c4ee0 upstream.

Add the missing unlock on the error handling path in function
imxdma_xfer_desc().

Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn
Signed-off-by: Vinod Koul vinod.k...@linux.intel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/dma/imx-dma.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -473,8 +473,10 @@ static int imxdma_xfer_desc(struct imxdm
slot = i;
break;
}
-   if (slot  0)
+   if (slot  0) {
+   spin_unlock_irqrestore(imxdma-lock, flags);
return -EBUSY;
+   }
 
imxdma-slots_2d[slot].xsr = d-x;
imxdma-slots_2d[slot].ysr = d-y;


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 43/54] dmaengine: sirf: fix a typo in moving running dma_desc to active queue

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Barry Song baohua.s...@csr.com

commit 26fd12209c08fe947be1828896ef4ffc5bd0e6df upstream.

list_move_tail(schan-queued, schan-active) makes the 
list_empty(schan-queued)
undefined, we either should change it to:
list_move_tail(schan-queued.next, schan-active)
or
list_move_tail(sdesc-node, schan-active)

Signed-off-by: Barry Song baohua.s...@csr.com
Signed-off-by: Vinod Koul vinod.k...@linux.intel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

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

--- a/drivers/dma/sirf-dma.c
+++ b/drivers/dma/sirf-dma.c
@@ -109,7 +109,7 @@ static void sirfsoc_dma_execute(struct s
sdesc = list_first_entry(schan-queued, struct sirfsoc_dma_desc,
node);
/* Move the first queued descriptor to active list */
-   list_move_tail(schan-queued, schan-active);
+   list_move_tail(sdesc-node, schan-active);
 
/* Start the DMA transfer */
writel_relaxed(sdesc-width, sdma-base + SIRFSOC_DMA_WIDTH_0 +


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 39/54] mac80211: check if key has TKIP type before updating IV

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Stanislaw Gruszka sgrus...@redhat.com

commit 4045f72bcf3c293c7c5932ef001742d8bb5ded76 upstream.

This patch fix corruption which can manifest itself by following crash
when switching on rfkill switch with rt2x00 driver:
https://bugzilla.redhat.com/attachment.cgi?id=615362

Pointer key-u.ccmp.tfm of group key get corrupted in:

ieee80211_rx_h_michael_mic_verify():

/* update IV in key information to be able to detect replays */
rx-key-u.tkip.rx[rx-security_idx].iv32 = rx-tkip_iv32;
rx-key-u.tkip.rx[rx-security_idx].iv16 = rx-tkip_iv16;

because rt2x00 always set RX_FLAG_MMIC_STRIPPED, even if key is not TKIP.

We already check type of the key in different path in
ieee80211_rx_h_michael_mic_verify() function, so adding additional
check here is reasonable.

Signed-off-by: Stanislaw Gruszka sgrus...@redhat.com
Signed-off-by: John W. Linville linvi...@tuxdriver.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 net/mac80211/wpa.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/net/mac80211/wpa.c
+++ b/net/mac80211/wpa.c
@@ -106,7 +106,8 @@ ieee80211_rx_h_michael_mic_verify(struct
if (status-flag  RX_FLAG_MMIC_ERROR)
goto mic_fail;
 
-   if (!(status-flag  RX_FLAG_IV_STRIPPED)  rx-key)
+   if (!(status-flag  RX_FLAG_IV_STRIPPED)  rx-key 
+   rx-key-conf.cipher == WLAN_CIPHER_SUITE_TKIP)
goto update_iv;
 
return RX_CONTINUE;


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 42/54] dmaengine: sirf: fix a typo in dma_prep_interleaved

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Barry Song baohua.s...@csr.com

commit 5997e089e4c3a7f0958a8fb0a54ec2b5a6f06168 upstream.

either DEV_TO_MEM or MEM_TO_DEV is supported, so change
OR to AND.

Signed-off-by: Barry Song baohua.s...@csr.com
Signed-off-by: Vinod Koul vinod.k...@linux.intel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

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

--- a/drivers/dma/sirf-dma.c
+++ b/drivers/dma/sirf-dma.c
@@ -428,7 +428,7 @@ static struct dma_async_tx_descriptor *s
unsigned long iflags;
int ret;
 
-   if ((xt-dir != DMA_MEM_TO_DEV) || (xt-dir != DMA_DEV_TO_MEM)) {
+   if ((xt-dir != DMA_MEM_TO_DEV)  (xt-dir != DMA_DEV_TO_MEM)) {
ret = -EINVAL;
goto err_dir;
}


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 40/54] Bluetooth: SMP: Fix setting unknown auth_req bits

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Johan Hedberg johan.hedb...@intel.com

commit 065a13e2cc665f6547dc7e8a9d6b6565badf940a upstream.

When sending a pairing request or response we should not just blindly
copy the value that the remote device sent. Instead we should at least
make sure to mask out any unknown bits. This is particularly critical
from the upcoming LE Secure Connections feature perspective as
incorrectly indicating support for it (by copying the remote value)
would cause a failure to pair with devices that support it.

Signed-off-by: Johan Hedberg johan.hedb...@intel.com
Acked-by: Marcel Holtmann mar...@holtmann.org
Signed-off-by: Gustavo Padovan gustavo.pado...@collabora.co.uk
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 net/bluetooth/smp.c |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -31,6 +31,8 @@
 
 #define SMP_TIMEOUTmsecs_to_jiffies(3)
 
+#define AUTH_REQ_MASK   0x07
+
 static inline void swap128(u8 src[16], u8 dst[16])
 {
int i;
@@ -229,7 +231,7 @@ static void build_pairing_cmd(struct l2c
req-max_key_size = SMP_MAX_ENC_KEY_SIZE;
req-init_key_dist = 0;
req-resp_key_dist = dist_keys;
-   req-auth_req = authreq;
+   req-auth_req = (authreq  AUTH_REQ_MASK);
return;
}
 
@@ -238,7 +240,7 @@ static void build_pairing_cmd(struct l2c
rsp-max_key_size = SMP_MAX_ENC_KEY_SIZE;
rsp-init_key_dist = 0;
rsp-resp_key_dist = req-resp_key_dist  dist_keys;
-   rsp-auth_req = authreq;
+   rsp-auth_req = (authreq  AUTH_REQ_MASK);
 }
 
 static u8 check_enc_key_size(struct l2cap_conn *conn, __u8 max_key_size)


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 41/54] freezer: exec should clear PF_NOFREEZE along with PF_KTHREAD

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Oleg Nesterov o...@redhat.com

commit b40a79591ca918e7b91b0d9b6abd5d00f2e88c19 upstream.

flush_old_exec() clears PF_KTHREAD but forgets about PF_NOFREEZE.

Signed-off-by: Oleg Nesterov o...@redhat.com
Acked-by: Tejun Heo t...@kernel.org
Signed-off-by: Rafael J. Wysocki rafael.j.wyso...@intel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

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

--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1114,7 +1114,8 @@ int flush_old_exec(struct linux_binprm *
bprm-mm = NULL;/* We're using it now */
 
set_fs(USER_DS);
-   current-flags = ~(PF_RANDOMIZE | PF_FORKNOEXEC | PF_KTHREAD);
+   current-flags =
+   ~(PF_RANDOMIZE | PF_FORKNOEXEC | PF_KTHREAD | PF_NOFREEZE);
flush_thread();
current-personality = ~bprm-per_clear;
 


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 32/54] USB: mos7840: remove NULL-urb submission

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Johan Hovold jhov...@gmail.com

commit 28c3ae9a8cf45f439c9a0779ebd0256e2ae72813 upstream.

The private int_urb is never allocated so the submission from the
control completion handler will always fail. Remove this odd piece of
broken code.

Signed-off-by: Johan Hovold jhov...@gmail.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/usb/serial/mos7840.c |   15 +--
 1 file changed, 1 insertion(+), 14 deletions(-)

--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -235,7 +235,6 @@ struct moschip_port {
int port_num;   /*Actual port number in the device(1,2,etc) */
struct urb *write_urb;  /* write URB for this port */
struct urb *read_urb;   /* read URB for this port */
-   struct urb *int_urb;
__u8 shadowLCR; /* last LCR value received */
__u8 shadowMCR; /* last MCR value received */
char open;
@@ -505,7 +504,6 @@ static void mos7840_control_callback(str
unsigned char *data;
struct moschip_port *mos7840_port;
__u8 regval = 0x0;
-   int result = 0;
int status = urb-status;
 
mos7840_port = urb-context;
@@ -524,7 +522,7 @@ static void mos7840_control_callback(str
default:
dbg(%s - nonzero urb status received: %d, __func__,
status);
-   goto exit;
+   return;
}
 
dbg(%s urb buffer size is %d, __func__, urb-actual_length);
@@ -537,17 +535,6 @@ static void mos7840_control_callback(str
mos7840_handle_new_msr(mos7840_port, regval);
else if (mos7840_port-MsrLsr == 1)
mos7840_handle_new_lsr(mos7840_port, regval);
-
-exit:
-   spin_lock(mos7840_port-pool_lock);
-   if (!mos7840_port-zombie)
-   result = usb_submit_urb(mos7840_port-int_urb, GFP_ATOMIC);
-   spin_unlock(mos7840_port-pool_lock);
-   if (result) {
-   dev_err(urb-dev-dev,
-   %s - Error %d submitting interrupt urb\n,
-   __func__, result);
-   }
 }
 
 static int mos7840_get_reg(struct moschip_port *mcs, __u16 Wval, __u16 reg,


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 31/54] USB: mos7840: fix port-device leak in error path

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Johan Hovold jhov...@gmail.com

commit 3eb55cc4ed88eee3b5230f66abcdbd2a91639eda upstream.

The driver set the usb-serial port pointers to NULL on errors in attach,
effectively preventing usb-serial core from decrementing the port ref
counters and releasing the port devices and associated data.

Signed-off-by: Johan Hovold jhov...@gmail.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/usb/serial/mos7840.c |1 -
 1 file changed, 1 deletion(-)

--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -2590,7 +2590,6 @@ error:
kfree(mos7840_port-ctrl_buf);
usb_free_urb(mos7840_port-control_urb);
kfree(mos7840_port);
-   serial-port[i] = NULL;
}
return status;
 }


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 38/54] ARM: at91: at91sam9g10: fix SOC type detection

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Ivan Shugov ivan.shu...@gmail.com

commit 3d9a0183dd3423353e9e363bcc261c1220d05f9f upstream.

Newer at91sam9g10 SoC revision can't be detected, so the kernel can't boot with
this kind of kernel panic:
AT91: Impossible to detect the SOC type

CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Atmel AT91SAM9G10-EK
Ignoring tag cmdline (using the default kernel command line)
bootconsole [earlycon0] enabled
Memory policy: ECC disabled, Data cache writeback
Kernel panic - not syncing: AT91: Impossible to detect the SOC type
[c00133d4] (unwind_backtrace+0x0/0xe0) from [c02366dc] (panic+0x78/0x1cc)
[c02366dc] (panic+0x78/0x1cc) from [c02fa35c] (at91_map_io+0x90/0xc8)
[c02fa35c] (at91_map_io+0x90/0xc8) from [c02f9860] (paging_init+0x564/0x6d0)
[c02f9860] (paging_init+0x564/0x6d0) from [c02f7914] 
(setup_arch+0x464/0x704)
[c02f7914] (setup_arch+0x464/0x704) from [c02f44f8] 
(start_kernel+0x6c/0x2d4)
[c02f44f8] (start_kernel+0x6c/0x2d4) from [20008040] (0x20008040)

The reason for this is that the Debug Unit Chip ID Register has changed between
Engineering Sample and definitive revision of the SoC. Changing the check of
cidr to socid will address the problem. We do not integrate this check to the
list just above because we also have to make sure that the extended id is
disregarded.

Signed-off-by: Ivan Shugov ivan.shu...@gmail.com
[nicolas.fe...@atmel.com: change commit message]
Signed-off-by: Nicolas Ferre nicolas.fe...@atmel.com
Acked-by: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 arch/arm/mach-at91/setup.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -146,7 +146,7 @@ static void __init soc_detect(u32 dbgu_b
}
 
/* at91sam9g10 */
-   if ((cidr  ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) {
+   if ((socid  ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) {
at91_soc_initdata.type = AT91_SOC_SAM9G10;
at91_boot_soc = at91sam9261_soc;
}


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 37/54] ARM: at91/i2c: change id to let i2c-gpio work

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Bo Shen voice.s...@atmel.com

commit 7840487cd6298f9f931103b558290d8d98d41c49 upstream.

The i2c core driver will turn the platform device ID to busnum
When using platfrom device ID as -1, it means dynamically assigned
the busnum. When writing code, we need to make sure the busnum,
and call i2c_register_board_info(int busnum, ...) to register device
if using -1, we do not know the value of busnum

In order to solve this issue, set the platform device ID as a fix number
Here using 0 to match the busnum used in i2c_regsiter_board_info()

Signed-off-by: Bo Shen voice.s...@atmel.com
Acked-by: Jean Delvare kh...@linux-fr.org
Signed-off-by: Nicolas Ferre nicolas.fe...@atmel.com
Acked-by: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com
Acked-by: Ludovic Desroches ludovic.desroc...@atmel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 arch/arm/mach-at91/at91rm9200_devices.c  |2 +-
 arch/arm/mach-at91/at91sam9260_devices.c |2 +-
 arch/arm/mach-at91/at91sam9261_devices.c |2 +-
 arch/arm/mach-at91/at91sam9263_devices.c |2 +-
 arch/arm/mach-at91/at91sam9rl_devices.c  |2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

--- a/arch/arm/mach-at91/at91rm9200_devices.c
+++ b/arch/arm/mach-at91/at91rm9200_devices.c
@@ -463,7 +463,7 @@ static struct i2c_gpio_platform_data pda
 
 static struct platform_device at91rm9200_twi_device = {
.name   = i2c-gpio,
-   .id = -1,
+   .id = 0,
.dev.platform_data  = pdata,
 };
 
--- a/arch/arm/mach-at91/at91sam9260_devices.c
+++ b/arch/arm/mach-at91/at91sam9260_devices.c
@@ -468,7 +468,7 @@ static struct i2c_gpio_platform_data pda
 
 static struct platform_device at91sam9260_twi_device = {
.name   = i2c-gpio,
-   .id = -1,
+   .id = 0,
.dev.platform_data  = pdata,
 };
 
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -285,7 +285,7 @@ static struct i2c_gpio_platform_data pda
 
 static struct platform_device at91sam9261_twi_device = {
.name   = i2c-gpio,
-   .id = -1,
+   .id = 0,
.dev.platform_data  = pdata,
 };
 
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -542,7 +542,7 @@ static struct i2c_gpio_platform_data pda
 
 static struct platform_device at91sam9263_twi_device = {
.name   = i2c-gpio,
-   .id = -1,
+   .id = 0,
.dev.platform_data  = pdata,
 };
 
--- a/arch/arm/mach-at91/at91sam9rl_devices.c
+++ b/arch/arm/mach-at91/at91sam9rl_devices.c
@@ -314,7 +314,7 @@ static struct i2c_gpio_platform_data pda
 
 static struct platform_device at91sam9rl_twi_device = {
.name   = i2c-gpio,
-   .id = -1,
+   .id = 0,
.dev.platform_data  = pdata,
 };
 


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 29/54] USB: sierra: fix memory leak in probe error path

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Johan Hovold jhov...@gmail.com

commit 084817d79399ab5ccab2f90a148b0369912a8369 upstream.

Move interface data allocation to attach so that it is deallocated on
errors in usb-serial probe.

Signed-off-by: Johan Hovold jhov...@gmail.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/usb/serial/sierra.c |   16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -171,7 +171,6 @@ static int sierra_probe(struct usb_seria
 {
int result = 0;
struct usb_device *udev;
-   struct sierra_intf_private *data;
u8 ifnum;
 
udev = serial-dev;
@@ -199,11 +198,6 @@ static int sierra_probe(struct usb_seria
return -ENODEV;
}
 
-   data = serial-private = kzalloc(sizeof(struct sierra_intf_private), 
GFP_KERNEL);
-   if (!data)
-   return -ENOMEM;
-   spin_lock_init(data-susp_lock);
-
return result;
 }
 
@@ -914,6 +908,7 @@ static void sierra_dtr_rts(struct usb_se
 static int sierra_startup(struct usb_serial *serial)
 {
struct usb_serial_port *port;
+   struct sierra_intf_private *intfdata;
struct sierra_port_private *portdata;
struct sierra_iface_info *himemoryp = NULL;
int i;
@@ -921,6 +916,14 @@ static int sierra_startup(struct usb_ser
 
dev_dbg(serial-dev-dev, %s\n, __func__);
 
+   intfdata = kzalloc(sizeof(*intfdata), GFP_KERNEL);
+   if (!intfdata)
+   return -ENOMEM;
+
+   spin_lock_init(intfdata-susp_lock);
+
+   usb_set_serial_data(serial, intfdata);
+
/* Set Device mode to D0 */
sierra_set_power_state(serial-dev, 0x);
 
@@ -978,6 +981,7 @@ err:
portdata = usb_get_serial_port_data(serial-port[i]);
kfree(portdata);
}
+   kfree(intfdata);
 
return -ENOMEM;
 }


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 34/54] vhost: fix mergeable bufs on BE hosts

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Michael S. Tsirkin m...@redhat.com

commit 910a578f7e9400a78a3b13aba0b4d2df16a2cb05 upstream.

We copy head count to a 16 bit field, this works by chance on LE but on
BE guest gets 0. Fix it up.

Signed-off-by: Michael S. Tsirkin m...@redhat.com
Tested-by: Alexander Graf ag...@suse.de
Signed-off-by: David S. Miller da...@davemloft.net
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

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

--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -376,7 +376,8 @@ static void handle_rx(struct vhost_net *
.hdr.gso_type = VIRTIO_NET_HDR_GSO_NONE
};
size_t total_len = 0;
-   int err, headcount, mergeable;
+   int err, mergeable;
+   s16 headcount;
size_t vhost_hlen, sock_hlen;
size_t vhost_len, sock_len;
/* TODO: check that we are running from vhost_worker? */


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 30/54] USB: mos7840: fix urb leak at release

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Johan Hovold jhov...@gmail.com

commit 65a4cdbb170e4ec1a7fa0e94936d47e24a17b0e8 upstream.

Make sure control urb is freed at release.

Signed-off-by: Johan Hovold jhov...@gmail.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

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

--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -2657,6 +2657,7 @@ static void mos7840_release(struct usb_s
mos7840_port = mos7840_get_port_private(serial-port[i]);
dbg(mos7840_port %d = %p, i, mos7840_port);
if (mos7840_port) {
+   usb_free_urb(mos7840_port-control_urb);
kfree(mos7840_port-ctrl_buf);
kfree(mos7840_port-dr);
kfree(mos7840_port);


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 23/54] usb hub: send clear_tt_buffer_complete events when canceling TT clear work

2012-10-29 Thread Greg Kroah-Hartman
/0x80
7[   47.611244]  [c175] ? timer_cpu_notify+0xd6/0x20d
7[   47.611253]  [c1050780] ? __init_kthread_worker+0x60/0x60
7[   47.611258]  [c176357e] kernel_thread_helper+0x6/0xd
7[   47.611283] [ cut here ]

This patch changes hub_quiesce behavior to flush the TT clear work
instead of canceling it, to make sure that no TT clear request remains
uncompleted before suspend.

Signed-off-by: Octavian Purdila octavian.purd...@intel.com
Acked-by: Alan Stern st...@rowland.harvard.edu
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

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

--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -507,13 +507,16 @@ static void hub_tt_work(struct work_stru
int limit = 100;
 
spin_lock_irqsave (hub-tt.lock, flags);
-   while (--limit  !list_empty (hub-tt.clear_list)) {
+   while (!list_empty(hub-tt.clear_list)) {
struct list_head*next;
struct usb_tt_clear *clear;
struct usb_device   *hdev = hub-hdev;
const struct hc_driver  *drv;
int status;
 
+   if (!hub-quiescing  --limit  0)
+   break;
+
next = hub-tt.clear_list.next;
clear = list_entry (next, struct usb_tt_clear, clear_list);
list_del (clear-clear_list);
@@ -978,7 +981,7 @@ static void hub_quiesce(struct usb_hub *
if (hub-has_indicators)
cancel_delayed_work_sync(hub-leds);
if (hub-tt.hub)
-   cancel_work_sync(hub-tt.clear_work);
+   flush_work_sync(hub-tt.clear_work);
 }
 
 /* caller has locked the hub device */


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 27/54] USB: serial: Fix memory leak in sierra_release()

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Lennart Sorensen lsore...@csclub.uwaterloo.ca

commit f7bc5051667b74c3861f79eed98c60d5c3b883f7 upstream.

I found a memory leak in sierra_release() (well sierra_probe() I guess)
that looses 8 bytes each time the driver releases a device.

Signed-off-by: Len Sorensen lsore...@csclub.uwaterloo.ca
Acked-by: Johan Hovold jhov...@gmail.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

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

--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -992,6 +992,7 @@ static void sierra_release(struct usb_se
continue;
kfree(portdata);
}
+   kfree(serial-private);
 }
 
 #ifdef CONFIG_PM


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 28/54] USB: sierra: fix memory leak in attach error path

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Johan Hovold jhov...@gmail.com

commit 7e41f9bcdd2e813ea2a3c40db291d87ea06b559f upstream.

Make sure port private data is deallocated on errors in attach.

Signed-off-by: Johan Hovold jhov...@gmail.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/usb/serial/sierra.c |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -936,7 +936,7 @@ static int sierra_startup(struct usb_ser
dev_dbg(port-dev, %s: kmalloc for 
sierra_port_private (%d) failed!\n,
__func__, i);
-   return -ENOMEM;
+   goto err;
}
spin_lock_init(portdata-lock);
init_usb_anchor(portdata-active);
@@ -973,6 +973,13 @@ static int sierra_startup(struct usb_ser
}
 
return 0;
+err:
+   for (--i; i = 0; --i) {
+   portdata = usb_get_serial_port_data(serial-port[i]);
+   kfree(portdata);
+   }
+
+   return -ENOMEM;
 }
 
 static void sierra_release(struct usb_serial *serial)


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 13/54] Revert SUNRPC: Ensure we close the socket on EPIPE errors too...

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Trond Myklebust trond.mykleb...@netapp.com

commit b9d2bb2ee537424a7f855e1f93eed44eb9ee0854 upstream.

This reverts commit 55420c24a0d4d1fce70ca713f84aa00b6b74a70e.
Now that we clear the connected flag when entering TCP_CLOSE_WAIT,
the deadlock described in this commit is no longer possible.
Instead, the resulting call to xs_tcp_shutdown() can interfere
with pending reconnection attempts.

Reported-by: Chris Perl chris.p...@gmail.com
Signed-off-by: Trond Myklebust trond.mykleb...@netapp.com
Tested-by: Chris Perl chris.p...@gmail.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 net/sunrpc/xprtsock.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -736,10 +736,10 @@ static int xs_tcp_send_request(struct rp
dprintk(RPC:   sendmsg returned unrecognized error %d\n,
-status);
case -ECONNRESET:
-   case -EPIPE:
xs_tcp_shutdown(xprt);
case -ECONNREFUSED:
case -ENOTCONN:
+   case -EPIPE:
clear_bit(SOCK_ASYNC_NOSPACE, transport-sock-flags);
}
 


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 15/54] xhci: Fix potential NULL ptr deref in command cancellation.

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Sarah Sharp sarah.a.sh...@linux.intel.com

commit 43a09f7fb01fa1e091416a2aa49b6c666458c1ee upstream.

The command cancellation code doesn't check whether find_trb_seg()
couldn't find the segment that contains the TRB to be canceled.  This
could cause a NULL pointer deference later in the function when next_trb
is called.  It's unlikely to happen unless something is wrong with the
command ring pointers, so add some debugging in case it happens.

This patch should be backported to stable kernels as old as 3.0, that
contain the commit b63f4053cc8aa22a98e3f9a97845afe6c15d0a0d xHCI:
handle command after aborting the command ring.

Signed-off-by: Sarah Sharp sarah.a.sh...@linux.intel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/usb/host/xhci-ring.c |   11 +++
 1 file changed, 11 insertions(+)

--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -1228,6 +1228,17 @@ static void xhci_cmd_to_noop(struct xhci
cur_seg = find_trb_seg(xhci-cmd_ring-first_seg,
xhci-cmd_ring-dequeue, cycle_state);
 
+   if (!cur_seg) {
+   xhci_warn(xhci, Command ring mismatch, dequeue = %p %llx 
(dma)\n,
+   xhci-cmd_ring-dequeue,
+   (unsigned long long)
+   xhci_trb_virt_to_dma(xhci-cmd_ring-deq_seg,
+   xhci-cmd_ring-dequeue));
+   xhci_debug_ring(xhci, xhci-cmd_ring);
+   xhci_dbg_ring_ptrs(xhci, xhci-cmd_ring);
+   return;
+   }
+
/* find the command trb matched by cd from command ring */
for (cmd_trb = xhci-cmd_ring-dequeue;
cmd_trb != xhci-cmd_ring-enqueue;


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 26/54] USB: opticon: fix memory leak in error path

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Johan Hovold jhov...@gmail.com

commit acbf0e5263de563e25f7c104868e4490b9e72b13 upstream.

Fix memory leak in write error path.

Signed-off-by: Johan Hovold jhov...@gmail.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/usb/serial/opticon.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/usb/serial/opticon.c
+++ b/drivers/usb/serial/opticon.c
@@ -297,7 +297,7 @@ static int opticon_write(struct tty_stru
if (!dr) {
dev_err(port-dev, out of memory\n);
count = -ENOMEM;
-   goto error;
+   goto error_no_dr;
}
 
dr-bRequestType = USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_OUT;
@@ -327,6 +327,8 @@ static int opticon_write(struct tty_stru
 
return count;
 error:
+   kfree(dr);
+error_no_dr:
usb_free_urb(urb);
 error_no_urb:
kfree(buffer);


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 25/54] USB: opticon: fix DMA from stack

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Johan Hovold jhov...@gmail.com

commit ea0dbebffe118724cd4df7d9b071ea8ee48d48f0 upstream.

Make sure to allocate the control-message buffer dynamically as some
platforms cannot do DMA from stack.

Note that only the first byte of the old buffer was used.

Signed-off-by: Johan Hovold jhov...@gmail.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/usb/serial/opticon.c |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- a/drivers/usb/serial/opticon.c
+++ b/drivers/usb/serial/opticon.c
@@ -160,7 +160,11 @@ static int send_control_msg(struct usb_s
 {
struct usb_serial *serial = port-serial;
int retval;
-   u8 buffer[2];
+   u8 *buffer;
+
+   buffer = kzalloc(1, GFP_KERNEL);
+   if (!buffer)
+   return -ENOMEM;
 
buffer[0] = val;
/* Send the message to the vendor control endpoint
@@ -169,6 +173,7 @@ static int send_control_msg(struct usb_s
requesttype,
USB_DIR_OUT|USB_TYPE_VENDOR|USB_RECIP_INTERFACE,
0, 0, buffer, 1, 0);
+   kfree(buffer);
 
return retval;
 }


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 22/54] usb-storage: add unusual_devs entry for Casio EX-N1 digital camera

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Michael Shigorin m...@osdn.org.ua

commit d7870af7e2e3a91b462075ec1ca669b482215187 upstream.

This commit sets removable subclass for Casio EX-N1 digital camera.

The patch has been tested within an ALT Linux kernel:
http://git.altlinux.org/people/led/packages/?p=kernel-image-3.0.git;a=commitdiff;h=c0fd891836e89fe0c93a4d536a59216d90e4e3e7

See also https://bugzilla.kernel.org/show_bug.cgi?id=49221

Signed-off-by: Oleksandr Chumachenko led...@gmail.com
Signed-off-by: Michael Shigorin m...@osdn.org.ua
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/usb/storage/unusual_devs.h |6 ++
 1 file changed, 6 insertions(+)

--- a/drivers/usb/storage/unusual_devs.h
+++ b/drivers/usb/storage/unusual_devs.h
@@ -1004,6 +1004,12 @@ UNUSUAL_DEV( 0x07cf, 0x1001, 0x1000, 0x9
USB_SC_8070, USB_PR_CB, NULL,
US_FL_NEED_OVERRIDE | US_FL_FIX_INQUIRY ),
 
+/* Submitted by Oleksandr Chumachenko led...@gmail.com */
+UNUSUAL_DEV( 0x07cf, 0x1167, 0x0100, 0x0100,
+   Casio,
+   EX-N1 DigitalCamera,
+   USB_SC_8070, USB_PR_DEVICE, NULL, 0),
+
 /* Submitted by Hartmut Wahl hw...@hwahl.de*/
 UNUSUAL_DEV( 0x0839, 0x000a, 0x0001, 0x0001,
Samsung,


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 14/54] SUNRPC: Prevent races in xs_abort_connection()

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Trond Myklebust trond.mykleb...@netapp.com

commit 4bc1e68ed6a8b59be8a79eb719be515a55c7bc68 upstream.

The call to xprt_disconnect_done() that is triggered by a successful
connection reset will trigger another automatic wakeup of all tasks
on the xprt-pending rpc_wait_queue. In particular it will cause an
early wake up of the task that called xprt_connect().

All we really want to do here is clear all the socket-specific state
flags, so we split that functionality out of xs_sock_mark_closed()
into a helper that can be called by xs_abort_connection()

Reported-by: Chris Perl chris.p...@gmail.com
Signed-off-by: Trond Myklebust trond.mykleb...@netapp.com
Tested-by: Chris Perl chris.p...@gmail.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 net/sunrpc/xprtsock.c |   13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1462,7 +1462,7 @@ static void xs_tcp_cancel_linger_timeout
xprt_clear_connecting(xprt);
 }
 
-static void xs_sock_mark_closed(struct rpc_xprt *xprt)
+static void xs_sock_reset_connection_flags(struct rpc_xprt *xprt)
 {
smp_mb__before_clear_bit();
clear_bit(XPRT_CONNECTION_ABORT, xprt-state);
@@ -1470,6 +1470,11 @@ static void xs_sock_mark_closed(struct r
clear_bit(XPRT_CLOSE_WAIT, xprt-state);
clear_bit(XPRT_CLOSING, xprt-state);
smp_mb__after_clear_bit();
+}
+
+static void xs_sock_mark_closed(struct rpc_xprt *xprt)
+{
+   xs_sock_reset_connection_flags(xprt);
/* Mark transport as closed and wake up all pending tasks */
xprt_disconnect_done(xprt);
 }
@@ -2004,10 +2009,8 @@ static void xs_abort_connection(struct s
any.sa_family = AF_UNSPEC;
result = kernel_connect(transport-sock, any, sizeof(any), 0);
if (!result)
-   xs_sock_mark_closed(transport-xprt);
-   else
-   dprintk(RPC:   AF_UNSPEC connect return code %d\n,
-   result);
+   xs_sock_reset_connection_flags(transport-xprt);
+   dprintk(RPC:   AF_UNSPEC connect return code %d\n, result);
 }
 
 static void xs_tcp_reuse_connection(struct sock_xprt *transport)


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 20/54] ehci: fix Lucid nohandoff pci quirk to be more generic with BIOS versions

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Anisse Astier ani...@astier.eu

commit c323dc023b9501e5d09582ec7efd1d40a9001d99 upstream.

BIOS vendors keep changing the BIOS versions. Only match the beginning
of the string to match all Lucid tablets with board name M11JB.

Signed-off-by: Anisse Astier ani...@astier.eu
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/usb/host/pci-quirks.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/usb/host/pci-quirks.c
+++ b/drivers/usb/host/pci-quirks.c
@@ -545,7 +545,7 @@ static const struct dmi_system_id __devi
/*  Pegatron Lucid (Ordissimo AIRIS) */
.matches = {
DMI_MATCH(DMI_BOARD_NAME, M11JB),
-   DMI_MATCH(DMI_BIOS_VERSION, Lucid-GE-133),
+   DMI_MATCH(DMI_BIOS_VERSION, Lucid-),
},
},
{ }


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 19/54] Drivers: hv: Cleanup error handling in vmbus_open()

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: K. Y. Srinivasan k...@microsoft.com

commit 1392550240aaa72ce3a094a38bd23525cd67ce60 upstream.

Fix a memory leak  in the error handling path in the function vmbus_open().

Signed-off-by: K. Y. Srinivasan k...@microsoft.com
Reviewed-by: Haiyang Zhang haiya...@microsoft.com
Reported-by: Jason Wang jasow...@redhat.com
Acked-by: Jason Wang jasow...@redhat.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/hv/channel.c |   24 +---
 1 file changed, 13 insertions(+), 11 deletions(-)

--- a/drivers/hv/channel.c
+++ b/drivers/hv/channel.c
@@ -146,14 +146,14 @@ int vmbus_open(struct vmbus_channel *new
 
if (ret != 0) {
err = ret;
-   goto errorout;
+   goto error0;
}
 
ret = hv_ringbuffer_init(
newchannel-inbound, in, recv_ringbuffer_size);
if (ret != 0) {
err = ret;
-   goto errorout;
+   goto error0;
}
 
 
@@ -168,7 +168,7 @@ int vmbus_open(struct vmbus_channel *new
 
if (ret != 0) {
err = ret;
-   goto errorout;
+   goto error0;
}
 
/* Create and init the channel open message */
@@ -177,7 +177,7 @@ int vmbus_open(struct vmbus_channel *new
   GFP_KERNEL);
if (!open_info) {
err = -ENOMEM;
-   goto errorout;
+   goto error0;
}
 
init_completion(open_info-waitevent);
@@ -193,7 +193,7 @@ int vmbus_open(struct vmbus_channel *new
 
if (userdatalen  MAX_USER_DEFINED_BYTES) {
err = -EINVAL;
-   goto errorout;
+   goto error0;
}
 
if (userdatalen)
@@ -208,19 +208,18 @@ int vmbus_open(struct vmbus_channel *new
   sizeof(struct vmbus_channel_open_channel));
 
if (ret != 0)
-   goto cleanup;
+   goto error1;
 
t = wait_for_completion_timeout(open_info-waitevent, 5*HZ);
if (t == 0) {
err = -ETIMEDOUT;
-   goto errorout;
+   goto error1;
}
 
 
if (open_info-response.open_result.status)
err = open_info-response.open_result.status;
 
-cleanup:
spin_lock_irqsave(vmbus_connection.channelmsg_lock, flags);
list_del(open_info-msglistentry);
spin_unlock_irqrestore(vmbus_connection.channelmsg_lock, flags);
@@ -228,9 +227,12 @@ cleanup:
kfree(open_info);
return err;
 
-errorout:
-   hv_ringbuffer_cleanup(newchannel-outbound);
-   hv_ringbuffer_cleanup(newchannel-inbound);
+error1:
+   spin_lock_irqsave(vmbus_connection.channelmsg_lock, flags);
+   list_del(open_info-msglistentry);
+   spin_unlock_irqrestore(vmbus_connection.channelmsg_lock, flags);
+
+error0:
free_pages((unsigned long)out,
get_order(send_ringbuffer_size + recv_ringbuffer_size));
kfree(open_info);


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 18/54] Staging: android: binder: Allow using highmem for binder buffers

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Arve Hjønnevåg a...@android.com

commit 585650dcec88e704a19bb226a34b6a7166111623 upstream.

The default kernel mapping for the pages allocated for the binder
buffers is never used. Set the __GFP_HIGHMEM flag when allocating
these pages so we don't needlessly use low memory pages that may
be required elsewhere.

Signed-off-by: Arve Hjønnevåg a...@android.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/staging/android/binder.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/staging/android/binder.c
+++ b/drivers/staging/android/binder.c
@@ -655,7 +655,7 @@ static int binder_update_page_range(stru
page = proc-pages[(page_addr - proc-buffer) / PAGE_SIZE];
 
BUG_ON(*page);
-   *page = alloc_page(GFP_KERNEL | __GFP_ZERO);
+   *page = alloc_page(GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO);
if (*page == NULL) {
printk(KERN_ERR binder: %d: binder_alloc_buf failed 
   for page at %p\n, proc-pid, page_addr);


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 17/54] Staging: android: binder: Fix memory leak on thread/process exit

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Arve Hjønnevåg a...@android.com

commit 675d66b0ed5fd170d6a44cf8dbb3fa56a5347bdb upstream.

If a thread or process exited while a reply, one-way transaction or
death notification was pending, the struct holding the pending work
was leaked.

Signed-off-by: Arve Hjønnevåg a...@android.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/staging/android/binder.c |   28 +++-
 1 file changed, 27 insertions(+), 1 deletion(-)

--- a/drivers/staging/android/binder.c
+++ b/drivers/staging/android/binder.c
@@ -2507,14 +2507,38 @@ static void binder_release_work(struct l
struct binder_transaction *t;
 
t = container_of(w, struct binder_transaction, work);
-   if (t-buffer-target_node  !(t-flags  TF_ONE_WAY))
+   if (t-buffer-target_node 
+   !(t-flags  TF_ONE_WAY)) {
binder_send_failed_reply(t, BR_DEAD_REPLY);
+   } else {
+   binder_debug(BINDER_DEBUG_DEAD_TRANSACTION,
+   binder: undelivered transaction %d\n,
+   t-debug_id);
+   t-buffer-transaction = NULL;
+   kfree(t);
+   binder_stats_deleted(BINDER_STAT_TRANSACTION);
+   }
} break;
case BINDER_WORK_TRANSACTION_COMPLETE: {
+   binder_debug(BINDER_DEBUG_DEAD_TRANSACTION,
+   binder: undelivered TRANSACTION_COMPLETE\n);
kfree(w);
binder_stats_deleted(BINDER_STAT_TRANSACTION_COMPLETE);
} break;
+   case BINDER_WORK_DEAD_BINDER_AND_CLEAR:
+   case BINDER_WORK_CLEAR_DEATH_NOTIFICATION: {
+   struct binder_ref_death *death;
+
+   death = container_of(w, struct binder_ref_death, work);
+   binder_debug(BINDER_DEBUG_DEAD_TRANSACTION,
+   binder: undelivered death notification, %p\n,
+   death-cookie);
+   kfree(death);
+   binder_stats_deleted(BINDER_STAT_DEATH);
+   } break;
default:
+   pr_err(binder: unexpected work type, %d, not freed\n,
+  w-type);
break;
}
}
@@ -2984,6 +3008,7 @@ static void binder_deferred_release(stru
nodes++;
rb_erase(node-rb_node, proc-nodes);
list_del_init(node-work.entry);
+   binder_release_work(node-async_todo);
if (hlist_empty(node-refs)) {
kfree(node);
binder_stats_deleted(BINDER_STAT_NODE);
@@ -3022,6 +3047,7 @@ static void binder_deferred_release(stru
binder_delete_ref(ref);
}
binder_release_work(proc-todo);
+   binder_release_work(proc-delivered_death);
buffers = 0;
 
while ((n = rb_first(proc-allocated_buffers))) {


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 07/54] genalloc: stop crashing the system when destroying a pool

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Thadeu Lima de Souza Cascardo casca...@linux.vnet.ibm.com

commit eedce141cd2dad8d0cefc5468ef41898949a7031 upstream.

The genalloc code uses the bitmap API from include/linux/bitmap.h and
lib/bitmap.c, which is based on long values.  Both bitmap_set from
lib/bitmap.c and bitmap_set_ll, which is the lockless version from
genalloc.c, use BITMAP_LAST_WORD_MASK to set the first bits in a long in
the bitmap.

That one uses (1  bits) - 1, 0b111, if you are setting the first three
bits.  This means that the API counts from the least significant bits
(LSB from now on) to the MSB.  The LSB in the first long is bit 0, then.
The same works for the lookup functions.

The genalloc code uses longs for the bitmap, as it should.  In
include/linux/genalloc.h, struct gen_pool_chunk has unsigned long
bits[0] as its last member.  When allocating the struct, genalloc should
reserve enough space for the bitmap.  This should be a proper number of
longs that can fit the amount of bits in the bitmap.

However, genalloc allocates an integer number of bytes that fit the
amount of bits, but may not be an integer amount of longs.  9 bytes, for
example, could be allocated for 70 bits.

This is a problem in itself if the Least Significat Bit in a long is in
the byte with the largest address, which happens in Big Endian machines.
This means genalloc is not allocating the byte in which it will try to
set or check for a bit.

This may end up in memory corruption, where genalloc will try to set the
bits it has not allocated.  In fact, genalloc may not set these bits
because it may find them already set, because they were not zeroed since
they were not allocated.  And that's what causes a BUG when
gen_pool_destroy is called and check for any set bits.

What really happens is that genalloc uses kmalloc_node with __GFP_ZERO
on gen_pool_add_virt.  With SLAB and SLUB, this means the whole slab
will be cleared, not only the requested bytes.  Since struct
gen_pool_chunk has a size that is a multiple of 8, and slab sizes are
multiples of 8, we get lucky and allocate and clear the right amount of
bytes.

Hower, this is not the case with SLOB or with older code that did memset
after allocating instead of using __GFP_ZERO.

So, a simple module as this (running 3.6.0), will cause a crash when
rmmod'ed.

  [root@phantom-lp2 foo]# cat foo.c
  #include linux/kernel.h
  #include linux/module.h
  #include linux/init.h
  #include linux/genalloc.h

  MODULE_LICENSE(GPL);
  MODULE_VERSION(0.1);

  static struct gen_pool *foo_pool;

  static __init int foo_init(void)
  {
  int ret;
  foo_pool = gen_pool_create(10, -1);
  if (!foo_pool)
  return -ENOMEM;
  ret = gen_pool_add(foo_pool, 0xa000, 32  10, -1);
  if (ret) {
  gen_pool_destroy(foo_pool);
  return ret;
  }
  return 0;
  }

  static __exit void foo_exit(void)
  {
  gen_pool_destroy(foo_pool);
  }

  module_init(foo_init);
  module_exit(foo_exit);
  [root@phantom-lp2 foo]# zcat /proc/config.gz | grep SLOB
  CONFIG_SLOB=y
  [root@phantom-lp2 foo]# insmod ./foo.ko
  [root@phantom-lp2 foo]# rmmod foo
  [ cut here ]
  kernel BUG at lib/genalloc.c:243!
  cpu 0x4: Vector: 700 (Program Check) at [c000bb0e7960]
  pc: c03cb50c: .gen_pool_destroy+0xac/0x110
  lr: c03cb4fc: .gen_pool_destroy+0x9c/0x110
  sp: c000bb0e7be0
 msr: 80029032
current = 0xc000bb0e
paca= 0xc6d30e00   softe: 0irq_happened: 0x01
  pid   = 13044, comm = rmmod
  kernel BUG at lib/genalloc.c:243!
  [c000bb0e7ca0] d4b00020 .foo_exit+0x20/0x38 [foo]
  [c000bb0e7d20] c00dff98 .SyS_delete_module+0x1a8/0x290
  [c000bb0e7e30] c00097d4 syscall_exit+0x0/0x94
  --- Exception: c00 (System Call) at 00800753d1a0
  SP (fffd0b0e640) is in userspace

Signed-off-by: Thadeu Lima de Souza Cascardo casca...@linux.vnet.ibm.com
Cc: Paul Gortmaker paul.gortma...@windriver.com
Cc: Benjamin Gaignard benjamin.gaign...@stericsson.com
Signed-off-by: Andrew Morton a...@linux-foundation.org
Signed-off-by: Linus Torvalds torva...@linux-foundation.org
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 lib/genalloc.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/lib/genalloc.c
+++ b/lib/genalloc.c
@@ -176,7 +176,7 @@ int gen_pool_add_virt(struct gen_pool *p
struct gen_pool_chunk *chunk;
int nbits = size  pool-min_alloc_order;
int nbytes = sizeof(struct gen_pool_chunk) +
-   (nbits + BITS_PER_BYTE - 1) / BITS_PER_BYTE;
+   BITS_TO_LONGS(nbits) * sizeof(long);
 
chunk = kmalloc_node(nbytes, GFP_KERNEL | __GFP_ZERO, nid);
if (unlikely(chunk == NULL))


--
To unsubscribe from this list

[ 16/54] sysfs: sysfs_pathname/sysfs_add_one: Use strlcat() instead of strcat()

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Geert Uytterhoeven ge...@linux-m68k.org

commit 66081a72517a131430dcf986775f3268aafcb546 upstream.

The warning check for duplicate sysfs entries can cause a buffer overflow
when printing the warning, as strcat() doesn't check buffer sizes.
Use strlcat() instead.

Since strlcat() doesn't return a pointer to the passed buffer, unlike
strcat(), I had to convert the nested concatenation in sysfs_add_one() to
an admittedly more obscure comma operator construct, to avoid emitting code
for the concatenation if CONFIG_BUG is disabled.

Signed-off-by: Geert Uytterhoeven ge...@linux-m68k.org
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 fs/sysfs/dir.c |   16 
 1 file changed, 8 insertions(+), 8 deletions(-)

--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -457,20 +457,18 @@ int __sysfs_add_one(struct sysfs_addrm_c
 /**
  * sysfs_pathname - return full path to sysfs dirent
  * @sd: sysfs_dirent whose path we want
- * @path: caller allocated buffer
+ * @path: caller allocated buffer of size PATH_MAX
  *
  * Gives the name / to the sysfs_root entry; any path returned
  * is relative to wherever sysfs is mounted.
- *
- * XXX: does no error checking on @path size
  */
 static char *sysfs_pathname(struct sysfs_dirent *sd, char *path)
 {
if (sd-s_parent) {
sysfs_pathname(sd-s_parent, path);
-   strcat(path, /);
+   strlcat(path, /, PATH_MAX);
}
-   strcat(path, sd-s_name);
+   strlcat(path, sd-s_name, PATH_MAX);
return path;
 }
 
@@ -503,9 +501,11 @@ int sysfs_add_one(struct sysfs_addrm_cxt
char *path = kzalloc(PATH_MAX, GFP_KERNEL);
WARN(1, KERN_WARNING
 sysfs: cannot create duplicate filename '%s'\n,
-(path == NULL) ? sd-s_name :
-strcat(strcat(sysfs_pathname(acxt-parent_sd, path), /),
-   sd-s_name));
+(path == NULL) ? sd-s_name
+   : (sysfs_pathname(acxt-parent_sd, path),
+  strlcat(path, /, PATH_MAX),
+  strlcat(path, sd-s_name, PATH_MAX),
+  path));
kfree(path);
}
 


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 12/54] SUNRPC: Clear the connect flag when socket state is TCP_CLOSE_WAIT

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Trond Myklebust trond.mykleb...@netapp.com

commit d0bea455dd48da1ecbd04fedf00eb89437455fdc upstream.

This is needed to ensure that we call xprt_connect() upon the next
call to call_connect().

Signed-off-by: Trond Myklebust trond.mykleb...@netapp.com
Tested-by: Chris Perl chris.p...@gmail.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 net/sunrpc/xprtsock.c |1 +
 1 file changed, 1 insertion(+)

--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1525,6 +1525,7 @@ static void xs_tcp_state_change(struct s
case TCP_CLOSE_WAIT:
/* The server initiated a shutdown of the socket */
xprt-connect_cookie++;
+   clear_bit(XPRT_CONNECTED, xprt-state);
xs_tcp_force_close(xprt);
case TCP_CLOSING:
/*


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 11/54] SUNRPC: Get rid of the xs_error_report socket callback

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Trond Myklebust trond.mykleb...@netapp.com

commit f878b657ce8e7d3673afe48110ec208a29e38c4a upstream.

Chris Perl reports that we're seeing races between the wakeup call in
xs_error_report and the connect attempts. Basically, Chris has shown
that in certain circumstances, the call to xs_error_report causes the
rpc_task that is responsible for reconnecting to wake up early, thus
triggering a disconnect and retry.

Since the sk-sk_error_report() calls in the socket layer are always
followed by a tcp_done() in the cases where we care about waking up
the rpc_tasks, just let the state_change callbacks take responsibility
for those wake ups.

Reported-by: Chris Perl chris.p...@gmail.com
Signed-off-by: Trond Myklebust trond.mykleb...@netapp.com
Tested-by: Chris Perl chris.p...@gmail.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 net/sunrpc/xprtsock.c |   25 -
 1 file changed, 25 deletions(-)

--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -254,7 +254,6 @@ struct sock_xprt {
void(*old_data_ready)(struct sock *, int);
void(*old_state_change)(struct sock *);
void(*old_write_space)(struct sock *);
-   void(*old_error_report)(struct sock *);
 };
 
 /*
@@ -781,7 +780,6 @@ static void xs_save_old_callbacks(struct
transport-old_data_ready = sk-sk_data_ready;
transport-old_state_change = sk-sk_state_change;
transport-old_write_space = sk-sk_write_space;
-   transport-old_error_report = sk-sk_error_report;
 }
 
 static void xs_restore_old_callbacks(struct sock_xprt *transport, struct sock 
*sk)
@@ -789,7 +787,6 @@ static void xs_restore_old_callbacks(str
sk-sk_data_ready = transport-old_data_ready;
sk-sk_state_change = transport-old_state_change;
sk-sk_write_space = transport-old_write_space;
-   sk-sk_error_report = transport-old_error_report;
 }
 
 static void xs_reset_transport(struct sock_xprt *transport)
@@ -1552,25 +1549,6 @@ static void xs_tcp_state_change(struct s
read_unlock_bh(sk-sk_callback_lock);
 }
 
-/**
- * xs_error_report - callback mainly for catching socket errors
- * @sk: socket
- */
-static void xs_error_report(struct sock *sk)
-{
-   struct rpc_xprt *xprt;
-
-   read_lock_bh(sk-sk_callback_lock);
-   if (!(xprt = xprt_from_sock(sk)))
-   goto out;
-   dprintk(RPC:   %s client %p...\n
-   RPC:   error %d\n,
-   __func__, xprt, sk-sk_err);
-   xprt_wake_pending_tasks(xprt, -EAGAIN);
-out:
-   read_unlock_bh(sk-sk_callback_lock);
-}
-
 static void xs_write_space(struct sock *sk)
 {
struct socket *sock;
@@ -1870,7 +1848,6 @@ static int xs_local_finish_connecting(st
sk-sk_user_data = xprt;
sk-sk_data_ready = xs_local_data_ready;
sk-sk_write_space = xs_udp_write_space;
-   sk-sk_error_report = xs_error_report;
sk-sk_allocation = GFP_ATOMIC;
 
xprt_clear_connected(xprt);
@@ -1959,7 +1936,6 @@ static void xs_udp_finish_connecting(str
sk-sk_user_data = xprt;
sk-sk_data_ready = xs_udp_data_ready;
sk-sk_write_space = xs_udp_write_space;
-   sk-sk_error_report = xs_error_report;
sk-sk_no_check = UDP_CSUM_NORCV;
sk-sk_allocation = GFP_ATOMIC;
 
@@ -2075,7 +2051,6 @@ static int xs_tcp_finish_connecting(stru
sk-sk_data_ready = xs_tcp_data_ready;
sk-sk_state_change = xs_tcp_state_change;
sk-sk_write_space = xs_tcp_write_space;
-   sk-sk_error_report = xs_error_report;
sk-sk_allocation = GFP_ATOMIC;
 
/* socket options */


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 08/54] ARM: 7559/1: smp: switch away from the idmap before updating init_mm.mm_count

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Will Deacon will.dea...@arm.com

commit 5f40b909728ad784eb43aa309d3c4e9bdf050781 upstream.

When booting a secondary CPU, the primary CPU hands two sets of page
tables via the secondary_data struct:

(1) swapper_pg_dir: a normal, cacheable, shared (if SMP) mapping
of the kernel image (i.e. the tables used by init_mm).

(2) idmap_pgd: an uncached mapping of the .idmap.text ELF
section.

The idmap is generally used when enabling and disabling the MMU, which
includes early CPU boot. In this case, the secondary CPU switches to
swapper as soon as it enters C code:

struct mm_struct *mm = init_mm;
unsigned int cpu = smp_processor_id();

/*
 * All kernel threads share the same mm context; grab a
 * reference and switch to it.
 */
atomic_inc(mm-mm_count);
current-active_mm = mm;
cpumask_set_cpu(cpu, mm_cpumask(mm));
cpu_switch_mm(mm-pgd, mm);

This causes a problem on ARMv7, where the identity mapping is treated as
strongly-ordered leading to architecturally UNPREDICTABLE behaviour of
exclusive accesses, such as those used by atomic_inc.

This patch re-orders the secondary_start_kernel function so that we
switch to swapper before performing any exclusive accesses.

Reported-by: Gilles Chanteperdrix gilles.chanteperd...@xenomai.org
Cc: David McKay david.mc...@st.com
Signed-off-by: Will Deacon will.dea...@arm.com
Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 arch/arm/kernel/smp.c |   14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -249,18 +249,24 @@ static void percpu_timer_setup(void);
 asmlinkage void __cpuinit secondary_start_kernel(void)
 {
struct mm_struct *mm = init_mm;
-   unsigned int cpu = smp_processor_id();
+   unsigned int cpu;
+
+   /*
+* The identity mapping is uncached (strongly ordered), so
+* switch away from it before attempting any exclusive accesses.
+*/
+   cpu_switch_mm(mm-pgd, mm);
+   enter_lazy_tlb(mm, current);
+   local_flush_tlb_all();
 
/*
 * All kernel threads share the same mm context; grab a
 * reference and switch to it.
 */
+   cpu = smp_processor_id();
atomic_inc(mm-mm_count);
current-active_mm = mm;
cpumask_set_cpu(cpu, mm_cpumask(mm));
-   cpu_switch_mm(mm-pgd, mm);
-   enter_lazy_tlb(mm, current);
-   local_flush_tlb_all();
 
printk(CPU%u: Booted secondary processor\n, cpu);
 


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 10/54] mm: fix XFS oops due to dirty pages without buffers on s390

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Jan Kara j...@suse.cz

commit ef5d437f71afdf4afdbab99213add99f4b1318fd upstream.

On s390 any write to a page (even from kernel itself) sets architecture
specific page dirty bit.  Thus when a page is written to via buffered
write, HW dirty bit gets set and when we later map and unmap the page,
page_remove_rmap() finds the dirty bit and calls set_page_dirty().

Dirtying of a page which shouldn't be dirty can cause all sorts of
problems to filesystems.  The bug we observed in practice is that
buffers from the page get freed, so when the page gets later marked as
dirty and writeback writes it, XFS crashes due to an assertion
BUG_ON(!PagePrivate(page)) in page_buffers() called from
xfs_count_page_state().

Similar problem can also happen when zero_user_segment() call from
xfs_vm_writepage() (or block_write_full_page() for that matter) set the
hardware dirty bit during writeback, later buffers get freed, and then
page unmapped.

Fix the issue by ignoring s390 HW dirty bit for page cache pages of
mappings with mapping_cap_account_dirty().  This is safe because for
such mappings when a page gets marked as writeable in PTE it is also
marked dirty in do_wp_page() or do_page_fault().  When the dirty bit is
cleared by clear_page_dirty_for_io(), the page gets writeprotected in
page_mkclean().  So pagecache page is writeable if and only if it is
dirty.

Thanks to Hugh Dickins for pointing out mapping has to have
mapping_cap_account_dirty() for things to work and proposing a cleaned
up variant of the patch.

The patch has survived about two hours of running fsx-linux on tmpfs
while heavily swapping and several days of running on out build machines
where the original problem was triggered.

Signed-off-by: Jan Kara j...@suse.cz
Cc: Martin Schwidefsky schwidef...@de.ibm.com
Cc: Mel Gorman mgor...@suse.de
Cc: Hugh Dickins hu...@google.com
Cc: Heiko Carstens heiko.carst...@de.ibm.com
Signed-off-by: Andrew Morton a...@linux-foundation.org
Signed-off-by: Linus Torvalds torva...@linux-foundation.org
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 mm/rmap.c |   20 +++-
 1 file changed, 15 insertions(+), 5 deletions(-)

--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -56,6 +56,7 @@
 #include linux/mmu_notifier.h
 #include linux/migrate.h
 #include linux/hugetlb.h
+#include linux/backing-dev.h
 
 #include asm/tlbflush.h
 
@@ -977,11 +978,8 @@ int page_mkclean(struct page *page)
 
if (page_mapped(page)) {
struct address_space *mapping = page_mapping(page);
-   if (mapping) {
+   if (mapping)
ret = page_mkclean_file(mapping, page);
-   if (page_test_and_clear_dirty(page_to_pfn(page), 1))
-   ret = 1;
-   }
}
 
return ret;
@@ -1167,6 +1165,7 @@ void page_add_file_rmap(struct page *pag
  */
 void page_remove_rmap(struct page *page)
 {
+   struct address_space *mapping = page_mapping(page);
bool anon = PageAnon(page);
bool locked;
unsigned long flags;
@@ -1189,8 +1188,19 @@ void page_remove_rmap(struct page *page)
 * this if the page is anon, so about to be freed; but perhaps
 * not if it's in swapcache - there might be another pte slot
 * containing the swap entry, but page not yet written to swap.
+*
+* And we can skip it on file pages, so long as the filesystem
+* participates in dirty tracking; but need to catch shm and tmpfs
+* and ramfs pages which have been modified since creation by read
+* fault.
+*
+* Note that mapping must be decided above, before decrementing
+* mapcount (which luckily provides a barrier): once page is unmapped,
+* it could be truncated and page-mapping reset to NULL at any moment.
+* Note also that we are relying on page_mapping(page) to set mapping
+* to swapper_space when PageSwapCache(page).
 */
-   if ((!anon || PageSwapCache(page)) 
+   if (mapping  !mapping_cap_account_dirty(mapping) 
page_test_and_clear_dirty(page_to_pfn(page), 1))
set_page_dirty(page);
/*


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 06/54] drivers/rtc/rtc-imxdi.c: add missing spin lock initialization

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Jan Luebbe j...@pengutronix.de

commit fee0de7791f967c2c5f0d43eb7b7261761b45e64 upstream.

Signed-off-by: Jan Luebbe j...@pengutronix.de
Cc: Alessandro Zummo a.zu...@towertech.it
Cc: Roland Stigge sti...@antcom.de
Cc: Grant Likely grant.lik...@secretlab.ca
Tested-by: Roland Stigge sti...@antcom.de
Cc: Sascha Hauer ker...@pengutronix.de
Cc: Russell King li...@arm.linux.org.uk
Signed-off-by: Andrew Morton a...@linux-foundation.org
Signed-off-by: Linus Torvalds torva...@linux-foundation.org
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/rtc/rtc-imxdi.c |2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/rtc/rtc-imxdi.c
+++ b/drivers/rtc/rtc-imxdi.c
@@ -392,6 +392,8 @@ static int dryice_rtc_probe(struct platf
if (imxdi-ioaddr == NULL)
return -ENOMEM;
 
+   spin_lock_init(imxdi-irq_lock);
+
imxdi-irq = platform_get_irq(pdev, 0);
if (imxdi-irq  0)
return imxdi-irq;


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 05/54] fs/compat_ioctl.c: VIDEO_SET_SPU_PALETTE missing error check

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Kees Cook keesc...@chromium.org

commit 12176503366885edd542389eed3aaf94be163fdb upstream.

The compat ioctl for VIDEO_SET_SPU_PALETTE was missing an error check
while converting ioctl arguments.  This could lead to leaking kernel
stack contents into userspace.

Patch extracted from existing fix in grsecurity.

Signed-off-by: Kees Cook keesc...@chromium.org
Cc: David Miller da...@davemloft.net
Cc: Brad Spengler spen...@grsecurity.net
Cc: PaX Team pagee...@freemail.hu
Signed-off-by: Andrew Morton a...@linux-foundation.org
Signed-off-by: Linus Torvalds torva...@linux-foundation.org
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 fs/compat_ioctl.c |2 ++
 1 file changed, 2 insertions(+)

--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -210,6 +210,8 @@ static int do_video_set_spu_palette(unsi
 
err  = get_user(palp, up-palette);
err |= get_user(length, up-length);
+   if (err)
+   return -EFAULT;
 
up_native = compat_alloc_user_space(sizeof(struct video_spu_palette));
err  = put_user(compat_ptr(palp), up_native-palette);


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 080/101] mac80211: use ieee80211_free_txskb in a few more places

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Felix Fietkau n...@openwrt.org

commit d4fa14cd62bd078c8e3ef39283b9f237e5b2ff0f upstream.

Free tx status skbs when draining power save buffers, pending frames, or
when tearing down a vif.
Fixes remaining conditions that can lead to hostapd/wpa_supplicant hangs when
running out of socket write memory.

Signed-off-by: Felix Fietkau n...@openwrt.org
Signed-off-by: John W. Linville linvi...@tuxdriver.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 net/mac80211/iface.c|2 +-
 net/mac80211/sta_info.c |4 ++--
 net/mac80211/util.c |4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -822,7 +822,7 @@ static void ieee80211_do_stop(struct iee
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
if (info-control.vif == sdata-vif) {
__skb_unlink(skb, local-pending[i]);
-   dev_kfree_skb_irq(skb);
+   ieee80211_free_txskb(local-hw, skb);
}
}
}
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -585,7 +585,7 @@ static bool sta_info_cleanup_expire_buff
 */
if (!skb)
break;
-   dev_kfree_skb(skb);
+   ieee80211_free_txskb(local-hw, skb);
}
 
/*
@@ -614,7 +614,7 @@ static bool sta_info_cleanup_expire_buff
local-total_ps_buffered--;
ps_dbg(sta-sdata, Buffered frame expired (STA %pM)\n,
   sta-sta.addr);
-   dev_kfree_skb(skb);
+   ieee80211_free_txskb(local-hw, skb);
}
 
/*
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -400,7 +400,7 @@ void ieee80211_add_pending_skb(struct ie
int queue = info-hw_queue;
 
if (WARN_ON(!info-control.vif)) {
-   kfree_skb(skb);
+   ieee80211_free_txskb(local-hw, skb);
return;
}
 
@@ -425,7 +425,7 @@ void ieee80211_add_pending_skbs_fn(struc
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
 
if (WARN_ON(!info-control.vif)) {
-   kfree_skb(skb);
+   ieee80211_free_txskb(local-hw, skb);
continue;
}
 


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 09/54] x86, mm: Trim memory in memblock to be page aligned

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Yinghai Lu ying...@kernel.org

commit 6ede1fd3cb404c0016de6ac529df46d561bd558b upstream.

We will not map partial pages, so need to make sure memblock
allocation will not allocate those bytes out.

Also we will use for_each_mem_pfn_range() to loop to map memory
range to keep them consistent.

Signed-off-by: Yinghai Lu ying...@kernel.org
Link: 
http://lkml.kernel.org/r/cae9fiqvzirvabmfyrfxmmwechbksicqehz4vawuv0xfck51...@mail.gmail.com
Acked-by: Jacob Shin jacob.s...@amd.com
Signed-off-by: H. Peter Anvin h...@linux.intel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 arch/x86/kernel/e820.c   |3 +++
 include/linux/memblock.h |1 +
 mm/memblock.c|   24 
 3 files changed, 28 insertions(+)

--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -1076,6 +1076,9 @@ void __init memblock_x86_fill(void)
memblock_add(ei-addr, ei-size);
}
 
+   /* throw away partial pages */
+   memblock_trim_memory(PAGE_SIZE);
+
memblock_dump_all();
 }
 
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -57,6 +57,7 @@ int memblock_add(phys_addr_t base, phys_
 int memblock_remove(phys_addr_t base, phys_addr_t size);
 int memblock_free(phys_addr_t base, phys_addr_t size);
 int memblock_reserve(phys_addr_t base, phys_addr_t size);
+void memblock_trim_memory(phys_addr_t align);
 
 #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
 void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn,
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -908,6 +908,30 @@ int __init_memblock memblock_is_region_r
return memblock_overlaps_region(memblock.reserved, base, size) = 0;
 }
 
+void __init_memblock memblock_trim_memory(phys_addr_t align)
+{
+   int i;
+   phys_addr_t start, end, orig_start, orig_end;
+   struct memblock_type *mem = memblock.memory;
+
+   for (i = 0; i  mem-cnt; i++) {
+   orig_start = mem-regions[i].base;
+   orig_end = mem-regions[i].base + mem-regions[i].size;
+   start = round_up(orig_start, align);
+   end = round_down(orig_end, align);
+
+   if (start == orig_start  end == orig_end)
+   continue;
+
+   if (start  end) {
+   mem-regions[i].base = start;
+   mem-regions[i].size = end - start;
+   } else {
+   memblock_remove_region(mem, i);
+   i--;
+   }
+   }
+}
 
 void __init_memblock memblock_set_current_limit(phys_addr_t limit)
 {


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 04/54] gen_init_cpio: avoid stack overflow when expanding

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: Kees Cook keesc...@chromium.org

commit 20f1de659b77364d55d4e7fad2ef657e7730323f upstream.

Fix possible overflow of the buffer used for expanding environment
variables when building file list.

In the extremely unlikely case of an attacker having control over the
environment variables visible to gen_init_cpio, control over the
contents of the file gen_init_cpio parses, and gen_init_cpio was built
without compiler hardening, the attacker can gain arbitrary execution
control via a stack buffer overflow.

  $ cat usr/crash.list
  file foo ${BIG}${BIG}${BIG}${BIG}${BIG}${BIG} 0755 0 0
  $ BIG=$(perl -e 'print A x 4096;') ./usr/gen_init_cpio usr/crash.list
  *** buffer overflow detected ***: ./usr/gen_init_cpio terminated

This also replaces the space-indenting with tabs.

Patch based on existing fix extracted from grsecurity.

Signed-off-by: Kees Cook keesc...@chromium.org
Cc: Michal Marek mma...@suse.cz
Cc: Brad Spengler spen...@grsecurity.net
Cc: PaX Team pagee...@freemail.hu
Signed-off-by: Andrew Morton a...@linux-foundation.org
Signed-off-by: Linus Torvalds torva...@linux-foundation.org
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 usr/gen_init_cpio.c |   41 ++---
 1 file changed, 22 insertions(+), 19 deletions(-)

--- a/usr/gen_init_cpio.c
+++ b/usr/gen_init_cpio.c
@@ -303,7 +303,7 @@ static int cpio_mkfile(const char *name,
int retval;
int rc = -1;
int namesize;
-   int i;
+   unsigned int i;
 
mode |= S_IFREG;
 
@@ -381,25 +381,28 @@ error:
 
 static char *cpio_replace_env(char *new_location)
 {
-   char expanded[PATH_MAX + 1];
-   char env_var[PATH_MAX + 1];
-   char *start;
-   char *end;
-
-   for (start = NULL; (start = strstr(new_location, ${)); ) {
-   end = strchr(start, '}');
-   if (start  end) {
-   *env_var = *expanded = '\0';
-   strncat(env_var, start + 2, end - start - 2);
-   strncat(expanded, new_location, start - new_location);
-   strncat(expanded, getenv(env_var), PATH_MAX);
-   strncat(expanded, end + 1, PATH_MAX);
-   strncpy(new_location, expanded, PATH_MAX);
-   } else
-   break;
-   }
+   char expanded[PATH_MAX + 1];
+   char env_var[PATH_MAX + 1];
+   char *start;
+   char *end;
+
+   for (start = NULL; (start = strstr(new_location, ${)); ) {
+   end = strchr(start, '}');
+   if (start  end) {
+   *env_var = *expanded = '\0';
+   strncat(env_var, start + 2, end - start - 2);
+   strncat(expanded, new_location, start - new_location);
+   strncat(expanded, getenv(env_var),
+   PATH_MAX - strlen(expanded));
+   strncat(expanded, end + 1,
+   PATH_MAX - strlen(expanded));
+   strncpy(new_location, expanded, PATH_MAX);
+   new_location[PATH_MAX] = 0;
+   } else
+   break;
+   }
 
-   return new_location;
+   return new_location;
 }
 
 


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 03/54] ALSA: hda - add dock support for Thinkpad T430

2012-10-29 Thread Greg Kroah-Hartman
3.4-stable review patch.  If anyone has any objections, please let me know.

--

From: =?UTF-8?q?Stef=C3=A1n=20Freyr?= stefan.fr...@gmail.com

commit 84f98fdf7865fbd35b312eb39ea91e5618c514c7 upstream.

I have a Lenovo ThinkPad T430 and an UltraBase Series 3 docking
station.

Without this patch, if I plug my headphones into the jack on the
computer, everything works fine. The computer speakers mute and the
audio is played in the headphones. However, if I plug into the docking
station headphone jack the computer speakers are muted but there is no
audio in the headphones.

Addresses https://bugs.launchpad.net/bugs/1060372

Signed-off-by: Joseph Salisbury joseph.salisb...@canonical.com
Signed-off-by: Takashi Iwai ti...@suse.de
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 sound/pci/hda/patch_realtek.c |1 +
 1 file changed, 1 insertion(+)

--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -6184,6 +6184,7 @@ static const struct snd_pci_quirk alc269
SND_PCI_QUIRK(0x17aa, 0x21e9, Thinkpad Edge 15, 
ALC269_FIXUP_SKU_IGNORE),
SND_PCI_QUIRK(0x17aa, 0x21f6, Thinkpad T530, 
ALC269_FIXUP_LENOVO_DOCK),
SND_PCI_QUIRK(0x17aa, 0x21fa, Thinkpad X230, 
ALC269_FIXUP_LENOVO_DOCK),
+   SND_PCI_QUIRK(0x17aa, 0x21f3, Thinkpad T430, 
ALC269_FIXUP_LENOVO_DOCK),
SND_PCI_QUIRK(0x17aa, 0x21fb, Thinkpad T430s, 
ALC269_FIXUP_LENOVO_DOCK),
SND_PCI_QUIRK(0x17aa, 0x2203, Thinkpad X230 Tablet, 
ALC269_FIXUP_LENOVO_DOCK),
SND_PCI_QUIRK(0x17aa, 0x3bf8, Quanta FL1, ALC269_FIXUP_PCM_44K),


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 00/54] 3.4.17-stable review

2012-10-29 Thread Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.4.17 release.
There are 54 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 Oct 31 21:37:26 UTC 2012.
Anything received after that time might be too late.

The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.0/stable-review/patch-3.4.17-rc1.gz
and the diffstat can be found below.

thanks,

greg k-h

-
Pseudo-Shortlog of commits:

Greg Kroah-Hartman gre...@linuxfoundation.org
Linux 3.4.17-rc1

Sjoerd Simons sjoerd.sim...@collabora.co.uk
drm/i915: no lvds quirk for Zotac ZDBOX SD ID12/ID13

Yinghai Lu ying...@kernel.org
x86, mm: Use memblock memory loop instead of e820_RAM

Ian Abbott abbo...@mev.co.uk
staging: comedi: amplc_pc236: fix invalid register access during detach

Olof Johansson o...@lixom.net
x86: efi: Turn off efi_enabled after setup on mixed fw/kernel

Josh Triplett j...@joshtriplett.org
efi: Defer freeing boot services memory until after ACPI init

Yinghai Lu ying...@kernel.org
x86, mm: Undo incorrect revert in arch/x86/mm/init.c

Jacob Shin jacob.s...@amd.com
x86, mm: Find_early_table_space based on ranges that are actually being 
mapped

Felix Fietkau n...@openwrt.org
Revert ath9k_hw: Updated AR9003 tx gain table for 5GHz

Andreas Herrmann andreas.herrma...@amd.com
cpufreq / powernow-k8: Remove usage of smp_processor_id() in preemptible 
code

Piotr Haber pha...@broadcom.com
bcma: fix unregistration of cores

Wei Yongjun yongjun_...@trendmicro.com.cn
dmaengine: imx-dma: fix missing unlock on error in imxdma_xfer_desc()

Barry Song baohua.s...@csr.com
dmaengine: sirf: fix a typo in moving running dma_desc to active queue

Barry Song baohua.s...@csr.com
dmaengine: sirf: fix a typo in dma_prep_interleaved

Oleg Nesterov o...@redhat.com
freezer: exec should clear PF_NOFREEZE along with PF_KTHREAD

Johan Hedberg johan.hedb...@intel.com
Bluetooth: SMP: Fix setting unknown auth_req bits

Stanislaw Gruszka sgrus...@redhat.com
mac80211: check if key has TKIP type before updating IV

Ivan Shugov ivan.shu...@gmail.com
ARM: at91: at91sam9g10: fix SOC type detection

Bo Shen voice.s...@atmel.com
ARM: at91/i2c: change id to let i2c-gpio work

Josh Wu josh...@atmel.com
ARM: at91/tc: fix typo in the DT document

Heiko Stuebner he...@sntech.de
ARM: SAMSUNG: Add naming of s3c64xx-spi devices

Michael S. Tsirkin m...@redhat.com
vhost: fix mergeable bufs on BE hosts

Johan Hovold jhov...@gmail.com
USB: mos7840: remove invalid disconnect handling

Johan Hovold jhov...@gmail.com
USB: mos7840: remove NULL-urb submission

Johan Hovold jhov...@gmail.com
USB: mos7840: fix port-device leak in error path

Johan Hovold jhov...@gmail.com
USB: mos7840: fix urb leak at release

Johan Hovold jhov...@gmail.com
USB: sierra: fix memory leak in probe error path

Johan Hovold jhov...@gmail.com
USB: sierra: fix memory leak in attach error path

Lennart Sorensen lsore...@csclub.uwaterloo.ca
USB: serial: Fix memory leak in sierra_release()

Johan Hovold jhov...@gmail.com
USB: opticon: fix memory leak in error path

Johan Hovold jhov...@gmail.com
USB: opticon: fix DMA from stack

Johan Hovold jhov...@gmail.com
USB: whiteheat: fix memory leak in error path

Octavian Purdila octavian.purd...@intel.com
usb hub: send clear_tt_buffer_complete events when canceling TT clear work

Michael Shigorin m...@osdn.org.ua
usb-storage: add unusual_devs entry for Casio EX-N1 digital camera

Anisse Astier ani...@astier.eu
ehci: Add yet-another Lucid nohandoff pci quirk

Anisse Astier ani...@astier.eu
ehci: fix Lucid nohandoff pci quirk to be more generic with BIOS versions

K. Y. Srinivasan k...@microsoft.com
Drivers: hv: Cleanup error handling in vmbus_open()

Arve Hjønnevåg a...@android.com
Staging: android: binder: Allow using highmem for binder buffers

Arve Hjønnevåg a...@android.com
Staging: android: binder: Fix memory leak on thread/process exit

Geert Uytterhoeven ge...@linux-m68k.org
sysfs: sysfs_pathname/sysfs_add_one: Use strlcat() instead of strcat()

Sarah Sharp sarah.a.sh...@linux.intel.com
xhci: Fix potential NULL ptr deref in command cancellation.

Trond Myklebust trond.mykleb...@netapp.com
SUNRPC: Prevent races in xs_abort_connection()

Trond Myklebust trond.mykleb...@netapp.com
Revert SUNRPC: Ensure we close the socket on EPIPE errors too...

Trond Myklebust trond.mykleb...@netapp.com
SUNRPC: Clear the connect flag when socket state is TCP_CLOSE_WAIT

Trond Myklebust trond.mykleb...@netapp.com
SUNRPC: Get rid of the xs_error_report socket callback

Jan Kara j...@suse.cz
mm: fix XFS oops due to dirty pages without buffers on s390

Yinghai Lu ying...@kernel.org
x86, mm: Trim memory in memblock to be page aligned

[ 092/101] cpufreq / powernow-k8: Remove usage of smp_processor_id() in preemptible code

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Andreas Herrmann andreas.herrma...@amd.com

commit e4df1cbcc1f329e53a1fff7450b2229e0addff20 upstream.

Commit 6889125b8b4e09c5e53e6ecab3433bed1ce198c9
(cpufreq/powernow-k8: workqueue user shouldn't migrate the kworker to another 
CPU)
causes powernow-k8 to trigger a preempt warning, e.g.:

  BUG: using smp_processor_id() in preemptible [] code: cpufreq/3776
  caller is powernowk8_target+0x20/0x49
  Pid: 3776, comm: cpufreq Not tainted 3.6.0 #9
  Call Trace:
   [8125b447] debug_smp_processor_id+0xc7/0xe0
   [814877e7] powernowk8_target+0x20/0x49
   [81482b02] __cpufreq_driver_target+0x82/0x8a
   [81484fc6] cpufreq_governor_performance+0x4e/0x54
   [81482c50] __cpufreq_governor+0x8c/0xc9
   [81482e6f] __cpufreq_set_policy+0x1a9/0x21e
   [814839af] store_scaling_governor+0x16f/0x19b
   [81484f16] ? cpufreq_update_policy+0x124/0x124
   [8162b4a5] ? _raw_spin_unlock_irqrestore+0x2c/0x49
   [81483640] store+0x60/0x88
   [811708c0] sysfs_write_file+0xf4/0x130
   [8111243b] vfs_write+0xb5/0x151
   [811126e0] sys_write+0x4a/0x71
   [816319a9] system_call_fastpath+0x16/0x1b

Fix this by by always using work_on_cpu().

Signed-off-by: Andreas Herrmann andreas.herrma...@amd.com
Signed-off-by: Rafael J. Wysocki rafael.j.wyso...@intel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/cpufreq/powernow-k8.c |9 +
 1 file changed, 1 insertion(+), 8 deletions(-)

--- a/drivers/cpufreq/powernow-k8.c
+++ b/drivers/cpufreq/powernow-k8.c
@@ -1223,14 +1223,7 @@ static int powernowk8_target(struct cpuf
struct powernowk8_target_arg pta = { .pol = pol, .targfreq = targfreq,
 .relation = relation };
 
-   /*
-* Must run on @pol-cpu.  cpufreq core is responsible for ensuring
-* that we're bound to the current CPU and pol-cpu stays online.
-*/
-   if (smp_processor_id() == pol-cpu)
-   return powernowk8_target_fn(pta);
-   else
-   return work_on_cpu(pol-cpu, powernowk8_target_fn, pta);
+   return work_on_cpu(pol-cpu, powernowk8_target_fn, pta);
 }
 
 /* Driver entry point to verify the policy and range of frequencies */


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 084/101] qmi_wwan/cdc_ether: move Novatel 551 and E362 to qmi_wwan

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Dan Williams d...@redhat.com

commit f8295ec22cb0f1ee6849b862addbfa3ea9320755 upstream.

These devices provide QMI and ethernet functionality via a standard CDC
ethernet descriptor.  But when driven by cdc_ether, the QMI
functionality is unavailable because only cdc_ether can claim the USB
interface.  Thus blacklist the devices in cdc_ether and add their IDs to
qmi_wwan, which enables both QMI and ethernet simultaneously.

Signed-off-by: Dan Williams d...@redhat.com
Acked-by: Greg Kroah-Hartman gre...@linuxfoundation.org
Acked-by: Bjørn Mork bj...@mork.no
Signed-off-by: David S. Miller da...@davemloft.net
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/net/usb/cdc_ether.c |   41 ++---
 drivers/net/usb/qmi_wwan.c  |   14 ++
 2 files changed, 40 insertions(+), 15 deletions(-)

--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -592,6 +592,32 @@ static const struct usb_device_id  produc
.driver_info= 0,
 },
 
+/* Novatel USB551L and MC551 - handled by qmi_wwan */
+{
+   .match_flags=   USB_DEVICE_ID_MATCH_VENDOR
+| USB_DEVICE_ID_MATCH_PRODUCT
+| USB_DEVICE_ID_MATCH_INT_INFO,
+   .idVendor   = NOVATEL_VENDOR_ID,
+   .idProduct  = 0xB001,
+   .bInterfaceClass= USB_CLASS_COMM,
+   .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET,
+   .bInterfaceProtocol = USB_CDC_PROTO_NONE,
+   .driver_info = 0,
+},
+
+/* Novatel E362 - handled by qmi_wwan */
+{
+   .match_flags=   USB_DEVICE_ID_MATCH_VENDOR
+| USB_DEVICE_ID_MATCH_PRODUCT
+| USB_DEVICE_ID_MATCH_INT_INFO,
+   .idVendor   = NOVATEL_VENDOR_ID,
+   .idProduct  = 0x9010,
+   .bInterfaceClass= USB_CLASS_COMM,
+   .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET,
+   .bInterfaceProtocol = USB_CDC_PROTO_NONE,
+   .driver_info = 0,
+},
+
 /*
  * WHITELIST!!!
  *
@@ -604,21 +630,6 @@ static const struct usb_device_id  produc
  * because of bugs/quirks in a given product (like Zaurus, above).
  */
 {
-   /* Novatel USB551L */
-   /* This match must come *before* the generic CDC-ETHER match so that
-* we get FLAG_WWAN set on the device, since it's descriptors are
-* generic CDC-ETHER.
-*/
-   .match_flags=   USB_DEVICE_ID_MATCH_VENDOR
-| USB_DEVICE_ID_MATCH_PRODUCT
-| USB_DEVICE_ID_MATCH_INT_INFO,
-   .idVendor   = NOVATEL_VENDOR_ID,
-   .idProduct  = 0xB001,
-   .bInterfaceClass= USB_CLASS_COMM,
-   .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET,
-   .bInterfaceProtocol = USB_CDC_PROTO_NONE,
-   .driver_info = (unsigned long)wwan_info,
-}, {
/* ZTE (Vodafone) K3805-Z */
.match_flags=   USB_DEVICE_ID_MATCH_VENDOR
 | USB_DEVICE_ID_MATCH_PRODUCT
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -364,6 +364,20 @@ static const struct usb_device_id produc
USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 
USB_CLASS_VENDOR_SPEC, 1, 57),
.driver_info= (unsigned long)qmi_wwan_info,
},
+   {   /* Novatel USB551L and MC551 */
+   USB_DEVICE_AND_INTERFACE_INFO(0x1410, 0xb001,
+ USB_CLASS_COMM,
+ USB_CDC_SUBCLASS_ETHERNET,
+ USB_CDC_PROTO_NONE),
+   .driver_info= (unsigned long)qmi_wwan_info,
+   },
+   {   /* Novatel E362 */
+   USB_DEVICE_AND_INTERFACE_INFO(0x1410, 0x9010,
+ USB_CLASS_COMM,
+ USB_CDC_SUBCLASS_ETHERNET,
+ USB_CDC_PROTO_NONE),
+   .driver_info= (unsigned long)qmi_wwan_info,
+   },
 
/* 2. Combined interface devices matching on class+protocol */
{   /* Huawei E367 and possibly others in Windows mode */


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 090/101] bcma: fix unregistration of cores

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Piotr Haber pha...@broadcom.com

commit 1fffa905adffbf0d3767fc978ef09afb830275eb upstream.

When cores are unregistered, entries
need to be removed from cores list in a safe manner.

Reported-by: Stanislaw Gruszka sgrus...@redhat.com
Reviewed-by: Arend Van Spriel ar...@broadcom.com
Signed-off-by: Piotr Haber pha...@broadcom.com
Signed-off-by: John W. Linville linvi...@tuxdriver.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/bcma/main.c |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -141,9 +141,10 @@ static int bcma_register_cores(struct bc
 
 static void bcma_unregister_cores(struct bcma_bus *bus)
 {
-   struct bcma_device *core;
+   struct bcma_device *core, *tmp;
 
-   list_for_each_entry(core, bus-cores, list) {
+   list_for_each_entry_safe(core, tmp, bus-cores, list) {
+   list_del(core-list);
if (core-dev_registered)
device_unregister(core-dev);
}


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 089/101] iwlwifi: fix 6000 series channel switch command

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Johannes Berg johannes.b...@intel.com

commit 8f7b8db6e0557c8437adf9371e020cd89a7e85dc upstream.

The channel switch command for 6000 series devices
is larger than the maximum inline command size of
320 bytes. The command is therefore refused with a
warning. Fix this by allocating the command and
using the NOCOPY mechanism.

Reviewed-by: Emmanuel Grumbach emmanuel.grumb...@intel.com
Signed-off-by: Johannes Berg johannes.b...@intel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/net/wireless/iwlwifi/dvm/devices.c |   39 +
 1 file changed, 24 insertions(+), 15 deletions(-)

--- a/drivers/net/wireless/iwlwifi/dvm/devices.c
+++ b/drivers/net/wireless/iwlwifi/dvm/devices.c
@@ -518,7 +518,7 @@ static int iwl6000_hw_channel_switch(str
 * See iwlagn_mac_channel_switch.
 */
struct iwl_rxon_context *ctx = priv-contexts[IWL_RXON_CTX_BSS];
-   struct iwl6000_channel_switch_cmd cmd;
+   struct iwl6000_channel_switch_cmd *cmd;
u32 switch_time_in_usec, ucode_switch_time;
u16 ch;
u32 tsf_low;
@@ -527,18 +527,25 @@ static int iwl6000_hw_channel_switch(str
struct ieee80211_vif *vif = ctx-vif;
struct iwl_host_cmd hcmd = {
.id = REPLY_CHANNEL_SWITCH,
-   .len = { sizeof(cmd), },
+   .len = { sizeof(*cmd), },
.flags = CMD_SYNC,
-   .data = { cmd, },
+   .dataflags[0] = IWL_HCMD_DFL_NOCOPY,
};
+   int err;
 
-   cmd.band = priv-band == IEEE80211_BAND_2GHZ;
+   cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
+   if (!cmd)
+   return -ENOMEM;
+
+   hcmd.data[0] = cmd;
+
+   cmd-band = priv-band == IEEE80211_BAND_2GHZ;
ch = ch_switch-channel-hw_value;
IWL_DEBUG_11H(priv, channel switch from %u to %u\n,
  ctx-active.channel, ch);
-   cmd.channel = cpu_to_le16(ch);
-   cmd.rxon_flags = ctx-staging.flags;
-   cmd.rxon_filter_flags = ctx-staging.filter_flags;
+   cmd-channel = cpu_to_le16(ch);
+   cmd-rxon_flags = ctx-staging.flags;
+   cmd-rxon_filter_flags = ctx-staging.filter_flags;
switch_count = ch_switch-count;
tsf_low = ch_switch-timestamp  0x0;
/*
@@ -554,23 +561,25 @@ static int iwl6000_hw_channel_switch(str
switch_count = 0;
}
if (switch_count = 1)
-   cmd.switch_time = cpu_to_le32(priv-ucode_beacon_time);
+   cmd-switch_time = cpu_to_le32(priv-ucode_beacon_time);
else {
switch_time_in_usec =
vif-bss_conf.beacon_int * switch_count * TIME_UNIT;
ucode_switch_time = iwl_usecs_to_beacons(priv,
 switch_time_in_usec,
 beacon_interval);
-   cmd.switch_time = iwl_add_beacon_time(priv,
- priv-ucode_beacon_time,
- ucode_switch_time,
- beacon_interval);
+   cmd-switch_time = iwl_add_beacon_time(priv,
+  priv-ucode_beacon_time,
+  ucode_switch_time,
+  beacon_interval);
}
IWL_DEBUG_11H(priv, uCode time for the switch is 0x%x\n,
- cmd.switch_time);
-   cmd.expect_beacon = ch_switch-channel-flags  IEEE80211_CHAN_RADAR;
+ cmd-switch_time);
+   cmd-expect_beacon = ch_switch-channel-flags  IEEE80211_CHAN_RADAR;
 
-   return iwl_dvm_send_cmd(priv, hcmd);
+   err = iwl_dvm_send_cmd(priv, hcmd);
+   kfree(cmd);
+   return err;
 }
 
 struct iwl_lib_ops iwl6000_lib = {


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 088/101] dmaengine: imx-dma: fix missing unlock on error in imxdma_xfer_desc()

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Wei Yongjun yongjun_...@trendmicro.com.cn

commit 720dfd250e48a8c7fd1b2b8645955413989c4ee0 upstream.

Add the missing unlock on the error handling path in function
imxdma_xfer_desc().

Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn
Signed-off-by: Vinod Koul vinod.k...@linux.intel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/dma/imx-dma.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -474,8 +474,10 @@ static int imxdma_xfer_desc(struct imxdm
slot = i;
break;
}
-   if (slot  0)
+   if (slot  0) {
+   spin_unlock_irqrestore(imxdma-lock, flags);
return -EBUSY;
+   }
 
imxdma-slots_2d[slot].xsr = d-x;
imxdma-slots_2d[slot].ysr = d-y;


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 087/101] dmaengine: sirf: fix a typo in moving running dma_desc to active queue

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Barry Song baohua.s...@csr.com

commit 26fd12209c08fe947be1828896ef4ffc5bd0e6df upstream.

list_move_tail(schan-queued, schan-active) makes the 
list_empty(schan-queued)
undefined, we either should change it to:
list_move_tail(schan-queued.next, schan-active)
or
list_move_tail(sdesc-node, schan-active)

Signed-off-by: Barry Song baohua.s...@csr.com
Signed-off-by: Vinod Koul vinod.k...@linux.intel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

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

--- a/drivers/dma/sirf-dma.c
+++ b/drivers/dma/sirf-dma.c
@@ -109,7 +109,7 @@ static void sirfsoc_dma_execute(struct s
sdesc = list_first_entry(schan-queued, struct sirfsoc_dma_desc,
node);
/* Move the first queued descriptor to active list */
-   list_move_tail(schan-queued, schan-active);
+   list_move_tail(sdesc-node, schan-active);
 
/* Start the DMA transfer */
writel_relaxed(sdesc-width, sdma-base + SIRFSOC_DMA_WIDTH_0 +


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 086/101] dmaengine: sirf: fix a typo in dma_prep_interleaved

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Barry Song baohua.s...@csr.com

commit 5997e089e4c3a7f0958a8fb0a54ec2b5a6f06168 upstream.

either DEV_TO_MEM or MEM_TO_DEV is supported, so change
OR to AND.

Signed-off-by: Barry Song baohua.s...@csr.com
Signed-off-by: Vinod Koul vinod.k...@linux.intel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

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

--- a/drivers/dma/sirf-dma.c
+++ b/drivers/dma/sirf-dma.c
@@ -428,7 +428,7 @@ static struct dma_async_tx_descriptor *s
unsigned long iflags;
int ret;
 
-   if ((xt-dir != DMA_MEM_TO_DEV) || (xt-dir != DMA_DEV_TO_MEM)) {
+   if ((xt-dir != DMA_MEM_TO_DEV)  (xt-dir != DMA_DEV_TO_MEM)) {
ret = -EINVAL;
goto err_dir;
}


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 085/101] freezer: exec should clear PF_NOFREEZE along with PF_KTHREAD

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Oleg Nesterov o...@redhat.com

commit b40a79591ca918e7b91b0d9b6abd5d00f2e88c19 upstream.

flush_old_exec() clears PF_KTHREAD but forgets about PF_NOFREEZE.

Signed-off-by: Oleg Nesterov o...@redhat.com
Acked-by: Tejun Heo t...@kernel.org
Signed-off-by: Rafael J. Wysocki rafael.j.wyso...@intel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

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

--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1110,7 +1110,8 @@ int flush_old_exec(struct linux_binprm *
bprm-mm = NULL;/* We're using it now */
 
set_fs(USER_DS);
-   current-flags = ~(PF_RANDOMIZE | PF_FORKNOEXEC | PF_KTHREAD);
+   current-flags =
+   ~(PF_RANDOMIZE | PF_FORKNOEXEC | PF_KTHREAD | PF_NOFREEZE);
flush_thread();
current-personality = ~bprm-per_clear;
 


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 060/101] USB: quatech2: fix port-data memory leaks

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Johan Hovold jhov...@gmail.com

commit 40d04738491d7ac1aa708ba434ff3480ec9e1b96 upstream.

Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.

Since commit 0998d0631001288 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Note that this also fixes memory leaks in the error path of attach where
the write urbs were not freed on errors.

Make sure all interface-data deallocation is done in release by moving
the read urb deallocation from disconnect.

Note that the write urb is killed during close so that the call in
disconnect was superfluous.

Compile-only tested.

Signed-off-by: Johan Hovold jhov...@gmail.com
Cc: Bill Pemberton wf...@virginia.edu
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/usb/serial/quatech2.c |  121 +-
 1 file changed, 51 insertions(+), 70 deletions(-)

--- a/drivers/usb/serial/quatech2.c
+++ b/drivers/usb/serial/quatech2.c
@@ -145,12 +145,12 @@ static void qt2_read_bulk_callback(struc
 
 static void qt2_release(struct usb_serial *serial)
 {
-   int i;
+   struct qt2_serial_private *serial_priv;
 
-   kfree(usb_get_serial_data(serial));
+   serial_priv = usb_get_serial_data(serial);
 
-   for (i = 0; i  serial-num_ports; i++)
-   kfree(usb_get_serial_port_data(serial-port[i]));
+   usb_free_urb(serial_priv-read_urb);
+   kfree(serial_priv);
 }
 
 static inline int calc_baud_divisor(int baudrate)
@@ -466,21 +466,9 @@ static void qt2_close(struct usb_serial_
 static void qt2_disconnect(struct usb_serial *serial)
 {
struct qt2_serial_private *serial_priv = usb_get_serial_data(serial);
-   struct qt2_port_private *port_priv;
-   int i;
 
if (serial_priv-read_urb-status == -EINPROGRESS)
usb_kill_urb(serial_priv-read_urb);
-
-   usb_free_urb(serial_priv-read_urb);
-
-   for (i = 0; i  serial-num_ports; i++) {
-   port_priv = usb_get_serial_port_data(serial-port[i]);
-
-   if (port_priv-write_urb-status == -EINPROGRESS)
-   usb_kill_urb(port_priv-write_urb);
-   usb_free_urb(port_priv-write_urb);
-   }
 }
 
 static int get_serial_info(struct usb_serial_port *port,
@@ -775,11 +763,9 @@ static void qt2_read_bulk_callback(struc
 
 static int qt2_setup_urbs(struct usb_serial *serial)
 {
-   struct usb_serial_port *port;
struct usb_serial_port *port0;
struct qt2_serial_private *serial_priv;
-   struct qt2_port_private *port_priv;
-   int pcount, status;
+   int status;
 
port0 = serial-port[0];
 
@@ -797,30 +783,6 @@ static int qt2_setup_urbs(struct usb_ser
  sizeof(serial_priv-read_buffer),
  qt2_read_bulk_callback, serial);
 
-   /* setup write_urb for each port */
-   for (pcount = 0; pcount  serial-num_ports; pcount++) {
-
-   port = serial-port[pcount];
-   port_priv = usb_get_serial_port_data(port);
-
-   port_priv-write_urb = usb_alloc_urb(0, GFP_KERNEL);
-   if (!port_priv-write_urb) {
-   dev_err(serial-dev-dev,
-   failed to alloc write_urb for port %i\n,
-   pcount);
-   return -ENOMEM;
-   }
-
-   usb_fill_bulk_urb(port_priv-write_urb,
- serial-dev,
- usb_sndbulkpipe(serial-dev,
- port0-
- bulk_out_endpointAddress),
- port_priv-write_buffer,
- sizeof(port_priv-write_buffer),
- qt2_write_bulk_callback, port);
-   }
-
status = usb_submit_urb(serial_priv-read_urb, GFP_KERNEL);
if (status != 0) {
dev_err(serial-dev-dev,
@@ -830,14 +792,12 @@ static int qt2_setup_urbs(struct usb_ser
}
 
return 0;
-
 }
 
 static int qt2_attach(struct usb_serial *serial)
 {
struct qt2_serial_private *serial_priv;
-   struct qt2_port_private *port_priv;
-   int status, pcount;
+   int status;
 
/* power on unit */
status = usb_control_msg(serial-dev, usb_rcvctrlpipe(serial-dev, 0),
@@ -857,26 +817,6 @@ static int qt2_attach(struct usb_serial
 
usb_set_serial_data(serial, serial_priv);
 
-   for (pcount = 0; pcount  serial-num_ports; pcount++) {
-   port_priv = kzalloc(sizeof(*port_priv), GFP_KERNEL);
-   if (!port_priv) {
-   dev_err(serial-dev-dev,
-   %s- kmalloc(%Zd

[ 083/101] Bluetooth: SMP: Fix setting unknown auth_req bits

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Johan Hedberg johan.hedb...@intel.com

commit 065a13e2cc665f6547dc7e8a9d6b6565badf940a upstream.

When sending a pairing request or response we should not just blindly
copy the value that the remote device sent. Instead we should at least
make sure to mask out any unknown bits. This is particularly critical
from the upcoming LE Secure Connections feature perspective as
incorrectly indicating support for it (by copying the remote value)
would cause a failure to pair with devices that support it.

Signed-off-by: Johan Hedberg johan.hedb...@intel.com
Acked-by: Marcel Holtmann mar...@holtmann.org
Signed-off-by: Gustavo Padovan gustavo.pado...@collabora.co.uk
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 net/bluetooth/smp.c |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -32,6 +32,8 @@
 
 #define SMP_TIMEOUTmsecs_to_jiffies(3)
 
+#define AUTH_REQ_MASK   0x07
+
 static inline void swap128(u8 src[16], u8 dst[16])
 {
int i;
@@ -230,7 +232,7 @@ static void build_pairing_cmd(struct l2c
req-max_key_size = SMP_MAX_ENC_KEY_SIZE;
req-init_key_dist = 0;
req-resp_key_dist = dist_keys;
-   req-auth_req = authreq;
+   req-auth_req = (authreq  AUTH_REQ_MASK);
return;
}
 
@@ -239,7 +241,7 @@ static void build_pairing_cmd(struct l2c
rsp-max_key_size = SMP_MAX_ENC_KEY_SIZE;
rsp-init_key_dist = 0;
rsp-resp_key_dist = req-resp_key_dist  dist_keys;
-   rsp-auth_req = authreq;
+   rsp-auth_req = (authreq  AUTH_REQ_MASK);
 }
 
 static u8 check_enc_key_size(struct l2cap_conn *conn, __u8 max_key_size)


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 082/101] tilegx: fix some issues in the SW TSO support

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Chris Metcalf cmetc...@tilera.com

commit 3da3fff8006c608f19a51859d44ba47ca8b41461 upstream.

This change correctly computes the header length and data length in
the fragments to avoid a bug where we would end up with extremely
slow performance.  Also adopt use of skb_frag_size() accessor.

Signed-off-by: Chris Metcalf cmetc...@tilera.com
Signed-off-by: David S. Miller da...@davemloft.net
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/net/ethernet/tile/tilegx.c |   35 +++
 1 file changed, 19 insertions(+), 16 deletions(-)

--- a/drivers/net/ethernet/tile/tilegx.c
+++ b/drivers/net/ethernet/tile/tilegx.c
@@ -1334,11 +1334,11 @@ static int tso_count_edescs(struct sk_bu
 {
struct skb_shared_info *sh = skb_shinfo(skb);
unsigned int sh_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
-   unsigned int data_len = skb-data_len + skb-hdr_len - sh_len;
+   unsigned int data_len = skb-len - sh_len;
unsigned int p_len = sh-gso_size;
long f_id = -1;/* id of the current fragment */
-   long f_size = skb-hdr_len;  /* size of the current fragment */
-   long f_used = sh_len;  /* bytes used from the current fragment */
+   long f_size = skb_headlen(skb) - sh_len;  /* current fragment size */
+   long f_used = 0;  /* bytes used from the current fragment */
long n;/* size of the current piece of payload */
int num_edescs = 0;
int segment;
@@ -1353,7 +1353,7 @@ static int tso_count_edescs(struct sk_bu
/* Advance as needed. */
while (f_used = f_size) {
f_id++;
-   f_size = sh-frags[f_id].size;
+   f_size = skb_frag_size(sh-frags[f_id]);
f_used = 0;
}
 
@@ -1384,13 +1384,13 @@ static void tso_headers_prepare(struct s
struct iphdr *ih;
struct tcphdr *th;
unsigned int sh_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
-   unsigned int data_len = skb-data_len + skb-hdr_len - sh_len;
+   unsigned int data_len = skb-len - sh_len;
unsigned char *data = skb-data;
unsigned int ih_off, th_off, p_len;
unsigned int isum_seed, tsum_seed, id, seq;
long f_id = -1;/* id of the current fragment */
-   long f_size = skb-hdr_len;  /* size of the current fragment */
-   long f_used = sh_len;  /* bytes used from the current fragment */
+   long f_size = skb_headlen(skb) - sh_len;  /* current fragment size */
+   long f_used = 0;  /* bytes used from the current fragment */
long n;/* size of the current piece of payload */
int segment;
 
@@ -1405,7 +1405,7 @@ static void tso_headers_prepare(struct s
isum_seed = ((0x - ih-check) +
 (0x - ih-tot_len) +
 (0x - ih-id));
-   tsum_seed = th-check + (0x ^ htons(sh_len + data_len));
+   tsum_seed = th-check + (0x ^ htons(skb-len));
id = ntohs(ih-id);
seq = ntohl(th-seq);
 
@@ -1444,7 +1444,7 @@ static void tso_headers_prepare(struct s
/* Advance as needed. */
while (f_used = f_size) {
f_id++;
-   f_size = sh-frags[f_id].size;
+   f_size = skb_frag_size(sh-frags[f_id]);
f_used = 0;
}
 
@@ -1478,14 +1478,14 @@ static void tso_egress(struct net_device
struct tile_net_priv *priv = netdev_priv(dev);
struct skb_shared_info *sh = skb_shinfo(skb);
unsigned int sh_len = skb_transport_offset(skb) + tcp_hdrlen(skb);
-   unsigned int data_len = skb-data_len + skb-hdr_len - sh_len;
+   unsigned int data_len = skb-len - sh_len;
unsigned int p_len = sh-gso_size;
gxio_mpipe_edesc_t edesc_head = { { 0 } };
gxio_mpipe_edesc_t edesc_body = { { 0 } };
long f_id = -1;/* id of the current fragment */
-   long f_size = skb-hdr_len;  /* size of the current fragment */
-   long f_used = sh_len;  /* bytes used from the current fragment */
-   void *f_data = skb-data;
+   long f_size = skb_headlen(skb) - sh_len;  /* current fragment size */
+   long f_used = 0;  /* bytes used from the current fragment */
+   void *f_data = skb-data + sh_len;
long n;/* size of the current piece of payload */
unsigned long tx_packets = 0, tx_bytes = 0;
unsigned int csum_start;
@@ -1516,15 +1516,18 @@ static void tso_egress(struct net_device
 
/* Egress the payload. */
while (p_used  p_len) {
+   void *va

[ 078/101] mac80211: connect with HT20 if HT40 is not permitted

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Johannes Berg johannes.b...@intel.com

commit 3a40414f826a8f1096d9b94c4a53ef91b25ba28d upstream.

Some changes to fix issues with HT40 APs in Korea
and follow-up changes to allow using HT40 even if
the local regulatory database disallows it caused
issues with iwlwifi (and could cause issues with
other devices); iwlwifi firmware would assert if
you tried to connect to an AP that has an invalid
configuration (e.g. using HT40- on channel 140.)

Fix this, while avoiding the Korean AP issue by
disabling HT40 and advertising HT20 to the AP
when connecting.

Reported-by: Florian Reitmeir flor...@reitmeir.org
Tested-by: Florian Reitmeir flor...@reitmeir.org
Signed-off-by: Johannes Berg johannes.b...@intel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 net/mac80211/mlme.c |   30 --
 1 file changed, 20 insertions(+), 10 deletions(-)

--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -3065,22 +3065,32 @@ static int ieee80211_prep_connection(str
   ht_cfreq, ht_oper-primary_chan,
   cbss-channel-band);
ht_oper = NULL;
+   } else {
+   channel_type = NL80211_CHAN_HT20;
}
}
 
-   if (ht_oper) {
-   channel_type = NL80211_CHAN_HT20;
+   if (ht_oper  sband-ht_cap.cap  IEEE80211_HT_CAP_SUP_WIDTH_20_40) {
+   /*
+* cfg80211 already verified that the channel itself can
+* be used, but it didn't check that we can do the right
+* HT type, so do that here as well. If HT40 isn't allowed
+* on this channel, disable 40 MHz operation.
+*/
 
-   if (sband-ht_cap.cap  IEEE80211_HT_CAP_SUP_WIDTH_20_40) {
-   switch (ht_oper-ht_param 
-   IEEE80211_HT_PARAM_CHA_SEC_OFFSET) {
-   case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
+   switch (ht_oper-ht_param  IEEE80211_HT_PARAM_CHA_SEC_OFFSET) {
+   case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
+   if (cbss-channel-flags  IEEE80211_CHAN_NO_HT40PLUS)
+   ifmgd-flags |= IEEE80211_STA_DISABLE_40MHZ;
+   else
channel_type = NL80211_CHAN_HT40PLUS;
-   break;
-   case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
+   break;
+   case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
+   if (cbss-channel-flags  IEEE80211_CHAN_NO_HT40MINUS)
+   ifmgd-flags |= IEEE80211_STA_DISABLE_40MHZ;
+   else
channel_type = NL80211_CHAN_HT40MINUS;
-   break;
-   }
+   break;
}
}
 


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 077/101] ARM: at91: fix external interrupt specification in board code

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Nicolas Ferre nicolas.fe...@atmel.com

commit 69e7ea04c9365626c0963ff09bbaa3a1b49e293a upstream.

Since the switch to sparse irq, we have to add the NR_IRQS_LEGACY
offset to static irq numbers. It has been forgotten on these
SPI irq definitions in board code.

Signed-off-by: Nicolas Ferre nicolas.fe...@atmel.com
Acked-by: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com
Acked-by: Ludovic Desroches ludovic.desroc...@atmel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 arch/arm/mach-at91/board-neocore926.c |2 +-
 arch/arm/mach-at91/board-sam9261ek.c  |2 +-
 arch/arm/mach-at91/board-sam9263ek.c  |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

--- a/arch/arm/mach-at91/board-neocore926.c
+++ b/arch/arm/mach-at91/board-neocore926.c
@@ -129,7 +129,7 @@ static struct spi_board_info neocore926_
.max_speed_hz   = 125000 * 16,
.bus_num= 0,
.platform_data  = ads_info,
-   .irq= AT91SAM9263_ID_IRQ1,
+   .irq= NR_IRQS_LEGACY + AT91SAM9263_ID_IRQ1,
},
 #endif
 };
--- a/arch/arm/mach-at91/board-sam9261ek.c
+++ b/arch/arm/mach-at91/board-sam9261ek.c
@@ -309,7 +309,7 @@ static struct spi_board_info ek_spi_devi
.max_speed_hz   = 125000 * 26,  /* (max sample rate @ 3V) * 
(cmd + data + overhead) */
.bus_num= 0,
.platform_data  = ads_info,
-   .irq= AT91SAM9261_ID_IRQ0,
+   .irq= NR_IRQS_LEGACY + AT91SAM9261_ID_IRQ0,
.controller_data = (void *) AT91_PIN_PA28,  /* CS pin */
},
 #endif
--- a/arch/arm/mach-at91/board-sam9263ek.c
+++ b/arch/arm/mach-at91/board-sam9263ek.c
@@ -132,7 +132,7 @@ static struct spi_board_info ek_spi_devi
.max_speed_hz   = 125000 * 26,  /* (max sample rate @ 3V) * 
(cmd + data + overhead) */
.bus_num= 0,
.platform_data  = ads_info,
-   .irq= AT91SAM9263_ID_IRQ1,
+   .irq= NR_IRQS_LEGACY + AT91SAM9263_ID_IRQ1,
},
 #endif
 };


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 076/101] ARM: at91: fix external interrupts in non-DT case

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Nicolas Ferre nicolas.fe...@atmel.com

commit 738a0fd752dc60e20beeda6f2f0f62e58dc0e344 upstream.

Management of external interrupts has changed but the
non-DT code has not integrated these changes.
Add a mask to pass external irq specification from SoC
specific code to the at91_aic_init() function.

Signed-off-by: Nicolas Ferre nicolas.fe...@atmel.com
Acked-by: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com
Acked-by: Ludovic Desroches ludovic.desroc...@atmel.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 arch/arm/mach-at91/generic.h |3 ++-
 arch/arm/mach-at91/irq.c |9 +++--
 arch/arm/mach-at91/setup.c   |2 +-
 3 files changed, 10 insertions(+), 4 deletions(-)

--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -26,7 +26,8 @@ extern void __init at91_dt_initialize(vo
 extern void __init at91_init_irq_default(void);
 extern void __init at91_init_interrupts(unsigned int priority[]);
 extern void __init at91x40_init_interrupts(unsigned int priority[]);
-extern void __init at91_aic_init(unsigned int priority[]);
+extern void __init at91_aic_init(unsigned int priority[],
+unsigned int ext_irq_mask);
 extern int  __init at91_aic_of_init(struct device_node *node,
struct device_node *parent);
 extern int  __init at91_aic5_of_init(struct device_node *node,
--- a/arch/arm/mach-at91/irq.c
+++ b/arch/arm/mach-at91/irq.c
@@ -502,14 +502,19 @@ int __init at91_aic5_of_init(struct devi
 /*
  * Initialize the AIC interrupt controller.
  */
-void __init at91_aic_init(unsigned int *priority)
+void __init at91_aic_init(unsigned int *priority, unsigned int ext_irq_mask)
 {
unsigned int i;
int irq_base;
 
-   if (at91_aic_pm_init())
+   at91_extern_irq = kzalloc(BITS_TO_LONGS(n_irqs)
+ * sizeof(*at91_extern_irq), GFP_KERNEL);
+
+   if (at91_aic_pm_init() || at91_extern_irq == NULL)
panic(Unable to allocate bit maps\n);
 
+   *at91_extern_irq = ext_irq_mask;
+
at91_aic_base = ioremap(AT91_AIC, 512);
if (!at91_aic_base)
panic(Unable to ioremap AIC registers\n);
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -47,7 +47,7 @@ void __init at91_init_irq_default(void)
 void __init at91_init_interrupts(unsigned int *priority)
 {
/* Initialize the AIC interrupt controller */
-   at91_aic_init(priority);
+   at91_aic_init(priority, at91_extern_irq);
 
/* Enable GPIO interrupts */
at91_gpio_irq_setup();


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 069/101] USB: mos7840: remove NULL-urb submission

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Johan Hovold jhov...@gmail.com

commit 28c3ae9a8cf45f439c9a0779ebd0256e2ae72813 upstream.

The private int_urb is never allocated so the submission from the
control completion handler will always fail. Remove this odd piece of
broken code.

Signed-off-by: Johan Hovold jhov...@gmail.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 drivers/usb/serial/mos7840.c |   15 +--
 1 file changed, 1 insertion(+), 14 deletions(-)

--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -218,7 +218,6 @@ struct moschip_port {
int port_num;   /*Actual port number in the device(1,2,etc) */
struct urb *write_urb;  /* write URB for this port */
struct urb *read_urb;   /* read URB for this port */
-   struct urb *int_urb;
__u8 shadowLCR; /* last LCR value received */
__u8 shadowMCR; /* last MCR value received */
char open;
@@ -493,7 +492,6 @@ static void mos7840_control_callback(str
unsigned char *data;
struct moschip_port *mos7840_port;
__u8 regval = 0x0;
-   int result = 0;
int status = urb-status;
 
mos7840_port = urb-context;
@@ -512,7 +510,7 @@ static void mos7840_control_callback(str
default:
dbg(%s - nonzero urb status received: %d, __func__,
status);
-   goto exit;
+   return;
}
 
dbg(%s urb buffer size is %d, __func__, urb-actual_length);
@@ -525,17 +523,6 @@ static void mos7840_control_callback(str
mos7840_handle_new_msr(mos7840_port, regval);
else if (mos7840_port-MsrLsr == 1)
mos7840_handle_new_lsr(mos7840_port, regval);
-
-exit:
-   spin_lock(mos7840_port-pool_lock);
-   if (!mos7840_port-zombie)
-   result = usb_submit_urb(mos7840_port-int_urb, GFP_ATOMIC);
-   spin_unlock(mos7840_port-pool_lock);
-   if (result) {
-   dev_err(urb-dev-dev,
-   %s - Error %d submitting interrupt urb\n,
-   __func__, result);
-   }
 }
 
 static int mos7840_get_reg(struct moschip_port *mcs, __u16 Wval, __u16 reg,


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[ 075/101] ARM: at91: at91sam9g10: fix SOC type detection

2012-10-29 Thread Greg Kroah-Hartman
3.6-stable review patch.  If anyone has any objections, please let me know.

--

From: Ivan Shugov ivan.shu...@gmail.com

commit 3d9a0183dd3423353e9e363bcc261c1220d05f9f upstream.

Newer at91sam9g10 SoC revision can't be detected, so the kernel can't boot with
this kind of kernel panic:
AT91: Impossible to detect the SOC type

CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
CPU: VIVT data cache, VIVT instruction cache
Machine: Atmel AT91SAM9G10-EK
Ignoring tag cmdline (using the default kernel command line)
bootconsole [earlycon0] enabled
Memory policy: ECC disabled, Data cache writeback
Kernel panic - not syncing: AT91: Impossible to detect the SOC type
[c00133d4] (unwind_backtrace+0x0/0xe0) from [c02366dc] (panic+0x78/0x1cc)
[c02366dc] (panic+0x78/0x1cc) from [c02fa35c] (at91_map_io+0x90/0xc8)
[c02fa35c] (at91_map_io+0x90/0xc8) from [c02f9860] (paging_init+0x564/0x6d0)
[c02f9860] (paging_init+0x564/0x6d0) from [c02f7914] 
(setup_arch+0x464/0x704)
[c02f7914] (setup_arch+0x464/0x704) from [c02f44f8] 
(start_kernel+0x6c/0x2d4)
[c02f44f8] (start_kernel+0x6c/0x2d4) from [20008040] (0x20008040)

The reason for this is that the Debug Unit Chip ID Register has changed between
Engineering Sample and definitive revision of the SoC. Changing the check of
cidr to socid will address the problem. We do not integrate this check to the
list just above because we also have to make sure that the extended id is
disregarded.

Signed-off-by: Ivan Shugov ivan.shu...@gmail.com
[nicolas.fe...@atmel.com: change commit message]
Signed-off-by: Nicolas Ferre nicolas.fe...@atmel.com
Acked-by: Jean-Christophe PLAGNIOL-VILLARD plagn...@jcrosoft.com
Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

---
 arch/arm/mach-at91/setup.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -151,7 +151,7 @@ static void __init soc_detect(u32 dbgu_b
}
 
/* at91sam9g10 */
-   if ((cidr  ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) {
+   if ((socid  ~AT91_CIDR_EXT) == ARCH_ID_AT91SAM9G10) {
at91_soc_initdata.type = AT91_SOC_SAM9G10;
at91_boot_soc = at91sam9261_soc;
}


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


<    1   2   3   4   5   6   7   8   9   10   >