Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp699645rdb; Fri, 2 Feb 2024 00:49:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IGz7Wbly7Ln1JCnQGohXufyojpMnAvT86VgLRnVsGFvwlz9KoSdJQSP0/naE86yX8IBdr6r X-Received: by 2002:a0c:e046:0:b0:68c:79b5:959e with SMTP id y6-20020a0ce046000000b0068c79b5959emr3969490qvk.39.1706863782706; Fri, 02 Feb 2024 00:49:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706863782; cv=pass; d=google.com; s=arc-20160816; b=XyPDTJZAkV61EB5WU7kITfZZ0PdCE/FHGj8ofgQPfOXivStPWh0F5LLdGE2CU8dVBk PzIcEvixm0loDW3RKWrvThc6zPDmr9UEJ98qMRZgRC3TFGdjKjgtJJNhtQUm0zbjph3V 51o6ZmG6V9pODtOlsDRN+gFKUcCc4dzi8FzG7Kgcau0e2JTZ5k5DSH8ao1cPzH2uolAA X00bzFR7FYYU4y+VUUa8hDKRgRSLU26BXwuXMG0ulWPljZrgBDIbJr7GbZ6Qcxd04NJ9 g7hieiP+Aqsljo2tkHlBucD8DNTPGKsjjoKXuDC/s8RoPGym6lRg5/s4owH6FAtMLd9t qHnA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=TItsROaQHyjEbJFLwPA4KC7BHoQVWA8FloUjcj8REgk=; fh=C6EqDQGIlNca8LFpgtfNfrx3q7O6T+k0bevyKajcZ84=; b=Ez2+5JpOXMqbpz1V2mMAt1C9nSJdWjcM48MWnsK/qMULni02mxMK8VR8NP3LeCqeux lOFf2g5syk3Bp4K7VeMeU/Dg9axFWgXNmw2skp8PSa95eAayYYHwj8sYeUWLLW/AzlhL Oq4KtZXvPg4OJL3MqTZlfT2IuW42vbprx0rsaI5G7Xcqc3rdf1nDz3h9hfdiuNIt7Hnh GiYUqIk/BZSnPIaPSyzg8wPD2OMalSaZY+ipVLz9uXFY5LF/mjjK5JpirKZTuZIf1SQO x6CoYhra4p6o+pXPFNeBBHvMpo20hEptPzlmdVPxmpQu+Ojt+Yz/0rO8GesHDMR9erk+ gNvw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=lpOw8qrT; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-49503-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49503-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCVTLPWYtghrTxBVlH4KOGrpunjZDEK0QWSOJrd6s1k14sUTKp5WUa16fEyMEj436Blw5L6SkJcv8nDJtFY6YM1tWRDA8/Zb7Xj8dtVomg== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id o15-20020a0ceccf000000b0068c43de18ffsi1445613qvq.133.2024.02.02.00.49.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 00:49:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49503-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=lpOw8qrT; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-49503-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49503-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 682FA1C267CB for ; Fri, 2 Feb 2024 08:49:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C204A60270; Fri, 2 Feb 2024 08:48:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="lpOw8qrT" Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5992D5FF13 for ; Fri, 2 Feb 2024 08:48:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706863721; cv=none; b=FZCQuhWtWN8eAW74keLI5Hl+XfvF+07Jwf2ChZLJveYN1Un7vEXfivfsmW2VM7qZANw3N6r53RoFFKYATxtHfy0sZivaBuQVAMn1k8tMwYhKOOeh02HkyKKYgvD8GQqh983IXntjbiY34NYqaew+iKGv/HQUitOYBGTaiABnspo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706863721; c=relaxed/simple; bh=sxX6A1jY2QUTnGziquDNeweaFL0CvM8/+UjRl9k6dKg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dSVaY0y5XfRULNeFyv69IGY93yHQoSyqrpbkWKt9ciC2cztq6DQiliKUZZk8N58opQV4v9pdCnVGgTT8gwS37agVRkQ5vYy9AzYlnEZ4lx5xCKetLlRs3VyzDY1yDOcxMNhteI3/oobH+8I5EQ5RRt/VblC0za5Y8Vf/q53ABDU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=lpOw8qrT; arc=none smtp.client-ip=209.85.214.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1d73066880eso15971605ad.3 for ; Fri, 02 Feb 2024 00:48:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1706863720; x=1707468520; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=TItsROaQHyjEbJFLwPA4KC7BHoQVWA8FloUjcj8REgk=; b=lpOw8qrT/7eEPoth7zOhVcLEX9OJWruHy4yfIfIdqquPCOvj67p5PV4ysnSJnTnSEW qCwxnCOsE7nfCHNbgbIJwaz0M47byGNvhfWcaP0XNotebjeCXZcy9+zH09oTXXgunGO6 Nq/kYlqIz+ZHMwJlGCFVp7Wn0NFGLegQQdCbIkR1Dw2NlA2p8oXAuFSlyxzFUwq976c8 M5MpsXewjGUnFOrvBLuMfQVErU35kcW6O+bEIOHzvAmiA0ytXdAnV96XTQIr+j9pXjsI nwicTAbaFkyI3IAfO2vAvHLlB0i5yud7pRqT/hW5SwIb3sjjWDc2eEVe3u3Tc2VOmZpD aJ8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706863720; x=1707468520; h=in-reply-to:content-transfer-encoding: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=TItsROaQHyjEbJFLwPA4KC7BHoQVWA8FloUjcj8REgk=; b=j3K52nHef8o/B4iMwIT+XSJ7ZP4Ld4wCvb9f60KywZ+XkkKEcNAEkB9gsmCG5rbidq hOXs9dN/zWmqNj2is/09C/JbfJwUigq0nKHpxRSApAGYOFZfLV3LW110oMhY/AbJpNPb fs0rSrT3YrjGiAGpLKFEI6XibghIQbcTXOa67PBNbNn/ok4gMGEgIrEyOb5RxuIHO79L tGp/kkWXgMvE5NIadbqx7q3ZQom9hLNQNNCot0H4Royskk7PZJGmHcMQeQXqlQ9vrckr EQJwY4OP+l2AtUdNUNNmvXbJT0b3XWVG+LYsyRRb9r2f5zZV69Bzm66DozSANlkTxZZV MiXQ== X-Gm-Message-State: AOJu0YxQsMCZPNvNv5wq2126MZ7lIyDDLcymg3bWRNmwokee+LKkxP+t lI0wP3AznrqMMsMHOFKwGKPBgcHNN60hqBiJkEnoWFfmtyaYrwWt9quiM33AgX4= X-Received: by 2002:a17:90a:9415:b0:293:eaec:fd67 with SMTP id r21-20020a17090a941500b00293eaecfd67mr7058447pjo.14.1706863719736; Fri, 02 Feb 2024 00:48:39 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCXTEwJbtE+hsf4fe9iCtFquFGaddaPiWZ6SnyAr0Einu4dhTiJbRdR7UsVh3wDijhbLCJy4cgq+WMa32kNB4DVIJ2CTvjvXu0QA+jepl2n5oU047rQfjh9yHEHsiiZ+3aZVPN2LIIzPHR59vKArcMIcOGJnWSGcxBhqXb0TN0G04w4wTYfPowAIDmztFuw3hXmNVpH/zvuBW4p/QvlVMswA4AJlDPiFke0+cJC8VBOZEPAQgzm4hnXEjuGRTNbSYioOI/Q++uuarI9wkhlxcl5I/iYC8zOTF+O5BAWMOKXF8GJmHwEOCoeUxQ21aQ/KeZpdSNG+68oMJ51E2GniW1hMaJrxApOTFBMSMCQGwlT0ne8wRSNvA2p5z5j4f9Y1MkgOUW/sdryWa5PgJxIHDqPHSheCrCT7xbEOIL8mNdusCKQpve8UzaMbCRG6fEz3HztBo4io4GCsbdgYf/1hEo6jY7yscTM4euX7ng586XMYFPY4lUWHwAeHZb1XYtHyRIKmbQ43J31dY25rJbxYBSi2SXlZTf1I+etr5v6pZjLBurjzWF9YzWmS602pOBZV+Th8SH99xW9a0+HO/D+WYHwmaRpdLRXX+xGrUGyJKI4iS992HPL5L2yc2C19Aiu/pkxxCLNMOjjMh6SewbZHG5CEqgva9cPnS9GJGjqgxTvbudduv7QTe0cO9p6r6VSsC1kZ Received: from sunil-laptop ([106.51.184.12]) by smtp.gmail.com with ESMTPSA id kb3-20020a17090ae7c300b0029647c140ddsm564007pjb.17.2024.02.02.00.48.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 00:48:39 -0800 (PST) Date: Fri, 2 Feb 2024 14:18:31 +0530 From: Sunil V L To: "Rafael J. Wysocki" 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 , 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 05/21] pnp.h: Return -EPROBE_DEFER for disabled IRQ resource in pnp_irq() Message-ID: References: <20231025202344.581132-1-sunilvl@ventanamicro.com> <20231025202344.581132-6-sunilvl@ventanamicro.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Thu, Feb 01, 2024 at 07:00:51PM +0100, Rafael J. Wysocki wrote: > On Wed, Oct 25, 2023 at 10:24 PM Sunil V L wrote: > > > > To support deferred PNP driver probe, pnp_irq() must return -EPROBE_DEFER > > so that the device driver can do deferred probe if the interrupt controller > > is not probed early. > > > > Signed-off-by: Sunil V L > > --- > > include/linux/pnp.h | 10 ++++++++-- > > 1 file changed, 8 insertions(+), 2 deletions(-) > > > > diff --git a/include/linux/pnp.h b/include/linux/pnp.h > > index c2a7cfbca713..21cf833789fb 100644 > > --- a/include/linux/pnp.h > > +++ b/include/linux/pnp.h > > @@ -147,12 +147,18 @@ static inline resource_size_t pnp_mem_len(struct pnp_dev *dev, > > } > > > > > > -static inline resource_size_t pnp_irq(struct pnp_dev *dev, unsigned int bar) > > +static inline int pnp_irq(struct pnp_dev *dev, unsigned int bar) > > { > > struct resource *res = pnp_get_resource(dev, IORESOURCE_IRQ, bar); > > > > - if (pnp_resource_valid(res)) > > + if (pnp_resource_valid(res)) { > > +#if IS_ENABLED(CONFIG_ARCH_ACPI_DEFERRED_GSI) > > + if (!pnp_resource_enabled(res)) > > + return -EPROBE_DEFER; > > +#endif > > What would be wrong with > > if (IS_ENABLED(CONFIG_ARCH_ACPI_DEFERRED_GSI) && !pnp_resource_enabled(res)) > return -EPROBE_DEFER; > > ? Hi Rafael, Actually, this is v2 version of the patch and there is recent v3. Please take a look at [1] for the latest version. However, your comment is still valid for v3. I will update as you mentioned. [1] - https://lore.kernel.org/linux-arm-kernel/20231219174526.2235150-7-sunilvl@ventanamicro.com/ Thanks, Sunil > > > + > > return res->start; > > + } > > return -1; > > } > > > > -- > > 2.39.2 > >