From patchwork Mon Mar 27 15:45:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Marussi X-Patchwork-Id: 75532 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1611962vqo; Mon, 27 Mar 2023 08:55:52 -0700 (PDT) X-Google-Smtp-Source: AKy350a0m04pdepxAuLO4/nC+D8SpoHGnP586jeLEoCdRktN+6zO6Q9fAkxxwSljhYyP5hzFmRUP X-Received: by 2002:a62:65c4:0:b0:5a8:b07b:82dc with SMTP id z187-20020a6265c4000000b005a8b07b82dcmr9767509pfb.0.1679932552613; Mon, 27 Mar 2023 08:55:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679932552; cv=none; d=google.com; s=arc-20160816; b=z0wx5b6QZzRjelB5ZAwmtwsl/tkoHjwJcbUlK/Q4keM+NRMG/uvZfxa4gmIhPZsVeQ R7NbCjPqftHEbgR/bPuvtHsTdH3LdEHlfve+rs9uMP2KY6PFMLCmVWjhBsjQmRhHwRUs FZO6rQeV9OEOvl39H9JDvhgcfMmT0vfAaMEHim64MVAlcY3eR4pSb82VqIGhAh2C0A5r J1vcNC+cwx7IpYACFpTqV2BGtmfEbS/072zZSezVBcSx9DpbZ3lq22e3d9hNmAnJz/gO Y+x9O705/aYRyCWmTkqh8KTirCVdiOzf26/nrZONpILkYmPHdxNTsH/2JFOf7G3lFIRE l5jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=f8BQruyWayF9QXVyGAp7h2urkOAR1nG3BhZGByZYPd4=; b=UWcRbFPE4ZH8AK23TR7Y+Ia8ti54XVGcUwYPdpAcXn8s3ODplKqptaU+kbqMpJMh8r +IdndkoVn14qO82gfUdngEifdsrHVAy6whcv6oeyTiq1g5jjhZHjfbbeLmUXh95lM6cf qZQ91m/u3m0WAg83TSKtA5qFmyjat4jhy1OMp96br5DHAYeuKckLPTrJpmzq3LdJK0Vy fh5wXILpqww6jwc/EPvRBpuilTqNBPmUAVyC5n2r5dW8HoMIB3ygt8WxjxjYAj8Z+H6N bstFnT12hDLAQuOUmrUItAAMNvl4xC2RdTAlPrm2D9K4Fzp0ifZLGZ4/clhRsZWVT++m p+UA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i137-20020a62878f000000b00624eb57b45dsi27522017pfe.74.2023.03.27.08.55.39; Mon, 27 Mar 2023 08:55:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232719AbjC0PqB (ORCPT + 99 others); Mon, 27 Mar 2023 11:46:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232398AbjC0Pp5 (ORCPT ); Mon, 27 Mar 2023 11:45:57 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 61B151BF5; Mon, 27 Mar 2023 08:45:56 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5903E1042; Mon, 27 Mar 2023 08:46:40 -0700 (PDT) Received: from e120937-lin.. (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B9D4A3F6C4; Mon, 27 Mar 2023 08:45:54 -0700 (PDT) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Cc: sudeep.holla@arm.com, vincent.guittot@linaro.org, souvik.chakravarty@arm.com, nicola.mazzucato@arm.com, cristian.marussi@arm.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Subject: [PATCH v2 1/2] dt-bindings: firmware: arm,scmi: Support mailboxes unidirectional channels Date: Mon, 27 Mar 2023 16:45:27 +0100 Message-Id: <20230327154528.460836-2-cristian.marussi@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230327154528.460836-1-cristian.marussi@arm.com> References: <20230327154528.460836-1-cristian.marussi@arm.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761536956076358591?= X-GMAIL-MSGID: =?utf-8?q?1761536956076358591?= SCMI defines two kinds of communication channels between the agent and the platform: one bidirectional 'a2p' channel used by the agent to send SCMI commands and synchronously receive the related replies, and an optional 'p2a' unidirectional channel used to asynchronously receive delayed responses and notifications emitted from the platform. When configuring an SCMI transport based on mailboxes, the current binding supports only mailboxes providing bidirectional channels: in such a case one mailbox channel can be easily assigned to each SCMI channel as above described. In case, instead, to have to deal with mailboxes providing only distinct unidirectional channels, it becomes necessary to extend the binding in order to be able to bind 2 distinct unidirectional mailbox channels to the same SCMI 'a2p' channel. Bidirectional and unidirectional channels support for the SCMI mailbox transport can coexist by carefully considering the effective combination of defined 'mboxes' and 'shmem' descriptors. Signed-off-by: Cristian Marussi --- v1 --> v2 - added mbox-names unidirectional definitions and example --- .../bindings/firmware/arm,scmi.yaml | 76 ++++++++++++++++--- 1 file changed, 66 insertions(+), 10 deletions(-) diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml index 2f7c51c75e85..0204b102b47f 100644 --- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml +++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml @@ -56,17 +56,41 @@ properties: description: Specifies the mailboxes used to communicate with SCMI compliant firmware. - items: - - const: tx - - const: rx + oneOf: + - items: + - const: tx + - items: + - const: tx + - const: rx + - items: + - const: tx + - const: tx_reply + - items: + - const: tx + - const: tx_reply + - const: rx mboxes: description: List of phandle and mailbox channel specifiers. It should contain - exactly one or two mailboxes, one for transmitting messages("tx") - and another optional for receiving the notifications("rx") if supported. + exactly one, two or three mailboxes; the first one or two for transmitting + messages ("tx") and another optional ("rx") for receiving notifications + and delayed responses, if supported by the platform. + The number of mailboxes needed for transmitting messages depends on the + type of channels exposed by the specific underlying mailbox controller; + one single channel descriptor is enough if such channel is bidirectional, + while two channel descriptors are needed to represent the SCMI ("tx") + channel if the underlying mailbox channels are of unidirectional type. + The effective combination in numbers of mboxes and shmem descriptors let + the SCMI subsystem determine unambiguosly which type of SCMI channels are + made available by the underlying mailbox controller and how to use them. + 1 mbox / 1 shmem => SCMI TX over 1 mailbox bidirectional channel + 2 mbox / 2 shmem => SCMI TX and RX over 2 mailbox bidirectional channels + 2 mbox / 1 shmem => SCMI TX over 2 mailbox unidirectional channels + 3 mbox / 2 shmem => SCMI TX and RX over 3 mailbox unidirectional channels + Any other combination of mboxes and shmem is invalid. minItems: 1 - maxItems: 2 + maxItems: 3 shmem: description: @@ -228,13 +252,23 @@ $defs: maxItems: 1 mbox-names: - items: - - const: tx - - const: rx + oneOf: + - items: + - const: tx + - items: + - const: tx + - const: rx + - items: + - const: tx + - const: tx_reply + - items: + - const: tx + - const: tx_reply + - const: rx mboxes: minItems: 1 - maxItems: 2 + maxItems: 3 shmem: minItems: 1 @@ -393,6 +427,28 @@ examples: }; }; + - | + firmware { + scmi { + compatible = "arm,scmi"; + mboxes = <&mhu_U_tx 0 0>, <&mhu_U_rx 0 0>; + mbox-names = "tx", "tx_reply"; + shmem = <&cpu_scp_lpri0>; + + #address-cells = <1>; + #size-cells = <0>; + + scmi_dvfs_2: protocol@13 { + reg = <0x13>; + #clock-cells = <1>; + + mboxes = <&mhu_U_tx 1 0>, <&mhu_U_rx 1 0>, <&mhu_U_rx 1 1>; + mbox-names = "tx", "tx_reply", "rx"; + shmem = <&cpu_scp_hpri0>, <&cpu_scp_hpri1>; + }; + }; + }; + - | firmware { scmi { From patchwork Mon Mar 27 15:45:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Marussi X-Patchwork-Id: 75534 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1614971vqo; Mon, 27 Mar 2023 09:00:54 -0700 (PDT) X-Google-Smtp-Source: AKy350Y5iiG7hJgpgFfIPEEKvF10MKyauxA4reJXVESDccrqO1Y3sl8z0RZ+DoEOO0VyYRXFbx6d X-Received: by 2002:a62:3897:0:b0:594:26a7:cbd2 with SMTP id f145-20020a623897000000b0059426a7cbd2mr9930467pfa.8.1679932854118; Mon, 27 Mar 2023 09:00:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679932854; cv=none; d=google.com; s=arc-20160816; b=lgrxVDyco+5i4WTUvo/7fNgjlbUpRV94zOptEtgDe8lXUIevz2lh1L+BNWw2QFvMru cLx/2B0/xAUGIKHLyeE6kluEWdPgyDeMzTiz+6181bhK4NnmPDc899e0Zjg1MhIBQ6j8 XrBfTCraawAVZnn72xUv1aXp6lbRL4YnMbfX7bFUTJ1OVimfFco/qETNQq1C1IR2Fndw 6Ed73SVGNgiyzzTaPr+1NGotQ7QQxJ8hn1TBNDfWrFso3ubu9VF+0kfpllV2ZW6I4ymW otnkcb32PH0uo5A4tZCeo7n0KhFhTDS9Uiqxx2+qbRsTxouJZPPpL+ako1THF/mAm77f 29Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Bx5fuFcF1+62rPxoyyj5s0NwhJi4DWRa36rEsh6gEqc=; b=ejPo6Ro3dqWnyhE/7Bm3xnOUmfU8F+EU/7wbMUk3JfyS2b9TUSzmfrjGNh7nyIiONw QMZm79+7K1zPqiMiO2JGlm/x6X1Td0Wf9Y+TrEqBdFZFtJHpNRIHR8AwhT1TqCUKTlN7 PuvAUY/bRBNo/EZv/IoKHoyQP7I+GEdMv1b+LlA29OHx9ZF8NqV9GAINUN9UvGDWGNl4 SMaPk761b4hGnIkuH3vbZo+GIp4WObqq03r7Vhrwhklrm8+37KPmrSvbblywvoXoNX72 nNBebw/yipvwvecRu9mbLzYubNiJOuntjDnmfqVRm8i7stbDr8xQjDXUI+L/l3QE71iR kbsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c16-20020a056a00249000b006281f2d375dsi14736996pfv.132.2023.03.27.09.00.35; Mon, 27 Mar 2023 09:00:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232815AbjC0PqD (ORCPT + 99 others); Mon, 27 Mar 2023 11:46:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232613AbjC0Pp7 (ORCPT ); Mon, 27 Mar 2023 11:45:59 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 04DD410C9; Mon, 27 Mar 2023 08:45:58 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 01367143D; Mon, 27 Mar 2023 08:46:42 -0700 (PDT) Received: from e120937-lin.. (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 631AB3F6C4; Mon, 27 Mar 2023 08:45:56 -0700 (PDT) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Cc: sudeep.holla@arm.com, vincent.guittot@linaro.org, souvik.chakravarty@arm.com, nicola.mazzucato@arm.com, cristian.marussi@arm.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org Subject: [PATCH v2 2/2] firmware: arm_scmi: Add support for unidirectional mailbox channels Date: Mon, 27 Mar 2023 16:45:28 +0100 Message-Id: <20230327154528.460836-3-cristian.marussi@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230327154528.460836-1-cristian.marussi@arm.com> References: <20230327154528.460836-1-cristian.marussi@arm.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761537272403889391?= X-GMAIL-MSGID: =?utf-8?q?1761537272403889391?= Extend the SCMI transport layer to support mailbox controllers that expose communication channels that are unidirectional by nature. Signed-off-by: Cristian Marussi --- drivers/firmware/arm_scmi/mailbox.c | 95 +++++++++++++++++++++++++---- 1 file changed, 84 insertions(+), 11 deletions(-) diff --git a/drivers/firmware/arm_scmi/mailbox.c b/drivers/firmware/arm_scmi/mailbox.c index 112c285deb97..1efa5e9392c4 100644 --- a/drivers/firmware/arm_scmi/mailbox.c +++ b/drivers/firmware/arm_scmi/mailbox.c @@ -19,13 +19,15 @@ * struct scmi_mailbox - Structure representing a SCMI mailbox transport * * @cl: Mailbox Client - * @chan: Transmit/Receive mailbox channel + * @chan: Transmit/Receive mailbox uni/bi-directional channel + * @chan_receiver: Optional Receiver mailbox unidirectional channel * @cinfo: SCMI channel info * @shmem: Transmit/Receive shared memory area */ struct scmi_mailbox { struct mbox_client cl; struct mbox_chan *chan; + struct mbox_chan *chan_receiver; struct scmi_chan_info *cinfo; struct scmi_shared_mem __iomem *shmem; }; @@ -48,30 +50,62 @@ static void rx_callback(struct mbox_client *cl, void *m) static bool mailbox_chan_available(struct device_node *of_node, int idx) { + int num_mb; + + /* + * Just check if bidirrectional channels are involved, and check the + * index accordingly; proper full validation will be made later + * in mailbox_chan_setup(). + */ + num_mb = of_count_phandle_with_args(of_node, "mboxes", "#mbox-cells"); + if (num_mb == 3 && idx == 1) + idx = 2; + return !of_parse_phandle_with_args(of_node, "mboxes", "#mbox-cells", idx, NULL); } -static int mailbox_chan_validate(struct device *cdev) +/** + * mailbox_chan_validate - Validate transport configuration and map channels + * + * @cdev: Reference to the underlying transport device carrying the + * of_node descriptor to analyze. + * @a2p_rx_chan: A reference to an optional unidirectional channel to use + * for replies on the a2p channel. Set as zero if not present. + * @p2a_chan: A reference to the optional p2a channel. + * Set as zero if not present. + * + * At first, validate the transport configuration as described in terms of + * 'mboxes' and 'shmem', then determin which mailbox channel indexes are + * appropriate to be use in the current configuration. + * + * Return: 0 on Success or error + */ +static int mailbox_chan_validate(struct device *cdev, + int *a2p_rx_chan, int *p2a_chan) { int num_mb, num_sh, ret = 0; struct device_node *np = cdev->of_node; num_mb = of_count_phandle_with_args(np, "mboxes", "#mbox-cells"); num_sh = of_count_phandle_with_args(np, "shmem", NULL); + dev_dbg(cdev, "Found %d mboxes and %d shmems !\n", num_mb, num_sh); + /* Bail out if mboxes and shmem descriptors are inconsistent */ - if (num_mb <= 0 || num_sh > 2 || num_mb != num_sh) { - dev_warn(cdev, "Invalid channel descriptor for '%s'\n", - of_node_full_name(np)); + if (num_mb <= 0 || num_sh <= 0 || num_sh > 2 || num_mb > 3 || + (num_mb == 1 && num_sh != 1) || (num_mb == 3 && num_sh != 2)) { + dev_warn(cdev, + "Invalid channel descriptor for '%s' - mbs:%d shm:%d\n", + of_node_full_name(np), num_mb, num_sh); return -EINVAL; } + /* Bail out if provided shmem descriptors do not refer distinct areas */ if (num_sh > 1) { struct device_node *np_tx, *np_rx; np_tx = of_parse_phandle(np, "shmem", 0); np_rx = of_parse_phandle(np, "shmem", 1); - /* SCMI Tx and Rx shared mem areas have to be distinct */ if (!np_tx || !np_rx || np_tx == np_rx) { dev_warn(cdev, "Invalid shmem descriptor for '%s'\n", of_node_full_name(np)); @@ -82,6 +116,29 @@ static int mailbox_chan_validate(struct device *cdev) of_node_put(np_rx); } + /* Calculate channels IDs to use depending on mboxes/shmem layout */ + if (!ret) { + switch (num_mb) { + case 1: + *a2p_rx_chan = 0; + *p2a_chan = 0; + break; + case 2: + if (num_sh == 2) { + *a2p_rx_chan = 0; + *p2a_chan = 1; + } else { + *a2p_rx_chan = 1; + *p2a_chan = 0; + } + break; + case 3: + *a2p_rx_chan = 1; + *p2a_chan = 2; + break; + } + } + return ret; } @@ -92,15 +149,18 @@ static int mailbox_chan_setup(struct scmi_chan_info *cinfo, struct device *dev, struct device *cdev = cinfo->dev; struct scmi_mailbox *smbox; struct device_node *shmem; - int ret, idx = tx ? 0 : 1; + int ret, a2p_rx_chan, p2a_chan, idx = tx ? 0 : 1; struct mbox_client *cl; resource_size_t size; struct resource res; - ret = mailbox_chan_validate(cdev); + ret = mailbox_chan_validate(cdev, &a2p_rx_chan, &p2a_chan); if (ret) return ret; + if (!tx && !p2a_chan) + return -ENODEV; + smbox = devm_kzalloc(dev, sizeof(*smbox), GFP_KERNEL); if (!smbox) return -ENOMEM; @@ -130,15 +190,26 @@ static int mailbox_chan_setup(struct scmi_chan_info *cinfo, struct device *dev, cl->tx_block = false; cl->knows_txdone = tx; - smbox->chan = mbox_request_channel(cl, tx ? 0 : 1); + smbox->chan = mbox_request_channel(cl, tx ? 0 : p2a_chan); if (IS_ERR(smbox->chan)) { ret = PTR_ERR(smbox->chan); if (ret != -EPROBE_DEFER) - dev_err(cdev, "failed to request SCMI %s mailbox\n", - tx ? "Tx" : "Rx"); + dev_err(cdev, + "failed to request SCMI %s mailbox\n", desc); return ret; } + /* Additional unidirectional channel for TX if needed */ + if (tx && a2p_rx_chan) { + smbox->chan_receiver = mbox_request_channel(cl, a2p_rx_chan); + if (IS_ERR(smbox->chan_receiver)) { + ret = PTR_ERR(smbox->chan_receiver); + if (ret != -EPROBE_DEFER) + dev_err(cdev, "failed to request SCMI Tx Receiver mailbox\n"); + return ret; + } + } + cinfo->transport_info = smbox; smbox->cinfo = cinfo; @@ -152,8 +223,10 @@ static int mailbox_chan_free(int id, void *p, void *data) if (smbox && !IS_ERR(smbox->chan)) { mbox_free_channel(smbox->chan); + mbox_free_channel(smbox->chan_receiver); cinfo->transport_info = NULL; smbox->chan = NULL; + smbox->chan_receiver = NULL; smbox->cinfo = NULL; }