From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FCD1C433DF for ; Tue, 21 Jul 2020 17:52:40 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4990B20717 for ; Tue, 21 Jul 2020 17:52:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NL7vXRIC"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="TCfIG95W" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4990B20717 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=j/4kDC+0MP9qysY+AglyoFlAyUBan0OsL7XKWOQSmBU=; b=NL7vXRICsofyz99MXyyD/7AoP 4ecWjP9Zlqyb2EOqpNIYxUSAgZYIgRomqqjzSBrFvVg2NGapNo8cXAeBxh7byJOEGciyc+dQvnVBy eH2JwHhnlJUdkE/C8XAQVMnRAlrceh8UC/TZJoLSaHHXj3fl3PzCjorAPD3pgHtfM+v+MBPcQ4pHY jPyTn5E6sls4koRwbOo0oIxSesxuLVp6Q8wWILxu8Z73cNwr0pMs8AoGbK8T2hMOl95T2TZSIpwiS xTkgQco/Xt6r5hKsvL2LgJu9K11yDDt8BtDFL/svmA7Y4vlkmevq8no28sn5X+o4ptSszKNkbw+cE FitkarKsQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxwQA-00058v-25; Tue, 21 Jul 2020 17:51:18 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxwQ7-00058H-3N for linux-arm-kernel@lists.infradead.org; Tue, 21 Jul 2020 17:51:16 +0000 Received: by mail-pl1-x642.google.com with SMTP id k4so10573060pld.12 for ; Tue, 21 Jul 2020 10:51:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=1/G/6YSg4NK+/1cqRG9X7l2LWQ8HQxH0eq1RWTBZ2lg=; b=TCfIG95WOBZpiEG1JX91eadTknTvTX/v6sX85OydlrO/Lz+FaFf0m6S3IdzPF/s/Hi zQaIGS6UiB8+F7ncwYCZbJqkNov1eylxyG7aie77z7gQbkIF1eCdT/hlw9uiErcn12eI RN4Maxb7QTWGsYoR2UkH1lfuEpBLDVy4fjqL/IDmBOtRC3HVnNZJk/6ZrvE2Rm298ShV 8f7bNYHAQy78hxs+jdxRD3tG5GNTT/IO4AydQtsNUF30/b/AITY48S1/FM7C1OV+aGa2 qk+6QNpx1IBOcMDGy66/pGgNXm9pO6sAbF4sixyU/zDFlxoR5xnq7boanu3GJqxF3806 aHOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=1/G/6YSg4NK+/1cqRG9X7l2LWQ8HQxH0eq1RWTBZ2lg=; b=Wn9wwlM4vhnfFZcOdbqwtgQlhyNkwKqFmmfH2SiV5K2+W5LY3mKeK2sxvkejmrayhS qaq1c410V2+mlDA9oEIrsibvGSkzgpLBASydAc6dVr8BOhndg/WBzYgy9Zb/TB7D2Wp1 n5/nErAfhfKObYGgpT3IM3AwZmLAcJC5GDGLF0Z1pMm6BSwagXpZXiQLO/AtDNeqQExw og7141lCr1DW8QkYKj0Iw/lREzcgFJ037jujjS3KdKd0rbYtE43Hb0d4XWAh4aoT+VvY PaBoKU1xsgSuvzFBWR+39B5UbF+KJAJmruLJ/5B8YT1RHKVqts2/4vpd6gf/t2PTl374 +cow== X-Gm-Message-State: AOAM531tkJDjAL3vYCRLZlpd4m3+fLh7NK29gU32o7ippTt1yFfzoykP SZalxLT6EDPyYdUj47YovRBEyA== X-Google-Smtp-Source: ABdhPJzvjZlvMLvvv0DAQS8MG7R4SWbhnEMucF2cfVOcZQNZaK/zFjMAY/pMpxZXvhjIElavVFplHg== X-Received: by 2002:a17:90a:ce96:: with SMTP id g22mr6009565pju.9.1595353873200; Tue, 21 Jul 2020 10:51:13 -0700 (PDT) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id o23sm22076119pfd.126.2020.07.21.10.51.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 10:51:12 -0700 (PDT) Date: Tue, 21 Jul 2020 11:51:10 -0600 From: Mathieu Poirier To: Mike Leach Subject: Re: [PATCH] coresight: cti: Fix remove sysfs link error. Message-ID: <20200721175110.GB1217536@xps15> References: <20200721111736.10805-1-mike.leach@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200721111736.10805-1-mike.leach@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200721_135115_820036_561462F7 X-CRM114-Status: GOOD ( 22.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: coresight@lists.linaro.org, tingwei@codeaurora.org, linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 > --- > 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