[PATCH] powerpc: Fix ppc32 mm_struct CPU tracking in SMP

2008-11-27 Thread Benjamin Herrenschmidt
The 32-bit hash code didn't need it so far so we don't update
mm->cpu_vm_mask on context switch. This however breaks the
merge of the RCU based page table freeing and other upcoming
32-bit embedded SMP work.

Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
---

 arch/powerpc/include/asm/mmu_context.h |3 +++
 1 file changed, 3 insertions(+)

--- linux-476.orig/arch/powerpc/include/asm/mmu_context.h   2008-11-28 
15:46:39.0 +1100
+++ linux-476/arch/powerpc/include/asm/mmu_context.h2008-11-28 
16:59:06.0 +1100
@@ -186,6 +186,9 @@ static inline void switch_mm(struct mm_s
 
tsk->thread.pgdir = next->pgd;
 
+   if (!cpu_isset(smp_processor_id(), next->cpu_vm_mask))
+   cpu_set(smp_processor_id(), next->cpu_vm_mask);
+
/* No need to flush userspace segments if the mm doesnt change */
if (prev == next)
return;
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] powerpc/pseries: Fix cpu hotplug

2008-11-27 Thread Nathan Lynch
Hi, I have some questions about this patch.

Sebastien Dugue wrote:
> 
>   Currently, pseries_cpu_die() calls msleep() while polling RTAS for
> the status of the dying cpu.
> 
>   However if the cpu that is going down also happens to be the one doing
> the tick then we're hosed as the tick_do_timer_cpu 'baton' is only passed
> later on in tick_shutdown() when _cpu_down() does the CPU_DEAD notification.
> Therefore jiffies won't be updated anymore.

I confess unfamiliarity with the tick/timer code, but this sounds like
something that should be addressed earlier in the process of taking
down a CPU.


>   This patch replaces that msleep() with a cpu_relax() to make sure we're
> not going to schedule at that point.

This is a significant change in behavior.  With the msleep(), we poll
for at least five seconds before giving up; with the cpu_relax(), the
period will almost certainly be much shorter and we're likely to give
up too soon in some circumstances.  Could be addressed by using
mdelay(), but...

It's just not clear to me how busy-waiting in the __cpu_die() path is
a legitimate fix.  Is sleeping in this path forbidden now?  (I notice
at least native_cpu_die() in x86 does msleep(), btw.)

As it can take several milliseconds for RTAS to report a CPU
offline, and the maximum latency of the operation is unspecified, it
seems inappropriate to tie up the waiting CPU this way.


>   With this patch my test box survives a 100k iterations hotplug stress
> test on _all_ cpus, whereas without it, it quickly dies after ~50 iterations.

What is the failure (e.g. stack trace, kernel messages)?

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] powerpc: add 16K/64K pages support for the 44x PPC32 architectures.

2008-11-27 Thread Ilya Yanok
This patch adds support for page sizes bigger than 4K (16K/64K) on
PPC 44x.
PGDIR table is much smaller than page in case of 16K/64K pages (512
and 32 bytes resp.) so we allocate PGDIR with kzalloc() instead of
__get_free_pages().
PTE table covers rather big memory area in case of 16K/64K pages
(32MB and 512MB resp.) so we can easily put FIXMAP and PKMAP in
area covered by one PTE table.

Signed-off-by: Yuri Tikhonov <[EMAIL PROTECTED]>
Signed-off-by: Vladimir Panfilov <[EMAIL PROTECTED]>
Signed-off-by: Ilya Yanok <[EMAIL PROTECTED]>
---
 arch/powerpc/Kconfig   |   54 ---
 arch/powerpc/include/asm/highmem.h |   15 -
 arch/powerpc/include/asm/mmu-44x.h |   18 ++
 arch/powerpc/include/asm/page.h|   13 +---
 arch/powerpc/include/asm/page_32.h |3 +-
 arch/powerpc/include/asm/pgtable.h |2 +
 arch/powerpc/kernel/asm-offsets.c  |4 ++
 arch/powerpc/kernel/head_44x.S |   22 -
 arch/powerpc/kernel/misc_32.S  |   12 +++---
 arch/powerpc/mm/pgtable_32.c   |   13 ++-
 arch/powerpc/platforms/Kconfig.cputype |2 +-
 11 files changed, 112 insertions(+), 46 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 525c13a..aa2eb46 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -401,23 +401,53 @@ config PPC_HAS_HASH_64K
depends on PPC64
default n
 
-config PPC_64K_PAGES
-   bool "64k page size"
-   depends on PPC64
-   select PPC_HAS_HASH_64K
+choice
+   prompt "Page size"
+   default PPC_4K_PAGES
help
- This option changes the kernel logical page size to 64k. On machines
- without processor support for 64k pages, the kernel will simulate
- them by loading each individual 4k page on demand transparently,
- while on hardware with such support, it will be used to map
- normal application pages.
+ Select the kernel logical page size. Increasing the page size
+ will reduce software overhead at each page boundary, allow
+ hardware prefetch mechanisms to be more effective, and allow
+ larger dma transfers increasing IO efficiency and reducing
+ overhead. However the utilization of memory will increase.
+ For example, each cached file will using a multiple of the
+ page size to hold its contents and the difference between the
+ end of file and the end of page is wasted.
+
+ Some dedicated systems, such as software raid serving with
+ accelerated calculations, have shown significant increases.
+
+ If you configure a 64 bit kernel for 64k pages but the
+ processor does not support them, then the kernel will simulate
+ them with 4k pages, loading them on demand, but with the
+ reduced software overhead and larger internal fragmentation.
+ For the 32 bit kernel, a large page option will not be offered
+ unless it is supported by the configured processor.
+
+ If unsure, choose 4K_PAGES.
+
+config PPC_4K_PAGES
+   bool "4k page size"
+
+config PPC_16K_PAGES
+   bool "16k page size" if 44x
+
+config PPC_64K_PAGES
+   bool "64k page size" if 44x || PPC64
+   select PPC_HAS_HASH_64K if PPC64
+
+endchoice
 
 config FORCE_MAX_ZONEORDER
int "Maximum zone order"
-   range 9 64 if PPC_64K_PAGES
-   default "9" if PPC_64K_PAGES
+   range 9 64 if PPC64 && PPC_64K_PAGES
+   default "9" if PPC64 && PPC_64K_PAGES
range 13 64 if PPC64 && !PPC_64K_PAGES
default "13" if PPC64 && !PPC_64K_PAGES
+   range 9 64 if PPC32 && PPC_16K_PAGES
+   default "9" if PPC32 && PPC_16K_PAGES
+   range 7 64 if PPC32 && PPC_64K_PAGES
+   default "7" if PPC32 && PPC_64K_PAGES
range 11 64
default "11"
help
@@ -437,7 +467,7 @@ config FORCE_MAX_ZONEORDER
 
 config PPC_SUBPAGE_PROT
bool "Support setting protections for 4k subpages"
-   depends on PPC_64K_PAGES
+   depends on PPC64 && PPC_64K_PAGES
help
  This option adds support for a system call to allow user programs
  to set access permissions (read/write, readonly, or no access)
diff --git a/arch/powerpc/include/asm/highmem.h 
b/arch/powerpc/include/asm/highmem.h
index 91c5895..9875540 100644
--- a/arch/powerpc/include/asm/highmem.h
+++ b/arch/powerpc/include/asm/highmem.h
@@ -38,9 +38,20 @@ extern pte_t *pkmap_page_table;
  * easily, subsequent pte tables have to be allocated in one physical
  * chunk of RAM.
  */
-#define LAST_PKMAP (1 << PTE_SHIFT)
-#define LAST_PKMAP_MASK (LAST_PKMAP-1)
+/*
+ * We use one full pte table with 4K pages. And with 16K/64K pages pte
+ * table covers enough memory (32MB and 512MB resp.) that both FIXMAP
+ * and PKMAP can be placed in single pte table. We use 1024 pages for
+ * PKMAP in case of 16K/64K pages.
+ */
+#define PKMAP_ORDERmin(PTE_SHIFT, 10)
+#

Re: [PATCH v1] RS485 support for MPC5200x_psc_uart

2008-11-27 Thread Wolfram Sang
Hello Hans,

On Mon, Nov 17, 2008 at 04:27:45PM +0100, Lehmann, Hans (Ritter Elektronik) 
wrote:

> Criticism is welcome

Well, there are still some issues concerning coding-style and design,
but those can be worked out, I guess. Still, there is one conceptual
question I'd like to ask:

Have you seen the TxRTS feature in Mode Register 2? It looks to me that
it does the same (in hardware) what you achieve with the
*_rts_clear-function and the TX_EMPTY interrupt. Or am I wrong?

Kind regards,

   Wolfram

-- 
  Dipl.-Ing. Wolfram Sang | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCH 4/5] powerpc: ftrace, use create_branch

2008-11-27 Thread Michael Ellerman
On Wed, 2008-11-26 at 16:58 -0500, Steven Rostedt wrote:
> plain text document attachment
> (0004-powerpc-ftrace-use-create_branch.patch)
> From: Steven Rostedt <[EMAIL PROTECTED]>
> 
> Impact: clean up
> 
> Paul Mackerras pointed out that the code to determine if the branch
> can reach the destination is incorrect. Michael Ellerman suggested
> to pull out the code from create_branch and use that.
> 
> Simply using create_branch is probably the best.

You're right, that's a lot simpler :)

Acked-by: Michael Ellerman <[EMAIL PROTECTED]>

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person


signature.asc
Description: This is a digitally signed message part
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Re: [PATCH] mpc52xx/serial: fix error paths in probe function

2008-11-27 Thread Wolfram Sang

On Thu, Nov 27, 2008 at 11:40:55AM -0500, Jon Smirl wrote:

> > +   if (port->irq == NO_IRQ) {
> > +   dev_err(&op->dev, "Could not get irq\n");
> > +   return -ENODEV;
> > +   }
> 
> Doesn't NO_IRQ imply polling, not an error?

See below, I just copied the original behaviour. Having another look at
mpc52xx_uart_setup, I don't see any polling option there, so I think it
is correct to do this.

> 
> >
> >dev_dbg(&op->dev, "mpc52xx-psc uart at %p, irq=%x, freq=%i\n",
> >(void *)port->mapbase, port->irq, port->uartclk);
> >
> > -   if ((port->irq == NO_IRQ) || !port->mapbase) {
> > -   printk(KERN_ERR "Could not allocate resources for PSC\n");
> > -   return -EINVAL;
> > -   }

(Originaly dropout for NO_IRQ)

Regards,

   Wolfram

-- 
  Dipl.-Ing. Wolfram Sang | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry


signature.asc
Description: Digital signature
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

[PATCH] of/gpio: Implement of_get_gpio_flags()

2008-11-27 Thread Anton Vorontsov
This function is alike to the simple of_get_gpio(), but accepts new
argument: flags. This new function will be used by the drivers that
need to retrieve additional GPIO information, such as active-low flag.

Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
---
 drivers/of/gpio.c   |   36 +---
 include/linux/of_gpio.h |   38 ++
 2 files changed, 63 insertions(+), 11 deletions(-)

diff --git a/drivers/of/gpio.c b/drivers/of/gpio.c
index 7cd7301..a4ba217 100644
--- a/drivers/of/gpio.c
+++ b/drivers/of/gpio.c
@@ -19,14 +19,17 @@
 #include 
 
 /**
- * of_get_gpio - Get a GPIO number from the device tree to use with GPIO API
+ * of_get_gpio_flags - Get a GPIO number and flags to use with GPIO API
  * @np:device node to get GPIO from
  * @index: index of the GPIO
+ * @flags: a flags pointer to fill in
  *
  * Returns GPIO number to use with Linux generic GPIO API, or one of the errno
- * value on the error condition.
+ * value on the error condition. If @flags is not NULL the function also fills
+ * in flags for the GPIO.
  */
-int of_get_gpio(struct device_node *np, int index)
+int of_get_gpio_flags(struct device_node *np, int index,
+ enum of_gpio_flags *flags)
 {
int ret;
struct device_node *gc;
@@ -59,7 +62,11 @@ int of_get_gpio(struct device_node *np, int index)
goto err1;
}
 
-   ret = of_gc->xlate(of_gc, np, gpio_spec);
+   /* .xlate might decide to not fill in the flags, so clear it. */
+   if (flags)
+   *flags = 0;
+
+   ret = of_gc->xlate(of_gc, np, gpio_spec, flags);
if (ret < 0)
goto err1;
 
@@ -70,26 +77,41 @@ err0:
pr_debug("%s exited with status %d\n", __func__, ret);
return ret;
 }
-EXPORT_SYMBOL(of_get_gpio);
+EXPORT_SYMBOL(of_get_gpio_flags);
 
 /**
- * of_gpio_simple_xlate - translate gpio_spec to the GPIO number
+ * of_gpio_simple_xlate - translate gpio_spec to the GPIO number and flags
  * @of_gc: pointer to the of_gpio_chip structure
  * @np:device node of the GPIO chip
  * @gpio_spec: gpio specifier as found in the device tree
+ * @flags: a flags pointer to fill in
  *
  * This is simple translation function, suitable for the most 1:1 mapped
  * gpio chips. This function performs only one sanity check: whether gpio
  * is less than ngpios (that is specified in the gpio_chip).
  */
 int of_gpio_simple_xlate(struct of_gpio_chip *of_gc, struct device_node *np,
-const void *gpio_spec)
+const void *gpio_spec, enum of_gpio_flags *flags)
 {
const u32 *gpio = gpio_spec;
 
+   /*
+* We're discouraging gpio_cells < 2, since that way you'll have to
+* write your own xlate function (that will have to retrive the GPIO
+* number and the flags from a single gpio cell -- this is possible,
+* but not recommended).
+*/
+   if (of_gc->gpio_cells < 2) {
+   WARN_ON(1);
+   return -EINVAL;
+   }
+
if (*gpio > of_gc->gc.ngpio)
return -EINVAL;
 
+   if (flags)
+   *flags = gpio[1];
+
return *gpio;
 }
 EXPORT_SYMBOL(of_gpio_simple_xlate);
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h
index 67db101..8dc9bcb 100644
--- a/include/linux/of_gpio.h
+++ b/include/linux/of_gpio.h
@@ -14,19 +14,32 @@
 #ifndef __LINUX_OF_GPIO_H
 #define __LINUX_OF_GPIO_H
 
+#include 
+#include 
 #include 
 #include 
 
+struct device_node;
+
 #ifdef CONFIG_OF_GPIO
 
 /*
+ * This is Linux-specific flags. By default controllers' and Linux' mapping
+ * match, but GPIO controllers are free to translate their own flags to
+ * Linux-specific in their .xlate callback. Though, 1:1 mapping is recommended.
+ */
+enum of_gpio_flags {
+   OF_GPIO_ACTIVE_LOW = 0x1,
+};
+
+/*
  * Generic OF GPIO chip
  */
 struct of_gpio_chip {
struct gpio_chip gc;
int gpio_cells;
int (*xlate)(struct of_gpio_chip *of_gc, struct device_node *np,
-const void *gpio_spec);
+const void *gpio_spec, enum of_gpio_flags *flags);
 };
 
 static inline struct of_gpio_chip *to_of_gpio_chip(struct gpio_chip *gc)
@@ -50,20 +63,37 @@ static inline struct of_mm_gpio_chip 
*to_of_mm_gpio_chip(struct gpio_chip *gc)
return container_of(of_gc, struct of_mm_gpio_chip, of_gc);
 }
 
-extern int of_get_gpio(struct device_node *np, int index);
+extern int of_get_gpio_flags(struct device_node *np, int index,
+enum of_gpio_flags *flags);
+
 extern int of_mm_gpiochip_add(struct device_node *np,
  struct of_mm_gpio_chip *mm_gc);
 extern int of_gpio_simple_xlate(struct of_gpio_chip *of_gc,
struct device_node *np,
-   const void *gpio_spec);
+   co

[PATCH] powerpc/83xx: Fix MCU support merge issue in mpc8349emitx.dts

2008-11-27 Thread Anton Vorontsov
Just found the merge issue in 442746989d92afc125040e0f29b33602ad94da99
("powerpc/83xx: Add support for MCU microcontroller in .dts files"):
the commit adds the MCU controller node into the DMA node, which is
wrong because the MCU sits on the I2C bus. Fix this by moving the MCU
node into the I2C controller node.

The original patch[1] was OK though. ;-)

[1] http://patchwork.ozlabs.org/patch/4895/

Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
---
 arch/powerpc/boot/dts/mpc8349emitx.dts |   16 
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/boot/dts/mpc8349emitx.dts 
b/arch/powerpc/boot/dts/mpc8349emitx.dts
index 2c9d54a..4bdbaf4 100644
--- a/arch/powerpc/boot/dts/mpc8349emitx.dts
+++ b/arch/powerpc/boot/dts/mpc8349emitx.dts
@@ -91,6 +91,14 @@
interrupts = <18 0x8>;
interrupt-parent = <&ipic>;
};
+
+   mcu_pio: [EMAIL PROTECTED] {
+   #gpio-cells = <2>;
+   compatible = "fsl,mc9s08qg8-mpc8349emitx",
+"fsl,mcu-mpc8349emitx";
+   reg = <0x0a>;
+   gpio-controller;
+   };
};
 
[EMAIL PROTECTED] {
@@ -139,14 +147,6 @@
interrupt-parent = <&ipic>;
interrupts = <71 8>;
};
-
-   mcu_pio: [EMAIL PROTECTED] {
-   #gpio-cells = <2>;
-   compatible = "fsl,mc9s08qg8-mpc8349emitx",
-"fsl,mcu-mpc8349emitx";
-   reg = <0x0a>;
-   gpio-controller;
-   };
};
 
[EMAIL PROTECTED] {
-- 
1.5.6.5
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] mpc52xx/serial: fix error paths in probe function

2008-11-27 Thread Jon Smirl
On Thu, Nov 27, 2008 at 10:33 AM, Wolfram Sang <[EMAIL PROTECTED]> wrote:
> - error cases for mapbase and irq were unbundled
> - mapped irq now gets disposed on error
> - errors return ENODEV instead of EINVAL as they are not dependant on
>  arguments
>
> Signed-off-by: Wolfram Sang <[EMAIL PROTECTED]>
> ---
>  drivers/serial/mpc52xx_uart.c |   27 +--
>  1 files changed, 17 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
> index 3234100..93e8893 100644
> --- a/drivers/serial/mpc52xx_uart.c
> +++ b/drivers/serial/mpc52xx_uart.c
> @@ -1113,14 +1113,14 @@ mpc52xx_uart_of_probe(struct of_device *op, const 
> struct of_device_id *match)
>if (mpc52xx_uart_nodes[idx] == op->node)
>break;
>if (idx >= MPC52xx_PSC_MAXNUM)
> -   return -EINVAL;
> +   return -ENODEV;
>pr_debug("Found %s assigned to ttyPSC%x\n",
> mpc52xx_uart_nodes[idx]->full_name, idx);
>
>uartclk = psc_ops->getuartclk(op->node);
>if (uartclk == 0) {
>dev_dbg(&op->dev, "Could not find uart clock frequency!\n");
> -   return -EINVAL;
> +   return -ENODEV;
>}
>
>/* Init the port structure */
> @@ -1142,22 +1142,29 @@ mpc52xx_uart_of_probe(struct of_device *op, const 
> struct of_device_id *match)
>return ret;
>
>port->mapbase = res.start;
> +   if (!port->mapbase) {
> +   dev_err(&op->dev, "Could not allocate resources for PSC\n");
> +   return -ENODEV;
> +   }
> +
>port->irq = irq_of_parse_and_map(op->node, 0);
> +   if (port->irq == NO_IRQ) {
> +   dev_err(&op->dev, "Could not get irq\n");
> +   return -ENODEV;
> +   }

