From: "Cousson, Benoit" <b-cousson@ti.com>
To: linux-serial@vger.kernel.org, Alan Cox <alan@linux.intel.com>,
gregkh@linuxfoundation.org
Cc: Paul Walmsley <paul@pwsan.com>,
linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
Kevin Hilman <khilman@ti.com>,
"Govindraj.R" <govindraj.raja@ti.com>
Subject: [PATCH] tty: serial: OMAP: Fix oops due to NULL pdata in DT boot
Date: Tue, 28 Feb 2012 18:22:12 +0100 [thread overview]
Message-ID: <4F4D0D44.3010604@ti.com> (raw)
In-Reply-To: <20120126025036.31613.67819.stgit@dusk>
The following commit: be4b0281956c5cae4f63f31f11d07625a6988766
(tty: serial: OMAP: block idle while the UART is transferring data in PIO mode),
is introducing an oops if OMAP is booted using device tree blob because
the pdata will not be initialized.
Check if pdata is set before de-referencing it.
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Reviewed-by: Paul Walmsley <paul@pwsan.com>
---
drivers/tty/serial/omap-serial.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index f809041..0121486 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -159,7 +159,7 @@ static void serial_omap_stop_tx(struct uart_port *port)
serial_out(up, UART_IER, up->ier);
}
- if (!up->use_dma && pdata->set_forceidle)
+ if (!up->use_dma && pdata && pdata->set_forceidle)
pdata->set_forceidle(up->pdev);
pm_runtime_mark_last_busy(&up->pdev->dev);
@@ -298,7 +298,7 @@ static void serial_omap_start_tx(struct uart_port *port)
if (!up->use_dma) {
pm_runtime_get_sync(&up->pdev->dev);
serial_omap_enable_ier_thri(up);
- if (pdata->set_noidle)
+ if (pdata && pdata->set_noidle)
pdata->set_noidle(up->pdev);
pm_runtime_mark_last_busy(&up->pdev->dev);
pm_runtime_put_autosuspend(&up->pdev->dev);
@@ -1613,7 +1613,7 @@ static int serial_omap_runtime_resume(struct device *dev)
struct uart_omap_port *up = dev_get_drvdata(dev);
struct omap_uart_port_info *pdata = dev->platform_data;
- if (up) {
+ if (up && pdata) {
if (pdata->get_context_loss_count) {
u32 loss_cnt = pdata->get_context_loss_count(dev);
--
1.7.0.4
WARNING: multiple messages have this Message-ID (diff)
From: b-cousson@ti.com (Cousson, Benoit)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] tty: serial: OMAP: Fix oops due to NULL pdata in DT boot
Date: Tue, 28 Feb 2012 18:22:12 +0100 [thread overview]
Message-ID: <4F4D0D44.3010604@ti.com> (raw)
In-Reply-To: <20120126025036.31613.67819.stgit@dusk>
The following commit: be4b0281956c5cae4f63f31f11d07625a6988766
(tty: serial: OMAP: block idle while the UART is transferring data in PIO mode),
is introducing an oops if OMAP is booted using device tree blob because
the pdata will not be initialized.
Check if pdata is set before de-referencing it.
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Reviewed-by: Paul Walmsley <paul@pwsan.com>
---
drivers/tty/serial/omap-serial.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index f809041..0121486 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -159,7 +159,7 @@ static void serial_omap_stop_tx(struct uart_port *port)
serial_out(up, UART_IER, up->ier);
}
- if (!up->use_dma && pdata->set_forceidle)
+ if (!up->use_dma && pdata && pdata->set_forceidle)
pdata->set_forceidle(up->pdev);
pm_runtime_mark_last_busy(&up->pdev->dev);
@@ -298,7 +298,7 @@ static void serial_omap_start_tx(struct uart_port *port)
if (!up->use_dma) {
pm_runtime_get_sync(&up->pdev->dev);
serial_omap_enable_ier_thri(up);
- if (pdata->set_noidle)
+ if (pdata && pdata->set_noidle)
pdata->set_noidle(up->pdev);
pm_runtime_mark_last_busy(&up->pdev->dev);
pm_runtime_put_autosuspend(&up->pdev->dev);
@@ -1613,7 +1613,7 @@ static int serial_omap_runtime_resume(struct device *dev)
struct uart_omap_port *up = dev_get_drvdata(dev);
struct omap_uart_port_info *pdata = dev->platform_data;
- if (up) {
+ if (up && pdata) {
if (pdata->get_context_loss_count) {
u32 loss_cnt = pdata->get_context_loss_count(dev);
--
1.7.0.4
next prev parent reply other threads:[~2012-02-28 17:22 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-26 2:50 [PATCH v2 0/3] tty: serial: OMAP: work around broken IP block, driver Paul Walmsley
2012-01-26 2:50 ` Paul Walmsley
2012-01-26 2:50 ` [PATCH v2 1/3] tty: serial: OMAP: use a 1-byte RX FIFO threshold in PIO mode Paul Walmsley
2012-01-26 2:50 ` Paul Walmsley
2012-01-26 2:50 ` [PATCH 2/3] tty: serial: OMAP: block idle while the UART is transferring data " Paul Walmsley
2012-01-26 2:50 ` Paul Walmsley
2012-01-26 2:58 ` Paul Walmsley
2012-01-26 2:58 ` Paul Walmsley
2012-01-27 7:23 ` Govindraj
2012-01-27 7:23 ` Govindraj
2012-02-20 12:35 ` Cousson, Benoit
2012-02-20 12:35 ` Cousson, Benoit
2012-02-21 22:02 ` Paul Walmsley
2012-02-21 22:02 ` Paul Walmsley
2012-02-24 14:35 ` Cousson, Benoit
2012-02-24 14:35 ` Cousson, Benoit
2012-02-28 17:13 ` Paul Walmsley
2012-02-28 17:13 ` Paul Walmsley
2012-02-28 17:22 ` Cousson, Benoit [this message]
2012-02-28 17:22 ` [PATCH] tty: serial: OMAP: Fix oops due to NULL pdata in DT boot Cousson, Benoit
2012-02-28 17:28 ` Greg KH
2012-02-28 17:28 ` Greg KH
2012-02-28 18:23 ` Kevin Hilman
2012-02-28 18:23 ` Kevin Hilman
2012-01-26 2:50 ` [PATCH v2 3/3] tty: serial: omap-serial: wakeup latency constraint is in microseconds, not milliseconds Paul Walmsley
2012-01-26 2:50 ` Paul Walmsley
2012-01-27 7:19 ` Govindraj
2012-01-27 7:19 ` Govindraj
2012-01-30 19:13 ` [PATCH v2 0/3] tty: serial: OMAP: work around broken IP block, driver Kevin Hilman
2012-01-30 19:13 ` Kevin Hilman
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=4F4D0D44.3010604@ti.com \
--to=b-cousson@ti.com \
--cc=alan@linux.intel.com \
--cc=govindraj.raja@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=khilman@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=paul@pwsan.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.