From patchwork Mon Aug 26 22:33:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 172225 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp4965619ily; Mon, 26 Aug 2019 15:33:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqxh7Ef5WpLtI7ZJstBVz7zcG8iQdIrc1oTJRfe4V2OSbXOMwCuDt5yKe0lbJix1nohmm5p+ X-Received: by 2002:aa7:8108:: with SMTP id b8mr6417951pfi.197.1566858822557; Mon, 26 Aug 2019 15:33:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566858822; cv=none; d=google.com; s=arc-20160816; b=ycfyQMvDjJPGOxoS18evJr1HtOZLXvJNlHsmR9Pt5qnGxzzLnkqt8Oz9ibdpNAwmOx jq6NMA2laPy6v0cKJR7GRWSnS/PQ3cQ6FJP1c7Q6c98xYq/jRd8MlFe8sPqPYzGTRPQ9 0H5u3mXnVuYRIGYT0Rv4PztR/hYaB01IwAu0u38sTC7t7kxbyaPKfU0GXosRP1Vqs4W4 ZoaMQwgT134sQMJOcJClRuOk1Bae3aAY4MLBis1BzQlOXOFMlt9PY3tTSOUMBJ9cchGk c70rNkn89QBbwrOJe746bvllJ0z1MRiZBjy6s1+dCOvSs2oUl0vbPMUPiFPT68GlURQF Kfqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to; bh=6R6Z6BmuwgXboh2rR1YGxPuYKp+3dbnYibRoIa2fVxQ=; b=MPWM3x5VdTpbJ34VUNWzp+euKkCwfbSvujUpQfph/pAO9TJuYEJqbOBTCzOS5ohGNg uK0CttYdr4ubkmgvcfYDNla2nLyayKr4DUrrxyd1/bkHsV1DUhamSImvPDz8uZOyTENv nM6WlXtvXGxyUcYS7pRhD/jbh4t8P9sp6lxhe6fi6ZTsN6MrOnqz8SqBNGnCdMa9E04H JoLBOFn/uSnb8nVPIS79AFwH0kUma2QX6zCAEHBrz3lQwWsSb3EKnMLVdiGh4LxIV8qc tM5wNzmIEVg8LbHiuQ8OFsQo2a+2PBpm1OhpXkc4NRxsf0IlHCWiTEGykq6er1DdIh7n 2jLQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id y5si10945523plt.128.2019.08.26.15.33.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 26 Aug 2019 15:33:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CDC326E320; Mon, 26 Aug 2019 22:33:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-oi1-f195.google.com (mail-oi1-f195.google.com [209.85.167.195]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9EF3789CA8 for ; Mon, 26 Aug 2019 22:33:28 +0000 (UTC) Received: by mail-oi1-f195.google.com with SMTP id o6so13405481oic.9 for ; Mon, 26 Aug 2019 15:33:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2f3o189Bj9Dp2uZTE2x4J7wjSYnkVvJZDV1ZxRluuIQ=; b=bAZDIL2MM8zEXXRVAwJLzY6NOQ2m/qOYCTzUwLEUUrpTtTOniZ/S7mDIyFFv44sQkx BtFM5A9sym32G615yP7BcpNZFmdxsQyjy406nDwbO9JN+uCvesQ4tjZI7/1EDCO7MiVb SXaCC7p/G3MoufEEE/RxAoErE+3FKbX5048iKnaUUb/0pXJmSDNwYMPkhk7tg63dQySL 9qbbkE8mKSDPlYYvIhyO1D1NmrH3LxDhrHWD60QJdf8V0J/TKjDmzdZMJaR8E3sobjHU 5ui+f6G42yXBJ6Q+sJUB9EOwq6WE5sFCas19XNRUg8Pc30lF7d/QjdpbaUZUOwr0sV/O vA5w== X-Gm-Message-State: APjAAAUVrkWIzIDKfQcOkyEkSFPtIfZ0QftBix4VODytx94zJJq485AT JakWJYk68nWbtrFknkwDjUozpFA= X-Received: by 2002:aca:4d85:: with SMTP id a127mr13779985oib.3.1566858807186; Mon, 26 Aug 2019 15:33:27 -0700 (PDT) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id e22sm3668959oii.7.2019.08.26.15.33.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2019 15:33:26 -0700 (PDT) From: Rob Herring To: dri-devel@lists.freedesktop.org Subject: [PATCH v3 8/8] drm/panfrost: Remove unnecessary hwaccess_lock spin_lock Date: Mon, 26 Aug 2019 17:33:17 -0500 Message-Id: <20190826223317.28509-9-robh@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190826223317.28509-1-robh@kernel.org> References: <20190826223317.28509-1-robh@kernel.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tomeu Vizoso , David Airlie , Steven Price , Alyssa Rosenzweig , Robin Murphy Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" With the introduction of the as_lock to serialize address space registers, the hwaccess_lock is only used within the job code and is not protecting anything. panfrost_job_hw_submit() only accesses registers for 1 job slot and it's already serialized by drm_sched. Fixes: 7282f7645d06 ("drm/panfrost: Implement per FD address spaces") Cc: Tomeu Vizoso Cc: Steven Price Cc: Alyssa Rosenzweig Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Rob Herring Reviewed-by: Steven Price --- v3: - New patch drivers/gpu/drm/panfrost/panfrost_device.c | 1 - drivers/gpu/drm/panfrost/panfrost_device.h | 2 -- drivers/gpu/drm/panfrost/panfrost_job.c | 4 ---- 3 files changed, 7 deletions(-) -- 2.20.1 diff --git a/drivers/gpu/drm/panfrost/panfrost_device.c b/drivers/gpu/drm/panfrost/panfrost_device.c index 73805210834e..46b0b02e4289 100644 --- a/drivers/gpu/drm/panfrost/panfrost_device.c +++ b/drivers/gpu/drm/panfrost/panfrost_device.c @@ -124,7 +124,6 @@ int panfrost_device_init(struct panfrost_device *pfdev) INIT_LIST_HEAD(&pfdev->scheduled_jobs); INIT_LIST_HEAD(&pfdev->as_lru_list); - spin_lock_init(&pfdev->hwaccess_lock); spin_lock_init(&pfdev->as_lock); err = panfrost_clk_init(pfdev); diff --git a/drivers/gpu/drm/panfrost/panfrost_device.h b/drivers/gpu/drm/panfrost/panfrost_device.h index b7fa08ed3a23..9c39b9794811 100644 --- a/drivers/gpu/drm/panfrost/panfrost_device.h +++ b/drivers/gpu/drm/panfrost/panfrost_device.h @@ -63,8 +63,6 @@ struct panfrost_device { struct drm_device *ddev; struct platform_device *pdev; - spinlock_t hwaccess_lock; - void __iomem *iomem; struct clk *clock; struct clk *bus_clock; diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c index 18bcc9bac6d2..a58551668d9a 100644 --- a/drivers/gpu/drm/panfrost/panfrost_job.c +++ b/drivers/gpu/drm/panfrost/panfrost_job.c @@ -141,7 +141,6 @@ static void panfrost_job_write_affinity(struct panfrost_device *pfdev, static void panfrost_job_hw_submit(struct panfrost_job *job, int js) { struct panfrost_device *pfdev = job->pfdev; - unsigned long flags; u32 cfg; u64 jc_head = job->jc; int ret; @@ -158,7 +157,6 @@ static void panfrost_job_hw_submit(struct panfrost_job *job, int js) cfg = panfrost_mmu_as_get(pfdev, &job->file_priv->mmu); panfrost_devfreq_record_transition(pfdev, js); - spin_lock_irqsave(&pfdev->hwaccess_lock, flags); job_write(pfdev, JS_HEAD_NEXT_LO(js), jc_head & 0xFFFFFFFF); job_write(pfdev, JS_HEAD_NEXT_HI(js), jc_head >> 32); @@ -187,8 +185,6 @@ static void panfrost_job_hw_submit(struct panfrost_job *job, int js) job, js, jc_head); job_write(pfdev, JS_COMMAND_NEXT(js), JS_COMMAND_START); - - spin_unlock_irqrestore(&pfdev->hwaccess_lock, flags); } static void panfrost_acquire_object_fences(struct drm_gem_object **bos,