Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1135020rdh; Fri, 27 Oct 2023 05:56:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFr0jc4Qal98KD1nWldFIhH9Kq0XqT1BDONNf4HVfPhRNbR3le+qqRHZet/eKDV7prtUp0S X-Received: by 2002:a81:ae1c:0:b0:5a7:d9e6:8fd4 with SMTP id m28-20020a81ae1c000000b005a7d9e68fd4mr2802717ywh.12.1698411411793; Fri, 27 Oct 2023 05:56:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698411411; cv=none; d=google.com; s=arc-20160816; b=YsAxNB2p0Pe5D7+goASo9rla73xC1ZlIixIBWghJWEs7OVKar19ETUkbyMOrgSsuKt wh0D3x4V23ef8X+rGRm70fhbU1SkU9S0yrzLFJHiUNv2N2ixNGZfkQouNHUMbLAy7cob QlyPBVFeCnocoHl3iYo6ur2egT3GbXRIeKdgBfdVELrImE3+snoILlPu61QZVjLUAx4U 31KFrluUGjxPq1o+1Q5LUvsJvNuBnDJnQV4iQ2YhzzOFB/qOJ96NoNvTlxwCR5LOXKAx /nhrLQnMjjxLiJtS6kC6pwJih5hZZNyniGB9uBL0ISm5YtbJi9Fe8Zz3Kgy4KJ7MLD5F Q17g== 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=NtR5YHlVvuHvzI/nsFjHhzkEP3xQ5iNgT/02AgGSWcY=; fh=U+L6H2Iabh4xdi9P7tKrqfSzWqWVFB+uYyqZvAYy2io=; b=1D9r2r3kruYJvF2Jcsqkz5e2+HAFckIUvV2nk12Y3CnlACvv0DOqBzgeiQbDflURk8 ah6YugizJ0nYxTuYrFWnyrjfcVBMXP/SMjEe/SYu3Y0WpO2db8sOV8TS13rIiyklq3Sk tz0Fzn8Ej0qoIDM7hnzDJ/GwvA6byQ6X2z/jrZkcTius3q3tksb6ljW3PSWuk8IhxiJ/ vyH7VjEaO75IBL/Qego7c+vsx4atQ+cCuV9y7wyOiOZyUtOINMwf07dWryNYR3Ruoj5m kHUIlLje5OOFzb2GxUyESiWwIj9iDRA0GTit+g6yVmcjGESmrS4K0Wbqd2djRbAOIIwP nz8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=eaaagx6N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id n14-20020a819c4e000000b005a81a489448si2359554ywa.267.2023.10.27.05.56.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 05:56:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=eaaagx6N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 5CE338074CE1; Fri, 27 Oct 2023 05:55:26 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231675AbjJ0MzR (ORCPT + 99 others); Fri, 27 Oct 2023 08:55:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231305AbjJ0MzQ (ORCPT ); Fri, 27 Oct 2023 08:55:16 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D96E129 for ; Fri, 27 Oct 2023 05:55:14 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6be840283ceso2001482b3a.3 for ; Fri, 27 Oct 2023 05:55:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1698411314; x=1699016114; 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=NtR5YHlVvuHvzI/nsFjHhzkEP3xQ5iNgT/02AgGSWcY=; b=eaaagx6NDkfQFgJo9sUQQmAQNfajIGMpoXKob72Poy79+Ux5Ksmp1ACsWi5q04olmg 4H6DQtFNdYdYKNljv++MNGOgGL7lntA58GKdrN3WI+AIz5EIn8VQ+WGhNWmlUG2Y+OlJ qK8lfyKbpgYWvNVXCceHQ311fa9K/4So1K0Olvdxx8hzecyqNjh6YO7HJ62LXKubO9xb GyTLR8h5sArH7U81tKasS0PdncPEiOkMnWyUsrT36i60PN1EDQO6tySOVTw3va7JvRn/ GtgXG2YtFEhYLmbS56xu4hdctI3FLs9PO8DZdp8nEzmqkHQB36NAxYG7xNgj4hWK8AKF 7U7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698411314; x=1699016114; 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=NtR5YHlVvuHvzI/nsFjHhzkEP3xQ5iNgT/02AgGSWcY=; b=pb3Ev7OFHTGxu3UrpiRBq7THttEu6mfbKYPUFLeBZ7k4WXsGFObrlCjLW0dxVp6/LN jZLfosNis0rrhTacX8NUL6MmCqfG+F6Wx4r/L4sxm8+j18/btK6QpbUnWlEAhCLsQ2B4 DnGxaeLGwmFWHHLBVQDO18CDnQgBflCMfBCNqvgtK6zYM98X0Ub/b/utJiegNZK6tmY4 NuE1vYfgDDPn5X/vjiPNyUEig1hii29bA1uwz7OG7vmxWvJFIJa5huIznF0cE4vjLbtU HooTa6PAo3/TmYT738uSXUKUVZwIkdXcI+tH7KvP0pnUdLn2YsN+tfEHl0+bJ43O+poh Llig== X-Gm-Message-State: AOJu0Yyj88tfGtSwXkCka0V5j2YMsuye9KaZQ6IfZCvb3CvYzqzy3swD jJ4GWr+hVT1elpd1nvazc8ugpQ== X-Received: by 2002:a05:6a21:a5a8:b0:174:129d:3978 with SMTP id gd40-20020a056a21a5a800b00174129d3978mr3501864pzc.32.1698411313970; Fri, 27 Oct 2023 05:55:13 -0700 (PDT) Received: from sunil-laptop ([106.51.188.78]) by smtp.gmail.com with ESMTPSA id bu22-20020a632956000000b00528db73ed70sm1053268pgb.3.2023.10.27.05.55.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 05:55:13 -0700 (PDT) Date: Fri, 27 Oct 2023 18:25:03 +0530 From: Sunil V L To: Bjorn Helgaas 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 , Thomas Gleixner , Greg Kroah-Hartman , Jiri Slaby , Conor Dooley , Andrew Jones , Atish Kumar Patra , Haibo Xu Subject: Re: [RFC PATCH v2 06/21] RISC-V: Kconfig: Select deferred GSI probe for ACPI systems Message-ID: References: <20231025202344.581132-7-sunilvl@ventanamicro.com> <20231026170408.GA1825378@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231026170408.GA1825378@bhelgaas> 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 fry.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 (fry.vger.email [0.0.0.0]); Fri, 27 Oct 2023 05:55:26 -0700 (PDT) On Thu, Oct 26, 2023 at 12:04:08PM -0500, Bjorn Helgaas wrote: > On Thu, Oct 26, 2023 at 01:53:29AM +0530, Sunil V L wrote: > > On RISC-V platforms, apart from root interrupt controllers (which > > provide local interrupts and IPI), other interrupt controllers in the > > hierarchy are probed late. Enable this select this CONFIG option for > > RISC-V platforms so that device drivers which connect to deferred > > interrupt controllers can take appropriate action. > > Quite a bit of this series seems related to the question of interrupt > controllers being probed "late". > > I don't see anything specific about *how* late this might be, but from > the use of -EPROBE_DEFER in individual drivers (8250_pnp explicitly, > and acpi_register_gsi() and pnp_irq() and acpi_pci_irq_enable(), which > are called from driver .probe() paths) it seems like interrupt > controllers might be detected even after devices that use them. > > That seems like a fairly invasive change to the driver probe flow. > If we really need to do that, I think it might merit a little more > background as justification since we haven't had to do it for any > other arch yet. > Hi Bjorn, In RISC-V, the APLIC can be a converter from wired (GSI) to MSI interrupts. Hence, especially in this mode, it has to be a platform device to use device MSI domain. Also, according to Marc Zyngier there is no reason to probe interrupt controllers early apart from root controller. So, the device drivers which use wired interrupts need to be probed after APLIC. The PNP devices and PCI INTx GSI links use either acpi_dev_resource_interrupt() (PNP) or acpi_register_gsi() directly (PCI). The approach taken here is to follow the example of acpi_irq_get() which is enhanced to return EPROBE_DEFER and several platform device drivers which use platform_get_irq() seem to be handling this already. Using ResourceSource dependency (mbigen uses) in the namespace as part of Extended Interrupt Descriptor will not ensure the order since PNP/INTx GSI devices don't work with that. Is there any other better way to create dependency between IO devices and the interrupt controllers when interrupt controller itself is a platform device? While using core_initcall() for interrupt controllers seem to work which forces the interrupt controller to be probed first, Marc is not in favor of that approach since it is fragile. Thanks a lot for your help with review and feedback! Sunil