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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 99273C54798 for ; Fri, 23 Feb 2024 18:33:28 +0000 (UTC) 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=fiZpJ1C1gs2ogXbB/3lrp2+LoYYeLdDbfbtGP40Ejgo=; b=iiLVPbBcbfPZlR WHdDtSEoFMpuWxU/ULh+lrRgDmSTmmRkD6jThAy71+uzDh0Lvmc5y3Cvc8wpn4mKSraMcdhPkYny/ xpaPKOcu/XsyNGYvWXQheCmTh3otif9Wj+xiUvSzONWSZqhoDXZZCwkCBY0mgudvsN6YjqTvt0lvp Dur9QCZ3OyAN234KFCz90G3gIbcGWVHV4Ej6CVrBR/kZ9TdiWs07h2K5jYxZqMBvkkYf2dRplHVAO d+2pxAaMnQC58Tgy2u8+kfaCZBfDGbe7JpzfqGLeMpf51Yb83eRB9RHxae+u6ZDfTIVNHNOiJaRVt spUjG8SmVyM64LmrEmYw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rdaM9-0000000ArYz-0Lwc; Fri, 23 Feb 2024 18:33:09 +0000 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rdaLt-0000000ArX8-0Z9G for linux-arm-kernel@lists.infradead.org; Fri, 23 Feb 2024 18:32:54 +0000 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6e47a104c2eso753944b3a.2 for ; Fri, 23 Feb 2024 10:32:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708713171; x=1709317971; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=dXNKJkVEkUZdoKeA6PbFxQU2RahxqYWMcCRd6gZZ97g=; b=DPGXv+9dvVgwXzTcSDf5APdNWR2sTu9gNuKLw9CirXjf2sZFt6aj0VWirBRp7F3l8Z WcYO1/p7Uy9ArzA5QgPttCQH37M9GDx+CoY//Nfs9fpV3shV7ZKF88yIlqCDPQS/8lm2 jpmL0UZ3fTNOCNNxRS9PX2Mftkx3Fb4LWaql7/9+hEQzjdi55h/WaE0gV9vxWAf0J7Wh 52cZrJzT/SZveVXzVD+0b76tCjOaByFrVhh6PHBEpUq5alZryhz9uHkFpmbcnCAEzAUm UTMV1KbjdcNOgwxbCWIdHOWYlOQHclXnJaIfrKf8ZreGSVxFHk216s3VPqvI4s29k7di nLlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708713171; x=1709317971; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=dXNKJkVEkUZdoKeA6PbFxQU2RahxqYWMcCRd6gZZ97g=; b=jC7AX3AI9sfizrE82JMj8Pnt/X8HCpmmdeJRQA+HAbw3+IKv2Tm41AutM6qPr7xcre lfp2gXD/h4IBYHY7vojH53RgVqjoB+ay8rMe5Yg1LTI+ApnP3ZBxp9N3P5hxI4vaWDuX Qj6v9YrBjGnVwCIU1+K73dSjfs7jKpWdRUrjqxO5Hbwquy9APfhCHC814kXr53PBR/xX cRuYMOYDid4+ZoCtBdiqrJqQ3qORpcdQ0lDrCwcKu2dfz3+cUbr75le1JAM3FglfT+Uv QkbZxgMU5k6k05nr2IiFW46h5t51Q71XU1ai9Ey1JjNPpBofWbnMv3zcT9DXNkoxJRHa JPOg== X-Forwarded-Encrypted: i=1; AJvYcCXZnisLQIPgGQgwBPMCNBrtxVzF8fbw7dw8iUvAXkGjHrcEVH6ZwmZcplvWIzZP9PqyNpihSbdmh2nIrLuVyxVH0ppX/bDBnn8WFTiuokg8N91HHIE= X-Gm-Message-State: AOJu0YxPpldUFhPNlohLwG8B3gcWAjZTNPaZgX1MmyAYeF0O53eKfaAy E8mU1GyPoZ5NqQVyPYtTQFMVQrWlprhtVIXYC7Edap624YbLwsrOBp1O3k4ctBE= X-Google-Smtp-Source: AGHT+IG4UQYH68MX7y3iRYfp2fJ92YT55kxRllR+ksVeb/ZiaoCE5+Ml7rd1sXmqZO+dsdfexxhreQ== X-Received: by 2002:a05:6a00:2310:b0:6e4:cf7c:6c28 with SMTP id h16-20020a056a00231000b006e4cf7c6c28mr599071pfh.22.1708713170112; Fri, 23 Feb 2024 10:32:50 -0800 (PST) Received: from p14s ([2604:3d09:148c:c800:a9ba:9d9e:b797:23f1]) by smtp.gmail.com with ESMTPSA id fn21-20020a056a002fd500b006e47e3e139esm7520820pfb.26.2024.02.23.10.32.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 10:32:49 -0800 (PST) Date: Fri, 23 Feb 2024 11:32:47 -0700 From: Mathieu Poirier To: Arnaud Pouliquen Cc: Bjorn Andersson , Jens Wiklander , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, op-tee@lists.trustedfirmware.org, devicetree@vger.kernel.org Subject: Re: [PATCH v3 3/7] remoteproc: core: Add check on cached_table pointer Message-ID: References: <20240214172127.1022199-1-arnaud.pouliquen@foss.st.com> <20240214172127.1022199-4-arnaud.pouliquen@foss.st.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240214172127.1022199-4-arnaud.pouliquen@foss.st.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240223_103253_197318_4D1EDBC3 X-CRM114-Status: GOOD ( 24.70 ) 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 Wed, Feb 14, 2024 at 06:21:23PM +0100, Arnaud Pouliquen wrote: > Add a check on the optional rproc->cached_table to perform the memory > copy only if it is not null. > > 2 use cases to support: > - starting on boot, in which case rproc->cached_table can be null, > - starting on crash recovery, where the cached table is used to save > the resource table configuration on stop and re-apply the configuration > on the re-start. > > Signed-off-by: Arnaud Pouliquen > --- > drivers/remoteproc/remoteproc_core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c > index 283ca071e35c..34b0093689da 100644 > --- a/drivers/remoteproc/remoteproc_core.c > +++ b/drivers/remoteproc/remoteproc_core.c > @@ -1278,7 +1278,7 @@ static int rproc_start(struct rproc *rproc, const struct firmware *fw) > * that any subsequent changes will be applied to the loaded version. > */ > loaded_table = rproc_find_loaded_rsc_table(rproc, fw); > - if (loaded_table) { > + if (loaded_table && rproc->cached_table) { ... and this becomes: if (loaded_table != rproc->cached_table) with a detailed comment about what is going on and a reference to tee_rproc_parse_fw(). There are other things to adjust in this patchset but starting with that will hopefully deal with a few of them. We can address the rest at the next iteration. I am done reviewing this set. Thanks, Mathieu > memcpy(loaded_table, rproc->cached_table, rproc->table_sz); > rproc->table_ptr = loaded_table; > } > -- > 2.25.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel