lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53F775A1.4070200@cogentembedded.com>
Date:	Fri, 22 Aug 2014 20:53:53 +0400
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Antoine Ténart 
	<antoine.tenart@...e-electrons.com>, balbi@...com,
	gregkh@...uxfoundation.org, Peter.Chen@...escale.com,
	kishon@...com, stern@...land.harvard.edu
CC:	yoshihiro.shimoda.uh@...esas.com,
	alexandre.belloni@...e-electrons.com,
	thomas.petazzoni@...e-electrons.com, zmxu@...vell.com,
	jszhang@...vell.com, linux-usb@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 6/9] usb: allow to supply the PHY in the drivers when
 using HCD

Hello.

On 08/22/2014 07:50 PM, Antoine Ténart wrote:

> This patch modify the generic code handling PHYs to allow them to be
> supplied from the drivers. This adds checks to ensure no PHY was already
> there when looking for one in the generic code. This also makes sure we
> do not modify its state in the generic HCD functions, it was provided by
> the driver.

> Signed-off-by: Antoine Ténart <antoine.tenart@...e-electrons.com>
> Acked-by: Alan Stern <stern@...land.harvard.edu>
> ---
>   drivers/usb/core/hcd.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)

> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
> index 6619239baf6d..dc0e46e5e618 100644
> --- a/drivers/usb/core/hcd.c
> +++ b/drivers/usb/core/hcd.c
> @@ -2646,7 +2646,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
>   		}
>   	}
>
> -	if (IS_ENABLED(CONFIG_GENERIC_PHY)) {
> +	if (IS_ENABLED(CONFIG_GENERIC_PHY) && !hcd->phy) {
>   		struct phy *phy = phy_get(hcd->self.controller, "usb");
>
>   		if (IS_ERR(phy)) {
> @@ -2666,6 +2666,7 @@ int usb_add_hcd(struct usb_hcd *hcd,
>   				goto err_phy;
>   			}
>   			hcd->phy = phy;
> +			hcd->remove_phy = 1;
>   		}
>   	}
>
> @@ -2812,7 +2813,7 @@ err_allocate_root_hub:
>   err_register_bus:
>   	hcd_buffer_destroy(hcd);
>   err_create_buf:
> -	if (IS_ENABLED(CONFIG_GENERIC_PHY) && hcd->phy) {
> +	if (IS_ENABLED(CONFIG_GENERIC_PHY) && hcd->remove_phy && hcd->phy) {

    The 'hcd->phy' check seems redundant now.

>   		phy_power_off(hcd->phy);
>   		phy_exit(hcd->phy);
>   		phy_put(hcd->phy);
> @@ -2896,7 +2897,7 @@ void usb_remove_hcd(struct usb_hcd *hcd)
>   	usb_deregister_bus(&hcd->self);
>   	hcd_buffer_destroy(hcd);
>
> -	if (IS_ENABLED(CONFIG_GENERIC_PHY) && hcd->phy) {
> +	if (IS_ENABLED(CONFIG_GENERIC_PHY) && hcd->remove_phy && hcd->phy) {

    Here as well.

[...]

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