linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean Delvare <jdelvare-l3A5Bk7waGM@public.gmane.org>
To: "Ivan.khoronzhuk"
	<ivan.khoronzhuk-hExfYMNmJl/Cnp4W7fqMDg@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	mikew-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	dmidecode-devel-qX2TKyscuCcdnm+yROfE0A@public.gmane.org,
	leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	msalter-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	roy.franz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org
Subject: Re: [Patch 2/3] firmware: dmi_scan: add SBMIOS entry and DMI tables
Date: Fri, 17 Apr 2015 15:02:24 +0200	[thread overview]
Message-ID: <20150417150224.50202bcb@endymion.delvare> (raw)
In-Reply-To: <552FF0E4.709-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On Thu, 16 Apr 2015 20:27:00 +0300, subscivan wrote:
> On 16.04.15 18:44, Jean Delvare wrote:
> > Le Thursday 16 April 2015 à 15:56 +0300, Ivan.khoronzhuk a écrit :
> >> We cannot be sure that firmware_kobj created at time of dmi_init().
> >> The sources don't oblige you to call it at core level,
> >> for instance like it was done for arm64. For x86, dmi_init() can be called
> >> before firmware_kobj is created.
> > Looking at the code, it seems that firmware_kobj is created very, very
> > early in the boot process. In do_basic_setup(), you can see that
> > driver_init() (which in turn calls firmware_init(), creating
> > firmware_kobj) is called before do_initcalls(). So firmware_kobj must be
> > defined before dmi_scan_machine() or dmi_init() is called.
> 
> No. Not must, rather should. See below.
> 
> > Oh, and this wasn't even my point ;-) I'm fine with you checking if
> > firmware_kobj is defined. My question was about the dmi_available check
> > above. But that question was silly anyway, sorry. I confused
> > dmi_available with dmi_initialized. Checking for dmi_available is
> > perfectly reasonable, please scratch my objection.
> >
> >> And if I call it from dmi_init() I suppose
> >> I would face an error. As I can't call it in dmi_init I can't be sure that
> >> DMI is available at all. So, no, we have to check dmi_available here and
> >> call it at subsys layer, where it's supposed to be.
> > I can't parse that, I suspect you wrote dmi_init where you actually
> > meant dmi_scan_machine? Given how early firmware_kobj is created, I
> > think the code currently in dmi_init could in fact go at the end of
> > dmi_scan_machine.
> 
> Actually, dmi_scan_machine can be called even earlier.
> As I've sad, for x86, it's called before firmware_kobj is created.
> 
> kernel_start()
>      setup_arch()
>          dmi_scan_machine()
> 
> And for firmware_init(), as you noticed already:
> 
> start_kernel()
>      rest_init()
>          kernel_init()
>              kernel_init_freeable()
>                  do_basic_setup()
>                      driver_init()
>                          firmware_init()
> 
> Pay attentions that setup_arch() is called much earlier than rest_init().
> So dmi_init couldn't in fact go at the end of dmi_scan_machine.

Yeah, you're right, sorry. Somehow I thought that setup_arch was an
arch_initcall, but it is not, so I got the order all wrong.

-- 
Jean Delvare
SUSE L3 Support

  parent reply	other threads:[~2015-04-17 13:02 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-02 12:57 [Patch 0/3] firmware: dmi_scan: add SBMIOS entry point and DMI tables Ivan Khoronzhuk
     [not found] ` <1427979423-22767-1-git-send-email-ivan.khoronzhuk-hExfYMNmJl/Cnp4W7fqMDg@public.gmane.org>
2015-04-02 12:57   ` [Patch 1/3] firmware: dmi_scan: rename dmi_table to dmi_decode_table Ivan Khoronzhuk
2015-04-15 11:51     ` Jean Delvare
     [not found]     ` <1427979423-22767-2-git-send-email-ivan.khoronzhuk-hExfYMNmJl/Cnp4W7fqMDg@public.gmane.org>
2015-04-15 14:35       ` Matt Fleming
     [not found]         ` <20150415143530.GF4804-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2015-04-16  8:35           ` Jean Delvare
2015-04-16 20:16             ` Ivan.khoronzhuk
2015-04-17  8:54               ` Jean Delvare
2015-04-17 10:11                 ` Ivan.khoronzhuk
2015-04-17 12:04                   ` Ivan.khoronzhuk
     [not found]                     ` <5530F6C7.6060306-hExfYMNmJl/Cnp4W7fqMDg@public.gmane.org>
2015-04-17 12:50                       ` Jean Delvare
2015-04-17 13:40             ` Matt Fleming
2015-04-17 14:12               ` [dmidecode] " Jean Delvare
2015-04-02 12:57   ` [Patch 2/3] firmware: dmi_scan: add SBMIOS entry and DMI tables Ivan Khoronzhuk
2015-04-03  9:36     ` Ivan.khoronzhuk
     [not found]       ` <551E5F0B.6050709-hExfYMNmJl/Cnp4W7fqMDg@public.gmane.org>
2015-04-15  4:19         ` Roy Franz
     [not found]           ` <CAFECyb_BGU82vCi0jOz+MbdsxRS-jFoHNsZe5KdOCgpt0K7y+A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-16  0:54             ` Roy Franz
     [not found]               ` <CAFECyb9RFAEWMOFCDcKKYBgQk85HoDiG2yfyou6X9qm=Wq5+Pg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-16  6:48                 ` Jean Delvare
2015-04-16 17:08                   ` Roy Franz
2015-04-16  9:52     ` Jean Delvare
     [not found]       ` <20150416115252.7dc964a3-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2015-04-16 12:56         ` Ivan.khoronzhuk
2015-04-16 15:44           ` [dmidecode] " Jean Delvare
2015-04-16 17:27             ` subscivan
     [not found]               ` <552FF0E4.709-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-04-16 17:32                 ` Ivan.khoronzhuk
2015-04-17 13:02                 ` Jean Delvare [this message]
2015-04-02 12:57   ` [Patch 3/3] Documentation: ABI: sysfs-firmware-dmi: add -entries suffix to file name Ivan Khoronzhuk
2015-04-15 11:52     ` Jean Delvare

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=20150417150224.50202bcb@endymion.delvare \
    --to=jdelvare-l3a5bk7wagm@public.gmane.org \
    --cc=ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=dmidecode-devel-qX2TKyscuCcdnm+yROfE0A@public.gmane.org \
    --cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=ivan.khoronzhuk-hExfYMNmJl/Cnp4W7fqMDg@public.gmane.org \
    --cc=leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=mikew-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=msalter-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=roy.franz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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).