Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1510772 > unrolled thread

Re: [PATCH] clk: xgene: Don't call __pa on ioremaped address

Started byLaura Abbott <labbott@redhat.com>
First post2016-10-28 01:30 +0200
Last post2016-10-28 01:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] clk: xgene: Don't call __pa on ioremaped address Laura Abbott <labbott@redhat.com> - 2016-10-28 01:30 +0200
    Re: [PATCH] clk: xgene: Don't call __pa on ioremaped address Stephen Boyd <sboyd@codeaurora.org> - 2016-10-28 01:40 +0200

#1510772 — Re: [PATCH] clk: xgene: Don't call __pa on ioremaped address

FromLaura Abbott <labbott@redhat.com>
Date2016-10-28 01:30 +0200
SubjectRe: [PATCH] clk: xgene: Don't call __pa on ioremaped address
Message-ID<sx2hr-4V-19@gated-at.bofh.it>
On 10/27/2016 04:21 PM, Laura Abbott wrote:
> ioremaped addresses are not linearly mapped so the physical
> address can not be figured out via __pa. More generally, there
> is no guarantee that backing value of an ioremapped address
> is a physical address at all. The value here is only used
> for debugging so just drop the call to __pa on the ioremapped
> address.
>
> Signed-off-by: Laura Abbott <labbott@redhat.com>
> ---
> Found while working on virt_to_phys debugging for arm64
> ---
>  drivers/clk/clk-xgene.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/clk/clk-xgene.c b/drivers/clk/clk-xgene.c
> index 3433132..4697bf9 100644
> --- a/drivers/clk/clk-xgene.c
> +++ b/drivers/clk/clk-xgene.c
> @@ -243,22 +243,20 @@ static int xgene_clk_enable(struct clk_hw *hw)
>  	struct xgene_clk *pclk = to_xgene_clk(hw);
>  	unsigned long flags = 0;
>  	u32 data;
> -	phys_addr_t reg;
>
>  	if (pclk->lock)
>  		spin_lock_irqsave(pclk->lock, flags);
>
>  	if (pclk->param.csr_reg != NULL) {
>  		pr_debug("%s clock enabled\n", clk_hw_get_name(hw));
> -		reg = __pa(pclk->param.csr_reg);
>  		/* First enable the clock */
>  		data = xgene_clk_read(pclk->param.csr_reg +
>  					pclk->param.reg_clk_offset);
>  		data |= pclk->param.reg_clk_mask;
>  		xgene_clk_write(data, pclk->param.csr_reg +
>  					pclk->param.reg_clk_offset);
> -		pr_debug("%s clock PADDR base %pa clk offset 0x%08X mask 0x%08X value 0x%08X\n",
> -			clk_hw_get_name(hw), &reg,
> +		pr_debug("%s clk offset 0x%08X mask 0x%08X value 0x%08X\n",
> +			clk_hw_get_name(hw),
>  			pclk->param.reg_clk_offset, pclk->param.reg_clk_mask,
>  			data);
>
> @@ -269,7 +267,7 @@ static int xgene_clk_enable(struct clk_hw *hw)
>  		xgene_clk_write(data, pclk->param.csr_reg +
>  					pclk->param.reg_csr_offset);
>  		pr_debug("%s CSR RESET PADDR base %pa csr offset 0x%08X mask 0x%08X value 0x%08X\n",

Bah, this got fixed locally but didn't get amended. I'll remove
the format here in a v2 assuming there are no other objections.

> -			clk_hw_get_name(hw), &reg,
> +			clk_hw_get_name(hw),
>  			pclk->param.reg_csr_offset, pclk->param.reg_csr_mask,
>  			data);
>  	}
>

[toc] | [next] | [standalone]


#1510777

FromStephen Boyd <sboyd@codeaurora.org>
Date2016-10-28 01:40 +0200
Message-ID<sx2r8-9r-19@gated-at.bofh.it>
In reply to#1510772
On 10/27, Laura Abbott wrote:
> On 10/27/2016 04:21 PM, Laura Abbott wrote:
> >
> >@@ -269,7 +267,7 @@ static int xgene_clk_enable(struct clk_hw *hw)
> > 		xgene_clk_write(data, pclk->param.csr_reg +
> > 					pclk->param.reg_csr_offset);
> > 		pr_debug("%s CSR RESET PADDR base %pa csr offset 0x%08X mask 0x%08X value 0x%08X\n",
> 
> Bah, this got fixed locally but didn't get amended. I'll remove
> the format here in a v2 assuming there are no other objections.
> 

Include a Fixes: tag too? It would be nice if sparse complained
about __pa used on an __iomem pointer too.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web