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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5C5C0E94.4090401@ti.com>
Date:   Thu, 7 Feb 2019 12:55:16 +0200
From:   Roger Quadros <rogerq@...com>
To:     Kishon Vijay Abraham I <kishon@...com>,
        Rob Herring <robh+dt@...nel.org>
CC:     <devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 1/4] phy: core: Add *release* phy_ops invoked when the
 consumer relinquishes PHY

Kishon,

On 06/02/19 13:07, Kishon Vijay Abraham I wrote:
> Add a new phy_ops *release* invoked when the consumer relinquishes the
> PHY using phy_put/devm_phy_put. The initializations done by the PHY
> driver in of_xlate call back can be can be cleaned up here.
> 
> Signed-off-by: Kishon Vijay Abraham I <kishon@...com>
> ---
>  drivers/phy/phy-core.c  | 5 +++++
>  include/linux/phy/phy.h | 2 ++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
> index 19b05e824ee4..d4bd85afdc91 100644
> --- a/drivers/phy/phy-core.c
> +++ b/drivers/phy/phy-core.c
> @@ -564,6 +564,11 @@ void phy_put(struct phy *phy)
>  	if (!phy || IS_ERR(phy))
>  		return;
>  
> +	mutex_lock(&phy->mutex);
> +	if (phy->ops->release)
> +		phy->ops->release(phy);
> +	mutex_unlock(&phy->mutex);
> +
>  	module_put(phy->ops->owner);
>  	put_device(&phy->dev);
>  }
> diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
> index e8e118d70fd7..feb8dce54ac2 100644
> --- a/include/linux/phy/phy.h
> +++ b/include/linux/phy/phy.h
> @@ -63,6 +63,7 @@ union phy_configure_opts {
>   * @set_mode: set the mode of the phy
>   * @reset: resetting the phy
>   * @calibrate: calibrate the phy
> + * @release: ops to be performed while the consumer reliquishes the PHY

s/reliquishes/relinquishes

>   * @owner: the module owner containing the ops
>   */
>  struct phy_ops {
> @@ -104,6 +105,7 @@ struct phy_ops {
>  			    union phy_configure_opts *opts);
>  	int	(*reset)(struct phy *phy);
>  	int	(*calibrate)(struct phy *phy);
> +	void	(*release)(struct phy *phy);
>  	struct module *owner;
>  };
>  
> 

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