Message ID | 20231025202344.581132-8-sunilvl@ventanamicro.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> 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 590B0C07545 for <linux-arm-kernel@archiver.kernel.org>; Wed, 25 Oct 2023 20:25:28 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kIx3EIJhrk8Y9UdrGi4WmGySwMUbwQa3EwTzFLmaHEY=; b=5GzEK09FbC217E lpXTOAkm94ONAV8AyChuXH6GJlkY7RYs6LSh88rbWL2mrKHxD8qe9y3xtK+VYRwGFMoebnuSjuzhi yEx5RecIHFx8INOiZyUETLOxTuVYtTkqbp12HM2fDvKcFmEyVGIVUTSXt73VVa+rCrIBaCSG5S/sb gurjgUQcRnew6U9iOvQs13VDNDkn+OEYqqQZjevlB6JUN3q29WViV5w2CzL/ccMxtr+hNI1Pcggn7 PmKy+c+uPDqivN8rVkm5NoMWDxb2anG+wCOMKj1nybWP0K1KNljqE57jjWas/+kyWZFqJR+xEFX4n 6aiAmGP+QoyXNAwER6pQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qvkRA-00D32S-2m; Wed, 25 Oct 2023 20:25:08 +0000 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qvkQs-00D2nK-0z for linux-arm-kernel@lists.infradead.org; Wed, 25 Oct 2023 20:24:51 +0000 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-6b9af7d41d2so154466b3a.0 for <linux-arm-kernel@lists.infradead.org>; Wed, 25 Oct 2023 13:24:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1698265489; x=1698870289; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2bjA2IFkbvQ+cjwZ90V9r6vmNOzBSbezE1qJqMO1A+c=; b=i+W23NRdmSfj8GRMU0+gqpM+b8UprXw2ZBgby03jq+RfupkKT3iwdAHlrkqEnp3Kv0 BO//6hJgYkFZkIENT3Ep+XGCB4mGpS3oTJZcVllfcQ36MUdbSOh5DEDHnZgfIBDj8O5b og07QMacmAnXLPxj8GqKIifOaYRxgRavP8ghAYVx3uKxjbjyKyERHqxw5eJdu1EcE2LH hqPpa3kvwjdj1evHYmzLvk2Jan4NR9p/4ZTQptkxCiBh/bdMUUqTUeFHfOAckhZYZviC Qn2P9t8Vo0/61ouUYREuNhBguzgDwYKvKBzwR5bZjrRjNepB3ugfllf6g/qFvW3+84Ro zTpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698265489; x=1698870289; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2bjA2IFkbvQ+cjwZ90V9r6vmNOzBSbezE1qJqMO1A+c=; b=b3FTKZU6vzdROJ0igolHscdt131e9ScV8r5WlFwIRfvVA+2r4ZS1ZtfoUefFBt7Qol 9B1tO/iTgKMyFUth0tDT1kuvPRiT2KwyvGwHDHqmW8/Z8VpLcoEDpfNdje2jYGX/cUUu 8W7siYJTN30UFr6I3iWZTJP3F1qZsUQ8YyXuXcreOV3/3wf7RfroUPYTDp/IaQTodj2u gMDctRvNbsD5wlnfyxSzGGZzCVhmzJWxaATaCXINxhOXzZXJ7AkKdCpUM26jrgmstGUL AIkUR3ohDnZ0vAL3/Brhyezt44sPkzjPdYY4vE2smuyrOQSEz8SVmI2d12w1zb7qwhSA N6Rw== X-Gm-Message-State: AOJu0Yy37r2DZgCVAP8DotF2OnEf/xlYekvVx3EgDP0s1AtBTeDwVHMJ VAs3NzYDZ5MgdvrPTG7B3rSblQ6VdDiJNQ95GphdUA== X-Google-Smtp-Source: AGHT+IG0SpgdyiZkoMurZXPLkoY/g9K3mifAR/RprvidWByJ+cvRjgFm+eLWR/dX/aORh+7WvaUdiA== X-Received: by 2002:a05:6a21:33a4:b0:17b:3cd6:b1bc with SMTP id yy36-20020a056a2133a400b0017b3cd6b1bcmr8121322pzb.14.1698265489371; Wed, 25 Oct 2023 13:24:49 -0700 (PDT) Received: from sunil-pc.Dlink ([106.51.188.78]) by smtp.gmail.com with ESMTPSA id y3-20020aa79423000000b006b84ed9371esm10079590pfo.177.2023.10.25.13.24.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 13:24:48 -0700 (PDT) From: Sunil V L <sunilvl@ventanamicro.com> To: 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 Cc: Catalin Marinas <catalin.marinas@arm.com>, Will Deacon <will@kernel.org>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, "Rafael J . Wysocki" <rafael@kernel.org>, Len Brown <lenb@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>, Anup Patel <anup@brainfault.org>, Thomas Gleixner <tglx@linutronix.de>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Jiri Slaby <jirislaby@kernel.org>, Conor Dooley <conor.dooley@microchip.com>, Andrew Jones <ajones@ventanamicro.com>, Atish Kumar Patra <atishp@rivosinc.com>, Haibo Xu <haibo1.xu@intel.com>, Sunil V L <sunilvl@ventanamicro.com> Subject: [RFC PATCH v2 07/21] serial: 8250_pnp: Add support for deferred probe Date: Thu, 26 Oct 2023 01:53:30 +0530 Message-Id: <20231025202344.581132-8-sunilvl@ventanamicro.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231025202344.581132-1-sunilvl@ventanamicro.com> References: <20231025202344.581132-1-sunilvl@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231025_132450_360476_20FB6603 X-CRM114-Status: GOOD ( 16.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
RISC-V: ACPI: Add external interrupt controller support
|
expand
|
diff --git a/drivers/tty/serial/8250/8250_pnp.c b/drivers/tty/serial/8250/8250_pnp.c index 1974bbadc975..dcb3daf7c816 100644 --- a/drivers/tty/serial/8250/8250_pnp.c +++ b/drivers/tty/serial/8250/8250_pnp.c @@ -8,6 +8,7 @@ * * Ported to the Linux PnP Layer - (C) Adam Belay. */ +#include <linux/acpi.h> #include <linux/module.h> #include <linux/pci.h> #include <linux/pnp.h> @@ -443,8 +444,21 @@ serial_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *dev_id) } memset(&uart, 0, sizeof(uart)); - if (pnp_irq_valid(dev, 0)) - uart.port.irq = pnp_irq(dev, 0); + if (pnp_irq_valid(dev, 0)) { + ret = pnp_irq(dev, 0); + if (ret == -EPROBE_DEFER) { + struct resource r; + + ret = acpi_irq_get(ACPI_HANDLE(&dev->dev), 0, &r); + if (!ret) + uart.port.irq = r.start; + else + return ret; + } else { + uart.port.irq = ret; + } + } + if ((flags & CIR_PORT) && pnp_port_valid(dev, 2)) { uart.port.iobase = pnp_port_start(dev, 2); uart.port.iotype = UPIO_PORT;
With pnp_irq() able to return error code, enhance the serial pnp driver to support deferred probing. Return -EPROBE_DEFER when pnp_irq() returns the same so that the driver probe is deferred. Signed-off-by: Sunil V L <sunilvl@ventanamicro.com> --- drivers/tty/serial/8250/8250_pnp.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)