Skip to contentSkip to conversation

Switchtec Updates

PATCH Applied Logan Gunthorpe 2 participants 4 messages Nov 29, 2017 – Dec 5, 2017

Subsystems (2)
lore
Share & tools
lore

Logan Gunthorpe

author maintainer
#0 lore raw

cover Switchtec Updates

Hi Bjorn,

Blease accept the following two patches. The first adds a couple more device IDs for the Switchtec driver. The second adds a new event type for it to report.

Thanks,

Logan

Kelvin Cao (1):
switchtec: Add device IDs for PSX 24xG3 and PSX 48xG3

Logan Gunthorpe (1):
switchtec: Added Global Fabric Manager Server (GFMS) event

 drivers/pci/switch/switchtec.c       | 3 +++
 include/linux/switchtec.h            | 3 +++
 include/uapi/linux/switchtec_ioctl.h | 3 ++-
 3 files changed, 8 insertions(+), 1 deletion(-)

--
2.11.0

author maintainer
#1 lore raw

PATCH 1/2 switchtec: Added Global Fabric Manager Server (GFMS) event

Add a new event type that is newly exposed by recent firmware. The event will never occur if the firmware is too old. If user space tries to use this event in an older kernel, it will just get an EINVAL which is perfectly acceptable in the existing user space code.

---
 drivers/pci/switch/switchtec.c       | 1 +
 include/linux/switchtec.h            | 3 +++
 include/uapi/linux/switchtec_ioctl.h | 3 ++-
 3 files changed, 6 insertions(+), 1 deletion(-)
drivers/pci/switch/switchtec.c +1 -0
index 730cc897b94d..7668d270725d 100644
@@ -707,6 +707,7 @@ static const struct event_reg {
 	EV_GLB(SWITCHTEC_IOCTL_EVENT_CLI_MRPC_COMP_ASYNC,
 	       cli_mrpc_comp_async_hdr),
 	EV_GLB(SWITCHTEC_IOCTL_EVENT_GPIO_INT, gpio_interrupt_hdr),
+	EV_GLB(SWITCHTEC_IOCTL_EVENT_GFMS, gfms_event_hdr),
 	EV_PAR(SWITCHTEC_IOCTL_EVENT_PART_RESET, part_reset_hdr),
 	EV_PAR(SWITCHTEC_IOCTL_EVENT_MRPC_COMP, mrpc_comp_hdr),
 	EV_PAR(SWITCHTEC_IOCTL_EVENT_MRPC_COMP_ASYNC, mrpc_comp_async_hdr),
include/linux/switchtec.h +3 -0
index 09d73d0d1aa8..42d121174fe2 100644
@@ -100,6 +100,9 @@ struct sw_event_regs {
 	u32 gpio_interrupt_hdr;
 	u32 gpio_interrupt_data;
 	u32 reserved16[4];
+	u32 gfms_event_hdr;
+	u32 gfms_event_data;
+	u32 reserved17[4];
 } __packed;
 
 enum {
include/uapi/linux/switchtec_ioctl.h +2 -1
index 75df44373034..4f4daf8db954 100644
@@ -88,7 +88,8 @@ struct switchtec_ioctl_event_summary {
 #define SWITCHTEC_IOCTL_EVENT_FORCE_SPEED		26
 #define SWITCHTEC_IOCTL_EVENT_CREDIT_TIMEOUT		27
 #define SWITCHTEC_IOCTL_EVENT_LINK_STATE		28
-#define SWITCHTEC_IOCTL_MAX_EVENTS			29
+#define SWITCHTEC_IOCTL_EVENT_GFMS			29
+#define SWITCHTEC_IOCTL_MAX_EVENTS			30
 
 #define SWITCHTEC_IOCTL_EVENT_LOCAL_PART_IDX -1
 #define SWITCHTEC_IOCTL_EVENT_IDX_ALL -2
Signature · 1 line
2.11.0
author maintainer
#2 lore raw

PATCH 2/2 switchtec: Add device IDs for PSX 24xG3 and PSX 48xG3

In reply to Logan Gunthorpe

From: Kelvin Cao <[email protected]>

These are valid devices that were missing from the existing device ID table for the Switchtec driver.

# Please enter the commit message for your changes. Lines starting

# with '#' will be ignored, and an empty message aborts the commit.
#
# Author:    Kelvin Cao <[email protected]>
# Date:      Sat Oct 14 01:31:58 2017 +0800
#
# interactive rebase in progress; onto 4fbd8d194f06
# Last commands done (2 commands done):
#    r b63e909353b8 switchtec: Added Global Fabric Manager Server (GFMS) event.
#    r a9d2d2460138 switchtec: Add device IDs for PSX 24xG3 and PSX 48xG3
# No commands remaining.
# You are currently editing a commit while rebasing branch 'switchtec-pci-next' on '4fbd8d194f06'.
#
# Changes to be committed:
#	modified:   drivers/pci/switch/switchtec.c
#

# Please enter the commit message for your changes. Lines starting

# with '#' will be ignored, and an empty message aborts the commit.
#
# Author:    Kelvin Cao <[email protected]>
# Date:      Sat Oct 14 01:31:58 2017 +0800
#
# On branch switchtec-pci-next
# Changes to be committed:
#	modified:   drivers/pci/switch/switchtec.c
#
---
 drivers/pci/switch/switchtec.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/pci/switch/switchtec.c +2 -0
index 7668d270725d..a0f8373f3b5f 100644
@@ -1353,6 +1353,8 @@ static const struct pci_device_id switchtec_pci_tbl[] = {
 	SWITCHTEC_PCI_DEVICE(0x8534),  //PFX 64xG3
 	SWITCHTEC_PCI_DEVICE(0x8535),  //PFX 80xG3
 	SWITCHTEC_PCI_DEVICE(0x8536),  //PFX 96xG3
+	SWITCHTEC_PCI_DEVICE(0x8541),  //PSX 24xG3
+	SWITCHTEC_PCI_DEVICE(0x8542),  //PSX 32xG3
 	SWITCHTEC_PCI_DEVICE(0x8543),  //PSX 48xG3
 	SWITCHTEC_PCI_DEVICE(0x8544),  //PSX 64xG3
 	SWITCHTEC_PCI_DEVICE(0x8545),  //PSX 80xG3
Signature · 1 line
2.11.0
#3 lore raw
In reply to Logan Gunthorpe
Quoted 13 lines · Logan Gunthorpe

Hi Bjorn,

Blease accept the following two patches. The first adds a couple more device IDs for the Switchtec driver. The second adds a new event type for it to report.

Thanks,

Logan

Kelvin Cao (1):
switchtec: Add device IDs for PSX 24xG3 and PSX 48xG3

Quoted 7 lines

Logan Gunthorpe (1):
switchtec: Added Global Fabric Manager Server (GFMS) event

 drivers/pci/switch/switchtec.c       | 3 +++
 include/linux/switchtec.h            | 3 +++
 include/uapi/linux/switchtec_ioctl.h | 3 ++-
 3 files changed, 8 insertions(+), 1 deletion(-)

Applied to pci/switchtec for v4.16, thanks!