From: Jon Hunter <jon-hunter@ti.com>
To: Jon Hunter <jon-hunter@ti.com>
Cc: Tony Lindgren <tony@atomide.com>,
linux-omap <linux-omap@vger.kernel.org>,
linux-arm <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] ARM: OMAP: Fix kernel panic in dmtimer probe
Date: Thu, 8 Nov 2012 19:13:59 -0600 [thread overview]
Message-ID: <509C58D7.2000301@ti.com> (raw)
In-Reply-To: <1352420243-31803-1-git-send-email-jon-hunter@ti.com>
On 11/08/2012 06:17 PM, Jon Hunter wrote:
> When booting with device-tree the kernel is panicing in the probe of the
> DMTIMER driver. The panic is caused because the pointer to platform_data
> structure is NULL when booting with device-tree and the driver is
> attempting to access the structure without checking if the pointer is
> valid.
>
> Fix this by moving the code that accesses the platform data structure
> under the "else" clause of the "if (dev->of_node)" statement because
> here the pointer to platform_data is guaranteed to be valid. The code
> accessing the "timer_capability" member of the platform data is simply
> removed as this is already handled under the else clause.
>
> This regression was introduced while integrating commit "ARM: OMAP: Add
> DT support for timer driver" to add device-tree support to the DMTIMER
> driver and commit "ARM: OMAP: Move omap-pm-noop.c local to mach-omap2"
> to prepare for single zImage support.
By the way, I meant to add ...
Reported-by: Tony Lindgren <tony@atomide.com>
Jon
> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> ---
> arch/arm/plat-omap/dmtimer.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c
> index 38c12ef..9dca23e 100644
> --- a/arch/arm/plat-omap/dmtimer.c
> +++ b/arch/arm/plat-omap/dmtimer.c
> @@ -799,12 +799,11 @@ static int __devinit omap_dm_timer_probe(struct platform_device *pdev)
> timer->id = pdev->id;
> timer->capability = pdata->timer_capability;
> timer->reserved = omap_dm_timer_reserved_systimer(timer->id);
> + timer->get_context_loss_count = pdata->get_context_loss_count;
> }
>
> timer->irq = irq->start;
> timer->pdev = pdev;
> - timer->capability = pdata->timer_capability;
> - timer->get_context_loss_count = pdata->get_context_loss_count;
>
> /* Skip pm_runtime_enable for OMAP1 */
> if (!(timer->capability & OMAP_TIMER_NEEDS_RESET)) {
>
next prev parent reply other threads:[~2012-11-09 1:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-09 0:17 [PATCH] ARM: OMAP: Fix kernel panic in dmtimer probe Jon Hunter
2012-11-09 1:13 ` Jon Hunter [this message]
2012-11-09 22:32 ` Tony Lindgren
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=509C58D7.2000301@ti.com \
--to=jon-hunter@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=tony@atomide.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 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).