From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755382AbdJJHYu (ORCPT ); Tue, 10 Oct 2017 03:24:50 -0400 Received: from thoth.sbs.de ([192.35.17.2]:57680 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751903AbdJJHYt (ORCPT ); Tue, 10 Oct 2017 03:24:49 -0400 Subject: Re: [PATCH] iommu/vt-d: Don't register bus-notifier under To: Joerg Roedel Cc: iommu@lists.linux-foundation.org, Linux Kernel Mailing List References: <4e9f9665-38f7-c5f0-2a9d-13bb3a00aab2@siemens.com> <6ed4183a-b2eb-b8d3-c54c-fb0c4fd7a813@siemens.com> <82afec06-4eb9-7b91-7b19-c442b77b5769@siemens.com> <20171006130823.a4rtzhusjpbgo3ar@suse.de> <2ee59dfe-0a02-05b6-8115-5846b49bc053@siemens.com> <20171010072141.57vbnmg4crpsk6ip@suse.de> From: Jan Kiszka Message-ID: <72728ccb-d5cb-762e-d5a1-6349dbe7db31@siemens.com> Date: Tue, 10 Oct 2017 09:24:41 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: <20171010072141.57vbnmg4crpsk6ip@suse.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017-10-10 09:21, Joerg Roedel wrote: > On Mon, Oct 09, 2017 at 06:58:13PM +0200, Jan Kiszka wrote: >>> extern int dmar_table_init(void); >>> extern int dmar_dev_scope_init(void); >>> +extern void dmar_register_bus_notifier(void); >>> extern int dmar_parse_dev_scope(void *start, void *end, int *cnt, >>> struct dmar_dev_scope **devices, u16 segment); >>> extern void *dmar_alloc_dev_scope(void *start, void *end, int *cnt); >>> >> >> Silences the warning, but locking in the init paths still smells fishy >> to me. > > Yes, its certainly not optimal, but the code that runs in there also > runs at iommu hotplug time, so we can't just remove the locking there > entirely. It may not just be "sub-optimal" but rather borken: "One example: dmar_table_init is not consistently protected by dmar_global_lock." Jan > > On the other side the warning you reported is a false-positive, it can > never dead-lock because the reverse lock-order happens only at > initialization time, but I don't know how to silence it otherwise. > > > Regards, > > Joerg > -- Siemens AG, Corporate Technology, CT RDA ITP SES-DE Corporate Competence Center Embedded Linux