Messages in this thread | | | Date | Fri, 8 Jul 2022 00:54:43 +0530 | Subject | Re: [V2] tty: serial: qcom-geni-serial: Fix get_clk_div_rate() which otherwise could return a sub-optimal clock rate. | From | Vijaya Krishna Nivarthi <> |
| |
On 7/6/2022 11:51 PM, Doug Anderson wrote: > Hi, > > On Wed, Jul 6, 2022 at 10:44 AM Vijaya Krishna Nivarthi > <quic_vnivarth@quicinc.com> wrote: >> Hi, >> >> >> On 7/6/2022 8:56 PM, Doug Anderson wrote: >>> Hi, >>> >>> On Mon, Jul 4, 2022 at 11:57 AM Vijaya Krishna Nivarthi (Temp) >>> <vnivarth@qti.qualcomm.com> wrote: >>>> Hi, >>>> >>>> >>>>> -----Original Message----- >>>>> From: Doug Anderson <dianders@chromium.org> >>>>> Sent: Friday, July 1, 2022 8:38 PM >>>>> To: Vijaya Krishna Nivarthi (Temp) (QUIC) <quic_vnivarth@quicinc.com> >>>>> Cc: Andy Gross <agross@kernel.org>; bjorn.andersson@linaro.org; Konrad >>>>> Dybcio <konrad.dybcio@somainline.org>; Greg Kroah-Hartman >>>>> <gregkh@linuxfoundation.org>; Jiri Slaby <jirislaby@kernel.org>; linux-arm- >>>>> msm <linux-arm-msm@vger.kernel.org>; linux-serial@vger.kernel.org; LKML >>>>> <linux-kernel@vger.kernel.org>; Mukesh Savaliya (QUIC) >>>>> <quic_msavaliy@quicinc.com>; Matthias Kaehlcke <mka@chromium.org>; >>>>> Stephen Boyd <swboyd@chromium.org> >>>>> Subject: Re: [V2] tty: serial: qcom-geni-serial: Fix get_clk_div_rate() which >>>>> otherwise could return a sub-optimal clock rate. >>>>> >>>>> WARNING: This email originated from outside of Qualcomm. Please be wary >>>>> of any links or attachments, and do not enable macros. >>>>> >>>>> Hi, >>>>> >>>>> On Fri, Jul 1, 2022 at 4:04 AM Vijaya Krishna Nivarthi (Temp) (QUIC) >>>>> <quic_vnivarth@quicinc.com> wrote: >>>>> > Ah, you are correct. So just: > > div = DIV_ROUND_UP(freq, desired_clk); > > ...because freq _has_ to be greater than mult. If it was < "mult - > offset" we would have ended the loop. If it was between "mult - > offset" and "mult + offset" (inclusive) then we would have success. So > freq must be > "mult + offset" at the end of the loop. > > -Doug
Thank you, uploaded V3.
| |