Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3299636lfo; Mon, 23 May 2022 01:04:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQ9y7gLQJWLallZju+5iS3uJcDMb4nm1nrJKcDL6fOv9xJiMoMfduXT86cWnAqgiAWO7aB X-Received: by 2002:a17:902:820e:b0:15f:4087:64d3 with SMTP id x14-20020a170902820e00b0015f408764d3mr21628307pln.163.1653293077816; Mon, 23 May 2022 01:04:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653293077; cv=none; d=google.com; s=arc-20160816; b=k9RATiMk522w49PrMHy2yHOrZy3EzkYcfgfJET2S6LFOtpgeMft15abM7+/40RZ3kX fqPHo1SLDd8LWRRRtbk7ZOv75MFKhoCikfjJvIiL7EdfSyi5A1GiQZvAzKRAztgkJzwb gZWdbbbFwXNlfCxf292QSweGLoJFUUP0q/iBI/B6oRdtQ00j03s5qDNGbt8Lvo1T7GwK isGn1MgEUBlun81wmRQ0c48Yru9pdh0MzmWLB9Z4LFgplGdUUXoSylXre+lA6bj7/8mM waqn4ILQToxhWH6Z7btBqBvu/g8digUlzBLCzRilY6nDMysKl93qShS4c6+mzT3Gyewl qFxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=UiYBOOmE3B2tSMcIdam7Gz2hPUtw38sVw9m7ntvwfEA=; b=0mfkof/CcXL8YdW8cAmUHlqblxogM0eIzabonJterMb9e+c2+tJFWTVBLsZDfw4Vgr 3qIU8FMHoudzVS0PGZn7c0tBNGLdv2evKKR3Tdmz4x8qKdF82vV68cKdMjRtSeLdhUWs jSxA96QY76DACEcH2KOiQHGGADVIHUL2Rbl5b1UCKzLNLs7owM1+7GFaVy6Lu4CuYfyC uOJG6yVdalVguwzn5ULDh+nzSEqEPe6ttTU+HPo5V38l5zP0sX4N1zaMwo9mabB8l/h2 6DURXLhDCV4EcjalI9p8ehrOUgJ1ZfedWzgf+ZQWDjLEi08S05+9DfBzwGRPij0eXZN8 zriw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dLYTDccX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id g16-20020a056a0023d000b005183283a2dcsi13195980pfc.59.2022.05.23.01.04.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 01:04:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dLYTDccX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 71240FC4FF; Mon, 23 May 2022 00:08:12 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243518AbiEUNAy (ORCPT + 99 others); Sat, 21 May 2022 09:00:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234385AbiEUNAu (ORCPT ); Sat, 21 May 2022 09:00:50 -0400 Received: from mail-vs1-xe36.google.com (mail-vs1-xe36.google.com [IPv6:2607:f8b0:4864:20::e36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 977C3E6A; Sat, 21 May 2022 06:00:47 -0700 (PDT) Received: by mail-vs1-xe36.google.com with SMTP id c62so10677789vsc.10; Sat, 21 May 2022 06:00:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=UiYBOOmE3B2tSMcIdam7Gz2hPUtw38sVw9m7ntvwfEA=; b=dLYTDccXOF5vdOcM3oYWeoDuEOe54vEE4MBQ4R2N4kJ0igBgtDxgjrcTmNno4/JYpU GCcDVEj5y1Xd0mFpJDTzwQCRcc0Fun+V4xGU8tybudQaPobtD5MQSknBJG47m9O4JNdY RNonrsVcOwvBn7VZuvbazM4jE5m7PTDXznBFyXxXo4Brvh0SfIDMeXLIqfMo9OKuUctn ksOd1CzhjJgaHIjm0ignljw8gatzaoNQmF8dL4/dPq+gSRntJCICTh3IOA9G5vElMjHR 3jNsWJNJxDPlHyHne+ed8UIlgrT9eGAj2yIfLGO9hj900vbevMKLkh6CsUxU5SXc5GZ8 ZXIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=UiYBOOmE3B2tSMcIdam7Gz2hPUtw38sVw9m7ntvwfEA=; b=RSpOn5mlzVaOZDXszF+Fpoap8GVLpwfNafZjze4jvidQf2MOIh+Ce67qK1kXXlTV65 0nH2m/exgZq4kCIKcLvrpQA8zJCI9oaPC5jLr73tTO/mewp09iEP9PMwMIorslF1x4+s BYUymhBsouq80KP5O9xGniq9/Jh+X5bzuwcKh18hgz9LEfaSei50puIeJsqe3oNF5cWd 4RR7eIU1DUdlE/IPIfaYxL5El0bb390BoNexzucwgBd3BUe4qWVZlB0Tr9mg91Xblhif IemLMj6hRfWxFOOSjPjXEooBfxRBTsMq834OWMoIRad2j0Ltx5GAUFeQFLO2SNia5SpO pAEg== X-Gm-Message-State: AOAM530hKDtlucu6Hi3zZdc8BZ9042HO0ywTOEBsBks2EBzjG5XBfTnM WvbY+LD2m5TTySU7KZM6791SRHRk3GDXUttk54qr3HSwCPJK X-Received: by 2002:a67:d88c:0:b0:337:9a25:36c3 with SMTP id f12-20020a67d88c000000b003379a2536c3mr818585vsj.84.1653138046685; Sat, 21 May 2022 06:00:46 -0700 (PDT) MIME-Version: 1.0 References: <20220517101142.28421-1-warp5tw@gmail.com> <20220517101142.28421-8-warp5tw@gmail.com> In-Reply-To: From: Tyrone Ting Date: Sat, 21 May 2022 21:00:35 +0800 Message-ID: Subject: Re: [PATCH v5 07/10] i2c: npcm: Handle spurious interrupts To: Wolfram Sang , Tyrone Ting , 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+dt@linaro.org, andriy.shevchenko@linux.intel.com, jarkko.nikula@linux.intel.com, semen.protsenko@linaro.org, rafal@milecki.pl, sven@svenpeter.dev, jsd@semihalf.com, 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 Cc: jie.deng@intel.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Hi Wolfram: Thank you for your review. Wolfram Sang =E6=96=BC 2022=E5=B9=B45=E6=9C=8821=E6=97=A5 = =E9=80=B1=E5=85=AD =E4=B8=8B=E5=8D=881:53=E5=AF=AB=E9=81=93=EF=BC=9A > > On Tue, May 17, 2022 at 06:11:39PM +0800, Tyrone Ting wrote: > > From: Tali Perry > > > > On some platforms in rare cases (1 to 100,000 transactions), > > the i2c gets a spurious interrupt which means that we enter an interrup= t > > but in the interrupt handler we don't find any status bit that points t= o > > the reason we got this interrupt. > > > > This may be a case of a rare HW issue or signal integrity issue that is > > still under investigation. > > > > In order to overcome this we are doing the following: > > 1. Disable incoming interrupts in master mode only when slave mode is n= ot > > enabled. > > 2. Clear end of busy (EOB) after every interrupt. > > 3. Clear other status bits (just in case since we found them cleared) > > 4. Return correct status during the interrupt that will finish the > > transaction. > > > > On next xmit transaction if the bus is still busy the master will issue= a > > recovery process before issuing the new transaction. > > > > Fixes: 56a1485b102e ("i2c: npcm7xx: Add Nuvoton NPCM I2C controller dri= ver") > > Signed-off-by: Tali Perry > > Signed-off-by: Tyrone Ting > > Applied to for-next, thanks! > Best Regards, Tyrone