From patchwork Fri Jun 9 13:39:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 105646 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp962055vqr; Fri, 9 Jun 2023 06:51:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ54OfYVKTL+xtnk4DhdcRy+FaSyWgT179Ij7ozUgxCkjHRCF8YPyL6VVBJl6I2NUM2nxTt9 X-Received: by 2002:a05:6a20:7f8c:b0:10e:786c:8219 with SMTP id d12-20020a056a207f8c00b0010e786c8219mr1372129pzj.3.1686318698739; Fri, 09 Jun 2023 06:51:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686318698; cv=none; d=google.com; s=arc-20160816; b=odaSjcKjDUkdsysMb8CKUldm0lDOob0pKIHFH4Ja05qdK2sYX/KUBeh7qBrj/FOBBB e+Z883qdKq9LoBWRBiphxAK6LtdzJfJeUHdO0xdGmd63df2mojtlrRZGrzbncO9MmsNB 3vH1FihoeoeeH+nIub+fu8OUFg13Au9POwHpRkfl5d3Ju+4Jvzcu21mvg1r68fxYi9SA VS1Lf2hqScFuF9bYabYRQxxlJHdlxbpYXXjuvtgNUXFP36fAoyE3XPiDhml9yAZl/Y/E AcYEINgHpkvcGhF1VGscopCmy7qFUV59Df57QWt27tiR3YlUqa83/NNSFvEzQqaJpo7r cpXQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=oj6jjRL6KpUwiWnoqrGIJRE3r5WBRcldOIdGJdBymiA=; b=o0n/l4HfNhkExk39DMWa+Rbco6kh35AWix9RfksnGiGt4ZAFsTtz4ypc1L3kmgcy5M JfTtheXQrpOcTCRE4vKgOMmGRRcCYr3mdOoTr4qgbz1JhT0IH3R+24qc29WTGZn8ly63 wcywcBJIX40rrsMlTFjEY+Ba52Z7npWjKQNsKFAHpgJ/z/z8GIcJ7prt0YJpEsZP7G1Y ugqItvUel8AFhbXiLak9Dz88bfq7vNjmCLU66a6N3zkdXSf4gBqLevm6XG5KKbxQL6aN oTJqeVko3J4Edsa4HA3DeIVgkxIbdrs1HdvM82lVevUU5t11mRmw6XEmssTHI0pMqAtG EQcA== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b27-20020a63931b000000b00524b2358ffcsi2750493pge.574.2023.06.09.06.51.26; Fri, 09 Jun 2023 06:51:38 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238922AbjFINkE (ORCPT + 99 others); Fri, 9 Jun 2023 09:40:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231960AbjFINkC (ORCPT ); Fri, 9 Jun 2023 09:40:02 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6808B30F1 for ; Fri, 9 Jun 2023 06:40:00 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q7cL5-00015c-Ly; Fri, 09 Jun 2023 15:39:39 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1q7cL2-006DQG-Iv; Fri, 09 Jun 2023 15:39:36 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1q7cL1-00CbLA-Tk; Fri, 09 Jun 2023 15:39:35 +0200 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= To: Michael Ellerman , Greg Kroah-Hartman , Jiri Slaby Cc: Nicholas Piggin , Christophe Leroy , Rob Herring , Randy Dunlap , Liang He , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: [PATCH v4 1/2] powerpc/legacy_serial: Handle SERIAL_8250_FSL=n build failures Date: Fri, 9 Jun 2023 15:39:31 +0200 Message-Id: <20230609133932.786117-2-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230609133932.786117-1-u.kleine-koenig@pengutronix.de> References: <20230609133932.786117-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1479; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=UaetvPn93yjffnvRpl05XP9ES/YlsYyRkVTXp98DFLg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBkgyuPTpnk3tAaU03gC4tcNyer+VWIXMkAUiNKc HgxNljHuy2JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCZIMrjwAKCRCPgPtYfRL+ TjC6B/9zeis0/Hsbg7mICcaw8jshAoTaOCKLITarBQvJoy4Nb5Hw7DfNETfz++t9Is22wt/mU2A VOivO/vxkzDxL6vyRZA5qXQIKs5XUMYrMcWZipTltj/SlD9TtmHZuGMcSHFllbNhfc+BaZASspf /SkuBf0luljF/Hsu942HEm64CDQmtpDHdSU0blz50GQaW1vYp68q6Hne6Z5IAixcoB+Tmq9JbLW zmPqv9bgtJMVb1tIEL/iSVC9M7q7EX531/lSkErdRjbFtYYUIgKUwI9IGBTEfaLiVn4LT9QK1Rb I1aVrbuc7xwtYXaVc3oXrEQD5cKgZWsItmLFDqT3GWW+Cseh X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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?1768233315683118121?= X-GMAIL-MSGID: =?utf-8?q?1768233315683118121?= With SERIAL_8250=y and SERIAL_8250_FSL_CONSOLE=n the both IS_ENABLED(CONFIG_SERIAL_8250) and IS_REACHABLE(CONFIG_SERIAL_8250) evaluate to true and so fsl8250_handle_irq() is used. However this function is only available if CONFIG_SERIAL_8250_CONSOLE=y (and thus SERIAL_8250_FSL=y). To prepare SERIAL_8250_FSL becoming tristate and being enabled in more cases, check for IS_REACHABLE(CONFIG_SERIAL_8250_FSL) before making use of fsl8250_handle_irq(). This check is correct with and without the change to make SERIAL_8250_FSL modular. Reported-by: Randy Dunlap Fixes: 66eff0ef528b ("powerpc/legacy_serial: Warn about 8250 devices operated without active FSL workarounds") Signed-off-by: Uwe Kleine-König Acked-by: Randy Dunlap Tested-by: Randy Dunlap # build-tested --- arch/powerpc/kernel/legacy_serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c index fdbd85aafeb1..6ee65741dbd5 100644 --- a/arch/powerpc/kernel/legacy_serial.c +++ b/arch/powerpc/kernel/legacy_serial.c @@ -510,7 +510,7 @@ static void __init fixup_port_irq(int index, if (IS_ENABLED(CONFIG_SERIAL_8250) && of_device_is_compatible(np, "fsl,ns16550")) { - if (IS_REACHABLE(CONFIG_SERIAL_8250)) { + if (IS_REACHABLE(CONFIG_SERIAL_8250_FSL)) { port->handle_irq = fsl8250_handle_irq; port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_8250_CONSOLE); } else {