Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp379766pxb; Tue, 3 Nov 2020 01:56:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzu7/a+yKIYLt4hxd898dWS3cxez453MdfGYQlfG+OeWrwtc06g8KAnt8HmC6y+fHHtd2uz X-Received: by 2002:a17:907:42cf:: with SMTP id nz23mr6136829ejb.138.1604397360493; Tue, 03 Nov 2020 01:56:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604397360; cv=none; d=google.com; s=arc-20160816; b=msAtJv9sq3ocmhycRxAY8cucNuv4pwJLaXG6MK7nJaFrXew058qmwUCQvjnOF4p9vt HGYbtBGHLGOIXfuI0T7gj8ZkXYxT0kU958+ElmaWjqKwtrlknLTQRdIvaqWMqpO/J00g NoDYxEXUgdk2J3LebQXhoZ62fAjgZ99F+if1tbmShMcyux41F+Wrlex3D013ghN5BzKY kXt5aY/B8hj4UP/EKdBYrRBJebuoxQ+wr0WDh0xm/NHFoi29T4+0At8ueIOJ2A90tLm6 AgBuqlpNdUtZ0SEtorGo6hnI4b6BiWh3fJb6COkXRKZrV9QlCXQOOGcEwipHSkfIS6U4 LMHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=eDQ3z6R7HELxuV1aufq8yOfVMPtp2cGpDjOIGR+8JmM=; b=PWUsOtNmF0CDOYG2cK7qcbzWtBg3EjrwDSNxn7UiPQsRyfZwD1r8x1Koim0Q8cOe5P ms4S2njQv78Xqll57t+GzCKUG29niUn6Ga3CR4Olu9jbpv4HgLn3g7E4/v50xNplQks4 XWuFMlC+jlSCCu7M9qtk5llpmQEa3WZXvWQ9gNN9SuZqYN/JIiwaV+VZWus4vZ/KAFVh D8Cr66IEINYDFOkNjkjkAGAlA4ROw7fxyZ92XDoJIZP67BNive0CztBNGPiXpKlgq+uN vCmyo/zPpPVTuT+jyX+jM7iACrRk73+tub4FevzsWp+7skZwfeAe68pkk0T6L+MLo7f5 YFzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm1 header.b=I3SUt8wW; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=lxU1ZyCh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v9si11436062ede.143.2020.11.03.01.55.38; Tue, 03 Nov 2020 01:56:00 -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; dkim=pass header.i=@cerno.tech header.s=fm1 header.b=I3SUt8wW; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=lxU1ZyCh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727967AbgKCJwK (ORCPT + 99 others); Tue, 3 Nov 2020 04:52:10 -0500 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:47491 "EHLO wout2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726013AbgKCJwJ (ORCPT ); Tue, 3 Nov 2020 04:52:09 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 5A5D9B7A; Tue, 3 Nov 2020 04:52:08 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 03 Nov 2020 04:52:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=eDQ3z6R7HELxuV1aufq8yOfVMPt p2cGpDjOIGR+8JmM=; b=I3SUt8wWwADbU6MU/c2Rae3H24rPiVeyyJeN3vtoZrs kqVmUGPHOwNWZ5tUnaS156kBAi48dhDlJP8/N4AWuXlw5U7oJLdYWy6XnUh4nC9B qwLzuv0QaBAdr5QN3kkIA7ARaGjkzszRDbGkO5qoMUIEZFzJ4V0WSroJLu0ubREp aQnGTzVYm1UlexzsRS7ce7nffOJOs5WibiS7SbbhuY8ywx3GL+HhKnbXvF8shY4L LgCmn3qBgj62ik6exEJJp+V8i2hZH4xPMCfBc1nabPn9fq2ln2coz/ks1FAogC4W /uD9K6+K5dZQ7GJuLcAR/ztySG1b/NzXRd+B2ty7+JA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=eDQ3z6 R7HELxuV1aufq8yOfVMPtp2cGpDjOIGR+8JmM=; b=lxU1ZyChE1RJZCuRZZAESM OdGFL6WvqEk6looiCqrMDNesm5OOoD4mHT4sjBxUMR4e8D/DCrNWT+tPOi2dJMbq cGAcvsjoUZHYjuAcRaREbYpW93RBtxpvvSFj+o8acQPEg/94EwnJgM6vSHAh8KU7 u1L5eHcvhi7J6hZ3CdDABEYC+F0fqUO82htz0pvPDXhPT7Z3QGgmvi2qzfEzF6aI VOhUfAlxe9oEhpBS6n5/pFpUA6vujujHHhnE0qF54eFAIcwjKNr9w/F52zVJiAoo RoLpmbOKCQE3kCGst0GCsTFk7/4vcwpEJ77eMyBIvRxTptPyZ5N2qflLMT2RogDQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddtfedgtdelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepleekgeehhfdutdeljefgleejffehfffgieejhffgueefhfdtveetgeehieeh gedunecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 3CB1D3280069; Tue, 3 Nov 2020 04:52:06 -0500 (EST) Date: Tue, 3 Nov 2020 10:52:05 +0100 From: Maxime Ripard To: Tian Tao Cc: maarten.lankhorst@linux.intel.com, tzimmermann@suse.de, airlied@linux.ie, daniel@ffwll.ch, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] drm: Add the new api to install irq Message-ID: <20201103095205.ywabphbc2xbop6ae@gilmour.lan> References: <1604369441-65254-1-git-send-email-tiantao6@hisilicon.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xs6ln5j4huqhrzhw" Content-Disposition: inline In-Reply-To: <1604369441-65254-1-git-send-email-tiantao6@hisilicon.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --xs6ln5j4huqhrzhw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 03, 2020 at 10:10:41AM +0800, Tian Tao wrote: > Add new api devm_drm_irq_install() to register interrupts, > no need to call drm_irq_uninstall() when the drm module is removed. >=20 > v2: > fixed the wrong parameter. >=20 > Signed-off-by: Tian Tao > --- > drivers/gpu/drm/drm_drv.c | 23 +++++++++++++++++++++++ > include/drm/drm_drv.h | 3 ++- > 2 files changed, 25 insertions(+), 1 deletion(-) >=20 > 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 > @@ -39,6 +39,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -678,6 +679,28 @@ static int devm_drm_dev_init(struct device *parent, > return ret; > } > =20 > +static void devm_drm_dev_irq_uninstall(void *data) > +{ > + drm_irq_uninstall(data); > +} > + > +int devm_drm_irq_install(struct device *parent, > + struct drm_device *dev, int irq) > +{ > + int ret; > + > + ret =3D drm_irq_install(dev, irq); > + if (ret) > + return ret; > + > + ret =3D devm_add_action(parent, devm_drm_dev_irq_uninstall, dev); > + if (ret) > + devm_drm_dev_irq_uninstall(dev); > + > + return ret; > +} > +EXPORT_SYMBOL(devm_drm_irq_install); > + Shouldn't we tie the IRQ to the drm device (so with drmm_add_action) instead of tying it to the underlying device? Maxime >=20 --xs6ln5j4huqhrzhw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCX6EoRAAKCRDj7w1vZxhR xYkCAQC9VFY7e5GLo1YuFFmxexHLyg1jTL5G7fYo1CEBerCVbwD8DKPgZ4MI0x6P C0AMlKKWSCWLXIBmLvIKJ1KxLqMYbA0= =crER -----END PGP SIGNATURE----- --xs6ln5j4huqhrzhw--