Doesn't NO_IRQ imply polling, not an error?

>
>dev_dbg(&op->dev, "mpc52xx-psc uart at %p, irq=%x, freq=%i\n",
>(void *)port->mapbase, port->irq, port->uartclk);
>
> -   if ((port->irq == NO_IRQ) || !port->mapbase) {
> -   printk(KERN_ERR "Could not allocate resources for PSC\n");
> -   return -EINVAL;
> -   }
> -
>/* Add the port to the uart sub-system */
>ret = uart_add_one_port(&mpc52xx_uart_driver, port);
> -   if (!ret)
> -   dev_set_drvdata(&op->dev, (void *)port);
> +   if (ret) {
> +   irq_dispose_mapping(port->irq);
> +   return -ENODEV;
> +   }
>
> -   return ret;
> +   dev_set_drvdata(&op->dev, (void *)port);
> +   return 0;
>  }
>
>  static int
> --
> 1.5.6.5
>
> ___
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>



-- 
Jon Smirl
[EMAIL PROTECTED]
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: i2c-mpc clocking scheme

2008-11-27 Thread Luotao Fu
Timur Tabi wrote:
> On Thu, Nov 27, 2008 at 9:00 AM, Andre Schwarz
> <[EMAIL PROTECTED]> wrote:
>> All,
>>
>> is anybody working on some improvements regarding configurable I2C
>> frequency inside the i2c-mpc driver ?
>>
>> If not - would anybody be intersted in getting this done, i.e.
>> configurable via device tree ?
> 
> Maybe I'm missing something, but U-Boot configures the I2C bus speed.

i2c-mpc sets the bus clock in kernel with mpc_i2c_setclock. The bus
speed in kernel is indepedent from u-boot.

> It does this because the algorithm is specific to the SOC itself.  For
> example, the 8544 is different from the 8548.  It would be a mess to
> duplicate this code in the kernel.
> 

I did try to write some mechanismen to make the i2c bus speed
configurable for  mpc5200. I found it quite hard to find some algorithm
to calculate the right values in the Timing table of the I2C bus
controller. Anyhow I gave it up after starring at the datasheet for some
time. ;-) I can't speak for other platforms, which are supported by
i2c-mpc. Anyway, I do think it might be interesting to have configurable
i2c bus speed.

cheers
Luotao Fu
-- 
   Dipl.-Ing. Luotao Fu | Phone: +49-5121-206917-5004
Pengutronix - Linux Solutions for Science and Industry
Entwicklungszentrum Nord http://www.pengutronix.de

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] xsysace: add compatible string

2008-11-27 Thread Yuri Tikhonov
Add one more compatible string to the table for
of_platform binding, so that the platforms, which
have the SysACE chip on board (e.g. Katmai), could
describe it in their device trees correctly.

Signed-off-by: Yuri Tikhonov <[EMAIL PROTECTED]>
---
 drivers/block/xsysace.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index 29e1dfa..381d686 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -1206,6 +1206,7 @@ static struct of_device_id ace_of_match[] __devinitdata = 
{
{ .compatible = "xlnx,opb-sysace-1.00.b", },
{ .compatible = "xlnx,opb-sysace-1.00.c", },
{ .compatible = "xlnx,xps-sysace-1.00.a", },
+   { .compatible = "xlnx,sysace", },
{},
 };
 MODULE_DEVICE_TABLE(of, ace_of_match);
-- 
1.5.6.1
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH][v2] xsysace: use resource_size_t instead of unsigned long

2008-11-27 Thread Yuri Tikhonov

 Hello Grant,

On Thursday 27 November 2008 17:11, Grant Likely wrote:
> On Thu, Nov 27, 2008 at 5:21 AM, Yuri Tikhonov <[EMAIL PROTECTED]> wrote:
> > Use resource_size_t for physical address of SystemACE
> > chip. This fixes the driver brokeness for 32 bit systems
> > with 64 bit resources (e.g. PPC440SPe).
> 
> Hey Yuri,
> 
> I actually already picked up the last version of your patch after
> fixing it up myself.  It's currently sitting in Paul's powerpc tree
> and it will be merged into mainline when Linus gets back from
> vacation.

 Oops. Indeed. Thanks.

> 
> Can you please spin a new version with just the addition of the
> compatible value and base it on Paul's tree.

 Sure. I've generated the patch against the origin/merge branch of Paul's 
tree, and posting it as separate "[PATCH] xsysace: add compatible string
".

 Regards, Yuri
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


TR: Async DMA completion

2008-11-27 Thread Laurent Lagrange

Hello,

I would like to use async DMA driver to transfer data. I find no function to
wait for the end of the DMA transfer in blocking mode:
the only way to get the end of the transfer is the polling by the function
"dma_async_is_tx_complete".

To wait the end of the transfer, must I poll the transfer status by the
function "dma_async_is_tx_complete" or is there a function
that waits for a DMA channel interrupt ?

Thanks for any tips.
Laurent


___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: i2c-mpc clocking scheme

2008-11-27 Thread Andre Schwarz
Timur Tabi schrieb:
> On Thu, Nov 27, 2008 at 9:00 AM, Andre Schwarz
> <[EMAIL PROTECTED]> wrote:
>   
>> All,
>>
>> is anybody working on some improvements regarding configurable I2C
>> frequency inside the i2c-mpc driver ?
>>
>> If not - would anybody be intersted in getting this done, i.e.
>> configurable via device tree ?
>> 
>
> Maybe I'm missing something, but U-Boot configures the I2C bus speed.
> It does this because the algorithm is specific to the SOC itself.  For
> example, the 8544 is different from the 8548.  It would be a mess to
> duplicate this code in the kernel.
>
>   
You're right regarding U-Boot, but the i2c-mpc driver overwrites the
"frequency divider register" on all chips.

