Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1502965ybt; Thu, 2 Jul 2020 07:08:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzm0dpwOEaOwHguH/fqmoHt2geH33xkfLFmMYzoAYNI030AtWR31x1A2O2A15v0fcXsANX0 X-Received: by 2002:aa7:d44f:: with SMTP id q15mr33354784edr.340.1593698904949; Thu, 02 Jul 2020 07:08:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593698904; cv=none; d=google.com; s=arc-20160816; b=LZUfTlDYXJJkE0o/aSsMrwtnOpVBpsPDuggX1BpxqM8AZFX4sauC1FT9bzL/AC5dVK rhLItXWilg9xJFd3acU5s4lUybyhWnjYSR5cF7FCoqa30Alxe/8HGeSc4RgY24xxvzoU vxgpGl/J30W9OcmlUqoLd7JydSqkiMH9OtmVE2Y48hFaR7UQtWO5XgAE+cITiMmV5vlI ELh4qCPw5hpbLT2e1/6wto+np3BIaknSp9rUYc1TrmnL553ivldZAB5ZEl+stpeAUwii XzojMOKFE80mjtkMI9+HTURNn4AhFlMuXJt+FoiIFFXaQiBwRTTqv2rZjtiXRH05VQwo 4iJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject; bh=LiYbVBXUo67e5wo/KvrnLCn4NdR/eRlJfMrOS4dDl7w=; b=z6zGMCHXnIslEUT2O9dXDNfSJux082zAJGunfnjA4faqzE4nUQBUGt2EkW+TrOrd8E OSMNjLfORu/Xcwqs69tSW1pq0FK8Rg7jkhDb4X1zL7ACz7giioC8ZP67ad2YmmIqr9GR VoGlzek+SqvyPWLBPpQUOqANZjqO+fXSMHGO71RSrWQrR/M6UnPW5PxQwBYETpt8W2yS EW2gkqIaXODDYv8yhTWyk0BD2EFFTxDzQ0/VAEyS3O5K0jbADLs3JnBlt0JWGDir9fa1 ad3VygPalbfVBzJYUx94NH/5VpEil8TBi01G1zbiD2zR7x1HEcFVDW1AzhhWYUjTl81W Lv4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m4si6127649ejo.514.2020.07.02.07.08.01; Thu, 02 Jul 2020 07:08:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729404AbgGBOHc (ORCPT + 99 others); Thu, 2 Jul 2020 10:07:32 -0400 Received: from mx2.suse.de ([195.135.220.15]:34628 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726500AbgGBOHb (ORCPT ); Thu, 2 Jul 2020 10:07:31 -0400 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 B7A64ADAA; Thu, 2 Jul 2020 14:07:29 +0000 (UTC) Subject: Re: [PATCH] drm/hisilicon: Use drmm_kzalloc() instead of devm_kzalloc() To: Tian Tao , puck.chen@hisilicon.com, airlied@linux.ie, kraxel@redhat.com, alexander.deucher@amd.com, tglx@linutronix.de, dri-devel@lists.freedesktop.org, xinliang.liu@linaro.org, linux-kernel@vger.kernel.org, inuxarm@huawei.com References: <1593652914-19639-1-git-send-email-tiantao6@hisilicon.com> <20200702131617.GY3278063@phenom.ffwll.local> From: Thomas Zimmermann Message-ID: Date: Thu, 2 Jul 2020 16:07:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200702131617.GY3278063@phenom.ffwll.local> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="IQNS5Lgj5hD7NbGynnevIaPaxKrc2MxkO" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --IQNS5Lgj5hD7NbGynnevIaPaxKrc2MxkO Content-Type: multipart/mixed; boundary="c4VxCKalZJooM6U7Zw6IO46gjXHN6CXHI"; protected-headers="v1" From: Thomas Zimmermann To: Tian Tao , puck.chen@hisilicon.com, airlied@linux.ie, kraxel@redhat.com, alexander.deucher@amd.com, tglx@linutronix.de, dri-devel@lists.freedesktop.org, xinliang.liu@linaro.org, linux-kernel@vger.kernel.org, inuxarm@huawei.com Message-ID: Subject: Re: [PATCH] drm/hisilicon: Use drmm_kzalloc() instead of devm_kzalloc() References: <1593652914-19639-1-git-send-email-tiantao6@hisilicon.com> <20200702131617.GY3278063@phenom.ffwll.local> In-Reply-To: <20200702131617.GY3278063@phenom.ffwll.local> --c4VxCKalZJooM6U7Zw6IO46gjXHN6CXHI Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi Daniel Am 02.07.20 um 15:16 schrieb Daniel Vetter: > On Thu, Jul 02, 2020 at 09:21:54AM +0800, Tian Tao wrote: >> using the new API drmm_kzalloc() instead of devm_kzalloc() >> >> Signed-off-by: Tian Tao >> --- >> drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers= /gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c >> index a6fd0c2..2f20704 100644 >> --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c >> +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c >> @@ -23,6 +23,7 @@ >> #include >> #include >> #include >> +#include >> =20 >> #include "hibmc_drm_drv.h" >> #include "hibmc_drm_regs.h" >> @@ -267,7 +268,7 @@ static int hibmc_load(struct drm_device *dev) >> struct hibmc_drm_private *priv; >> int ret; >> =20 >> - priv =3D devm_kzalloc(dev->dev, sizeof(*priv), GFP_KERNEL); >> + priv =3D drmm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); >=20 > Hm would be nice if hisilicon could entirely switch over to embedding, = and > stop using the driver private pointer. Quite a bit more work though. As= -is > this change here isn't really brining you closer to that, pretty much a= ll > the lifetime bugs around hotunload are still there. Well, it's a first step. The follow-up patch for embedding connector and encoder removes more instances of devm_kzalloc(). Although I have to say, I'd rather review a longer patch series that fully addresses the problem, instead the current one-by-one approach. Best regards Thomas > -Daniel >=20 >> if (!priv) { >> DRM_ERROR("no memory to allocate for hibmc_drm_private\n"); >> return -ENOMEM; >> --=20 >> 2.7.4 >> >=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 --c4VxCKalZJooM6U7Zw6IO46gjXHN6CXHI-- --IQNS5Lgj5hD7NbGynnevIaPaxKrc2MxkO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQFIBAEBCAAyFiEEchf7rIzpz2NEoWjlaA3BHVMLeiMFAl796h0UHHR6aW1tZXJt YW5uQHN1c2UuZGUACgkQaA3BHVMLeiMxgAf/Y6N6+WPdzEC1+R9KNYFQVb9OQUxO 26E4t+xaXRsT3YHdjP3N6T2J+NA94IWoJqqCemYpIXc3j7gamS/D0YEcfeNRQqkw hzZjcqENDitaOrbJhn4SQBQc774xfu5TrfZpiz3HP4yIapJNS9HL6bmbUtnGbQqK cuC+eYoftScnvsXJr6y6H/EIVwIW3tpcQTlOtzn3oHiYZUrid2tnN66bL/5ud3+T fhHkwKJjLzsssPdooToPOg7zJmcYYOOAg9eJHzdalZqzMOcKzW9TK/kZYsvUJHky XG1tgQtBL4ytdAPC3Bqo49MA/08b/ztACv5PJj/syQDjJlwCpmxnefrQtw== =NxIC -----END PGP SIGNATURE----- --IQNS5Lgj5hD7NbGynnevIaPaxKrc2MxkO--