All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Philipp Rossak <embed3d@gmail.com>
Cc: wens@csie.org, a.zummo@towertech.it, maxime.ripard@bootlin.com,
	mturquette@baylibre.com, sboyd@codeaurora.org,
	linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com,
	linux-rtc@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v4] rtc: ac100: Fix ac100 determine rate bug
Date: Thu, 1 Mar 2018 10:59:44 +0100	[thread overview]
Message-ID: <20180301095944.GT1479@piout.net> (raw)
In-Reply-To: <20180226211901.9805-1-embed3d@gmail.com>

On 26/02/2018 at 22:19:01 +0100, Philipp Rossak wrote:
> This patch fixes a bug, that prevents the Allwinner A83T and the A80
> from a successful boot.
> 
> The bug is there since v4.16-rc1 and appeared after the clk branch was
> merged.
> 
> You can find the shortend trace below:
> 
> Unable to handle kernel NULL pointer dereference at virtual address
> 00000000
> pgd = (ptrval)
> [00000000] *pgd=00000000
> Internal error: Oops: 5 [#1] SMP ARM
> Modules linked in:
> CPU: 0 PID: 49 Comm: kworker/0:1 Not tainted 4.15.0-10190-gb89e32ccd1be #2
> Hardware name: Allwinner sun8i Family
> Workqueue: events deferred_probe_work_func
> PC is at clk_hw_get_rate+0x0/0x34
> LR is at ac100_clkout_determine_rate+0x48/0x19c
> 
> [ ... ]
> 
> (clk_hw_get_rate) from (ac100_clkout_determine_rate+0x48/0x19c)
> (ac100_clkout_determine_rate) from  (clk_core_set_rate_nolock+0x3c/0x1a0)
> (clk_core_set_rate_nolock) from (clk_set_rate+0x30/0x88)
> (clk_set_rate) from (of_clk_set_defaults+0x200/0x364)
> (of_clk_set_defaults) from (platform_drv_probe+0x18/0xb0)
> 
> To fix that bug, we first check if the return of the
> clk_hw_get_parent_by_index is non zero. If it is zero we skip that
> clock parent.
> 
> The BUG report could be found here: https://lkml.org/lkml/2018/2/10/198
> 
> Fixes: 04940631b8d2 ("rtc: ac100: Add clk output support")
> 
> Signed-off-by: Philipp Rossak <embed3d@gmail.com>
> ---
> 
> Changes in v4:
> 	* add more information to the comment
> Changes in v3:
> 	* add information when the bug appeared 
> 	* make the comment more clear
> Changes in v2:
> 	* add tag Fixes: ... to commit message
> 	* add comment to if statement why we are doing this check
> 
>  drivers/rtc/rtc-ac100.c | 24 +++++++++++++++++++++++-
>  1 file changed, 23 insertions(+), 1 deletion(-)
> 
Applied, thanks.

-- 
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

WARNING: multiple messages have this Message-ID (diff)
From: alexandre.belloni@bootlin.com (Alexandre Belloni)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4] rtc: ac100: Fix ac100 determine rate bug
Date: Thu, 1 Mar 2018 10:59:44 +0100	[thread overview]
Message-ID: <20180301095944.GT1479@piout.net> (raw)
In-Reply-To: <20180226211901.9805-1-embed3d@gmail.com>

On 26/02/2018 at 22:19:01 +0100, Philipp Rossak wrote:
> This patch fixes a bug, that prevents the Allwinner A83T and the A80
> from a successful boot.
> 
> The bug is there since v4.16-rc1 and appeared after the clk branch was
> merged.
> 
> You can find the shortend trace below:
> 
> Unable to handle kernel NULL pointer dereference at virtual address
> 00000000
> pgd = (ptrval)
> [00000000] *pgd=00000000
> Internal error: Oops: 5 [#1] SMP ARM
> Modules linked in:
> CPU: 0 PID: 49 Comm: kworker/0:1 Not tainted 4.15.0-10190-gb89e32ccd1be #2
> Hardware name: Allwinner sun8i Family
> Workqueue: events deferred_probe_work_func
> PC is at clk_hw_get_rate+0x0/0x34
> LR is at ac100_clkout_determine_rate+0x48/0x19c
> 
> [ ... ]
> 
> (clk_hw_get_rate) from (ac100_clkout_determine_rate+0x48/0x19c)
> (ac100_clkout_determine_rate) from  (clk_core_set_rate_nolock+0x3c/0x1a0)
> (clk_core_set_rate_nolock) from (clk_set_rate+0x30/0x88)
> (clk_set_rate) from (of_clk_set_defaults+0x200/0x364)
> (of_clk_set_defaults) from (platform_drv_probe+0x18/0xb0)
> 
> To fix that bug, we first check if the return of the
> clk_hw_get_parent_by_index is non zero. If it is zero we skip that
> clock parent.
> 
> The BUG report could be found here: https://lkml.org/lkml/2018/2/10/198
> 
> Fixes: 04940631b8d2 ("rtc: ac100: Add clk output support")
> 
> Signed-off-by: Philipp Rossak <embed3d@gmail.com>
> ---
> 
> Changes in v4:
> 	* add more information to the comment
> Changes in v3:
> 	* add information when the bug appeared 
> 	* make the comment more clear
> Changes in v2:
> 	* add tag Fixes: ... to commit message
> 	* add comment to if statement why we are doing this check
> 
>  drivers/rtc/rtc-ac100.c | 24 +++++++++++++++++++++++-
>  1 file changed, 23 insertions(+), 1 deletion(-)
> 
Applied, thanks.

-- 
Alexandre Belloni, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

  parent reply	other threads:[~2018-03-01  9:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-26 21:19 [PATCH v4] rtc: ac100: Fix ac100 determine rate bug Philipp Rossak
2018-02-26 21:19 ` Philipp Rossak
2018-02-27  9:09 ` Maxime Ripard
2018-02-27  9:09   ` Maxime Ripard
2018-03-01  9:59 ` Alexandre Belloni [this message]
2018-03-01  9:59   ` Alexandre Belloni

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=20180301095944.GT1479@piout.net \
    --to=alexandre.belloni@bootlin.com \
    --cc=a.zummo@towertech.it \
    --cc=embed3d@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@codeaurora.org \
    --cc=wens@csie.org \
    /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.