From mboxrd@z Thu Jan 1 00:00:00 1970 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=-12.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 88A7AC433E1 for ; Tue, 28 Jul 2020 09:33:42 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6405520714 for ; Tue, 28 Jul 2020 09:33:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6405520714 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D73B289DDD; Tue, 28 Jul 2020 09:33:41 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5006389DDD for ; Tue, 28 Jul 2020 09:33:40 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id D1D94B6A0; Tue, 28 Jul 2020 09:33:49 +0000 (UTC) Subject: Re: [PATCH 04/13] drm/ast: Managed release of I2C adapter To: daniel@ffwll.ch References: <20200728074425.2749-1-tzimmermann@suse.de> <20200728074425.2749-5-tzimmermann@suse.de> <20200728092337.GD6419@phenom.ffwll.local> From: Thomas Zimmermann Message-ID: <27bc5694-e80b-d440-8e4a-c5eea94f15bd@suse.de> Date: Tue, 28 Jul 2020 11:33:38 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200728092337.GD6419@phenom.ffwll.local> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emil.l.velikov@gmail.com, dri-devel@lists.freedesktop.org, kraxel@redhat.com, airlied@redhat.com, sam@ravnborg.org Content-Type: multipart/mixed; boundary="===============0810736770==" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --===============0810736770== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="E1amhZfnsw7mE6BRbxiWHnXPbUJmVouCs" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --E1amhZfnsw7mE6BRbxiWHnXPbUJmVouCs Content-Type: multipart/mixed; boundary="QXPWSWf3yBAPjAUlmOsZpnmQMGGeZhXXB"; protected-headers="v1" From: Thomas Zimmermann To: daniel@ffwll.ch Cc: airlied@redhat.com, sam@ravnborg.org, emil.l.velikov@gmail.com, kraxel@redhat.com, yc_chen@aspeedtech.com, dri-devel@lists.freedesktop.org Message-ID: <27bc5694-e80b-d440-8e4a-c5eea94f15bd@suse.de> Subject: Re: [PATCH 04/13] drm/ast: Managed release of I2C adapter References: <20200728074425.2749-1-tzimmermann@suse.de> <20200728074425.2749-5-tzimmermann@suse.de> <20200728092337.GD6419@phenom.ffwll.local> In-Reply-To: <20200728092337.GD6419@phenom.ffwll.local> --QXPWSWf3yBAPjAUlmOsZpnmQMGGeZhXXB Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi Am 28.07.20 um 11:23 schrieb daniel@ffwll.ch: > On Tue, Jul 28, 2020 at 09:44:16AM +0200, Thomas Zimmermann wrote: >> Managed releases of the device's I2C adapter simplify the connector's >> release. >> >> Signed-off-by: Thomas Zimmermann >=20 > I think this breaks bisect, since at this point the release callback is= > called when the connector is already gone. At the end of the series it'= s > fine again though. >=20 > I've done a very cursory reading of your series to look for high-level > issues, I think overall reasonable. On the series: >=20 > Acked-by: Daniel Vetter >=20 > But maybe you want to polish a bit more, up to you. Thanks. I'll address your points and wait a bit longer. Usually Sam has a number of good comments as well. Best regards Thomas > -Daniel >=20 >> --- >> drivers/gpu/drm/ast/ast_mode.c | 21 ++++++++++----------- >> 1 file changed, 10 insertions(+), 11 deletions(-) >> >> diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_= mode.c >> index f421a60d8a96..27eb49bd12b3 100644 >> --- a/drivers/gpu/drm/ast/ast_mode.c >> +++ b/drivers/gpu/drm/ast/ast_mode.c >> @@ -39,6 +39,7 @@ >> #include >> #include >> #include >> +#include >> #include >> #include >> #include >> @@ -591,6 +592,14 @@ static void ast_i2c_setsda(void *i2c_priv, int da= ta) >> } >> } >> =20 >> +static void ast_i2c_release(struct drm_device *dev, void *data) >> +{ >> + struct ast_i2c_chan *i2c =3D data; >> + >> + i2c_del_adapter(&i2c->adapter); >> + i2c->dev =3D NULL; /* clear to signal absence of I2C support */ >> +} >> + >> static int ast_i2c_init(struct ast_i2c_chan *i2c, struct drm_device *= dev) >> { >> int ret; >> @@ -618,7 +627,7 @@ static int ast_i2c_init(struct ast_i2c_chan *i2c, = struct drm_device *dev) >> =20 >> i2c->dev =3D dev; /* signals presence of I2C support */ >> =20 >> - return 0; >> + return drmm_add_action_or_reset(dev, ast_i2c_release, i2c); >> } >> =20 >> static bool ast_i2c_is_initialized(struct ast_i2c_chan *i2c) >> @@ -626,14 +635,6 @@ static bool ast_i2c_is_initialized(struct ast_i2c= _chan *i2c) >> return !!i2c->dev; >> } >> =20 >> -static void ast_i2c_fini(struct ast_i2c_chan *i2c) >> -{ >> - if (!ast_i2c_is_initialized(i2c)) >> - return; >> - i2c_del_adapter(&i2c->adapter); >> - i2c->dev =3D NULL; /* clear to signal absence of I2C support */ >> -} >> - >> /* >> * Primary plane >> */ >> @@ -1139,8 +1140,6 @@ static enum drm_mode_status ast_mode_valid(struc= t drm_connector *connector, >> =20 >> static void ast_connector_destroy(struct drm_connector *connector) >> { >> - struct ast_connector *ast_connector =3D to_ast_connector(connector);= >> - ast_i2c_fini(&ast_connector->i2c); >> drm_connector_cleanup(connector); >> kfree(connector); >> } >> --=20 >> 2.27.0 >> >=20 --=20 Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany (HRB 36809, AG N=C3=BCrnberg) Gesch=C3=A4ftsf=C3=BChrer: Felix Imend=C3=B6rffer --QXPWSWf3yBAPjAUlmOsZpnmQMGGeZhXXB-- --E1amhZfnsw7mE6BRbxiWHnXPbUJmVouCs Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQFIBAEBCAAyFiEEchf7rIzpz2NEoWjlaA3BHVMLeiMFAl8f8PIUHHR6aW1tZXJt YW5uQHN1c2UuZGUACgkQaA3BHVMLeiMEtgf/cOr1qNA/kCi0a78wh3YcZSr5zSvS 73/YyIBrBE6ex50HagkpirOMjZ12fmV/EtxXo0nG0Kw5eS7jnJRit5G4wUWPOJ4V gSEFLK8SdQkq/wAhSI6k3BN6OLDdyV/vU1ZS6ZwJGdoBBFnoCPR+FpKfhk7RtY7H GVy0UqyuqEPRqlRTTY3oCT9uEFC7kzqInQCFRP7uUXi3htLbcKKrD9ur0wdSQ8le jxVv3ChbslR0EooQBXd3See1Ni276HKowj2snpvHopRouceV3eqRgaLOka2+ezIJ XmMnxd/EGlLXKQD8k1ntvsLweQ/pA8HwCsywo514sDh0mPyM8qj14YwfZA== =YniJ -----END PGP SIGNATURE----- --E1amhZfnsw7mE6BRbxiWHnXPbUJmVouCs-- --===============0810736770== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel --===============0810736770==--