Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1258798pxb; Tue, 29 Mar 2022 22:17:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzx38QibFMVkGKj3secaK6Y5xcvM/uDfkgmIQ7uiNcj9Lmoycx9GQWSo6kFu1QE2w1xhKif X-Received: by 2002:a17:907:7ea7:b0:6df:fb36:e8af with SMTP id qb39-20020a1709077ea700b006dffb36e8afmr38459737ejc.356.1648617421208; Tue, 29 Mar 2022 22:17:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648617421; cv=none; d=google.com; s=arc-20160816; b=mDXV/iyuXKGFGDqscLrkL6YDEdc4eQvEgC0ssOX745cnOBQvZTTbkncAlQfZkc10SK VJb5LtzvpWYfHnQhKUR9kv+rxJYZCwBS6LyQj+QcGq7mzNE1EJ3CQHvMTywuRSEnryW1 JkNGUII/BtKlCAhvk0b8KZjnWOxPULlhdIczotanTcEnODFVhumT6Vl/r7RCu94mZwO2 OGN6oXdBXWhsUX53rAJ8cMiLWgZSgulxtLKJe9mcAS9iFcLk2gZQyDn0Xxi39t0wOYSD WuTGn+dkPQ4DM7qbn1TkBhdCOPzGZ3+LDTZWr8N+qOr+TB124Ii59NqOBH5P/zVJVkEs u78w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=K56BsfoBgMn9W+rnuLsv0bm5grEALntNroa6Yc82KdQ=; b=bEZ3UYDm/95b2H7XdJ3qHkNMrZskLasrg2cBKpDqDkaXWoZooMetmGocpEygIAqoXi lEdVENmtl8puNHAqODwhbIjvRZoQ0gwCGfdwnH2F5yrmxENkf+0DRsFXV01y9MgKf0MF vD6zIMSmnTJXI9/zmCvKgFxRaXJgGvwIH+e17d2wWvO0EZpNQUIsHGiP6GFo2J6YAK0B 9gtTZkNC/PCz3ltKTGwoE2FHLFB0RkjJOXAKRtuEmqiFWc0R3Jm9iLOkdJrQxjLg4RDT 7gncsFoZWibjOH6KOeF4Fgp/0gFcRZ/okDPMkVXTkFMuonGU3ZHAuOcFkF/gLYlPyCK3 NyTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ZunERedB; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e26-20020a50a69a000000b00418c2b5be23si19808942edc.261.2022.03.29.22.16.35; Tue, 29 Mar 2022 22:17:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ZunERedB; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240427AbiC2SPp (ORCPT + 99 others); Tue, 29 Mar 2022 14:15:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235546AbiC2SPo (ORCPT ); Tue, 29 Mar 2022 14:15:44 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 329B439BB4 for ; Tue, 29 Mar 2022 11:14:01 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1648577638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=K56BsfoBgMn9W+rnuLsv0bm5grEALntNroa6Yc82KdQ=; b=ZunERedBvlyrIkmrxBOXq+SFQ8oPAJgIiSTJSupnoMy84lsSq8+Y2ithnhrH89ev3RuYLd on4YdUn5/atLStXdp46m8hsxV++A3QYBwbS5ZZ1u/pUbMcaUe08ao8nRJKuZruOCClE7/b s3wNIGzjDFF9ojCSNct1rQQ4GYfogIrQPuQ4dD+1WHoiI4MPyxvIwZjPR0cx8CDhUnNIcP +wiD1x8SnNtfwssRGq9F2ST0x1KxfN+vEp9aJfdnG828YtchAykyspeoOMkiZx7eQ9y6gG SbrRF1hqYi8kGkBiMcG39wlAxjJcQvbi0bu0GOFo/KIWqucqNk3/UqFn3zcutQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1648577638; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=K56BsfoBgMn9W+rnuLsv0bm5grEALntNroa6Yc82KdQ=; b=aAtoPleLjBNdBeKI37H4sj56tIZfUR4WxK9DqSTju6swEfqZnVAHT4B/GXVkAxEykVGOB3 gVyYaZS/2js+eTBg== To: "Michael S. Tsirkin" Cc: Jason Wang , virtualization , linux-kernel , Marc Zyngier , Peter Zijlstra , Stefano Garzarella , Keir Fraser , "Paul E. McKenney" Subject: Re: In-Reply-To: <20220329100859-mutt-send-email-mst@kernel.org> References: <20220325050947-mutt-send-email-mst@kernel.org> <20220325060659-mutt-send-email-mst@kernel.org> <20220328015757-mutt-send-email-mst@kernel.org> <20220328062452-mutt-send-email-mst@kernel.org> <87fsn1f96e.ffs@tglx> <20220329100859-mutt-send-email-mst@kernel.org> Date: Tue, 29 Mar 2022 20:13:57 +0200 Message-ID: <87v8vweie2.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 29 2022 at 10:37, Michael S. Tsirkin wrote: > On Tue, Mar 29, 2022 at 10:35:21AM +0200, Thomas Gleixner wrote: > We are trying to fix the driver since at the moment it does not > have the dev->ok flag at all. > > And I suspect virtio is not alone in that. > So it would have been nice if there was a standard flag > replacing the driver-specific dev->ok above, and ideally > would also handle the case of an interrupt triggering > too early by deferring the interrupt until the flag is set. > > And in fact, it does kind of exist: IRQF_NO_AUTOEN, and you would call > enable_irq instead of dev->ok = true, except > - it doesn't work with affinity managed IRQs > - it does not work with shared IRQs > > So using dev->ok as you propose above seems better at this point. Unless there is a big enough amount of drivers which could make use of a generic mechanism for that. >> If any driver does this in the wrong order, then the driver is >> broken. > > I agree, however: > $ git grep synchronize_irq `git grep -l request_irq drivers/net/`|wc -l > 113 > $ git grep -l request_irq drivers/net/|wc -l > 397 > > I suspect there are more drivers which in theory need the > synchronize_irq dance but in practice do not execute it. That really depends on when the driver requests the interrupt, when it actually enables the interrupt in the device itself and how the interrupt service routine works. So just doing that grep dance does not tell much. You really have to do a case by case analysis. Thanks, tglx