From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAD98C83F2C for ; Tue, 5 Sep 2023 16:20:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243859AbjIEQUV (ORCPT ); Tue, 5 Sep 2023 12:20:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354430AbjIELfZ (ORCPT ); Tue, 5 Sep 2023 07:35:25 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 048D783 for ; Tue, 5 Sep 2023 04:35:21 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-31c65820134so2117250f8f.1 for ; Tue, 05 Sep 2023 04:35:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693913718; x=1694518518; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Jvh7WWzBAfXIoLzMSSdLyX47ANtIvmPMfydEou4b9YY=; b=TeNECdvpO9r1SBGjZ9pisRSv/oW/ZMpr5gHFHc573ZYfIihKiHbngZX+6PilA5sz/u 5UlPqB53GQ3Z5LhqTeiEyvL5q2UFAVe6QvysjFf2qGaKBFLFlxKFGjs4H5VLgHD7QmgK rVSg784JHilbHIbLtwC9cZo04qtxYhnNLq1dUKGVET7j6UQxlWpHPptv3lggUl6f+Q8X R7dP4JsM/bsLhOtZiYBji3kSSIu+xFRGSts2spi+0O2TwJ70Kp5wEpmVPEm7hla5yKLb yeBwTGW08ovq/UhSqxIHZ5eQZdmCWTVmK4GHnWy3Pxz1LSgttd/8VdNDWirV7mQVXYXA BDxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693913718; x=1694518518; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Jvh7WWzBAfXIoLzMSSdLyX47ANtIvmPMfydEou4b9YY=; b=BJfZguaWAfK3D0ecKWcC9cBePgax5+ryaBGiGd1PAkjSf9zgxcrKL/53OWQOXwlmsX a5y/AMuGLtbd2tGLn9x/JuYvGjtkA8ABS20S9jfWAIfzJp/pgdZoAJjtAHppK0/9MBMg N5phtC7cMoZxNQNo5PqHLN9F7JGQbT0E3LHguzRK6+MfqbnZl6zVVSVitRFM3pachlwS ZP+IhuuSWmprL6CkRntX6KrhffSygvFd1DFC/BfFaDGxFiJmF6LmiuuiKQ70HWOh6Ckl NHl93u0mGXg4N4QytRxKgXGjpAwRcc643QXu+rFHOBUtS2og70e2301BCKtVOIq8ADYO 2bKQ== X-Gm-Message-State: AOJu0Yzo7fzf/tfsnB6Bb7XuvTOwi1axlak8GYz0R7CXtf3sIT2h66zd PwGvIytaCYrl5Sh/CDA3TXw= X-Google-Smtp-Source: AGHT+IHOHzTrP4NzjQVDJirNoemHn+GVuC/dHpoCKwrwgDZx6qjpNwN4f85rtIL2+PuFa5c3V/vnnA== X-Received: by 2002:a05:6000:4e:b0:31c:e933:9590 with SMTP id k14-20020a056000004e00b0031ce9339590mr8574702wrx.33.1693913718106; Tue, 05 Sep 2023 04:35:18 -0700 (PDT) Received: from ?IPV6:2a01:c22:6f6b:c00:c45d:f24a:575b:803b? (dynamic-2a01-0c22-6f6b-0c00-c45d-f24a-575b-803b.c22.pool.telefonica.de. [2a01:c22:6f6b:c00:c45d:f24a:575b:803b]) by smtp.googlemail.com with ESMTPSA id a2-20020adff7c2000000b003177074f830sm17267798wrq.59.2023.09.05.04.35.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Sep 2023 04:35:17 -0700 (PDT) Message-ID: <5838f7e4-dd08-48eb-2f9c-df45daa0214a@gmail.com> Date: Tue, 5 Sep 2023 13:35:10 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: [PATCH v2] i2c: i801: fix potential race in i801_block_transaction_byte_by_byte Content-Language: en-US To: Andi Shyti , Jean Delvare Cc: Wolfram Sang , linux-i2c@vger.kernel.org References: <20230905101243.39920fe5@endymion.delvare> <20230905091155.h3oezdj5g6z5jpxu@zenone.zhora.eu> From: Heiner Kallweit In-Reply-To: <20230905091155.h3oezdj5g6z5jpxu@zenone.zhora.eu> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org On 05.09.2023 11:11, Andi Shyti wrote: > Hi Jean, > > On Tue, Sep 05, 2023 at 10:12:43AM +0200, Jean Delvare wrote: >> On Sat, 02 Sep 2023 22:10:52 +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(). >>> >>> Reported-by: Jean Delvare >> >> Note for Wolfram: checkpatch says we should insert here: >> >> Closes: https://lore.kernel.org/linux-i2c/20230828152747.09444625@endymion.delvare/ > > does this also need a Fixes: tag? I tried to check it, but there > was an intricate jungle of commits in these lines. > Quoting Jean from previous communication about this patch: 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. > Anyway, you can add: > > Acked-by: Andi Shyti > > Thanks, > Andi