Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp630187img; Fri, 22 Mar 2019 05:30:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5DC3b/R68bVzrKcENpUeVuU72Cz0ETNZQU6EAepmDCqqOJOPV59xBX4qoK48y/SuAg2Nk X-Received: by 2002:a17:902:2983:: with SMTP id h3mr9500683plb.332.1553257847208; Fri, 22 Mar 2019 05:30:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553257847; cv=none; d=google.com; s=arc-20160816; b=IEcUvD0oVv0SBF37Ixmx80eEtlxgLVjvkruiM2L7SoXi/4/xPPvQMTzol49P+hzy26 z8Gti2ohO3C+42nhwHC49RKeVw1t8I7JGQL01F6JnjJBlW2Xq5CdKXaFMNvhgRjoiRb3 LYV5acRMk0t/ICn0bsuhEg1Btuaa4BBkEFI44X7+3oJBRLK9gNd5r7JjVwX6lEIZuRE2 k9HYxzWL8AO8oQo2Numcn8F24Dn9rtGWNYdBcep60Yz9kOs2XbT0JTzS794YyNUp6AcQ 2VTEj8SYng4Xyon2Wxx3mK4n1t/eMoSgxaolTEbTNtuAjpKSyoQ55wpTQ8o3OLMTDx0R QXDA== 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=HehlS8SptcDVWhVdx1wnShRMcD+xXGirxcMfyb18x5Q=; b=a/wUFp0ebaz+FDUocke1VkASK9EmY7fXmRo+FAVMItCwK+wX5fC+ZAIChK7OpQZ+JN 2qxr73y5VGZnCv53Lp6tn4CSCuRKeMNNKUtcPqbUdAsl+Oh4893gjHaAlC/nP28jWZpS csGhWJGCPLvrJKJVR3O5kKlG5y9qLvZuSmBlngGyYZqjZ0l0fW9RMqo6DsmT4gTS+4Oe cCmL3yVkE2oUGIVHEljz4DQin/MCnnNGvVI5t3RptvEs5Idcl8gx5DLsB6gYoqbrFFoL 3hDdMvMGBiHj0LSSuPD93YDnlXpGIVj39xgU7NHKi1cJiq6k4EzLlm3uKk+jGodSiai7 qENQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=o5fUwSTb; 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 o1si6086795pfe.194.2019.03.22.05.30.32; Fri, 22 Mar 2019 05:30:47 -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=o5fUwSTb; 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 S2390603AbfCVMTT (ORCPT + 99 others); Fri, 22 Mar 2019 08:19:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:58152 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390402AbfCVMTK (ORCPT ); Fri, 22 Mar 2019 08:19:10 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 69A322054F; Fri, 22 Mar 2019 12:19:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553257149; bh=9aeln6Ool/Ll6KWF7ShclDeaLBUuQmPB7EEuAjJlmuo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o5fUwSTbuzXtYaWzn/tZMOeaaCo5vrceCobMIfMyHO/VrckJZ/bibeQavhEKGetcj 1UdUb1ELbmfc+E5kNZmmiiCZnlx4tV1iVN6icqKs64ULfg/pXa2sj/zVpHcyFw4vqU 6haR0XXu+MPkjMdh6lI1P2+bw8dTvc4PC/fV9OLM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Phuong Nguyen , Hiroyuki Yokoyama , Yoshihiro Shimoda , Vinod Koul Subject: [PATCH 5.0 147/238] dmaengine: usb-dmac: Make DMAC system sleep callbacks explicit Date: Fri, 22 Mar 2019 12:16:06 +0100 Message-Id: <20190322111307.041335199@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111258.383569278@linuxfoundation.org> References: <20190322111258.383569278@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 5.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Phuong Nguyen commit d9140a0da4a230a03426d175145989667758aa6a upstream. This commit fixes the issue that USB-DMAC hangs silently after system resumes on R-Car Gen3 hence renesas_usbhs will not work correctly when using USB-DMAC for bulk transfer e.g. ethernet or serial gadgets. The issue can be reproduced by these steps: 1. modprobe g_serial 2. Suspend and resume system. 3. connect a usb cable to host side 4. Transfer data from Host to Target 5. cat /dev/ttyGS0 (Target side) 6. echo "test" > /dev/ttyACM0 (Host side) The 'cat' will not result anything. However, system still can work normally. Currently, USB-DMAC driver does not have system sleep callbacks hence this driver relies on the PM core to force runtime suspend/resume to suspend and reinitialize USB-DMAC during system resume. After the commit 17218e0092f8 ("PM / genpd: Stop/start devices without pm_runtime_force_suspend/resume()"), PM core will not force runtime suspend/resume anymore so this issue happens. To solve this, make system suspend resume explicit by using pm_runtime_force_{suspend,resume}() as the system sleep callbacks. SET_NOIRQ_SYSTEM_SLEEP_PM_OPS() is used to make sure USB-DMAC suspended after and initialized before renesas_usbhs." Signed-off-by: Phuong Nguyen Signed-off-by: Hiroyuki Yokoyama Cc: # v4.16+ [shimoda: revise the commit log and add Cc tag] Signed-off-by: Yoshihiro Shimoda Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/dma/sh/usb-dmac.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/dma/sh/usb-dmac.c +++ b/drivers/dma/sh/usb-dmac.c @@ -694,6 +694,8 @@ static int usb_dmac_runtime_resume(struc #endif /* CONFIG_PM */ static const struct dev_pm_ops usb_dmac_pm = { + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, + pm_runtime_force_resume) SET_RUNTIME_PM_OPS(usb_dmac_runtime_suspend, usb_dmac_runtime_resume, NULL) };