public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Mike Leach <mike.leach@linaro.org>
Cc: coresight@lists.linaro.org, tingwei@codeaurora.org,
	linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com
Subject: Re: [PATCH] coresight: cti: Fix remove sysfs link error.
Date: Tue, 21 Jul 2020 11:51:10 -0600	[thread overview]
Message-ID: <20200721175110.GB1217536@xps15> (raw)
In-Reply-To: <20200721111736.10805-1-mike.leach@linaro.org>

Hi Mike,

On Tue, Jul 21, 2020 at 12:17:36PM +0100, Mike Leach wrote:
> CTI code to remove sysfs link to other devices on shutdown, incorrectly
> tries to remove a single ended link when these are all double ended. This
> implementation leaves elements in the link info structure undefined which
> results in a crash in recent tests for driver module unload.
> 
> This patch corrects the link removal code.
> 
> Fixes: 73274abb6557 (coresight: cti: Add in sysfs links to other coresight devices)
> 

Please remove the extra new line, add a "Reported-by:" for Tingwei and remove the
'.' at the end of the title.  Up to now I've been removing those manually but it
causes problems when Greg has to pickup a set directly from the mailing list.

Also, I just noticed the other problem you shared with Tingwei regarding the
call to cti_remove_conn_xrefs() in cti_remove().  I think it will be simpler if
you send a 2 patch serie with those fixes.

Thanks,
Mathieu 

> Signed-off-by: Mike Leach <mike.leach@linaro.org>
> ---
>  drivers/hwtracing/coresight/coresight-cti.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-cti.c b/drivers/hwtracing/coresight/coresight-cti.c
> index 3ccc703dc940..19d0b031a7df 100644
> --- a/drivers/hwtracing/coresight/coresight-cti.c
> +++ b/drivers/hwtracing/coresight/coresight-cti.c
> @@ -511,12 +511,15 @@ static bool cti_add_sysfs_link(struct cti_drvdata *drvdata,
>  	return !link_err;
>  }
>  
> -static void cti_remove_sysfs_link(struct cti_trig_con *tc)
> +static void cti_remove_sysfs_link(struct cti_drvdata *drvdata,
> +				  struct cti_trig_con *tc)
>  {
>  	struct coresight_sysfs_link link_info;
>  
> +	link_info.orig = drvdata->csdev;
>  	link_info.orig_name = tc->con_dev_name;
>  	link_info.target = tc->con_dev;
> +	link_info.target_name = dev_name(&drvdata->csdev->dev);
>  	coresight_remove_sysfs_link(&link_info);
>  }
>  
> @@ -607,7 +610,7 @@ void cti_remove_assoc_from_csdev(struct coresight_device *csdev)
>  		ctidev = &ctidrv->ctidev;
>  		list_for_each_entry(tc, &ctidev->trig_cons, node) {
>  			if (tc->con_dev == csdev->ect_dev) {
> -				cti_remove_sysfs_link(tc);
> +				cti_remove_sysfs_link(ctidrv, tc);
>  				tc->con_dev = NULL;
>  				break;
>  			}
> @@ -651,7 +654,7 @@ static void cti_remove_conn_xrefs(struct cti_drvdata *drvdata)
>  		if (tc->con_dev) {
>  			coresight_set_assoc_ectdev_mutex(tc->con_dev,
>  							 NULL);
> -			cti_remove_sysfs_link(tc);
> +			cti_remove_sysfs_link(drvdata, tc);
>  			tc->con_dev = NULL;
>  		}
>  	}
> -- 
> 2.17.1
> 

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

  reply	other threads:[~2020-07-21 17:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-21 11:17 [PATCH] coresight: cti: Fix remove sysfs link error Mike Leach
2020-07-21 17:51 ` Mathieu Poirier [this message]
2020-07-21 19:50   ` Mike Leach
2020-07-22 16:21     ` Mathieu Poirier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200721175110.GB1217536@xps15 \
    --to=mathieu.poirier@linaro.org \
    --cc=coresight@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=mike.leach@linaro.org \
    --cc=suzuki.poulose@arm.com \
    --cc=tingwei@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox