All of lore.kernel.org
 help / color / mirror / Atom feed
From: Evgeniy Polyakov <zbr@ioremap.net>
To: Jean-Francois Dagenais <jeff.dagenais@gmail.com>,
	Mariusz Bialonczyk <manio@skyboo.net>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Greg Kroah-Hartman <greg@kroah.com>
Subject: Re: [PATCH 2/2] w1: fix the resume command API
Date: Tue, 19 Mar 2019 17:21:09 +0300	[thread overview]
Message-ID: <9351961553005269@iva4-406defa25fee.qloud-c.yandex.net> (raw)
In-Reply-To: <6836A9A3-AF86-4E2F-9215-647CB36E22DA@gmail.com>

Hi everyone

Mariusz, thank you for the patch, a small comment on it logic

19.03.2019, 16:21, "Jean-Francois Dagenais" <jeff.dagenais@gmail.com>:

>>  ---
>>  drivers/w1/w1_io.c | 11 +++++++++--
>>  1 file changed, 9 insertions(+), 2 deletions(-)
>>
>>  diff --git a/drivers/w1/w1_io.c b/drivers/w1/w1_io.c
>>  index 0364d3329c52..4697136b9027 100644
>>  --- a/drivers/w1/w1_io.c
>>  +++ b/drivers/w1/w1_io.c
>>  @@ -432,8 +432,15 @@ int w1_reset_resume_command(struct w1_master *dev)
>>          if (w1_reset_bus(dev))
>>                  return -1;
>>
>>  - /* This will make only the last matched slave perform a skip ROM. */
>>  - w1_write_8(dev, W1_RESUME_CMD);
>>  + if (dev->slave_count == 1) {
>>  + /* Resume Command has to be preceeded with e.g. Match ROM which is
>>  + * not happening on single-slave buses, just do a Skip ROM instead
>>  + */
>>  + w1_write_8(dev, W1_SKIP_ROM);

Looks like this may break the search logic, can you check that with this patch applied
some other single slave device will correctly 'tell' its id and it can be addressed via match rom (like, basically, just reading temperature or something like that)?

>>  + } else {
>>  + /* This will make only the last matched slave perform a skip ROM. */
>>  + w1_write_8(dev, W1_RESUME_CMD);
>>  + }
>
> This may be a subsys maintainer's style preference, but perhaps the verbose comments
> might be better suited for the git commit message. Could this then be shorted to
>
>         if (dev->slave_count == 1)
>                 w1_write_8(dev, W1_SKIP_ROM);
>         else
>                 w1_write_8(dev, W1_RESUME_CMD);
>
> Or maybe:
>
>         w1_write_8(dev, dev->slave_count > 1 ? W1_RESUME_CMD : W1_SKIP_ROM);
>
> I am also ok with this proposed version, hence the "reviewed-by".
>
>>          return 0;
>>  }
>>  EXPORT_SYMBOL_GPL(w1_reset_resume_command);
>>  --
>>  2.19.0.rc1

  reply	other threads:[~2019-03-19 14:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-18  9:27 [PATCH 0/2] w1: DS2408 fixes Mariusz Bialonczyk
2019-03-18  9:27 ` [PATCH 1/2] w1: ds2408: add a missing reset when retrying in output_write() Mariusz Bialonczyk
2019-03-19 14:21   ` Jean-Francois Dagenais
2019-03-19 14:25     ` Jean-Francois Dagenais
2019-03-21 10:55     ` Mariusz Bialonczyk
2019-03-21 15:18   ` [PATCH v2] w1: ds2408: reset on output_write retry with readback Jean-Francois Dagenais
2019-03-27 16:53     ` Greg Kroah-Hartman
2019-03-28 12:17       ` Jean-Francois Dagenais
2019-04-03  8:33         ` Mariusz Bialonczyk
2019-03-18  9:27 ` [PATCH 2/2] w1: fix the resume command API Mariusz Bialonczyk
2019-03-19 13:21   ` Jean-Francois Dagenais
2019-03-19 14:21     ` Evgeniy Polyakov [this message]
2019-03-21 10:11       ` Mariusz Bialonczyk
2019-03-21 10:52 ` [PATCH v2] " Mariusz Bialonczyk

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=9351961553005269@iva4-406defa25fee.qloud-c.yandex.net \
    --to=zbr@ioremap.net \
    --cc=greg@kroah.com \
    --cc=jeff.dagenais@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manio@skyboo.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.