Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp355512pxb; Tue, 3 Nov 2020 01:06:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJwn+O6tYqW6Ms8Umb+ZoQS9fotCdetrENXVRYc3anPS2EY0BzuKIAvm/ZIELGheXd9VJHsU X-Received: by 2002:aa7:c1d3:: with SMTP id d19mr21596803edp.293.1604394390038; Tue, 03 Nov 2020 01:06:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604394390; cv=none; d=google.com; s=arc-20160816; b=wPeGPV4OC1FbXu64ZaGgsAoGu6uNfyZjqdqEUbu3OA8rwzkTo2iBHZvg7TcXfQHvr3 pVhstvEGG0yxoeslI07lfyV1jTgpEL6KpWbfycPvVRLUUz6LFtva1m40ldj8s1YcUr7J HimST4Euqhd50CD1Jgqjf1CqULD+kVAml8A1mHqvg7pvZcOSj9ev5ERPzlmJCK+Ib6pS lYPLQKuLpvZirQ/KTAuZZCsdgUO21O0rAAQC22txRj1emcoutKhHPnkdnt6JQbgf/LCp 2NCA3z4SF7xXrv9Da+HaNr/J8fSQFdcRFGQCCyIJWU1CynXH+Yckv7K5eboXQhLWSnxE BaYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject; bh=Aw2cxTwrjK+dSAksX/M80b6uvH6EKQWCUmWg0pyGecI=; b=XA5Sv6waiBhrxoOfMD9WPZgChZeE5PAOH9KtBdORsUuyp1OIINGr8vkDrwifuQcVAQ rJIXs/2kEojD/RVRYTkuUqHS1OkWly8MhX6H+c2DDo8nAasBtUgpN7J1drnY/ckky/+F pZpAOMejk0aRjeAHtXIGcDSRk87fR1HmjoN/mbOEuUkfrH+By/PhNYMFr52YnsqjSkKf TI7j+iO7A5UFK1/EvzK02mTw0txCSWQRg92jjOjzD8XuXlMV5I/zYzbqnz0LZcbQOdui Vohkl6nFoAoAFDJ/HlTWLt59grbIt7HJXQTIgSglYSKTWsYfcCz+WFNzfz0CLOka0PAH UXnw== 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 n11si11371443ejb.664.2020.11.03.01.06.07; Tue, 03 Nov 2020 01:06:30 -0800 (PST) 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 S1726212AbgKCJEj (ORCPT + 99 others); Tue, 3 Nov 2020 04:04:39 -0500 Received: from mx2.suse.de ([195.135.220.15]:43774 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725997AbgKCJEi (ORCPT ); Tue, 3 Nov 2020 04:04:38 -0500 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 17C75B135; Tue, 3 Nov 2020 09:04:36 +0000 (UTC) Subject: Re: [PATCH v2] drm: Add the new api to install irq To: "tiantao (H)" , Tian Tao , maarten.lankhorst@linux.intel.com, mripard@kernel.org, airlied@linux.ie, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <1604369441-65254-1-git-send-email-tiantao6@hisilicon.com> <8af4223a-037e-7093-cac3-0061aa7b8025@suse.de> <29e7eeb5-de7b-89bd-b710-38c00e3c7b54@huawei.com> From: Thomas Zimmermann Message-ID: <3c627d02-c226-bdda-772e-55a76ae52816@suse.de> Date: Tue, 3 Nov 2020 10:04:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.3 MIME-Version: 1.0 In-Reply-To: <29e7eeb5-de7b-89bd-b710-38c00e3c7b54@huawei.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="s7JgjpPpOWhj1zpnWsJpn22TN9iwH7Yet" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --s7JgjpPpOWhj1zpnWsJpn22TN9iwH7Yet Content-Type: multipart/mixed; boundary="4O1ho7gnFXB4kNPYLxDT4eDLCuMs074jk"; protected-headers="v1" From: Thomas Zimmermann To: "tiantao (H)" , Tian Tao , maarten.lankhorst@linux.intel.com, mripard@kernel.org, airlied@linux.ie, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Message-ID: <3c627d02-c226-bdda-772e-55a76ae52816@suse.de> Subject: Re: [PATCH v2] drm: Add the new api to install irq References: <1604369441-65254-1-git-send-email-tiantao6@hisilicon.com> <8af4223a-037e-7093-cac3-0061aa7b8025@suse.de> <29e7eeb5-de7b-89bd-b710-38c00e3c7b54@huawei.com> In-Reply-To: <29e7eeb5-de7b-89bd-b710-38c00e3c7b54@huawei.com> --4O1ho7gnFXB4kNPYLxDT4eDLCuMs074jk Content-Type: multipart/mixed; boundary="------------697B086C84832DFE51B1E0EB" Content-Language: en-US This is a multi-part message in MIME format. --------------697B086C84832DFE51B1E0EB Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Am 03.11.20 um 09:57 schrieb tiantao (H): >=20 >=20 > =E5=9C=A8 2020/11/3 15:56, Thomas Zimmermann =E5=86=99=E9=81=93: >> Hi >> >> Thanks, the code looks good already. There just are a few nits below. >> > Thanks for the help with the review code. > Add the new api devm_drm_irq_install and himbc use the new interface as= > one patch or two? Better make two patches from it. Best regards Thomas >=20 >> Am 03.11.20 um 03:10 schrieb Tian Tao: >>> Add new api devm_drm_irq_install() to register interrupts, >>> no need to call drm_irq_uninstall() when the drm module is removed. >>> >>> v2: >>> fixed the wrong parameter. >>> >>> Signed-off-by: Tian Tao >>> --- >>> =C2=A0 drivers/gpu/drm/drm_drv.c | 23 +++++++++++++++++++++++ >>> =C2=A0 include/drm/drm_drv.h=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 3 ++- >>> =C2=A0 2 files changed, 25 insertions(+), 1 deletion(-) >>> >>> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c >>> index cd162d4..0fe5243 100644 >>> --- a/drivers/gpu/drm/drm_drv.c >>> +++ b/drivers/gpu/drm/drm_drv.c >> >> The implementation should rather go to drm_irq.c >> >>> @@ -39,6 +39,7 @@ >>> =C2=A0 #include >>> =C2=A0 #include >>> =C2=A0 #include >>> +#include >>> =C2=A0 #include >>> =C2=A0 #include >>> =C2=A0 #include >>> @@ -678,6 +679,28 @@ static int devm_drm_dev_init(struct device *pare= nt, >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return ret; >>> =C2=A0 } >>> =C2=A0 +static void devm_drm_dev_irq_uninstall(void *data) >>> +{ >>> +=C2=A0=C2=A0=C2=A0 drm_irq_uninstall(data); >>> +} >>> + >>> +int devm_drm_irq_install(struct device *parent, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 struct drm_device *dev, int irq) >>> +{ >>> +=C2=A0=C2=A0=C2=A0 int ret; >>> + >>> +=C2=A0=C2=A0=C2=A0 ret =3D drm_irq_install(dev, irq); >>> +=C2=A0=C2=A0=C2=A0 if (ret) >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 return ret; >>> + >>> +=C2=A0=C2=A0=C2=A0 ret =3D devm_add_action(parent, devm_drm_dev_irq_= uninstall, dev); >>> +=C2=A0=C2=A0=C2=A0 if (ret) >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 devm_drm_dev_irq_uninstal= l(dev); >>> + >>> +=C2=A0=C2=A0=C2=A0 return ret; >>> +} >>> +EXPORT_SYMBOL(devm_drm_irq_install); >>> + >>> =C2=A0 void *__devm_drm_dev_alloc(struct device *parent, struct drm_d= river >>> *driver, >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 size_t size, size_t offset) >>> =C2=A0 { >>> diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h >>> index 0230762..fec1776 100644 >>> --- a/include/drm/drm_drv.h >>> +++ b/include/drm/drm_drv.h >> >> And the declaration should go to drm_irq.h >> >> We generally don't merge unused code, so you should convert at least o= ne >> KMS driver, say hibmc, to use the new interface. >> >> Best regards >> Thomas >> >>> @@ -513,7 +513,8 @@ struct drm_driver { >>> =C2=A0 =C2=A0 void *__devm_drm_dev_alloc(struct device *parent, struc= t >>> drm_driver *driver, >>> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 size_t size, size_t offset); >>> - >>> +int devm_drm_irq_install(struct device *parent, struct drm_device *d= ev, >>> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 int irq); >>> =C2=A0 /** >>> =C2=A0=C2=A0 * devm_drm_dev_alloc - Resource managed allocation of a >>> &drm_device instance >>> =C2=A0=C2=A0 * @parent: Parent device object >>> >> >=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 --------------697B086C84832DFE51B1E0EB Content-Type: application/pgp-keys; name="OpenPGP_0x680DC11D530B7A23.asc" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="OpenPGP_0x680DC11D530B7A23.asc" -----BEGIN PGP PUBLIC KEY BLOCK----- xsBNBFs50uABCADEHPidWt974CaxBVbrIBwqcq/WURinJ3+2WlIrKWspiP83vfZKaXhFYsdgX= H47 fDVbPPj+d6tQrw5lPQCyqjwrCPYnq3WlIBnGPJ4/jreTL6V+qfKRDlGLWFjZcsrPJGE0BeB5B= bqP 5erN1qylK9i3gPoQjXGhpBpQYwRrEyQyjuvk+Ev0K1Jc5tVDeJAuau3TGNgah4YchdHm3bkPj= z9E ErV85RwvImQ1dptvx6s7xzwXTgGAsaYZsL8WCwDaTuqFa1d1jjlaxg6+tZsB9GluwvIhSezPg= nEm imZDkGnZRRSFiGP8yjqTjjWuf0bSj5rUnTGiyLyRZRNGcXmu6hjlABEBAAHNKFRob21hcyBaa= W1t ZXJtYW5uIDx0emltbWVybWFubkBzdXNlLmNvbT7CwI4EEwEIADgCGwMFCwkIBwIGFQoJCAsCB= BYC AwECHgECF4AWIQRyF/usjOnPY0ShaOVoDcEdUwt6IwUCXvxIWAAKCRBoDcEdUwt6I+aZB/9ih= Onf G4Lgf1L87cvoXh95/bnaJ6aQhP6/ZeRleuCXflnyDajlm3c9loQr0r2bQUi7JeYwUKbBab2QS= GJm DMRGlLMnmzWB8mHmZ6bHAu+2Sth8SraE42p6BB9d8dlYEID+dl/D/xUBeulfkck5rloGtYqDi= +1Q DfkEZJaxVSZ6FFkXuQi/G9qcI4iklN2nv02iQ7mZe8WYAysix6s/6vIobhirEBreclSNxXqis= p8n 91+v855JC11EgRdUXMRK81IAaCKXP8zLx3ixku7mvP9Om61yerHSbeU2HZbIggZYQlFh6llJm= zF1 CjCWgPTJyk4t4kMTcNOw5ykD47vU/KW+wl0EEBECAB0WIQQn6OOmnzvP/7ktjmoud6EwEfXTw= gUC Wzod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Fq -----END PGP PUBLIC KEY BLOCK----- --------------697B086C84832DFE51B1E0EB-- --4O1ho7gnFXB4kNPYLxDT4eDLCuMs074jk-- --s7JgjpPpOWhj1zpnWsJpn22TN9iwH7Yet Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEEchf7rIzpz2NEoWjlaA3BHVMLeiMFAl+hHSIFAwAAAAAACgkQaA3BHVMLeiOH ggf5AVZWpAB2XKBb5YfD+7piOl0NNClBanvsMNxq24SCegvgPcY3GD0wxn8HHTYO2TunbHoKaKeE q+SZDzgO0rS9sypxhl3KaPYpMSo72aj4xBh/EKbbDK2Lw78of7fmy2zq12di/V6w13tsmA4QZF8/ WR610w4ZpOEieIdchDTFX/yuLSDIxtRxn/cwJmNQHgfUECVT/eLuzYNe7X+MJI0vH8qoqGkWJHZE WKAFW9MqWHA2iSTuJW3Kmlzi7UUmzF7Umh2r93yDwalg/wMTEdI5+ssPdAHoIm+h3XKtA81moXQJ YcVQJw6QyC05bSY4okVHsdpVYe6W4G1PxmdAuOPf/g== =NF6O -----END PGP SIGNATURE----- --s7JgjpPpOWhj1zpnWsJpn22TN9iwH7Yet--