mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Patch "syscon: Decrease driver registration priority" breaks clps711x target
@ 2016-07-13  7:37 Alexander Shiyan
  2016-07-13 13:04 ` Sascha Hauer
  0 siblings, 1 reply; 7+ messages in thread
From: Alexander Shiyan @ 2016-07-13  7:37 UTC (permalink / raw)
  To: barebox

Hello All.

Patch "syscon: Decrease driver registration priority" breaks clps711x target.
Previously, the syscon device initialized at "core_initcall", that did not cause problems.
Now the device is initialized at "device_initcall" level, but clps711x uses syscon for
the serial, so serial device initialized at "console_initcall" level.
Any ideas?

Thanks.
---
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Patch "syscon: Decrease driver registration priority" breaks clps711x target
  2016-07-13  7:37 Patch "syscon: Decrease driver registration priority" breaks clps711x target Alexander Shiyan
@ 2016-07-13 13:04 ` Sascha Hauer
  2016-07-13 15:52   ` Andrey Smirnov
  0 siblings, 1 reply; 7+ messages in thread
From: Sascha Hauer @ 2016-07-13 13:04 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: barebox

On Wed, Jul 13, 2016 at 10:37:11AM +0300, Alexander Shiyan wrote:
> Hello All.
> 
> Patch "syscon: Decrease driver registration priority" breaks clps711x target.
> Previously, the syscon device initialized at "core_initcall", that did not cause problems.
> Now the device is initialized at "device_initcall" level, but clps711x uses syscon for
> the serial, so serial device initialized at "console_initcall" level.
> Any ideas?

We could move syscon back to core_initcall level and in the syscon
driver use dev_get_resource() instead of request_iomem_region().

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] 7+ messages in thread

* Re: Patch "syscon: Decrease driver registration priority" breaks clps711x target
  2016-07-13 13:04 ` Sascha Hauer
@ 2016-07-13 15:52   ` Andrey Smirnov
  2016-07-13 16:17     ` Alexander Shiyan
  2016-07-13 17:57     ` Trent Piepho
  0 siblings, 2 replies; 7+ messages in thread
From: Andrey Smirnov @ 2016-07-13 15:52 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On Wed, Jul 13, 2016 at 6:04 AM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> On Wed, Jul 13, 2016 at 10:37:11AM +0300, Alexander Shiyan wrote:
>> Hello All.
>>
>> Patch "syscon: Decrease driver registration priority" breaks clps711x target.
>> Previously, the syscon device initialized at "core_initcall", that did not cause problems.
>> Now the device is initialized at "device_initcall" level, but clps711x uses syscon for
>> the serial, so serial device initialized at "console_initcall" level.
>> Any ideas?
>
> We could move syscon back to core_initcall level and in the syscon
> driver use dev_get_resource() instead of request_iomem_region().

Right now the driver uses both, so if we just drop the call to
request_iomem_region that was problematic for me on i.MX6, that should
resolve the issue. I think this would also bring the behavior of
syscon driver closer to what it does in Linux kernel land. The only
negative effect of that change I think would be that on the platforms
where syscon driver controls that region of memory, it no longer would
be reported as such by "iomem".

Apologies for breaking your use-case, Alexander.

Andrey

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Patch "syscon: Decrease driver registration priority" breaks clps711x target
  2016-07-13 15:52   ` Andrey Smirnov
