Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4441759pxb; Tue, 5 Oct 2021 03:14:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHrNEWXs8J07bD+uKa90obH0nCJRbdAiWfE18dKyB2A+Ww41wwq/eCAz8N9OYWQdenvd3A X-Received: by 2002:a17:902:7ec2:b0:13d:b563:c39 with SMTP id p2-20020a1709027ec200b0013db5630c39mr4529612plb.14.1633428875880; Tue, 05 Oct 2021 03:14:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633428875; cv=none; d=google.com; s=arc-20160816; b=0FZrNVNKlqoK8e3330c2ftMnLKaK94qvg5+1BNx5225nZgIXzPq6hYiVI6BN1gdrU9 HLecrmyB/zNwNv42y+ctRkuIw01mXIwaMy1A4w32aa4qvt8tSv/s6AaWX5nC6bK0cq+U 6tldVxEMiszZVRmhYh543NcMUxWY6XDQB8YOfd3HDpMAtm2grVYCiXOZBRO5wR4+juEs XaRx5YGf+58q6/fHIIqlZrmvn5aU+FScjYbXNUVc6j8TJHxITwofu/zekTHwfr7l0HGq U3/299Dj/96Wk52wfTSrmVcbLcV8NlXuJkT+Cpbqs10RfzibpLzBhDOomiQEoQdudUAO OS/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date; bh=8etk5KTnfGF3Xz5jU4ccgcIoA2Q6oNF7dAXJvVIIxdY=; b=VGTZVHuCFumc1qYcEiGwGmE9f6utAYFGrInbSOa0EUtEjRXlAjroXMs5Qp9kkw13aw K5x0MY5f12bI+xJ/BZpozHI/cQGjNxpm99zTet9CtPOZihkEJvpBr40SgGZipllVdS1/ y868/0TPlV90uPqBpREdrhM1EkOVzrq9ZQ/5jQghjplSrofd59ZffkbH2ryk1Apam82m QS3z36xHSLzB0xUfUDOMWkrsNNuMuBuEY0KeuFktY2bMcHwfxt6B3/lrjCE22O3IFdQq t9QnWCpS+6muOvKNuiOz6KJ9k8AS1dnPMp/EcG/bfMQ3G53ixHgFLWaXrI3Zdzm9zNs0 EHdA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d9si1548839pjd.15.2021.10.05.03.14.20; Tue, 05 Oct 2021 03:14:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233930AbhJEKOi (ORCPT + 99 others); Tue, 5 Oct 2021 06:14:38 -0400 Received: from m-r2.th.seeweb.it ([5.144.164.171]:48245 "EHLO m-r2.th.seeweb.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233077AbhJEKOX (ORCPT ); Tue, 5 Oct 2021 06:14:23 -0400 Received: from SoMainline.org (94-209-165-62.cable.dynamic.v4.ziggo.nl [94.209.165.62]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r2.th.seeweb.it (Postfix) with ESMTPSA id E09AC3F0AC; Tue, 5 Oct 2021 12:12:31 +0200 (CEST) Date: Tue, 5 Oct 2021 12:12:30 +0200 From: Marijn Suijten To: Daniel Thompson Cc: phone-devel@vger.kernel.org, Andy Gross , Bjorn Andersson , Lee Jones , Jingoo Han , ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno , Konrad Dybcio , Martin Botka , Jami Kettunen , Pavel Dubrova , Kiran Gunda , Courtney Cavin , Bryan Wu , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 09/10] backlight: qcom-wled: Consistently use enabled-strings in set_brightness Message-ID: <20211005101230.sp2ldu3gfvh5eiit@SoMainline.org> Mail-Followup-To: Daniel Thompson , phone-devel@vger.kernel.org, Andy Gross , Bjorn Andersson , Lee Jones , Jingoo Han , ~postmarketos/upstreaming@lists.sr.ht, AngeloGioacchino Del Regno , Konrad Dybcio , Martin Botka , Jami Kettunen , Pavel Dubrova , Kiran Gunda , Courtney Cavin , Bryan Wu , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20211004192741.621870-1-marijn.suijten@somainline.org> <20211004192741.621870-10-marijn.suijten@somainline.org> <20211005093331.4houxsc5b6lfzmbz@maple.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211005093331.4houxsc5b6lfzmbz@maple.lan> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-10-05 10:33:31, Daniel Thompson wrote: > On Mon, Oct 04, 2021 at 09:27:40PM +0200, Marijn Suijten wrote: > > The hardware is capable of controlling any non-contiguous sequence of > > LEDs specified in the DT using qcom,enabled-strings as u32 > > array, and this also follows from the DT-bindings documentation. The > > numbers specified in this array represent indices of the LED strings > > that are to be enabled and disabled. > > > > Its value is appropriately used to setup and enable string modules, but > > completely disregarded in the set_brightness paths which only iterate > > over the number of strings linearly. > > Take an example where only string 2 is enabled with > > qcom,enabled_strings=<2>: this string is appropriately enabled but > > subsequent brightness changes would have only touched the zero'th > > brightness register because num_strings is 1 here. This is simply > > addressed by looking up the string for this index in the enabled_strings > > array just like the other codepaths that iterate over num_strings. > > This isn't true until patch 10 is applied! Patch 9 and 10 were split up at a last resort to prevent a clash in the title, apologies for that. > Given both patches fix the same issue in different functions I'd prefer > these to be squashed together (and doubly so because the autodetect code > uses set_brightness() as a helper function). That's a fair reason, and solution I agree on. I'll figure out how to generify the title and re-spin this patchset except if there are other reviewers/maintainers I should wait for. - Marijn > Daniel.