From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC 3/3] drm/exynos: use pending_components for components tracking
Date: Thu, 17 Apr 2014 23:04:12 +0100 [thread overview]
Message-ID: <20140417220412.GZ24070@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <1397734130-21019-4-git-send-email-a.hajda@samsung.com>
On Thu, Apr 17, 2014 at 01:28:50PM +0200, Andrzej Hajda wrote:
> +static int exynos_drm_add_blocker(struct device *dev, void *data)
> +{
> + struct device_driver *drv = data;
> +
> + if (!platform_bus_type.match(dev, drv))
> + return 0;
> +
> + device_lock(dev);
> + if (!dev->driver)
> + exynos_drm_dev_busy(dev);
> + device_unlock(dev);
> +
> + return 0;
> +}
> +
> +static void exynos_drm_init_blockers(struct device_driver *drv)
> +{
> + bus_for_each_dev(&platform_bus_type, NULL, drv, exynos_drm_add_blocker);
> +}
This feels very wrong to be dumping the above code into every driver which
wants to make use of some kind of componentised support.
You also appear to need to know the struct device_driver's for every
component. While that may work for exynos, it doesn't work elsewhere
where the various components of the system are very real separate
kernel modules - for example, a separate I2C driver such as the TDA998x
case I mentioned in my first reply.
I can't see how your solution would be usable in that circumstance.
The third issue I have is that you're still needing to have internal
exynos sub-device management - you're having to add the individual
devices to some kind of list, array or static data, and during DRM
probe you're having to then walk these lists/arrays/static data to
locate these sub-devices and finish each of their individual
initialisations. So you're ending up with a two-tier initialisation.
That's not particularly good because it means you're exposed to
problems where the state is different between two initialisations -
when the device is recreated, your component attempts to re-finalise
the initialisation a second time. It wouldn't take much for a field
to be assumed to be zero at init time somewhere for a bug to creep
in.
--
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.
next prev parent reply other threads:[~2014-04-17 22:04 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-17 11:28 [PATCH RFC 0/3] drm/exynos: refactoring drm initialization/cleanup code Andrzej Hajda
2014-04-17 11:28 ` [PATCH RFC 1/3] drm/exynos: refactor drm drivers registration code Andrzej Hajda
2014-04-17 11:28 ` [PATCH RFC 2/3] drivers/base: provide lightweight framework for componentized devices Andrzej Hajda
2014-04-17 11:28 ` [PATCH RFC 3/3] drm/exynos: use pending_components for components tracking Andrzej Hajda
2014-04-17 21:47 ` Russell King - ARM Linux
2014-04-18 11:27 ` Andrzej Hajda
2014-04-18 12:42 ` Russell King - ARM Linux
2014-04-22 8:43 ` Andrzej Hajda
2014-04-17 22:04 ` Russell King - ARM Linux [this message]
2014-04-18 12:02 ` Andrzej Hajda
2014-04-18 12:46 ` Russell King - ARM Linux
2014-04-22 11:29 ` Andrzej Hajda
2014-04-22 11:51 ` Russell King - ARM Linux
2014-04-23 15:04 ` Andrzej Hajda
2014-04-23 16:43 ` Russell King - ARM Linux
2014-04-23 17:13 ` Russell King - ARM Linux
2014-04-25 14:36 ` Andrzej Hajda
2014-04-26 15:30 ` Russell King - ARM Linux
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=20140417220412.GZ24070@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).