Skip to contentSkip to conversation

MIPS: Octeon: Select USB_OHCI_BIG_ENDIAN_MMIO

PATCH New Ben Hutchings 2 participants 6 messages May 25, 2015 – May 28, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: Octeon: Select USB_OHCI_BIG_ENDIAN_MMIO

The Octeon OHCI is now supported by the ohci-platform driver, and USB_OCTEON_OHCI is marked as deprecated. However, it is currently still necessary to enable it in order to select USB_OHCI_BIG_ENDIAN_MMIO. Make CPU_CAVIUM_OCTEON select that as well, so that USB_OCTEON_OHCI is really obsolete.

Fixes 2193dda5eec6 ("USB: host: Remove ehci-octeon and ohci-octeon drivers")

---
This is untested, aside from comparing the resulting config files.

Ben.

 arch/mips/Kconfig | 1 +
 1 file changed, 1 insertion(+)
arch/mips/Kconfig +1 -0
index f501665..d5c81b4 100644
@@ -1569,6 +1569,7 @@ config CPU_CAVIUM_OCTEON
 	select CPU_SUPPORTS_HIGHMEM
 	select CPU_SUPPORTS_HUGEPAGES
 	select USB_EHCI_BIG_ENDIAN_MMIO
+	select USB_OHCI_BIG_ENDIAN_MMIO
 	select MIPS_L1_CACHE_SHIFT_7
 	help
 	  The Cavium Octeon processor is a highly integrated chip containing
Signature · 2 lines
Ben Hutchings
Design a system any fool can use, and only a fool will want to use it.
#1 lore raw

PATCH v2 1/1 MIPS: Octeon: Set OHCI and EHCI MMIO byte order to match CPU

The Octeon OHCI is now supported by the ohci-platform driver, and USB_OCTEON_OHCI is marked as deprecated. However, it is currently still necessary to enable it in order to select USB_OHCI_BIG_ENDIAN_MMIO. Make CPU_CAVIUM_OCTEON select that as well, so that USB_OCTEON_OHCI is really obsolete.

The old ohci-octeon and ehci-octeon drivers also only enabled big-endian MMIO in case the CPU was big-endian. Make the selections of USB_EHCI_BIG_ENDIAN_MMIO and USB_OHCI_BIG_ENDIAN_MMIO conditional, to match this.

Fixes 2193dda5eec6 ("USB: host: Remove ehci-octeon and ohci-octeon drivers")

---
v2: Make selections conditional

This is also untested; I'm just comparing the old and new code.

Ben.

 arch/mips/Kconfig        | 4 ++--
 drivers/usb/host/Kconfig | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/mips/Kconfig +2 -1
index d5c81b4..4b43459 100644
@@ -1568,7 +1568,8 @@ config CPU_CAVIUM_OCTEON
 	select WEAK_ORDERING
 	select CPU_SUPPORTS_HIGHMEM
 	select CPU_SUPPORTS_HUGEPAGES
-	select USB_EHCI_BIG_ENDIAN_MMIO
+	select USB_EHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN
+	select USB_OHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN
 	select MIPS_L1_CACHE_SHIFT_7
 	help
 	  The Cavium Octeon processor is a highly integrated chip containing
drivers/usb/host/Kconfig +2 -2
@@ -295,7 +295,7 @@ config USB_OCTEON_EHCI
 	bool "Octeon on-chip EHCI support (DEPRECATED)"
 	depends on CAVIUM_OCTEON_SOC
 	default n
-	select USB_EHCI_BIG_ENDIAN_MMIO
+	select USB_EHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN
 	select USB_EHCI_HCD_PLATFORM
 	help
 	  This option is deprecated now and the driver was removed, use
@@ -568,7 +568,7 @@ config USB_OCTEON_OHCI
 	bool "Octeon on-chip OHCI support (DEPRECATED)"
 	depends on CAVIUM_OCTEON_SOC
 	default USB_OCTEON_EHCI
-	select USB_OHCI_BIG_ENDIAN_MMIO
+	select USB_OHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN
 	select USB_OHCI_LITTLE_ENDIAN
 	select USB_OHCI_HCD_PLATFORM
 	help
Signature · 2 lines
Ben Hutchings
Design a system any fool can use, and only a fool will want to use it.
#2 lore raw

Re: [PATCH v2] MIPS: Octeon: Set OHCI and EHCI MMIO byte order to match CPU

Quoted 5 lines · Ben Hutchings

The Octeon OHCI is now supported by the ohci-platform driver, and USB_OCTEON_OHCI is marked as deprecated. However, it is currently still necessary to enable it in order to select USB_OHCI_BIG_ENDIAN_MMIO. Make CPU_CAVIUM_OCTEON select that as well, so that USB_OCTEON_OHCI is really obsolete.

Good catch.

Quoted 2 lines

The old ohci-octeon and ehci-octeon drivers also only enabled big-endian MMIO in case the CPU was big-endian.

This is true in the current kernel as well. [eo]hci-platform.c enables big-endian MMIO only if the appropriate flag is set in the platform data or OF properties.

Quoted 3 lines

Make the selections of
USB_EHCI_BIG_ENDIAN_MMIO and USB_OHCI_BIG_ENDIAN_MMIO conditional, to match this.

I'm not sure you want to do this. [eo]hci-platform.c will fail with an error if the platform/OF data has the big-endian flag set but CONFIG_USB_[EO]HCI_BIG_ENDIAN_MMIO isn't defined.

Quoted 6 lines
Fixes 2193dda5eec6 ("USB: host: Remove ehci-octeon and ohci-octeon drivers")

---
v2: Make selections conditional

