From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 704F8C433F5 for ; Fri, 17 Dec 2021 18:12:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239937AbhLQSMH (ORCPT ); Fri, 17 Dec 2021 13:12:07 -0500 Received: from mga12.intel.com ([192.55.52.136]:62049 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230432AbhLQSMF (ORCPT ); Fri, 17 Dec 2021 13:12:05 -0500 X-IronPort-AV: E=McAfee;i="6200,9189,10201"; a="219821298" X-IronPort-AV: E=Sophos;i="5.88,214,1635231600"; d="scan'208";a="219821298" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Dec 2021 10:10:26 -0800 X-IronPort-AV: E=Sophos;i="5.88,214,1635231600"; d="scan'208";a="605965790" Received: from smile.fi.intel.com ([10.237.72.184]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Dec 2021 10:10:24 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1myHfd-007YU0-SR; Fri, 17 Dec 2021 20:09:29 +0200 Date: Fri, 17 Dec 2021 20:09:29 +0200 From: Andy Shevchenko To: Greg Kroah-Hartman Cc: Zhiyong Tao , linux-serial@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Jiri Slaby , Matthias Brugger Subject: Re: [PATCH v1 1/1] serial: 8520_mtk: Prepare for platform_get_irq_optional() changes Message-ID: References: <20211217151034.62046-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 17, 2021 at 05:54:55PM +0100, Greg Kroah-Hartman wrote: > On Fri, Dec 17, 2021 at 05:10:34PM +0200, Andy Shevchenko wrote: > > The platform_get_irq_optional() is going to be changed in a way > > that the result of it: > > = 0 means no IRQ is provided > > < 0 means the error which needs to be propagated to the upper layers > > > 0 valid vIRQ is allocated > > What about 0 being a valid irq? For this driver it can't be possible. The driver is instantiated via DT only and OF APIs never return 0 for IRQ. If it's the case, it's a regression in the OF APIs. I can elaborate in the commit message. > > In this case, drop check for 0. Note, the 0 is not valid vIRQ and > > platform_get_irq_optional() issues a big WARN() in such case, > > But it still is a valid irq, so why did you just break things? Yes, a > warning will happen, but the driver and platform will still work. In general yes, but not in this case. See above. ... > > - if (irq >= 0) > > + if (irq > 0) > > disable_irq_wake(irq); > > Why change this now? What does this solve at this point in time? As explained in the commit message, it's a preparation patch to fix the logic behind platform_get_irq_optional(). -- With Best Regards, Andy Shevchenko