[kernel] r16489 - in dists/sid/linux-2.6/debian: . patches/bugfix/arm patches/series

Martin Michlmayr tbm at alioth.debian.org
Mon Oct 25 15:10:40 UTC 2010


Author: tbm
Date: Mon Oct 25 15:10:27 2010
New Revision: 16489

Log:
Kirkwood: reset PCIe unit on boot

Added:
   dists/sid/linux-2.6/debian/patches/bugfix/arm/kirkwood-reset-pcie-restrict.patch
   dists/sid/linux-2.6/debian/patches/bugfix/arm/kirkwood-reset-pcie.patch
Modified:
   dists/sid/linux-2.6/debian/changelog
   dists/sid/linux-2.6/debian/patches/series/27

Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog	Mon Oct 25 03:57:31 2010	(r16488)
+++ dists/sid/linux-2.6/debian/changelog	Mon Oct 25 15:10:27 2010	(r16489)
@@ -23,6 +23,10 @@
   * e1000e: Reset 82577/82578 PHY before first PHY register read
     (Closes: #601017)
 
+  [ Martin Michlmayr ]
+  * Kirkwood: reset PCIe unit on boot
+  * Kirkwood: restrict the scope of the PCIe reset workaround
+
  -- Ben Hutchings <ben at decadent.org.uk>  Tue, 19 Oct 2010 23:27:23 +0100
 
 linux-2.6 (2.6.32-26) unstable; urgency=high

Added: dists/sid/linux-2.6/debian/patches/bugfix/arm/kirkwood-reset-pcie-restrict.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/arm/kirkwood-reset-pcie-restrict.patch	Mon Oct 25 15:10:27 2010	(r16489)
@@ -0,0 +1,89 @@
+From: Nicolas Pitre <nico at fluxnic.net>
+Date: Thu, 21 Oct 2010 19:48:33 +0000 (-0400)
+Subject: [ARM] Kirkwood: restrict the scope of the PCIe reset workaround
+X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fnico%2Forion.git;a=commitdiff_plain;h=3924996bab2845bdf9a9d16ff7c20445de1ab55d
+
+[ARM] Kirkwood: restrict the scope of the PCIe reset workaround
+
+Commit 21f0ba90a447 "orion/kirkwood: reset PCIe unit on boot" made the
+reset of the PCIe unit unconditional.  While this may fix problems on some
+targets, this also causes problems on other targets.
+
+Saeed Bishara <saeed at marvell.com> said about the original problem: "We
+couln't pinpoint the root cause of this issue, actually we failed to
+reproduce that issue."
+
+So let's restrict the reset of the PCIe unit only to the target where
+the original problem was observed.
+
+Signed-off-by: Nicolas Pitre <nico at fluxnic.net>
+---
+
+diff --git a/arch/arm/mach-kirkwood/ts41x-setup.c b/arch/arm/mach-kirkwood/ts41x-setup.c
+index 2e14afe..6995199 100644
+--- a/arch/arm/mach-kirkwood/ts41x-setup.c
++++ b/arch/arm/mach-kirkwood/ts41x-setup.c
+@@ -33,6 +33,9 @@
+ #include "common.h"
+ #include "mpp.h"
+ 
++/* for the PCIe reset workaround */
++#include <plat/pcie.h>
++
+ #define QNAP_TS41X_JUMPER_JP1  45
+ 
+ /****************************************************************************
+@@ -239,8 +243,16 @@ static void __init qnap_ts41x_init(void)
+ 
+ static int __init ts41x_pci_init(void)
+ {
+-	if (machine_is_ts41x())
++	if (machine_is_ts41x()) {
++		/*
++		 * Without this explicit reset, the PCIe SATA controller
++		 * (Marvell 88sx7042/sata_mv) is known to stop working
++		 * after a few minutes.
++		 */
++		orion_pcie_reset((void __iomem *)PCIE_VIRT_BASE);
++
+ 		kirkwood_pcie_init(KW_PCIE0);
++	}
+ 
+    return 0;
+ }
+diff --git a/arch/arm/plat-orion/include/plat/pcie.h b/arch/arm/plat-orion/include/plat/pcie.h
+index 3ebfef7..cc99163 100644
+--- a/arch/arm/plat-orion/include/plat/pcie.h
++++ b/arch/arm/plat-orion/include/plat/pcie.h
+@@ -11,12 +11,15 @@
+ #ifndef __PLAT_PCIE_H
+ #define __PLAT_PCIE_H
+ 
++struct pci_bus;
++
+ u32 orion_pcie_dev_id(void __iomem *base);
+ u32 orion_pcie_rev(void __iomem *base);
+ int orion_pcie_link_up(void __iomem *base);
+ int orion_pcie_x4_mode(void __iomem *base);
+ int orion_pcie_get_local_bus_nr(void __iomem *base);
+ void orion_pcie_set_local_bus_nr(void __iomem *base, int nr);
++void orion_pcie_reset(void __iomem *base);
+ void orion_pcie_setup(void __iomem *base,
+ 		      struct mbus_dram_target_info *dram);
+ int orion_pcie_rd_conf(void __iomem *base, struct pci_bus *bus,
+diff --git a/arch/arm/plat-orion/pcie.c b/arch/arm/plat-orion/pcie.c
+index 779553a..af2d733 100644
+--- a/arch/arm/plat-orion/pcie.c
++++ b/arch/arm/plat-orion/pcie.c
+@@ -176,11 +176,6 @@ void __init orion_pcie_setup(void __iomem *base,
+ 	u32 mask;
+ 
+ 	/*
+-	 * soft reset PCIe unit
+-	 */
+-	orion_pcie_reset(base);
+-
+-	/*
+ 	 * Point PCIe unit MBUS decode windows to DRAM space.
+ 	 */
+ 	orion_pcie_setup_wins(base, dram);

Added: dists/sid/linux-2.6/debian/patches/bugfix/arm/kirkwood-reset-pcie.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ dists/sid/linux-2.6/debian/patches/bugfix/arm/kirkwood-reset-pcie.patch	Mon Oct 25 15:10:27 2010	(r16489)
@@ -0,0 +1,93 @@
+From: Olaf Rempel <razzor at kopf-tisch.de>
+Date: Tue, 8 Jun 2010 20:32:38 +0000 (+0200)
+Subject: [ARM] orion/kirkwood: reset PCIe unit on boot
+X-Git-Tag: v2.6.36-rc1~591^2^2~5^2~16
+X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=21f0ba90a447090153edeaf2f14f9f7e8bd9bc80
+
+[ARM] orion/kirkwood: reset PCIe unit on boot
+
+Patch found in QNAPs vendor source package, with some cleanups
+(proper defines, shortened max. timeout from 1s to 200ms).
+
+Without this patch the PCIe SATA controller (Marvell 88sx7042/sata_mv)
+in my QNAP TS-419P (Marvell 88f6281/Kirkwood) stops working after a
+few minutes.
+
+The symptomes are described in this thread:
+http://marc.info/?l=linux-ide&m=124822863706181&w=2
+
+[ Note: this is a workaround in need of a better analysis/solution -- NP ]
+
+Acked-by: Saeed Bishara <saeed at marvell.com>
+Tested-by: Bernhard R. Link <brl at pcpool00.mathematik.uni-freiburg.de>
+Seconded-by: Martin Michlmayr <tbm at cyrius.com>
+I'm_not_very_happy_with_it-by: Lennert Buytenhek <buytenh at wantstofly.org>
+Signed-off-by: Nicolas Pitre <nico at fluxnic.net>
+---
+
+diff --git a/arch/arm/plat-orion/pcie.c b/arch/arm/plat-orion/pcie.c
+index 54c84a4..779553a 100644
+--- a/arch/arm/plat-orion/pcie.c
++++ b/arch/arm/plat-orion/pcie.c
+@@ -13,6 +13,7 @@
+ #include <linux/mbus.h>
+ #include <asm/mach/pci.h>
+ #include <plat/pcie.h>
++#include <linux/delay.h>
+ 
+ /*
+  * PCIe unit register offsets.
+@@ -46,6 +47,8 @@
+ #define  PCIE_STAT_BUS_OFFS		8
+ #define  PCIE_STAT_BUS_MASK		0xff
+ #define  PCIE_STAT_LINK_DOWN		1
++#define PCIE_DEBUG_CTRL         0x1a60
++#define  PCIE_DEBUG_SOFT_RESET		(1<<20)
+ 
+ 
+ u32 __init orion_pcie_dev_id(void __iomem *base)
+@@ -85,6 +88,32 @@ void __init orion_pcie_set_local_bus_nr(void __iomem *base, int nr)
+ 	writel(stat, base + PCIE_STAT_OFF);
+ }
+ 
++void __init orion_pcie_reset(void __iomem *base)
++{
++	u32 reg;
++	int i;
++
++	/*
++	 * MV-S104860-U0, Rev. C:
++	 * PCI Express Unit Soft Reset
++	 * When set, generates an internal reset in the PCI Express unit.
++	 * This bit should be cleared after the link is re-established.
++	 */
++	reg = readl(base + PCIE_DEBUG_CTRL);
++	reg |= PCIE_DEBUG_SOFT_RESET;
++	writel(reg, base + PCIE_DEBUG_CTRL);
++
++	for (i = 0; i < 20; i++) {
++		mdelay(10);
++
++		if (orion_pcie_link_up(base))
++			break;
++	}
++
++	reg &= ~(PCIE_DEBUG_SOFT_RESET);
++	writel(reg, base + PCIE_DEBUG_CTRL);
++}
++
+ /*
+  * Setup PCIE BARs and Address Decode Wins:
+  * BAR[0,2] -> disabled, BAR[1] -> covers all DRAM banks
+@@ -147,6 +176,11 @@ void __init orion_pcie_setup(void __iomem *base,
+ 	u32 mask;
+ 
+ 	/*
++	 * soft reset PCIe unit
++	 */
++	orion_pcie_reset(base);
++
++	/*
+ 	 * Point PCIe unit MBUS decode windows to DRAM space.
+ 	 */
+ 	orion_pcie_setup_wins(base, dram);

Modified: dists/sid/linux-2.6/debian/patches/series/27
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/27	Mon Oct 25 03:57:31 2010	(r16488)
+++ dists/sid/linux-2.6/debian/patches/series/27	Mon Oct 25 15:10:27 2010	(r16489)
@@ -10,3 +10,5 @@
 + bugfix/all/stable/2.6.32.25-rc1.patch
 + features/all/btrfs-add-a-df-ioctl-for-btrfs.patch
 + bugfix/all/e1000e-Reset-82577+82578-PHY-before-first-PHY-register-read.patch
++ bugfix/arm/kirkwood-reset-pcie.patch
++ bugfix/arm/kirkwood-reset-pcie-restrict.patch



More information about the Kernel-svn-changes mailing list