Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2911414imm; Fri, 19 Oct 2018 01:39:40 -0700 (PDT) X-Google-Smtp-Source: ACcGV63GDJaKFQvH6wsGOWPZE1Hj96xmcIYHwnFsjZ6XrgChzglm40/K6Sn7DqvjUKWEDNRUdBhn X-Received: by 2002:a63:dd58:: with SMTP id g24-v6mr30997347pgj.86.1539938379939; Fri, 19 Oct 2018 01:39:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539938379; cv=none; d=google.com; s=arc-20160816; b=jykoUJgCuQxisIysaqWi1FiYbragoIz/dJ/e94IARtOzgYkY09l3esVi0LREYF3E0m pZWLEDz+pXa+eYUjmZtwUWPuGx797OJUZKVLHUfrm3Ddp/8Hhg8i7Nyq135dDJfXHRkC mxF/i6NttvAiAL4CNqSWQ4BJ7r1noYjeivKm73jA+8ZdXpzXzpyX7gfZ2AcfttzJnGn8 BE88km8DRHW/6YbfWgtVrqTMbknOiAvy4DszgREh2L0EA2eRUQMJv3sB6wYGIBReRQQE Fbk84PiCJIIAceqpBtyTVb29MOPfcD4uTsFfPIfelgmgm+tfE7GV75+wsJscNxOTQl27 6o/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=l9bluTpc25IppI2cdHkh2XWw/MonJnAUXvS1NCJVSbE=; b=RsFl0ZGl21lIqLjXifoMS5V9GM8xcravMc3wEslJCA0XxuJmqVKdCot2Cm3i7MFTox 5gT6j8NRnYjwDMlKSJzI6l7qaBKW/MSRzYEyXwlWnn4rPejBP4Mf0tJX7MKi3qbsSxrk OJ3fr62rxM6XvnvDHfKk69SwNwK19ELR3K41GfZkY13wkhvNJ2hFSGleCgMIW6tVBULP V5q4e3OMmySczw7Osrbmp5Bb/ZhsPmlSALdFqJ4s4vxJhj2HiUvATBeCKnLRmPPKAIdw AHmZNKDkuCp98c7sQ9EXtodIlUB0OsSmbbD8UZJ0fSrhCCyvSp2g7x9ckzifwtxWyjql AV8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k9-v6si22668868plt.144.2018.10.19.01.39.24; Fri, 19 Oct 2018 01:39:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727242AbeJSQnP (ORCPT + 99 others); Fri, 19 Oct 2018 12:43:15 -0400 Received: from foss.arm.com ([217.140.101.70]:48596 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727178AbeJSQnP (ORCPT ); Fri, 19 Oct 2018 12:43:15 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B196980D; Fri, 19 Oct 2018 01:38:09 -0700 (PDT) Received: from [10.37.12.214] (unknown [10.37.12.214]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C90B23F5D3; Fri, 19 Oct 2018 01:38:07 -0700 (PDT) Subject: Re: [PATCH] coresight: tmc: Fix bad register address for CLAIM To: Leo Yan , Mathieu Poirier , Alexander Shishkin , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Coresight ML Cc: Mike Leach , Robert Walker References: <1539924983-18503-1-git-send-email-leo.yan@linaro.org> From: Suzuki K Poulose Message-ID: <9b6a508d-5c4b-ffd8-7f6b-3f4e6db26571@arm.com> Date: Fri, 19 Oct 2018 09:39:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <1539924983-18503-1-git-send-email-leo.yan@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Leo, On 10/19/2018 05:56 AM, Leo Yan wrote: > Commit 4d3ebd3658d8 ("coreisght: tmc: Claim device before use") uses > CLAIM tag to validate if the device is available, it needs to pass > the device base address to access related registers. > > In the function tmc_etb_disable_hw() it wrongly passes the driver data > pointer as register base address, thus it's easily to produce the kernel > warning info like below: > > [ 83.579898] WARNING: CPU: 4 PID: 2970 at drivers/hwtracing/coresight/coresight.c:207 coresight_disclaim_device_unlocked+0x44/0x80 > [ 83.591448] Modules linked in: > [ 83.594485] CPU: 4 PID: 2970 Comm: uname Not tainted 4.19.0-rc6-00417-g721b509 #110 Oops! Thanks for fixing ! > > This patch is to fix this bug by using 'drvdata->base' as the > register base address for CLAIM related operation. > > Fixes: 4d3ebd3658d8 ("coreisght: tmc: Claim device before use") > Cc: Suzuki Poulose > Cc: Mathieu Poirier > Cc: Mike Leach > Cc: Robert Walker > Signed-off-by: Leo Yan Reviewed-by: Suzuki K Poulose > --- > drivers/hwtracing/coresight/coresight-tmc-etf.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/hwtracing/coresight/coresight-tmc-etf.c b/drivers/hwtracing/coresight/coresight-tmc-etf.c > index 53fc83b..5864ac5 100644 > --- a/drivers/hwtracing/coresight/coresight-tmc-etf.c > +++ b/drivers/hwtracing/coresight/coresight-tmc-etf.c > @@ -86,7 +86,7 @@ static void __tmc_etb_disable_hw(struct tmc_drvdata *drvdata) > > static void tmc_etb_disable_hw(struct tmc_drvdata *drvdata) > { > - coresight_disclaim_device(drvdata); > + coresight_disclaim_device(drvdata->base); > __tmc_etb_disable_hw(drvdata); > } > >