Skip to contentSkip to conversation

Fix compile failure encountered on u-boot-usb tree (2017-07-20)

PATCH New patrice.chotard at st.com 4 participants 17 messages Jul 24, 2017 – Aug 6, 2017

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

cover Fix compile failure encountered on u-boot-usb tree (2017-07-20)

From: Patrice Chotard <[email protected]>

This series fixes :
_ compilation issue reported by Ran Wang on u-boot-usb branch _ add last minute fixes for both generic-ehci and generic_ohci drivers
which avoid to init a generic PHY if not found, reported by Patrick Delaunay

This series need an additionnal patch from Jean-Jacques Hiblot :
[PATCH v2] phy: add a NO-OP phy driver

Patrice Chotard (4):
dm: phy: add missing #ifdef CONFIG_PHY
dm: usb: host: xhci-dwc3: add missing #ifdef CONFIG_DM_USB
usb: host: ehci-generic: initialize PHY only when found
usb: host: ohci-generic: initialize PHY only when found

 drivers/usb/host/ehci-generic.c | 11 ++++++-----
 drivers/usb/host/ohci-generic.c | 11 ++++++-----
 drivers/usb/host/xhci-dwc3.c    |  2 ++
 include/generic-phy.h           | 42 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 56 insertions(+), 10 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/4 dm: phy: add missing #ifdef CONFIG_PHY

From: Patrice Chotard <[email protected]>

To avoid compilation breakage on platform that doesn't support DM PHY but uses xhci-dwc3 driver, add the missing CONFIG_PHY flag.

Introduced by patch :
84e53877 "usb: host: xhci-dwc3: Add generic PHY support"

Cc Ran Wang <[email protected]>
Cc Bin Meng <[email protected]>
---
 include/generic-phy.h | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
include/generic-phy.h +42 -0
index 58cd2b2..eac5adc 100644
@@ -122,6 +122,7 @@ struct phy_ops {
 	int	(*power_off)(struct phy *phy);
 };
 
+#ifdef CONFIG_PHY
 
 /**
  * generic_phy_init() - initialize the PHY port
@@ -220,6 +221,47 @@ int generic_phy_get_by_index(struct udevice *user, int index,
 int generic_phy_get_by_name(struct udevice *user, const char *phy_name,
 			    struct phy *phy);
 
+#else /* CONFIG_PHY */
+
+static inline int generic_phy_init(struct phy *phy)
+{
+	return 0;
+}
+
+static inline int generic_phy_exit(struct phy *phy)
+{
+	return 0;
+}
+
+static inline int generic_phy_reset(struct phy *phy)
+{
+	return 0;
+}
+
+static inline int generic_phy_power_on(struct phy *phy)
+{
+	return 0;
+}
+
+static inline int generic_phy_power_off(struct phy *phy)
+{
+	return 0;
+}
+
+static inline int generic_phy_get_by_index(struct udevice *user, int index,
+			     struct phy *phy)
+{
+	return 0;
+}
+
+static inline int generic_phy_get_by_name(struct udevice *user, const char *phy_name,
+			    struct phy *phy)
+{
+	return 0;
+}
+
+#endif /* CONFIG_PHY */
+
 /**
  * generic_phy_valid() - check if PHY port is valid
  *
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/4 dm: usb: host: xhci-dwc3: add missing #ifdef CONFIG_DM_USB

In reply to patrice.chotard at st.com

From: Patrice Chotard <[email protected]>

Add CONFIG_DM_USB flag to avoid following compilation errors detected by buildman :
+drivers/usb/host/built-in.o: In function `xhci_dwc3_remove':
+drivers/usb/host/xhci-dwc3.c:168: undefined reference to xhci_deregister' +drivers/usb/host/built-in.o: In function xhci_dwc3_probe':
+drivers/usb/host/xhci-dwc3.c:145: undefined reference to usb_get_dr_mode' +drivers/usb/host/xhci-dwc3.c:152: undefined reference to xhci_register'

introduced by patch d5c3f014da3 "usb: host: xhci-dwc3: Convert driver to DM"

---
 drivers/usb/host/xhci-dwc3.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/usb/host/xhci-dwc3.c +2 -0
index 374fe74..541a785 100644
@@ -111,6 +111,7 @@ void dwc3_set_fladj(struct dwc3 *dwc3_reg, u32 val)
 			GFLADJ_30MHZ(val));
 }
 
+#ifdef CONFIG_DM_USB
 static int xhci_dwc3_probe(struct udevice *dev)
 {
 	struct xhci_dwc3_platdata *plat = dev_get_platdata(dev);
@@ -184,3 +185,4 @@ U_BOOT_DRIVER(xhci_dwc3) = {
 	.platdata_auto_alloc_size = sizeof(struct xhci_dwc3_platdata),
 	.flags = DM_FLAG_ALLOC_PRIV_DMA,
 };
+#endif
Signature · 1 line
1.9.1
#3 lore raw

PATCH 2/4 dm: usb: host: xhci-dwc3: add missing #ifdef CONFIG_DM_USB

Quoted 10 lines · On 24 July 2017 at 09:07, <[email protected]> wrote:

From: Patrice Chotard <[email protected]>

Add CONFIG_DM_USB flag to avoid following compilation errors detected by buildman :

(quoted diff) +5 -0
+drivers/usb/host/built-in.o: In function `xhci_dwc3_remove':
+drivers/usb/host/xhci-dwc3.c:168: undefined reference to `xhci_deregister'
+drivers/usb/host/built-in.o: In function `xhci_dwc3_probe':
+drivers/usb/host/xhci-dwc3.c:145: undefined reference to `usb_get_dr_mode'
+drivers/usb/host/xhci-dwc3.c:152: undefined reference to `xhci_register'
Quoted 7 lines

introduced by patch d5c3f014da3 "usb: host: xhci-dwc3: Convert driver to DM"

---
 drivers/usb/host/xhci-dwc3.c | 2 ++
 1 file changed, 2 insertions(+)
#4 lore raw

PATCH 2/4 dm: usb: host: xhci-dwc3: add missing #ifdef CONFIG_DM_USB

Quoted 13 lines · Simon Glass
Quoted 12 lines · On 24 July 2017 at 09:07, <[email protected]> wrote:

From: Patrice Chotard <[email protected]>

Add CONFIG_DM_USB flag to avoid following compilation errors detected by buildman :

(quoted diff) +5 -0
+drivers/usb/host/built-in.o: In function `xhci_dwc3_remove':
+drivers/usb/host/xhci-dwc3.c:168: undefined reference to `xhci_deregister'
+drivers/usb/host/built-in.o: In function `xhci_dwc3_probe':
+drivers/usb/host/xhci-dwc3.c:145: undefined reference to `usb_get_dr_mode'
+drivers/usb/host/xhci-dwc3.c:152: undefined reference to `xhci_register'

introduced by patch d5c3f014da3 "usb: host: xhci-dwc3: Convert driver to DM"

Quoted 8 lines
Quoted 5 lines
---
 drivers/usb/host/xhci-dwc3.c | 2 ++
 1 file changed, 2 insertions(+)

Um, this patch was applied like two weeks ago. Is this some automated botmail ... reviewman ? :)

Signature · 2 lines
Best regards,
Marek Vasut
#5 lore raw

PATCH 2/4 dm: usb: host: xhci-dwc3: add missing #ifdef CONFIG_DM_USB

Hi Marek,

Quoted 22 lines · Marek Vasut
Quoted 13 lines · Simon Glass
Quoted 12 lines · On 24 July 2017 at 09:07, <[email protected]> wrote:

From: Patrice Chotard <[email protected]>

Add CONFIG_DM_USB flag to avoid following compilation errors detected by buildman :

(quoted diff) +5 -0
+drivers/usb/host/built-in.o: In function `xhci_dwc3_remove':
+drivers/usb/host/xhci-dwc3.c:168: undefined reference to `xhci_deregister'
+drivers/usb/host/built-in.o: In function `xhci_dwc3_probe':
+drivers/usb/host/xhci-dwc3.c:145: undefined reference to `usb_get_dr_mode'
+drivers/usb/host/xhci-dwc3.c:152: undefined reference to `xhci_register'

introduced by patch d5c3f014da3 "usb: host: xhci-dwc3: Convert driver to DM"

Quoted 8 lines
Quoted 5 lines
---
 drivers/usb/host/xhci-dwc3.c | 2 ++
 1 file changed, 2 insertions(+)
Quoted 2 lines

Um, this patch was applied like two weeks ago. Is this some automated botmail ... reviewman ? :)

There is no mention of it being applied on this thread, so it looked like an open patch to me.

Regards,
Simon

#6 lore raw

PATCH 3/4 usb: host: ehci-generic: initialize PHY only when found

In reply to patrice.chotard at st.com

From: Patrice Chotard <[email protected]>

Call generic_phy_init() only when a PHY was found. This will avoid a crash if no "phys" property is found in DT.

---
 drivers/usb/host/ehci-generic.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/usb/host/ehci-generic.c +6 -5
index 3f751f1..03f8d32 100644
@@ -99,12 +99,13 @@ static int ehci_usb_probe(struct udevice *dev)
 			error("failed to get usb phy\n");
 			goto reset_err;
 		}
-	}
+	} else {
 
-	err = generic_phy_init(&priv->phy);
-	if (err) {
-		error("failed to init usb phy\n");
-		goto reset_err;
+		err = generic_phy_init(&priv->phy);
+		if (err) {
+			error("failed to init usb phy\n");
+			goto reset_err;
+		}
 	}
 
 	hccr = map_physmem(devfdt_get_addr(dev), 0x100, MAP_NOCACHE);
Signature · 1 line
1.9.1
#7 lore raw

PATCH 3/4 usb: host: ehci-generic: initialize PHY only when found

Quoted 10 lines · On 24 July 2017 at 09:07, <[email protected]> wrote:

From: Patrice Chotard <[email protected]>

Call generic_phy_init() only when a PHY was found. This will avoid a crash if no "phys" property is found in DT.

---
 drivers/usb/host/ehci-generic.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
#8 lore raw

PATCH 4/4 usb: host: ohci-generic: initialize PHY only when found

In reply to patrice.chotard at st.com

From: Patrice Chotard <[email protected]>

Call generic_phy_init() only when a PHY was found. This will avoid a crash if no "phys" property is found in DT.

---
 drivers/usb/host/ohci-generic.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/usb/host/ohci-generic.c +6 -5
index 9249039..e22ee97 100644
@@ -91,12 +91,13 @@ static int ohci_usb_probe(struct udevice *dev)
 			error("failed to get usb phy\n");
 			goto reset_err;
 		}
-	}
+	} else {
 
-	err = generic_phy_init(&priv->phy);
-	if (err) {
-		error("failed to init usb phy\n");
-		goto reset_err;
+		err = generic_phy_init(&priv->phy);
+		if (err) {
+			error("failed to init usb phy\n");
+			goto reset_err;
+		}
 	}
 
 	err = ohci_register(dev, regs);
Signature · 1 line
1.9.1
#9 lore raw

PATCH 4/4 usb: host: ohci-generic: initialize PHY only when found

Quoted 10 lines · On 24 July 2017 at 09:07, <[email protected]> wrote:

From: Patrice Chotard <[email protected]>

Call generic_phy_init() only when a PHY was found. This will avoid a crash if no "phys" property is found in DT.

---
 drivers/usb/host/ohci-generic.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
Applied
#10 lore raw

cover Fix compile failure encountered on u-boot-usb tree (2017-07-20)

In reply to patrice.chotard at st.com
Quoted 18 lines · patrice.chotard at st.com

From: Patrice Chotard <[email protected]>

This series fixes :
_ compilation issue reported by Ran Wang on u-boot-usb branch _ add last minute fixes for both generic-ehci and generic_ohci drivers
which avoid to init a generic PHY if not found, reported by Patrick Delaunay

This series need an additionnal patch from Jean-Jacques Hiblot :
[PATCH v2] phy: add a NO-OP phy driver

Patrice Chotard (4):
dm: phy: add missing #ifdef CONFIG_PHY
dm: usb: host: xhci-dwc3: add missing #ifdef CONFIG_DM_USB
usb: host: ehci-generic: initialize PHY only when found
usb: host: ohci-generic: initialize PHY only when found

Quoted 6 lines
 drivers/usb/host/ehci-generic.c | 11 ++++++-----
 drivers/usb/host/ohci-generic.c | 11 ++++++-----
 drivers/usb/host/xhci-dwc3.c    |  2 ++
 include/generic-phy.h           | 42 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 56 insertions(+), 10 deletions(-)

Applied all, thanks.

Signature · 2 lines
Best regards,
Marek Vasut
#11 lore raw

cover Fix compile failure encountered on u-boot-usb tree (2017-07-20)

Hi Marek,

Quoted 19 lines · Marek Vasut
Quoted 18 lines · patrice.chotard at st.com

From: Patrice Chotard <[email protected]>

This series fixes :
_ compilation issue reported by Ran Wang on u-boot-usb branch _ add last minute fixes for both generic-ehci and generic_ohci drivers
which avoid to init a generic PHY if not found, reported by Patrick Delaunay

This series need an additionnal patch from Jean-Jacques Hiblot :
[PATCH v2] phy: add a NO-OP phy driver

Patrice Chotard (4):
dm: phy: add missing #ifdef CONFIG_PHY
dm: usb: host: xhci-dwc3: add missing #ifdef CONFIG_DM_USB
usb: host: ehci-generic: initialize PHY only when found
usb: host: ohci-generic: initialize PHY only when found

Quoted 8 lines
Quoted 6 lines
 drivers/usb/host/ehci-generic.c | 11 ++++++-----
 drivers/usb/host/ohci-generic.c | 11 ++++++-----
 drivers/usb/host/xhci-dwc3.c    |  2 ++
 include/generic-phy.h           | 42 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 56 insertions(+), 10 deletions(-)

Applied all, thanks.

I see these 4 patches are applied on top of u-boot-usb/master directly. I think they should be squashed into Patrice's previous patches, so that we can still maintain bisectablity.

Regards,
Bin

#12 lore raw

cover Fix compile failure encountered on u-boot-usb tree (2017-07-20)

Quoted 1 line · Bin Meng

Hi Marek,

Hi Bin,

Quoted 26 lines · Marek Vasut
Quoted 25 lines · patrice.chotard at st.com
Quoted 24 lines

From: Patrice Chotard <[email protected]>

This series fixes :
_ compilation issue reported by Ran Wang on u-boot-usb branch _ add last minute fixes for both generic-ehci and generic_ohci drivers
which avoid to init a generic PHY if not found, reported by Patrick Delaunay

This series need an additionnal patch from Jean-Jacques Hiblot :
[PATCH v2] phy: add a NO-OP phy driver

Patrice Chotard (4):
dm: phy: add missing #ifdef CONFIG_PHY
dm: usb: host: xhci-dwc3: add missing #ifdef CONFIG_DM_USB
usb: host: ehci-generic: initialize PHY only when found
usb: host: ohci-generic: initialize PHY only when found

 drivers/usb/host/ehci-generic.c | 11 ++++++-----
 drivers/usb/host/ohci-generic.c | 11 ++++++-----
 drivers/usb/host/xhci-dwc3.c    |  2 ++
 include/generic-phy.h           | 42 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 56 insertions(+), 10 deletions(-)
Quoted 6 lines
Quoted 2 lines

Applied all, thanks.

I see these 4 patches are applied on top of u-boot-usb/master directly. I think they should be squashed into Patrice's previous patches, so that we can still maintain bisectablity.

They can, but then I have to rewrite history and rebase your patches on top of his, which I'm not too happy to do. Plus if I squash them, you cannot locate either of the squashed patches in the ML, which sucks.

Quoted 3 lines

Regards,
Bin

Signature · 2 lines
Best regards,
Marek Vasut
#13 lore raw

cover Fix compile failure encountered on u-boot-usb tree (2017-07-20)

In reply to patrice.chotard at st.com
Quoted 18 lines · patrice.chotard at st.com

From: Patrice Chotard <[email protected]>

This series fixes :
_ compilation issue reported by Ran Wang on u-boot-usb branch _ add last minute fixes for both generic-ehci and generic_ohci drivers
which avoid to init a generic PHY if not found, reported by Patrick Delaunay

This series need an additionnal patch from Jean-Jacques Hiblot :
[PATCH v2] phy: add a NO-OP phy driver

Patrice Chotard (4):
dm: phy: add missing #ifdef CONFIG_PHY
dm: usb: host: xhci-dwc3: add missing #ifdef CONFIG_DM_USB
usb: host: ehci-generic: initialize PHY only when found
usb: host: ohci-generic: initialize PHY only when found

Quoted 6 lines
 drivers/usb/host/ehci-generic.c | 11 ++++++-----
 drivers/usb/host/ohci-generic.c | 11 ++++++-----
 drivers/usb/host/xhci-dwc3.c    |  2 ++
 include/generic-phy.h           | 42 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 56 insertions(+), 10 deletions(-)

FYI, poplar, dra7xx_evm, evb-rk3328 still have errors. Just try building the entirety of ARM and ARM64 and you'll see them.

Signature · 2 lines
Best regards,
Marek Vasut
#14 lore raw

cover Fix compile failure encountered on u-boot-usb tree (2017-07-20)

Hi Marek

Quoted 26 lines · Marek Vasut
Quoted 18 lines · patrice.chotard at st.com

From: Patrice Chotard <[email protected]>

This series fixes :
_ compilation issue reported by Ran Wang on u-boot-usb branch _ add last minute fixes for both generic-ehci and generic_ohci drivers
which avoid to init a generic PHY if not found, reported by Patrick Delaunay

This series need an additionnal patch from Jean-Jacques Hiblot :
[PATCH v2] phy: add a NO-OP phy driver

Patrice Chotard (4):
dm: phy: add missing #ifdef CONFIG_PHY
dm: usb: host: xhci-dwc3: add missing #ifdef CONFIG_DM_USB
usb: host: ehci-generic: initialize PHY only when found
usb: host: ohci-generic: initialize PHY only when found

Quoted 6 lines
  drivers/usb/host/ehci-generic.c | 11 ++++++-----
  drivers/usb/host/ohci-generic.c | 11 ++++++-----
  drivers/usb/host/xhci-dwc3.c    |  2 ++
  include/generic-phy.h           | 42 +++++++++++++++++++++++++++++++++++++++++
  4 files changed, 56 insertions(+), 10 deletions(-)
Quoted 3 lines

FYI, poplar, dra7xx_evm, evb-rk3328 still have errors. Just try building the entirety of ARM and ARM64 and you'll see them.

Ok i will submit fixes to fix error poplar and warnings for dra7xx_evm platforms.

Regarding evb-rk3328, warnings are not link with my series

Patrice

#15 lore raw

cover Fix compile failure encountered on u-boot-usb tree (2017-07-20)

Quoted 29 lines · Patrice CHOTARD

Hi Marek

Quoted 26 lines · Marek Vasut
Quoted 24 lines · patrice.chotard at st.com

From: Patrice Chotard <[email protected]>

This series fixes :
_ compilation issue reported by Ran Wang on u-boot-usb branch _ add last minute fixes for both generic-ehci and generic_ohci drivers
which avoid to init a generic PHY if not found, reported by Patrick Delaunay

This series need an additionnal patch from Jean-Jacques Hiblot :
[PATCH v2] phy: add a NO-OP phy driver

Patrice Chotard (4):
dm: phy: add missing #ifdef CONFIG_PHY
dm: usb: host: xhci-dwc3: add missing #ifdef CONFIG_DM_USB
usb: host: ehci-generic: initialize PHY only when found
usb: host: ohci-generic: initialize PHY only when found

  drivers/usb/host/ehci-generic.c | 11 ++++++-----
  drivers/usb/host/ohci-generic.c | 11 ++++++-----
  drivers/usb/host/xhci-dwc3.c    |  2 ++
  include/generic-phy.h           | 42 +++++++++++++++++++++++++++++++++++++++++
  4 files changed, 56 insertions(+), 10 deletions(-)
Quoted 6 lines
Quoted 3 lines

FYI, poplar, dra7xx_evm, evb-rk3328 still have errors. Just try building the entirety of ARM and ARM64 and you'll see them.

Ok i will submit fixes to fix error poplar and warnings for dra7xx_evm platforms.

Can you please run buildman to see if there are any failures remaining ?

Quoted 1 line

Regarding evb-rk3328, warnings are not link with my series

OK

Quoted 2 lines

Patrice

Signature · 2 lines
Best regards,
Marek Vasut
#16 lore raw

cover Fix compile failure encountered on u-boot-usb tree (2017-07-20)

Hi Marek

Quoted 30 lines · Marek Vasut
Quoted 29 lines · Patrice CHOTARD

Hi Marek

Quoted 26 lines · Marek Vasut
Quoted 24 lines · patrice.chotard at st.com

From: Patrice Chotard <[email protected]>

This series fixes :
_ compilation issue reported by Ran Wang on u-boot-usb branch _ add last minute fixes for both generic-ehci and generic_ohci drivers
which avoid to init a generic PHY if not found, reported by Patrick Delaunay

This series need an additionnal patch from Jean-Jacques Hiblot :
[PATCH v2] phy: add a NO-OP phy driver

Patrice Chotard (4):
dm: phy: add missing #ifdef CONFIG_PHY
dm: usb: host: xhci-dwc3: add missing #ifdef CONFIG_DM_USB
usb: host: ehci-generic: initialize PHY only when found
usb: host: ohci-generic: initialize PHY only when found

   drivers/usb/host/ehci-generic.c | 11 ++++++-----
   drivers/usb/host/ohci-generic.c | 11 ++++++-----
   drivers/usb/host/xhci-dwc3.c    |  2 ++
   include/generic-phy.h           | 42 +++++++++++++++++++++++++++++++++++++++++
   4 files changed, 56 insertions(+), 10 deletions(-)
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

FYI, poplar, dra7xx_evm, evb-rk3328 still have errors. Just try building the entirety of ARM and ARM64 and you'll see them.

Ok i will submit fixes to fix error poplar and warnings for dra7xx_evm platforms.

Can you please run buildman to see if there are any failures remaining ?

Of course, buildman becomes my friends ;-)

Quoted 9 lines
Quoted 2 lines

Regarding evb-rk3328, warnings are not link with my series

OK

Quoted 2 lines

Patrice