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=1cwRwl2PIcsj3v/i5CGJEml03C1MA6LO1cq8T7xuYGT1s4odXM8HJ+dIB0CnPS7kZk/m OGtPoVzpgUrSeuu3EHpr4GaKl1X8jSXI3f8IP0U+3kvdE2cjeXV8ioIitIMgO6rrkuOLk u945s4od6k+sHdzcISFA6tcXDdhKXZCxBYEtA3OiLCh92to3aonSmjpBv1BeNq35omBwo xBkIJWSYswa2t4F/9FnGmRMGRe7pU7VGs8w4EWizNi09V1V9pt2HXbpNDK1/LWJKtyUJH AibqBYbskW4oT/lK9O7b1M4T+ozSgaftDXx6okRU6QAoFGecWdq9xRITtj/n/dNshnQ== 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=CtpdxzUJNqNJ4ke9Kbd3dUmGjIEaXs21GbevYgibc+FDEP/71MDWHztuBSltfahmx70P Hr0jlHz2/bQNW9i+EWdr22LdDUSl+fguoG4tysD4yI3dqxF9SJOeMSPVoli+eaHHsXoSg 5nY4EbNeNVr1PphhmC9E6g764YnsTT1Wv1QAzl7uAJ3tyfNGsOkIIserCmtjFREKfFlmj BOfUoYYVO+amlCI16ZxKduagXXMYyVfAWjmHAqd4F2sXlR9BQrqdhyi49AO8lid9gL1F5 z2kGN+62UMi5KkhHQob3Ll/9cZQOBZ1ykm9hNJKsqvUnSWJ3GfnxqltOiYYSi76CYqA== 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 07243606A32E for ; Wed, 2 Dec 2026 17:06:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 07243606A32E 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 385E614000F1 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=PGxpbnV4LW1lZGlhQHZnZXIua2VybmVsLm9yZz4=; s=fm2:rsa-sha256:vAKEwWjqpve4mjaIWrO/B4mWKDM2MEVatGSZ+fJaNAirou6 zqnW1EKIqEZmYgLyQkUUsUe14JPtb+eH0xiZuEinEciAtsS8vomzwpD56blk1dXn K7RajtofNl+QH5/EAmVYp420XDNTDRnxE42usyj8Xy02syalmUUlJI/SYvnvCGB5 P3L3WoIxO4dLpzEjWHsZ2CZj6NJ7skulgzbRu9iGNqJTDqQqKTrqHoJ4Pc+t1qWm vsNphrR9bhiRc4cuNUrpMfT3ADt/3v+V5JXziy8EL++Y1dOdSM15JVzPWoGlu0Re tmlnqjvTAJf+nsg7TO8qAjWoDDGee1SfSrsyFfw==; 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-media@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