Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6014494ybi; Wed, 12 Jun 2019 12:24:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzFQtTPFUhNgtRMO04vFKXvazp4lU/oHH79z/CbcTZGWQKgv+fuW92VSMYaCRa7ru8sebPc X-Received: by 2002:a17:90a:8c18:: with SMTP id a24mr731830pjo.111.1560367491699; Wed, 12 Jun 2019 12:24:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560367491; cv=none; d=google.com; s=arc-20160816; b=QHu6soqykqpCZkTTp/B4ngXDdIb6wlV/2XRz+NAUHcLlswG5JhumffjEHSKDO5/EAD +hAHJvfQRwgQDMUBCEunpsY2R0a4RvJMq3TBfoQ/MIs6cQZyAIEYxrkkr3uLM/LFD2uK gzUYKftVb8UXbGFzvO17hXjKG9yv4pIvdmx2/bi1OL5KmRNi+RMTDi2pNDckpPkWxzRI JJu/bZDUzq6O0udipCirGCuCWbT0IBlb4zs57BRPPJlgXe6holFwMOPz41upkf1M4iZd O38KY9bqoDygrrKJezz/hQibXKdvfDLzTt+gVUyhRC69sJjyq5w1phYfQeRrjEJo//dd MYkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=wC+Cdrz0RXhjPU4AxGHq1Ud+q4A21tc6As13pWmEXeg=; b=nfCHPRF+ezbBKIUQu7YlH300fz1qGZwrdUxeTqqwpWN83qNclOirg8Pat2o9Y7o3zT TUiyOjnrNSUbh+Ju7eB16Q+VZ3ODFhcgxsEYN9g2YUtQoeTjWAo7mZIvjjANRvFxGhCB HKlXpUqpVHi1wxWDa4kYCUcQB29hxkvQEKlFdB6u/LKxSuPK/DmU/weyEBBdrXeZQQdj T4DC2g5n/biB9qKQZsCKjOnOY9NR08jjJDj6KfW/lTFTjUiz2499eKeKWxd0qTDiBWg6 mh0tk6WQQO7o53b3Rkpgm6Oq8orlXuhU4CFGgwmQMk53TlQsc6T2dnKABumdZMqt/TZW aTWA== 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=iki.fi Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si460305pld.265.2019.06.12.12.24.37; Wed, 12 Jun 2019 12:24:51 -0700 (PDT) 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=iki.fi Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387934AbfFLTYR (ORCPT + 99 others); Wed, 12 Jun 2019 15:24:17 -0400 Received: from emh07.mail.saunalahti.fi ([62.142.5.117]:44270 "EHLO emh07.mail.saunalahti.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727443AbfFLTYQ (ORCPT ); Wed, 12 Jun 2019 15:24:16 -0400 Received: from darkstar.musicnaut.iki.fi (85-76-70-161-nat.elisa-mobile.fi [85.76.70.161]) by emh07.mail.saunalahti.fi (Postfix) with ESMTP id B32D2B0069; Wed, 12 Jun 2019 22:24:12 +0300 (EEST) Date: Wed, 12 Jun 2019 22:24:12 +0300 From: Aaro Koskinen To: "Maciej W. Rozycki" Cc: Alexandre Oliva , Tom Li , James Hogan , Jiaxun Yang , Huacai Chen , Ralf Baechle , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC] On the Current Troubles of Mainlining Loongson Platform Drivers Message-ID: <20190612192412.GF26504@darkstar.musicnaut.iki.fi> References: <20190217235951.GA20700@darkstar.musicnaut.iki.fi> <20190610214938.GB7147@darkstar.musicnaut.iki.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Wed, Jun 12, 2019 at 06:55:28AM +0100, Maciej W. Rozycki wrote: > On Tue, 11 Jun 2019, Aaro Koskinen wrote: > > > However, with your patch the "nobody cared" is never reached so all is > > good. I tried 10 boots with the patch and all were successful. Without > > the patch 8 out of 10 failed with the "nobody cared" warning. > > I wouldn't call it "good", just less obvious or painful. This is still > causing wasted CPU cycles that are used for taking the phantom interrupts. > > There is clearly a completion barrier missing somewhere that causes the > interrupt request to linger beyond the point interrupts are reenabled at > the CPU. > > One way to attempt to narrow it down might be taking a backtrace from > where IRQ 14 is found to be spurious. This would indicate the offending > interrupt unmask action. E.g. I see no explicit completion barrier The first spurious IRQ is right after the driver registers: [ 4.732000] [] show_stack+0x90/0x140 [ 4.732000] [] ata_bmdma_interrupt+0x2b4/0x39c [ 4.732000] [] __handle_irq_event_percpu+0xb0/0x178 [ 4.732000] [] handle_irq_event_percpu+0x34/0x9c [ 4.732000] [] handle_irq_event+0x3c/0x74 [ 4.732000] [] handle_level_irq+0x118/0x154 [ 4.732000] [] generic_handle_irq+0x34/0x50 [ 4.732000] [] do_IRQ+0x18/0x24 [ 4.732000] [] handle_int+0x17c/0x188 [ 4.732000] [] arch_local_irq_restore+0x18/0x30 [ 4.732000] [] __setup_irq+0x660/0x7a0 [ 4.732000] [] request_threaded_irq+0x114/0x19c [ 4.732000] [] devm_request_threaded_irq+0xa0/0x10c [ 4.732000] [] ata_pci_sff_activate_host+0x1c0/0x274 [ 4.732000] [] ata_pci_init_one+0x170/0x1c4 [ 4.732000] [] cs5536_init_one+0x94/0xb8 and the following ones do not seem to provide much info as I can only see the IRQ stack: [ 4.736000] [] show_stack+0x90/0x140 [ 4.736000] [] ata_bmdma_interrupt+0x2b4/0x39c [ 4.736000] [] __handle_irq_event_percpu+0xb0/0x178 [ 4.736000] [] handle_irq_event_percpu+0x34/0x9c [ 4.736000] [] handle_irq_event+0x3c/0x74 [ 4.736000] [] handle_level_irq+0x118/0x154 [ 4.736000] [] generic_handle_irq+0x34/0x50 [ 4.736000] [] do_IRQ+0x18/0x24 [ 4.736000] [] handle_int+0x17c/0x188 [ 4.736000] [] irq_exit+0x68/0xcc > between the final `outb' in `mask_and_ack_8259A' and the following call to > `raw_spin_unlock_irqrestore', which are obviously otherwise unordered WRT > each other (because `outb' is I/O or MMIO and `raw_spin_unlock_irqrestore' > is contained within the CPU on UP). I can see provisions however for > issuing an architecture-specific barrier in `do_raw_spin_unlock', which is > the workhorse for `raw_spin_unlock_irqrestore', so maybe this is the place > to look into? > > Also how's IRQ 14 registered as indicated by /proc/interrupts? Not sure what you mean but here's the output: $ cat /proc/interrupts CPU0 2: 0 XT-PIC 2 cascade 3: 20 XT-PIC 3 ttyS0 5: 543358 XT-PIC 5 timer 11: 0 XT-PIC 11 ehci_hcd:usb1, ohci_hcd:usb2 14: 100000 XT-PIC 14 pata_cs5536 18: 0 MIPS 2 cascade 22: 0 MIPS 6 cascade 36: 3052 bonito_irq eth0 ERR: 0 A.