Skip to contentSkip to conversation

VFIO: platform: reset: AMD xgbe reset module

PATCH Superseded Eric Auger 3 participants 4 messages Oct 23, 2015 – Oct 26, 2015

Subsystems (4)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Eric Auger

author
#0 lore raw

PATCH v3 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

v2 -> v3:
- in Kconfig, add empty line between the 2 options
- remove DRIVER_VERSION, DRIVER_AUTHOR and DRIVER_DESC and put strings directly in MODULE macros

v1 -> v2:
- uses module_vfio_reset_handler macro

---
 drivers/vfio/platform/reset/Kconfig                |   8 ++
 drivers/vfio/platform/reset/Makefile               |   2 +
 .../vfio/platform/reset/vfio_platform_amdxgbe.c    | 127 +++++++++++++++++++++
 3 files changed, 137 insertions(+)
 create mode 100644 drivers/vfio/platform/reset/vfio_platform_amdxgbe.c
drivers/vfio/platform/reset/Kconfig +8 -0
index 746b96b..70cccc5 100644
@@ -5,3 +5,11 @@ 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 +127 -0

127 lines not on this page · raw message

Signature · 1 line
1.9.1
Reviewed-by on v3 1/1
#1 lore raw
Quoted 9 lines · On Friday 23 October 2015 17:58:33 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 4 lines

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

#2 lore raw
In reply to Eric Auger
reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree…

Hi Eric,

[auto build test ERROR on asm-generic/master -- if it's inappropriate base, please suggest rules for selecting the more suitable base]

url:    https://github.com/0day-ci/linux/commits/Eric-Auger/VFIO-platform-reset-AMD-xgbe-reset-module/20151024-000245
config: arm-allyesconfig (attached as .config)

reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm

All errors (new ones prefixed by >>):

>> drivers/vfio/platform/reset/vfio_platform_amdxgbe.c:122:27: error: expected declaration specifiers or '...' before string constant
    module_vfio_reset_handler("amd,xgbe-seattle-v1a", vfio_platform_amdxgbe_reset);
                              ^
>> drivers/vfio/platform/reset/vfio_platform_amdxgbe.c:122:51: error: expected declaration specifiers or '...' before 'vfio_platform_amdxgbe_reset'
    module_vfio_reset_handler("amd,xgbe-seattle-v1a", vfio_platform_amdxgbe_reset);
                                                      ^
--
>> /kbuild/src/defs/drivers/vfio/platform/reset/vfio_platform_amdxgbe.c:122:27: error: expected declaration specifiers or '...' before string constant
    module_vfio_reset_handler("amd,xgbe-seattle-v1a", vfio_platform_amdxgbe_reset);
                              ^
>> /kbuild/src/defs/drivers/vfio/platform/reset/vfio_platform_amdxgbe.c:122:51: error: expected declaration specifiers or '...' before 'vfio_platform_amdxgbe_reset'
    module_vfio_reset_handler("amd,xgbe-seattle-v1a", vfio_platform_amdxgbe_reset);
                                                      ^

vim +122 drivers/vfio/platform/reset/vfio_platform_amdxgbe.c

116 if (!count)
117 pr_warn("%s MAC SW reset failed\n", __func__);
118
119 return 0;
120 }
121

 > 122	module_vfio_reset_handler("amd,xgbe-seattle-v1a", vfio_platform_amdxgbe_reset);

123
124 MODULE_VERSION("0.1");
125 MODULE_LICENSE("GPL v2");

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

author
#3 lore raw

Dear all,

I think the problem comes from the fact this patch applies on top of "VFIO platform reset module rework",
https://lkml.org/lkml/2015/10/23/385. This is where module_vfio_reset_handler macro is introduced. Maybe I should have reverted the patch into RFC after decision to rework the framework.

Best Regards

Eric

Quoted 45 lines · kbuild test robot

Hi Eric,

[auto build test ERROR on asm-generic/master -- if it's inappropriate base, please suggest rules for selecting the more suitable base]

url:    https://github.com/0day-ci/linux/commits/Eric-Auger/VFIO-platform-reset-AMD-xgbe-reset-module/20151024-000245
config: arm-allyesconfig (attached as .config)

reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm

All errors (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

drivers/vfio/platform/reset/vfio_platform_amdxgbe.c:122:27: error: expected declaration specifiers or '...' before string constant

    module_vfio_reset_handler("amd,xgbe-seattle-v1a", vfio_platform_amdxgbe_reset);
                              ^
Quoted 1 line
Quoted 1 line

drivers/vfio/platform/reset/vfio_platform_amdxgbe.c:122:51: error: expected declaration specifiers or '...' before 'vfio_platform_amdxgbe_reset'

    module_vfio_reset_handler("amd,xgbe-seattle-v1a", vfio_platform_amdxgbe_reset);
                                                      ^

--

Quoted 1 line
Quoted 1 line

/kbuild/src/defs/drivers/vfio/platform/reset/vfio_platform_amdxgbe.c:122:27: error: expected declaration specifiers or '...' before string constant

    module_vfio_reset_handler("amd,xgbe-seattle-v1a", vfio_platform_amdxgbe_reset);
                              ^
Quoted 1 line
Quoted 1 line

/kbuild/src/defs/drivers/vfio/platform/reset/vfio_platform_amdxgbe.c:122:51: error: expected declaration specifiers or '...' before 'vfio_platform_amdxgbe_reset'

    module_vfio_reset_handler("amd,xgbe-seattle-v1a", vfio_platform_amdxgbe_reset);
                                                      ^

vim +122 drivers/vfio/platform/reset/vfio_platform_amdxgbe.c

   116		if (!count)
   117			pr_warn("%s MAC SW reset failed\n", __func__);
   118	
   119		return 0;
   120	}
   121	
Quoted 1 line

122 module_vfio_reset_handler("amd,xgbe-seattle-v1a", vfio_platform_amdxgbe_reset);

123

   124	MODULE_VERSION("0.1");
   125	MODULE_LICENSE("GPL v2");

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation