From patchwork Fri Aug 23 02:12:09 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: 172076 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp1625ily; Thu, 22 Aug 2019 19:12:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqzG4j3BlM4sOspOT98rtz2ETzvl3P/Q/PYWw2rKo1wyTPacOtSf1RNmTby+XbM2+rkgq0L9 X-Received: by 2002:a17:902:9041:: with SMTP id w1mr2069853plz.132.1566526349817; Thu, 22 Aug 2019 19:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566526349; cv=none; d=google.com; s=arc-20160816; b=QwRrbQFriBAJw/whAs3pnKQxvPZHHZBeN/pHpVoADfG3BaAPdY/xN6Fv+c/1tOGZ+9 bAMNtlbdy6sRhXmMf9NN0JlZwyxlzK0QZkhkbKUomyk117JNj0g6wPytahRUQFJtqPT7 OsuwTAqfgFkofMq+UPEXR6Kb448+CuIvFsgWFVZ65fVFlTOoDLM5H7M01I+CMy9myRzL zgP7wHPxRbtoDhkohtSnjlMWnz3hhUYLdY3METZWqnEnpSofkrMkqaMrL+64ttMDP1lI X8sCoUlbK013vyft+lnzPTZ5whueJD5CkAXA/YqRZAwz5nGy9/gh2m+UwTnRqV7bUn3w JAdw== 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=l+29fQl4Dnqcyp+PDB2nKswG3Hq5NgBxDL6W7mYmpcU=; b=ZM2k4/XoC4Dl66M1lGN+rwuxnS202rfUCPrYhsukKgO4L42Hq9ElVJyfPImyWmm4Od 9FGAAUmlfl/KJApzCah/5mFUWzvRU3asyMURNP71mxYmrLD0Jq/tGU1rQc6Wb2ccigOu FN/jXpPZ2BNnvcOjntor9gU7hNEwid/5bkyJLmKl7o1hVE9YbF2/tuMx3fs4p39JI7aO VikCZVufrH5YNLAyQp6tftBQZok9NZSxtlRzJR7bGvJE3LFBgmIWdXdhoqHE6DLPUCoz gdr3FUyuSb5BsNvGCR/7Ukvq9AgRzcDsGz1wBU2snphtEQT43MxYQsN8UC5UlmaHpZ5X 3N0Q== 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 q23si1045831pjp.76.2019.08.22.19.12.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Aug 2019 19:12:29 -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 626A66EBA3; Fri, 23 Aug 2019 02:12:25 +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 D0C256EAAA for ; Fri, 23 Aug 2019 02:12:20 +0000 (UTC) Received: by mail-oi1-f195.google.com with SMTP id q8so5637206oij.5 for ; Thu, 22 Aug 2019 19:12:20 -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=CtVv9KmOH1uY8onE46Ao79LAatPRJtfqcOsRBmR2M9Q=; b=lm7NrdhvRCY0ZW8DYbYnmfw1iRUuCluNcwJFuHNbL96EkrCXtu42+sOfrdQ0Dil6Rd ClV5kppI0iM3yQUUDQImHO+dsWcmgCJJ6Nq/3oqykQt8OcwJQgrCXHN6XzsUaCSZ0twS AuRU3mcFxPOFhzAlkLLdZQJvuofpOcWlrjdfLkz3ICkdYyXd1IbKI23dX/13k+8S7y9W MvKhfD+jcNjukB9JxJGwWRJDQScYTbDXPwfCUYnMreqvmNRjkxHMk4QvYk+BFQvmrXm5 ++vQ3O52l7shgpTwJ71xUeS/cC2Uc9WWOZDTi6g+/9JNy78373S/7G2vFsCdV+a0rnR0 DJ8w== X-Gm-Message-State: APjAAAXEf44elJACY+t3qMEidkjMpTQX58g6oanrZ44ZrC9UK3Yt3FYG DETiry1arIJ+CyoaHUd62eHZ36U= X-Received: by 2002:aca:dc88:: with SMTP id t130mr1435568oig.43.1566526339704; Thu, 22 Aug 2019 19:12:19 -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 c1sm457747oic.31.2019.08.22.19.12.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Aug 2019 19:12:19 -0700 (PDT) From: Rob Herring To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 1/8] drm/panfrost: Fix possible suspend in panfrost_remove Date: Thu, 22 Aug 2019 21:12:09 -0500 Message-Id: <20190823021216.5862-2-robh@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190823021216.5862-1-robh@kernel.org> References: <20190823021216.5862-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: Maxime Ripard , Tomeu Vizoso , David Airlie , Sean Paul , Steven Price , Boris Brezillon , Alyssa Rosenzweig , Robin Murphy Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Calls to panfrost_device_fini() access the h/w, but we already done a pm_runtime_put_sync_autosuspend() beforehand. This only works if the autosuspend delay is long enough. A 0ms delay will hang the system when removing the device. Fix this by moving the pm_runtime_put_sync_suspend() after the panfrost_device_fini() call. Cc: Tomeu Vizoso Cc: Steven Price Cc: Alyssa Rosenzweig Cc: David Airlie Cc: Daniel Vetter Signed-off-by: Rob Herring Reviewed-by: Steven Price --- v2: new patch drivers/gpu/drm/panfrost/panfrost_drv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index 44a558c6e17e..d74442d71048 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -570,11 +570,13 @@ static int panfrost_remove(struct platform_device *pdev) drm_dev_unregister(ddev); panfrost_gem_shrinker_cleanup(ddev); + pm_runtime_get_sync(pfdev->dev); - pm_runtime_put_sync_autosuspend(pfdev->dev); - pm_runtime_disable(pfdev->dev); panfrost_devfreq_fini(pfdev); panfrost_device_fini(pfdev); + pm_runtime_put_sync_suspend(pfdev->dev); + pm_runtime_disable(pfdev->dev); + drm_dev_put(ddev); return 0; }