From patchwork Fri Dec 1 10:40:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AngeloGioacchino Del Regno X-Patchwork-Id: 172409 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp1024004vqy; Fri, 1 Dec 2023 02:41:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IGwqJhHZB3+/uKalmkSPprhT2nFLJXcSLWN7vUgkLdhwXOqcU33S7T8dGaVWZkOfmeTVKer X-Received: by 2002:a05:6a20:158b:b0:18b:985e:8035 with SMTP id h11-20020a056a20158b00b0018b985e8035mr26748071pzj.12.1701427303177; Fri, 01 Dec 2023 02:41:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701427303; cv=none; d=google.com; s=arc-20160816; b=p7TgktnyEjc8NVYZ2uc9PlUAhbocMOGGfk2bkCOfrp/bW5sJ90QCDtzVHk5DOqFTRN vp25vThLodSR8TgqbDez5nDHrkHEuV3bkuQ7OY/6MCF2UXnvvgPuS5EjQiopF1hN0eIY gVwGlVDUeQGE0ppTKQ/8h/kjdGHAEL0TdsmWCrzfu3D3iegtVRqtNcHdhyo8rEjI5Lb4 xg9qGHH8iP+DdP1W3gVRDp0eERuqJ3WUyc5gtMpPDkzrJ0qYp2Gnpcg5/mRn6ksojcfi TkW9eOP6EubuSGoGsvuWovZUDZvbl4rk3ZsDMwOV46J6NaD+zL3Vcfa0zNx1dB70uGei kN4w== 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=tq7jyXCQ1MNbvNfmmtcieSqarVmMjHZsZF8RzV8rRW0=; fh=VZHXHo+vwBqT7vOg4dFYBUvOBDmtIVtwH9XG5mvsu+Q=; b=Jmepii6k9EqXXZFxzCLKWvIP7rW270Fg9mCJbWikysglr1F0ADvk9MYuYDd4ncYFKB SEHdVLdegsNm1jEKplr2RyvrruU46B7746qqh/cRGzfmCUhwMUD/tBq6z/M0HnUGjowt AG99tkjHZdmCwYhOZNrtsXphUuzuPiWROTNcleDjNG36Xy6+D0l9n3N2Vzi8E65+fKx9 MXHndAvvuYFytCrtbJDlprS+22xG9vWjqncqacAV2z7Tb0BjZGLJIjbNWRld9rq5x6Js ezTq8vJCKTrL/pNYgCcCTqqi0f1RKd+OPg/xBMNF57bntKZVypkW4JoH4+q+kbvkH4Kd omsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=E2Hspznz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id pb17-20020a17090b3c1100b00285874cccb7si3433932pjb.119.2023.12.01.02.41.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 02:41:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=E2Hspznz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 220B88083AE0; Fri, 1 Dec 2023 02:40:55 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378341AbjLAKkf (ORCPT + 99 others); Fri, 1 Dec 2023 05:40:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378327AbjLAKka (ORCPT ); Fri, 1 Dec 2023 05:40:30 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A6C1F4 for ; Fri, 1 Dec 2023 02:40:37 -0800 (PST) Received: from IcarusMOD.eternityproject.eu (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id D36D2660739E; Fri, 1 Dec 2023 10:40:34 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701427235; bh=UHGGjWyb9Jp3JfckcC+Y+MAj83qpLoBpUbGcBQKDZUc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E2HspznzDqvZveaKtQCiSgbNtBfMVi5xErnFeKQeQWsKSAcFYgQ7R5SOSX3QxSkDY y8WkRuiZ+oZLA2YRoeh2XpgT2Eho8+nCejD6C37b1+KnyOUVMWRXUhNROxOehZ9h6y Ezto/k+yNQqDVxNe8S6COFqRLXDBDhvJJX4kOah/jHPpjp5NgdO7qQU8vAb/8AI0sy F5v6eQeoBIewKj7CuNmNO4QdIJHjs2f+6FZHu/ZMFfcaWB7ESXxZ60cHmn29ohyAnn AGuluZZViuEzmc4zQx1X2lhLGz9HG59Q7Lf1bz0v/L2nkNMvnQBqzeDw3111D4vM5j LZEeWjlX0DWYw== From: AngeloGioacchino Del Regno To: boris.brezillon@collabora.com Cc: robh@kernel.org, steven.price@arm.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, angelogioacchino.delregno@collabora.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel@collabora.com, m.szyprowski@samsung.com, krzysztof.kozlowski@linaro.org Subject: [PATCH v3 2/3] drm/panfrost: Add gpu_irq, mmu_irq to struct panfrost_device Date: Fri, 1 Dec 2023 11:40:26 +0100 Message-ID: <20231201104027.35273-3-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231201104027.35273-1-angelogioacchino.delregno@collabora.com> References: <20231201104027.35273-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 01 Dec 2023 02:40:55 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784075835896472950 X-GMAIL-MSGID: 1784075835896472950 In preparation for adding a IRQ synchronization mechanism for PM suspend add gpu_irq and mmu_irq variables to struct panfrost_device and change functions panfrost_gpu_init() and panfrost_mmu_init() to use those. Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_device.h | 2 ++ drivers/gpu/drm/panfrost/panfrost_gpu.c | 10 +++++----- drivers/gpu/drm/panfrost/panfrost_mmu.c | 10 +++++----- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_device.h b/drivers/gpu/drm/panfrost/panfrost_device.h index 0fc558db6bfd..54a8aad54259 100644 --- a/drivers/gpu/drm/panfrost/panfrost_device.h +++ b/drivers/gpu/drm/panfrost/panfrost_device.h @@ -94,6 +94,8 @@ struct panfrost_device { struct device *dev; struct drm_device *ddev; struct platform_device *pdev; + int gpu_irq; + int mmu_irq; void __iomem *iomem; struct clk *clock; diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c index bd41617c5e4b..7adc4441fa14 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gpu.c +++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c @@ -454,7 +454,7 @@ void panfrost_gpu_power_off(struct panfrost_device *pfdev) int panfrost_gpu_init(struct panfrost_device *pfdev) { - int err, irq; + int err; err = panfrost_gpu_soft_reset(pfdev); if (err) @@ -469,11 +469,11 @@ int panfrost_gpu_init(struct panfrost_device *pfdev) dma_set_max_seg_size(pfdev->dev, UINT_MAX); - irq = platform_get_irq_byname(to_platform_device(pfdev->dev), "gpu"); - if (irq < 0) - return irq; + pfdev->gpu_irq = platform_get_irq_byname(to_platform_device(pfdev->dev), "gpu"); + if (pfdev->gpu_irq < 0) + return pfdev->gpu_irq; - err = devm_request_irq(pfdev->dev, irq, panfrost_gpu_irq_handler, + err = devm_request_irq(pfdev->dev, pfdev->gpu_irq, panfrost_gpu_irq_handler, IRQF_SHARED, KBUILD_MODNAME "-gpu", pfdev); if (err) { dev_err(pfdev->dev, "failed to request gpu irq"); diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c index 846dd697c410..ac4296c1e54b 100644 --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c @@ -753,13 +753,13 @@ static irqreturn_t panfrost_mmu_irq_handler_thread(int irq, void *data) int panfrost_mmu_init(struct panfrost_device *pfdev) { - int err, irq; + int err; - irq = platform_get_irq_byname(to_platform_device(pfdev->dev), "mmu"); - if (irq < 0) - return irq; + pfdev->mmu_irq = platform_get_irq_byname(to_platform_device(pfdev->dev), "mmu"); + if (pfdev->mmu_irq < 0) + return pfdev->mmu_irq; - err = devm_request_threaded_irq(pfdev->dev, irq, + err = devm_request_threaded_irq(pfdev->dev, pfdev->mmu_irq, panfrost_mmu_irq_handler, panfrost_mmu_irq_handler_thread, IRQF_SHARED, KBUILD_MODNAME "-mmu",