Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1746596pxa; Thu, 20 Aug 2020 20:50:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWRi+YEbYbi/BeZ7EiuFQaUClJPyOSq4R/KgmlXozP/0eA0ebOpt59+EpkEwlvTPqv9gV0 X-Received: by 2002:a17:907:2067:: with SMTP id qp7mr1002173ejb.378.1597981813312; Thu, 20 Aug 2020 20:50:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597981813; cv=none; d=google.com; s=arc-20160816; b=y/7usWmehNIBqBDe0vtlT/Sj46mdhN1NgVVKo8o3hze3V7MHck0HaWG5smMDYVIpau uTTrXIC1Ifxi6U4tEzwt52dhbR7kn/y+zymIAemZqWTHl8nR71ggq0UDIQ91PIKTeeoj PfeBGRiCFg8noW+HiHFmq/lIcriGaCJKt97fKuOp+gpaWuU9aPAX8uxXYm+lyQWnZN+J yWE+zVEnWCvKXCpRF8lIn21ZgpnyCBIhuONq0OyaZkzfoMlOts/J1H3TiaeRRU1HowXp 2YsDRJcgDTK4bxORizZdzFUoeKsLJsqbhqdvHqhlRF+i3v3qg4UqYn3SFdPzDxGFHOvn TctA== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature; bh=CNgtZ+04LUqpuHskCaUKwUE4yjEH6qYxU2GM8zcuRyI=; b=f31jFuWyMGEtz06mCt/8ds4mY9l8O5sjoh05hJowCIm0WAxWUCtV1MncahPOgtWo1n HUjcxh2vzDOMl0V8Bw1Xn2bqdxjP7Qml/zO+yCRqX30ZwXRBnCj6xtidAgojRgc0D1fu X6VYdUwlGp5nI1lvGLRGAQXyV2qmZvZbpKHZSwuJw/JoiIozUpJTBrkhYgpVWB2WtvX1 Zs4NytJ464wE9B75y2St0jxG6s7E+kEzAZoozwNPVaLEk4CNdI4/HVBEimQ+XLNrQbQS 0uAqhe60CZh6GWhIifwY/wnBcakMpgxvsrVA0tsO848EfFYbbhzQacr6/HofqX7SYvbH h98Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=BkkOhm8N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m9si378202edb.557.2020.08.20.20.49.49; Thu, 20 Aug 2020 20:50:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=BkkOhm8N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727850AbgHUDqD (ORCPT + 99 others); Thu, 20 Aug 2020 23:46:03 -0400 Received: from mail29.static.mailgun.info ([104.130.122.29]:58948 "EHLO mail29.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726975AbgHUDqA (ORCPT ); Thu, 20 Aug 2020 23:46:00 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1597981560; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=CNgtZ+04LUqpuHskCaUKwUE4yjEH6qYxU2GM8zcuRyI=; b=BkkOhm8NdxPFv4Dbmkg0hciK3AcaRzMVkHtyI1nLgpAN3OaM94wFSkPT1p0aPzyfeI+zT9ZP v2+jAkQKr9Apkn8ewpCdqsruyizpNfXBTtiaEPYqLl3nI/Olko5+rJbFo5fK6UssalkqQ7cs Vfy/I5LZKD9n09OsadDqIBt2G+Y= X-Mailgun-Sending-Ip: 104.130.122.29 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n04.prod.us-east-1.postgun.com with SMTP id 5f3f436f7eb4541d931ddcef (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 21 Aug 2020 03:45:51 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 814AFC433B6; Fri, 21 Aug 2020 03:45:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from tingweiz-gv.qualcomm.com (unknown [180.166.53.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tingwei) by smtp.codeaurora.org (Postfix) with ESMTPSA id 143EBC433B6; Fri, 21 Aug 2020 03:45:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 143EBC433B6 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=tingwei@codeaurora.org From: Tingwei Zhang To: Mathieu Poirier , Suzuki K Poulose , Alexander Shishkin , Mike Leach Cc: Tingwei Zhang , Greg Kroah-Hartman , Leo Yan , Randy Dunlap , Russell King , Kim Phillips , Mian Yousaf Kaukab , tsoni@codeaurora.org, Sai Prakash Ranjan , Mao Jinlong , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v10 08/24] coresight: etm: perf: Fix warning caused by etm_setup_aux failure Date: Fri, 21 Aug 2020 11:44:29 +0800 Message-Id: <20200821034445.967-9-tingwei@codeaurora.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20200821034445.967-1-tingwei@codeaurora.org> References: <20200821034445.967-1-tingwei@codeaurora.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When coresight_build_path() fails on all the cpus, etm_setup_aux calls etm_free_aux() to free allocated event_data. WARN_ON(cpumask_empty(mask) will be triggered since cpu mask is empty. Check event_data->snk_config is not NULL first to avoid this warning. Signed-off-by: Tingwei Zhang Reviewed-by: Mike Leach Reviewed-by: Suzuki K Poulose Reviewed-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm-perf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c index dcb0592418ae..3728c44e5763 100644 --- a/drivers/hwtracing/coresight/coresight-etm-perf.c +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c @@ -126,10 +126,10 @@ static void free_sink_buffer(struct etm_event_data *event_data) cpumask_t *mask = &event_data->mask; struct coresight_device *sink; - if (WARN_ON(cpumask_empty(mask))) + if (!event_data->snk_config) return; - if (!event_data->snk_config) + if (WARN_ON(cpumask_empty(mask))) return; cpu = cpumask_first(mask); -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project