Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1101608rwo; Wed, 2 Aug 2023 08:44:22 -0700 (PDT) X-Google-Smtp-Source: APBJJlHeb13hW8RQuo1z+2GKr5K1CJVveZA4A9Fskw1FDh1V0X8InFCTDe/4UXzGfeYTHCSL2DHI X-Received: by 2002:a17:906:74cb:b0:994:8e9:67fe with SMTP id z11-20020a17090674cb00b0099408e967femr4919563ejl.35.1690991061984; Wed, 02 Aug 2023 08:44:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690991061; cv=none; d=google.com; s=arc-20160816; b=ZlnBxykkGcR2D1jxZMrC6QIMcZe/JeJ+AFBcXklIixQmuLGLteWTteSZmzZBpseKCf 7Pi12pTwQ8uvWpO00HiKiU2Qb5z3A3h+pa/MplEuoyg6beMTrvi4LP6dBvBcvXK5SdxS 4h1KJtINuDPai2dxSFzl59l+DQBTZ/P/vIjhBtoBCfkHNaoX+k5fu46Sw7h82u2h+4YU MLFwuj5Y5QdGDWEORIDSwsi+cehpoIgve3b2lw7a+ncqok4kHGaECMBieikId3EZ0jUR gYfsm4eyBokLC0vDuGaprnFssswH5M5SJUjByGXrx1mO3KvKQ3P8+rH0VkhbkCzW6/zF lfuw== 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 :dkim-signature; bh=Zrnu0/L77MNW1fa/WdNXwcEGI7LPKgy7NUxx30oiKO4=; fh=9LhevukQlN8QgABBNKHWl1nBtSwK1vKoyAVqIrNCnSI=; b=EyYYqhDEpbTwGgdAopIZ7zRk1t6e1YGoENZWyoxe0L1fughDhE/hmtYdShjiAyArxy EiH6RHC3N77f3SqtaU2ez/ZCZ/YIERmrmTu3i4YfW7Hq1vpc4NqiNHBC12uNttTN7Am7 Hv536BuJuvMQb/xmzXw3CEmH3hXJ9g/QqoUWrkplvo/lQg7f9YxTy+P5DB8CUCM1o6mj uOiYvmnpNMbmIMgB+RW/s5S37mnYwGcTsWAVEfF6ls/OdyQ/Y5am8SaSyWn9jmSPG5hn 4m/uI0zZtyEjVmxaBKsLijy/F0LZ5SmUbua96fQdAlVW4XE1s+30Vx4C56UfPbBA7tDE 53gw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=o+GTk+Zi; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h15-20020a1709063c0f00b00993ebae9929si9787686ejg.708.2023.08.02.08.43.56; Wed, 02 Aug 2023 08:44:21 -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=@kernel.org header.s=k20201202 header.b=o+GTk+Zi; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235154AbjHBPWY (ORCPT + 99 others); Wed, 2 Aug 2023 11:22:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234923AbjHBPVy (ORCPT ); Wed, 2 Aug 2023 11:21:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CC37729C; Wed, 2 Aug 2023 08:18:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 19A2361A10; Wed, 2 Aug 2023 15:17:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68AD5C433C8; Wed, 2 Aug 2023 15:17:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690989452; bh=7g0cOtIPkTfpyTVkaC+imOD6lb85coVQ5pyYai7ah8g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o+GTk+ZiTqrD50iO1u+Je+SWZGXJ8Ykl+Kd2uDp2GWXfLqyxNMBGGoKLq47yWby6/ Grucz//CFkdABFja9oavh7p0hIl+v8DkAzPsThD7LrkPk/4MWmVJxVSsE9wzX8/FZJ CstVqxfxeHocIXHyfPrUsn3nZ4t0JO8dtNmEldKeMb0nhMfFkO7N/pGEpgFGV7Atd6 AhLtDUvem4RlppYeFSpP1CwRYzz93yhezO89tL4c6Pj0vV8hJVLLzYjsa5UcVLpArx hfynAGhFjQQfJcuEOqtYF6ZDPcgHYqa9M0ap3SEnoIwG/oU406YjcI80x5hWsAIbti YOH3EVR0d30gQ== From: Jisheng Zhang To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Andy Shevchenko , Jiri Slaby Cc: linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] serial: 8250_dw: fall back to poll if there's no interrupt Date: Wed, 2 Aug 2023 23:05:45 +0800 Message-Id: <20230802150545.3742-3-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230802150545.3742-1-jszhang@kernel.org> References: <20230802150545.3742-1-jszhang@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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 When there's no irq(this can be due to various reasons, for example, no irq from HW support, or we just want to use poll solution, and so on), falling back to poll is still better than no support at all. Signed-off-by: Jisheng Zhang --- drivers/tty/serial/8250/8250_dw.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 7db51781289e..39db768517eb 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -524,8 +524,12 @@ static int dw8250_probe(struct platform_device *pdev) return dev_err_probe(dev, -EINVAL, "no registers defined\n"); irq = platform_get_irq(pdev, 0); - if (irq < 0) - return irq; + if (irq < 0) { + if (irq != -ENXIO) + return irq; + /* no interrupt -> fall back to polling */ + irq = 0; + } spin_lock_init(&p->lock); p->mapbase = regs->start; -- 2.40.1