From: Mark Brown <broonie@kernel.org> To: Claudiu.Beznea@microchip.com Cc: jonathanh@nvidia.com, lgirdwood@gmail.com, s.hauer@pengutronix.de, ttynkkynen@nvidia.com, linus.walleij@linaro.org, axel.lin@ingics.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-tegra@vger.kernel.org Subject: Re: [PATCH v3 1/6] regulator: core: validate selector against linear_min_sel Date: Tue, 24 Nov 2020 14:11:36 +0000 [thread overview] Message-ID: <20201124141136.GD4933@sirena.org.uk> (raw) In-Reply-To: <f06c90ca-11c8-961d-1461-a9486933a1a3@microchip.com> [-- Attachment #1: Type: text/plain, Size: 1361 bytes --] On Tue, Nov 24, 2020 at 11:14:54AM +0000, Claudiu.Beznea@microchip.com wrote: > On 24.11.2020 11:36, Jon Hunter wrote: > > Before doing so, I wanted to ask if that is the correct fix here, > > because it seems a bit odd that regulator_count_voltages() returns N > > voltages, but if the min selector value is greater than 0, then actually > > there are less than N. However, changing the number of voltages > > supported by the regulator to be N - linear_min_sel does not make sense > > either because then we need to know the linear_min_sel in order to > > determine the first valid voltage. > I would say that a solution would be to have a new helper to retrieve the > linear_min_sel (e.g. regulator_min_sel()) and use this for all the > consumers of regulator_list_voltage() and the other APIs that patch > "regulator: core: validate selector against linear_min_sel" has changed > (regulator_list_voltage_table(), regulator_set_voltage_time()). With this > change the loop in find_vdd_map_entry_exact() should be b/w > regulator_min_sel() and regulator_count_voltages(). We need an incremental fix to return 0 rather than an error for things below the minimum selector, it's not invalid for there to be holes in the range of selectors and this is just an example of that. Consumers need to be able to cope with skipping over values that can't be mapped. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Mark Brown <broonie@kernel.org> To: Claudiu.Beznea@microchip.com Cc: axel.lin@ingics.com, linux-kernel@vger.kernel.org, s.hauer@pengutronix.de, lgirdwood@gmail.com, jonathanh@nvidia.com, ttynkkynen@nvidia.com, linux-tegra@vger.kernel.org, linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v3 1/6] regulator: core: validate selector against linear_min_sel Date: Tue, 24 Nov 2020 14:11:36 +0000 [thread overview] Message-ID: <20201124141136.GD4933@sirena.org.uk> (raw) In-Reply-To: <f06c90ca-11c8-961d-1461-a9486933a1a3@microchip.com> [-- Attachment #1.1: Type: text/plain, Size: 1361 bytes --] On Tue, Nov 24, 2020 at 11:14:54AM +0000, Claudiu.Beznea@microchip.com wrote: > On 24.11.2020 11:36, Jon Hunter wrote: > > Before doing so, I wanted to ask if that is the correct fix here, > > because it seems a bit odd that regulator_count_voltages() returns N > > voltages, but if the min selector value is greater than 0, then actually > > there are less than N. However, changing the number of voltages > > supported by the regulator to be N - linear_min_sel does not make sense > > either because then we need to know the linear_min_sel in order to > > determine the first valid voltage. > I would say that a solution would be to have a new helper to retrieve the > linear_min_sel (e.g. regulator_min_sel()) and use this for all the > consumers of regulator_list_voltage() and the other APIs that patch > "regulator: core: validate selector against linear_min_sel" has changed > (regulator_list_voltage_table(), regulator_set_voltage_time()). With this > change the loop in find_vdd_map_entry_exact() should be b/w > regulator_min_sel() and regulator_count_voltages(). We need an incremental fix to return 0 rather than an error for things below the minimum selector, it's not invalid for there to be holes in the range of selectors and this is just an example of that. Consumers need to be able to cope with skipping over values that can't be mapped. [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --] [-- Attachment #2: Type: text/plain, Size: 176 bytes --] _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-11-24 14:12 UTC|newest] Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-11-13 15:21 [PATCH v3 0/6] regulator: mcp16502: add support for ramp delay Claudiu Beznea 2020-11-13 15:21 ` Claudiu Beznea 2020-11-13 15:21 ` [PATCH v3 1/6] regulator: core: validate selector against linear_min_sel Claudiu Beznea 2020-11-13 15:21 ` Claudiu Beznea 2020-11-24 9:36 ` Jon Hunter 2020-11-24 9:36 ` Jon Hunter 2020-11-24 11:14 ` Claudiu.Beznea 2020-11-24 11:14 ` Claudiu.Beznea 2020-11-24 13:41 ` Jon Hunter 2020-11-24 13:41 ` Jon Hunter 2020-11-25 10:46 ` Claudiu.Beznea 2020-11-25 10:46 ` Claudiu.Beznea 2020-11-24 14:11 ` Mark Brown [this message] 2020-11-24 14:11 ` Mark Brown 2020-11-25 11:34 ` [PATCH] regulator: core: return zero for selectors lower than linear_min_sel Claudiu Beznea 2020-11-25 11:34 ` Claudiu Beznea 2020-11-25 17:03 ` Mark Brown 2020-11-25 17:03 ` Mark Brown 2020-11-13 15:21 ` [PATCH v3 2/6] regulator: core: do not continue if selector match Claudiu Beznea 2020-11-13 15:21 ` Claudiu Beznea 2020-11-13 16:11 ` Mark Brown 2020-11-13 16:11 ` Mark Brown 2020-11-13 15:21 ` [PATCH v3 3/6] regulator: mcp16502: add linear_min_sel Claudiu Beznea 2020-11-13 15:21 ` Claudiu Beznea 2020-11-13 15:21 ` [PATCH v3 4/6] regulator: mcp16502: adapt for get/set on other registers Claudiu Beznea 2020-11-13 15:21 ` Claudiu Beznea 2020-11-13 15:21 ` [PATCH v3 5/6] regulator: mcp16502: add support for ramp delay Claudiu Beznea 2020-11-13 15:21 ` Claudiu Beznea 2020-11-13 15:21 ` [PATCH v3 6/6] regulator: mcp16502: remove void documentation of struct mcp16502 Claudiu Beznea 2020-11-13 15:21 ` Claudiu Beznea 2020-11-13 17:14 ` [PATCH v3 0/6] regulator: mcp16502: add support for ramp delay Mark Brown 2020-11-13 17:14 ` Mark Brown 2020-12-01 13:57 ` Mark Brown 2020-12-01 13:57 ` Mark Brown
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20201124141136.GD4933@sirena.org.uk \ --to=broonie@kernel.org \ --cc=Claudiu.Beznea@microchip.com \ --cc=axel.lin@ingics.com \ --cc=jonathanh@nvidia.com \ --cc=lgirdwood@gmail.com \ --cc=linus.walleij@linaro.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-tegra@vger.kernel.org \ --cc=s.hauer@pengutronix.de \ --cc=ttynkkynen@nvidia.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.