Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3445069pxb; Sun, 26 Sep 2021 15:46:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycScbJOQADF8PQ/fbpuCoMU9dNP6KQ3fb44+Fe7vWmWtHB5gPV+Unxv+TMdswBvUinIY8U X-Received: by 2002:a63:fb09:: with SMTP id o9mr6710835pgh.255.1632696369518; Sun, 26 Sep 2021 15:46:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632696369; cv=none; d=google.com; s=arc-20160816; b=0bX+oFTI2ZjFjnHKv2W0eNoPuSSrdAcbJ+/6KES5DUAewWEmtXgwJcT+RMUvUGG2RU nbJgqeEfTzWwECZatsgZy95vNFc5jNKhvgzjslG+ZlmjWch8rmHE+9/wjJUygdbatFg0 jEL/DusZ1ip3E6MOHuJ2dOFB/HpoppcUDeMkSu9onCxSc1vdC7n5fwgC5lNLWajTyyJH EyExz9lPdNLTTHDjx7I0ULI3C4xrGGgkSVL4D/3hfyfoKD5f9o0cpsM34dEpK4NziFQi x+yrUlj7tFNBva2fMak9XVun+d3AlB6GcExPlK/4At2ZNEPnwUkljNTpSbYrBrSXx25M XNxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=yDP03amDwCEY6IiivIbDG+60+C+xV/Pv6sR1LEywSYo=; b=JXCS+cOzMI87/nMuctcWFkNGq9voDapVHb9fyW/0ihLpdQ9Flvvjw22aRJ2b/N0FyZ EUvi+Kmft3CgCR5m03MDIMvnzME8CU09jxFnm00v2la/vRVZhwYTDiXXbi7r7uIbkoWn g79bbDdKyB0k+j7caA++KjqMnV8witkzYmUqV7jkLi76MS9wSjMgJdtzFOCepTkCPZbf fXoMfngxlnZAUYlGoroO/QgRq2pB/QwFu4LxVoAxHl6TCABBJntjDm0Kf+H0zDSokIkv B4y4YZCYmjBE278wrLUIQrKQ78yvwBq0j5l9uCP4Tf1JwkMMaTb44OaAMby36jwrAMx8 upYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ByNHptD1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t3si23957063pfd.189.2021.09.26.15.45.56; Sun, 26 Sep 2021 15:46:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ByNHptD1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231398AbhIZWq0 (ORCPT + 99 others); Sun, 26 Sep 2021 18:46:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231408AbhIZWoQ (ORCPT ); Sun, 26 Sep 2021 18:44:16 -0400 Received: from mail-lf1-x136.google.com (mail-lf1-x136.google.com [IPv6:2a00:1450:4864:20::136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 654EFC061570; Sun, 26 Sep 2021 15:42:39 -0700 (PDT) Received: by mail-lf1-x136.google.com with SMTP id g41so68399497lfv.1; Sun, 26 Sep 2021 15:42:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yDP03amDwCEY6IiivIbDG+60+C+xV/Pv6sR1LEywSYo=; b=ByNHptD14yPmBI5qwC9iLjNDIrS32hyv0eOv0r4DI67a82TRGkwAolm0a3jemhZJ1Y ndRBWXsWDlo2ZqXlOsa9s4WcpVXNs7zNzqFB0o2HJEQ2BUJAZuJN/NqsJn/Y9PaDty4P Qh9O3DDW2qCbpxE3fsT1jOVkZ9Q/zP1jt30/CYULft9d3sAFb24IH8CJnqtxgzmOD8Ap CjmvDPKdhiXMLtTMKHQTzOKc7JHVvXxW7MzBKpVRBTdP2+Bc2ohgArtTwM345FHktbyH sJTjvbUXKxsEw4SdFS506k3hjs364Wxxly6t038kdqy0ZrJazBY0OTp2jzkynLCES97Q 9CRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yDP03amDwCEY6IiivIbDG+60+C+xV/Pv6sR1LEywSYo=; b=qh5SJGnScyR3dct4XK1u4NKd+4MlTJvsD00J5h17l4yvmg+7b57bgFky/bTdxMPEbI +IfQviS1ANgIGtfQWg9vWeZVXmnDtKR81e5jOG0F/FGu4RqSg+j6vpSpfDgJB08t3bkz 8+W280e5htQ8QdoQqVIIjDwLfvsacusfu/xX3yD72XGyLrpfl+0KzGrEE4Nm+VmgMsxa hP1MPwspe0gd6gjmikQxrZjLH64a2L2/1UFhJLeKc3OOjDvTTkpMkkYd8hCzqDx+uUJv mUrSjYGLSvWJvBnB5RQAPNIagYjHooQHvfowEJFF/t+GH7ZL2QkDABu32mhOzpDlfGpf g9og== X-Gm-Message-State: AOAM532CUI6LgxZyO5GeAHvksNgXG8b61jfVClNge0vkmj50/ywFDSmF j56lj/JxVuRbVvaYMXRfQi8= X-Received: by 2002:a2e:a7c5:: with SMTP id x5mr1671863ljp.89.1632696157847; Sun, 26 Sep 2021 15:42:37 -0700 (PDT) Received: from localhost.localdomain (46-138-80-108.dynamic.spd-mgts.ru. [46.138.80.108]) by smtp.gmail.com with ESMTPSA id m10sm1408899lfr.272.2021.09.26.15.42.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:42:37 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Ulf Hansson , Viresh Kumar , Stephen Boyd , Peter De Schrijver , Mikko Perttunen , Peter Chen , Lee Jones , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Nishanth Menon , Adrian Hunter , Michael Turquette Cc: linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-usb@vger.kernel.org, linux-staging@lists.linux.dev, linux-pwm@vger.kernel.org, linux-mmc@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, Mark Brown , Vignesh Raghavendra , Richard Weinberger , Miquel Raynal , Lucas Stach , Stefan Agner , Mauro Carvalho Chehab , David Heidelberg Subject: [PATCH v13 10/35] gpu: host1x: Add host1x_channel_stop() Date: Mon, 27 Sep 2021 01:40:33 +0300 Message-Id: <20210926224058.1252-11-digetx@gmail.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210926224058.1252-1-digetx@gmail.com> References: <20210926224058.1252-1-digetx@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add host1x_channel_stop() which waits till channel becomes idle and then stops the channel hardware. This is needed for supporting suspend/resume by host1x drivers since the hardware state is lost after power-gating, thus the channel needs to be stopped before client enters into suspend. Tested-by: Peter Geis # Ouya T30 Tested-by: Paul Fertser # PAZ00 T20 Tested-by: Nicolas Chauvet # PAZ00 T20 and TK1 T124 Tested-by: Matt Merhar # Ouya T30 Signed-off-by: Dmitry Osipenko --- drivers/gpu/host1x/channel.c | 8 ++++++++ include/linux/host1x.h | 1 + 2 files changed, 9 insertions(+) diff --git a/drivers/gpu/host1x/channel.c b/drivers/gpu/host1x/channel.c index 4cd212bb570d..2a9a3a8d5931 100644 --- a/drivers/gpu/host1x/channel.c +++ b/drivers/gpu/host1x/channel.c @@ -75,6 +75,14 @@ struct host1x_channel *host1x_channel_get_index(struct host1x *host, return ch; } +void host1x_channel_stop(struct host1x_channel *channel) +{ + struct host1x *host = dev_get_drvdata(channel->dev->parent); + + host1x_hw_cdma_stop(host, &channel->cdma); +} +EXPORT_SYMBOL(host1x_channel_stop); + static void release_channel(struct kref *kref) { struct host1x_channel *channel = diff --git a/include/linux/host1x.h b/include/linux/host1x.h index 7bccf589aba7..66473b5be0af 100644 --- a/include/linux/host1x.h +++ b/include/linux/host1x.h @@ -181,6 +181,7 @@ struct host1x_job; struct host1x_channel *host1x_channel_request(struct host1x_client *client); struct host1x_channel *host1x_channel_get(struct host1x_channel *channel); +void host1x_channel_stop(struct host1x_channel *channel); void host1x_channel_put(struct host1x_channel *channel); int host1x_job_submit(struct host1x_job *job); -- 2.32.0