From patchwork Sun Dec 29 17:22:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 182554 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp5459304ild; Sun, 29 Dec 2019 09:45:21 -0800 (PST) X-Google-Smtp-Source: APXvYqz+rQUxPhhuezdGSBvpstnrHGOG3lGFdDpphK4B1eLt8j2258kbLQV/PcOe3jePIyqch/Ys X-Received: by 2002:a9d:70d9:: with SMTP id w25mr65053933otj.231.1577641521239; Sun, 29 Dec 2019 09:45:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577641521; cv=none; d=google.com; s=arc-20160816; b=UNb6t5vM2Zapty6k0hDdsebiQ7bsTT9enDBigCyvfdVvON4fnUkSOieucDQCdtkeE8 cHuiC4sTGk9s44rAETmaeI4URFs13kq9edGI+bqc5nYkIIcOOhGUKaTvv6deeUvmF4B6 4Tn/2qN5Uw+J2f39mseGMl0xyFN8e/YaWfByfX2EEpwotATvnDAD+6AVpua+/3mYVW2A dpe3yreBpWg3JcJY6LCs8hFw3sx8WdjH4/z3Uudg32YW8YGomTaybTzDzUDAQQCY3uFz Inpduc6YHTUEIOTYJ7EDJeSLwpLv6Rmckgqy8jmMeKNuzpLDZ77x3yYxx26V8skLR9UA tXoA== 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=XiqM5n/HxqYiaXEw5mBUHw2TXdK03OpNcC7pz1s/Loc=; b=qAo/7jGse5QormIJWmrUUDaOGe/I+jytOpS9glkGNhOQdtnfTeeZfROgjv3MeJ/kvV /I7GUo6BJrmlEDIXJW8p3GK1Bds/C6Mhl/yEPWVNxhYAt0oesQ04O2fyp4fxmDgmgEwt vxQbtrQpXDgo0YWxGx1a2Dr61Jv4bFnHtemcm4BTzPtb0HwM1w6XxVObI6CjOhngNfET KjWF8PseSLcfqelmbHrGMYdGY/w0R1isF6vCoXUUWGhVBiawNVmkzWKNcZGBLtD4vDlP 37i4CVRfWrAOJG1VEI72oHBChjbsFkqCm8q5iO8wglpJ6fr1nVo5iQTx2jvp866yhaaC QMEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FGQcBkma; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 w2si21292985otq.31.2019.12.29.09.45.21; Sun, 29 Dec 2019 09:45:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=FGQcBkma; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730877AbfL2RpT (ORCPT + 14 others); Sun, 29 Dec 2019 12:45:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:54268 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729173AbfL2RpT (ORCPT ); Sun, 29 Dec 2019 12:45:19 -0500 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 4E260207FD; Sun, 29 Dec 2019 17:45:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577641518; bh=/15pi5qSvB4ceV78bERpn7re2axBK/lYD0PAppSjBj4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FGQcBkmaFnMJPwh5z/4twO2GO/8MHDZzu5wxl4hzZw4/y4mPAV6ygJpvjPMLBqzdt wNxLkOuI7nUgfIKzUhkuY5D5e/BwpzM7aG8Nhl6xsuaZtcFj+Gx+xeT9wU69Czg3/o lZxH2foV0tD4/HIfTe5N0ldHvzvo3sg8LlgcyrPI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stanimir Varbanov , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.4 098/434] media: venus: Fix occasionally failures to suspend Date: Sun, 29 Dec 2019 18:22:31 +0100 Message-Id: <20191229172708.099982918@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Stanimir Varbanov [ Upstream commit 8dbebb2bd01e6f36e9a215dcde99ace70408f2c8 ] Failure to suspend (venus_suspend_3xx) happens when the system is fresh booted and loading venus driver. This happens once and after reload the venus driver modules the problem disrepair. Fix the failure by skipping the check for WFI and IDLE bits if PC_READY is on in control status register. Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/qcom/venus/hfi_venus.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.20.1 diff --git a/drivers/media/platform/qcom/venus/hfi_venus.c b/drivers/media/platform/qcom/venus/hfi_venus.c index 7129a2aea09a..0d8855014ab3 100644 --- a/drivers/media/platform/qcom/venus/hfi_venus.c +++ b/drivers/media/platform/qcom/venus/hfi_venus.c @@ -1472,6 +1472,7 @@ static int venus_suspend_3xx(struct venus_core *core) { struct venus_hfi_device *hdev = to_hfi_priv(core); struct device *dev = core->dev; + u32 ctrl_status; bool val; int ret; @@ -1487,6 +1488,10 @@ static int venus_suspend_3xx(struct venus_core *core) return -EINVAL; } + ctrl_status = venus_readl(hdev, CPU_CS_SCIACMDARG0); + if (ctrl_status & CPU_CS_SCIACMDARG0_PC_READY) + goto power_off; + /* * Power collapse sequence for Venus 3xx and 4xx versions: * 1. Check for ARM9 and video core to be idle by checking WFI bit @@ -1511,6 +1516,7 @@ static int venus_suspend_3xx(struct venus_core *core) if (ret) return ret; +power_off: mutex_lock(&hdev->lock); ret = venus_power_off(hdev);