From: mark.rutland@arm.com (Mark Rutland)
To: kernelnewbies@lists.kernelnewbies.org
Subject: [PATCH v3 0/4] SysFS driver for QEMU fw_cfg device
Date: Mon, 5 Oct 2015 14:05:17 +0100 [thread overview]
Message-ID: <20151005130516.GM19064@leverpostej> (raw)
In-Reply-To: <20151005124042.GF1977@HEDWIG.INI.CMU.EDU>
> > I'm not sure I follow what the difficulty with supporting DT in addition
> > to ACPI is? It looks like all you need is a compatible string and a reg
> > entry.
>
> Bearing in mind that I have almost no experience with arm:
>
> I started out by probing all possible port-io and mmio locations where
> fw_cfg registers might have been found, from a "classic" module_init
> method.
>
> Arm has DT, which as far as I understand will answer the following two
> questions: 1. Do I have fw_cfg ? 2. If yes, what address range does it use ?
> So that I could continue using a classic module_init, but won't need
> to probe for the device.
>
> PC (my primary architecture, the one I actually care about) does not
> have DT. If I want to share the same code, I can't probe, so if I try
> DT and don't find fw_cfg there (or somehow DT is no-op-ed out because
> I'm on a PC guest), I could somehow look it up in ACPI the same way
> (i.e., use ACPI as sort of a stand-in for DT).
I'd imagine that it's simple to have something in your probe path like:
if (pdev->dev.of_node)
parse_dt(pdev);
else
parse_acpi(pdev);
> But all ACPI-enabled drivers I could find use dedicated macros (i.e.
> no more classic module_init() and module_exit(), but rather
> module_acpi_driver() with .add and .remove methods on an acpi_driver
> object, etc.) Not sure how I'd glue DT back into something like that.
You don't have to use those macros, and can simply use the classic
module_{init,exit} functions, calling the requisite acpi driver
registration functions at module {init,exit} time.
> In addition, Michael's comment earlier in the thread suggests that
> even my current acpi version isn't sufficiently "orthodox" w.r.t.
> ACPI, and I should be providing the hardware access routine as
> an ACPI/AML routine, to avoid race conditions with the rest of ACPI,
> and for encapsulation. I.e. it's even rude to use the fw_cfg node's
> ACPI _CRS method (the part where I'd be treating it like a DT stand-in
> only to query fw_cfg's hardware specifics).
As Peter stated, this sounds very much like it rules out sharing the
interface with FW generally (and is certainly scary).
> So far, all the information I've been able to pull together points
> away from a dual DT + ACPI all-in-one solution for fw_cfg. If you know
> of an example where that's done in an acceptable way, please let
> me know so I can use it for inspiration...
I'm not immediately aware, but I would imagine you could search for
files that had both an of_match_table and a acpi_bus_register_driver
call.
Thanks,
Mark.
WARNING: multiple messages have this Message-ID (diff)
From: Mark Rutland <mark.rutland@arm.com>
To: "Gabriel L. Somlo" <somlo@cmu.edu>
Cc: gregkh@linuxfoundation.org, paul@pwsan.com, galak@codeaurora.org,
will.deacon@arm.com, agross@codeaurora.org, zajec5@gmail.com,
hanjun.guo@linaro.org, catalin.marinas@arm.com,
linux-api@vger.kernel.org, linux-kernel@vger.kernel.org,
kernelnewbies@kernelnewbies.org, matt.fleming@intel.com,
lersek@redhat.com, jordan.l.justen@intel.com, mst@redhat.com,
peter.maydell@linaro.org, leif.lindholm@linaro.org,
ard.biesheuvel@linaro.org, pbonzini@redhat.com,
kraxel@redhat.com, qemu-devel@nongnu.org
Subject: Re: [PATCH v3 0/4] SysFS driver for QEMU fw_cfg device
Date: Mon, 5 Oct 2015 14:05:17 +0100 [thread overview]
Message-ID: <20151005130516.GM19064@leverpostej> (raw)
In-Reply-To: <20151005124042.GF1977@HEDWIG.INI.CMU.EDU>
> > I'm not sure I follow what the difficulty with supporting DT in addition
> > to ACPI is? It looks like all you need is a compatible string and a reg
> > entry.
>
> Bearing in mind that I have almost no experience with arm:
>
> I started out by probing all possible port-io and mmio locations where
> fw_cfg registers might have been found, from a "classic" module_init
> method.
>
> Arm has DT, which as far as I understand will answer the following two
> questions: 1. Do I have fw_cfg ? 2. If yes, what address range does it use ?
> So that I could continue using a classic module_init, but won't need
> to probe for the device.
>
> PC (my primary architecture, the one I actually care about) does not
> have DT. If I want to share the same code, I can't probe, so if I try
> DT and don't find fw_cfg there (or somehow DT is no-op-ed out because
> I'm on a PC guest), I could somehow look it up in ACPI the same way
> (i.e., use ACPI as sort of a stand-in for DT).
I'd imagine that it's simple to have something in your probe path like:
if (pdev->dev.of_node)
parse_dt(pdev);
else
parse_acpi(pdev);
> But all ACPI-enabled drivers I could find use dedicated macros (i.e.
> no more classic module_init() and module_exit(), but rather
> module_acpi_driver() with .add and .remove methods on an acpi_driver
> object, etc.) Not sure how I'd glue DT back into something like that.
You don't have to use those macros, and can simply use the classic
module_{init,exit} functions, calling the requisite acpi driver
registration functions at module {init,exit} time.
> In addition, Michael's comment earlier in the thread suggests that
> even my current acpi version isn't sufficiently "orthodox" w.r.t.
> ACPI, and I should be providing the hardware access routine as
> an ACPI/AML routine, to avoid race conditions with the rest of ACPI,
> and for encapsulation. I.e. it's even rude to use the fw_cfg node's
> ACPI _CRS method (the part where I'd be treating it like a DT stand-in
> only to query fw_cfg's hardware specifics).
As Peter stated, this sounds very much like it rules out sharing the
interface with FW generally (and is certainly scary).
> So far, all the information I've been able to pull together points
> away from a dual DT + ACPI all-in-one solution for fw_cfg. If you know
> of an example where that's done in an acceptable way, please let
> me know so I can use it for inspiration...
I'm not immediately aware, but I would imagine you could search for
files that had both an of_match_table and a acpi_bus_register_driver
call.
Thanks,
Mark.
WARNING: multiple messages have this Message-ID (diff)
From: Mark Rutland <mark.rutland@arm.com>
To: "Gabriel L. Somlo" <somlo@cmu.edu>
Cc: peter.maydell@linaro.org, paul@pwsan.com, matt.fleming@intel.com,
catalin.marinas@arm.com, jordan.l.justen@intel.com,
kernelnewbies@kernelnewbies.org, gregkh@linuxfoundation.org,
zajec5@gmail.com, will.deacon@arm.com,
linux-kernel@vger.kernel.org, leif.lindholm@linaro.org,
qemu-devel@nongnu.org, ard.biesheuvel@linaro.org,
galak@codeaurora.org, mst@redhat.com, hanjun.guo@linaro.org,
agross@codeaurora.org, pbonzini@redhat.com,
linux-api@vger.kernel.org, lersek@redhat.com, kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3 0/4] SysFS driver for QEMU fw_cfg device
Date: Mon, 5 Oct 2015 14:05:17 +0100 [thread overview]
Message-ID: <20151005130516.GM19064@leverpostej> (raw)
In-Reply-To: <20151005124042.GF1977@HEDWIG.INI.CMU.EDU>
> > I'm not sure I follow what the difficulty with supporting DT in addition
> > to ACPI is? It looks like all you need is a compatible string and a reg
> > entry.
>
> Bearing in mind that I have almost no experience with arm:
>
> I started out by probing all possible port-io and mmio locations where
> fw_cfg registers might have been found, from a "classic" module_init
> method.
>
> Arm has DT, which as far as I understand will answer the following two
> questions: 1. Do I have fw_cfg ? 2. If yes, what address range does it use ?
> So that I could continue using a classic module_init, but won't need
> to probe for the device.
>
> PC (my primary architecture, the one I actually care about) does not
> have DT. If I want to share the same code, I can't probe, so if I try
> DT and don't find fw_cfg there (or somehow DT is no-op-ed out because
> I'm on a PC guest), I could somehow look it up in ACPI the same way
> (i.e., use ACPI as sort of a stand-in for DT).
I'd imagine that it's simple to have something in your probe path like:
if (pdev->dev.of_node)
parse_dt(pdev);
else
parse_acpi(pdev);
> But all ACPI-enabled drivers I could find use dedicated macros (i.e.
> no more classic module_init() and module_exit(), but rather
> module_acpi_driver() with .add and .remove methods on an acpi_driver
> object, etc.) Not sure how I'd glue DT back into something like that.
You don't have to use those macros, and can simply use the classic
module_{init,exit} functions, calling the requisite acpi driver
registration functions at module {init,exit} time.
> In addition, Michael's comment earlier in the thread suggests that
> even my current acpi version isn't sufficiently "orthodox" w.r.t.
> ACPI, and I should be providing the hardware access routine as
> an ACPI/AML routine, to avoid race conditions with the rest of ACPI,
> and for encapsulation. I.e. it's even rude to use the fw_cfg node's
> ACPI _CRS method (the part where I'd be treating it like a DT stand-in
> only to query fw_cfg's hardware specifics).
As Peter stated, this sounds very much like it rules out sharing the
interface with FW generally (and is certainly scary).
> So far, all the information I've been able to pull together points
> away from a dual DT + ACPI all-in-one solution for fw_cfg. If you know
> of an example where that's done in an acceptable way, please let
> me know so I can use it for inspiration...
I'm not immediately aware, but I would imagine you could search for
files that had both an of_match_table and a acpi_bus_register_driver
call.
Thanks,
Mark.
next prev parent reply other threads:[~2015-10-05 13:05 UTC|newest]
Thread overview: 100+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-03 23:28 [PATCH v3 0/4] SysFS driver for QEMU fw_cfg device Gabriel L. Somlo
2015-10-03 23:28 ` [Qemu-devel] " Gabriel L. Somlo
2015-10-03 23:28 ` Gabriel L. Somlo
2015-10-03 23:28 ` Gabriel L. Somlo
2015-10-03 23:28 ` [PATCH v3 1/4] firmware: introduce sysfs driver for QEMU's " Gabriel L. Somlo
2015-10-03 23:28 ` [Qemu-devel] " Gabriel L. Somlo
2015-10-03 23:28 ` Gabriel L. Somlo
2015-10-03 23:28 ` Gabriel L. Somlo
2015-10-04 1:34 ` kbuild test robot
2015-10-04 1:34 ` [Qemu-devel] " kbuild test robot
2015-10-04 1:34 ` kbuild test robot
2015-10-06 8:40 ` [Qemu-devel] " Stefan Hajnoczi
2015-10-06 8:40 ` Stefan Hajnoczi
2015-10-06 8:40 ` Stefan Hajnoczi
2015-10-06 12:53 ` Laszlo Ersek
2015-10-06 12:53 ` [Qemu-devel] " Laszlo Ersek
2015-10-06 12:53 ` Laszlo Ersek
2015-10-06 12:53 ` Laszlo Ersek
2015-10-06 17:54 ` Andy Lutomirski
2015-10-06 17:54 ` [Qemu-devel] " Andy Lutomirski
2015-10-06 17:54 ` Andy Lutomirski
2015-10-06 18:17 ` Gabriel L. Somlo
2015-10-06 18:17 ` [Qemu-devel] " Gabriel L. Somlo
2015-10-06 18:17 ` Gabriel L. Somlo
2015-10-06 18:17 ` Gabriel L. Somlo
2015-10-03 23:28 ` [PATCH v3 2/4] firmware: use acpi to detect QEMU fw_cfg device for sysfs fw_cfg driver Gabriel L. Somlo
2015-10-03 23:28 ` [Qemu-devel] " Gabriel L. Somlo
2015-10-03 23:28 ` Gabriel L. Somlo
2015-10-03 23:28 ` Gabriel L. Somlo
2015-10-04 7:54 ` Michael S. Tsirkin
2015-10-04 7:54 ` [Qemu-devel] " Michael S. Tsirkin
2015-10-04 7:54 ` Michael S. Tsirkin
2015-10-04 7:54 ` Michael S. Tsirkin
2015-10-04 20:24 ` Gabriel L. Somlo
2015-10-04 20:24 ` [Qemu-devel] " Gabriel L. Somlo
2015-10-04 20:24 ` Gabriel L. Somlo
2015-10-04 20:24 ` Gabriel L. Somlo
2015-10-04 20:27 ` Gabriel L. Somlo
2015-10-04 20:27 ` [Qemu-devel] " Gabriel L. Somlo
2015-10-04 20:27 ` Gabriel L. Somlo
2015-10-04 20:27 ` Gabriel L. Somlo
2015-10-03 23:28 ` [PATCH v3 3/4] kobject: export kset_find_obj() for module use Gabriel L. Somlo
2015-10-03 23:28 ` [Qemu-devel] " Gabriel L. Somlo
2015-10-03 23:28 ` Gabriel L. Somlo
2015-10-03 23:28 ` Gabriel L. Somlo
2015-10-03 23:28 ` [PATCH v3 4/4] firmware: create directory hierarchy for sysfs fw_cfg entries Gabriel L. Somlo
2015-10-03 23:28 ` [Qemu-devel] " Gabriel L. Somlo
2015-10-03 23:28 ` Gabriel L. Somlo
2015-10-03 23:28 ` Gabriel L. Somlo
2015-10-05 10:00 ` [PATCH v3 0/4] SysFS driver for QEMU fw_cfg device Mark Rutland
2015-10-05 10:00 ` [Qemu-devel] " Mark Rutland
2015-10-05 10:00 ` Mark Rutland
2015-10-05 10:00 ` Mark Rutland
2015-10-05 11:48 ` Paolo Bonzini
2015-10-05 11:48 ` [Qemu-devel] " Paolo Bonzini
2015-10-05 11:48 ` Paolo Bonzini
2015-10-05 11:48 ` Paolo Bonzini
2015-10-05 12:23 ` Mark Rutland
2015-10-05 12:23 ` [Qemu-devel] " Mark Rutland
2015-10-05 12:23 ` Mark Rutland
2015-10-05 12:23 ` Mark Rutland
2015-10-05 12:43 ` Gabriel L. Somlo
2015-10-05 12:43 ` [Qemu-devel] " Gabriel L. Somlo
2015-10-05 12:43 ` Gabriel L. Somlo
2015-10-05 12:43 ` Gabriel L. Somlo
2015-10-05 12:56 ` Mark Rutland
2015-10-05 12:56 ` [Qemu-devel] " Mark Rutland
2015-10-05 12:56 ` Mark Rutland
2015-10-05 12:56 ` Mark Rutland
2015-10-05 13:21 ` Gabriel L. Somlo
2015-10-05 13:21 ` [Qemu-devel] " Gabriel L. Somlo
2015-10-05 13:21 ` Gabriel L. Somlo
2015-10-05 13:21 ` Gabriel L. Somlo
2015-10-05 12:40 ` Gabriel L. Somlo
2015-10-05 12:40 ` [Qemu-devel] " Gabriel L. Somlo
2015-10-05 12:40 ` Gabriel L. Somlo
2015-10-05 12:40 ` Gabriel L. Somlo
2015-10-05 12:50 ` Peter Maydell
2015-10-05 12:50 ` [Qemu-devel] " Peter Maydell
2015-10-05 12:50 ` Peter Maydell
2015-10-05 12:50 ` Peter Maydell
2015-10-05 13:13 ` Gabriel L. Somlo
2015-10-05 13:13 ` [Qemu-devel] " Gabriel L. Somlo
2015-10-05 13:13 ` Gabriel L. Somlo
2015-10-05 13:13 ` Gabriel L. Somlo
2015-10-05 13:18 ` Paolo Bonzini
2015-10-05 13:18 ` [Qemu-devel] " Paolo Bonzini
2015-10-05 13:18 ` Paolo Bonzini
2015-10-05 13:18 ` Paolo Bonzini
2015-11-04 20:48 ` Gabriel L. Somlo
2015-11-04 20:48 ` [Qemu-devel] " Gabriel L. Somlo
2015-11-04 20:48 ` Gabriel L. Somlo
2015-11-04 20:48 ` Gabriel L. Somlo
2015-10-05 13:05 ` Mark Rutland [this message]
2015-10-05 13:05 ` [Qemu-devel] " Mark Rutland
2015-10-05 13:05 ` Mark Rutland
2015-10-06 7:18 ` Laszlo Ersek
2015-10-06 7:18 ` [Qemu-devel] " Laszlo Ersek
2015-10-06 7:18 ` Laszlo Ersek
2015-10-06 7:18 ` Laszlo Ersek
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=20151005130516.GM19064@leverpostej \
--to=mark.rutland@arm.com \
--cc=kernelnewbies@lists.kernelnewbies.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.