Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp941391iob; Fri, 13 May 2022 17:12:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3NR0FsoP+vGDHFuolLNdPOp0KQnnyuBIXEN0FLJHXMFOfrAqWr+iGCJ9ptyuaIpCW/okL X-Received: by 2002:a05:600c:1992:b0:394:826a:d40d with SMTP id t18-20020a05600c199200b00394826ad40dmr6781224wmq.146.1652487150813; Fri, 13 May 2022 17:12:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652487150; cv=none; d=google.com; s=arc-20160816; b=OK4pJdSotuCOoPquOMDuR63QeqflUDZNcWN2lH0/qPutVh6NpuhsxQwmAsqVyoPMLG ARO3UyhZXMwy+7zxeo7mtbfdSdL5ymw/wzRL9c1GjCKP9/HybeTFk8snc1rCLW39eiAy T0KYDe1TwGFTB/0y7y8DOUE1+URERbadEOF96HvF6JjKWc/QBMnzTYRa+L3D1lYLG+E5 bRdsmNuW36GG7lXa6vs5ZeQXti8IBTntBxWErLz8af0hlrGOrDGsJcvLkThD6xwV51ZP yFRavIyPPgb1tO9KKYtjriJlLQlEFcvqXS8aPBIuYvAAG8/mDCU7oq9mDxygfUJfCxK1 o/0g== 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 :dkim-signature; bh=mU7DjZ6YdE5ZE6KKWVtlZVe9sgVvfea3+yMKl+vOnVo=; b=nxXs6O4EAip+jn0vpmnG9eX0KADKlq5Om1LewM4aOCwAG5eerq5xbzEIdvjxJ8aW4x Iofh8WgJorLDlxa9VuBCEjiSK1NQbHdobipnbwfmY/TxO3M6iZHDLpQrlAMfTY+183qP bpcJwB7fpHYARTY44IW/nF47O5qY3T7mmC4sZR7pDybiBQDLKURzUSFwyDrm/Iv9ngUU kJOwjBOvU4Mbfgwtp4ODwn0PPCMS4lVpRD0vUPSaX6U3y9r0KuqRPl8agt2MN2KvvN/X 9AdKlLYEIxYbgQ//Bvo8dhJKNogW+HgQkOfD6lXF70t4cX2CIQ/BAI/cDlN6L21q5fzp hmYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Jz3TNB8I; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 10-20020a056000154a00b0020adb6f7116si4657005wry.330.2022.05.13.17.12.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 17:12:30 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Jz3TNB8I; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1553F31C34F; Fri, 13 May 2022 16:13:44 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241510AbiELLLa (ORCPT + 99 others); Thu, 12 May 2022 07:11:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344515AbiELLL1 (ORCPT ); Thu, 12 May 2022 07:11:27 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93A475372B for ; Thu, 12 May 2022 04:11:25 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id dk23so9482126ejb.8 for ; Thu, 12 May 2022 04:11:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mU7DjZ6YdE5ZE6KKWVtlZVe9sgVvfea3+yMKl+vOnVo=; b=Jz3TNB8Ix/xBZkbtD4X/DUmSq4yrvweuymYmhr87xqoKK5IUcCStHAl/E63TFW9yig lcBfVAgG4F3Y70mg4qNIlVfbSyle/W6kkfNPBn3V53mF6wXoUvnWuh2G1uaOVPh2pNVZ 29PL1PqFKJ5Q17EoiAxRowAF6RaaQR7bHgXdonm7011jncH3ynSsle0eIJlA38q6o/gw S1P4+n0yOKA0iDNxa2RRjZZt9ImKvr+7LHeXFbgqRiKSRfKwe7SKImD52XXg0ib0zhG6 D3sR9XXM3oS9fT4pT7hGWd8NX+8ZgSsFY/YN26HVof+qfy6t65+FRNetsjng4OXJYS5y tVjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mU7DjZ6YdE5ZE6KKWVtlZVe9sgVvfea3+yMKl+vOnVo=; b=XhQEKVPCAHrXLh8v+vjXdaeh71pQmCVSJX3MwiP/C31e2Tgnv27T0Ggv7JbNEXsWlp +BkY/8HkMEKsA9SZu4M7C0WiWOpYML9EpO6C7V6+FDP2ViQCnO47Xn2+YxmDmqHp62lm Wt2YArTAwSy2Iz7/2QY+fh+jkVpFU8PzcYvSBfn65lwwZyAh2L9okgDSwH1MYCLz2Dp9 CBPTf1AYet6bydYNeQgRsh1rJMHw6SiPuctNanG7RTWfHfQbGzzhN9n035b15J9pdGEa cuMC9srTYoeGYkvoq5Lxugc8ZakJHZSBY+ixiuA2gurmcZdGx+Sap7/fFkA4L/QlM/gc wy9g== X-Gm-Message-State: AOAM531pJ1KvxwaUiG/Y9pFRd56eKQXkja6VoMo1xYzD0xo+OuOzn6fq qftG+/Ko235g5r93kr/hJyY= X-Received: by 2002:a17:907:c28:b0:6f4:2a80:f355 with SMTP id ga40-20020a1709070c2800b006f42a80f355mr28999239ejc.101.1652353884087; Thu, 12 May 2022 04:11:24 -0700 (PDT) Received: from archbook.localnet (ict-networks-195-176-112-051.fwd-v4.ethz.ch. [195.176.112.51]) by smtp.gmail.com with ESMTPSA id y17-20020a50f1d1000000b0042617ba6380sm2436781edl.10.2022.05.12.04.11.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 04:11:23 -0700 (PDT) From: Nicolas Frattaroli To: Cristian Marussi , Etienne Carriere Cc: Sudeep Holla , linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, Heiko Stuebner , Liang Chen , linux-kernel@vger.kernel.org, Kever Yang , Jeffy Chen , Peter Geis Subject: Re: [BUG] New arm scmi check in linux-next causing rk3568 not to boot due to firmware bug Date: Thu, 12 May 2022 13:11:22 +0200 Message-ID: <6587375.6lpfYT6tjA@archbook> In-Reply-To: References: <1698297.NAKyZzlH2u@archbook> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Hello, sorry for the late reply, completely missed that there was a question for me in this mail. On Donnerstag, 5. Mai 2022 11:40:09 CEST Etienne Carriere wrote: > Hello Nicolas, Cristian, > [...] > > Indeed the firmware implementation is wrong in TF-A. > And also in OP-TEE by the way: > https://github.com/OP-TEE/optee_os/blob/3.17.0/core/drivers/scmi-msg/base.c#L163-L166 > > @Nicoals, do you want to send a patch to TF-A, or do you want me to do it? I have no experience with TF-A, so I'd prefer if you could do it. In good news, Rockchip has confirmed they're preparing to release RK356x TF-A sources, so I'll be able to port the patch over to their sources once they are released, if they don't already apply it themselves. > > I can fix the optee_os implementation. I'll tell you when I'll have > created a P-R. > The fix is the same for TF-A and OP-TEE. > Proposal from Cristian looks good to me, maybe simplified: > > ```patch > memcpy(outargs, &p2a, sizeof(p2a)); > memcpy(outargs + sizeof(p2a), list + a2p->skip, count); > > - scmi_write_response(msg, outargs, sizeof(outargs)); > + list_sz = (1 + (count - 1) / sizeof(uint32_t)) * sizeof(uint32_t); > + scmi_write_response(msg, outargs, sizeof(p2a) + list_sz); > ``` > [...] > > BR, > Etienne Regards, Nicolas Frattaroli