<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/drivers/pci/switch, branch master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/drivers/pci/switch?h=master</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/drivers/pci/switch?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2022-06-09T17:28:21Z</updated>
<entry>
<title>PCI: switchtec: Prefer ida_alloc()/free() over ida_simple_get()/remove()</title>
<updated>2022-06-09T17:28:21Z</updated>
<author>
<name>Ke Liu</name>
<email>liuke94@huawei.com</email>
</author>
<published>2022-06-02T07:11:15Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=aa195350cdc8e93a890c56d0999b17c441b60b97'/>
<id>urn:sha1:aa195350cdc8e93a890c56d0999b17c441b60b97</id>
<content type='text'>
Use ida_alloc() and ida_free() instead of deprecated ida_simple_get() and
ida_simple_remove().

Link: https://lore.kernel.org/r/20220602071115.3833935-1-liuke94@huawei.com
Signed-off-by: Ke Liu &lt;liuke94@huawei.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Acked-by: Logan Gunthorpe &lt;logang@deltatee.com&gt;
</content>
</entry>
<entry>
<title>PCI/switchtec: Declare local state_names[] as static</title>
<updated>2021-11-19T18:14:02Z</updated>
<author>
<name>Kelvin Cao</name>
<email>kelvin.cao@microchip.com</email>
</author>
<published>2021-11-19T00:38:03Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=b76521f6482d2a2a691e4eb1a496d55d73aea064'/>
<id>urn:sha1:b76521f6482d2a2a691e4eb1a496d55d73aea064</id>
<content type='text'>
The local state_names[] array is constant and need not be allocated and
populated each time we enter stuser_set_state().  Declare it as static.

See the link below for the discussion.

  https://lore.kernel.org/r/20211014141859.11444-1-kelvin.cao@microchip.com/

[bhelgaas: simplify commit log]
Suggested-by: Krzysztof Wilczyński &lt;kw@linux.com&gt;
Link: https://lore.kernel.org/r/20211119003803.2333-3-kelvin.cao@microchip.com
Signed-off-by: Kelvin Cao &lt;kelvin.cao@microchip.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Reviewed-by: Logan Gunthorpe &lt;logang@deltatee.com&gt;
</content>
</entry>
<entry>
<title>PCI/switchtec: Add Gen4 automotive device IDs</title>
<updated>2021-11-19T18:13:50Z</updated>
<author>
<name>Kelvin Cao</name>
<email>kelvin.cao@microchip.com</email>
</author>
<published>2021-11-19T00:38:02Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=bb17b15813eacc85ae8cb0c3901408ba051ebf91'/>
<id>urn:sha1:bb17b15813eacc85ae8cb0c3901408ba051ebf91</id>
<content type='text'>
Advertise support of the Gen4 automotive variants in module's device ID
table and add the same IDs to the list of switchtec quirks.

Link: https://lore.kernel.org/r/20211119003803.2333-2-kelvin.cao@microchip.com
Signed-off-by: Kelvin Cao &lt;kelvin.cao@microchip.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Reviewed-by: Logan Gunthorpe &lt;logang@deltatee.com&gt;
</content>
</entry>
<entry>
<title>PCI/switchtec: Add check of event support</title>
<updated>2021-10-14T14:22:47Z</updated>
<author>
<name>Logan Gunthorpe</name>
<email>logang@deltatee.com</email>
</author>
<published>2021-10-14T14:18:59Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=9f37ab0412eba537377c38b1dde1a04fbd7b5264'/>
<id>urn:sha1:9f37ab0412eba537377c38b1dde1a04fbd7b5264</id>
<content type='text'>
Not all events are supported by every gen/variant of the Switchtec
firmware. To solve this, since Gen4, a new bit in each event header
is introduced to indicate if an event is supported by the firmware.

Link: https://lore.kernel.org/r/20211014141859.11444-6-kelvin.cao@microchip.com
Signed-off-by: Logan Gunthorpe &lt;logang@deltatee.com&gt;
Signed-off-by: Kelvin Cao &lt;kelvin.cao@microchip.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
</content>
</entry>
<entry>
<title>PCI/switchtec: Replace ENOTSUPP with EOPNOTSUPP</title>
<updated>2021-10-14T14:22:47Z</updated>
<author>
<name>Kelvin Cao</name>
<email>kelvin.cao@microchip.com</email>
</author>
<published>2021-10-14T14:18:58Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=67116444cf55e1d070ee2060ffe4d1c72917ec31'/>
<id>urn:sha1:67116444cf55e1d070ee2060ffe4d1c72917ec31</id>
<content type='text'>
ENOTSUPP is not a SUSV4 error code, and the following checkpatch.pl
warning will be given for new patches which still use ENOTSUPP.

    WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP

See the link below for the discussion.

  https://lore.kernel.org/netdev/20200511165319.2251678-1-kuba@kernel.org/

Replace ENOTSUPP with EOPNOTSUPP to align with future patches which will
be using EOPNOTSUPP.

Link: https://lore.kernel.org/r/20211014141859.11444-5-kelvin.cao@microchip.com
Signed-off-by: Kelvin Cao &lt;kelvin.cao@microchip.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
</content>
</entry>
<entry>
<title>PCI/switchtec: Update the way of getting management VEP instance ID</title>
<updated>2021-10-14T14:22:47Z</updated>
<author>
<name>Kelvin Cao</name>
<email>kelvin.cao@microchip.com</email>
</author>
<published>2021-10-14T14:18:57Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=1420ac218abcc1df809eedfb0f7351941b01c785'/>
<id>urn:sha1:1420ac218abcc1df809eedfb0f7351941b01c785</id>
<content type='text'>
Gen4 firmware adds DMA VEP and NVMe VEP support in VEP (virtual EP)
instance ID register in addtion to management EP, update the way of
getting management VEP instance ID.

Link: https://lore.kernel.org/r/20211014141859.11444-4-kelvin.cao@microchip.com
Signed-off-by: Kelvin Cao &lt;kelvin.cao@microchip.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
</content>
</entry>
<entry>
<title>PCI/switchtec: Fix a MRPC error status handling issue</title>
<updated>2021-10-14T14:22:47Z</updated>
<author>
<name>Kelvin Cao</name>
<email>kelvin.cao@microchip.com</email>
</author>
<published>2021-10-14T14:18:56Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=551ec658b69807318aeef5506da886cf9587b251'/>
<id>urn:sha1:551ec658b69807318aeef5506da886cf9587b251</id>
<content type='text'>
If an error is encountered when executing a MRPC command, the firmware
will set the status register to SWITCHTEC_MRPC_STATUS_ERROR and return
the error code in the return value register.

Add handling of SWITCHTEC_MRPC_STATUS_ERROR on status register when
completing a MRPC command.

Link: https://lore.kernel.org/r/20211014141859.11444-3-kelvin.cao@microchip.com
Signed-off-by: Kelvin Cao &lt;kelvin.cao@microchip.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
</content>
</entry>
<entry>
<title>PCI/switchtec: Error out MRPC execution when MMIO reads fail</title>
<updated>2021-10-14T14:22:47Z</updated>
<author>
<name>Kelvin Cao</name>
<email>kelvin.cao@microchip.com</email>
</author>
<published>2021-10-14T14:18:55Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=1a323bd071dd81c9c136c06fad9e02c403b48aca'/>
<id>urn:sha1:1a323bd071dd81c9c136c06fad9e02c403b48aca</id>
<content type='text'>
A firmware hard reset may be initiated by various mechanisms including a
UART interface, TWI sideband interface from BMC, MRPC command from
userspace, etc. The switchtec management driver is unaware of these
resets.

The reset clears PCI state including the BARs and Memory Space Enable
bits, so the device no longer responds to the MMIO accesses the driver
uses to operate it.

MMIO reads to the device will fail with a PCIe error. When the root
complex handles that error, it typically fabricates ~0 data to complete
the CPU read.

Check for this sort of error by reading the device ID from MMIO space.
This ID can never be ~0, so if we see that value, it probably means the
PCIe Memory Read failed and we should return an error indication to the
application using the switchtec driver.

Link: https://lore.kernel.org/r/20211014141859.11444-2-kelvin.cao@microchip.com
Signed-off-by: Kelvin Cao &lt;kelvin.cao@microchip.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
</content>
</entry>
<entry>
<title>PCI/sysfs: Use sysfs_emit() and sysfs_emit_at() in "show" functions</title>
<updated>2021-06-04T03:14:47Z</updated>
<author>
<name>Krzysztof Wilczyński</name>
<email>kw@linux.com</email>
</author>
<published>2021-06-03T00:01:07Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=f8cf6e513ec4f0e207f56c27d5030da429ac2cae'/>
<id>urn:sha1:f8cf6e513ec4f0e207f56c27d5030da429ac2cae</id>
<content type='text'>
The sysfs_emit() and sysfs_emit_at() functions were introduced to make
it less ambiguous which function is preferred when writing to the output
buffer in a device attribute's "show" callback [1].

Convert the PCI sysfs object "show" functions from sprintf(), snprintf()
and scnprintf() to sysfs_emit() and sysfs_emit_at() accordingly, as the
latter is aware of the PAGE_SIZE buffer and correctly returns the number
of bytes written into the buffer.

No functional change intended.

[1] Documentation/filesystems/sysfs.rst

Related commit: ad025f8e46f3 ("PCI/sysfs: Use sysfs_emit() and
sysfs_emit_at() in "show" functions").

Link: https://lore.kernel.org/r/20210603000112.703037-2-kw@linux.com
Signed-off-by: Krzysztof Wilczyński &lt;kw@linux.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
Reviewed-by: Logan Gunthorpe &lt;logang@deltatee.com&gt;
</content>
</entry>
<entry>
<title>PCI: switchtec: Add missing __iomem tag to fix sparse warnings</title>
<updated>2020-07-31T16:23:45Z</updated>
<author>
<name>Logan Gunthorpe</name>
<email>logang@deltatee.com</email>
</author>
<published>2020-07-28T19:24:34Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=42dae8937406c98ce0cb6ff0d683765c854098d9'/>
<id>urn:sha1:42dae8937406c98ce0cb6ff0d683765c854098d9</id>
<content type='text'>
Fix a missing __iomem tag in the init_pfn() function. This fixes a sparse
warning of the form:

  $ make C=2 drivers/pci/switch/
  drivers/pci/switch/switchtec.c:... incorrect type assignment(different address spaces)

Fixes: 080b47def5e5 ("MicroSemi Switchtec management interface driver")
Link: https://lore.kernel.org/r/20200728192434.18993-2-logang@deltatee.com
Signed-off-by: Logan Gunthorpe &lt;logang@deltatee.com&gt;
Signed-off-by: Bjorn Helgaas &lt;bhelgaas@google.com&gt;
</content>
</entry>
</feed>
