Linux-USB Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] usb: dwc3: remove generic PHYs forwarding for XHCI device
       [not found] <CGME20190719093045eucas1p1a1c6f26ae4103e9ed283fff2396beaef@eucas1p1.samsung.com>
@ 2019-07-19  9:30 ` Marek Szyprowski
  2019-08-08 12:47   ` Felipe Balbi
  0 siblings, 1 reply; 3+ messages in thread
From: Marek Szyprowski @ 2019-07-19  9:30 UTC (permalink / raw)
  To: linux-usb, linux-samsung-soc
  Cc: linux-kernel, Marek Szyprowski, Mathias Nyman, Felipe Balbi,
	Bartlomiej Zolnierkiewicz, Krzysztof Kozlowski

Commit 08f871a3aca2 ("usb: dwc3: host: convey the PHYs to xhci") added
forwarding of the generic PHYs from DWC3 core to the instantiated XHCI-plat
device. However XHCI(-plat) driver never gained support for generic PHYs,
thus the lookup added by that commit is never used. In meantime the commit
d64ff406e51e ("usb: dwc3: use bus->sysdev for DMA configuration")
incorrectly changed the device used for creating lookup, making the lookup
useless and generic PHYs inaccessible from XHCI device.

However since commit 178a0bce05cb ("usb: core: hcd: integrate the PHY
wrapper into the HCD core") USB HCD already handles generic PHYs acquired
from the HCD's 'sysdev', which in this case is DWC3 core device. This means
that creating any custom lookup entries for XHCI driver is no longer needed
and can be simply removed.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 drivers/usb/dwc3/host.c | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index f55947294f7c..8deea8c91e03 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -85,7 +85,7 @@ int dwc3_host_init(struct dwc3 *dwc)
 						DWC3_XHCI_RESOURCES_NUM);
 	if (ret) {
 		dev_err(dwc->dev, "couldn't add resources to xHCI device\n");
-		goto err1;
+		goto err;
 	}
 
 	memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props));
@@ -112,37 +112,23 @@ int dwc3_host_init(struct dwc3 *dwc)
 		ret = platform_device_add_properties(xhci, props);
 		if (ret) {
 			dev_err(dwc->dev, "failed to add properties to xHCI\n");
-			goto err1;
+			goto err;
 		}
 	}
 
-	phy_create_lookup(dwc->usb2_generic_phy, "usb2-phy",
-			  dev_name(dwc->dev));
-	phy_create_lookup(dwc->usb3_generic_phy, "usb3-phy",
-			  dev_name(dwc->dev));
-
 	ret = platform_device_add(xhci);
 	if (ret) {
 		dev_err(dwc->dev, "failed to register xHCI device\n");
-		goto err2;
+		goto err;
 	}
 
 	return 0;
-err2:
-	phy_remove_lookup(dwc->usb2_generic_phy, "usb2-phy",
-			  dev_name(dwc->dev));
-	phy_remove_lookup(dwc->usb3_generic_phy, "usb3-phy",
-			  dev_name(dwc->dev));
-err1:
+err:
 	platform_device_put(xhci);
 	return ret;
 }
 
 void dwc3_host_exit(struct dwc3 *dwc)
 {
-	phy_remove_lookup(dwc->usb2_generic_phy, "usb2-phy",
-			  dev_name(dwc->dev));
-	phy_remove_lookup(dwc->usb3_generic_phy, "usb3-phy",
-			  dev_name(dwc->dev));
 	platform_device_unregister(dwc->xhci);
 }
-- 
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: dwc3: remove generic PHYs forwarding for XHCI device
  2019-07-19  9:30 ` [PATCH] usb: dwc3: remove generic PHYs forwarding for XHCI device Marek Szyprowski
@ 2019-08-08 12:47   ` Felipe Balbi
  2019-08-09 10:31     ` Roger Quadros
  0 siblings, 1 reply; 3+ messages in thread
From: Felipe Balbi @ 2019-08-08 12:47 UTC (permalink / raw)
  To: Marek Szyprowski, linux-usb, linux-samsung-soc, Roger Quadros
  Cc: linux-kernel, Marek Szyprowski, Mathias Nyman,
	Bartlomiej Zolnierkiewicz, Krzysztof Kozlowski

[-- Attachment #1: Type: text/plain, Size: 2825 bytes --]


Hi,

Marek Szyprowski <m.szyprowski@samsung.com> writes:

> Commit 08f871a3aca2 ("usb: dwc3: host: convey the PHYs to xhci") added
> forwarding of the generic PHYs from DWC3 core to the instantiated XHCI-plat
> device. However XHCI(-plat) driver never gained support for generic PHYs,
> thus the lookup added by that commit is never used. In meantime the commit
> d64ff406e51e ("usb: dwc3: use bus->sysdev for DMA configuration")
> incorrectly changed the device used for creating lookup, making the lookup
> useless and generic PHYs inaccessible from XHCI device.
>
> However since commit 178a0bce05cb ("usb: core: hcd: integrate the PHY
> wrapper into the HCD core") USB HCD already handles generic PHYs acquired
> from the HCD's 'sysdev', which in this case is DWC3 core device. This means
> that creating any custom lookup entries for XHCI driver is no longer needed
> and can be simply removed.
>
> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
> ---
>  drivers/usb/dwc3/host.c | 22 ++++------------------
>  1 file changed, 4 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
> index f55947294f7c..8deea8c91e03 100644
> --- a/drivers/usb/dwc3/host.c
> +++ b/drivers/usb/dwc3/host.c
> @@ -85,7 +85,7 @@ int dwc3_host_init(struct dwc3 *dwc)
>  						DWC3_XHCI_RESOURCES_NUM);
>  	if (ret) {
>  		dev_err(dwc->dev, "couldn't add resources to xHCI device\n");
> -		goto err1;
> +		goto err;
>  	}
>  
>  	memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props));
> @@ -112,37 +112,23 @@ int dwc3_host_init(struct dwc3 *dwc)
>  		ret = platform_device_add_properties(xhci, props);
>  		if (ret) {
>  			dev_err(dwc->dev, "failed to add properties to xHCI\n");
> -			goto err1;
> +			goto err;
>  		}
>  	}
>  
> -	phy_create_lookup(dwc->usb2_generic_phy, "usb2-phy",
> -			  dev_name(dwc->dev));
> -	phy_create_lookup(dwc->usb3_generic_phy, "usb3-phy",
> -			  dev_name(dwc->dev));
> -
>  	ret = platform_device_add(xhci);
>  	if (ret) {
>  		dev_err(dwc->dev, "failed to register xHCI device\n");
> -		goto err2;
> +		goto err;
>  	}
>  
>  	return 0;
> -err2:
> -	phy_remove_lookup(dwc->usb2_generic_phy, "usb2-phy",
> -			  dev_name(dwc->dev));
> -	phy_remove_lookup(dwc->usb3_generic_phy, "usb3-phy",
> -			  dev_name(dwc->dev));
> -err1:
> +err:
>  	platform_device_put(xhci);
>  	return ret;
>  }
>  
>  void dwc3_host_exit(struct dwc3 *dwc)
>  {
> -	phy_remove_lookup(dwc->usb2_generic_phy, "usb2-phy",
> -			  dev_name(dwc->dev));
> -	phy_remove_lookup(dwc->usb3_generic_phy, "usb3-phy",
> -			  dev_name(dwc->dev));
>  	platform_device_unregister(dwc->xhci);
>  }

Roger, could you verify that this doesn't regress any of your platforms?

Thanks

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] usb: dwc3: remove generic PHYs forwarding for XHCI device
  2019-08-08 12:47   ` Felipe Balbi
@ 2019-08-09 10:31     ` Roger Quadros
  0 siblings, 0 replies; 3+ messages in thread
From: Roger Quadros @ 2019-08-09 10:31 UTC (permalink / raw)
  To: Felipe Balbi, Marek Szyprowski, linux-usb, linux-samsung-soc
  Cc: linux-kernel, Mathias Nyman, Bartlomiej Zolnierkiewicz,
	Krzysztof Kozlowski

Hi,

On 08/08/2019 15:47, Felipe Balbi wrote:
> 
> Hi,
> 
> Marek Szyprowski <m.szyprowski@samsung.com> writes:
> 
>> Commit 08f871a3aca2 ("usb: dwc3: host: convey the PHYs to xhci") added
>> forwarding of the generic PHYs from DWC3 core to the instantiated XHCI-plat
>> device. However XHCI(-plat) driver never gained support for generic PHYs,
>> thus the lookup added by that commit is never used. In meantime the commit
>> d64ff406e51e ("usb: dwc3: use bus->sysdev for DMA configuration")
>> incorrectly changed the device used for creating lookup, making the lookup
>> useless and generic PHYs inaccessible from XHCI device.
>>
>> However since commit 178a0bce05cb ("usb: core: hcd: integrate the PHY
>> wrapper into the HCD core") USB HCD already handles generic PHYs acquired
>> from the HCD's 'sysdev', which in this case is DWC3 core device. This means
>> that creating any custom lookup entries for XHCI driver is no longer needed
>> and can be simply removed.
>>
>> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
>> ---
>>  drivers/usb/dwc3/host.c | 22 ++++------------------
>>  1 file changed, 4 insertions(+), 18 deletions(-)
>>
>> diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
>> index f55947294f7c..8deea8c91e03 100644
>> --- a/drivers/usb/dwc3/host.c
>> +++ b/drivers/usb/dwc3/host.c
>> @@ -85,7 +85,7 @@ int dwc3_host_init(struct dwc3 *dwc)
>>  						DWC3_XHCI_RESOURCES_NUM);
>>  	if (ret) {
>>  		dev_err(dwc->dev, "couldn't add resources to xHCI device\n");
>> -		goto err1;
>> +		goto err;
>>  	}
>>  
>>  	memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props));
>> @@ -112,37 +112,23 @@ int dwc3_host_init(struct dwc3 *dwc)
>>  		ret = platform_device_add_properties(xhci, props);
>>  		if (ret) {
>>  			dev_err(dwc->dev, "failed to add properties to xHCI\n");
>> -			goto err1;
>> +			goto err;
>>  		}
>>  	}
>>  
>> -	phy_create_lookup(dwc->usb2_generic_phy, "usb2-phy",
>> -			  dev_name(dwc->dev));
>> -	phy_create_lookup(dwc->usb3_generic_phy, "usb3-phy",
>> -			  dev_name(dwc->dev));
>> -
>>  	ret = platform_device_add(xhci);
>>  	if (ret) {
>>  		dev_err(dwc->dev, "failed to register xHCI device\n");
>> -		goto err2;
>> +		goto err;
>>  	}
>>  
>>  	return 0;
>> -err2:
>> -	phy_remove_lookup(dwc->usb2_generic_phy, "usb2-phy",
>> -			  dev_name(dwc->dev));
>> -	phy_remove_lookup(dwc->usb3_generic_phy, "usb3-phy",
>> -			  dev_name(dwc->dev));
>> -err1:
>> +err:
>>  	platform_device_put(xhci);
>>  	return ret;
>>  }
>>  
>>  void dwc3_host_exit(struct dwc3 *dwc)
>>  {
>> -	phy_remove_lookup(dwc->usb2_generic_phy, "usb2-phy",
>> -			  dev_name(dwc->dev));
>> -	phy_remove_lookup(dwc->usb3_generic_phy, "usb3-phy",
>> -			  dev_name(dwc->dev));
>>  	platform_device_unregister(dwc->xhci);
>>  }
> 
> Roger, could you verify that this doesn't regress any of your platforms?

Patch is fine with our platforms.

-- 
cheers,
-roger

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20190719093045eucas1p1a1c6f26ae4103e9ed283fff2396beaef@eucas1p1.samsung.com>
2019-07-19  9:30 ` [PATCH] usb: dwc3: remove generic PHYs forwarding for XHCI device Marek Szyprowski
2019-08-08 12:47   ` Felipe Balbi
2019-08-09 10:31     ` Roger Quadros

Linux-USB Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-usb/0 linux-usb/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-usb linux-usb/ https://lore.kernel.org/linux-usb \
		linux-usb@vger.kernel.org linux-usb@archiver.kernel.org
	public-inbox-index linux-usb


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-usb


AGPL code for this site: git clone https://public-inbox.org/ public-inbox