Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2101445pxb; Mon, 12 Apr 2021 14:33:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwu6cRpETXtHou54RgRxqI065+Q9sYNi3eFBgiHfCJIOQUzonoxFCi0lNf/X+LNcuC9NnmX X-Received: by 2002:a05:6402:4d1:: with SMTP id n17mr30523181edw.118.1618263203570; Mon, 12 Apr 2021 14:33:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618263203; cv=none; d=google.com; s=arc-20160816; b=ikfwGtNSzyC8x7QoYytUJea5S2HLFKC+fbndoaZrppuuDSXNRQhbkKb7aLFptdDOtX UrZcpLyzLJj3NZEZqvqvwgZGwIXot8Ye8KSyh71WSaIDMfhd3W1N8vBTVFTwvTqtE6XE qoGVUTDvu1/IhL59ZpIFUVR8a9WxUDvLBhuAEo+4OgUDHKD5JItKclRdI0jyo8Daf/a6 Zw4qJzBclqe64+Wwdep6DXbD5A/bHCFaFgNO4VD9t7IkC480UQBVmfv15KgHS2ktrTUa yPTDbUfD0sxThTlBk6Pu0lNuZzT36tTW+WKhuE2NMHnkAGrI+wbPhIs7dgfVPq8gw+Y7 ZYnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ygfnG6He+O5MLOF6R364ulz7jpkMXQpACIk/VrLHWjE=; b=XacYW+juslkcdJOvMenQu7GjWNrY7ShYTYwCGqe3ExOQyhZiUpDdXNGvmAZxkyMR+m nygYQUJ0eJbveLwUGLVJh0tFAXLQpqf2ekeUpgkBJxoZZ8pwV66/z+EAGZAV+WTj0Std VG4Y8J9svXIWF/iVZ3Ph//wMq2KLGN67+SPqEiS04AIJBUCE2EdXeNpNg1Uct/f2fA8r pMt9yOr7moIqKIPjsAnDABEGv1QHi7FA3SJBJbzDVEXNof2ZUe6IWT80tjAvI5M1Hscd LjvYPo9BiDSI6x/rNAz9e/V8wYlcCs5S+VwpU1k9C8TdifX5BdHBE3NentUXq+P29hZz 0M9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=R4b1aqlJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j18si8235712edw.209.2021.04.12.14.33.00; Mon, 12 Apr 2021 14:33:23 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=R4b1aqlJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240297AbhDLJO1 (ORCPT + 99 others); Mon, 12 Apr 2021 05:14:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:49450 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238263AbhDLI5h (ORCPT ); Mon, 12 Apr 2021 04:57:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0FE6D6128E; Mon, 12 Apr 2021 08:56:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618217807; bh=0OJSYjFmcQVR8Y+J6nqu6mWK+cmBCkQ7Sz9Ivf9TdQU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R4b1aqlJUa3YzThrhTFd840BIqngVhybpXKL7YnIXCICmFx4ncz5f/d8G6RjOf+Gd gVb9m0mkrHRKAO/YavQwkGx5saqhgaKAUsugcAx6wPiqBjv0tkx59f/n7UEgWTGj2T 2bUbQZWdfAhOmvQ5FQ21R+PoZFAFIQDGA9ZftS5s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Song Bao Hua (Barry Song)" , Andy Shevchenko , Wolfram Sang , Sasha Levin Subject: [PATCH 5.10 153/188] i2c: designware: Adjust bus_freq_hz when refuse high speed mode set Date: Mon, 12 Apr 2021 10:41:07 +0200 Message-Id: <20210412084018.709994647@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210412084013.643370347@linuxfoundation.org> References: <20210412084013.643370347@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andy Shevchenko [ Upstream commit 5e729bc54bda705f64941008b018b4e41a4322bf ] When hardware doesn't support High Speed Mode, we forget bus_freq_hz timing adjustment. This makes the timings and real registers being unsynchronized. Adjust bus_freq_hz when refuse high speed mode set. Fixes: b6e67145f149 ("i2c: designware: Enable high speed mode") Reported-by: "Song Bao Hua (Barry Song)" Signed-off-by: Andy Shevchenko Reviewed-by: Barry Song Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-designware-master.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c/busses/i2c-designware-master.c index d6425ad6e6a3..2871cf2ee8b4 100644 --- a/drivers/i2c/busses/i2c-designware-master.c +++ b/drivers/i2c/busses/i2c-designware-master.c @@ -129,6 +129,7 @@ static int i2c_dw_set_timings_master(struct dw_i2c_dev *dev) if ((comp_param1 & DW_IC_COMP_PARAM_1_SPEED_MODE_MASK) != DW_IC_COMP_PARAM_1_SPEED_MODE_HIGH) { dev_err(dev->dev, "High Speed not supported!\n"); + t->bus_freq_hz = I2C_MAX_FAST_MODE_FREQ; dev->master_cfg &= ~DW_IC_CON_SPEED_MASK; dev->master_cfg |= DW_IC_CON_SPEED_FAST; dev->hs_hcnt = 0; -- 2.30.2