Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1565840 > unrolled thread

Re: How to ensure other module/driver is initialized?

Started byLinus Walleij <linus.walleij@linaro.org>
First post2017-01-24 14:10 +0100
Last post2017-01-26 16:00 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: How to ensure other module/driver is initialized? Linus Walleij <linus.walleij@linaro.org> - 2017-01-24 14:10 +0100
    Re: How to ensure other module/driver is initialized? Ian Pilcher <arequipeno@gmail.com> - 2017-01-24 17:50 +0100
      Re: How to ensure other module/driver is initialized? Linus Walleij <linus.walleij@linaro.org> - 2017-01-26 16:00 +0100

#1565840 — Re: How to ensure other module/driver is initialized?

FromLinus Walleij <linus.walleij@linaro.org>
Date2017-01-24 14:10 +0100
SubjectRe: How to ensure other module/driver is initialized?
Message-ID<t391g-4Ik-5@gated-at.bofh.it>
On Thu, Dec 15, 2016 at 8:50 PM, Ian Pilcher <arequipeno@gmail.com> wrote:

> I maintain an out-of-tree kernel module that enables the front-panel
> LEDs on the Thecus N5550 NAS.
>
>   https://github.com/ipilcher/n5550/blob/master/modules/n5550_board.c

Generally I'm not very happy about boardfiles and such stuff being
maintained out-of-tree.

Is there work ongoing to:

(A) work upstream with this stuff
(B) convert the whole platform to use device tree

Because that is what is needed for long-term maintenance.

The file you point to corresponds to just a few lines of device tree
code. c.f. my recent submission of Gemini patches:
http://marc.info/?l=linux-arm-kernel&m=148508801709983&w=2

I know it is a bit up upfront work, but hey, it's fun.

> The drive activity LEDs are connected to GPIO pins on the ICH10R, so
> the gpio_ich driver must be loaded and initialized before my module is
> loaded.  Unfortunately, the "and initialized" part is giving me trouble
> after a recent CentOS kernel update.
>
> My modprobe configuration includes:
>
>   install n5550_board /sbin/modprobe gpio_ich; /sbin/modprobe i2c_i801;
>       /sbin/modprobe --ignore-install n5550_board
>
> But although the gpio_ich module does get loaded, it apparently hasn't
> finished initializing when my module is loaded.  The result looks like
> this:

I have no idea how modprobe works, but a SoC GPIO driver is often
such a critical component of a system (often provididing an irqchip
as well) that their Kconfig should be made bool and set to 'y' in the
config so it is compiled-in to the kernel.

Then any dependent modules can happily utilize it.

If this doesn't work, it should make use of deferred probe I guess?

Yours,
Linus Walleij

[toc] | [next] | [standalone]


#1565999

FromIan Pilcher <arequipeno@gmail.com>
Date2017-01-24 17:50 +0100
Message-ID<t3cs9-6Gn-17@gated-at.bofh.it>
In reply to#1565840
On 01/24/2017 07:02 AM, Linus Walleij wrote:
> On Thu, Dec 15, 2016 at 8:50 PM, Ian Pilcher <arequipeno@gmail.com> wrote:
>
>> I maintain an out-of-tree kernel module that enables the front-panel
>> LEDs on the Thecus N5550 NAS.
>>
>>   https://github.com/ipilcher/n5550/blob/master/modules/n5550_board.c
>
> Generally I'm not very happy about boardfiles and such stuff being
> maintained out-of-tree.
>
> Is there work ongoing to:
>
> (A) work upstream with this stuff
> (B) convert the whole platform to use device tree
>
> Because that is what is needed for long-term maintenance.

In general, I completely agree with you.  In this case, however, I
don't think that moving the module upstream and/or converting to device
tree is realistic.

I say this because the purpose of my module is to enable the LEDs and
GPIOs in the Thecus N5550 NAS for "generic" x86_64 distributions --
CentOS, Fedora, Debian, Ubuntu, etc.  It has nothing to do with the
Linux-based "firmware" provided by Thecus.  To the best of my knowledge,
the worldwide number of users of this module is in the single digits.

So even if the module were to be accepted upstream (which I tend to
doubt), it's extremely unlikely that any of the aforementioned
distributions would include it in their kernel configuration.

Device tree presents even greater problems.  It's not clear to me that
device tree even works with x86_64, and even if it does, I'm almost
positive that none of the "generic" distributions are going to support
it.

If my understanding of device tree is inaccurate, please do let me
know.  I'd definitely like to replace the "board" module with a
device tree description if it's possible.

Thanks!

-- 
========================================================================
Ian Pilcher                                         arequipeno@gmail.com
-------- "I grew up before Mark Zuckerberg invented friendship" --------
========================================================================

[toc] | [prev] | [next] | [standalone]


#1567488

FromLinus Walleij <linus.walleij@linaro.org>
Date2017-01-26 16:00 +0100
Message-ID<t3TGO-cu-19@gated-at.bofh.it>
In reply to#1565999
On Tue, Jan 24, 2017 at 5:40 PM, Ian Pilcher <arequipeno@gmail.com> wrote:

> Device tree presents even greater problems.  It's not clear to me that
> device tree even works with x86_64, and even if it does, I'm almost
> positive that none of the "generic" distributions are going to support
> it.
>
> If my understanding of device tree is inaccurate, please do let me
> know.  I'd definitely like to replace the "board" module with a
> device tree description if it's possible.

Sorry for my ignorance. I thought this was some ARM or MIPS thing.

It should indeed come in as a board file for x86 systems,
unless they have ACPI to do what DT does on other platforms,
which modern systems do.

The way on these systems is to put a file in
drivers/platform/x86/* I think, but I know too little about
x86 for that.

I do think it'll be accepted upstream nevertheless, we do not
really count users but rather check whether the code is nice
and maintainable.

Yours,
Linus Walleij

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web