[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-arm-kernel
Subject:    Re: [PATCH v3 02/13] coresight: etb10: Fix handling of perf mode
From:       Suzuki K Poulose <suzuki.poulose () arm ! com>
Date:       2018-07-31 21:32:39
Message-ID: 7b311596-025a-f4f4-1859-6f3531258b75 () arm ! com
[Download RAW message or body]

On 07/31/2018 06:07 PM, Mathieu Poirier wrote:
> Hello,
> 
> On Thu, Jul 26, 2018 at 01:54:40PM +0100, Suzuki K Poulose wrote:
> > If the ETB is already enabled in sysfs mode, the ETB reports
> > success even if a perf mode is requested. Fix this by checking
> > the requested mode.
> > 
> > Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
> > Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
> > ---
> > drivers/hwtracing/coresight/coresight-etb10.c | 8 ++++++--
> > 1 file changed, 6 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/hwtracing/coresight/coresight-etb10.c \
> > b/drivers/hwtracing/coresight/coresight-etb10.c index 306119e..e5808fd 100644
> > --- a/drivers/hwtracing/coresight/coresight-etb10.c
> > +++ b/drivers/hwtracing/coresight/coresight-etb10.c
> > @@ -148,8 +148,12 @@ static int etb_enable(struct coresight_device *csdev, u32 \
> > mode)  return -EBUSY;
> > 
> > 	/* Nothing to do, the tracer is already enabled. */
> > -	if (val == CS_MODE_SYSFS)
> > -		goto out;
> > +	if (val == CS_MODE_SYSFS) {
> > +		if (mode == CS_MODE_SYSFS)
> > +			goto out;
> > +		else
> > +			return -EBUSY;
> > +	}
> 
> How about:
> 
> if (val == CS_MODE_PERF)
> return -EBUSY;
> 
> +       /* Don't let perf disturb sysFS sessions */
> +       if (val == CS_MODE_SYSFS && mode = CS_MODE_PERF)
> +               return -EBUSY;
> +
> /* Nothing to do, the tracer is already enabled. */
> if (val == CS_MODE_SYSFS)
> goto out;
> 
> 
> I just find it more readable that way.

Sure, thats fine by me.

Cheers
Suzuki


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic