Tobias Klauser | 1 Mar 2011 09:10
Picon
Favicon
Gravatar

Re: [smatch stuff] altera_uart: inconsistent checks for null

On 2011-02-19 at 15:02:05 +0100, Dan Carpenter <error27 <at> gmail.com> wrote:
> On Sat, Feb 19, 2011 at 02:22:17PM +0100, Tobias Klauser wrote:
> > On 2011-02-19 at 10:31:07 +0100, Dan Carpenter <error27 <at> gmail.com> wrote:
> > > Patch 2780ad42f5fe67 "tty: serial: altera_uart: Use port->regshift to
> > > store bus shift" added a NULL check for platp in altera_uart_probe() but
> > > not consistently through out the function.
> > > 
> > > drivers/tty/serial/altera_uart.c +553 altera_uart_probe(43)
> > > 	error: we previously assumed 'platp' could be null.
> > > 
> > >    545          if (platp)
> > >                    ^^^^^^^
> > > checked here.
> > > 
> > >    546                  port->regshift = platp->bus_shift;
> > >    547          else
> > >    548                  port->regshift = 0;
> > >    549
> > >    550          port->line = i;
> > >    551          port->type = PORT_ALTERA_UART;
> > >    552          port->iotype = SERIAL_IO_MEM;
> > >    553          port->uartclk = platp->uartclk;
> > >                                 ^^^^^^^
> > > potential NULL dereference?
> > 
> > Not at the moment, because everybody is using platform data at the
> > momenti, so platp should never be NULL. Still this is inconsistent and
> > shouldn't be there like this. The dereference on line 553 will go away
> > with the patch introducing device tree support to altera_uart [1].
> > 
(Continue reading)

@@@ | 2 Mar 2011 00:48
Picon

(unknown)

Van szüksége a hitel bármilyen célra? Van egy pénzügyi probléma? Nem
szükség van a pénzügyi megoldás? Mr. Henrik
 hitelek a megoldás toall a pénzügyi problémákat, mi hitelek könnyen,
olcsó, és gyors. Írjon nekünk ma, hogy a kölcsönt, amire vágytok, akkor
intézkedik minden olyan kölcsön, hogy megfeleljen a költségvetés mindössze
3%-os kamat. Ha
érdekli, lépjen velünk kapcsolatba immediately.Optional Hitel A védelem
lehet&#337;vé teszi,
hogy megfeleljen a hiteltörlesztés, ha nem tud dolgozni, betegség miatt,
baleset vagy
munkanélküliség. Csak akkor vegye ki az értékes biztosítást, ha alkalmazni
az Ön kölcsönt,
emlékszem, hogy elmondja nekünk, ha azt szeretné, hogy
henmoralendingfirm <at> gmail.com

* HITEL JELENTKEZÉSI LAP *

* Teljes név ............*

* Otthoni cím ....................... ..*

* Születési dátum ......................*

* Telefonszám ...................*

* MOBIL szám, ha ..............*

* HITEL szükséges mennyiség .................*

* FAX .................*
(Continue reading)

Mr. henry | 2 Mar 2011 00:47
Picon

(unknown)

Van szüksége a hitel bármilyen célra? Van egy pénzügyi probléma? Nem
szükség van a pénzügyi megoldás? Mr. Henrik
 hitelek a megoldás toall a pénzügyi problémákat, mi hitelek könnyen,
olcsó, és gyors. Írjon nekünk ma, hogy a kölcsönt, amire vágytok, akkor
intézkedik minden olyan kölcsön, hogy megfeleljen a költségvetés mindössze
3%-os kamat. Ha
érdekli, lépjen velünk kapcsolatba immediately.Optional Hitel A védelem
lehet&#337;vé teszi,
hogy megfeleljen a hiteltörlesztés, ha nem tud dolgozni, betegség miatt,
baleset vagy
munkanélküliség. Csak akkor vegye ki az értékes biztosítást, ha alkalmazni
az Ön kölcsönt,
emlékszem, hogy elmondja nekünk, ha azt szeretné, hogy
henmoralendingfirm <at> gmail.com

* HITEL JELENTKEZÉSI LAP *

