2015-07-28 09:44:25

by Graeme Gregory

[permalink] [raw]
Subject: [PATCH] virtio_mmio: add ACPI probing

Added the match table and pointers for ACPI probing to the driver.

This uses the same identifier for virt devices as being used for qemu
ARM64 ACPI support.

http://git.linaro.org/people/shannon.zhao/qemu.git/commit/d0bf1955a3ecbab4b51d46f8c5dda02b7e14a17e

Signed-off-by: Graeme Gregory <[email protected]>
---
drivers/virtio/virtio_mmio.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
index 10189b5..f499d9d 100644
--- a/drivers/virtio/virtio_mmio.c
+++ b/drivers/virtio/virtio_mmio.c
@@ -58,6 +58,7 @@

#define pr_fmt(fmt) "virtio-mmio: " fmt

+#include <linux/acpi.h>
#include <linux/highmem.h>
#include <linux/interrupt.h>
#include <linux/io.h>
@@ -732,12 +733,21 @@ static struct of_device_id virtio_mmio_match[] = {
};
MODULE_DEVICE_TABLE(of, virtio_mmio_match);

+#ifdef CONFIG_ACPI
+static const struct acpi_device_id virtio_mmio_acpi_match[] = {
+ { "LNRO0005", },
+ { }
+};
+MODULE_DEVICE_TABLE(acpi, virtio_mmio_acpi_match);
+#endif
+
static struct platform_driver virtio_mmio_driver = {
.probe = virtio_mmio_probe,
.remove = virtio_mmio_remove,
.driver = {
.name = "virtio-mmio",
.of_match_table = virtio_mmio_match,
+ .acpi_match_table = ACPI_PTR(virtio_mmio_acpi_match),
},
};

--
2.1.4


2015-07-28 10:09:05

by Michael S. Tsirkin

[permalink] [raw]
Subject: Re: [PATCH] virtio_mmio: add ACPI probing

On Tue, Jul 28, 2015 at 10:44:02AM +0100, Graeme Gregory wrote:
> Added the match table and pointers for ACPI probing to the driver.
>
> This uses the same identifier for virt devices as being used for qemu
> ARM64 ACPI support.
>
> http://git.linaro.org/people/shannon.zhao/qemu.git/commit/d0bf1955a3ecbab4b51d46f8c5dda02b7e14a17e
>
> Signed-off-by: Graeme Gregory <[email protected]>
> ---
> drivers/virtio/virtio_mmio.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
> index 10189b5..f499d9d 100644
> --- a/drivers/virtio/virtio_mmio.c
> +++ b/drivers/virtio/virtio_mmio.c
> @@ -58,6 +58,7 @@
>
> #define pr_fmt(fmt) "virtio-mmio: " fmt
>
> +#include <linux/acpi.h>
> #include <linux/highmem.h>
> #include <linux/interrupt.h>
> #include <linux/io.h>
> @@ -732,12 +733,21 @@ static struct of_device_id virtio_mmio_match[] = {
> };
> MODULE_DEVICE_TABLE(of, virtio_mmio_match);
>
> +#ifdef CONFIG_ACPI
> +static const struct acpi_device_id virtio_mmio_acpi_match[] = {
> + { "LNRO0005", },
> + { }
> +};

Hmm - we have reserved QEMUXXXX in ASWG explicitly for this purpose.

Pater - do you think it's a good idea to change this before QEMU 2.4
is released?

> +MODULE_DEVICE_TABLE(acpi, virtio_mmio_acpi_match);
> +#endif
> +
> static struct platform_driver virtio_mmio_driver = {
> .probe = virtio_mmio_probe,
> .remove = virtio_mmio_remove,
> .driver = {
> .name = "virtio-mmio",
> .of_match_table = virtio_mmio_match,
> + .acpi_match_table = ACPI_PTR(virtio_mmio_acpi_match),
> },
> };
>
> --
> 2.1.4

2015-07-28 10:12:56

by Peter Maydell

[permalink] [raw]
Subject: Re: [PATCH] virtio_mmio: add ACPI probing

On 28 July 2015 at 11:08, Michael S. Tsirkin <[email protected]> wrote:
> On Tue, Jul 28, 2015 at 10:44:02AM +0100, Graeme Gregory wrote:
>> Added the match table and pointers for ACPI probing to the driver.
>>
>> This uses the same identifier for virt devices as being used for qemu
>> ARM64 ACPI support.
>>
>> http://git.linaro.org/people/shannon.zhao/qemu.git/commit/d0bf1955a3ecbab4b51d46f8c5dda02b7e14a17e
>>
>> Signed-off-by: Graeme Gregory <[email protected]>
>> ---
>> drivers/virtio/virtio_mmio.c | 10 ++++++++++
>> 1 file changed, 10 insertions(+)
>>
>> diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
>> index 10189b5..f499d9d 100644
>> --- a/drivers/virtio/virtio_mmio.c
>> +++ b/drivers/virtio/virtio_mmio.c
>> @@ -58,6 +58,7 @@
>>
>> #define pr_fmt(fmt) "virtio-mmio: " fmt
>>
>> +#include <linux/acpi.h>
>> #include <linux/highmem.h>
>> #include <linux/interrupt.h>
>> #include <linux/io.h>
>> @@ -732,12 +733,21 @@ static struct of_device_id virtio_mmio_match[] = {
>> };
>> MODULE_DEVICE_TABLE(of, virtio_mmio_match);
>>
>> +#ifdef CONFIG_ACPI
>> +static const struct acpi_device_id virtio_mmio_acpi_match[] = {
>> + { "LNRO0005", },
>> + { }
>> +};
>
> Hmm - we have reserved QEMUXXXX in ASWG explicitly for this purpose.
>
> Pater - do you think it's a good idea to change this before QEMU 2.4
> is released?

Shannon's call, I guess. I don't know enough about ACPI to say.
I thought these ACPI IDs were already fixed because they were
what the kernel was looking for...

-- PMM

2015-07-28 10:27:25

by Michael S. Tsirkin

[permalink] [raw]
Subject: Re: [PATCH] virtio_mmio: add ACPI probing

On Tue, Jul 28, 2015 at 11:12:33AM +0100, Peter Maydell wrote:
> On 28 July 2015 at 11:08, Michael S. Tsirkin <[email protected]> wrote:
> > On Tue, Jul 28, 2015 at 10:44:02AM +0100, Graeme Gregory wrote:
> >> Added the match table and pointers for ACPI probing to the driver.
> >>
> >> This uses the same identifier for virt devices as being used for qemu
> >> ARM64 ACPI support.
> >>
> >> http://git.linaro.org/people/shannon.zhao/qemu.git/commit/d0bf1955a3ecbab4b51d46f8c5dda02b7e14a17e
> >>
> >> Signed-off-by: Graeme Gregory <[email protected]>
> >> ---
> >> drivers/virtio/virtio_mmio.c | 10 ++++++++++
> >> 1 file changed, 10 insertions(+)
> >>
> >> diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
> >> index 10189b5..f499d9d 100644
> >> --- a/drivers/virtio/virtio_mmio.c
> >> +++ b/drivers/virtio/virtio_mmio.c
> >> @@ -58,6 +58,7 @@
> >>
> >> #define pr_fmt(fmt) "virtio-mmio: " fmt
> >>
> >> +#include <linux/acpi.h>
> >> #include <linux/highmem.h>
> >> #include <linux/interrupt.h>
> >> #include <linux/io.h>
> >> @@ -732,12 +733,21 @@ static struct of_device_id virtio_mmio_match[] = {
> >> };
> >> MODULE_DEVICE_TABLE(of, virtio_mmio_match);
> >>
> >> +#ifdef CONFIG_ACPI
> >> +static const struct acpi_device_id virtio_mmio_acpi_match[] = {
> >> + { "LNRO0005", },
> >> + { }
> >> +};
> >
> > Hmm - we have reserved QEMUXXXX in ASWG explicitly for this purpose.
> >
> > Pater - do you think it's a good idea to change this before QEMU 2.4
> > is released?
>
> Shannon's call, I guess. I don't know enough about ACPI to say.
> I thought these ACPI IDs were already fixed because they were
> what the kernel was looking for...
>
> -- PMM

Apparently not :)

--
MST

2015-07-28 10:33:52

by Graeme Gregory

[permalink] [raw]
Subject: Re: [PATCH] virtio_mmio: add ACPI probing

On 28 July 2015 at 11:27, Michael S. Tsirkin <[email protected]> wrote:
> On Tue, Jul 28, 2015 at 11:12:33AM +0100, Peter Maydell wrote:
>> On 28 July 2015 at 11:08, Michael S. Tsirkin <[email protected]> wrote:
>> > On Tue, Jul 28, 2015 at 10:44:02AM +0100, Graeme Gregory wrote:
>> >> Added the match table and pointers for ACPI probing to the driver.
>> >>
>> >> This uses the same identifier for virt devices as being used for qemu
>> >> ARM64 ACPI support.
>> >>
>> >> http://git.linaro.org/people/shannon.zhao/qemu.git/commit/d0bf1955a3ecbab4b51d46f8c5dda02b7e14a17e
>> >>
>> >> Signed-off-by: Graeme Gregory <[email protected]>
>> >> ---
>> >> drivers/virtio/virtio_mmio.c | 10 ++++++++++
>> >> 1 file changed, 10 insertions(+)
>> >>
>> >> diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
>> >> index 10189b5..f499d9d 100644
>> >> --- a/drivers/virtio/virtio_mmio.c
>> >> +++ b/drivers/virtio/virtio_mmio.c
>> >> @@ -58,6 +58,7 @@
>> >>
>> >> #define pr_fmt(fmt) "virtio-mmio: " fmt
>> >>
>> >> +#include <linux/acpi.h>
>> >> #include <linux/highmem.h>
>> >> #include <linux/interrupt.h>
>> >> #include <linux/io.h>
>> >> @@ -732,12 +733,21 @@ static struct of_device_id virtio_mmio_match[] = {
>> >> };
>> >> MODULE_DEVICE_TABLE(of, virtio_mmio_match);
>> >>
>> >> +#ifdef CONFIG_ACPI
>> >> +static const struct acpi_device_id virtio_mmio_acpi_match[] = {
>> >> + { "LNRO0005", },
>> >> + { }
>> >> +};
>> >
>> > Hmm - we have reserved QEMUXXXX in ASWG explicitly for this purpose.
>> >
>> > Pater - do you think it's a good idea to change this before QEMU 2.4
>> > is released?
>>
>> Shannon's call, I guess. I don't know enough about ACPI to say.
>> I thought these ACPI IDs were already fixed because they were
>> what the kernel was looking for...
>>
>> -- PMM
>
> Apparently not :)
>
We assigned LNRO in ASWG to avoid collisions with our prototypes/real
platforms so it makes sense to me to switch to QEMUXXXX.

I will submit a new patch if Shannon wants to switch to that form.

Graeme

2015-07-28 20:12:23

by Peter Maydell

[permalink] [raw]
Subject: Re: [PATCH] virtio_mmio: add ACPI probing

On 28 July 2015 at 11:27, Michael S. Tsirkin <[email protected]> wrote:
> On Tue, Jul 28, 2015 at 11:12:33AM +0100, Peter Maydell wrote:
>> On 28 July 2015 at 11:08, Michael S. Tsirkin <[email protected]> wrote:
>> > On Tue, Jul 28, 2015 at 10:44:02AM +0100, Graeme Gregory wrote:
>> >> Added the match table and pointers for ACPI probing to the driver.
>> >>
>> >> This uses the same identifier for virt devices as being used for qemu
>> >> ARM64 ACPI support.
>> >>
>> >> http://git.linaro.org/people/shannon.zhao/qemu.git/commit/d0bf1955a3ecbab4b51d46f8c5dda02b7e14a17e
>> >>
>> >> Signed-off-by: Graeme Gregory <[email protected]>

>> >> +#ifdef CONFIG_ACPI
>> >> +static const struct acpi_device_id virtio_mmio_acpi_match[] = {
>> >> + { "LNRO0005", },
>> >> + { }
>> >> +};
>> >
>> > Hmm - we have reserved QEMUXXXX in ASWG explicitly for this purpose.
>> >
>> > Pater - do you think it's a good idea to change this before QEMU 2.4
>> > is released?
>>
>> Shannon's call, I guess. I don't know enough about ACPI to say.
>> I thought these ACPI IDs were already fixed because they were
>> what the kernel was looking for...

> Apparently not :)

Mmm. I'm not terribly happy about stuff being in QEMU before the
ACPI spec for it has been finalised. We should not be picking
stuff randomly on the fly...

If we want to fix the ACPI IDs QEMU is using for 2.4 then we
really need to do that now (ie within the next day or two).

-- PMM

2015-07-28 20:28:49

by Graeme Gregory

[permalink] [raw]
Subject: Re: [PATCH] virtio_mmio: add ACPI probing

On 28 July 2015 at 21:12, Peter Maydell <[email protected]> wrote:
> On 28 July 2015 at 11:27, Michael S. Tsirkin <[email protected]> wrote:
>> On Tue, Jul 28, 2015 at 11:12:33AM +0100, Peter Maydell wrote:
>>> On 28 July 2015 at 11:08, Michael S. Tsirkin <[email protected]> wrote:
>>> > On Tue, Jul 28, 2015 at 10:44:02AM +0100, Graeme Gregory wrote:
>>> >> Added the match table and pointers for ACPI probing to the driver.
>>> >>
>>> >> This uses the same identifier for virt devices as being used for qemu
>>> >> ARM64 ACPI support.
>>> >>
>>> >> http://git.linaro.org/people/shannon.zhao/qemu.git/commit/d0bf1955a3ecbab4b51d46f8c5dda02b7e14a17e
>>> >>
>>> >> Signed-off-by: Graeme Gregory <[email protected]>
>
>>> >> +#ifdef CONFIG_ACPI
>>> >> +static const struct acpi_device_id virtio_mmio_acpi_match[] = {
>>> >> + { "LNRO0005", },
>>> >> + { }
>>> >> +};
>>> >
>>> > Hmm - we have reserved QEMUXXXX in ASWG explicitly for this purpose.
>>> >
>>> > Pater - do you think it's a good idea to change this before QEMU 2.4
>>> > is released?
>>>
>>> Shannon's call, I guess. I don't know enough about ACPI to say.
>>> I thought these ACPI IDs were already fixed because they were
>>> what the kernel was looking for...
>
>> Apparently not :)
>
> Mmm. I'm not terribly happy about stuff being in QEMU before the
> ACPI spec for it has been finalised. We should not be picking
> stuff randomly on the fly...
>
> If we want to fix the ACPI IDs QEMU is using for 2.4 then we
> really need to do that now (ie within the next day or two).
>
It is upto the owner of the QEMU prefix to allocate numbers. This is
not an issue for ACPI spec at all.

Graeme

2015-07-28 21:10:35

by Peter Maydell

[permalink] [raw]
Subject: Re: [PATCH] virtio_mmio: add ACPI probing

On 28 July 2015 at 21:28, G Gregory <[email protected]> wrote:
> On 28 July 2015 at 21:12, Peter Maydell <[email protected]> wrote:
>> Mmm. I'm not terribly happy about stuff being in QEMU before the
>> ACPI spec for it has been finalised. We should not be picking
>> stuff randomly on the fly...
>>
>> If we want to fix the ACPI IDs QEMU is using for 2.4 then we
>> really need to do that now (ie within the next day or two).
>>
> It is upto the owner of the QEMU prefix to allocate numbers. This is
> not an issue for ACPI spec at all.

I mean "the specification for how this device should be advertised
in an ACPI table". I don't care whether that's an official ACPI
consortium thing or something less official. The table is
constructed by QEMU and read by the kernel (and possibly
also by UEFI?), so everybody needs to agree on what the
string is...

thanks
-- PMM

2015-07-29 02:01:47

by Shannon Zhao

[permalink] [raw]
Subject: Re: [PATCH] virtio_mmio: add ACPI probing



On 2015/7/29 5:10, Peter Maydell wrote:
> On 28 July 2015 at 21:28, G Gregory <[email protected]> wrote:
>> > On 28 July 2015 at 21:12, Peter Maydell <[email protected]> wrote:
>>> >> Mmm. I'm not terribly happy about stuff being in QEMU before the
>>> >> ACPI spec for it has been finalised. We should not be picking
>>> >> stuff randomly on the fly...
>>> >>
>>> >> If we want to fix the ACPI IDs QEMU is using for 2.4 then we
>>> >> really need to do that now (ie within the next day or two).
>>> >>
>> > It is upto the owner of the QEMU prefix to allocate numbers. This is
>> > not an issue for ACPI spec at all.
> I mean "the specification for how this device should be advertised
> in an ACPI table". I don't care whether that's an official ACPI
> consortium thing or something less official. The table is
> constructed by QEMU and read by the kernel (and possibly
> also by UEFI?), so everybody needs to agree on what the
> string is...

I agree with Peter. Maybe we should record these IDs at some place.
Since QEMU is owner of this device and we register QEMU in ASWG, the
official ID can be assigned by QEMU and the ID could(or should) be
"QEMUXXXX". But what's the exact ID for this virtio-mmio? That's what we
need to agree on and record.

P.S. I don't see "QEMU" in the list of approved Vendor IDs for ACPI.
http://www.uefi.org/sites/default/files/resources/PNPID_List.pdf
http://www.uefi.org/sites/default/files/resources/ACPIID_List.pdf

--
Shannon

2015-07-29 10:01:31

by Michael S. Tsirkin

[permalink] [raw]
Subject: Re: [PATCH] virtio_mmio: add ACPI probing

On Wed, Jul 29, 2015 at 10:01:35AM +0800, Shannon Zhao wrote:
>
>
> On 2015/7/29 5:10, Peter Maydell wrote:
> > On 28 July 2015 at 21:28, G Gregory <[email protected]> wrote:
> >> > On 28 July 2015 at 21:12, Peter Maydell <[email protected]> wrote:
> >>> >> Mmm. I'm not terribly happy about stuff being in QEMU before the
> >>> >> ACPI spec for it has been finalised. We should not be picking
> >>> >> stuff randomly on the fly...
> >>> >>
> >>> >> If we want to fix the ACPI IDs QEMU is using for 2.4 then we
> >>> >> really need to do that now (ie within the next day or two).
> >>> >>
> >> > It is upto the owner of the QEMU prefix to allocate numbers. This is
> >> > not an issue for ACPI spec at all.
> > I mean "the specification for how this device should be advertised
> > in an ACPI table". I don't care whether that's an official ACPI
> > consortium thing or something less official. The table is
> > constructed by QEMU and read by the kernel (and possibly
> > also by UEFI?), so everybody needs to agree on what the
> > string is...
>
> I agree with Peter. Maybe we should record these IDs at some place.

Right. And it should apply even if you keep using LNRO.
Pls create docs/specs/acpi_ids.txt and list them there.

For simplicity, I'd just replace LNRO with QEMU.

> Since QEMU is owner of this device and we register QEMU in ASWG, the
> official ID can be assigned by QEMU and the ID could(or should) be
> "QEMUXXXX". But what's the exact ID for this virtio-mmio? That's what we
> need to agree on and record.

So far we only had PVPANIC with ACPI ID QEMU0001.

> P.S. I don't see "QEMU" in the list of approved Vendor IDs for ACPI.
> http://www.uefi.org/sites/default/files/resources/PNPID_List.pdf
> http://www.uefi.org/sites/default/files/resources/ACPIID_List.pdf

Should appear there any day now.

> --
> Shannon

2015-07-29 17:52:51

by Peter Maydell

[permalink] [raw]
Subject: Re: [PATCH] virtio_mmio: add ACPI probing

On 28 July 2015 at 11:33, G Gregory <[email protected]> wrote:
> We assigned LNRO in ASWG to avoid collisions with our prototypes/real
> platforms so it makes sense to me to switch to QEMUXXXX.

So just to check, if we switch virtio-mmio from an LNRO0005 ID
to a QEMUxxxx ID we aren't going to break any existing widely
shipped or deployed code, right?

If we can change the ID without breaking anything significant
then I think the QEMU ID makes more sense; but it doesn't
really gain us much beyond tidiness.

PS: https://www.kernel.org/doc/Documentation/arm64/arm-acpi.txt
uses virtio-mmio and LNRO0005 as its code example, so if
we change this then it might be nice to update the docs
as a followup.

thanks
-- PMM

2015-07-29 18:03:18

by Michael S. Tsirkin

[permalink] [raw]
Subject: Re: [PATCH] virtio_mmio: add ACPI probing

On Wed, Jul 29, 2015 at 06:52:29PM +0100, Peter Maydell wrote:
> On 28 July 2015 at 11:33, G Gregory <[email protected]> wrote:
> > We assigned LNRO in ASWG to avoid collisions with our prototypes/real
> > platforms so it makes sense to me to switch to QEMUXXXX.
>
> So just to check, if we switch virtio-mmio from an LNRO0005 ID
> to a QEMUxxxx ID we aren't going to break any existing widely
> shipped or deployed code, right?
>
> If we can change the ID without breaking anything significant
> then I think the QEMU ID makes more sense; but it doesn't
> really gain us much beyond tidiness.
>
> PS: https://www.kernel.org/doc/Documentation/arm64/arm-acpi.txt
> uses virtio-mmio and LNRO0005 as its code example, so if
> we change this then it might be nice to update the docs
> as a followup.
>
> thanks
> -- PMM

So this is the proposed patch. I agree it's merely about tidyness.
Pls ack or nack - we need to decide before 2.4 is out.

-->

arm: change vendor ID for virtio-mmio

Signed-off-by: Michael S. Tsirkin <[email protected]>

---

diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index f365140..d10bd69 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -145,7 +145,7 @@ static void acpi_dsdt_add_virtio(Aml *scope,

for (i = 0; i < num; i++) {
Aml *dev = aml_device("VR%02u", i);
- aml_append(dev, aml_name_decl("_HID", aml_string("LNRO0005")));
+ aml_append(dev, aml_name_decl("_HID", aml_string("QEMU0005")));
aml_append(dev, aml_name_decl("_UID", aml_int(i)));

Aml *crs = aml_resource_template();

2015-07-29 18:17:12

by Michael S. Tsirkin

[permalink] [raw]
Subject: Re: [PATCH] virtio_mmio: add ACPI probing

On Tue, Jul 28, 2015 at 10:44:02AM +0100, Graeme Gregory wrote:
> Added the match table and pointers for ACPI probing to the driver.
>
> This uses the same identifier for virt devices as being used for qemu
> ARM64 ACPI support.
>
> http://git.linaro.org/people/shannon.zhao/qemu.git/commit/d0bf1955a3ecbab4b51d46f8c5dda02b7e14a17e
>
> Signed-off-by: Graeme Gregory <[email protected]>

To summarize, let's wait a bit with this until QEMU 2.4
with the relevant code is out, to make sure ID does not
change.

> ---
> drivers/virtio/virtio_mmio.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
> index 10189b5..f499d9d 100644
> --- a/drivers/virtio/virtio_mmio.c
> +++ b/drivers/virtio/virtio_mmio.c
> @@ -58,6 +58,7 @@
>
> #define pr_fmt(fmt) "virtio-mmio: " fmt
>
> +#include <linux/acpi.h>
> #include <linux/highmem.h>
> #include <linux/interrupt.h>
> #include <linux/io.h>
> @@ -732,12 +733,21 @@ static struct of_device_id virtio_mmio_match[] = {
> };
> MODULE_DEVICE_TABLE(of, virtio_mmio_match);
>
> +#ifdef CONFIG_ACPI
> +static const struct acpi_device_id virtio_mmio_acpi_match[] = {
> + { "LNRO0005", },
> + { }
> +};
> +MODULE_DEVICE_TABLE(acpi, virtio_mmio_acpi_match);
> +#endif
> +
> static struct platform_driver virtio_mmio_driver = {
> .probe = virtio_mmio_probe,
> .remove = virtio_mmio_remove,
> .driver = {
> .name = "virtio-mmio",
> .of_match_table = virtio_mmio_match,
> + .acpi_match_table = ACPI_PTR(virtio_mmio_acpi_match),
> },
> };
>
> --
> 2.1.4

2015-08-27 14:55:17

by Graeme Gregory

[permalink] [raw]
Subject: Re: [PATCH] virtio_mmio: add ACPI probing

On Wed, Jul 29, 2015 at 09:17:08PM +0300, Michael S. Tsirkin wrote:
> On Tue, Jul 28, 2015 at 10:44:02AM +0100, Graeme Gregory wrote:
> > Added the match table and pointers for ACPI probing to the driver.
> >
> > This uses the same identifier for virt devices as being used for qemu
> > ARM64 ACPI support.
> >
> > http://git.linaro.org/people/shannon.zhao/qemu.git/commit/d0bf1955a3ecbab4b51d46f8c5dda02b7e14a17e
> >
> > Signed-off-by: Graeme Gregory <[email protected]>
>
> To summarize, let's wait a bit with this until QEMU 2.4
> with the relevant code is out, to make sure ID does not
> change.
>

It seems qemu 2.4 released with the LNRO0005 identifier.

Graeme

> > ---
> > drivers/virtio/virtio_mmio.c | 10 ++++++++++
> > 1 file changed, 10 insertions(+)
> >
> > diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c
> > index 10189b5..f499d9d 100644
> > --- a/drivers/virtio/virtio_mmio.c
> > +++ b/drivers/virtio/virtio_mmio.c
> > @@ -58,6 +58,7 @@
> >
> > #define pr_fmt(fmt) "virtio-mmio: " fmt
> >
> > +#include <linux/acpi.h>
> > #include <linux/highmem.h>
> > #include <linux/interrupt.h>
> > #include <linux/io.h>
> > @@ -732,12 +733,21 @@ static struct of_device_id virtio_mmio_match[] = {
> > };
> > MODULE_DEVICE_TABLE(of, virtio_mmio_match);
> >
> > +#ifdef CONFIG_ACPI
> > +static const struct acpi_device_id virtio_mmio_acpi_match[] = {
> > + { "LNRO0005", },
> > + { }
> > +};
> > +MODULE_DEVICE_TABLE(acpi, virtio_mmio_acpi_match);
> > +#endif
> > +
> > static struct platform_driver virtio_mmio_driver = {
> > .probe = virtio_mmio_probe,
> > .remove = virtio_mmio_remove,
> > .driver = {
> > .name = "virtio-mmio",
> > .of_match_table = virtio_mmio_match,
> > + .acpi_match_table = ACPI_PTR(virtio_mmio_acpi_match),
> > },
> > };
> >
> > --
> > 2.1.4