Received: by 10.213.65.68 with SMTP id h4csp2119626imn; Sun, 8 Apr 2018 20:11:24 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+qbIx05TtYGTNisWUy7g6hBE2v+v8XMwnT7egM+wgzbvYlXEA70uPUmXEmQCL62CqK76A9 X-Received: by 2002:a17:902:bb0c:: with SMTP id l12-v6mr5990742pls.347.1523243484228; Sun, 08 Apr 2018 20:11:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243484; cv=none; d=google.com; s=arc-20160816; b=ItE8SF7LZ2Js5WsrDJgMa0hE6fsJNqzRH2aAiTh3HDVFjUunU/MIm3pw5ZS9IgNIux sk/LoF6UIYv2Mrk4z/xXF7L6on12eVMWapKwh87fnzVa2gO4cmU2Ed8kd5PnuPyxdFiH Pknu5my4P9EY+xsxq9NqQUZqCw19ggtCXeisYA4hi2NfZQkr85ci+J/RQ0CebN30Q1L8 C1cH7NXEHMbaLautkknwnv0W4PltNosnWFqeyr1PAdzrCKdSuhaptAKbRwNe/WLLpH6y kwnZGbq9jFrNHIDyFNO2a95hDHq4lxItQHLyp8wZfCchDkzIkVOiHAYbyP6Hh1EKeHFh yIzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=DyPhn31LMtFBlkCqEXeZCgXnRS6UgDF2kT/YE4aW/6Y=; b=adCemZ+2xkrQZ9U4ZeVSozmfye7p5Jb5KPwJKObGMaQaUmfTIq9nSdcHaYwYh/ah1M hIuqgZp97srgcRGP70hFzk0IpxAi9KxLcQQhNkQ8uJnpX2fCbyarGFaPJXAF9xLAtc9L Kdw0IxLBwib/uFvJOB9+joSFxFDvZhmLBM5SjrVl3SiJdfqscZ+sH092Vv1BYqDMKuvT kKFtTrt8k5UC5kN5TG2wRnm0p4rWDViYZZcsmDMaPBsKHgai+wew1brJ6VrI4dUkSDmO N2F/Jv/7S+gSu9C//ueNLjLZsE447XRCiXbmAHp67lMDZDlO/4mb5nYvKSYxZGMUe3G0 fGkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=nKJlMfPN; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y8si10574892pgq.230.2018.04.08.20.10.47; Sun, 08 Apr 2018 20:11:24 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=nKJlMfPN; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932399AbeDICQo (ORCPT + 99 others); Sun, 8 Apr 2018 22:16:44 -0400 Received: from mail-dm3nam03on0104.outbound.protection.outlook.com ([104.47.41.104]:17478 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755119AbeDIAac (ORCPT ); Sun, 8 Apr 2018 20:30:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=DyPhn31LMtFBlkCqEXeZCgXnRS6UgDF2kT/YE4aW/6Y=; b=nKJlMfPNTxqvyzLBoem+gDQnkAUaJUJmH1fcnraz5zKyvsAN4wLg8xGjEN3LxOCcNhrgIcnRRO8tFgFFZN1DlcCUkGxeJeG4WI/ImLF6S5a0pGTXJRuDMEE4DSZmDnbi/8Xef5Sb8xVdtcrPEETggyCjux+NIyYFKC+JMjsAHxU= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0807.namprd21.prod.outlook.com (10.167.110.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.3; Mon, 9 Apr 2018 00:30:26 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:30:26 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Matt Weber , John Linn , Paresh Chaudhary , Wolfram Sang , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 136/293] i2c: cadance: fix ctrl/addr reg write order Thread-Topic: [PATCH AUTOSEL for 4.9 136/293] i2c: cadance: fix ctrl/addr reg write order Thread-Index: AQHTz5kllWHp2SzIXEyjOB7OaBSJQQ== Date: Mon, 9 Apr 2018 00:24:39 +0000 Message-ID: <20180409002239.163177-136-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0807;7:g1hwOE51cao5XadG7cTJ54Q/kTvcQQ5IxSPJvhrMdjDcgdfVqwVUzRhM8zm1bIW02zIcN13sd4Xkg1IxO6mwD6tOCUzM+/qf+sz4S8wmqx887sHZ363hl7erHKTy9AXRU35ctWiSW61ADdRa6xnlF4uq7A6v+RXTBLDtW9iYtjtYDJn1OtXTDkh1nhRAsfz7ZHMBxBhuCLF7uBlx623g4T27ScV/0RwN1oPT0H2f6HGXN781RW9tFwSU3V7DVHzk;20:mtnfkd4N+0kc8wzUFHIfXqvbRhS9K69raygQ9aNQi9zUfim7qfHZOfntIt6P6Vwf0RPIZDwFnimrSQTbCn5xnGfQCAV2ZWsdfRZzAcubtkqOGjmH/7ACcf3Jr7RW/GxesECiJKFjjogeGwLHt7Uh/pcRDlVj8z4wn0TUt7cgMU8= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 84adb3b2-21e3-4ad5-6db9-08d59db1170a x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0807; x-ms-traffictypediagnostic: DM5PR2101MB0807: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(192813158149592); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3231221)(944501327)(52105095)(3002001)(6055026)(61426038)(61427038)(6041310)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB0807;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0807; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(39860400002)(396003)(366004)(376002)(346002)(199004)(189003)(14454004)(4326008)(54906003)(25786009)(53936002)(2900100001)(1076002)(3280700002)(6486002)(186003)(2616005)(68736007)(110136005)(11346002)(10090500001)(6116002)(107886003)(3846002)(36756003)(8676002)(72206003)(22452003)(66066001)(26005)(6512007)(478600001)(3660700001)(8666007)(81156014)(86362001)(8656006)(81166006)(86612001)(7736002)(305945005)(8936002)(10290500003)(6436002)(105586002)(6666003)(316002)(575784001)(76176011)(5660300001)(476003)(106356001)(2906002)(6506007)(446003)(2501003)(99286004)(5250100002)(486006)(102836004)(97736004)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0807;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: dcYPSKmPgXwkbeFk7YCf7b50SW1vaRflYalOq7UYVf+arEzqbMg3qcr6S2OaYIf/ctCu+YMr4MZOepMqbOti96+AfCjRfjIPEXde0mZJtwNyXCj6Rz9ixrFabB5aoaVZ69oTwMRpkRZaiqysSHYnXJi66VYBu4fyRzcmyUJbt56rMCcbryKdFm4sLMFp3bIy+kGGgjNMzZ9Eq184RLsgvfT49o10EviDc8p8czPFCbHBeNuENYjgQ4oW4gfsJ+SgLdNCWSjXAW4CjoRZkEtiy32f27zGjAVmEx6N9zLY/6uhumvHzGvU8RTMhHNJQTSFSZqO1zgLQ8aOGQlUgdnOX0KKkvc+IY8OgbqwLXAoseAeZWP7df1sp2evqa2KGvUAxRTr+mPnBisrGcpKTy/ereN5pjIDsbweiKfWAe06T7k= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 84adb3b2-21e3-4ad5-6db9-08d59db1170a X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:24:39.0500 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0807 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Matt Weber [ Upstream commit 8064c616984eaa015f018dba595d78cd24a0cc8c ] The driver was clearing the hold bit in the control register before writing to the address register which resulted in a stop condition being generated rather than a repeated start. This issue was only observed when a system was running much slower than a normal processor would execute. The IP data sheet mentions a ordering of writing to the address register before clearing the hold. Fixes: df8eb5691c4 ("i2c: Add driver for Cadence I2C controller") Signed-off-by: John Linn Signed-off-by: Paresh Chaudhary Signed-off-by: Matthew Weber Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-cadence.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cade= nce.c index 45d6771fac8c..75d80161931f 100644 --- a/drivers/i2c/busses/i2c-cadence.c +++ b/drivers/i2c/busses/i2c-cadence.c @@ -405,14 +405,14 @@ static void cdns_i2c_mrecv(struct cdns_i2c *id) cdns_i2c_writereg(id->recv_count, CDNS_I2C_XFER_SIZE_OFFSET); } =20 + /* Set the slave address in address register - triggers operation */ + cdns_i2c_writereg(id->p_msg->addr & CDNS_I2C_ADDR_MASK, + CDNS_I2C_ADDR_OFFSET); /* Clear the bus hold flag if bytes to receive is less than FIFO size */ if (!id->bus_hold_flag && ((id->p_msg->flags & I2C_M_RECV_LEN) !=3D I2C_M_RECV_LEN) && (id->recv_count <=3D CDNS_I2C_FIFO_DEPTH)) cdns_i2c_clear_bus_hold(id); - /* Set the slave address in address register - triggers operation */ - cdns_i2c_writereg(id->p_msg->addr & CDNS_I2C_ADDR_MASK, - CDNS_I2C_ADDR_OFFSET); cdns_i2c_writereg(CDNS_I2C_ENABLED_INTR_MASK, CDNS_I2C_IER_OFFSET); } =20 --=20 2.15.1