Received: by 10.192.165.156 with SMTP id m28csp504275imm; Mon, 16 Apr 2018 04:13:44 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+QrRc9ogvghFrEiJBGVs5Xza4m9aFChJHQW/TkEAclIHGTwi1H1ntUsx0AyUgCRXIeaKJR X-Received: by 2002:a17:902:820d:: with SMTP id x13-v6mr14591919pln.225.1523877224110; Mon, 16 Apr 2018 04:13:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523877224; cv=none; d=google.com; s=arc-20160816; b=Se7mBl35hdAX+3XQd9/oFRJYMru7a89Yx1xvBACHLyETjh7lT+IM/74DgU42TW2Pd9 Bae1NsFXrTE9nDQszDvGAjdGSKZKwPC1fOec13cjcGigdFh41Q4GfJHDeX6Gvc7h0Sb3 MzkVtL1tcFTJ8xD/ca/vnBy60xUzNxmQ2bJ4IEX6+SwrUAoLu9HXPBP1DfEkIuL38xAZ zSNSE3MISSY1cnNwiQFItEPGP1h46tda6ZZGVijRWh2MO+fugI3rRNJAFGcoXuG3Ymif SACNVt+3oZm3kjHyuszW+q5VumDI9FiRnJ0+B7KDVZAiICO1kZNK5yCNd0RjIMCjZC6r pBmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=hQmbIKzOqcPDrxbU915xL/1Gjrvi7TigPHHTyO+JzTk=; b=rRqDn9xfDBQBRmmkaV6JaK+3xVnDL3zUI9uGwsY2ApcFwh2uSph4KTyegmwCmjCBj6 CvRgmNITA/Aj7H9p0//Co6C2Od5jUHA9hYyiO+NSrXAfUYPF0pggkTquyyPcwJw1qopd 34IP0niMMjWyNGqsRzlON5tK9PDMbOUq/fiwJdvYtXeVZfdKYDZQPhcY91aBiVJhG/JK yOM+7/+KLZ1MLagrn3MX8cq1p9XbxZitBGfOIR45Fiyozybt2qXvb9ViZAf5ZHlX343j aAcZBRpLdYro86KNRyvMyYQUWGIeZrfipApMLbinkJSnGNLWRkkcmq6Bct02qNK0lmeM mHpg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v123si4982685pgv.545.2018.04.16.04.13.30; Mon, 16 Apr 2018 04:13:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753244AbeDPJpk (ORCPT + 99 others); Mon, 16 Apr 2018 05:45:40 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:57218 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751840AbeDPJph (ORCPT ); Mon, 16 Apr 2018 05:45:37 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B498815B2; Mon, 16 Apr 2018 02:45:36 -0700 (PDT) Received: from e110455-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 859C23F25D; Mon, 16 Apr 2018 02:45:36 -0700 (PDT) Received: by e110455-lin.cambridge.arm.com (Postfix, from userid 1000) id DF05F6803C7; Mon, 16 Apr 2018 10:45:34 +0100 (BST) Date: Mon, 16 Apr 2018 10:45:34 +0100 From: Liviu Dudau To: Ayan Kumar Halder Cc: brian.starkey@arm.com, alexandru-cosmin.gheorghe@arm.com, malidp@foss.arm.com, airlied@linux.ie, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, nd@arm.com Subject: Re: [PATCH v2] drm/arm/malidp: Ensure that the crtcs are shutdown before removing any encoder/connector Message-ID: <20180416094534.GF14661@e110455-lin.cambridge.arm.com> References: <20180412154727.GJ16141@n2100.armlinux.org.uk> <1523633388-15112-1-git-send-email-ayan.halder@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1523633388-15112-1-git-send-email-ayan.halder@arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 13, 2018 at 04:29:48PM +0100, Ayan Kumar Halder wrote: > One needs to ensure that the crtcs are shutdown so that the > drm_crtc_state->connector_mask reflects that no connectors > are currently active. Further, it reduces the reference > count for each connector. This ensures that the connectors > and encoders can be cleanly removed either when _unbind > is called for the corresponding drivers or by > drm_mode_config_cleanup(). Describing what the code does is nice and good, however it is also useful to have a description of what the patch fixes, or why the fix provided by the patch is better. In this case, we need drm_atomic_helper_shutdown() to be called before component_unbind_all() otherwise the connectors attached to the component device will have the wrong reference count value and will not be cleanly cleared up. > > Signed-off-by: Ayan Kumar Halder With the updated commit message: Acked-by: Liviu Dudau > --- > > Changes in v2: > - Reset the connectors' mask and the reference counts in drm_device > before unbinding any of its components (ie connectors and > encoders). > > --- > drivers/gpu/drm/arm/malidp_drv.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c > index 8d20faa..0a788d7 100644 > --- a/drivers/gpu/drm/arm/malidp_drv.c > +++ b/drivers/gpu/drm/arm/malidp_drv.c > @@ -278,7 +278,6 @@ static int malidp_init(struct drm_device *drm) > > static void malidp_fini(struct drm_device *drm) > { > - drm_atomic_helper_shutdown(drm); > drm_mode_config_cleanup(drm); > } > > @@ -646,6 +645,7 @@ static int malidp_bind(struct device *dev) > malidp_de_irq_fini(drm); > drm->irq_enabled = false; > irq_init_fail: > + drm_atomic_helper_shutdown(drm); > component_unbind_all(dev, drm); > bind_fail: > of_node_put(malidp->crtc.port); > @@ -681,6 +681,7 @@ static void malidp_unbind(struct device *dev) > malidp_se_irq_fini(drm); > malidp_de_irq_fini(drm); > drm->irq_enabled = false; > + drm_atomic_helper_shutdown(drm); > component_unbind_all(dev, drm); > of_node_put(malidp->crtc.port); > malidp->crtc.port = NULL; > -- > 2.7.4 > -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