Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1539410rwo; Wed, 2 Aug 2023 16:16:35 -0700 (PDT) X-Google-Smtp-Source: APBJJlFUFGAmHpXkSJWH2XSd0T0Ua3hqQyMWeyGbP2dS62TfifnxZ5xN1KvcmYOOr7uRCphxNqnT X-Received: by 2002:a2e:7003:0:b0:2b6:e7ff:4b2e with SMTP id l3-20020a2e7003000000b002b6e7ff4b2emr6110080ljc.33.1691018195307; Wed, 02 Aug 2023 16:16:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691018195; cv=none; d=google.com; s=arc-20160816; b=EaukWl9PoCZDopj59m2tcDKbBGtZAnMdsv1fh0rdqb7XDmiJcoALdJjQHB/qQ7PDey 3m5V4pwM4nWx0WB7Kj2P9TMExu28rP3oTS+9EiODt7n9HOJDYcTvn0y3t+TPL1WRQzTy AwBGEJtNSNwBB6JYj2e8aEPqcdTJ570Iwz11v8Z6ZQt2VOE7FZzffQbpV4RvkYRk8tdS ZmwA2iQ9OCi/Cg1c3KmpBzNMZnwT6/ehSSYPpvCV8Gqy0JnfbAYGTSgttUxEyb/5iqDQ cfuO3TjalvQfFRNwnRGQloyrDOjLFu0wb6A524VGIvJXcfCc8bz5yIF3WuPZ8iXtYLwF ESQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=PRGfH+xK7woduiUvkKcqpedhmADEPM2OHY872F8zdys=; fh=nDsJKtctlbmoWODOtmJhCASOHrJWrSxrVpdcjY6rf7s=; b=BEIKmeXSgh9suJJjrLJi33M4QwGGNiPTY9HyUCd8GSH03Nk/gknp7vwOyaMTY040oa l/G+0tNFl+cyTyJyNPX4ufk2P+iBvH8pFCDlN20OfJ0Yli0xk662YVqHRQPqcabMXUMq NOxyMEUkrFWP5eZLIk8TbUiZ8KfUgCCf17esqUKf4/J66+gCZLzdlEnKz0xps3inaDxP A9Hxu9yrH5lOpOdwwSo4/57ePlYqrmvUeF1Y91aLwrY9HT/N5ymgo1ymjE6BM6W/eCV6 UYisFBP9NSOix9aJTFTQpCZlipfW6BgRJEODlLR9rBXCA5Xk8A9kAPMoznUShxp27dZa sQkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=G0QgTXAQ; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u21-20020a1709060b1500b009889b69c1edsi8019211ejg.697.2023.08.02.16.16.11; Wed, 02 Aug 2023 16:16:35 -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=@intel.com header.s=Intel header.b=G0QgTXAQ; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231922AbjHBV4I (ORCPT + 99 others); Wed, 2 Aug 2023 17:56:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229624AbjHBV4G (ORCPT ); Wed, 2 Aug 2023 17:56:06 -0400 Received: from mgamail.intel.com (unknown [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAE2A1712; Wed, 2 Aug 2023 14:56:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691013366; x=1722549366; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=UPnjyCol6mSkqe/I6LFj5Fg8Cfw99iZMAfmBzpyn1Jk=; b=G0QgTXAQ7nTn7ZFIpI83wZXWnhnMyzft00d0xQ55rrgJU8U4+SbPyfQz xPUGHX+EQL5gk14fDBTrGMAiXSYNvcSjK11gni2E6jk27qncJ/ooCodlj iAjdRBhdURasO3rkLRqjM/fMG94QMDaGMdZN4zovLFofbXAUqJfnGNtD7 MQQ6oH9xWlN90sHg8IKjIuwWcBL/9lx0xqt/+1r4dBMSPRaOEcL7NJSm8 5xPl2mRYta4jTiMULLhaBZTZljC/O0lsp6IhKfYxBdjGNXlv80JvrVii9 H1NIFWIBh8W6xWv4PJ/H/617stm4TnmU5dfxFyGzSOwA3ytKeul3nCdMx A==; X-IronPort-AV: E=McAfee;i="6600,9927,10790"; a="354624661" X-IronPort-AV: E=Sophos;i="6.01,250,1684825200"; d="scan'208";a="354624661" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2023 14:56:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10790"; a="758890861" X-IronPort-AV: E=Sophos;i="6.01,250,1684825200"; d="scan'208";a="758890861" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga008.jf.intel.com with ESMTP; 02 Aug 2023 14:56:02 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qRJp3-0008cb-0q; Thu, 03 Aug 2023 00:56:01 +0300 Date: Thu, 3 Aug 2023 00:56:00 +0300 From: Andy Shevchenko To: Jisheng Zhang Cc: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , Jiri Slaby , linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] serial: 8250_dw: fall back to poll if there's no interrupt Message-ID: References: <20230802150545.3742-1-jszhang@kernel.org> <20230802150545.3742-3-jszhang@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230802150545.3742-3-jszhang@kernel.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Wed, Aug 02, 2023 at 11:05:45PM +0800, Jisheng Zhang wrote: > 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. ... > irq = platform_get_irq(pdev, 0); You will still have an error message. Perhaps you need to replace it with irq = platform_get_irq_optional(pdev, 0); > - if (irq < 0) > - return irq; > + if (irq < 0) { > + if (irq != -ENXIO) > + return irq; > + /* no interrupt -> fall back to polling */ > + irq = 0; > + } This can be slightly modified: /* no interrupt -> fall back to polling */ if (irq == -ENXIO) irq = 0; if (irq < 0) return irq; -- With Best Regards, Andy Shevchenko