LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 10/11] net/can/mscan: add error path to mscan_open()
From: Wolfram Sang @ 2009-11-16 22:57 UTC (permalink / raw)
  To: netdev; +Cc: socketcan-core, linuxppc-dev, David Miller
In-Reply-To: <1258412274-14686-1-git-send-email-w.sang@pengutronix.de>

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
---
 drivers/net/can/mscan/mscan.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/net/can/mscan/mscan.c b/drivers/net/can/mscan/mscan.c
index 263d1a9..bb06dfb 100644
--- a/drivers/net/can/mscan/mscan.c
+++ b/drivers/net/can/mscan/mscan.c
@@ -542,10 +542,8 @@ static int mscan_open(struct net_device *dev)
 
 	ret = request_irq(dev->irq, mscan_isr, 0, dev->name, dev);
 	if (ret < 0) {
-		napi_disable(&priv->napi);
-		printk(KERN_ERR "%s - failed to attach interrupt\n",
-		       dev->name);
-		return ret;
+		dev_err(dev->dev.parent, "failed to attach interrupt\n");
+		goto exit_napi_disable;
 	}
 
 	priv->open_time = jiffies;
@@ -554,11 +552,19 @@ static int mscan_open(struct net_device *dev)
 
 	ret = mscan_start(dev);
 	if (ret)
-		return ret;
+		goto exit_free_irq;
 
 	netif_start_queue(dev);
 
 	return 0;
+
+exit_free_irq:
+	priv->open_time = 0;
+	free_irq(dev->irq, dev);
+exit_napi_disable:
+	napi_disable(&priv->napi);
+	close_candev(dev);
+	return ret;
 }
 
 static int mscan_close(struct net_device *dev)
-- 
1.6.3.3

^ permalink raw reply related

* [PATCH 11/11] net/can/mscan: improve build
From: Wolfram Sang @ 2009-11-16 22:57 UTC (permalink / raw)
  To: netdev; +Cc: socketcan-core, linuxppc-dev, David Miller
In-Reply-To: <1258412274-14686-1-git-send-email-w.sang@pengutronix.de>

- move Kconfig entries to the subdirectory
- do remaining renames of mpc52xx to mpc5xxx

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
---
 drivers/net/can/Kconfig             |   19 +---
 drivers/net/can/mscan/Kconfig       |   23 +++
 drivers/net/can/mscan/Makefile      |    4 +-
 drivers/net/can/mscan/mpc52xx_can.c |  259 -----------------------------------
 drivers/net/can/mscan/mpc5xxx_can.c |  259 +++++++++++++++++++++++++++++++++++
 5 files changed, 285 insertions(+), 279 deletions(-)
 create mode 100644 drivers/net/can/mscan/Kconfig
 delete mode 100644 drivers/net/can/mscan/mpc52xx_can.c
 create mode 100644 drivers/net/can/mscan/mpc5xxx_can.c

diff --git a/drivers/net/can/Kconfig b/drivers/net/can/Kconfig
index c16e6ff..c1cfe2e 100644
--- a/drivers/net/can/Kconfig
+++ b/drivers/net/can/Kconfig
@@ -108,24 +108,7 @@ config CAN_MCP251X
 	---help---
 	  Driver for the Microchip MCP251x SPI CAN controllers.
 
-config CAN_MSCAN
-	depends on CAN_DEV && (PPC || M68K || M68KNOMMU)
-	tristate "Support for Freescale MSCAN based chips"
-	---help---
-	  The Motorola Scalable Controller Area Network (MSCAN) definition
-	  is based on the MSCAN12 definition which is the specific
-	  implementation of the Motorola Scalable CAN concept targeted for
-	  the Motorola MC68HC12 Microcontroller Family.
-
-config CAN_MPC52XX
-	tristate "Freescale MPC5xxx onboard CAN controller"
-	depends on CAN_MSCAN && PPC_MPC52xx
-	---help---
-	  If you say yes here you get support for Freescale's MPC52xx
-	  onboard dualCAN controller.
-
-	  This driver can also be built as a module.  If so, the module
-	  will be called mpc5xxx_can.
+source "drivers/net/can/mscan/Kconfig"
 
 config CAN_DEBUG_DEVICES
 	bool "CAN devices debugging messages"
diff --git a/drivers/net/can/mscan/Kconfig b/drivers/net/can/mscan/Kconfig
new file mode 100644
index 0000000..cd0f2d6
--- /dev/null
+++ b/drivers/net/can/mscan/Kconfig
@@ -0,0 +1,23 @@
+config CAN_MSCAN
+	depends on CAN_DEV && (PPC || M68K || M68KNOMMU)
+	tristate "Support for Freescale MSCAN based chips"
+	---help---
+	  The Motorola Scalable Controller Area Network (MSCAN) definition
+	  is based on the MSCAN12 definition which is the specific
+	  implementation of the Motorola Scalable CAN concept targeted for
+	  the Motorola MC68HC12 Microcontroller Family.
+
+if CAN_MSCAN
+
+config CAN_MPC5XXX
+	tristate "Freescale MPC5xxx onboard CAN controller"
+	depends on PPC_MPC52xx
+	---help---
+	  If you say yes here you get support for Freescale's MPC5xxx
+	  onboard CAN controller.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called mscan-mpc5xxx.ko.
+
+endif
+
diff --git a/drivers/net/can/mscan/Makefile b/drivers/net/can/mscan/Makefile
index 2bd9f04..c9fab17 100644
--- a/drivers/net/can/mscan/Makefile
+++ b/drivers/net/can/mscan/Makefile
@@ -1,5 +1,5 @@
 
-obj-$(CONFIG_CAN_MPC52XX)	+= mscan-mpc52xx.o
-mscan-mpc52xx-objs		:= mscan.o mpc52xx_can.o
+obj-$(CONFIG_CAN_MPC5XXX)	+= mscan-mpc5xxx.o
+mscan-mpc5xxx-objs		:= mscan.o mpc5xxx_can.o
 
 ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG
