Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp890872rwi; Wed, 19 Oct 2022 04:23:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7bx+UTMbwt1KrMhCMRXj0OujWNhzhFGS3FO9+aV1cMeWChYqLdOgMJRXwm5dE6HobQHeZ2 X-Received: by 2002:a17:902:e1cd:b0:184:aa71:217d with SMTP id t13-20020a170902e1cd00b00184aa71217dmr7811273pla.77.1666178585440; Wed, 19 Oct 2022 04:23:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666178585; cv=none; d=google.com; s=arc-20160816; b=jhpC29C+c0ljpTwY+tPfl/yU1FqCJnpxpEJr9mfmcUwiGKnDhCn/Jar5Ldd54eVZeD ZQjle8vaUALWd2NNs7K2fXJl7eq61gW1KHFjf/9lms9sjXkPWUKZNyBYL1/ulE8tNOKj J+jpVtqGubrPGhOmE3Nc00s5WlGyx3h9ndq7gYVHxGIzD9f+hJzmTYHkkfIn3dFZ9Vx1 EotXWFtlLRCSFy7J/1Oiktl7ug/vA6uzDFUMt4/+E+wCG/yvXGlCWKmnvDe1yN/Tjnm4 /VqizT/gI30DFy2ArjGyiBOYhWrBO+x4964YeX+BBp8Oy8gt5BAEBOqjWv6uAWEFTVmr 8FSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JhSCCrgEMkeDeIUMI+ygNto2o9LXqzQNoXwaeAOPCsM=; b=l0N2cVsAoCZ9zvMnPc7uqtRXvOak1tVl7YRil8NAEwX216bruEeLGyvC1HWSZwb1ek 1Eqo6KOe7Z6uYNrzb+582/ev8EEfzcAO9LO9xvZc9rY0k4t4o8+H07ZIvI5U5KkmM9io WxtKD4UKJXuVn1mljXVRqxZrUaBRmOvqLcx3lFoygKQ9epzsL+tXDf5u46Q46uq1UeBN WZt85NA2SdiH33fQM5mgKu2aJhqr2MaD5GqV4vaZV1OH5L1PkIGxbHKDxO8UWcMQZkAU JklqCZb5J60ZJ5B93Zq4bjrX5/tfTOuB8EYHbMrOkLDxsmKOy/qqa6yiYG2KUZa8qs+D 00FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sZQEZ5iJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f70-20020a636a49000000b0042b9117b723si17440502pgc.794.2022.10.19.04.22.53; Wed, 19 Oct 2022 04:23:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sZQEZ5iJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231736AbiJSLM2 (ORCPT + 99 others); Wed, 19 Oct 2022 07:12:28 -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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 platform_device") Cc: stable@vger.kernel.org Signed-off-by: Christophe Leroy Link: https://lore.kernel.org/r/8bed0f30c2e9ef16ae64fb1243a16d54a48eb8da.1664526717.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 = pinfo->tx_nrfifos * pinfo->tx_fifosize; spin_lock_init(&pinfo->port.lock); - pinfo->port.irq = irq_of_parse_and_map(np, 0); - if (pinfo->port.irq == NO_IRQ) { - ret = -EINVAL; - goto out_pram; - } - for (i = 0; i < NUM_GPIOS; i++) { struct gpio_desc *gpiod; @@ -1229,7 +1223,7 @@ static int cpm_uart_init_port(struct dev if (IS_ERR(gpiod)) { ret = PTR_ERR(gpiod); - goto out_irq; + goto out_pram; } if (gpiod) { @@ -1255,8 +1249,6 @@ static int cpm_uart_init_port(struct dev return cpm_uart_request_port(&pinfo->port); -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 = &ofdev->dev; + pinfo->port.irq = irq_of_parse_and_map(ofdev->dev.of_node, 0); + if (!pinfo->port.irq) + return -EINVAL; + ret = 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); - return uart_add_one_port(&cpm_reg, &pinfo->port); + return ret; } static int cpm_uart_remove(struct platform_device *ofdev)