From: Greg Kroah-Hartman Date: Fri, 18 May 2012 20:17:43 +0000 (-0700) Subject: 3.0-stable patches X-Git-Tag: v3.0.32~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=80a001f7ae0f34da8ca8e9d78162948629e23533;p=thirdparty%2Fkernel%2Fstable-queue.git 3.0-stable patches added patches: pch_gbe-do-not-abort-probe-on-bad-mac.patch pch_gbe-fixed-the-issue-on-which-pc-was-frozen-when-link-was-downed.patch pch_gbe-fixed-the-issue-which-receives-an-unnecessary-packet.patch pch_gbe-memory-corruption-calling-pch_gbe_validate_option.patch pch_gbe-support-ml7831-ioh.patch pch_gpio-support-new-device-lapis-semiconductor-ml7831-ioh.patch wake-up-s_wait_unfrozen-when-freeze_fs-fails.patch --- diff --git a/queue-3.0/pch_gbe-do-not-abort-probe-on-bad-mac.patch b/queue-3.0/pch_gbe-do-not-abort-probe-on-bad-mac.patch new file mode 100644 index 00000000000..bcdbf32dc74 --- /dev/null +++ b/queue-3.0/pch_gbe-do-not-abort-probe-on-bad-mac.patch @@ -0,0 +1,79 @@ +From 2b53d07891630dead46d65c8f896955fd3ae0302 Mon Sep 17 00:00:00 2001 +From: Darren Hart +Date: Mon, 16 Jan 2012 09:50:19 +0000 +Subject: pch_gbe: Do not abort probe on bad MAC + +From: Darren Hart + +commit 2b53d07891630dead46d65c8f896955fd3ae0302 upstream. + +If the MAC is invalid or not implemented, do not abort the probe. Issue +a warning and prevent bringing the interface up until a MAC is set manually +(via ifconfig $IFACE hw ether $MAC). + +Tested on two platforms, one with a valid MAC, the other without a MAC. The real +MAC is used if present, the interface fails to come up until the MAC is set on +the other. They successfully get an IP over DHCP and pass a simple ping and +login over ssh test. + +This is meant to allow the Inforce SYS940X development board: +http://www.inforcecomputing.com/SYS940X_ECX.html +(and others suffering from a missing MAC) to work with the mainline kernel. +Without this patch, the probe will fail and the interface will not be created, +preventing the user from configuring the MAC manually. + +This does not make any attempt to address a missing or invalid MAC for the +pch_phub driver. + +Signed-off-by: Darren Hart +CC: Arjan van de Ven +CC: Alan Cox +CC: Tomoya MORINAGA +CC: Jeff Kirsher +CC: "David S. Miller" +CC: Paul Gortmaker +CC: Jon Mason +CC: netdev@vger.kernel.org +CC: Mark Brown +CC: David Laight +CC: Joe Perches +Signed-off-by: David S. Miller +Signed-off-by: Tomoya MORINAGA + +--- + drivers/net/pch_gbe/pch_gbe_main.c | 17 ++++++++++++++--- + 1 file changed, 14 insertions(+), 3 deletions(-) + +--- a/drivers/net/pch_gbe/pch_gbe_main.c ++++ b/drivers/net/pch_gbe/pch_gbe_main.c +@@ -1710,6 +1710,12 @@ int pch_gbe_up(struct pch_gbe_adapter *a + struct pch_gbe_rx_ring *rx_ring = adapter->rx_ring; + int err; + ++ /* Ensure we have a valid MAC */ ++ if (!is_valid_ether_addr(adapter->hw.mac.addr)) { ++ pr_err("Error: Invalid MAC address\n"); ++ return -EINVAL; ++ } ++ + /* hardware has been reset, we need to reload some things */ + pch_gbe_set_multi(netdev); + +@@ -2402,9 +2408,14 @@ static int pch_gbe_probe(struct pci_dev + + memcpy(netdev->dev_addr, adapter->hw.mac.addr, netdev->addr_len); + if (!is_valid_ether_addr(netdev->dev_addr)) { +- dev_err(&pdev->dev, "Invalid MAC Address\n"); +- ret = -EIO; +- goto err_free_adapter; ++ /* ++ * If the MAC is invalid (or just missing), display a warning ++ * but do not abort setting up the device. pch_gbe_up will ++ * prevent the interface from being brought up until a valid MAC ++ * is set. ++ */ ++ dev_err(&pdev->dev, "Invalid MAC address, " ++ "interface disabled.\n"); + } + setup_timer(&adapter->watchdog_timer, pch_gbe_watchdog, + (unsigned long)adapter); diff --git a/queue-3.0/pch_gbe-fixed-the-issue-on-which-pc-was-frozen-when-link-was-downed.patch b/queue-3.0/pch_gbe-fixed-the-issue-on-which-pc-was-frozen-when-link-was-downed.patch new file mode 100644 index 00000000000..94dea84237b --- /dev/null +++ b/queue-3.0/pch_gbe-fixed-the-issue-on-which-pc-was-frozen-when-link-was-downed.patch @@ -0,0 +1,33 @@ +From 5f3a11419099d5cc010cfbfc524ca10d8fb81f89 Mon Sep 17 00:00:00 2001 +From: Toshiharu Okada +Date: Sun, 25 Sep 2011 21:27:42 +0000 +Subject: pch_gbe: Fixed the issue on which PC was frozen when link was downed. + +From: Toshiharu Okada + +commit 5f3a11419099d5cc010cfbfc524ca10d8fb81f89 upstream. + +When a link was downed during network use, +there is an issue on which PC freezes. + +This patch fixed this issue. + +Signed-off-by: Toshiharu Okada +Signed-off-by: David S. Miller +Signed-off-by: Tomoya MORINAGA + +--- + drivers/net/pch_gbe/pch_gbe_main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/pch_gbe/pch_gbe_main.c ++++ b/drivers/net/pch_gbe/pch_gbe_main.c +@@ -2128,7 +2128,7 @@ static int pch_gbe_napi_poll(struct napi + /* If no Tx and not enough Rx work done, + * exit the polling mode + */ +- if ((work_done < budget) || !netif_running(netdev)) ++ if (work_done < budget) + poll_end_flag = true; + } + diff --git a/queue-3.0/pch_gbe-fixed-the-issue-which-receives-an-unnecessary-packet.patch b/queue-3.0/pch_gbe-fixed-the-issue-which-receives-an-unnecessary-packet.patch new file mode 100644 index 00000000000..c0556254d01 --- /dev/null +++ b/queue-3.0/pch_gbe-fixed-the-issue-which-receives-an-unnecessary-packet.patch @@ -0,0 +1,67 @@ +From 5229d87edcd80a3bceb0708ebd767faff2e589a9 Mon Sep 17 00:00:00 2001 +From: Toshiharu Okada +Date: Thu, 1 Sep 2011 14:20:07 +0000 +Subject: pch_gbe: fixed the issue which receives an unnecessary packet. + +From: Toshiharu Okada + +commit 5229d87edcd80a3bceb0708ebd767faff2e589a9 upstream. + +This patch fixed the issue which receives an unnecessary packet before link + +When using PHY of GMII, an unnecessary packet is received, +And it becomes impossible to receive a packet after link up. + +Signed-off-by: Toshiharu Okada +Signed-off-by: David S. Miller +Signed-off-by: Tomoya MORINAGA +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/pch_gbe/pch_gbe_main.c | 21 ++++++++++++++------- + 1 file changed, 14 insertions(+), 7 deletions(-) + +--- a/drivers/net/pch_gbe/pch_gbe_main.c ++++ b/drivers/net/pch_gbe/pch_gbe_main.c +@@ -717,13 +717,6 @@ static void pch_gbe_configure_rx(struct + iowrite32(rdba, &hw->reg->RX_DSC_BASE); + iowrite32(rdlen, &hw->reg->RX_DSC_SIZE); + iowrite32((rdba + rdlen), &hw->reg->RX_DSC_SW_P); +- +- /* Enables Receive DMA */ +- rxdma = ioread32(&hw->reg->DMA_CTRL); +- rxdma |= PCH_GBE_RX_DMA_EN; +- iowrite32(rxdma, &hw->reg->DMA_CTRL); +- /* Enables Receive */ +- iowrite32(PCH_GBE_MRE_MAC_RX_EN, &hw->reg->MAC_RX_EN); + } + + /** +@@ -1097,6 +1090,19 @@ void pch_gbe_update_stats(struct pch_gbe + spin_unlock_irqrestore(&adapter->stats_lock, flags); + } + ++static void pch_gbe_start_receive(struct pch_gbe_hw *hw) ++{ ++ u32 rxdma; ++ ++ /* Enables Receive DMA */ ++ rxdma = ioread32(&hw->reg->DMA_CTRL); ++ rxdma |= PCH_GBE_RX_DMA_EN; ++ iowrite32(rxdma, &hw->reg->DMA_CTRL); ++ /* Enables Receive */ ++ iowrite32(PCH_GBE_MRE_MAC_RX_EN, &hw->reg->MAC_RX_EN); ++ return; ++} ++ + /** + * pch_gbe_intr - Interrupt Handler + * @irq: Interrupt number +@@ -1717,6 +1723,7 @@ int pch_gbe_up(struct pch_gbe_adapter *a + pch_gbe_alloc_tx_buffers(adapter, tx_ring); + pch_gbe_alloc_rx_buffers(adapter, rx_ring, rx_ring->count); + adapter->tx_queue_len = netdev->tx_queue_len; ++ pch_gbe_start_receive(&adapter->hw); + + mod_timer(&adapter->watchdog_timer, jiffies); + diff --git a/queue-3.0/pch_gbe-memory-corruption-calling-pch_gbe_validate_option.patch b/queue-3.0/pch_gbe-memory-corruption-calling-pch_gbe_validate_option.patch new file mode 100644 index 00000000000..43b1ba8577a --- /dev/null +++ b/queue-3.0/pch_gbe-memory-corruption-calling-pch_gbe_validate_option.patch @@ -0,0 +1,53 @@ +From 73f98eab9b9e0bab492ca06add5657d9e702ddb1 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Wed, 29 Feb 2012 21:17:08 +0000 +Subject: pch_gbe: memory corruption calling pch_gbe_validate_option() + +From: Dan Carpenter + +commit 73f98eab9b9e0bab492ca06add5657d9e702ddb1 upstream. + +pch_gbe_validate_option() modifies 32 bits of memory but we pass +&hw->phy.autoneg_advertised which only has 16 bits and &hw->mac.fc +which only has 8 bits. + +Signed-off-by: Dan Carpenter +Signed-off-by: David S. Miller +Signed-off-by: Tomoya MORINAGA +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/pch_gbe/pch_gbe_param.c | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +--- a/drivers/net/pch_gbe/pch_gbe_param.c ++++ b/drivers/net/pch_gbe/pch_gbe_param.c +@@ -320,10 +320,10 @@ static void pch_gbe_check_copper_options + pr_debug("AutoNeg specified along with Speed or Duplex, AutoNeg parameter ignored\n"); + hw->phy.autoneg_advertised = opt.def; + } else { +- hw->phy.autoneg_advertised = AutoNeg; +- pch_gbe_validate_option( +- (int *)(&hw->phy.autoneg_advertised), +- &opt, adapter); ++ int tmp = AutoNeg; ++ ++ pch_gbe_validate_option(&tmp, &opt, adapter); ++ hw->phy.autoneg_advertised = tmp; + } + } + +@@ -494,9 +494,10 @@ void pch_gbe_check_options(struct pch_gb + .arg = { .l = { .nr = (int)ARRAY_SIZE(fc_list), + .p = fc_list } } + }; +- hw->mac.fc = FlowControl; +- pch_gbe_validate_option((int *)(&hw->mac.fc), +- &opt, adapter); ++ int tmp = FlowControl; ++ ++ pch_gbe_validate_option(&tmp, &opt, adapter); ++ hw->mac.fc = tmp; + } + + pch_gbe_check_copper_options(adapter); diff --git a/queue-3.0/pch_gbe-support-ml7831-ioh.patch b/queue-3.0/pch_gbe-support-ml7831-ioh.patch new file mode 100644 index 00000000000..76c73053925 --- /dev/null +++ b/queue-3.0/pch_gbe-support-ml7831-ioh.patch @@ -0,0 +1,78 @@ +From 7756332f5b64c9c1535712b9679792e8bd4f0019 Mon Sep 17 00:00:00 2001 +From: Toshiharu Okada +Date: Thu, 1 Sep 2011 14:20:09 +0000 +Subject: pch_gbe: support ML7831 IOH + +From: Toshiharu Okada + +commit 7756332f5b64c9c1535712b9679792e8bd4f0019 upstream. + +Support new device OKI SEMICONDUCTOR ML7831 IOH(Input/Output Hub) + +ML7831 is for general purpose use. +ML7831 is companion chip for Intel Atom E6xx series. +ML7831 is completely compatible for Intel EG20T PCH. + +Signed-off-by: Toshiharu Okada +Signed-off-by: David S. Miller +Signed-off-by: Tomoya MORINAGA +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/Kconfig | 11 ++++++----- + drivers/net/pch_gbe/pch_gbe_main.c | 10 ++++++++++ + 2 files changed, 16 insertions(+), 5 deletions(-) + +--- a/drivers/net/Kconfig ++++ b/drivers/net/Kconfig +@@ -2543,7 +2543,7 @@ config S6GMAC + source "drivers/net/stmmac/Kconfig" + + config PCH_GBE +- tristate "Intel EG20T PCH / OKI SEMICONDUCTOR ML7223 IOH GbE" ++ tristate "Intel EG20T PCH/OKI SEMICONDUCTOR IOH(ML7223/ML7831) GbE" + depends on PCI + select MII + ---help--- +@@ -2556,10 +2556,11 @@ config PCH_GBE + This driver enables Gigabit Ethernet function. + + This driver also can be used for OKI SEMICONDUCTOR IOH(Input/ +- Output Hub), ML7223. +- ML7223 IOH is for MP(Media Phone) use. +- ML7223 is companion chip for Intel Atom E6xx series. +- ML7223 is completely compatible for Intel EG20T PCH. ++ Output Hub), ML7223/ML7831. ++ ML7223 IOH is for MP(Media Phone) use. ML7831 IOH is for general ++ purpose use. ++ ML7223/ML7831 is companion chip for Intel Atom E6xx series. ++ ML7223/ML7831 is completely compatible for Intel EG20T PCH. + + endif # NETDEV_1000 + +--- a/drivers/net/pch_gbe/pch_gbe_main.c ++++ b/drivers/net/pch_gbe/pch_gbe_main.c +@@ -39,6 +39,9 @@ const char pch_driver_version[] = DRV_VE + #define PCI_VENDOR_ID_ROHM 0x10db + #define PCI_DEVICE_ID_ROHM_ML7223_GBE 0x8013 + ++/* Macros for ML7831 */ ++#define PCI_DEVICE_ID_ROHM_ML7831_GBE 0x8802 ++ + #define PCH_GBE_TX_WEIGHT 64 + #define PCH_GBE_RX_WEIGHT 64 + #define PCH_GBE_RX_BUFFER_WRITE 16 +@@ -2457,6 +2460,13 @@ static DEFINE_PCI_DEVICE_TABLE(pch_gbe_p + .subvendor = PCI_ANY_ID, + .subdevice = PCI_ANY_ID, + .class = (PCI_CLASS_NETWORK_ETHERNET << 8), ++ .class_mask = (0xFFFF00) ++ }, ++ {.vendor = PCI_VENDOR_ID_ROHM, ++ .device = PCI_DEVICE_ID_ROHM_ML7831_GBE, ++ .subvendor = PCI_ANY_ID, ++ .subdevice = PCI_ANY_ID, ++ .class = (PCI_CLASS_NETWORK_ETHERNET << 8), + .class_mask = (0xFFFF00) + }, + /* required last entry */ diff --git a/queue-3.0/pch_gpio-support-new-device-lapis-semiconductor-ml7831-ioh.patch b/queue-3.0/pch_gpio-support-new-device-lapis-semiconductor-ml7831-ioh.patch new file mode 100644 index 00000000000..fb36950593f --- /dev/null +++ b/queue-3.0/pch_gpio-support-new-device-lapis-semiconductor-ml7831-ioh.patch @@ -0,0 +1,59 @@ +From tomoya.rohm@gmail.com Fri May 18 12:54:19 2012 +From: Tomoya MORINAGA +Date: Tue, 15 May 2012 12:53:23 +0900 +Subject: pch_gpio: Support new device LAPIS Semiconductor ML7831 IOH +To: stable@vger.kernel.org +Cc: Tomoya MORINAGA , Grant Likely , Greg Kroah-Hartman +Message-ID: <1337054003-22009-1-git-send-email-tomoya.rohm@gmail.com> + +From: Tomoya MORINAGA + +commit 868fea0507308b6548bba7debe5f5c2d5ca47fca upstream. + +ML7831 is companion chip for Intel Atom E6xx series. + +Signed-off-by: Grant Likely +Signed-off-by: Tomoya MORINAGA +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpio/Kconfig | 11 ++++++----- + drivers/gpio/pch_gpio.c | 1 + + 2 files changed, 7 insertions(+), 5 deletions(-) + +--- a/drivers/gpio/Kconfig ++++ b/drivers/gpio/Kconfig +@@ -350,18 +350,19 @@ config GPIO_LANGWELL + Say Y here to support Intel Langwell/Penwell GPIO. + + config GPIO_PCH +- tristate "Intel EG20T PCH / OKI SEMICONDUCTOR ML7223 IOH GPIO" ++ tristate "Intel EG20T PCH/LAPIS Semiconductor IOH(ML7223/ML7831) GPIO" + depends on PCI && X86 + help + This driver is for PCH(Platform controller Hub) GPIO of Intel Topcliff + which is an IOH(Input/Output Hub) for x86 embedded processor. + This driver can access PCH GPIO device. + +- This driver also can be used for OKI SEMICONDUCTOR IOH(Input/ +- Output Hub), ML7223. ++ This driver also can be used for LAPIS Semiconductor IOH(Input/ ++ Output Hub), ML7223 and ML7831. + ML7223 IOH is for MP(Media Phone) use. +- ML7223 is companion chip for Intel Atom E6xx series. +- ML7223 is completely compatible for Intel EG20T PCH. ++ ML7831 IOH is for general purpose use. ++ ML7223/ML7831 is companion chip for Intel Atom E6xx series. ++ ML7223/ML7831 is completely compatible for Intel EG20T PCH. + + config GPIO_ML_IOH + tristate "OKI SEMICONDUCTOR ML7213 IOH GPIO support" +--- a/drivers/gpio/pch_gpio.c ++++ b/drivers/gpio/pch_gpio.c +@@ -287,6 +287,7 @@ static int pch_gpio_resume(struct pci_de + static DEFINE_PCI_DEVICE_TABLE(pch_gpio_pcidev_id) = { + { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8803) }, + { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8014) }, ++ { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8803) }, + { 0, } + }; + MODULE_DEVICE_TABLE(pci, pch_gpio_pcidev_id); diff --git a/queue-3.0/series b/queue-3.0/series index d09f9d44cce..04c640b1309 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -45,3 +45,10 @@ ext3-fix-error-handling-on-inode-bitmap-corruption.patch ext4-fix-error-handling-on-inode-bitmap-corruption.patch acpi-pm-add-sony-vaio-vpccw29fx-to-nonvs-blacklist.patch scsi-hpsa-add-irqf_shared-back-in-for-the-non-msi-x-interrupt-handler.patch +wake-up-s_wait_unfrozen-when-freeze_fs-fails.patch +pch_gpio-support-new-device-lapis-semiconductor-ml7831-ioh.patch +pch_gbe-fixed-the-issue-which-receives-an-unnecessary-packet.patch +pch_gbe-support-ml7831-ioh.patch +pch_gbe-fixed-the-issue-on-which-pc-was-frozen-when-link-was-downed.patch +pch_gbe-do-not-abort-probe-on-bad-mac.patch +pch_gbe-memory-corruption-calling-pch_gbe_validate_option.patch diff --git a/queue-3.0/wake-up-s_wait_unfrozen-when-freeze_fs-fails.patch b/queue-3.0/wake-up-s_wait_unfrozen-when-freeze_fs-fails.patch new file mode 100644 index 00000000000..2db60073b15 --- /dev/null +++ b/queue-3.0/wake-up-s_wait_unfrozen-when-freeze_fs-fails.patch @@ -0,0 +1,40 @@ +From e1616300a20c80396109c1cf013ba9a36055a3da Mon Sep 17 00:00:00 2001 +From: Kazuya Mio +Date: Thu, 1 Dec 2011 16:51:07 +0900 +Subject: wake up s_wait_unfrozen when ->freeze_fs fails + +From: Kazuya Mio + +commit e1616300a20c80396109c1cf013ba9a36055a3da upstream. + +dd slept infinitely when fsfeeze failed because of EIO. +To fix this problem, if ->freeze_fs fails, freeze_super() wakes up +the tasks waiting for the filesystem to become unfrozen. + +When s_frozen isn't SB_UNFROZEN in __generic_file_aio_write(), +the function sleeps until FITHAW ioctl wakes up s_wait_unfrozen. + +However, if ->freeze_fs fails, s_frozen is set to SB_UNFROZEN and then +freeze_super() returns an error number. In this case, FITHAW ioctl returns +EINVAL because s_frozen is already SB_UNFROZEN. There is no way to wake up +s_wait_unfrozen, so __generic_file_aio_write() sleeps infinitely. + +Signed-off-by: Kazuya Mio +Signed-off-by: Al Viro +Signed-off-by: Greg Kroah-Hartman + +--- + fs/super.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/fs/super.c ++++ b/fs/super.c +@@ -1009,6 +1009,8 @@ int freeze_super(struct super_block *sb) + printk(KERN_ERR + "VFS:Filesystem freeze failed\n"); + sb->s_frozen = SB_UNFROZEN; ++ smp_wmb(); ++ wake_up(&sb->s_wait_unfrozen); + deactivate_locked_super(sb); + return ret; + }