Received: by 10.223.176.46 with SMTP id f43csp2476601wra; Thu, 25 Jan 2018 10:24:40 -0800 (PST) X-Google-Smtp-Source: AH8x224oHhQ71T0Fe+V8u8tgW8OH7nooYzfMaBdWaMOPLVrKBAklqeyxw7d+VzL5BZuVA6N69nTc X-Received: by 10.101.97.165 with SMTP id i5mr2690184pgv.55.1516904680055; Thu, 25 Jan 2018 10:24:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516904680; cv=none; d=google.com; s=arc-20160816; b=yRZkpC6vBLPIElLGbrmhqNNqHaTIU2zWOzpEP3XwFTyPWITKZ8gbqDI8/DJZpVDCP2 tqYEO+8RDsPzmZKdGvByq4K6x9VAQDm1YFsDmV19MRKsJiRcMx3NwnbThUg7ZZPnazey d7enPdfWh02BNsp1efDrvRweZQYuJvqG98necTFvxTm2eDuEBLeeM8cgiU3Ia6uNOyPK /cRId5ma0hU4b3FK0NflMz91ofvr14gLXnaAwu0Fx8IjNtCjswgvLnFDMKc57+9U84SC ZR4H6GlTA+x8M47S0Sw7Ial6sI9wxfd6XeaJ2Xt3KhVolX8UmjXQM7/gkCmUGjTRf300 cVGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:date:cc:to:reply-to:from :subject:message-id:arc-authentication-results; bh=NW59YwkGkWIvVFm9ipZ70MEqIyWk8FKPK/MDHV8uc80=; b=M78dDUbtona+AiIY9U2St3KNUmQ5Q8U0CMT90nC68uQI4H5pjXLrM3ENWA7TCC764m C/qruLCXcBFLyigpzPPMPGkxG/oQs4OuaUtQWv/D48Y7UfyGRxIk/XTZMg25pz9fQTrH uBulxqjoQUnbNEQ7v5KN+r5ke6lR1EijiKx3kKt3ao0UnO2LrXIUK74HtsvtqXw08RtT 365hM3qpBCcmT3VnFYQB5Sf7AUg41yq7q636tJp+lF+wudv3PvL+QRLf1BOwtlO+UTDk n3oS9UtKx591mncUJgakx1/0qXRSLQbwQwPvkkCe7rPJi1Q2oyvGj9pQZ7GeoGSGWBbe bUhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l67si4969791pfa.321.2018.01.25.10.24.25; Thu, 25 Jan 2018 10:24:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751211AbeAYSYC (ORCPT + 99 others); Thu, 25 Jan 2018 13:24:02 -0500 Received: from mail-qt0-f170.google.com ([209.85.216.170]:34366 "EHLO mail-qt0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750994AbeAYSYA (ORCPT ); Thu, 25 Jan 2018 13:24:00 -0500 Received: by mail-qt0-f170.google.com with SMTP id a27so21629503qtd.1 for ; Thu, 25 Jan 2018 10:24:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:reply-to:to:cc:date :in-reply-to:references:organization:mime-version :content-transfer-encoding; bh=NW59YwkGkWIvVFm9ipZ70MEqIyWk8FKPK/MDHV8uc80=; b=MNYiJGjIvo3A7xuUMouV0eAz926BHQKjZxomD0NcDI3y00cPTD+Y5jWzQQpOIcU0ed 7pXE4FyvLfJSVdMpNrNTdZYWPu+vGDN8HKt6zZjwcNRKdPMbrv8G0dVdGWjWc4SqhjiL IxBAcnuG/+azd2UbLZ8PIrDaRap9fsVPCEEgFZaGhtZCNRWo0D4o6sY04J4mlEK+IV6g +OeQkrTgyrZz7Mlv4us0My+uXj762t6RR2s2pG78KaocLnhvdfoGuR2D4Q6bAhxD4if5 tW/QDf1RxbrU7C3+nfuzgoweUv7+oFwsW7CBjcNzRMq2+R+rlKQ2uO4PLfoHgBaXwZUP etHg== X-Gm-Message-State: AKwxyteILXg4QhFLCBv9HRhupJWFzKPLTn+RIKgQsNGhqmUerf6BcxNi yEwDkEedySwlGdIZIhzdOYO0HQ== X-Received: by 10.200.46.69 with SMTP id s5mr18597194qta.205.1516904640080; Thu, 25 Jan 2018 10:24:00 -0800 (PST) Received: from whitewolf.lyude.net (pool-108-26-161-12.bstnma.fios.verizon.net. [108.26.161.12]) by smtp.gmail.com with ESMTPSA id s22sm4371019qtk.53.2018.01.25.10.23.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Jan 2018 10:23:59 -0800 (PST) Message-ID: <1516904638.5161.1.camel@redhat.com> Subject: Re: "irq/matrix: Spread interrupts on allocation" breaks nouveau in mainline kernel From: Lyude Paul Reply-To: lyude@redhat.com To: Thomas Gleixner Cc: "Ghannam, Yazen" , "hpa@zytor.com" , "keith.busch@intel.com" , "mingo@kernel.org" , "linux-kernel@vger.kernel.org" , Borislav Petkov Date: Thu, 25 Jan 2018 13:23:58 -0500 In-Reply-To: References: <1516744873.29151.3.camel@redhat.com> <1516757219.29151.7.camel@redhat.com> <1516816150.4109.2.camel@redhat.com> <1516823810.4109.26.camel@redhat.com> Organization: Red Hat Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.4 (3.26.4-1.fc27) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I think you are right, apologies. Glad to know this isn't a regression in the IRQ handling code :). It looks like our nouveau problems are probably coming from the fact that we don't just leave IRQs setup through suspend/resume which as far as I can tell, is probably not the correct thing to do. Going to get some patches onto the mailing list for this, thanks for the help! On Thu, 2018-01-25 at 09:54 +0100, Thomas Gleixner wrote: > On Wed, 24 Jan 2018, Lyude Paul wrote: > > Sorry about that! Let me clarify a little bit: this is a problem that shows > > up > > on mainline. Normally when we suspend the GPU in nouveau, we free the IRQs > > it's using before going into suspend > > (drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c:88), then reserve IRQs again > > on resume (drivers/gpu/drm/nouveau/nvkm/subdev/pci/base.c:134). Since this > > patch got pushed to mainline, the IRQ we get from request_irq() ends up > > having > > the same MSI vector as another device on the system: > > It's not the same. > > > nouveau: > > parent: > > domain: VECTOR > > hwirq: 0x2f > > chip: APIC > > flags: 0x0 > > Vector: 35 > > Target: 1 > > Vector 35 on CPU1 > > > After resume and allocating the interrupt for nouveau again, we get a > > message > > from the kernel saying: > > > > [ 217.150787] do_IRQ: 1.35 No irq handler for vector > > That's because there is a pending irq on the old vector for unknown reasons. > > > As well, nouveau ends up getting no interrupts from the card and as a > > result > > fails to come back up: > > > > [ 219.153049] nouveau 0000:22:00.0: DRM: EVO timeout > > [ 220.226254] r8169 0000:1e:00.0 enp30s0: link up > > [ 221.153054] nouveau 0000:22:00.0: DRM: base-0: timeout > > [ 223.153528] nouveau 0000:22:00.0: DRM: base-0: timeout > > > > If we look through all of the other IRQ allocations, we'll find that now > > two > > devices have the MSI vector 35: > > > > nouveau: > > parent: > > domain: VECTOR > > hwirq: 0x2f > > chip: APIC > > flags: 0x0 > > Vector: 35 > > Target: 1 > > Vector 35 on CPU1 > > > and the PCI bridge (00:01.3 PCI bridge: Advanced Micro Devices, Inc. > > [AMD] > > Family 17h (Models 00h-0fh) PCIe GPP Bridge): > > > > parent: > > domain: VECTOR > > hwirq: 0x19 > > chip: APIC > > flags: 0x0 > > Vector: 35 > > Target: 0 > > Vector 35 on CPU0. Same vector but different CPUs. So it's NOT the same > thing. > > The real issue is something completely different and the revert of this > patch merily papers over the underlying problem. I'm pretty sure that you > can trigger this even with the revert in place. Do the following before > suspend: > > echo 2 >/proc/irq/$NOUVEAUIRQ/smp_affinity_list > > Then do suspend/resume and you should end up with the same situation. > > I can't tell from your dmesg, but I'm pretty confident that > > > [ 217.150787] do_IRQ: 1.35 No irq handler for vector > > happens _before_ the nouveau driver requests the irq again. Can please you > add some printk to the code in question to verify that? > > Thanks, > > tglx