From: Dave Hansen <dave.hansen@intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
Jani Nikula <jani.nikula@linux.intel.com>,
David Airlie <airlied@linux.ie>,
intel-gfx <intel-gfx@lists.freedesktop.org>,
dri-devel <dri-devel@lists.freedesktop.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [Intel-gfx] 4.10-rc2 oops in DRM connector code
Date: Mon, 9 Jan 2017 09:22:52 -0800 [thread overview]
Message-ID: <4893e899-eb31-0f73-b2dc-81d13e26cf76@intel.com> (raw)
In-Reply-To: <CAKMK7uGRX4xNzS5yVH+H3r1k_A_R91cEO8TOZEA93pPKTkOuYA@mail.gmail.com>
On 01/09/2017 08:59 AM, Daniel Vetter wrote:
> On Mon, Jan 9, 2017 at 5:50 PM, Dave Hansen <dave.hansen@intel.com> wrote:
>> On 01/09/2017 08:41 AM, Daniel Vetter wrote:
>>> On Mon, Jan 9, 2017 at 2:40 PM, Dave Hansen <dave.hansen@intel.com> wrote:
>>>> Well, now I found where the -2 comes from.
>>>> intel_dp_register_mst_connector() calls drm_connector_register(), which
>>>> fails to add the kobject (warning below). But, it does zero error
>>>> checking on the drm_connector_register() call and leaves the
>>>> partially-constructed connector in place.
>>>>
>>>> The next time some poor, hapless code goes and tries to do anything with
>>>> that kdev, they oops. I'm perplexed by this, though. The
>>>> drm_dp_mst_topology_cbs->register_connector just returns void. It seems
>>>> a bit goofy that it can't even _return_ failure.
>>>>
>>>> Is there some stable code to go back to here? Or, is there something
>>>> about my configuration that's unique? I really wonder why nobody else
>>>> is running into this.
>>>>
>>>> There's probably some other race going on here. This warning doesn't
>>>> happen on every boot.
>>> This smells more like the root-cause: Something goes wrong on boot
>>> that prevents connectors from properly registering, then we fall over
>>> later on. And the register callback is intentionally void, assuming
>>> that any prep work has been done earlier and that therefore the
>>> register step can't fail. Can you pls check whether the oops later on
>>> only happens together with this warning at boot, or whether they're
>>> not correlated?
>>
>> Looking through my logs, I can't find any instance of the oops without
>> the warning at boot. So I do think the later oops is entirely caused by
>> the issue warned about in early boot.
>
> Hm, I guess then we'd need to fix that boot-up warning. Can you try to
> figure out why it's unhappy? On a hunch it could be that we call
> drm_connector_register from the mst probe worker before the main
> driver load thread has reached the drm_dev_register call. A few printk
> to decide whether that's the case (plus a few boot-up tests to gather
> the statistics, sorry about that) would be real great.
>
> If that's inconclusive I'm again a bit low on ideas ...
I'll do that shortly. But, for now I can confirm that the failure is
precipitated by the !parent check in sysfs_create_dir_ns().
I also can't reproduce this if I build i915 as a module. It only
happens when built in.
> Jan 9 09:07:34 ray kernel: [ 1.400547] sysfs_create_dir_ns()::53 error: -2
> Jan 9 09:07:34 ray kernel: [ 1.400554] create_dir()::75 error: -2
> Jan 9 09:07:34 ray kernel: [ 1.400558] ------------[ cut here ]------------
> Jan 9 09:07:34 ray kernel: [ 1.400565] WARNING: CPU: 1 PID: 90 at lib/kobject.c:249 kobject_add_internal+0x273/0x320
> Jan 9 09:07:34 ray kernel: [ 1.400569] kobject_add_internal failed for card0-DP-3 (error: -2 parent: card0)
> Jan 9 09:07:34 ray kernel: [ 1.400572] Modules linked in:
> Jan 9 09:07:34 ray kernel: [ 1.400577] CPU: 1 PID: 90 Comm: kworker/1:2 Not tainted 4.10.0-rc3-dirty #61
> Jan 9 09:07:34 ray kernel: [ 1.400579] Hardware name: LENOVO 20F5S7V800/20F5S7V800, BIOS R02ET50W (1.23 ) 09/20/2016
> Jan 9 09:07:34 ray kernel: [ 1.400585] Workqueue: events_long drm_dp_mst_link_probe_work
> Jan 9 09:07:34 ray kernel: [ 1.400588] Call Trace:
> Jan 9 09:07:34 ray kernel: [ 1.400593] dump_stack+0x67/0x99
> Jan 9 09:07:34 ray kernel: [ 1.400598] __warn+0xd1/0xf0
> Jan 9 09:07:34 ray kernel: [ 1.400601] warn_slowpath_fmt+0x4f/0x60
> Jan 9 09:07:34 ray kernel: [ 1.400604] kobject_add_internal+0x273/0x320
> Jan 9 09:07:34 ray kernel: [ 1.400607] kobject_add+0x65/0xb0
> Jan 9 09:07:34 ray kernel: [ 1.400611] ? klist_init+0x31/0x40
> Jan 9 09:07:34 ray kernel: [ 1.400615] device_add+0x102/0x5d0
> Jan 9 09:07:34 ray kernel: [ 1.400619] ? kfree_const+0x22/0x30
> Jan 9 09:07:34 ray kernel: [ 1.400623] device_create_groups_vargs+0xd8/0x100
> Jan 9 09:07:34 ray kernel: [ 1.400626] device_create_with_groups+0x36/0x40
> Jan 9 09:07:34 ray kernel: [ 1.400631] ? drm_fb_helper_add_one_connector+0x57/0xd0
> Jan 9 09:07:34 ray kernel: [ 1.400636] ? kmem_cache_alloc_trace+0x1d2/0x1f0
> Jan 9 09:07:34 ray kernel: [ 1.400641] drm_sysfs_connector_add+0x60/0xe0
> Jan 9 09:07:34 ray kernel: [ 1.400645] drm_connector_register+0x21/0xc0
> Jan 9 09:07:34 ray kernel: [ 1.400649] intel_dp_register_mst_connector+0x41/0x50
> Jan 9 09:07:34 ray kernel: [ 1.400653] drm_dp_add_port+0x350/0x450
> Jan 9 09:07:34 ray kernel: [ 1.400657] ? rcu_early_boot_tests+0x1/0x10
> Jan 9 09:07:34 ray kernel: [ 1.400660] ? schedule_timeout+0x1cd/0x390
> Jan 9 09:07:34 ray kernel: [ 1.400664] ? __might_sleep+0x4a/0x90
> Jan 9 09:07:34 ray kernel: [ 1.400667] ? mutex_lock+0x25/0x50
> Jan 9 09:07:34 ray kernel: [ 1.400670] ? drm_dp_mst_wait_tx_reply+0x118/0x1e0
> Jan 9 09:07:34 ray kernel: [ 1.400673] ? prepare_to_wait_event+0x120/0x120
> Jan 9 09:07:34 ray kernel: [ 1.400675] drm_sysfs_connector_add() connector: ffff88040c778000 kdev: ffff88040ef15000
> Jan 9 09:07:34 ray kernel: [ 1.400681] ? drm_dp_check_mstb_guid+0x3d/0x120
> Jan 9 09:07:34 ray kernel: [ 1.400684] drm_dp_send_link_address+0x185/0x1f0
> Jan 9 09:07:34 ray kernel: [ 1.400688] drm_dp_check_and_send_link_address+0xad/0xc0
> Jan 9 09:07:34 ray kernel: [ 1.400691] drm_dp_mst_link_probe_work+0x57/0xa0
> Jan 9 09:07:34 ray kernel: [ 1.400694] process_one_work+0x14b/0x430
> Jan 9 09:07:34 ray kernel: [ 1.400697] worker_thread+0x12b/0x4a0
> Jan 9 09:07:34 ray kernel: [ 1.400700] kthread+0x10c/0x140
> Jan 9 09:07:34 ray kernel: [ 1.400703] ? process_one_work+0x430/0x430
> Jan 9 09:07:34 ray kernel: [ 1.400706] ? kthread_create_on_node+0x40/0x40
> Jan 9 09:07:34 ray kernel: [ 1.400709] ret_from_fork+0x27/0x40
> Jan 9 09:07:34 ray kernel: [ 1.400714] ---[ end trace 0009c9dc7b253d9c ]---
next prev parent reply other threads:[~2017-01-09 17:23 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-05 19:03 4.10-rc2 oops in DRM connector code Dave Hansen
2017-01-09 10:15 ` [Intel-gfx] " Daniel Vetter
2017-01-09 12:59 ` Dave Hansen
2017-01-09 13:40 ` Dave Hansen
2017-01-09 13:46 ` Dave Hansen
2017-01-09 16:41 ` Daniel Vetter
2017-01-09 16:50 ` Dave Hansen
2017-01-09 16:59 ` Daniel Vetter
2017-01-09 17:22 ` Dave Hansen [this message]
2017-01-09 19:34 ` Alex Deucher
2017-01-09 17:42 ` Dave Hansen
2017-01-10 10:31 ` Daniel Vetter
2017-01-10 16:52 ` Dave Hansen
2017-01-11 7:43 ` Daniel Vetter
2017-01-11 15:24 ` Dave Hansen
2017-01-11 15:39 ` Daniel Vetter
2017-01-11 16:16 ` Dave Hansen
2017-01-11 22:25 ` Daniel Vetter
2017-01-11 15:40 ` Chris Wilson
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=4893e899-eb31-0f73-b2dc-81d13e26cf76@intel.com \
--to=dave.hansen@intel.com \
--cc=airlied@linux.ie \
--cc=daniel.vetter@intel.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=linux-kernel@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;
as well as URLs for NNTP newsgroup(s).