Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752053AbdFNJdV (ORCPT ); Wed, 14 Jun 2017 05:33:21 -0400 Received: from foss.arm.com ([217.140.101.70]:59142 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751874AbdFNJc2 (ORCPT ); Wed, 14 Jun 2017 05:32:28 -0400 Subject: Re: [PATCH v7 3/3] PCI: Add tango MSI controller support To: Marc Gonzalez , Thomas Gleixner References: <741766e5-cff2-db5f-d40b-6866e08fd966@sigmadesigns.com> <9975fa6c-f426-519b-6b3e-a2d102d36fd5@arm.com> <82d6bf37-96b9-cd9d-134b-f01638fa2b1b@sigmadesigns.com> <49b4138d-0030-1e8c-6a14-0e9151b63d24@sigmadesigns.com> <1588fa00-92c6-046d-ccfc-9a2deae61486@arm.com> <08d84ce3-5345-dc69-bbc3-37372a3df22b@sigmadesigns.com> <870f833b-6bff-b3b1-6591-7d46e374de66@sigmadesigns.com> Cc: Bjorn Helgaas , Robin Murphy , Lorenzo Pieralisi , Liviu Dudau , David Laight , linux-pci , Linux ARM , LKML , Mason From: Marc Zyngier Organization: ARM Ltd Message-ID: Date: Wed, 14 Jun 2017 10:32:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <870f833b-6bff-b3b1-6591-7d46e374de66@sigmadesigns.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1056 Lines: 33 On 14/06/17 10:19, Marc Gonzalez wrote: > On 14/06/2017 11:00, Marc Gonzalez wrote: > >> The MSI controller in Tango supports 256 message-signaled interrupts, >> and a single doorbell address. >> >> Signed-off-by: Marc Gonzalez >> --- >> Changes from v6 to v7 >> o Call spin_lock() not spin_lock_irqsave() in the ISR >> --- >> drivers/pci/host/pcie-tango.c | 225 ++++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 225 insertions(+) > > Someone on IRC suggested testing the driver with LOCKDEP. > > If I understand the warning below correctly, I am not supposed > to call irq_domain_set_info() while holding used_msi_lock? Indeed. This creates an AB/BA situation, which will eventually deadlock. Once again, lockdep saves the day. > NB: in probe, my driver calls > > add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK); > > This should not break LOCKDEP analysis, right? It doesn't. The code is provably wrong, and lockdep proved that it is wrong. M. -- Jazz is not dead. It just smells funny...