Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2510036lqo; Mon, 20 May 2024 08:03:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXYFyaN1wsVaFAvP3lzizvSj5YoRrcHg0v5ju0QaQDhih24yZ4gRGr5h+lFmK+RkslxTvAvgDQ75kK6xNf0qBFtzEBBRu0JDNji8HRHRg== X-Google-Smtp-Source: AGHT+IGx0h5eBXQASvi+HkDC2t3woNxWnb3CqYf48Aaji4OWR2WM6m0qqsiT0q0nJcG/9EIbL7LL X-Received: by 2002:a05:6808:343:b0:3c9:68ee:e00f with SMTP id 5614622812f47-3c9970cc4a3mr31475527b6e.43.1716217381866; Mon, 20 May 2024 08:03:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716217381; cv=pass; d=google.com; s=arc-20160816; b=d0gX/HhWaeTYC8LYpcHy7A4YzG8pGpbSzma9IpByUopiybEt7dmAm1WTsQANL+07u3 BmtIVap2/V6vC/vExftulscixxqPnFyisWIRZAv0q0OekB/vEvUYkLekSoMnRbj5oxyh /XUgbaqcqwjfkE6UM+30ASIRmEx2H2jX3iowl4PkbSiZrjxCozSXCHN+mtiw7vPKFD4Z /2sFQnwgqrI35JvjNMMy/CxusIKjWHyi3m+0JsojAc8Pje/2jjnf1NE7iyJorObVEBDk K4Q2vS+nC+TNLHJ8UKvvI4yUiDoNlItPl0IQ52ZWEDX08OI8NrRe8PdnmbdhV+dF6FhG d74g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=ViWFnlRfa6HfsCpt9sNPud6U2bBS5mkJbqnxes4Nv44=; fh=1KrCs113+vruRdduXYlV1bJnDAWKN5cg3sN2gD6e4cQ=; b=CJs/i2Waosak+7/5srd0UF/YuDKsaGGdEEOq5ZtC8CzhUilU3YV/+rz7ZBHhtvsgb4 8aXyPyvTrs6mpt1vz4y9ig34JDhY14j+pa7aervD+uRxyPCyHX3fC1o09vjvnDDH7HTM eVv+KZ4+twViHTkXZwg3pZHVh4RhuTeHe/oCx6cgOLFDjkXVm8g5Qu0eNVW0HCrQhIMs e1RfGAnrqMfzv/RghQmlu3juiU0WdwZsYoniyicdazThzM5737+9WrqDj8rRlo23mPUh e4UZosOtB4Efd6FHF2p3w1qJrNr9jHbhPjRxuUXEKuzHfnqVfiPMeEBakqsZqTYAHqBa i5Xw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=KHzDrnPS; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-183874-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183874-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ada2fe7eead31-4806cc6cd80si3639320137.455.2024.05.20.08.03.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 08:03:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183874-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=KHzDrnPS; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-183874-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183874-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 811C41C211C9 for ; Mon, 20 May 2024 15:02:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 05DBB1369A8; Mon, 20 May 2024 15:02:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="KHzDrnPS" Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 A80D928E7; Mon, 20 May 2024 15:01:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716217319; cv=none; b=FFJAfb5myIP8Ixf9c2NafY4sIEIGAPl5MRSM5UZ48HjpZX+mWwhbFMpEYjIpWiH/ts1P8r+p6Ya56hVDuJrE28KVHYmFzjxPg+O3vvqyuQgB1k07XOqNfJPmhpoFmBfK3i0h0y48Olyo6MLD2HOVjGFMBybB3NkCATU9JmmqNlw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716217319; c=relaxed/simple; bh=yZe8BUauvo3lejvk2C+hLkZ78XaAKCpDBbZUCxqKy8c=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=imOSlKDJTnBRV8izNwqf4sWUggUZ+Hi6trhWSw47kFOkMiyum2U1FpeekmVHL+vuLsb5I0F74sYSqTYHP2c4iZ594psV7knAtyoDT6mzUtbFYIQDvPsuR3v5kPtojvHUZxyw+AZQF6FjnrGFMM5Nhk0/paytwtW4VMAimZVAPCI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=KHzDrnPS; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 44KCAjP9029799; Mon, 20 May 2024 15:01:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=ViWFnlRfa6HfsCpt9sNPud6U2bBS5mkJbqnxes4Nv44=; b=KH zDrnPS1fdfel7KxCI9YWLJcFc0omE4hPzN51YzAyvtF8H5eJjOOx5MAZiWV3kDR6 nHGCtoJ4w5zdWfkijZpbcYZr/YeHui7gsMfIHDRMEZ6O366kEhiLoTNKLvkLvfC1 w5pEo/5Bz3A16Df819O08VcmWtQMpFSwy2S//XpEsNJAOVjB9snSFAjsVdA13wTs WVUEpNn0F8FDv0nvRWsBQdWEncLfX8BK2FtYGiKKxpkZDx6O/7sDpUXNiJJn+950 qshmrVa7sRv1cTq8eU4tFzdA2ee9xfy93ozB8Gg06WZ1wMRe9faa3BxnZ4HuNvVz /+/KURVGk03kcLvRRpsQ== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3y6psauk5q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 May 2024 15:01:44 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 44KF1hue032086 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 May 2024 15:01:43 GMT Received: from [10.216.60.210] (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Mon, 20 May 2024 08:01:39 -0700 Message-ID: <7ab7636c-9da0-8053-a264-6031c416ab6b@quicinc.com> Date: Mon, 20 May 2024 20:31:35 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] remoteproc: mediatek: Zero out only remaining bytes of IPI buffer Content-Language: en-US To: AngeloGioacchino Del Regno , CC: , , , , , , References: <20240520112724.139945-1-angelogioacchino.delregno@collabora.com> From: Mukesh Ojha In-Reply-To: <20240520112724.139945-1-angelogioacchino.delregno@collabora.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: Bd0pJb3d-7DgY5dqmoJk8-rBGLOCNNDJ X-Proofpoint-ORIG-GUID: Bd0pJb3d-7DgY5dqmoJk8-rBGLOCNNDJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.12.28.16 definitions=2024-05-20_05,2024-05-17_03,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxscore=0 adultscore=0 lowpriorityscore=0 malwarescore=0 mlxlogscore=999 priorityscore=1501 phishscore=0 impostorscore=0 spamscore=0 clxscore=1011 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2405010000 definitions=main-2405200120 On 5/20/2024 4:57 PM, 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); Although, it does not make any difference apart from a write of len bytes, still a good improvement to do .. Acked-by: Mukesh Ojha -Mukesh > handler(scp->share_buf, len, ipi_desc[id].priv); > scp_ipi_unlock(scp, id); >