Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp993901pxa; Wed, 19 Aug 2020 22:50:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/TGR5tIGRa3KP9CKYlg2PUjcsoFsgYAPVnbQ1+1FwhwuPlj7crRv/aJFTdgzqpJG7muxy X-Received: by 2002:aa7:d3d9:: with SMTP id o25mr1410410edr.362.1597902647636; Wed, 19 Aug 2020 22:50:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597902647; cv=none; d=google.com; s=arc-20160816; b=AAuqcRhhGA0GeOPj6QSES7j2DkAgWWy15iG9xhEY0VHNZA7E06s9hbo90bJ8RFHt/B LeT4V1K1MrymRn2DWTRc5gM0zWR45q/6GwBEH3VGNkLR4jn3eOb9RbqSiUIjn4US+r+H Lb7U6Vg/bdGNXVQW2WiJHXHocgS4TrD5/42Jp5HIu7k+Gpr2R8HytZJV44YN+hgZLMfU xIthbKzDHwuAW2OB1mtulfcI/fC0uANqDtZh6KqSFybnsag0gpZXge2Oh1vZ8BOLsjFE fpr5mlXKnWwrkp5Mm2g7h3VGJvphaZd3SbfRIwKTzDh6oMkABE5UaO4Zs1ZNOUV79uhY Ubcw== 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=L9cGIE4ti1krQNTVbDZwTmFieIo+1CVJdXdsFjCi2YxfIJcJVx88IPA8bZipC1knlt DPeuqZyFJjDHOviyzpTXr26lcZsDuAWinSf6b7g1rHTuFkUv4RKEayz2TH/YyqEAjdop uWMt0xtORD97wJO19tOt+mvBCI5LqT/MoKqfHxJ9ivf9VH9o/EEvJPP3Aru6iAUYgAxt vkVFNRjuMHbEZ/KzjF2QVXSnPqZMK510u34sVQmA0c3DvGvmOG0+T35vSF4SCNfvPOqU gibMb0/m6lQLCz6dnYA2Tb/2BGCvPXi0yy1wjqWIOpoNwPnrUH0bq7xWbN2vx1Xqzin6 tpbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=Il2ya6FY; 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 ot41si597144ejb.173.2020.08.19.22.50.24; Wed, 19 Aug 2020 22:50:47 -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=Il2ya6FY; 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 S1727107AbgHTFsy (ORCPT + 99 others); Thu, 20 Aug 2020 01:48:54 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:55879 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726825AbgHTFss (ORCPT ); Thu, 20 Aug 2020 01:48:48 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1597902528; h=Content-Transfer-Encoding: MIME-Version: References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=CNgtZ+04LUqpuHskCaUKwUE4yjEH6qYxU2GM8zcuRyI=; b=Il2ya6FYk98o9DxlYp8mp3uEkf6xvOovrQ+GGXvt5kmzhdJm08Q4IBvjNlI1QBJI2NLHU5lx fHATwaU5lxnJ2y0zKrYWa8Ieozkw9W8Wo23dFnz6dAB5cB0FSsytjWCmuorY658piaf8Nayf CxQrvZHSMPP52pAxJQ0Fl/mrokY= X-Mailgun-Sending-Ip: 69.72.43.7 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-n05.prod.us-west-2.postgun.com with SMTP id 5f3e0ebc7e76db358ef7dbf1 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 20 Aug 2020 05:48:44 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 40718C4345F; Thu, 20 Aug 2020 05:48:44 +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 CA146C43449; Thu, 20 Aug 2020 05:48:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org CA146C43449 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 v9 08/24] coresight: etm: perf: Fix warning caused by etm_setup_aux failure Date: Thu, 20 Aug 2020 13:47:02 +0800 Message-Id: <20200820054718.20115-9-tingwei@codeaurora.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20200820054718.20115-1-tingwei@codeaurora.org> References: <20200820054718.20115-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