Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp239234ybe; Wed, 18 Sep 2019 16:19:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwaivbPB1UQsj145FY6zcsMYH8tulA5RGOORoavCBGqd6a9pQJlebnMfbKkrCCBJeaUG3gZ X-Received: by 2002:a17:906:1d03:: with SMTP id n3mr11843583ejh.287.1568848757362; Wed, 18 Sep 2019 16:19:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568848757; cv=none; d=google.com; s=arc-20160816; b=TvCom7lRbKX1zeTTkxSSOTqyUBz3R32zs2fS7qM827dL3oCiRiArAHIynk+uG6WyYw qNAXoCz3w8oe6Opi76JLqOyx7T9KkGVPyJOGDGULelSVWdFNmsxXMErjrxkv5al9eqxG quUvPXbZsw1T8fA8rV+QTnnHsM/yxphtmTP6K/n7ML2jClM9oZ05ubWI03lbP0rS7lOR ZaQ010n7vV9jDZvMquFj/e9CfbT5WiW438jWTAeeITlEtbaQcdkCFcWIFzrJD1VhtwNi Dh/yk6fWQfcNbeFZqmhpM/6VgYWRTpTcCdg7HcH8OWOedGyBtlUZmKnzcZ3byPwM58pk R1dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=bGfAVdLrb+WtrOwj6S/Ke5fvJyoppeNpLvbmn3xM56E=; b=T7LWQbT0LVqWOw7eECrGs5yz6PRxa7ELaJr0BIazi2CWfXq/VkKF59GlqammMFbtZD vrLK6riSudPWvrlpc5BwWWw41xg29mIkqr3aEBeEaVKRlhYL+NtLurezhTji6fgT+Niw wDY3VJvDW5A2vDCBeUQGLu+3LMaACIJ7BxQsI+IiI7o+GKWd1kXznXl19JDWImyU+mF2 5DAH7RFEipDbEcOybd3iNxvdqgJgupaTkcqxLMGFrIe0DcEfR0X74Y/QSuIe1BeLSQjF ZIPQdlRLBn/qH0PBXGjaiXckLcogEPI/p9YvE5oPoRj3qOsm0gfDAARULKTY7/CT1Qcg Y8Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=Bo2EKOV2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g32si4412550eda.330.2019.09.18.16.18.53; Wed, 18 Sep 2019 16:19:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=Bo2EKOV2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387939AbfIRVSN (ORCPT + 99 others); Wed, 18 Sep 2019 17:18:13 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:53788 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725989AbfIRVSM (ORCPT ); Wed, 18 Sep 2019 17:18:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=bGfAVdLrb+WtrOwj6S/Ke5fvJyoppeNpLvbmn3xM56E=; b=Bo2EKOV2JKWCr7domMkoJ9RxMR t4jTivpww+hB5Ptcd4It1JeTeX5QNuA2Og0oERJFVKjdN60X3oNvEo2PEeQuGVBmSmd50Sj3FmhCP ke0Erl3yScdOvZhnIlTiYJA+wIQZNhbcVgM8ALr34i92/bzNG1Zqr9tSxDL0Mkaobyhc=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1iAhKt-00028X-Rq; Wed, 18 Sep 2019 23:18:03 +0200 Date: Wed, 18 Sep 2019 23:18:03 +0200 From: Andrew Lunn To: vincent.cheng.xh@renesas.com Cc: robh+dt@kernel.org, mark.rutland@arm.com, richardcochran@gmail.com, devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] ptp: Add a ptp clock driver for IDT ClockMatrix. Message-ID: <20190918211803.GO9591@lunn.ch> References: <1568837198-27211-1-git-send-email-vincent.cheng.xh@renesas.com> <1568837198-27211-2-git-send-email-vincent.cheng.xh@renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1568837198-27211-2-git-send-email-vincent.cheng.xh@renesas.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 18, 2019 at 04:06:38PM -0400, vincent.cheng.xh@renesas.com wrote: > From: Vincent Cheng > > The IDT ClockMatrix (TM) family includes integrated devices that provide > eight PLL channels. Each PLL channel can be independently configured as a > frequency synthesizer, jitter attenuator, digitally controlled > oscillator (DCO), or a digital phase lock loop (DPLL). Typically > these devices are used as timing references and clock sources for PTP > applications. This patch adds support for the device. > > Co-developed-by: Richard Cochran > Signed-off-by: Richard Cochran > Signed-off-by: Vincent Cheng Hi Vincent > +static s32 idtcm_xfer(struct idtcm *idtcm, > + u8 regaddr, > + u8 *buf, > + u16 count, > + bool write) > +{ > + struct i2c_client *client = idtcm->client; > + struct i2c_msg msg[2]; > + s32 cnt; > + > + msg[0].addr = client->addr; > + msg[0].flags = 0; > + msg[0].len = 1; > + msg[0].buf = ®addr; > + > + msg[1].addr = client->addr; > + msg[1].flags = write ? 0 : I2C_M_RD; > + msg[1].len = count; > + msg[1].buf = buf; > + > + cnt = i2c_transfer(client->adapter, msg, 2); > + > + if (cnt < 0) { > + pr_err("i2c_transfer returned %d\n", cnt); dev_err(client->dev, "i2c_transfer returned %d\n", cnt); We then have an idea which device has a transfer error. Please try to not use pr_err() when you have some sort of device. > +static s32 idtcm_state_machine_reset(struct idtcm *idtcm) > +{ > + s32 err; > + u8 byte = SM_RESET_CMD; > + > + err = idtcm_write(idtcm, RESET_CTRL, SM_RESET, &byte, sizeof(byte)); > + > + if (!err) { > + /* delay */ > + set_current_state(TASK_INTERRUPTIBLE); > + schedule_timeout(_msecs_to_jiffies(POST_SM_RESET_DELAY_MS)); Maybe use msleep_interruptable()? > + } > + > + return err; > +} > + > +static s32 idtcm_load_firmware(struct idtcm *idtcm, > + struct device *dev) > +{ > + const struct firmware *fw; > + struct idtcm_fwrc *rec; > + u32 regaddr; > + s32 err; > + s32 len; > + u8 val; > + u8 loaddr; > + > + pr_info("requesting firmware '%s'\n", FW_FILENAME); dev_debug() > + > + err = request_firmware(&fw, FW_FILENAME, dev); > + > + if (err) > + return err; > + > + pr_info("firmware size %zu bytes\n", fw->size); dev_debug() Maybe look through all your pr_info and downgrade most of them to dev_debug() Andrew