Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1998159imm; Thu, 24 May 2018 04:15:39 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq1jwWEUwYECyTOqD999Q1gL0oFMpSj2GAgliJYv/AHq6mFXx6zM21rf+m23MauUTDAKLob X-Received: by 2002:a17:902:b205:: with SMTP id t5-v6mr6918353plr.343.1527160539798; Thu, 24 May 2018 04:15:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527160539; cv=none; d=google.com; s=arc-20160816; b=mALxuCLqY9LadOVkqSP8LtGg72SABX7hmxd3lPXM1w9u2vBxl3YmPJtzbVcKmS8fDk yVgKrjdmUvJT/EvxrdXxb1qo3k6IuIG00QfwLNU4Vb5v4PlCBo7Wzea14L9OzCWYXRNF JURnmMv15sPD7hjaBN0wfM5Bd70McHO6QADYIx8DqK1xFVk85J6iJ3BegkyaVINQqp6p s0sV5zEsTj0ckLlve9aEyuvTDAIAbSr4flYY5kCzvEu3VvawWcOuFyQdAFbBS8WgCJQe kZ4qhn+S07s4Zbabbmf6JSJcGXy/o+CV3pSHFqN1/u7eObqR5VqPRPoU2pURNWmjVusN 6wVg== 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:dkim-signature :arc-authentication-results; bh=Tef+F/H4NCyt37GWwaWF9qhUffXb3ke6tyaoxLjdQD4=; b=f7MunBPSNZi4CUVj5OYdvt9NlrpnQxdyZEq2hOMC9alcCA3GVBY+YJduPS2GGEePy4 5TSGzCrsM0GLaujP+1ZpMEkPc/t7NS3tePm7kzhAM+bGEN/l+jN+6Xo5u16Wg7emHgzO 554djTAUHCNugvfKHjPshwjZckgvp+9g1L7WhH0HkytLCSJMoCIrXdstUwUr5tlOU7zd miho2lAZb+hTLPc/87WuQ2KVpoyLFdcpiVrztzgckWH1X6SQmyM8NRnOEwNsCqOsC5es kkEL7pTl8NZN/NurusT3P/BNBT1X+mNJmJz6Yy9n4k6+6wEiJTAfW5st0BUTZWXIj1Bb mH6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bumJdb/2; 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 65-v6si21040305pfo.229.2018.05.24.04.15.25; Thu, 24 May 2018 04:15:39 -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=@kernel.org header.s=default header.b=bumJdb/2; 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 S968595AbeEXLOc (ORCPT + 99 others); Thu, 24 May 2018 07:14:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:33534 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968108AbeEXJyC (ORCPT ); Thu, 24 May 2018 05:54:02 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 ED35A208AF; Thu, 24 May 2018 09:54:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527155641; bh=5iomdVDpc4/uyiBMiw+DO5Aw4xnP2oxKcQQRm+ZvLx8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bumJdb/2vFC3VrP7GYe26kPEnx6bRwjTuRih+v6YDneWadiaTMbBaAuDjHdE2TnDu f/dq8bSvehpJQmiUYl9R8GDzxVIl3YGhR5xSh6gGwwm3bk2eTRgbkK4x2dsA+QcgBv oympDLuzcslg0ENxqTEyeYMXt+JjfESQX6iqJiGU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yoshihiro Shimoda , Mathias Nyman , Sasha Levin Subject: [PATCH 4.14 063/165] usb: host: xhci-plat: revert "usb: host: xhci-plat: enable clk in resume timing" Date: Thu, 24 May 2018 11:37:49 +0200 Message-Id: <20180524093624.571694301@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180524093621.979359379@linuxfoundation.org> References: <20180524093621.979359379@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.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yoshihiro Shimoda [ Upstream commit d56e57ca030c8b4296944a2ae61ac167bf979c07 ] This patch reverts the commit 835e4241e714 ("usb: host: xhci-plat: enable clk in resume timing") because this driver also has runtime PM and the commit 560869100b99 ("clk: renesas: cpg-mssr: Restore module clocks during resume") will restore the clock on R-Car H3 environment. If the xhci_plat_suspend() disables the clk, the system cannot enable the clk in resume like the following behavior: < In resume > - genpd_resume_noirq() runs and enable the clk (enable_count = 1) - cpg_mssr_resume_noirq() restores the clk register. -- Since the clk was disabled in suspend, cpg_mssr_resume_noirq() will disable the clk and keep the enable_count. - Even if xhci_plat_resume() calls clk_prepare_enable(), since the enable_count is 1, the clk will be not enabled. After this patch is applied, the cpg-mssr driver will save the clk as enable, so the clk will be enabled in resume. Fixes: 835e4241e714 ("usb: host: xhci-plat: enable clk in resume timing") Signed-off-by: Yoshihiro Shimoda Signed-off-by: Mathias Nyman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci-plat.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -355,7 +355,6 @@ static int __maybe_unused xhci_plat_susp { struct usb_hcd *hcd = dev_get_drvdata(dev); struct xhci_hcd *xhci = hcd_to_xhci(hcd); - int ret; /* * xhci_suspend() needs `do_wakeup` to know whether host is allowed @@ -365,12 +364,7 @@ static int __maybe_unused xhci_plat_susp * reconsider this when xhci_plat_suspend enlarges its scope, e.g., * also applies to runtime suspend. */ - ret = xhci_suspend(xhci, device_may_wakeup(dev)); - - if (!device_may_wakeup(dev) && !IS_ERR(xhci->clk)) - clk_disable_unprepare(xhci->clk); - - return ret; + return xhci_suspend(xhci, device_may_wakeup(dev)); } static int __maybe_unused xhci_plat_resume(struct device *dev) @@ -379,9 +373,6 @@ static int __maybe_unused xhci_plat_resu struct xhci_hcd *xhci = hcd_to_xhci(hcd); int ret; - if (!device_may_wakeup(dev) && !IS_ERR(xhci->clk)) - clk_prepare_enable(xhci->clk); - ret = xhci_priv_resume_quirk(hcd); if (ret) return ret;