@ 2016-07-13 16:17     ` Alexander Shiyan
  2016-07-13 17:12       ` Andrey Smirnov
  2016-07-13 17:57     ` Trent Piepho
  1 sibling, 1 reply; 7+ messages in thread
From: Alexander Shiyan @ 2016-07-13 16:17 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: barebox

>Среда, 13 июля 2016, 18:52 +03:00 от Andrey Smirnov <andrew.smirnov@gmail.com>:
>
>On Wed, Jul 13, 2016 at 6:04 AM, Sascha Hauer < s.hauer@pengutronix.de > wrote:
>> On Wed, Jul 13, 2016 at 10:37:11AM +0300, Alexander Shiyan wrote:
>>> Hello All.
>>>
>>> Patch "syscon: Decrease driver registration priority" breaks clps711x target.
>>> Previously, the syscon device initialized at "core_initcall", that did not cause problems.
>>> Now the device is initialized at "device_initcall" level, but clps711x uses syscon for
>>> the serial, so serial device initialized at "console_initcall" level.
>>> Any ideas?
>>
>> We could move syscon back to core_initcall level and in the syscon
>> driver use dev_get_resource() instead of request_iomem_region().
>
>Right now the driver uses both, so if we just drop the call to
>request_iomem_region that was problematic for me on i.MX6, that should
>resolve the issue. I think this would also bring the behavior of
>syscon driver closer to what it does in Linux kernel land. The only
>negative effect of that change I think would be that on the platforms
>where syscon driver controls that region of memory, it no longer would
>be reported as such by "iomem".
>
>Apologies for breaking your use-case, Alexander.

Andrey? Can you revert this and resend it in another way?

---

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Patch "syscon: Decrease driver registration priority" breaks clps711x target
  2016-07-13 16:17     ` Alexander Shiyan
@ 2016-07-13 17:12       ` Andrey Smirnov
  0 siblings, 0 replies; 7+ messages in thread
From: Andrey Smirnov @ 2016-07-13 17:12 UTC (permalink / raw)
  To: Alexander Shiyan; +Cc: barebox

On Wed, Jul 13, 2016 at 9:17 AM, Alexander Shiyan <shc_work@mail.ru> wrote:
>>Среда, 13 июля 2016, 18:52 +03:00 от Andrey Smirnov <andrew.smirnov@gmail.com>:
>>
>>On Wed, Jul 13, 2016 at 6:04 AM, Sascha Hauer < s.hauer@pengutronix.de > wrote:
>>> On Wed, Jul 13, 2016 at 10:37:11AM +0300, Alexander Shiyan wrote:
>>>> Hello All.
>>>>
>>>> Patch "syscon: Decrease driver registration priority" breaks clps711x target.
>>>> Previously, the syscon device initialized at "core_initcall", that did not cause problems.
>>>> Now the device is initialized at "device_initcall" level, but clps711x uses syscon for
>>>> the serial, so serial device initialized at "console_initcall" level.
>>>> Any ideas?
>>>
>>> We could move syscon back to core_initcall level and in the syscon
>>> driver use dev_get_resource() instead of request_iomem_region().
>>
>>Right now the driver uses both, so if we just drop the call to
>>request_iomem_region that was problematic for me on i.MX6, that should
>>resolve the issue. I think this would also bring the behavior of
>>syscon driver closer to what it does in Linux kernel land. The only
>>negative effect of that change I think would be that on the platforms
>>where syscon driver controls that region of memory, it no longer would
>>be reported as such by "iomem".
>>
>>Apologies for breaking your use-case, Alexander.
>
> Andrey? Can you revert this and resend it in another way?

Sure, I can. Can't promise to do it before the end of the week though.

Thanks,
Andrey

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Patch "syscon: Decrease driver registration priority" breaks clps711x target
  2016-07-13 15:52   ` Andrey Smirnov
  2016-07-13 16:17     ` Alexander Shiyan
@ 2016-07-13 17:57     ` Trent Piepho
  2016-07-13 21:35       ` Andrey Smirnov
  1 sibling, 1 reply; 7+ messages in thread
From: Trent Piepho @ 2016-07-13 17:57 UTC (permalink / raw)
  To: Andrey Smirnov; +Cc: barebox

On Wed, 2016-07-13 at 08:52 -0700, Andrey Smirnov wrote:
> On Wed, Jul 13, 2016 at 6:04 AM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> > On Wed, Jul 13, 2016 at 10:37:11AM +0300, Alexander Shiyan wrote:
> >> Hello All.
> >>
> >> Patch "syscon: Decrease driver registration priority" breaks clps711x target.
> >> Previously, the syscon device initialized at "core_initcall", that did not cause problems.
> >> Now the device is initialized at "device_initcall" level, but clps711x uses syscon for
> >> the serial, so serial device initialized at "console_initcall" level.
> >> Any ideas?
> >
> > We could move syscon back to core_initcall level and in the syscon
> > driver use dev_get_resource() instead of request_iomem_region().
> 
> Right now the driver uses both, so if we just drop the call to
> request_iomem_region that was problematic for me on i.MX6, that should
> resolve the issue. I think this would also bring the behavior of
> syscon driver closer to what it does in Linux kernel land. The only
> negative effect of that change I think would be that on the platforms
> where syscon driver controls that region of memory, it no longer would
> be reported as such by "iomem".
> 

Syscon driver is a little strange in Linux since commit bdb0066.  The
driver no longer as an OF match and doesn't bind to syscon devices
listed in the device tree.  When something wants to use a syscon it
calls syscon_regmap_lookup_by_compatible(), which finds the OF node,
maps the registers, and puts it in a driver global list.  Anything that
maps the same syscon will get the same regmap that via the list.  But
the regmap is never associated with the syscon device!

So syscon doesn't use the driver/device model anymore.  It's more like a
global table of regmaps that are indexed using a OF node.
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Patch "syscon: Decrease driver registration priority" breaks clps711x target
  2016-07-13 17:57     ` Trent Piepho
