From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8636E2D2387 for ; Mon, 2 Feb 2026 22:45:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.65 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770072342; cv=none; b=iXngY4tGtenVPdMCmF1FHh+Rexw/submiqavsdiIUYAMchX4gdEbeUQLbw1H82ugUohL28JdtAw96sNKY5ZwqJkFHW/egFQdWC5COpUkc934LT0+RXDoa3cjff/S+haceCDJ9qp0AeR9/kludhaDHv8M93TUWhc1yFqAakId7io= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770072342; c=relaxed/simple; bh=5Kb5krIsfIdKzbY4UbV0w0i93VHuDl4UPIOiaxALKbg=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uW8bYGMwwq1w+QYrMi6Du0bCm6K/HtagqhEWifQut74jaZRZFAxeJnly68LHygjlIJdIcJcSG6jneEpRJ/BCjZ5NgMg7xAW0I12WF5ku4tE4FyiQ4RzUmTWokKFfurP3bmugwIdKWTp2nXYpQwd0TtT4FbBNaZDRbYrgD4iM0Xg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=YI8KWJqU; arc=none smtp.client-ip=209.85.128.65 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YI8KWJqU" Received: by mail-wm1-f65.google.com with SMTP id 5b1f17b1804b1-47ff94b46afso1821535e9.1 for ; Mon, 02 Feb 2026 14:45:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770072339; x=1770677139; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=JGqAdrVHnFu6PnnaHfHKQoFDoCwgyHq7ziHIdTjOCQs=; b=YI8KWJqUC0UQfYhst3EmtYqnqMbtMocelTGoFCn5ICZaG1YrEV/4+ldRx5gQP2aTe3 +jsKB2nrkgLIgvETdfjQM8fn7115QlK4jj+YzLKYw+a+TGqjeZ7NHqqxrcTSDhX2RyiV FVG4bdZR1NJRpmGXiRg3yXfjHBzeEnwtYCb9tywXndb56SQ16DUbqwY2XEpn9i98nslg h2vsWy7E5/vTrQOiYeXnHuhK26CD23pJJt42dAFR+pSOJzgEescMsEorT7hAN6nICu6u j99WD+/C2Qotx+ZPXxI+AfzgoOjZxRNMvA75Hi3rZVS/LRPI7vNaBUa0lFVndkldXVZe L5vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770072339; x=1770677139; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=JGqAdrVHnFu6PnnaHfHKQoFDoCwgyHq7ziHIdTjOCQs=; b=qz3JZrub9GNZuH+f0qAV+fWymfVHkAhw0LVPf1M00jz8hEwWFfHrm/odKlFGxw/YHo JVJDYXATmzR3v/FdW9CqWjgS2bzrvT8Z4RLL8b9Z39WrZK6uQtcgi/jBaPyag4pxEdTK qOiOj5AkrDWT589Rp4J9QzQErShsimwHlIBhnx2DkqcHxObD/+dtn21x/AGbOQ2RT0/Z Bh0Fj8TLxyHjX0nWwYDgo96c1kBWs1XdihkdTQJEQ4WBA/t0mAZr7rDuCDOkzaMKCHDT Rn9xTEYyWMQG9SS+Yly/QTsfTSbhnmO5mXGcx/zQDDfUyivMB3c4mRWuvxdfKIPjzorz XKTA== X-Forwarded-Encrypted: i=1; AJvYcCUJO08uS1uQx78dZZfrt4+2Wjn5TMUGAP4p8UQVt0diL+Nra1pGJUmaf8yI6cvHTMEQO3uSHtwXLzSdJc4=@vger.kernel.org X-Gm-Message-State: AOJu0YzRmXb5c9GN+Re0pbkR2ztTkeAORCnAfrdg942t84RHdnuGl6Qd P3KkPm7xmh2hr39g7UWkX8omwB+ukkfd/KiBrVtiQYSchkvRkNCsOcGI X-Gm-Gg: AZuq6aKyflTRCZvwe2IHv75vcesFCM38ivZKfQgS2cf7F2uW3xmNMevUA3xUck7vQ+B vckMFiKgT6XbniUD0In/b31RPwyQPESKoGJ7xtT0VHKg4VB6IfuZJ+t7MJyOUgEo/sq137Mdnfu mY03Wwxfr6XpjK1BgS89/WR5tsZqBp8i/Ieym4hpZQ7rPJTan8+eqqc2STMre9eOpgbfTyb7QZn jz+3MuS49+16bSA119b2/CT7GdQQ5q3ryou/+NVTmxLOrf1s8WA2UjzlvMsc7HHVOPp3AbS9JXe ku8PvwVIkFFnnPqp52w20KKOUHY9dBqIFiB+n4DG0K0nqZT73b2Bicd7wH0RsljRJIu/rGLgGg8 7QguLq4mJbxe7aRD08axfst0Q4uBQTwNPs8e5yAawBZiyx2pyRe+LMn9Z1P1yScAJo2R1Z4Y7Xj H/DSmEzVzWFFUa8+ygCrp0der0LKAzEDLassTlA5ub1sNdc0+elG5h X-Received: by 2002:a05:600c:6303:b0:47e:e59c:67c5 with SMTP id 5b1f17b1804b1-4830513aed8mr18382505e9.8.1770072338747; Mon, 02 Feb 2026 14:45:38 -0800 (PST) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-482e2973d57sm100080575e9.18.2026.02.02.14.45.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Feb 2026 14:45:38 -0800 (PST) Date: Mon, 2 Feb 2026 22:45:37 +0000 From: David Laight To: "Arnd Bergmann" Cc: "Nicolas Dufresne" , "Arnd Bergmann" , "Detlev Casanova" , "Ezequiel Garcia" , "Mauro Carvalho Chehab" , Heiko =?UTF-8?B?U3TDvGJuZXI=?= , "Nathan Chancellor" , "Hans Verkuil" , "Nick Desaulniers" , "Bill Wendling" , "Justin Stitt" , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH 1/2] media: rkvdec: reduce excessive stack usage in assemble_hw_pps() Message-ID: <20260202224537.16c16e13@pumpkin> In-Reply-To: <070cebc8-3cab-4f32-a203-9456506dfcc5@app.fastmail.com> References: <20260202094804.1231706-1-arnd@kernel.org> <16baade123f563ea92e6117bf78c56e8617daf14.camel@collabora.com> <3b89635f-1c1c-4e4e-b0a9-2bbd0f21bc90@app.fastmail.com> <070cebc8-3cab-4f32-a203-9456506dfcc5@app.fastmail.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) 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-Transfer-Encoding: 7bit On Mon, 02 Feb 2026 16:59:05 +0100 "Arnd Bergmann" wrote: ... > - Since most of the fields are exactly 6 bits offset from a word > boundary, you can try assembling all the *_field_order_cnt* > fields in an array first that has all the bits in the correct > order, but then shift the entire array six bits. How are they being written to the hardware? It would be very unusual for hardware not to have things 'reasonably aligned'. This makes me think that the data buffer is actually being 'bit-bashed' down some serial data interface. In which case the simple solution is to give the function that writes the data a 'bit offset' for the first word. And to re-iterate C bit-fields are completely non portable and entirely inappropriate for mapping onto device registers. You can use C structures (arranged with everything on its natural boundary so there are no holes) with members declared with the correct endianness. Indeed that is actually preferable to using numeric constants as the offsets are tied to the correct structure. David > > Arnd >