diff --git a/drivers/net/can/mscan/mpc52xx_can.c b/drivers/net/can/mscan/mpc52xx_can.c
deleted file mode 100644
index 1de6f63..0000000
--- a/drivers/net/can/mscan/mpc52xx_can.c
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * CAN bus driver for the Freescale MPC5xxx embedded CPU.
- *
- * Copyright (C) 2004-2005 Andrey Volkov <avolkov@varma-el.com>,
- *                         Varma Electronics Oy
- * Copyright (C) 2008-2009 Wolfgang Grandegger <wg@grandegger.com>
- * Copyright (C) 2009 Wolfram Sang, Pengutronix <w.sang@pengutronix.de>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the version 2 of the GNU General Public License
- * as published by the Free Software Foundation
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/interrupt.h>
-#include <linux/platform_device.h>
-#include <linux/netdevice.h>
-#include <linux/can.h>
-#include <linux/can/dev.h>
-#include <linux/of_platform.h>
-#include <sysdev/fsl_soc.h>
-#include <linux/io.h>
-#include <asm/mpc52xx.h>
-
-#include "mscan.h"
-
-#define DRV_NAME "mpc5xxx_can"
-
-static struct of_device_id mpc52xx_cdm_ids[] __devinitdata = {
-	{ .compatible = "fsl,mpc5200-cdm", },
-	{}
-};
-
-/*
- * Get frequency of the MSCAN clock source
- *
- * Either the oscillator clock (SYS_XTAL_IN) or the IP bus clock (IP_CLK)
- * can be selected. According to the MPC5200 user's manual, the oscillator
- * clock is the better choice as it has less jitter but due to a hardware
- * bug, it can not be selected for the old MPC5200 Rev. A chips.
- */
-
-static unsigned int  __devinit mpc52xx_can_clock_freq(struct of_device *of,
-						      int clock_src)
-{
-	unsigned int pvr;
-	struct mpc52xx_cdm  __iomem *cdm;
-	struct device_node *np_cdm;
-	unsigned int freq;
-	u32 val;
-
-	pvr = mfspr(SPRN_PVR);
-
-	freq = mpc5xxx_get_bus_frequency(of->node);
-	if (!freq)
-		return 0;
-
-	if (clock_src == MSCAN_CLKSRC_BUS || pvr == 0x80822011)
-		return freq;
-
-	/* Determine SYS_XTAL_IN frequency from the clock domain settings */
-	np_cdm = of_find_matching_node(NULL, mpc52xx_cdm_ids);
-	if (!np_cdm) {
-		dev_err(&of->dev, "can't get clock node!\n");
-		return 0;
-	}
-	cdm = of_iomap(np_cdm, 0);
-	of_node_put(np_cdm);
-
-	if (in_8(&cdm->ipb_clk_sel) & 0x1)
-		freq *= 2;
-	val = in_be32(&cdm->rstcfg);
-
-	freq *= (val & (1 << 5)) ? 8 : 4;
-	freq /= (val & (1 << 6)) ? 12 : 16;
-
-	iounmap(cdm);
-
-	return freq;
-}
-
-static int __devinit mpc5xxx_can_probe(struct of_device *ofdev,
-				       const struct of_device_id *id)
-{
-	struct device_node *np = ofdev->node;
-	struct net_device *dev;
-	struct mscan_priv *priv;
-	void __iomem *base;
-	const char *clk_src;
-	int err, irq, clock_src;
-
-	base = of_iomap(ofdev->node, 0);
-	if (!base) {
-		dev_err(&ofdev->dev, "couldn't ioremap\n");
-		err = -ENOMEM;
-		goto exit_release_mem;
-	}
-
-	irq = irq_of_parse_and_map(np, 0);
-	if (!irq) {
-		dev_err(&ofdev->dev, "no irq found\n");
-		err = -ENODEV;
-		goto exit_unmap_mem;
-	}
-
-	dev = alloc_mscandev();
-	if (!dev) {
-		err = -ENOMEM;
-		goto exit_dispose_irq;
-	}
-
-	priv = netdev_priv(dev);
-	priv->reg_base = base;
-	dev->irq = irq;
-
-	/*
-	 * Either the oscillator clock (SYS_XTAL_IN) or the IP bus clock
-	 * (IP_CLK) can be selected as MSCAN clock source. According to
-	 * the MPC5200 user's manual, the oscillator clock is the better
-	 * choice as it has less jitter. For this reason, it is selected
-	 * by default.
-	 */
-	clk_src = of_get_property(np, "fsl,mscan-clock-source", NULL);
-	if (clk_src && strcmp(clk_src, "ip") == 0)
-		clock_src = MSCAN_CLKSRC_BUS;
-	else
-		clock_src = MSCAN_CLKSRC_XTAL;
-	priv->can.clock.freq = mpc52xx_can_clock_freq(ofdev, clock_src);
-	if (!priv->can.clock.freq) {
-		dev_err(&ofdev->dev, "couldn't get MSCAN clock frequency\n");
-		err = -ENODEV;
-		goto exit_free_mscan;
-	}
-
-	SET_NETDEV_DEV(dev, &ofdev->dev);
-
-	err = register_mscandev(dev, clock_src);
-	if (err) {
-		dev_err(&ofdev->dev, "registering %s failed (err=%d)\n",
-			DRV_NAME, err);
-		goto exit_free_mscan;
-	}
-
-	dev_set_drvdata(&ofdev->dev, dev);
-
-	dev_info(&ofdev->dev, "MSCAN at 0x%p, irq %d, clock %d Hz\n",
-		 priv->reg_base, dev->irq, priv->can.clock.freq);
-
-	return 0;
-
-exit_free_mscan:
-	free_candev(dev);
-exit_dispose_irq:
-	irq_dispose_mapping(irq);
-exit_unmap_mem:
-	iounmap(base);
-exit_release_mem:
-	return err;
-}
-
-static int __devexit mpc5xxx_can_remove(struct of_device *ofdev)
-{
-	struct net_device *dev = dev_get_drvdata(&ofdev->dev);
-	struct mscan_priv *priv = netdev_priv(dev);
-
-	dev_set_drvdata(&ofdev->dev, NULL);
-
-	unregister_mscandev(dev);
-	iounmap(priv->reg_base);
-	irq_dispose_mapping(dev->irq);
-	free_candev(dev);
-
-	return 0;
-}
-
-#ifdef CONFIG_PM
-static struct mscan_regs saved_regs;
-static int mpc5xxx_can_suspend(struct of_device *ofdev, pm_message_t state)
-{
-	struct net_device *dev = dev_get_drvdata(&ofdev->dev);
-	struct mscan_priv *priv = netdev_priv(dev);
-	struct mscan_regs *regs = (struct mscan_regs *)priv->reg_base;
-
-	_memcpy_fromio(&saved_regs, regs, sizeof(*regs));
-
-	return 0;
-}
-
-static int mpc5xxx_can_resume(struct of_device *ofdev)
-{
-	struct net_device *dev = dev_get_drvdata(&ofdev->dev);
-	struct mscan_priv *priv = netdev_priv(dev);
-	struct mscan_regs *regs = (struct mscan_regs *)priv->reg_base;
-
-	regs->canctl0 |= MSCAN_INITRQ;
-	while (!(regs->canctl1 & MSCAN_INITAK))
-		udelay(10);
-
-	regs->canctl1 = saved_regs.canctl1;
-	regs->canbtr0 = saved_regs.canbtr0;
-	regs->canbtr1 = saved_regs.canbtr1;
-	regs->canidac = saved_regs.canidac;
-
-	/* restore masks, buffers etc. */
-	_memcpy_toio(&regs->canidar1_0, (void *)&saved_regs.canidar1_0,
-		     sizeof(*regs) - offsetof(struct mscan_regs, canidar1_0));
-
-	regs->canctl0 &= ~MSCAN_INITRQ;
-	regs->cantbsel = saved_regs.cantbsel;
-	regs->canrier = saved_regs.canrier;
-	regs->cantier = saved_regs.cantier;
-	regs->canctl0 = saved_regs.canctl0;
-
-	return 0;
-}
-#endif
-
-static struct of_device_id __devinitdata mpc5xxx_can_table[] = {
-	{.compatible = "fsl,mpc5200-mscan"},
-	{},
-};
-
-static struct of_platform_driver mpc5xxx_can_driver = {
-	.owner = THIS_MODULE,
-	.name = "mpc5xxx_can",
-	.probe = mpc5xxx_can_probe,
-	.remove = __devexit_p(mpc5xxx_can_remove),
-#ifdef CONFIG_PM
-	.suspend = mpc5xxx_can_suspend,
-	.resume = mpc5xxx_can_resume,
-#endif
-	.match_table = mpc5xxx_can_table,
-};
-
-static int __init mpc5xxx_can_init(void)
-{
-	return of_register_platform_driver(&mpc5xxx_can_driver);
-}
-module_init(mpc5xxx_can_init);
-
-static void __exit mpc5xxx_can_exit(void)
-{
-	return of_unregister_platform_driver(&mpc5xxx_can_driver);
-};
-module_exit(mpc5xxx_can_exit);
-
-MODULE_AUTHOR("Wolfgang Grandegger <wg@grandegger.com>");
-MODULE_DESCRIPTION("Freescale MPC5200 CAN driver");
-MODULE_LICENSE("GPL v2");
diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c
new file mode 100644
index 0000000..1de6f63
--- /dev/null
+++ b/drivers/net/can/mscan/mpc5xxx_can.c
@@ -0,0 +1,259 @@
+/*
+ * CAN bus driver for the Freescale MPC5xxx embedded CPU.
+ *
+ * Copyright (C) 2004-2005 Andrey Volkov <avolkov@varma-el.com>,
+ *                         Varma Electronics Oy
+ * Copyright (C) 2008-2009 Wolfgang Grandegger <wg@grandegger.com>
+ * Copyright (C) 2009 Wolfram Sang, Pengutronix <w.sang@pengutronix.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the version 2 of the GNU General Public License
+ * as published by the Free Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/interrupt.h>
+#include <linux/platform_device.h>
+#include <linux/netdevice.h>
+#include <linux/can.h>
+#include <linux/can/dev.h>
+#include <linux/of_platform.h>
+#include <sysdev/fsl_soc.h>
+#include <linux/io.h>
+#include <asm/mpc52xx.h>
+
+#include "mscan.h"
+
+#define DRV_NAME "mpc5xxx_can"
+
+static struct of_device_id mpc52xx_cdm_ids[] __devinitdata = {
+	{ .compatible = "fsl,mpc5200-cdm", },
+	{}
+};
+
+/*
+ * Get frequency of the MSCAN clock source
+ *
+ * Either the oscillator clock (SYS_XTAL_IN) or the IP bus clock (IP_CLK)
+ * can be selected. According to the MPC5200 user's manual, the oscillator
+ * clock is the better choice as it has less jitter but due to a hardware
+ * bug, it can not be selected for the old MPC5200 Rev. A chips.
+ */
+
+static unsigned int  __devinit mpc52xx_can_clock_freq(struct of_device *of,
+						      int clock_src)
+{
+	unsigned int pvr;
+	struct mpc52xx_cdm  __iomem *cdm;
+	struct device_node *np_cdm;
+	unsigned int freq;
+	u32 val;
+
+	pvr = mfspr(SPRN_PVR);
+
+	freq = mpc5xxx_get_bus_frequency(of->node);
+	if (!freq)
+		return 0;
+
+	if (clock_src == MSCAN_CLKSRC_BUS || pvr == 0x80822011)
+		return freq;
+
+	/* Determine SYS_XTAL_IN frequency from the clock domain settings */
+	np_cdm = of_find_matching_node(NULL, mpc52xx_cdm_ids);
+	if (!np_cdm) {
+		dev_err(&of->dev, "can't get clock node!\n");
+		return 0;
+	}
+	cdm = of_iomap(np_cdm, 0);
+	of_node_put(np_cdm);
+
+	if (in_8(&cdm->ipb_clk_sel) & 0x1)
+		freq *= 2;
+	val = in_be32(&cdm->rstcfg);
+
+	freq *= (val & (1 << 5)) ? 8 : 4;
+	freq /= (val & (1 << 6)) ? 12 : 16;
+
+	iounmap(cdm);
+
+	return freq;
+}
+
+static int __devinit mpc5xxx_can_probe(struct of_device *ofdev,
+				       const struct of_device_id *id)
+{
+	struct device_node *np = ofdev->node;
+	struct net_device *dev;
+	struct mscan_priv *priv;
+	void __iomem *base;
+	const char *clk_src;
+	int err, irq, clock_src;
+
+	base = of_iomap(ofdev->node, 0);
+	if (!base) {
+		dev_err(&ofdev->dev, "couldn't ioremap\n");
+		err = -ENOMEM;
+		goto exit_release_mem;
+	}
+
+	irq = irq_of_parse_and_map(np, 0);
+	if (!irq) {
+		dev_err(&ofdev->dev, "no irq found\n");
+		err = -ENODEV;
+		goto exit_unmap_mem;
+	}
+
+	dev = alloc_mscandev();
+	if (!dev) {
+		err = -ENOMEM;
+		goto exit_dispose_irq;
+	}
+
+	priv = netdev_priv(dev);
+	priv->reg_base = base;
+	dev->irq = irq;
+
+	/*
+	 * Either the oscillator clock (SYS_XTAL_IN) or the IP bus clock
+	 * (IP_CLK) can be selected as MSCAN clock source. According to
+	 * the MPC5200 user's manual, the oscillator clock is the better
+	 * choice as it has less jitter. For this reason, it is selected
+	 * by default.
+	 */
+	clk_src = of_get_property(np, "fsl,mscan-clock-source", NULL);
+	if (clk_src && strcmp(clk_src, "ip") == 0)
+		clock_src = MSCAN_CLKSRC_BUS;
+	else
+		clock_src = MSCAN_CLKSRC_XTAL;
+	priv->can.clock.freq = mpc52xx_can_clock_freq(ofdev, clock_src);
+	if (!priv->can.clock.freq) {
+		dev_err(&ofdev->dev, "couldn't get MSCAN clock frequency\n");
+		err = -ENODEV;
+		goto exit_free_mscan;
+	}
+
+	SET_NETDEV_DEV(dev, &ofdev->dev);
+
+	err = register_mscandev(dev, clock_src);
+	if (err) {
+		dev_err(&ofdev->dev, "registering %s failed (err=%d)\n",
+			DRV_NAME, err);
+		goto exit_free_mscan;
+	}
+
+	dev_set_drvdata(&ofdev->dev, dev);
+
+	dev_info(&ofdev->dev, "MSCAN at 0x%p, irq %d, clock %d Hz\n",
+		 priv->reg_base, dev->irq, priv->can.clock.freq);
+
+	return 0;
+
+exit_free_mscan:
+	free_candev(dev);
+exit_dispose_irq:
+	irq_dispose_mapping(irq);
+exit_unmap_mem:
+	iounmap(base);
+exit_release_mem:
+	return err;
+}
+
+static int __devexit mpc5xxx_can_remove(struct of_device *ofdev)
+{
+	struct net_device *dev = dev_get_drvdata(&ofdev->dev);
+	struct mscan_priv *priv = netdev_priv(dev);
+
+	dev_set_drvdata(&ofdev->dev, NULL);
+
+	unregister_mscandev(dev);
+	iounmap(priv->reg_base);
+	irq_dispose_mapping(dev->irq);
+	free_candev(dev);
+
+	return 0;
+}
+
+#ifdef CONFIG_PM
+static struct mscan_regs saved_regs;
+static int mpc5xxx_can_suspend(struct of_device *ofdev, pm_message_t state)
+{
+	struct net_device *dev = dev_get_drvdata(&ofdev->dev);
+	struct mscan_priv *priv = netdev_priv(dev);
+	struct mscan_regs *regs = (struct mscan_regs *)priv->reg_base;
+
+	_memcpy_fromio(&saved_regs, regs, sizeof(*regs));
+
+	return 0;
+}
+
+static int mpc5xxx_can_resume(struct of_device *ofdev)
+{
+	struct net_device *dev = dev_get_drvdata(&ofdev->dev);
+	struct mscan_priv *priv = netdev_priv(dev);
+	struct mscan_regs *regs = (struct mscan_regs *)priv->reg_base;
+
+	regs->canctl0 |= MSCAN_INITRQ;
+	while (!(regs->canctl1 & MSCAN_INITAK))
+		udelay(10);
+
+	regs->canctl1 = saved_regs.canctl1;
+	regs->canbtr0 = saved_regs.canbtr0;
+	regs->canbtr1 = saved_regs.canbtr1;
+	regs->canidac = saved_regs.canidac;
+
+	/* restore masks, buffers etc. */
+	_memcpy_toio(&regs->canidar1_0, (void *)&saved_regs.canidar1_0,
+		     sizeof(*regs) - offsetof(struct mscan_regs, canidar1_0));
+
+	regs->canctl0 &= ~MSCAN_INITRQ;
+	regs->cantbsel = saved_regs.cantbsel;
+	regs->canrier = saved_regs.canrier;
+	regs->cantier = saved_regs.cantier;
+	regs->canctl0 = saved_regs.canctl0;
+
+	return 0;
+}
+#endif
+
+static struct of_device_id __devinitdata mpc5xxx_can_table[] = {
+	{.compatible = "fsl,mpc5200-mscan"},
+	{},
+};
+
+static struct of_platform_driver mpc5xxx_can_driver = {
+	.owner = THIS_MODULE,
+	.name = "mpc5xxx_can",
+	.probe = mpc5xxx_can_probe,
+	.remove = __devexit_p(mpc5xxx_can_remove),
+#ifdef CONFIG_PM
+	.suspend = mpc5xxx_can_suspend,
+	.resume = mpc5xxx_can_resume,
+#endif
+	.match_table = mpc5xxx_can_table,
+};
+
+static int __init mpc5xxx_can_init(void)
+{
+	return of_register_platform_driver(&mpc5xxx_can_driver);
+}
+module_init(mpc5xxx_can_init);
+
+static void __exit mpc5xxx_can_exit(void)
+{
+	return of_unregister_platform_driver(&mpc5xxx_can_driver);
+};
+module_exit(mpc5xxx_can_exit);
+
+MODULE_AUTHOR("Wolfgang Grandegger <wg@grandegger.com>");
+MODULE_DESCRIPTION("Freescale MPC5200 CAN driver");
+MODULE_LICENSE("GPL v2");
-- 
1.6.3.3

^ permalink raw reply related

* Re: [PATCH 00/10] Fix 8xx MMU/TLB
From: Scott Wood @ 2009-11-17  0:40 UTC (permalink / raw)
  To: Joakim Tjernlund; +Cc: linuxppc-dev@ozlabs.org, Rex Feany
In-Reply-To: <OF8A8D1539.83855DA3-ONC1257670.007D4AD1-C1257670.007DC74A@transmode.se>

Joakim Tjernlund wrote:
> Scott Wood <scottwood@freescale.com> wrote on 16/11/2009 22:27:41:
>> On Mon, Nov 16, 2009 at 03:00:09PM -0600, Scott Wood wrote:
>>> On Sun, Nov 15, 2009 at 06:09:27PM +0100, Joakim Tjernlund wrote:
>>>> [I used the wrong branch, this will hopefully not conflict]
>>>>
>>>> This is hopfully the last iteration of the series.
>>>> Rex & Scott, please test and signoff.
>>>> Changes since last version:
>>>>  - Added mandatory pinning of iTLB
>>>>  - Added "DTLB Miss cleanup"
>>> I still get the EFAULTs.
> 
> umm, this worked before this series with your own
> version, right?

No...  I only meant that the ITLB pinning got rid of the boot hang.

When I mentioned the EFAULTs before you said, "No surprise as the it 
seems like the DAR decoding is broken."  I thought you meant you'd found 
a bug and fixed it in this respin.

> Did I screw up with the  "DTLB Miss cleanup"?

No change if I remove that patch.

> Does the self modifying code version work any better?

No change.

-Scott

^ permalink raw reply

* Re: [PATCH 10/13] mac68k: start CUDA early
From: Benjamin Herrenschmidt @ 2009-11-17  2:03 UTC (permalink / raw)
  To: Finn Thain; +Cc: linuxppc-dev, linux-m68k, Geert Uytterhoeven
In-Reply-To: <alpine.OSX.2.00.0911031502250.483@silk.local>

On Wed, 2009-11-04 at 00:46 +1100, Finn Thain wrote:
> The valkyriefb driver needs the CUDA to work in order to set the video 
> mode at boot. Initialising the device earlier, and bring the m68k code 
> closer to the powermac code.
> 
> Signed-off-by: Finn Thain <fthain@telegraphics.com.au>

Hi Finn !

> @@ -224,20 +249,9 @@ cuda_probe(void)
>  static int __init
>  cuda_init(void)
>  {
> -#ifdef CONFIG_PPC
>      if (via == NULL)
>  	return -ENODEV;
>      return 0;
> -#else 
> -    int err = cuda_init_via();
> -    if (err) {
> -	printk(KERN_ERR "cuda_init_via() failed\n");
> -	return -ENODEV;
> -    }
> -    out_8(&via[IER], IER_SET|SR_INT); /* enable interrupt from SR */
> -
> -    return via_cuda_start();
> -#endif
>  }
>  #endif /* CONFIG_ADB */

Can't we just get rid of cuda_init() completely ?
 
> @@ -430,9 +444,12 @@ cuda_poll(void)
>      /* cuda_interrupt only takes a normal lock, we disable
>       * interrupts here to avoid re-entering and thus deadlocking.
>       */
> -    disable_irq(cuda_irq);
> -    cuda_interrupt(0, NULL);
> -    enable_irq(cuda_irq);
> +    if (cuda_fully_inited) {
> +	disable_irq(cuda_irq);
> +	cuda_interrupt(0, NULL);
> +	enable_irq(cuda_irq);
> +    } else
> +	cuda_interrupt(0, NULL);
>  }

Wouldn't it be better that way ?

	if (cuda_irq)
		disable_irq(cuda_irq);
	cuda_interrupt(0, NULL);
	if (cuda_irq)
		enable_irq(cuda_irq);

Cheers,
Ben.

^ permalink raw reply

* Re: [PATCH 3/13] pmac-zilog: cleanup
From: Benjamin Herrenschmidt @ 2009-11-17  2:07 UTC (permalink / raw)
  To: Finn Thain; +Cc: linuxppc-dev, linux-m68k, Geert Uytterhoeven
In-Reply-To: <alpine.OSX.2.00.0911031441280.483@silk.local>

On Wed, 2009-11-04 at 00:40 +1100, Finn Thain wrote:
> Whitespace cleanups and comment typo fix.
> 
> Signed-off-by: Finn Thain <fthain@telegraphics.com.au>

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Hi Finn. Do you want me to carry and merge those patches via the powerpc
tree ?

Cheers,
Ben.

^ permalink raw reply

* Re: [PATCH 4/13] pmac-zilog, mac68k: replace mac68k SCC code with platform device
From: Benjamin Herrenschmidt @ 2009-11-17  2:10 UTC (permalink / raw)
  To: Finn Thain; +Cc: linuxppc-dev, linux-m68k, Geert Uytterhoeven
In-Reply-To: <alpine.OSX.2.00.0911031442360.483@silk.local>

On Wed, 2009-11-04 at 00:40 +1100, Finn Thain wrote:
> Remove the old 68k Mac serial port code and a lot of related cruft. Add 
> platform driver support to the pmac-zilog driver, putting the powermac- 
> specific bits inside #ifdef CONFIG_PPC_PMAC. Add new platform devices to 
> mac68k.
> 
> Tested on a beige G3 PowerMac and a variety of 68k Macs.
> 
> Signed-off-by: Finn Thain <fthain@telegraphics.com.au>

Can you split that patch into one that adds the pmac_zilog bit, and a
separate one that then removes the old m68k stuff ?

Cheers,
Ben.

^ permalink raw reply

* Re: [PATCH] sata_fsl: Split hard and soft reset
From: Jeff Garzik @ 2009-11-17  3:42 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linux-ide, linux-ppc list, Ashish Kalra, Jiang Yutang
In-Reply-To: <795A2621-9D6C-4D1F-B07B-24E15C55B03F@kernel.crashing.org>

On 11/05/2009 10:02 AM, Kumar Gala wrote:
>
> On Oct 16, 2009, at 11:44 AM, Anton Vorontsov wrote:
>
>> From: Jiang Yutang <b14898@freescale.com>
>>
>> Split sata_fsl_softreset() into hard and soft resets to make
>> error-handling more efficient & device and PMP detection more
>> reliable.
>>
>> Also includes fix for PMP support, driver tested with Sil3726,
>> Sil4726 & Exar PMP controllers.
>>
>> [AV: Also fixes resuming from deep sleep on MPC8315 CPUs]
>>
>> Signed-off-by: Jiang Yutang <b14898@freescale.com>
>> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
>> ---
>> drivers/ata/sata_fsl.c | 84
>> +++++++++++++++++++++++++-----------------------
>> 1 files changed, 44 insertions(+), 40 deletions(-)
>
> Jeff,
>
> any update on this going in for .32?

It seems I missed this, and an SNotification patch for sata_fsl as well 
(Bart noticed the latter)...

Will push, probably tomorrow...

	Jeff

^ permalink raw reply

* Re: [PATCH 1/1] ata/sata_sil24: MSI support, disabled by default
From: Jeff Garzik @ 2009-11-17  3:19 UTC (permalink / raw)
  To: Vivek Mahajan; +Cc: linux-ide, linuxppc-dev
In-Reply-To: <1258352362-11231-1-git-send-email-vivek.mahajan@freescale.com>

On 11/16/2009 01:19 AM, Vivek Mahajan wrote:
> The following patch adds MSI support. Some platforms
> may have broken MSI, so those are defaulted to use
> legacy PCI interrupts.
>
> Signed-off-by: Vivek Mahajan<vivek.mahajan@freescale.com>
> ---
>   drivers/ata/sata_sil24.c |    9 +++++++++
>   1 files changed, 9 insertions(+), 0 deletions(-)

applied

^ permalink raw reply

* Re: [PATCH 3/13] pmac-zilog: cleanup
From: Finn Thain @ 2009-11-17  4:58 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, linux-m68k, Geert Uytterhoeven
In-Reply-To: <1258423668.2140.557.camel@pasglop>

Hi Ben,

On Tue, 17 Nov 2009, Benjamin Herrenschmidt wrote:

> On Wed, 2009-11-04 at 00:40 +1100, Finn Thain wrote:
> > Whitespace cleanups and comment typo fix.
> > 
> > Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
> 
> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> 
> Hi Finn. Do you want me to carry and merge those patches via the powerpc 
> tree ?

The CUDA changes are probably detrimental without the macfb changes. The 
m68k side of the pmac-zilog patch won't apply without a patch earlier in 
the series, and the pmac-zilog changes as a whole are no use without that.
So I think it is best if Geert merges them with your acked-by, once they 
pass review.

Finn

> 
> Cheers,
> Ben.
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-m68k" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

^ permalink raw reply

* Re: [powerpc] Next tree Nov 2 : kernel BUG at mm/mmap.c:2135!
From: David Gibson @ 2009-11-17  5:25 UTC (permalink / raw)
  To: Sachin Sant; +Cc: Linux/PPC Development, linux-next, Stephen Rothwell
In-Reply-To: <4AFD2865.5090503@in.ibm.com>

On Fri, Nov 13, 2009 at 03:05:33PM +0530, Sachin Sant wrote:
> David Gibson wrote:
> >so, could you try booting the kernel with the patch below, which
> >should give a bit more information about the problem.
> >
> >Index: working-2.6/mm/mmap.c
> >===================================================================
> >--- working-2.6.orig/mm/mmap.c	2009-11-13 13:08:29.000000000 +1100
> >+++ working-2.6/mm/mmap.c	2009-11-13 13:09:26.000000000 +1100
> >@@ -2136,6 +2136,8 @@ void exit_mmap(struct mm_struct *mm)
> > 	while (vma)
> > 		vma = remove_vma(vma);
> >
> >+	if (nr_ptes != 0)
> >+		printk("exit_mmap(): mm %p nr_ptes %d\n", mm, mm->nr_ptes);
> > 	BUG_ON(mm->nr_ptes > (FIRST_USER_ADDRESS+PMD_SIZE-1)>>PMD_SHIFT);
> > }
> Here is the information collected with today's next.
> (2.6.32-rc7-20091113)
> 
> ------------[ cut here ]------------
> kernel BUG at mm/mmap.c:2139!
> cpu 0x3: Vector: 700 (Program Check) at [c0000000fae1b7e0]
>    pc: c000000000150e88: .exit_mmap+0x1ac/0x1d4
>    lr: c000000000150e78: .exit_mmap+0x19c/0x1d4
>    sp: c0000000fae1ba60
>   msr: 8000000000029032
>  current = 0xc0000000fada8be0
>  paca    = 0xc000000000bb2c00
>    pid   = 84, comm = cat
> kernel BUG at mm/mmap.c:2139!
> enter ? for help
> [c0000000fae1bb10] c000000000093d24 .mmput+0x54/0x164
> [c0000000fae1bba0] c000000000098f30 .exit_mm+0x17c/0x1a0
> [c0000000fae1bc50] c00000000009b310 .do_exit+0x248/0x784
> [c0000000fae1bd30] c00000000009b900 .do_group_exit+0xb4/0xe8
> [c0000000fae1bdc0] c00000000009b948 .SyS_exit_group+0x14/0x28
> [c0000000fae1be30] c0000000000085b4 syscall_exit+0x0/0x40
> --- Exception: c01 (System Call) at 00000fff89a8ff40
> SP (fffdf8a2460) is in userspace
> 
> Have attached the complete boot log.
> 
> At the time of crash values of mm and mm->nr_ptes were
> 
> <7>exit_mmap(): mm c0000000fa9f9580 nr_ptes 1

Hrm.  Ok.  I am truly baffled.  Well, below is a revised debug patch
which I hope will shed some sort of light on things.  I do also notice
from your full log that it looks like the bug is happening shortly
after we start userspace.  So it may be differences in my userspace
set up that meant I haven't been able to reproduce it.  I'll have
another look at that when I get a chance.

Index: working-2.6/mm/mmap.c
===================================================================
--- working-2.6.orig/mm/mmap.c	2009-11-17 11:55:23.000000000 +1100
+++ working-2.6/mm/mmap.c	2009-11-17 16:04:48.182600029 +1100
@@ -2136,6 +2136,9 @@ void exit_mmap(struct mm_struct *mm)
 	while (vma)
 		vma = remove_vma(vma);
 
+	if (mm->nr_ptes != 0)
+		printk("exit_mmap(): mm %p nr_ptes %d current %p pid %d comm \"%s\"\n",
+		       mm, mm->nr_ptes, current, current->pid, current->comm);
 	BUG_ON(mm->nr_ptes > (FIRST_USER_ADDRESS+PMD_SIZE-1)>>PMD_SHIFT);
 }
 
Index: working-2.6/mm/memory.c
===================================================================
--- working-2.6.orig/mm/memory.c	2009-11-17 11:55:23.000000000 +1100
+++ working-2.6/mm/memory.c	2009-11-17 14:57:49.881603609 +1100
@@ -156,6 +156,8 @@ static void free_pte_range(struct mmu_ga
 	pmd_clear(pmd);
 	pte_free_tlb(tlb, token, addr);
 	tlb->mm->nr_ptes--;
+	printk("free_pte_range() -> mm %p addr 0x%lx nr_ptes %d\n", tlb->mm,
+	       addr, tlb->mm->nr_ptes);
 }
 
 static inline void free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
