public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Vincent Chen <vincent.chen@sifive.com>, Anup Patel <anup@brainfault.org>
Cc: paul.walmsley@sifive.com, palmer@dabbelt.com,
	aou@eecs.berkeley.edu, linux-kernel@vger.kernel.org,
	linux-riscv@lists.infradead.org
Subject: Re: [PATCH] irqchip: let the probe of APLIC be earlier than IMSIC
Date: Mon, 05 Aug 2024 10:08:26 +0200	[thread overview]
Message-ID: <87sevj5r45.ffs@tglx> (raw)
In-Reply-To: <CABvJ_xgcbyQKa1+U1MC7cLEB-SUzzNaWqKdXFp+13mni0YSvNw@mail.gmail.com>

On Mon, Aug 05 2024 at 10:43, Vincent Chen wrote:
> On Fri, Aug 2, 2024 at 7:03 PM Anup Patel <anup@brainfault.org> wrote:
>> Secondly, changing compilation order in Makefile to influence
>> the probe order will not help in any way.
>>
> I was confused here. If possible, hope you can help me clarify it.
> The following is the backtrace of really_porbe() dumped by GDB.
> #0  0xffffffff8092318a in really_probe ()
> #1  0xffffffff80923516 in __driver_probe_device.part.0 ()
> #2  0xffffffff8057c856 in driver_probe_device ()
> #3  0xffffffff8057c9ba in __driver_attach ()
> #4  0xffffffff8057aaa4 in bus_for_each_dev ()
> #5  0xffffffff8057c3ea in driver_attach ()
> #6  0xffffffff8057bc4a in bus_add_driver ()
> #7  0xffffffff8057d75a in driver_register ()
> #8  0xffffffff8057e83c in __platform_driver_register ()
> #9  0xffffffff80a2455e in imsic_platform_driver_init ()
> #10 0xffffffff8000212c in do_one_initcall ()
> #11 0xffffffff80a01188 in kernel_init_freeable ()
> #12 0xffffffff80928d80 in kernel_init ()
>
> According to this result, the source to call really_probe is
> do_one_initcall(), regardless of whether it is APLIC or IMSIC. The
> do_one_initcall() function follows the placed order of the
> initialization functions in the __initcall6 section to invoke them.
> The compile order determines the order of the __initcall6 section.
> Therefore, I try to adjust the compile order to influence the probe
> order between IMSIC and APLIC. Do I misunderstand something?

There is no guarantee that this order is retained. The linker can freely
reorg the section. That's why we have deferred probing. It's neither a
bug nor a problem, so what are you trying to solve?

Thanks,

        tglx

  reply	other threads:[~2024-08-05  8:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-02  7:57 [PATCH] irqchip: let the probe of APLIC be earlier than IMSIC Vincent Chen
2024-08-02 10:55 ` Thomas Gleixner
2024-08-02 11:02 ` Anup Patel
2024-08-05  2:43   ` Vincent Chen
2024-08-05  8:08     ` Thomas Gleixner [this message]
2024-08-06  1:56       ` Vincent Chen
2024-08-06  3:14         ` Jessica Clarke

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=87sevj5r45.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=anup@brainfault.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=vincent.chen@sifive.com \
    /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