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=ham 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 7864DC433DF for ; Mon, 3 Aug 2020 17:16: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 3F94120A8B for ; Mon, 3 Aug 2020 17:16:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nsBoA3oo"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="LBMTQudm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F94120A8B 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:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MtYYDOUp5eNm0ofCz0fC0+CW234y4B5dHSIDYZ3L0VA=; b=nsBoA3oobvkuJw8z3fYTg7Ms9 oZ7X8Y1LCS2Xkmfc6SPy1aDCGDSjA5+Z9fwv/sr9HIwdnwgOR9BpP7eCUhnfnOo1iOa8fYWB+zQCg HxC01YfhaYRfW3y9o39wDCaAvbxtS8kmw1S4M5Mz/XqLm6TeyeVIw+tnRVuFN8IBEt60mxklhSayy sU+UTu5P66Ryiv4xlcUIXp07VVhvxyRClmeQVj9Yz/c5kJbkLQhERc20YLOR+aDcoFpdZlhZXS9ch AONvDfehN0reUChulLSplVnjJlhA1rpIkndIMVB5Zex9wH+5kVDU/SSCXoNKMFxCl0+tWseavNtBA H9Z5YOLdw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2e2d-0007Nq-Ur; Mon, 03 Aug 2020 17:14:28 +0000 Received: from mail-ej1-x643.google.com ([2a00:1450:4864:20::643]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2e1Z-0006Zr-Jv for linux-arm-kernel@lists.infradead.org; Mon, 03 Aug 2020 17:13:22 +0000 Received: by mail-ej1-x643.google.com with SMTP id f24so18937613ejx.6 for ; Mon, 03 Aug 2020 10:13:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HxY5s4uhOCTpJ860uswHHtBVNTP/IhicKxUVtr1XNiU=; b=LBMTQudmGBt9k1ysURDcQDILzfCvLQh4pR+tU80DB18wqJy7FbN84Zyt+0LYHlpmwF gvt5tqiBcDMZmm5avOu3uBksAqsI5MOgf5T5WKnW7gDES0hGMaI3nZq/fRDTppexl34f gykMkr3WPbjHk5WpOj4/hk/8jf+0o9uGjciLb2/Fv9JU0RQDtRquCuuOGjlfzhax2oeq J7kCHiYserUhVRWKlygHejHWCoug5IqVAl/2rw9H739OlAtD9A+6lzKRmcId7Y0UjPQo o2/8K6X2tRWwfbWdbxCguyln5IoWfQN87teYwMCC64HoQ9Mu2BWicQ5UK47gFnJe4xAs J6lQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HxY5s4uhOCTpJ860uswHHtBVNTP/IhicKxUVtr1XNiU=; b=FAFfsq5OL4IfitcYqe8x/yUkVSPFAqE08CQ/q/tyiw2sdLbmAR7UP6HL6If63KK6zX PriC8NayZ+IBzWGb3D7FFNTnu0E6qBhGypzxOxbQr58jDufFvKbA2cN1C/9KUL0m6k4R ck8gFaimg8pbNr0cBvdAx3u/4/hLu68LnQQ4bON1KE4o3utiPLcFiZGs0toSPFyI/YOd xhMOkNH1j12VEssZjxfaFK9COVY9ru876ctLWkXXCz4zDq0LKwANw8Aj2odF/bT290Pb PUYC8mNvnEVbkm0dbxsu5Bz/DyE+OoKD8AtkNT95Gdx9ZXeezs4nzMh0E1fUSmbrUkcU cdjg== X-Gm-Message-State: AOAM530UGpFOWln54BLlt+UlQnPC9L/EaQsCMrYob4QsikaxMnGVXJPj zPez3W6L0PSgnc/s5jWxu/l7V0wdOYZreodlPol83g== X-Google-Smtp-Source: ABdhPJyu7+rPYOouXZjLxz73Rh4lLfA4pABRjV6w78X5qnj4i2Czq41rYLC4a0hi8RU03BDimHOVheEDE67YovbPik4= X-Received: by 2002:a17:907:20f5:: with SMTP id rh21mr17258390ejb.194.1596474798132; Mon, 03 Aug 2020 10:13:18 -0700 (PDT) MIME-Version: 1.0 References: <20200731064012.8076-1-tingwei@codeaurora.org> <20200731064012.8076-21-tingwei@codeaurora.org> In-Reply-To: <20200731064012.8076-21-tingwei@codeaurora.org> From: Mike Leach Date: Mon, 3 Aug 2020 18:13:06 +0100 Message-ID: Subject: Re: [PATCH v6 20/25] coresight: cti: don't disable ect device if it's not enabled To: Tingwei Zhang X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200803_131321_976747_C5661BDF X-CRM114-Status: GOOD ( 26.17 ) 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 , Mathieu Poirier , Suzuki K Poulose , Alexander Shishkin , Greg Kroah-Hartman , Coresight ML , Randy Dunlap , Mian Yousaf Kaukab , Russell King , Mao Jinlong , Leo Yan , linux-arm-kernel 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 Tingwei, On Fri, 31 Jul 2020 at 07:42, 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 > --- > 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 8b55383cfcf1..83a46cf37968 100644 > --- a/drivers/hwtracing/coresight/coresight.c > +++ b/drivers/hwtracing/coresight/coresight.c > @@ -245,13 +245,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) Should this be:- if (!ect_ret) However, this problem is corrected in the next patch - so the set as tested overall works. This needs fixing or it might be better to combine this patch and the next patch into a single patch? Both are required because the CTI can be loaded as a module. Both adjust the same block of functionality. Mathieu may have a view on the best solution option here. Mike > + 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 > -- Mike Leach Principal Engineer, ARM Ltd. Manchester Design Centre. UK _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel