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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D26CAC433EF for ; Tue, 16 Nov 2021 18:29:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 9465F61B5F for ; Tue, 16 Nov 2021 18:29:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9465F61B5F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ky6WGtaPA4owoxwAdjKfCmAQdneuBqsuVYhlOzPksIs=; b=tszHJL9RJLgeXz 5J/sR59WmjtpgV4VjeQdY3wQm6TDIf7pKDlSNjn0cMd+1u/kO+04qrp9DBp6T3yFUjalzVm2kgxFj ZBPQmE6sio4e18YTTTYHEAaeoiJMfOv2XBM4Vu/PAVO5A7gN5fr0/sH7DUJpX7NL4Fh+4x69mWVLW u8vNvbX9LUCFIy61QwvrP21ehd6ILYQz9fviV3Ejk80XKGeke5t0z87HO2XirDO/7oyosBoJJD7Uv enISwkeXk+lM+qNLsxi41AEL3rcPwwexBNHaqX4PuewQ/FAhYNX1BI26Am5y9fxoHaS5EJJnE56C4 CRM+7l/NK50khwnAzFgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mn3Bl-002ZH4-Nw; Tue, 16 Nov 2021 18:28:13 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mn3Bd-002ZFt-SF for linux-arm-kernel@lists.infradead.org; Tue, 16 Nov 2021 18:28:07 +0000 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 E52DB6D; Tue, 16 Nov 2021 10:28:01 -0800 (PST) Received: from e120937-lin (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 364AD3F70D; Tue, 16 Nov 2021 10:28:01 -0800 (PST) Date: Tue, 16 Nov 2021 18:27:58 +0000 From: Cristian Marussi To: Vincent Guittot Cc: sudeep.holla@arm.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm/scmi: fix base agent discover response Message-ID: <20211116182758.GB56473@e120937-lin> References: <20211116173255.19936-1-vincent.guittot@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211116173255.19936-1-vincent.guittot@linaro.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211116_102806_008369_15056BEF 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 On Tue, Nov 16, 2021 at 06:32:55PM +0100, Vincent Guittot wrote: > According to scmi specification, the response of the discover agent request > is made of: > - int32 status > - uint32 agent_id > - uint8 name[16] > > but the current implementation doesn't take into account the agent_id field > and only allocates a rx buffer of SCMI_MAX_STR_SIZE length > Hi Vincent, > Allocate the correct length for rx buffer and copy the name from the > correct offset in the response. > > While no error were returned until v5.15, v5.16-rc1 fails with virtio_scmi > transport channel: > > [ 1.093253] arm-scmi firmware:scmi0: SCMI Notifications - Core Enabled. > [ 1.114776] arm-scmi firmware:scmi0: SCMI Protocol v2.0 'Linaro:PMWG' Firmware version 0x2090000 > [ 1.117544] scmi-virtio virtio0: tx:used len 28 is larger than in buflen 24 > Good catch...I was (still) not testing BASE_DISCOVER_AGENT in my virtio setup given it's optional.... Once implemented the command I could reproduce and test you fix. [ 1.239629] arm-scmi firmware:scmi: SCMI Notifications - Core Enabled. [ 1.266401] arm-scmi firmware:scmi: SCMI Protocol v2.0 'EMU-SCMI-VM:userland' Firmware version 0xdeadbeef [ 1.280360] arm-scmi firmware:scmi: Found 3 protocol(s) 3 agent(s) [ 1.286304] arm-scmi firmware:scmi: Agent 0: AGENT_00 [ 1.294115] arm-scmi firmware:scmi: Agent 1: AGENT_01 [ 1.301062] arm-scmi firmware:scmi: Agent 2: AGENT_02 LGTM. Maybe it's worth also a Fixes... The earlier where this was introduced seems: Fixes: b6f20ff8bd94 ("firmware: arm_scmi: add common infrastructure and support for base protocol") and then it was carried on (:D) after heavily refactoring in: Fixes: 8d3581c2526f ("firmware: arm_scmi: Port base protocol to new interface") FWIW, Reviewed-by: Cristian Marussi Tested-by: Cristian Marussi Thanks, Cristian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel