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=unavailable 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 34839C433E0 for ; Tue, 21 Jul 2020 23:37:17 +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 F25B020720 for ; Tue, 21 Jul 2020 23:37:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YzMantYl"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="kIg7d6Fc" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F25B020720 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.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-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:To:From: Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=M8fnwIRV+hQIE6+YFCMv7EvzAmuChxcmLgYaHdtMAC0=; b=YzMantYlknETCGYZvhgIQwZJ+ CZA4u1yTvtKl3AAqpU67T85rUD+vo9xpf+EHnlmQKHr03KI8QYgwUwIgMljVWSQvSd4DiJafZxX0w 9v7om7yKMyrnJHfx/yNmOj+cbVVVCJ7U637HPIc2w0VAnP/orSrXobIjrLBWBwmUG6P8HqhY22vOp NDDu1clYvHe4SvVPyCCLNG745nAuuGqoNS+v3UL76deB69YlmWgTAY0q1A1UIAJm1Bu0sidld5mk1 3DSYrHF4Q1ZN0Cb2ctxzUTdfptlbg3+MYdr64WAkqeKbkAMxW0yfSOxJJE8ftZtqaRFPj4VGPkxQ0 FA1Mdp5pw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jy1nc-0000gq-AW; Tue, 21 Jul 2020 23:35:52 +0000 Received: from m43-7.mailgun.net ([69.72.43.7]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jy1nU-0000g9-EQ for linux-arm-kernel@lists.infradead.org; Tue, 21 Jul 2020 23:35:49 +0000 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1595374548; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=Zp+D57mJHIqt36ZlSZRWpmf9YZGUo9PJIDqwkqn3dPc=; b=kIg7d6FcKNy4EyGaKmb1QOoz6aUbIo9Z/WJahsk8NQfPL2Q86Z1bRy6OowND1N4b2f0DrHlj pOeP8RS3B50o+GPKgidc/4Rsh8bNWQmLxSTa+44PKzWvZiS8rrbSsO/oTRvdeCR5xX0UxZU3 0fgTho1fB8IiW5e5LlYeKMxScsc= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyJiYzAxZiIsICJsaW51eC1hcm0ta2VybmVsQGxpc3RzLmluZnJhZGVhZC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n11.prod.us-west-2.postgun.com with SMTP id 5f177bbfe32d449b31a044b1 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 21 Jul 2020 23:35:27 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 7EB37C433A0; Tue, 21 Jul 2020 23:35:27 +0000 (UTC) Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: tingwei) by smtp.codeaurora.org (Postfix) with ESMTPSA id B54E9C433C6; Tue, 21 Jul 2020 23:35:26 +0000 (UTC) MIME-Version: 1.0 Date: Wed, 22 Jul 2020 07:35:26 +0800 From: tingwei@codeaurora.org To: Mathieu Poirier Subject: Re: [PATCH] coresight: stm: support marked packet In-Reply-To: <20200721171218.GA1217536@xps15> References: <20200719062712.29133-1-tingwei@codeaurora.org> <20200721171218.GA1217536@xps15> Message-ID: <3de87823f7328a197a5501d253aee0f6@codeaurora.org> X-Sender: tingwei@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200721_193548_884306_72FFC17C X-CRM114-Status: GOOD ( 20.14 ) 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 , Suzuki K Poulose , Alexander Shishkin , coresight@lists.linaro.org, Mao Jinlong , linux-arm-kernel , linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Mathieu, On 2020-07-22 01:12, Mathieu Poirier wrote: > Hi Tingwei, > > On Sun, Jul 19, 2020 at 02:27:12PM +0800, Tingwei Zhang wrote: >> STP_PACKET_MARKED is not supported by STM currently. >> Add STM_FLAG_MARKED to support marked packet in STM. >> >> Signed-off-by: Tingwei Zhang >> --- >> 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 b908ca104645..36fb1838b1d1 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,10 @@ 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 |= (flags & STP_PACKET_MARKED) ? STM_FLAG_MARKED : 0; > > Looking at the STM programmer's manual there is a marked area for data > packets > only. Clearing the marked bit for non-data access ends up in a > reserved > area > and yet here it is set invariably. Thanks. I'll fix that by set marked flag for data packet only. > > Out of curiosity, what kind of use case are you using this for? It's required for MIPI OST protocol. Thanks, Tingwei > > Thanks, > Mathieu > >> + stm_flags |= test_bit(channel, drvdata->chs.guaranteed) ? >> STM_FLAG_GUARANTEED : 0; >> >> if (size > drvdata->write_bytes) >> @@ -432,7 +435,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 +447,7 @@ 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); >> + 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) >> >> /* >> -- >> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora > Forum, >> a Linux Foundation Collaborative Project >> > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel