netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vincent Cheng <vincent.cheng.xh@renesas.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: "robh+dt@kernel.org" <robh+dt@kernel.org>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"richardcochran@gmail.com" <richardcochran@gmail.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] ptp: Add a ptp clock driver for IDT ClockMatrix.
Date: Thu, 19 Sep 2019 20:24:33 +0000	[thread overview]
Message-ID: <20190919202420.GA523@renesas.com> (raw)
In-Reply-To: <20190918211803.GO9591@lunn.ch>

Hi Andrew,

On Wed, Sep 18, 2019 at 05:18:03PM EDT, Andrew Lunn wrote:
>On Wed, Sep 18, 2019 at 04:06:38PM -0400, vincent.cheng.xh@renesas.com wrote:
>
>> +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 = &regaddr;
>> +
>> +	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.

Sure thing, will replace pr_err() with dev_err().

>> +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()? 

Yes, will try using msleep_interruptable() and will replace if it works.

>> +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()

Thanks, will make the change.

>> +
>> +	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()

Yes, will go through and downgrade to dev_debug() accordingly.

Thanks,
Vincent

  reply	other threads:[~2019-09-19 20:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-18 20:06 [PATCH 1/2] dt-bindings: ptp: Add binding doc for IDT ClockMatrix based PTP clock vincent.cheng.xh
2019-09-18 20:06 ` [PATCH 2/2] ptp: Add a ptp clock driver for IDT ClockMatrix vincent.cheng.xh
2019-09-18 21:18   ` Andrew Lunn
2019-09-19 20:24     ` Vincent Cheng [this message]
2019-09-19  0:10   ` kbuild test robot
2019-10-01 22:09 ` [PATCH 1/2] dt-bindings: ptp: Add binding doc for IDT ClockMatrix based PTP clock Rob Herring
2019-10-03 15:12   ` Vincent Cheng
2019-10-03 15:56     ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190919202420.GA523@renesas.com \
    --to=vincent.cheng.xh@renesas.com \
    --cc=andrew@lunn.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).