mbox series

[00/12] Switchtec Fixes and Gen4 Support

Message ID 20200106190337.2428-1-logang@deltatee.com
Headers show
Series Switchtec Fixes and Gen4 Support | expand

Message

Logan Gunthorpe Jan. 6, 2020, 7:03 p.m. UTC
Hi,

Please find a bunch of patches for the switchtec driver collected over the
last few months.

The first 2 patches fix a couple of minor bugs. Patch 3 adds support for
a new event that is available in specific firmware versions. Patches 4 and
5 are some code cleanup changes to simplify the logic. And the last 6
patches implement support for the new Gen4 hardware.

This patchset is based on v5.5-rc5 and a git branch is available here:

https://github.com/sbates130272/linux-p2pmem switchtec-next

Thanks,

Logan

--

Kelvin Cao (3):
  PCI/switchtec: Add gen4 support in struct flash_info_regs
  PCI/switchtec: Add permission check for the GAS access MRPC commands
  PCI/switchtec: Introduce gen4 variant IDS in the device ID table

Logan Gunthorpe (6):
  PCI/switchtec: Fix vep_vector_number ioread width
  PCI/switchtec: Add support for new events
  PCI/switchtec: Introduce Generation Variable
  PCI/switchtec: Separate out gen3 specific fields in the sys_info_regs
    structure
  PCI/switchtec: Add gen4 support in struct sys_info_regs
  PCI: Apply switchtec DMA aliasing quirk to GEN4 devices

Wesley Sheng (3):
  PCI/switchtec: Use dma_set_mask_and_coherent()
  PCI/switchtec: Remove redundant valid PFF number count
  PCI/switchtec: Move check event id from mask_event() to
    switchtec_event_isr()

 drivers/pci/quirks.c                 |  18 ++
 drivers/pci/switch/switchtec.c       | 365 ++++++++++++++++++++-------
 include/linux/switchtec.h            | 160 ++++++++++--
 include/uapi/linux/switchtec_ioctl.h |  13 +-
 4 files changed, 450 insertions(+), 106 deletions(-)

--
2.20.1

Comments

Bjorn Helgaas Jan. 8, 2020, 9:47 p.m. UTC | #1
On Mon, Jan 06, 2020 at 12:03:25PM -0700, Logan Gunthorpe wrote:
> Hi,
> 
> Please find a bunch of patches for the switchtec driver collected over the
> last few months.
> 
> The first 2 patches fix a couple of minor bugs. Patch 3 adds support for
> a new event that is available in specific firmware versions. Patches 4 and
> 5 are some code cleanup changes to simplify the logic. And the last 6
> patches implement support for the new Gen4 hardware.
> 
> This patchset is based on v5.5-rc5 and a git branch is available here:
> 
> https://github.com/sbates130272/linux-p2pmem switchtec-next
> 
> Thanks,
> 
> Logan
> 
> --
> 
> Kelvin Cao (3):
>   PCI/switchtec: Add gen4 support in struct flash_info_regs
>   PCI/switchtec: Add permission check for the GAS access MRPC commands
>   PCI/switchtec: Introduce gen4 variant IDS in the device ID table
> 
> Logan Gunthorpe (6):
>   PCI/switchtec: Fix vep_vector_number ioread width
>   PCI/switchtec: Add support for new events
>   PCI/switchtec: Introduce Generation Variable
>   PCI/switchtec: Separate out gen3 specific fields in the sys_info_regs
>     structure
>   PCI/switchtec: Add gen4 support in struct sys_info_regs
>   PCI: Apply switchtec DMA aliasing quirk to GEN4 devices
> 
> Wesley Sheng (3):
>   PCI/switchtec: Use dma_set_mask_and_coherent()
>   PCI/switchtec: Remove redundant valid PFF number count
>   PCI/switchtec: Move check event id from mask_event() to
>     switchtec_event_isr()

Current order is:

  [PATCH 01/12] PCI/switchtec: Use dma_set_mask_and_coherent()
  [PATCH 02/12] PCI/switchtec: Fix vep_vector_number ioread width
  [PATCH 03/12] PCI/switchtec: Add support for new events
  [PATCH 04/12] PCI/switchtec: Remove redundant valid PFF number count
  [PATCH 05/12] PCI/switchtec: Move check event id from mask_event() to switchtec_event_isr()
  [PATCH 06/12] PCI/switchtec: Introduce Generation Variable
  [PATCH 07/12] PCI/switchtec: Separate out gen3 specific fields in the sys_info_regs structure
  [PATCH 08/12] PCI/switchtec: Add gen4 support in struct sys_info_regs
  [PATCH 09/12] PCI/switchtec: Add gen4 support in struct flash_info_regs
  [PATCH 10/12] PCI/switchtec: Add permission check for the GAS access MRPC commands

10/12 looks lonely in the middle of the gen4 stuff, and it looks like
it's unrelated to gen3/gen4?  Maybe it could be moved up after 05/12?

  [PATCH 11/12] PCI/switchtec: Introduce gen4 variant IDS in the device ID table
  [PATCH 12/12] PCI: Apply switchtec DMA aliasing quirk to GEN4 devices

