Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp609604ybk; Wed, 13 May 2020 08:26:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyv5YzFW2o1GGFXjzJqjBWlZmX5N7HJQsTKrn/jc9bJ/TKxIFQIwvV7qHJnqUPkSnnbkkrC X-Received: by 2002:a50:d7c7:: with SMTP id m7mr160247edj.101.1589383563500; Wed, 13 May 2020 08:26:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589383563; cv=none; d=google.com; s=arc-20160816; b=IqOKRamEbmwHWgG1v7RkkGefsLVcYoAZll4L/E0ur5K/zmxqDQ6U95swSLOx0iX6Lo yBd85SuoAzX8w9j6iJaEFIatInHa00jb/QmM45zZnVR8uQYEIVhM88LPYhszri1q3Rh5 oVdAqPDpiZNLDWIchBQzeE5xTY9NpNdxfXBDGiW+vouSGpMvwVLmI4txeiCfM9d/YLUO c7bzvqkGCVH/+DFdZ1ArVskk9KQaLRBa6htJBV9UxAetHAOH955Nr4VeDG13mSFQnuk5 EsM2lGhgb6wqL7D02k7pbw7M++PkP9H2Wlcjeu3Hma+I6NoX3Jt4X9tfmmDjLx89NPKD xI4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=vbtIgsxVa74BT6d1w4uzcGH9A5YnQxctxhe9zFr3wAI=; b=rPRcmGKSZR2j6IFXunjXdoBiEfIpyP+0EfRjqB5UAq1wmHjMKWDeryWT/ItTkx7x/Z ciCc1SIMDBFAMkQdV6oYd1nHORN0DnNnWFHTo+dY10dmcF/f0xUkQSi1p1+nUp87QT+k fn91WoBhfme6mRMV5CnN6ODz0xcs/WjN8w39oOlBHA89Jb3ImKujyd3HdgJp8GHNOkdK HWhZkTO5z7hmRXSXnyvfkhgSaHhQ1zTTmFEwkjph6zL+rFWpNAb4DkV6+HtxGFlaxHfc 9llByL1rga8Zu/4h0R485tkLl88hWE0X7I4n+TXLg+aGJjxfkAbRBvhHxVjQTeheFEh/ 4uZA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r22si1068769edm.199.2020.05.13.08.25.39; Wed, 13 May 2020 08:26:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732461AbgEMPYS (ORCPT + 99 others); Wed, 13 May 2020 11:24:18 -0400 Received: from mga02.intel.com ([134.134.136.20]:63313 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729153AbgEMPYQ (ORCPT ); Wed, 13 May 2020 11:24:16 -0400 IronPort-SDR: ihX3aOfMkDRyoSI3BXeQDwlHzLsfm4qh59ktvA7M5GXsYGPFaezzB8OsiqZVJvnynpYmFxFOP5 jqhfsr+xUh1w== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2020 08:24:15 -0700 IronPort-SDR: LEYmL0D8h4/MJPzQww7+nG6ZMTyIUMdrpW620uivs8d1RMOvGn0hsKExHGUYjZoUgEhe4Gmdup YKNkAXzriOTw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,388,1583222400"; d="scan'208";a="251288456" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga007.jf.intel.com with ESMTP; 13 May 2020 08:24:10 -0700 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1jYtEz-006Rr3-Pi; Wed, 13 May 2020 18:24:13 +0300 Date: Wed, 13 May 2020 18:24:13 +0300 From: Andy Shevchenko To: Tali Perry Cc: ofery@google.com, Brendan Higgins , avifishman70@gmail.com, Tomer Maimon , kfting@nuvoton.com, Patrick Venture , Nancy Yuen , Benjamin Fair , Rob Herring , Wolfram Sang , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, OpenBMC Maillist , devicetree , Linux Kernel Mailing List Subject: Re: [PATCH v10 2/3] i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver Message-ID: <20200513152413.GQ185537@smile.fi.intel.com> References: <20200510102330.66715-1-tali.perry1@gmail.com> <20200510102330.66715-3-tali.perry1@gmail.com> <20200511091759.GE185537@smile.fi.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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 11, 2020 at 02:28:50PM +0300, Tali Perry wrote: > On Mon, May 11, 2020 at 12:18 PM Andy Shevchenko > wrote: > > On Sun, May 10, 2020 at 01:23:29PM +0300, Tali Perry wrote: ... > > > +#if IS_ENABLED(CONFIG_DEBUG_FS) > > > > Why? > > We wanted to add an optional feature to track i2c slave status. > the NPCM has 16 channels handling multiple devices each. Some of the devices > are polled periodically, and might power down. > The user wanted to implement a health monitoring option > to occasionally check the status of the buses (how many timeouts, recovery etc.) > This feature is optional and depends on CONFIG_DEBUG_FS The counters are exposed > to user through the file system. What I meant is why do you need an #ifdef? ... > > > +#define I2C_NUM_OF_ADDR 10 > > > > Is it 10-bit address support or what? > > > > No, the NPCM has an option to respond to multiple slave addresses > (10 own slave addresses) Perhaps more descriptive name then? ... > > > + // Repeat the following sequence until SDA is released > > > + do { > > > + // Issue a single SCL toggle > > > + iowrite8(NPCM_I2CCST_TGSCL, bus->reg + NPCM_I2CCST); > > > + udelay(20); > > > + // If SDA line is inactive (high), stop > > > + if (npcm_i2c_get_SDA(_adap)) { > > > + done = true; > > > + status = 0; > > > + } > > > + } while (!done && iter--); > > > > readx_poll_timeout() ? > > Not exactly, readx_poll_timeout includes only a read operation, here there is a > write in the middle. (iowrite8) Ah, indeed. Perhaps time to add writex_poll_timeout() ? -- With Best Regards, Andy Shevchenko