[PATCH v3 6/9] coresight: Avoid enable programming clock duplicately

Leo Yan leo.yan at arm.com
Mon Jun 9 10:14:13 PDT 2025


On Mon, Jun 09, 2025 at 05:58:34PM +0100, Suzuki Kuruppassery Poulose wrote:

[...]

> >   static inline struct clk *coresight_get_enable_apb_pclk(struct device *dev)
> >   {
> > -	struct clk *pclk;
> > +	struct clk *pclk = NULL;
> > -	pclk = devm_clk_get_enabled(dev, "apb_pclk");
> > -	if (IS_ERR(pclk))
> > -		pclk = devm_clk_get_enabled(dev, "apb");
> > +	if (!dev_is_amba(dev)) {
> > +		pclk = devm_clk_get_enabled(dev, "apb_pclk");
> > +		if (IS_ERR(pclk))
> > +			pclk = devm_clk_get_enabled(dev, "apb");
> 
> AMBA driver doesn't handle "apb" clock ? So we may need to retain that here
> ?

Here checks the condition "if (!dev_is_amba(dev))", it means the device
is not an AMBA device (e.g., a platform device), the APB clock is
enabled at here.

Otherwise, for a AMBA device, the AMBA bus layer will help to enable
APB clock.

> Otherwise looks good to me.
> 
> Suzuki
> > +	}
> >   	return pclk;
> >   }
> > 
> 



More information about the linux-arm-kernel mailing list