All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Jarzmik <robert.jarzmik@free.fr>
To: Mike Dunn <mikedunn@newsguy.com>
Cc: linux-arm-kernel@lists.infradead.org, linux-pwm@vger.kernel.org,
	Thierry Reding <thierry.reding@avionic-design.de>,
	H Hartley Sweeten <hartleys@visionengravers.com>,
	Haojian Zhuang <haojian.zhuang@gmail.com>,
	Chao Xie <chao.xie@marvell.com>,
	Eric Miao <eric.y.miao@gmail.com>, Marek Vasut <marex@denx.de>
Subject: Re: [PATCH] ARM: pxa: make pwm driver module_platform_driver
Date: Thu, 08 Aug 2013 22:38:17 +0200	[thread overview]
Message-ID: <87fvuj2a12.fsf@free.fr> (raw)
In-Reply-To: <1375981237-7167-1-git-send-email-mikedunn@newsguy.com> (Mike Dunn's message of "Thu, 8 Aug 2013 10:00:37 -0700")

Mike Dunn <mikedunn@newsguy.com> writes:

> Commit 76abbdde2d95a3807d0dc6bf9f84d03d0dbd4f3d
>
>     pwm: Add sysfs interface
>
> causes a kernel oops due to a null pointer dereference on pxa platforms.  This
> happens because the class added by the patch is registered in a subsys_initcall
> (initcall4), but the pxa pwm driver is registered in arch_initcall (initcall3).
> If the class is not registered before the driver probe function runs, the oops
> occurs in device_add() when the uninitialized pointers in struct class are
> dereferenced.  I don't see a reason that the driver must be an arch_initcall, so
> this patch makes it a regular module_platform_driver (initcall6), preventing the
> oops.

That makes sense.
The only users I'm aware of for PWM on pxa is backlight, and that can certainly
wait for regular driver initcall level. I'm not aware of any usage in early boot
stages.

Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>

-- 
Robert

WARNING: multiple messages have this Message-ID (diff)
From: robert.jarzmik@free.fr (Robert Jarzmik)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: pxa: make pwm driver module_platform_driver
Date: Thu, 08 Aug 2013 22:38:17 +0200	[thread overview]
Message-ID: <87fvuj2a12.fsf@free.fr> (raw)
In-Reply-To: <1375981237-7167-1-git-send-email-mikedunn@newsguy.com> (Mike Dunn's message of "Thu, 8 Aug 2013 10:00:37 -0700")

Mike Dunn <mikedunn@newsguy.com> writes:

> Commit 76abbdde2d95a3807d0dc6bf9f84d03d0dbd4f3d
>
>     pwm: Add sysfs interface
>
> causes a kernel oops due to a null pointer dereference on pxa platforms.  This
> happens because the class added by the patch is registered in a subsys_initcall
> (initcall4), but the pxa pwm driver is registered in arch_initcall (initcall3).
> If the class is not registered before the driver probe function runs, the oops
> occurs in device_add() when the uninitialized pointers in struct class are
> dereferenced.  I don't see a reason that the driver must be an arch_initcall, so
> this patch makes it a regular module_platform_driver (initcall6), preventing the
> oops.

That makes sense.
The only users I'm aware of for PWM on pxa is backlight, and that can certainly
wait for regular driver initcall level. I'm not aware of any usage in early boot
stages.

Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>

-- 
Robert

  reply	other threads:[~2013-08-08 20:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-08 17:00 [PATCH] ARM: pxa: make pwm driver module_platform_driver Mike Dunn
2013-08-08 17:00 ` Mike Dunn
2013-08-08 20:38 ` Robert Jarzmik [this message]
2013-08-08 20:38   ` Robert Jarzmik
2013-08-09  7:22 ` Marek Vasut
2013-08-09  7:22   ` Marek Vasut

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=87fvuj2a12.fsf@free.fr \
    --to=robert.jarzmik@free.fr \
    --cc=chao.xie@marvell.com \
    --cc=eric.y.miao@gmail.com \
    --cc=haojian.zhuang@gmail.com \
    --cc=hartleys@visionengravers.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=mikedunn@newsguy.com \
    --cc=thierry.reding@avionic-design.de \
    /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.