From patchwork Tue Mar 23 00:56:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 12156525 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7CEA6C433DB for ; Tue, 23 Mar 2021 00:57:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4329F619AE for ; Tue, 23 Mar 2021 00:57:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230479AbhCWA5N (ORCPT ); Mon, 22 Mar 2021 20:57:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231476AbhCWA5J (ORCPT ); Mon, 22 Mar 2021 20:57:09 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAF3EC061574 for ; Mon, 22 Mar 2021 17:57:08 -0700 (PDT) Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1E13C885; Tue, 23 Mar 2021 01:57:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1616461025; bh=33WH+hzN3JgixsFuUMQWQEGuDw/Pl+FQcmhuiHQuRGE=; h=From:To:Cc:Subject:Date:From; b=FmcXCNPuMhkMtMHjEfDvCjytjtbo2rtCXAWrkcU+TzjOHK5cfZnB4J3BAUNu6+28o GE5rghZzmW3j/0MJcbX4hgLQmTcOO8Te2O5jwgvRrWos277jT4U8853DAm4NgoGMQJ lLS7ZZtGFhJ5ciuCUld2rPhHxea2El0mKwUFlmEo= From: Laurent Pinchart To: dri-devel@lists.freedesktop.org Cc: linux-renesas-soc@vger.kernel.org Subject: [PATCH 1/2] drm: rcar-du: Don't put reference to drm_device in rcar_du_remove() Date: Tue, 23 Mar 2021 02:56:15 +0200 Message-Id: <20210323005616.20110-1-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 2.28.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org The reference to the drm_device that was acquired by devm_drm_dev_alloc() is released automatically by the devres infrastructure. It must not be released manually, as that causes a reference underflow.. Fixes: ea6aae151887 ("drm: rcar-du: Embed drm_device in rcar_du_device") Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c index 43de3d8686e8..2a06ec1cbefb 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c @@ -556,8 +556,6 @@ static int rcar_du_remove(struct platform_device *pdev) drm_kms_helper_poll_fini(ddev); - drm_dev_put(ddev); - return 0; } From patchwork Tue Mar 23 00:56:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 12156523 X-Patchwork-Delegate: kieran@bingham.xyz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 520B7C433C1 for ; Tue, 23 Mar 2021 00:57:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0FED66199F for ; Tue, 23 Mar 2021 00:57:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230467AbhCWA5M (ORCPT ); Mon, 22 Mar 2021 20:57:12 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:41854 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231468AbhCWA5H (ORCPT ); Mon, 22 Mar 2021 20:57:07 -0400 Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 57CCA8F0; Tue, 23 Mar 2021 01:57:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1616461026; bh=cxNXwLl1bpW8Kb5Kd6WkWoYN/NfLRBADz7YLk2AsHdI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m3QRNi4SKs1yaisOlk/sPwFgobMxHmI0jGCNEeurqeXtBjYdAR9G9f8PQPJ+WBKIE qcZ4aze8Oo7SY4kBReEjSwt2EifgWfrkcGDHSdXILUQ8X6wTtamOaB5GKUTLQ0hobZ i4UVT4SwJho4Oi/oQ6u8oKLPVpkroPRIcvSXlLvM= From: Laurent Pinchart To: dri-devel@lists.freedesktop.org Cc: linux-renesas-soc@vger.kernel.org Subject: [PATCH 2/2] drm: rcar-du: Shutdown the display on remove Date: Tue, 23 Mar 2021 02:56:16 +0200 Message-Id: <20210323005616.20110-2-laurent.pinchart+renesas@ideasonboard.com> X-Mailer: git-send-email 2.28.1 In-Reply-To: <20210323005616.20110-1-laurent.pinchart+renesas@ideasonboard.com> References: <20210323005616.20110-1-laurent.pinchart+renesas@ideasonboard.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org When the device is unbound from the driver (the DU being a platform device, this occurs either when removing the DU module, or when unbinding the device manually through sysfs), the display may be active. Make sure it gets shut down. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- drivers/gpu/drm/rcar-du/rcar_du_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c index 2a06ec1cbefb..9f1a3aad4dd7 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c @@ -553,6 +553,7 @@ static int rcar_du_remove(struct platform_device *pdev) struct drm_device *ddev = &rcdu->ddev; drm_dev_unregister(ddev); + drm_atomic_helper_shutdown(ddev); drm_kms_helper_poll_fini(ddev);