mbox series

[platform-next,v4,00/16] Add new features and amendments for Nvidia systems

Message ID 20230822113451.13785-1-vadimp@nvidia.com (mailing list archive)
Headers show
Series Add new features and amendments for Nvidia systems | expand

Message

Vadim Pasternak Aug. 22, 2023, 11:34 a.m. UTC
The patch set:
- Provides New system attributes for monitoring.
- Adds system reboot callback to perform system specific operations.
- Adds support for ACPI based initialization flow.
- Adds support for FPGA device connected through PCIe bus.
- Adds additional logic for hotplug events handling.
- Contains some amendments and cosmetic changes.

The patch set includes:
Patches #1 - #3, #5: add new attributes for monitoring.
Patch #4: sets hotplug event action for health and power signals.
Patch #6: adds CPLD versioning registers for systems equipped with five
	  CPLD devices.
Patch #7: modifies power off callback.
Patch #8: cosmetic changes - fixes misspelling.
Patch #9: provides system reboot callback through system reboot
	  notifier.
Patch #10: prepares driver to allow probing through ACPI hooks along
	   with probing through DMI hooks.
Patch #11: adds ACPI match hook for initialization flow.
Patch #12: adds support for getting system interrupt line from ACPI
	   table.
Patch #13: adds initial support for programming logic device connected
	   through PCIe.
Patch #14: Extends condition for notification callback processing.
Patch #15: defines the exact i2c bus of fans on the SN2201 system.
Patch #16: Documents new attributes.

Changes in v4:
- Address review comments from Ilpo, see patch 16/16 for details.
Changes in v3:
- Address review comments from Hans, see patch 16/16 for details.
- Rebased on top of:
  https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Michael Shych (1):
  platform: mellanox: nvsw-sn2201: change fans i2c busses.

Vadim Pasternak (15):
  platform: mellanox: Add new attributes
  platform: mellanox: Add field upgrade capability register
  platform: mellanox: Modify reset causes description
  platform: mellanox: mlx-platform: Modify health and power hotplug
    action
  platform: mellanox: mlx-platform: Add reset cause attribute
  platform: mellanox: mlx-platform: add support for additional CPLD
  platform: mellanox: mlx-platform: Modify power off callback
  platform: mellanox: Cosmetic changes
  platform: mellanox: mlx-platform: Add reset callback
  platform: mellanox: mlx-platform: Prepare driver to allow probing
    through ACPI infrastructure
  platform: mellanox: mlx-platform: Introduce ACPI init flow
  platform: mellanox: mlx-platform: Get interrupt line through ACPI
  platform: mellanox: Add initial support for PCIe based programming
    logic device
  platform/mellanox: mlxreg-hotplug: Extend condition for notification
    callback processing
  Documentation/ABI: Add new attribute for mlxreg-io sysfs interfaces

 .../ABI/stable/sysfs-driver-mlxreg-io         |  52 +++
 drivers/platform/mellanox/mlxreg-hotplug.c    |   2 +-
 drivers/platform/mellanox/nvsw-sn2201.c       |  12 +-
 drivers/platform/x86/mlx-platform.c           | 376 ++++++++++++++++--
 4 files changed, 393 insertions(+), 49 deletions(-)

Comments

Ilpo Järvinen Aug. 22, 2023, 11:43 a.m. UTC | #1
On Tue, 22 Aug 2023, Vadim Pasternak wrote:

