From: Greg Kroah-Hartman Date: Tue, 3 Jan 2012 21:05:36 +0000 (-0800) Subject: 3.0-stable patches X-Git-Tag: v3.1.8~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2f8da877d1625b60433b1b337f14683898fa4ed7;p=thirdparty%2Fkernel%2Fstable-queue.git 3.0-stable patches added patches: iwlwifi-update-scd-bc-table-for-all-scd-queues.patch mfd-check-for-twl4030-madc-null-pointer.patch mfd-copy-the-device-pointer-to-the-twl4030-madc-structure.patch mfd-fix-mismatch-in-twl4030-mutex-lock-unlock.patch mfd-turn-on-the-twl4030-madc-madc-clock.patch xen-swiotlb-use-page-alignment-for-early-buffer-allocation.patch --- diff --git a/queue-3.0/iwlwifi-update-scd-bc-table-for-all-scd-queues.patch b/queue-3.0/iwlwifi-update-scd-bc-table-for-all-scd-queues.patch new file mode 100644 index 00000000000..741969c468a --- /dev/null +++ b/queue-3.0/iwlwifi-update-scd-bc-table-for-all-scd-queues.patch @@ -0,0 +1,39 @@ +From emmanuel.grumbach@intel.com Tue Jan 3 12:53:48 2012 +From: Emmanuel Grumbach +Date: Mon, 26 Dec 2011 08:47:33 +0200 +Subject: iwlwifi: update SCD BC table for all SCD queues +To: stable@vger.kernel.org +Cc: Emmanuel Grumbach , Wey-Yi Guy , "John W. Linville" +Message-ID: <1324882054-15030-1-git-send-email-emmanuel.grumbach@intel.com> + +From: Emmanuel Grumbach + +commit 96f1f05af76b601ab21a7dc603ae0a1cea4efc3d upstream. + +Since we configure all the queues as CHAINABLE, we need to update the +byte count for all the queues, not only the AGGREGATABLE ones. + +Not doing so can confuse the SCD and make the fw assert. + +Signed-off-by: Emmanuel Grumbach +Signed-off-by: Wey-Yi Guy +Signed-off-by: John W. Linville + +--- + drivers/net/wireless/iwlwifi/iwl-agn-tx.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +--- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c ++++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c +@@ -778,10 +778,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv, + iwl_print_hex_dump(priv, IWL_DL_TX, (u8 *)tx_cmd, sizeof(*tx_cmd)); + iwl_print_hex_dump(priv, IWL_DL_TX, (u8 *)tx_cmd->hdr, hdr_len); + +- /* Set up entry for this TFD in Tx byte-count array */ +- if (info->flags & IEEE80211_TX_CTL_AMPDU) +- iwlagn_txq_update_byte_cnt_tbl(priv, txq, +- le16_to_cpu(tx_cmd->len)); ++ iwlagn_txq_update_byte_cnt_tbl(priv, txq, le16_to_cpu(tx_cmd->len)); + + pci_dma_sync_single_for_device(priv->pci_dev, txcmd_phys, + firstlen, PCI_DMA_BIDIRECTIONAL); diff --git a/queue-3.0/mfd-check-for-twl4030-madc-null-pointer.patch b/queue-3.0/mfd-check-for-twl4030-madc-null-pointer.patch new file mode 100644 index 00000000000..1569ef96e1a --- /dev/null +++ b/queue-3.0/mfd-check-for-twl4030-madc-null-pointer.patch @@ -0,0 +1,34 @@ +From d0e84caeb4cd535923884735906e5730329505b4 Mon Sep 17 00:00:00 2001 +From: Kyle Manna +Date: Thu, 11 Aug 2011 22:33:14 -0500 +Subject: mfd: Check for twl4030-madc NULL pointer + +From: Kyle Manna + +commit d0e84caeb4cd535923884735906e5730329505b4 upstream. + +If the twl4030-madc device wasn't registered, and another device, such +as twl4030-madc-hwmon, calls twl4030_madc_conversion() a NULL pointer is +dereferenced. + +Signed-off-by: Kyle Manna +Signed-off-by: Samuel Ortiz +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mfd/twl4030-madc.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/mfd/twl4030-madc.c ++++ b/drivers/mfd/twl4030-madc.c +@@ -510,8 +510,9 @@ int twl4030_madc_conversion(struct twl40 + u8 ch_msb, ch_lsb; + int ret; + +- if (!req) ++ if (!req || !twl4030_madc) + return -EINVAL; ++ + mutex_lock(&twl4030_madc->lock); + if (req->method < TWL4030_MADC_RT || req->method > TWL4030_MADC_SW2) { + ret = -EINVAL; diff --git a/queue-3.0/mfd-copy-the-device-pointer-to-the-twl4030-madc-structure.patch b/queue-3.0/mfd-copy-the-device-pointer-to-the-twl4030-madc-structure.patch new file mode 100644 index 00000000000..05dc1d780eb --- /dev/null +++ b/queue-3.0/mfd-copy-the-device-pointer-to-the-twl4030-madc-structure.patch @@ -0,0 +1,32 @@ +From 66cc5b8e50af87b0bbd0f179d76d2826f4549c13 Mon Sep 17 00:00:00 2001 +From: Kyle Manna +Date: Thu, 11 Aug 2011 22:33:12 -0500 +Subject: mfd: Copy the device pointer to the twl4030-madc structure + +From: Kyle Manna + +commit 66cc5b8e50af87b0bbd0f179d76d2826f4549c13 upstream. + +Worst case this fixes the following error: +[ 72.086212] (NULL device *): conversion timeout! + +Best case it prevents a crash + +Signed-off-by: Kyle Manna +Signed-off-by: Samuel Ortiz + +--- + drivers/mfd/twl4030-madc.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/drivers/mfd/twl4030-madc.c ++++ b/drivers/mfd/twl4030-madc.c +@@ -706,6 +706,8 @@ static int __devinit twl4030_madc_probe( + if (!madc) + return -ENOMEM; + ++ madc->dev = &pdev->dev; ++ + /* + * Phoenix provides 2 interrupt lines. The first one is connected to + * the OMAP. The other one can be connected to the other processor such diff --git a/queue-3.0/mfd-fix-mismatch-in-twl4030-mutex-lock-unlock.patch b/queue-3.0/mfd-fix-mismatch-in-twl4030-mutex-lock-unlock.patch new file mode 100644 index 00000000000..b8fa31fc670 --- /dev/null +++ b/queue-3.0/mfd-fix-mismatch-in-twl4030-mutex-lock-unlock.patch @@ -0,0 +1,61 @@ +From e178ccb33569da17dc897a08a3865441b813bdfb Mon Sep 17 00:00:00 2001 +From: Sanjeev Premi +Date: Mon, 11 Jul 2011 20:50:31 +0530 +Subject: mfd: Fix mismatch in twl4030 mutex lock-unlock + +From: Sanjeev Premi + +commit e178ccb33569da17dc897a08a3865441b813bdfb upstream. + +A mutex is locked on entry into twl4030_madc_conversion(). +Immediate return on some error conditions leaves the +mutex locked. + +This patch ensures that mutex is always unlocked before +leaving the function. + +Signed-off-by: Sanjeev Premi +Cc: Keerthy +Signed-off-by: Samuel Ortiz +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mfd/twl4030-madc.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/mfd/twl4030-madc.c ++++ b/drivers/mfd/twl4030-madc.c +@@ -530,13 +530,13 @@ int twl4030_madc_conversion(struct twl40 + if (ret) { + dev_err(twl4030_madc->dev, + "unable to write sel register 0x%X\n", method->sel + 1); +- return ret; ++ goto out; + } + ret = twl_i2c_write_u8(TWL4030_MODULE_MADC, ch_lsb, method->sel); + if (ret) { + dev_err(twl4030_madc->dev, + "unable to write sel register 0x%X\n", method->sel + 1); +- return ret; ++ goto out; + } + /* Select averaging for all channels if do_avg is set */ + if (req->do_avg) { +@@ -546,7 +546,7 @@ int twl4030_madc_conversion(struct twl40 + dev_err(twl4030_madc->dev, + "unable to write avg register 0x%X\n", + method->avg + 1); +- return ret; ++ goto out; + } + ret = twl_i2c_write_u8(TWL4030_MODULE_MADC, + ch_lsb, method->avg); +@@ -554,7 +554,7 @@ int twl4030_madc_conversion(struct twl40 + dev_err(twl4030_madc->dev, + "unable to write sel reg 0x%X\n", + method->sel + 1); +- return ret; ++ goto out; + } + } + if (req->type == TWL4030_MADC_IRQ_ONESHOT && req->func_cb != NULL) { diff --git a/queue-3.0/mfd-turn-on-the-twl4030-madc-madc-clock.patch b/queue-3.0/mfd-turn-on-the-twl4030-madc-madc-clock.patch new file mode 100644 index 00000000000..403c1f0177d --- /dev/null +++ b/queue-3.0/mfd-turn-on-the-twl4030-madc-madc-clock.patch @@ -0,0 +1,68 @@ +From 3d6271f92e98094584fd1e609a9969cd33e61122 Mon Sep 17 00:00:00 2001 +From: Kyle Manna +Date: Thu, 11 Aug 2011 22:33:13 -0500 +Subject: mfd: Turn on the twl4030-madc MADC clock + +From: Kyle Manna + +commit 3d6271f92e98094584fd1e609a9969cd33e61122 upstream. + +Without turning the MADC clock on, no MADC conversions occur. + +$ cat /sys/class/hwmon/hwmon0/device/in8_input +[ 53.428436] twl4030_madc twl4030_madc: conversion timeout! +cat: read error: Resource temporarily unavailable + +Signed-off-by: Kyle Manna +Signed-off-by: Samuel Ortiz +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/mfd/twl4030-madc.c | 22 ++++++++++++++++++++++ + include/linux/i2c/twl4030-madc.h | 4 ++++ + 2 files changed, 26 insertions(+) + +--- a/drivers/mfd/twl4030-madc.c ++++ b/drivers/mfd/twl4030-madc.c +@@ -740,6 +740,28 @@ static int __devinit twl4030_madc_probe( + TWL4030_BCI_BCICTL1); + goto err_i2c; + } ++ ++ /* Check that MADC clock is on */ ++ ret = twl_i2c_read_u8(TWL4030_MODULE_INTBR, ®val, TWL4030_REG_GPBR1); ++ if (ret) { ++ dev_err(&pdev->dev, "unable to read reg GPBR1 0x%X\n", ++ TWL4030_REG_GPBR1); ++ goto err_i2c; ++ } ++ ++ /* If MADC clk is not on, turn it on */ ++ if (!(regval & TWL4030_GPBR1_MADC_HFCLK_EN)) { ++ dev_info(&pdev->dev, "clk disabled, enabling\n"); ++ regval |= TWL4030_GPBR1_MADC_HFCLK_EN; ++ ret = twl_i2c_write_u8(TWL4030_MODULE_INTBR, regval, ++ TWL4030_REG_GPBR1); ++ if (ret) { ++ dev_err(&pdev->dev, "unable to write reg GPBR1 0x%X\n", ++ TWL4030_REG_GPBR1); ++ goto err_i2c; ++ } ++ } ++ + platform_set_drvdata(pdev, madc); + mutex_init(&madc->lock); + ret = request_threaded_irq(platform_get_irq(pdev, 0), NULL, +--- a/include/linux/i2c/twl4030-madc.h ++++ b/include/linux/i2c/twl4030-madc.h +@@ -129,6 +129,10 @@ enum sample_type { + #define REG_BCICTL2 0x024 + #define TWL4030_BCI_ITHSENS 0x007 + ++/* Register and bits for GPBR1 register */ ++#define TWL4030_REG_GPBR1 0x0c ++#define TWL4030_GPBR1_MADC_HFCLK_EN (1 << 7) ++ + struct twl4030_madc_user_parms { + int channel; + int average; diff --git a/queue-3.0/series b/queue-3.0/series index 15874a21c1b..c06308bb74b 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -59,3 +59,9 @@ sctp-do-not-account-for-sizeof-struct-sk_buff-in-estimated-rwnd.patch ipv4-flush-route-cache-after-change-accept_local.patch ipv4-reintroduce-route-cache-garbage-collector.patch ipv4-using-prefetch-requires-including-prefetch.h.patch +iwlwifi-update-scd-bc-table-for-all-scd-queues.patch +mfd-fix-mismatch-in-twl4030-mutex-lock-unlock.patch +mfd-copy-the-device-pointer-to-the-twl4030-madc-structure.patch +mfd-check-for-twl4030-madc-null-pointer.patch +mfd-turn-on-the-twl4030-madc-madc-clock.patch +xen-swiotlb-use-page-alignment-for-early-buffer-allocation.patch diff --git a/queue-3.0/xen-swiotlb-use-page-alignment-for-early-buffer-allocation.patch b/queue-3.0/xen-swiotlb-use-page-alignment-for-early-buffer-allocation.patch new file mode 100644 index 00000000000..989f7651887 --- /dev/null +++ b/queue-3.0/xen-swiotlb-use-page-alignment-for-early-buffer-allocation.patch @@ -0,0 +1,50 @@ +From 63a741757d15320a25ebf5778f8651cce2ed0611 Mon Sep 17 00:00:00 2001 +From: Konrad Rzeszutek Wilk +Date: Thu, 15 Dec 2011 11:28:46 -0500 +Subject: xen/swiotlb: Use page alignment for early buffer allocation. + +From: Konrad Rzeszutek Wilk + +commit 63a741757d15320a25ebf5778f8651cce2ed0611 upstream. + +This fixes an odd bug found on a Dell PowerEdge 1850/0RC130 +(BIOS A05 01/09/2006) where all of the modules doing pci_set_dma_mask +would fail with: + +ata_piix 0000:00:1f.1: enabling device (0005 -> 0007) +ata_piix 0000:00:1f.1: can't derive routing for PCI INT A +ata_piix 0000:00:1f.1: BMDMA: failed to set dma mask, falling back to PIO + +The issue was the Xen-SWIOTLB was allocated such as that the end of +buffer was stradling a page (and also above 4GB). The fix was +spotted by Kalev Leonid which was to piggyback on git commit +e79f86b2ef9c0a8c47225217c1018b7d3d90101c "swiotlb: Use page alignment +for early buffer allocation" which: + + We could call free_bootmem_late() if swiotlb is not used, and + it will shrink to page alignment. + + So alloc them with page alignment at first, to avoid lose two pages + +And doing that fixes the outstanding issue. + +Suggested-by: "Kalev, Leonid" +Reported-and-Tested-by: "Taylor, Neal E" +Signed-off-by: Konrad Rzeszutek Wilk +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/xen/swiotlb-xen.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/xen/swiotlb-xen.c ++++ b/drivers/xen/swiotlb-xen.c +@@ -162,7 +162,7 @@ void __init xen_swiotlb_init(int verbose + /* + * Get IO TLB memory from any location. + */ +- xen_io_tlb_start = alloc_bootmem(bytes); ++ xen_io_tlb_start = alloc_bootmem_pages(PAGE_ALIGN(bytes)); + if (!xen_io_tlb_start) + panic("Cannot allocate SWIOTLB buffer"); +