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 A80BAC433FE for ; Thu, 3 Mar 2022 10:37:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230075AbiCCKil (ORCPT ); Thu, 3 Mar 2022 05:38:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229922AbiCCKij (ORCPT ); Thu, 3 Mar 2022 05:38:39 -0500 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6B475B3F5; Thu, 3 Mar 2022 02:37:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646303873; x=1677839873; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=hLseLd0tY6z76yWC4tPRUyQCqqYU1QPw+fPC2+urnM4=; b=etbtKiTFxbsxYumrYw9C4t/42YTFkv9+JIg25wKjPoJ/TxAExacc+ztS HWVwaicHey3RrFQppeWaAF2Ik3MHURqlxhJAnNlpURtqjtaqQKyj0W1yh BxKHhskCwXaRS3YP7LAUGeA+5PZhp3GoISVfg2hCyr9wxCZpSe7CalU32 rIUP45I6+bLnuBXRBStnuhAWg11PjdPD5ImsuMVXZrPPC0Z+g3cvYoU61 EVQ8hoSLZP4IJcJOZIethWFH8Xt7wQz5dowar8HGskbMNzlYEfoXrPlZj ncwi/MBp8D9uCOf2mfUWak9evDymepbhd4/Z9BRgDgiT0wqaWmk/qM3x+ A==; X-IronPort-AV: E=McAfee;i="6200,9189,10274"; a="241059688" X-IronPort-AV: E=Sophos;i="5.90,151,1643702400"; d="scan'208";a="241059688" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2022 02:37:52 -0800 X-IronPort-AV: E=Sophos;i="5.90,151,1643702400"; d="scan'208";a="576445523" Received: from smile.fi.intel.com ([10.237.72.59]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2022 02:37:46 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nPipO-00Ak4g-5d; Thu, 03 Mar 2022 12:36:58 +0200 Date: Thu, 3 Mar 2022 12:36:57 +0200 From: Andy Shevchenko To: Tyrone Ting Cc: avifishman70@gmail.com, tmaimon77@gmail.com, tali.perry1@gmail.com, venture@google.com, yuenn@google.com, benjaminfair@google.com, robh+dt@kernel.org, krzysztof.kozlowski@canonical.com, yangyicong@hisilicon.com, semen.protsenko@linaro.org, wsa@kernel.org, jie.deng@intel.com, sven@svenpeter.dev, bence98@sch.bme.hu, lukas.bulwahn@gmail.com, arnd@arndb.de, olof@lixom.net, tali.perry@nuvoton.com, Avi.Fishman@nuvoton.com, tomer.maimon@nuvoton.com, KWLIU@nuvoton.com, JJLIU0@nuvoton.com, kfting@nuvoton.com, openbmc@lists.ozlabs.org, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 09/11] i2c: npcm: Handle spurious interrupts Message-ID: References: <20220303083141.8742-1-warp5tw@gmail.com> <20220303083141.8742-10-warp5tw@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220303083141.8742-10-warp5tw@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org On Thu, Mar 03, 2022 at 04:31:39PM +0800, Tyrone Ting wrote: > From: Tali Perry > > In order to better handle spurious interrupts: > 1. Disable incoming interrupts in master only mode. > 2. Clear end of busy (EOB) after every interrupt. > 3. Return correct status during interrupt. This is bad commit message, it doesn't explain "why" you are doing these. ... > + /* > + * if irq is not one of the above, make sure EOB is disabled and all > + * status bits are cleared. This does not explain why you hide the spurious interrupt. > + */ > + if (ret == IRQ_NONE) { > + npcm_i2c_eob_int(bus, false); > + npcm_i2c_clear_master_status(bus); > + } > + > + return IRQ_HANDLED; -- With Best Regards, Andy Shevchenko 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1C06EC433EF for ; Thu, 3 Mar 2022 10:40:08 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4K8SDP6c9Mz3c2C for ; Thu, 3 Mar 2022 21:40:05 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=U1ELLz7f; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=linux.intel.com (client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=andriy.shevchenko@linux.intel.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=U1ELLz7f; dkim-atps=neutral Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4K8SC22cG3z3bx8 for ; Thu, 3 Mar 2022 21:38:54 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646303935; x=1677839935; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=hLseLd0tY6z76yWC4tPRUyQCqqYU1QPw+fPC2+urnM4=; b=U1ELLz7fFIrhOtrI4RAttpPIJlf/NFSlBZ/e/vvylNdtT0746Ak8gsHV xPwcVCc7SZ+MFALgM3OL3Th4B+Cbt2f3Fy/JkAWZazReWpOV0C0ttjp5B eOINvrrmP+kq5tZ54yAYURGrRF5nHPwd/mGReDak3cuccM8aZuC/4UPhu CkC3j5p8xzT8x+kMWpYAX1wcA6U9jE1s4dNuq9F8oTk8EJsnP+TYVkYVZ LsSWRmo28WH5SUqDIkaH3QfrPNXmkg2HiSRO12TOgwo8uvpaYhPx2QaAr 0DQOrjzqv7vIXA0Tf49U9jm61jpaMdgLj7qWJg1ru5zMr2C0B1TfxVRH2 w==; X-IronPort-AV: E=McAfee;i="6200,9189,10274"; a="340071816" X-IronPort-AV: E=Sophos;i="5.90,151,1643702400"; d="scan'208";a="340071816" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2022 02:37:53 -0800 X-IronPort-AV: E=Sophos;i="5.90,151,1643702400"; d="scan'208";a="576445523" Received: from smile.fi.intel.com ([10.237.72.59]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2022 02:37:46 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.95) (envelope-from ) id 1nPipO-00Ak4g-5d; Thu, 03 Mar 2022 12:36:58 +0200 Date: Thu, 3 Mar 2022 12:36:57 +0200 From: Andy Shevchenko To: Tyrone Ting Subject: Re: [PATCH v3 09/11] i2c: npcm: Handle spurious interrupts Message-ID: References: <20220303083141.8742-1-warp5tw@gmail.com> <20220303083141.8742-10-warp5tw@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220303083141.8742-10-warp5tw@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tmaimon77@gmail.com, devicetree@vger.kernel.org, tali.perry1@gmail.com, linux-i2c@vger.kernel.org, benjaminfair@google.com, krzysztof.kozlowski@canonical.com, openbmc@lists.ozlabs.org, JJLIU0@nuvoton.com, lukas.bulwahn@gmail.com, tomer.maimon@nuvoton.com, KWLIU@nuvoton.com, bence98@sch.bme.hu, arnd@arndb.de, sven@svenpeter.dev, robh+dt@kernel.org, Avi.Fishman@nuvoton.com, yangyicong@hisilicon.com, semen.protsenko@linaro.org, jie.deng@intel.com, avifishman70@gmail.com, venture@google.com, linux-kernel@vger.kernel.org, wsa@kernel.org, kfting@nuvoton.com, tali.perry@nuvoton.com, olof@lixom.net Errors-To: openbmc-bounces+openbmc=archiver.kernel.org@lists.ozlabs.org Sender: "openbmc" On Thu, Mar 03, 2022 at 04:31:39PM +0800, Tyrone Ting wrote: > From: Tali Perry > > In order to better handle spurious interrupts: > 1. Disable incoming interrupts in master only mode. > 2. Clear end of busy (EOB) after every interrupt. > 3. Return correct status during interrupt. This is bad commit message, it doesn't explain "why" you are doing these. ... > + /* > + * if irq is not one of the above, make sure EOB is disabled and all > + * status bits are cleared. This does not explain why you hide the spurious interrupt. > + */ > + if (ret == IRQ_NONE) { > + npcm_i2c_eob_int(bus, false); > + npcm_i2c_clear_master_status(bus); > + } > + > + return IRQ_HANDLED; -- With Best Regards, Andy Shevchenko