@ 2016-07-13 21:35       ` Andrey Smirnov
  0 siblings, 0 replies; 7+ messages in thread
From: Andrey Smirnov @ 2016-07-13 21:35 UTC (permalink / raw)
  To: Trent Piepho; +Cc: barebox

On Wed, Jul 13, 2016 at 10:57 AM, Trent Piepho <tpiepho@kymetacorp.com> wrote:
> On Wed, 2016-07-13 at 08:52 -0700, Andrey Smirnov wrote:
>> On Wed, Jul 13, 2016 at 6:04 AM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
>> > On Wed, Jul 13, 2016 at 10:37:11AM +0300, Alexander Shiyan wrote:
>> >> Hello All.
>> >>
>> >> Patch "syscon: Decrease driver registration priority" breaks clps711x target.
>> >> Previously, the syscon device initialized at "core_initcall", that did not cause problems.
>> >> Now the device is initialized at "device_initcall" level, but clps711x uses syscon for
>> >> the serial, so serial device initialized at "console_initcall" level.
>> >> Any ideas?
>> >
>> > We could move syscon back to core_initcall level and in the syscon
>> > driver use dev_get_resource() instead of request_iomem_region().
>>
>> Right now the driver uses both, so if we just drop the call to
>> request_iomem_region that was problematic for me on i.MX6, that should
>> resolve the issue. I think this would also bring the behavior of
>> syscon driver closer to what it does in Linux kernel land. The only
>> negative effect of that change I think would be that on the platforms
>> where syscon driver controls that region of memory, it no longer would
>> be reported as such by "iomem".
>>
>
> Syscon driver is a little strange in Linux since commit bdb0066.  The
> driver no longer as an OF match and doesn't bind to syscon devices
> listed in the device tree.  When something wants to use a syscon it
> calls syscon_regmap_lookup_by_compatible(), which finds the OF node,
> maps the registers, and puts it in a driver global list.  Anything that
> maps the same syscon will get the same regmap that via the list.  But
> the regmap is never associated with the syscon device!
>
> So syscon doesn't use the driver/device model anymore.  It's more like a
> global table of regmaps that are indexed using a OF node.

Good to know, thanks for the info. When I was looking at that code
earlier I was looking at the stable 4.4 kernel, so my knowledge of it
is probably outdated. I'll take a look again when I get to work on the
patch.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-07-13 21:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-13  7:37 Patch "syscon: Decrease driver registration priority" breaks clps711x target Alexander Shiyan
2016-07-13 13:04 ` Sascha Hauer
2016-07-13 15:52   ` Andrey Smirnov
2016-07-13 16:17     ` Alexander Shiyan
2016-07-13 17:12       ` Andrey Smirnov
2016-07-13 17:57     ` Trent Piepho
2016-07-13 21:35       ` Andrey Smirnov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox