Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp631293pxa; Thu, 27 Aug 2020 11:21:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMgTHGwbm/A19U9eJECoUFdt2vYR7WljHk4i/kxjrfiPnyU5d043Ab6LplOLTigSCGpKm6 X-Received: by 2002:a05:6402:1bc2:: with SMTP id ch2mr402786edb.235.1598552515522; Thu, 27 Aug 2020 11:21:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598552515; cv=none; d=google.com; s=arc-20160816; b=oMZBLYlXDSSlt7N4vdun6B7JLEyKSu/o+IwZgOH7eCw3OW9luEFtc4HqbwRpOzwc7s 1r/7E3jlqWlmtY0OM4AlFE8gtJ+Q0BSKuFsZmheFw0KwK5y5EeM7DIATwHjJoWVxHMrr RMxbSVCTpU0ANzpNApi4UYe/KsqKJ7v8VT/r5Sm1YlDirDcDc0MLzMrUkQ+9SdBk5MoA b8Q1cSV2dFLW6daoFtDSCrmgzuPNE3Xoe76hpVmypMWhfoiWNAITjCu2nmU5MpBwwSz/ prhTppSAvCDqZp6BASsIKzacuttHRLuMDIqb2q08F4tjSi5z9pG4WO0TQzVS/xMHwDU6 QuLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=R/2EWkqD+mAtieDF44z7QG5DT91//t/RscuRk69c9TE=; b=kobIWTjvNQGev9C3QUZ9ZHR2ZVikyinkrDBdlhFMG6I2kYVhR+lx9ae/mYW85Qg+NV OoMtcaRcJwtnisBN7HNvDE9ji4YgArP0V7IX4Do7ma2RlnhpwuN4ybJz0pawT0uo2+6s yqOurlfztf7gzuYGvBKeNp1GollHTxkxHzKzRIip84haglQjD6BNiIHKemP4/ZWpuI8l CUCQSJvo+aHSJFE32TtOiH3nBbZpoFGeTrKPexyhfcFQBeXgF0UCczprsMeHMYxTbkHn b3PSkKRz/7DL+Bk8WiSpMHY9Z8QsSNXcRS9T1o2LEE1VKTervCnew4izgXZhjoEKz+4H EWrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UkvStWoB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a10si1900828ejf.666.2020.08.27.11.21.33; Thu, 27 Aug 2020 11:21:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UkvStWoB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727933AbgH0SUn (ORCPT + 99 others); Thu, 27 Aug 2020 14:20:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:57484 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726093AbgH0SUm (ORCPT ); Thu, 27 Aug 2020 14:20:42 -0400 Received: from localhost (104.sub-72-107-126.myvzw.com [72.107.126.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A730E2087E; Thu, 27 Aug 2020 18:20:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598552442; bh=m7vhbAFnI7P7AwdKlzAn0wqD1YPTHJSRQ+ZyXNR7MXY=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=UkvStWoB1OiC87isw5L+RU0aRZ6Byn64sN6W7fqyqnYslW1VbyUto3Ot7HnJdzmV/ BpHMqJ6kR2FuX03H7NAUtZrH7Q62VQWR+Hm7VJz4TNIG5szeBamrDedrrHkWMj3Ds6 qwX6HCvJ0Dk2KiupyPg7/GXt0z0MFg9xlpzjsATc= Date: Thu, 27 Aug 2020 13:20:40 -0500 From: Bjorn Helgaas To: Thomas Gleixner Cc: LKML , x86@kernel.org, Joerg Roedel , iommu@lists.linux-foundation.org, linux-hyperv@vger.kernel.org, Haiyang Zhang , Jon Derrick , Lu Baolu , Wei Liu , "K. Y. Srinivasan" , Stephen Hemminger , Steve Wahl , Dimitri Sivanich , Russ Anderson , linux-pci@vger.kernel.org, Bjorn Helgaas , Lorenzo Pieralisi , Konrad Rzeszutek Wilk , xen-devel@lists.xenproject.org, Juergen Gross , Boris Ostrovsky , Stefano Stabellini , Marc Zyngier , Greg Kroah-Hartman , "Rafael J. Wysocki" , Megha Dey , Jason Gunthorpe , Dave Jiang , Alex Williamson , Jacob Pan , Baolu Lu , Kevin Tian , Dan Williams , Rob Herring Subject: Re: [patch V2 34/46] PCI/MSI: Make arch_.*_msi_irq[s] fallbacks selectable Message-ID: <20200827182040.GA2049623@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200826112333.992429909@linutronix.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [+cc Rob, cover https://lore.kernel.org/r/20200826111628.794979401@linutronix.de/ this https://lore.kernel.org/r/20200826112333.992429909@linutronix.de/] On Wed, Aug 26, 2020 at 01:17:02PM +0200, Thomas Gleixner wrote: > From: Thomas Gleixner > > The arch_.*_msi_irq[s] fallbacks are compiled in whether an architecture > requires them or not. Architectures which are fully utilizing hierarchical > irq domains should never call into that code. > > It's not only architectures which depend on that by implementing one or > more of the weak functions, there is also a bunch of drivers which relies > on the weak functions which invoke msi_controller::setup_irq[s] and > msi_controller::teardown_irq. > > Make the architectures and drivers which rely on them select them in Kconfig > and if not selected replace them by stub functions which emit a warning and > fail the PCI/MSI interrupt allocation. Sorry, I really don't understand this, so these are probably stupid questions. If CONFIG_PCI_MSI_ARCH_FALLBACKS is defined, we will supply implementations of: arch_setup_msi_irq arch_teardown_msi_irq arch_setup_msi_irqs arch_teardown_msi_irqs default_teardown_msi_irqs # non-weak You select CONFIG_PCI_MSI_ARCH_FALLBACKS for ia64, mips, powerpc, s390, sparc, and x86. I see that all of those arches implement at least one of the functions above. But x86 doesn't and I can't figure out why it needs to select CONFIG_PCI_MSI_ARCH_FALLBACKS. I assume there's a way to convert these arches to hierarchical irq domains so they wouldn't need this at all? Is there a sample conversion to look at? And I can't figure out what's special about tegra, rcar, and xilinx that makes them need it as well. Is there something I could grep for to identify them? Is there a way to convert them so they don't need it? > --- a/include/linux/msi.h > +++ b/include/linux/msi.h > @@ -193,17 +193,38 @@ void pci_msi_mask_irq(struct irq_data *d > void pci_msi_unmask_irq(struct irq_data *data); > > /* > - * The arch hooks to setup up msi irqs. Those functions are > - * implemented as weak symbols so that they /can/ be overriden by > - * architecture specific code if needed. > + * The arch hooks to setup up msi irqs. Default functions are implemented s/msi/MSI/ to match the one below. > + * as weak symbols so that they /can/ be overriden by architecture specific > + * code if needed. These hooks must be enabled by the architecture or by > + * drivers which depend on them via msi_controller based MSI handling.