From patchwork Wed Sep 16 19:17:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11780607 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2A5D9159A for ; Wed, 16 Sep 2020 19:18: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 A6C712075E for ; Wed, 16 Sep 2020 19:18: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="rn7yMHqP"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="U626TRHm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A6C712075E 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+patchwork-linux-arm=patchwork.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:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=9ILzaeP5Rz9dvVwoCbOiNN2JrYkEAg+JKXjA8c5lAiI=; b=rn7yMHqPRvj/DIbxw0fCWqosE qrB4tOM4Z/lHQWKfUWFvkstS0MzMxYElEc7s2VgaHu958v61wDcHguhwJbZTKKebQ7kGVr/DeHwfW YRr++h/NYIy5Sii4xHHqlAt1b1idkW+nbPz43fd7XIe9LUVDoXbXtv/Y7iLfGkv03EccSr5LvHivA lCGhIG3jb2eykfSwVs4F33LxXup3r1hXDRG4lsYffOa1a6dDDbH/Kkw0wAUQw1mmBWAb7JA3zmhkZ CQmDnKXyC7yBgMcugccYp79NJ8MfcDdysUlFORKyoa9+Dqx2/0W1N1O5V+zNY9rhdSKDx686DixnT ahbC/25Nw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIcwF-0005AP-W1; Wed, 16 Sep 2020 19:17:56 +0000 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIcw5-000561-5r for linux-arm-kernel@lists.infradead.org; Wed, 16 Sep 2020 19:17:47 +0000 Received: by mail-pj1-x1044.google.com with SMTP id md22so1808379pjb.0 for ; Wed, 16 Sep 2020 12:17:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zx/tRahkEP1ZuMIl3SnwL71U4RtbDAoiNGLgupaBarI=; b=U626TRHmq+dValxTL/wxQGez4XilqyapSenwhZd08kDwFTFiUjAv297n7tj3r+Wj3l kONbPUFOnlqEE81iPzu1w1aIVA5pH+FHhI/CKOmpC4Z1xPeQLqV/nXHIppqli7bcQYma Eknf+HeeKvZqAn0AOV9cPMni+JWnHAN+HlwOr07XYJILofpviCyF/NCOiD/v+yTCpZr1 L3h1XYk62XIXSgFTedflfw2Rk9apbzIbyTBes1YaqK//ENPKh1jdIXgswZbYD+LQa6Pq UMtw0edbobNVD4BlfuG3JX3ShOnM9Ce9R5Hj+QdV9WNhY1I3isw64vJeb7iaN415hLHe WYyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zx/tRahkEP1ZuMIl3SnwL71U4RtbDAoiNGLgupaBarI=; b=P2t8nXd6ChXZ+Qpdd65xwmjKN2HwpQtvoIiYbprZkpV20BOjmP1cD5aOmWqS9b/iur WXks+qX+E5I4Zk6h7POv2EG21jhYY35gZi1ir7nPzCeDSq4y3ktadfLidXTRRu8LP3HA Sw/Wp53cRiITfc6eicZ9OA6wQ4T3UY3um9SterESmPsZqRe2fdH2KfR6vKLNFJNtM63F kciJ+SFV8EipcEpGVoCyVe1zFmzIiQtV3UvDexj28/zFFrelEPoe47h331bkfX8C5Zz7 fJI/qVsAqeLT7GdIilvuCq42Cv5/+eBNQTlWOl7kKA/3U0119stsCd62S0CWrfwHB2v3 qr7A== X-Gm-Message-State: AOAM532z2CH8QCNQOeO/nWrt4FhY3vVDPyQIIgABEANlka6/UmoTlyaO 3QWNLepyKrkjY8aXzrm9hgg08g== X-Google-Smtp-Source: ABdhPJwwyxa6q5cJWUmAVgT0vuDVnsHuBPjDmEaxttGpGRNdARKtaR8d32GydHCyu5cf97Qw6sEpFA== X-Received: by 2002:a17:902:8602:b029:d1:e5e7:be65 with SMTP id f2-20020a1709028602b02900d1e5e7be65mr7578928plo.63.1600283862043; Wed, 16 Sep 2020 12:17:42 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id b2sm11373688pfp.3.2020.09.16.12.17.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Sep 2020 12:17:41 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 02/16] coresight: stm: Support marked packet Date: Wed, 16 Sep 2020 13:17:23 -0600 Message-Id: <20200916191737.4001561-3-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200916191737.4001561-1-mathieu.poirier@linaro.org> References: <20200916191737.4001561-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200916_151745_306035_BAD1E090 X-CRM114-Status: GOOD ( 13.82 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1044 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Tingwei Zhang STP_PACKET_MARKED is not supported by STM currently. Add STM_FLAG_MARKED to support marked packet in STM. Signed-off-by: Tingwei Zhang Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-stm.c | 11 +++++++---- include/uapi/linux/coresight-stm.h | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-stm.c b/drivers/hwtracing/coresight/coresight-stm.c index 673d2f56ed1e..2ba819a47cf6 100644 --- a/drivers/hwtracing/coresight/coresight-stm.c +++ b/drivers/hwtracing/coresight/coresight-stm.c @@ -412,6 +412,7 @@ static ssize_t notrace stm_generic_packet(struct stm_data *stm_data, void __iomem *ch_addr; struct stm_drvdata *drvdata = container_of(stm_data, struct stm_drvdata, stm); + unsigned int stm_flags; if (!(drvdata && local_read(&drvdata->mode))) return -EACCES; @@ -421,8 +422,9 @@ static ssize_t notrace stm_generic_packet(struct stm_data *stm_data, ch_addr = stm_channel_addr(drvdata, channel); - flags = (flags == STP_PACKET_TIMESTAMPED) ? STM_FLAG_TIMESTAMPED : 0; - flags |= test_bit(channel, drvdata->chs.guaranteed) ? + stm_flags = (flags & STP_PACKET_TIMESTAMPED) ? + STM_FLAG_TIMESTAMPED : 0; + stm_flags |= test_bit(channel, drvdata->chs.guaranteed) ? STM_FLAG_GUARANTEED : 0; if (size > drvdata->write_bytes) @@ -432,7 +434,7 @@ static ssize_t notrace stm_generic_packet(struct stm_data *stm_data, switch (packet) { case STP_PACKET_FLAG: - ch_addr += stm_channel_off(STM_PKT_TYPE_FLAG, flags); + ch_addr += stm_channel_off(STM_PKT_TYPE_FLAG, stm_flags); /* * The generic STM core sets a size of '0' on flag packets. @@ -444,7 +446,8 @@ static ssize_t notrace stm_generic_packet(struct stm_data *stm_data, break; case STP_PACKET_DATA: - ch_addr += stm_channel_off(STM_PKT_TYPE_DATA, flags); + stm_flags |= (flags & STP_PACKET_MARKED) ? STM_FLAG_MARKED : 0; + ch_addr += stm_channel_off(STM_PKT_TYPE_DATA, stm_flags); stm_send(ch_addr, payload, size, drvdata->write_bytes); break; diff --git a/include/uapi/linux/coresight-stm.h b/include/uapi/linux/coresight-stm.h index 8847dbf24151..7ff3709c01b8 100644 --- a/include/uapi/linux/coresight-stm.h +++ b/include/uapi/linux/coresight-stm.h @@ -5,6 +5,7 @@ #include #define STM_FLAG_TIMESTAMPED _BITUL(3) +#define STM_FLAG_MARKED _BITUL(4) #define STM_FLAG_GUARANTEED _BITUL(7) /*