chrome-platform.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 00/35] Remove .notify callback in acpi_device_ops
@ 2023-06-01 13:16 Michal Wilczynski
  2023-06-03 11:03 ` andy.shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Michal Wilczynski @ 2023-06-01 13:16 UTC (permalink / raw)
  To: rafael, lenb, dan.j.williams, vishal.l.verma, dave.jiang,
	ira.weiny, rui.zhang, jdelvare, linux, jic23, lars, bleung,
	yu.c.chen, hdegoede, markgross, luzmaximilian, corentin.chary,
	jprvita, cascardo, don, pali, jwoithe, matan, kenneth.t.chan,
	malattia, jeremy, productdev, herton, coproscefalo, tytso, Jason,
	robert.moore
  Cc: linux-acpi, nvdimm, linux-hwmon, linux-iio, chrome-platform,
	platform-driver-x86, acpi4asus-user, Michal Wilczynski

Currently drivers support ACPI event handlers by defining .notify
callback in acpi_device_ops. This solution is suboptimal as event
handler installer installs intermediary function acpi_notify_device as a
handler in every driver. Also this approach requires extra variable
'flags' for specifying event types that the driver want to subscribe to.
Additionally this is a pre-work required to align acpi_driver with
platform_driver and eventually replace acpi_driver with platform_driver.

Remove .notify callback from the acpi_device_ops. Replace it with each
driver installing and removing it's event handlers.

v4:
 - added one commit for previously missed driver sony-laptop,
   refactored return statements, added NULL check for event installer
v3:
 - lkp still reported some failures for eeepc, fujitsu and
   toshiba_bluetooth, fix those
v2:
 - fix compilation errors for drivers

Michal Wilczynski (35):
  acpi: Adjust functions installing bus event handlers
  acpi/ac: Move handler installing logic to driver
  acpi/video: Move handler installing logic to driver
  acpi/battery: Move handler installing logic to driver
  acpi/button: Move handler installing logic to driver
  acpi/hed: Move handler installing logic to driver
  acpi/nfit: Move handler installing logic to driver
  acpi/thermal: Move handler installing logic to driver
  acpi/tiny-power-button: Move handler installing logic to driver
  hwmon/acpi_power_meter: Move handler installing logic to driver
  iio/acpi-als: Move handler installing logic to driver
  platform/chromeos_tbmc: Move handler installing logic to driver
  platform/wilco_ec: Move handler installing logic to driver
  platform/surface/button: Move handler installing logic to driver
  platform/x86/acer-wireless: Move handler installing logic to driver
  platform/x86/asus-laptop: Move handler installing logic to driver
  platform/x86/asus-wireless: Move handler installing logic to driver
  platform/x86/classmate-laptop: Move handler installing logic to driver
  platform/x86/dell/dell-rbtn: Move handler installing logic to driver
  platform/x86/eeepc-laptop: Move handler installing logic to driver
  platform/x86/fujitsu-laptop: Move handler installing logic to driver
  platform/x86/lg-laptop: Move handler installing logic to driver
  platform/x86/panasonic-laptop: Move handler installing logic to driver
  platform/x86/system76_acpi: Move handler installing logic to driver
  platform/x86/topstar-laptop: Move handler installing logic to driver
  platform/x86/toshiba_acpi: Move handler installing logic to driver
  platform/x86/toshiba_bluetooth: Move handler installing logic to
    driver
  platform/x86/toshiba_haps: Move handler installing logic to driver
  platform/x86/wireless-hotkey: Move handler installing logic to driver
  platform/x86/xo15-ebook: Move handler installing logic to driver
  platform/x86/sony-laptop: Move handler installing logic to driver
  virt/vmgenid: Move handler installing logic to driver
  acpi/bus: Remove installing/removing notify handlers from probe/remove
  acpi/bus: Remove redundant functions
  acpi/bus: Remove notify callback and flags

 drivers/acpi/ac.c                             |  14 +-
 drivers/acpi/acpi_video.c                     |  16 ++-
 drivers/acpi/battery.c                        |  16 ++-
 drivers/acpi/bus.c                            |  56 +++-----
 drivers/acpi/button.c                         |  16 ++-
 drivers/acpi/hed.c                            |   7 +-
 drivers/acpi/nfit/core.c                      |  25 ++--
 drivers/acpi/thermal.c                        |  20 ++-
 drivers/acpi/tiny-power-button.c              |  18 +--
 drivers/hwmon/acpi_power_meter.c              |  15 +-
 drivers/iio/light/acpi-als.c                  |  23 +++-
 drivers/platform/chrome/chromeos_tbmc.c       |  14 +-
 drivers/platform/chrome/wilco_ec/event.c      |  17 ++-
 drivers/platform/surface/surfacepro3_button.c |  17 ++-
 drivers/platform/x86/acer-wireless.c          |  22 ++-
 drivers/platform/x86/asus-laptop.c            |  14 +-
 drivers/platform/x86/asus-wireless.c          |  24 ++--
 drivers/platform/x86/classmate-laptop.c       |  53 +++++--
 drivers/platform/x86/dell/dell-rbtn.c         |  17 ++-
 drivers/platform/x86/eeepc-laptop.c           |  16 ++-
 drivers/platform/x86/fujitsu-laptop.c         |  86 +++++++-----
 drivers/platform/x86/lg-laptop.c              |  10 +-
 drivers/platform/x86/panasonic-laptop.c       |  18 ++-
 drivers/platform/x86/sony-laptop.c            |   9 +-
 drivers/platform/x86/system76_acpi.c          |  26 ++--
 drivers/platform/x86/topstar-laptop.c         |  14 +-
 drivers/platform/x86/toshiba_acpi.c           | 129 +++++++++---------
 drivers/platform/x86/toshiba_bluetooth.c      |  30 ++--
 drivers/platform/x86/toshiba_haps.c           |   9 +-
 drivers/platform/x86/wireless-hotkey.c        |  24 +++-
 drivers/platform/x86/xo15-ebook.c             |   9 +-
 drivers/virt/vmgenid.c                        |  30 ++--
 include/acpi/acpi_bus.h                       |  10 +-
 33 files changed, 530 insertions(+), 294 deletions(-)

-- 
2.40.1


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

* Re: [PATCH v4 00/35] Remove .notify callback in acpi_device_ops
  2023-06-01 13:16 [PATCH v4 00/35] Remove .notify callback in acpi_device_ops Michal Wilczynski
@ 2023-06-03 11:03 ` andy.shevchenko
  2023-06-05  8:39   ` Wilczynski, Michal
  0 siblings, 1 reply; 4+ messages in thread
From: andy.shevchenko @ 2023-06-03 11:03 UTC (permalink / raw)
  To: Michal Wilczynski
  Cc: rafael, lenb, dan.j.williams, vishal.l.verma, dave.jiang,
	ira.weiny, rui.zhang, jdelvare, linux, jic23, lars, bleung,
	yu.c.chen, hdegoede, markgross, luzmaximilian, corentin.chary,
	jprvita, cascardo, don, pali, jwoithe, matan, kenneth.t.chan,
	malattia, jeremy, productdev, herton, coproscefalo, tytso, Jason,
	robert.moore, linux-acpi, nvdimm, linux-hwmon, linux-iio,
	chrome-platform, platform-driver-x86, acpi4asus-user

Thu, Jun 01, 2023 at 03:16:55PM +0200, Michal Wilczynski kirjoitti:
> Currently drivers support ACPI event handlers by defining .notify
> callback in acpi_device_ops. This solution is suboptimal as event
> handler installer installs intermediary function acpi_notify_device as a
> handler in every driver. Also this approach requires extra variable
> 'flags' for specifying event types that the driver want to subscribe to.
> Additionally this is a pre-work required to align acpi_driver with
> platform_driver and eventually replace acpi_driver with platform_driver.
> 
> Remove .notify callback from the acpi_device_ops. Replace it with each
> driver installing and removing it's event handlers.

Somehow this thread is screwed up in a sense of linking messages.
Even on the archives there are rather individual patches.

Please, be sure you are always use --thread when formatting it.
Yet you have a possibility to Cc different patches to the different
mailing lists and people.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH v4 00/35] Remove .notify callback in acpi_device_ops
  2023-06-03 11:03 ` andy.shevchenko
@ 2023-06-05  8:39   ` Wilczynski, Michal
  2023-06-05  9:50     ` Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Wilczynski, Michal @ 2023-06-05  8:39 UTC (permalink / raw)
  To: andy.shevchenko
  Cc: rafael, lenb, dan.j.williams, vishal.l.verma, dave.jiang,
	ira.weiny, rui.zhang, jdelvare, linux, jic23, lars, bleung,
	yu.c.chen, hdegoede, markgross, luzmaximilian, corentin.chary,
	jprvita, cascardo, don, pali, jwoithe, matan, kenneth.t.chan,
	malattia, jeremy, productdev, herton, coproscefalo, tytso, Jason,
	robert.moore, linux-acpi, nvdimm, linux-hwmon, linux-iio,
	chrome-platform, platform-driver-x86, acpi4asus-user



On 6/3/2023 1:03 PM, andy.shevchenko@gmail.com wrote:
> Thu, Jun 01, 2023 at 03:16:55PM +0200, Michal Wilczynski kirjoitti:
>> Currently drivers support ACPI event handlers by defining .notify
>> callback in acpi_device_ops. This solution is suboptimal as event
>> handler installer installs intermediary function acpi_notify_device as a
>> handler in every driver. Also this approach requires extra variable
>> 'flags' for specifying event types that the driver want to subscribe to.
>> Additionally this is a pre-work required to align acpi_driver with
>> platform_driver and eventually replace acpi_driver with platform_driver.
>>
>> Remove .notify callback from the acpi_device_ops. Replace it with each
>> driver installing and removing it's event handlers.
> Somehow this thread is screwed up in a sense of linking messages.
> Even on the archives there are rather individual patches.
>
> Please, be sure you are always use --thread when formatting it.
> Yet you have a possibility to Cc different patches to the different
> mailing lists and people.

Hi,
Thank you for this remark, I was trying to be clever and tried to send a patch
in a bit non-canonical way. So I've send a cover letter and a couple of other
major bits of a solution to everyone from the output of scripts/get_maintainer.pl
run on every patch from this series.

./scripts/get_maintainer.pl /home/mwilczyn/patches/remove_notify_external/*

(where remove_notify_external contains all patches generated for this patchset)

For the rest I used --to-cmd and --cc-cmd options of git send-email. This way I could
send patches with minor changes to every driver to only specified people marked
by get_maintainer.pl for this individual patch.

Hope that when re-sending with next revision --thread can help.

>


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

* Re: [PATCH v4 00/35] Remove .notify callback in acpi_device_ops
  2023-06-05  8:39   ` Wilczynski, Michal
@ 2023-06-05  9:50     ` Andy Shevchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2023-06-05  9:50 UTC (permalink / raw)
  To: Wilczynski, Michal
  Cc: rafael, lenb, dan.j.williams, vishal.l.verma, dave.jiang,
	ira.weiny, rui.zhang, jdelvare, linux, jic23, lars, bleung,
	yu.c.chen, hdegoede, markgross, luzmaximilian, corentin.chary,
	jprvita, cascardo, don, pali, jwoithe, matan, kenneth.t.chan,
	malattia, jeremy, productdev, herton, coproscefalo, tytso, Jason,
	robert.moore, linux-acpi, nvdimm, linux-hwmon, linux-iio,
	chrome-platform, platform-driver-x86, acpi4asus-user

On Mon, Jun 5, 2023 at 11:39 AM Wilczynski, Michal
<michal.wilczynski@intel.com> wrote:
> On 6/3/2023 1:03 PM, andy.shevchenko@gmail.com wrote:
> > Thu, Jun 01, 2023 at 03:16:55PM +0200, Michal Wilczynski kirjoitti:
> >> Currently drivers support ACPI event handlers by defining .notify
> >> callback in acpi_device_ops. This solution is suboptimal as event
> >> handler installer installs intermediary function acpi_notify_device as a
> >> handler in every driver. Also this approach requires extra variable
> >> 'flags' for specifying event types that the driver want to subscribe to.
> >> Additionally this is a pre-work required to align acpi_driver with
> >> platform_driver and eventually replace acpi_driver with platform_driver.
> >>
> >> Remove .notify callback from the acpi_device_ops. Replace it with each
> >> driver installing and removing it's event handlers.
> > Somehow this thread is screwed up in a sense of linking messages.
> > Even on the archives there are rather individual patches.
> >
> > Please, be sure you are always use --thread when formatting it.
> > Yet you have a possibility to Cc different patches to the different
> > mailing lists and people.
>
> Hi,
> Thank you for this remark, I was trying to be clever and tried to send a patch
> in a bit non-canonical way. So I've send a cover letter and a couple of other
> major bits of a solution to everyone from the output of scripts/get_maintainer.pl
> run on every patch from this series.
>
> ./scripts/get_maintainer.pl /home/mwilczyn/patches/remove_notify_external/*
>
> (where remove_notify_external contains all patches generated for this patchset)
>
> For the rest I used --to-cmd and --cc-cmd options of git send-email. This way I could
> send patches with minor changes to every driver to only specified people marked
> by get_maintainer.pl for this individual patch.
>
> Hope that when re-sending with next revision --thread can help.

You can send it to yourself first to test.

The biggest issue with your thread is making `b4` unable to catch the
thread. Since it cooperates with lore archive, it's extremely hard to
see the whole thing via the web either.

-- 
With Best Regards,
Andy Shevchenko

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

end of thread, other threads:[~2023-06-05  9:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-01 13:16 [PATCH v4 00/35] Remove .notify callback in acpi_device_ops Michal Wilczynski
2023-06-03 11:03 ` andy.shevchenko
2023-06-05  8:39   ` Wilczynski, Michal
2023-06-05  9:50     ` Andy Shevchenko

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