]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
.36 patches
authorGreg Kroah-Hartman <gregkh@suse.de>
Tue, 1 Feb 2011 00:32:44 +0000 (16:32 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 1 Feb 2011 00:32:44 +0000 (16:32 -0800)
queue-2.6.36/atl1-fix-oops-when-changing-tx-rx-ring-params.patch [new file with mode: 0644]
queue-2.6.36/hwmon-applesmc-add-macbookair3-1-3-2-support.patch [new file with mode: 0644]
queue-2.6.36/hwmon-applesmc-relax-the-severity-of-device-init-failure.patch [new file with mode: 0644]
queue-2.6.36/hwmon-via686a-initialize-fan_div-values.patch [new file with mode: 0644]
queue-2.6.36/series

diff --git a/queue-2.6.36/atl1-fix-oops-when-changing-tx-rx-ring-params.patch b/queue-2.6.36/atl1-fix-oops-when-changing-tx-rx-ring-params.patch
new file mode 100644 (file)
index 0000000..c590a0d
--- /dev/null
@@ -0,0 +1,63 @@
+From 2f32c867219734b06abc980d4812f67b6d6fe517 Mon Sep 17 00:00:00 2001
+From: J. K. Cliburn <jcliburn@gmail.com>
+Date: Sat, 1 Jan 2011 05:02:12 +0000
+Subject: atl1: fix oops when changing tx/rx ring params
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: J. K. Cliburn <jcliburn@gmail.com>
+
+commit 2f32c867219734b06abc980d4812f67b6d6fe517 upstream.
+
+Commit 3f5a2a713aad28480d86b0add00c68484b54febc zeroes out the statistics
+message block (SMB) and coalescing message block (CMB) when adapter ring
+resources are freed.  This is desirable behavior, but, as a side effect,
+the commit leads to an oops when atl1_set_ringparam() attempts to alter
+the number of rx or tx elements in the ring buffer (by using ethtool
+-G, for example).  We don't want SMB or CMB to change during this
+operation.
+
+Modify atl1_set_ringparam() to preserve SMB and CMB when changing ring
+parameters.
+
+Signed-off-by: Jay Cliburn <jcliburn@gmail.com>
+Reported-by: Tõnu Raitviir <jussuf@linux.ee>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/net/atlx/atl1.c |   10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- a/drivers/net/atlx/atl1.c
++++ b/drivers/net/atlx/atl1.c
+@@ -3503,6 +3503,8 @@ static int atl1_set_ringparam(struct net
+       struct atl1_rfd_ring rfd_old, rfd_new;
+       struct atl1_rrd_ring rrd_old, rrd_new;
+       struct atl1_ring_header rhdr_old, rhdr_new;
++      struct atl1_smb smb;
++      struct atl1_cmb cmb;
+       int err;
+       tpd_old = adapter->tpd_ring;
+@@ -3543,11 +3545,19 @@ static int atl1_set_ringparam(struct net
+               adapter->rrd_ring = rrd_old;
+               adapter->tpd_ring = tpd_old;
+               adapter->ring_header = rhdr_old;
++              /*
++               * Save SMB and CMB, since atl1_free_ring_resources
++               * will clear them.
++               */
++              smb = adapter->smb;
++              cmb = adapter->cmb;
+               atl1_free_ring_resources(adapter);
+               adapter->rfd_ring = rfd_new;
+               adapter->rrd_ring = rrd_new;
+               adapter->tpd_ring = tpd_new;
+               adapter->ring_header = rhdr_new;
++              adapter->smb = smb;
++              adapter->cmb = cmb;
+               err = atl1_up(adapter);
+               if (err)
diff --git a/queue-2.6.36/hwmon-applesmc-add-macbookair3-1-3-2-support.patch b/queue-2.6.36/hwmon-applesmc-add-macbookair3-1-3-2-support.patch
new file mode 100644 (file)
index 0000000..59c09c3
--- /dev/null
@@ -0,0 +1,54 @@
+From 132af03233b493101a53010383b5abb5b9ff1e51 Mon Sep 17 00:00:00 2001
+From: Edgar Hucek <gimli@dark-green.com>
+Date: Tue, 9 Nov 2010 15:15:01 +0000
+Subject: hwmon: (applesmc) Add MacBookAir3,1(3,2) support
+
+From: Edgar Hucek <gimli@dark-green.com>
+
+commit 132af03233b493101a53010383b5abb5b9ff1e51 upstream.
+
+This patch add support for the MacBookAir3,1 and MacBookAir3,2 to the
+applesmc driver.
+
+[rydberg@euromail.se: minor cleanup]
+Cc: stable@kernel.org
+Signed-off-by: Edgar Hucek <gimli@dark-green.com>
+Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
+Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/hwmon/applesmc.c |   10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- a/drivers/hwmon/applesmc.c
++++ b/drivers/hwmon/applesmc.c
+@@ -162,6 +162,10 @@ static const char *temperature_sensors_s
+ /* Set 22: MacBook Pro 7,1 */
+       { "TB0T", "TB1T", "TB2T", "TC0D", "TC0P", "TN0D", "TN0P", "TN0S",
+         "TN1D", "TN1F", "TN1G", "TN1S", "Th1H", "Ts0P", "Ts0S", NULL },
++/* Set 23: MacBook Air 3,1 */
++      { "TB0T", "TB1T", "TB2T", "TC0D", "TC0E", "TC0P", "TC1E", "TCZ3",
++        "TCZ4", "TCZ5", "TG0E", "TG1E", "TG2E", "TGZ3", "TGZ4", "TGZ5",
++        "TH0F", "TH0O", "TM0P" },
+ };
+ /* List of keys used to read/write fan speeds */
+@@ -1524,11 +1528,17 @@ static __initdata struct dmi_match_data
+       { .accelerometer = 1, .light = 1, .temperature_set = 21 },
+ /* MacBook Pro 7,1: accelerometer, backlight and temperature set 22 */
+       { .accelerometer = 1, .light = 1, .temperature_set = 22 },
++/* MacBook Air 3,1: accelerometer, backlight and temperature set 23 */
++      { .accelerometer = 0, .light = 0, .temperature_set = 23 },
+ };
+ /* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1".
+  * So we need to put "Apple MacBook Pro" before "Apple MacBook". */
+ static __initdata struct dmi_system_id applesmc_whitelist[] = {
++      { applesmc_dmi_match, "Apple MacBook Air 3", {
++        DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
++        DMI_MATCH(DMI_PRODUCT_NAME, "MacBookAir3") },
++              &applesmc_dmi_data[23]},
+       { applesmc_dmi_match, "Apple MacBook Air 2", {
+         DMI_MATCH(DMI_BOARD_VENDOR, "Apple"),
+         DMI_MATCH(DMI_PRODUCT_NAME, "MacBookAir2") },
diff --git a/queue-2.6.36/hwmon-applesmc-relax-the-severity-of-device-init-failure.patch b/queue-2.6.36/hwmon-applesmc-relax-the-severity-of-device-init-failure.patch
new file mode 100644 (file)
index 0000000..3428c1a
--- /dev/null
@@ -0,0 +1,102 @@
+From 2344cd0c2e9ea8f3037be11fb997ddbeda0237ca Mon Sep 17 00:00:00 2001
+From: Henrik Rydberg <rydberg@euromail.se>
+Date: Tue, 9 Nov 2010 15:15:02 +0000
+Subject: hwmon: (applesmc) Relax the severity of device init failure
+
+From: Henrik Rydberg <rydberg@euromail.se>
+
+commit 2344cd0c2e9ea8f3037be11fb997ddbeda0237ca upstream.
+
+The device init is used to reset the accelerometer. Failure to reset
+is not severe enough to stop loading the module or to resume from
+hibernation.  This patch relaxes failure to a warning and drops
+output in case of success.
+
+Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
+Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/hwmon/applesmc.c |   38 +++++++-------------------------------
+ 1 file changed, 7 insertions(+), 31 deletions(-)
+
+--- a/drivers/hwmon/applesmc.c
++++ b/drivers/hwmon/applesmc.c
+@@ -448,38 +448,22 @@ static int applesmc_read_motion_sensor(i
+ }
+ /*
+- * applesmc_device_init - initialize the accelerometer.  Returns zero on success
+- * and negative error code on failure.  Can sleep.
++ * applesmc_device_init - initialize the accelerometer.  Can sleep.
+  */
+-static int applesmc_device_init(void)
++static void applesmc_device_init(void)
+ {
+-      int total, ret = -ENXIO;
++      int total;
+       u8 buffer[2];
+       if (!applesmc_accelerometer)
+-              return 0;
++              return;
+       mutex_lock(&applesmc_lock);
+       for (total = INIT_TIMEOUT_MSECS; total > 0; total -= INIT_WAIT_MSECS) {
+-              if (debug)
+-                      printk(KERN_DEBUG "applesmc try %d\n", total);
+               if (!applesmc_read_key(MOTION_SENSOR_KEY, buffer, 2) &&
+-                              (buffer[0] != 0x00 || buffer[1] != 0x00)) {
+-                      if (total == INIT_TIMEOUT_MSECS) {
+-                              printk(KERN_DEBUG "applesmc: device has"
+-                                              " already been initialized"
+-                                              " (0x%02x, 0x%02x).\n",
+-                                              buffer[0], buffer[1]);
+-                      } else {
+-                              printk(KERN_DEBUG "applesmc: device"
+-                                              " successfully initialized"
+-                                              " (0x%02x, 0x%02x).\n",
+-                                              buffer[0], buffer[1]);
+-                      }
+-                      ret = 0;
++                              (buffer[0] != 0x00 || buffer[1] != 0x00))
+                       goto out;
+-              }
+               buffer[0] = 0xe0;
+               buffer[1] = 0x00;
+               applesmc_write_key(MOTION_SENSOR_KEY, buffer, 2);
+@@ -490,7 +474,6 @@ static int applesmc_device_init(void)
+ out:
+       mutex_unlock(&applesmc_lock);
+-      return ret;
+ }
+ /*
+@@ -516,13 +499,8 @@ static int applesmc_get_fan_count(void)
+ /* Device model stuff */
+ static int applesmc_probe(struct platform_device *dev)
+ {
+-      int ret;
+-
+-      ret = applesmc_device_init();
+-      if (ret)
+-              return ret;
++      applesmc_device_init();
+-      printk(KERN_INFO "applesmc: device successfully initialized.\n");
+       return 0;
+ }
+@@ -539,9 +517,7 @@ static int applesmc_pm_resume(struct dev
+ /* Reinitialize device on resume from hibernation */
+ static int applesmc_pm_restore(struct device *dev)
+ {
+-      int ret = applesmc_device_init();
+-      if (ret)
+-              return ret;
++      applesmc_device_init();
+       return applesmc_pm_resume(dev);
+ }
diff --git a/queue-2.6.36/hwmon-via686a-initialize-fan_div-values.patch b/queue-2.6.36/hwmon-via686a-initialize-fan_div-values.patch
new file mode 100644 (file)
index 0000000..15fa38d
--- /dev/null
@@ -0,0 +1,64 @@
+From f790674d3f87df6390828ac21a7d1530f71b59c8 Mon Sep 17 00:00:00 2001
+From: Jean Delvare <khali@linux-fr.org>
+Date: Wed, 12 Jan 2011 21:55:09 +0100
+Subject: hwmon: (via686a) Initialize fan_div values
+
+From: Jean Delvare <khali@linux-fr.org>
+
+commit f790674d3f87df6390828ac21a7d1530f71b59c8 upstream.
+
+Functions set_fan_min() and set_fan_div() assume that the fan_div
+values have already been read from the register. The driver currently
+doesn't initialize them at load time, they are only set when function
+via686a_update_device() is called. This means that set_fan_min() and
+set_fan_div() misbehave if, for example, "sensors -s" is called
+before any monitoring application (e.g. "sensors") is has been run.
+
+Fix the problem by always initializing the fan_div values at device
+bind time.
+
+Signed-off-by: Jean Delvare <khali@linux-fr.org>
+Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/hwmon/via686a.c |   14 +++++++++++---
+ 1 file changed, 11 insertions(+), 3 deletions(-)
+
+--- a/drivers/hwmon/via686a.c
++++ b/drivers/hwmon/via686a.c
+@@ -687,6 +687,13 @@ static int __devexit via686a_remove(stru
+       return 0;
+ }
++static void via686a_update_fan_div(struct via686a_data *data)
++{
++      int reg = via686a_read_value(data, VIA686A_REG_FANDIV);
++      data->fan_div[0] = (reg >> 4) & 0x03;
++      data->fan_div[1] = reg >> 6;
++}
++
+ static void __devinit via686a_init_device(struct via686a_data *data)
+ {
+       u8 reg;
+@@ -700,6 +707,9 @@ static void __devinit via686a_init_devic
+       via686a_write_value(data, VIA686A_REG_TEMP_MODE,
+                           (reg & ~VIA686A_TEMP_MODE_MASK)
+                           | VIA686A_TEMP_MODE_CONTINUOUS);
++
++      /* Pre-read fan clock divisor values */
++      via686a_update_fan_div(data);
+ }
+ static struct via686a_data *via686a_update_device(struct device *dev)
+@@ -751,9 +761,7 @@ static struct via686a_data *via686a_upda
+                   (via686a_read_value(data, VIA686A_REG_TEMP_LOW23) &
+                    0xc0) >> 6;
+-              i = via686a_read_value(data, VIA686A_REG_FANDIV);
+-              data->fan_div[0] = (i >> 4) & 0x03;
+-              data->fan_div[1] = i >> 6;
++              via686a_update_fan_div(data);
+               data->alarms =
+                   via686a_read_value(data,
+                                      VIA686A_REG_ALARM1) |
index 694dc1da1f2868ec76882e01c6ff4d984a260faf..6814395b1597494eaa13836307c2bfb2191f7eaf 100644 (file)
@@ -4,3 +4,7 @@ rt2x00-add-device-id-for-windy31-usb-device.patch
 staging-rt2870sta-add-id-for-linksys-wusb100v2.patch
 alsa-snd-usb-us122l-fix-midi-output.patch
 alsa-snd-usb-us122l-fix-missing-null-checks.patch
+atl1-fix-oops-when-changing-tx-rx-ring-params.patch
+hwmon-via686a-initialize-fan_div-values.patch
+hwmon-applesmc-add-macbookair3-1-3-2-support.patch
+hwmon-applesmc-relax-the-severity-of-device-init-failure.patch