Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00213C61DA3 for ; Tue, 21 Feb 2023 18:39:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229948AbjBUSjC (ORCPT ); Tue, 21 Feb 2023 13:39:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229491AbjBUSjA (ORCPT ); Tue, 21 Feb 2023 13:39:00 -0500 Received: from mail-ua1-x933.google.com (mail-ua1-x933.google.com [IPv6:2607:f8b0:4864:20::933]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE5DAC168 for ; Tue, 21 Feb 2023 10:38:59 -0800 (PST) Received: by mail-ua1-x933.google.com with SMTP id x40so1208663uaf.2 for ; Tue, 21 Feb 2023 10:38:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1677004739; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=GTvDVfPxtXyqmctAMAXQWBEW0gmaPl4ijzzYuKFjZwA=; b=hDg20VImU6Q+gi5ZLq8NEysTMDtcN5ZZEuThmU5xqabdoEb+Pu8dEkS4vLD2rxOgS4 KNraTM+2Zv0ovSweC5+JRvkdbjwyF+AXsCASN6/24RWOU15RW6KOZpQeIRtJxE+peJEH HFsTdO8jvgLPNexaB/CnCzd6vrWxouz+h7LMo5HYyqTaODbxy8+CrEI4vbO/mSDGUc+9 Ltk+NNlHbhDcE2a5Gix8wTppfo+ZlVp17zy4vQBnSvj3uCCyxFfVWyOQ5xA8jOjxApi/ sapg1F7t+DATJfoExBqlpml9SIs0iSxfcnyU6zWI6QkLhimXENnknS1SLN6sPIvErYCH VQDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677004739; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GTvDVfPxtXyqmctAMAXQWBEW0gmaPl4ijzzYuKFjZwA=; b=5mXtdpPbWVUVmRnsasalP2TuLcCV+YlnD1CeD40NQ1nlQWRfZ4qXLjleBwgpPSSOdw tRH9wLrbTAFf/dcZi9zbxU/AtNcy12kOcAwyaT86RGYBhLcEGxRnYsQoH8UxyA/Urklf qS2HdlsIsGtMrUF0gIs+SK/4bt3qPsI3AdIWHZup3vthvUSXGZa+Ih1gpA92AG+FTbwG pSAST9CVB6DwsigTc1c/z4nkIIfoto7SJSLrEmnBBYAX7xhzr204DxKMRwVnzN3S3ew3 OdBxPMhtqx4+q9LIhj4tTydE0cXNamloncVvmUkPCpe2mp+riJlzuZRSnSmxPnPhp4wy e/DA== X-Gm-Message-State: AO0yUKWg0uh189KmWWwxGmwhFNxdw6gWVMyBMIkJaNr0/Xg//vIFVJrr FY1s0wQxIyyM3vlmmbj3F5fvnPPZmwFZO4QttVs6 X-Google-Smtp-Source: AK7set/Na0CE6HZujWX+qzUx9lwEP51SplrunjyTO0VDBAwjcplGgdKuuUP0gn2p8196NVmBFZ1fbwSA/LC3/QAZ0QE= X-Received: by 2002:a1f:7f11:0:b0:401:87ef:e516 with SMTP id o17-20020a1f7f11000000b0040187efe516mr748005vki.16.1677004738831; Tue, 21 Feb 2023 10:38:58 -0800 (PST) MIME-Version: 1.0 References: <77bd4509-bd8b-3bcc-e94a-7593505e27c0@arm.com> <20230210234311.1661312-1-yabinc@google.com> In-Reply-To: <20230210234311.1661312-1-yabinc@google.com> From: Yabin Cui Date: Tue, 21 Feb 2023 18:38:47 +0000 Message-ID: Subject: Re: [PATCH] coresight: tmc-etr: Handle enable failure in tmc_read_unprepare_etr To: Mathieu Poirier , Suzuki K Poulose , Mike Leach , Leo Yan , James Clark Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ping for review? On Fri, Feb 10, 2023 at 11:43 PM Yabin Cui wrote: > > It's similar to what we did in tmc_read_unprepare_etb. > > Signed-off-by: Yabin Cui > --- > drivers/hwtracing/coresight/coresight-tmc-etr.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/hwtracing/coresight/coresight-tmc-etr.c b/drivers/hwtracing/coresight/coresight-tmc-etr.c > index 918d461fcf4a..b04f12079efd 100644 > --- a/drivers/hwtracing/coresight/coresight-tmc-etr.c > +++ b/drivers/hwtracing/coresight/coresight-tmc-etr.c > @@ -1763,6 +1763,7 @@ int tmc_read_unprepare_etr(struct tmc_drvdata *drvdata) > { > unsigned long flags; > struct etr_buf *sysfs_buf = NULL; > + int rc = 0; > > /* config types are set a boot time and never change */ > if (WARN_ON_ONCE(drvdata->config_type != TMC_CONFIG_TYPE_ETR)) > @@ -1777,7 +1778,11 @@ int tmc_read_unprepare_etr(struct tmc_drvdata *drvdata) > * buffer. Since the tracer is still enabled drvdata::buf can't > * be NULL. > */ > - __tmc_etr_enable_hw(drvdata); > + rc = __tmc_etr_enable_hw(drvdata); > + if (rc) { > + spin_unlock_irqrestore(&drvdata->spinlock, flags); > + return rc; > + } > } else { > /* > * The ETR is not tracing and the buffer was just read. > -- > 2.39.1.581.gbfd45094c4-goog >