* [PATCH] platform driver: Drop check for resource conflicts
@ 2012-10-10 9:44 Sascha Hauer
2012-10-10 10:57 ` Jean-Christophe PLAGNIOL-VILLARD
0 siblings, 1 reply; 3+ messages in thread
From: Sascha Hauer @ 2012-10-10 9:44 UTC (permalink / raw)
To: barebox
The check is wrong since it would have to check whether the
new iomem region overlaps with an existing region. Checking
for the base address only is not enough.
Currently this is not possible because every device conflicts
with the top iomem region which covers the whole address space.
This at least fixes the regression that devices whose memory region
begins at 0x0 can no longer be succesfully registered.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Alexander Shiyan <shc_work@mail.ru>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
drivers/base/platform.c | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 13b4620..ea4e37b 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -66,18 +66,6 @@ int platform_device_register(struct device_d *new_device)
{
new_device->bus = &platform_bus;
- if (new_device->resource) {
- struct device_d *dev;
-
- bus_for_each_device(new_device->bus, dev) {
- if (!dev->resource)
- continue;
- if (dev->resource->start == new_device->resource->start) {
- return -EBUSY;
- }
- }
- }
-
return register_device(new_device);
}
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] platform driver: Drop check for resource conflicts
2012-10-10 9:44 [PATCH] platform driver: Drop check for resource conflicts Sascha Hauer
@ 2012-10-10 10:57 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-10 16:48 ` Sascha Hauer
0 siblings, 1 reply; 3+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2012-10-10 10:57 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
On 11:44 Wed 10 Oct , Sascha Hauer wrote:
> The check is wrong since it would have to check whether the
> new iomem region overlaps with an existing region. Checking
> for the base address only is not enough.
> Currently this is not possible because every device conflicts
> with the top iomem region which covers the whole address space.
>
> This at least fixes the regression that devices whose memory region
> begins at 0x0 can no longer be succesfully registered.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Alexander Shiyan <shc_work@mail.ru>
> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> ---
> drivers/base/platform.c | 12 ------------
> 1 file changed, 12 deletions(-)
>
> diff --git a/drivers/base/platform.c b/drivers/base/platform.c
> index 13b4620..ea4e37b 100644
> --- a/drivers/base/platform.c
> +++ b/drivers/base/platform.c
> @@ -66,18 +66,6 @@ int platform_device_register(struct device_d *new_device)
> {
> new_device->bus = &platform_bus;
>
> - if (new_device->resource) {
> - struct device_d *dev;
> -
> - bus_for_each_device(new_device->bus, dev) {
> - if (!dev->resource)
> - continue;
> - if (dev->resource->start == new_device->resource->start) {
> - return -EBUSY;
> - }
> - }
> - }
> -
IIRC this break the dt probe no?
this break the arm and st hw atleast
Best Regards,
J.
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] platform driver: Drop check for resource conflicts
2012-10-10 10:57 ` Jean-Christophe PLAGNIOL-VILLARD
@ 2012-10-10 16:48 ` Sascha Hauer
0 siblings, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2012-10-10 16:48 UTC (permalink / raw)
To: Jean-Christophe PLAGNIOL-VILLARD; +Cc: barebox
On Wed, Oct 10, 2012 at 12:57:43PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 11:44 Wed 10 Oct , Sascha Hauer wrote:
> > The check is wrong since it would have to check whether the
> > new iomem region overlaps with an existing region. Checking
> > for the base address only is not enough.
> > Currently this is not possible because every device conflicts
> > with the top iomem region which covers the whole address space.
> >
> > This at least fixes the regression that devices whose memory region
> > begins at 0x0 can no longer be succesfully registered.
> >
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > Cc: Alexander Shiyan <shc_work@mail.ru>
> > Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > ---
> > drivers/base/platform.c | 12 ------------
> > 1 file changed, 12 deletions(-)
> >
> > diff --git a/drivers/base/platform.c b/drivers/base/platform.c
> > index 13b4620..ea4e37b 100644
> > --- a/drivers/base/platform.c
> > +++ b/drivers/base/platform.c
> > @@ -66,18 +66,6 @@ int platform_device_register(struct device_d *new_device)
> > {
> > new_device->bus = &platform_bus;
> >
> > - if (new_device->resource) {
> > - struct device_d *dev;
> > -
> > - bus_for_each_device(new_device->bus, dev) {
> > - if (!dev->resource)
> > - continue;
> > - if (dev->resource->start == new_device->resource->start) {
> > - return -EBUSY;
> > - }
> > - }
> > - }
> > -
> IIRC this break the dt probe no?
Why should it?
>
> this break the arm and st hw atleast
What breaks it? The check for conflicts or the removal of the check?
What breaks? I know no board which registers conflicting resources, so
the check never triggers.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-10-10 16:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-10 9:44 [PATCH] platform driver: Drop check for resource conflicts Sascha Hauer
2012-10-10 10:57 ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-10 16:48 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox