* [PATCH 5/5] of/irq: merge of_irq_map_one()
From: Grant Likely @ 2010-06-04 21:21 UTC (permalink / raw)
Cc: Stephen Rothwell, Michal Simek, microblaze-uclinux,
devicetree-discuss, linuxppc-dev
In-Reply-To: <20100604212134.10552.70717.stgit@angua>
Merge common implementation of of_irq_map_one(). Rename it to
__of_irq_map_one() so that arch code can either use the stock
implementation, or override it to handle platform quirks.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
CC: Michal Simek <monstr@monstr.eu>
CC: Wolfram Sang <w.sang@pengutronix.de>
CC: Stephen Rothwell <sfr@canb.auug.org.au>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: microblaze-uclinux@itee.uq.edu.au
CC: linuxppc-dev@ozlabs.org
CC: devicetree-discuss@lists.ozlabs.org
---
arch/microblaze/include/asm/prom.h | 3 -
arch/microblaze/kernel/prom_parse.c | 73 ------------------------------
arch/powerpc/include/asm/prom.h | 3 -
arch/powerpc/kernel/prom_parse.c | 55 -----------------------
drivers/of/irq.c | 85 +++++++++++++++++++++++++++++++++++
include/linux/of_irq.h | 6 ++
6 files changed, 91 insertions(+), 134 deletions(-)
diff --git a/arch/microblaze/include/asm/prom.h b/arch/microblaze/include/asm/prom.h
index 89fca70..3659930 100644
--- a/arch/microblaze/include/asm/prom.h
+++ b/arch/microblaze/include/asm/prom.h
@@ -107,9 +107,6 @@ extern const void *of_get_mac_address(struct device_node *np);
struct pci_dev;
extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
-extern int of_irq_to_resource(struct device_node *dev, int index,
- struct resource *r);
-
/**
* of_iomap - Maps the memory mapped IO for a given device_node
* @device: the device whose io range will be mapped
diff --git a/arch/microblaze/kernel/prom_parse.c b/arch/microblaze/kernel/prom_parse.c
index 02ec946..70c0471 100644
--- a/arch/microblaze/kernel/prom_parse.c
+++ b/arch/microblaze/kernel/prom_parse.c
@@ -656,49 +656,7 @@ struct device_node *of_irq_find_parent_by_phandle(phandle p)
int of_irq_map_one(struct device_node *device,
int index, struct of_irq *out_irq)
{
- struct device_node *p;
- const u32 *intspec, *tmp, *addr;
- u32 intsize, intlen;
- int res;
-
- pr_debug("of_irq_map_one: dev=%s, index=%d\n",
- device->full_name, index);
-
- /* Get the interrupts property */
- intspec = of_get_property(device, "interrupts", (int *) &intlen);
- if (intspec == NULL)
- return -EINVAL;
- intlen /= sizeof(u32);
-
- pr_debug(" intspec=%d intlen=%d\n", *intspec, intlen);
-
- /* Get the reg property (if any) */
- addr = of_get_property(device, "reg", NULL);
-
- /* Look for the interrupt parent. */
- p = of_irq_find_parent(device);
- if (p == NULL)
- return -EINVAL;
-
- /* Get size of interrupt specifier */
- tmp = of_get_property(p, "#interrupt-cells", NULL);
- if (tmp == NULL) {
- of_node_put(p);
- return -EINVAL;
- }
- intsize = *tmp;
-
- pr_debug(" intsize=%d intlen=%d\n", intsize, intlen);
-
- /* Check index */
- if ((index + 1) * intsize > intlen)
- return -EINVAL;
-
- /* Get new specifier and map it */
- res = of_irq_map_raw(p, intspec + index * intsize, intsize,
- addr, out_irq);
- of_node_put(p);
- return res;
+ return __of_irq_map_one(device, index, out_irq);
}
EXPORT_SYMBOL_GPL(of_irq_map_one);
@@ -740,35 +698,6 @@ const void *of_get_mac_address(struct device_node *np)
}
EXPORT_SYMBOL(of_get_mac_address);
-int of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
-{
- struct of_irq out_irq;
- int irq;
- int res;
-
- res = of_irq_map_one(dev, index, &out_irq);
-
- /* Get irq for the device */
- if (res) {
- pr_debug("IRQ not found... code = %d", res);
- return NO_IRQ;
- }
- /* Assuming single interrupt controller... */
- irq = out_irq.specifier[0];
-
- pr_debug("IRQ found = %d", irq);
-
- /* Only dereference the resource if both the
- * resource and the irq are valid. */
- if (r && irq != NO_IRQ) {
- r->start = r->end = irq;
- r->flags = IORESOURCE_IRQ;
- }
-
- return irq;
-}
-EXPORT_SYMBOL_GPL(of_irq_to_resource);
-
void __iomem *of_iomap(struct device_node *np, int index)
{
struct resource res;
diff --git a/arch/powerpc/include/asm/prom.h b/arch/powerpc/include/asm/prom.h
index 187ef4e..2440984 100644
--- a/arch/powerpc/include/asm/prom.h
+++ b/arch/powerpc/include/asm/prom.h
@@ -136,9 +136,6 @@ extern void of_irq_map_init(unsigned int flags);
struct pci_dev;
extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
-extern int of_irq_to_resource(struct device_node *dev, int index,
- struct resource *r);
-
/**
* of_iomap - Maps the memory mapped IO for a given device_node
* @device: the device whose io range will be mapped
diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c
index 89ca7b3..ef518e3 100644
--- a/arch/powerpc/kernel/prom_parse.c
+++ b/arch/powerpc/kernel/prom_parse.c
@@ -777,49 +777,11 @@ static int of_irq_map_oldworld(struct device_node *device, int index,
int of_irq_map_one(struct device_node *device, int index, struct of_irq *out_irq)
{
- struct device_node *p;
- const u32 *intspec, *tmp, *addr;
- u32 intsize, intlen;
- int res = -EINVAL;
-
- DBG("of_irq_map_one: dev=%s, index=%d\n", device->full_name, index);
-
/* OldWorld mac stuff is "special", handle out of line */
if (of_irq_workarounds & OF_IMAP_OLDWORLD_MAC)
return of_irq_map_oldworld(device, index, out_irq);
- /* Get the interrupts property */
- intspec = of_get_property(device, "interrupts", &intlen);
- if (intspec == NULL)
- return -EINVAL;
- intlen /= sizeof(u32);
-
- /* Get the reg property (if any) */
- addr = of_get_property(device, "reg", NULL);
-
- /* Look for the interrupt parent. */
- p = of_irq_find_parent(device);
- if (p == NULL)
- return -EINVAL;
-
- /* Get size of interrupt specifier */
- tmp = of_get_property(p, "#interrupt-cells", NULL);
- if (tmp == NULL)
- goto out;
- intsize = *tmp;
-
- DBG(" intsize=%d intlen=%d\n", intsize, intlen);
-
- /* Check index */
- if ((index + 1) * intsize > intlen)
- goto out;
-
- /* Get new specifier and map it */
- res = of_irq_map_raw(p, intspec + index * intsize, intsize,
- addr, out_irq);
-out:
- of_node_put(p);
- return res;
+ return __of_irq_map_one(device, index, out_irq);
}
EXPORT_SYMBOL_GPL(of_irq_map_one);
@@ -861,21 +823,6 @@ const void *of_get_mac_address(struct device_node *np)
}
EXPORT_SYMBOL(of_get_mac_address);
-int of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
-{
- int irq = irq_of_parse_and_map(dev, index);
-
- /* Only dereference the resource if both the
- * resource and the irq are valid. */
- if (r && irq != NO_IRQ) {
- r->start = r->end = irq;
- r->flags = IORESOURCE_IRQ;
- }
-
- return irq;
-}
-EXPORT_SYMBOL_GPL(of_irq_to_resource);
-
void __iomem *of_iomap(struct device_node *np, int index)
{
struct resource res;
diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index 351c87a..dd420e5 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -31,7 +31,7 @@
* Returns a pointer to the interrupt parent node, or NULL if the interrupt
* parent could not be determined.
*/
-struct device_node *of_irq_find_parent(struct device_node *child)
+static struct device_node *of_irq_find_parent(struct device_node *child)
{
struct device_node *p;
const phandle *parp;
@@ -240,6 +240,67 @@ int of_irq_map_raw(struct device_node *parent, const u32 *intspec, u32 ointsize,
}
EXPORT_SYMBOL_GPL(of_irq_map_raw);
+/**
+ * of_irq_map_one - Resolve an interrupt for a device
+ * @device: the device whose interrupt is to be resolved
+ * @index: index of the interrupt to resolve
+ * @out_irq: structure of_irq filled by this function
+ *
+ * This function resolves an interrupt, walking the tree, for a given
+ * device-tree node. It's the high level pendant to of_irq_map_raw().
+ *
+ * Architecture code must provide of_irq_map_one() which can simply be a
+ * wrapper around __of_irq_map_one(), or can override it to deal with
+ * arch specific quirks and bugs.
+ */
+int __of_irq_map_one(struct device_node *device, int index,
+ struct of_irq *out_irq)
+{
+ struct device_node *p;
+ const u32 *intspec, *tmp, *addr;
+ u32 intsize, intlen;
+ int res = -EINVAL;
+
+ pr_debug("of_irq_map_one: dev=%s, index=%d\n",
+ device->full_name, index);
+
+ /* Get the interrupts property */
+ intspec = of_get_property(device, "interrupts", &intlen);
+ if (intspec == NULL)
+ return -EINVAL;
+ intlen /= sizeof(u32);
+
+ pr_debug(" intspec=%d intlen=%d\n", *intspec, intlen);
+
+ /* Get the reg property (if any) */
+ addr = of_get_property(device, "reg", NULL);
+
+ /* Look for the interrupt parent. */
+ p = of_irq_find_parent(device);
+ if (p == NULL)
+ return -EINVAL;
+
+ /* Get size of interrupt specifier */
+ tmp = of_get_property(p, "#interrupt-cells", NULL);
+ if (tmp == NULL)
+ goto out;
+ intsize = *tmp;
+
+ pr_debug(" intsize=%d intlen=%d\n", intsize, intlen);
+
+ /* Check index */
+ if ((index + 1) * intsize > intlen)
+ goto out;
+
+ /* Get new specifier and map it */
+ res = of_irq_map_raw(p, intspec + index * intsize, intsize,
+ addr, out_irq);
+ out:
+ of_node_put(p);
+ return res;
+}
+EXPORT_SYMBOL_GPL(__of_irq_map_one);
+
unsigned int irq_of_parse_and_map(struct device_node *dev, int index)
{
struct of_irq oirq;
@@ -251,3 +312,25 @@ unsigned int irq_of_parse_and_map(struct device_node *dev, int index)
oirq.size);
}
EXPORT_SYMBOL_GPL(irq_of_parse_and_map);
+
+/**
+ * of_irq_to_resource - Decode a node's IRQ and return it as a resource
+ * @dev: pointer to device tree node
+ * @index: zero-based index of the irq
+ * @r: pointer to resource structure to return result into.
+ */
+unsigned int of_irq_to_resource(struct device_node *dev, int index,
+ struct resource *r)
+{
+ unsigned int irq = irq_of_parse_and_map(dev, index);
+
+ /* Only dereference the resource if both the
+ * resource and the irq are valid. */
+ if (r && irq != NO_IRQ) {
+ r->start = r->end = irq;
+ r->flags = IORESOURCE_IRQ;
+ }
+
+ return irq;
+}
+EXPORT_SYMBOL_GPL(of_irq_to_resource);
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h
index 51c520b..935a14d 100644
--- a/include/linux/of_irq.h
+++ b/include/linux/of_irq.h
@@ -5,6 +5,7 @@
struct of_irq;
#include <linux/types.h>
#include <linux/of.h>
+#include <linux/ioport.h>
/*
* irq_of_parse_and_map() is used ba all OF enabled platforms; but SPARC
@@ -31,14 +32,17 @@ struct of_irq {
};
extern struct device_node *of_irq_find_parent_by_phandle(phandle p);
-extern struct device_node *of_irq_find_parent(struct device_node *child);
extern int of_irq_map_raw(struct device_node *parent, const u32 *intspec,
u32 ointsize, const u32 *addr, struct of_irq *out_irq);
+extern int __of_irq_map_one(struct device_node *device, int index,
+ struct of_irq *out_irq);
extern int of_irq_map_one(struct device_node *device, int index,
struct of_irq *out_irq);
extern unsigned int irq_create_of_mapping(struct device_node *controller,
const u32 *intspec,
unsigned int intsize);
+extern unsigned int of_irq_to_resource(struct device_node *dev, int index,
+ struct resource *r);
#endif /* CONFIG_OF_IRQ */
#endif /* CONFIG_OF */
^ permalink raw reply related
* [PATCH 0/5] Consolidate OF IRQ handling code
From: Grant Likely @ 2010-06-04 21:24 UTC (permalink / raw)
To: Grant Likely
Cc: Stephen Rothwell, Michal Simek, devicetree-discuss, linuxppc-dev,
microblaze-uclinux, sparclinux, Jeremy Kerr, David S. Miller
This series merges the common IRQ handling code between Microblaze and Powerpc.
I'll be adding these patches to linux-next next week unless there are
objections.
Cheers,
g.
Grant Likely (5):
of/irq: Move irq_of_parse_and_map() to common code
of/microblaze: strip out of_irq_workarounds code
of/irq: merge of_irq_find_parent()
of/irq: Merge of_irq_map_raw()
of/irq: merge of_irq_map_one()
arch/microblaze/include/asm/irq.h | 13 --
arch/microblaze/include/asm/prom.h | 63 +-------
arch/microblaze/kernel/irq.c | 14 +--
arch/microblaze/kernel/prom_parse.c | 321 +---------------------------------
arch/powerpc/include/asm/irq.h | 13 --
arch/powerpc/include/asm/prom.h | 51 +-----
arch/powerpc/kernel/irq.c | 14 +--
arch/powerpc/kernel/prom_parse.c | 254 +--------------------------
arch/sparc/include/asm/prom.h | 1 -
drivers/of/Kconfig | 4 +
drivers/of/Makefile | 1 +
drivers/of/irq.c | 336 +++++++++++++++++++++++++++++++++++
drivers/of/of_mdio.c | 1 +
include/linux/of_irq.h | 49 +++++
14 files changed, 405 insertions(+), 730 deletions(-)
create mode 100644 drivers/of/irq.c
create mode 100644 include/linux/of_irq.h
^ permalink raw reply
* [PATCH 0/2] ipic and pca953x irq patches
From: Esben Haabendal @ 2010-06-04 21:25 UTC (permalink / raw)
To: linuxppc-dev
A minor bugfix for the ipic driver, and powerpc support for pca953x irq.
Esben Haabendal (2):
powerpc: ipic: use set_irq_chip to ensure irq_chip defaults are
applied
gpio: pca953x: add powerpc irq support
arch/powerpc/sysdev/ipic.c | 4 +-
drivers/gpio/pca953x.c | 347 ++++++++++++++++++++++++++++++--------------
2 files changed, 242 insertions(+), 109 deletions(-)
^ permalink raw reply
* [PATCH 1/2] powerpc: ipic: use set_irq_chip to ensure irq_chip defaults are applied
From: Esben Haabendal @ 2010-06-04 21:25 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <cover.1275686504.git.eha@doredevelopment.dk>
Signed-off-by: Esben Haabendal <eha@doredevelopment.dk>
---
arch/powerpc/sysdev/ipic.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c
index d7b9b9c..8464b86 100644
--- a/arch/powerpc/sysdev/ipic.c
+++ b/arch/powerpc/sysdev/ipic.c
@@ -630,10 +630,10 @@ static int ipic_set_irq_type(unsigned int virq, unsigned int flow_type)
if (flow_type & IRQ_TYPE_LEVEL_LOW) {
desc->status |= IRQ_LEVEL;
desc->handle_irq = handle_level_irq;
- desc->chip = &ipic_level_irq_chip;
+ set_irq_chip(virq, &ipic_level_irq_chip);
} else {
desc->handle_irq = handle_edge_irq;
- desc->chip = &ipic_edge_irq_chip;
+ set_irq_chip(virq, &ipic_edge_irq_chip);
}
/* only EXT IRQ senses are programmable on ipic
--
1.7.1
^ permalink raw reply related
* [PATCH 2/2] gpio: pca953x: add powerpc irq support
From: Esben Haabendal @ 2010-06-04 21:25 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <cover.1275686504.git.eha@doredevelopment.dk>
Signed-off-by: Esben Haabendal <eha@doredevelopment.dk>
---
drivers/gpio/pca953x.c | 347 +++++++++++++++++++++++++++++++++---------------
1 files changed, 240 insertions(+), 107 deletions(-)
diff --git a/drivers/gpio/pca953x.c b/drivers/gpio/pca953x.c
index a2b12aa..a47d55f 100644
--- a/drivers/gpio/pca953x.c
+++ b/drivers/gpio/pca953x.c
@@ -3,6 +3,7 @@
*
* Copyright (C) 2005 Ben Gardner <bgardner@wabtec.com>
* Copyright (C) 2007 Marvell International Ltd.
+ * Copyright (C) 2010 DoreDevelopment ApS
*
* Derived from drivers/i2c/chips/pca9539.c
*
@@ -67,8 +68,11 @@ struct pca953x_chip {
uint16_t irq_stat;
uint16_t irq_trig_raise;
uint16_t irq_trig_fall;
- int irq_base;
-#endif
+ int irq_base;
+#ifdef CONFIG_PPC
+ struct irq_host *irq_host;
+#endif /* CONFIG_PPC */
+#endif /* CONFIG_GPIO_PCA953X_IRQ */
struct i2c_client *client;
struct pca953x_platform_data *dyn_pdata;
@@ -120,6 +124,10 @@ static int pca953x_gpio_direction_input(struct gpio_chip *gc, unsigned off)
chip = container_of(gc, struct pca953x_chip, gpio_chip);
reg_val = chip->reg_direction | (1u << off);
+
+ if (reg_val == chip->reg_direction)
+ return 0;
+
ret = pca953x_write_reg(chip, PCA953X_DIRECTION, reg_val);
if (ret)
return ret;
@@ -220,63 +228,41 @@ static void pca953x_setup_gpio(struct pca953x_chip *chip, int gpios)
}
#ifdef CONFIG_GPIO_PCA953X_IRQ
-static int pca953x_gpio_to_irq(struct gpio_chip *gc, unsigned off)
-{
- struct pca953x_chip *chip;
- chip = container_of(gc, struct pca953x_chip, gpio_chip);
- return chip->irq_base + off;
-}
+#ifdef CONFIG_PPC
-static void pca953x_irq_mask(unsigned int irq)
-{
- struct pca953x_chip *chip = get_irq_chip_data(irq);
-
- chip->irq_mask &= ~(1 << (irq - chip->irq_base));
-}
+#define pca953x_pin_to_virq(chip, pin) \
+ (irq_linear_revmap((chip)->irq_host, pin))
+#define pca953x_virq_to_pin(chip, virq) \
+ (virq_to_hw(virq))
-static void pca953x_irq_unmask(unsigned int irq)
+static void pca953x_irq_mask(unsigned int virq)
{
- struct pca953x_chip *chip = get_irq_chip_data(irq);
-
- chip->irq_mask |= 1 << (irq - chip->irq_base);
+ struct pca953x_chip *chip = get_irq_chip_data(virq);
+ int pin = pca953x_virq_to_pin(chip, virq);
+ pr_debug("%s: virq=%d pin=%d\n", __func__, virq, pin);
+ chip->irq_mask &= ~(1 << pin);
}
-static void pca953x_irq_bus_lock(unsigned int irq)
+static void pca953x_irq_unmask(unsigned int virq)
{
- struct pca953x_chip *chip = get_irq_chip_data(irq);
-
- mutex_lock(&chip->irq_lock);
+ struct pca953x_chip *chip = get_irq_chip_data(virq);
+ int pin = pca953x_virq_to_pin(chip, virq);
+ pr_debug("%s: virq=%d hwirq=%d\n", __func__, virq, pin);
+ chip->irq_mask |= 1 << pin;
}
-static void pca953x_irq_bus_sync_unlock(unsigned int irq)
+static int pca953x_irq_set_type(unsigned int virq, unsigned int type)
{
- struct pca953x_chip *chip = get_irq_chip_data(irq);
- uint16_t new_irqs;
- uint16_t level;
+ struct pca953x_chip *chip = get_irq_chip_data(virq);
+ int pin = pca953x_virq_to_pin(chip, virq);
+ uint16_t mask = 1 << pin;
- /* Look for any newly setup interrupt */
- new_irqs = chip->irq_trig_fall | chip->irq_trig_raise;
- new_irqs &= ~chip->reg_direction;
-
- while (new_irqs) {
- level = __ffs(new_irqs);
- pca953x_gpio_direction_input(&chip->gpio_chip, level);
- new_irqs &= ~(1 << level);
- }
-
- mutex_unlock(&chip->irq_lock);
-}
-
-static int pca953x_irq_set_type(unsigned int irq, unsigned int type)
-{
- struct pca953x_chip *chip = get_irq_chip_data(irq);
- uint16_t level = irq - chip->irq_base;
- uint16_t mask = 1 << level;
+ pr_debug("%s: virq=%d pin=%d type=0x%x\n", __func__, virq, pin, type);
if (!(type & IRQ_TYPE_EDGE_BOTH)) {
- dev_err(&chip->client->dev, "irq %d: unsupported type %d\n",
- irq, type);
+ dev_err(&chip->client->dev, "virq %d: unsupported type %d\n",
+ virq, type);
return -EINVAL;
}
@@ -297,11 +283,140 @@ static struct irq_chip pca953x_irq_chip = {
.name = "pca953x",
.mask = pca953x_irq_mask,
.unmask = pca953x_irq_unmask,
+#ifndef CONFIG_PPC
.bus_lock = pca953x_irq_bus_lock,
.bus_sync_unlock = pca953x_irq_bus_sync_unlock,
+#endif /* !CONFIG_PPC */
.set_type = pca953x_irq_set_type,
};
+static int pca953x_irq_host_match(struct irq_host *h, struct device_node *node)
+{
+ pr_debug("%s: node=%s\n", __func__, node->full_name);
+ return h->of_node == NULL || h->of_node == node;
+}
+
+static int pca953x_irq_host_map(struct irq_host *h, unsigned int virq,
+ irq_hw_number_t hwirq)
+{
+ struct pca953x_chip *chip = h->host_data;
+
+ pr_debug("%s: virq=%d hwirq=%ld\n", __func__, virq, hwirq);
+
+ set_irq_chip_data(virq, chip);
+ set_irq_chip_and_handler(virq, &pca953x_irq_chip, handle_edge_irq);
+ set_irq_nested_thread(virq, 1);
+
+ /* On powerpc, we set the direction to input on map(),
+ * avoiding the use of genirq buslock, and thereby not
+ * restricting the use of generic interrupt management
+ * functions. */
+ pca953x_gpio_direction_input(&chip->gpio_chip, hwirq);
+
+ return 0;
+}
+
+static int pca953x_irq_host_xlate(struct irq_host *h, struct device_node *node,
+ const u32 *intspec, unsigned int intsize,
+ irq_hw_number_t *hwirq, unsigned int *flags)
+{
+ pr_debug("%s: irq_host=%p node=%s\n", __func__, h, node->full_name);
+ *hwirq = intspec[0];
+ if (intsize > 1)
+ *flags = intspec[1];
+ else
+ *flags = IRQ_TYPE_EDGE_BOTH;
+ pr_debug("%s: hwirq=%ld flags=0x%x\n", __func__, *hwirq, *flags);
+ return 0;
+}
+
+static struct irq_host_ops pca953x_irq_host_ops = {
+ .match = pca953x_irq_host_match,
+ .map = pca953x_irq_host_map,
+ .xlate = pca953x_irq_host_xlate,
+};
+
+#define pca953x_irq_setup_premap(chip) do {} while (0)
+
+static void pca953x_irq_alloc_host(struct pca953x_chip *chip,
+ struct device_node *node)
+{
+ chip->irq_host = irq_alloc_host(
+ node, IRQ_HOST_MAP_LINEAR, chip->gpio_chip.ngpio,
+ &pca953x_irq_host_ops, -1);
+ chip->irq_host->host_data = chip;
+}
+
+#else /* CONFIG_PPC */
+
+#define pca953x_pin_to_virq(chip, pin) \
+ ((chip)->irq_base + pin)
+#define pca953x_virq_to_pin(chip, virq) \
+ (virq - (chip)->irq_base)
+
+/* Use the genirq buslock support on non-powerpc archs for setting
+ * gpio direction on enable_irq, which unfortunately means that some
+ * of the generic interrupt management functions like enable_irq,
+ * disable_irq and so on cannot be used in atomic context on irq's
+ * from this interrupt controller. */
+static void pca953x_irq_bus_lock(unsigned int virq)
+{
+ struct pca953x_chip *chip = get_irq_chip_data(virq);
+ pr_debug("%s: virq=%d\n", __func__, virq);
+ mutex_lock(&chip->irq_lock);
+}
+
+static void pca953x_irq_bus_sync_unlock(unsigned int virq)
+{
+ struct pca953x_chip *chip = get_irq_chip_data(virq);
+ uint16_t new_irqs;
+ uint16_t pin;
+ pr_debug("%s: virq=%d\n", __func__, virq);
+
+ /* Look for any newly setup interrupt */
+ new_irqs = chip->irq_trig_fall | chip->irq_trig_raise;
+ new_irqs &= ~chip->reg_direction;
+
+ while (new_irqs) {
+ pin = __ffs(new_irqs);
+ pca953x_gpio_direction_input(&chip->gpio_chip, pin);
+ new_irqs &= ~(1 << pin);
+ }
+
+ mutex_unlock(&chip->irq_lock);
+}
+
+static void pca953x_irq_setup_premap(struct pca953x_chipo *chip)
+{
+ int pin;
+
+ for (pin = 0; pin < chip->gpio_chip.ngpio; pin++) {
+ int irq = pin + chip->irq_base;
+
+ //irq_to_desc_alloc_node(irq, 0);
+ set_irq_chip_data(irq, chip);
+ set_irq_chip_and_handler(irq, &pca953x_irq_chip,
+ handle_edge_irq);
+ set_irq_nested_thread(irq, 1);
+#ifdef CONFIG_ARM
+ set_irq_flags(irq, IRQF_VALID);
+#else /* CONFIG_ARM */
+ set_irq_noprobe(irq);
+#endif /* CONFIG_ARM */
+ }
+}
+
+#define pca953x_irq_alloc_host(chip) do {} while (0)
+
+#endif /* CONFIG_PPC */
+
+static int pca953x_gpio_to_irq(struct gpio_chip *gc, unsigned off)
+{
+ struct pca953x_chip *chip;
+ chip = container_of(gc, struct pca953x_chip, gpio_chip);
+ return pca953x_pin_to_virq(chip, off);
+}
+
static uint16_t pca953x_irq_pending(struct pca953x_chip *chip)
{
uint16_t cur_stat;
@@ -317,14 +432,20 @@ static uint16_t pca953x_irq_pending(struct pca953x_chip *chip)
/* Remove output pins from the equation */
cur_stat &= chip->reg_direction;
+ /* Remember the input */
old_stat = chip->irq_stat;
+ chip->irq_stat = cur_stat;
+
+ /* Find changed inputs which are not masked out */
trigger = (cur_stat ^ old_stat) & chip->irq_mask;
+ pr_debug("%s: irq_mask=0x%04x old_stat=0x%04x cur_stat=0x%04x\n",
+ __func__, chip->irq_mask, old_stat, cur_stat);
+
if (!trigger)
return 0;
- chip->irq_stat = cur_stat;
-
+ /* And finally, get the pending irq's */
pending = (old_stat & chip->irq_trig_fall) |
(cur_stat & chip->irq_trig_raise);
pending &= trigger;
@@ -332,22 +453,26 @@ static uint16_t pca953x_irq_pending(struct pca953x_chip *chip)
return pending;
}
-static irqreturn_t pca953x_irq_handler(int irq, void *devid)
+static irqreturn_t pca953x_irq_thread_fn(int irq, void *devid)
{
struct pca953x_chip *chip = devid;
uint16_t pending;
- uint16_t level;
+ uint16_t pin;
pending = pca953x_irq_pending(chip);
+ pr_debug("%s: virq=%d pending=0x%04x\n", __func__, irq, pending);
+
if (!pending)
return IRQ_HANDLED;
do {
- level = __ffs(pending);
- handle_nested_irq(level + chip->irq_base);
-
- pending &= ~(1 << level);
+ unsigned int gpio_irq;
+ pin = __ffs(pending);
+ gpio_irq = pca953x_pin_to_virq(chip, pin);
+ pr_debug("%s: pin=%hu gpio_irq=%d\n", __func__, pin, gpio_irq);
+ handle_nested_irq(gpio_irq);
+ pending &= ~(1 << pin);
} while (pending);
return IRQ_HANDLED;
@@ -360,51 +485,39 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
struct pca953x_platform_data *pdata = client->dev.platform_data;
int ret;
- if (pdata->irq_base && (id->driver_data & PCA953X_INT)) {
- int lvl;
+ if (! ((pdata->irq_base || chip->irq_host) &&
+ (id->driver_data & PCA953X_INT)))
+ return 0;
- ret = pca953x_read_reg(chip, PCA953X_INPUT,
- &chip->irq_stat);
- if (ret)
- goto out_failed;
+ ret = pca953x_read_reg(chip, PCA953X_INPUT, &chip->irq_stat);
+ if (ret)
+ goto out_failed;
- /*
- * There is no way to know which GPIO line generated the
- * interrupt. We have to rely on the previous read for
- * this purpose.
- */
- chip->irq_stat &= chip->reg_direction;
- chip->irq_base = pdata->irq_base;
- mutex_init(&chip->irq_lock);
+ /*
+ * There is no way to know which GPIO line generated the
+ * interrupt. We have to rely on the previous read for
+ * this purpose.
+ */
+ chip->irq_stat &= chip->reg_direction;
+ mutex_init(&chip->irq_lock);
- for (lvl = 0; lvl < chip->gpio_chip.ngpio; lvl++) {
- int irq = lvl + chip->irq_base;
+ chip->irq_base = pdata->irq_base;
- set_irq_chip_data(irq, chip);
- set_irq_chip_and_handler(irq, &pca953x_irq_chip,
- handle_edge_irq);
- set_irq_nested_thread(irq, 1);
-#ifdef CONFIG_ARM
- set_irq_flags(irq, IRQF_VALID);
-#else
- set_irq_noprobe(irq);
-#endif
- }
-
- ret = request_threaded_irq(client->irq,
- NULL,
- pca953x_irq_handler,
- IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
- dev_name(&client->dev), chip);
- if (ret) {
- dev_err(&client->dev, "failed to request irq %d\n",
- client->irq);
- goto out_failed;
- }
+ pca953x_irq_setup_premap(chip);
- chip->gpio_chip.to_irq = pca953x_gpio_to_irq;
+ pr_debug("%s: requesting irq=%d\n", __func__, client->irq);
+ ret = request_threaded_irq(client->irq,
+ NULL, pca953x_irq_thread_fn,
+ IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
+ dev_name(&client->dev), chip);
+ if (ret) {
+ dev_err(&client->dev, "failed to request irq %d\n",
+ client->irq);
+ goto out_failed;
}
+ chip->gpio_chip.to_irq = pca953x_gpio_to_irq;
+
return 0;
out_failed:
@@ -414,17 +527,20 @@ out_failed:
static void pca953x_irq_teardown(struct pca953x_chip *chip)
{
- if (chip->irq_base)
+ if (chip->irq_host || chip->irq_base)
free_irq(chip->client->irq, chip);
}
+
#else /* CONFIG_GPIO_PCA953X_IRQ */
+
static int pca953x_irq_setup(struct pca953x_chip *chip,
const struct i2c_device_id *id)
{
struct i2c_client *client = chip->client;
struct pca953x_platform_data *pdata = client->dev.platform_data;
- if (pdata->irq_base && (id->driver_data & PCA953X_INT))
+ if ((chip->irq_host || pdata->irq_base) &&
+ (id->driver_data & PCA953X_INT))
dev_warn(&client->dev, "interrupt support not compiled in\n");
return 0;
@@ -433,21 +549,21 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
static void pca953x_irq_teardown(struct pca953x_chip *chip)
{
}
-#endif
-/*
- * Handlers for alternative sources of platform_data
- */
+#endif /* CONFIG_GPIO_PCA953X_IRQ */
+
#ifdef CONFIG_OF_GPIO
+
/*
* Translate OpenFirmware node properties into platform_data
*/
static struct pca953x_platform_data *
-pca953x_get_alt_pdata(struct i2c_client *client)
+pca953x_get_alt_pdata(struct pca953x_chip *chip)
{
+ struct i2c_client *client = chip->client;
struct pca953x_platform_data *pdata;
struct device_node *node;
- const uint16_t *val;
+ const int *val;
node = client->dev.of_node;
if (node == NULL)
@@ -469,19 +585,34 @@ pca953x_get_alt_pdata(struct i2c_client *client)
pdata->gpio_base = *val;
}
+ pdata->irq_base = -1;
+ val = of_get_property(node, "linux,irq-base", NULL);
+ if (val) {
+ if (*val < 0)
+ dev_warn(&client->dev,
+ "invalid irq-base in device tree\n");
+ else
+ pdata->irq_base = *val;
+ }
+
val = of_get_property(node, "polarity", NULL);
if (val)
pdata->invert = *val;
+ pca953x_irq_alloc_host(chip, node);
+
return pdata;
}
-#else
+
+#else /* CONFIG_OF_GPIO */
+
static struct pca953x_platform_data *
pca953x_get_alt_pdata(struct i2c_client *client)
{
return NULL;
}
-#endif
+
+#endif /* CONFIG_OF_GPIO */
static int __devinit pca953x_probe(struct i2c_client *client,
const struct i2c_device_id *id)
@@ -490,13 +621,18 @@ static int __devinit pca953x_probe(struct i2c_client *client,
struct pca953x_chip *chip;
int ret;
+ pr_debug("%s\n", __func__);
+
chip = kzalloc(sizeof(struct pca953x_chip), GFP_KERNEL);
if (chip == NULL)
return -ENOMEM;
+ chip->client = client;
+
pdata = client->dev.platform_data;
if (pdata == NULL) {
- pdata = pca953x_get_alt_pdata(client);
+ pdata = pca953x_get_alt_pdata(chip);
+ client->dev.platform_data = pdata;
/*
* Unlike normal platform_data, this is allocated
* dynamically and must be freed in the driver
@@ -510,10 +646,7 @@ static int __devinit pca953x_probe(struct i2c_client *client,
goto out_failed;
}
- chip->client = client;
-
chip->gpio_start = pdata->gpio_base;
-
chip->names = pdata->names;
/* initialize cached registers from their original values.
--
1.7.1
^ permalink raw reply related
* [PATCH] [powerpc] do not expect executable permissions for in-tree shell scripts
From: Olaf Hering @ 2010-06-05 8:10 UTC (permalink / raw)
To: linuxppc-dev, Benjamin Herrenschmidt; +Cc: stable
scripts in the kernel source do not have executable permissions if they were created with patch(1)
run mkuboot.sh with bash, its tagged as bash script.
/opt/cross/kernel/linux-2.6.33-cross-host-kernel-source/arch/powerpc/boot/wrapper: line 273: /opt/cross/kernel/linux-2.6.33-cross-host-kernel-source/scripts/mkuboot.sh: Permission denied
Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
This happens with 2.6.33, other versions have this bug as well.
arch/powerpc/boot/wrapper | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- linux-2.6.33-cross-host-kernel-source.orig/arch/powerpc/boot/wrapper
+++ linux-2.6.33-cross-host-kernel-source/arch/powerpc/boot/wrapper
@@ -270,7 +270,7 @@ membase=`${CROSS}objdump -p "$kernel" |
case "$platform" in
uboot)
rm -f "$ofile"
- ${MKIMAGE} -A ppc -O linux -T kernel -C gzip -a $membase -e $membase \
+ bash ${MKIMAGE} -A ppc -O linux -T kernel -C gzip -a $membase -e $membase \
$uboot_version -d "$vmz" "$ofile"
if [ -z "$cacheit" ]; then
rm -f "$vmz"
@@ -330,7 +330,7 @@ coff)
;;
cuboot*)
gzip -f -9 "$ofile"
- ${MKIMAGE} -A ppc -O linux -T kernel -C gzip -a "$base" -e "$entry" \
+ bash ${MKIMAGE} -A ppc -O linux -T kernel -C gzip -a "$base" -e "$entry" \
$uboot_version -d "$ofile".gz "$ofile"
;;
treeboot*)
^ permalink raw reply
* Re: [PATCH v21 011/100] eclone (11/11): Document sys_eclone
From: Albert Cahalan @ 2010-06-05 11:49 UTC (permalink / raw)
To: Sukadev Bhattiprolu; +Cc: randy.dunlap, linuxppc-dev, linux-kernel
In-Reply-To: <20100602013839.GB17579@us.ibm.com>
On Tue, Jun 1, 2010 at 9:38 PM, Sukadev Bhattiprolu
<sukadev@linux.vnet.ibm.com> wrote:
> | Come on, seriously, you know it's ia64 and hppa that
> | have issues. Maybe the nommu ports also have issues.
> |
> | The only portable way to specify the stack is base and offset,
> | with flags or magic values for "share" and "kernel managed".
>
> Ah, ok, we have not yet ported to IA64 and I see now where the #ifdef
> comes in.
>
> But are you saying that we should force x86 and other architectures to
> specify base and offset for eclone() even though they currently specify
> just the stack pointer to clone() ?
Even for x86, it's an easier API. Callers would be specifying
two numbers they already have: the argument and return value
for malloc. Currently the numbers must be added together,
destroying information, except on hppa (must not add size)
and ia64 (must use what I'm proposing already).
This also provides the opportunity for the kernel (perhaps not
in the initial implementation) to have a bit of extra info about
some processes. The info could be supplied to gdb, used to
harden the system against some types of security exploits,
presented in /proc, and so on.
> That would remove the ifdef, but could be a big change to applications
> on x86 and other architectures.
It's no change at all until somebody decides to use the new
system call. At that point, you're making changes anyway.
It's certainly not a big change compared to eclone() itself.
> | > I don't understand how "making up some numbers (pids) that will work"
> | > is more portable/cleaner than the proposed eclone().
> |
> | It isolates the cross-platform problems to an obscure tool
> | instead of polluting the kernel interface that everybody uses.
>
> Sure, there was talk about using an approach like /proc/<pid>/next_pid
> where you write your target pid into the file and the next time you
> fork() you get that target pid. But it was considered racy and ugly.
Oh, you misunderstood what I meant by making up numbers
and I didn't catch it. I wasn't meaning PID numbers. I was meaning
stack numbers for processes that your strange tool is restarting.
You ignored my long-ago request to use base/size to specify
the stack. My guess was that this was because you're focused
on restarting processes, many of which will lack stack base info.
I thus suggested that you handle this obscure legacy case by
making up some reasonable numbers.
For example, suppose a process allocates 0x40000000 to
0x7fffffff (a 1 GiB chunk) and uses 0x50000000 to 0x5fffffff as
a thread stack. If done using the old clone() syscall on i386,
you're only told that 0x5fffffff is the last stack address. You
know nothing of 0x50000000. Your tool can see the size and
base of the whole mapping though, so 0x40000000...0x5fffffff
is a reasonable place to assume the stack lives. You therefore
call eclone with base=0x40000000 size=0x2000000 when
restarting the process.
For everybody NOT writing an obscure tool to restart processes,
my requested change eliminates #ifdef mess and/or needless
failure to support some architectures.
Right now user code must be like this:
base=malloc(size);
#if defined(__hppa__)
tid=clone(fn,base,flags,arg);
#elif defined(__ia64__)
tid=clone2(fn,base,size,flags,arg);
#else
tid=clone(fn,base+size,flags,arg);
#endif
The man page is likewise messy.
Note that if clone2 were available for all architectures,
we wouldn't have this mess. Let's not perpetuate the
mistakes that led to the mess. Please provide an API
that, like clone2, uses base and size. It'll work for every
architecture. It'll even be less trouble to document.
^ permalink raw reply
* Re: [PATCH v21 011/100] eclone (11/11): Document sys_eclone
From: Albert Cahalan @ 2010-06-05 11:58 UTC (permalink / raw)
To: Sukadev Bhattiprolu; +Cc: randy.dunlap, linuxppc-dev, linux-kernel
In-Reply-To: <20100602013839.GB17579@us.ibm.com>
On Tue, Jun 1, 2010 at 9:38 PM, Sukadev Bhattiprolu
<sukadev@linux.vnet.ibm.com> wrote:
> | Come on, seriously, you know it's ia64 and hppa that
> | have issues. Maybe the nommu ports also have issues.
> |
> | The only portable way to specify the stack is base and offset,
> | with flags or magic values for "share" and "kernel managed".
>
> Ah, ok, we have not yet ported to IA64 and I see now where the #ifdef
> comes in.
>
> But are you saying that we should force x86 and other architectures to
> specify base and offset for eclone() even though they currently specify
> just the stack pointer to clone() ?
Even for x86, it's an easier API. Callers would be specifying
two numbers they already have: the argument and return value
for malloc. Currently the numbers must be added together,
destroying information, except on hppa (must not add size)
and ia64 (must use what I'm proposing already).
This also provides the opportunity for the kernel (perhaps not
in the initial implementation) to have a bit of extra info about
some processes. The info could be supplied to gdb, used to
harden the system against some types of security exploits,
presented in /proc, and so on.
> That would remove the ifdef, but could be a big change to applications
> on x86 and other architectures.
It's no change at all until somebody decides to use the new
system call. At that point, you're making changes anyway.
It's certainly not a big change compared to eclone() itself.
> | > I don't understand how "making up some numbers (pids) that will work"
> | > is more portable/cleaner than the proposed eclone().
> |
> | It isolates the cross-platform problems to an obscure tool
> | instead of polluting the kernel interface that everybody uses.
>
> Sure, there was talk about using an approach like /proc/<pid>/next_pid
> where you write your target pid into the file and the next time you
> fork() you get that target pid. But it was considered racy and ugly.
Oh, you misunderstood what I meant by making up numbers
and I didn't catch it. I wasn't meaning PID numbers. I was meaning
stack numbers for processes that your strange tool is restarting.
You ignored my long-ago request to use base/size to specify
the stack. My guess was that this was because you're focused
on restarting processes, many of which will lack stack base info.
I thus suggested that you handle this obscure legacy case by
making up some reasonable numbers.
For example, suppose a process allocates 0x40000000 to
0x7fffffff (a 1 GiB chunk) and uses 0x50000000 to 0x5fffffff as
a thread stack. If done using the old clone() syscall on i386,
you're only told that 0x5fffffff is the last stack address. You
know nothing of 0x50000000. Your tool can see the size and
base of the whole mapping though, so 0x40000000...0x5fffffff
is a reasonable place to assume the stack lives. You therefore
call eclone with base=0x40000000 size=0x2000000 when
restarting the process.
For everybody NOT writing an obscure tool to restart processes,
my requested change eliminates #ifdef mess and/or needless
failure to support some architectures.
Right now user code must be like this:
base=malloc(size);
#if defined(__hppa__)
tid=clone(fn,base,flags,arg);
#elif defined(__ia64__)
tid=clone2(fn,base,size,flags,arg);
#else
tid=clone(fn,base+size,flags,arg);
#endif
The man page is likewise messy.
Note that if clone2 were available for all architectures,
we wouldn't have this mess. Let's not perpetuate the
mistakes that led to the mess. Please provide an API
that, like clone2, uses base and size. It'll work for every
architecture. It'll even be less trouble to document.
^ permalink raw reply
* Re: [PATCH v21 011/100] eclone (11/11): Document sys_eclone
From: Albert Cahalan @ 2010-06-05 12:08 UTC (permalink / raw)
To: Sukadev Bhattiprolu; +Cc: randy.dunlap, linuxppc-dev, linux-kernel
In-Reply-To: <20100602013839.GB17579@us.ibm.com>
On Tue, Jun 1, 2010 at 9:38 PM, Sukadev Bhattiprolu
<sukadev@linux.vnet.ibm.com> wrote:
> | Come on, seriously, you know it's ia64 and hppa that
> | have issues. Maybe the nommu ports also have issues.
> |
> | The only portable way to specify the stack is base and offset,
> | with flags or magic values for "share" and "kernel managed".
>
> Ah, ok, we have not yet ported to IA64 and I see now where the #ifdef
> comes in.
>
> But are you saying that we should force x86 and other architectures to
> specify base and offset for eclone() even though they currently specify
> just the stack pointer to clone() ?
Even for x86, it's an easier API. Callers would be specifying
two numbers they already have: the argument and return value
for malloc. Currently the numbers must be added together,
destroying information, except on hppa (must not add size)
and ia64 (must use what I'm proposing already).
This also provides the opportunity for the kernel (perhaps not
in the initial implementation) to have a bit of extra info about
some processes. The info could be supplied to gdb, used to
harden the system against some types of security exploits,
presented in /proc, and so on.
> That would remove the ifdef, but could be a big change to applications
> on x86 and other architectures.
It's no change at all until somebody decides to use the new
system call. At that point, you're making changes anyway.
It's certainly not a big change compared to eclone() itself.
> | > I don't understand how "making up some numbers (pids) that will work"
> | > is more portable/cleaner than the proposed eclone().
> |
> | It isolates the cross-platform problems to an obscure tool
> | instead of polluting the kernel interface that everybody uses.
>
> Sure, there was talk about using an approach like /proc/<pid>/next_pid
> where you write your target pid into the file and the next time you
> fork() you get that target pid. But it was considered racy and ugly.
Oh, you misunderstood what I meant by making up numbers
and I didn't catch it. I wasn't meaning PID numbers. I was meaning
stack numbers for processes that your strange tool is restarting.
You ignored my long-ago request to use base/size to specify
the stack. My guess was that this was because you're focused
on restarting processes, many of which will lack stack base info.
I thus suggested that you handle this obscure legacy case by
making up some reasonable numbers.
For example, suppose a process allocates 0x40000000 to
0x7fffffff (a 1 GiB chunk) and uses 0x50000000 to 0x5fffffff as
a thread stack. If done using the old clone() syscall on i386,
you're only told that 0x5fffffff is the last stack address. You
know nothing of 0x50000000. Your tool can see the size and
base of the whole mapping though, so 0x40000000...0x5fffffff
is a reasonable place to assume the stack lives. You therefore
call eclone with base=0x40000000 size=0x2000000 when
restarting the process.
For everybody NOT writing an obscure tool to restart processes,
my requested change eliminates #ifdef mess and/or needless
failure to support some architectures.
Right now user code must be like this:
base=malloc(size);
#if defined(__hppa__)
tid=clone(fn,base,flags,arg);
#elif defined(__ia64__)
tid=clone2(fn,base,size,flags,arg);
#else
tid=clone(fn,base+size,flags,arg);
#endif
The man page is likewise messy.
Note that if clone2 were available for all architectures,
we wouldn't have this mess. Let's not perpetuate the
mistakes that led to the mess. Please provide an API
that, like clone2, uses base and size. It'll work for every
architecture. It'll even be less trouble to document.
^ permalink raw reply
* Re: [PATCH] [powerpc] do not expect executable permissions for in-tree shell scripts
From: Sean MacLennan @ 2010-06-05 17:32 UTC (permalink / raw)
To: Olaf Hering; +Cc: linuxppc-dev, stable
In-Reply-To: <20100605081039.GA21300@aepfle.de>
On Sat, 5 Jun 2010 10:10:39 +0200
Olaf Hering <olaf@aepfle.de> wrote:
> scripts in the kernel source do not have executable permissions if
> they were created with patch(1) run mkuboot.sh with bash, its tagged
> as bash script.
Wouldn't it be better to use ${SHELL}? Not every system has bash.
Cheers,
Sean
^ permalink raw reply
* Re: [PATCH] [powerpc] do not expect executable permissions for in-tree shell scripts
From: Olaf Hering @ 2010-06-05 17:44 UTC (permalink / raw)
To: Sean MacLennan; +Cc: linuxppc-dev, stable
In-Reply-To: <20100605133210.11f504c3@opus.seanm.ca>
On Sat, Jun 05, Sean MacLennan wrote:
> On Sat, 5 Jun 2010 10:10:39 +0200
> Olaf Hering <olaf@aepfle.de> wrote:
>
> > scripts in the kernel source do not have executable permissions if
> > they were created with patch(1) run mkuboot.sh with bash, its tagged
> > as bash script.
>
> Wouldn't it be better to use ${SHELL}? Not every system has bash.
Maybe.
As it stands right now, mkuboot.sh does not run without bash.
And:
Reality check please.
A _development system_ without bash, installed per default on every sane
Linux distro, does most likely not exist.
Olaf
^ permalink raw reply
* Re: [PATCH] [powerpc] do not expect executable permissions for in-tree shell scripts
From: Sean MacLennan @ 2010-06-05 18:00 UTC (permalink / raw)
To: Olaf Hering; +Cc: linuxppc-dev, stable
In-Reply-To: <20100605174437.GA16229@aepfle.de>
On Sat, 5 Jun 2010 19:44:37 +0200
Olaf Hering <olaf@aepfle.de> wrote:
> Maybe.
> As it stands right now, mkuboot.sh does not run without bash.
>
>
> And:
> Reality check please.
> A _development system_ without bash, installed per default on every
> sane Linux distro, does most likely not exist.
Hmmm, can't argue with that. I wouldn't consider building a kernel on
the warp sane ;) And to be honest, I am not sure anyone has tried. We
officially support it, but I have never done it and don't plan to try.
Cheers,
Sean
^ permalink raw reply
* Re: [PATCH 1/2] net: ll_temac: fix interrupt bug when interrupt 0 is used
From: Grant Likely @ 2010-06-06 3:33 UTC (permalink / raw)
To: John Williams; +Cc: linuxppc-dev, netdev, Brian Hill, michal.simek, John Linn
In-Reply-To: <AANLkTin0Lg8HCpCAmyy_ybPlv6K9_iyE2aFrhifw486D@mail.gmail.com>
On Wed, May 26, 2010 at 10:12 PM, John Williams
<john.williams@petalogix.com> wrote:
> On Thu, May 27, 2010 at 3:29 AM, John Linn <john.linn@xilinx.com> wrote:
>> The code is not checking the interrupt for DMA correctly so that an
>> interrupt number of 0 will cause a false error.
>>
>> Signed-off-by: Brian Hill <brian.hill@xilinx.com>
>> Signed-off-by: John Linn <john.linn@xilinx.com>
>> ---
>> =A0drivers/net/ll_temac_main.c | =A0 =A02 +-
>> =A01 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/net/ll_temac_main.c b/drivers/net/ll_temac_main.c
>> index fa7620e..0615737 100644
>> --- a/drivers/net/ll_temac_main.c
>> +++ b/drivers/net/ll_temac_main.c
>> @@ -950,7 +950,7 @@ temac_of_probe(struct of_device *op, const struct of=
_device_id *match)
>>
>> =A0 =A0 =A0 =A0lp->rx_irq =3D irq_of_parse_and_map(np, 0);
>> =A0 =A0 =A0 =A0lp->tx_irq =3D irq_of_parse_and_map(np, 1);
>> - =A0 =A0 =A0 if (!lp->rx_irq || !lp->tx_irq) {
>> + =A0 =A0 =A0 if ((lp->rx_irq =3D=3D NO_IRQ) || (lp->tx_irq =3D=3D NO_IR=
Q)) {
>
> Personally I think this is the right thing to do. =A0But, I thought the
> IRQ 0 =3D=3D NO_IRQ (AKA "all-the-world's-an-x86-and-if-not-it-should-be"=
)
> holy war was already fought and won (or lost, depending on your
> perspective)?
>
> I seem to recall giving reluctant assent to a patch from Grant a few
> months ago that touched MicroBlaze thus?
I've still got the patch in my private queue. I can reapply it, test
it and repost it. I think what was still a bit up in the air was the
exact method to map hw irq numbers onto linux irqs.
g.
^ permalink raw reply
* 2.6.35-rc2 : OOPS with LTP memcg regression test run.
From: Sachin Sant @ 2010-06-06 15:06 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-mm, Linux/PPC Development
While executing LTP Controller tests(memcg regression) on
a POWER6 box came across this following OOPS.
Memory cgroup out of memory: kill process 9139 (memcg_test_1) score 3 or a child
Killed process 9139 (memcg_test_1) vsz:3456kB, anon-rss:448kB, file-rss:1088kB
Memory cgroup out of memory: kill process 9140 (memcg_test_1) score 3 or a child
Killed process 9140 (memcg_test_1) vsz:3456kB, anon-rss:448kB, file-rss:1088kB
Unable to handle kernel paging request for data at address 0x720072007200720
Faulting instruction address: 0xc00000000015b778
Oops: Kernel access of bad area, sig: 11 [#2]
SMP NR_CPUS=1024 NUMA pSeries
last sysfs file: /sys/devices/system/cpu/cpu1/cache/index1/shared_cpu_map
Modules linked in: quota_v2 quota_tree ipv6 fuse loop dm_mod sr_mod cdrom sg sd_mod crc_t10dif ibmvscsic scsi_transport_srp scsi_tgt scsi_mod
NIP: c00000000015b778 LR: c00000000015b740 CTR: 0000000000000000
REGS: c000000009812ff0 TRAP: 0300 Tainted: G D (2.6.35-rc2-autotest)
MSR: 8000000000009032 <EE,ME,IR,DR> CR: 44004424 XER: 00000001
DAR: 0720072007200720, DSISR: 0000000040000000
TASK = c000000005fb1100[9155] 'umount' THREAD: c000000009810000 CPU: 0
GPR00: 0000000000000000 c000000009813270 c000000000d3d7a0 0000000000000000
GPR04: 0000000000008050 0000000000160000 0000000000000027 c00000000f2c6870
GPR08: 00000000000006a5 c000000000b16870 c000000000cf0140 000000000e7b0000
GPR12: 0000000024004428 c000000007440000 0000000000008000 fffffffffffff000
GPR16: 0000000000000000 c0000000098138f0 000000000000002d 0000000000000027
GPR20: 0000000000000000 0000000000000027 0000000000000000 c000000007063138
GPR24: ffffffffffffffff 0000000000000000 c00000000019bafc c00000000e02e000
GPR28: 0000000000000001 0000000000008050 c000000000ca6b00 0720072007200720
NIP [c00000000015b778] .kmem_cache_alloc+0xb0/0x13c
LR [c00000000015b740] .kmem_cache_alloc+0x78/0x13c
Call Trace:
[c000000009813270] [c00000000015b740] .kmem_cache_alloc+0x78/0x13c (unreliable)
[c000000009813310] [c00000000019bafc] .alloc_buffer_head+0x2c/0x78
[c000000009813390] [c00000000019c99c] .alloc_page_buffers+0x60/0x114
[c000000009813450] [c00000000019ca78] .create_empty_buffers+0x28/0x140
[c0000000098134e0] [c00000000019f2ec] .__block_prepare_write+0xe4/0x4f0
[c000000009813610] [c00000000019f94c] .block_write_begin_newtrunc+0xa8/0x120
[c0000000098136d0] [c00000000019fea0] .block_write_begin+0x34/0x8c
[c000000009813770] [c00000000022b458] .ext3_write_begin+0x13c/0x298
[c000000009813880] [c000000000117500] .generic_file_buffered_write+0x13c/0x320
[c0000000098139b0] [c000000000119c80] .__generic_file_aio_write+0x378/0x3dc
[c000000009813ab0] [c000000000119d68] .generic_file_aio_write+0x84/0xfc
[c000000009813b60] [c00000000016e460] .do_sync_write+0xac/0x10c
[c000000009813ce0] [c00000000016f204] .vfs_write+0xd0/0x1dc
[c000000009813d80] [c00000000016f418] .SyS_write+0x58/0xa0
[c000000009813e30] [c0000000000085b4] syscall_exit+0x0/0x40
Instruction dump:
38600000 409e0090 38000000 8b8d0212 980d0212 e96d0040 e93b0000 7ce95a14
7fe9582a 2fbf0000 419e0014 e81b001a <7c1f002a> 7c09592a 4800001c 7f46d378
---[ end trace f24cb0cb5729d2bb ]---
And few more of these. Previous snapshot release 2.6.35-rc1-git5(6c5de280b6...)
was good.
Thanks
-Sachin
--
---------------------------------
Sachin Sant
IBM Linux Technology Center
India Systems and Technology Labs
Bangalore, India
---------------------------------
^ permalink raw reply
* Re: 2.6.35-rc2 : OOPS with LTP memcg regression test run.
From: Al Viro @ 2010-06-06 15:40 UTC (permalink / raw)
To: Sachin Sant; +Cc: linux-mm, linux-kernel, Linux/PPC Development
In-Reply-To: <4C0BB98E.9030101@in.ibm.com>
On Sun, Jun 06, 2010 at 08:36:54PM +0530, Sachin Sant wrote:
> And few more of these. Previous snapshot release 2.6.35-rc1-git5(6c5de280b6...)
> was good.
That's very odd, since
; git diff --stat 6c5de280b6..v2.6.35-rc2
Makefile | 2 +-
drivers/gpu/drm/i915/intel_display.c | 9 +++++++
fs/ext4/inode.c | 40 +++++++++++++++++++--------------
fs/ext4/move_extent.c | 3 ++
4 files changed, 36 insertions(+), 18 deletions(-)
;
and nothing of that looks like good candidates...
^ permalink raw reply
* Re: fsl_rio.c build problem
From: kerstin jonsson @ 2010-06-06 16:20 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev@lists.ozlabs.org
In-Reply-To: <4C095C53.60002@freescale.com>
On 06/04/2010 10:04 PM, Scott Wood wrote:
> On 06/04/2010 06:24 AM, kerstin jonsson wrote:
>
>> Hi,
>>
>> I'm using:
>>
>> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
>>
>> and building for ARCH=powerpc - mpc85xx_defconfig
>>
>> arch/powerpc/sysdev/fsl_rio.c will not build due to a missing
>> MCSR_MASK bitmask definition.
>>
>> The attached patch is based on code found in
>>
>> git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git
>>
>> and - at the least - will fix the build problem.
>>
> Can we remove the use of MCSR_MASK from fsl_rio.c instead? I don't see
> what it's accomplishing here. MCSR_MASK will be wrong on e500mc, so
> exporting it as something that looks generic doesn't seem right.
>
Thanks for pointing that out, I agree in the context it's currently
used in the fsl_rio.c, it's not obvious what purpose it serves.
I have a e500v2 so I guess that just removing the MCSR_MASK
from the fsl_rio.c will make no difference in my case.
> MCSR_BUS_RBERR also needs to change on e500mc -- you'll probably get
> MCSR_LDG.
>
>
Someone that know the e500mc probably need to have a look
at this part of the fsl_rio.c then.
BR,
Kerstin
> -Scott
>
^ permalink raw reply
* Re: 2.6.35-rc2 : OOPS with LTP memcg regression test run.
From: Markus Trippelsdorf @ 2010-06-06 16:15 UTC (permalink / raw)
To: Sachin Sant; +Cc: linux-mm, linux-kernel, Linux/PPC Development
In-Reply-To: <20100606154048.GJ31073@ZenIV.linux.org.uk>
>> And few more of these. Previous snapshot release 2.6.35-rc1-git5(6c5de280b6...)
>> was good.
>
>That's very odd, since
>; git diff --stat 6c5de280b6..v2.6.35-rc2
> Makefile | 2 +-
> drivers/gpu/drm/i915/intel_display.c | 9 +++++++
> fs/ext4/inode.c | 40 +++++++++++++++++++--------------
> fs/ext4/move_extent.c | 3 ++
> 4 files changed, 36 insertions(+), 18 deletions(-)
>
>and nothing of that looks like good candidates...
I may have the same problem on my machine.
(See also the thread: ext4 2.6.35-rc2 regression (ext4: Make sure the MOVE_EXT ioctl...))
general protection fault: 0000 [#1] SMP
last sysfs file: /sys/devices/pci0000:00/0000:00:11.0/host2/target2:0:0/2:0:0:0/block/sdb/size
CPU 2
Pid: 1683, comm: iptables-restor Not tainted 2.6.35-rc2-00033-gcc1f375 #46 M4A78T-E/System Product Name
RIP: 0010:[<ffffffff810cc6e6>] [<ffffffff810cc6e6>] kmem_cache_alloc+0x59/0xda
RSP: 0018:ffff88011c993d78 EFLAGS: 00010002
RAX: 0000000000000000 RBX: 0720072007200720 RCX: ffffffff810bd4c9
RDX: 00007f076cee3000 RSI: 00000000000000d0 RDI: ffff88011fc01800
RBP: ffff88011c993db8 R08: ffff880001b13f48 R09: 0000000000000000
R10: ffff88011d387c00 R11: ffff88011c983930 R12: ffff88011fc01800
R13: 0000000000000202 R14: 00000000000000d0 R15: 00000000000000d0
FS: 00007f076dc43700(0000) GS:ffff880001b00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 00007f8595d364f8 CR3: 000000011b8b0000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process iptables-restor (pid: 1683, threadinfo ffff88011c992000, task ffff88011ec09610)
Stack:
ffff88011d387c10 ffff88011c983930 ffff88011c993d98 000000000000fffa
<0> ffff88011d387bd0 00007f076cee3000 ffff88011f77ea40 0000000000000000
<0> ffff88011c993e08 ffffffff810bd4c9 ffff88011b8f5cc0 ffffffff810bd639
Call Trace:
[<ffffffff810bd4c9>] __split_vma+0x33/0x18d
[<ffffffff810bd639>] ? vma_merge+0x16/0x1fc
[<ffffffff810bdc01>] split_vma+0x23/0x28
[<ffffffff810bf572>] mprotect_fixup+0x146/0x54c
[<ffffffff810befff>] ? do_mmap_pgoff+0x2a4/0x2fe
[<ffffffff810bfaf0>] sys_mprotect+0x178/0x1f4
[<ffffffff8102b93b>] system_call_fastpath+0x16/0x1b
Code: 65 4c 8b 04 25 88 d4 00 00 48 8b 07 49 01 c0 49 8b 18 48 85 db 75 10 83 ca ff 44 89 f6 e8 58 fa ff ff 48 89 c3 eb 0b 48 63 47 18 <48> 8b 04 03 49 89 00 41 55 9d 48 85 db 74 15 41 81 e6 00 80 00
RIP [<ffffffff810cc6e6>] kmem_cache_alloc+0x59/0xda
RSP <ffff88011c993d78>
---[ end trace e2fb1ccd3cb9dd77 ]---
--
Markus
^ permalink raw reply
* Re: [PATCH]Device tree update for the 460ex DWC SATA<resubmission>
From: Josh Boyer @ 2010-06-06 18:47 UTC (permalink / raw)
To: Rupjyoti Sarmah; +Cc: linux-ide, sr, rsarmah, linux-kernel, linuxppc-dev
In-Reply-To: <201006041003.o54A3CIi024533@amcc.com>
On Fri, Jun 04, 2010 at 03:33:12PM +0530, Rupjyoti Sarmah wrote:
>
>Device tree update for the Applied micro processor 460ex on-chip SATA
>Signed-off-by: Rupjyoti Sarmah <rsarmah@amcc.com>
You sent this same patch twice. Mistake, or was there supposed to be a
difference?
josh
^ permalink raw reply
* Re: [PATCH]460EX on-chip SATA driver<kernel 2.6.33><resubmission>
From: Josh Boyer @ 2010-06-06 18:52 UTC (permalink / raw)
To: Rupjyoti Sarmah; +Cc: linux-ide, sr, jgarzik, linux-kernel, linuxppc-dev
In-Reply-To: <201006041226.o54CQH2V017366@amcc.com>
On Fri, Jun 04, 2010 at 05:56:17PM +0530, Rupjyoti Sarmah wrote:
>This patch enables the on-chip DWC SATA controller of the AppliedMicro processor 460EX.
>
>Signed-off-by: Rupjyoti Sarmah <rsarmah@appliedmicro.com>
>Signed-off-by: Mark Miesfeld <mmiesfeld@appliedmicro.com>
>Signed-off-by: Prodyut Hazarika <phazarika@appliedmicro.com>
What does the <kernel 2.6.33> mean in the Subject?
>
>---
> drivers/ata/Kconfig | 9 +
> drivers/ata/Makefile | 1 +
> drivers/ata/sata_dwc_460ex.c | 1808 ++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 1818 insertions(+), 0 deletions(-)
> create mode 100644 drivers/ata/sata_dwc_460ex.c
>
>diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
>index 56c6374..bba7b8a 100644
>--- a/drivers/ata/Kconfig
>+++ b/drivers/ata/Kconfig
>@@ -82,6 +82,15 @@ config SATA_FSL
>
> If unsure, say N.
>
>+config SATA_DWC
>+ tristate "DesignWare Cores SATA support"
>+ depends on 460EX
>+ help
>+ This option enables support for the on-chip SATA controller of the
>+ AppliedMicro processor 460EX.
>+
>+ If unsure, say N.
>+
> config ATA_SFF
> bool "ATA SFF support"
> default y
>diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile
>index fc936d4..96ff315 100644
>--- a/drivers/ata/Makefile
>+++ b/drivers/ata/Makefile
>@@ -19,6 +19,7 @@ obj-$(CONFIG_SATA_INIC162X) += sata_inic162x.o
> obj-$(CONFIG_PDC_ADMA) += pdc_adma.o
> obj-$(CONFIG_SATA_FSL) += sata_fsl.o
> obj-$(CONFIG_PATA_MACIO) += pata_macio.o
>+obj-$(CONFIG_SATA_DWC) += sata_dwc_460ex.o
>
> obj-$(CONFIG_PATA_ALI) += pata_ali.o
> obj-$(CONFIG_PATA_AMD) += pata_amd.o
>diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c
>new file mode 100644
>index 0000000..e6e2896
>--- /dev/null
>+++ b/drivers/ata/sata_dwc_460ex.c
>@@ -0,0 +1,1808 @@
>+/*
>+ * drivers/ata/sata_dwc_460ex.c
>+ *
>+ * Synopsys DesignWare Cores (DWC) SATA host driver
>+ *
>+ * Author: Mark Miesfeld <mmiesfeld@amcc.com>
>+ *
>+ * Ported from 2.6.19.2 to 2.6.25/26 by Stefan Roese <sr@denx.de>
>+ * Copyright 2008 DENX Software Engineering
I'm pretty sure Denx uses Signed-off-by lines in their trees. If you've ported
it from their tree, perhaps you should keep Stefan's S-o-b line intact.
>+/******************************************************************************
>+ * Function: get_burst_length_encode
>+ * arguments: datalength: length in bytes of data
>+ * returns value to be programmed in register corrresponding to data length
>+ * This value is effectively the log(base 2) of the length
>+ *****************************************************************************/
>+static int get_burst_length_encode(int datalength)
>+{
>+ int items = datalength >> 2; /* div by 4 to get lword count */
A minor suggestion, but if you're going to document the interfaces this way
you might want to go ahead and use KernelDoc. It's pretty close to what you
have already.
josh
^ permalink raw reply
* Re: [PATCH]460EX on-chip SATA driver<kernel 2.6.33><resubmission>
From: Wolfgang Denk @ 2010-06-06 21:09 UTC (permalink / raw)
To: Rupjyoti Sarmah; +Cc: linuxppc-dev, linux-kernel, linux-ide, sr, jgarzik
In-Reply-To: <201006041226.o54CQH2V017366@amcc.com>
Dear Rupjyoti Sarmah,
In message <201006041226.o54CQH2V017366@amcc.com> you wrote:
> This patch enables the on-chip DWC SATA controller of the AppliedMicro processor 460EX.
>
> Signed-off-by: Rupjyoti Sarmah <rsarmah@appliedmicro.com>
> Signed-off-by: Mark Miesfeld <mmiesfeld@appliedmicro.com>
> Signed-off-by: Prodyut Hazarika <phazarika@appliedmicro.com>
>
> ---
> drivers/ata/Kconfig | 9 +
> drivers/ata/Makefile | 1 +
> drivers/ata/sata_dwc_460ex.c | 1808 ++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 1818 insertions(+), 0 deletions(-)
> create mode 100644 drivers/ata/sata_dwc_460ex.c
This driver needs fixing. It will not compile against recent kernel
versions.
...
> diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c
> new file mode 100644
> index 0000000..e6e2896
> --- /dev/null
> +++ b/drivers/ata/sata_dwc_460ex.c
> @@ -0,0 +1,1808 @@
...
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/init.h>
> +#include <linux/device.h>
> +#include <linux/of_platform.h>
> +#include <linux/libata.h>
> +#include "libata.h"
> +
> +#include <scsi/scsi_host.h>
> +#include <scsi/scsi_cmnd.h>
You miss a "#include <linux/slab.h>" here.
...
> + for (i = 0; i < SATA_DWC_QCMD_MAX; i++)
> + hsdevp->cmd_issued[i] = SATA_DWC_CMD_ISSUED_NOT;
> +
> + ap->prd = 0; /* set these so libata doesn't use them */
> + ap->prd_dma = 0;
s/prd/bmdma_prd/ in these two lines (cf. commit f60d7011).
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
He had quite a powerful intellect, but it was as powerful like a
locomotive, and ran on rails and was therefore almost impossible to
steer. - Terry Pratchett, _Lords and Ladies_
^ permalink raw reply
* Re: [PATCH 1/2] net: ll_temac: fix interrupt bug when interrupt 0 is used
From: Benjamin Herrenschmidt @ 2010-06-06 21:57 UTC (permalink / raw)
To: John Linn; +Cc: linuxppc-dev, netdev, Brian Hill, michal.simek, john.williams
In-Reply-To: <6f264a7a-e5da-494a-a24d-1578ca422807@VA3EHSMHS016.ehs.local>
On Wed, 2010-05-26 at 11:29 -0600, John Linn wrote:
> The code is not checking the interrupt for DMA correctly so that an
> interrupt number of 0 will cause a false error.
>
> Signed-off-by: Brian Hill <brian.hill@xilinx.com>
> Signed-off-by: John Linn <john.linn@xilinx.com>
> ---
> drivers/net/ll_temac_main.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/ll_temac_main.c b/drivers/net/ll_temac_main.c
> index fa7620e..0615737 100644
> --- a/drivers/net/ll_temac_main.c
> +++ b/drivers/net/ll_temac_main.c
> @@ -950,7 +950,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match)
>
> lp->rx_irq = irq_of_parse_and_map(np, 0);
> lp->tx_irq = irq_of_parse_and_map(np, 1);
> - if (!lp->rx_irq || !lp->tx_irq) {
> + if ((lp->rx_irq == NO_IRQ) || (lp->tx_irq == NO_IRQ)) {
> dev_err(&op->dev, "could not determine irqs\n");
> rc = -ENOMEM;
> goto nodev;
Hasn't NO_IRQ been deprecated ?
Linus made it clear a while back that interrupt 0 was not valid and
that's the way it should be.
We now have an interrupt remapping scheme on powerpc, so we ensure that
0 always mean no interrupt. Other archs might need some fixups. Which
are specifically needs this patch ?
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH 2/2] gpio: pca953x: add powerpc irq support
From: Thomas Gleixner @ 2010-06-06 23:39 UTC (permalink / raw)
To: Esben Haabendal; +Cc: linuxppc-dev
In-Reply-To: <1275686731.2970.14.camel@eha.doredevelopment.dk>
On Fri, 4 Jun 2010, Esben Haabendal wrote:
NAK for various reasons (no particular order):
1) That patch misses a sensible changelog. See Documentation/Submit*
2) patch contains several independent changes, which need to be separated
> @@ -120,6 +124,10 @@ static int pca953x_gpio_direction_input(struct gpio_chip *gc, unsigned off)
> chip = container_of(gc, struct pca953x_chip, gpio_chip);
>
> reg_val = chip->reg_direction | (1u << off);
> +
> + if (reg_val == chip->reg_direction)
> + return 0;
> +
This is an optimization of its own value.
3) it breaks the driver. See http://lkml.org/lkml/2010/6/6/177 for a
detailed explanation
4) the virq/powerpc churn is horrible and I bet there are sane ways to
solve this, but it leave this to the powerpc experts.
Thanks,
tglx
^ permalink raw reply
* Re: [PATCH 1/2] powerpc: ipic: use set_irq_chip to ensure irq_chip defaults are applied
From: Thomas Gleixner @ 2010-06-06 23:45 UTC (permalink / raw)
To: Esben Haabendal; +Cc: linuxppc-dev
In-Reply-To: <1275686717.2970.13.camel@eha.doredevelopment.dk>
On Fri, 4 Jun 2010, Esben Haabendal wrote:
What's the rationale of this patch and which problem does it solve ?
> Signed-off-by: Esben Haabendal <eha@doredevelopment.dk>
> ---
> arch/powerpc/sysdev/ipic.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c
> index d7b9b9c..8464b86 100644
> --- a/arch/powerpc/sysdev/ipic.c
> +++ b/arch/powerpc/sysdev/ipic.c
> @@ -630,10 +630,10 @@ static int ipic_set_irq_type(unsigned int virq, unsigned int flow_type)
> if (flow_type & IRQ_TYPE_LEVEL_LOW) {
> desc->status |= IRQ_LEVEL;
> desc->handle_irq = handle_level_irq;
> - desc->chip = &ipic_level_irq_chip;
> + set_irq_chip(virq, &ipic_level_irq_chip);
This patch has never been tested with spinlock debugging enabled and
will break SMP as it causes a deadlock on irq_desc->lock.
Again: See Documentation/Submit*
Thanks,
tglx
^ permalink raw reply
* Re: [PATCH] powerpc: Disable CONFIG_SYSFS_DEPRECATED
From: Anton Blanchard @ 2010-06-07 0:46 UTC (permalink / raw)
To: Josh Boyer; +Cc: linuxppc-dev
In-Reply-To: <20100506113816.GP2671@hansolo.jdub.homelinux.org>
Hi Josh,
> I'd like to run a few tests with this disabled on the 4xx boards first please.
> I can't say that all the boards I have will have any sort of "distro" to begin
> with, and if they did they might not be running something from the last 3 or
> 4 years. I do run -git kernels on them frequently though.
Any luck with this? I can submit a patch to fix the 64bit platforms and ignore
all 32bit if there is going to be a problem.
Anton
^ permalink raw reply
* Re: [PATCH 1/2] net: ll_temac: fix interrupt bug when interrupt 0 is used
From: Grant Likely @ 2010-06-07 0:47 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: linuxppc-dev, netdev, Brian Hill, michal.simek, John Linn,
john.williams
In-Reply-To: <1275861445.1931.2974.camel@pasglop>
On Sun, Jun 6, 2010 at 3:57 PM, Benjamin Herrenschmidt
<benh@kernel.crashing.org> wrote:
> On Wed, 2010-05-26 at 11:29 -0600, John Linn wrote:
>> The code is not checking the interrupt for DMA correctly so that an
>> interrupt number of 0 will cause a false error.
>>
>> Signed-off-by: Brian Hill <brian.hill@xilinx.com>
>> Signed-off-by: John Linn <john.linn@xilinx.com>
>> ---
>> =A0drivers/net/ll_temac_main.c | =A0 =A02 +-
>> =A01 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/net/ll_temac_main.c b/drivers/net/ll_temac_main.c
>> index fa7620e..0615737 100644
>> --- a/drivers/net/ll_temac_main.c
>> +++ b/drivers/net/ll_temac_main.c
>> @@ -950,7 +950,7 @@ temac_of_probe(struct of_device *op, const struct of=
_device_id *match)
>>
>> =A0 =A0 =A0 lp->rx_irq =3D irq_of_parse_and_map(np, 0);
>> =A0 =A0 =A0 lp->tx_irq =3D irq_of_parse_and_map(np, 1);
>> - =A0 =A0 if (!lp->rx_irq || !lp->tx_irq) {
>> + =A0 =A0 if ((lp->rx_irq =3D=3D NO_IRQ) || (lp->tx_irq =3D=3D NO_IRQ)) =
{
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 dev_err(&op->dev, "could not determine irqs\=
n");
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 rc =3D -ENOMEM;
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto nodev;
>
> Hasn't NO_IRQ been deprecated ?
ARM still uses it, plus less than a handful of other arches. There is
no reason for Microblaze to use NO_IRQ as -1.
In fact, on ARM, as part of the device tree work I'm hoping to piggy
back in irq remapping and make 0 no longer a valid irq.
> Linus made it clear a while back that interrupt 0 was not valid and
> that's the way it should be.
>
> We now have an interrupt remapping scheme on powerpc, so we ensure that
> 0 always mean no interrupt. Other archs might need some fixups. Which
> are specifically needs this patch ?
Microblaze.
BTW jlinn, for xilinx ARM support we should make sure 0 is never used
as a valid IRQ from day one. It will result it far less pain in the
future.
g.
--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox