Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp1785261rwb; Sun, 6 Aug 2023 02:54:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEFjljYE/x4xlpx1cg75EjGoeDJmpXmz0UxyPdk8EgIKINcHNBCA2uVJcFRBFcWaP/+4YAR X-Received: by 2002:aa7:c244:0:b0:523:a09:c092 with SMTP id y4-20020aa7c244000000b005230a09c092mr5452440edo.24.1691315694704; Sun, 06 Aug 2023 02:54:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691315694; cv=none; d=google.com; s=arc-20160816; b=g05lgUgCJD9PShsnD7a+BIWj25c4YNTUqoiTh7b/ogRTJhXScDqFIwAVEoloTqow7E ZR//7rVTpoJdvYmObc5XosudsgOgm4kiAv0m8KKCLYcCnSGgGjXL1hfrVP4WWFOLMXZD qvV7KjT+vkTmdqCkIHP4N3aUFIvR6iozlHl2RV0XmK7rafZzo80y1Eh/rObI4Smm00mm WQNV2XTCL4/txg6d+TPFUxKi4HI7Jk3806/qNDM0IAAm9pCMPDtwD0OHu3JMDzdpZKf7 /dDVPci8M9Gatnc23T7H/aK0phOM1gjhx/Pt8mckZ5xuAnRgYhbJ67OQlh6giXD/xrb0 W19w== 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=ERumemdOiVFOlIHOtj67gaJ2faoeNW4yCGRBq5U5+Us=; fh=9LhevukQlN8QgABBNKHWl1nBtSwK1vKoyAVqIrNCnSI=; b=pXwBNOqgZRS82KksIXhrQRqd19hh9h32ZfHa9g650PYsYYvoAw4XVFTdbY/DPQgevJ ImPB8yzD7BBR4dZ9JUUXLnM39X/6bSlT/3I+ZQlscKefG+YOYp+x0Ug7c0Nbe/HFqzcV OUovjnoHjlV87JPKYknb1J+T4xqDwQtBMHcMYa27fJMOqkGkJY5YoZmth4lE+j0tC0wG Qdzrv+BFkXo90LIgiEyFiyu2s6dKKurzsvL6RcHCLlBBO7vsl5Obkrb/OMyuqs82589S gDEGDHoCIPf2fHr1SpNVw1fZvI+2UWXYxn78YzJLLOW86O632gVmyXtNgaR7MhJa66Qp A5+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="jszcQuU/"; 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 b26-20020aa7c91a000000b00522270b5753si4198396edt.293.2023.08.06.02.54.30; Sun, 06 Aug 2023 02:54:54 -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="jszcQuU/"; 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 S230196AbjHFJct (ORCPT + 99 others); Sun, 6 Aug 2023 05:32:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230171AbjHFJcn (ORCPT ); Sun, 6 Aug 2023 05:32:43 -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 745D01BFC; Sun, 6 Aug 2023 02:32:42 -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 0433C6100A; Sun, 6 Aug 2023 09:32:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C192C433CB; Sun, 6 Aug 2023 09:32:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691314361; bh=plXfZ6NESmXmkMd2BEKNNu9j1SnUKyka5nXAMxoPibY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jszcQuU/5DSTnUmyu/OD+prBihCdWWfNBi3PvQsNEbzF/XlSESwy65RvAyyQjgwoo 5SfXws34GtC7qrnzTNKj0vAU96o8+ByTIqQ9g7jOy00MRrAmM0IMWYHZN5s5I832i7 pSJX0UjwOJKL1gxo9tiDA3vSEWc2XqUd0W0AnQcFiBxTV9XgQoBVSn+OXT1xSh27ik 7AWShAct8DQVQLcqpjr2GQe+kYxdDjgG1v0meBZ13+Xss9fA0b+hEL5MvZRdr7OuNr IFU99Skw7uE02RbB1v2Tqpp57ICI61XhU1b7WI2AbmB58phtRGf68gtJ/tnz9cwl2u 1K2z3oZr9Mmvw== 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 v2 2/2] serial: 8250_dw: fall back to poll if there's no interrupt Date: Sun, 6 Aug 2023 17:20:56 +0800 Message-Id: <20230806092056.2467-3-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230806092056.2467-1-jszhang@kernel.org> References: <20230806092056.2467-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 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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 7db51781289e..f4cafca1a7da 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -523,7 +523,10 @@ static int dw8250_probe(struct platform_device *pdev) if (!regs) return dev_err_probe(dev, -EINVAL, "no registers defined\n"); - irq = platform_get_irq(pdev, 0); + irq = platform_get_irq_optional(pdev, 0); + /* no interrupt -> fall back to polling */ + if (irq == -ENXIO) + irq = 0; if (irq < 0) return irq; -- 2.40.1