]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.5-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Sep 2012 23:53:48 +0000 (16:53 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Sep 2012 23:53:48 +0000 (16:53 -0700)
added patches:
i2c-powermac-improve-detection-of-devices-from-device-tree.patch
net-qmi_wwan-add-zte-mf821d.patch
nfs-fix-oopses-in-nfs_lookup_revalidate-and-nfs4_lookup_revalidate.patch
omap-usb-fix-the-ehci-enumeration-and-core-retention-issue.patch
sound-aoa-adapt-to-new-i2c-probing-scheme.patch

queue-3.5/i2c-powermac-improve-detection-of-devices-from-device-tree.patch [new file with mode: 0644]
queue-3.5/net-qmi_wwan-add-zte-mf821d.patch [new file with mode: 0644]
queue-3.5/nfs-fix-oopses-in-nfs_lookup_revalidate-and-nfs4_lookup_revalidate.patch [new file with mode: 0644]
queue-3.5/omap-usb-fix-the-ehci-enumeration-and-core-retention-issue.patch [new file with mode: 0644]
queue-3.5/series
queue-3.5/sound-aoa-adapt-to-new-i2c-probing-scheme.patch [new file with mode: 0644]

diff --git a/queue-3.5/i2c-powermac-improve-detection-of-devices-from-device-tree.patch b/queue-3.5/i2c-powermac-improve-detection-of-devices-from-device-tree.patch
new file mode 100644 (file)
index 0000000..d3c6552
--- /dev/null
@@ -0,0 +1,222 @@
+From 3a3dd0186f619b74e61e6f29dddcaf59af7d3cac Mon Sep 17 00:00:00 2001
+From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Date: Mon, 18 Jun 2012 12:00:50 +1000
+Subject: i2c/powermac: Improve detection of devices from device-tree
+
+From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+
+commit 3a3dd0186f619b74e61e6f29dddcaf59af7d3cac upstream.
+
+This patch adds a number of workarounds for broken Apple device-trees
+mostly around sound chips. It handles creating the missing audio codec
+devices and works around various issues with missing addresses or
+missing compatible properties.
+
+Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Cc: Michel Dänzer <michel@daenzer.net>
+Cc: Elimar Riesebieter <riesebie@lxtec.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/i2c/busses/i2c-powermac.c |  157 ++++++++++++++++++++++++++++++++------
+ 1 file changed, 133 insertions(+), 24 deletions(-)
+
+--- a/drivers/i2c/busses/i2c-powermac.c
++++ b/drivers/i2c/busses/i2c-powermac.c
+@@ -227,28 +227,138 @@ static int __devexit i2c_powermac_remove
+       return 0;
+ }
++static u32 __devinit i2c_powermac_get_addr(struct i2c_adapter *adap,
++                                         struct pmac_i2c_bus *bus,
++                                         struct device_node *node)
++{
++      const __be32 *prop;
++      int len;
++
++      /* First check for valid "reg" */
++      prop = of_get_property(node, "reg", &len);
++      if (prop && (len >= sizeof(int)))
++              return (be32_to_cpup(prop) & 0xff) >> 1;
++
++      /* Then check old-style "i2c-address" */
++      prop = of_get_property(node, "i2c-address", &len);
++      if (prop && (len >= sizeof(int)))
++              return (be32_to_cpup(prop) & 0xff) >> 1;
++
++      /* Now handle some devices with missing "reg" properties */
++      if (!strcmp(node->name, "cereal"))
++              return 0x60;
++      else if (!strcmp(node->name, "deq"))
++              return 0x34;
++
++      dev_warn(&adap->dev, "No i2c address for %s\n", node->full_name);
++
++      return 0xffffffff;
++}
++
++static void __devinit i2c_powermac_create_one(struct i2c_adapter *adap,
++                                            const char *type,
++                                            u32 addr)
++{
++      struct i2c_board_info info = {};
++      struct i2c_client *newdev;
++
++      strncpy(info.type, type, sizeof(info.type));
++      info.addr = addr;
++      newdev = i2c_new_device(adap, &info);
++      if (!newdev)
++              dev_err(&adap->dev,
++                      "i2c-powermac: Failure to register missing %s\n",
++                      type);
++}
++
++static void __devinit i2c_powermac_add_missing(struct i2c_adapter *adap,
++                                             struct pmac_i2c_bus *bus,
++                                             bool found_onyx)
++{
++      struct device_node *busnode = pmac_i2c_get_bus_node(bus);
++      int rc;
++
++      /* Check for the onyx audio codec */
++#define ONYX_REG_CONTROL              67
++      if (of_device_is_compatible(busnode, "k2-i2c") && !found_onyx) {
++              union i2c_smbus_data data;
++
++              rc = i2c_smbus_xfer(adap, 0x46, 0, I2C_SMBUS_READ,
++                                  ONYX_REG_CONTROL, I2C_SMBUS_BYTE_DATA,
++                                  &data);
++              if (rc >= 0)
++                      i2c_powermac_create_one(adap, "MAC,pcm3052", 0x46);
++
++              rc = i2c_smbus_xfer(adap, 0x47, 0, I2C_SMBUS_READ,
++                                  ONYX_REG_CONTROL, I2C_SMBUS_BYTE_DATA,
++                                  &data);
++              if (rc >= 0)
++                      i2c_powermac_create_one(adap, "MAC,pcm3052", 0x47);
++      }
++}
++
++static bool __devinit i2c_powermac_get_type(struct i2c_adapter *adap,
++                                          struct device_node *node,
++                                          u32 addr, char *type, int type_size)
++{
++      char tmp[16];
++
++      /* Note: we to _NOT_ want the standard
++       * i2c drivers to match with any of our powermac stuff
++       * unless they have been specifically modified to handle
++       * it on a case by case basis. For example, for thermal
++       * control, things like lm75 etc... shall match with their
++       * corresponding windfarm drivers, _NOT_ the generic ones,
++       * so we force a prefix of AAPL, onto the modalias to
++       * make that happen
++       */
++
++      /* First try proper modalias */
++      if (of_modalias_node(node, tmp, sizeof(tmp)) >= 0) {
++              snprintf(type, type_size, "MAC,%s", tmp);
++              return true;
++      }
++
++      /* Now look for known workarounds */
++      if (!strcmp(node->name, "deq")) {
++              /* Apple uses address 0x34 for TAS3001 and 0x35 for TAS3004 */
++              if (addr == 0x34) {
++                      snprintf(type, type_size, "MAC,tas3001");
++                      return true;
++              } else if (addr == 0x35) {
++                      snprintf(type, type_size, "MAC,tas3004");
++                      return true;
++              }
++      }
++
++      dev_err(&adap->dev, "i2c-powermac: modalias failure"
++              " on %s\n", node->full_name);
++      return false;
++}
++
+ static void __devinit i2c_powermac_register_devices(struct i2c_adapter *adap,
+                                                   struct pmac_i2c_bus *bus)
+ {
+       struct i2c_client *newdev;
+       struct device_node *node;
++      bool found_onyx = 0;
++
++      /*
++       * In some cases we end up with the via-pmu node itself, in this
++       * case we skip this function completely as the device-tree will
++       * not contain anything useful.
++       */
++      if (!strcmp(adap->dev.of_node->name, "via-pmu"))
++              return;
+       for_each_child_of_node(adap->dev.of_node, node) {
+               struct i2c_board_info info = {};
+-              struct dev_archdata dev_ad = {};
+-              const __be32 *reg;
+-              char tmp[16];
+               u32 addr;
+-              int len;
+               /* Get address & channel */
+-              reg = of_get_property(node, "reg", &len);
+-              if (!reg || (len < sizeof(int))) {
+-                      dev_err(&adap->dev, "i2c-powermac: invalid reg on %s\n",
+-                              node->full_name);
++              addr = i2c_powermac_get_addr(adap, bus, node);
++              if (addr == 0xffffffff)
+                       continue;
+-              }
+-              addr = be32_to_cpup(reg);
+               /* Multibus setup, check channel */
+               if (!pmac_i2c_match_adapter(node, adap))
+@@ -257,27 +367,23 @@ static void __devinit i2c_powermac_regis
+               dev_dbg(&adap->dev, "i2c-powermac: register %s\n",
+                       node->full_name);
+-              /* Make up a modalias. Note: we to _NOT_ want the standard
+-               * i2c drivers to match with any of our powermac stuff
+-               * unless they have been specifically modified to handle
+-               * it on a case by case basis. For example, for thermal
+-               * control, things like lm75 etc... shall match with their
+-               * corresponding windfarm drivers, _NOT_ the generic ones,
+-               * so we force a prefix of AAPL, onto the modalias to
+-               * make that happen
++              /*
++               * Keep track of some device existence to handle
++               * workarounds later.
+                */
+-              if (of_modalias_node(node, tmp, sizeof(tmp)) < 0) {
+-                      dev_err(&adap->dev, "i2c-powermac: modalias failure"
+-                              " on %s\n", node->full_name);
++              if (of_device_is_compatible(node, "pcm3052"))
++                      found_onyx = true;
++
++              /* Make up a modalias */
++              if (!i2c_powermac_get_type(adap, node, addr,
++                                         info.type, sizeof(info.type))) {
+                       continue;
+               }
+-              snprintf(info.type, sizeof(info.type), "MAC,%s", tmp);
+               /* Fill out the rest of the info structure */
+-              info.addr = (addr & 0xff) >> 1;
++              info.addr = addr;
+               info.irq = irq_of_parse_and_map(node, 0);
+               info.of_node = of_node_get(node);
+-              info.archdata = &dev_ad;
+               newdev = i2c_new_device(adap, &info);
+               if (!newdev) {
+@@ -292,6 +398,9 @@ static void __devinit i2c_powermac_regis
+                       continue;
+               }
+       }
++
++      /* Additional workarounds */
++      i2c_powermac_add_missing(adap, bus, found_onyx);
+ }
+ static int __devinit i2c_powermac_probe(struct platform_device *dev)
diff --git a/queue-3.5/net-qmi_wwan-add-zte-mf821d.patch b/queue-3.5/net-qmi_wwan-add-zte-mf821d.patch
new file mode 100644 (file)
index 0000000..007ebf0
--- /dev/null
@@ -0,0 +1,38 @@
+From db8dacf953a70274172236957a4b97d4fdb376f0 Mon Sep 17 00:00:00 2001
+From: Bjørn Mork <bjorn@mork.no>
+Date: Thu, 12 Jul 2012 01:18:26 +0000
+Subject: net: qmi_wwan: add ZTE MF821D
+
+From: Bjørn Mork <bjorn@mork.no>
+
+commit db8dacf953a70274172236957a4b97d4fdb376f0 upstream.
+
+Sold by O2 (telefonica germany) under the name "LTE4G"
+
+Tested-by: Thomas Schäfer <tschaefer@t-online.de>
+Signed-off-by: Bjørn Mork <bjorn@mork.no>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/net/usb/qmi_wwan.c |    9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/drivers/net/usb/qmi_wwan.c
++++ b/drivers/net/usb/qmi_wwan.c
+@@ -453,6 +453,15 @@ static const struct usb_device_id produc
+               .bInterfaceProtocol = 0xff,
+               .driver_info        = (unsigned long)&qmi_wwan_force_int4,
+       },
++      {       /* ZTE MF821D */
++              .match_flags        = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
++              .idVendor           = 0x19d2,
++              .idProduct          = 0x0326,
++              .bInterfaceClass    = 0xff,
++              .bInterfaceSubClass = 0xff,
++              .bInterfaceProtocol = 0xff,
++              .driver_info        = (unsigned long)&qmi_wwan_force_int4,
++      },
+       {       /* ZTE (Vodafone) K3520-Z */
+               .match_flags        = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
+               .idVendor           = 0x19d2,
diff --git a/queue-3.5/nfs-fix-oopses-in-nfs_lookup_revalidate-and-nfs4_lookup_revalidate.patch b/queue-3.5/nfs-fix-oopses-in-nfs_lookup_revalidate-and-nfs4_lookup_revalidate.patch
new file mode 100644 (file)
index 0000000..3ed6ba5
--- /dev/null
@@ -0,0 +1,88 @@
+From Trond.Myklebust@netapp.com  Thu Sep 27 16:47:09 2012
+From: Trond Myklebust <Trond.Myklebust@netapp.com>
+Date: Wed, 22 Aug 2012 16:08:17 -0400
+Subject: NFS: Fix Oopses in nfs_lookup_revalidate and nfs4_lookup_revalidate
+To: stable@vger.kernel.org
+Message-ID: <1345666097-14815-1-git-send-email-Trond.Myklebust@netapp.com>
+
+From: Trond Myklebust <Trond.Myklebust@netapp.com>
+
+[Fixed upstream as part of 0b728e1911c, but that's a much larger patch,
+this is only the nfs portion backported as needed.]
+
+Fix the following Oops in 3.5.1:
+
+ BUG: unable to handle kernel NULL pointer dereference at 0000000000000038
+ IP: [<ffffffffa03789cd>] nfs_lookup_revalidate+0x2d/0x480 [nfs]
+ PGD 337c63067 PUD 0
+ Oops: 0000 [#1] SMP
+ CPU 5
+ Modules linked in: nfs fscache nfsd lockd nfs_acl auth_rpcgss sunrpc af_packet binfmt_misc cpufreq_conservative cpufreq_userspace cpufreq_powersave dm_mod acpi_cpufreq mperf coretemp gpio_ich kvm_intel joydev kvm ioatdma hid_generic igb lpc_ich i7core_edac edac_core ptp serio_raw dca pcspkr i2c_i801 mfd_core sg pps_core usbhid crc32c_intel microcode button autofs4 uhci_hcd ttm drm_kms_helper drm i2c_algo_bit sysimgblt sysfillrect syscopyarea ehci_hcd usbcore usb_common scsi_dh_rdac scsi_dh_emc scsi_dh_hp_sw scsi_dh_alua scsi_dh edd fan ata_piix thermal processor thermal_sys
+
+ Pid: 30431, comm: java Not tainted 3.5.1-2-default #1 Supermicro X8DTT/X8DTT
+ RIP: 0010:[<ffffffffa03789cd>]  [<ffffffffa03789cd>] nfs_lookup_revalidate+0x2d/0x480 [nfs]
+ RSP: 0018:ffff8801b418bd38  EFLAGS: 00010292
+ RAX: 00000000fffffff6 RBX: ffff88032016d800 RCX: 0000000000000020
+ RDX: ffffffff00000000 RSI: 0000000000000000 RDI: ffff8801824a7b00
+ RBP: ffff8801b418bdf8 R08: 7fffff0034323030 R09: fffffffff04c03ed
+ R10: ffff8801824a7b00 R11: 0000000000000002 R12: ffff8801824a7b00
+ R13: ffff8801824a7b00 R14: 0000000000000000 R15: ffff8803201725d0
+ FS:  00002b53a46cb700(0000) GS:ffff88033fc20000(0000) knlGS:0000000000000000
+ CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+ CR2: 0000000000000038 CR3: 000000020a426000 CR4: 00000000000007e0
+ DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
+ DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
+ Process java (pid: 30431, threadinfo ffff8801b418a000, task ffff8801b5d20600)
+ Stack:
+  ffff8801b418be44 ffff88032016d800 ffff8801b418bdf8 0000000000000000
+  ffff8801824a7b00 ffff8801b418bdd7 ffff8803201725d0 ffffffff8116a9c0
+  ffff8801b5c38dc0 0000000000000007 ffff88032016d800 0000000000000000
+ Call Trace:
+  [<ffffffff8116a9c0>] lookup_dcache+0x80/0xe0
+  [<ffffffff8116aa43>] __lookup_hash+0x23/0x90
+  [<ffffffff8116b4a5>] lookup_one_len+0xc5/0x100
+  [<ffffffffa03869a3>] nfs_sillyrename+0xe3/0x210 [nfs]
+  [<ffffffff8116cadf>] vfs_unlink.part.25+0x7f/0xe0
+  [<ffffffff8116f22c>] do_unlinkat+0x1ac/0x1d0
+  [<ffffffff815717b9>] system_call_fastpath+0x16/0x1b
+  [<00002b5348b5f527>] 0x2b5348b5f526
+ Code: ec 38 b8 f6 ff ff ff 4c 89 64 24 18 4c 89 74 24 28 49 89 fc 48 89 5c 24 08 48 89 6c 24 10 49 89 f6 4c 89 6c 24 20 4c 89 7c 24 30 <f6> 46 38 40 0f 85 d1 00 00 00 e8 c4 c4 df e0 48 8b 58 30 49 89
+ RIP  [<ffffffffa03789cd>] nfs_lookup_revalidate+0x2d/0x480 [nfs]
+  RSP <ffff8801b418bd38>
+ CR2: 0000000000000038
+ ---[ end trace 845113ed191985dd ]---
+
+This Oops affects 3.5 kernels and older, and is due to lookup_one_len()
+calling down to the dentry revalidation code with a NULL pointer
+to struct nameidata.
+
+It is fixed upstream by commit 0b728e1911c (stop passing nameidata *
+to ->d_revalidate())
+
+Reported-by: Richard Ems <richard.ems@cape-horn-eng.com>
+Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/nfs/dir.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/fs/nfs/dir.c
++++ b/fs/nfs/dir.c
+@@ -1123,7 +1123,7 @@ static int nfs_lookup_revalidate(struct
+       struct nfs_fattr *fattr = NULL;
+       int error;
+-      if (nd->flags & LOOKUP_RCU)
++      if (nd && (nd->flags & LOOKUP_RCU))
+               return -ECHILD;
+       parent = dget_parent(dentry);
+@@ -1526,7 +1526,7 @@ static int nfs4_lookup_revalidate(struct
+       struct inode *dir;
+       int openflags, ret = 0;
+-      if (nd->flags & LOOKUP_RCU)
++      if (nd && (nd->flags & LOOKUP_RCU))
+               return -ECHILD;
+       inode = dentry->d_inode;
diff --git a/queue-3.5/omap-usb-fix-the-ehci-enumeration-and-core-retention-issue.patch b/queue-3.5/omap-usb-fix-the-ehci-enumeration-and-core-retention-issue.patch
new file mode 100644 (file)
index 0000000..6771fea
--- /dev/null
@@ -0,0 +1,240 @@
+From 872c495dd0f9d1f48814a8ee80c2c7b3b7c3b4d9 Mon Sep 17 00:00:00 2001
+From: Keshava Munegowda <keshava_mgowda@ti.com>
+Date: Fri, 20 Jul 2012 15:13:35 +0530
+Subject: OMAP: USB : Fix the EHCI enumeration and core retention issue
+
+From: Keshava Munegowda <keshava_mgowda@ti.com>
+
+commit 872c495dd0f9d1f48814a8ee80c2c7b3b7c3b4d9 upstream.
+
+This commit 354ab8567ae3107a8cbe7228c3181990ba598aac titled
+"Fix OMAP EHCI suspend/resume failure (i693)" is causing
+the usb hub and device detection fails in beagle XM
+causeing NFS not functional. This affects the core retention too.
+The same commit logic needs to be revisted adhering to hwmod and
+device tree framework.
+for now, this commit id 354ab8567ae3107a8cbe7228c3181990ba598aac
+titled "Fix OMAP EHCI suspend/resume failure (i693)" reverted.
+
+This patch is validated on BeagleXM with NFS support over
+usb ethernet and USB mass storage and other device detection.
+
+Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com>
+Acked-by: Felipe Balbi <balbi@ti.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/host/ehci-omap.c |  164 -------------------------------------------
+ 1 file changed, 1 insertion(+), 163 deletions(-)
+
+--- a/drivers/usb/host/ehci-omap.c
++++ b/drivers/usb/host/ehci-omap.c
+@@ -56,15 +56,6 @@
+ #define       EHCI_INSNREG05_ULPI_EXTREGADD_SHIFT             8
+ #define       EHCI_INSNREG05_ULPI_WRDATA_SHIFT                0
+-/* Errata i693 */
+-static struct clk     *utmi_p1_fck;
+-static struct clk     *utmi_p2_fck;
+-static struct clk     *xclk60mhsp1_ck;
+-static struct clk     *xclk60mhsp2_ck;
+-static struct clk     *usbhost_p1_fck;
+-static struct clk     *usbhost_p2_fck;
+-static struct clk     *init_60m_fclk;
+-
+ /*-------------------------------------------------------------------------*/
+ static const struct hc_driver ehci_omap_hc_driver;
+@@ -80,40 +71,6 @@ static inline u32 ehci_read(void __iomem
+       return __raw_readl(base + reg);
+ }
+-/* Erratum i693 workaround sequence */
+-static void omap_ehci_erratum_i693(struct ehci_hcd *ehci)
+-{
+-      int ret = 0;
+-
+-      /* Switch to the internal 60 MHz clock */
+-      ret = clk_set_parent(utmi_p1_fck, init_60m_fclk);
+-      if (ret != 0)
+-              ehci_err(ehci, "init_60m_fclk set parent"
+-                      "failed error:%d\n", ret);
+-
+-      ret = clk_set_parent(utmi_p2_fck, init_60m_fclk);
+-      if (ret != 0)
+-              ehci_err(ehci, "init_60m_fclk set parent"
+-                      "failed error:%d\n", ret);
+-
+-      clk_enable(usbhost_p1_fck);
+-      clk_enable(usbhost_p2_fck);
+-
+-      /* Wait 1ms and switch back to the external clock */
+-      mdelay(1);
+-      ret = clk_set_parent(utmi_p1_fck, xclk60mhsp1_ck);
+-      if (ret != 0)
+-              ehci_err(ehci, "xclk60mhsp1_ck set parent"
+-                      "failed error:%d\n", ret);
+-
+-      ret = clk_set_parent(utmi_p2_fck, xclk60mhsp2_ck);
+-      if (ret != 0)
+-              ehci_err(ehci, "xclk60mhsp2_ck set parent"
+-                      "failed error:%d\n", ret);
+-
+-      clk_disable(usbhost_p1_fck);
+-      clk_disable(usbhost_p2_fck);
+-}
+ static void omap_ehci_soft_phy_reset(struct platform_device *pdev, u8 port)
+ {
+@@ -145,50 +102,6 @@ static void omap_ehci_soft_phy_reset(str
+       }
+ }
+-static int omap_ehci_hub_control(
+-      struct usb_hcd  *hcd,
+-      u16             typeReq,
+-      u16             wValue,
+-      u16             wIndex,
+-      char            *buf,
+-      u16             wLength
+-)
+-{
+-      struct ehci_hcd *ehci = hcd_to_ehci(hcd);
+-      u32 __iomem *status_reg = &ehci->regs->port_status[
+-                              (wIndex & 0xff) - 1];
+-      u32             temp;
+-      unsigned long   flags;
+-      int             retval = 0;
+-
+-      spin_lock_irqsave(&ehci->lock, flags);
+-
+-      if (typeReq == SetPortFeature && wValue == USB_PORT_FEAT_SUSPEND) {
+-              temp = ehci_readl(ehci, status_reg);
+-              if ((temp & PORT_PE) == 0 || (temp & PORT_RESET) != 0) {
+-                      retval = -EPIPE;
+-                      goto done;
+-              }
+-
+-              temp &= ~PORT_WKCONN_E;
+-              temp |= PORT_WKDISC_E | PORT_WKOC_E;
+-              ehci_writel(ehci, temp | PORT_SUSPEND, status_reg);
+-
+-              omap_ehci_erratum_i693(ehci);
+-
+-              set_bit((wIndex & 0xff) - 1, &ehci->suspended_ports);
+-              goto done;
+-      }
+-
+-      spin_unlock_irqrestore(&ehci->lock, flags);
+-
+-      /* Handle the hub control events here */
+-      return ehci_hub_control(hcd, typeReq, wValue, wIndex, buf, wLength);
+-done:
+-      spin_unlock_irqrestore(&ehci->lock, flags);
+-      return retval;
+-}
+-
+ static void disable_put_regulator(
+               struct ehci_hcd_omap_platform_data *pdata)
+ {
+@@ -351,76 +264,9 @@ static int ehci_hcd_omap_probe(struct pl
+       /* root ports should always stay powered */
+       ehci_port_power(omap_ehci, 1);
+-      /* get clocks */
+-      utmi_p1_fck = clk_get(dev, "utmi_p1_gfclk");
+-      if (IS_ERR(utmi_p1_fck)) {
+-              ret = PTR_ERR(utmi_p1_fck);
+-              dev_err(dev, "utmi_p1_gfclk failed error:%d\n", ret);
+-              goto err_add_hcd;
+-      }
+-
+-      xclk60mhsp1_ck = clk_get(dev, "xclk60mhsp1_ck");
+-      if (IS_ERR(xclk60mhsp1_ck)) {
+-              ret = PTR_ERR(xclk60mhsp1_ck);
+-              dev_err(dev, "xclk60mhsp1_ck failed error:%d\n", ret);
+-              goto err_utmi_p1_fck;
+-      }
+-
+-      utmi_p2_fck = clk_get(dev, "utmi_p2_gfclk");
+-      if (IS_ERR(utmi_p2_fck)) {
+-              ret = PTR_ERR(utmi_p2_fck);
+-              dev_err(dev, "utmi_p2_gfclk failed error:%d\n", ret);
+-              goto err_xclk60mhsp1_ck;
+-      }
+-
+-      xclk60mhsp2_ck = clk_get(dev, "xclk60mhsp2_ck");
+-      if (IS_ERR(xclk60mhsp2_ck)) {
+-              ret = PTR_ERR(xclk60mhsp2_ck);
+-              dev_err(dev, "xclk60mhsp2_ck failed error:%d\n", ret);
+-              goto err_utmi_p2_fck;
+-      }
+-
+-      usbhost_p1_fck = clk_get(dev, "usb_host_hs_utmi_p1_clk");
+-      if (IS_ERR(usbhost_p1_fck)) {
+-              ret = PTR_ERR(usbhost_p1_fck);
+-              dev_err(dev, "usbhost_p1_fck failed error:%d\n", ret);
+-              goto err_xclk60mhsp2_ck;
+-      }
+-
+-      usbhost_p2_fck = clk_get(dev, "usb_host_hs_utmi_p2_clk");
+-      if (IS_ERR(usbhost_p2_fck)) {
+-              ret = PTR_ERR(usbhost_p2_fck);
+-              dev_err(dev, "usbhost_p2_fck failed error:%d\n", ret);
+-              goto err_usbhost_p1_fck;
+-      }
+-
+-      init_60m_fclk = clk_get(dev, "init_60m_fclk");
+-      if (IS_ERR(init_60m_fclk)) {
+-              ret = PTR_ERR(init_60m_fclk);
+-              dev_err(dev, "init_60m_fclk failed error:%d\n", ret);
+-              goto err_usbhost_p2_fck;
+-      }
+       return 0;
+-err_usbhost_p2_fck:
+-      clk_put(usbhost_p2_fck);
+-
+-err_usbhost_p1_fck:
+-      clk_put(usbhost_p1_fck);
+-
+-err_xclk60mhsp2_ck:
+-      clk_put(xclk60mhsp2_ck);
+-
+-err_utmi_p2_fck:
+-      clk_put(utmi_p2_fck);
+-
+-err_xclk60mhsp1_ck:
+-      clk_put(xclk60mhsp1_ck);
+-
+-err_utmi_p1_fck:
+-      clk_put(utmi_p1_fck);
+-
+ err_add_hcd:
+       disable_put_regulator(pdata);
+       pm_runtime_put_sync(dev);
+@@ -450,14 +296,6 @@ static int ehci_hcd_omap_remove(struct p
+       iounmap(hcd->regs);
+       usb_put_hcd(hcd);
+-      clk_put(utmi_p1_fck);
+-      clk_put(utmi_p2_fck);
+-      clk_put(xclk60mhsp1_ck);
+-      clk_put(xclk60mhsp2_ck);
+-      clk_put(usbhost_p1_fck);
+-      clk_put(usbhost_p2_fck);
+-      clk_put(init_60m_fclk);
+-
+       pm_runtime_put_sync(dev);
+       pm_runtime_disable(dev);
+@@ -528,7 +366,7 @@ static const struct hc_driver ehci_omap_
+        * root hub support
+        */
+       .hub_status_data        = ehci_hub_status_data,
+-      .hub_control            = omap_ehci_hub_control,
++      .hub_control            = ehci_hub_control,
+       .bus_suspend            = ehci_bus_suspend,
+       .bus_resume             = ehci_bus_resume,
index a92b322d5147312fe85c23ad503824e6c544ceec..d776b31098a73638789d0463ce5d418b7ed256b5 100644 (file)
@@ -237,3 +237,8 @@ pch_uart-fix-parity-setting-issue.patch
 powerpc-85xx-p1022ds-disable-the-nand-flash-node-if-video-is-enabled.patch
 powerpc-85xx-p1022ds-fix-diu-lbc-switching-with-nand-enabled.patch
 pch_uart-add-eg20t_port-lock-field-avoid-recursive-spinlocks.patch
+omap-usb-fix-the-ehci-enumeration-and-core-retention-issue.patch
+i2c-powermac-improve-detection-of-devices-from-device-tree.patch
+sound-aoa-adapt-to-new-i2c-probing-scheme.patch
+nfs-fix-oopses-in-nfs_lookup_revalidate-and-nfs4_lookup_revalidate.patch
+net-qmi_wwan-add-zte-mf821d.patch
diff --git a/queue-3.5/sound-aoa-adapt-to-new-i2c-probing-scheme.patch b/queue-3.5/sound-aoa-adapt-to-new-i2c-probing-scheme.patch
new file mode 100644 (file)
index 0000000..25db915
--- /dev/null
@@ -0,0 +1,248 @@
+From 26b0d14106954ae46d2f4f7eec3481828a210f7d Mon Sep 17 00:00:00 2001
+From: Andreas Schwab <schwab@linux-m68k.org>
+Date: Sat, 9 Jun 2012 15:58:56 +0200
+Subject: sound/aoa: Adapt to new i2c probing scheme
+
+From: Andreas Schwab <schwab@linux-m68k.org>
+
+commit 26b0d14106954ae46d2f4f7eec3481828a210f7d upstream.
+
+The i2c-powermac driver now creates the i2c devices properly
+from the device-tree, including workarounds for broken or
+missing device-tree bits, so let's just use the normal probe
+methods and get rid of the hand made device creation code.
+
+Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
+Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Cc: Elimar Riesebieter <riesebie@lxtec.de>
+Cc: Michel Dänzer <michel@daenzer.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/aoa/codecs/onyx.c |   75 +--------------------------------------------
+ sound/aoa/codecs/tas.c  |   80 +-----------------------------------------------
+ 2 files changed, 6 insertions(+), 149 deletions(-)
+
+--- a/sound/aoa/codecs/onyx.c
++++ b/sound/aoa/codecs/onyx.c
+@@ -997,45 +997,10 @@ static void onyx_exit_codec(struct aoa_c
+       onyx->codec.soundbus_dev->detach_codec(onyx->codec.soundbus_dev, onyx);
+ }
+-static int onyx_create(struct i2c_adapter *adapter,
+-                     struct device_node *node,
+-                     int addr)
+-{
+-      struct i2c_board_info info;
+-      struct i2c_client *client;
+-
+-      memset(&info, 0, sizeof(struct i2c_board_info));
+-      strlcpy(info.type, "aoa_codec_onyx", I2C_NAME_SIZE);
+-      info.addr = addr;
+-      info.platform_data = node;
+-      client = i2c_new_device(adapter, &info);
+-      if (!client)
+-              return -ENODEV;
+-
+-      /*
+-       * We know the driver is already loaded, so the device should be
+-       * already bound. If not it means binding failed, which suggests
+-       * the device doesn't really exist and should be deleted.
+-       * Ideally this would be replaced by better checks _before_
+-       * instantiating the device.
+-       */
+-      if (!client->driver) {
+-              i2c_unregister_device(client);
+-              return -ENODEV;
+-      }
+-
+-      /*
+-       * Let i2c-core delete that device on driver removal.
+-       * This is safe because i2c-core holds the core_lock mutex for us.
+-       */
+-      list_add_tail(&client->detected, &client->driver->clients);
+-      return 0;
+-}
+-
+ static int onyx_i2c_probe(struct i2c_client *client,
+                         const struct i2c_device_id *id)
+ {
+-      struct device_node *node = client->dev.platform_data;
++      struct device_node *node = client->dev.of_node;
+       struct onyx *onyx;
+       u8 dummy;
+@@ -1071,40 +1036,6 @@ static int onyx_i2c_probe(struct i2c_cli
+       return -ENODEV;
+ }
+-static int onyx_i2c_attach(struct i2c_adapter *adapter)
+-{
+-      struct device_node *busnode, *dev = NULL;
+-      struct pmac_i2c_bus *bus;
+-
+-      bus = pmac_i2c_adapter_to_bus(adapter);
+-      if (bus == NULL)
+-              return -ENODEV;
+-      busnode = pmac_i2c_get_bus_node(bus);
+-
+-      while ((dev = of_get_next_child(busnode, dev)) != NULL) {
+-              if (of_device_is_compatible(dev, "pcm3052")) {
+-                      const u32 *addr;
+-                      printk(KERN_DEBUG PFX "found pcm3052\n");
+-                      addr = of_get_property(dev, "reg", NULL);
+-                      if (!addr)
+-                              return -ENODEV;
+-                      return onyx_create(adapter, dev, (*addr)>>1);
+-              }
+-      }
+-
+-      /* if that didn't work, try desperate mode for older
+-       * machines that have stuff missing from the device tree */
+-
+-      if (!of_device_is_compatible(busnode, "k2-i2c"))
+-              return -ENODEV;
+-
+-      printk(KERN_DEBUG PFX "found k2-i2c, checking if onyx chip is on it\n");
+-      /* probe both possible addresses for the onyx chip */
+-      if (onyx_create(adapter, NULL, 0x46) == 0)
+-              return 0;
+-      return onyx_create(adapter, NULL, 0x47);
+-}
+-
+ static int onyx_i2c_remove(struct i2c_client *client)
+ {
+       struct onyx *onyx = i2c_get_clientdata(client);
+@@ -1117,16 +1048,16 @@ static int onyx_i2c_remove(struct i2c_cl
+ }
+ static const struct i2c_device_id onyx_i2c_id[] = {
+-      { "aoa_codec_onyx", 0 },
++      { "MAC,pcm3052", 0 },
+       { }
+ };
++MODULE_DEVICE_TABLE(i2c,onyx_i2c_id);
+ static struct i2c_driver onyx_driver = {
+       .driver = {
+               .name = "aoa_codec_onyx",
+               .owner = THIS_MODULE,
+       },
+-      .attach_adapter = onyx_i2c_attach,
+       .probe = onyx_i2c_probe,
+       .remove = onyx_i2c_remove,
+       .id_table = onyx_i2c_id,
+--- a/sound/aoa/codecs/tas.c
++++ b/sound/aoa/codecs/tas.c
+@@ -883,43 +883,10 @@ static void tas_exit_codec(struct aoa_co
+ }
+-static int tas_create(struct i2c_adapter *adapter,
+-                     struct device_node *node,
+-                     int addr)
+-{
+-      struct i2c_board_info info;
+-      struct i2c_client *client;
+-
+-      memset(&info, 0, sizeof(struct i2c_board_info));
+-      strlcpy(info.type, "aoa_codec_tas", I2C_NAME_SIZE);
+-      info.addr = addr;
+-      info.platform_data = node;
+-
+-      client = i2c_new_device(adapter, &info);
+-      if (!client)
+-              return -ENODEV;
+-      /*
+-       * We know the driver is already loaded, so the device should be
+-       * already bound. If not it means binding failed, and then there
+-       * is no point in keeping the device instantiated.
+-       */
+-      if (!client->driver) {
+-              i2c_unregister_device(client);
+-              return -ENODEV;
+-      }
+-
+-      /*
+-       * Let i2c-core delete that device on driver removal.
+-       * This is safe because i2c-core holds the core_lock mutex for us.
+-       */
+-      list_add_tail(&client->detected, &client->driver->clients);
+-      return 0;
+-}
+-
+ static int tas_i2c_probe(struct i2c_client *client,
+                        const struct i2c_device_id *id)
+ {
+-      struct device_node *node = client->dev.platform_data;
++      struct device_node *node = client->dev.of_node;
+       struct tas *tas;
+       tas = kzalloc(sizeof(struct tas), GFP_KERNEL);
+@@ -953,47 +920,6 @@ static int tas_i2c_probe(struct i2c_clie
+       return -EINVAL;
+ }
+-static int tas_i2c_attach(struct i2c_adapter *adapter)
+-{
+-      struct device_node *busnode, *dev = NULL;
+-      struct pmac_i2c_bus *bus;
+-
+-      bus = pmac_i2c_adapter_to_bus(adapter);
+-      if (bus == NULL)
+-              return -ENODEV;
+-      busnode = pmac_i2c_get_bus_node(bus);
+-
+-      while ((dev = of_get_next_child(busnode, dev)) != NULL) {
+-              if (of_device_is_compatible(dev, "tas3004")) {
+-                      const u32 *addr;
+-                      printk(KERN_DEBUG PFX "found tas3004\n");
+-                      addr = of_get_property(dev, "reg", NULL);
+-                      if (!addr)
+-                              continue;
+-                      return tas_create(adapter, dev, ((*addr) >> 1) & 0x7f);
+-              }
+-              /* older machines have no 'codec' node with a 'compatible'
+-               * property that says 'tas3004', they just have a 'deq'
+-               * node without any such property... */
+-              if (strcmp(dev->name, "deq") == 0) {
+-                      const u32 *_addr;
+-                      u32 addr;
+-                      printk(KERN_DEBUG PFX "found 'deq' node\n");
+-                      _addr = of_get_property(dev, "i2c-address", NULL);
+-                      if (!_addr)
+-                              continue;
+-                      addr = ((*_addr) >> 1) & 0x7f;
+-                      /* now, if the address doesn't match any of the two
+-                       * that a tas3004 can have, we cannot handle this.
+-                       * I doubt it ever happens but hey. */
+-                      if (addr != 0x34 && addr != 0x35)
+-                              continue;
+-                      return tas_create(adapter, dev, addr);
+-              }
+-      }
+-      return -ENODEV;
+-}
+-
+ static int tas_i2c_remove(struct i2c_client *client)
+ {
+       struct tas *tas = i2c_get_clientdata(client);
+@@ -1011,16 +937,16 @@ static int tas_i2c_remove(struct i2c_cli
+ }
+ static const struct i2c_device_id tas_i2c_id[] = {
+-      { "aoa_codec_tas", 0 },
++      { "MAC,tas3004", 0 },
+       { }
+ };
++MODULE_DEVICE_TABLE(i2c,tas_i2c_id);
+ static struct i2c_driver tas_driver = {
+       .driver = {
+               .name = "aoa_codec_tas",
+               .owner = THIS_MODULE,
+       },
+-      .attach_adapter = tas_i2c_attach,
+       .probe = tas_i2c_probe,
+       .remove = tas_i2c_remove,
+       .id_table = tas_i2c_id,