Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp440615pxk; Thu, 17 Sep 2020 07:11:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxEVKzV/uXWpetZRIQoIHZkZSttvoCi8TrdsfNQC9kSGZcYec0vnW/LO5hu4NAip9+sslAy X-Received: by 2002:a17:906:1b15:: with SMTP id o21mr30345126ejg.377.1600351874481; Thu, 17 Sep 2020 07:11:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600351874; cv=none; d=google.com; s=arc-20160816; b=ZWxZyTzKb37o4DR4H/woKnAkYgnv8kUD+5hpNhiQc6GYANA3EQyFkeQE1TbKwlHIbx Y0xaOrRYlrN2rOQiINI+ICFiVpjVbzYX5+zuagZgUusFQZXi7A4fgShrVVGUuWM2XXMe lGGyztJxDEiPR6Uk9P+jHgBIquMfW5BidnVqT7N8BpsfkAjHC4zVp9doBwVIACC6IeuB N683RNXOVsc3IEj1Bslvs13zCieJwgk66WzKl0AtfGsKSZ0PDh4hSxEJWBnI8RoTZNYv bMHyhypei2EmAGpmsSsb5XDToDf1dHWcQgWBG4WKOCSn+U8SvQaNn+7WwMgMt+KfEgu+ vM7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=3UxwsE5aSMdZ9GDY99Ubj8bTgFB+58q+fT4boqU1juA=; b=C8CqaQ3H1lJz4gLiJEYDria5HqSmE73CuUElvdEjSYMcreX9YtDgcmnKtfun5/8zzu /8Kv2ZV5O/und/05xUc4B4AjNhAtHQvFZduFV5YYn/jB99qOa+Jq9r1A1Rne1uIww4kP LhP8f2MjvUX/bLkfO6Px/FZYVvyksObg4p/5UA/tiRMlveHPLProB4yCkeaXPT9SjvDx 70lsAW2GE6F3ifrXj9S/KNkFFM06+n7Q49YeguCBZ7PavRibUoT+I5oz8WDzBdB1bNnQ gSLZiDZr0yIHjfcsvSxckIanssjT1A+CCjPkxM6QBd5qpOMh/VEq4fYJ+RyTVZhA4+OO 9HPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zh8si35717ejb.92.2020.09.17.07.10.50; Thu, 17 Sep 2020 07:11:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727307AbgIQOIO (ORCPT + 99 others); Thu, 17 Sep 2020 10:08:14 -0400 Received: from mga01.intel.com ([192.55.52.88]:29235 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727183AbgIQN7w (ORCPT ); Thu, 17 Sep 2020 09:59:52 -0400 X-Greylist: delayed 556 seconds by postgrey-1.27 at vger.kernel.org; Thu, 17 Sep 2020 09:59:33 EDT IronPort-SDR: aoQ2yfbA+VB18GNHhXTVEkHpmlrsMj1gABpColDFG0Vd/DN59+uIPHBuXISNoiAd7380gQjLc3 HAEN8KT8WNmw== X-IronPort-AV: E=McAfee;i="6000,8403,9746"; a="177791956" X-IronPort-AV: E=Sophos;i="5.76,437,1592895600"; d="scan'208";a="177791956" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Sep 2020 06:46:22 -0700 IronPort-SDR: zT5iIOf4unlK1SgFAVXPYQucFc18m7rBc3aM8BzyqSheN9QbAo/2NDoF1iqeRll4O/PJAXdUZE 76KarLVxtjvw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,437,1592895600"; d="scan'208";a="307471975" Received: from mylly.fi.intel.com (HELO [10.237.72.153]) ([10.237.72.153]) by orsmga006.jf.intel.com with ESMTP; 17 Sep 2020 06:46:18 -0700 Subject: Re: [PATCH v2 2/4] i2c: designware: Ensure tx_buf_len is nonzero for SMBus block reads To: Sultan Alsawaf , linux-i2c@vger.kernel.org Cc: jikos@kernel.org, aaron.ma@canonical.com, admin@kryma.net, andriy.shevchenko@linux.intel.com, benjamin.tissoires@redhat.com, hdegoede@redhat.com, hn.chen@weidahitech.com, kai.heng.feng@canonical.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, mika.westerberg@linux.intel.com, vicamo.yang@canonical.com, wsa@kernel.org References: <20200917052256.5770-1-sultan@kerneltoast.com> <20200917052256.5770-3-sultan@kerneltoast.com> From: Jarkko Nikula Message-ID: <4698b23c-7af6-3f44-975d-b1f692ae3f00@linux.intel.com> Date: Thu, 17 Sep 2020 16:44:18 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20200917052256.5770-3-sultan@kerneltoast.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/17/20 8:22 AM, Sultan Alsawaf wrote: > From: Sultan Alsawaf > > The point of adding a byte to len in i2c_dw_recv_len() is to make sure > that tx_buf_len is nonzero, so that i2c_dw_xfer_msg() can let the i2c > controller know that the i2c transaction can end. Otherwise, the i2c > controller will think that the transaction can never end for block > reads, which results in the stop-detection bit never being set and thus > the transaction timing out. > > Adding a byte to len is not a reliable way to do this though; sometimes > it lets tx_buf_len become zero, which results in the scenario described > above. Therefore, just directly ensure tx_buf_len cannot be zero to fix > the issue. > > Fixes: c3ae106050b9 ("i2c: designware: Implement support for SMBus block read and write") > Signed-off-by: Sultan Alsawaf > --- > drivers/i2c/busses/i2c-designware-master.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > Were other patches in series dropped somewhere? I received only this. Jarkko