--- /dev/null
+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>
+
+diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
+index 5336310..3acf512 100644
+--- a/drivers/net/atlx/atl1.c
++++ b/drivers/net/atlx/atl1.c
+@@ -3504,6 +3504,8 @@ static int atl1_set_ringparam(struct net_device *netdev,
+ 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;
+@@ -3544,11 +3546,19 @@ static int atl1_set_ringparam(struct net_device *netdev,
+ 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)
--- /dev/null
+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") },
--- /dev/null
+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);
+ }
+
--- /dev/null
+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) |
--- /dev/null
+From 729a6a300e628a48cf12bac93a964a535e83cd1d Mon Sep 17 00:00:00 2001
+From: Tejun Heo <htejun@gmail.com>
+Date: Thu, 20 Jan 2011 13:59:06 +0100
+Subject: libata: set queue DMA alignment to sector size for ATAPI too
+
+From: Tejun Heo <htejun@gmail.com>
+
+commit 729a6a300e628a48cf12bac93a964a535e83cd1d upstream.
+
+ata_pio_sectors() expects buffer for each sector to be contained in a
+single page; otherwise, it ends up overrunning the first page. This
+is achieved by setting queue DMA alignment. If sector_size is smaller
+than PAGE_SIZE and all buffers are sector_size aligned, buffer for
+each sector is always contained in a single page.
+
+This wasn't applied to ATAPI devices but IDENTIFY_PACKET is executed
+as ATA_PROT_PIO and thus uses ata_pio_sectors(). Newer versions of
+udev issue IDENTIFY_PACKET with unaligned buffer triggering the
+problem and causing oops.
+
+This patch fixes the problem by setting sdev->sector_size to
+ATA_SECT_SIZE on ATATPI devices and always setting DMA alignment to
+sector_size. While at it, add a warning for the unlikely but still
+possible scenario where sector_size is larger than PAGE_SIZE, in which
+case the alignment wouldn't be enough.
+
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Reported-by: John Stanley <jpsinthemix@verizon.net>
+Tested-by: John Stanley <jpsinthemix@verizon.net>
+Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/ata/libata-scsi.c | 24 ++++++++++++++++++------
+ 1 file changed, 18 insertions(+), 6 deletions(-)
+
+--- a/drivers/ata/libata-scsi.c
++++ b/drivers/ata/libata-scsi.c
+@@ -1102,9 +1102,9 @@ static int ata_scsi_dev_config(struct sc
+ struct request_queue *q = sdev->request_queue;
+ void *buf;
+
+- /* set the min alignment and padding */
+- blk_queue_update_dma_alignment(sdev->request_queue,
+- ATA_DMA_PAD_SZ - 1);
++ sdev->sector_size = ATA_SECT_SIZE;
++
++ /* set DMA padding */
+ blk_queue_update_dma_pad(sdev->request_queue,
+ ATA_DMA_PAD_SZ - 1);
+
+@@ -1118,13 +1118,25 @@ static int ata_scsi_dev_config(struct sc
+
+ blk_queue_dma_drain(q, atapi_drain_needed, buf, ATAPI_MAX_DRAIN);
+ } else {
+- /* ATA devices must be sector aligned */
+ sdev->sector_size = ata_id_logical_sector_size(dev->id);
+- blk_queue_update_dma_alignment(sdev->request_queue,
+- sdev->sector_size - 1);
+ sdev->manage_start_stop = 1;
+ }
+
++ /*
++ * ata_pio_sectors() expects buffer for each sector to not cross
++ * page boundary. Enforce it by requiring buffers to be sector
++ * aligned, which works iff sector_size is not larger than
++ * PAGE_SIZE. ATAPI devices also need the alignment as
++ * IDENTIFY_PACKET is executed as ATA_PROT_PIO.
++ */
++ if (sdev->sector_size > PAGE_SIZE)
++ ata_dev_printk(dev, KERN_WARNING,
++ "sector_size=%u > PAGE_SIZE, PIO may malfunction\n",
++ sdev->sector_size);
++
++ blk_queue_update_dma_alignment(sdev->request_queue,
++ sdev->sector_size - 1);
++
+ if (dev->flags & ATA_DFLAG_AN)
+ set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events);
+
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
+libata-set-queue-dma-alignment-to-sector-size-for-atapi-too.patch
+x86-uv-bau-extend-for-more-than-16-cpus-per-socket.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
+atl1-fix-oops-when-changing-tx-rx-ring-params.patch
--- /dev/null
+From cfa60917f0ba6eca83f41aef3cb4a7dd7736ac9f Mon Sep 17 00:00:00 2001
+From: Cliff Wickman <cpw@sgi.com>
+Date: Mon, 3 Jan 2011 12:03:53 -0600
+Subject: x86, UV, BAU: Extend for more than 16 cpus per socket
+
+From: Cliff Wickman <cpw@sgi.com>
+
+commit cfa60917f0ba6eca83f41aef3cb4a7dd7736ac9f upstream.
+
+Fix a hard-coded limit of a maximum of 16 cpu's per socket.
+
+The UV Broadcast Assist Unit code initializes by scanning the
+cpu topology of the system and assigning a master cpu for each
+socket and UV hub. That scan had an assumption of a limit of 16
+cpus per socket. With Westmere we are going over that limit.
+The UV hub hardware will allow up to 32.
+
+If the scan finds the system has gone over that limit it returns
+an error and we print a warning and fall back to doing TLB
+shootdowns without the BAU.
+
+Signed-off-by: Cliff Wickman <cpw@sgi.com>
+LKML-Reference: <E1PZol7-0000mM-77@eag09.americas.sgi.com>
+Signed-off-by: Ingo Molnar <mingo@elte.hu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/include/asm/uv/uv_bau.h | 9 +++++----
+ arch/x86/platform/uv/tlb_uv.c | 22 ++++++++++++++++++----
+ 2 files changed, 23 insertions(+), 8 deletions(-)
+
+--- a/arch/x86/include/asm/uv/uv_bau.h
++++ b/arch/x86/include/asm/uv/uv_bau.h
+@@ -26,20 +26,22 @@
+ * BAU_SB_DESCRIPTOR_BASE register, set 1 is located at BASE + 512,
+ * set 2 is at BASE + 2*512, set 3 at BASE + 3*512, and so on.
+ *
+- * We will use 31 sets, one for sending BAU messages from each of the 32
++ * We will use one set for sending BAU messages from each of the
+ * cpu's on the uvhub.
+ *
+ * TLB shootdown will use the first of the 8 descriptors of each set.
+ * Each of the descriptors is 64 bytes in size (8*64 = 512 bytes in a set).
+ */
+
++#define MAX_CPUS_PER_UVHUB 64
++#define MAX_CPUS_PER_SOCKET 32
++#define UV_ADP_SIZE 64 /* hardware-provided max. */
++#define UV_CPUS_PER_ACT_STATUS 32 /* hardware-provided max. */
+ #define UV_ITEMS_PER_DESCRIPTOR 8
+ /* the 'throttle' to prevent the hardware stay-busy bug */
+ #define MAX_BAU_CONCURRENT 3
+-#define UV_CPUS_PER_ACT_STATUS 32
+ #define UV_ACT_STATUS_MASK 0x3
+ #define UV_ACT_STATUS_SIZE 2
+-#define UV_ADP_SIZE 32
+ #define UV_DISTRIBUTION_SIZE 256
+ #define UV_SW_ACK_NPENDING 8
+ #define UV_NET_ENDPOINT_INTD 0x38
+@@ -100,7 +102,6 @@
+ * number of destination side software ack resources
+ */
+ #define DEST_NUM_RESOURCES 8
+-#define MAX_CPUS_PER_NODE 32
+ /*
+ * completion statuses for sending a TLB flush message
+ */
+--- a/arch/x86/platform/uv/tlb_uv.c
++++ b/arch/x86/platform/uv/tlb_uv.c
+@@ -1341,7 +1341,7 @@ uv_activation_descriptor_init(int node,
+
+ /*
+ * each bau_desc is 64 bytes; there are 8 (UV_ITEMS_PER_DESCRIPTOR)
+- * per cpu; and up to 32 (UV_ADP_SIZE) cpu's per uvhub
++ * per cpu; and one per cpu on the uvhub (UV_ADP_SIZE)
+ */
+ bau_desc = kmalloc_node(sizeof(struct bau_desc) * UV_ADP_SIZE
+ * UV_ITEMS_PER_DESCRIPTOR, GFP_KERNEL, node);
+@@ -1490,7 +1490,7 @@ calculate_destination_timeout(void)
+ /*
+ * initialize the bau_control structure for each cpu
+ */
+-static void __init uv_init_per_cpu(int nuvhubs)
++static int __init uv_init_per_cpu(int nuvhubs)
+ {
+ int i;
+ int cpu;
+@@ -1507,7 +1507,7 @@ static void __init uv_init_per_cpu(int n
+ struct bau_control *smaster = NULL;
+ struct socket_desc {
+ short num_cpus;
+- short cpu_number[16];
++ short cpu_number[MAX_CPUS_PER_SOCKET];
+ };
+ struct uvhub_desc {
+ unsigned short socket_mask;
+@@ -1540,6 +1540,10 @@ static void __init uv_init_per_cpu(int n
+ sdp = &bdp->socket[socket];
+ sdp->cpu_number[sdp->num_cpus] = cpu;
+ sdp->num_cpus++;
++ if (sdp->num_cpus > MAX_CPUS_PER_SOCKET) {
++ printk(KERN_EMERG "%d cpus per socket invalid\n", sdp->num_cpus);
++ return 1;
++ }
+ }
+ for (uvhub = 0; uvhub < nuvhubs; uvhub++) {
+ if (!(*(uvhub_mask + (uvhub/8)) & (1 << (uvhub%8))))
+@@ -1570,6 +1574,12 @@ static void __init uv_init_per_cpu(int n
+ bcp->uvhub_master = hmaster;
+ bcp->uvhub_cpu = uv_cpu_hub_info(cpu)->
+ blade_processor_id;
++ if (bcp->uvhub_cpu >= MAX_CPUS_PER_UVHUB) {
++ printk(KERN_EMERG
++ "%d cpus per uvhub invalid\n",
++ bcp->uvhub_cpu);
++ return 1;
++ }
+ }
+ nextsocket:
+ socket++;
+@@ -1595,6 +1605,7 @@ nextsocket:
+ bcp->congested_reps = congested_reps;
+ bcp->congested_period = congested_period;
+ }
++ return 0;
+ }
+
+ /*
+@@ -1625,7 +1636,10 @@ static int __init uv_bau_init(void)
+ spin_lock_init(&disable_lock);
+ congested_cycles = microsec_2_cycles(congested_response_us);
+
+- uv_init_per_cpu(nuvhubs);
++ if (uv_init_per_cpu(nuvhubs)) {
++ nobau = 1;
++ return 0;
++ }
+
+ uv_partition_base_pnode = 0x7fffffff;
+ for (uvhub = 0; uvhub < nuvhubs; uvhub++)