* [PATCH 2/2] serial: sh-sci: Make probe fail for ports that exceed the maximum count
From: Laurent Pinchart @ 2012-06-12 22:28 UTC (permalink / raw)
To: Paul Mundt; +Cc: linux-serial, linux-sh
In-Reply-To: <1339540104-25003-1-git-send-email-laurent.pinchart@ideasonboard.com>
The driver supports a maximum number of ports configurable at compile
time. Make sure the probe() method fails when registering a port that
exceeds the maximum instead of returning success without registering the
port.
This fixes a crash at system suspend time, when the driver tried to
suspend a non-registered port using the UART core.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/tty/serial/sh-sci.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index a779663..55dada3 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -2352,7 +2352,7 @@ static int __devinit sci_probe_single(struct platform_device *dev,
index+1, SCI_NPORTS);
dev_notice(&dev->dev, "Consider bumping "
"CONFIG_SERIAL_SH_SCI_NR_UARTS!\n");
- return 0;
+ return -EINVAL;
}
ret = sci_init_single(dev, sciport, index, p);
--
1.7.3.4
^ permalink raw reply related
* [PATCH 1/2] serial: sh-sci: Fix probe error paths
From: Laurent Pinchart @ 2012-06-12 22:28 UTC (permalink / raw)
To: Paul Mundt; +Cc: linux-serial, linux-sh
When probing fails, the driver must not try to cleanup resources that
have not been initialized. Fix this.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/tty/serial/sh-sci.c | 36 +++++++++++++++++++++++-------------
1 files changed, 23 insertions(+), 13 deletions(-)
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 3158e17..a779663 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -2140,6 +2140,16 @@ static int __devinit sci_init_single(struct platform_device *dev,
return 0;
}
+static void sci_cleanup_single(struct sci_port *port)
+{
+ sci_free_gpios(port);
+
+ clk_put(port->iclk);
+ clk_put(port->fclk);
+
+ pm_runtime_disable(port->port.dev);
+}
+
#ifdef CONFIG_SERIAL_SH_SCI_CONSOLE
static void serial_console_putchar(struct uart_port *port, int ch)
{
@@ -2321,14 +2331,10 @@ static int sci_remove(struct platform_device *dev)
cpufreq_unregister_notifier(&port->freq_transition,
CPUFREQ_TRANSITION_NOTIFIER);
- sci_free_gpios(port);
-
uart_remove_one_port(&sci_uart_driver, &port->port);
- clk_put(port->iclk);
- clk_put(port->fclk);
+ sci_cleanup_single(port);
- pm_runtime_disable(&dev->dev);
return 0;
}
@@ -2353,7 +2359,13 @@ static int __devinit sci_probe_single(struct platform_device *dev,
if (ret)
return ret;
- return uart_add_one_port(&sci_uart_driver, &sciport->port);
+ ret = uart_add_one_port(&sci_uart_driver, &sciport->port);
+ if (ret) {
+ sci_cleanup_single(sciport);
+ return ret;
+ }
+
+ return 0;
}
static int __devinit sci_probe(struct platform_device *dev)
@@ -2374,24 +2386,22 @@ static int __devinit sci_probe(struct platform_device *dev)
ret = sci_probe_single(dev, dev->id, p, sp);
if (ret)
- goto err_unreg;
+ return ret;
sp->freq_transition.notifier_call = sci_notifier;
ret = cpufreq_register_notifier(&sp->freq_transition,
CPUFREQ_TRANSITION_NOTIFIER);
- if (unlikely(ret < 0))
- goto err_unreg;
+ if (unlikely(ret < 0)) {
+ sci_cleanup_single(sp);
+ return ret;
+ }
#ifdef CONFIG_SH_STANDARD_BIOS
sh_bios_gdb_detach();
#endif
return 0;
-
-err_unreg:
- sci_remove(dev);
- return ret;
}
static int sci_suspend(struct device *dev)
--
1.7.3.4
^ permalink raw reply related
* Re: [PATCH V2] serial: pxa: add spin lock for console write
From: Greg KH @ 2012-06-12 22:35 UTC (permalink / raw)
To: Chao Xie; +Cc: linux-serial, haojian.zhuang
In-Reply-To: <1337661780-26446-1-git-send-email-chao.xie@marvell.com>
On Tue, May 22, 2012 at 12:43:00PM +0800, Chao Xie wrote:
> at UP mode, when cpu want to print message in kernel, it will invoke
> peempt_disable and disable irq. So it is safe for UP mode.
> For SMP mode, it is not safe to protect the HW reigsters.
> one CPU will run a program which will invoke printf.
> another CPU will run a program in kernel that invoke printk.
> So when second CPU is trying to printk, it will do
> 1. save ier register
> 2. enable uue bit of ier register
> 3. push buffer to uart fifo
> 4 .restore ier register
> when first CPU want to printf, and it happens between 1 and 4, it will
> enable thre bit of ier, and waiting for transmit intterupt. while step 4
> will make the ier lost thre bit.
> add spin lock here to protect the ier register for console write.
>
> Signed-off-by: Chao Xie <chao.xie@marvell.com>
What is different from patch v1?
> ---
> drivers/tty/serial/pxa.c | 15 +++++++++++++++
> 1 files changed, 15 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c
> index 5847a4b..aca62f6 100644
> --- a/drivers/tty/serial/pxa.c
> +++ b/drivers/tty/serial/pxa.c
> @@ -670,9 +670,19 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count)
> {
> struct uart_pxa_port *up = serial_pxa_ports[co->index];
> unsigned int ier;
> + unsigned long flags;
> + int locked = 1;
>
> clk_prepare_enable(up->clk);
>
> + local_irq_save(flags);
> + if (up->port.sysrq)
> + locked = 0;
> + else if (oops_in_progress)
> + locked = spin_trylock(&up->port.lock);
> + else
> + spin_lock(&up->port.lock);
> +
> /*
> * First save the IER then disable the interrupts
> */
> @@ -688,7 +698,12 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count)
> wait_for_xmitr(up);
> serial_out(up, UART_IER, ier);
>
> + if (locked)
> + spin_unlock(&up->port.lock);
> + local_irq_restore(flags);
> +
> clk_disable_unprepare(up->clk);
> +
> }
Why the extra line at the end of the function?
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH 1/2] serial: sh-sci: Fix probe error paths
From: Paul Mundt @ 2012-06-13 1:36 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: linux-serial, linux-sh
In-Reply-To: <1339540104-25003-1-git-send-email-laurent.pinchart@ideasonboard.com>
On Wed, Jun 13, 2012 at 12:28:23AM +0200, Laurent Pinchart wrote:
> When probing fails, the driver must not try to cleanup resources that
> have not been initialized. Fix this.
On Wed, Jun 13, 2012 at 12:28:24AM +0200, Laurent Pinchart wrote:
> The driver supports a maximum number of ports configurable at compile
> time. Make sure the probe() method fails when registering a port that
> exceeds the maximum instead of returning success without registering the
> port.
>
> This fixes a crash at system suspend time, when the driver tried to
> suspend a non-registered port using the UART core.
Both applied, thanks.
^ permalink raw reply
* RE: [PATCH V2] serial: pxa: add spin lock for console write
From: Haojian Zhuang @ 2012-06-14 3:14 UTC (permalink / raw)
To: Greg KH, Chao Xie; +Cc: linux-serial@vger.kernel.org
In-Reply-To: <20120612223515.GA14008@kroah.com>
V2 moves local_irq_save() after clk_prepare_enable().
The extra empty line is unnecessary.
Greg,
Would you apply this patch?
Regards
Haojian
________________________________________
From: Greg KH [gregkh@linuxfoundation.org]
Sent: Wednesday, June 13, 2012 6:35 AM
To: Chao Xie
Cc: linux-serial@vger.kernel.org; Haojian Zhuang
Subject: Re: [PATCH V2] serial: pxa: add spin lock for console write
On Tue, May 22, 2012 at 12:43:00PM +0800, Chao Xie wrote:
> at UP mode, when cpu want to print message in kernel, it will invoke
> peempt_disable and disable irq. So it is safe for UP mode.
> For SMP mode, it is not safe to protect the HW reigsters.
> one CPU will run a program which will invoke printf.
> another CPU will run a program in kernel that invoke printk.
> So when second CPU is trying to printk, it will do
> 1. save ier register
> 2. enable uue bit of ier register
> 3. push buffer to uart fifo
> 4 .restore ier register
> when first CPU want to printf, and it happens between 1 and 4, it will
> enable thre bit of ier, and waiting for transmit intterupt. while step 4
> will make the ier lost thre bit.
> add spin lock here to protect the ier register for console write.
>
> Signed-off-by: Chao Xie <chao.xie@marvell.com>
What is different from patch v1?
> ---
> drivers/tty/serial/pxa.c | 15 +++++++++++++++
> 1 files changed, 15 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c
> index 5847a4b..aca62f6 100644
> --- a/drivers/tty/serial/pxa.c
> +++ b/drivers/tty/serial/pxa.c
> @@ -670,9 +670,19 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count)
> {
> struct uart_pxa_port *up = serial_pxa_ports[co->index];
> unsigned int ier;
> + unsigned long flags;
> + int locked = 1;
>
> clk_prepare_enable(up->clk);
>
> + local_irq_save(flags);
> + if (up->port.sysrq)
> + locked = 0;
> + else if (oops_in_progress)
> + locked = spin_trylock(&up->port.lock);
> + else
> + spin_lock(&up->port.lock);
> +
> /*
> * First save the IER then disable the interrupts
> */
> @@ -688,7 +698,12 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count)
> wait_for_xmitr(up);
> serial_out(up, UART_IER, ier);
>
> + if (locked)
> + spin_unlock(&up->port.lock);
> + local_irq_restore(flags);
> +
> clk_disable_unprepare(up->clk);
> +
> }
Why the extra line at the end of the function?
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH V2] serial: pxa: add spin lock for console write
From: Greg KH @ 2012-06-14 3:23 UTC (permalink / raw)
To: Haojian Zhuang; +Cc: Chao Xie, linux-serial@vger.kernel.org
In-Reply-To: <25B60CDC2F704E4E9D88FFD52780CB4C060E55D5AF@SC-VEXCH1.marvell.com>
A: No.
Q: Should I include quotations after my reply?
http://daringfireball.net/2007/07/on_top
On Wed, Jun 13, 2012 at 08:14:20PM -0700, Haojian Zhuang wrote:
> V2 moves local_irq_save() after clk_prepare_enable().
Then say that in the patch description please.
> The extra empty line is unnecessary.
Great, please remove it :)
> Greg,
>
> Would you apply this patch?
Please resend it with the above changes made.
thanks,
greg k-h
^ permalink raw reply
* [PATCH v3] serial: pxa: add spin lock for console write
From: Haojian Zhuang @ 2012-06-14 4:18 UTC (permalink / raw)
To: gregkh, linux-serial; +Cc: Chao Xie, Haojian Zhuang
From: Chao Xie <chao.xie@marvell.com>
v3:
Remove empty line
v2:
Move local_irq_save() after clk_prepare_enable()
v1:
At UP mode, when cpu want to print message in kernel, it will invoke
peempt_disable and disable irq. So it is safe for UP mode.
For SMP mode, it is not safe to protect the HW reigsters.
one CPU will run a program which will invoke printf.
another CPU will run a program in kernel that invoke printk.
So when second CPU is trying to printk, it will do
1. save ier register
2. enable uue bit of ier register
3. push buffer to uart fifo
4 .restore ier register
when first CPU want to printf, and it happens between 1 and 4, it will
enable thre bit of ier, and waiting for transmit intterupt. while step 4
will make the ier lost thre bit.
add spin lock here to protect the ier register for console write.
Signed-off-by: Chao Xie <chao.xie@marvell.com>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
---
drivers/tty/serial/pxa.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c
index 5847a4b..9033fc6 100644
--- a/drivers/tty/serial/pxa.c
+++ b/drivers/tty/serial/pxa.c
@@ -670,9 +670,19 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count)
{
struct uart_pxa_port *up = serial_pxa_ports[co->index];
unsigned int ier;
+ unsigned long flags;
+ int locked = 1;
clk_prepare_enable(up->clk);
+ local_irq_save(flags);
+ if (up->port.sysrq)
+ locked = 0;
+ else if (oops_in_progress)
+ locked = spin_trylock(&up->port.lock);
+ else
+ spin_lock(&up->port.lock);
+
/*
* First save the IER then disable the interrupts
*/
@@ -688,6 +698,10 @@ serial_pxa_console_write(struct console *co, const char *s, unsigned int count)
wait_for_xmitr(up);
serial_out(up, UART_IER, ier);
+ if (locked)
+ spin_unlock(&up->port.lock);
+ local_irq_restore(flags);
+
clk_disable_unprepare(up->clk);
}
--
1.7.5.4
^ permalink raw reply related
* [PATCH 00/16] Enable SPARSE_IRQ support for imx
From: Shawn Guo @ 2012-06-14 5:59 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Sascha Hauer, Arnd Bergmann, Rob Herring, Grant Likely,
Dong Aisheng, Shawn Guo, Russell King, Greg Kroah-Hartman,
linux-serial, Wolfram Sang, linux-i2c, Vinod Koul
It seems that the lack of SPARSE_IRQ support becomes the last blocker
for imx being built with multi-platform. The series is to enable
SPARSE_IRQ for imx by having all the irqchips allocate their irq_descs.
Along with the change, a legacy irqdomain is added for each of these
irqchips (except ipu_irq) to help the mapping between hardware irq and
Linux irq number, which is required by DT boot but also benefits non-DT.
Based on v3.5-rc2. Boot tested on imx3, imx5 and imx6, and compile
tested with imx_v4_v5_defconfig.
Shawn Guo (16):
ARM: imx: eliminate macro IMX_GPIO_TO_IRQ()
ARM: imx: eliminate macro IOMUX_TO_IRQ()
ARM: imx: eliminate macro IRQ_GPIOx()
gpio/mxc: move irq_domain_add_legacy call into gpio driver
ARM: imx: move irq_domain_add_legacy call into tzic driver
ARM: imx: move irq_domain_add_legacy call into avic driver
dma: ipu: remove the use of ipu_platform_data
ARM: imx: leave irq_base of wm8350_platform_data uninitialized
ARM: imx: pass gpio than irq number into mxc_expio_init
ARM: imx: add a legacy irqdomain for 3ds_debugboard
ARM: imx: add a legacy irqdomain for mx31ads
i2c: imx: remove unneeded mach/irqs.h inclusion
ARM: imx: remove unneeded mach/irq.h inclusion
tty: serial: imx: remove the use of MXC_INTERNAL_IRQS
ARM: fiq: save FIQ_START by passing absolute fiq number
ARM: imx: enable SPARSE_IRQ for imx platform
arch/arm/Kconfig | 1 +
arch/arm/kernel/fiq.c | 4 +-
arch/arm/mach-imx/devices-imx31.h | 4 +-
arch/arm/mach-imx/devices-imx35.h | 4 +-
arch/arm/mach-imx/eukrea_mbimx27-baseboard.c | 3 +-
arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c | 6 +-
arch/arm/mach-imx/imx27-dt.c | 28 ---
arch/arm/mach-imx/imx51-dt.c | 27 ---
arch/arm/mach-imx/imx53-dt.c | 27 ---
arch/arm/mach-imx/mach-apf9328.c | 7 +-
arch/arm/mach-imx/mach-armadillo5x0.c | 18 +-
arch/arm/mach-imx/mach-cpuimx27.c | 12 +-
arch/arm/mach-imx/mach-cpuimx35.c | 3 +-
arch/arm/mach-imx/mach-cpuimx51sd.c | 3 +-
arch/arm/mach-imx/mach-imx27_visstrim_m10.c | 9 +-
arch/arm/mach-imx/mach-imx6q.c | 14 --
arch/arm/mach-imx/mach-kzm_arm11_01.c | 20 ++-
arch/arm/mach-imx/mach-mx1ads.c | 1 -
arch/arm/mach-imx/mach-mx21ads.c | 16 ++-
arch/arm/mach-imx/mach-mx27_3ds.c | 7 +-
arch/arm/mach-imx/mach-mx27ads.c | 12 +-
arch/arm/mach-imx/mach-mx31_3ds.c | 18 +--
arch/arm/mach-imx/mach-mx31ads.c | 63 ++++---
arch/arm/mach-imx/mach-mx31lilly.c | 10 +-
arch/arm/mach-imx/mach-mx31lite.c | 11 +-
arch/arm/mach-imx/mach-mx31moboard.c | 10 +-
arch/arm/mach-imx/mach-mx35_3ds.c | 18 +--
arch/arm/mach-imx/mach-mx51_3ds.c | 3 +-
arch/arm/mach-imx/mach-mx53_ard.c | 5 +-
arch/arm/mach-imx/mach-mxt_td60.c | 6 +-
arch/arm/mach-imx/mach-pca100.c | 5 +-
arch/arm/mach-imx/mach-pcm037.c | 24 ++--
arch/arm/mach-imx/mach-pcm038.c | 4 +-
arch/arm/mach-imx/mach-pcm043.c | 6 +-
arch/arm/mach-imx/mach-qong.c | 10 +-
arch/arm/mach-imx/mach-scb9328.c | 7 +-
arch/arm/mach-imx/mach-vpr200.c | 10 +-
arch/arm/mach-imx/mm-imx1.c | 1 -
arch/arm/mach-imx/mm-imx21.c | 1 -
arch/arm/mach-imx/mm-imx25.c | 1 -
arch/arm/mach-imx/mm-imx27.c | 1 -
arch/arm/mach-imx/mm-imx3.c | 1 -
arch/arm/mach-imx/mx31lilly-db.c | 11 +-
arch/arm/mach-imx/mx31lite-db.c | 5 +-
arch/arm/mach-imx/mx51_efika.c | 3 +-
arch/arm/mach-imx/pcm970-baseboard.c | 13 +-
arch/arm/mach-rpc/include/mach/irqs.h | 12 +-
arch/arm/plat-mxc/3ds_debugboard.c | 50 +++---
arch/arm/plat-mxc/avic.c | 26 ++-
arch/arm/plat-mxc/devices/platform-ipu-core.c | 5 +-
arch/arm/plat-mxc/include/mach/3ds_debugboard.h | 2 +-
arch/arm/plat-mxc/include/mach/devices-common.h | 4 +-
arch/arm/plat-mxc/include/mach/hardware.h | 2 -
arch/arm/plat-mxc/include/mach/iomux-mx3.h | 3 -
arch/arm/plat-mxc/include/mach/iomux-v1.h | 7 -
arch/arm/plat-mxc/include/mach/ipu.h | 4 -
arch/arm/plat-mxc/include/mach/irqs.h | 44 -----
arch/arm/plat-mxc/include/mach/mx1.h | 111 ++++++------
arch/arm/plat-mxc/include/mach/mx21.h | 107 ++++++------
arch/arm/plat-mxc/include/mach/mx25.h | 72 ++++----
arch/arm/plat-mxc/include/mach/mx27.h | 127 +++++++-------
arch/arm/plat-mxc/include/mach/mx2x.h | 87 +++++-----
arch/arm/plat-mxc/include/mach/mx31.h | 118 +++++++------
arch/arm/plat-mxc/include/mach/mx35.h | 109 ++++++------
arch/arm/plat-mxc/include/mach/mx3x.h | 77 ++++----
arch/arm/plat-mxc/include/mach/mx50.h | 187 ++++++++++----------
arch/arm/plat-mxc/include/mach/mx51.h | 209 +++++++++++-----------
arch/arm/plat-mxc/include/mach/mx53.h | 217 ++++++++++++-----------
arch/arm/plat-mxc/tzic.c | 28 ++-
drivers/dma/ipu/ipu_idmac.c | 8 +-
drivers/dma/ipu/ipu_irq.c | 14 +-
drivers/gpio/gpio-mxc.c | 56 ++++---
drivers/i2c/busses/i2c-imx.c | 1 -
drivers/media/video/mx1_camera.c | 1 +
drivers/tty/serial/imx.c | 6 +-
sound/soc/fsl/imx-pcm-fiq.c | 1 +
76 files changed, 1041 insertions(+), 1127 deletions(-)
--
1.7.5.4
^ permalink raw reply
* [PATCH 14/16] tty: serial: imx: remove the use of MXC_INTERNAL_IRQS
From: Shawn Guo @ 2012-06-14 5:59 UTC (permalink / raw)
To: linux-arm-kernel
Cc: Sascha Hauer, Arnd Bergmann, Rob Herring, Grant Likely,
Dong Aisheng, Shawn Guo, linux-serial, Greg Kroah-Hartman
In-Reply-To: <1339653587-4832-1-git-send-email-shawn.guo@linaro.org>
As the part of the effort to enable SPARE_IRQ for imx platform,
the macro MXC_INTERNAL_IRQS will be removed. The imx serial driver
has a references to it for a decision on flags of request_irq call
based on rtsirq is beyond MXC_INTERNAL_IRQS. However the searching
on imx platform code tells that rtsirq will never be beyond
MXC_INTERNAL_IRQS. That said, the check, consequently the reference
to MXC_INTERNAL_IRQS are not needed, so remove them.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: linux-serial@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/serial/imx.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 4ef7473..d5c689d6 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -169,7 +169,6 @@
#define SERIAL_IMX_MAJOR 207
#define MINOR_START 16
#define DEV_NAME "ttymxc"
-#define MAX_INTERNAL_IRQ MXC_INTERNAL_IRQS
/*
* This determines how often we check the modem status signals
@@ -741,10 +740,7 @@ static int imx_startup(struct uart_port *port)
/* do not use RTS IRQ on IrDA */
if (!USE_IRDA(sport)) {
- retval = request_irq(sport->rtsirq, imx_rtsint,
- (sport->rtsirq < MAX_INTERNAL_IRQ) ? 0 :
- IRQF_TRIGGER_FALLING |
- IRQF_TRIGGER_RISING,
+ retval = request_irq(sport->rtsirq, imx_rtsint, 0,
DRIVER_NAME, sport);
if (retval)
goto error_out3;
--
1.7.5.4
^ permalink raw reply related
* Re: [PATCH 00/16] Enable SPARSE_IRQ support for imx
From: Sascha Hauer @ 2012-06-14 8:00 UTC (permalink / raw)
To: Shawn Guo
Cc: linux-arm-kernel, Arnd Bergmann, Rob Herring, Grant Likely,
Dong Aisheng, Russell King, Greg Kroah-Hartman, linux-serial,
Wolfram Sang, linux-i2c, Vinod Koul
In-Reply-To: <1339653587-4832-1-git-send-email-shawn.guo@linaro.org>
On Thu, Jun 14, 2012 at 01:59:31PM +0800, Shawn Guo wrote:
> It seems that the lack of SPARSE_IRQ support becomes the last blocker
> for imx being built with multi-platform. The series is to enable
> SPARSE_IRQ for imx by having all the irqchips allocate their irq_descs.
> Along with the change, a legacy irqdomain is added for each of these
> irqchips (except ipu_irq) to help the mapping between hardware irq and
> Linux irq number, which is required by DT boot but also benefits non-DT.
>
> Based on v3.5-rc2. Boot tested on imx3, imx5 and imx6, and compile
> tested with imx_v4_v5_defconfig.
I gave it a test on i.MX1 and i.MX27, so
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
Also, nice move ;)
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Sascha
>
> Shawn Guo (16):
> ARM: imx: eliminate macro IMX_GPIO_TO_IRQ()
> ARM: imx: eliminate macro IOMUX_TO_IRQ()
> ARM: imx: eliminate macro IRQ_GPIOx()
> gpio/mxc: move irq_domain_add_legacy call into gpio driver
> ARM: imx: move irq_domain_add_legacy call into tzic driver
> ARM: imx: move irq_domain_add_legacy call into avic driver
> dma: ipu: remove the use of ipu_platform_data
> ARM: imx: leave irq_base of wm8350_platform_data uninitialized
> ARM: imx: pass gpio than irq number into mxc_expio_init
> ARM: imx: add a legacy irqdomain for 3ds_debugboard
> ARM: imx: add a legacy irqdomain for mx31ads
> i2c: imx: remove unneeded mach/irqs.h inclusion
> ARM: imx: remove unneeded mach/irq.h inclusion
> tty: serial: imx: remove the use of MXC_INTERNAL_IRQS
> ARM: fiq: save FIQ_START by passing absolute fiq number
> ARM: imx: enable SPARSE_IRQ for imx platform
>
> arch/arm/Kconfig | 1 +
> arch/arm/kernel/fiq.c | 4 +-
> arch/arm/mach-imx/devices-imx31.h | 4 +-
> arch/arm/mach-imx/devices-imx35.h | 4 +-
> arch/arm/mach-imx/eukrea_mbimx27-baseboard.c | 3 +-
> arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c | 6 +-
> arch/arm/mach-imx/imx27-dt.c | 28 ---
> arch/arm/mach-imx/imx51-dt.c | 27 ---
> arch/arm/mach-imx/imx53-dt.c | 27 ---
> arch/arm/mach-imx/mach-apf9328.c | 7 +-
> arch/arm/mach-imx/mach-armadillo5x0.c | 18 +-
> arch/arm/mach-imx/mach-cpuimx27.c | 12 +-
> arch/arm/mach-imx/mach-cpuimx35.c | 3 +-
> arch/arm/mach-imx/mach-cpuimx51sd.c | 3 +-
> arch/arm/mach-imx/mach-imx27_visstrim_m10.c | 9 +-
> arch/arm/mach-imx/mach-imx6q.c | 14 --
> arch/arm/mach-imx/mach-kzm_arm11_01.c | 20 ++-
> arch/arm/mach-imx/mach-mx1ads.c | 1 -
> arch/arm/mach-imx/mach-mx21ads.c | 16 ++-
> arch/arm/mach-imx/mach-mx27_3ds.c | 7 +-
> arch/arm/mach-imx/mach-mx27ads.c | 12 +-
> arch/arm/mach-imx/mach-mx31_3ds.c | 18 +--
> arch/arm/mach-imx/mach-mx31ads.c | 63 ++++---
> arch/arm/mach-imx/mach-mx31lilly.c | 10 +-
> arch/arm/mach-imx/mach-mx31lite.c | 11 +-
> arch/arm/mach-imx/mach-mx31moboard.c | 10 +-
> arch/arm/mach-imx/mach-mx35_3ds.c | 18 +--
> arch/arm/mach-imx/mach-mx51_3ds.c | 3 +-
> arch/arm/mach-imx/mach-mx53_ard.c | 5 +-
> arch/arm/mach-imx/mach-mxt_td60.c | 6 +-
> arch/arm/mach-imx/mach-pca100.c | 5 +-
> arch/arm/mach-imx/mach-pcm037.c | 24 ++--
> arch/arm/mach-imx/mach-pcm038.c | 4 +-
> arch/arm/mach-imx/mach-pcm043.c | 6 +-
> arch/arm/mach-imx/mach-qong.c | 10 +-
> arch/arm/mach-imx/mach-scb9328.c | 7 +-
> arch/arm/mach-imx/mach-vpr200.c | 10 +-
> arch/arm/mach-imx/mm-imx1.c | 1 -
> arch/arm/mach-imx/mm-imx21.c | 1 -
> arch/arm/mach-imx/mm-imx25.c | 1 -
> arch/arm/mach-imx/mm-imx27.c | 1 -
> arch/arm/mach-imx/mm-imx3.c | 1 -
> arch/arm/mach-imx/mx31lilly-db.c | 11 +-
> arch/arm/mach-imx/mx31lite-db.c | 5 +-
> arch/arm/mach-imx/mx51_efika.c | 3 +-
> arch/arm/mach-imx/pcm970-baseboard.c | 13 +-
> arch/arm/mach-rpc/include/mach/irqs.h | 12 +-
> arch/arm/plat-mxc/3ds_debugboard.c | 50 +++---
> arch/arm/plat-mxc/avic.c | 26 ++-
> arch/arm/plat-mxc/devices/platform-ipu-core.c | 5 +-
> arch/arm/plat-mxc/include/mach/3ds_debugboard.h | 2 +-
> arch/arm/plat-mxc/include/mach/devices-common.h | 4 +-
> arch/arm/plat-mxc/include/mach/hardware.h | 2 -
> arch/arm/plat-mxc/include/mach/iomux-mx3.h | 3 -
> arch/arm/plat-mxc/include/mach/iomux-v1.h | 7 -
> arch/arm/plat-mxc/include/mach/ipu.h | 4 -
> arch/arm/plat-mxc/include/mach/irqs.h | 44 -----
> arch/arm/plat-mxc/include/mach/mx1.h | 111 ++++++------
> arch/arm/plat-mxc/include/mach/mx21.h | 107 ++++++------
> arch/arm/plat-mxc/include/mach/mx25.h | 72 ++++----
> arch/arm/plat-mxc/include/mach/mx27.h | 127 +++++++-------
> arch/arm/plat-mxc/include/mach/mx2x.h | 87 +++++-----
> arch/arm/plat-mxc/include/mach/mx31.h | 118 +++++++------
> arch/arm/plat-mxc/include/mach/mx35.h | 109 ++++++------
> arch/arm/plat-mxc/include/mach/mx3x.h | 77 ++++----
> arch/arm/plat-mxc/include/mach/mx50.h | 187 ++++++++++----------
> arch/arm/plat-mxc/include/mach/mx51.h | 209 +++++++++++-----------
> arch/arm/plat-mxc/include/mach/mx53.h | 217 ++++++++++++-----------
> arch/arm/plat-mxc/tzic.c | 28 ++-
> drivers/dma/ipu/ipu_idmac.c | 8 +-
> drivers/dma/ipu/ipu_irq.c | 14 +-
> drivers/gpio/gpio-mxc.c | 56 ++++---
> drivers/i2c/busses/i2c-imx.c | 1 -
> drivers/media/video/mx1_camera.c | 1 +
> drivers/tty/serial/imx.c | 6 +-
> sound/soc/fsl/imx-pcm-fiq.c | 1 +
> 76 files changed, 1041 insertions(+), 1127 deletions(-)
>
> --
> 1.7.5.4
>
>
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply
* Re: [PATCH 14/16] tty: serial: imx: remove the use of MXC_INTERNAL_IRQS
From: Greg Kroah-Hartman @ 2012-06-14 15:37 UTC (permalink / raw)
To: Shawn Guo
Cc: linux-arm-kernel, Sascha Hauer, Arnd Bergmann, Rob Herring,
Grant Likely, Dong Aisheng, linux-serial
In-Reply-To: <1339653587-4832-15-git-send-email-shawn.guo@linaro.org>
On Thu, Jun 14, 2012 at 01:59:45PM +0800, Shawn Guo wrote:
> As the part of the effort to enable SPARE_IRQ for imx platform,
> the macro MXC_INTERNAL_IRQS will be removed. The imx serial driver
> has a references to it for a decision on flags of request_irq call
> based on rtsirq is beyond MXC_INTERNAL_IRQS. However the searching
> on imx platform code tells that rtsirq will never be beyond
> MXC_INTERNAL_IRQS. That said, the check, consequently the reference
> to MXC_INTERNAL_IRQS are not needed, so remove them.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: linux-serial@vger.kernel.org
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
^ permalink raw reply
* [PATCH 3/5] serial: mxs-auart: Allow device tree probing
From: Fabio Estevam @ 2012-06-15 3:33 UTC (permalink / raw)
To: linux-arm-kernel
Cc: shawn.guo, kernel, marex, matt, snijsure, Fabio Estevam,
Grant Likely, Rob Herring, Alan Cox, linux-serial
In-Reply-To: <1339731185-4889-1-git-send-email-festevam@gmail.com>
From: Fabio Estevam <fabio.estevam@freescale.com>
Allow device tree probing.
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: <linux-serial@vger.kernel.org>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
drivers/tty/serial/mxs-auart.c | 55 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 54 insertions(+), 1 deletions(-)
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index ec56d83..467b8a2 100644
--- a/drivers/tty/serial/mxs-auart.c
+++ b/drivers/tty/serial/mxs-auart.c
@@ -33,6 +33,7 @@
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/pinctrl/consumer.h>
+#include <linux/of_device.h>
#include <asm/cacheflush.h>
@@ -675,6 +676,44 @@ static struct uart_driver auart_driver = {
#endif
};
+#ifdef CONFIG_OF
+/*
+ * This function returns 1 if pdev isn't a device instatiated by dt, 0 if it
+ * could successfully get all information from dt or a negative errno.
+ */
+static int serial_mxs_probe_dt(struct mxs_auart_port *s,
+ struct platform_device *pdev)
+{
+ struct device_node *np = pdev->dev.of_node;
+ int ret;
+
+ if (!np)
+ /* no device tree device */
+ return 1;
+
+ ret = of_alias_get_id(np, "serial");
+ if (ret < 0) {
+ dev_err(&pdev->dev, "failed to get alias id: %d\n", ret);
+ return ret;
+ }
+ s->port.line = ret;
+
+ return 0;
+}
+#else
+static inline int serial_mxs_probe_dt(struct mxs_auart_port *s,
+ struct platform_device *pdev)
+{
+ return 1;
+}
+#endif
+
+static void mxs_auart_probe_pdev(struct mxs_auart_port *s,
+ struct platform_device *pdev)
+{
+ s->port.line = pdev->id < 0 ? 0 : pdev->id;
+}
+
static int __devinit mxs_auart_probe(struct platform_device *pdev)
{
struct mxs_auart_port *s;
@@ -689,6 +728,14 @@ static int __devinit mxs_auart_probe(struct platform_device *pdev)
goto out;
}
+ ret = serial_mxs_probe_dt(s, pdev);
+ if (ret > 0)
+ mxs_auart_probe_pdev(s, pdev);
+ else if (ret < 0) {
+ ret = -EINVAL;
+ goto out_free;
+ }
+
pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
if (IS_ERR(pinctrl)) {
ret = PTR_ERR(pinctrl);
@@ -711,7 +758,6 @@ static int __devinit mxs_auart_probe(struct platform_device *pdev)
s->port.membase = ioremap(r->start, resource_size(r));
s->port.ops = &mxs_auart_ops;
s->port.iotype = UPIO_MEM;
- s->port.line = pdev->id < 0 ? 0 : pdev->id;
s->port.fifosize = 16;
s->port.uartclk = clk_get_rate(s->clk);
s->port.type = PORT_IMX;
@@ -769,12 +815,19 @@ static int __devexit mxs_auart_remove(struct platform_device *pdev)
return 0;
}
+static struct of_device_id mxs_auart_dt_ids[] = {
+ {.compatible = "fsl,mxs-auart", },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, mxs_auart_dt_ids);
+
static struct platform_driver mxs_auart_driver = {
.probe = mxs_auart_probe,
.remove = __devexit_p(mxs_auart_remove),
.driver = {
.name = "mxs-auart",
.owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(mxs_auart_dt_ids),
},
};
--
1.7.1
^ permalink raw reply related
* [PATCH v2 2/3] serial: mxs-auart: Allow device tree probing
From: Fabio Estevam @ 2012-06-15 11:32 UTC (permalink / raw)
To: linux-arm-kernel
Cc: shawn.guo, kernel, marex, matt, snijsure, rob.herring,
Fabio Estevam, Grant Likely, Alan Cox, linux-serial
In-Reply-To: <1339759950-5507-1-git-send-email-festevam@gmail.com>
From: Fabio Estevam <fabio.estevam@freescale.com>
Allow device tree probing.
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: <linux-serial@vger.kernel.org>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v1:
- Merged patches 3 and 5 from v1 into this one
.../bindings/tty/serial/fsl-mxs-auart.txt | 13 +++++
drivers/tty/serial/mxs-auart.c | 55 +++++++++++++++++++-
2 files changed, 67 insertions(+), 1 deletions(-)
create mode 100644 Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt
diff --git a/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt b/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt
new file mode 100644
index 0000000..1b28b1c
--- /dev/null
+++ b/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt
@@ -0,0 +1,13 @@
+* Freescale MXS Application UART (AUART)
+
+Required properties:
+- compatible : Should be "fsl,mxs-uart"
+- reg : Address and length of the register set for the device
+- interrupts : Should contain the auart interrupt
+
+Example:
+auart0: serial@8006a000 {
+ compatible = "fsl,mxs-auart";
+ reg = <0x8006a000 0x2000>;
+ interrupts = <112 70 71>;
+};
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index ec56d83..21e2ce7 100644
--- a/drivers/tty/serial/mxs-auart.c
+++ b/drivers/tty/serial/mxs-auart.c
@@ -33,6 +33,7 @@
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/pinctrl/consumer.h>
+#include <linux/of_device.h>
#include <asm/cacheflush.h>
@@ -675,6 +676,44 @@ static struct uart_driver auart_driver = {
#endif
};
+#ifdef CONFIG_OF
+/*
+ * This function returns 1 if pdev isn't a device instatiated by dt, 0 if it
+ * could successfully get all information from dt or a negative errno.
+ */
+static int serial_mxs_probe_dt(struct mxs_auart_port *s,
+ struct platform_device *pdev)
+{
+ struct device_node *np = pdev->dev.of_node;
+ int ret;
+
+ if (!np)
+ /* no device tree device */
+ return 1;
+
+ ret = of_alias_get_id(np, "serial");
+ if (ret < 0) {
+ dev_err(&pdev->dev, "failed to get alias id: %d\n", ret);
+ return ret;
+ }
+ s->port.line = ret;
+
+ return 0;
+}
+#else
+static inline int serial_mxs_probe_dt(struct mxs_auart_port *s,
+ struct platform_device *pdev)
+{
+ return 1;
+}
+#endif
+
+static void mxs_auart_probe_pdev(struct mxs_auart_port *s,
+ struct platform_device *pdev)
+{
+ s->port.line = pdev->id < 0 ? 0 : pdev->id;
+}
+
static int __devinit mxs_auart_probe(struct platform_device *pdev)
{
struct mxs_auart_port *s;
@@ -689,6 +728,14 @@ static int __devinit mxs_auart_probe(struct platform_device *pdev)
goto out;
}
+ ret = serial_mxs_probe_dt(s, pdev);
+ if (ret > 0)
+ mxs_auart_probe_pdev(s, pdev);
+ else if (ret < 0) {
+ ret = -EINVAL;
+ goto out_free;
+ }
+
pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
if (IS_ERR(pinctrl)) {
ret = PTR_ERR(pinctrl);
@@ -711,7 +758,6 @@ static int __devinit mxs_auart_probe(struct platform_device *pdev)
s->port.membase = ioremap(r->start, resource_size(r));
s->port.ops = &mxs_auart_ops;
s->port.iotype = UPIO_MEM;
- s->port.line = pdev->id < 0 ? 0 : pdev->id;
s->port.fifosize = 16;
s->port.uartclk = clk_get_rate(s->clk);
s->port.type = PORT_IMX;
@@ -769,12 +815,19 @@ static int __devexit mxs_auart_remove(struct platform_device *pdev)
return 0;
}
+static struct of_device_id mxs_auart_dt_ids[] = {
+ {.compatible = "fsl,mxs-auart", },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, mxs_auart_dt_ids);
+
static struct platform_driver mxs_auart_driver = {
.probe = mxs_auart_probe,
.remove = __devexit_p(mxs_auart_remove),
.driver = {
.name = "mxs-auart",
.owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(mxs_auart_dt_ids),
},
};
--
1.7.1
^ permalink raw reply related
* Re: [PATCH v2 2/3] serial: mxs-auart: Allow device tree probing
From: Marek Vasut @ 2012-06-15 11:49 UTC (permalink / raw)
To: Fabio Estevam
Cc: linux-arm-kernel, shawn.guo, kernel, matt, snijsure, rob.herring,
Fabio Estevam, Grant Likely, Alan Cox, linux-serial
In-Reply-To: <1339759950-5507-2-git-send-email-festevam@gmail.com>
Dear Fabio Estevam,
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> Allow device tree probing.
>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Cc: Alan Cox <alan@linux.intel.com>
> Cc: <linux-serial@vger.kernel.org>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> Changes since v1:
> - Merged patches 3 and 5 from v1 into this one
> .../bindings/tty/serial/fsl-mxs-auart.txt | 13 +++++
> drivers/tty/serial/mxs-auart.c | 55
> +++++++++++++++++++- 2 files changed, 67 insertions(+), 1 deletions(-)
> create mode 100644
> Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt
>
> diff --git a/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt
> b/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt new file
> mode 100644
> index 0000000..1b28b1c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt
> @@ -0,0 +1,13 @@
> +* Freescale MXS Application UART (AUART)
> +
> +Required properties:
> +- compatible : Should be "fsl,mxs-uart"
> +- reg : Address and length of the register set for the device
> +- interrupts : Should contain the auart interrupt
> +
> +Example:
> +auart0: serial@8006a000 {
> + compatible = "fsl,mxs-auart";
> + reg = <0x8006a000 0x2000>;
> + interrupts = <112 70 71>;
> +};
> diff --git a/drivers/tty/serial/mxs-auart.c
> b/drivers/tty/serial/mxs-auart.c index ec56d83..21e2ce7 100644
> --- a/drivers/tty/serial/mxs-auart.c
> +++ b/drivers/tty/serial/mxs-auart.c
> @@ -33,6 +33,7 @@
> #include <linux/delay.h>
> #include <linux/io.h>
> #include <linux/pinctrl/consumer.h>
> +#include <linux/of_device.h>
>
> #include <asm/cacheflush.h>
>
> @@ -675,6 +676,44 @@ static struct uart_driver auart_driver = {
> #endif
> };
>
> +#ifdef CONFIG_OF
Isn't CONFIG_OF always enabled?
> +/*
> + * This function returns 1 if pdev isn't a device instatiated by dt, 0 if
> it + * could successfully get all information from dt or a negative errno.
> + */
> +static int serial_mxs_probe_dt(struct mxs_auart_port *s,
> + struct platform_device *pdev)
> +{
> + struct device_node *np = pdev->dev.of_node;
> + int ret;
> +
> + if (!np)
> + /* no device tree device */
> + return 1;
> +
> + ret = of_alias_get_id(np, "serial");
> + if (ret < 0) {
> + dev_err(&pdev->dev, "failed to get alias id: %d\n", ret);
> + return ret;
> + }
> + s->port.line = ret;
> +
> + return 0;
> +}
> +#else
> +static inline int serial_mxs_probe_dt(struct mxs_auart_port *s,
> + struct platform_device *pdev)
> +{
> + return 1;
> +}
> +#endif
So drop this whole ifdef stuff ...
> +
> +static void mxs_auart_probe_pdev(struct mxs_auart_port *s,
> + struct platform_device *pdev)
> +{
> + s->port.line = pdev->id < 0 ? 0 : pdev->id;
> +}
> +
> static int __devinit mxs_auart_probe(struct platform_device *pdev)
> {
> struct mxs_auart_port *s;
> @@ -689,6 +728,14 @@ static int __devinit mxs_auart_probe(struct
> platform_device *pdev) goto out;
> }
>
> + ret = serial_mxs_probe_dt(s, pdev);
> + if (ret > 0)
> + mxs_auart_probe_pdev(s, pdev);
> + else if (ret < 0) {
> + ret = -EINVAL;
> + goto out_free;
> + }
> +
> pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
> if (IS_ERR(pinctrl)) {
> ret = PTR_ERR(pinctrl);
> @@ -711,7 +758,6 @@ static int __devinit mxs_auart_probe(struct
> platform_device *pdev) s->port.membase = ioremap(r->start,
> resource_size(r));
> s->port.ops = &mxs_auart_ops;
> s->port.iotype = UPIO_MEM;
> - s->port.line = pdev->id < 0 ? 0 : pdev->id;
> s->port.fifosize = 16;
> s->port.uartclk = clk_get_rate(s->clk);
> s->port.type = PORT_IMX;
> @@ -769,12 +815,19 @@ static int __devexit mxs_auart_remove(struct
> platform_device *pdev) return 0;
> }
>
> +static struct of_device_id mxs_auart_dt_ids[] = {
> + {.compatible = "fsl,mxs-auart", },
> + { /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(of, mxs_auart_dt_ids);
> +
> static struct platform_driver mxs_auart_driver = {
> .probe = mxs_auart_probe,
> .remove = __devexit_p(mxs_auart_remove),
> .driver = {
> .name = "mxs-auart",
> .owner = THIS_MODULE,
> + .of_match_table = of_match_ptr(mxs_auart_dt_ids),
> },
> };
Best regards,
Marek Vasut
^ permalink raw reply
* Re: [PATCH v2 2/3] serial: mxs-auart: Allow device tree probing
From: Fabio Estevam @ 2012-06-15 12:01 UTC (permalink / raw)
To: Marek Vasut
Cc: linux-arm-kernel, shawn.guo, kernel, matt, snijsure, rob.herring,
Fabio Estevam, Grant Likely, Alan Cox, linux-serial
In-Reply-To: <201206151349.27261.marex@denx.de>
Hi Marek,
On Fri, Jun 15, 2012 at 8:49 AM, Marek Vasut <marex@denx.de> wrote:
>> +#ifdef CONFIG_OF
>
> Isn't CONFIG_OF always enabled?
Not always necessarily. You can boot mx23/mx28 via non-DT kernel.
The serial imx driver also does the same thing about this.
^ permalink raw reply
* Re: [PATCH v2 2/3] serial: mxs-auart: Allow device tree probing
From: Fabio Estevam @ 2012-06-15 12:13 UTC (permalink / raw)
To: Marek Vasut
Cc: linux-arm-kernel, shawn.guo, kernel, matt, snijsure, rob.herring,
Fabio Estevam, Grant Likely, Alan Cox, linux-serial
In-Reply-To: <201206151349.27261.marex@denx.de>
On Fri, Jun 15, 2012 at 8:49 AM, Marek Vasut <marex@denx.de> wrote:
>> +/*
>> + * This function returns 1 if pdev isn't a device instatiated by dt, 0 if
>> it + * could successfully get all information from dt or a negative errno.
>> + */
>> +static int serial_mxs_probe_dt(struct mxs_auart_port *s,
>> + struct platform_device *pdev)
>> +{
>> + struct device_node *np = pdev->dev.of_node;
>> + int ret;
>> +
>> + if (!np)
>> + /* no device tree device */
>> + return 1;
>> +
>> + ret = of_alias_get_id(np, "serial");
>> + if (ret < 0) {
>> + dev_err(&pdev->dev, "failed to get alias id: %d\n", ret);
>> + return ret;
>> + }
>> + s->port.line = ret;
>> +
>> + return 0;
>> +}
>> +#else
>> +static inline int serial_mxs_probe_dt(struct mxs_auart_port *s,
>> + struct platform_device *pdev)
>> +{
>> + return 1;
>> +}
>> +#endif
>
> So drop this whole ifdef stuff ...
Yes, you are right. We can safely remove it. Just tested and it worked fine.
I will drop the ifdef in the next revision.
Thanks,
Fabio Estevam
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH v2 2/3] serial: mxs-auart: Allow device tree probing
From: Shawn Guo @ 2012-06-15 13:10 UTC (permalink / raw)
To: Fabio Estevam
Cc: linux-arm-kernel, kernel, marex, matt, snijsure, rob.herring,
Fabio Estevam, Grant Likely, Alan Cox, linux-serial
In-Reply-To: <1339759950-5507-2-git-send-email-festevam@gmail.com>
On Fri, Jun 15, 2012 at 08:32:29AM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> Allow device tree probing.
>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Cc: Alan Cox <alan@linux.intel.com>
> Cc: <linux-serial@vger.kernel.org>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> Changes since v1:
> - Merged patches 3 and 5 from v1 into this one
> .../bindings/tty/serial/fsl-mxs-auart.txt | 13 +++++
> drivers/tty/serial/mxs-auart.c | 55 +++++++++++++++++++-
> 2 files changed, 67 insertions(+), 1 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt
>
> diff --git a/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt b/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt
> new file mode 100644
> index 0000000..1b28b1c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt
> @@ -0,0 +1,13 @@
> +* Freescale MXS Application UART (AUART)
> +
> +Required properties:
> +- compatible : Should be "fsl,mxs-uart"
The compatible property is to specify the compatibility between
different versions of the hardware block. One general way to do that
is using SoC name to specific the version. We know the auart block
works for both imx23 and imx28 without any tweaking in the driver,
so we should have something like the following to tell that the auart
block used on imx28 is completely compatible with the one on imx23.
static struct of_device_id mxs_auart_dt_ids[] = {
{ .compatible = "fsl,imx23-auart", },
{ /* sentinel */ }
};
imx23.dtsi:
auart0: serial@8006a000 {
compatible = "fsl,imx23-auart";
...
};
imx28.dtsi:
auart0: serial@8006a000 {
compatible = "fsl,imx28-auart", "fsl,imx23-auart";
...
};
> +- reg : Address and length of the register set for the device
> +- interrupts : Should contain the auart interrupt
The binding relies on alias to work with the driver, so we may need to
note it here. See Documentation/devicetree/bindings/gpio/gpio-mxs.txt
for example.
> +
> +Example:
> +auart0: serial@8006a000 {
> + compatible = "fsl,mxs-auart";
> + reg = <0x8006a000 0x2000>;
> + interrupts = <112 70 71>;
> +};
> diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
> index ec56d83..21e2ce7 100644
> --- a/drivers/tty/serial/mxs-auart.c
> +++ b/drivers/tty/serial/mxs-auart.c
> @@ -33,6 +33,7 @@
> #include <linux/delay.h>
> #include <linux/io.h>
> #include <linux/pinctrl/consumer.h>
> +#include <linux/of_device.h>
>
> #include <asm/cacheflush.h>
>
> @@ -675,6 +676,44 @@ static struct uart_driver auart_driver = {
> #endif
> };
>
> +#ifdef CONFIG_OF
> +/*
> + * This function returns 1 if pdev isn't a device instatiated by dt, 0 if it
> + * could successfully get all information from dt or a negative errno.
> + */
> +static int serial_mxs_probe_dt(struct mxs_auart_port *s,
> + struct platform_device *pdev)
> +{
> + struct device_node *np = pdev->dev.of_node;
> + int ret;
> +
> + if (!np)
> + /* no device tree device */
> + return 1;
> +
> + ret = of_alias_get_id(np, "serial");
> + if (ret < 0) {
> + dev_err(&pdev->dev, "failed to get alias id: %d\n", ret);
> + return ret;
> + }
> + s->port.line = ret;
> +
> + return 0;
> +}
> +#else
> +static inline int serial_mxs_probe_dt(struct mxs_auart_port *s,
> + struct platform_device *pdev)
> +{
> + return 1;
> +}
> +#endif
> +
> +static void mxs_auart_probe_pdev(struct mxs_auart_port *s,
> + struct platform_device *pdev)
> +{
> + s->port.line = pdev->id < 0 ? 0 : pdev->id;
> +}
> +
Do we really need such a simple function?
> static int __devinit mxs_auart_probe(struct platform_device *pdev)
> {
> struct mxs_auart_port *s;
> @@ -689,6 +728,14 @@ static int __devinit mxs_auart_probe(struct platform_device *pdev)
> goto out;
> }
>
> + ret = serial_mxs_probe_dt(s, pdev);
> + if (ret > 0)
> + mxs_auart_probe_pdev(s, pdev);
> + else if (ret < 0) {
> + ret = -EINVAL;
Why changing the error code here?
> + goto out_free;
> + }
> +
> pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
> if (IS_ERR(pinctrl)) {
> ret = PTR_ERR(pinctrl);
> @@ -711,7 +758,6 @@ static int __devinit mxs_auart_probe(struct platform_device *pdev)
> s->port.membase = ioremap(r->start, resource_size(r));
> s->port.ops = &mxs_auart_ops;
> s->port.iotype = UPIO_MEM;
> - s->port.line = pdev->id < 0 ? 0 : pdev->id;
> s->port.fifosize = 16;
> s->port.uartclk = clk_get_rate(s->clk);
> s->port.type = PORT_IMX;
> @@ -769,12 +815,19 @@ static int __devexit mxs_auart_remove(struct platform_device *pdev)
> return 0;
> }
>
> +static struct of_device_id mxs_auart_dt_ids[] = {
> + {.compatible = "fsl,mxs-auart", },
Nit: put a space after "{".
> + { /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(of, mxs_auart_dt_ids);
> +
> static struct platform_driver mxs_auart_driver = {
> .probe = mxs_auart_probe,
> .remove = __devexit_p(mxs_auart_remove),
> .driver = {
> .name = "mxs-auart",
> .owner = THIS_MODULE,
> + .of_match_table = of_match_ptr(mxs_auart_dt_ids),
As Marek already pointed out, we have ARCH_MXS select USE_OF to have
CONFIG_OF always enabled, the of_match_ptr wrapper is not really needed
here.
> },
> };
>
> --
> 1.7.1
>
--
Regards,
Shawn
^ permalink raw reply
* [PATCH v3 2/2] serial: mxs-auart: Allow device tree probing
From: Fabio Estevam @ 2012-06-15 15:35 UTC (permalink / raw)
To: linux-arm-kernel
Cc: shawn.guo, kernel, marex, matt, snijsure, rob.herring,
Fabio Estevam, Grant Likely, Alan Cox, linux-serial
In-Reply-To: <1339774557-23588-1-git-send-email-fabio.estevam@freescale.com>
Allow device tree probing.
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: <linux-serial@vger.kernel.org>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v2:
- Change compatible string
- Add aliases information in bindings doc
- Remove unneeded mxs_auart_probe_pdev function
- Remove "ifdef CONFIG_OF"
- Remove of_match_ptr wrapper
Changes since v1:
- Merged patches 3 and 5 from v1 into this one
.../bindings/tty/serial/fsl-mxs-auart.txt | 27 +++++++++++
drivers/tty/serial/mxs-auart.c | 49 +++++++++++++++++++-
2 files changed, 75 insertions(+), 1 deletions(-)
create mode 100644 Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt
diff --git a/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt b/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt
new file mode 100644
index 0000000..2ee903f
--- /dev/null
+++ b/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt
@@ -0,0 +1,27 @@
+* Freescale MXS Application UART (AUART)
+
+Required properties:
+- compatible : Should be "fsl,<soc>-auart". The supported SoCs include
+ imx23 and imx28.
+- reg : Address and length of the register set for the device
+- interrupts : Should contain the auart interrupt numbers
+
+Example:
+auart0: serial@8006a000 {
+ compatible = "fsl,imx28-auart", "fsl,imx23-auart";
+ reg = <0x8006a000 0x2000>;
+ interrupts = <112 70 71>;
+};
+
+Note: Each auart port should have an alias correctly numbered in "aliases"
+node.
+
+Example:
+
+aliases {
+ serial0 = &auart0;
+ serial1 = &auart1;
+ serial2 = &auart2;
+ serial3 = &auart3;
+ serial4 = &auart4;
+};
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index ec56d83..87bbe9c 100644
--- a/drivers/tty/serial/mxs-auart.c
+++ b/drivers/tty/serial/mxs-auart.c
@@ -33,6 +33,7 @@
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/pinctrl/consumer.h>
+#include <linux/of_device.h>
#include <asm/cacheflush.h>
@@ -675,6 +676,30 @@ static struct uart_driver auart_driver = {
#endif
};
+/*
+ * This function returns 1 if pdev isn't a device instatiated by dt, 0 if it
+ * could successfully get all information from dt or a negative errno.
+ */
+static int serial_mxs_probe_dt(struct mxs_auart_port *s,
+ struct platform_device *pdev)
+{
+ struct device_node *np = pdev->dev.of_node;
+ int ret;
+
+ if (!np)
+ /* no device tree device */
+ return 1;
+
+ ret = of_alias_get_id(np, "serial");
+ if (ret < 0) {
+ dev_err(&pdev->dev, "failed to get alias id: %d\n", ret);
+ return ret;
+ }
+ s->port.line = ret;
+
+ return 0;
+}
+
static int __devinit mxs_auart_probe(struct platform_device *pdev)
{
struct mxs_auart_port *s;
@@ -689,6 +714,12 @@ static int __devinit mxs_auart_probe(struct platform_device *pdev)
goto out;
}
+ ret = serial_mxs_probe_dt(s, pdev);
+ if (ret > 0)
+ s->port.line = pdev->id < 0 ? 0 : pdev->id;
+ else if (ret < 0)
+ goto out_free;
+
pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
if (IS_ERR(pinctrl)) {
ret = PTR_ERR(pinctrl);
@@ -711,7 +742,6 @@ static int __devinit mxs_auart_probe(struct platform_device *pdev)
s->port.membase = ioremap(r->start, resource_size(r));
s->port.ops = &mxs_auart_ops;
s->port.iotype = UPIO_MEM;
- s->port.line = pdev->id < 0 ? 0 : pdev->id;
s->port.fifosize = 16;
s->port.uartclk = clk_get_rate(s->clk);
s->port.type = PORT_IMX;
@@ -769,13 +799,29 @@ static int __devexit mxs_auart_remove(struct platform_device *pdev)
return 0;
}
+static struct platform_device_id mxs_auart_devtype[] = {
+ {
+ .name = "mxs-auart",
+ /* sentinel */
+ }
+};
+MODULE_DEVICE_TABLE(platform, mxs_auart_devtype);
+
+static struct of_device_id mxs_auart_dt_ids[] = {
+ { .compatible = "fsl,imx23-auart", },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, mxs_auart_dt_ids);
+
static struct platform_driver mxs_auart_driver = {
.probe = mxs_auart_probe,
.remove = __devexit_p(mxs_auart_remove),
.driver = {
.name = "mxs-auart",
.owner = THIS_MODULE,
+ .of_match_table = mxs_auart_dt_ids,
},
+ .id_table = mxs_auart_devtype,
};
static int __init mxs_auart_init(void)
@@ -807,3 +853,4 @@ module_init(mxs_auart_init);
module_exit(mxs_auart_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Freescale MXS application uart driver");
+MODULE_ALIAS("platform:mxs-auart");
--
1.7.1
^ permalink raw reply related
* Re: [PATCH v3 2/2] serial: mxs-auart: Allow device tree probing
From: Marek Vasut @ 2012-06-15 15:48 UTC (permalink / raw)
To: Fabio Estevam
Cc: linux-arm-kernel, shawn.guo, kernel, matt, snijsure, rob.herring,
Grant Likely, Alan Cox, linux-serial
In-Reply-To: <1339774557-23588-2-git-send-email-fabio.estevam@freescale.com>
Dear Fabio Estevam,
> Allow device tree probing.
>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: Rob Herring <rob.herring@calxeda.com>
> Cc: Alan Cox <alan@linux.intel.com>
> Cc: <linux-serial@vger.kernel.org>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Acked-by: Marek Vasut <marex@denx.de>
> ---
> Changes since v2:
> - Change compatible string
> - Add aliases information in bindings doc
> - Remove unneeded mxs_auart_probe_pdev function
> - Remove "ifdef CONFIG_OF"
> - Remove of_match_ptr wrapper
> Changes since v1:
> - Merged patches 3 and 5 from v1 into this one
> .../bindings/tty/serial/fsl-mxs-auart.txt | 27 +++++++++++
> drivers/tty/serial/mxs-auart.c | 49
> +++++++++++++++++++- 2 files changed, 75 insertions(+), 1 deletions(-)
> create mode 100644
> Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt
>
> diff --git a/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt
> b/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt new file
> mode 100644
> index 0000000..2ee903f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/tty/serial/fsl-mxs-auart.txt
> @@ -0,0 +1,27 @@
> +* Freescale MXS Application UART (AUART)
> +
> +Required properties:
> +- compatible : Should be "fsl,<soc>-auart". The supported SoCs include
> + imx23 and imx28.
> +- reg : Address and length of the register set for the device
> +- interrupts : Should contain the auart interrupt numbers
> +
> +Example:
> +auart0: serial@8006a000 {
> + compatible = "fsl,imx28-auart", "fsl,imx23-auart";
> + reg = <0x8006a000 0x2000>;
> + interrupts = <112 70 71>;
> +};
> +
> +Note: Each auart port should have an alias correctly numbered in "aliases"
> +node.
> +
> +Example:
> +
> +aliases {
> + serial0 = &auart0;
> + serial1 = &auart1;
> + serial2 = &auart2;
> + serial3 = &auart3;
> + serial4 = &auart4;
> +};
> diff --git a/drivers/tty/serial/mxs-auart.c
> b/drivers/tty/serial/mxs-auart.c index ec56d83..87bbe9c 100644
> --- a/drivers/tty/serial/mxs-auart.c
> +++ b/drivers/tty/serial/mxs-auart.c
> @@ -33,6 +33,7 @@
> #include <linux/delay.h>
> #include <linux/io.h>
> #include <linux/pinctrl/consumer.h>
> +#include <linux/of_device.h>
>
> #include <asm/cacheflush.h>
>
> @@ -675,6 +676,30 @@ static struct uart_driver auart_driver = {
> #endif
> };
>
> +/*
> + * This function returns 1 if pdev isn't a device instatiated by dt, 0 if
> it + * could successfully get all information from dt or a negative errno.
> + */
> +static int serial_mxs_probe_dt(struct mxs_auart_port *s,
> + struct platform_device *pdev)
> +{
> + struct device_node *np = pdev->dev.of_node;
> + int ret;
> +
> + if (!np)
> + /* no device tree device */
> + return 1;
> +
> + ret = of_alias_get_id(np, "serial");
> + if (ret < 0) {
> + dev_err(&pdev->dev, "failed to get alias id: %d\n", ret);
> + return ret;
> + }
> + s->port.line = ret;
> +
> + return 0;
> +}
> +
> static int __devinit mxs_auart_probe(struct platform_device *pdev)
> {
> struct mxs_auart_port *s;
> @@ -689,6 +714,12 @@ static int __devinit mxs_auart_probe(struct
> platform_device *pdev) goto out;
> }
>
> + ret = serial_mxs_probe_dt(s, pdev);
> + if (ret > 0)
> + s->port.line = pdev->id < 0 ? 0 : pdev->id;
> + else if (ret < 0)
> + goto out_free;
> +
> pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
> if (IS_ERR(pinctrl)) {
> ret = PTR_ERR(pinctrl);
> @@ -711,7 +742,6 @@ static int __devinit mxs_auart_probe(struct
> platform_device *pdev) s->port.membase = ioremap(r->start,
> resource_size(r));
> s->port.ops = &mxs_auart_ops;
> s->port.iotype = UPIO_MEM;
> - s->port.line = pdev->id < 0 ? 0 : pdev->id;
> s->port.fifosize = 16;
> s->port.uartclk = clk_get_rate(s->clk);
> s->port.type = PORT_IMX;
> @@ -769,13 +799,29 @@ static int __devexit mxs_auart_remove(struct
> platform_device *pdev) return 0;
> }
>
> +static struct platform_device_id mxs_auart_devtype[] = {
> + {
> + .name = "mxs-auart",
> + /* sentinel */
> + }
> +};
> +MODULE_DEVICE_TABLE(platform, mxs_auart_devtype);
> +
> +static struct of_device_id mxs_auart_dt_ids[] = {
> + { .compatible = "fsl,imx23-auart", },
> + { /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(of, mxs_auart_dt_ids);
> +
> static struct platform_driver mxs_auart_driver = {
> .probe = mxs_auart_probe,
> .remove = __devexit_p(mxs_auart_remove),
> .driver = {
> .name = "mxs-auart",
> .owner = THIS_MODULE,
> + .of_match_table = mxs_auart_dt_ids,
> },
> + .id_table = mxs_auart_devtype,
> };
>
> static int __init mxs_auart_init(void)
> @@ -807,3 +853,4 @@ module_init(mxs_auart_init);
> module_exit(mxs_auart_exit);
> MODULE_LICENSE("GPL");
> MODULE_DESCRIPTION("Freescale MXS application uart driver");
> +MODULE_ALIAS("platform:mxs-auart");
Best regards,
Marek Vasut
^ permalink raw reply
* Re: [PATCH v3 2/2] serial: mxs-auart: Allow device tree probing
From: Shawn Guo @ 2012-06-15 16:06 UTC (permalink / raw)
To: Fabio Estevam
Cc: linux-arm-kernel, kernel, marex, matt, snijsure, rob.herring,
Grant Likely, Alan Cox, linux-serial
In-Reply-To: <1339774557-23588-2-git-send-email-fabio.estevam@freescale.com>
On Fri, Jun 15, 2012 at 12:35:57PM -0300, Fabio Estevam wrote:
> +static struct platform_device_id mxs_auart_devtype[] = {
> + {
> + .name = "mxs-auart",
> + /* sentinel */
> + }
> +};
> +MODULE_DEVICE_TABLE(platform, mxs_auart_devtype);
...
> + .id_table = mxs_auart_devtype,
I do not think we need these.
--
Regards,
Shawn
^ permalink raw reply
* Re: [PATCH v3 2/2] serial: mxs-auart: Allow device tree probing
From: Fabio Estevam @ 2012-06-15 16:11 UTC (permalink / raw)
To: Shawn Guo
Cc: Fabio Estevam, marex, snijsure, rob.herring, Grant Likely, kernel,
linux-serial, matt, linux-arm-kernel, Alan Cox
In-Reply-To: <20120615160635.GP31565@S2101-09.ap.freescale.net>
On Fri, Jun 15, 2012 at 1:06 PM, Shawn Guo <shawn.guo@linaro.org> wrote:
>> +MODULE_DEVICE_TABLE(platform, mxs_auart_devtype);
> ...
>> + .id_table = mxs_auart_devtype,
>
> I do not think we need these.
WIthout this, the non-dt kernel does not probe correctly.
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH v3 2/2] serial: mxs-auart: Allow device tree probing
From: Marek Vasut @ 2012-06-15 16:16 UTC (permalink / raw)
To: Fabio Estevam
Cc: Shawn Guo, Fabio Estevam, snijsure, rob.herring, Grant Likely,
kernel, linux-serial, matt, linux-arm-kernel, Alan Cox
In-Reply-To: <CAOMZO5BB5G5gvbcqDa2uB3hR-_o7XpcgXR9Ha+Xd7ZLpCqaOVw@mail.gmail.com>
Dear Fabio Estevam,
> On Fri, Jun 15, 2012 at 1:06 PM, Shawn Guo <shawn.guo@linaro.org> wrote:
> >> +MODULE_DEVICE_TABLE(platform, mxs_auart_devtype);
> >
> > ...
> >
> >> + .id_table = mxs_auart_devtype,
> >
> > I do not think we need these.
>
> WIthout this, the non-dt kernel does not probe correctly.
But we don't support non-DT kernel anymore.
Best regards,
Marek Vasut
^ permalink raw reply
* Re: [PATCH v3 2/2] serial: mxs-auart: Allow device tree probing
From: Fabio Estevam @ 2012-06-15 16:18 UTC (permalink / raw)
To: Marek Vasut
Cc: Shawn Guo, Fabio Estevam, snijsure, rob.herring, Grant Likely,
kernel, linux-serial, matt, linux-arm-kernel, Alan Cox
In-Reply-To: <201206151816.55567.marex@denx.de>
On Fri, Jun 15, 2012 at 1:16 PM, Marek Vasut <marex@denx.de> wrote:
> Dear Fabio Estevam,
>
>> On Fri, Jun 15, 2012 at 1:06 PM, Shawn Guo <shawn.guo@linaro.org> wrote:
>> >> +MODULE_DEVICE_TABLE(platform, mxs_auart_devtype);
>> >
>> > ...
>> >
>> >> + .id_table = mxs_auart_devtype,
>> >
>> > I do not think we need these.
>>
>> WIthout this, the non-dt kernel does not probe correctly.
>
> But we don't support non-DT kernel anymore.
but I don't want my patch to break something that has been working for
a long time.
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH v3 2/2] serial: mxs-auart: Allow device tree probing
From: Marek Vasut @ 2012-06-15 17:00 UTC (permalink / raw)
To: Fabio Estevam
Cc: Shawn Guo, Fabio Estevam, snijsure, rob.herring, Grant Likely,
kernel, linux-serial, matt, linux-arm-kernel, Alan Cox
In-Reply-To: <CAOMZO5AFaWGEfEhVs1TVc0c_Wp6aB7FT5zKHEoiucLnuWGg8zA@mail.gmail.com>
Dear Fabio Estevam,
> On Fri, Jun 15, 2012 at 1:16 PM, Marek Vasut <marex@denx.de> wrote:
> > Dear Fabio Estevam,
> >
> >> On Fri, Jun 15, 2012 at 1:06 PM, Shawn Guo <shawn.guo@linaro.org> wrote:
> >> >> +MODULE_DEVICE_TABLE(platform, mxs_auart_devtype);
> >> >
> >> > ...
> >> >
> >> >> + .id_table = mxs_auart_devtype,
> >> >
> >> > I do not think we need these.
> >>
> >> WIthout this, the non-dt kernel does not probe correctly.
> >
> > But we don't support non-DT kernel anymore.
>
> but I don't want my patch to break something that has been working for
> a long time.
But we don't care if the non-DT case gets broken anyway *. It's unsupported and
will be removed.
* that's how I understand it.
Best regards,
Marek Vasut
^ permalink raw reply
* [PATCH 1/4] serial: imx: Remove unneeded '#ifdef CONFIG_OF'
From: Fabio Estevam @ 2012-06-15 17:23 UTC (permalink / raw)
To: linux-arm-kernel
Cc: kernel, shawn.guo, marex, Fabio Estevam, Greg Kroah-Hartman,
Alan Cox, linux-serial
CONFIG_OF is always selected for imx SoCs so it is safe
to drop the '#ifdef CONFIG_OF'.
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Alan Cox <alan@linux.intel.com>
Cc: <linux-serial@vger.kernel.org>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
drivers/tty/serial/imx.c | 8 --------
1 files changed, 0 insertions(+), 8 deletions(-)
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 0af4eec..4bfa95d 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1399,7 +1399,6 @@ static int serial_imx_resume(struct platform_device *dev)
return 0;
}
-#ifdef CONFIG_OF
/*
* This function returns 1 iff pdev isn't a device instatiated by dt, 0 iff it
* could successfully get all information from dt or a negative errno.
@@ -1433,13 +1432,6 @@ static int serial_imx_probe_dt(struct imx_port *sport,
return 0;
}
-#else
-static inline int serial_imx_probe_dt(struct imx_port *sport,
- struct platform_device *pdev)
-{
- return 1;
-}
-#endif
static void serial_imx_probe_pdata(struct imx_port *sport,
struct platform_device *pdev)
--
1.7.1
^ permalink raw reply related
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