Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp929628lqp; Thu, 21 Mar 2024 23:17:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV1GiwoLzuQe+LIiZJSO0TeG+ZxCc/lLgK/HLYWAhpsWBPD9EJrSvdxBVp56K8JJMmWwLJt+LQ3nj9zwtubReBj5gOw48zEwoaU7WVcqw== X-Google-Smtp-Source: AGHT+IEWvObJDntJLjQPObNpx7+4tbZdcbCleJL1CsPUmt45xLq2bogJNq0t89lgxvnPzemU/LH3 X-Received: by 2002:a05:6a00:2291:b0:6e6:bb2b:882c with SMTP id f17-20020a056a00229100b006e6bb2b882cmr2183084pfe.13.1711088223325; Thu, 21 Mar 2024 23:17:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711088223; cv=pass; d=google.com; s=arc-20160816; b=cYG8Jbrag2Yp7AdS3qs4R9m5UQr8hgiJWPl3viktT9ROc+fPWlaAsvGu0WENlIR7Qr 3+fCz0eX/yRqIXTBaen729DLT4ZQtwDbCV+hyYA0N/LByF9AIhQL5kdFlTSEdUcCmM2j 89g9UMo+H24bm23u/9+BG/bN4SpPbkxy0Blt5D69IkWyqVTjXjmoZvh8qlroY0tPpzoz HEaO8S3+yWbdA3T8uQYDxSAAjEX+MdA/ce6vB9mWyydfxAbPdSgNWWKVIFVVu2kMg85d /cy/iHZLgB2yWBABp8QE66Fkx1NShsmHkDsxyi2mappR3iDPTbqUA0sHeTepFTySfdr3 oP+w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=gT7Bg18sIXZg+EjgY6lBXh74L2mub86VFZv8DtqvGEM=; fh=htIqC06e4rwDLq3G0AuNNP4zUgnA79XpIpKqxumKqMQ=; b=l6fKt2q7vuc/jXwEu8L2E2DgmvCaVXyCBjdhDSpRi/jjzFGuKIUdgUDgInfRyfrJ3m 20t17/kb2IFsQcDM3UswiDJYRGsXSKgK9kqWH4A905CymrLKGaMjQhwB+ze45V+7Np/Q KsgiCT+cfIxpjzewABdhxI2vpfw1VmTwfIkUSShWqzHID2PADn8gw0jT4tuXJtcfwHFt f0krNqy5Govew/52SIAZTyxIHbCwl+VX2iTS+URreZv5nUaJPAKQYHg/0U/C612vt+Ix rMZuKoVfNzqmOeI6jv7pNqPXUzR0IzDGmYFNmIdxEvpql75CYwwPrZFPiooUkS+Q35m8 q//g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oQtSKAmA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-110982-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110982-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 203-20020a6302d4000000b005e43cb2a1ccsi1321180pgc.325.2024.03.21.23.17.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 23:17:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-110982-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oQtSKAmA; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-110982-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-110982-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 4800BB20D9A for ; Fri, 22 Mar 2024 06:16:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7094B1097D; Fri, 22 Mar 2024 06:16:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oQtSKAmA" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90830101C1; Fri, 22 Mar 2024 06:16:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711088198; cv=none; b=S9c3NpgtLamRoof7YPtY7bs11ctusMFsFfZMNK6yaI+cxNUhiX9lc0/n9k814BW8HZL+iFoXJHpFa1voJF3/7e+hyCJBdya/KpAZhssXPHwGmOJoU8175u9j+Tb3/x4BbNdRvUV2L4fW2B/S3AJuqHCKl6tCcVnlD8gBjnSw18E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711088198; c=relaxed/simple; bh=LrKxP3gm3uo3ToMeUXgziplcc6id5nTLO7X+pOXUayc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=szdEdL9ZLS4jFACksX9t8Y7ngEf59ngxrCGeV+96xzMXkIuT+PetVgF5kb0IYd0zuUiBW3atgr6CZy9QFXIkpsutljWMWgxYTbkeV4Qo4iF2TpEfxbuDTv01s+jB92rHNC3xZFJaW5+CJSzbezD72/qm2WPQ29bDKmrf3XgdNiM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oQtSKAmA; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52942C43390; Fri, 22 Mar 2024 06:16:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711088198; bh=LrKxP3gm3uo3ToMeUXgziplcc6id5nTLO7X+pOXUayc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oQtSKAmAk0cKGUFhHQ+JW6Wm6UGuBD6ww5PLgK2/IZtltY5+Dki2bf5/Wv9QLWMYN XUikuAIsCQOQWag0bM3/jKybttyCf8q9dURrF8Z887Tp/+LunpV7Y2G0nF2GSgsXD5 6zvB3BXFfM2G9N+6SkKR1RZoChB3g3LNqEBOnWyAS5all7n+yD0DDgUwje9oXUavPD kIU7HS3tVvKXVcki/fUEfvpE/QnmOzl4+cQWFoAW8kEa+0kAnUgPKw1VCo5aWZ2471 MKj1U4ngpZwjm0CzaetQ0iL4nWzXt/RWMOSRyz+604MyQoeG5p4Tbn7uC7HxYqqbcz Nz3PNcznGYDaw== Date: Fri, 22 Mar 2024 14:16:34 +0800 From: Tzung-Bi Shih To: AngeloGioacchino Del Regno Cc: mathieu.poirier@linaro.org, andersson@kernel.org, matthias.bgg@gmail.com, tinghan.shen@mediatek.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, wenst@chromium.org, kernel@collabora.com Subject: Re: [PATCH 1/2] remoteproc: mediatek: Make sure IPI buffer fits in L2TCM Message-ID: References: <20240321084614.45253-1-angelogioacchino.delregno@collabora.com> <20240321084614.45253-2-angelogioacchino.delregno@collabora.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240321084614.45253-2-angelogioacchino.delregno@collabora.com> On Thu, Mar 21, 2024 at 09:46:13AM +0100, AngeloGioacchino Del Regno wrote: > The IPI buffer location is read from the firmware that we load to the > System Companion Processor, and it's not granted that both the SRAM > (L2TCM) size that is defined in the devicetree node is large enough > for that, and while this is especially true for multi-core SCP, it's > still useful to check on single-core variants as well. > > Failing to perform this check may make this driver perform R/W > oeprations out of the L2TCM boundary, resulting (at best) in a > kernel panic. > > To fix that, check that the IPI buffer fits, otherwise return a > failure and refuse to boot the relevant SCP core (or the SCP at > all, if this is single core). > > Fixes: 3efa0ea743b7 ("remoteproc/mediatek: read IPI buffer offset from FW") > Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Tzung-Bi Shih