Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp643872ybl; Thu, 22 Aug 2019 02:37:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+Z49fjw/zzc7uT+hSqCll2ZGM3WwDfHCEu03b6jnas31MXX9vkU00JPaQWIPdZ5zUSS1D X-Received: by 2002:a17:902:b70a:: with SMTP id d10mr1979801pls.281.1566466660527; Thu, 22 Aug 2019 02:37:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566466660; cv=none; d=google.com; s=arc-20160816; b=sAVTeT1vf/0ZWnfGV9iRkDBe2VwS2jOoJI96ilJ8YCsvZ/mFkKEZRobLjUxXfVyOcE VoiH2HecgtRbqYjws1P/H7ZgN5Xyr8QpT6coZO92R/JgaDRUlT1zutsc7Y3ibt2UL3Xa pNiwSNj3TDd1S7yMe3caxTIU50dWhtsbmJvzdYrKEyj143kh45bxuz1UURY4XNxAvbDm tUNNi1xZ1SVVi8vlVVdClfJrm0E5fOkPOhGUE4RORpfJw25AvmGcDgA9Cf5sQs0ptRXl NB3j1A1mD+rOrddirir/UMiqo4NYc8NKIOzVRkIaSu5ooPGeFl3IbcciviLgFONp2rkZ ZRkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=kdjMjpYa3rg8jCJCDf5YdHJiI1bhYzzey7tK69leF5g=; b=tLOAHhyzLuIGnwDRk0EZUUhLxdeSekN4n33/eNXVuyoAhIAUG6yBzu/1udsehSIt8G rNsQyllJHNtNzepUfRKjsT89LS0LGg2BOVp5zc0LpX+yB0oCdvInGNYuPqdfwz1OQ9zp GchulJGa3TMIbDpkhKZOP1zpu4DpepVY5I+gYtbbRvFyKBnMvYKKdCaLd0jAVqohvC8q 8NZyFHVpFNGxnnIs0zXvLGpfOhsP6A7T+5ydEyHXc4nbe4s1ryRa5tCEsoYW2ufKz4dV FRVKdbwOeeWXQu2T7epw7nIvzdZWv7YlT3Xid2M/emJaIyAeP2wa8Mv31mTBnhQHIn8K B6EQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i23si17646180pfa.196.2019.08.22.02.37.25; Thu, 22 Aug 2019 02:37:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732332AbfHVIYx (ORCPT + 99 others); Thu, 22 Aug 2019 04:24:53 -0400 Received: from Mailgw01.mediatek.com ([1.203.163.78]:43278 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1731207AbfHVIYx (ORCPT ); Thu, 22 Aug 2019 04:24:53 -0400 X-UUID: 01fbca1311e54c78adea42e8c0d5164f-20190822 X-UUID: 01fbca1311e54c78adea42e8c0d5164f-20190822 Received: from mtkcas32.mediatek.inc [(172.27.4.253)] by mailgw01.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 1885262594; Thu, 22 Aug 2019 16:24:38 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by MTKMBS31N2.mediatek.inc (172.27.4.87) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 22 Aug 2019 16:24:35 +0800 Received: from [172.21.77.4] (172.21.77.4) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 22 Aug 2019 16:24:35 +0800 Message-ID: <1566462278.26641.1.camel@mtksdaap41> Subject: Re: [PATCH RESEND] i2c: mediatek: disable zero-length transfers for mt8183 From: Yingjoe Chen To: Hsin-Yi Wang CC: Wolfram Sang , , Nicolas Boichat , Alexandru M Stan , Jun Gao , , , , Matthias Brugger , Thomas Gleixner , Qii Wang Date: Thu, 22 Aug 2019 16:24:38 +0800 In-Reply-To: <20190822055737.142384-1-hsinyi@chromium.org> References: <20190822055737.142384-1-hsinyi@chromium.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-SNTS-SMTP: CDD14A64F1E5A4DF5E573825EDBC482C6C80C91A52820B01E0AE08A9F54881602000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2019-08-22 at 13:57 +0800, Hsin-Yi Wang wrote: > When doing i2cdetect quick write mode, we would get transfer > error ENOMEM, and i2cdetect shows there's no device at the address. > Quoting from mt8183 datasheet, the number of transfers to be > transferred in one transaction should be set to bigger than 1, > so we should forbid zero-length transfer and update functionality. <...> > @@ -933,8 +942,8 @@ static int mtk_i2c_probe(struct platform_device *pdev) > i2c->dev = &pdev->dev; > i2c->adap.dev.parent = &pdev->dev; > i2c->adap.owner = THIS_MODULE; > - i2c->adap.algo = &mtk_i2c_algorithm; > i2c->adap.quirks = i2c->dev_comp->quirks; > + i2c->adap.algo = &mtk_i2c_algorithm; > i2c->adap.timeout = 2 * HZ; > i2c->adap.retries = 1; > Why do you need to change this part? Joe.C