> Add documentation for the new attributes:
> - CPLD versioning: "cpld5_pn", "cpld5_version", "cpld5_version_min".
> - JTAG capability: "jtag_cap", indicating the available method of
>   CPLD/FPGA devices field update.
> - System lid status: "lid_open".
> - Reset caused by long press of power button: "reset_long_pwr_pb".
> - Reset caused by switch board DC-DC converter device failure:
>   "reset_swb_dc_dc_pwr_fail".
> 
> Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
> Reviewed-by: Michael Shych <michaelsh@nvidia.com>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> ---
> v3->v4:
>  Comments provided by Ilpo:
>  - Modify desription for "reset_swb_dc_dc_pwr_fail".
> v2->v3:
>  Comments provided by Hans:
>  - Document new attribute "reset_swb_dc_dc_pwr_fail".
> ---
>  .../ABI/stable/sysfs-driver-mlxreg-io         | 52 +++++++++++++++++++
>  1 file changed, 52 insertions(+)
> 
> diff --git a/Documentation/ABI/stable/sysfs-driver-mlxreg-io b/Documentation/ABI/stable/sysfs-driver-mlxreg-io
> index 60953903d007..115302236627 100644
> --- a/Documentation/ABI/stable/sysfs-driver-mlxreg-io
> +++ b/Documentation/ABI/stable/sysfs-driver-mlxreg-io
> @@ -662,3 +662,55 @@ Description:	This file shows the system reset cause due to AC power failure.
>  		Value 1 in file means this is reset cause, 0 - otherwise.
>  
>  		The file is read only.
> +
> +What:		/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_pn
> +What:		/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_version
> +What:		/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_version_min
> +Date:		August 2023
> +KernelVersion:	6.6
> +Contact:	Vadim Pasternak <vadimp@nvidia.com>
> +Description:	These files show with which CPLD part numbers, version and minor
> +		versions have been burned the 5-th CPLD device equipped on a
> +		system.
> +
> +		The files are read only.
> +
> +What:		/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/jtag_cap
> +Date:		August 2023
> +KernelVersion:	6.6
> +Contact:	Vadim Pasternak <vadimp@nvidia.com>
> +Description:    This file indicates the available method of CPLD/FPGA devices
> +		field update through the JTAG chain:
> +		 b00 - field update through LPC bus register memory space.
> +		 b01 - Reserved.
> +		 b10 - Reserved.
> +		 b11 - field update through CPU GPIOs bit-banging.
> +
> +		The file is read only.
> +
> +What:		/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/lid_open
> +Date:		August 2023
> +KernelVersion:	6.6
> +Contact:	Vadim Pasternak <vadimp@nvidia.com>
> +Description:	1 - indicates that system lid is opened, otherwise 0.
> +
> +		The file is read only.
> +
> +What:		/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_long_pwr_pb
> +Date:		August 2023
> +KernelVersion:	6.6
> +Contact:	Vadim Pasternak <vadimp@nvidia.com>
> +Description:	This file if set 1 indicates that system has been reset by
> +		long press of power button.
> +
> +		The file is read only.
> +
> +What:		/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_swb_dc_dc_pwr_fail
> +Date:		August 2023
> +KernelVersion:	6.6
> +Contact:	Vadim Pasternak <vadimp@nvidia.com>
> +Description:	This file shows 1 in case the system reset happened due to the
> +		failure of any DC-DC power converter devices equipped on the
> +		switch board.
> +
> +		The file is read only.

Thanks a lot, much clearer wording now.

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Vadim Pasternak Aug. 22, 2023, 12:45 p.m. UTC | #2
> -----Original Message-----
> From: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> Sent: Tuesday, 22 August 2023 14:44
> To: Vadim Pasternak <vadimp@nvidia.com>
> Cc: hdegoede@redhat.com; platform-driver-x86@vger.kernel.org
> Subject: Re: [PATCH platform-next v4 16/16] Documentation/ABI: Add new
> attribute for mlxreg-io sysfs interfaces
> 
> On Tue, 22 Aug 2023, Vadim Pasternak wrote:
> 
> > Add documentation for the new attributes:
> > - CPLD versioning: "cpld5_pn", "cpld5_version", "cpld5_version_min".
> > - JTAG capability: "jtag_cap", indicating the available method of
> >   CPLD/FPGA devices field update.
> > - System lid status: "lid_open".
> > - Reset caused by long press of power button: "reset_long_pwr_pb".
> > - Reset caused by switch board DC-DC converter device failure:
> >   "reset_swb_dc_dc_pwr_fail".
> >
> > Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
> > Reviewed-by: Michael Shych <michaelsh@nvidia.com>
> > Reviewed-by: Hans de Goede <hdegoede@redhat.com>
> > ---
> > v3->v4:
> >  Comments provided by Ilpo:
> >  - Modify desription for "reset_swb_dc_dc_pwr_fail".
> > v2->v3:
> >  Comments provided by Hans:
> >  - Document new attribute "reset_swb_dc_dc_pwr_fail".
> > ---
> >  .../ABI/stable/sysfs-driver-mlxreg-io         | 52 +++++++++++++++++++
> >  1 file changed, 52 insertions(+)
> >
> > diff --git a/Documentation/ABI/stable/sysfs-driver-mlxreg-io
> b/Documentation/ABI/stable/sysfs-driver-mlxreg-io
> > index 60953903d007..115302236627 100644
> > --- a/Documentation/ABI/stable/sysfs-driver-mlxreg-io
> > +++ b/Documentation/ABI/stable/sysfs-driver-mlxreg-io
> > @@ -662,3 +662,55 @@ Description:	This file shows the system reset cause
> due to AC power failure.
> >  		Value 1 in file means this is reset cause, 0 - otherwise.
> >
> >  		The file is read only.
> > +
> > +What:		/sys/devices/platform/mlxplat/mlxreg-
> io/hwmon/hwmon*/cpld5_pn
> > +What:		/sys/devices/platform/mlxplat/mlxreg-
> io/hwmon/hwmon*/cpld5_version
> > +What:		/sys/devices/platform/mlxplat/mlxreg-
> io/hwmon/hwmon*/cpld5_version_min
> > +Date:		August 2023
> > +KernelVersion:	6.6
> > +Contact:	Vadim Pasternak <vadimp@nvidia.com>
> > +Description:	These files show with which CPLD part numbers, version and
> minor
> > +		versions have been burned the 5-th CPLD device equipped on
> a
> > +		system.
> > +
> > +		The files are read only.
> > +
> > +What:		/sys/devices/platform/mlxplat/mlxreg-
> io/hwmon/hwmon*/jtag_cap
> > +Date:		August 2023
> > +KernelVersion:	6.6
> > +Contact:	Vadim Pasternak <vadimp@nvidia.com>
> > +Description:    This file indicates the available method of CPLD/FPGA
> devices
> > +		field update through the JTAG chain:
> > +		 b00 - field update through LPC bus register memory space.
> > +		 b01 - Reserved.
> > +		 b10 - Reserved.
> > +		 b11 - field update through CPU GPIOs bit-banging.
> > +
> > +		The file is read only.
> > +
> > +What:		/sys/devices/platform/mlxplat/mlxreg-
> io/hwmon/hwmon*/lid_open
> > +Date:		August 2023
> > +KernelVersion:	6.6
> > +Contact:	Vadim Pasternak <vadimp@nvidia.com>
> > +Description:	1 - indicates that system lid is opened, otherwise 0.
> > +
> > +		The file is read only.
> > +
> > +What:		/sys/devices/platform/mlxplat/mlxreg-
> io/hwmon/hwmon*/reset_long_pwr_pb
> > +Date:		August 2023
> > +KernelVersion:	6.6
> > +Contact:	Vadim Pasternak <vadimp@nvidia.com>
> > +Description:	This file if set 1 indicates that system has been reset by
> > +		long press of power button.
> > +
> > +		The file is read only.
> > +
> > +What:		/sys/devices/platform/mlxplat/mlxreg-
> io/hwmon/hwmon*/reset_swb_dc_dc_pwr_fail
> > +Date:		August 2023
> > +KernelVersion:	6.6
> > +Contact:	Vadim Pasternak <vadimp@nvidia.com>
> > +Description:	This file shows 1 in case the system reset happened due to
> the
> > +		failure of any DC-DC power converter devices equipped on
> the
> > +		switch board.
> > +
> > +		The file is read only.
> 
> Thanks a lot, much clearer wording now.
> 
> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Thank you very much Ilpo for all your reviews!
> 
> --
>  i.
Hans de Goede Aug. 22, 2023, 3:51 p.m. UTC | #3
Hi,

On 8/22/23 13:43, Ilpo Järvinen wrote:
> On Tue, 22 Aug 2023, Vadim Pasternak wrote:
> 
>> Add documentation for the new attributes:
>> - CPLD versioning: "cpld5_pn", "cpld5_version", "cpld5_version_min".
>> - JTAG capability: "jtag_cap", indicating the available method of
>>   CPLD/FPGA devices field update.
>> - System lid status: "lid_open".
>> - Reset caused by long press of power button: "reset_long_pwr_pb".
>> - Reset caused by switch board DC-DC converter device failure:
>>   "reset_swb_dc_dc_pwr_fail".
>>
>> Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
>> Reviewed-by: Michael Shych <michaelsh@nvidia.com>
>> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
>> ---
>> v3->v4:
>>  Comments provided by Ilpo:
>>  - Modify desription for "reset_swb_dc_dc_pwr_fail".

