From nobody Fri Oct 17 10:31:31 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 776E3C433FE for ; Wed, 19 Oct 2022 11:12:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231596AbiJSLM3 (ORCPT ); Wed, 19 Oct 2022 07:12:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229716AbiJSLLR (ORCPT ); Wed, 19 Oct 2022 07:11:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66B8115381C; Wed, 19 Oct 2022 03:38:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0DC92B822CC; Wed, 19 Oct 2022 08:41:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4BEE2C433C1; Wed, 19 Oct 2022 08:41:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666168896; bh=1rW26+ZwcA6tiLBS6hz+rgjIIBis7sdQ7KSHF1iXPo0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sZQEZ5iJxSbcYNFQa5lnAm3NkfGAzSzfkSt2WLXWcCNjO2fvImsdQw+At9kN1ck9j Xad1bSk8vEUGuH5A+Spm5EIqDPSTyxcXwFsNaSIuIrGSjDJEq4Qq1oPFnfMl7SlQWm BCMGvDmczwU6B1wrSEYrxl+14En59KlrEDXT5R84= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe Leroy Subject: [PATCH 6.0 090/862] serial: cpm_uart: Dont request IRQ too early for console port Date: Wed, 19 Oct 2022 10:22:57 +0200 Message-Id: <20221019083253.923565134@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Christophe Leroy commit 30963b2f75bfdbbcf1cc5d80bf88fec7aaba808d upstream. The following message is seen during boot and the activation of console port gets delayed until normal serial ports activation. [ 0.001346] irq: no irq domain found for pic@930 ! The console port doesn't need irq, perform irq reservation later, during cpm_uart probe. While at it, don't use NO_IRQ but 0 which is the value returned by irq_of_parse_and_map() in case of error. By chance powerpc's NO_IRQ has value 0 but on some architectures it is -1. Fixes: 14d893fc6846 ("powerpc/8xx: Convert CPM1 interrupt controller to pla= tform_device") Cc: stable@vger.kernel.org Signed-off-by: Christophe Leroy Link: https://lore.kernel.org/r/8bed0f30c2e9ef16ae64fb1243a16d54a48eb8da.16= 64526717.git.christophe.leroy@csgroup.eu Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/cpm_uart/cpm_uart_core.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) --- a/drivers/tty/serial/cpm_uart/cpm_uart_core.c +++ b/drivers/tty/serial/cpm_uart/cpm_uart_core.c @@ -1214,12 +1214,6 @@ static int cpm_uart_init_port(struct dev pinfo->port.fifosize =3D pinfo->tx_nrfifos * pinfo->tx_fifosize; spin_lock_init(&pinfo->port.lock); =20 - pinfo->port.irq =3D irq_of_parse_and_map(np, 0); - if (pinfo->port.irq =3D=3D NO_IRQ) { - ret =3D -EINVAL; - goto out_pram; - } - for (i =3D 0; i < NUM_GPIOS; i++) { struct gpio_desc *gpiod; =20 @@ -1229,7 +1223,7 @@ static int cpm_uart_init_port(struct dev =20 if (IS_ERR(gpiod)) { ret =3D PTR_ERR(gpiod); - goto out_irq; + goto out_pram; } =20 if (gpiod) { @@ -1255,8 +1249,6 @@ static int cpm_uart_init_port(struct dev =20 return cpm_uart_request_port(&pinfo->port); =20 -out_irq: - irq_dispose_mapping(pinfo->port.irq); out_pram: cpm_uart_unmap_pram(pinfo, pram); out_mem: @@ -1436,11 +1428,17 @@ static int cpm_uart_probe(struct platfor /* initialize the device pointer for the port */ pinfo->port.dev =3D &ofdev->dev; =20 + pinfo->port.irq =3D irq_of_parse_and_map(ofdev->dev.of_node, 0); + if (!pinfo->port.irq) + return -EINVAL; + ret =3D cpm_uart_init_port(ofdev->dev.of_node, pinfo); - if (ret) - return ret; + if (!ret) + return uart_add_one_port(&cpm_reg, &pinfo->port); + + irq_dispose_mapping(pinfo->port.irq); =20 - return uart_add_one_port(&cpm_reg, &pinfo->port); + return ret; } =20 static int cpm_uart_remove(struct platform_device *ofdev)