Skip to contentSkip to conversation

VFIO: platform: reset: AMD xgbe reset module

PATCH Superseded Eric Auger 2 participants 2 messages Oct 23, 2015

Subsystems (4)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Eric Auger

author
#0 lore raw

PATCH v2 1/1 VFIO: platform: reset: AMD xgbe reset module

This patch introduces a module that registers and implements a low-level reset function for the AMD XGBE device.

it performs the following actions:
- reset the PHY
- disable auto-negotiation
- disable & clear auto-negotiation IRQ
- soft-reset the MAC

Those tiny pieces of code are inherited from the native xgbe driver.

---

Applies on top of [PATCH v3 0/7] VFIO platform reset module rework

v1 -> v2:
- uses module_vfio_reset_handler macro

---
 drivers/vfio/platform/reset/Kconfig                |   7 ++
 drivers/vfio/platform/reset/Makefile               |   2 +
 .../vfio/platform/reset/vfio_platform_amdxgbe.c    | 131 +++++++++++++++++++++
 3 files changed, 140 insertions(+)
 create mode 100644 drivers/vfio/platform/reset/vfio_platform_amdxgbe.c
drivers/vfio/platform/reset/Kconfig +7 -0
index 746b96b..ed9bb28 100644
@@ -5,3 +5,10 @@ config VFIO_PLATFORM_CALXEDAXGMAC_RESET
 	  Enables the VFIO platform driver to handle reset for Calxeda xgmac
 
 	  If you don't know what to do here, say N.
+config VFIO_PLATFORM_AMDXGBE_RESET
+	tristate "VFIO support for AMD XGBE reset"
+	depends on VFIO_PLATFORM
+	help
+	  Enables the VFIO platform driver to handle reset for AMD XGBE
+
+	  If you don't know what to do here, say N.
drivers/vfio/platform/reset/Makefile +2 -0
index 2a486af..93f4e23 100644
@@ -1,5 +1,7 @@
 vfio-platform-calxedaxgmac-y := vfio_platform_calxedaxgmac.o
+vfio-platform-amdxgbe-y := vfio_platform_amdxgbe.o
 
 ccflags-y += -Idrivers/vfio/platform
 
 obj-$(CONFIG_VFIO_PLATFORM_CALXEDAXGMAC_RESET) += vfio-platform-calxedaxgmac.o
+obj-$(CONFIG_VFIO_PLATFORM_AMDXGBE_RESET) += vfio-platform-amdxgbe.o
drivers/vfio/platform/reset/vfio_platform_amdxgbe.c new file +131 -0

131 lines not on this page · raw message

Signature · 1 line
1.9.1
#1 lore raw
Quoted 9 lines · On Friday 23 October 2015 14:44:13 Eric Auger wrote:

This patch introduces a module that registers and implements a low-level reset function for the AMD XGBE device.

it performs the following actions:
- reset the PHY
- disable auto-negotiation
- disable & clear auto-negotiation IRQ
- soft-reset the MAC

Quoted 5 lines

Those tiny pieces of code are inherited from the native xgbe driver.

---

The code looks ok to me, just two small style issues.

drivers/vfio/platform/reset/Kconfig config VFIO_PLATFORM_CALXEDAXGMAC_RESET · line 14

Quoted 9 lines
drivers/vfio/platform/reset/Kconfig +7 -0
 	  If you don't know what to do here, say N.
+config VFIO_PLATFORM_AMDXGBE_RESET
+	tristate "VFIO support for AMD XGBE reset"
+	depends on VFIO_PLATFORM
+	help
+	  Enables the VFIO platform driver to handle reset for AMD XGBE
+
+	  If you don't know what to do here, say N.

Please add an empty line before the newly introduced option.

drivers/vfio/platform/reset/vfio_platform_amdxgbe.c line 131

Quoted 4 lines
drivers/vfio/platform/reset/vfio_platform_amdxgbe.c new file +4 -0
+MODULE_VERSION(DRIVER_VERSION);
+MODULE_LICENSE("GPL v2");
+MODULE_AUTHOR(DRIVER_AUTHOR);
+MODULE_DESCRIPTION(DRIVER_DESC);

Best remove those macros and put the strings in here directly to make it easier to grep for.

Arnd