All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] PWM framework: add support referencing PWMs from ACPI
@ 2019-05-29 12:18 Nikolaus Voss
  2019-05-29 12:18 ` [PATCH 1/3] ACPI: Resolve objects on host-directed table loads Nikolaus Voss
                   ` (2 more replies)
  0 siblings, 3 replies; 77+ messages in thread
From: Nikolaus Voss @ 2019-05-29 12:18 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown, Robert Moore, Erik Schmauss,
	Jacek Anaszewski, Pavel Machek, Dan Murphy, Thierry Reding
  Cc: Nikolaus Voss, linux-acpi, devel, linux-leds, linux-pwm

As described in Documentation/firmware-guide/acpi/gpio-properties.rst a
GPIO can be referenced from ACPI ASL _DSD with the "gpios"-property of the
form:

  Package () { "gpios", Package () { ref, index, pin, active_low }}

The second patch of this series adds support for specifing a PWM
reference in ASL of the form

  Package () { "pwms", Package () { ref, index, pwm-period [, pwm flags]}}

The first patch of this series is necessary to resolve the "ref" in ASL
if the table has been loaded by efivar_ssdt_load() or configfs.

The third patch of this series makes leds-pwm use the ACPI-enabled
PWM framework.

Nikolaus Voss (3):
  ACPI: Resolve objects on host-directed table loads
  PWM framework: add support referencing PWMs from ACPI
  leds-pwm.c: support ACPI via firmware-node framework

 drivers/acpi/acpi_configfs.c   |   6 +-
 drivers/acpi/acpica/tbxfload.c |  11 ++++
 drivers/leds/leds-pwm.c        |  44 +++++++------
 drivers/pwm/core.c             | 112 +++++++++++++++++++++++++++++++++
 include/linux/pwm.h            |   9 +++
 5 files changed, 159 insertions(+), 23 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 77+ messages in thread
* Re: [Devel] [PATCH] ACPICA: make acpi_load_table() return table index
  2019-09-13 17:40                             ` Moore, Robert
@ 2019-09-13 19:56 ` Rafael J. Wysocki
  -1 siblings, 0 replies; 77+ messages in thread
From: Rafael J. Wysocki @ 2019-09-13 19:56 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 4298 bytes --]

On Fri, Sep 13, 2019 at 7:41 PM Moore, Robert <robert.moore(a)intel.com> wrote:
>
>
>
> -----Original Message-----
> From: Ferry Toth [mailto:fntoth(a)gmail.com]
> Sent: Friday, September 13, 2019 9:48 AM
> To: Shevchenko, Andriy <andriy.shevchenko(a)intel.com>; Moore, Robert <robert.moore(a)intel.com>
> Cc: Nikolaus Voss <nv(a)vosn.de>; Schmauss, Erik <erik.schmauss(a)intel.com>; Rafael J. Wysocki <rjw(a)rjwysocki.net>; Len Brown <lenb(a)kernel.org>; Jacek Anaszewski <jacek.anaszewski(a)gmail.com>; Pavel Machek <pavel(a)ucw.cz>; Dan Murphy <dmurphy(a)ti.com>; linux-acpi(a)vger.kernel.org; devel(a)acpica.org; linux-kernel(a)vger.kernel.org; nikolaus.voss(a)loewensteinmedical.de; Jan Kiszka <jan.kiszka(a)siemens.com>
> Subject: Re: [PATCH] ACPICA: make acpi_load_table() return table index
>
> Hello all,
>
> Sorry to have sent our message with cancelled e-mail address. I have correct this now.
>
> Op 13-09-19 om 17:12 schreef Shevchenko, Andriy:
> > On Fri, Sep 13, 2019 at 05:20:21PM +0300, Moore, Robert wrote:
> >> -----Original Message-----
> >> From: Nikolaus Voss [mailto:nv(a)vosn.de]
> >> Sent: Friday, September 13, 2019 12:44 AM
> >> To: Moore, Robert <robert.moore(a)intel.com>
> >> Cc: Shevchenko, Andriy <andriy.shevchenko(a)intel.com>; Schmauss, Erik
> >> <erik.schmauss(a)intel.com>; Rafael J. Wysocki <rjw(a)rjwysocki.net>; Len
> >> Brown <lenb(a)kernel.org>; Jacek Anaszewski
> >> <jacek.anaszewski(a)gmail.com>; Pavel Machek <pavel(a)ucw.cz>; Dan Murphy
> >> <dmurphy(a)ti.com>; linux-acpi(a)vger.kernel.org; devel(a)acpica.org;
> >> linux-kernel(a)vger.kernel.org; Ferry Toth <ftoth(a)telfort.nl>;
> >> nikolaus.voss(a)loewensteinmedical.de
> >> Subject: RE: [PATCH] ACPICA: make acpi_load_table() return table
> >> index
> >>
> >> Bob,
> >>
> >> On Thu, 12 Sep 2019, Moore, Robert wrote:
> >>> The ability to unload an ACPI table (especially AML tables such as
> >>> SSDTs) is in the process of being deprecated in ACPICA -- since it
> >>> is also deprecated in the current ACPI specification. This is being
> >>> done because of the difficulty of deleting the namespace entries for
> >>> the table.  FYI, Windows does not properly support this function either.
> >>
> >> ok, I see it can be a problem to unload an AML table with all it's
> >> consequences e.g. with respect to driver unregistering in setups with
> >> complex dependencies. It will only work properly under certain
> >> conditions
> >> - nevertheless acpi_tb_unload_table() is still exported in ACPICA and we should get this working as it worked before.
> >>
> >> AcpiTbUnloadTable is not exported, it is an internal interface only
> >> -- as recognized by the "AcpiTb".
> >
> > In Linux it became a part of ABI when the
> >
> > commit 772bf1e2878ecfca0d1f332071c83e021dd9cf01
> > Author: Jan Kiszka <jan.kiszka(a)siemens.com>
> > Date:   Fri Jun 9 20:36:31 2017 +0200
> >
> >      ACPI: configfs: Unload SSDT on configfs entry removal
> >
> > appeared in the kernel.
>
> And the commit message explains quite well why it is an important feature:
>
> "This allows to change SSDTs without rebooting the system.
> It also allows to destroy devices again that a dynamically loaded SSDT created.
>
> The biggest problem AFAIK is that under linux, many drivers cannot be unloaded.
> Also, there are many race conditions as the namespace entries "owned" by an SSDT
> being unloaded are deleted (out from underneath a driver).

While that is true in general, there are cases in which unloading does
work and they
still need to be supported.

You may argue that adding support for unloading SSDTs loaded via
configfs was a mistake,
but that was done and it cannot be undone.

We cannot break existing setups in which it is in use and works.

> This is widely similar to the DT overlay behavior."
>
> >> I'm not sure that I want to change the interface to AcpiLoadTable
> >> just for something that is being deprecated. Already, we throw an
> >> ACPI_EXCEPTION if the Unload operator is encountered in the AML byte
> >> stream. The same thing with AcpiUnloadParentTable - it is being deprecated.
> >>
> >>      ACPI_EXCEPTION ((AE_INFO, AE_NOT_IMPLEMENTED,
> >>          "AML Unload operator is not supported"));
> >
>

^ permalink raw reply	[flat|nested] 77+ messages in thread
* Re: [Devel] [PATCH] ACPICA: make acpi_load_table() return table index
  2019-09-26 18:44                       ` Nikolaus Voss
@ 2019-09-26 19:26 ` Rafael J. Wysocki
  -1 siblings, 0 replies; 77+ messages in thread
From: Rafael J. Wysocki @ 2019-09-26 19:26 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 2811 bytes --]

On Thu, Sep 26, 2019 at 8:44 PM Nikolaus Voss <nv(a)vosn.de> wrote:
>
> On Thu, 26 Sep 2019, Schmauss, Erik wrote:
> >> -----Original Message-----
> >> From: linux-acpi-owner(a)vger.kernel.org <linux-acpi-owner(a)vger.kernel.org>
> >> On Behalf Of Shevchenko, Andriy
> >> Sent: Thursday, September 26, 2019 9:35 AM
> >> To: Schmauss, Erik <erik.schmauss(a)intel.com>
> >> Cc: Nikolaus Voss <nikolaus.voss(a)loewensteinmedical.de>; Rafael J. Wysocki
> >> <rjw(a)rjwysocki.net>; Moore, Robert <robert.moore(a)intel.com>; Len Brown
> >> <lenb(a)kernel.org>; Jacek Anaszewski <jacek.anaszewski(a)gmail.com>; Pavel
> >> Machek <pavel(a)ucw.cz>; Dan Murphy <dmurphy(a)ti.com>; linux-
> >> acpi(a)vger.kernel.org; devel(a)acpica.org; linux-kernel(a)vger.kernel.org;
> >> nv(a)vosn.de
> >> Subject: Re: [PATCH] ACPICA: make acpi_load_table() return table index
> >>
> >> On Thu, Sep 26, 2019 at 07:09:05PM +0300, Schmauss, Erik wrote:
> >>>> -----Original Message-----
> >>>> From: Nikolaus Voss <nikolaus.voss(a)loewensteinmedical.de>
> >>>> Sent: Thursday, September 12, 2019 1:08 AM
> >>>> To: Shevchenko, Andriy <andriy.shevchenko(a)intel.com>; Schmauss, Erik
> >>>> <erik.schmauss(a)intel.com>; Rafael J. Wysocki <rjw(a)rjwysocki.net>;
> >>>> Moore, Robert <robert.moore(a)intel.com>
> >>>> Cc: Len Brown <lenb(a)kernel.org>; Jacek Anaszewski
> >>>> <jacek.anaszewski(a)gmail.com>; Pavel Machek <pavel(a)ucw.cz>; Dan
> >>>> Murphy <dmurphy(a)ti.com>; linux-acpi(a)vger.kernel.org;
> >>>> devel(a)acpica.org; linux- kernel(a)vger.kernel.org; nv(a)vosn.de;
> >>>> Nikolaus Voss <nikolaus.voss(a)loewensteinmedical.de>
> >>>> Subject: [PATCH] ACPICA: make acpi_load_table() return table index
> >>>>
> >>> Hi Nikolaus,
> >>>
> >>>> For unloading an ACPI table, it is necessary to provide the index of the table.
> >>>> The method intended for dynamically loading or hotplug addition of
> >>>> tables, acpi_load_table(), should provide this information via an
> >>>> optional pointer to the loaded table index.
> >>>
> >>> We'll take this patch for ACPICA upstream
> >>
> >> Erik,
> >>
> > Hi Andy,
> >
> >> how about to have also counterpart to acpi_load_table() which will do what it's
> >> done now in acpi_configfs.c via acpi_tb_*() API?
> >
> > I should have given more details. We decided to add this extra parameter
> > in AcpiLoadTable and we're going to create an AcpiUnloadTable function
> > that will take table index to unload the table (basically the
> > acpi_tb_unload..). Once we do this, you can use table indices with
> > AcpiUnloadTable and AcpiLoadTable.
>
> that's even better news.
>
> Rafael, shall I prepare anything?

I don't think so.  I'm expecting to get a proper fix from the upstream
through the normal process.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 77+ messages in thread
* Re: [Devel] [PATCH] ACPICA: make acpi_load_table() return table index
  2019-09-26 19:26 ` Rafael J. Wysocki
@ 2019-09-26 19:41 ` Schmauss, Erik
  -1 siblings, 0 replies; 77+ messages in thread
From: Schmauss, Erik @ 2019-09-26 19:41 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 4060 bytes --]



> -----Original Message-----
> From: Rafael J. Wysocki <rafael(a)kernel.org>
> Sent: Thursday, September 26, 2019 12:26 PM
> To: Nikolaus Voss <nv(a)vosn.de>
> Cc: Schmauss, Erik <erik.schmauss(a)intel.com>; Shevchenko, Andriy
> <andriy.shevchenko(a)intel.com>; Rafael J. Wysocki <rjw(a)rjwysocki.net>;
> Moore, Robert <robert.moore(a)intel.com>; Len Brown <lenb(a)kernel.org>;
> Jacek Anaszewski <jacek.anaszewski(a)gmail.com>; Pavel Machek
> <pavel(a)ucw.cz>; Dan Murphy <dmurphy(a)ti.com>; linux-acpi(a)vger.kernel.org;
> devel(a)acpica.org; linux-kernel(a)vger.kernel.org
> Subject: Re: [PATCH] ACPICA: make acpi_load_table() return table index
> 
> On Thu, Sep 26, 2019 at 8:44 PM Nikolaus Voss <nv(a)vosn.de> wrote:
> >
> > On Thu, 26 Sep 2019, Schmauss, Erik wrote:
> > >> -----Original Message-----
> > >> From: linux-acpi-owner(a)vger.kernel.org
> > >> <linux-acpi-owner(a)vger.kernel.org>
> > >> On Behalf Of Shevchenko, Andriy
> > >> Sent: Thursday, September 26, 2019 9:35 AM
> > >> To: Schmauss, Erik <erik.schmauss(a)intel.com>
> > >> Cc: Nikolaus Voss <nikolaus.voss(a)loewensteinmedical.de>; Rafael J.
> > >> Wysocki <rjw(a)rjwysocki.net>; Moore, Robert
> > >> <robert.moore(a)intel.com>; Len Brown <lenb(a)kernel.org>; Jacek
> > >> Anaszewski <jacek.anaszewski(a)gmail.com>; Pavel Machek
> > >> <pavel(a)ucw.cz>; Dan Murphy <dmurphy(a)ti.com>; linux-
> > >> acpi(a)vger.kernel.org; devel(a)acpica.org;
> > >> linux-kernel(a)vger.kernel.org; nv(a)vosn.de
> > >> Subject: Re: [PATCH] ACPICA: make acpi_load_table() return table
> > >> index
> > >>
> > >> On Thu, Sep 26, 2019 at 07:09:05PM +0300, Schmauss, Erik wrote:
> > >>>> -----Original Message-----
> > >>>> From: Nikolaus Voss <nikolaus.voss(a)loewensteinmedical.de>
> > >>>> Sent: Thursday, September 12, 2019 1:08 AM
> > >>>> To: Shevchenko, Andriy <andriy.shevchenko(a)intel.com>; Schmauss,
> > >>>> Erik <erik.schmauss(a)intel.com>; Rafael J. Wysocki
> > >>>> <rjw(a)rjwysocki.net>; Moore, Robert <robert.moore(a)intel.com>
> > >>>> Cc: Len Brown <lenb(a)kernel.org>; Jacek Anaszewski
> > >>>> <jacek.anaszewski(a)gmail.com>; Pavel Machek <pavel(a)ucw.cz>; Dan
> > >>>> Murphy <dmurphy(a)ti.com>; linux-acpi(a)vger.kernel.org;
> > >>>> devel(a)acpica.org; linux- kernel(a)vger.kernel.org; nv(a)vosn.de;
> > >>>> Nikolaus Voss <nikolaus.voss(a)loewensteinmedical.de>
> > >>>> Subject: [PATCH] ACPICA: make acpi_load_table() return table
> > >>>> index
> > >>>>
> > >>> Hi Nikolaus,
> > >>>
> > >>>> For unloading an ACPI table, it is necessary to provide the index of the
> table.
> > >>>> The method intended for dynamically loading or hotplug addition
> > >>>> of tables, acpi_load_table(), should provide this information via
> > >>>> an optional pointer to the loaded table index.
> > >>>
> > >>> We'll take this patch for ACPICA upstream
> > >>
> > >> Erik,
> > >>
> > > Hi Andy,
> > >
> > >> how about to have also counterpart to acpi_load_table() which will
> > >> do what it's done now in acpi_configfs.c via acpi_tb_*() API?
> > >
> > > I should have given more details. We decided to add this extra
> > > parameter in AcpiLoadTable and we're going to create an
> > > AcpiUnloadTable function that will take table index to unload the
> > > table (basically the acpi_tb_unload..). Once we do this, you can use
> > > table indices with AcpiUnloadTable and AcpiLoadTable.
> >
> > that's even better news.
> >
> > Rafael, shall I prepare anything?
Hi everyone,

> I don't think so.  I'm expecting to get a proper fix from the upstream through
> the normal process.
Just so that we are on the same page:

I've backported Nikolaus's patch for upstream here https://github.com/acpica/acpica/pull/506
and Bob has implemented the new API here: https://github.com/acpica/acpica/commit/c69369cd9cf0134e1aac516e97d612947daa8dc2

Once we do a release, I will send Bob's change to the linux ACPI mailing list.
Feel free to use this new API where you see fit.

Thanks,
Erik

> 
> Thanks,
> Rafael

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

end of thread, other threads:[~2019-09-26 19:41 UTC | newest]

Thread overview: 77+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-29 12:18 [PATCH 0/3] PWM framework: add support referencing PWMs from ACPI Nikolaus Voss
2019-05-29 12:18 ` [PATCH 1/3] ACPI: Resolve objects on host-directed table loads Nikolaus Voss
2019-05-30 14:42   ` Dan Murphy
2019-05-30 14:42     ` Dan Murphy
2019-05-31 12:23     ` Pavel Machek
2019-05-31 12:45       ` Dan Murphy
2019-05-31 12:45         ` Dan Murphy
2019-05-31 12:46     ` Dan Murphy
2019-05-31 12:46       ` Dan Murphy
2019-06-03  9:12       ` Nikolaus Voss
2019-08-14 18:50   ` Andy Shevchenko
2019-08-14 20:27     ` [Devel] " Schmauss, Erik
2019-08-14 20:27       ` Schmauss, Erik
2019-08-16 11:57       ` Nikolaus Voss
2019-08-30 14:53         ` Shevchenko, Andriy
2019-09-04  7:20           ` Nikolaus Voss
2019-09-06 17:46             ` Shevchenko, Andriy
2019-09-12  8:05               ` Nikolaus Voss
2019-09-12  8:07               ` [PATCH] ACPICA: make acpi_load_table() return table index Nikolaus Voss
2019-09-12 14:19                 ` [Devel] " Moore, Robert
2019-09-12 14:19                   ` Moore, Robert
2019-09-12 19:36                   ` Ferry Toth
2019-09-25 18:13                     ` [Devel] " Schmauss, Erik
2019-09-25 18:13                       ` Schmauss, Erik
2019-09-26  8:09                       ` Shevchenko, Andriy
2019-09-13  7:44                   ` Nikolaus Voss
2019-09-13 14:20                     ` [Devel] " Moore, Robert
2019-09-13 14:20                       ` Moore, Robert
2019-09-13 15:12                       ` Shevchenko, Andriy
2019-09-13 16:48                         ` Ferry Toth
2019-09-13 16:48                           ` Ferry Toth
2019-09-13 16:48                           ` Ferry Toth
2019-09-13 17:40                           ` [Devel] " Moore, Robert
2019-09-13 17:40                             ` Moore, Robert
2019-09-16  9:46                             ` Nikolaus Voss
2019-09-18 14:13                               ` [Devel] " Moore, Robert
2019-09-18 14:13                                 ` Moore, Robert
2019-09-18 14:31                                 ` Nikolaus Voss
2019-09-19 17:05                                   ` [Devel] " Moore, Robert
2019-09-19 17:05                                     ` Moore, Robert
2019-09-23  9:05                                     ` Nikolaus Voss
2019-09-24 19:41                                       ` [Devel] " Moore, Robert
2019-09-24 19:41                                         ` Moore, Robert
2019-09-25 10:18                                         ` Nikolaus Voss
2019-09-25 10:53                                           ` Shevchenko, Andriy
2019-09-19  8:13                 ` [Devel] " Rafael J. Wysocki
2019-09-19  8:13                   ` Rafael J. Wysocki
2019-09-23  9:08                   ` Nikolaus Voss
2019-09-23  9:47                   ` [PATCH] ACPICA: Introduce acpi_load_table_with_index() Nikolaus Voss
2019-09-24 12:07                     ` Shevchenko, Andriy
2019-09-24 12:08                       ` Shevchenko, Andriy
2019-09-25 10:20                         ` Nikolaus Voss
2019-09-24 15:11                     ` Andy Shevchenko
2019-09-25 10:22                       ` Nikolaus Voss
2019-09-26 16:09                 ` [Devel] [PATCH] ACPICA: make acpi_load_table() return table index Schmauss, Erik
2019-09-26 16:09                   ` Schmauss, Erik
2019-09-26 16:35                   ` Shevchenko, Andriy
2019-09-26 16:51                     ` [Devel] " Schmauss, Erik
2019-09-26 16:51                       ` Schmauss, Erik
2019-09-26 17:47                       ` Shevchenko, Andriy
2019-09-26 18:44                       ` Nikolaus Voss
2019-09-26 18:43                   ` Nikolaus Voss
2019-05-29 12:18 ` [PATCH 2/3] PWM framework: add support referencing PWMs from ACPI Nikolaus Voss
2019-05-30 14:54   ` Dan Murphy
2019-05-30 14:54     ` Dan Murphy
2019-05-31 12:24     ` Pavel Machek
2019-06-03  9:27     ` Nikolaus Voss
2019-05-29 12:18 ` [PATCH 3/3] leds-pwm.c: support ACPI via firmware-node framework Nikolaus Voss
2019-05-30 15:14   ` Dan Murphy
2019-05-30 15:14     ` Dan Murphy
2019-06-03  9:44     ` Nikolaus Voss
  -- strict thread matches above, loose matches on Subject: below --
2019-09-13 19:56 [Devel] [PATCH] ACPICA: make acpi_load_table() return table index Rafael J. Wysocki
2019-09-13 19:56 ` Rafael J. Wysocki
2019-09-26 19:26 [Devel] " Rafael J. Wysocki
2019-09-26 19:26 ` Rafael J. Wysocki
2019-09-26 19:41 [Devel] " Schmauss, Erik
2019-09-26 19:41 ` Schmauss, Erik

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.