From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=103.168.172.156 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796231170; b=4j7mM8XAdDnQyI2m4NRdtkyn3dij7qHFoOC2I6v/q6iVZS2P8+lOagF5WU4X52+XkCq2 NeE4M6PfIdxPvubQtM2Buy6ur+FurwLOAP+xb5UZDWRxhlJPuz2JiZWv8bgQd+tw4MI3C Cg0lYDmS/YaYTE4I6zcxEv+La/xzRWvT0EvOd3RjPVD3VDoOjEeLeKxaZjx7cq8PCcDob wope6fxN4vtlMBq+zIn48/tOKLa+YfNHs8ZbXVm3FvtKwfYUPF+82eWn1LLWSBglrZOO6 qY3GscWTy0x3daIo4Hj7w4fjgIWkfA6jNBSQbtEYGzBztRKRY/JFrftnPlLfnDCCKTw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796231170; h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature: X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:Message-Instance: X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID: Received:Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:Content-Transfer-Encoding: In-Reply-To; bh=aRnsoXgsmCzjDJ1TVNMTixKIIW1PAbUujEz2NihgjGk=; b=QEDfpRYikVYSKW12f8w2SbcrCcN4fuGB6lwglT4twLOzIUY0wdc/eRoLMp+jfREFDvZn 9MCpsKXodeFM12FGD+7cUTrUe6ZfdutSG1baCfNwcCwLE1boN+1cGzUw2v/+UPb53M2a3 7927opOIlnXxWvTLmHjzWZ4pt2jXjHDcBBUvzfpvQJgRWTXbApJU6vK6Kg7irFXBdN32k S93kmAXh0PxS32zAnGXPumKfNygSG/S4B4VBdEHhioGK7SJaYADplaqq4zjyRMP+Fnvae ZVyMMPP4/ANT9iySnENyNlunquBXShTT3QLhkVUjlbQF2yQM/6f1Iwq2tRf+zSoOTIA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=ragnatech.se; spf=pass smtp.mailfrom=ragnatech.se; dkim=pass header.d=ragnatech.se header.i=@ragnatech.se header.a=rsa-sha256 header.s=fm2 header.b=F+2OHuwc; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b="v/o2Hwqf"; arc=none smtp.remote-ip=103.168.172.156 Received: from fhigh-a5-smtp.messagingengine.com (fhigh-a5-smtp.messagingengine.com [103.168.172.156]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 072E6606A330 for ; Wed, 2 Dec 2026 17:06:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 072E6606A330 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ragnatech.se Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ragnatech.se Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=ragnatech.se header.i=@ragnatech.se header.a=rsa-sha256 header.s=fm2 header.b=F+2OHuwc; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=v/o2Hwqf Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.phl.internal (Postfix) with ESMTP id 3954B14000FB for ; Wed, 2 Dec 2026 12:06:09 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Wed, 02 Dec 2026 12:06:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech.se; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1796231169; x=1796317569; bh=aRnsoXgsmCzjDJ1TVNMTixKIIW1PAbUujEz2NihgjGk=; b= F+2OHuwcf9RQE0ADL3FF3Z67LOGtjKrUrpN62wCMKipaPNx7BIrL4U7Mx1ABHAbf 711/AWeafs1BZLHniQ1Z5k948NISSTpZ1YnTzqu6eHuvBFaP09DhT08Alxrk5Y9I jebHTieGaBp4R16G3572LU0vwdtayss24dgoks1tmVSsQgSKONWrBwramiS817Dm QF2CCRD80QH1IxQnX+ikQObqwtdGewZBlEJ41QfPA5fHyIEmacWF3Z6nuwR/vPVf KhL+KaBZIhHIxyFQgOUec5zMkYJBbbu2MlR1doX9NP19yvZnXSbHdH1t4LOvNcLP 0ra5z7elBOMUJQRsgGS97Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1796231169; x= 1796317569; bh=aRnsoXgsmCzjDJ1TVNMTixKIIW1PAbUujEz2NihgjGk=; b=v /o2Hwqf0U08hXqukoncZBB1usHL+OVu+x0ncb7TNSLldMpeTlbeGtecYTp3ltC3J WiRcQDXVXny4gGKQeDg15+Rcu10m75w103UmhTNELsLoWmJYFd5sCmFxZjKrBuwR b4dM9alOr4GsNBqs90GWcO5+yujdKHZW5htqvGhcivxyGBWU3PQ53J7AP+EeHh6f 9YR0dalQOZM75rP4DpAP4fsZcPTED27aKcSnz8ytX7SPnUUZwMFVvoZt5xZU//ju 1YAtrdBUuTqnmsnNM5sLTfnsSMfk+m8g82Hwou12I2VqShOyGsc642bNgTocSYvb hPbbm+xGwTyeI0dxk/ngw== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=ragnatech.se a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1796231169; d=ragnatech.se; mf=PG5pa2xhcy5zb2Rlcmx1bmRAcmFnbmF0ZWNoLnNlPg==; rt=PGxpbnV4LXJlbmVzYXMtc29jQHZnZXIua2VybmVsLm9yZz4=; s=fm2:rsa-sha256:lWPo1pPyBOv8sEr0CcVREzPh55EKqWGnKMTY8Y4m0HtRzDo 0bEsjuvkU0NW5KG0ORXx/7pnrlsZKciird3bqPIxdo2udnnHVQ4JIztlD9qjcNWG 4LcqnMqaKKNLgYH/25MBOo1hrBvKD3bz7sQYFKrxTAhL9ms4BhyzjlindsbJxFUi jIBHWk0aAWFgJoy9b4sfU/gcZrKk2oEldZcl+mFLywGKsOJCQSP+KKm2JJDN7XvS 0Otx7M8suYctCi/wSNbewRkFfjB+4XF9lSUe8CsfoMFeW8ZSBMnuayJ0EWkY8LAv DSn0cjljgXf7QcG0Z2yYaRN2FclG9GLfGAaKbkA==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=mi-m=1; hc=13; hn=cc,content-disposition,content-transfer-encoding, content-type,date,feedback-id,from,in-reply-to,message-id, mime-version,references,subject,to; Message-Instance: m=1; h=sha256:8xo6Vk6oAboeWvwTifOCtzc1krTY2kjS73QRC2kNPnU=:PDubLnqWChn8F2mRffq1eI5WkPFNmZGIqypHwPbWBqI=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFU7wSrIOfGMf+Jv5ZATHexEl8a1/5W6fjpQv1+7i7zfVXmn99kgmKsqfuRHc8vrY l0fcedvsSs1PQ4s+EDofWBey55iYtvfxXnDP2/aOvfJYGrYu/WEMKGNyY4ZA/W+iXzc1X3 uqkKVZHKPivywtmz/eMQgTz23kWhYy2R1IGnau/3g6r+mcrmLwtkG8RqKZrxgP9Mhn6zP/ PC4yw3K4o0MbdW9Nmx4eviTPtF+FmK0U1TECdvER5u6zgPeQK3+jCml28KyzSCxGtbEECF KQNqPBwsdzqtSaDWBP50HtcG5dXFwClU/jtV9MVInGOotSbgcCz23mwCYPIG1S6PYJnNg2 KUafacYc8LUId9oz/rMyf58hSaABHF5P4eqEpU4UFP0GJSDnTfaPJilwyzr7UBx+dG377s w1wFy9h74Y2Lco5NMFXmAGeHkHnV152M7xHb8xzAlM2SSPNz5yw6KPkQCeRjGkGhZNrOQe DnxmomtdWrxmQ8ug25vqqgHdu9e97V8criiyQaNibW9XSfz10pnvU7Qs1CsX5+u2zShb8W gbotNPaukteorMOMw+2HfTLrIxGs2t5BJwdEbJ0NRSDzjB9Tc+d9JEbmHpCgraAjCX/ATo PvG1rNsJPEuSXNE1QWuJatAdHjldxixNp/6T/GLnxQBkZAd9IoEwA1s7Yjiw X-ME-Proxy: Feedback-ID: i80c9496c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 2 Dec 2026 12:06:08 -0500 (EST) Date: Wed, 2 Dec 2026 18:06:06 +0100 From: Niklas =?utf-8?Q?S=C3=B6derlund?= To: Hyeonjun Hong Cc: Mauro Carvalho Chehab , Geert Uytterhoeven , Magnus Damm , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH 2/2] media: rcar-isp: Fail buffer preparation if the ConfigDMA buffer is full Message-ID: <20261202170606.GL3157946@ragnatech.se> References: <20261202163100.GH3157946@ragnatech.se> <20261202164311.745594-1-hyeonjunhong330@gmail.com> X-Mailing-List: linux-renesas-soc@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20261202164311.745594-1-hyeonjunhong330@gmail.com> Hello Hyeonjun, On 2026-12-03 01:43:11 +0900, Hyeonjun Hong wrote: > Hi Niklas, > > On 2026-12-02 17:31:00 +0100, Niklas Söderlund wrote: > > ... This check while also setting the new overflow flag will return > > -ENOMEM ... > [...] > > ... Which will be propagated and returned here ... > > I do not think it is propagated. The block handlers ignore the return > value of the write callback and return 0, e.g. rppx1_ccor_fill_params(): > > write(priv, mod->base + CCOR_COEFF_REG(0), 0x1000); > [...] > return 0; > > None of the write() calls in the rppx1_*.c handlers is checked, so > rppx1_params() returns 0 after the buffer is full. In the userspace > model, with only patch 1/2 applied, 700 header-only CCOR_POST blocks > give 2047 pairs written and rppx1_params() == 0. You are correct, my bad. And that's not very nice and likely something that should be fixed.. I can't think of a nice idea right now other then patching all rppx1_*.c handlers, let me think on it. Or if you have a nice idea? I think fixing this design flaw is the right solution. Or if we go another way changing the write() callback to void so it is obvious the return value is not used. > > > I don't like adding a flag for this, and it's not needed... > > Understood. Would you prefer one of these instead? > > a) No flag, keep counting in the callback and check the count > afterwards: > > if (desc->count++ >= RISP_IO_PARAMS_MAX_PAIRS) > return -ENOMEM; > > and in risp_io_params_buffer_prepare(): > > if (desc.count > RISP_IO_PARAMS_MAX_PAIRS) > return -ENOMEM; > > b) Make the rppx1 block handlers check and return the result of > write(). That is the proper fix but touches about 170 call sites > in rppx1. If we can't think of something smarter I think this. Or do option (a) and switch the writer callback to void to make it clear the return value is not used. > > c) Drop patch 2/2 and leave it as is. > > Thanks, > Hyeonjun -- Kind Regards, Niklas Söderlund