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=-11.5 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 1A013C43461 for ; Mon, 14 Sep 2020 18:09:08 +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 BC0C2208B3 for ; Mon, 14 Sep 2020 18:09:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="I3WLtkii"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Wq1KqHf7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BC0C2208B3 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=OJF5zFbGApzdF+/ZfL5VTjXUs3AgzzHsAQli/vAteek=; b=I3WLtkiijPYmbCIWOFsPFR2B9 Ujc9SDLD1jeKBW08/sD6HO6r5bBKIv8D4Ee4jKWjhOt+ruMOmtA1OUP0+a4TdKISQjiS3FbKgTX80 8tkNzadXKFbhSwMS2c3iUJorx86wIYacPy366HkLvYqywT4GyKSjTZEZ6AEdnH/GhNE3yfDwMjyPZ FS6biTEwtXm1xfY5IrJNkuf+OsJeulxBaLF+UCQsZ0D9bTl4XV+Lw/Oh6IbS1WaN6pk6E97LmF+xd EpwIzgoFfAAuShBjY7f8paZhLQx9EHUsv3K2x+PN1bGSLw0ElG80IR90MZ5A6CsV7z72xiokSPfVx zRblEwKTg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHstD-0000SN-Dx; Mon, 14 Sep 2020 18:07:43 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHst9-0000Qg-Mn for linux-arm-kernel@lists.infradead.org; Mon, 14 Sep 2020 18:07:40 +0000 Received: by mail-pf1-x444.google.com with SMTP id v196so260997pfc.1 for ; Mon, 14 Sep 2020 11:07:37 -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=kHCI7393v5p3kexWunTjdq/iYFgJKMZ0uvZccmvK5y8=; b=Wq1KqHf7XbQNK9J/wBkbvAfCmPENj64N2mQRwZxLftk5ZvLJHMrD5KIRurHlZakzam g5Dhpjg6yuiPSn783tfxST3oemxDNWGHY8QjYw5lqQ8UVYyppUj6vCC3VFQo8k3mc2aL JNP9W6DX666rVAfjikQ75Qg0yTTl25zoTMezx6mW1Ty1LYP5p/CtnlsoodcEeO7Z0aLP Xzpe+wlxBe4BXfPPocf0g8pvNdad57vqt9HrwddSWHzEhKg827LCHxAS76YL/3euUKdO +aj8pgobrGQbGokyuLRFQL12u0pD0XY+4QX4qt3TL1j+hA51Q4m9cCW56TGEB9+iJ4Km cL3g== 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=kHCI7393v5p3kexWunTjdq/iYFgJKMZ0uvZccmvK5y8=; b=e9oCsgZ8z4rOHlN8jxkDTE20/NMD8kOQiGJ8dXiPv3vrp6ODtcD6MoX3yEMlCP7/lC AZxbFCXZGuKuJXoBdIThcNAXFSCfiSMTZA41lfPr3d+3sXGhJrjFscMQalBDCwKLFrjm wpSWvGYD2jUjNDP3FenD78+e2qrorw1Hkj69/f2zz+o6hDl7xyuLoZmwKR8aGLFmGbBh Q9ATlfZisOmoeqewg+X2n5BVYIs/q030zB2/SbG0+z8K1hkuq1fgwv0R3q4Gz7mdQdPp fK3jYTUJSDKess3ITUvNoXfnV3T6N7tPXRBPzedI/dnA8pAfDoxQ/2ZToZNKW3L6thF7 AoRA== X-Gm-Message-State: AOAM530PEcOOzHNdzaLb9mlbp3SlnQzezRQfrwZmqg5geRnpJBT1/qcv RBI7rRIjZdzxSACxj+3DEpAIkA== X-Google-Smtp-Source: ABdhPJxrFrjvVqOIlIBr14qaBpuCIcZBJRtrTbHN8EzlL6RAfkfE2K09U0mY0LwWELCoLih8z4PzsA== X-Received: by 2002:a63:a55e:: with SMTP id r30mr12232178pgu.61.1600106855715; Mon, 14 Sep 2020 11:07:35 -0700 (PDT) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id y23sm10906205pfp.65.2020.09.14.11.07.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Sep 2020 11:07:35 -0700 (PDT) Date: Mon, 14 Sep 2020 12:07:32 -0600 From: Mathieu Poirier To: Tingwei Zhang Subject: Re: [PATCH v10 19/24] coresight: cti: don't disable ect device if it's not enabled Message-ID: <20200914180732.GB3238264@xps15> References: <20200821034445.967-1-tingwei@codeaurora.org> <20200821034445.967-20-tingwei@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200821034445.967-20-tingwei@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200914_140739_760640_BC26237F X-CRM114-Status: GOOD ( 24.40 ) 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: tsoni@codeaurora.org, Sai Prakash Ranjan , Kim Phillips , Mao Jinlong , Suzuki K Poulose , Alexander Shishkin , Greg Kroah-Hartman , coresight@lists.linaro.org, Randy Dunlap , Mian Yousaf Kaukab , Russell King , linux-kernel@vger.kernel.org, Leo Yan , linux-arm-kernel@lists.infradead.org, Mike Leach 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 On Fri, Aug 21, 2020 at 11:44:40AM +0800, Tingwei Zhang wrote: > If associated ect device is not enabled at first place, disable > routine should not be called. Add ect_enabled flag to check whether > ect device is enabled. Fix the issue in below case. Ect device is > not available when associated coresight device enabled and the > association is established after coresight device is enabled. > > Signed-off-by: Mike Leach > Signed-off-by: Tingwei Zhang > --- Reviewed-by: Mathieu Poirier > drivers/hwtracing/coresight/coresight.c | 11 ++++++++--- > include/linux/coresight.h | 1 + > 2 files changed, 9 insertions(+), 3 deletions(-) > > diff --git a/drivers/hwtracing/coresight/coresight.c b/drivers/hwtracing/coresight/coresight.c > index 6c09be15d60c..d354fd57474e 100644 > --- a/drivers/hwtracing/coresight/coresight.c > +++ b/drivers/hwtracing/coresight/coresight.c > @@ -244,13 +244,18 @@ coresight_control_assoc_ectdev(struct coresight_device *csdev, bool enable) > > if (!ect_csdev) > return 0; > + if ((!ect_ops(ect_csdev)->enable) || (!ect_ops(ect_csdev)->disable)) > + return 0; > > if (enable) { > - if (ect_ops(ect_csdev)->enable) > - ect_ret = ect_ops(ect_csdev)->enable(ect_csdev); > + ect_ret = ect_ops(ect_csdev)->enable(ect_csdev); > + if (!ect_ret) > + csdev->ect_enabled = true; > } else { > - if (ect_ops(ect_csdev)->disable) > + if (csdev->ect_enabled) { > ect_ret = ect_ops(ect_csdev)->disable(ect_csdev); > + csdev->ect_enabled = false; > + } > } > > /* output warning if ECT enable is preventing trace operation */ > diff --git a/include/linux/coresight.h b/include/linux/coresight.h > index 3bb738f9a326..7d3c87e5b97c 100644 > --- a/include/linux/coresight.h > +++ b/include/linux/coresight.h > @@ -208,6 +208,7 @@ struct coresight_device { > /* sysfs links between components */ > int nr_links; > bool has_conns_grp; > + bool ect_enabled; /* true only if associated ect device is enabled */ > }; > > /* > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel