Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1460037 > unrolled thread
| Started by | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| First post | 2016-08-11 00:00 +0200 |
| Last post | 2016-08-11 08:40 +0200 |
| Articles | 5 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH 0/9] v4.8 build regressions Arnd Bergmann <arnd@arndb.de> - 2016-08-11 00:00 +0200
[PATCH 6/9] clocksource: kona: fix get_counter error handling Arnd Bergmann <arnd@arndb.de> - 2016-08-11 00:00 +0200
Re: [PATCH 6/9] clocksource: kona: fix get_counter error handling Ray Jui <ray.jui@broadcom.com> - 2016-08-11 02:10 +0200
Re: [PATCH 6/9] clocksource: kona: fix get_counter error handling Daniel Lezcano <daniel.lezcano@linaro.org> - 2016-08-16 15:20 +0200
Re: [PATCH 0/9] v4.8 build regressions Philipp Zabel <p.zabel@pengutronix.de> - 2016-08-11 08:40 +0200
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2016-08-11 00:00 +0200 |
| Subject | [PATCH 0/9] v4.8 build regressions |
| Message-ID | <s4JHz-2k9-9@gated-at.bofh.it> |
This is a set of patches to address build warnings and errors that have come up in linux-4.8 but that worked fine in v4.7. I've added the tinyconfig warning patch in there as well, which is not a regression but is something that shows up in the kernelci.org build bots. The other patches address issues that either came up in kernelci.org or in my randconfig test setup. I have three more fixes queued up in arm-soc/fixes that I plan to send as a pull request for -rc2 along with the other bugfixes. All patches have been posted before, but for some reason or another failed to make it into the merge window. I have updated the ones that were waiting for a new version from me now, the others are sent without modifications. Hopefully we can get them all merged into v4.8. Please pick up patches from the middle of the series if appropriate. Arnd Arnd Bergmann (7): kconfig: tinyconfig: provide whole choice blocks to avoid warnings dsa: mv88e6xxx: hide unused functions drm/mediatek: add COMMON_CLK dependency drm/mediatek: add CONFIG_OF dependency drm/mediatek: add ARM_SMCCC dependency clocksource: kona: fix get_counter error handling 8250/fintek: rename IRQ_MODE macro Geert Uytterhoeven (1): test/hash: Fix warning in two-dimensional array init George Spelvin (1): test/hash: Fix warning in preprocessor symbol evaluation arch/x86/configs/tiny.config | 2 ++ drivers/clocksource/bcm_kona_timer.c | 16 ++++++++++------ drivers/gpu/drm/mediatek/Kconfig | 3 +++ drivers/net/dsa/mv88e6xxx/chip.c | 2 ++ drivers/tty/serial/8250/8250_fintek.c | 4 ++-- kernel/configs/tiny.config | 8 ++++++++ lib/test_hash.c | 8 ++++---- 7 files changed, 31 insertions(+), 12 deletions(-) -- 2.9.0 Cc: Andrew Lunn <andrew@lunn.ch> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: David Airlie <airlied@linux.ie> Cc: dri-devel@lists.freedesktop.org Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: George Spelvin <linux@sciencehorizons.net> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Jiri Slaby <jslaby@suse.com> Cc: Ji-Ze Hong (Peter Hong) <hpeter+linux_kernel@gmail.com> Cc: Josh Triplett <josh@joshtriplett.org> Cc: kernel-build-reports@lists.linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: Matthias Brugger <matthias.bgg@gmail.com> Cc: netdev@vger.kernel.org Cc: Philipp Zabel <p.zabel@pengutronix.de> Cc: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Cc: x86@kernel.org
[toc] | [next] | [standalone]
| From | Arnd Bergmann <arnd@arndb.de> |
|---|---|
| Date | 2016-08-11 00:00 +0200 |
| Subject | [PATCH 6/9] clocksource: kona: fix get_counter error handling |
| Message-ID | <s4JHA-2k9-45@gated-at.bofh.it> |
| In reply to | #1460037 |
I could not figure out why, but gcc cannot prove that the
kona_timer_init function always initializes its two outputs,
and we get a warning for the use of the 'lsw' variable later,
which is obviously correct.
drivers/clocksource/bcm_kona_timer.c: In function 'kona_timer_init':
drivers/clocksource/bcm_kona_timer.c:119:13: error: 'lsw' may be used uninitialized in this function [-Werror=maybe-uninitialized]
Slightly reordering the loop makes the warning disappear, after
it becomes more obvious to the compiler that the loop is
always entered on the first iteration.
As pointed out by Ray Jui, there is a related problem in the
way we deal with the loop running into the limit, as we just
keep going there with an invalid counter data, so instead we
now propagate a -ETIMEDOUT result to the caller.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patchwork.kernel.org/patch/9174261/
---
Originally sent this as a warning fix only on June 13, this
version actually fixes the incorrect data problem.
---
drivers/clocksource/bcm_kona_timer.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/drivers/clocksource/bcm_kona_timer.c b/drivers/clocksource/bcm_kona_timer.c
index 7e3fd375a627..92f6e4deee74 100644
--- a/drivers/clocksource/bcm_kona_timer.c
+++ b/drivers/clocksource/bcm_kona_timer.c
@@ -66,10 +66,10 @@ static void kona_timer_disable_and_clear(void __iomem *base)
}
-static void
+static int
kona_timer_get_counter(void __iomem *timer_base, uint32_t *msw, uint32_t *lsw)
{
- int loop_limit = 4;
+ int loop_limit = 3;
/*
* Read 64-bit free running counter
@@ -83,18 +83,19 @@ kona_timer_get_counter(void __iomem *timer_base, uint32_t *msw, uint32_t *lsw)
* if new hi-word is equal to previously read hi-word then stop.
*/
- while (--loop_limit) {
+ do {
*msw = readl(timer_base + KONA_GPTIMER_STCHI_OFFSET);
*lsw = readl(timer_base + KONA_GPTIMER_STCLO_OFFSET);
if (*msw == readl(timer_base + KONA_GPTIMER_STCHI_OFFSET))
break;
- }
+ } while (--loop_limit);
if (!loop_limit) {
pr_err("bcm_kona_timer: getting counter failed.\n");
pr_err(" Timer will be impacted\n");
+ return -ETIMEDOUT;
}
- return;
+ return 0;
}
static int kona_timer_set_next_event(unsigned long clc,
@@ -112,8 +113,11 @@ static int kona_timer_set_next_event(unsigned long clc,
uint32_t lsw, msw;
uint32_t reg;
+ int ret;
- kona_timer_get_counter(timers.tmr_regs, &msw, &lsw);
+ ret = kona_timer_get_counter(timers.tmr_regs, &msw, &lsw);
+ if (ret)
+ return ret;
/* Load the "next" event tick value */
writel(lsw + clc, timers.tmr_regs + KONA_GPTIMER_STCM0_OFFSET);
--
2.9.0
[toc] | [prev] | [next] | [standalone]
| From | Ray Jui <ray.jui@broadcom.com> |
|---|---|
| Date | 2016-08-11 02:10 +0200 |
| Subject | Re: [PATCH 6/9] clocksource: kona: fix get_counter error handling |
| Message-ID | <s4LJn-3Od-1@gated-at.bofh.it> |
| In reply to | #1460039 |
Hi Arnd,
On 8/10/2016 2:54 PM, Arnd Bergmann wrote:
> I could not figure out why, but gcc cannot prove that the
> kona_timer_init function always initializes its two outputs,
> and we get a warning for the use of the 'lsw' variable later,
> which is obviously correct.
>
> drivers/clocksource/bcm_kona_timer.c: In function 'kona_timer_init':
> drivers/clocksource/bcm_kona_timer.c:119:13: error: 'lsw' may be used uninitialized in this function [-Werror=maybe-uninitialized]
>
> Slightly reordering the loop makes the warning disappear, after
> it becomes more obvious to the compiler that the loop is
> always entered on the first iteration.
>
> As pointed out by Ray Jui, there is a related problem in the
> way we deal with the loop running into the limit, as we just
> keep going there with an invalid counter data, so instead we
> now propagate a -ETIMEDOUT result to the caller.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Link: https://patchwork.kernel.org/patch/9174261/
> ---
> Originally sent this as a warning fix only on June 13, this
> version actually fixes the incorrect data problem.
> ---
> drivers/clocksource/bcm_kona_timer.c | 16 ++++++++++------
> 1 file changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/clocksource/bcm_kona_timer.c b/drivers/clocksource/bcm_kona_timer.c
> index 7e3fd375a627..92f6e4deee74 100644
> --- a/drivers/clocksource/bcm_kona_timer.c
> +++ b/drivers/clocksource/bcm_kona_timer.c
> @@ -66,10 +66,10 @@ static void kona_timer_disable_and_clear(void __iomem *base)
>
> }
>
> -static void
> +static int
> kona_timer_get_counter(void __iomem *timer_base, uint32_t *msw, uint32_t *lsw)
> {
> - int loop_limit = 4;
> + int loop_limit = 3;
>
> /*
> * Read 64-bit free running counter
> @@ -83,18 +83,19 @@ kona_timer_get_counter(void __iomem *timer_base, uint32_t *msw, uint32_t *lsw)
> * if new hi-word is equal to previously read hi-word then stop.
> */
>
> - while (--loop_limit) {
> + do {
> *msw = readl(timer_base + KONA_GPTIMER_STCHI_OFFSET);
> *lsw = readl(timer_base + KONA_GPTIMER_STCLO_OFFSET);
> if (*msw == readl(timer_base + KONA_GPTIMER_STCHI_OFFSET))
> break;
> - }
> + } while (--loop_limit);
> if (!loop_limit) {
> pr_err("bcm_kona_timer: getting counter failed.\n");
> pr_err(" Timer will be impacted\n");
> + return -ETIMEDOUT;
> }
>
> - return;
> + return 0;
> }
>
> static int kona_timer_set_next_event(unsigned long clc,
> @@ -112,8 +113,11 @@ static int kona_timer_set_next_event(unsigned long clc,
>
> uint32_t lsw, msw;
> uint32_t reg;
> + int ret;
>
> - kona_timer_get_counter(timers.tmr_regs, &msw, &lsw);
> + ret = kona_timer_get_counter(timers.tmr_regs, &msw, &lsw);
> + if (ret)
> + return ret;
>
> /* Load the "next" event tick value */
> writel(lsw + clc, timers.tmr_regs + KONA_GPTIMER_STCM0_OFFSET);
>
The change looks good to me! Thanks!
Acked-by: Ray Jui <ray.jui@broadcom.com>
[toc] | [prev] | [next] | [standalone]
| From | Daniel Lezcano <daniel.lezcano@linaro.org> |
|---|---|
| Date | 2016-08-16 15:20 +0200 |
| Subject | Re: [PATCH 6/9] clocksource: kona: fix get_counter error handling |
| Message-ID | <s6MrE-3zL-29@gated-at.bofh.it> |
| In reply to | #1460039 |
On 08/10/2016 11:54 PM, Arnd Bergmann wrote: > I could not figure out why, but gcc cannot prove that the > kona_timer_init function always initializes its two outputs, > and we get a warning for the use of the 'lsw' variable later, > which is obviously correct. > > drivers/clocksource/bcm_kona_timer.c: In function 'kona_timer_init': > drivers/clocksource/bcm_kona_timer.c:119:13: error: 'lsw' may be used uninitialized in this function [-Werror=maybe-uninitialized] > > Slightly reordering the loop makes the warning disappear, after > it becomes more obvious to the compiler that the loop is > always entered on the first iteration. > > As pointed out by Ray Jui, there is a related problem in the > way we deal with the loop running into the limit, as we just > keep going there with an invalid counter data, so instead we > now propagate a -ETIMEDOUT result to the caller. > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > Link: https://patchwork.kernel.org/patch/9174261/ Hi Arnd, I applied this patch as a fix. Thanks ! -- Daniel -- <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
[toc] | [prev] | [next] | [standalone]
| From | Philipp Zabel <p.zabel@pengutronix.de> |
|---|---|
| Date | 2016-08-11 08:40 +0200 |
| Message-ID | <s4RON-84G-11@gated-at.bofh.it> |
| In reply to | #1460037 |
Am Mittwoch, den 10.08.2016, 23:54 +0200 schrieb Arnd Bergmann: > This is a set of patches to address build warnings and errors that have > come up in linux-4.8 but that worked fine in v4.7. I've added the > tinyconfig warning patch in there as well, which is not a regression > but is something that shows up in the kernelci.org build bots. > The other patches address issues that either came up in kernelci.org > or in my randconfig test setup. > > I have three more fixes queued up in arm-soc/fixes that I plan > to send as a pull request for -rc2 along with the other bugfixes. > > All patches have been posted before, but for some reason or another > failed to make it into the merge window. I have updated the ones > that were waiting for a new version from me now, the others are > sent without modifications. > > Hopefully we can get them all merged into v4.8. Please pick up > patches from the middle of the series if appropriate. > > Arnd > > Arnd Bergmann (7): > kconfig: tinyconfig: provide whole choice blocks to avoid warnings > dsa: mv88e6xxx: hide unused functions > drm/mediatek: add COMMON_CLK dependency > drm/mediatek: add CONFIG_OF dependency > drm/mediatek: add ARM_SMCCC dependency I have picked up the three drm/mediatek patches. regards Philipp > clocksource: kona: fix get_counter error handling > 8250/fintek: rename IRQ_MODE macro > > Geert Uytterhoeven (1): > test/hash: Fix warning in two-dimensional array init > > George Spelvin (1): > test/hash: Fix warning in preprocessor symbol evaluation > > arch/x86/configs/tiny.config | 2 ++ > drivers/clocksource/bcm_kona_timer.c | 16 ++++++++++------ > drivers/gpu/drm/mediatek/Kconfig | 3 +++ > drivers/net/dsa/mv88e6xxx/chip.c | 2 ++ > drivers/tty/serial/8250/8250_fintek.c | 4 ++-- > kernel/configs/tiny.config | 8 ++++++++ > lib/test_hash.c | 8 ++++---- > 7 files changed, 31 insertions(+), 12 deletions(-)
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web