linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: nsekhar@ti.com (Sekhar Nori)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 1/5] ARM: davinci: uart: move to devid based clk_get
Date: Thu, 6 Jun 2013 16:14:19 +0530	[thread overview]
Message-ID: <51B06803.2020008@ti.com> (raw)
In-Reply-To: <51B06547.8030709@ti.com>



On 6/6/2013 4:02 PM, Sekhar Nori wrote:
> Hi Prakash,
> 
> It appears that this patch was not tested thoroughly. See below:
> 
> On 5/28/2013 1:58 PM, Manjunathappa, Prakash wrote:
>> For modules having single clock, clk_get should be done with dev_id.
>> But current davinci implementation handles multiple instances
>> of the UART devices with single platform_device_register. Hence clk_get
>> is based on con_id rather than dev_id, this is not correct. Do
>> platform_device_register for each instance and clk_get on dev_id.
>>
>> Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
>> ---
> 
>> -static struct plat_serial8250_port da8xx_serial_pdata[] = {
>> +static struct plat_serial8250_port da8xx_serial0_pdata[] = {
>>  	{
>>  		.mapbase	= DA8XX_UART0_BASE,
>>  		.irq		= IRQ_DA8XX_UARTINT0,
>> @@ -75,7 +75,9 @@ static struct plat_serial8250_port da8xx_serial_pdata[] = {
>>  					UPF_IOREMAP,
>>  		.iotype		= UPIO_MEM,
>>  		.regshift	= 2,
>> -	},
>> +	}
>> +};
>> +static struct plat_serial8250_port da8xx_serial1_pdata[] = {
>>  	{
>>  		.mapbase	= DA8XX_UART1_BASE,
>>  		.irq		= IRQ_DA8XX_UARTINT1,
>> @@ -83,7 +85,9 @@ static struct plat_serial8250_port da8xx_serial_pdata[] = {
>>  					UPF_IOREMAP,
>>  		.iotype		= UPIO_MEM,
>>  		.regshift	= 2,
>> -	},
>> +	}
>> +};
>> +static struct plat_serial8250_port da8xx_serial2_pdata[] = {
>>  	{
>>  		.mapbase	= DA8XX_UART2_BASE,
>>  		.irq		= IRQ_DA8XX_UARTINT2,
>> @@ -91,18 +95,31 @@ static struct plat_serial8250_port da8xx_serial_pdata[] = {
>>  					UPF_IOREMAP,
>>  		.iotype		= UPIO_MEM,
>>  		.regshift	= 2,
>> -	},
>> -	{
>> -		.flags	= 0,
>> -	},
>> +	}
> 
> 8250_core.c relies on sentinel value with p->flags = 0 to terminate
> looking for more ports. You don't have sentinel values in any of pdata
> the arrays you introduced so the code basically goes looking into areas
> of memory not its own. This caused bunch of "cannot register port"
> errors for me but I can easily imagine more serious errors.

Similarly, you check for platform_data being NULL to go over the list of
serial devices in the code in serial.c you introduced, but don't have a
sentinel when you define the serial device array.

Thanks,
Sekhar

  reply	other threads:[~2013-06-06 10:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-28  8:28 [PATCH v2 0/5] ARM: davinci: fix UART clock enabling Manjunathappa, Prakash
2013-05-28  8:28 ` [PATCH v2 1/5] ARM: davinci: uart: move to devid based clk_get Manjunathappa, Prakash
2013-06-06 10:32   ` Sekhar Nori
2013-06-06 10:44     ` Sekhar Nori [this message]
2013-06-19  9:20       ` Manjunathappa, Prakash
2013-06-07  5:35   ` Sekhar Nori
2013-06-19  9:24     ` Manjunathappa, Prakash
2013-05-28  8:28 ` [PATCH v2 2/5] ARM: davinci: da850: override device name of UART in DT kernel Manjunathappa, Prakash
2013-05-28  8:28 ` [PATCH v2 3/5] ARM: davinci: da850: do not specify clock_frequency for UART DT node Manjunathappa, Prakash
2013-05-28  8:28 ` [PATCH v2 4/5] ARM: davinci: da8xx: remove da8xx_uart_clk_enable Manjunathappa, Prakash
2013-05-28  8:28 ` [PATCH v2 5/5] ARM: davinci: serial: platform code cleanup Manjunathappa, Prakash
2013-06-05 11:41   ` Sekhar Nori
2013-06-06 10:25     ` Sekhar Nori

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51B06803.2020008@ti.com \
    --to=nsekhar@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).