All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sagar Kadam <sagar.kadam@sifive.com>
To: u-boot@lists.denx.de
Subject: [PATCH v4 1/4] fu540: prci: add request and free clock handlers
Date: Thu, 25 Jun 2020 04:46:56 +0000	[thread overview]
Message-ID: <BN8PR13MB2611531401C7258E1C35B33799920@BN8PR13MB2611.namprd13.prod.outlook.com> (raw)
In-Reply-To: <CAEUhbmXEf5nLi+05P1KsfJ7v3T-M1DRq79aUGu31KqDp4nmSsw@mail.gmail.com>

Hi Bin,

> -----Original Message-----
> From: Bin Meng <bmeng.cn@gmail.com>
> Sent: Thursday, June 25, 2020 4:51 AM
> To: Sagar Kadam <sagar.kadam@sifive.com>
> Cc: U-Boot Mailing List <u-boot@lists.denx.de>; Rick Chen
> <rick@andestech.com>; Lukasz Majewski <lukma@denx.de>; Jagan Teki
> <jagan@amarulasolutions.com>; Pragnesh Patel
> <pragnesh.patel@sifive.com>; Anup Patel <anup.patel@wdc.com>; Simon
> Glass <sjg@chromium.org>; Sean Anderson <seanga2@gmail.com>
> Subject: Re: [PATCH v4 1/4] fu540: prci: add request and free clock handlers
> 
> [External Email] Do not click links or attachments unless you recognize the
> sender and know the content is safe
> 
> Hi Sagar,
> 
> On Wed, Jun 24, 2020 at 6:58 PM Sagar Kadam <sagar.kadam@sifive.com>
> wrote:
> >
> > Hi Bin,
> >
> > > -----Original Message-----
> > > From: Bin Meng <bmeng.cn@gmail.com>
> > > Sent: Wednesday, June 24, 2020 6:50 AM
> > > To: Sagar Kadam <sagar.kadam@sifive.com>
> > > Cc: U-Boot Mailing List <u-boot@lists.denx.de>; Rick Chen
> > > <rick@andestech.com>; Lukasz Majewski <lukma@denx.de>; Jagan Teki
> > > <jagan@amarulasolutions.com>; Pragnesh Patel
> > > <pragnesh.patel@sifive.com>; Anup Patel <anup.patel@wdc.com>;
> Simon
> > > Glass <sjg@chromium.org>; Sean Anderson <seanga2@gmail.com>
> > > Subject: Re: [PATCH v4 1/4] fu540: prci: add request and free clock
> handlers
> > >
> > > [External Email] Do not click links or attachments unless you recognize
> the
> > > sender and know the content is safe
> > >
> > > Hi Sagar,
> > >
> > > On Sun, Jun 21, 2020 at 9:10 PM Sagar Shrikant Kadam
> > > <sagar.kadam@sifive.com> wrote:
> > > >
> > > > Add clk_request handler to check if a valid clock is requested.
> > > > Here clk_free handler is added for debug purpose which will display
> > > > details of clock passed to clk_free.
> > > >
> > > > Signed-off-by: Sagar Shrikant Kadam <sagar.kadam@sifive.com>
> > > > Reviewed-by: Pragnesh Patel <Pragnesh.patel@sifive.com>
> > > > ---
> > > >  drivers/clk/sifive/fu540-prci.c | 21 +++++++++++++++++++++
> > > >  1 file changed, 21 insertions(+)
> > > >
> > > > diff --git a/drivers/clk/sifive/fu540-prci.c
> > > > b/drivers/clk/sifive/fu540-prci.c index fe6e0d4..9a9ff6b 100644
> > > > --- a/drivers/clk/sifive/fu540-prci.c
> > > > +++ b/drivers/clk/sifive/fu540-prci.c
> > > > @@ -686,6 +686,25 @@ static ulong sifive_fu540_prci_set_rate(struct
> clk
> > > *clk, ulong rate)
> > > >         return rate;
> > > >  }
> > > >
> > > > +static int sifive_fu540_prci_clk_request(struct clk *clk) {
> > > > +       debug("%s(clk=%p) (dev=%p, id=%lu)\n", __func__, clk, clk->dev,
> > > > +             clk->id);
> > > > +
> > > > +       if (clk->id >= ARRAY_SIZE(__prci_init_clocks))
> > > > +               return -EINVAL;
> > > > +
> > > > +       return 0;
> > > > +}
> > > > +
> > > > +static int sifive_fu540_prci_clk_free(struct clk *clk) {
> > > > +       debug("%s(clk=%p) (dev=%p, id=%lu)\n", __func__, clk, clk->dev,
> > > > +             clk->id);
> > > > +
> > > > +       return 0;
> > > > +}
> > >
> > > It seems these 2 routines do not actually do anything? Is this for
> debugging
> > > purposes?
> > >
> > The sifive_fu540_prci_clk_request will check if the clock requested is valid
> or not.
> > While the sifive_fu540_prci_clk_free function is just for debug.
> > Is it ok if I retain these in V5 or you have some other thought here.
> >
> 
> OK, but I suspect the parameter check in
> sifive_fu540_prci_clk_request() is not necessary too as currently the
> codes work well.
> 

Ok. In that case I will than drop the check in sifive_fu540_prci_clk_request()
and just keep the debug info.

Thanks & BR,
Sagar

> Regards,
> Bin

  reply	other threads:[~2020-06-25  4:46 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-21 13:10 [PATCH v4 0/4] update clock handler and proper cpu features Sagar Shrikant Kadam
2020-06-21 13:10 ` [PATCH v4 1/4] fu540: prci: add request and free clock handlers Sagar Shrikant Kadam
     [not found]   ` <752D002CFF5D0F4FA35C0100F1D73F3FA471B1E9@ATCPCS16.andestech.com>
2020-06-22  1:53     ` Rick Chen
2020-06-22  4:46       ` Sagar Kadam
2020-06-24  1:35         ` Rick Chen
2020-06-24  1:38           ` Bin Meng
2020-06-24  1:46             ` Rick Chen
2020-06-24  9:51               ` Sagar Kadam
2020-06-24  1:20   ` Bin Meng
2020-06-24 10:58     ` Sagar Kadam
2020-06-24 23:21       ` Bin Meng
2020-06-25  4:46         ` Sagar Kadam [this message]
2020-06-25  5:41           ` Sagar Kadam
2020-06-21 13:10 ` [PATCH v4 2/4] riscv: dts: hifive-unleashed-a00: add cpu aliases Sagar Shrikant Kadam
2020-06-24  1:21   ` Bin Meng
2020-06-24  6:53     ` Sagar Kadam
2020-06-21 13:10 ` [PATCH v4 3/4] riscv: cpu: fixes to display proper CPU features Sagar Shrikant Kadam
2020-06-24  1:26   ` Bin Meng
2020-06-24  1:46     ` Simon Glass
2020-06-21 13:10 ` [PATCH v4 4/4] riscv: cpu: check and append L1 cache to cpu features Sagar Shrikant Kadam
2020-06-24  1:28   ` Bin Meng
2020-06-24  6:37     ` Sagar Kadam
2020-06-24  1:15 ` [PATCH v4 0/4] update clock handler and proper " Bin Meng
2020-06-24  6:01   ` Sagar Kadam
2020-06-24  7:37     ` Bin Meng

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=BN8PR13MB2611531401C7258E1C35B33799920@BN8PR13MB2611.namprd13.prod.outlook.com \
    --to=sagar.kadam@sifive.com \
    --cc=u-boot@lists.denx.de \
    /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: link
Be 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.