Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp733401imu; Thu, 20 Dec 2018 04:35:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/UPe5OBYwQ8tWImZkYE/HT0yXbHowZ61XlJWy9UnNTqAOcpskKo8tfNj+k3gpXAux/Rce/J X-Received: by 2002:a17:902:8a91:: with SMTP id p17mr23958129plo.316.1545309336960; Thu, 20 Dec 2018 04:35:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545309336; cv=none; d=google.com; s=arc-20160816; b=A6bpqZujuPrt0gZlKuPNP8nPPXbRC7aUaV1ZNGHQQaHRXXwrPsV8+AVAqqjHH11oA9 uvLIFV7DPrTYgFdFYWbq5XmPBU33KXbX1CN7aPgOLn4gHVKFaRdzGkEFX3rDopvnOvbP EMEZtvvRmzyFXb+NIdkuOFt7zHzi4uyuPYY+JMFi35fZzc2DOqo/vIgyY4GXJ4pSINRQ wW2N835Ynd3A9ItIn5vynP+MrXyZH8jq9md8S9wi5LcF3e4l+Dtp/vwPVYmMzBZ++gcm sZJOxLu8fHE0tKM4eavuLgwptHvIB5TK8ral3AKCcIQ8cEGmXgHZJbPCBXX/oROTeL4T 3+vA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3YbqpyExK27eVmKvRwTofJG36i7996nrkYee1ICvHjo=; b=ZqIJi0M0ieA6Q1ojP+aTbZoc0Oa2wIQnxAkANKMkZ51N8yoeKfAeXSZNeRM6KZoqMU IUN/Fi6tgFaJbCKzNnlhV7vGQT7AWFn9kM8H33hluusBgz5fEYg83e7fcmqqhU7MLS46 paBJ5zstjZpNS8N4OyAFZ5MX6KvTZ9fz8RQyT9jca7hfdjhusVUr7kSeE9wBJueXnOjR Cvj+zG5rqQTJ744x2w2+m3nBDqLVgdQIKeq5wDkf7HoZ60Db98CHM1gAauIvOiuQPYdb 6o5zQEHiYi99FGrGspWKpMEcY8vVwuY66z7nUCwSsH+IPgRGLGSeVELvicgC/AAQnNM6 FHTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yCvVEXVg; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q15si18293832pgm.420.2018.12.20.04.35.18; Thu, 20 Dec 2018 04:35:36 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=yCvVEXVg; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732534AbeLTJ2e (ORCPT + 99 others); Thu, 20 Dec 2018 04:28:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:47018 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732522AbeLTJ2a (ORCPT ); Thu, 20 Dec 2018 04:28:30 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 759F921741; Thu, 20 Dec 2018 09:28:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1545298109; bh=xjd4CMKf4nrJG2aTgG2ooCwurgC4yhBLa0VbeH7+8dw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yCvVEXVgwDvrj9676IExoRVlBZFweb+hBzjkO5JNZyRc9yPAK2dZIQ3D+o3pQZGtp DMTJwcy6bAnG1g8BkZC2xzyzy/jSlGxOOMcOIxGnvmaytNFSxvxPOHdPyKWyHfAfoy PLF6BTBc1oyq351CHiQEydFSDDvDv+I5hCQNO4KQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Masahiro Yamada , Wolfram Sang , Sasha Levin Subject: [PATCH 4.14 68/72] i2c: uniphier: fix violation of tLOW requirement for Fast-mode Date: Thu, 20 Dec 2018 10:19:07 +0100 Message-Id: <20181220085925.011761909@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20181220085922.332225035@linuxfoundation.org> References: <20181220085922.332225035@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 8469636ab5d8c77645b953746c10fda6983a8830 ] Currently, the clock duty is set as tLOW/tHIGH = 1/1. For Fast-mode, tLOW is set to 1.25 us while the I2C spec requires tLOW >= 1.3 us. tLOW/tHIGH = 5/4 would meet both Standard-mode and Fast-mode: Standard-mode: tLOW = 5.56 us, tHIGH = 4.44 us Fast-mode: tLOW = 1.39 us, tHIGH = 1.11 us Signed-off-by: Masahiro Yamada Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-uniphier.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-uniphier.c b/drivers/i2c/busses/i2c-uniphier.c index 454f914ae66d..c488e558aef7 100644 --- a/drivers/i2c/busses/i2c-uniphier.c +++ b/drivers/i2c/busses/i2c-uniphier.c @@ -320,7 +320,13 @@ static void uniphier_i2c_hw_init(struct uniphier_i2c_priv *priv) uniphier_i2c_reset(priv, true); - writel((cyc / 2 << 16) | cyc, priv->membase + UNIPHIER_I2C_CLK); + /* + * Bit30-16: clock cycles of tLOW. + * Standard-mode: tLOW = 4.7 us, tHIGH = 4.0 us + * Fast-mode: tLOW = 1.3 us, tHIGH = 0.6 us + * "tLow/tHIGH = 5/4" meets both. + */ + writel((cyc * 5 / 9 << 16) | cyc, priv->membase + UNIPHIER_I2C_CLK); uniphier_i2c_reset(priv, false); } -- 2.19.1