* Teljes név ............*

* Otthoni cím ....................... ..*

* Születési dátum ......................*

* Telefonszám ...................*

* MOBIL szám, ha ..............*

* HITEL szükséges mennyiség .................*

* FAX .................*
(Continue reading)

Govindraj | 2 Mar 2011 08:40
Picon

Re: [PATCH 6/7] OMAP: Serial: Allow UART parameters to be configured from board file

On Wed, Mar 2, 2011 at 12:46 AM, Sricharan R <r.sricharan <at> ti.com> wrote:
> Hi,
>>diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
>>index 755f4aa..530e9e3 100644
>>--- a/arch/arm/mach-omap2/serial.c
>>+++ b/arch/arm/mach-omap2/serial.c
>> <at>  <at>  -44,6 +44,15  <at>  <at> 
>>
>> static int omap_uart_con_id __initdata = -1;
>>
>>+static struct omap_uart_port_info omap_serial_default_info[] = {
>>+      {
>>+              .dma_enabled    = 0,
>>+              .dma_rx_buf_size = DEFAULT_RXDMA_BUFSIZE,
>>+              .dma_rx_timeout = DEFAULT_RXDMA_TIMEOUT,
>>+              .idle_timeout   = DEFAULT_IDLE_TIMEOUT,
>>+      },
>>+};
>>+
>> static int uart_idle_hwmod(struct omap_device *od)
>> {
>>       omap_hwmod_idle(od->hwmods[0]);
>> <at>  <at>  -66,6 +75,54  <at>  <at>  static struct omap_device_pm_latency
> omap_uart_latency[]
>>= {
>>       },
>> };
>>
>>+#ifdef CONFIG_OMAP_MUX
>>+static struct omap_device_pad default_serial0_pads[] __initdata = {
(Continue reading)

Sricharan R | 2 Mar 2011 09:19
Picon
Favicon

RE: [PATCH 6/7] OMAP: Serial: Allow UART parameters to be configured from board file

Hi,
>-----Original Message-----
>From: Govindraj [mailto:govindraj.ti <at> gmail.com]
>Sent: Wednesday, March 02, 2011 1:11 PM
>To: Sricharan R
>Cc: Govindraj.R; linux-omap <at> vger.kernel.org;
linux-serial <at> vger.kernel.org;
>linux-arm-kernel <at> lists.infradead.org; Jon Hunter; Tony Lindgren; Benoit
>Cousson; Kevin Hilman; Paul Walmsley; Rajendra Nayak; Deepak Kattungal
>Subject: Re: [PATCH 6/7] OMAP: Serial: Allow UART parameters to be
>configured from board file
>
>On Wed, Mar 2, 2011 at 12:46 AM, Sricharan R <r.sricharan <at> ti.com> wrote:
>> Hi,
>>>diff --git a/arch/arm/mach-omap2/serial.c
b/arch/arm/mach-omap2/serial.c
>>>index 755f4aa..530e9e3 100644
>>>--- a/arch/arm/mach-omap2/serial.c
>>>+++ b/arch/arm/mach-omap2/serial.c
>>> <at>  <at>  -44,6 +44,15  <at>  <at> 
>>>
>>> static int omap_uart_con_id __initdata = -1;
>>>
>>>+static struct omap_uart_port_info omap_serial_default_info[] = {
>>>+      {
>>>+              .dma_enabled    = 0,
>>>+              .dma_rx_buf_size = DEFAULT_RXDMA_BUFSIZE,
>>>+              .dma_rx_timeout = DEFAULT_RXDMA_TIMEOUT,
>>>+              .idle_timeout   = DEFAULT_IDLE_TIMEOUT,
>>>+      },
(Continue reading)

Govindraj | 2 Mar 2011 11:07
Picon

Re: [PATCH 6/7] OMAP: Serial: Allow UART parameters to be configured from board file

On Wed, Mar 2, 2011 at 1:49 PM, Sricharan R <r.sricharan <at> ti.com> wrote:
> Hi,
>>-----Original Message-----
>>From: Govindraj [mailto:govindraj.ti <at> gmail.com]
>>Sent: Wednesday, March 02, 2011 1:11 PM
>>To: Sricharan R
>>Cc: Govindraj.R; linux-omap <at> vger.kernel.org;
> linux-serial <at> vger.kernel.org;
>>linux-arm-kernel <at> lists.infradead.org; Jon Hunter; Tony Lindgren; Benoit
>>Cousson; Kevin Hilman; Paul Walmsley; Rajendra Nayak; Deepak Kattungal
>>Subject: Re: [PATCH 6/7] OMAP: Serial: Allow UART parameters to be
>>configured from board file
>>
>>On Wed, Mar 2, 2011 at 12:46 AM, Sricharan R <r.sricharan <at> ti.com> wrote:
>>> Hi,
>>>>diff --git a/arch/arm/mach-omap2/serial.c
> b/arch/arm/mach-omap2/serial.c
>>>>index 755f4aa..530e9e3 100644
>>>>--- a/arch/arm/mach-omap2/serial.c
>>>>+++ b/arch/arm/mach-omap2/serial.c
>>>> <at>  <at>  -44,6 +44,15  <at>  <at> 
>>>>
>>>> static int omap_uart_con_id __initdata = -1;
>>>>
>>>>+static struct omap_uart_port_info omap_serial_default_info[] = {
>>>>+      {
>>>>+              .dma_enabled    = 0,
>>>>+              .dma_rx_buf_size = DEFAULT_RXDMA_BUFSIZE,
>>>>+              .dma_rx_timeout = DEFAULT_RXDMA_TIMEOUT,
>>>>+              .idle_timeout   = DEFAULT_IDLE_TIMEOUT,
(Continue reading)

Govindraj | 2 Mar 2011 11:40
Picon

Re: [PATCH 2/7] OMAP2+: mux: Enable wakeup for wakeup enable requested pads

On Wed, Mar 2, 2011 at 10:19 AM, Varadarajan, Charulatha <charu <at> ti.com> wrote:
> Govind,
>
> Couple of minor comments.
>
> On Mon, Feb 28, 2011 at 20:09, Govindraj.R <govindraj.raja <at> ti.com> wrote:
>> For device pads which have OMAP_DEVICE_PAD_WAKEUP set (which means they
>> are wakeup capable) enable the IO-daisy wakeup capability.
>> During re-muxing avoid direct write with val as this can disturb if any
>> mux done at bootloader level so read the pad then write back.
>>
>> Also add a api to fetch the wake-up status bit is set for given omap-hwmod
>
> %s/a api/an API/
>
>> device using available mux info which is added during omap_hwmod_mux_init.
>> Wakeup status bit is needed for uart_resume_idle call from sram_idle path
>> based on wake-up event has occurred for given uart we can enable clocks back.
>>
>> Signed-off-by: Rajendra Nayak <rnayak <at> ti.com>
>> Signed-off-by: Govindraj.R <govindraj.raja <at> ti.com>
>> ---
>>  arch/arm/mach-omap2/mux.c                    |   23 +++++++++++++++++++++++
>>  arch/arm/mach-omap2/mux.h                    |   13 +++++++++++++
>>  arch/arm/mach-omap2/omap_hwmod.c             |   13 +++++++++++++
>>  arch/arm/plat-omap/include/plat/omap_hwmod.h |    1 +
>>  4 files changed, 50 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
>> index 98148b6..5338b93 100644
(Continue reading)

Govindraj.R | 2 Mar 2011 12:12
Picon
Favicon

[PATCH 2/7] OMAP2+: mux: Enable wakeup for wakeup enable requested pads

For device pads which have OMAP_DEVICE_PAD_WAKEUP set (which means they
are wakeup capable) enable the IO-daisy wakeup capability.
During re-muxing avoid direct write with val as this can disturb if any
mux done at bootloader level so read the pad then write back.

Also add an API to fetch the wake-up status bit is set for given omap-hwmod
device using available mux info which is added during omap_hwmod_mux_init.
Wakeup status bit is needed for uart_resume_idle call from sram_idle path
based on wake-up event has occurred for given uart we can enable clocks back.

Signed-off-by: Rajendra Nayak <rnayak <at> ti.com>
Signed-off-by: Govindraj.R <govindraj.raja <at> ti.com>
---
 arch/arm/mach-omap2/mux.c                    |   28 ++++++++++++++++++++++++++
 arch/arm/mach-omap2/mux.h                    |   13 ++++++++++++
 arch/arm/mach-omap2/omap_hwmod.c             |   13 ++++++++++++
 arch/arm/plat-omap/include/plat/omap_hwmod.h |    1 +
 4 files changed, 55 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c
index 98148b6..50edcea 100644
--- a/arch/arm/mach-omap2/mux.c
+++ b/arch/arm/mach-omap2/mux.c
 <at>  <at>  -317,6 +317,29  <at>  <at>  err1:
 	return NULL;
 }

+/* Gets the wakeup status of given pad from omap-hwmod */
+int omap_hwmod_mux_wakeup(struct omap_hwmod_mux_info *hmux)
+{
(Continue reading)

Sricharan R | 3 Mar 2011 06:08
Picon
Favicon

RE: [PATCH 6/7] OMAP: Serial: Allow UART parameters to be configured from board file

Hi,
>-----Original Message-----
>From: Govindraj [mailto:govindraj.ti <at> gmail.com]
>Sent: Wednesday, March 02, 2011 3:37 PM
>To: Sricharan R
>Cc: Govindraj.R; linux-omap <at> vger.kernel.org;
linux-serial <at> vger.kernel.org;
>linux-arm-kernel <at> lists.infradead.org; Jon Hunter; Tony Lindgren; Benoit
>Cousson; Kevin Hilman; Paul Walmsley; Rajendra Nayak; Deepak Kattungal
>Subject: Re: [PATCH 6/7] OMAP: Serial: Allow UART parameters to be
>configured from board file
>
>On Wed, Mar 2, 2011 at 1:49 PM, Sricharan R <r.sricharan <at> ti.com> wrote:
>> Hi,
>>>-----Original Message-----
>>>From: Govindraj [mailto:govindraj.ti <at> gmail.com]
>>>Sent: Wednesday, March 02, 2011 1:11 PM
>>>To: Sricharan R
>>>Cc: Govindraj.R; linux-omap <at> vger.kernel.org;
>> linux-serial <at> vger.kernel.org;
>>>linux-arm-kernel <at> lists.infradead.org; Jon Hunter; Tony Lindgren; Benoit
>>>Cousson; Kevin Hilman; Paul Walmsley; Rajendra Nayak; Deepak Kattungal
>>>Subject: Re: [PATCH 6/7] OMAP: Serial: Allow UART parameters to be
>>>configured from board file
>>>
>>>On Wed, Mar 2, 2011 at 12:46 AM, Sricharan R <r.sricharan <at> ti.com>
wrote:
>>>> Hi,
>>>>>diff --git a/arch/arm/mach-omap2/serial.c
>> b/arch/arm/mach-omap2/serial.c
(Continue reading)

Govindraj | 3 Mar 2011 13:14
Picon

Re: [PATCH 6/7] OMAP: Serial: Allow UART parameters to be configured from board file

On Wed, Mar 2, 2011 at 11:54 PM, Tony Lindgren <tony <at> atomide.com> wrote:
> * Govindraj <govindraj.ti <at> gmail.com> [110302 02:05]:
>>
>> >>>>+static struct omap_device_pad default_serial1_pads[] __initdata = {
>> >>>>+      {
>> >>>>+              .name   = "uart2_rx.uart2_rx",
>> >>>>+              .flags  = OMAP_DEVICE_PAD_REMUX |
>> > OMAP_DEVICE_PAD_WAKEUP,
>> >>>>+              .enable = OMAP_MUX_MODE0,
>> >>>>+      },
> ...
>
> AFAIK you should only need the OMAP_DEVICE_PAD_REMUX option for
> omap24xx. And if you use that option, you also need the .idle
> value.
>

Yes correct. I should avoid enabling rx-pad wakeup for omap24xx and
populate rx pad wakeup only for 3xxx onwards as done prior to this patch.

Will correct this in next version.

--
Thanks,
Govindraj.R

> Tony
>
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
(Continue reading)


Gmane