public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <jdelvare@suse.de>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: Andi Shyti <andi.shyti@kernel.org>,
	Daniel Kurtz <djkurtz@chromium.org>,
	linux-i2c@vger.kernel.org
Subject: Re: [PATCH] i2c: i801: fix potential race in i801_block_transaction_byte_by_byte
Date: Fri, 1 Sep 2023 19:26:46 +0200	[thread overview]
Message-ID: <20230901192646.3706a36c@endymion.delvare> (raw)
In-Reply-To: <d392cf3a-a029-2cd6-44e6-a98f57d42b5f@gmail.com>

On Fri, 1 Sep 2023 19:02:13 +0200, Heiner Kallweit wrote:
> On 01.09.2023 18:44, Jean Delvare wrote:
> > Hi Heiner,
> > 
> > On Tue, 29 Aug 2023 08:25:23 +0200, Heiner Kallweit wrote:  
> >> Currently we set SMBHSTCNT_LAST_BYTE only after the host has started
> >> receiving the last byte. If we get e.g. preempted before setting
> >> SMBHSTCNT_LAST_BYTE, the host may be finished with receiving the byte
> >> before SMBHSTCNT_LAST_BYTE is set.
> >> Therefore change the code to set SMBHSTCNT_LAST_BYTE before writing
> >> SMBHSTSTS_BYTE_DONE for the byte before the last byte. Now the code
> >> is also consistent with what we do in i801_isr_byte_done().
> >>
> >> Fixes: efa3cb15ad8b ("i2c-i801: Refactor use of LAST_BYTE in i801_block_transaction_byte_by_byte")  
> > 
> > I don't think this is true. This patch refactored the code but didn't
> > change the logic. The bug existed before already. As far as I see, the
> > race condition already existed when the kernel switched to git, so
> > there's no point in having a Fixes statement.
>
> Shall we go with the patch as-is or do you think it's better to resubmit
> w/o the Fixes tag?

Please resubmit, for the sake of correctness and to be fair to Daniel.

-- 
Jean Delvare
SUSE L3 Support

      reply	other threads:[~2023-09-01 17:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-29  6:25 [PATCH] i2c: i801: fix potential race in i801_block_transaction_byte_by_byte Heiner Kallweit
2023-09-01 16:44 ` Jean Delvare
2023-09-01 17:02   ` Heiner Kallweit
2023-09-01 17:26     ` Jean Delvare [this message]

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=20230901192646.3706a36c@endymion.delvare \
    --to=jdelvare@suse.de \
    --cc=andi.shyti@kernel.org \
    --cc=djkurtz@chromium.org \
    --cc=hkallweit1@gmail.com \
    --cc=linux-i2c@vger.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