public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Binbin Zhou <zhoubinbin@loongson.cn>
Cc: Wolfram Sang <wsa@kernel.org>,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	Mika Westerberg <mika.westerberg@linux.intel.com>,
	linux-i2c@vger.kernel.org, loongarch@lists.linux.dev,
	devicetree@vger.kernel.org, Huacai Chen <chenhuacai@loongson.cn>,
	WANG Xuerui <kernel@xen0n.name>, Arnd Bergmann <arnd@arndb.de>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Jianmin Lv <lvjianmin@loongson.cn>
Subject: Re: [PATCH V4 4/5] i2c: ls2x: Add driver for Loongson-2K/LS7A I2C controller
Date: Fri, 2 Dec 2022 10:29:21 +0200	[thread overview]
Message-ID: <Y4m3Ycs88nOk5zs9@smile.fi.intel.com> (raw)
In-Reply-To: <f0060385-644a-847e-48cf-865c12b96473@loongson.cn>

On Fri, Dec 02, 2022 at 11:22:19AM +0800, Binbin Zhou wrote:
> 在 2022/12/1 04:41, Andy Shevchenko 写道:
> > On Wed, Nov 30, 2022 at 01:56:20PM +0800, Binbin Zhou wrote:

...

> > > +	for (retry = 0; retry < adap->retries; retry++) {
> > > +		ret = ls2x_i2c_doxfer(adap, msgs, num);
> > > +		if (ret != -EAGAIN)
> > > +			return ret;
> > > +
> > > +		dev_dbg(priv->dev, "Retrying transmission (%d)\n", retry);
> > > +		udelay(100);
> > Why atomic? This long (esp. atomic) delay must be explained.
> 
> The modification records for this part of the source code are no longer
> traceable.
> 
> Communicating with colleagues offline, I learned that this part of the code
> first appeared on Linux 2.6.36, which was done to circumvent the problem of
> probable failure to scan the device for i2c devices on some boards.
> 
> How about I add a comment here to explain the reason for this?

Yes, that's what we want, and not what you said above. I.o.w. the comment like
"reason is unknown" is not accepted.

Can you be more specific about the boards and why do you still need this delay?

And also why is it atomic?

> > > +	}

...

> > > +	r = devm_request_irq(dev, irq, ls2x_i2c_irq_handler,
> > > +				IRQF_SHARED, "ls2x-i2c", priv);
> > Indentation.
> 
> Do you mean  "IRQF_SHARE"  should be aligned to "dev"  ?

Yes.

...

> > > +static const struct dev_pm_ops ls2x_i2c_pm_ops = {
> > > +	SET_SYSTEM_SLEEP_PM_OPS(ls2x_i2c_suspend, ls2x_i2c_resume)
> > > +};
> > Use corresponding DEFINE_ macro.
> 
> ok.
> 
> I will use
> 
> "static DEFINE_SIMPLE_DEV_PM_OPS(ls2x_i2c_pm_ops, ls2x_i2c_suspend,
> ls2x_i2c_resume);"  corresponding to  ".pm     = pm_ptr(&ls2x_i2c_pm_ops),"

Shouldn't be pm_sleep_ptr()?


-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2022-12-02  8:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-30  5:55 [PATCH V4 0/5] i2c: ls2x: Add support for the Loongson-2K/LS7A I2C controller Binbin Zhou
2022-11-30  5:55 ` [PATCH V4 1/5] i2c: gpio: Fix potential unused warning for 'i2c_gpio_dt_ids' Binbin Zhou
2022-11-30 20:29   ` Andy Shevchenko
2022-12-05  9:29   ` Wolfram Sang
2022-11-30  5:55 ` [PATCH V4 2/5] i2c: gpio: Add support on ACPI-based system Binbin Zhou
2022-11-30 20:32   ` Andy Shevchenko
2022-11-30  5:55 ` [PATCH V4 3/5] dt-bindings: i2c: add bindings for Loongson LS2X I2C Binbin Zhou
2022-12-02  8:57   ` Krzysztof Kozlowski
2022-11-30  5:56 ` [PATCH V4 4/5] i2c: ls2x: Add driver for Loongson-2K/LS7A I2C controller Binbin Zhou
2022-11-30 20:41   ` Andy Shevchenko
2022-12-02  3:22     ` Binbin Zhou
2022-12-02  8:29       ` Andy Shevchenko [this message]
2022-12-05  2:23         ` Binbin Zhou
2022-12-05  8:38   ` Wolfram Sang
2022-12-05  8:54     ` Binbin Zhou
2022-12-05  8:58       ` Wolfram Sang
2022-11-30  5:56 ` [PATCH V4 5/5] LoongArch: Enable LS2X I2C in loongson3_defconfig Binbin Zhou
2022-11-30 13:47 ` [PATCH V4 3/5] dt-bindings: i2c: add bindings for Loongson LS2X I2C 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=Y4m3Ycs88nOk5zs9@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=chenhuacai@loongson.cn \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@xen0n.name \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    --cc=lvjianmin@loongson.cn \
    --cc=mika.westerberg@linux.intel.com \
    --cc=robh+dt@kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=wsa@kernel.org \
    --cc=zhoubinbin@loongson.cn \
    /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