Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2011025imm; Tue, 10 Jul 2018 11:33:19 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdkkLPaErlJbjKT5J7OgLn5b6qZNhPJNTtZM+sG1eUL7ubCq4v8dTPwDoHKI8VRBRBxDmBi X-Received: by 2002:a65:64d7:: with SMTP id t23-v6mr18153621pgv.207.1531247599125; Tue, 10 Jul 2018 11:33:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531247599; cv=none; d=google.com; s=arc-20160816; b=c8KkwGVh9tWvuyPd6p0DgShrz+Fa/BjJs9QTOOF9edHue2+f7zw8nZVua+wGQUngIH MFR8l/vPXyaTt08ZKcrqEo+6gjuDRJRxMakmmUtuk14wB5T7UuB7bt3wZ+TZvjY6JPE2 kSh69w1h28Vqjjdq94+vfEnmoiMX2ibCt3Rrx1VnUTkku+35Tcm1q4RJx0zJwXTI/aMv 1nFiDSP5A9oiQDCA3je6q4QqdQtcY9pDlsquPZyoPzontrXZsGC7r1TY9Hd+yvBoK/5i NRr0t/9s736NM+2Xui+IaKRDqag7vZJbjPufPT28w45Fh0nRoUQYDKHA5ROLVbeJcHFd 6B1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=p01uCtjwFxSI0YtSKbmrCaM6hOxB+jhSHf7ptOl+RTk=; b=fTUgox1BsKkvpQmVzD9huEqcAy+gr6okwx/nMWf4JKpyzS+YA6jhWr5JaTr3d+wtkA WLlCnZ1dy6Hu7LT8S0UTYnP49mQiDhu1FVhUlY5JI2Ee8fAABCZ4ZiiN0wlQJ0HaAV+c tvBjuwiqmF9Bu1N5kl2A1VOdtnJXO3lstlfog633eM7vxCzYZriTE4YPVG8FQdSvtcMz 9kwJy+cMzo8VLF/Q/1V/CoX8H3/cv2ipYYWH6jfIXBgdFNBcgBjt77WekmDfIHEYskJ7 PSdZClk8x927X8zLIJ0MkXWfzKZyBLE3gWR+ziSKb0mAg2L7nQ4XGYBcxLO+/IGPcXFo 2yOA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f23-v6si19009225plj.494.2018.07.10.11.33.04; Tue, 10 Jul 2018 11:33:19 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388204AbeGJSav (ORCPT + 99 others); Tue, 10 Jul 2018 14:30:51 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45660 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732400AbeGJSav (ORCPT ); Tue, 10 Jul 2018 14:30:51 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 4124AEB4; Tue, 10 Jul 2018 18:30:39 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wolfram Sang , Kuninori Morimoto , Wolfram Sang , Ben Hutchings Subject: [PATCH 4.9 09/52] i2c: rcar: fix resume by always initializing registers before transfer Date: Tue, 10 Jul 2018 20:24:37 +0200 Message-Id: <20180710182450.429872333@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180710182449.285532226@linuxfoundation.org> References: <20180710182449.285532226@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Wolfram Sang commit ae481cc139658e89eb3ea671dd00b67bd87f01a3 upstream. Resume failed because of uninitialized registers. Instead of adding a resume callback, we simply initialize registers before every transfer. This lightweight change is more robust and will keep us safe if we ever need support for power domains or dynamic frequency changes. Signed-off-by: Wolfram Sang Acked-by: Kuninori Morimoto Signed-off-by: Wolfram Sang Cc: Ben Hutchings Signed-off-by: Greg Kroah-Hartman --- drivers/i2c/busses/i2c-rcar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/i2c/busses/i2c-rcar.c +++ b/drivers/i2c/busses/i2c-rcar.c @@ -700,6 +700,8 @@ static int rcar_i2c_master_xfer(struct i pm_runtime_get_sync(dev); + rcar_i2c_init(priv); + ret = rcar_i2c_bus_barrier(priv); if (ret < 0) goto out; @@ -857,8 +859,6 @@ static int rcar_i2c_probe(struct platfor if (ret < 0) goto out_pm_put; - rcar_i2c_init(priv); - /* Don't suspend when multi-master to keep arbitration working */ if (of_property_read_bool(dev->of_node, "multi-master")) priv->flags |= ID_P_PM_BLOCKED;