Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp443463rdb; Thu, 2 Nov 2023 08:06:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGph6XkaYNVkF7cywZpDLyFyANPqyY1O/9VNwyPxIoaUvpGRXosDreRw+YI1PQWib0hMZH8 X-Received: by 2002:a05:6a00:230a:b0:6b6:e754:9e02 with SMTP id h10-20020a056a00230a00b006b6e7549e02mr18641220pfh.12.1698937604023; Thu, 02 Nov 2023 08:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698937604; cv=none; d=google.com; s=arc-20160816; b=0TmaClOSm+ggsBJGXg0myrZ4TJmLl54KlaJcbTfacIaKdFTssLUrw0Oko2N8/TwfQZ yA65jq7RkoUtF6U+4VG7DYKVF8Ei0pqjGOVQa8WVUfukwdP1A9HhR6QIsIINmX3GWF1v h0ahxXXMvSnMtrpmA/avIL/ZfoZajJahgrPrAul5FtG+BeOhz1DekP31LQ81rVjr5rDg vdh90U8mjwrY1Ml9HJqWIq10xBmoY+VRoVywWl8ZFoBW8I0BM8xh1tteyjbAEVS7ve5L H7t9tF0QR6RoZOB3gdN1BnXBs3/P0MhXVIbBIR511q7zR/uz1KWF78h+I+pCyP98oAYk NscQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=qT8oiDNAJf914vxaCfZ4xL6mzFfRo1NtAaeUh0c+H4Q=; fh=/QPHva3s1KgxrpGt9MawY1vy02jSai2N8yZUuH/vFBg=; b=ZxOFPpHUlnCVWJc4iyZ9t+JO/lJmGdjGv9r5URzC3q6WzFRR8Iz4uKdFHT389xkfmR cEVApCAxILe/41ClKO9Kb285hDH8RjbZFVSHXK6aX2dDvUWOPvXdQabE0/Et5K57RWaP 2plCCCbJ5hLw++cXpATvcPERxMp3BqRO6gqmstuRLNKhQHyseF3D6unPV5iCCcfRMQlC vRrjIqNtR2j6QKDrZZjQHKwKvpPnL+R7agjtVHxxHFEHqaYf2DxzxpMx3dibGkyETRet Ri6S9XFzUBrjfDtDnoHvKY3WUZKBarGw46V+NU5DpOH9e/TQWeAjn0izhsFBKuoBs34V nRLw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id h63-20020a638342000000b00578a44df6c1si1864730pge.640.2023.11.02.08.06.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 08:06:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 630948077A5B; Thu, 2 Nov 2023 08:05:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344378AbjKBPFA (ORCPT + 99 others); Thu, 2 Nov 2023 11:05:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232145AbjKBPE7 (ORCPT ); Thu, 2 Nov 2023 11:04:59 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 847F9138; Thu, 2 Nov 2023 08:04:55 -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 428792F4; Thu, 2 Nov 2023 08:05:37 -0700 (PDT) Received: from pluto (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4ABEF3F738; Thu, 2 Nov 2023 08:04:53 -0700 (PDT) Date: Thu, 2 Nov 2023 15:04:43 +0000 From: Cristian Marussi To: Oleksii Moisieiev Cc: "sudeep.holla@arm.com" , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Linus Walleij , "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-gpio@vger.kernel.org" Subject: Re: [RFC v5 2/5] drivers: firmware: scmi: Introduce scmi_get_max_msg_size function Message-ID: References: <9c9660c1-ab64-4186-917d-2007d88ce7c7@epam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9c9660c1-ab64-4186-917d-2007d88ce7c7@epam.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 02 Nov 2023 08:05:11 -0700 (PDT) On Thu, Nov 02, 2023 at 01:57:24PM +0000, Oleksii Moisieiev wrote: > Hi Cristian, > Hi, > Just found an interesting note in the PINCTRL_CONFIG_SET command > description: > > The maximum value of this field is limited by > the transport used. The agent needs to specify > this field such that the entire command can be > accommodated within the transport chosen. > Yes I am aware of that. > Furthermore, I observed the absence of a skip_configs parameter. > > From my understanding, this implies that the maximum number of > configurations should not exceed the msg_max_size allowed by the > protocol, enabling the transmission of only one message to the SCMI > server at a time. > Yes that is correct, my understanding is that the transmitter is in charge of building a message whose payload can fit into the maximum message size allowed by the underlying configured transport. > Given this constraint, it seems we might not require additional helper > functions. We could potentially just verify against msg_max_size. > Indeed for that reason the scmi_get_max_msg_size that you introduced is just enough since it allows you to peek into the transport and get the max_msg_size...the misunderstanding is around the fact that I was simply meaning that you should plug it into some new helper_ops so that yo can call it like: max_msg = ph->hops->get_max_msg_size(ph); (like iterators or get_extended_name) Because in this way you could use it also when the protocol is build as a loadable module, thing that now it is possible only for vendor defined protocols, but we could also easily switch all the base protocols to be selectable via Kconfig and =m in the future (if ever) Your helper is fine by itself it is just that it cannot be called by a protocol defined to loaded as a module because the symbol is not exported and, indeed, we introduced the ph->hops thing just for this reason, i.e. to have a set of common protocol utilities that can be called even from loadable modules protocols without the need to export every single symbol. The reference to iterators and extended_name was misleading probably...my bad...or I am still missing something :D Thanks, Cristian