@@ -348,6 +350,8 @@ int __pte_alloc(struct mm_struct *mm, pm
 	spin_lock(&mm->page_table_lock);
 	if (!pmd_present(*pmd)) {	/* Has another populated it ? */
 		mm->nr_ptes++;
+		printk("__pte_alloc() -> mm %p addr 0x%lx nr_ptes %d\n", mm,
+		       address, mm->nr_ptes);
 		pmd_populate(mm, pmd, new);
 		new = NULL;
 	}


-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply

* RE: [PATCH 1/1] ata/sata_sil24: MSI support, disabled by default
From: Mahajan Vivek-B08308 @ 2009-11-17  6:59 UTC (permalink / raw)
  To: Grant Grundler; +Cc: linux-ide, linuxppc-dev
In-Reply-To: <da824cf30911160937l38651a44sc25a3315efd24aea@mail.gmail.com>

> From: Grant Grundler [mailto:grundler@google.com]=20
> Sent: Monday, November 16, 2009 11:08 PM
> > +static int sata_sil24_msi; =A0 =A0/* Disable MSI */=20
> > +module_param_named(msi, sata_sil24_msi, bool, S_IRUGO);=20
> > +MODULE_PARM_DESC(msi, "Enable MSI (Default: false)");
>=20
> Vivek,
> Do we even still need the parameter? I'm thinking either MSI=20
> works with a chipset or it doesn't. The kernel has globals to=20
> "know" which state is true.

Sometimes even in a platform, some PCIe endpoints do very=20
well with MSI while others may have to resort to legacy ints.=20
Should we let the endpoints make the final call.

>=20
> If the parameter is needed, when this driver is compiled into=20
> the kernel, how is "msi" parameter specified?
> I think the parameter needs to be documented and fit in with=20
> other "msi" parameters.
> See "nomsi" in Documentation/kernel-parameters.txt.

In this case "msi" is supposed to be passed via insmod and=20
not via kernel cmdline. If the driver is built-in the kernel,=20
then force sata_sil24_msi =3D 1 in the driver to enable it.

>=20
> If you want to keep this module parameter, can I suggest=20
> calling the exported parameter "sata_sil24_msi"?
>=20

Will do it in the subsequent patch.

> pci_intx() isn't documented in MSI-HOWTO.txt  - because it's=20
> already called:
>     pci_msi_enable() -> pci_msi_enable_block() ->=20
> msi_capability_init()
>        -> pci_intx_for_msi(dev, 0) -> pci_intx(pdev, 0);
>=20
> (thanks to willy (Mathew Wilcox) for pointing me at
> msi_capability_init() - I overlooked it)
>=20
> Please add "Reviewed-by: Grant Grundler=20
> <grundler@google.com>" once the variable name is changed and=20
> the pci_intx() call is removed.

Will take care in the upcoming patch

>=20
> cheers,
> grant

Thanks,
Vivek
=20

^ permalink raw reply

* [RFC] powerpc/mm: honor O_SYNC flag for memory map
From: Li Yang @ 2009-11-17  7:10 UTC (permalink / raw)
  To: linuxppc-dev, benh

Rather than the original intelligent way, we grant user more freedom.
This enables user to map cacheable memory not managed by Linux.

Signed-off-by: Li Yang <leoli@freescale.com>
---
The only direct users of this function is fb_mmap() and /dev/mem mmap.
Although I'm not sure if anything is depending on the intelligent setting of
cacheability.

 arch/powerpc/mm/mem.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 579382c..0fd267e 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -101,7 +101,7 @@ pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn,
 	if (ppc_md.phys_mem_access_prot)
 		return ppc_md.phys_mem_access_prot(file, pfn, size, vma_prot);
 
-	if (!page_is_ram(pfn))
+	if (file->f_flags & O_SYNC)
 		vma_prot = pgprot_noncached(vma_prot);
 
 	return vma_prot;
-- 
1.6.4

^ permalink raw reply related

* [PATCH 1/1] sata_sil24: MSI support cleanup
From: Vivek Mahajan @ 2009-11-17  7:31 UTC (permalink / raw)
  To: linux-ide; +Cc: linuxppc-dev, Vivek Mahajan

Grant Grundler suggested the following cleanup:

* Rename module param 'msi' to 'sata_sil24_msi'
* Remove pci_intx() as pci_enable_msi() internally
  takes care of it.

Reviewed-by: Grant Grundler <grundler@google.com>
Signed-off-by: Vivek Mahajan <vivek.mahajan@freescale.com>
---
 drivers/ata/sata_sil24.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index 1370df6..783d8c7 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -417,9 +417,9 @@ static struct ata_port_operations sil24_ops = {
 #endif
 };
 
-static int sata_sil24_msi;    /* Disable MSI */
-module_param_named(msi, sata_sil24_msi, bool, S_IRUGO);
-MODULE_PARM_DESC(msi, "Enable MSI (Default: false)");
+static int modparam_sata_sil24_msi;    /* Disable MSI */
+module_param_named(sata_sil24_msi, modparam_sata_sil24_msi, bool, S_IRUGO);
+MODULE_PARM_DESC(sata_sil24_msi, "Enable MSI (default: false)");
 
 /*
  * Use bits 30-31 of port_flags to encode available port numbers.
@@ -1344,10 +1344,8 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	sil24_init_controller(host);
 
-	if (sata_sil24_msi && !pci_enable_msi(pdev)) {
+	if (modparam_sata_sil24_msi && !pci_enable_msi(pdev))
 		dev_printk(KERN_INFO, &pdev->dev, "Using MSI\n");
-		pci_intx(pdev, 0);
-	}
 
 	pci_set_master(pdev);
 	return ata_host_activate(host, pdev->irq, sil24_interrupt, IRQF_SHARED,
-- 
1.5.6.5

^ permalink raw reply related

* Re: [powerpc] Next tree Nov 2 : kernel BUG at mm/mmap.c:2135!
From: Sachin Sant @ 2009-11-17  7:37 UTC (permalink / raw)
  To: dwg; +Cc: Linux/PPC Development, linux-next
In-Reply-To: <20091117052542.GB2576@yookeroo>

[-- Attachment #1: Type: text/plain, Size: 819 bytes --]

David Gibson wrote:
> Hrm.  Ok.  I am truly baffled.  Well, below is a revised debug patch
> which I hope will shed some sort of light on things.  I do also notice
>   
Thanks for the debug patch. I have attached the collected information.

> from your full log that it looks like the bug is happening shortly
> after we start userspace.  So it may be differences in my userspace
> set up that meant I haven't been able to reproduce it.  I'll have
> another look at that when I get a chance.
>   
Let me know if you need access to the system on which i can recreate the
bug. I can make that system available for you to debug this issue.

Thanks
-Sachin

-- 

---------------------------------
Sachin Sant
IBM Linux Technology Center
India Systems and Technology Labs
Bangalore, India
---------------------------------


[-- Attachment #2: dmesg-log --]
[-- Type: text/plain, Size: 26598 bytes --]

------------[ cut here ]------------
kernel BUG at mm/mmap.c:2142!
cpu 0x3: Vector: 700 (Program Check) at [c0000000fae2b7e0]
    pc: c0000000001510d0: .exit_mmap+0x1dc/0x204
    lr: c0000000001510c0: .exit_mmap+0x1cc/0x204
    sp: c0000000fae2ba60
   msr: 8000000000029032
  current = 0xc0000000fad98be0
  paca    = 0xc000000000bb2c00
    pid   = 84, comm = cat
kernel BUG at mm/mmap.c:2142!
enter ? for help
[c0000000fae2bb10] c000000000093e28 .mmput+0x54/0x164
[c0000000fae2bba0] c000000000099034 .exit_mm+0x17c/0x1a0
[c0000000fae2bc50] c00000000009b414 .do_exit+0x248/0x784
[c0000000fae2bd30] c00000000009ba04 .do_group_exit+0xb4/0xe8
[c0000000fae2bdc0] c00000000009ba4c .SyS_exit_group+0x14/0x28
[c0000000fae2be30] c0000000000085b4 syscall_exit+0x0/0x40
--- Exception: c01 (System Call) at 00000fff9604ff40
SP (fffed84bae0) is in userspace
3:mon> dl
<4>Crash kernel location must be 0x2000000
<6>Reserving 256MB of memory at 32MB for crashkernel (System RAM: 4096MB)
<6>Using pSeries machine description
<7>Page orders: linear mapping = 24, virtual = 16, io = 12
<6>Using 1TB segments
<4>Found initrd at 0xc0000000034d0000:0xc000000003cf89c1
<6>bootconsole [udbg0] enabled
<6>Partition configured for 4 cpus.
<6>CPU maps initialized for 2 threads per core
<7> (thread shift is 1)
<4>Starting Linux PPC64 #6 SMP Tue Nov 17 12:51:36 IST 2009
<4>-----------------------------------------------------
<4>ppc64_pft_size                = 0x1a
<4>physicalMemorySize            = 0x100000000
<4>htab_hash_mask                = 0x7ffff
<4>-----------------------------------------------------
<6>Initializing cgroup subsys cpuset
<6>Initializing cgroup subsys cpu
<5>Linux version 2.6.32-rc7-next-20091116 (root@llm62) (gcc version 4.3.2 [gcc-4_3-branch revision 141291] (SUSE Linux) ) #6 SMP Tue Nov 17 12:51:36 IST 2009
<4>[boot]0012 Setup Arch
<7>Node 0 Memory:
<7>Node 1 Memory: 0x0-0x100000000
<4>EEH: No capable adapters found
<6>PPC64 nvram contains 15360 bytes
<7>Using shared processor idle loop
<4>Zone PFN ranges:
<4>  DMA      0x00000000 -> 0x00010000
<4>  Normal   0x00010000 -> 0x00010000
<4>Movable zone start PFN for each node
<4>early_node_map[1] active PFN ranges
<4>    1: 0x00000000 -> 0x00010000
<4>Could not find start_pfn for node 0
<7>On node 0 totalpages: 0
<7>On node 1 totalpages: 65536
<7>  DMA zone: 56 pages used for memmap
<7>  DMA zone: 0 pages reserved
<7>  DMA zone: 65480 pages, LIFO batch:1
<4>[boot]0015 Setup Done
<6>PERCPU: Embedded 2 pages/cpu @c000000000f00000 s89000 r0 d42072 u262144
<6>pcpu-alloc: s89000 r0 d42072 u262144 alloc=1*1048576
<6>pcpu-alloc: [0] 0 1 2 3 
<4>Built 2 zonelists in Node order, mobility grouping on.  Total pages: 65480
<4>Policy zone: DMA
<5>Kernel command line: root=/dev/sda5 sysrq=1 insmod=sym53c8xx insmod=ipr crashkernel=512M-:256M xmon=on 
<6>PID hash table entries: 4096 (order: -1, 32768 bytes)
<4>freeing bootmem node 1
<6>Memory: 3899712k/4194304k available (9216k kernel code, 294592k reserved, 2688k data, 2370k bss, 640k init)
<6>Hierarchical RCU implementation.
<6>RCU-based detection of stalled CPUs is enabled.
<6>NR_IRQS:512 nr_irqs:512
<4>[boot]0020 XICS Init
<4>[boot]0021 XICS Done
<7>pic: no ISA interrupt controller
<7>time_init: decrementer frequency = 512.000000 MHz
<7>time_init: processor frequency   = 4704.000000 MHz
<6>clocksource: timebase mult[7d0000] shift[22] registered
<7>clockevent: decrementer mult[83126e97] shift[32] cpu[0]
<4>Console: colour dummy device 80x25
<6>console [hvc0] enabled, bootconsole disabled
<6>allocated 2621440 bytes of page_cgroup
<6>please try 'cgroup_disable=memory' option if you don't want memory cgroups
<6>Security Framework initialized
<6>SELinux:  Disabled at boot.
<6>Dentry cache hash table entries: 524288 (order: 6, 4194304 bytes)
<6>Inode-cache hash table entries: 262144 (order: 5, 2097152 bytes)
<4>Mount-cache hash table entries: 4096
<6>Initializing cgroup subsys ns
<6>Initializing cgroup subsys cpuacct
<6>Initializing cgroup subsys memory
<6>Initializing cgroup subsys devices
<6>Initializing cgroup subsys freezer
<7>  alloc irq_desc for 16 on node 0
<7>  alloc kstat_irqs on node 0
<7>irq: irq 2 on host null mapped to virtual irq 16
<7>clockevent: decrementer mult[83126e97] shift[32] cpu[1]
<4>Processor 1 found.
<7>clockevent: decrementer mult[83126e97] shift[32] cpu[2]
<4>Processor 2 found.
<7>clockevent: decrementer mult[83126e97] shift[32] cpu[3]
<4>Processor 3 found.
<6>Brought up 4 CPUs
<7>Node 0 CPUs: 0-3
<7>Node 1 CPUs:
<7>CPU0 attaching sched-domain:
<7> domain 0: span 0-1 level SIBLING
<7>  groups: 0 (cpu_power = 589) 1 (cpu_power = 589)
<7>  domain 1: span 0-3 level CPU
<7>   groups: 0-1 (cpu_power = 1178) 2-3 (cpu_power = 1178)
<7>CPU1 attaching sched-domain:
<7> domain 0: span 0-1 level SIBLING
<7>  groups: 1 (cpu_power = 589) 0 (cpu_power = 589)
<7>  domain 1: span 0-3 level CPU
<7>   groups: 0-1 (cpu_power = 1178) 2-3 (cpu_power = 1178)
<7>CPU2 attaching sched-domain:
<7> domain 0: span 2-3 level SIBLING
<7>  groups: 2 (cpu_power = 589) 3 (cpu_power = 589)
<7>  domain 1: span 0-3 level CPU
<7>   groups: 2-3 (cpu_power = 1178) 0-1 (cpu_power = 1178)
<7>CPU3 attaching sched-domain:
<7> domain 0: span 2-3 level SIBLING
<7>  groups: 3 (cpu_power = 589) 2 (cpu_power = 589)
<7>  domain 1: span 0-3 level CPU
<7>   groups: 2-3 (cpu_power = 1178) 0-1 (cpu_power = 1178)
<6>NET: Registered protocol family 16
<6>IBM eBus Device Driver
<6>POWER6 performance monitor hardware support registered
<6>PCI: Probing PCI hardware
<7>PCI: Probing PCI hardware done
<4>bio: create slab <bio-0> at 0
<6>vgaarb: loaded
<6>usbcore: registered new interface driver usbfs
<6>usbcore: registered new interface driver hub
<6>usbcore: registered new device driver usb
<6>Switching to clocksource timebase
<6>NET: Registered protocol family 2
<6>IP route cache hash table entries: 32768 (order: 2, 262144 bytes)
<6>TCP established hash table entries: 131072 (order: 5, 2097152 bytes)
<6>TCP bind hash table entries: 65536 (order: 4, 1048576 bytes)
<6>TCP: Hash tables configured (established 131072 bind 65536)
<6>TCP reno registered
<6>UDP hash table entries: 2048 (order: 0, 65536 bytes)
<6>UDP-Lite hash table entries: 2048 (order: 0, 65536 bytes)
<6>NET: Registered protocol family 1
<7>PCI: CLS 0 bytes, default 128
<6>Unpacking initramfs...
<7>RTAS daemon started
<7>  alloc irq_desc for 17 on node 0
<7>  alloc kstat_irqs on node 0
<7>irq: irq 655360 on host null mapped to virtual irq 17
<7>  alloc irq_desc for 18 on node 0
<7>  alloc kstat_irqs on node 0
<7>irq: irq 655362 on host null mapped to virtual irq 18
<6>IOMMU table initialized, virtual merging enabled
<7>  alloc irq_desc for 19 on node 0
<7>  alloc kstat_irqs on node 0
<7>irq: irq 589825 on host null mapped to virtual irq 19
<6>audit: initializing netlink socket (disabled)
<5>type=2000 audit(1258442853.220:1): initialized
<1>rcu-torture:--- Start of test: nreaders=8 nfakewriters=4 stat_interval=0 verbose=0 test_no_idle_hz=0 shuffle_interval=3 stutter=5 irqreader=1
<6>HugeTLB registered 16 MB page size, pre-allocated 0 pages
<6>HugeTLB registered 16 GB page size, pre-allocated 0 pages
<5>VFS: Disk quotas dquot_6.5.2
<4>Dquot-cache hash table entries: 8192 (order 0, 65536 bytes)
<6>msgmni has been set to 7616
<6>alg: No test for stdrng (krng)
<6>Block layer SCSI generic (bsg) driver version 0.4 loaded (major 254)
<6>io scheduler noop registered
<6>io scheduler deadline registered
<6>io scheduler cfq registered (default)
<6>pci_hotplug: PCI Hot Plug PCI Core version: 0.5
<6>pciehp: PCI Express Hot Plug Controller Driver version: 0.4
<6>rpaphp: RPA HOT Plug PCI Controller Driver version: 0.1
<7>vio_register_driver: driver hvc_console registering
<7>HVSI: registered 0 devices
<6>Generic RTC Driver v1.07
<6>Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
<6>pmac_zilog: 0.6 (Benjamin Herrenschmidt <benh@kernel.crashing.org>)
<6>input: Macintosh mouse button emulation as /devices/virtual/input/input0
<6>Uniform Multi-Platform E-IDE driver
<6>ide-gd driver 1.18
<6>ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
<6>ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
<6>mice: PS/2 mouse device common for all mice
<6>EDAC MC: Ver: 2.1.0 Nov 16 2009
<6>usbcore: registered new interface driver hiddev
<6>usbcore: registered new interface driver usbhid
<6>usbhid: USB HID core driver
<6>TCP cubic registered
<6>NET: Registered protocol family 15
<4>registered taskstats version 1
<4>Freeing unused kernel memory: 640k freed
<4>__pte_alloc() -> mm c0000000fa9f0180 addr 0xffffffffff2 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f0180 addr 0x419cacb8 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f0180 addr 0xfff886daf30 nr_ptes 3
<4>__pte_alloc() -> mm c0000000fa9f0580 addr 0x419b0000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f0580 addr 0xfff88370000 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f0580 addr 0xffff03d0000 nr_ptes 3
<4>__pte_alloc() -> mm c0000000fa9f0980 addr 0xfffffffffed nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f0580 addr 0x40000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f0580 addr 0xfff80000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f0580 addr 0xffff0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f0980 addr 0xfffd45b0000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f0980 addr 0xffff0000000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f0980 addr 0x10029a80 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f0980 addr 0xfff7dd5af30 nr_ptes 3
<4>free_pte_range() -> mm c0000000fa9f0980 addr 0x10000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f0980 addr 0xfff70000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f0980 addr 0xfffd0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f0d80 addr 0x419b0000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f0d80 addr 0xfff88370000 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f0d80 addr 0xffff03d0000 nr_ptes 3
<4>__pte_alloc() -> mm c0000000fa9f1180 addr 0xfffffffffed nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f0d80 addr 0x40000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f0d80 addr 0xfff80000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f0d80 addr 0xffff0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f1180 addr 0xfffe4880000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f1180 addr 0xffff0000000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f1180 addr 0x10029a80 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f1180 addr 0xfff97f3af30 nr_ptes 3
<4>free_pte_range() -> mm c0000000fa9f1180 addr 0x10000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f1180 addr 0xfff90000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f1180 addr 0xfffe0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f1580 addr 0x419b0000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f1580 addr 0xfff88370000 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f1580 addr 0xffff03d0000 nr_ptes 3
<4>__pte_alloc() -> mm c0000000fa9f1980 addr 0xfffffffffed nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f1580 addr 0x40000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f1580 addr 0xfff80000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f1580 addr 0xffff0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f1980 addr 0xfffd1700000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f1980 addr 0xffff0000000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f1980 addr 0x10029a80 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f1980 addr 0xfff9d31af30 nr_ptes 3
<4>free_pte_range() -> mm c0000000fa9f1980 addr 0x10000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f1980 addr 0xfff90000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f1980 addr 0xfffd0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f1d80 addr 0x419b0000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f1d80 addr 0xfff88370000 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f1d80 addr 0xffff03d0000 nr_ptes 3
<4>__pte_alloc() -> mm c0000000fa9f2180 addr 0xfffffffffed nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f1d80 addr 0x40000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f1d80 addr 0xfff80000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f1d80 addr 0xffff0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f2180 addr 0xfffdad00000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f2180 addr 0xffff0000000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f2180 addr 0x10017830 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f2180 addr 0xfff93bfaf30 nr_ptes 3
<4>free_pte_range() -> mm c0000000fa9f2180 addr 0x10000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f2180 addr 0xfff90000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f2180 addr 0xfffd0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f2580 addr 0x419b0000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f2580 addr 0xfff88370000 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f2580 addr 0xffff03d0000 nr_ptes 3
<4>__pte_alloc() -> mm c0000000fa9f2980 addr 0xfffffffffed nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f2580 addr 0x40000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f2580 addr 0xfff80000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f2580 addr 0xffff0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f2980 addr 0xfffd9b10000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f2980 addr 0xffff0000000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f2980 addr 0x10017830 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f2980 addr 0xfff9a09af30 nr_ptes 3
<4>free_pte_range() -> mm c0000000fa9f2980 addr 0x10000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f2980 addr 0xfff90000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f2980 addr 0xfffd0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f2d80 addr 0x419b0000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f2d80 addr 0xfff88370000 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f2d80 addr 0xffff03d0000 nr_ptes 3
<4>__pte_alloc() -> mm c0000000fa9f3180 addr 0xfffffffffed nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f2d80 addr 0x40000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f2d80 addr 0xfff80000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f2d80 addr 0xffff0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f3180 addr 0xfffc0dc0000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f3180 addr 0xffff0000000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f3180 addr 0x10017830 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f3180 addr 0xfff7bb1af30 nr_ptes 3
<4>free_pte_range() -> mm c0000000fa9f3180 addr 0x10000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f3180 addr 0xfff70000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f3180 addr 0xfffc0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f3580 addr 0x419b0000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f3580 addr 0xfff88370000 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f3580 addr 0xffff03d0000 nr_ptes 3
<4>__pte_alloc() -> mm c0000000fa9f3980 addr 0xfffffffffed nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f3580 addr 0x40000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f3580 addr 0xfff80000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f3580 addr 0xffff0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f3980 addr 0xfffe80f0000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f3980 addr 0xffff0000000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f3980 addr 0x10017830 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f3980 addr 0xfff9a73af30 nr_ptes 3
<4>free_pte_range() -> mm c0000000fa9f3980 addr 0x10000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f3980 addr 0xfff90000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f3980 addr 0xfffe0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f3d80 addr 0x419b0000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f3d80 addr 0xfff88370000 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f3d80 addr 0xffff03d0000 nr_ptes 3
<4>__pte_alloc() -> mm c0000000fa9f4180 addr 0xfffffffffed nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f3d80 addr 0x40000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f3d80 addr 0xfff80000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f3d80 addr 0xffff0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f4180 addr 0xfffc0650000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f4180 addr 0xffff0000000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f4180 addr 0x10017830 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f4180 addr 0xfffa335af30 nr_ptes 3
<4>free_pte_range() -> mm c0000000fa9f4180 addr 0x10000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f4180 addr 0xfffa0000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f4180 addr 0xfffc0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f4580 addr 0x419b0000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f4580 addr 0xfff88370000 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f4580 addr 0xffff03d0000 nr_ptes 3
<4>__pte_alloc() -> mm c0000000fa9f4980 addr 0xfffffffffed nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f4580 addr 0x40000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f4580 addr 0xfff80000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f4580 addr 0xffff0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f4980 addr 0xfffe5970000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f4980 addr 0xffff0000000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f4980 addr 0x10017830 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f4980 addr 0xfff812daf30 nr_ptes 3
<4>free_pte_range() -> mm c0000000fa9f4980 addr 0x10000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f4980 addr 0xfff80000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f4980 addr 0xfffe0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f4d80 addr 0x419b0000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f4d80 addr 0xfff88370000 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f4d80 addr 0xffff03d0000 nr_ptes 3
<4>__pte_alloc() -> mm c0000000fa9f5180 addr 0xfffffffffed nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f4d80 addr 0x40000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f4d80 addr 0xfff80000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f4d80 addr 0xffff0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f5180 addr 0xfffd0950000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f5180 addr 0xffff0000000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f5180 addr 0x10017830 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f5180 addr 0xfff9865af30 nr_ptes 3
<4>free_pte_range() -> mm c0000000fa9f5180 addr 0x10000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f5180 addr 0xfff90000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f5180 addr 0xfffd0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f5580 addr 0x419b0000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f5580 addr 0xfff88370000 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f5580 addr 0xffff03d0000 nr_ptes 3
<4>__pte_alloc() -> mm c0000000fa9f5980 addr 0xfffffffffed nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f5580 addr 0x40000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f5580 addr 0xfff80000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f5580 addr 0xffff0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f5980 addr 0xfffea6f0000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f5980 addr 0xffff0000000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f5980 addr 0x10017830 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f5980 addr 0xfff9575af30 nr_ptes 3
<4>free_pte_range() -> mm c0000000fa9f5980 addr 0x10000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f5980 addr 0xfff90000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f5980 addr 0xfffe0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f5d80 addr 0x419b0000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f5d80 addr 0xfff88370000 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f5d80 addr 0xffff03d0000 nr_ptes 3
<4>__pte_alloc() -> mm c0000000fa9f6180 addr 0xfffffffffed nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f5d80 addr 0x40000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f5d80 addr 0xfff80000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f5d80 addr 0xffff0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f6180 addr 0xfffe6650000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f6180 addr 0xffff0000000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f6180 addr 0x10018960 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f6180 addr 0xfffaf91af30 nr_ptes 3
<4>free_pte_range() -> mm c0000000fa9f6180 addr 0x10000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f6180 addr 0xfffa0000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f6180 addr 0xfffe0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f6580 addr 0x419b0000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f6580 addr 0xfff88370000 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f6580 addr 0xffff03d0000 nr_ptes 3
<4>__pte_alloc() -> mm c0000000fa9f6980 addr 0xfffffffffed nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f6580 addr 0x40000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f6580 addr 0xfff80000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f6580 addr 0xffff0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f6980 addr 0xfffcbcf0000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f6980 addr 0xffff0000000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f6980 addr 0x10018960 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f6980 addr 0xfff9589af30 nr_ptes 3
<4>free_pte_range() -> mm c0000000fa9f6980 addr 0x10000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f6980 addr 0xfff90000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f6980 addr 0xfffc0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f6d80 addr 0x419b0000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f6d80 addr 0xfff88370000 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f6d80 addr 0xffff03d0000 nr_ptes 3
<4>__pte_alloc() -> mm c0000000fa9f7180 addr 0xffffffffff0 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f6d80 addr 0x40000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f6d80 addr 0xfff80000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f6d80 addr 0xffff0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f7180 addr 0xfffe0660000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f7180 addr 0xffff0000000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f7180 addr 0x1001be48 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f7180 addr 0xfffb65faf30 nr_ptes 3
<4>free_pte_range() -> mm c0000000fa9f7180 addr 0x10000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f7180 addr 0xfffb0000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f7180 addr 0xfffe0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f7580 addr 0x419b0000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f7580 addr 0xfff88370000 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f7580 addr 0xffff03d0000 nr_ptes 3
<4>__pte_alloc() -> mm c0000000fa9f7980 addr 0xffffffffff0 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f7580 addr 0x40000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f7580 addr 0xfff80000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f7580 addr 0xffff0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f7980 addr 0xfffec320000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f7980 addr 0xffff0000000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f7980 addr 0x1001be48 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f7980 addr 0xfffa1ebaf30 nr_ptes 3
<4>free_pte_range() -> mm c0000000fa9f7980 addr 0x10000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f7980 addr 0xfffa0000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f7980 addr 0xfffe0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f7d80 addr 0x419b0000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f7d80 addr 0xfff88370000 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f7d80 addr 0xffff03d0000 nr_ptes 3
<4>__pte_alloc() -> mm c0000000fa9f8180 addr 0xffffffffff0 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f7d80 addr 0x40000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f7d80 addr 0xfff80000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f7d80 addr 0xffff0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f8180 addr 0xfffcdb20000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f8180 addr 0xffff0000000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f8180 addr 0x1001be48 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f8180 addr 0xfff9a19af30 nr_ptes 3
<4>free_pte_range() -> mm c0000000fa9f8180 addr 0x10000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f8180 addr 0xfff90000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f8180 addr 0xfffc0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f8580 addr 0x419b0000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f8580 addr 0xfff88370000 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f8580 addr 0xffff03d0000 nr_ptes 3
<4>__pte_alloc() -> mm c0000000fa9f8980 addr 0xffffffffff0 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f8580 addr 0x40000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f8580 addr 0xfff80000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f8580 addr 0xffff0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f8980 addr 0xfffcc8a0000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f8980 addr 0xffff0000000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f8980 addr 0x1001be48 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f8980 addr 0xfffa7dbaf30 nr_ptes 3
<4>free_pte_range() -> mm c0000000fa9f8980 addr 0x10000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f8980 addr 0xfffa0000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f8980 addr 0xfffc0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f8d80 addr 0x419b0000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f8d80 addr 0xfff88370000 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f8d80 addr 0xffff03d0000 nr_ptes 3
<4>__pte_alloc() -> mm c0000000fa9f9180 addr 0x419b0000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f9180 addr 0xfff88370000 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f9180 addr 0xffff03d0000 nr_ptes 3
<4>__pte_alloc() -> mm c0000000fa9f9580 addr 0xfffffffffef nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f9180 addr 0x40000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f9180 addr 0xfff80000000 nr_ptes 1
<4>free_pte_range() -> mm c0000000fa9f9180 addr 0xffff0000000 nr_ptes 0
<4>__pte_alloc() -> mm c0000000fa9f9580 addr 0xfffed840000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f9580 addr 0xffff0000000 nr_ptes 1
<4>__pte_alloc() -> mm c0000000fa9f9580 addr 0x1001bae0 nr_ptes 2
<4>__pte_alloc() -> mm c0000000fa9f9580 addr 0xfff9619af30 nr_ptes 3
<4>free_pte_range() -> mm c0000000fa9f9580 addr 0xfff90000000 nr_ptes 2
<4>free_pte_range() -> mm c0000000fa9f9580 addr 0xfffe0000000 nr_ptes 1
<7>exit_mmap(): mm c0000000fa9f9580 nr_ptes 1
<4>exit_mmap(): mm c0000000fa9f9580 nr_ptes 1 current c0000000fad98be0 pid 84 comm "cat"
<0>------------[ cut here ]------------
<2>kernel BUG at mm/mmap.c:2142!
3:mon>



^ permalink raw reply

* Re: [PATCH 1/1] ata/sata_sil24: MSI support, disabled by default
From: Jeff Garzik @ 2009-11-17  7:42 UTC (permalink / raw)
  To: Mahajan Vivek-B08308; +Cc: linux-ide, Grant Grundler, linuxppc-dev
In-Reply-To: <F2F605B667B24B489C904986E0D60A08012220A2@zin33exm23.fsl.freescale.net>

On 11/17/2009 01:59 AM, Mahajan Vivek-B08308 wrote:
>> From: Grant Grundler [mailto:grundler@google.com]
>> Sent: Monday, November 16, 2009 11:08 PM
>>> +static int sata_sil24_msi;    /* Disable MSI */
>>> +module_param_named(msi, sata_sil24_msi, bool, S_IRUGO);
>>> +MODULE_PARM_DESC(msi, "Enable MSI (Default: false)");
>>
>> Vivek,
>> Do we even still need the parameter? I'm thinking either MSI
>> works with a chipset or it doesn't. The kernel has globals to
>> "know" which state is true.
>
> Sometimes even in a platform, some PCIe endpoints do very
> well with MSI while others may have to resort to legacy ints.
> Should we let the endpoints make the final call.
>
>>
>> If the parameter is needed, when this driver is compiled into
>> the kernel, how is "msi" parameter specified?
>> I think the parameter needs to be documented and fit in with
>> other "msi" parameters.
>> See "nomsi" in Documentation/kernel-parameters.txt.
>
> In this case "msi" is supposed to be passed via insmod and
> not via kernel cmdline. If the driver is built-in the kernel,
> then force sata_sil24_msi = 1 in the driver to enable it.

First, the original patch was just fine, and it was applied.  You should 
have received email confirmation of this already.

Second, all module options are available on the kernel command line, 
when a module is built into the kernel.  You supply a module name prefix 
to each module option, on the kernel command line.

	Jeff

^ permalink raw reply

* Re: [PATCH 00/10] Fix 8xx MMU/TLB
From: Joakim Tjernlund @ 2009-11-17  8:04 UTC (permalink / raw)
  To: Scott Wood; +Cc: linuxppc-dev@ozlabs.org, Rex Feany
In-Reply-To: <4B01F0EB.70707@freescale.com>



Scott Wood <scottwood@freescale.com> wrote on 17/11/2009 01:40:11:

> From:
>
> Scott Wood <scottwood@freescale.com>
>
> To:
>
> Joakim Tjernlund <joakim.tjernlund@transmode.se>
>
> Cc:
>
> "linuxppc-dev@ozlabs.org" <linuxppc-dev@ozlabs.org>, Rex Feany <RFeany@mrv.com>
>
> Date:
>
> 17/11/2009 01:40
>
> Subject:
>
> Re: [PATCH 00/10] Fix 8xx MMU/TLB
>
> Joakim Tjernlund wrote:
> > Scott Wood <scottwood@freescale.com> wrote on 16/11/2009 22:27:41:
> >> On Mon, Nov 16, 2009 at 03:00:09PM -0600, Scott Wood wrote:
> >>> On Sun, Nov 15, 2009 at 06:09:27PM +0100, Joakim Tjernlund wrote:
> >>>> [I used the wrong branch, this will hopefully not conflict]
> >>>>
> >>>> This is hopfully the last iteration of the series.
> >>>> Rex & Scott, please test and signoff.
> >>>> Changes since last version:
> >>>>  - Added mandatory pinning of iTLB
> >>>>  - Added "DTLB Miss cleanup"
> >>> I still get the EFAULTs.
> >
> > umm, this worked before this series with your own
> > version, right?
>
> No...  I only meant that the ITLB pinning got rid of the boot hang.
>
> When I mentioned the EFAULTs before you said, "No surprise as the it
> seems like the DAR decoding is broken."  I thought you meant you'd found
> a bug and fixed it in this respin.

Oh, there seems to be a misunderstanding here :)
Lets go back a bit, you said some time ago:
/Quote
> > +3:   lwz   r11, 0(r11)		 /* Get the level 1 entry */
> >       DO_8xx_CPU6(0x3b80, r3)
> >       mtspr SPRN_MD_TWC, r11		 /* Load pte table base address */
> >       mfspr r11, SPRN_MD_TWC		 /* ....and get the pte address */
> >       lwz   r11, 0(r11)		 /* Get the pte */
> >       /* concat physical page address(r11) and page offset(r10) */
> >       rlwimi      r11, r10, 0, 20, 31
>
> But r10 here contains SRR0 from above, and this is a data TLB error.

