Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5708987ybl; Tue, 14 Jan 2020 13:39:32 -0800 (PST) X-Google-Smtp-Source: APXvYqys0EdKMeDWP9w+i2WtgQRWT7EmwDPa4iXO10LUFCOWRTykKjvv2N/KA7k52xVCHK9iOME+ X-Received: by 2002:a9d:6b8a:: with SMTP id b10mr363841otq.322.1579037971948; Tue, 14 Jan 2020 13:39:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579037971; cv=none; d=google.com; s=arc-20160816; b=G9ZkGJ7AE6hmU524BRRoQdDz4kzqKhiSRw7iJPqEv6vYhpyQgNEPXHFShofwVAVkxS FKRXf3GtoU1W1lcFVrFG+Yu1bGjFWdiy+WGnm5fAY/J4WwFMSOpzTUh2K/uNP6zGgJly vO2h91iDmwhF2pQe/eeVuMZ9hvwE9nULi100WrL5BwevJMsdIXjhxs9Herc/PJxtIHsx 8Ov5U5QTm49+Ho3DcgvOIQ2D8KJzmrbu8yG0wUtC/A12wiwEocBB3/CR+hXZ6EnPSkuL fNfYkGpKfV96Tpw0abaIO1vFTUsDrZkXWdct/0I6E2/YFJ2gtpLRwjZjlfoVVauCkiQp BTPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=CWsnwP4GIaciUFACTvTTV9wv4l6lQ5px2rGr1iC9QYQ=; b=do1MBf+CPnvYh8DUR93lxGkgLoIvR9LX7ccJslTI2sIK/t+PZFtds8jKjaYTOgyiF3 VPEsa6xC9QJNlKAHbqM9ZEWi7X/u+ONWF130tskMzKI64oDJ3fs92HKjFnB6u/8tWTTh WJfkYWg6YzJvGy8JY0fYGHfRPBFKhLBUVDZn66vAgOSr6fvzHAA5X+Squ3j3vzpztDF+ 3BZsYu0boto9zhFNNh4MYGVpg8Xvibe7Zhkf3es2KgvJPr4t3VxksApMCdniFys1zNFa Dtp4wlTjCpT+T886UG5zUzteh032TkaE8KRKuZO2EbXOOrqQ5M3fdDZjht1NrSzDkRb9 7wjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=I5IqhNFA; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1si8148867oic.245.2020.01.14.13.39.19; Tue, 14 Jan 2020 13:39:31 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=I5IqhNFA; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728921AbgANVi0 (ORCPT + 99 others); Tue, 14 Jan 2020 16:38:26 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:43404 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728808AbgANViX (ORCPT ); Tue, 14 Jan 2020 16:38:23 -0500 Received: by mail-ot1-f67.google.com with SMTP id p8so14120680oth.10; Tue, 14 Jan 2020 13:38:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CWsnwP4GIaciUFACTvTTV9wv4l6lQ5px2rGr1iC9QYQ=; b=I5IqhNFAv/XIejr8sL+ZxQeuLgtDWkRE7z3Wkpi9O531Wszi1pqwwo8eQ70RarRn0K CYTUlqN1qXNDKtqanYseQau9icecgVJFeW8JaYXnmAv/IIHvPAsJH6Q2wOc0Rjm3IP+d sTKfeNnqvgOOJzo+N8QKFnEFSs0hWxzeoCsSVeYjUf5/AAsAgSXIRPH+kFWy1M+bqJ6a EjY5GEymiRHzdlwF0kMaVSq5syNCJGv1X4/doDjmfYEcNaTzxjgxn9wug6ynVBEk1QLf HAgAYUt83/3c6DtcEQaXyBVoaEx7mj5qOFGunDx1q4/KAZ/wtv41SJqlom9+kt8zlyD3 qhHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CWsnwP4GIaciUFACTvTTV9wv4l6lQ5px2rGr1iC9QYQ=; b=ek9fkZ6TeNWSWAAA+haVSo2UiZYObOJjRhpj1GyiZE+zC8gAgoGp1pbWC/PGXd4nKH CefCCoqezxKK0HWacQRM+n12idMYl9v3IIx/GNuxQT25o2l/wZ4xBS+M30dnHKg7dSP1 IOeCDQ7iwoDIAuqGYXINlBzWZJKguMStLRbLOEliVGKfHsR9pj4xn1kbq/FGXmK8WCYs BsiXxVGcOTzLeJincjomz9y+BLLKpfYLcKKkN5J/+YRmGlDQmOEbhG85GLBu2ZxjpOzV Z3JjjPeF4g21j3fi4PJbwZJRNmPwjCcjVeQ5eu5OnrIAwl8CgzLm9+R78TOJZ8oroCrD nnAQ== X-Gm-Message-State: APjAAAXmB86opFHAMWLYQDOwARJ1Zpm1mklfZwjB/34556J3sGVOfF/+ J0i6tci5QRU4Xcat70bJ0ZUacqNaCKwQ3WjMgqQ= X-Received: by 2002:a9d:70d9:: with SMTP id w25mr334632otj.231.1579037902181; Tue, 14 Jan 2020 13:38:22 -0800 (PST) MIME-Version: 1.0 References: <87wo9ub5f6.fsf@nanos.tec.linutronix.de> In-Reply-To: <87wo9ub5f6.fsf@nanos.tec.linutronix.de> From: Ramon Fried Date: Tue, 14 Jan 2020 23:38:11 +0200 Message-ID: Subject: Re: MSI irqchip configured as IRQCHIP_ONESHOT_SAFE causes spurious IRQs To: Thomas Gleixner Cc: hkallweit1@gmail.com, Bjorn Helgaas , maz@kernel.org, lorenzo.pieralisi@arm.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 14, 2020 at 2:15 PM Thomas Gleixner wrote: > > Ramon Fried writes: > > While debugging the root cause of spurious IRQ's on my PCIe MSI line it appears > > that because of the line: > > info->chip->flags |= IRQCHIP_ONESHOT_SAFE; > > in pci_msi_create_irq_domain() > > > > The IRQF_ONESHOT is ignored, especially when requesting IRQ through > > pci_request_threaded_irq() where handler is NULL. > > Which is perfectly fine. > > > The problem is that the MSI masking now only surrounds the HW handler, > > and all additional MSI that occur before the threaded handler is > > complete are considered by the note_interrupt() as spurious. > > Which is not a problem as long as the thread finishes before 100k MSIs > arrived on that line. If that happens then there is something really > wrong. Either the device fires MSIs like crazy or the threaded handler > is stuck somewhere. > > > Besides the side effect of that, I don't really understand the logic > > of not masking the MSI until the threaded handler is complete, > > especially when there's no HW handler and only threaded handler. > > What's wrong with having another interrupt firing while the threaded > handler is running? Nothing, really. It actually can be desired because > the threaded handler is allowed to sleep. What do you mean, isn't it the purpose IRQ masking ? Interrupt coalescing is done to mitigate these IRQ's, these HW interrupts just consume CPU cycles and don't do anything useful (scheduling an already scheduled thread). Thanks, Ramon. > > Thanks, > > tglx