Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13653638pxu; Mon, 4 Jan 2021 00:11:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJzhAsvAtZx/yr7xujOoJ2AZFOBxwwrK6RGpx3nHik7nHYTX85U1JTcOSJuo19lL5APxFK59 X-Received: by 2002:a50:fd10:: with SMTP id i16mr70618299eds.331.1609747873960; Mon, 04 Jan 2021 00:11:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609747873; cv=none; d=google.com; s=arc-20160816; b=B9lTGct3o8WErbQrJFbEkOKB4MUGERUpqdZb3rG9hJxPVV/sGKbRyjDckZsPcL+02u 62w0pEqW5hSMlRirVrweuhmsX6yXdV4Pe2roT2X711VPQGtp3MXthvyGRUBIXZyAnjBG iGdkI6wn2a+sGD6p0YJjLISOQ+GQS3MBsLNrCLcMDEWxevN3m9ILqHvQ8ab57VooA60D qF+YyY27ayV/5v5jw6PE4gMXpvqI2J9tI5/p1XbWwP/4kXu5AVaYVZfkbEztkajpigtP pqJcOOIeVzAdxM4QY2vL2pwTq2LOf9t3L4UMBEm3a3rAq8ToPeToAJixPV9u8VpGszYW r3ow== 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=sG3vhzwVbHGfNG02axWXxmjiUDN57QqyedaYOh5m0ZU=; b=v1GVEeC+m4cWeh/gTG8bNkxDudg4j+wVpFF8wG9uyDZ0kWcPdyVn4tdf+YTlf6xdFp 50b6g7uOC2A5cOqTfTN4S1UsvgqUX8x05n62+rALaENmgfJe4BIJiTRnrD3AdRXK2V4o oDjdTperfhYkHmHe6DsrStpQLrHfL8PvSP89EexSVAE/o25gUaYXSdD5znyW4IY9jrQ4 boWbjxLAKqkdmfF0fYd0ouSynTr/sgUHq7Lwk1/3A5oO61C2qT+d0QwSpZTDiKGHDdGZ ir4gFOVJ1mNiCSjaiY+z1Oab/yJrpQ92M58M+739crYshpzpW+IuxUkfISOqJUxwABuk wEIw== 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 i34si32928443edd.44.2021.01.04.00.10.39; Mon, 04 Jan 2021 00:11:13 -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 S1726178AbhADIE5 (ORCPT + 99 others); Mon, 4 Jan 2021 03:04:57 -0500 Received: from mx2.suse.de ([195.135.220.15]:51788 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726163AbhADIE4 (ORCPT ); Mon, 4 Jan 2021 03:04:56 -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 4D523AD75; Mon, 4 Jan 2021 08:04:15 +0000 (UTC) Subject: Re: [PATCH v2] drm/hisilicon: Add load and unload callback functions To: Tian Tao , airlied@linux.ie, daniel@ffwll.ch, kraxel@redhat.com, alexander.deucher@amd.com, tglx@linutronix.de, dri-devel@lists.freedesktop.org, xinliang.liu@linaro.org, linux-kernel@vger.kernel.org References: <1608799558-29564-1-git-send-email-tiantao6@hisilicon.com> From: Thomas Zimmermann Message-ID: Date: Mon, 4 Jan 2021 09:04:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <1608799558-29564-1-git-send-email-tiantao6@hisilicon.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="u6hWuRE08bl3qPl4zHmAMlPyFZi3LrVu3" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --u6hWuRE08bl3qPl4zHmAMlPyFZi3LrVu3 Content-Type: multipart/mixed; boundary="ciPq5Np7IqVuo7gosp9iQSLBNK1WF6MRW"; protected-headers="v1" From: Thomas Zimmermann To: Tian Tao , airlied@linux.ie, daniel@ffwll.ch, kraxel@redhat.com, alexander.deucher@amd.com, tglx@linutronix.de, dri-devel@lists.freedesktop.org, xinliang.liu@linaro.org, linux-kernel@vger.kernel.org Message-ID: Subject: Re: [PATCH v2] drm/hisilicon: Add load and unload callback functions References: <1608799558-29564-1-git-send-email-tiantao6@hisilicon.com> In-Reply-To: <1608799558-29564-1-git-send-email-tiantao6@hisilicon.com> --ciPq5Np7IqVuo7gosp9iQSLBNK1WF6MRW Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi, and a happy new year. Am 24.12.20 um 09:45 schrieb Tian Tao: > Add the callback functions of drm_driver structure member functions > load and unload, no need to call load in the hibmc_pci_probe function > and unload in the hibmc_pci_remove function. The load and unload callbacks are left over from long ago. They are now=20 deprecated.* Don't use them. >=20 > v2: > remove the hibmc_unload called from hibmc_pic_remove. If anything, you'd want to inline hibmc's load/unload into their callers.= Best regards Thomas *) White lie: They are used by the old non-KMS drivers. Anything with=20 KMS should not use them. >=20 > Signed-off-by: Tian Tao > --- > drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 18 +++++++---------= -- > 1 file changed, 7 insertions(+), 11 deletions(-) >=20 > diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/= gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c > index 0d4e902..10042cf 100644 > --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c > +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c > @@ -27,6 +27,9 @@ > =20 > DEFINE_DRM_GEM_FOPS(hibmc_fops); > =20 > +static int hibmc_load(struct drm_device *dev, unsigned long flags); > +static void hibmc_unload(struct drm_device *dev); > + > static irqreturn_t hibmc_drm_interrupt(int irq, void *arg) > { > struct drm_device *dev =3D (struct drm_device *)arg; > @@ -63,6 +66,8 @@ static const struct drm_driver hibmc_driver =3D { > .dumb_map_offset =3D drm_gem_vram_driver_dumb_mmap_offset, > .gem_prime_mmap =3D drm_gem_prime_mmap, > .irq_handler =3D hibmc_drm_interrupt, > + .load =3D hibmc_load, > + .unload =3D hibmc_unload, > }; > =20 > static int __maybe_unused hibmc_pm_suspend(struct device *dev) > @@ -248,7 +253,7 @@ static int hibmc_hw_init(struct hibmc_drm_private *= priv) > return 0; > } > =20 > -static int hibmc_unload(struct drm_device *dev) > +static void hibmc_unload(struct drm_device *dev) > { > drm_atomic_helper_shutdown(dev); > =20 > @@ -256,11 +261,9 @@ static int hibmc_unload(struct drm_device *dev) > drm_irq_uninstall(dev); > =20 > pci_disable_msi(dev->pdev); > - > - return 0; > } > =20 > -static int hibmc_load(struct drm_device *dev) > +static int hibmc_load(struct drm_device *dev, unsigned long flags) > { > struct hibmc_drm_private *priv =3D to_hibmc_drm_private(dev); > int ret; > @@ -335,12 +338,6 @@ static int hibmc_pci_probe(struct pci_dev *pdev, > goto err_return; > } > =20 > - ret =3D hibmc_load(dev); > - if (ret) { > - drm_err(dev, "failed to load hibmc: %d\n", ret); > - goto err_return; > - } > - > ret =3D drm_dev_register(dev, 0); > if (ret) { > drm_err(dev, "failed to register drv for userspace access: %d\n", > @@ -363,7 +360,6 @@ static void hibmc_pci_remove(struct pci_dev *pdev) > struct drm_device *dev =3D pci_get_drvdata(pdev); > =20 > drm_dev_unregister(dev); > - hibmc_unload(dev); > } > =20 > static const struct pci_device_id hibmc_pci_table[] =3D { >=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 --ciPq5Np7IqVuo7gosp9iQSLBNK1WF6MRW-- --u6hWuRE08bl3qPl4zHmAMlPyFZi3LrVu3 Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEExndm/fpuMUdwYFFolh/E3EQov+AFAl/yy/0FAwAAAAAACgkQlh/E3EQov+Bh wg/+IvCyezuD14UleRkSN4+mLh1au6dgj6AyGJKWiPcTl+Zr5+fvCrnubEBFFBcgWFCYGwg5cfJC RsiloINl/r7zcAXON5IVPVXnIFU+0jClbQicZMxqotYYPSnKgCcjL3E2Nmt+aLDVZhmD3OjWMIMg q6d7EGKacGm+o5hEuFQf3fQOAhy1IIXLC2yyNLzbkPnEBpuOdHuBYhmu5IS4u0hOtFanffhjmgZA a46qs80XKebZ3HG3vxLFwg07/9XVlelcGiERwTjY/Wq0wBXQ39N+gsLQFduj8fNMUen9M+iNnWsq 9EsuGIFo1FJLsf0UY9xzGwrevlMXQT9HZGVWQbrJErVO5l1ViTPdgqSh326e1oGhklaq/A9eQ5pj KOQUoEk8KtAEGgmHI8M++JwUFeTXqnWlm/x9S+RNDo5UDX1BzP9oWkvwCih5OhF44COLzy4CfOZC zcLwdBvzGDiOF8Du4xL1cXJN0C+qWLvzfXNMMjP1bRwe6bJ/ckS+V0oijzSRndfR5QxBalcA8sD/ 3O3zM/Cr0fUvfD51LHQAIgebhSsYKvBjhhFV0ZUiNfdm8NjDcVEZstiBBGwz5FZamaOnbUPQFz98 Wjsj+UoqiU3Hzh3gIXOsYgzId+21fmkUQ02zjk7vnfRC8fDo8aYbv0AAk6+UPXyIVaNdIM+J0a85 wtY= =NaQb -----END PGP SIGNATURE----- --u6hWuRE08bl3qPl4zHmAMlPyFZi3LrVu3--