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=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 A4A17C433ED for ; Tue, 11 May 2021 00:28:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7AA366161C for ; Tue, 11 May 2021 00:28:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231518AbhEKA3v (ORCPT ); Mon, 10 May 2021 20:29:51 -0400 Received: from mx1.opensynergy.com ([217.66.60.4]:26881 "EHLO mx1.opensynergy.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231131AbhEKA3o (ORCPT ); Mon, 10 May 2021 20:29:44 -0400 Received: from SR-MAILGATE-02.opensynergy.com (localhost.localdomain [127.0.0.1]) by mx1.opensynergy.com (Proxmox) with ESMTP id 3D911A1A32; 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=/5Dxcbib2uhu l8GgPx/VJRtYLOF11009NaDVvtRbKkg=; b=ZeN6OTiYGFHRcbQZmlEyWwXZybUo J3X0++xambBLe+GJ+VSQ8qmpUE7x97am3+9Gh3bHPPHXpJPVWpB7Rl9EEuGnchcY MLPHkrdVnCNDoP55fS2pZw9BT0sDMglxLPjgZNu+tI0svX9bOxyG/p2bprfHjTV/ Xr5phJJhWRymwbiT23Fai5395Px8DRZRP0YrjxNIw70q0kag6zYZIPrmDHJc339s 4u1xpa73CjqfFF15zz4rr0SKh77wKXhZp2S3TuNUw5mHf7Qf86IiQULED0kpDHwW KNH6O05SlpEyCy7d+MEk24pIOPPSepzdF3cC1tTRJC+ZmtrjL20SJFylAg== From: Peter Hilber To: , CC: Peter Hilber , Rob Herring , , , , , , , , , Vasyl Vavrychuk , Andriy Tryshnivskyy , Cristian Marussi Subject: [RFC PATCH v3 07/12] firmware: arm_scmi: Add msg_handle to some transport ops Date: Tue, 11 May 2021 02:20:35 +0200 Message-ID: <20210511002040.802226-8-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 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SR-MAIL-01.open-synergy.com (10.26.10.21) To SR-MAIL-02.open-synergy.com (10.26.10.22) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The upcoming virtio transport may xfer several SCMI messages in parallel on a channel. But the transport ops which fetch messages lack information through which a transport can determine which of several messages the core intends to address. The virtio transport should not rely on the current implementation details of the core to deduce the message. Disambiguate this by having the transport pass an opaque message handle to scmi_rx_callback(), which the transport will then use in the message fetching transport ops to identify which message to address. Do not address how to handle the polling mechanism for now. The existing transports can just ignore the message handle. Signed-off-by: Peter Hilber --- drivers/firmware/arm_scmi/common.h | 8 ++++---- drivers/firmware/arm_scmi/driver.c | 20 +++++++++++--------- drivers/firmware/arm_scmi/mailbox.c | 7 ++++--- drivers/firmware/arm_scmi/smc.c | 5 +++-- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h index 9488c682a51d..5ab2ea0f7db2 100644 --- a/drivers/firmware/arm_scmi/common.h +++ b/drivers/firmware/arm_scmi/common.h @@ -310,9 +310,9 @@ struct scmi_transport_ops { struct scmi_xfer *xfer); void (*mark_txdone)(struct scmi_chan_info *cinfo, int ret); void (*fetch_response)(struct scmi_chan_info *cinfo, - struct scmi_xfer *xfer); - void (*fetch_notification)(struct scmi_chan_info *cinfo, - size_t max_len, struct scmi_xfer *xfer); + struct scmi_xfer *xfer, void *msg_handle); + void (*fetch_notification)(struct scmi_chan_info *cinfo, size_t max_len, + 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); }; @@ -350,7 +350,7 @@ extern const struct scmi_desc scmi_smc_desc; int scmi_set_transport_info(struct device *dev, void *transport_info); void *scmi_get_transport_info(struct device *dev); -void scmi_rx_callback(struct scmi_chan_info *cinfo, u32 msg_hdr); +void scmi_rx_callback(struct scmi_chan_info *cinfo, u32 msg_hdr, void *msg_handle); void scmi_free_channel(struct scmi_chan_info *cinfo, struct idr *idr, int id); /* shmem related declarations */ diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index 581b6c9b3781..cc27978b4bea 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -272,7 +272,8 @@ __scmi_xfer_put(struct scmi_xfers_info *minfo, struct scmi_xfer *xfer) spin_unlock_irqrestore(&minfo->xfer_lock, flags); } -static void scmi_handle_notification(struct scmi_chan_info *cinfo, u32 msg_hdr) +static void scmi_handle_notification(struct scmi_chan_info *cinfo, u32 msg_hdr, + void *msg_handle) { struct scmi_xfer *xfer; struct device *dev = cinfo->dev; @@ -292,7 +293,7 @@ static void scmi_handle_notification(struct scmi_chan_info *cinfo, u32 msg_hdr) unpack_scmi_header(msg_hdr, &xfer->hdr); scmi_dump_header_dbg(dev, &xfer->hdr); info->desc->ops->fetch_notification(cinfo, info->desc->max_msg_size, - xfer); + xfer, msg_handle); scmi_notify(cinfo->handle, xfer->hdr.protocol_id, xfer->hdr.id, xfer->rx.buf, xfer->rx.len, ts); @@ -305,8 +306,8 @@ static void scmi_handle_notification(struct scmi_chan_info *cinfo, u32 msg_hdr) info->desc->ops->clear_channel(cinfo); } -static void scmi_handle_response(struct scmi_chan_info *cinfo, - u16 xfer_id, u8 msg_type) +static void scmi_handle_response(struct scmi_chan_info *cinfo, u16 xfer_id, + u8 msg_type, void *msg_handle) { struct scmi_xfer *xfer; struct device *dev = cinfo->dev; @@ -339,7 +340,7 @@ static void scmi_handle_response(struct scmi_chan_info *cinfo, scmi_dump_header_dbg(dev, &xfer->hdr); - info->desc->ops->fetch_response(cinfo, xfer); + info->desc->ops->fetch_response(cinfo, xfer, msg_handle); trace_scmi_rx_done(xfer->transfer_id, xfer->hdr.id, xfer->hdr.protocol_id, xfer->hdr.seq, @@ -365,18 +366,19 @@ static void scmi_handle_response(struct scmi_chan_info *cinfo, * NOTE: This function will be invoked in IRQ context, hence should be * as optimal as possible. */ -void scmi_rx_callback(struct scmi_chan_info *cinfo, u32 msg_hdr) +void scmi_rx_callback(struct scmi_chan_info *cinfo, u32 msg_hdr, + void *msg_handle) { u16 xfer_id = MSG_XTRACT_TOKEN(msg_hdr); u8 msg_type = MSG_XTRACT_TYPE(msg_hdr); switch (msg_type) { case MSG_TYPE_NOTIFICATION: - scmi_handle_notification(cinfo, msg_hdr); + scmi_handle_notification(cinfo, msg_hdr, msg_handle); break; case MSG_TYPE_COMMAND: case MSG_TYPE_DELAYED_RESP: - scmi_handle_response(cinfo, xfer_id, msg_type); + scmi_handle_response(cinfo, xfer_id, msg_type, msg_handle); break; default: WARN_ONCE(1, "received unknown msg_type:%d\n", msg_type); @@ -490,7 +492,7 @@ static int do_xfer(const struct scmi_protocol_handle *ph, spin_until_cond(scmi_xfer_done_no_timeout(cinfo, xfer, stop)); if (ktime_before(ktime_get(), stop)) - info->desc->ops->fetch_response(cinfo, xfer); + info->desc->ops->fetch_response(cinfo, xfer, NULL); else ret = -ETIMEDOUT; } else { diff --git a/drivers/firmware/arm_scmi/mailbox.c b/drivers/firmware/arm_scmi/mailbox.c index 4626404be541..584d7dcde2eb 100644 --- a/drivers/firmware/arm_scmi/mailbox.c +++ b/drivers/firmware/arm_scmi/mailbox.c @@ -43,7 +43,7 @@ static void rx_callback(struct mbox_client *cl, void *m) { struct scmi_mailbox *smbox = client_to_scmi_mailbox(cl); - scmi_rx_callback(smbox->cinfo, shmem_read_header(smbox->shmem)); + scmi_rx_callback(smbox->cinfo, shmem_read_header(smbox->shmem), NULL); } static bool mailbox_chan_available(struct device *dev, int idx) @@ -151,7 +151,7 @@ static void mailbox_mark_txdone(struct scmi_chan_info *cinfo, int ret) } static void mailbox_fetch_response(struct scmi_chan_info *cinfo, - struct scmi_xfer *xfer) + struct scmi_xfer *xfer, void *msg_handle) { struct scmi_mailbox *smbox = cinfo->transport_info; @@ -159,7 +159,8 @@ static void mailbox_fetch_response(struct scmi_chan_info *cinfo, } static void mailbox_fetch_notification(struct scmi_chan_info *cinfo, - size_t max_len, struct scmi_xfer *xfer) + size_t max_len, struct scmi_xfer *xfer, + void *msg_handle) { struct scmi_mailbox *smbox = cinfo->transport_info; diff --git a/drivers/firmware/arm_scmi/smc.c b/drivers/firmware/arm_scmi/smc.c index fcbe2677f84b..507107d1a4ad 100644 --- a/drivers/firmware/arm_scmi/smc.c +++ b/drivers/firmware/arm_scmi/smc.c @@ -151,7 +151,8 @@ static int smc_send_message(struct scmi_chan_info *cinfo, if (scmi_info->irq) wait_for_completion(&scmi_info->tx_complete); - scmi_rx_callback(scmi_info->cinfo, shmem_read_header(scmi_info->shmem)); + scmi_rx_callback(scmi_info->cinfo, shmem_read_header(scmi_info->shmem), + NULL); mutex_unlock(&scmi_info->shmem_lock); @@ -162,7 +163,7 @@ static int smc_send_message(struct scmi_chan_info *cinfo, } static void smc_fetch_response(struct scmi_chan_info *cinfo, - struct scmi_xfer *xfer) + struct scmi_xfer *xfer, void *msg_handle) { struct scmi_smc *scmi_info = cinfo->transport_info; -- 2.25.1 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=-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 C244DC433B4 for ; Tue, 11 May 2021 09:54:57 +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 28EDD61363 for ; Tue, 11 May 2021 09:54:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 28EDD61363 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=L8sSuEr4Id6gOjLWgklxDi3qpmHV/9TB4owVZAkq/SY=; b=kny9y6D1fpdGi3zI6J47HPvkI gRFRnQA0DoZj/hCbl/5RdimdRdYR4ynV0H9Uk+NOKTnieP2NZ1xpw2thiWzDGanC4t+ZwjWwBJgnG kjGQXmR9wSyUaaZAQcqkupZd8QmlpVY6zJploOWSynnLpaJXSs/4pvUcB7XmHcyzCEB6Pt7EBVTo8 6HZJ4AHS4cO9GmIbx1myhsp4rB7dL5U0TiQoD3esocaG70mMEhW+J2dq5VgdVpqpPcLCjZ4taGVav Gh69G7jq9PLGt+BlRPd0nfEm5O4JejWDLonwiIPTSMdj/Xp6GWprfKiG7aqJ0JBGqIuAE2MCDwTw5 W/XebAv5A==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lgP5J-00GmAx-UH; Tue, 11 May 2021 09:53:50 +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 1lgGQA-00FzTy-Jo for linux-arm-kernel@desiato.infradead.org; Tue, 11 May 2021 00:38:49 +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=/5Dxcbib2uhul8GgPx/VJRtYLOF11009NaDVvtRbKkg=; b=p6YaEjiYLeLDElib6gatlBFd/M hEIgzXWY176z7NRFRb9HVIU4lPWmYUpyl1lH8ndL19FjX+ylirMXf9JNr1RVBGMKDb+d5k8Iwi+Mt AdGjYyPxd4Fm+RRavzJo1Y+ZJX/gkZhYl6XX08b/iSKFeV0YIyOj4x4P9SmkHKOH9h8orY3qWtw9U ZsjoNh8Dp2b9i0Vfw8i+baeX90pIgpJNOismdKVPvcrkzhuICjM2HqMwjOuu8UzUABTWJQ4UxJ53U RQkHyFB3/00MtKI9lB8qYa9oiU3SBf/oQMcGHpfE/om74XT0xDg76RIh6CqKx3f9qcCxk0Y/0a04r vcgbLDDQ==; Received: from mx1.opensynergy.com ([217.66.60.4]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lgGQ2-009Dn4-TU for linux-arm-kernel@lists.infradead.org; Tue, 11 May 2021 00:38:41 +0000 Received: from SR-MAILGATE-02.opensynergy.com (localhost.localdomain [127.0.0.1]) by mx1.opensynergy.com (Proxmox) with ESMTP id 3D911A1A32; 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=/5Dxcbib2uhu l8GgPx/VJRtYLOF11009NaDVvtRbKkg=; b=ZeN6OTiYGFHRcbQZmlEyWwXZybUo J3X0++xambBLe+GJ+VSQ8qmpUE7x97am3+9Gh3bHPPHXpJPVWpB7Rl9EEuGnchcY MLPHkrdVnCNDoP55fS2pZw9BT0sDMglxLPjgZNu+tI0svX9bOxyG/p2bprfHjTV/ Xr5phJJhWRymwbiT23Fai5395Px8DRZRP0YrjxNIw70q0kag6zYZIPrmDHJc339s 4u1xpa73CjqfFF15zz4rr0SKh77wKXhZp2S3TuNUw5mHf7Qf86IiQULED0kpDHwW KNH6O05SlpEyCy7d+MEk24pIOPPSepzdF3cC1tTRJC+ZmtrjL20SJFylAg== From: Peter Hilber To: , CC: Peter Hilber , Rob Herring , , , , , , , , , Vasyl Vavrychuk , Andriy Tryshnivskyy , Cristian Marussi Subject: [RFC PATCH v3 07/12] firmware: arm_scmi: Add msg_handle to some transport ops Date: Tue, 11 May 2021 02:20:35 +0200 Message-ID: <20210511002040.802226-8-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_173839_139794_263CD38E X-CRM114-Status: GOOD ( 14.56 ) /bin/ln: failed to access 'reaver_cache/texts/20210510_173839_139794_263CD38E': No such file or directory X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210510_173839_139794_263CD38E X-CRM114-Status: GOOD ( 12.06 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The upcoming virtio transport may xfer several SCMI messages in parallel on a channel. But the transport ops which fetch messages lack information through which a transport can determine which of several messages the core intends to address. The virtio transport should not rely on the current implementation details of the core to deduce the message. Disambiguate this by having the transport pass an opaque message handle to scmi_rx_callback(), which the transport will then use in the message fetching transport ops to identify which message to address. Do not address how to handle the polling mechanism for now. The existing transports can just ignore the message handle. Signed-off-by: Peter Hilber --- drivers/firmware/arm_scmi/common.h | 8 ++++---- drivers/firmware/arm_scmi/driver.c | 20 +++++++++++--------- drivers/firmware/arm_scmi/mailbox.c | 7 ++++--- drivers/firmware/arm_scmi/smc.c | 5 +++-- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h index 9488c682a51d..5ab2ea0f7db2 100644 --- a/drivers/firmware/arm_scmi/common.h +++ b/drivers/firmware/arm_scmi/common.h @@ -310,9 +310,9 @@ struct scmi_transport_ops { struct scmi_xfer *xfer); void (*mark_txdone)(struct scmi_chan_info *cinfo, int ret); void (*fetch_response)(struct scmi_chan_info *cinfo, - struct scmi_xfer *xfer); - void (*fetch_notification)(struct scmi_chan_info *cinfo, - size_t max_len, struct scmi_xfer *xfer); + struct scmi_xfer *xfer, void *msg_handle); + void (*fetch_notification)(struct scmi_chan_info *cinfo, size_t max_len, + 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); }; @@ -350,7 +350,7 @@ extern const struct scmi_desc scmi_smc_desc; int scmi_set_transport_info(struct device *dev, void *transport_info); void *scmi_get_transport_info(struct device *dev); -void scmi_rx_callback(struct scmi_chan_info *cinfo, u32 msg_hdr); +void scmi_rx_callback(struct scmi_chan_info *cinfo, u32 msg_hdr, void *msg_handle); void scmi_free_channel(struct scmi_chan_info *cinfo, struct idr *idr, int id); /* shmem related declarations */ diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index 581b6c9b3781..cc27978b4bea 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -272,7 +272,8 @@ __scmi_xfer_put(struct scmi_xfers_info *minfo, struct scmi_xfer *xfer) spin_unlock_irqrestore(&minfo->xfer_lock, flags); } -static void scmi_handle_notification(struct scmi_chan_info *cinfo, u32 msg_hdr) +static void scmi_handle_notification(struct scmi_chan_info *cinfo, u32 msg_hdr, + void *msg_handle) { struct scmi_xfer *xfer; struct device *dev = cinfo->dev; @@ -292,7 +293,7 @@ static void scmi_handle_notification(struct scmi_chan_info *cinfo, u32 msg_hdr) unpack_scmi_header(msg_hdr, &xfer->hdr); scmi_dump_header_dbg(dev, &xfer->hdr); info->desc->ops->fetch_notification(cinfo, info->desc->max_msg_size, - xfer); + xfer, msg_handle); scmi_notify(cinfo->handle, xfer->hdr.protocol_id, xfer->hdr.id, xfer->rx.buf, xfer->rx.len, ts); @@ -305,8 +306,8 @@ static void scmi_handle_notification(struct scmi_chan_info *cinfo, u32 msg_hdr) info->desc->ops->clear_channel(cinfo); } -static void scmi_handle_response(struct scmi_chan_info *cinfo, - u16 xfer_id, u8 msg_type) +static void scmi_handle_response(struct scmi_chan_info *cinfo, u16 xfer_id, + u8 msg_type, void *msg_handle) { struct scmi_xfer *xfer; struct device *dev = cinfo->dev; @@ -339,7 +340,7 @@ static void scmi_handle_response(struct scmi_chan_info *cinfo, scmi_dump_header_dbg(dev, &xfer->hdr); - info->desc->ops->fetch_response(cinfo, xfer); + info->desc->ops->fetch_response(cinfo, xfer, msg_handle); trace_scmi_rx_done(xfer->transfer_id, xfer->hdr.id, xfer->hdr.protocol_id, xfer->hdr.seq, @@ -365,18 +366,19 @@ static void scmi_handle_response(struct scmi_chan_info *cinfo, * NOTE: This function will be invoked in IRQ context, hence should be * as optimal as possible. */ -void scmi_rx_callback(struct scmi_chan_info *cinfo, u32 msg_hdr) +void scmi_rx_callback(struct scmi_chan_info *cinfo, u32 msg_hdr, + void *msg_handle) { u16 xfer_id = MSG_XTRACT_TOKEN(msg_hdr); u8 msg_type = MSG_XTRACT_TYPE(msg_hdr); switch (msg_type) { case MSG_TYPE_NOTIFICATION: - scmi_handle_notification(cinfo, msg_hdr); + scmi_handle_notification(cinfo, msg_hdr, msg_handle); break; case MSG_TYPE_COMMAND: case MSG_TYPE_DELAYED_RESP: - scmi_handle_response(cinfo, xfer_id, msg_type); + scmi_handle_response(cinfo, xfer_id, msg_type, msg_handle); break; default: WARN_ONCE(1, "received unknown msg_type:%d\n", msg_type); @@ -490,7 +492,7 @@ static int do_xfer(const struct scmi_protocol_handle *ph, spin_until_cond(scmi_xfer_done_no_timeout(cinfo, xfer, stop)); if (ktime_before(ktime_get(), stop)) - info->desc->ops->fetch_response(cinfo, xfer); + info->desc->ops->fetch_response(cinfo, xfer, NULL); else ret = -ETIMEDOUT; } else { diff --git a/drivers/firmware/arm_scmi/mailbox.c b/drivers/firmware/arm_scmi/mailbox.c index 4626404be541..584d7dcde2eb 100644 --- a/drivers/firmware/arm_scmi/mailbox.c +++ b/drivers/firmware/arm_scmi/mailbox.c @@ -43,7 +43,7 @@ static void rx_callback(struct mbox_client *cl, void *m) { struct scmi_mailbox *smbox = client_to_scmi_mailbox(cl); - scmi_rx_callback(smbox->cinfo, shmem_read_header(smbox->shmem)); + scmi_rx_callback(smbox->cinfo, shmem_read_header(smbox->shmem), NULL); } static bool mailbox_chan_available(struct device *dev, int idx) @@ -151,7 +151,7 @@ static void mailbox_mark_txdone(struct scmi_chan_info *cinfo, int ret) } static void mailbox_fetch_response(struct scmi_chan_info *cinfo, - struct scmi_xfer *xfer) + struct scmi_xfer *xfer, void *msg_handle) { struct scmi_mailbox *smbox = cinfo->transport_info; @@ -159,7 +159,8 @@ static void mailbox_fetch_response(struct scmi_chan_info *cinfo, } static void mailbox_fetch_notification(struct scmi_chan_info *cinfo, - size_t max_len, struct scmi_xfer *xfer) + size_t max_len, struct scmi_xfer *xfer, + void *msg_handle) { struct scmi_mailbox *smbox = cinfo->transport_info; diff --git a/drivers/firmware/arm_scmi/smc.c b/drivers/firmware/arm_scmi/smc.c index fcbe2677f84b..507107d1a4ad 100644 --- a/drivers/firmware/arm_scmi/smc.c +++ b/drivers/firmware/arm_scmi/smc.c @@ -151,7 +151,8 @@ static int smc_send_message(struct scmi_chan_info *cinfo, if (scmi_info->irq) wait_for_completion(&scmi_info->tx_complete); - scmi_rx_callback(scmi_info->cinfo, shmem_read_header(scmi_info->shmem)); + scmi_rx_callback(scmi_info->cinfo, shmem_read_header(scmi_info->shmem), + NULL); mutex_unlock(&scmi_info->shmem_lock); @@ -162,7 +163,7 @@ static int smc_send_message(struct scmi_chan_info *cinfo, } static void smc_fetch_response(struct scmi_chan_info *cinfo, - struct scmi_xfer *xfer) + struct scmi_xfer *xfer, void *msg_handle) { struct scmi_smc *scmi_info = cinfo->transport_info; -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel