From: Lee Jones <lee.jones@linaro.org>
To: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Cc: gwendal@chromium.org, gregkh@linuxfoundation.org,
linux-kernel@vger.kernel.org, groeck@chromium.org,
kernel@collabora.com, bleung@chromium.org, dtor@google.com,
stable@vger.kernel.org
Subject: Re: [PATCH] Revert "mfd: cros_ec: Use devm_kzalloc for private data"
Date: Wed, 5 Dec 2018 10:05:44 +0000 [thread overview]
Message-ID: <20181205100544.GB26661@dell> (raw)
In-Reply-To: <20181204155843.11411-1-enric.balletbo@collabora.com>
On Tue, 04 Dec 2018, Enric Balletbo i Serra wrote:
> This reverts commit 3aa2177e47878f7e7616da8a2050c44f22301b6e.
>
> That commit triggered a new WARN when unloading the module (see at the
> end of the commit message). When a class_dev is embedded in a structure
> then that class_dev is the thing that controls the lifetime of that
> structure, for that reason device managed allocations can't be used here.
> See Documentation/kobject.txt.
>
> Revert the above patch, so the struct is allocated using kzalloc and we
> have a release function for it that frees the allocated memory, otherwise
> it is broken.
>
> ------------[ cut here ]------------
> Device 'cros_ec' does not have a release() function, it is broken and must be fixed.
> WARNING: CPU: 3 PID: 3675 at drivers/base/core.c:895 device_release+0x80/0x90
> Modules linked in: btusb btrtl btintel btbcm bluetooth ...
> CPU: 3 PID: 3675 Comm: rmmod Not tainted 4.20.0-rc4 #76
> Hardware name: Google Kevin (DT)
> pstate: 40000005 (nZcv daif -PAN -UAO)
> pc : device_release+0x80/0x90
> lr : device_release+0x80/0x90
> sp : ffff00000c47bc70
> x29: ffff00000c47bc70 x28: ffff8000e86b0d40
> x27: 0000000000000000 x26: 0000000000000000
> x25: 0000000056000000 x24: 0000000000000015
> x23: ffff8000f0bbf860 x22: ffff000000d320a0
> x21: ffff8000ee93e100 x20: ffff8000ed931428
> x19: ffff8000ed931418 x18: 0000000000000020
> x17: 0000000000000000 x16: 0000000000000000
> x15: 0000000000000400 x14: 0000000000000143
> x13: 0000000000000000 x12: 0000000000000400
> x11: 0000000000000157 x10: 0000000000000960
> x9 : ffff00000c47b9b0 x8 : ffff8000e86b1700
> x7 : 0000000000000000 x6 : ffff8000f7d520b8
> x5 : ffff8000f7d520b8 x4 : 0000000000000000
> x3 : ffff8000f7d58e68 x2 : ffff8000e86b0d40
> x1 : 37d859939c964800 x0 : 0000000000000000
> Call trace:
> device_release+0x80/0x90
> kobject_put+0x74/0xe8
> device_unregister+0x20/0x30
> ec_device_remove+0x34/0x48 [cros_ec_dev]
> platform_drv_remove+0x28/0x48
> device_release_driver_internal+0x1a8/0x240
> driver_detach+0x40/0x80
> bus_remove_driver+0x54/0xa8
> driver_unregister+0x2c/0x58
> platform_driver_unregister+0x10/0x18
> cros_ec_dev_exit+0x1c/0x2d8 [cros_ec_dev]
> __arm64_sys_delete_module+0x16c/0x1f8
> el0_svc_common+0x84/0xd8
> el0_svc_handler+0x2c/0x80
> el0_svc+0x8/0xc
> ---[ end trace a57c4625f3c60ae8 ]---
>
> Cc: stable@vger.kernel.org
> Fixes: 3aa2177e4787 ("mfd: cros_ec: Use devm_kzalloc for private data")
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> ---
>
> drivers/mfd/cros_ec_dev.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
Applied, thanks.
--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
prev parent reply other threads:[~2018-12-05 10:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-04 15:58 [PATCH] Revert "mfd: cros_ec: Use devm_kzalloc for private data" Enric Balletbo i Serra
2018-12-04 16:07 ` Guenter Roeck
2018-12-04 16:13 ` Dmitry Torokhov
2018-12-05 10:05 ` Lee Jones [this message]
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=20181205100544.GB26661@dell \
--to=lee.jones@linaro.org \
--cc=bleung@chromium.org \
--cc=dtor@google.com \
--cc=enric.balletbo@collabora.com \
--cc=gregkh@linuxfoundation.org \
--cc=groeck@chromium.org \
--cc=gwendal@chromium.org \
--cc=kernel@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox