Skip to contentSkip to conversation

linux-next: manual merge of the usb tree with the usb.current tree

DISCUSSION Stephen Rothwell 4 participants 7 messages Apr 23, 2018 – Apr 30, 2018 Linux-next tree

lore
Share & tools
lore
#0 lore raw

Hi Greg,

Today's linux-next merge of the usb tree got a conflict in:

drivers/usb/core/hcd.c

between commit:

63cb03f5c11e ("usb: core: split usb_phy_roothub_{init,alloc}")

from the usb.current tree and commit:

bc40f5341741 ("USB: core: hcd: drop support for legacy phys")

from the usb tree.

I fixed it up (see below - though I am not sure what happens to the phy_roothub allocation when usb_phy_roothub_init fails) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

Signature · 47 lines
Cheers,
Stephen Rothwell

diff --cc drivers/usb/core/hcd.c
index 0a42c5df3c0f,ac5bcf449d7d..000000000000
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@@ -2742,35 -2740,11 +2743,15 @@@ int usb_add_hcd(struct usb_hcd *hcd
  	int retval;
  	struct usb_device *rhdev;
  
- 	if (IS_ENABLED(CONFIG_USB_PHY) && !hcd->skip_phy_initialization) {
- 		struct usb_phy *phy = usb_get_phy_dev(hcd->self.sysdev, 0);
- 
- 		if (IS_ERR(phy)) {
- 			retval = PTR_ERR(phy);
- 			if (retval == -EPROBE_DEFER)
- 				return retval;
- 		} else {
- 			retval = usb_phy_init(phy);
- 			if (retval) {
- 				usb_put_phy(phy);
- 				return retval;
- 			}
- 			hcd->usb_phy = phy;
- 			hcd->remove_phy = 1;
- 		}
- 	}
- 
  	if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) {
 -		hcd->phy_roothub = usb_phy_roothub_init(hcd->self.sysdev);
 +		hcd->phy_roothub = usb_phy_roothub_alloc(hcd->self.sysdev);
- 		if (IS_ERR(hcd->phy_roothub)) {
- 			retval = PTR_ERR(hcd->phy_roothub);
- 			goto err_phy_roothub_alloc;
- 		}
+ 		if (IS_ERR(hcd->phy_roothub))
+ 			return PTR_ERR(hcd->phy_roothub);
  
 +		retval = usb_phy_roothub_init(hcd->phy_roothub);
 +		if (retval)
- 			goto err_phy_roothub_alloc;
++			return retval;
 +
  		retval = usb_phy_roothub_power_on(hcd->phy_roothub);
  		if (retval)
  			goto err_usb_phy_roothub_power_on;
#1 lore raw
Quoted 12 lines · Stephen Rothwell

Hi Greg,

Today's linux-next merge of the usb tree got a conflict in:

drivers/usb/core/hcd.c

between commit:

63cb03f5c11e ("usb: core: split usb_phy_roothub_{init,alloc}")

from the usb.current tree and commit:

Quoted 7 lines

bc40f5341741 ("USB: core: hcd: drop support for legacy phys")

from the usb tree.

I fixed it up (see below - though I am not sure what happens to the phy_roothub allocation when usb_phy_roothub_init fails) and can carry the fix as necessary.

The resolution looks correct to me. The allocations done by usb_phy_roothub_alloc() are device managed and would be freed on probe failures (or unbind) so not explicit dealloc is needed. It might be a good idea to indicate that in the function name however (i.e. to add a devm_ prefix).

Johan

#2 lore raw
Quoted 21 lines · Johan Hovold
Quoted 12 lines · Stephen Rothwell

Hi Greg,

Today's linux-next merge of the usb tree got a conflict in:

drivers/usb/core/hcd.c

between commit:

63cb03f5c11e ("usb: core: split usb_phy_roothub_{init,alloc}")

from the usb.current tree and commit:

Quoted 7 lines

bc40f5341741 ("USB: core: hcd: drop support for legacy phys")

from the usb tree.

I fixed it up (see below - though I am not sure what happens to the phy_roothub allocation when usb_phy_roothub_init fails) and can carry the fix as necessary.

Quoted 5 lines

The resolution looks correct to me. The allocations done by usb_phy_roothub_alloc() are device managed and would be freed on probe failures (or unbind) so not explicit dealloc is needed. It might be a good idea to indicate that in the function name however (i.e. to add a devm_ prefix).

I'll take this same resolution when the branches get merged, thanks.

And yes, being more explicit would be a good idea for the function name...

thanks,

greg k-h

#3 lore raw
In reply to Stephen Rothwell

Hi all,

Quoted 61 lines · On Mon, 23 Apr 2018 13:04:44 +1000 Stephen Rothwell <[email protected]>…

Today's linux-next merge of the usb tree got a conflict in:

drivers/usb/core/hcd.c

between commit:

63cb03f5c11e ("usb: core: split usb_phy_roothub_{init,alloc}")

from the usb.current tree and commit:

bc40f5341741 ("USB: core: hcd: drop support for legacy phys")

from the usb tree.

I fixed it up (see below - though I am not sure what happens to the phy_roothub allocation when usb_phy_roothub_init fails) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

Signature · 2 lines
Cheers,
Stephen Rothwell
drivers/usb/core/hcd.c +1 -22
diff --cc drivers/usb/core/hcd.c
index 0a42c5df3c0f,ac5bcf449d7d..000000000000
@@@ -2742,35 -2740,11 +2743,15 @@@ int usb_add_hcd(struct usb_hcd *hcd
  	int retval;
  	struct usb_device *rhdev;
 
- 	if (IS_ENABLED(CONFIG_USB_PHY) && !hcd->skip_phy_initialization) {
- 		struct usb_phy *phy = usb_get_phy_dev(hcd->self.sysdev, 0);
- 
- 		if (IS_ERR(phy)) {
- 			retval = PTR_ERR(phy);
- 			if (retval == -EPROBE_DEFER)
- 				return retval;
- 		} else {
- 			retval = usb_phy_init(phy);
- 			if (retval) {
- 				usb_put_phy(phy);
- 				return retval;
- 			}
- 			hcd->usb_phy = phy;
- 			hcd->remove_phy = 1;
- 		}
- 	}
- 
  	if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) {
 -		hcd->phy_roothub = usb_phy_roothub_init(hcd->self.sysdev);
 +		hcd->phy_roothub = usb_phy_roothub_alloc(hcd->self.sysdev);
- 		if (IS_ERR(hcd->phy_roothub)) {
- 			retval = PTR_ERR(hcd->phy_roothub);
- 			goto err_phy_roothub_alloc;
- 		}
+ 		if (IS_ERR(hcd->phy_roothub))

drivers/usb/core/hcd.c

Quoted 10 lines
drivers/usb/core/hcd.c +2 -1
+ 			return PTR_ERR(hcd->phy_roothub);
 
 +		retval = usb_phy_roothub_init(hcd->phy_roothub);
 +		if (retval)
- 			goto err_phy_roothub_alloc;
++			return retval;
 +
  		retval = usb_phy_roothub_power_on(hcd->phy_roothub);
  		if (retval)
  			goto err_usb_phy_roothub_power_on;

This is now a conflict between the battery tree (since it merged the usb tree) and Linus' tree (since it merged the usb.current tree).

Signature · 2 lines
Cheers,
Stephen Rothwell
#4 lore raw

Hi,

Quoted 66 lines · Stephen Rothwell

Hi all,

Quoted 63 lines · On Mon, 23 Apr 2018 13:04:44 +1000 Stephen Rothwell <[email protected]>…

Today's linux-next merge of the usb tree got a conflict in:

drivers/usb/core/hcd.c

between commit:

63cb03f5c11e ("usb: core: split usb_phy_roothub_{init,alloc}")

from the usb.current tree and commit:

bc40f5341741 ("USB: core: hcd: drop support for legacy phys")

from the usb tree.

I fixed it up (see below - though I am not sure what happens to the phy_roothub allocation when usb_phy_roothub_init fails) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

Signature · 2 lines
Cheers,
Stephen Rothwell
drivers/usb/core/hcd.c +2 -22
diff --cc drivers/usb/core/hcd.c
index 0a42c5df3c0f,ac5bcf449d7d..000000000000
@@@ -2742,35 -2740,11 +2743,15 @@@ int usb_add_hcd(struct usb_hcd *hcd
  	int retval;
  	struct usb_device *rhdev;
 
- 	if (IS_ENABLED(CONFIG_USB_PHY) && !hcd->skip_phy_initialization) {
- 		struct usb_phy *phy = usb_get_phy_dev(hcd->self.sysdev, 0);
- 
- 		if (IS_ERR(phy)) {
- 			retval = PTR_ERR(phy);
- 			if (retval == -EPROBE_DEFER)
- 				return retval;
- 		} else {
- 			retval = usb_phy_init(phy);
- 			if (retval) {
- 				usb_put_phy(phy);
- 				return retval;
- 			}
- 			hcd->usb_phy = phy;
- 			hcd->remove_phy = 1;
- 		}
- 	}
- 
  	if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) {
 -		hcd->phy_roothub = usb_phy_roothub_init(hcd->self.sysdev);
 +		hcd->phy_roothub = usb_phy_roothub_alloc(hcd->self.sysdev);
- 		if (IS_ERR(hcd->phy_roothub)) {
- 			retval = PTR_ERR(hcd->phy_roothub);
- 			goto err_phy_roothub_alloc;
- 		}
+ 		if (IS_ERR(hcd->phy_roothub))
+ 			return PTR_ERR(hcd->phy_roothub);
Quoted 11 lines

drivers/usb/core/hcd.c

Quoted 8 lines

+ retval = usb_phy_roothub_init(hcd->phy_roothub);
+ if (retval)

drivers/usb/core/hcd.c +1 -1
- 			goto err_phy_roothub_alloc;
++			return retval;
 +
  		retval = usb_phy_roothub_power_on(hcd->phy_roothub);
  		if (retval)
  			goto err_usb_phy_roothub_power_on;

This is now a conflict between the battery tree (since it merged the usb tree) and Linus' tree (since it merged the usb.current tree).

Thanks for the heads up! I guess using a topic branch for the tcpm changes would have been the better choice :( As far as I can see there is not much I can do except for mentioning it to Linus when I send my pull request.

-- Sebastian

#6 lore raw
In reply to Stephen Rothwell
Quoted 66 lines · Stephen Rothwell

Hi all,

Quoted 63 lines · On Mon, 23 Apr 2018 13:04:44 +1000 Stephen Rothwell <[email protected]>…

Today's linux-next merge of the usb tree got a conflict in:

drivers/usb/core/hcd.c

between commit:

63cb03f5c11e ("usb: core: split usb_phy_roothub_{init,alloc}")

from the usb.current tree and commit:

bc40f5341741 ("USB: core: hcd: drop support for legacy phys")

from the usb tree.

I fixed it up (see below - though I am not sure what happens to the phy_roothub allocation when usb_phy_roothub_init fails) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

Signature · 2 lines
Cheers,
Stephen Rothwell
drivers/usb/core/hcd.c +2 -22
diff --cc drivers/usb/core/hcd.c
index 0a42c5df3c0f,ac5bcf449d7d..000000000000
@@@ -2742,35 -2740,11 +2743,15 @@@ int usb_add_hcd(struct usb_hcd *hcd
  	int retval;
  	struct usb_device *rhdev;
 
- 	if (IS_ENABLED(CONFIG_USB_PHY) && !hcd->skip_phy_initialization) {
- 		struct usb_phy *phy = usb_get_phy_dev(hcd->self.sysdev, 0);
- 
- 		if (IS_ERR(phy)) {
- 			retval = PTR_ERR(phy);
- 			if (retval == -EPROBE_DEFER)
- 				return retval;
- 		} else {
- 			retval = usb_phy_init(phy);
- 			if (retval) {
- 				usb_put_phy(phy);
- 				return retval;
- 			}
- 			hcd->usb_phy = phy;
- 			hcd->remove_phy = 1;
- 		}
- 	}
- 
  	if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) {
 -		hcd->phy_roothub = usb_phy_roothub_init(hcd->self.sysdev);
 +		hcd->phy_roothub = usb_phy_roothub_alloc(hcd->self.sysdev);
- 		if (IS_ERR(hcd->phy_roothub)) {
- 			retval = PTR_ERR(hcd->phy_roothub);
- 			goto err_phy_roothub_alloc;
- 		}
+ 		if (IS_ERR(hcd->phy_roothub))
+ 			return PTR_ERR(hcd->phy_roothub);
Quoted 11 lines

drivers/usb/core/hcd.c

Quoted 8 lines

+ retval = usb_phy_roothub_init(hcd->phy_roothub);
+ if (retval)

drivers/usb/core/hcd.c +1 -1
- 			goto err_phy_roothub_alloc;
++			return retval;
 +
  		retval = usb_phy_roothub_power_on(hcd->phy_roothub);
  		if (retval)
  			goto err_usb_phy_roothub_power_on;

This is now a conflict between the battery tree (since it merged the usb tree) and Linus' tree (since it merged the usb.current tree).

I have resolved the merge conflict in my tree. If the battery tree wants to pull again from my tree to resolve this for them, they are welcome to :)

thanks,

greg k-h

#5 lore raw
In reply to Sebastian Reichel
Quoted 81 lines · Sebastian Reichel

Hi,

Quoted 66 lines · Stephen Rothwell

Hi all,

Quoted 63 lines · On Mon, 23 Apr 2018 13:04:44 +1000 Stephen Rothwell <[email protected]>…

Today's linux-next merge of the usb tree got a conflict in:

drivers/usb/core/hcd.c

between commit:

63cb03f5c11e ("usb: core: split usb_phy_roothub_{init,alloc}")

from the usb.current tree and commit:

bc40f5341741 ("USB: core: hcd: drop support for legacy phys")

from the usb tree.

I fixed it up (see below - though I am not sure what happens to the phy_roothub allocation when usb_phy_roothub_init fails) and can carry the fix as necessary. This is now fixed as far as linux-next is concerned, but any non trivial conflicts should be mentioned to your upstream maintainer when your tree is submitted for merging. You may also want to consider cooperating with the maintainer of the conflicting tree to minimise any particularly complex conflicts.

Signature · 2 lines
Cheers,
Stephen Rothwell
drivers/usb/core/hcd.c +2 -22
diff --cc drivers/usb/core/hcd.c
index 0a42c5df3c0f,ac5bcf449d7d..000000000000
@@@ -2742,35 -2740,11 +2743,15 @@@ int usb_add_hcd(struct usb_hcd *hcd
  	int retval;
  	struct usb_device *rhdev;
 
- 	if (IS_ENABLED(CONFIG_USB_PHY) && !hcd->skip_phy_initialization) {
- 		struct usb_phy *phy = usb_get_phy_dev(hcd->self.sysdev, 0);
- 
- 		if (IS_ERR(phy)) {
- 			retval = PTR_ERR(phy);
- 			if (retval == -EPROBE_DEFER)
- 				return retval;
- 		} else {
- 			retval = usb_phy_init(phy);
- 			if (retval) {
- 				usb_put_phy(phy);
- 				return retval;
- 			}
- 			hcd->usb_phy = phy;
- 			hcd->remove_phy = 1;
- 		}
- 	}
- 
  	if (!hcd->skip_phy_initialization && usb_hcd_is_primary_hcd(hcd)) {
 -		hcd->phy_roothub = usb_phy_roothub_init(hcd->self.sysdev);
 +		hcd->phy_roothub = usb_phy_roothub_alloc(hcd->self.sysdev);
- 		if (IS_ERR(hcd->phy_roothub)) {
- 			retval = PTR_ERR(hcd->phy_roothub);
- 			goto err_phy_roothub_alloc;
- 		}
+ 		if (IS_ERR(hcd->phy_roothub))
+ 			return PTR_ERR(hcd->phy_roothub);
Quoted 11 lines

drivers/usb/core/hcd.c

Quoted 8 lines

+ retval = usb_phy_roothub_init(hcd->phy_roothub);
+ if (retval)

drivers/usb/core/hcd.c +1 -1
- 			goto err_phy_roothub_alloc;
++			return retval;
 +
  		retval = usb_phy_roothub_power_on(hcd->phy_roothub);
  		if (retval)
  			goto err_usb_phy_roothub_power_on;

This is now a conflict between the battery tree (since it merged the usb tree) and Linus' tree (since it merged the usb.current tree).

Quoted 4 lines

Thanks for the heads up! I guess using a topic branch for the tcpm changes would have been the better choice :( As far as I can see there is not much I can do except for mentioning it to Linus when I send my pull request.

Sorry about that, you are right, it would have been better to do that :(

greg k-h