Received: by 2002:ac8:71d8:0:b0:40f:fb00:664b with SMTP id i24csp202476qtp; Fri, 4 Aug 2023 08:29:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEZWRkI6YX5RxVdMknFJK8dhu9cmnaAHs+roR5CXt7pKnN/cn32LUTlzIE5X1gV1b1G5UtR X-Received: by 2002:aa7:d782:0:b0:522:7db8:9939 with SMTP id s2-20020aa7d782000000b005227db89939mr1859472edq.29.1691162956626; Fri, 04 Aug 2023 08:29:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691162956; cv=none; d=google.com; s=arc-20160816; b=HYs98fO3ANBcDGGNNgbuWRojCQXJdoadC5Y2gJgs/mRZIQo5bF49+eWB2im89pdIZK wfVxNofm+wo8sVgLdWGuWKuf9tEGhwu4pVvzU/HHvB7LYnSS1KEYGt2uSWGP8K8DIRzB WMM+vKWPdQMhla2r2Y2StpKPj1ZpL/6DnGvq/NeEtkFup/7FAqD4Fyd95OYt6aL3JWoL 3En7zMs5rqxLKcnAgvYJ16pwtLndmTT1KFOW1PTiyIifq/5WXUvwjI02nBL5u1Iict+B yS1+qOeYKfndwspHlXLlloFKzmkQMqsO2tpoiBVuM9miOWbygv/vnEEWYVvGBPzQbq7i XXVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=wG1WwW+12DFf+CKdI7aZHmdWsc2lOzNCn0mjYoWP81A=; fh=L3qVOdH1ujMmG08yOqLWUlN5KiVWxqyEZ73voLaWAws=; b=cFagOUpnmX4KHrOrop7BnFEV2JkEZjiU6J2bGfF+vMc+AfAw4l2MWa03jxz2KYgawi m2mqpMhvZVhUj/O6kZNPvv6BTZEMTcjqlaPE2pO3Lq5l0OvT+PLUl42UDTioLNH0VRT+ 7isKiP6dKVpYIkQh3AV7aKDWMHE+AtB5dmfXkZi6SKMSPfiKac20DSd3Vuo1SF5M3Miq yqVJbE2vMX+Sa55ZQpkk+qPMe+ibsdtRTd5c4t+PwDf9bDMvCYgZPxuFQHa5iX6DQ5Z4 zq2VcTkZK81X9AXou6teTd8q6CZXbSTwVkJ3B/zR26Icym5wGXn1shlmAjBVhyoRfHXh 8RiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DeqIpYcY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f8-20020a056402150800b005231033581esi1186435edw.344.2023.08.04.08.28.44; Fri, 04 Aug 2023 08:29:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DeqIpYcY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230517AbjHDPKu (ORCPT + 99 others); Fri, 4 Aug 2023 11:10:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231286AbjHDPKo (ORCPT ); Fri, 4 Aug 2023 11:10:44 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4D4D4EE5 for ; Fri, 4 Aug 2023 08:10:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CA05362064 for ; Fri, 4 Aug 2023 15:10:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35E6BC43395 for ; Fri, 4 Aug 2023 15:10:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691161812; bh=k/WEV4wChuXrYdiVjfZQg92NekohcL6BMfLucYkhImI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=DeqIpYcYPsJrb5GoacN0Bs+9uHCfU0qlOXefyRIw345uQW+COgwQECJGhZLwO6oX9 NaMp+PQGGsKq3Nk1G17T4KJspQgLBpKj2OPesmFXhaWlTY6qeCA7nF+2jN+EsezlHZ IWGQOi9d23l2uwqOdptBKqKjUZ20qQfVfSBsvb7AQQHTfTrII6k0e4CuhsXW9150KP EG83O95mTUJw5XHZzDdQHMSZ4n1+1Du4uQB1b82S6zuDFC/v4rxzAY3zKn13edqom/ Oy+RyimmjBoNBQDzZmEXP62o+KVcUmm1+VJKS99rM40pkEilOG2LNaZEWAhJXzp/3v yenJZ/ZH6dBcw== Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1bbc7b2133fso15629695ad.1 for ; Fri, 04 Aug 2023 08:10:12 -0700 (PDT) X-Gm-Message-State: AOJu0YwlR7mDkEOeqsB2kr8Gr6lGvpEd6sx/3EG5YRHeWqFhTI0iWJ8f 4LCRbJX8TWvk0GnVuQUXi7mLq8cQcqIrRn9NO1Q0PQ== X-Received: by 2002:a17:90a:1bc6:b0:267:e011:3e9a with SMTP id r6-20020a17090a1bc600b00267e0113e9amr1495780pjr.3.1691161811724; Fri, 04 Aug 2023 08:10:11 -0700 (PDT) MIME-Version: 1.0 References: <20230804-lt8912b-v1-0-c542692c6a2f@ideasonboard.com> <20230804-lt8912b-v1-1-c542692c6a2f@ideasonboard.com> In-Reply-To: <20230804-lt8912b-v1-1-c542692c6a2f@ideasonboard.com> From: Robert Foss Date: Fri, 4 Aug 2023 17:10:01 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/4] drm/bridge: lt8912b: Fix bridge_detach To: Tomi Valkeinen Cc: Adrien Grassein , Andrzej Hajda , Neil Armstrong , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Francesco Dolcini , Stefan Eichenberger , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 On Fri, Aug 4, 2023 at 12:48=E2=80=AFPM Tomi Valkeinen wrote: > > The driver calls lt8912_bridge_detach() from its lt8912_remove() > function. As the DRM core detaches bridges automatically, this leads to > calling lt8912_bridge_detach() twice. The code probably has tried to > manage the double-call with the 'is_attached' variable, but the driver > never sets the variable to false, so its of no help. > > Fix the issue by dropping the call to lt8912_bridge_detach() from > lt8912_remove(), as the DRM core will handle the detach call for us, > and also drop the useless is_attached field. > > Fixes: 88abfc2b9e61 ("drm/bridge: Introduce LT8912B DSI to HDMI bridge") > Signed-off-by: Tomi Valkeinen > --- > drivers/gpu/drm/bridge/lontium-lt8912b.c | 16 +++++----------- > 1 file changed, 5 insertions(+), 11 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/lontium-lt8912b.c b/drivers/gpu/drm/b= ridge/lontium-lt8912b.c > index 4eaea67fb71c..0e581f6e3c88 100644 > --- a/drivers/gpu/drm/bridge/lontium-lt8912b.c > +++ b/drivers/gpu/drm/bridge/lontium-lt8912b.c > @@ -45,7 +45,6 @@ struct lt8912 { > > u8 data_lanes; > bool is_power_on; > - bool is_attached; > }; > > static int lt8912_write_init_config(struct lt8912 *lt) > @@ -575,8 +574,6 @@ static int lt8912_bridge_attach(struct drm_bridge *br= idge, > if (ret) > goto error; > > - lt->is_attached =3D true; > - > return 0; > > error: > @@ -588,15 +585,13 @@ static void lt8912_bridge_detach(struct drm_bridge = *bridge) > { > struct lt8912 *lt =3D bridge_to_lt8912(bridge); > > - if (lt->is_attached) { > - lt8912_hard_power_off(lt); > + lt8912_hard_power_off(lt); > > - if (lt->hdmi_port->ops & DRM_BRIDGE_OP_HPD) > - drm_bridge_hpd_disable(lt->hdmi_port); > + if (lt->hdmi_port->ops & DRM_BRIDGE_OP_HPD) > + drm_bridge_hpd_disable(lt->hdmi_port); > > - drm_connector_unregister(<->connector); > - drm_connector_cleanup(<->connector); > - } > + drm_connector_unregister(<->connector); > + drm_connector_cleanup(<->connector); > } > > static enum drm_connector_status > @@ -750,7 +745,6 @@ static void lt8912_remove(struct i2c_client *client) > { > struct lt8912 *lt =3D i2c_get_clientdata(client); > > - lt8912_bridge_detach(<->bridge); > drm_bridge_remove(<->bridge); > lt8912_free_i2c(lt); > lt8912_put_dt(lt); > > -- > 2.34.1 > Reviewed-by: Robert Foss