I speculatively reordered the permission check patch and applied these
to my pci/switchtec branch for v5.6 (reverse order from "git log"):

  b96abab6314f ("PCI/switchtec: Add permission check for the GAS access MRPC commands")
  5f23367bd4df ("PCI/switchtec: Move check event ID from mask_event() to switchtec_event_isr()")
  6722d609bc82 ("PCI/switchtec: Remove redundant valid PFF number count")
  3f3a521ecc81 ("PCI/switchtec: Add support for intercom notify and UEC Port")
  9375646b4cf0 ("PCI/switchtec: Fix vep_vector_number ioread width")
  aa82130a22f7 ("PCI/switchtec: Use dma_set_mask_and_coherent()")

If you rework any of the subsequent ones, you can just post those
without reposting these first six.

Bjorn
Logan Gunthorpe Jan. 8, 2020, 9:53 p.m. UTC | #2
On 2020-01-08 2:47 p.m., Bjorn Helgaas wrote:
> On Mon, Jan 06, 2020 at 12:03:25PM -0700, Logan Gunthorpe wrote:
>> Hi,
>>
>> Please find a bunch of patches for the switchtec driver collected over the
>> last few months.
>>
>> The first 2 patches fix a couple of minor bugs. Patch 3 adds support for
>> a new event that is available in specific firmware versions. Patches 4 and
>> 5 are some code cleanup changes to simplify the logic. And the last 6
>> patches implement support for the new Gen4 hardware.
>>
>> This patchset is based on v5.5-rc5 and a git branch is available here:
>>
>> https://github.com/sbates130272/linux-p2pmem switchtec-next
>>
>> Thanks,
>>
>> Logan
>>
>> --
>>
>> Kelvin Cao (3):
>>   PCI/switchtec: Add gen4 support in struct flash_info_regs
>>   PCI/switchtec: Add permission check for the GAS access MRPC commands
>>   PCI/switchtec: Introduce gen4 variant IDS in the device ID table
>>
>> Logan Gunthorpe (6):
>>   PCI/switchtec: Fix vep_vector_number ioread width
>>   PCI/switchtec: Add support for new events
>>   PCI/switchtec: Introduce Generation Variable
>>   PCI/switchtec: Separate out gen3 specific fields in the sys_info_regs
>>     structure
>>   PCI/switchtec: Add gen4 support in struct sys_info_regs
>>   PCI: Apply switchtec DMA aliasing quirk to GEN4 devices
>>
>> Wesley Sheng (3):
>>   PCI/switchtec: Use dma_set_mask_and_coherent()
>>   PCI/switchtec: Remove redundant valid PFF number count
>>   PCI/switchtec: Move check event id from mask_event() to
>>     switchtec_event_isr()
> 
> Current order is:
> 
>   [PATCH 01/12] PCI/switchtec: Use dma_set_mask_and_coherent()
>   [PATCH 02/12] PCI/switchtec: Fix vep_vector_number ioread width
>   [PATCH 03/12] PCI/switchtec: Add support for new events
>   [PATCH 04/12] PCI/switchtec: Remove redundant valid PFF number count
>   [PATCH 05/12] PCI/switchtec: Move check event id from mask_event() to switchtec_event_isr()
>   [PATCH 06/12] PCI/switchtec: Introduce Generation Variable
>   [PATCH 07/12] PCI/switchtec: Separate out gen3 specific fields in the sys_info_regs structure
>   [PATCH 08/12] PCI/switchtec: Add gen4 support in struct sys_info_regs
>   [PATCH 09/12] PCI/switchtec: Add gen4 support in struct flash_info_regs
>   [PATCH 10/12] PCI/switchtec: Add permission check for the GAS access MRPC commands
> 
> 10/12 looks lonely in the middle of the gen4 stuff, and it looks like
> it's unrelated to gen3/gen4?  Maybe it could be moved up after 05/12?

Yes, sort of: It's related to GEN4 because the GAS access MRPC command
is introduced in GEN4. So it won't really have any effect until after
the GEN4 IDs are added. But there is no harm in applying it earlier.

> I speculatively reordered the permission check patch and applied these
> to my pci/switchtec branch for v5.6 (reverse order from "git log"):
> 
>   b96abab6314f ("PCI/switchtec: Add permission check for the GAS access MRPC commands")
>   5f23367bd4df ("PCI/switchtec: Move check event ID from mask_event() to switchtec_event_isr()")
>   6722d609bc82 ("PCI/switchtec: Remove redundant valid PFF number count")
>   3f3a521ecc81 ("PCI/switchtec: Add support for intercom notify and UEC Port")
>   9375646b4cf0 ("PCI/switchtec: Fix vep_vector_number ioread width")
>   aa82130a22f7 ("PCI/switchtec: Use dma_set_mask_and_coherent()")
> 
> If you rework any of the subsequent ones, you can just post those
> without reposting these first six.

Sounds good, thanks!

Logan