Never mind that last one, forgot that you'd be wanting to load the
instruction. :-P

But the rlwimi is what's causing the machine checks.  I replaced it with:
rlwinm		 r11, r11, 0, 0x3ffff000
rlwimi		 r11, r10, 22, 0xffc

and things seem to work.  You could probably replace the rlwinm by
subtracting PAGE_OFFSET from swapper_pg_dir instead.
/End Quote

I read this as now everything is working, but I guess I misunderstood?
You still have EFAULT here?

^ permalink raw reply

* [PATCH 10/13] mac68k: start CUDA early, take 2
From: Finn Thain @ 2009-11-17  9:03 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-m68k, linuxppc-dev
In-Reply-To: <1258423421.2140.555.camel@pasglop>

The valkyriefb driver needs the CUDA to work in order to set the video 
mode at boot. So initialise the device earlier, and bring the m68k code 
closer to the powermac code.

Take 2 was changed as per Benjamin Herrenschmidt's review.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>

---
 arch/m68k/mac/config.c       |    6 +++
 drivers/macintosh/adb.c      |    6 ++-
 drivers/macintosh/via-cuda.c |   74 +++++++++++++++++++++++--------------------
 3 files changed, 51 insertions(+), 35 deletions(-)

Index: linux-2.6.31/arch/m68k/mac/config.c
===================================================================
--- linux-2.6.31.orig/arch/m68k/mac/config.c	2009-11-17 17:11:47.000000000 +1100
+++ linux-2.6.31/arch/m68k/mac/config.c	2009-11-17 17:11:47.000000000 +1100
@@ -23,6 +23,8 @@
 #include <linux/init.h>
 #include <linux/vt_kern.h>
 #include <linux/platform_device.h>
