Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp387456pxk; Thu, 17 Sep 2020 05:58:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3jz3CCpK7IND/jBVVtgvRAKKrbgz3P/hpTL6aJjC4/6gb5JPjSTae50epgQK0I8Vd8BBz X-Received: by 2002:aa7:c347:: with SMTP id j7mr34107362edr.185.1600347534327; Thu, 17 Sep 2020 05:58:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600347534; cv=none; d=google.com; s=arc-20160816; b=lTwEcpvZSVK8EnvarI5c726WDXpmZ+5ack/biv1wDKVm42jcpRLnXhDmG6ZIgXxh5k yMQNZU6oEE+7YS7Ax2v/unOFgIbGEwcx5zwFni38h1PYH5kgFGDM4Si7R6gHb99TtcT0 w0k3909rR32MWiifBlwdI3H6TTAfX58Cm/EYeR9DjB9fXKgUsPpcudJ6YcfJfJre2ojY GlXXhJhdgwuNNveU8j7ZT22fbHNxAY77GshHkoxPnIe69OG0jgBX2AXiaVO9Q22up+eT zdS3U+BfaUvw63TkJjRbr1gg67ZVXhbdaKzV3TTOXo49akq+bePLxKPh1BkKWgKPFj+n tAEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=fTnK/yo+1dNIk3e/Inx6LQCVXHVS+uJxm59kvFw3A3Q=; b=Rc56gLACWxPVRWIXuHbiAgm/vKkSz84EHpkj2DKhSMe7t26hWQzWvygy8vVYaIAwVv tHlRvVTQWe3rR2SQBdKEha8HuvJST+6gGBC4YDGNAF4T+EP66nF6M083ZzzD5xNdQxJl k7d32In/3fPAWaubyC6uSDraCDqEUT7jsnFz+tEtJmNRMj8wUDMmtYCHMZsqpIu5usAD q/b5r5AUUw9QyG5A/6N2EUKunGxDx4eZa4bwH4yaYqM3kdSu7J802qj+SlnCCf/DqJYV 2vdQT6LPZ7zPsy0IiyjRFQCQABJ492GxXmI8+IOPq4G+eWALQYLXt78Q3BAgGBiGAJAN 8LBQ== 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 lr25si13755464ejb.42.2020.09.17.05.58.30; Thu, 17 Sep 2020 05:58:54 -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 S1726764AbgIQM46 (ORCPT + 99 others); Thu, 17 Sep 2020 08:56:58 -0400 Received: from mga03.intel.com ([134.134.136.65]:6354 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727179AbgIQM4T (ORCPT ); Thu, 17 Sep 2020 08:56:19 -0400 X-Greylist: delayed 517 seconds by postgrey-1.27 at vger.kernel.org; Thu, 17 Sep 2020 08:56:18 EDT IronPort-SDR: ENU+rvd2fj0D+le23FdZuw9xJFhRzvQBYAxdC6ep4G3FKKvboan0mpd1kFCzziBYCNHKH5Rkfp 22jgyhB+3ARQ== X-IronPort-AV: E=McAfee;i="6000,8403,9746"; a="159738927" X-IronPort-AV: E=Sophos;i="5.76,436,1592895600"; d="scan'208";a="159738927" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Sep 2020 05:47:37 -0700 IronPort-SDR: UZvmrhAvKT85vhrcQe42e72CtXVDWzwCMm5Z5JIyJnyyTwPdR87fq+D/dfl+/fD/a//Nli247W rvFMUbUJ+OnA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,436,1592895600"; d="scan'208";a="336400715" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga008.jf.intel.com with ESMTP; 17 Sep 2020 05:47:34 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1kItJy-00HKDV-It; Thu, 17 Sep 2020 15:47:30 +0300 Date: Thu, 17 Sep 2020 15:47:30 +0300 From: Andy Shevchenko To: Sultan Alsawaf Cc: linux-i2c@vger.kernel.org, jikos@kernel.org, aaron.ma@canonical.com, admin@kryma.net, benjamin.tissoires@redhat.com, hdegoede@redhat.com, hn.chen@weidahitech.com, jarkko.nikula@linux.intel.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 Subject: Re: [PATCH v2 2/4] i2c: designware: Ensure tx_buf_len is nonzero for SMBus block reads Message-ID: <20200917124730.GL3956970@smile.fi.intel.com> References: <20200917052256.5770-1-sultan@kerneltoast.com> <20200917052256.5770-3-sultan@kerneltoast.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200917052256.5770-3-sultan@kerneltoast.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 16, 2020 at 10:22:54PM -0700, 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. I got only patch 2/4, where the other 3 along with cover letter? -- With Best Regards, Andy Shevchenko