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: <040dce71-36c8-f2e6-cdf0-a848294862c4@nvidia.com>
Date:   Wed, 11 Jul 2018 09:24:57 +0100
From:   Jon Hunter <jonathanh@...dia.com>
To:     Aapo Vienamo <avienamo@...dia.com>,
        Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Thierry Reding <thierry.reding@...il.com>,
        Mikko Perttunen <mperttunen@...dia.com>
CC:     <devicetree@...r.kernel.org>, <linux-tegra@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/6] soc/tegra: pmc: Factor out DPD register bit
 calculation


On 10/07/18 13:47, Aapo Vienamo wrote:
> Factor out the the code to calculate the correct DPD register and bit
> number for a given pad. This logic will be needed to query the status
> register.
> 
> Signed-off-by: Aapo Vienamo <avienamo@...dia.com>
> ---
>  drivers/soc/tegra/pmc.c | 20 +++++++++++++++++---
>  1 file changed, 17 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
> index 5bea3b9..83b39cd 100644
> --- a/drivers/soc/tegra/pmc.c
> +++ b/drivers/soc/tegra/pmc.c
> @@ -922,11 +922,12 @@ tegra_io_pad_find(struct tegra_pmc *pmc, enum tegra_io_pad id)
>  	return NULL;
>  }
>  
> -static int tegra_io_pad_prepare(enum tegra_io_pad id, unsigned long *request,
> -				unsigned long *status, u32 *mask)
> +static int tegra_io_pad_get_dpd_register_bit(enum tegra_io_pad id,
> +					     unsigned long *request,
> +					     unsigned long *status,
> +					     u32 *mask)
>  {
>  	const struct tegra_io_pad_soc *pad;
> -	unsigned long rate, value;
>  
>  	pad = tegra_io_pad_find(pmc, id);
>  	if (!pad) {
> @@ -947,6 +948,19 @@ static int tegra_io_pad_prepare(enum tegra_io_pad id, unsigned long *request,
>  		*request = pmc->soc->regs->dpd2_req;
>  	}
>  
> +	return 0;
> +}
> +
> +static int tegra_io_pad_prepare(enum tegra_io_pad id, unsigned long *request,
> +				unsigned long *status, u32 *mask)
> +{
> +	unsigned long rate, value;
> +	int err;
> +
> +	err = tegra_io_pad_get_dpd_register_bit(id, request, status, mask);
> +	if (err)
> +		return err;
> +
>  	if (pmc->clk) {
>  		rate = clk_get_rate(pmc->clk);
>  		if (!rate) {
> 

Acked-by: Jon Hunter <jonathanh@...dia.com>

Cheers
Jon

-- 
nvpublic

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