From patchwork Thu Feb 22 18:42:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 129306 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp857397lja; Thu, 22 Feb 2018 09:49:56 -0800 (PST) X-Google-Smtp-Source: AH8x2266aVwc6wWI1qumIs2ZsmpoSPZYNJhcV47Y1yEmfjGy+x54C/xVA9qeyvnH4mucMbaNpg9v X-Received: by 10.99.158.84 with SMTP id r20mr6104440pgo.296.1519321796201; Thu, 22 Feb 2018 09:49:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519321796; cv=none; d=google.com; s=arc-20160816; b=OitFh/GzxhvCe9HPaLRV+6DNqnE6YRNz2ntqN8g3LbccMOk3KOJyjdzvLXXI2Sa/O1 dJdg4S45mjuWiuQ2fduisWz3Dj2mmRBQWl3p6BTUdLr6OKoytrLRgolNCHDW1aNEzLtA gEIcLbqf69DJBfxA8/RAUtJ+qNk/3UIaAAQssel5lkOrDeB8oseeymynziLfTtO9aQJ1 zQZcRAMnvbllxegLxDPfniwglBsNb1w8Xa3EP5bdfizBVJcW56npz38tpTTZTE5SG+Yb ruIElBfMsQa7skvw6YGfKBNmgE5UZJIgw1MjosTY2Ros24+ONNVZXywWUgjkV/Q7YuiD RWvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=3obFTH9qLPtg8DinRB+Tvv4k4q9uq40ESBaaPIYWQzA=; b=WKC3sdBjWY/wtf/Wc+YCQK0bQ8ULpy434ypVpoS+jW4jLebHlq/5cvTzk7ZYvlcGgR zzOdRtKU/dEuGE/wMUjb50K2kj/+kH1D2T1OFnP8eimaXlSMaQWsEGRzEVJqmCoy9/cv 3q4XmtOnrccZ4zY+xwHOxHQTnRwyGgHmgVxshYac+ySqkDLYlN71b8qsoy5YsM4dzdfc Bn2oCveV7j24IHe3pVRdnCtudmEdZWkUrZRoWtWJZEB32WimOL408kkaa/nX1OtUBIfP a6fQ6LPSU/zB9qo1NLrUA5cSMx8D2lHvIjY4Pf78G2KPdwI+qxse42mZYwD5FHTlvK6f QQYA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m10si107912pgq.417.2018.02.22.09.49.55; Thu, 22 Feb 2018 09:49:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933446AbeBVRtz (ORCPT + 2 others); Thu, 22 Feb 2018 12:49:55 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:54863 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S933441AbeBVRty (ORCPT ); Thu, 22 Feb 2018 12:49:54 -0500 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 5FF41F4AF78D8; Fri, 23 Feb 2018 01:49:49 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.361.1; Fri, 23 Feb 2018 01:49:42 +0800 From: John Garry To: , , , , , , CC: , , Subject: [RFC PATCH 2/2] serial: 8250_dw: support polling mode Date: Fri, 23 Feb 2018 02:42:03 +0800 Message-ID: <1519324923-196857-3-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1519324923-196857-1-git-send-email-john.garry@huawei.com> References: <1519324923-196857-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org It would be useful to make this driver support some 8250-compatible devices which have no interrupt line. For these, we allow for no interrupt, and will fallback on polling mode. Note: the 8250 dt bindings state that "interrupts" is a required property: "interrupts : should contain uart interrupt." But the 8250_of.c driver can live without it. So this patch is going this way also. Signed-off-by: John Garry --- drivers/tty/serial/8250/8250_dw.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 28fbc8f..3154988 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -422,9 +422,10 @@ static int dw8250_probe(struct platform_device *pdev) } if (irq < 0) { - if (irq != -EPROBE_DEFER) - dev_err(dev, "cannot get irq\n"); - return irq; + if (irq == -EPROBE_DEFER) + return irq; + dev_warn(dev, "cannot get irq, using polling mode\n"); + irq = 0; } spin_lock_init(&p->lock);