+#include <linux/adb.h>
+#include <linux/cuda.h>
 
 #define BOOTINFO_COMPAT_1_0
 #include <asm/setup.h>
@@ -889,6 +891,10 @@ static void __init mac_identify(void)
 	oss_init();
 	psc_init();
 	baboon_init();
+
+#ifdef CONFIG_ADB_CUDA
+	find_via_cuda();
+#endif
 }
 
 static void __init mac_report_hardware(void)
Index: linux-2.6.31/drivers/macintosh/via-cuda.c
===================================================================
--- linux-2.6.31.orig/drivers/macintosh/via-cuda.c	2009-11-17 17:07:58.000000000 +1100
+++ linux-2.6.31/drivers/macintosh/via-cuda.c	2009-11-17 17:11:47.000000000 +1100
@@ -89,7 +89,6 @@ static int cuda_fully_inited;
 
 #ifdef CONFIG_ADB
 static int cuda_probe(void);
-static int cuda_init(void);
 static int cuda_send_request(struct adb_request *req, int sync);
 static int cuda_adb_autopoll(int devs);
 static int cuda_reset_adb_bus(void);
@@ -107,17 +106,42 @@ int cuda_request(struct adb_request *req
 
 #ifdef CONFIG_ADB
 struct adb_driver via_cuda_driver = {
-	"CUDA",
-	cuda_probe,
-	cuda_init,
-	cuda_send_request,
-	cuda_adb_autopoll,
-	cuda_poll,
-	cuda_reset_adb_bus
+	.name         = "CUDA",
+	.probe        = cuda_probe,
+	.send_request = cuda_send_request,
+	.autopoll     = cuda_adb_autopoll,
+	.poll         = cuda_poll,
+	.reset_bus    = cuda_reset_adb_bus,
 };
 #endif /* CONFIG_ADB */
 
-#ifdef CONFIG_PPC
+#ifdef CONFIG_MAC
+int __init find_via_cuda(void)
+{
+    struct adb_request req;
+    int err;
+
+    if (macintosh_config->adb_type != MAC_ADB_CUDA)
+	return 0;
+
+    via = via1;
+    cuda_state = idle;
+
+    err = cuda_init_via();
+    if (err) {
+	printk(KERN_ERR "cuda_init_via() failed\n");
+	via = NULL;
+	return 0;
+    }
+
+    /* enable autopoll */
+    cuda_request(&req, NULL, 3, CUDA_PACKET, CUDA_AUTOPOLL, 1);
+    while (!req.complete)
+	cuda_poll();
+
+    return 1;
+}
+#else
 int __init find_via_cuda(void)
 {
     struct adb_request req;
@@ -175,7 +199,7 @@ int __init find_via_cuda(void)
     vias = NULL;
     return 0;
 }
-#endif /* CONFIG_PPC */
+#endif /* !defined CONFIG_MAC */
 
 static int __init via_cuda_start(void)
 {
@@ -184,14 +208,14 @@ static int __init via_cuda_start(void)
 
 #ifdef CONFIG_MAC
     cuda_irq = IRQ_MAC_ADB;
-#else /* CONFIG_MAC */
+#else
     cuda_irq = irq_of_parse_and_map(vias, 0);
     if (cuda_irq == NO_IRQ) {
 	printk(KERN_ERR "via-cuda: can't map interrupts for %s\n",
 	       vias->full_name);
 	return -ENODEV;
     }
-#endif /* CONFIG_MAC */
+#endif
 
     if (request_irq(cuda_irq, cuda_interrupt, 0, "ADB", cuda_interrupt)) {
 	printk(KERN_ERR "via-cuda: can't request irq %d\n", cuda_irq);
@@ -216,28 +240,10 @@ cuda_probe(void)
 #else
     if (macintosh_config->adb_type != MAC_ADB_CUDA)
 	return -ENODEV;
-    via = via1;
 #endif
-    return 0;
-}
-
-static int __init
-cuda_init(void)
-{
-#ifdef CONFIG_PPC
     if (via == NULL)
 	return -ENODEV;
     return 0;
-#else 
-    int err = cuda_init_via();
-    if (err) {
-	printk(KERN_ERR "cuda_init_via() failed\n");
-	return -ENODEV;
-    }
-    out_8(&via[IER], IER_SET|SR_INT); /* enable interrupt from SR */
-
-    return via_cuda_start();
-#endif
 }
 #endif /* CONFIG_ADB */
 
@@ -430,9 +436,11 @@ cuda_poll(void)
     /* cuda_interrupt only takes a normal lock, we disable
      * interrupts here to avoid re-entering and thus deadlocking.
      */
-    disable_irq(cuda_irq);
+    if (cuda_irq)
+	disable_irq(cuda_irq);
     cuda_interrupt(0, NULL);
-    enable_irq(cuda_irq);
+    if (cuda_irq)
+	enable_irq(cuda_irq);
 }
 
 static irqreturn_t
@@ -446,7 +454,7 @@ cuda_interrupt(int irq, void *arg)
     
     spin_lock(&cuda_lock);
 
-    /* On powermacs, this handler is registered for the VIA IRQ. But it uses
+    /* On powermacs, this handler is registered for the VIA IRQ. But they use
      * just the shift register IRQ -- other VIA interrupt sources are disabled.
      * On m68k macs, the VIA IRQ sources are dispatched individually. Unless
      * we are polling, the shift register IRQ flag has already been cleared.
Index: linux-2.6.31/drivers/macintosh/adb.c
===================================================================
--- linux-2.6.31.orig/drivers/macintosh/adb.c	2009-11-17 17:07:58.000000000 +1100
+++ linux-2.6.31/drivers/macintosh/adb.c	2009-11-17 17:11:47.000000000 +1100
@@ -317,9 +317,11 @@ static int __init adb_init(void)
 			break;
 		}
 	}
-	if ((adb_controller == NULL) || adb_controller->init()) {
-		printk(KERN_WARNING "Warning: no ADB interface detected\n");
+	if (adb_controller != NULL && adb_controller->init &&
+	    adb_controller->init())
 		adb_controller = NULL;
+	if (adb_controller == NULL) {
+		printk(KERN_WARNING "Warning: no ADB interface detected\n");
 	} else {
 #ifdef CONFIG_PPC
 		if (machine_is_compatible("AAPL,PowerBook1998") ||

^ permalink raw reply

* [PATCH 1/2] pmac-zilog: add platform driver
From: Finn Thain @ 2009-11-17  9:04 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-m68k, linuxppc-dev

Add platform driver to the pmac-zilog driver for mac 68k, putting the 
powermac-specific bits inside #ifdef CONFIG_PPC_PMAC.

This patch should be applied after "[PATCH 3/13] pmac-zilog: cleanup". It 
renders obsolete the version in "[PATCH 4/13] pmac-zilog, mac68k: replace 
mac68k SCC code with platform".

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>

---
 arch/m68k/configs/mac_defconfig   |    5 +
 arch/m68k/configs/multi_defconfig |    5 +
 drivers/serial/Kconfig            |   12 +-
 drivers/serial/pmac_zilog.c       |  159 +++++++++++++++++++++++++++++++++-----
 drivers/serial/pmac_zilog.h       |   14 +++
 5 files changed, 169 insertions(+), 26 deletions(-)

Index: linux-2.6.31/drivers/serial/Kconfig
===================================================================
--- linux-2.6.31.orig/drivers/serial/Kconfig	2009-11-17 17:05:27.000000000 +1100
+++ linux-2.6.31/drivers/serial/Kconfig	2009-11-17 17:07:38.000000000 +1100
@@ -1079,12 +1079,12 @@ config SERIAL_68360
 	default y
 
 config SERIAL_PMACZILOG
-	tristate "PowerMac z85c30 ESCC support"
-	depends on PPC_OF && PPC_PMAC
+	tristate "Mac or PowerMac z85c30 ESCC support"
+	depends on (M68K && MAC) || (PPC_OF && PPC_PMAC)
 	select SERIAL_CORE
 	help
 	  This driver supports the Zilog z85C30 serial ports found on
-	  PowerMac machines.
+	  (Power)Mac machines.
 	  Say Y or M if you want to be able to these serial ports.
 
 config SERIAL_PMACZILOG_TTYS
@@ -1109,16 +1109,16 @@ config SERIAL_PMACZILOG_TTYS
 	  unable to use the 8250 module for PCMCIA or other 16C550-style
 	  UARTs.
 
-	  Say N unless you need the z85c30 ports on your powermac
+	  Say N unless you need the z85c30 ports on your (Power)Mac
 	  to appear as /dev/ttySn.
 
 config SERIAL_PMACZILOG_CONSOLE
-	bool "Console on PowerMac z85c30 serial port"
+	bool "Console on Mac or PowerMac z85c30 serial port"
 	depends on SERIAL_PMACZILOG=y
 	select SERIAL_CORE_CONSOLE
 	help
 	  If you would like to be able to use the z85c30 serial port
-	  on your PowerMac as the console, you can do so by answering
+	  on your (Power)Mac as the console, you can do so by answering
 	  Y to this option.
 
 config SERIAL_LH7A40X
Index: linux-2.6.31/arch/m68k/configs/mac_defconfig
===================================================================
--- linux-2.6.31.orig/arch/m68k/configs/mac_defconfig	2009-11-17 17:07:29.000000000 +1100
+++ linux-2.6.31/arch/m68k/configs/mac_defconfig	2009-11-17 17:07:38.000000000 +1100
@@ -701,6 +701,11 @@ CONFIG_VT_HW_CONSOLE_BINDING=y
 #
 # Non-8250 serial port support
 #
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_PMACZILOG=y
+CONFIG_SERIAL_PMACZILOG_TTYS=y
+CONFIG_SERIAL_PMACZILOG_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
 CONFIG_LEGACY_PTYS=y
Index: linux-2.6.31/arch/m68k/configs/multi_defconfig
===================================================================
--- linux-2.6.31.orig/arch/m68k/configs/multi_defconfig	2009-11-17 17:07:29.000000000 +1100
+++ linux-2.6.31/arch/m68k/configs/multi_defconfig	2009-11-17 17:07:38.000000000 +1100
@@ -822,6 +822,11 @@ CONFIG_A2232=y
 #
 # Non-8250 serial port support
 #
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+CONFIG_SERIAL_PMACZILOG=y
+CONFIG_SERIAL_PMACZILOG_TTYS=y
+CONFIG_SERIAL_PMACZILOG_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 # CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set
 CONFIG_LEGACY_PTYS=y
Index: linux-2.6.31/drivers/serial/pmac_zilog.c
===================================================================
--- linux-2.6.31.orig/drivers/serial/pmac_zilog.c	2009-11-17 17:07:28.000000000 +1100
+++ linux-2.6.31/drivers/serial/pmac_zilog.c	2009-11-17 17:07:38.000000000 +1100
@@ -63,11 +63,18 @@
 #include <asm/sections.h>
 #include <asm/io.h>
 #include <asm/irq.h>
+
+#ifdef CONFIG_PPC_PMAC
 #include <asm/prom.h>
 #include <asm/machdep.h>
 #include <asm/pmac_feature.h>
 #include <asm/dbdma.h>
 #include <asm/macio.h>
+#else
+#include <linux/platform_device.h>
+#include <asm/macints.h>
+#define machine_is_compatible(x) (0)
+#endif
 
 #if defined (CONFIG_SERIAL_PMACZILOG_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
 #define SUPPORT_SYSRQ
@@ -83,11 +90,9 @@
 
 static char version[] __initdata = "pmac_zilog: 0.6 (Benjamin Herrenschmidt <benh@kernel.crashing.org>)";
 MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>");
-MODULE_DESCRIPTION("Driver for the PowerMac serial ports.");
+MODULE_DESCRIPTION("Driver for the Mac and PowerMac serial ports.");
 MODULE_LICENSE("GPL");
 
-#define PWRDBG(fmt, arg...)	printk(KERN_DEBUG fmt , ## arg)
-
 #ifdef CONFIG_SERIAL_PMACZILOG_TTYS
 #define PMACZILOG_MAJOR		TTY_MAJOR
 #define PMACZILOG_MINOR		64
@@ -341,7 +346,7 @@ static struct tty_struct *pmz_receive_ch
 	uap->curregs[R1] &= ~(EXT_INT_ENAB | TxINT_ENAB | RxINT_MASK);
 	write_zsreg(uap, R1, uap->curregs[R1]);
 	zssync(uap);
-	dev_err(&uap->dev->ofdev.dev, "pmz: rx irq flood !\n");
+	pmz_error("pmz: rx irq flood !\n");
 	return tty;
 }
 
@@ -746,6 +751,8 @@ static void pmz_break_ctl(struct uart_po
 	spin_unlock_irqrestore(&port->lock, flags);
 }
 
+#ifdef CONFIG_PPC_PMAC
+
 /*
  * Turn power on or off to the SCC and associated stuff
  * (port drivers, modem, IR port, etc.)
@@ -781,6 +788,15 @@ static int pmz_set_scc_power(struct uart
 	return delay;
 }
 
+#else
+
+static int pmz_set_scc_power(struct uart_pmac_port *uap, int state)
+{
+	return 0;
+}
+
+#endif /* !CONFIG_PPC_PMAC */
+
 /*
  * FixZeroBug....Works around a bug in the SCC receving channel.
  * Inspired from Darwin code, 15 Sept. 2000  -DanM
@@ -943,9 +959,9 @@ static int pmz_startup(struct uart_port 
 	}	
 
 	pmz_get_port_A(uap)->flags |= PMACZILOG_FLAG_IS_IRQ_ON;
-	if (request_irq(uap->port.irq, pmz_interrupt, IRQF_SHARED, "PowerMac Zilog", uap)) {
-		dev_err(&uap->dev->ofdev.dev,
-			"Unable to register zs interrupt handler.\n");
+	if (request_irq(uap->port.irq, pmz_interrupt, IRQF_SHARED,
+	                "SCC", uap)) {
+		pmz_error("Unable to register zs interrupt handler.\n");
 		pmz_set_scc_power(uap, 0);
 		mutex_unlock(&pmz_irq_mutex);
 		return -ENXIO;
@@ -1185,7 +1201,7 @@ static void pmz_irda_setup(struct uart_p
 	while ((read_zsreg(uap, R0) & Tx_BUF_EMP) == 0
 	       || (read_zsreg(uap, R1) & ALL_SNT) == 0) {
 		if (--t <= 0) {
-			dev_err(&uap->dev->ofdev.dev, "transmitter didn't drain\n");
+			pmz_error("transmitter didn't drain\n");
 			return;
 		}
 		udelay(10);
@@ -1201,7 +1217,7 @@ static void pmz_irda_setup(struct uart_p
 		read_zsdata(uap);
 		mdelay(10);
 		if (--t <= 0) {
-			dev_err(&uap->dev->ofdev.dev, "receiver didn't drain\n");
+			pmz_error("receiver didn't drain\n");
 			return;
 		}
 	}
@@ -1222,8 +1238,7 @@ static void pmz_irda_setup(struct uart_p
 	t = 5000;
 	while ((read_zsreg(uap, R0) & Rx_CH_AV) == 0) {
 		if (--t <= 0) {
-			dev_err(&uap->dev->ofdev.dev,
-				"irda_setup timed out on get_version byte\n");
+			pmz_error("irda_setup timed out on get_version byte\n");
 			goto out;
 		}
 		udelay(10);
@@ -1231,8 +1246,7 @@ static void pmz_irda_setup(struct uart_p
 	version = read_zsdata(uap);
 
 	if (version < 4) {
-		dev_info(&uap->dev->ofdev.dev, "IrDA: dongle version %d not supported\n",
-			 version);
+		pmz_info("IrDA: dongle version %d not supported\n", version);
 		goto out;
 	}
 
@@ -1241,19 +1255,17 @@ static void pmz_irda_setup(struct uart_p
 	t = 5000;
 	while ((read_zsreg(uap, R0) & Rx_CH_AV) == 0) {
 		if (--t <= 0) {
-			dev_err(&uap->dev->ofdev.dev,
-				"irda_setup timed out on speed mode byte\n");
+			pmz_error("irda_setup timed out on speed mode byte\n");
 			goto out;
 		}
 		udelay(10);
 	}
 	t = read_zsdata(uap);
 	if (t != cmdbyte)
-		dev_err(&uap->dev->ofdev.dev,
-			"irda_setup speed mode byte = %x (%x)\n", t, cmdbyte);
+		pmz_error("irda_setup speed mode byte = %x (%x)\n", t, cmdbyte);
 
-	dev_info(&uap->dev->ofdev.dev, "IrDA setup for %ld bps, dongle version: %d\n",
-		 *baud, version);
+	pmz_info("IrDA setup for %ld bps, dongle version: %d\n",
+	         *baud, version);
 
 	(void)read_zsdata(uap);
 	(void)read_zsdata(uap);
@@ -1402,7 +1414,7 @@ static void pmz_poll_put_char(struct uar
 	write_zsdata(uap, c);
 }
 
-#endif
+#endif /* CONFIG_CONSOLE_POLL */
 
 static struct uart_ops pmz_pops = {
 	.tx_empty	=	pmz_tx_empty,
@@ -1427,6 +1439,8 @@ static struct uart_ops pmz_pops = {
 #endif
 };
 
+#ifdef CONFIG_PPC_PMAC
+
 /*
  * Setup one port structure after probing, HW is down at this point,
  * Unlike sunzilog, we don't need to pre-init the spinlock as we don't
@@ -1823,6 +1837,88 @@ next:
 	return 0;
 }
 
+#else
+
+extern struct platform_device scc_a_pdev, scc_b_pdev;
+
+static int __init pmz_init_port(struct uart_pmac_port *uap)
+{
+	struct resource *r_ports;
+	int irq;
+
+	r_ports = platform_get_resource(uap->node, IORESOURCE_MEM, 0);
+	irq = platform_get_irq(uap->node, 0);
+	if (!r_ports || !irq)
+		return -ENODEV;
+
+	uap->port.mapbase  = r_ports->start;
+	uap->port.membase  = (unsigned char __iomem *) r_ports->start;
+	uap->port.iotype   = UPIO_MEM;
+	uap->port.irq      = irq;
+	uap->port.uartclk  = ZS_CLOCK;
+	uap->port.fifosize = 1;
+	uap->port.ops      = &pmz_pops;
+	uap->port.type     = PORT_PMAC_ZILOG;
+	uap->port.flags    = 0;
+
+	uap->control_reg   = uap->port.membase;
+	uap->data_reg      = uap->control_reg + 4;
+	uap->port_type     = 0;
+
+	pmz_convert_to_zs(uap, CS8, 0, 9600);
+
+	return 0;
+}
+
+static int __init pmz_probe(void)
+{
+	int err;
+
+	pmz_ports_count = 0;
+
+	pmz_ports[0].mate      = &pmz_ports[1];
+	pmz_ports[0].port.line = 0;
+	pmz_ports[0].flags     = PMACZILOG_FLAG_IS_CHANNEL_A;
+	pmz_ports[0].node      = &scc_a_pdev;
+	err = pmz_init_port(&pmz_ports[0]);
+	if (err)
+		return err;
+	pmz_ports_count++;
+
+	pmz_ports[1].mate      = &pmz_ports[0];
+	pmz_ports[1].port.line = 1;
+	pmz_ports[1].flags     = 0;
+	pmz_ports[1].node      = &scc_b_pdev;
+	err = pmz_init_port(&pmz_ports[1]);
+	if (err)
+		return err;
+	pmz_ports_count++;
+
+	return 0;
+}
+
+static void pmz_dispose_port(struct uart_pmac_port *uap)
+{
+	memset(uap, 0, sizeof(struct uart_pmac_port));
+}
+
+static int pmz_attach(struct platform_device *pdev)
+{
+	int i;
+
+	for (i = 0; i < pmz_ports_count; i++)
+		if (pmz_ports[i].node == pdev)
+			return 0;
+	return -ENODEV;
+}
+
+static int pmz_detach(struct platform_device *pdev)
+{
+	return 0;
+}
+
+#endif /* !CONFIG_PPC_PMAC */
+
 #ifdef CONFIG_SERIAL_PMACZILOG_CONSOLE
 
 static void pmz_console_write(struct console *con, const char *s, unsigned int count);
@@ -1883,6 +1979,8 @@ err_out:
 	return rc;
 }
 
+#ifdef CONFIG_PPC_PMAC
+
 static struct of_device_id pmz_match[] = 
 {
 	{
@@ -1904,6 +2002,19 @@ static struct macio_driver pmz_driver = 
 	.resume		= pmz_resume,
 };
 
+#else
+
+static struct platform_driver pmz_driver = {
+	.probe          = pmz_attach,
+	.remove         = __devexit_p(pmz_detach),
+	.driver         = {
+		.name           = "scc",
+		.owner          = THIS_MODULE,
+	},
+};
+
+#endif /* !CONFIG_PPC_PMAC */
+
 static int __init init_pmz(void)
 {
 	int rc, i;
@@ -1942,15 +2053,23 @@ static int __init init_pmz(void)
 	/*
 	 * Then we register the macio driver itself
 	 */
+#ifdef CONFIG_PPC_PMAC
 	return macio_register_driver(&pmz_driver);
+#else
+	return platform_driver_register(&pmz_driver);
+#endif
 }
 
 static void __exit exit_pmz(void)
 {
 	int i;
 
+#ifdef CONFIG_PPC_PMAC
 	/* Get rid of macio-driver (detach from macio) */
 	macio_unregister_driver(&pmz_driver);
+#else
+	platform_driver_unregister(&pmz_driver);
+#endif
 
 	for (i = 0; i < pmz_ports_count; i++) {
 		struct uart_pmac_port *uport = &pmz_ports[i];
Index: linux-2.6.31/drivers/serial/pmac_zilog.h
===================================================================
--- linux-2.6.31.orig/drivers/serial/pmac_zilog.h	2009-11-17 17:07:28.000000000 +1100
+++ linux-2.6.31/drivers/serial/pmac_zilog.h	2009-11-17 17:07:38.000000000 +1100
@@ -1,7 +1,15 @@
 #ifndef __PMAC_ZILOG_H__
 #define __PMAC_ZILOG_H__
 
+#ifdef CONFIG_PPC_PMAC
 #define pmz_debug(fmt, arg...)	dev_dbg(&uap->dev->ofdev.dev, fmt, ## arg)
+#define pmz_error(fmt, arg...)	dev_err(&uap->dev->ofdev.dev, fmt, ## arg)
+#define pmz_info(fmt, arg...)	dev_info(&uap->dev->ofdev.dev, fmt, ## arg)
+#else
+#define pmz_debug(fmt, arg...)	do { } while (0)
+#define pmz_error(fmt, arg...)	printk(KERN_ERR fmt, ## arg)
+#define pmz_info(fmt, arg...)	printk(KERN_INFO fmt, ## arg)
+#endif
 
 /*
  * At most 2 ESCCs with 2 ports each
@@ -17,6 +25,7 @@ struct uart_pmac_port {
 	struct uart_port		port;
 	struct uart_pmac_port		*mate;
 
+#ifdef CONFIG_PPC_PMAC
 	/* macio_dev for the escc holding this port (maybe be null on
 	 * early inited port)
 	 */
@@ -25,6 +34,9 @@ struct uart_pmac_port {
 	 * of "escc" node (ie. ch-a or ch-b)
 	 */
 	struct device_node		*node;
+#else
+	struct platform_device		*node;
+#endif
 
 	/* Port type as obtained from device tree (IRDA, modem, ...) */
 	int				port_type;
@@ -55,10 +67,12 @@ struct uart_pmac_port {
 	volatile u8			__iomem *control_reg;
 	volatile u8			__iomem *data_reg;
 
+#ifdef CONFIG_PPC_PMAC
 	unsigned int			tx_dma_irq;
 	unsigned int			rx_dma_irq;
 	volatile struct dbdma_regs	__iomem *tx_dma_regs;
 	volatile struct dbdma_regs	__iomem *rx_dma_regs;
+#endif
 
 	struct ktermios			termios_cache;
 };

^ permalink raw reply

* RE: [PATCH 1/1] ata/sata_sil24: MSI support, disabled by default
From: Mahajan Vivek-B08308 @ 2009-11-17  9:41 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-ide, Grant Grundler, linuxppc-dev
In-Reply-To: <4B0253CF.3090506@garzik.org>

> From: Jeff Garzik [mailto:jeff@garzik.org]=20
> Sent: Tuesday, November 17, 2009 1:12 PM
> > In this case "msi" is supposed to be passed via insmod and not via=20
> > kernel cmdline. If the driver is built-in the kernel, then force=20
> > sata_sil24_msi =3D 1 in the driver to enable it.
>=20
> First, the original patch was just fine, and it was applied. =20
> You should have received email confirmation of this already.

Yes, I did.

> Second, all module options are available on the kernel=20
> command line, when a module is built into the kernel.  You=20
> supply a module name prefix to each module option, on the=20
> kernel command line.

Correct, sata_sil24.msi enables it.

>=20
> 	Jeff

Thanks,
Vivek=20

^ permalink raw reply

* Re: updates to the mscan-driver in net-next
From: David Miller @ 2009-11-17 11:54 UTC (permalink / raw)
  To: w.sang; +Cc: socketcan-core, netdev, linuxppc-dev
In-Reply-To: <1258412274-14686-1-git-send-email-w.sang@pengutronix.de>

From: Wolfram Sang <w.sang@pengutronix.de>
Date: Mon, 16 Nov 2009 23:57:43 +0100

> here are the patches which fix the issues for the mscan & mpc52xx_can drivers
> raised by Wolfgang Grandegger and Grant Likely. They are based on the initial
> version of the drivers I sent a few days ago. Devicetree-discuss has been added
> for the property changes. I will also update my branch on pengutronix.de
> tomorrow, I seem to have issues when trying that from home :(^

All applied to net-next-2.6, thank you.

^ permalink raw reply

* [PATCH 1/4] powerpc: Add Kconfig dependency for PCI_MSI as needed by XICS
From: Mel Gorman @ 2009-11-17 12:07 UTC (permalink / raw)
  To: Paul Mackerras, Benjamin Herrenschmidt
  Cc: Mel Gorman, linuxppc-dev, linux-kernel
In-Reply-To: <1258459659-11770-1-git-send-email-mel@csn.ul.ie>

It's possible to set CONFIG_XICS without CONFIG_PCI_MSI. When that
happens, the kernel fails to build with

arch/powerpc/platforms/built-in.o: In function `.xics_startup':
xics.c:(.text+0x12f60): undefined reference to `.unmask_msi_irq'
make: *** [.tmp_vmlinux1] Error 1

This patch adds the dependency in KConfig.

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
---
 arch/powerpc/platforms/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index 04a8061..21a1fa1 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -52,7 +52,7 @@ config PPC_UDBG_BEAT
 	default n
 
 config XICS
-	depends on PPC_PSERIES
+	depends on PPC_PSERIES && PCI_MSI
 	bool
 	default y
 
-- 
1.6.5

^ permalink raw reply related

* [PATCH 4/4] powerpc: Avoid reference to XICS-related functions when CONFIG_XICS is not set
From: Mel Gorman @ 2009-11-17 12:07 UTC (permalink / raw)
  To: Paul Mackerras, Benjamin Herrenschmidt
  Cc: Mel Gorman, linuxppc-dev, linux-kernel
In-Reply-To: <1258459659-11770-1-git-send-email-mel@csn.ul.ie>

Calls to XICS-related functions is open-coded in a number of places even
when CONFIG_XICS is not set resulting in build failures such as

arch/powerpc/platforms/built-in.o: In function `.pseries_kexec_cpu_down_xics':
kexec.c:(.text+0x15558): undefined reference to `.xics_kexec_teardown_cpu'
arch/powerpc/platforms/built-in.o: In function `.pseries_cpu_disable': hotplug-cpu.c:(.text+0x16104): undefined reference to `.xics_migrate_irqs_away'
arch/powerpc/platforms/built-in.o: In function `.pseries_mach_cpu_die': hotplug-cpu.c:(.text+0x1615c): undefined reference to `.xics_teardown_cpu'
arch/powerpc/platforms/built-in.o: In function `.pseries_xics_init_IRQ': setup.c:(.init.text+0x4590): undefined reference to `.xics_init_IRQ'
make: *** [.tmp_vmlinux1] Error 1

This patch fixes up a number of references such as those described above.

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
---
 arch/powerpc/platforms/pseries/hotplug-cpu.c |    2 ++
 arch/powerpc/platforms/pseries/kexec.c       |    7 +++++++
 arch/powerpc/platforms/pseries/setup.c       |    7 +++++++
 arch/powerpc/platforms/pseries/xics.h        |    8 +++++++-
 4 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index ebff6d9..a2957d6 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -58,7 +58,9 @@ static void pseries_mach_cpu_die(void)
 {
 	local_irq_disable();
 	idle_task_exit();
+#ifdef CONFIG_XICS
 	xics_teardown_cpu();
+#endif
 	unregister_slb_shadow(hard_smp_processor_id(), __pa(get_slb_shadow()));
 	rtas_stop_self();
 	/* Should never get here... */
diff --git a/arch/powerpc/platforms/pseries/kexec.c b/arch/powerpc/platforms/pseries/kexec.c
index 53cbd53..ab79947 100644
--- a/arch/powerpc/platforms/pseries/kexec.c
+++ b/arch/powerpc/platforms/pseries/kexec.c
@@ -51,6 +51,7 @@ void __init setup_kexec_cpu_down_mpic(void)
 	ppc_md.kexec_cpu_down = pseries_kexec_cpu_down_mpic;
 }
 
+#ifdef CONFIG_XICS
 static void pseries_kexec_cpu_down_xics(int crash_shutdown, int secondary)
 {
 	pseries_kexec_cpu_down(crash_shutdown, secondary);
@@ -61,6 +62,12 @@ void __init setup_kexec_cpu_down_xics(void)
 {
 	ppc_md.kexec_cpu_down = pseries_kexec_cpu_down_xics;
 }
+#else
+void __init setup_kexec_cpu_down_xics(void)
+{
+	BUG();
+}
+#endif
 
 static int __init pseries_kexec_setup(void)
 {
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index ca5f2e1..a925fbb 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -210,11 +210,18 @@ static void __init pseries_mpic_init_IRQ(void)
 	pseries_setup_i8259_cascade();
 }
 
+#ifdef CONFIG_XICS
 static void __init pseries_xics_init_IRQ(void)
 {
 	xics_init_IRQ();
 	pseries_setup_i8259_cascade();
 }
+#else
+static void __init pseries_xics_init_IRQ(void)
+{
+	BUG();
+}
+#endif
 
 static void pseries_lpar_enable_pmcs(void)
 {
diff --git a/arch/powerpc/platforms/pseries/xics.h b/arch/powerpc/platforms/pseries/xics.h
index d1d5a83..d0a618d 100644
--- a/arch/powerpc/platforms/pseries/xics.h
+++ b/arch/powerpc/platforms/pseries/xics.h
@@ -16,8 +16,14 @@ extern void xics_init_IRQ(void);
 extern void xics_setup_cpu(void);
 extern void xics_teardown_cpu(void);
 extern void xics_kexec_teardown_cpu(int secondary);
-extern void xics_migrate_irqs_away(void);
 extern int smp_xics_probe(void);
 extern void smp_xics_message_pass(int target, int msg);
+#ifdef CONFIG_XICS
+extern void xics_migrate_irqs_away(void);
+#else
+static inline void xics_migrate_irqs_away(void)
+{
+	BUG();
+}
 
 #endif /* _POWERPC_KERNEL_XICS_H */
-- 
1.6.5

^ permalink raw reply related

* [PATCH 2/4] powerpc: Panic on platform ppc-xicp when CONFIG_XICS not set instead of build failure
From: Mel Gorman @ 2009-11-17 12:07 UTC (permalink / raw)
  To: Paul Mackerras, Benjamin Herrenschmidt
  Cc: Mel Gorman, linuxppc-dev, linux-kernel
In-Reply-To: <1258459659-11770-1-git-send-email-mel@csn.ul.ie>

If CONFIG_XICS is not set but CONFIG_PPC_PSERIES is, then the kernel
fails to build with

arch/powerpc/platforms/pseries/smp.c: In function ‘smp_init_pseries_xics’:
arch/powerpc/platforms/pseries/smp.c:202: error: ‘pSeries_xics_smp_ops’ undeclared (first use in this function)
arch/powerpc/platforms/pseries/smp.c:202: error: (Each undeclared identifier is reported only once
arch/powerpc/platforms/pseries/smp.c:202: error: for each function it appears in.)
make[2]: *** [arch/powerpc/platforms/pseries/smp.o] Error 1

As CONFIG_XICS is not always necessary, this patch allows the kernel to
build but the system will panic at runtime if it is found that XICS is
required.

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
---
 arch/powerpc/platforms/pseries/smp.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
index 440000c..da78ea5 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -199,7 +199,11 @@ void __init smp_init_pseries_mpic(void)
 
 void __init smp_init_pseries_xics(void)
 {
+#ifdef CONFIG_XICS
 	smp_ops = &pSeries_xics_smp_ops;
+#else
+	panic("Support for platform ppc-xicp not configured");
+#endif
 
 	smp_init_pseries();
 }
-- 
1.6.5

^ permalink raw reply related

* [PATCH 3/4] powerpc: Only define smp_pSeries_cpu_bootable when CONFIG_XICS is set
From: Mel Gorman @ 2009-11-17 12:07 UTC (permalink / raw)
  To: Paul Mackerras, Benjamin Herrenschmidt
  Cc: Mel Gorman, linuxppc-dev, linux-kernel
In-Reply-To: <1258459659-11770-1-git-send-email-mel@csn.ul.ie>

If CONFIG_XICS is set, then smp_pSeries_cpu_bootable() is unnecessary.
As warnings are treated as errors, this fails to build.

This patch only defines smp_pSeries_cpu_bootable() when CONFIG_XICS is
set.

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
---
 arch/powerpc/platforms/pseries/smp.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
index da78ea5..62b1141 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -130,6 +130,15 @@ static void __devinit smp_pSeries_kick_cpu(int nr)
 	paca[nr].cpu_start = 1;
 }
 
+#ifdef CONFIG_MPIC
+static struct smp_ops_t pSeries_mpic_smp_ops = {
+	.message_pass	= smp_mpic_message_pass,
+	.probe		= smp_mpic_probe,
+	.kick_cpu	= smp_pSeries_kick_cpu,
+	.setup_cpu	= smp_mpic_setup_cpu,
+};
+#endif
+#ifdef CONFIG_XICS
 static int smp_pSeries_cpu_bootable(unsigned int nr)
 {
 	/* Special case - we inhibit secondary thread startup
@@ -142,15 +151,7 @@ static int smp_pSeries_cpu_bootable(unsigned int nr)
 
 	return 1;
 }
-#ifdef CONFIG_MPIC
-static struct smp_ops_t pSeries_mpic_smp_ops = {
-	.message_pass	= smp_mpic_message_pass,
-	.probe		= smp_mpic_probe,
-	.kick_cpu	= smp_pSeries_kick_cpu,
-	.setup_cpu	= smp_mpic_setup_cpu,
-};
-#endif
-#ifdef CONFIG_XICS
+
 static struct smp_ops_t pSeries_xics_smp_ops = {
 	.message_pass	= smp_xics_message_pass,
 	.probe		= smp_xics_probe,
-- 
1.6.5

^ permalink raw reply related

* [PATCH 0/4] powerpc: Fix minor build issues on 2.6.32-rc7 without CONFIG_XICS set
From: Mel Gorman @ 2009-11-17 12:07 UTC (permalink / raw)
  To: Paul Mackerras, Benjamin Herrenschmidt
  Cc: Mel Gorman, linuxppc-dev, linux-kernel

KConfig doesn't require CONFIG_XICS to be set with CONFIG_PSERIES but if
it's not set, there are numerous small build errors. This is a small series
of patches to allow CONFIG_XICS to be unset in the config.

XICS appears to be some sort of interrupt controller but I'm not sure how
common it is on systems that require CONFIG_PSERIES. If CONFIG_PSERIES
universally requires CONFIG_XICS, the better path might be to force it to
be set.

Testing was building with make oldconfig a configuration from 2.6.31 on
a PPC970.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox