mbox series

[0/2] Native PCIe Enclosure Management

Message ID 20240215142345.6073-1-mariusz.tkaczyk@linux.intel.com
Headers show
Series Native PCIe Enclosure Management | expand

Message

Mariusz Tkaczyk Feb. 15, 2024, 2:23 p.m. UTC
In this patchset support of Native PCIe Enclosure Management is proposed.
Stuart Hayes was working on this earlier. It is a new serie because it
is NPEM only.

NPEM is pattern oriented standard, it tells which "pattern" should blink.
It doesn't control physical LED or pattern visualization. It is described
better in second patch.

Overall, driver is simple but it was not simple to fit it into interfaces
we have in kernel (We considered leds and enclosure interfaces). It reuses
leds interface, this approach seems to be the best because:
- leds are actively maintained, no new interface added.
- leds do not require any extensions, enclosure needs to be adjusted first.

There are trade-offs:
- "brightness" is the name of sysfs file to control led. It is not
  natural to use brightness to set patterns, that is why multiple led
  devices are created (one per pattern);
- Update of one led may affect other leds, led triggers may not work
  as expected.

It doesn't provide ACPI _DSM support, it requires separate implementation
outside drives/pci/ but NPEM is not registered if _DSM is available.

This patchset was made in close collaboration with Lucas Wunner.

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ilpo Jarvinen <ilpo.jarvinen@linux.intel.com>
Cc: Lukas Wunner <lukas@wunner.de>
Cc: Keith Busch <kbusch@kernel.org>
Cc: Marek Behun <marek.behun@nic.cz>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Shevchenko, Andriy <andriy.shevchenko@intel.com>
Cc: Stuart Hayes <stuart.w.hayes@gmail.com>
Link: https://lore.kernel.org/linux-pci/20201106194221.59353-1-stuart.w.hayes@gmail.com/
Link: https://lore.kernel.org/linux-pci/20201110153735.58587-1-stuart.w.hayes@gmail.com/
Link: https://lore.kernel.org/linux-pci/20210416192010.3197-1-stuart.w.hayes@gmail.com/
Link: https://lore.kernel.org/linux-pci/20210601203820.3647-1-stuart.w.hayes@gmail.com/
Link: https://lore.kernel.org/linux-pci/20210813213653.3760-1-stuart.w.hayes@gmail.com/
Link: https://lore.kernel.org/linux-pci/cover.1642460765.git.stuart.w.hayes@gmail.com/
Link: https://lore.kernel.org/linux-pci/cover.1643822289.git.stuart.w.hayes@gmail.com/


Mariusz Tkaczyk (2):
  leds: Init leds class earlier
  PCI/NPEM: Add Native PCIe Enclosure Management support

 drivers/leds/led-class.c      |   2 +-
 drivers/pci/Kconfig           |   7 +
 drivers/pci/Makefile          |   1 +
 drivers/pci/bus.c             |   1 +
 drivers/pci/npem.c            | 339 ++++++++++++++++++++++++++++++++++
 drivers/pci/pci.h             |   8 +
 drivers/pci/remove.c          |   1 +
 include/linux/pci.h           |   4 +
 include/uapi/linux/pci_regs.h |  34 ++++
 9 files changed, 396 insertions(+), 1 deletion(-)
 create mode 100644 drivers/pci/npem.c