<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/drivers/platform/mellanox, branch linus/master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/drivers/platform/mellanox?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/drivers/platform/mellanox?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-06-10T19:59:08Z</updated>
<entry>
<title>platform/mellanox: Add static in struct declaration.</title>
<updated>2022-06-10T19:59:08Z</updated>
<author>
<name>Michael Shych</name>
<email>michaelsh@nvidia.com</email>
</author>
<published>2022-06-02T14:51:03Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=b9c29f391f4195a778620f3d2efd0d9746a414fe'/>
<id>urn:sha1:b9c29f391f4195a778620f3d2efd0d9746a414fe</id>
<content type='text'>
Fix problem of missing static in struct declaration.

Fixes: 662f24826f954 ("platform/mellanox: Add support for new SN2201 system")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Michael Shych &lt;michaelsh@nvidia.com&gt;
Link: https://lore.kernel.org/r/20220602145103.11859-1-michaelsh@nvidia.com
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
</content>
</entry>
<entry>
<title>platform/mellanox: Spelling s/platfom/platform/</title>
<updated>2022-06-10T19:09:49Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert@linux-m68k.org</email>
</author>
<published>2022-05-24T07:15:44Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=a4c934d74e408cb5ea5209b5fdf6184e3e250b1b'/>
<id>urn:sha1:a4c934d74e408cb5ea5209b5fdf6184e3e250b1b</id>
<content type='text'>
Fix a misspelling of the word "platform".

Signed-off-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Acked-by: Michael Shych &lt;michaelsh@nvidia.com&gt;
Link: https://lore.kernel.org/r/9c8edde31e271311b7832d7677fe84aba917da8d.1653376503.git.geert@linux-m68k.org
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
</content>
</entry>
<entry>
<title>platform/mellanox: Add support for new SN2201 system</title>
<updated>2022-05-12T13:35:29Z</updated>
<author>
<name>Michael Shych</name>
<email>michaelsh@nvidia.com</email>
</author>
<published>2022-04-30T11:58:08Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=662f24826f954d49d56211822bcd7b3109287961'/>
<id>urn:sha1:662f24826f954d49d56211822bcd7b3109287961</id>
<content type='text'>
The SN2201 is a highly integrated for one rack unit system with
L3 management switches. It has 48 x 1Gbps RJ45 + 4 x 100G QSFP28
ports in a compact 1RU form factor. The system also including a
serial port (RS-232 interface), an OOB port (1G/100M MDI interface)
and USB ports for management functions.

The processor used on SN2201 is Intel Atom®Processor C Series,
C3338R which is one of the Denverton product families.

System equipped with Nvidia®Spectrum-1 32x100GbE Ethernet switch.

Features:
-  48 ports RJ45 support 10/100/1000M speed.
-  Support 4 QSFP28 ports with 10/25/40/50/100G.
-  A USB port is available on SN2201. This port is used for image and File
   Management purposes - backing up and restoring images and config files
-  Provides flow control mechanism to ensure zero packet loss.
   Uses backpressure for half-duplex operation and IEEE802.3x
   for full duplex operation.
-  Cut-through and Store-and-Forward free switching mechanism.
   By default the mode is cut-through.
-  Standard 1U chassis height.
-  19" rack mountable.
-  Extensive system LED and per port LEDs.
-  Redundant power supply.
-  2 x AC Power Supply (one PSU is default, second PSU is optional).

Signed-off-by: Michael Shych &lt;michaelsh@nvidia.com&gt;
Reviewed-by: Vadim Pasternak &lt;vadimp@nvidia.com&gt;
Link: https://lore.kernel.org/r/20220430115809.54565-3-michaelsh@nvidia.com
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
</content>
</entry>
<entry>
<title>platform/mellanox: mlxbf-pmc: Fix an IS_ERR() vs NULL bug in mlxbf_pmc_map_counters</title>
<updated>2021-12-21T18:35:22Z</updated>
<author>
<name>Miaoqian Lin</name>
<email>linmq006@gmail.com</email>
</author>
<published>2021-12-10T07:07:53Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=804034c4ffc502795cea9b3867acb2ec7fad99ba'/>
<id>urn:sha1:804034c4ffc502795cea9b3867acb2ec7fad99ba</id>
<content type='text'>
The devm_ioremap() function returns NULL on error, it doesn't return
error pointers. Also according to doc of device_property_read_u64_array,
values in info array are properties of device or NULL.

Signed-off-by: Miaoqian Lin &lt;linmq006@gmail.com&gt;
Link: https://lore.kernel.org/r/20211210070753.10761-1-linmq006@gmail.com
Reviewed-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
</content>
</entry>
<entry>
<title>platform/mellanox: mlxreg-lc: fix error code in mlxreg_lc_create_static_devices()</title>
<updated>2021-11-16T09:19:46Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2021-11-10T07:43:46Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=287273a80be5d45d59d1742557cab69cabf0ef3c'/>
<id>urn:sha1:287273a80be5d45d59d1742557cab69cabf0ef3c</id>
<content type='text'>
This code should be using PTR_ERR() instead of IS_ERR().  And because
it's using the wrong "dev-&gt;client" pointer, the IS_ERR() check will be
false, meaning the function returns success.

Fixes: 62f9529b8d5c ("platform/mellanox: mlxreg-lc: Add initial support for Nvidia line card devices")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Acked-by: Vadim Pasternak &lt;vadimp@nvidia.com&gt;
Link: https://lore.kernel.org/r/20211110074346.GB5176@kili
Reviewed-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
</content>
</entry>
<entry>
<title>platform/mellanox: mlxreg-lc: Add initial support for Nvidia line card devices</title>
<updated>2021-10-19T08:41:56Z</updated>
<author>
<name>Vadim Pasternak</name>
<email>vadimp@nvidia.com</email>
</author>
<published>2021-10-02T09:32:36Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=62f9529b8d5c87b89c3d9698405014bc8f370fbd'/>
<id>urn:sha1:62f9529b8d5c87b89c3d9698405014bc8f370fbd</id>
<content type='text'>
Provide support for the Nvidia MSN4800-XX line cards for MSN4800
Ethernet modular switch system, providing a high performance switching
solution for Enterprise Data Centers (EDC) for building Ethernet based
clusters, High-Performance Computing (HPC) and embedded environments.
Initial version provides support for line card type MSN4800-C16. This
type of line card is equipped with:
- Lattice CPLD device, used for system and ports control.
- four Nvidia gearbox devices, used for port splitting.
- FPGA device, used for gearboxes management.
- 16x100G QSFP28 ports.
- hotpswap controllers, voltage regulators, analog-to-digital
  convertors, nvram devices.
- status LED.

During initialization driver creates:
- line card's I2C tree through "i2c-mux-mlxcpd" driver.
- line card's LED objects through "leds-mlxreg" driver.
- line card's CPLD register space input / output "hwmon" attributes for
  line control and monitoring through "mlxreg-io" driver. These
  attributes provide CPLD and FPAG versioning, control for upgradable
  components burning, NVRAM devices write protection, line card
  revision, line card power consuming, line card reset cause
  indication, etcetera.

Lattice CPLD device and nvram devices are feeding from auxiliary power
domain and accessible, when line card is powered off. These devices
are connected by line card driver probing routine, invoked after line
card security verification is done by hardware and event lc#n_verified
is received for line card located in slot #n.

Gearboxes, FPGA, hotpswap controllers, voltage regulators,
analog-to-digital convertors are feeding from main power domain. These
devices are connected after power good event "lc#n_powered" is received
for line card located in slot #n.

The driver 'mlxreg-lc' is driven by 'mlxreg-hotplug' driver following
relevant "hotplug" events.

Signed-off-by: Vadim Pasternak &lt;vadimp@nvidia.com&gt;
Reviewed-by: Michael Shych &lt;michaelsh@nvidia.com&gt;
Link: https://lore.kernel.org/r/20211002093238.3771419-8-vadimp@nvidia.com
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
</content>
</entry>
<entry>
<title>platform/mellanox: mlxreg-io: Extend number of hwmon attributes</title>
<updated>2021-10-19T08:41:55Z</updated>
<author>
<name>Vadim Pasternak</name>
<email>vadimp@nvidia.com</email>
</author>
<published>2021-10-02T09:32:34Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=bbfd79c681706e2be8cdf95e2711b9ff9c669ae4'/>
<id>urn:sha1:bbfd79c681706e2be8cdf95e2711b9ff9c669ae4</id>
<content type='text'>
Extend maximum number of the attributes, exposed to 'sysfs'.
It is requires in order to support modular systems, which
provide more attributes for system control, statuses and info.

Signed-off-by: Vadim Pasternak &lt;vadimp@nvidia.com&gt;
Reviewed-by: Michael Shych &lt;michaelsh@nvidia.com&gt;
Link: https://lore.kernel.org/r/20211002093238.3771419-6-vadimp@nvidia.com
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
</content>
</entry>
<entry>
<title>platform/mellanox: mlxreg-hotplug: Extend logic for hotplug devices operations</title>
<updated>2021-10-19T08:41:55Z</updated>
<author>
<name>Vadim Pasternak</name>
<email>vadimp@nvidia.com</email>
</author>
<published>2021-10-02T09:32:32Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=bb1023b6da379985ff888dcd7bc601735d02267a'/>
<id>urn:sha1:bb1023b6da379985ff888dcd7bc601735d02267a</id>
<content type='text'>
Extend the structure 'mlxreg_hotplug_device" with platform device field
to allow transition of the register map and system interrupt line number
to underlying hotplug devices, sharing the same register map and
same interrupt line with 'mlxreg-hotplug' driver.

Extend logic for hotplug devices creation and removing according to
the action associated with the hotplug device description. Previously
hotplug driver was capable to attach / de-attach upon hotplug events
only I2C devices handled by simple I2C drivers. Now it should be able
to attach also devices handled by the platform drivers.

The motivation is to allow transition of platform data like:
- system interrupt line number, sharing with 'mlxreg-hotplug' to
  underlying hotplug devices.
- shared register map of programmable devices on main board to
  underlying hotplug devices.

Additioanlly the number of 'sysfs' attributes is increased, since
modular system defines more 'sysfs' attributes.

Signed-off-by: Vadim Pasternak &lt;vadimp@nvidia.com&gt;
Reviewed-by: Michael Shych &lt;michaelsh@nvidia.com&gt;
Link: https://lore.kernel.org/r/20211002093238.3771419-4-vadimp@nvidia.com
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
</content>
</entry>
<entry>
<title>platform/mellanox: mlxreg-io: Fix read access of n-bytes size attributes</title>
<updated>2021-10-11T12:54:41Z</updated>
<author>
<name>Vadim Pasternak</name>
<email>vadimp@nvidia.com</email>
</author>
<published>2021-09-27T14:22:14Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=5fd56f11838da1580cc77743c08cf02c9cd48380'/>
<id>urn:sha1:5fd56f11838da1580cc77743c08cf02c9cd48380</id>
<content type='text'>
Fix shift argument for function rol32(). It should be provided in bits,
while was provided in bytes.

Fixes: 86148190a7db ("platform/mellanox: mlxreg-io: Add support for complex attributes")
Signed-off-by: Vadim Pasternak &lt;vadimp@nvidia.com&gt;
Link: https://lore.kernel.org/r/20210927142214.2613929-3-vadimp@nvidia.com
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
</content>
</entry>
<entry>
<title>platform/mellanox: mlxreg-io: Fix argument base in kstrtou32() call</title>
<updated>2021-10-11T12:54:41Z</updated>
<author>
<name>Vadim Pasternak</name>
<email>vadimp@nvidia.com</email>
</author>
<published>2021-09-27T14:22:13Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=452dcfab995437888106a5af6730363f67efdf79'/>
<id>urn:sha1:452dcfab995437888106a5af6730363f67efdf79</id>
<content type='text'>
Change kstrtou32() argument 'base' to be zero instead of 'len'.
It works by chance for setting one bit value, but it is not supposed to
work in case value passed to mlxreg_io_attr_store() is greater than 1.

It works for example, for:
echo 1 &gt; /sys/devices/platform/mlxplat/mlxreg-io/hwmon/.../jtag_enable
But it will fail for:
echo n &gt; /sys/devices/platform/mlxplat/mlxreg-io/hwmon/.../jtag_enable,
where n &gt; 1.

The flow for input buffer conversion is as below:
_kstrtoull(const char *s, unsigned int base, unsigned long long *res)
calls:
rv = _parse_integer(s, base, &amp;_res);

For the second case, where n &gt; 1:
- _parse_integer() converts 's' to 'val'.
  For n=2, 'len' is set to 2 (string buffer is 0x32 0x0a), for n=3
  'len' is set to 3 (string buffer 0x33 0x0a), etcetera.
- 'base' is equal or greater then '2' (length of input buffer).

As a result, _parse_integer() exits with result zero (rv):
	rv = 0;
	while (1) {
		...
		if (val &gt;= base)-&gt; (2 &gt;= 2)
			break;
		...
		rv++;
		...
	}

And _kstrtoull() in their turn will fail:
	if (rv == 0)
		return -EINVAL;

Fixes: 5ec4a8ace06c ("platform/mellanox: Introduce support for Mellanox register access driver")
Signed-off-by: Vadim Pasternak &lt;vadimp@nvidia.com&gt;
Link: https://lore.kernel.org/r/20210927142214.2613929-2-vadimp@nvidia.com
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
</content>
</entry>
</feed>
