From: Stephen Boyd <sboyd@codeaurora.org>
To: Tero Kristo <t-kristo@ti.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
Michael Turquette <mturquette@baylibre.com>,
Tony Lindgren <tony@atomide.com>, Keerthy <j-keerthy@ti.com>,
linux-omap@vger.kernel.org, linux-clk@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] clk: ti: divider: try to fix ti_clk_register_divider
Date: Fri, 21 Apr 2017 18:58:20 -0700 [thread overview]
Message-ID: <20170422015820.GZ7065@codeaurora.org> (raw)
In-Reply-To: <7f0c996e-df53-ffb7-2c02-2f7fa66d2b94@ti.com>
On 04/20, Tero Kristo wrote:
> On 19/04/17 20:44, Arnd Bergmann wrote:
> >The newly introduced function is entirely bogus as I found when looking
> >at this warning:
> >
> >drivers/clk/ti/divider.c: In function 'ti_clk_register_divider':
> >drivers/clk/ti/divider.c:460:8: error: 'reg' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> >
> >Treating a 'u32' variable as a structure leads to a stack overflow here,
> >and the register address we pass down is never initialized.
> >
> >As the code in its original form makes no sense, I can only guess what
> >the intention was, and change it to take the address from div->reg.ptr
> >instead.
>
> Actually, I believe the code you are fixing works before this commit:
>
> commit 6c0afb503937a12a8d20a805fcf263e31afa9871
> Author: Tero Kristo <t-kristo@ti.com>
> Date: Thu Feb 9 11:24:37 2017 +0200
>
> clk: ti: convert to use proper register definition for all accesses
>
>
> ... it attempted to convert all the register accesses to the new
> format and change the size of the clk_omap_reg in bulk but I missed
> converting this one. Previously the size of the clk_omap_reg
> definition was u32, but this was confusing and bug prone so I
> changed it.
>
> The failing piece of code is only executed for legacy boot mode
> OMAP3 right now, which could be potentially stripped out of the
> kernel already (I think Tony removed the support for non-DT boot
> OMAP3 boards already...?) This explains why I didn't notice the
> issue in my local testing either.
>
> >
> >Fixes: d96f774b2538 ("clk: ti: divider: add support for legacy divider init")
> >Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>
> So, this patch itself is fine, but the desc should be updated to
> reflect the above somehow.
>
> And the "Fixes:" line should be updated to point to the commit
> mentioned above also.
>
Waiting for Arnd to agree. I can also rename reg_setup to reg.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2017-04-22 1:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-19 17:44 [PATCH 1/2] clk: ti: divider: try to fix ti_clk_register_divider Arnd Bergmann
2017-04-19 17:44 ` [PATCH 2/2] clk: ti: fix building without legacy omap3 Arnd Bergmann
2017-04-20 15:25 ` Tero Kristo
2017-04-20 15:25 ` Tero Kristo
2017-04-22 2:23 ` Stephen Boyd
2017-04-19 20:05 ` [PATCH 1/2] clk: ti: divider: try to fix ti_clk_register_divider Tony Lindgren
2017-04-20 15:46 ` Tero Kristo
2017-04-20 15:46 ` Tero Kristo
2017-04-22 1:58 ` Stephen Boyd [this message]
2017-04-22 12:08 ` Arnd Bergmann
2017-04-28 18:36 ` Stephen Boyd
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=20170422015820.GZ7065@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=arnd@arndb.de \
--cc=j-keerthy@ti.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=t-kristo@ti.com \
--cc=tony@atomide.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: 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.