From patchwork Wed Oct 19 08:22:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5222 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp265548wrs; Wed, 19 Oct 2022 04:22:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4LidKKbP8UGobQwjxACTP2VTixJFjN/S+lu9XnrzCW7mp8wigx+2b1hN8sNMbk2WniFRjs X-Received: by 2002:a17:903:258e:b0:17b:a251:c80a with SMTP id jb14-20020a170903258e00b0017ba251c80amr8024180plb.110.1666178560253; Wed, 19 Oct 2022 04:22:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666178560; cv=none; d=google.com; s=arc-20160816; b=Yan+0qdOSzaf95ZVpUtnvF5qBFV0pbQcLva1E1vxYLwtdF51cfpCok3ziLYPQb9WJz dV2VZH8az5H+v6ZDlDvcWzhGFrFMuI7cz+BcSI4nXg/0FUhzZGy7F291fhODdJGZKrwu qlQoeSZZboykPwgD66CodZsnoaK3uTXvkqj7GsdsL2EAo0qPu77Pw0Zf6BHOisIBia3S FIZZG00lwHUP3r+WAL+9KU6i4M+72oBJPB0GoBYoGJHV8f+7hVIP16xOp7+zGJNQ5Bbn CPSeXC4QPO+P5KNPv+HdYlXGL4LiTXAS3tBS9DCZ+k/HwH3P1Q1lc6p88pBYTpAFNMN7 eSFQ== 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 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.26; Wed, 19 Oct 2022 04:22:40 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747114850095517745?= X-GMAIL-MSGID: =?utf-8?q?1747114850095517745?= 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)