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 A0B83C25B78 for ; Tue, 21 May 2024 16:47:54 +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=QttFpMtyPhkz73x6KlblgnJJtmmAobWfHd++V0qRbQA=; b=dpQtEmiIu7deN3 o99F0tpSIWkfUSeuqpjyUzuW6vVWnjgk3LZDnC6o2tUlW6QlMlxd/kOeS4WMdJE9bBcJjiyOG1LBT F/aYENBoqgJE+1eUKhiU2IAwyiOJq2uSww0dgDqqVW1oBA/loEjM9qmhquEa4ge2b3sVTlja3GETN GQBDOz9HAeYhT9TXA1rJEsAdotRr3KkSDytZp7RMX0ZuQD0vUkRcflSpndmM2/oY5nSiwiuLECnjz aYOIJcyCLw7H3/XlXDlPKwR34EfejoY+KsWEjWMd7S3FaM2zIjWN/LkOus6ZiPMfwH+oBiud8la8v cWlml4JuKxL39VsVrG9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s9SeO-00000000YOZ-2aQ2; Tue, 21 May 2024 16:47:44 +0000 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s9SeL-00000000YNc-0uuz for linux-arm-kernel@lists.infradead.org; Tue, 21 May 2024 16:47:42 +0000 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-6f6a045d476so485902b3a.1 for ; Tue, 21 May 2024 09:47:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716310056; x=1716914856; 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=PZAIDSZz5noc6if4QKqooN9MLNYkeL9UbakI+8iRBos=; b=s/cW5O6LM9ERWWMjmUhL78Gg3dA3MQ0RyOyz24HIQMSyf9YpXqc4FbS67ulnbx6h1x JM+D1F9/lG7pyKB6FcQYhzfRlUbHAjLkC730rEweyE4hVLWXHZmxQ6uSUIbB+/CIfjNE M9zrWQ/E/xcQMWHPPqrTwiDdu3liCCIgaGt4+E5I22puq975fPidH/0UuCo2LGaMEpP7 8Gs8Vk5GivpgT28qpTKZkfGGieZ2b362OCt+l5BXgJetw7ZNOutF7zZyGfZkDyvlxWBN NqsNvQ+kahVj7u7LQKsaUUk5jf3hNh+0gtwdMWjXFpJb0aKzbj8BVpEz7MUTqbm4Gdcc uFqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716310056; x=1716914856; 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=PZAIDSZz5noc6if4QKqooN9MLNYkeL9UbakI+8iRBos=; b=ks/wj5zV39n9V6luTQCGQXmRoeSIgP+binyINOJXj8n/4Z6NM9V9zy/g9ha4ld13XC d3Ed7QCHxCD79znJCdafjbMXCbWCRUI8KPP1wzZg120hm/V3VyLxVdtfTOATVgAbzVUy dBbvcQuQFCulgG2fClDOTrzT+tGiHySv4b7RwwZbKiXf+35gMwBOiGMZOwv1UnIHjKzq BDOmd0xrTQC4wSSCvWBkbSDyqU9h/RmrP8ZA/fIowMYUHFf0OlpPy7TfRBq0WgF7kHZN umNJp2rFGN4TBW2MxXGG90GqrXQ9v/Teo2egjNnB8BbjMLd3lwvpbiWd+/eUQCOPpSsa JOCw== X-Forwarded-Encrypted: i=1; AJvYcCUMKzqbAjNmK8mhMH0dkMdkz9qGtYkCEX62kjALjed0TsYmWVy+wCV2WD+UeZ4eR6gRFHbuAJEjNCRbxVYUzeLZ2H+p3nY8ha5Oq1cVgC9CbDVTxE4= X-Gm-Message-State: AOJu0Yyh6dSpxYkYVzU/bNf4v3iJOavfWYt9Q5t8hvOPO8zE9e/iL/2n ygSOOaIauNvKQYPKR53LzsD9DhRK9I56uxw1EN0Uynu2JAZjxaN/MoA3hq4EBfc= X-Google-Smtp-Source: AGHT+IEM61ROSOw0CzG0X8FSdmCEEg6WGFlarYhclikyQ2fR7QmVIqgP4xaOcvcYDgnr0vf49H+LBA== X-Received: by 2002:a05:6a00:2284:b0:6ee:1d68:d33 with SMTP id d2e1a72fcca58-6f4e02ca2abmr35478343b3a.15.1716310056526; Tue, 21 May 2024 09:47:36 -0700 (PDT) Received: from p14s ([2604:3d09:148c:c800:df1a:22de:40b2:f110]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-6584e7897bdsm9707304a12.21.2024.05.21.09.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 09:47:36 -0700 (PDT) Date: Tue, 21 May 2024 10:47:33 -0600 From: Mathieu Poirier To: AngeloGioacchino Del Regno Cc: andersson@kernel.org, matthias.bgg@gmail.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@collabora.com Subject: Re: [PATCH] remoteproc: mediatek: Zero out only remaining bytes of IPI buffer Message-ID: References: <20240520112724.139945-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240520112724.139945-1-angelogioacchino.delregno@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240521_094741_289061_D74E56B7 X-CRM114-Status: GOOD ( 16.25 ) 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 Mon, May 20, 2024 at 01:27:24PM +0200, AngeloGioacchino Del Regno wrote: > In scp_ipi_handler(), instead of zeroing out the entire shared > buffer, which may be as large as 600 bytes, overwrite it with the > received data, then zero out only the remaining bytes. > > Signed-off-by: AngeloGioacchino Del Regno > --- > drivers/remoteproc/mtk_scp.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c > index e5214d43181e..dc70cf7db44d 100644 > --- a/drivers/remoteproc/mtk_scp.c > +++ b/drivers/remoteproc/mtk_scp.c > @@ -117,8 +117,8 @@ static void scp_ipi_handler(struct mtk_scp *scp) > return; > } > > - memset(scp->share_buf, 0, scp_sizes->ipi_share_buffer_size); > memcpy_fromio(scp->share_buf, &rcv_obj->share_buf, len); > + memset(&scp->share_buf[len], 0, scp_sizes->ipi_share_buffer_size - len); I will apply this patch when rc1 comes out next week. Thanks, Mathieu > handler(scp->share_buf, len, ipi_desc[id].priv); > scp_ipi_unlock(scp, id); > > -- > 2.45.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel