From patchwork Tue May 11 00:20:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Hilber X-Patchwork-Id: 12250367 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=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 6FCBFC433B4 for ; Tue, 11 May 2021 09:59:52 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 B524161621 for ; Tue, 11 May 2021 09:59:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B524161621 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=opensynergy.com 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=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3h4PUO4xruvJIp7e7NNb5HaniVm0f8UM8R1dYzHaWp4=; b=ArMIIog6iyO8dQ0ANudzmeXY2 CPPY2PHWcqzX+7JowE8NCj4j6ukHfVI0mHcOvDi/2J9wckE3ikwnbnaif9Hq7Ako4/jvpcopByGj8 8U4Q0TjgvG9s9u7Z3bM/ci/4sLXnLddiTf1mxNHY2Qr5W9iHNoQ9XIjlBSq+LdrF78Hvsd8X1yg0K 50dNI0ZA4nmsU7KnqcFkErm7GtIDKpy+mzoK9qmat1sMvQ50DGZPrYr1WRX/vKeaUnlr6soYQ/U6+ s8qnLIgv99nebLguUzAl4i66UiBlTyRoSsV1D4aiWPuNnNEJ5tGi1BOMuuOzaAY5a7TaJ/0Z7Ceuw cYK8k6I9A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lgP9r-00GnUm-R8; Tue, 11 May 2021 09:58:31 +0000 Received: from [2607:7c80:54:e::133] (helo=bombadil.infradead.org) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lgGoD-00G0n7-Vc for linux-arm-kernel@desiato.infradead.org; Tue, 11 May 2021 01:03:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date :Subject:CC:To:From:Sender:Reply-To:Content-ID:Content-Description; bh=qDRth01lvccacQ4leScF8MqXeu+HXFiuV4vdo43NTWA=; b=iYbxqecEBbLAVUwrkvDKRXhSla NUgOwDLgfZ0g7zjEFV8FiPOakw8DA2tqEYDVZNO9+BU5Lj5mBWWIymlUCHz+YWwZaknk1TvbAwqFG 2LhDzNWqQQjrkGDcwauqHD9nuxh4BgJhXfxlZWj4G7Pzc/8vJjZE9x/jTTlBLxxYDd6WIa4EcGLqW XrZ0YvVuTfPxGM8/GSWysmyUE/+enz7DJOuJ0iENV+h8P7EThTsABKRwpjF+4iHx/4ryfQbRFX9PQ 52s+ELYqv5chVhu8ivdPvZNM8Ak6/WttTv+RQVYyvqnRcFVgTd61/PePZ7eh8+yM95hw7ipeeVfuI DDu+F7Xw==; Received: from mx1.opensynergy.com ([217.66.60.4]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lgGGQ-009DPs-Hx for linux-arm-kernel@lists.infradead.org; Tue, 11 May 2021 00:28:45 +0000 Received: from SR-MAILGATE-02.opensynergy.com (localhost.localdomain [127.0.0.1]) by mx1.opensynergy.com (Proxmox) with ESMTP id B9B33A1A33; Tue, 11 May 2021 02:22:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=opensynergy.com; h=cc:cc:content-transfer-encoding:content-type:content-type :date:from:from:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=srmailgate02; bh=qDRth01lvcca cQ4leScF8MqXeu+HXFiuV4vdo43NTWA=; b=l3D6+Lg0/yxa6+4wfSVlzgOUMBM9 Uje/YGgCyD2sbYNUoQDHiiONNgRYhTvEjPbww51bPTUtCaB2BWoua+kMDYe4OYXl 53v6nOvJME8MkmDRT6WVFTaB5iQ7EJOawBGWlt1TyMqCZO1kswGgHfTuQFB7gJLX 2SujQGhBfQ8ydb7sMw3TL5MqvwkjCHh/gNxJdMRa59FzXC3IhIxEscOzr0sktI6X zKsbGLqad8WkmcwGJc1Ic2TGHDs3sZpdoN6/3FmTMAjSu6PF2SeZ2yl/Q3d/z2qW FGwdu8263qq+Yjr/Kh/B1hm0jMIhP9XNEf6K6DEhiATlyogF+Gi3rJxvdw== From: Peter Hilber To: , CC: Peter Hilber , Rob Herring , , , , , , , , , Vasyl Vavrychuk , Andriy Tryshnivskyy , Cristian Marussi Subject: [RFC PATCH v3 08/12] firmware: arm_scmi: Add optional drop_message() transport op Date: Tue, 11 May 2021 02:20:36 +0200 Message-ID: <20210511002040.802226-9-peter.hilber@opensynergy.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210511002040.802226-1-peter.hilber@opensynergy.com> References: <20210511002040.802226-1-peter.hilber@opensynergy.com> MIME-Version: 1.0 X-ClientProxiedBy: SR-MAIL-01.open-synergy.com (10.26.10.21) To SR-MAIL-02.open-synergy.com (10.26.10.22) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210510_172842_791985_4D49BACB X-CRM114-Status: GOOD ( 10.78 ) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210510_172842_791985_4D49BACB X-CRM114-Status: UNSURE ( 8.59 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The virtio transport will need to know when the core has finished using a message. Add a transport op that indicates this to scmi_rx_callback(). Do not address the polling case for now. Signed-off-by: Peter Hilber --- drivers/firmware/arm_scmi/common.h | 2 ++ drivers/firmware/arm_scmi/driver.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h index 5ab2ea0f7db2..51ee08bdcb0c 100644 --- a/drivers/firmware/arm_scmi/common.h +++ b/drivers/firmware/arm_scmi/common.h @@ -298,6 +298,7 @@ struct scmi_chan_info { * @fetch_notification: Callback to fetch notification * @clear_channel: Callback to clear a channel * @poll_done: Callback to poll transfer status + * @drop_message: Optional callback when finished using msg_handle */ struct scmi_transport_ops { int (*link_supplier)(struct device *dev); @@ -315,6 +316,7 @@ struct scmi_transport_ops { struct scmi_xfer *xfer, void *msg_handle); void (*clear_channel)(struct scmi_chan_info *cinfo); bool (*poll_done)(struct scmi_chan_info *cinfo, struct scmi_xfer *xfer); + void (*drop_message)(struct scmi_chan_info *cinfo, void *msg_handle); }; int scmi_protocol_device_request(const struct scmi_device_id *id_table); diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index cc27978b4bea..e04e7c8e6928 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -371,6 +371,7 @@ void scmi_rx_callback(struct scmi_chan_info *cinfo, u32 msg_hdr, { u16 xfer_id = MSG_XTRACT_TOKEN(msg_hdr); u8 msg_type = MSG_XTRACT_TYPE(msg_hdr); + struct scmi_info *info = handle_to_scmi_info(cinfo->handle); switch (msg_type) { case MSG_TYPE_NOTIFICATION: @@ -384,6 +385,9 @@ void scmi_rx_callback(struct scmi_chan_info *cinfo, u32 msg_hdr, WARN_ONCE(1, "received unknown msg_type:%d\n", msg_type); break; } + + if (info->desc->ops->drop_message) + info->desc->ops->drop_message(cinfo, msg_handle); } /**