I'm not happy with a fixed 0x3f @ MPC5200 which results in 65kHz ... :-(

Have a look at line 163 in drivers/i2c/busses/i2c-mpc.c



MATRIX VISION GmbH, Talstraße 16, DE-71570 Oppenweiler  - Registergericht: 
Amtsgericht Stuttgart, HRB 271090
Geschäftsführer: Gerhard Thullner, Werner Armingeon, Uwe Furtner
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Fwd: [PATCH] Add QPACE as a separated Cell platform

2008-11-27 Thread Arnd Bergmann
From: Benjamin Krill <[EMAIL PROTECTED]>

Since the QPACE (Chromodynamics Parallel Computing on the
Cell Broadband Engine) platform doesn't use a iommu, doesn't
have PCI devices and a MPIC much lesser setup and
configurations are needed. So far all devices are detected
as OF device. A notifier function is used to set the dma_ops
for the of_platform bus. Further this patch splits the
PPC_CELL_NATIVE into PPC_CELL_COMMON which are parts that are
shared with the QPACE platform and the rest.

Signed-off-by: Benjamin Krill <[EMAIL PROTECTED]>
Signed-off-by: Arnd Bergmann <[EMAIL PROTECTED]>
---
 arch/powerpc/boot/Makefile|1 +
 arch/powerpc/platforms/cell/Kconfig   |   19 +++--
 arch/powerpc/platforms/cell/Makefile  |   17 ++--
 arch/powerpc/platforms/cell/qpace_setup.c |  141 +
 4 files changed, 163 insertions(+), 15 deletions(-)
 create mode 100644 arch/powerpc/platforms/cell/qpace_setup.c

diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 8fc6d72..75412aa 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -193,6 +193,7 @@ image-$(CONFIG_PPC_MAPLE)   += zImage.pseries
 image-$(CONFIG_PPC_IBM_CELL_BLADE) += zImage.pseries
 image-$(CONFIG_PPC_PS3)+= dtbImage.ps3
 image-$(CONFIG_PPC_CELLEB) += zImage.pseries
+image-$(CONFIG_PPC_CELL_QPACE) += zImage.pseries
 image-$(CONFIG_PPC_CHRP)   += zImage.chrp
 image-$(CONFIG_PPC_EFIKA)  += zImage.chrp
 image-$(CONFIG_PPC_PMAC)   += zImage.pmac
diff --git a/arch/powerpc/platforms/cell/Kconfig 
b/arch/powerpc/platforms/cell/Kconfig
index c14d7d8..56ae9c5 100644
--- a/arch/powerpc/platforms/cell/Kconfig
+++ b/arch/powerpc/platforms/cell/Kconfig
@@ -2,13 +2,18 @@ config PPC_CELL
bool
default n
 
-config PPC_CELL_NATIVE
+config PPC_CELL_COMMON
bool
select PPC_CELL
select PPC_DCR_MMIO
-   select PPC_OF_PLATFORM_PCI
select PPC_INDIRECT_IO
select PPC_NATIVE
+   select PPC_RTAS
+
+config PPC_CELL_NATIVE
+   bool
+   select PPC_CELL_COMMON
+   select PPC_OF_PLATFORM_PCI
select MPIC
select IBM_NEW_EMAC_EMAC4
select IBM_NEW_EMAC_RGMII
@@ -20,7 +25,6 @@ config PPC_IBM_CELL_BLADE
bool "IBM Cell Blade"
depends on PPC_MULTIPLATFORM && PPC64
select PPC_CELL_NATIVE
-   select PPC_RTAS
select MMIO_NVRAM
select PPC_UDBG_16550
select UDBG_RTAS_CONSOLE
@@ -28,16 +32,17 @@ config PPC_IBM_CELL_BLADE
 config PPC_CELLEB
bool "Toshiba's Cell Reference Set 'Celleb' Architecture"
depends on PPC_MULTIPLATFORM && PPC64
-   select PPC_CELL
select PPC_CELL_NATIVE
-   select PPC_RTAS
-   select PPC_INDIRECT_IO
-   select PPC_OF_PLATFORM_PCI
select HAS_TXX9_SERIAL
select PPC_UDBG_BEAT
select USB_OHCI_BIG_ENDIAN_MMIO
select USB_EHCI_BIG_ENDIAN_MMIO
 
+config PPC_CELL_QPACE
+   bool "IBM Cell - QPACE"
+   depends on PPC_MULTIPLATFORM && PPC64
+   select PPC_CELL_COMMON
+
 menu "Cell Broadband Engine options"
depends on PPC_CELL
 
diff --git a/arch/powerpc/platforms/cell/Makefile 
b/arch/powerpc/platforms/cell/Makefile
index 7fd8308..43eccb2 100644
--- a/arch/powerpc/platforms/cell/Makefile
+++ b/arch/powerpc/platforms/cell/Makefile
@@ -1,7 +1,7 @@
-obj-$(CONFIG_PPC_CELL_NATIVE)  += interrupt.o iommu.o setup.o \
-  cbe_regs.o spider-pic.o \
-  pervasive.o pmu.o io-workarounds.o \
-  spider-pci.o
+obj-$(CONFIG_PPC_CELL_COMMON)  += cbe_regs.o interrupt.o pervasive.o
+
+obj-$(CONFIG_PPC_CELL_NATIVE)  += iommu.o setup.o spider-pic.o \
+  pmu.o io-workarounds.o spider-pci.o
 obj-$(CONFIG_CBE_RAS)  += ras.o
 
 obj-$(CONFIG_CBE_THERM)+= cbe_thermal.o
@@ -14,13 +14,12 @@ obj-$(CONFIG_PPC_IBM_CELL_POWERBUTTON)  += 
cbe_powerbutton.o
 
 ifeq ($(CONFIG_SMP),y)
 obj-$(CONFIG_PPC_CELL_NATIVE)  += smp.o
+obj-$(CONFIG_PPC_CELL_QPACE)   += smp.o
 endif
 
 # needed only when building loadable spufs.ko
-spu-priv1-$(CONFIG_PPC_CELL_NATIVE)+= spu_priv1_mmio.o
-
-spu-manage-$(CONFIG_PPC_CELLEB)+= spu_manage.o
-spu-manage-$(CONFIG_PPC_CELL_NATIVE)   += spu_manage.o
+spu-priv1-$(CONFIG_PPC_CELL_COMMON)+= spu_priv1_mmio.o
+spu-manage-$(CONFIG_PPC_CELL_COMMON)   += spu_manage.o
 
 obj-$(CONFIG_SPU_BASE) += spu_callbacks.o spu_base.o \
   spu_notify.o \
@@ -31,6 +30,8 @@ obj-$(CONFIG_SPU_BASE)+= 
spu_callbacks.o spu_base.o \
 
 obj-$(CONFIG_PCI_MSI)  += axon_msi.o
 
+# qpace setup
+obj-$(CONFIG_PPC_CELL_QPACE)   += qpace_setup.o
 
 # cel

[PATCH] mpc52xx/serial: fix error paths in probe function

2008-11-27 Thread Wolfram Sang
- error cases for mapbase and irq were unbundled
- mapped irq now gets disposed on error
- errors return ENODEV instead of EINVAL as they are not dependant on
  arguments

Signed-off-by: Wolfram Sang <[EMAIL PROTECTED]>
---
 drivers/serial/mpc52xx_uart.c |   27 +--
 1 files changed, 17 insertions(+), 10 deletions(-)

diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c
index 3234100..93e8893 100644
--- a/drivers/serial/mpc52xx_uart.c
+++ b/drivers/serial/mpc52xx_uart.c
@@ -1113,14 +1113,14 @@ mpc52xx_uart_of_probe(struct of_device *op, const 
struct of_device_id *match)
if (mpc52xx_uart_nodes[idx] == op->node)
break;
if (idx >= MPC52xx_PSC_MAXNUM)
-   return -EINVAL;
+   return -ENODEV;
pr_debug("Found %s assigned to ttyPSC%x\n",
 mpc52xx_uart_nodes[idx]->full_name, idx);
 
uartclk = psc_ops->getuartclk(op->node);
if (uartclk == 0) {
dev_dbg(&op->dev, "Could not find uart clock frequency!\n");
-   return -EINVAL;
+   return -ENODEV;
}
 
/* Init the port structure */
@@ -1142,22 +1142,29 @@ mpc52xx_uart_of_probe(struct of_device *op, const 
struct of_device_id *match)
return ret;
 
port->mapbase = res.start;
+   if (!port->mapbase) {
+   dev_err(&op->dev, "Could not allocate resources for PSC\n");
+   return -ENODEV;
+   }
+
port->irq = irq_of_parse_and_map(op->node, 0);
+   if (port->irq == NO_IRQ) {
+   dev_err(&op->dev, "Could not get irq\n");
+   return -ENODEV;
+   }
 
dev_dbg(&op->dev, "mpc52xx-psc uart at %p, irq=%x, freq=%i\n",
(void *)port->mapbase, port->irq, port->uartclk);
 
-   if ((port->irq == NO_IRQ) || !port->mapbase) {
-   printk(KERN_ERR "Could not allocate resources for PSC\n");
-   return -EINVAL;
-   }
-
/* Add the port to the uart sub-system */
ret = uart_add_one_port(&mpc52xx_uart_driver, port);
-   if (!ret)
-   dev_set_drvdata(&op->dev, (void *)port);
+   if (ret) {
+   irq_dispose_mapping(port->irq);
+   return -ENODEV;
+   }
 
-   return ret;
+   dev_set_drvdata(&op->dev, (void *)port);
+   return 0;
 }
 
 static int
-- 
1.5.6.5

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: i2c-mpc clocking scheme

2008-11-27 Thread Timur Tabi
On Thu, Nov 27, 2008 at 9:00 AM, Andre Schwarz
<[EMAIL PROTECTED]> wrote:
> All,
>
> is anybody working on some improvements regarding configurable I2C
> frequency inside the i2c-mpc driver ?
>
> If not - would anybody be intersted in getting this done, i.e.
> configurable via device tree ?

Maybe I'm missing something, but U-Boot configures the I2C bus speed.
It does this because the algorithm is specific to the SOC itself.  For
example, the 8544 is different from the 8548.  It would be a mess to
duplicate this code in the kernel.

-- 
Timur Tabi
Linux kernel developer at Freescale
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


i2c-mpc clocking scheme

2008-11-27 Thread Andre Schwarz
All,

is anybody working on some improvements regarding configurable I2C
frequency inside the i2c-mpc driver ?

If not - would anybody be intersted in getting this done, i.e.
configurable via device tree ?



regards,
Andre

MATRIX VISION GmbH, Talstraße 16, DE-71570 Oppenweiler  - Registergericht: 
Amtsgericht Stuttgart, HRB 271090
Geschäftsführer: Gerhard Thullner, Werner Armingeon, Uwe Furtner
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] powerpc/pseries: fix idle sleep early exit state

2008-11-27 Thread Sebastien Dugue

  In pseries_dedicated_idle_sleep(), if we need to exit idle during the
snooze period (i.e. need_resched or cpu has been offlined), then we should
re-disable the interrupts and clear TIF_POLLING_NRFLAG before leaving.

Signed-off-by: Sebastien Dugue <[EMAIL PROTECTED]>
Cc: Paul Mackerras <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/pseries/setup.c |   10 --
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/setup.c 
b/arch/powerpc/platforms/pseries/setup.c
index ec34170..8270f04 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -504,8 +504,13 @@ static void pseries_dedicated_idle_sleep(void)
set_thread_flag(TIF_POLLING_NRFLAG);
 
while (get_tb() < start_snooze) {
-   if (need_resched() || cpu_is_offline(cpu))
-   goto out;
+   if (need_resched() || cpu_is_offline(cpu)) {
+   HMT_medium();
+   clear_thread_flag(TIF_POLLING_NRFLAG);
+   smp_mb();
+   local_irq_disable();
+   goto out2;
+   }
ppc64_runlatch_off();
HMT_low();
HMT_very_low();
@@ -523,6 +528,7 @@ static void pseries_dedicated_idle_sleep(void)
 
 out:
HMT_medium();
+out2:
out_purr = mfspr(SPRN_PURR);
get_lppaca()->wait_state_cycles += out_purr - in_purr;
get_lppaca()->donate_dedicated_cpu = 0;
-- 
1.6.0.1.308.gede4c

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH][v2] xsysace: use resource_size_t instead of unsigned long

2008-11-27 Thread Grant Likely
On Thu, Nov 27, 2008 at 5:21 AM, Yuri Tikhonov <[EMAIL PROTECTED]> wrote:
> Use resource_size_t for physical address of SystemACE
> chip. This fixes the driver brokeness for 32 bit systems
> with 64 bit resources (e.g. PPC440SPe).

Hey Yuri,

I actually already picked up the last version of your patch after
fixing it up myself.  It's currently sitting in Paul's powerpc tree
and it will be merged into mainline when Linus gets back from
vacation.

Can you please spin a new version with just the addition of the
compatible value and base it on Paul's tree.

Thanks,
g.
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH][v2] xsysace: use resource_size_t instead of unsigned long

2008-11-27 Thread Yuri Tikhonov
I'm sorry, but the patch I've just posted turn out to be corrupted. The
correct one is below.

---
Use resource_size_t for physical address of SystemACE
chip. This fixes the driver brokeness for 32 bit systems
with 64 bit resources (e.g. PPC440SPe).

Also this patch adds one more compatible string for more
clean description of the hardware, and fixes a sector_t-
related compilation warning.

Signed-off-by: Yuri Tikhonov <[EMAIL PROTECTED]>
Signed-off-by: Ilya Yanok <[EMAIL PROTECTED]>
---
 drivers/block/xsysace.c |   24 +---
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index ecab9e6..9efd3d7 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -194,7 +194,7 @@ struct ace_device {
int in_irq;
 
/* Details of hardware device */
-   unsigned long physaddr;
+   resource_size_t physaddr;
void __iomem *baseaddr;
int irq;
int bus_width;  /* 0 := 8 bit; 1 := 16 bit */
@@ -628,8 +628,8 @@ static void ace_fsm_dostate(struct ace_device *ace)
 
/* Okay, it's a data request, set it up for transfer */
dev_dbg(ace->dev,
-   "request: sec=%lx hcnt=%lx, ccnt=%x, dir=%i\n",
-   req->sector, req->hard_nr_sectors,
+   "request: sec=%llx hcnt=%lx, ccnt=%x, dir=%i\n",
+   (unsigned long long)req->sector, req->hard_nr_sectors,
req->current_nr_sectors, rq_data_dir(req));
 
ace->req = req;
@@ -935,7 +935,8 @@ static int __devinit ace_setup(struct ace_device *ace)
int rc;
 
dev_dbg(ace->dev, "ace_setup(ace=0x%p)\n", ace);
-   dev_dbg(ace->dev, "physaddr=0x%lx irq=%i\n", ace->physaddr, ace->irq);
+   dev_dbg(ace->dev, "physaddr=0x%llx irq=%i\n",
+   (unsigned long long)ace->physaddr, ace->irq);
 
spin_lock_init(&ace->lock);
init_completion(&ace->id_completion);
@@ -1017,8 +1018,8 @@ static int __devinit ace_setup(struct ace_device *ace)
/* Print the identification */
dev_info(ace->dev, "Xilinx SystemACE revision %i.%i.%i\n",
 (version >> 12) & 0xf, (version >> 8) & 0x0f, version & 0xff);
-   dev_dbg(ace->dev, "physaddr 0x%lx, mapped to 0x%p, irq=%i\n",
-   ace->physaddr, ace->baseaddr, ace->irq);
+   dev_dbg(ace->dev, "physaddr 0x%llx, mapped to 0x%p, irq=%i\n",
+   (unsigned long long)ace->physaddr, ace->baseaddr, ace->irq);
 
ace->media_change = 1;
ace_revalidate_disk(ace->gd);
@@ -1035,8 +1036,8 @@ err_alloc_disk:
 err_blk_initq:
iounmap(ace->baseaddr);
 err_ioremap:
-   dev_info(ace->dev, "xsysace: error initializing device at 0x%lx\n",
-  ace->physaddr);
+   dev_info(ace->dev, "xsysace: error initializing device at 0x%llx\n",
+(unsigned long long)ace->physaddr);
return -ENOMEM;
 }
 
@@ -1059,7 +1060,7 @@ static void __devexit ace_teardown(struct ace_device *ace)
 }
 
 static int __devinit
