Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2903603rdh; Mon, 30 Oct 2023 10:54:48 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG35l1RVWZDKhtEkfiTddjjLUyiZ0Ajg+FwEJNQ08SrCZJ4cUt7xQfiUzEaavCPJ9Fqws09 X-Received: by 2002:a05:6a00:21d3:b0:6bc:635a:aad3 with SMTP id t19-20020a056a0021d300b006bc635aaad3mr8544772pfj.9.1698688488044; Mon, 30 Oct 2023 10:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698688488; cv=none; d=google.com; s=arc-20160816; b=EvO22WvdVTtSadB0JOpgAB6avs9KDmuPJAeg2gfTVB12GAQ6mXJR/TwPydzc/Yem0J 3hxvSqBSU3el4MioEfoZY7D5ZbPyIXnbvCr34efDYCa3FJjs2fYtYuLcI5rMwGzy5f9m z5Qu1FfS3npsk3A2BSz1yP+6xAqU+/5EjazSp90YaAe7CdHGL209AudmJoe1PyFStxoX FzyWDaGClwr3y8Rn15AAV/fKwI74Inr30CJtiNiwJjdG/l/HgMsqLqtaWvBr+s7AG4uC tZUuNADmp/q8l6uCJEjwwi3ItEu4YoVu2MripuOj0YZ5pGQTdi5Uk1eGABjltKtPYH9H AIEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=21YW+6fG17bA3AZxmYV1MGGTJ8p29kWqv098XZo38z4=; fh=xqMMS0I8zVmxYwgMmmm0nqbeoz+2vyhsS9mJSWakhpg=; b=i8HKTKmwVOvZBsCwtRsBazzPjizbsTRERVweeVKVBpTsYD/cgUpm/lD3aJtNORWA5J xqIQBSg8eM3ruC636FjVSBWCgfN9Oq4eOmnxjwsGEGSdPOswwm2pMMa9GiGSRDiVFKyP KWyDMZwH5rQI/3fAP+WysVzA5w5inRmIOn2m45MN69DMFbGBnvRDwiqQdtQ940iHvkcg UqOIkymWD3n7F9MjLq2UPPjPIsLp2JYIjJn52gApazXo1TU/0dzJa/eRbMeaESJmYhJC UCy2GPzpHQjhOvUW3s/icbYry2hcMSSMq2XJMtkS40ZG8E0L5c1nib4EcH8F84y5K8hg 4Htg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=ZG0ykLbH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id u22-20020a056a00125600b0068a54cfcd74si5172669pfi.192.2023.10.30.10.54.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 10:54:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=ZG0ykLbH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 79DBE80AF3D8; Mon, 30 Oct 2023 10:54:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232992AbjJ3Ryk (ORCPT + 99 others); Mon, 30 Oct 2023 13:54:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231263AbjJ3Ryj (ORCPT ); Mon, 30 Oct 2023 13:54:39 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34303AB for ; Mon, 30 Oct 2023 10:54:36 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-6c10f098a27so967580b3a.2 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=1698688475; x=1699293275; darn=vger.kernel.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=ZG0ykLbHGUD2GEH950QKtsgGnijgHqeey8cIAPrvU4XcOoUXswe7Rjb9+T4IuEcEL5 EeMt4evioD8oS4Z+0ZqzarMe3xet3Wrer3jgjz3XGpU/y0lCBTYoCQ6xWQflByR+N6L2 rGA4xcfOavWqw5h6o8VpGQHXYXrFfUmuub95g13K0fBJ9Y1avNCwFsWXcVwMHKOv0iWs gf9LkKxQ/sJeSsLQrC14UO4pYOr4oSiN9j2xbQrX7DhpejnPwWB9iBYyXYU/SJFJ7nyi I1dIdSXB1Q2TcQMWMkNP+sK8E2jVk0ledp5TQYwkhJ0iEs48mt0T53gWChSMb9CaWrgU iQ4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698688475; x=1699293275; 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=Ue8VZXoiCp9+uTz+MxBcFVaISwqcUL81y71eeW6mbqGqWHB14j2zSwufEYU75ETu33 eIF4UCkI4uqwJawU7RHbu9uWyGwSgbOIzQaCiMe3uQRlC5vcqfzUqIxgi4HHMFhFeSJY S/ifw6CL704LpJfOiIsq2ttw+rKcw+Nnxpr6eW0/5G7ZopDxotW05NxOVKgAy2oNJLUl nh62oJZiECQ1ya1f1p/2g9cJUgG9SO+WrZd0+qG6j2Sd//+HDowkjc03epZ/icctp1or 7ge3fxD/Gru6BWa8B7zTavuwk49E9K5qlMV+xWCQb3nokHSVBjqeKVJIzOJ5pD21Ot+l gxeQ== X-Gm-Message-State: AOJu0Ywnhp8VD8H1iEHSi//fCKBaI0vJviZUINPeGq0i2LD5DKI5c9+0 opzDtJsS+k4THuDLjtrroW6i8w== 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a5s0yyje.ffs@tglx> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 30 Oct 2023 10:54:45 -0700 (PDT) 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