From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B720FC4332F for ; Mon, 30 Oct 2023 17:55:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YVOO+QK3Z4zcGSvRqCFVww1rK5N9xf+0iGGcvr6mtV4=; b=U/sIympu/x6kjJ Yo9dPhv+rWC9k4vOaaanA8b7aaQR+9/QU7Tvp3y/Wud/Q7o6i8+SoDwT/RK3wt0mkMx3GZeXR7ZXz /Sh01pJl636nkzZCmQiOFMBz5TD79EIQFiEC3D8mO0a3RQ4zQ7OJLpaJp/VmnN9/Y+MoZCOnJoC2+ VlNqcpVnkG32yDfOZd9dPDykia1+SNwsHryNi3X8GhohFWciorE/5rsql8TTGRXd1SZVPZmmKEmnh X4kj1t4ISQJY3LHlLQEjhF0X3m+H62lkQBSQkd//THRcF6YnR7OUW+KCcFbCq90ARjtwHmyvQocNI lbD7CKB1Jz2lvQWkKA9w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qxWTJ-003o5F-1X; Mon, 30 Oct 2023 17:54:41 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qxWTG-003o42-0h for linux-arm-kernel@lists.infradead.org; Mon, 30 Oct 2023 17:54:39 +0000 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6bd0e1b1890so3881231b3a.3 for ; Mon, 30 Oct 2023 10:54:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1698688476; x=1699293276; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=21YW+6fG17bA3AZxmYV1MGGTJ8p29kWqv098XZo38z4=; b=lg3wwnJDuXc7xnG2xA5Sko9Y4SBlmledgh1aLW1bNTny11GLBim2PmXaeMsI9063Kz 0ol/W0EeCIIqBDW+TQzMizIy6E9L45/E4r9Oa9NPuC5ioq4D70QYKk9D4fVF056ZUbvy BDyiaMG3xWeGeqA5O6joexxUpvjdYLFIYE+LKa+ukpOzwDzDTp/J2X7yp4PKeUBy/FVV Mr1vB5hygYIG3gtA4qnF9YLCFL5xWIIyB807ekDV3n9hItP8hoG3sroEYgX5uwp+zbH7 JwX7IalzJ+vghPeHCA88XB5bYtOY2Y8bfUAU0PpY4hsLKi9OD4fwGcrPvG2rX6c7R5C5 ruzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698688476; x=1699293276; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=21YW+6fG17bA3AZxmYV1MGGTJ8p29kWqv098XZo38z4=; b=GccqH5WTbPLj1/n8iI3YEzJfA0yM7eFiXVNqJhLpy8qr+pa1BA62BKqfv1sCUH/28S PMF9fN0ekFlXEh9L5QoVs4/wExZXnmJ4G6DGuonBhtLa3u0mt4HY6hKz4G9E+M2qvpV3 qUCdWnlvNll7UOw8ic25e2KSl1HJ4J3UA6uBDQOod9+NSDG86jFi0NKq72wnzKb6URiN kVsRIldmANELlbIwD3LbBtjjrCJ/3qZfsILsNnXZTZqmKoGsR3Kb2sp/iZ3DpnO9Os2r mhVrC2V29QCe9WCsoAjHHyeffGISadbG9Hm3aemPQC5RX/3EkMQdvVGEe5s2PdsKlqSO pspA== X-Gm-Message-State: AOJu0Yz1lDxLbjQ3xsMRDDlR/81K9m3aQnmMhutw0ewVrfJQmoYCVMIq QP10kRfkdh5b4V5gJiXbsRyXMw== X-Google-Smtp-Source: AGHT+IGcO5mSWybe6n+dtGZAk2xcN8I4tCXS/WOTKt6LNejW/oYf1m4IEzTPCduyQ3/xCabvXgof9A== X-Received: by 2002:a05:6a00:cc6:b0:6be:11ac:98a5 with SMTP id b6-20020a056a000cc600b006be11ac98a5mr10716364pfv.27.1698688475658; Mon, 30 Oct 2023 10:54:35 -0700 (PDT) Received: from sunil-laptop ([106.51.188.78]) by smtp.gmail.com with ESMTPSA id f29-20020a056a000b1d00b006be0fb89ac3sm6169630pfu.30.2023.10.30.10.54.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 10:54:35 -0700 (PDT) Date: Mon, 30 Oct 2023 23:24:25 +0530 From: Sunil V L To: Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, linux-serial@vger.kernel.org, Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , "Rafael J . Wysocki" , Len Brown , Bjorn Helgaas , Anup Patel , Greg Kroah-Hartman , Jiri Slaby , Conor Dooley , Andrew Jones , Atish Kumar Patra , Haibo Xu Subject: Re: [RFC PATCH v2 11/21] PCI: MSI: Add helper function to set system wide MSI support Message-ID: References: <20231025202344.581132-1-sunilvl@ventanamicro.com> <20231025202344.581132-12-sunilvl@ventanamicro.com> <87a5s0yyje.ffs@tglx> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87a5s0yyje.ffs@tglx> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231030_105438_253566_85EA62F0 X-CRM114-Status: GOOD ( 17.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Oct 30, 2023 at 03:28:53PM +0100, Thomas Gleixner wrote: > On Thu, Oct 26 2023 at 01:53, Sunil V. L. wrote: > > Like pci_no_msi() used to disable MSI support, add a function to enable > > system wide MSI support. > > Why? > > int pci_msi_enable = 1; > > So this function makes it more one or what am I missing here? > Hi Thomas, Just noting related discussion : https://www.spinics.net/lists/linux-serial/msg57616.html The MSI controller on RISC-V (IMSIC) is optional for the platform. So, when by default pci_msi_enable = 1 and the MSI controller is not discovered, we get stack trace like below. [ 0.608941] [] pci_msi_setup_msi_irqs+0x18/0x34 [ 0.608991] [] msix_capability_init+0x228/0x406 [ 0.609001] [] __pci_enable_msix_range+0x1b4/0x1ca [ 0.609011] [] pci_alloc_irq_vectors_affinity+0x6e/0xee [ 0.609020] [] vp_find_vqs_msix+0xfa/0x350 [ 0.609031] [] vp_find_vqs+0x36/0x144 [ 0.609040] [] vp_modern_find_vqs+0x14/0x48 [ 0.609049] [] init_vqs+0x362/0x4ee [ 0.609058] [] virtnet_probe+0x672/0xa70 [ 0.609067] [] virtio_dev_probe+0x194/0x200 [ 0.609075] [] really_probe+0x106/0x28a [ 0.609083] [] __driver_probe_device+0x62/0xdc [ 0.609091] [] driver_probe_device+0x38/0x164 [ 0.609098] [] __driver_attach+0xd0/0x17c [ 0.609106] [] bus_for_each_dev+0xd0/0x11c [ 0.609116] [] driver_attach+0x1a/0x22 [ 0.609123] [] bus_add_driver+0x136/0x208 [ 0.609132] [] driver_register+0x48/0xda [ 0.609140] [] register_virtio_driver+0x20/0x2a [ 0.609157] [] virtio_net_driver_init+0x76/0xa6 [ 0.609168] [] do_one_initcall+0xc0/0x21e [ 0.609176] [] do_initcall_level+0x7c/0x8e [ 0.609186] [] do_initcalls+0x52/0x88 [ 0.609195] [] do_basic_setup+0x1c/0x24 [ 0.609204] [] kernel_init_freeable+0xe2/0x122 [ 0.609213] [] kernel_init+0x1a/0x18e [ 0.609223] [] ret_from_fork+0xa/0x1c So, what I did was, by default call pci_no_msi() to disable MSI and then call pci_set_msi() to enable when MSI controller is probed. But I think Bjorn's suggestion to depend on PCI_BUS_FLAGS_NO_MSI may be better idea. In that case, we need to set bridge->msi_domain to true in pci_create_root_bus(). Let me know what do you prefer or if I am completely missing something here. Thanks, Sunil _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel