From: Andy Shevchenko <andy.shevchenko@gmail.com> To: Keiji Hayashibara <hayashibara.keiji@socionext.com> Cc: "Mark Brown" <broonie@kernel.org>, "Rob Herring" <robh+dt@kernel.org>, "Mark Rutland" <mark.rutland@arm.com>, "Yamada, Masahiro/山田 真弘" <yamada.masahiro@socionext.com>, linux-spi <linux-spi@vger.kernel.org>, "linux-arm Mailing List" <linux-arm-kernel@lists.infradead.org>, devicetree <devicetree@vger.kernel.org>, "Masami Hiramatsu" <masami.hiramatsu@linaro.org>, "Jassi Brar" <jaswinder.singh@linaro.org>, "Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>, "Hayashi, Kunihiko/林 邦彦" <hayashi.kunihiko@socionext.com> Subject: Re: [PATCH v2 2/2] spi: add SPI controller driver for UniPhier SoC Date: Thu, 26 Jul 2018 16:44:08 +0300 [thread overview] Message-ID: <CAHp75VfPozwBPpuP9HadSc2GVm7tbPpMxg+AtACZa9jzVGGT-Q@mail.gmail.com> (raw) In-Reply-To: <001b01d424c4$66e04230$34a0c690$@socionext.com> On Thu, Jul 26, 2018 at 12:38 PM, Keiji Hayashibara <hayashibara.keiji@socionext.com> wrote: >> > + /* check if requested speed is too small */ >> > + if (ckrat > SSI_MAX_CLK_DIVIDER) >> >> > + return -EINVAL; >> >> So, does this critical? > > If set the value to SSI_MAX_CLK_DIVIDER, the clock frequency will be set high. > I don't change it to high frequency, and it is daringly an error. > On the other hand, when changing to low frequency, I will change it automatically. No. My point is, if somehow user asks for that condition to be happened you bail out, while when using clamp_val() you may continue to work at maximum limit, though issue warning to user, for example. >> > + >> > + if (ckrat < SSI_MIN_CLK_DIVIDER) >> > + ckrat = SSI_MIN_CLK_DIVIDER; >> >> clamp_val() / max() ? > > I will modify it to use max(). See above. -- With Best Regards, Andy Shevchenko
WARNING: multiple messages have this Message-ID (diff)
From: andy.shevchenko@gmail.com (Andy Shevchenko) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 2/2] spi: add SPI controller driver for UniPhier SoC Date: Thu, 26 Jul 2018 16:44:08 +0300 [thread overview] Message-ID: <CAHp75VfPozwBPpuP9HadSc2GVm7tbPpMxg+AtACZa9jzVGGT-Q@mail.gmail.com> (raw) In-Reply-To: <001b01d424c4$66e04230$34a0c690$@socionext.com> On Thu, Jul 26, 2018 at 12:38 PM, Keiji Hayashibara <hayashibara.keiji@socionext.com> wrote: >> > + /* check if requested speed is too small */ >> > + if (ckrat > SSI_MAX_CLK_DIVIDER) >> >> > + return -EINVAL; >> >> So, does this critical? > > If set the value to SSI_MAX_CLK_DIVIDER, the clock frequency will be set high. > I don't change it to high frequency, and it is daringly an error. > On the other hand, when changing to low frequency, I will change it automatically. No. My point is, if somehow user asks for that condition to be happened you bail out, while when using clamp_val() you may continue to work at maximum limit, though issue warning to user, for example. >> > + >> > + if (ckrat < SSI_MIN_CLK_DIVIDER) >> > + ckrat = SSI_MIN_CLK_DIVIDER; >> >> clamp_val() / max() ? > > I will modify it to use max(). See above. -- With Best Regards, Andy Shevchenko
next prev parent reply other threads:[~2018-07-26 13:44 UTC|newest] Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-07-26 7:09 [PATCH v2 0/2] add SPI controller driver for UniPhier SoCs Keiji Hayashibara 2018-07-26 7:09 ` Keiji Hayashibara 2018-07-26 7:09 ` [PATCH v2 1/2] dt-bindings: spi: add DT bindings for UniPhier SPI controller Keiji Hayashibara 2018-07-26 7:09 ` Keiji Hayashibara 2018-07-30 21:47 ` Rob Herring 2018-07-30 21:47 ` Rob Herring 2018-07-30 23:44 ` Keiji Hayashibara 2018-07-30 23:44 ` Keiji Hayashibara 2018-07-26 7:09 ` [PATCH v2 2/2] spi: add SPI controller driver for UniPhier SoC Keiji Hayashibara 2018-07-26 7:09 ` Keiji Hayashibara 2018-07-26 8:46 ` Andy Shevchenko 2018-07-26 8:46 ` Andy Shevchenko 2018-07-26 9:38 ` Keiji Hayashibara 2018-07-26 9:38 ` Keiji Hayashibara 2018-07-26 10:57 ` Radu Pirea 2018-07-26 10:57 ` Radu Pirea 2018-07-30 1:15 ` Keiji Hayashibara 2018-07-30 1:15 ` Keiji Hayashibara 2018-07-30 1:15 ` Keiji Hayashibara 2018-07-26 13:44 ` Andy Shevchenko [this message] 2018-07-26 13:44 ` Andy Shevchenko 2018-07-30 1:46 ` Keiji Hayashibara 2018-07-30 1:46 ` Keiji Hayashibara 2018-07-26 17:01 ` Trent Piepho 2018-07-26 17:01 ` Trent Piepho 2018-07-26 17:01 ` Trent Piepho 2018-07-30 5:30 ` Keiji Hayashibara 2018-07-30 5:30 ` Keiji Hayashibara 2018-07-30 5:30 ` Keiji Hayashibara 2018-07-30 8:39 ` Andy Shevchenko 2018-07-30 8:39 ` Andy Shevchenko 2018-07-26 9:12 ` Masahiro Yamada 2018-07-26 9:12 ` Masahiro Yamada 2018-07-26 9:49 ` Keiji Hayashibara 2018-07-26 9:49 ` Keiji Hayashibara
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=CAHp75VfPozwBPpuP9HadSc2GVm7tbPpMxg+AtACZa9jzVGGT-Q@mail.gmail.com \ --to=andy.shevchenko@gmail.com \ --cc=broonie@kernel.org \ --cc=devicetree@vger.kernel.org \ --cc=hayashi.kunihiko@socionext.com \ --cc=hayashibara.keiji@socionext.com \ --cc=jaswinder.singh@linaro.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-spi@vger.kernel.org \ --cc=mark.rutland@arm.com \ --cc=masami.hiramatsu@linaro.org \ --cc=robh+dt@kernel.org \ --cc=yamada.masahiro@socionext.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.