From patchwork Mon Dec 4 11:42:14 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: 173232 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp2701494vqy; Mon, 4 Dec 2023 03:42:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IFbj0mQxdB8AQGVFHSayJhRQwVNxQ43oWk83O+/UfoHMKvUP5afEigeFNEJz8RvgLPZUSV8 X-Received: by 2002:a05:6a00:4305:b0:6bd:4ab7:5f69 with SMTP id cb5-20020a056a00430500b006bd4ab75f69mr5102454pfb.12.1701690152580; Mon, 04 Dec 2023 03:42:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701690152; cv=none; d=google.com; s=arc-20160816; b=Ukr9brXPuGDKlnBQAKNhbWwsA1kyD8R4Kw9sgK3vgspX0kPYjjQbrTbppATqPclDoV bbg/dWP0tgZKGwPO+FOTNtuUCE6upq7hS9iI+h05HWM0EVE6f6yTjQ2iYXz6LGUwfiPQ CKyvV8b9NYkNdEvJNl92lrjgz2nZTSeFEUvoqRYf1iKvdF6/TvpJ2tqmOJbPbdaMnYOl JkurK1uxwa6SnSzaaQ0Baq6HZ58WPelnhyDy1ZJYwDJiv32vG3Th0/XFg5Rd55ju23kk Yp5wtRip1zhgXyaAtF+P9KjWBMii2xPmXTqXN7pk6gI36KmzpQRQqVSJxfOP/rSe53gt ccVg== 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=j5OW4SwWFq4UolwWY7aSBZosmhZlHTgk9Jyi02Q9378=; fh=VZHXHo+vwBqT7vOg4dFYBUvOBDmtIVtwH9XG5mvsu+Q=; b=M9dkSsJum9WB+cAJrey52AhHovV/tGgqcAjXk+MItAFauUkZ5i0V/Ofd5vxuufLIEo hF4g3kums3OvUICnhsq16mTD9q7p7jJvPDIrmwyAdDTJgK4IPot4ALZjLztFG1f2lN/7 5KZ0ZGyJHoojVYMOpucYI7zSMyzzO7V4FBT87cxkPB2f5/sKRcWpqfhMuwJezjlm/vQX Ndlqn0O5zH7gRcUmo0Lrpe/MsuFoViQtcHRH9Bz+RNNm8GWYnB7it+zk9XAOC+WZ8D/H GF7v53YHxa/uvdQQDPqNMWr4mS3cYmPIlYEwaSJXYYYGXYsDQ2qEMLxFBTfodHlUNJqN B+JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=HvbUInVG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id dr2-20020a056a004a8200b006cbee3a0c06si7398904pfb.6.2023.12.04.03.42.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 03:42:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=HvbUInVG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 6312C8092212; Mon, 4 Dec 2023 03:42:31 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234751AbjLDLmU (ORCPT + 99 others); Mon, 4 Dec 2023 06:42:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231496AbjLDLmR (ORCPT ); Mon, 4 Dec 2023 06:42:17 -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 E1F4AD2 for ; Mon, 4 Dec 2023 03:42:23 -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 97B326602F41; Mon, 4 Dec 2023 11:42:21 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1701690142; bh=ESSV2PN7zmFyp4nUKZfzM2WLnL5lc7+ZvCKAFXMJow4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HvbUInVGsS0Z5UfJUeYhkSpAOrND8cGq7KDuXn+wgYoXBhjvRrcE7XAxCgpplBuZW 0W3zBGggftNvsjJwvDG61TpdmXoZwE20PYiZc1Ja5BVZvhT4ZVg3Ghn+TjOvw9BAK0 PNBg570cn3nZKAd7IrHC5zqxohEGh6OJuJiZwqTf0kE1aBXaavrBg+ZNeZWyUAGofO 3Sq5Vh7hbG1mzUE278G8Xl5DdCVs2VYbNBcfxxJ/yXUZ1rJwGGdRJASALueCbPLpaj 48iBM95MU+nw7HPKHBtVt21rhP95nRZRpMnnytiJcZEKSgYp2VVY1j0Hg29D8RL9sZ jme3YB5suw3Lw== 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 v4 2/3] drm/panfrost: Add gpu_irq, mmu_irq to struct panfrost_device Date: Mon, 4 Dec 2023 12:42:14 +0100 Message-ID: <20231204114215.54575-3-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231204114215.54575-1-angelogioacchino.delregno@collabora.com> References: <20231204114215.54575-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 04 Dec 2023 03:42:31 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784351453521439525 X-GMAIL-MSGID: 1784351453521439525 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. Reviewed-by: Boris Brezillon Reviewed-by: Steven Price Signed-off-by: AngeloGioacchino Del Regno Tested-by: Marek Szyprowski --- 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",