This is also untested; I'm just comparing the old and new code.

Is there anyone who can test this with both big-endian and little-endian hardware?

Alan Stern

#3 lore raw

Re: [PATCH v2] MIPS: Octeon: Set OHCI and EHCI MMIO byte order to match CPU

Quoted 8 lines · Alan Stern
Quoted 5 lines · Ben Hutchings

The Octeon OHCI is now supported by the ohci-platform driver, and USB_OCTEON_OHCI is marked as deprecated. However, it is currently still necessary to enable it in order to select USB_OHCI_BIG_ENDIAN_MMIO. Make CPU_CAVIUM_OCTEON select that as well, so that USB_OCTEON_OHCI is really obsolete.

Quoted 8 lines

Good catch.

Quoted 2 lines

The old ohci-octeon and ehci-octeon drivers also only enabled big-endian MMIO in case the CPU was big-endian.

This is true in the current kernel as well. [eo]hci-platform.c enables big-endian MMIO only if the appropriate flag is set in the platform data or OF properties.

Oh, I see.

Quoted 7 lines
Quoted 3 lines

Make the selections of
USB_EHCI_BIG_ENDIAN_MMIO and USB_OHCI_BIG_ENDIAN_MMIO conditional, to match this.

I'm not sure you want to do this. [eo]hci-platform.c will fail with an error if the platform/OF data has the big-endian flag set but CONFIG_USB_[EO]HCI_BIG_ENDIAN_MMIO isn't defined.

The conditional selection should match the platform data in arch/mips/cavium-octeon/octeon-platform.c

Quoted 9 lines
Quoted 6 lines
Fixes 2193dda5eec6 ("USB: host: Remove ehci-octeon and ohci-octeon drivers")

---
v2: Make selections conditional

This is also untested; I'm just comparing the old and new code.

Is there anyone who can test this with both big-endian and little-endian hardware?

Failing that, the previous version of this patch ("MIPS: Octeon: Select USB_OHCI_BIG_ENDIAN_MMIO") should be a safe fix.

The conditional selection in this patch is a possible optimisation on top of that, and not a necessary fix as I thought.

Ben,

Signature · 2 lines
Ben Hutchings
Reality is just a crutch for people who can't handle science fiction.
#4 lore raw

Re: [PATCH v2] MIPS: Octeon: Set OHCI and EHCI MMIO byte order to match CPU

Quoted 5 lines · Ben Hutchings
Quoted 2 lines

Is there anyone who can test this with both big-endian and little-endian hardware?

Failing that, the previous version of this patch ("MIPS: Octeon: Select USB_OHCI_BIG_ENDIAN_MMIO") should be a safe fix.

Yes, it should be. If you want to submit it again as v3, I'll Ack it.

Quoted 2 lines

The conditional selection in this patch is a possible optimisation on top of that, and not a necessary fix as I thought.

Right.

Alan Stern

#5 lore raw

PATCH v2 1/1 MIPS: Octeon: Set OHCI and EHCI MMIO byte order to match CPU

In reply to Ben Hutchings

The Octeon OHCI is now supported by the ohci-platform driver, and USB_OCTEON_OHCI is marked as deprecated. However, it is currently still necessary to enable it in order to select USB_OHCI_BIG_ENDIAN_MMIO. Make CPU_CAVIUM_OCTEON select that as well, so that USB_OCTEON_OHCI is really obsolete.

The old ohci-octeon and ehci-octeon drivers also only enabled big-endian MMIO in case the CPU was big-endian. Make the selections of USB_EHCI_BIG_ENDIAN_MMIO and USB_OHCI_BIG_ENDIAN_MMIO conditional, to match this.

Fixes 2193dda5eec6 ("USB: host: Remove ehci-octeon and ohci-octeon drivers")

---
v2: Make selections conditional

This is also untested; I'm just comparing the old and new code.

Ben.

 arch/mips/Kconfig        | 4 ++--
 drivers/usb/host/Kconfig | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/mips/Kconfig +2 -1
index d5c81b4..4b43459 100644
@@ -1568,7 +1568,8 @@ config CPU_CAVIUM_OCTEON
 	select WEAK_ORDERING
 	select CPU_SUPPORTS_HIGHMEM
 	select CPU_SUPPORTS_HUGEPAGES
-	select USB_EHCI_BIG_ENDIAN_MMIO
+	select USB_EHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN
+	select USB_OHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN
 	select MIPS_L1_CACHE_SHIFT_7
 	help
 	  The Cavium Octeon processor is a highly integrated chip containing
drivers/usb/host/Kconfig +2 -2
@@ -295,7 +295,7 @@ config USB_OCTEON_EHCI
 	bool "Octeon on-chip EHCI support (DEPRECATED)"
 	depends on CAVIUM_OCTEON_SOC
 	default n
-	select USB_EHCI_BIG_ENDIAN_MMIO
+	select USB_EHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN
 	select USB_EHCI_HCD_PLATFORM
 	help
 	  This option is deprecated now and the driver was removed, use
@@ -568,7 +568,7 @@ config USB_OCTEON_OHCI
 	bool "Octeon on-chip OHCI support (DEPRECATED)"
 	depends on CAVIUM_OCTEON_SOC
 	default USB_OCTEON_EHCI
-	select USB_OHCI_BIG_ENDIAN_MMIO
+	select USB_OHCI_BIG_ENDIAN_MMIO if CPU_BIG_ENDIAN
 	select USB_OHCI_LITTLE_ENDIAN
 	select USB_OHCI_HCD_PLATFORM
 	help
Signature · 2 lines
Ben Hutchings
Design a system any fool can use, and only a fool will want to use it.