Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1625100 > unrolled thread

Re: sun50i-a64-pinctrl WARN_ON drivers/base/dd.c:349

Started byTejun Heo <tj@kernel.org>
First post2017-04-18 09:30 +0200
Last post2017-04-18 13:00 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: sun50i-a64-pinctrl WARN_ON drivers/base/dd.c:349 Tejun Heo <tj@kernel.org> - 2017-04-18 09:30 +0200
    Re: sun50i-a64-pinctrl WARN_ON drivers/base/dd.c:349 Andre Przywara <andre.przywara@arm.com> - 2017-04-18 11:20 +0200
    Re: sun50i-a64-pinctrl WARN_ON drivers/base/dd.c:349 Icenowy Zheng <icenowy@aosc.io> - 2017-04-18 13:00 +0200

#1625100 — Re: sun50i-a64-pinctrl WARN_ON drivers/base/dd.c:349

FromTejun Heo <tj@kernel.org>
Date2017-04-18 09:30 +0200
SubjectRe: sun50i-a64-pinctrl WARN_ON drivers/base/dd.c:349
Message-ID<txvKi-3lc-15@gated-at.bofh.it>
Hello,

On Mon, Apr 03, 2017 at 12:48:16AM +0100, André Przywara wrote:
> So I see this problem easily now - on every boot - with an unpatched
> 4.11-rc3 kernel and the (arm64) defconfig on a Pine64 or BananaPi M64.
> I enabled devres.log and see that pinctrl probes early, but apparently
> gets deferred, pretty late actually (after 43 ADDs).
> 
> Now what sticks out from the sequence (see the attached log) is that
> there are two un-matches ADDs with a devm_kmalloc of size 0:
> sun50i-a64-pinctrl 1c20800.pinctrl: DEVRES ADD ffff80007bd84200
> devm_kzalloc_release (0 bytes)
> sun50i-a64-pinctrl 1c20800.pinctrl: DEVRES ADD ffff80007bd84100
> devm_kzalloc_release (0 bytes)
> 
> While all the other ADDs have a matching REL, those two have not. I
> guess it's due to the size being 0. Does that ring a bell?

AFAICS, 0 size allocs should be fine.

> Or is due to the fact that these two ADDs are after the RELs have
> already started, so at a point where the driver is already cleaned up?

But this sounds problematic to me.  So, these zero length allocations
are happening after release of the device is initiated?  Where are
they coming from?

Thanks.

-- 
tejun

[toc] | [next] | [standalone]


#1625175

FromAndre Przywara <andre.przywara@arm.com>
Date2017-04-18 11:20 +0200
Message-ID<txxsK-4oB-21@gated-at.bofh.it>
In reply to#1625100
Hi,

On 18/04/17 08:25, Tejun Heo wrote:
> Hello,
> 
> On Mon, Apr 03, 2017 at 12:48:16AM +0100, André Przywara wrote:
>> So I see this problem easily now - on every boot - with an unpatched
>> 4.11-rc3 kernel and the (arm64) defconfig on a Pine64 or BananaPi M64.
>> I enabled devres.log and see that pinctrl probes early, but apparently
>> gets deferred, pretty late actually (after 43 ADDs).
>>
>> Now what sticks out from the sequence (see the attached log) is that
>> there are two un-matches ADDs with a devm_kmalloc of size 0:
>> sun50i-a64-pinctrl 1c20800.pinctrl: DEVRES ADD ffff80007bd84200
>> devm_kzalloc_release (0 bytes)
>> sun50i-a64-pinctrl 1c20800.pinctrl: DEVRES ADD ffff80007bd84100
>> devm_kzalloc_release (0 bytes)
>>
>> While all the other ADDs have a matching REL, those two have not. I
>> guess it's due to the size being 0. Does that ring a bell?
> 
> AFAICS, 0 size allocs should be fine.
> 
>> Or is due to the fact that these two ADDs are after the RELs have
>> already started, so at a point where the driver is already cleaned up?
> 
> But this sounds problematic to me.  So, these zero length allocations
> are happening after release of the device is initiated?  Where are
> they coming from?

Yeah, so I stack-dumped on the zero allocations and indeed they are
called from cleanup functions:
drivers/pinctrl/pinmux.c:pinmux_generic_free_functions():
	devm_kzalloc(sizeof(*indices) * pctldev->num_functions, ...)
(and another one I don't know from the top of the my head, logs at home)

So my hunch was that once EPROBE_DEFER triggers the devres cleanup, it
uses some reverse list traversal to release all allocated resources
(backwards!), so missing those which get (appended) during the process.
But I don't think that would not work with the locking.
So I have to dig deeper tonight in my logs.

Just curious why this does (or did) not happen for other users, because
the affected code paths seem rather generic to me.
Is that due to probing order being unfortunate in our case and the
pinctrl driver is never released due to DEFER anywhere else?

Cheers,
Andre.

[toc] | [prev] | [next] | [standalone]


#1625251

FromIcenowy Zheng <icenowy@aosc.io>
Date2017-04-18 13:00 +0200
Message-ID<txz1w-5bl-17@gated-at.bofh.it>
In reply to#1625100

于 2017年4月18日 GMT+08:00 下午3:25:05, Tejun Heo <tj@kernel.org> 写到:
>Hello,
>
>On Mon, Apr 03, 2017 at 12:48:16AM +0100, André Przywara wrote:
>> So I see this problem easily now - on every boot - with an unpatched
>> 4.11-rc3 kernel and the (arm64) defconfig on a Pine64 or BananaPi
>M64.
>> I enabled devres.log and see that pinctrl probes early, but
>apparently
>> gets deferred, pretty late actually (after 43 ADDs).
>> 
>> Now what sticks out from the sequence (see the attached log) is that
>> there are two un-matches ADDs with a devm_kmalloc of size 0:
>> sun50i-a64-pinctrl 1c20800.pinctrl: DEVRES ADD ffff80007bd84200
>> devm_kzalloc_release (0 bytes)
>> sun50i-a64-pinctrl 1c20800.pinctrl: DEVRES ADD ffff80007bd84100
>> devm_kzalloc_release (0 bytes)

P.S. mysteriously the warn disappeared in newest -next, but still exist in 4.11-rc.

>> 
>> While all the other ADDs have a matching REL, those two have not. I
>> guess it's due to the size being 0. Does that ring a bell?
>
>AFAICS, 0 size allocs should be fine.
>
>> Or is due to the fact that these two ADDs are after the RELs have
>> already started, so at a point where the driver is already cleaned
>up?
>
>But this sounds problematic to me.  So, these zero length allocations
>are happening after release of the device is initiated?  Where are
>they coming from?
>
>Thanks.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web