linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] acpi: Unconditional GED build
@ 2019-10-09 13:04 Samuel Ortiz
  2019-10-09 13:04 ` [PATCH 1/2] acpi: Fail GED probe when not on hardware-reduced Samuel Ortiz
  2019-10-09 13:04 ` [PATCH 2/2] acpi: Always build evged in Samuel Ortiz
  0 siblings, 2 replies; 6+ messages in thread
From: Samuel Ortiz @ 2019-10-09 13:04 UTC (permalink / raw)
  To: Len Brown, Rafael J . Wysocki; +Cc: linux-kernel, linux-acpi, Samuel Ortiz

The Generic Event Device is a hardware-reduced ACPI specific device, but
kernels supporting both fixed and hardware-reduced ACPI hardware should
be able to probe it dynamically.

For that purpose, here are 2 patches:

- The first one makes the GED device probe fail on non hardware-reduced
  platforms.
- The second one disable the conditional evged build.

Arjan van de Ven (1):
  acpi: Always build evged in

Samuel Ortiz (1):
  acpi: Fail GED probe when not on hardware-reduced

 drivers/acpi/Makefile | 2 +-
 drivers/acpi/evged.c  | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

-- 
2.21.0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] acpi: Fail GED probe when not on hardware-reduced
  2019-10-09 13:04 [PATCH 0/2] acpi: Unconditional GED build Samuel Ortiz
@ 2019-10-09 13:04 ` Samuel Ortiz
  2019-10-11 10:38   ` Rafael J. Wysocki
  2019-10-09 13:04 ` [PATCH 2/2] acpi: Always build evged in Samuel Ortiz
  1 sibling, 1 reply; 6+ messages in thread
From: Samuel Ortiz @ 2019-10-09 13:04 UTC (permalink / raw)
  To: Len Brown, Rafael J . Wysocki; +Cc: linux-kernel, linux-acpi, Samuel Ortiz

The Generic Event Device (GED) is a hardware-reduced platform device.
Probing this driver on fixed platforms should fail.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/acpi/evged.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/acpi/evged.c b/drivers/acpi/evged.c
index aba0d0027586..55de4b2d2fee 100644
--- a/drivers/acpi/evged.c
+++ b/drivers/acpi/evged.c
@@ -127,6 +127,9 @@ static int ged_probe(struct platform_device *pdev)
 	struct acpi_ged_device *geddev;
 	acpi_status acpi_ret;
 
+	if (!acpi_gbl_reduced_hardware)
+		return -ENODEV;
+
 	geddev = devm_kzalloc(&pdev->dev, sizeof(*geddev), GFP_KERNEL);
 	if (!geddev)
 		return -ENOMEM;
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] acpi: Always build evged in
  2019-10-09 13:04 [PATCH 0/2] acpi: Unconditional GED build Samuel Ortiz
  2019-10-09 13:04 ` [PATCH 1/2] acpi: Fail GED probe when not on hardware-reduced Samuel Ortiz
@ 2019-10-09 13:04 ` Samuel Ortiz
  1 sibling, 0 replies; 6+ messages in thread
From: Samuel Ortiz @ 2019-10-09 13:04 UTC (permalink / raw)
  To: Len Brown, Rafael J . Wysocki
  Cc: linux-kernel, linux-acpi, Arjan van de Ven, Samuel Ortiz

From: Arjan van de Ven <arjan@linux.intel.com>

Although the Generic Event Device is a Hardware-reduced platfom device,
it should not be restricted to ACPI_REDUCED_HARDWARE_ONLY.
Kernels supporting both fixed and hardware-reduced ACPI platforms should
be able to probe the GED when dynamically detecting that a platform is
hardware-reduced. For that, the driver must be unconditionally built in.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
---
 drivers/acpi/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index 5d361e4e3405..ef1ac4d127da 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -48,7 +48,7 @@ acpi-y				+= acpi_pnp.o
 acpi-$(CONFIG_ARM_AMBA)	+= acpi_amba.o
 acpi-y				+= power.o
 acpi-y				+= event.o
-acpi-$(CONFIG_ACPI_REDUCED_HARDWARE_ONLY) += evged.o
+acpi-y				+= evged.o
 acpi-y				+= sysfs.o
 acpi-y				+= property.o
 acpi-$(CONFIG_X86)		+= acpi_cmos_rtc.o
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] acpi: Fail GED probe when not on hardware-reduced
  2019-10-09 13:04 ` [PATCH 1/2] acpi: Fail GED probe when not on hardware-reduced Samuel Ortiz
@ 2019-10-11 10:38   ` Rafael J. Wysocki
  2019-10-11 12:14     ` Samuel Ortiz
  0 siblings, 1 reply; 6+ messages in thread
From: Rafael J. Wysocki @ 2019-10-11 10:38 UTC (permalink / raw)
  To: Samuel Ortiz
  Cc: Len Brown, Rafael J . Wysocki, Linux Kernel Mailing List,
	ACPI Devel Maling List

On Wed, Oct 9, 2019 at 3:04 PM Samuel Ortiz <sameo@linux.intel.com> wrote:
>
> The Generic Event Device (GED) is a hardware-reduced platform device.

No, it is not AFAICS.

The spec doesn't say that GED cannot be used on platforms that aren't
HW-reduced and if evged.c is going to be built in unconditionally, the
kernel will be able to handle GED regardless.

> Probing this driver on fixed platforms should fail.
>
> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
> ---
>  drivers/acpi/evged.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/acpi/evged.c b/drivers/acpi/evged.c
> index aba0d0027586..55de4b2d2fee 100644
> --- a/drivers/acpi/evged.c
> +++ b/drivers/acpi/evged.c
> @@ -127,6 +127,9 @@ static int ged_probe(struct platform_device *pdev)
>         struct acpi_ged_device *geddev;
>         acpi_status acpi_ret;
>
> +       if (!acpi_gbl_reduced_hardware)
> +               return -ENODEV;
> +
>         geddev = devm_kzalloc(&pdev->dev, sizeof(*geddev), GFP_KERNEL);
>         if (!geddev)
>                 return -ENOMEM;
> --
> 2.21.0
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] acpi: Fail GED probe when not on hardware-reduced
  2019-10-11 10:38   ` Rafael J. Wysocki
@ 2019-10-11 12:14     ` Samuel Ortiz
  2019-10-14  8:55       ` Rafael J. Wysocki
  0 siblings, 1 reply; 6+ messages in thread
From: Samuel Ortiz @ 2019-10-11 12:14 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Len Brown, Rafael J . Wysocki, Linux Kernel Mailing List,
	ACPI Devel Maling List

On Fri, Oct 11, 2019 at 12:38:49PM +0200, Rafael J. Wysocki wrote:
> On Wed, Oct 9, 2019 at 3:04 PM Samuel Ortiz <sameo@linux.intel.com> wrote:
> >
> > The Generic Event Device (GED) is a hardware-reduced platform device.
> 
> No, it is not AFAICS.
It's a little confusing, I was not sure what's the common understanding
and tried to be safe by not having non HW-reduced machines getting a
new device that they've never seen so far.


> The spec doesn't say that GED cannot be used on platforms that aren't
> HW-reduced
I agree.

>  and if evged.c is going to be built in unconditionally, the
> kernel will be able to handle GED regardless.
Ok, perfect then. Does that mean you're ok with the 2nd patch but are
going to drop this one?

Cheers,
Samuel.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] acpi: Fail GED probe when not on hardware-reduced
  2019-10-11 12:14     ` Samuel Ortiz
@ 2019-10-14  8:55       ` Rafael J. Wysocki
  0 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2019-10-14  8:55 UTC (permalink / raw)
  To: Samuel Ortiz
  Cc: Rafael J. Wysocki, Len Brown, Rafael J . Wysocki,
	Linux Kernel Mailing List, ACPI Devel Maling List

On Fri, Oct 11, 2019 at 2:14 PM Samuel Ortiz <sameo@linux.intel.com> wrote:
>
> On Fri, Oct 11, 2019 at 12:38:49PM +0200, Rafael J. Wysocki wrote:
> > On Wed, Oct 9, 2019 at 3:04 PM Samuel Ortiz <sameo@linux.intel.com> wrote:
> > >
> > > The Generic Event Device (GED) is a hardware-reduced platform device.
> >
> > No, it is not AFAICS.
> It's a little confusing, I was not sure what's the common understanding
> and tried to be safe by not having non HW-reduced machines getting a
> new device that they've never seen so far.

I really don't expect firmware to expose GED for such machines (why
would it?), but if it does so, then why not to handle it?

> > The spec doesn't say that GED cannot be used on platforms that aren't
> > HW-reduced
> I agree.
>
> >  and if evged.c is going to be built in unconditionally, the
> > kernel will be able to handle GED regardless.
> Ok, perfect then. Does that mean you're ok with the 2nd patch but are
> going to drop this one?

Sure, I will apply the second patch only.

Thanks!

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-10-14  8:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-09 13:04 [PATCH 0/2] acpi: Unconditional GED build Samuel Ortiz
2019-10-09 13:04 ` [PATCH 1/2] acpi: Fail GED probe when not on hardware-reduced Samuel Ortiz
2019-10-11 10:38   ` Rafael J. Wysocki
2019-10-11 12:14     ` Samuel Ortiz
2019-10-14  8:55       ` Rafael J. Wysocki
2019-10-09 13:04 ` [PATCH 2/2] acpi: Always build evged in Samuel Ortiz

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).