From: Thierry Reding <thierry.reding@avionic-design.de>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: David Airlie <airlied@linux.ie>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm: platform: Don't initialize driver-private data
Date: Wed, 31 Oct 2012 09:50:47 +0100 [thread overview]
Message-ID: <20121031085047.GE1835@avionic-0098.mockup.avionic-design.de> (raw)
In-Reply-To: <1397581.cKqVYz2Abn@avalon>
[-- Attachment #1: Type: text/plain, Size: 2045 bytes --]
On Wed, Oct 31, 2012 at 09:31:27AM +0100, Laurent Pinchart wrote:
> Hi Thierry,
>
> On Wednesday 31 October 2012 09:26:07 Thierry Reding wrote:
> > On Fri, Oct 26, 2012 at 04:06:27PM +0200, Laurent Pinchart wrote:
> > > On Monday 15 October 2012 20:03:42 Thierry Reding wrote:
> > > > Platform device drivers usually use the driver-private data for their
> > > > own purposes. Having it overwritten by drm_platform_init() is confusing
> > > > and error-prone.
> > >
> > > If you want to push drivers that way, you should get rid of the
> > > pci_set_drvdata() call in core DRM as well. This would push device driver
> > > data handling down to all drivers, so I'm not convinced it would actually
> > > make things simpler.
> >
> > I think the problem doesn't exist for PCI-based DRM drivers, so I didn't
> > look at it. The issue only arises once the DRM needs to glue together
> > multiple devices, as is usual with the drivers for embedded devices,
> > where the drivers are based on platform devices.
> >
> > I agree, though, that for consistency it would be nicer not to do this
> > for the PCI-based DRM drivers either. If David agrees I can take a look
> > at converting the other drivers along with the change to the DRM core.
> >
> > Pushing the handling of the driver-private data down to the drivers may
> > not make things easier, but at least it would be consistent with other
> > drivers. I didn't mention this in the patch description but it actually
> > took me a day to track down why the driver kept crashing until I figured
> > out that drm_platform_init() actually modified the pointer.
>
> So we either need your patch, or a documentation update :-)
>
> The patch itself is fine, I'll let others comment on the approach.
The patch already went in through David's tree, so I guess that says
much about his opinion on the matter. =) Still I think there's some
value in making this consistent across all drivers and if everybody
agrees I'll volunteer to write the patch.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
prev parent reply other threads:[~2012-10-31 8:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-15 18:03 [PATCH] drm: platform: Don't initialize driver-private data Thierry Reding
2012-10-26 14:06 ` Laurent Pinchart
2012-10-31 8:26 ` Thierry Reding
2012-10-31 8:31 ` Laurent Pinchart
2012-10-31 8:50 ` Thierry Reding [this message]
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=20121031085047.GE1835@avionic-0098.mockup.avionic-design.de \
--to=thierry.reding@avionic-design.de \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.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