-ace_alloc(struct device *dev, int id, unsigned long physaddr,
+ace_alloc(struct device *dev, int id, resource_size_t physaddr,
  int irq, int bus_width)
 {
struct ace_device *ace;
@@ -1119,7 +1120,7 @@ static void __devexit ace_free(struct device *dev)
 
 static int __devinit ace_probe(struct platform_device *dev)
 {
-   unsigned long physaddr = 0;
+   resource_size_t physaddr = 0;
int bus_width = ACE_BUS_WIDTH_16; /* FIXME: should not be hard coded */
int id = dev->id;
int irq = NO_IRQ;
@@ -1165,7 +1166,7 @@ static int __devinit
 ace_of_probe(struct of_device *op, const struct of_device_id *match)
 {
struct resource res;
-   unsigned long physaddr;
+   resource_size_t physaddr;
const u32 *id;
int irq, bus_width, rc;
 
@@ -1205,6 +1206,7 @@ static struct of_device_id ace_of_match[] __devinitdata = 
{
{ .compatible = "xlnx,opb-sysace-1.00.b", },
{ .compatible = "xlnx,opb-sysace-1.00.c", },
{ .compatible = "xlnx,xps-sysace-1.00.a", },
+   { .compatible = "xlnx,sysace", },
{},
 };
 MODULE_DEVICE_TABLE(of, ace_of_match);
-- 
1.5.6.1
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH][v2] xsysace: use resource_size_t instead of unsigned long

2008-11-27 Thread Yuri Tikhonov
Use resource_size_t for physical address of SystemACE
chip. This fixes the driver brokeness for 32 bit systems
with 64 bit resources (e.g. PPC440SPe).

Also this patch adds one more compatible string for more
clean description of the hardware, and fixes a sector_t-
related compilation warning.

Signed-off-by: Yuri Tikhonov <[EMAIL PROTECTED]>
Signed-off-by: Ilya Yanok <[EMAIL PROTECTED]>
---
 drivers/block/xsysace.c |   24 +---
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index ecab9e6..9efd3d7 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -194,7 +194,7 @@ struct ace_device {
int in_irq;
 
/* Details of hardware device */
-   unsigned long physaddr;
+   resource_size_t physaddr;
void __iomem *baseaddr;
int irq;
int bus_width;  /* 0 := 8 bit; 1 := 16 bit */
@@ -628,8 +628,8 @@ static void ace_fsm_dostate(struct ace_device *ace)
 
/* Okay, it's a data request, set it up for transfer */
dev_dbg(ace->dev,
-   "request: sec=%lx hcnt=%lx, ccnt=%x, dir=%i\n",
-   req->sector, req->hard_nr_sectors,
+   "request: sec=%llx hcnt=%lx, ccnt=%x, dir=%i\n",
+   (unsigned long long)req->sector, req->hard_nr_sectors,
req->current_nr_sectors, rq_data_dir(req));
 
ace->req = req;
@@ -935,7 +935,8 @@ static int __devinit ace_setup(struct ace_device *ace)
int rc;
 
dev_dbg(ace->dev, "ace_setup(ace=0x%p)\n", ace);
-   dev_dbg(ace->dev, "physaddr=0x%lx irq=%i\n", ace->physaddr, ace->irq);
+   dev_dbg(ace->dev, "physaddr=0x%llx irq=%i\n",
+   (unsigned long long)ace->physaddr, ace->irq);
 
spin_lock_init(&ace->lock);
init_completion(&ace->id_completion);
@@ -1017,8 +1018,8 @@ static int __devinit ace_setup(struct ace_device *ace)
/* Print the identification */
dev_info(ace->dev, "Xilinx SystemACE revision %i.%i.%i\n",
 (version >> 12) & 0xf, (version >> 8) & 0x0f, version & 0xff);
-   dev_dbg(ace->dev, "physaddr 0x%lx, mapped to 0x%p, irq=%i\n",
-   ace->physaddr, ace->baseaddr, ace->irq);
+   dev_dbg(ace->dev, "physaddr 0x%llx, mapped to 0x%p, irq=%i\n",
+   (unsigned long long)ace->physaddr, ace->baseaddr, ace->irq);
 
ace->media_change = 1;
ace_revalidate_disk(ace->gd);
@@ -1035,8 +1036,8 @@ err_alloc_disk:
 err_blk_initq:
iounmap(ace->baseaddr);
 err_ioremap:
-   dev_info(ace->dev, "xsysace: error initializing device at 0x%lx\n",
-  ace->physaddr);
+   dev_info(ace->dev, "xsysace: error initializing device at 0x%llx\n",
+(unsigned long long)ace->physaddr);
return -ENOMEM;
 }
 
@@ -1059,7 +1060,7 @@ static void __devexit ace_teardown(struct ace_device 
*ace)
 }
 
 static int __devinit
-ace_alloc(struct device *dev, int id, unsigned long physaddr,
+ace_alloc(struct device *dev, int id, resource_size_t physaddr,
  int irq, int bus_width)
 {
struct ace_device *ace;
@@ -1119,7 +1120,7 @@ static void __devexit ace_free(struct device *dev)
 
 static int __devinit ace_probe(struct platform_device *dev)
 {
-   unsigned long physaddr = 0;
+   resource_size_t physaddr = 0;
int bus_width = ACE_BUS_WIDTH_16; /* FIXME: should not be hard coded */
int id = dev->id;
int irq = NO_IRQ;
@@ -1165,7 +1166,7 @@ static int __devinit
 ace_of_probe(struct of_device *op, const struct of_device_id *match)
 {
struct resource res;
-   unsigned long physaddr;
+   resource_size_t physaddr;
const u32 *id;
int irq, bus_width, rc;
 
@@ -1205,6 +1206,7 @@ static struct of_device_id ace_of_match[] __devinitdata 
= {
{ .compatible = "xlnx,opb-sysace-1.00.b", },
{ .compatible = "xlnx,opb-sysace-1.00.c", },
{ .compatible = "xlnx,xps-sysace-1.00.a", },
+   { .compatible = "xlnx,sysace", },
{},
 };
 MODULE_DEVICE_TABLE(of, ace_of_match);
-- 
1.5.6.1
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] powerpc/ibmebus: Get rid of the IRQ mapping in ibmebus_free_irq()

2008-11-27 Thread Sebastien Dugue

  ibmebus_free_irq() frees the IRQ but does not remove its mapping which
results in stale entries in the map.

  Fix this by adding a call to irq_dispose_mapping() in ibmebus_free_irq().

Signed-off-by: Sebastien Dugue <[EMAIL PROTECTED]>
Cc: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
Cc: Paul Mackerras <[EMAIL PROTECTED]>
---
 arch/powerpc/kernel/ibmebus.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kernel/ibmebus.c b/arch/powerpc/kernel/ibmebus.c
index 64299d2..7c65377 100644
--- a/arch/powerpc/kernel/ibmebus.c
+++ b/arch/powerpc/kernel/ibmebus.c
@@ -231,6 +231,7 @@ void ibmebus_free_irq(u32 ist, void *dev_id)
unsigned int irq = irq_find_mapping(NULL, ist);
 
free_irq(irq, dev_id);
+   irq_dispose_mapping(irq);
 }
 EXPORT_SYMBOL(ibmebus_free_irq);
 
-- 
1.6.0.1.308.gede4c

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


[PATCH] powerpc/pseries: Fix cpu hotplug

2008-11-27 Thread Sebastien Dugue

  Currently, pseries_cpu_die() calls msleep() while polling RTAS for
the status of the dying cpu.

  However if the cpu that is going down also happens to be the one doing
the tick then we're hosed as the tick_do_timer_cpu 'baton' is only passed
later on in tick_shutdown() when _cpu_down() does the CPU_DEAD notification.
Therefore jiffies won't be updated anymore.

  This patch replaces that msleep() with a cpu_relax() to make sure we're
not going to schedule at that point.

  With this patch my test box survives a 100k iterations hotplug stress
test on _all_ cpus, whereas without it, it quickly dies after ~50 iterations.


Signed-off-by: Sebastien Dugue <[EMAIL PROTECTED]>
Cc: Paul Mackerras <[EMAIL PROTECTED]>
Cc: Michael Ellerman <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/pseries/hotplug-cpu.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c 
b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index 1f03248..a20ead8 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -116,7 +116,7 @@ static void pseries_cpu_die(unsigned int cpu)
cpu_status = query_cpu_stopped(pcpu);
if (cpu_status == 0 || cpu_status == -1)
break;
-   msleep(200);
+   cpu_relax();
}
if (cpu_status != 0) {
printk("Querying DEAD? cpu %i (%i) shows %i\n",
-- 
1.6.0.1.308.gede4c

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev