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: <20190418165030.GA10675@xps15>
Date:   Thu, 18 Apr 2019 10:50:30 -0600
From:   Mathieu Poirier <mathieu.poirier@...aro.org>
To:     Suzuki K Poulose <suzuki.poulose@....com>
Cc:     linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        coresight@...ts.linaro.org, mike.leach@...aro.org,
        rjw@...ysocki.net, robert.walker@....com
Subject: Re: [PATCH v2 11/36] coresight: stm: Cleanup device specific data

On Mon, Apr 15, 2019 at 05:03:54PM +0100, Suzuki K Poulose wrote:
> Keep track of the STM coresight device which is a child device
> of the AMBA device. Since we can get to the coresight_device
> from the "device" instance, remove the explicit field.
> 
> Cc: Mathieu Poirier <mathieu.poirier@...aro.org>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@....com>
> ---
>  drivers/hwtracing/coresight/coresight-stm.c | 21 ++++++++++-----------
>  1 file changed, 10 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-stm.c b/drivers/hwtracing/coresight/coresight-stm.c
> index 9f8a844..8f50484 100644
> --- a/drivers/hwtracing/coresight/coresight-stm.c
> +++ b/drivers/hwtracing/coresight/coresight-stm.c
> @@ -110,7 +110,6 @@ struct channel_space {
>  /**
>   * struct stm_drvdata - specifics associated to an STM component
>   * @base:		memory mapped base address for this component.
> - * @dev:		the device entity associated to this component.
>   * @atclk:		optional clock for the core parts of the STM.
>   * @csdev:		component vitals needed by the framework.
>   * @spinlock:		only one at a time pls.
> @@ -128,7 +127,6 @@ struct channel_space {
>   */
>  struct stm_drvdata {
>  	void __iomem		*base;
> -	struct device		*dev;
>  	struct clk		*atclk;
>  	struct coresight_device	*csdev;
>  	spinlock_t		spinlock;
> @@ -205,13 +203,13 @@ static int stm_enable(struct coresight_device *csdev,
>  	if (val)
>  		return -EBUSY;
>  
> -	pm_runtime_get_sync(drvdata->dev);
> +	pm_runtime_get_sync(csdev->dev.parent);
>  
>  	spin_lock(&drvdata->spinlock);
>  	stm_enable_hw(drvdata);
>  	spin_unlock(&drvdata->spinlock);
>  
> -	dev_dbg(drvdata->dev, "STM tracing enabled\n");
> +	dev_dbg(&csdev->dev, "STM tracing enabled\n");
>  	return 0;
>  }
>  
> @@ -271,10 +269,10 @@ static void stm_disable(struct coresight_device *csdev,
>  		/* Wait until the engine has completely stopped */
>  		coresight_timeout(drvdata->base, STMTCSR, STMTCSR_BUSY_BIT, 0);
>  
> -		pm_runtime_put(drvdata->dev);
> +		pm_runtime_put(csdev->dev.parent);
>  
>  		local_set(&drvdata->mode, CS_MODE_DISABLED);
> -		dev_dbg(drvdata->dev, "STM tracing disabled\n");
> +		dev_dbg(&csdev->dev, "STM tracing disabled\n");
>  	}
>  }
>  
> @@ -763,9 +761,10 @@ static void stm_init_default_data(struct stm_drvdata *drvdata)
>  	bitmap_clear(drvdata->chs.guaranteed, 0, drvdata->numsp);
>  }
>  
> -static void stm_init_generic_data(struct stm_drvdata *drvdata)
> +static void stm_init_generic_data(struct stm_drvdata *drvdata,
> +				  const char *name)
>  {
> -	drvdata->stm.name = dev_name(drvdata->dev);
> +	drvdata->stm.name = name;
>  
>  	/*
>  	 * MasterIDs are assigned at HW design phase. As such the core is
> @@ -807,7 +806,6 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id)
>  	if (!drvdata)
>  		return -ENOMEM;
>  
> -	drvdata->dev = &adev->dev;
>  	drvdata->atclk = devm_clk_get(&adev->dev, "atclk"); /* optional */
>  	if (!IS_ERR(drvdata->atclk)) {
>  		ret = clk_prepare_enable(drvdata->atclk);
> @@ -848,7 +846,7 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id)
>  	spin_lock_init(&drvdata->spinlock);
>  
>  	stm_init_default_data(drvdata);
> -	stm_init_generic_data(drvdata);
> +	stm_init_generic_data(drvdata, dev_name(dev));
>  
>  	if (stm_register_device(dev, &drvdata->stm, THIS_MODULE)) {
>  		dev_info(dev,
> @@ -870,7 +868,8 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id)
>  
>  	pm_runtime_put(&adev->dev);
>  
> -	dev_info(dev, "%s initialized\n", (char *)coresight_get_uci_data(id));
> +	dev_info(&drvdata->csdev->dev, "%s initialized\n",
> +		 (char *)coresight_get_uci_data(id));
>  	return 0;
>  
>  stm_unregister:

Reviewed-by: Mathieu Poirier <mathieu.poirier@...aro.org>

> -- 
> 2.7.4
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