Thank you for your patch-series, I've applied the series to my
review-hans branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.

Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.

Regards,

Hans


>> v2->v3:
>>  Comments provided by Hans:
>>  - Document new attribute "reset_swb_dc_dc_pwr_fail".
>> ---
>>  .../ABI/stable/sysfs-driver-mlxreg-io         | 52 +++++++++++++++++++
>>  1 file changed, 52 insertions(+)
>>
>> diff --git a/Documentation/ABI/stable/sysfs-driver-mlxreg-io b/Documentation/ABI/stable/sysfs-driver-mlxreg-io
>> index 60953903d007..115302236627 100644
>> --- a/Documentation/ABI/stable/sysfs-driver-mlxreg-io
>> +++ b/Documentation/ABI/stable/sysfs-driver-mlxreg-io
>> @@ -662,3 +662,55 @@ Description:	This file shows the system reset cause due to AC power failure.
>>  		Value 1 in file means this is reset cause, 0 - otherwise.
>>  
>>  		The file is read only.
>> +
>> +What:		/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_pn
>> +What:		/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_version
>> +What:		/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_version_min
>> +Date:		August 2023
>> +KernelVersion:	6.6
>> +Contact:	Vadim Pasternak <vadimp@nvidia.com>
>> +Description:	These files show with which CPLD part numbers, version and minor
>> +		versions have been burned the 5-th CPLD device equipped on a
>> +		system.
>> +
>> +		The files are read only.
>> +
>> +What:		/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/jtag_cap
>> +Date:		August 2023
>> +KernelVersion:	6.6
>> +Contact:	Vadim Pasternak <vadimp@nvidia.com>
>> +Description:    This file indicates the available method of CPLD/FPGA devices
>> +		field update through the JTAG chain:
>> +		 b00 - field update through LPC bus register memory space.
>> +		 b01 - Reserved.
>> +		 b10 - Reserved.
>> +		 b11 - field update through CPU GPIOs bit-banging.
>> +
>> +		The file is read only.
>> +
>> +What:		/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/lid_open
>> +Date:		August 2023
>> +KernelVersion:	6.6
>> +Contact:	Vadim Pasternak <vadimp@nvidia.com>
>> +Description:	1 - indicates that system lid is opened, otherwise 0.
>> +
>> +		The file is read only.
>> +
>> +What:		/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_long_pwr_pb
>> +Date:		August 2023
>> +KernelVersion:	6.6
>> +Contact:	Vadim Pasternak <vadimp@nvidia.com>
>> +Description:	This file if set 1 indicates that system has been reset by
>> +		long press of power button.
>> +
>> +		The file is read only.
>> +
>> +What:		/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_swb_dc_dc_pwr_fail
>> +Date:		August 2023
>> +KernelVersion:	6.6
>> +Contact:	Vadim Pasternak <vadimp@nvidia.com>
>> +Description:	This file shows 1 in case the system reset happened due to the
>> +		failure of any DC-DC power converter devices equipped on the
>> +		switch board.
>> +
>> +		The file is read only.
> 
> Thanks a lot, much clearer wording now.
> 
> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
>
Hans de Goede Aug. 22, 2023, 4:27 p.m. UTC | #4
Hi,

On 8/22/23 17:51, Hans de Goede wrote:
> Hi,
> 
> On 8/22/23 13:43, Ilpo Järvinen wrote:
>> On Tue, 22 Aug 2023, Vadim Pasternak wrote:
>>
>>> Add documentation for the new attributes:
>>> - CPLD versioning: "cpld5_pn", "cpld5_version", "cpld5_version_min".
>>> - JTAG capability: "jtag_cap", indicating the available method of
>>>   CPLD/FPGA devices field update.
>>> - System lid status: "lid_open".
>>> - Reset caused by long press of power button: "reset_long_pwr_pb".
>>> - Reset caused by switch board DC-DC converter device failure:
>>>   "reset_swb_dc_dc_pwr_fail".
>>>
>>> Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
>>> Reviewed-by: Michael Shych <michaelsh@nvidia.com>
>>> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
>>> ---
>>> v3->v4:
>>>  Comments provided by Ilpo:
>>>  - Modify desription for "reset_swb_dc_dc_pwr_fail".
> 
> Thank you for your patch-series, I've applied the series to my
> review-hans branch:
> https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
> 
> Note it will show up in my review-hans branch once I've pushed my
> local branch there, which might take a while.
> 
> Once I've run some tests on this branch the patches there will be
> added to the platform-drivers-x86/for-next branch and eventually
> will be included in the pdx86 pull-request to Linus for the next
> merge-window.

Quick follow up I've squashed in a few whitespace changes
into this (16/16) patch to fix a new "make htmldocs" warning:

/home/hans/projects/platform-drivers-x86/Documentation/ABI/stable/sysfs-driver-mlxreg-io:679:  ERROR: Unexpected indentation.

Regards,

Hans



> 
> Regards,
> 
> Hans
> 
> 
>>> v2->v3:
>>>  Comments provided by Hans:
>>>  - Document new attribute "reset_swb_dc_dc_pwr_fail".
>>> ---
>>>  .../ABI/stable/sysfs-driver-mlxreg-io         | 52 +++++++++++++++++++
>>>  1 file changed, 52 insertions(+)
>>>
>>> diff --git a/Documentation/ABI/stable/sysfs-driver-mlxreg-io b/Documentation/ABI/stable/sysfs-driver-mlxreg-io
>>> index 60953903d007..115302236627 100644
>>> --- a/Documentation/ABI/stable/sysfs-driver-mlxreg-io
>>> +++ b/Documentation/ABI/stable/sysfs-driver-mlxreg-io
>>> @@ -662,3 +662,55 @@ Description:	This file shows the system reset cause due to AC power failure.
>>>  		Value 1 in file means this is reset cause, 0 - otherwise.
>>>  
>>>  		The file is read only.
>>> +
>>> +What:		/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_pn
>>> +What:		/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_version
>>> +What:		/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld5_version_min
>>> +Date:		August 2023
>>> +KernelVersion:	6.6
>>> +Contact:	Vadim Pasternak <vadimp@nvidia.com>
>>> +Description:	These files show with which CPLD part numbers, version and minor
>>> +		versions have been burned the 5-th CPLD device equipped on a
>>> +		system.
>>> +
>>> +		The files are read only.
>>> +
>>> +What:		/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/jtag_cap
>>> +Date:		August 2023
>>> +KernelVersion:	6.6
>>> +Contact:	Vadim Pasternak <vadimp@nvidia.com>
>>> +Description:    This file indicates the available method of CPLD/FPGA devices
>>> +		field update through the JTAG chain:
>>> +		 b00 - field update through LPC bus register memory space.
>>> +		 b01 - Reserved.
>>> +		 b10 - Reserved.
>>> +		 b11 - field update through CPU GPIOs bit-banging.
>>> +
>>> +		The file is read only.
>>> +
>>> +What:		/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/lid_open
>>> +Date:		August 2023
>>> +KernelVersion:	6.6
>>> +Contact:	Vadim Pasternak <vadimp@nvidia.com>
>>> +Description:	1 - indicates that system lid is opened, otherwise 0.
>>> +
>>> +		The file is read only.
>>> +
>>> +What:		/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_long_pwr_pb
>>> +Date:		August 2023
>>> +KernelVersion:	6.6
>>> +Contact:	Vadim Pasternak <vadimp@nvidia.com>
>>> +Description:	This file if set 1 indicates that system has been reset by
>>> +		long press of power button.
>>> +
>>> +		The file is read only.
>>> +
>>> +What:		/sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/reset_swb_dc_dc_pwr_fail
>>> +Date:		August 2023
>>> +KernelVersion:	6.6
>>> +Contact:	Vadim Pasternak <vadimp@nvidia.com>
>>> +Description:	This file shows 1 in case the system reset happened due to the
>>> +		failure of any DC-DC power converter devices equipped on the
>>> +		switch board.
>>> +
>>> +		The file is read only.
>>
>> Thanks a lot, much clearer wording now.
>>
>> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
>>