From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752661AbcDOQVq (ORCPT ); Fri, 15 Apr 2016 12:21:46 -0400 Received: from mga11.intel.com ([192.55.52.93]:17357 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752357AbcDOQVn convert rfc822-to-8bit (ORCPT ); Fri, 15 Apr 2016 12:21:43 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,488,1455004800"; d="scan'208";a="933257057" From: "Moore, Robert" To: Mika Westerberg , Prarit Bhargava CC: "linux-kernel@vger.kernel.org" , "Zheng, Lv" , "Wysocki, Rafael J" , "Len Brown" , "linux-acpi@vger.kernel.org" , "devel@acpica.org" Subject: RE: [PATCH] acpi/acpica: fix Thunderbolt hotplug Thread-Topic: [PATCH] acpi/acpica: fix Thunderbolt hotplug Thread-Index: AQHRluoIkWSV2KoTJESJeB6MrRXVWJ+LN8aQ Date: Fri, 15 Apr 2016 16:21:41 +0000 Message-ID: <94F2FBAB4432B54E8AACC7DFDE6C92E37E474F3C@ORSMSX110.amr.corp.intel.com> References: <1459291540-8746-1-git-send-email-prarit@redhat.com> <20160415073950.GC1714@lahna.fi.intel.com> In-Reply-To: <20160415073950.GC1714@lahna.fi.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjZkMjkzNzgtZDRiNC00OGIyLWEyMmEtMmNlNzRkNGI2N2JhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6ImtiQ0VoRzVEYkZZYTBCYXUxa2FBcUFjcCtTdUlNaTN3YkdBNStyYldrODA9In0= x-ctpclassification: CTP_IC x-originating-ip: [10.22.254.140] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Lv is looking at it. He has already commented that this might not be the best solution, so he is continuing to investigate. > -----Original Message----- > From: Mika Westerberg [mailto:mika.westerberg@linux.intel.com] > Sent: Friday, April 15, 2016 12:40 AM > To: Prarit Bhargava > Cc: linux-kernel@vger.kernel.org; Moore, Robert; Zheng, Lv; Wysocki, > Rafael J; Len Brown; linux-acpi@vger.kernel.org; devel@acpica.org > Subject: Re: [PATCH] acpi/acpica: fix Thunderbolt hotplug > > Bob, Rafael, any comments about this? > > This seems to solve a real issue with Thunderbolt hotplug on Dell XPS > laptops. I do not know ACPICA that well to tell if this is 100% correct > fix but many reporters say it fixes the problem they are facing: > > https://bugzilla.kernel.org/show_bug.cgi?id=115121 > > On Tue, Mar 29, 2016 at 06:45:40PM -0400, Prarit Bhargava wrote: > > The following hung task trace is seen when hotplugging an ethernet > > dongle in a Thunderbolt port on Linux. > > > > INFO: task kworker/0:4:1468 blocked for more than 120 seconds. > > Tainted: G W 4.6.0-rc1+ #1 > > "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this > message. > > kworker/0:4 D ffff8802a265ba38 13344 1468 2 0x00000000 > > Workqueue: kacpid acpi_os_execute_deferred > > ffff8802a265ba38 ffff8802a265ba00 ffffffff81130200 ffffffff81e0d580 > > ffff88029e5eb340 ffff8802a265c000 ffff88029d69d000 ffff88029e5eb340 > > ffffffff818c1b8d ffff8802b64e8758 ffff8802a265ba50 ffffffff818bdfcc > > Call Trace: > > [] ? test_callback+0x10/0x30 [] > > ? __down_timeout+0x5d/0xd0 [] schedule+0x3c/0x90 > > [] schedule_timeout+0x210/0x360 > > [] ? sched_clock+0x9/0x10 [] ? > > local_clock+0x1c/0x20 [] ? > > mark_held_locks+0x76/0xa0 [] ? > > _raw_spin_unlock_irq+0x2c/0x40 [] ? > > __down_timeout+0x5d/0xd0 [] ? > > trace_hardirqs_on_caller+0xf5/0x1b0 > > [] ? __down_timeout+0x5d/0xd0 [] > > __down_timeout+0x7c/0xd0 [] ? > > _raw_spin_lock_irqsave+0x82/0x90 [] > > down_timeout+0x4c/0x60 [] > > acpi_os_wait_semaphore+0xaa/0x16a [] > > acpi_ex_system_wait_mutex+0x81/0xfa > > [] acpi_ds_begin_method_execution+0x25a/0x373 > > [] acpi_ds_call_control_method+0x107/0x2e0 > > [] acpi_ps_parse_aml+0x177/0x495 > > [] acpi_ps_execute_method+0x1f7/0x2b9 > > [] acpi_ns_evaluate+0x2ee/0x435 > > [] acpi_ev_asynch_execute_gpe_method+0xbd/0x159 > > [] acpi_os_execute_deferred+0x17/0x23 > > [] process_one_work+0x242/0x700 > > [] ? process_one_work+0x1ba/0x700 > > [] worker_thread+0x4e/0x490 [] ? > > process_one_work+0x700/0x700 [] ? > > process_one_work+0x700/0x700 [] kthread+0x101/0x120 > > [] ? trace_hardirqs_on_caller+0xf5/0x1b0 > > [] ret_from_fork+0x22/0x50 [] ? > > kthread_create_on_node+0x250/0x250 > > 2 locks held by kworker/0:4/1468: > > #0: ("kacpid"){.+.+.+}, at: [] > > process_one_work+0x1ba/0x700 > > #1: ((&dpc->work)){+.+.+.}, at: [] > > process_one_work+0x1ba/0x700 > > > > The issue appears to be that the kworker thread attempts to acquire > > the > > _E42 method's mutex twice when executing acpi_ps_execute_method() and > > recursing through the entry method. > > > > The current code does take the possiblity of this recursion into > > account, however, it is only for the case where the walk_state has been > populated. > > > > This can be fixed by setting the thread id in the !walk_state case to > > allow for recursion. > > > > Cc: Robert Moore > > Cc: Lv Zheng > > Cc: "Rafael J. Wysocki" > > Cc: Len Brown > > Cc: linux-acpi@vger.kernel.org > > Cc: devel@acpica.org > > Signed-off-by: Prarit Bhargava > > --- > > drivers/acpi/acpica/dsmethod.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/drivers/acpi/acpica/dsmethod.c > > b/drivers/acpi/acpica/dsmethod.c index 1982310..93799db 100644 > > --- a/drivers/acpi/acpica/dsmethod.c > > +++ b/drivers/acpi/acpica/dsmethod.c > > @@ -428,6 +428,9 @@ acpi_ds_begin_method_execution(struct > acpi_namespace_node *method_node, > > obj_desc->method.mutex->mutex. > > original_sync_level = > > obj_desc->method.mutex->mutex.sync_level; > > + > > + obj_desc->method.mutex->mutex.thread_id = > > + acpi_os_get_thread_id(); > > } > > } > > > > -- > > 1.7.9.3 > > > > -- > > To unsubscribe from this list: send the line "unsubscribe linux-acpi" > > in the body of a message to majordomo@vger.kernel.org More majordomo > > info at http://vger.kernel.org/majordomo-info.html