Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 May 2019 15:39:23 +0200
From:      Hans Petter Selasky <hps@selasky.org>
To:        Johannes Lundberg <johalun@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   Re: svn commit: r347954 - in stable/12/sys/compat/linuxkpi/common: include/linux src
Message-ID:  <cbead5a8-dd49-e48e-b6e2-ce315b7975c1@selasky.org>
In-Reply-To: <201905181327.x4IDR9EK005864@repo.freebsd.org>
References:  <201905181327.x4IDR9EK005864@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2019-05-18 15:27, Johannes Lundberg wrote:
> Author: johalun
> Date: Sat May 18 13:27:09 2019
> New Revision: 347954
> URL: https://svnweb.freebsd.org/changeset/base/347954
> 
> Log:
>    MFC
>    ------------------------------------------------------------------------
>    r347470 | johalun | 2019-05-10 16:10:22 -0700 (Fri, 10 May 2019) | 9 lines
>    
>    Implement linux_pci_unregister_drm_driver in linuxkpi so that drm drivers
>    can be unloaded.
>    
>    This patch is a part of D19565.
>    
>    Reviewed by:	hps
>    Approved by:	imp (mentor), hps
>    MFC after:	1 week
>    
>    ------------------------------------------------------------------------
> 
> Modified:
>    stable/12/sys/compat/linuxkpi/common/include/linux/pci.h
>    stable/12/sys/compat/linuxkpi/common/src/linux_pci.c
> Directory Properties:
>    stable/12/   (props changed)
> 
> Modified: stable/12/sys/compat/linuxkpi/common/include/linux/pci.h
> ==============================================================================
> --- stable/12/sys/compat/linuxkpi/common/include/linux/pci.h	Sat May 18 12:27:22 2019	(r347953)
> +++ stable/12/sys/compat/linuxkpi/common/include/linux/pci.h	Sat May 18 13:27:09 2019	(r347954)
> @@ -521,6 +521,7 @@ pci_write_config_dword(struct pci_dev *pdev, int where
>   int	linux_pci_register_driver(struct pci_driver *pdrv);
>   int	linux_pci_register_drm_driver(struct pci_driver *pdrv);
>   void	linux_pci_unregister_driver(struct pci_driver *pdrv);
> +void	linux_pci_unregister_drm_driver(struct pci_driver *pdrv);
>   
>   #define	pci_register_driver(pdrv)	linux_pci_register_driver(pdrv)
>   #define	pci_unregister_driver(pdrv)	linux_pci_unregister_driver(pdrv)
> 
> Modified: stable/12/sys/compat/linuxkpi/common/src/linux_pci.c
> ==============================================================================
> --- stable/12/sys/compat/linuxkpi/common/src/linux_pci.c	Sat May 18 12:27:22 2019	(r347953)
> +++ stable/12/sys/compat/linuxkpi/common/src/linux_pci.c	Sat May 18 13:27:09 2019	(r347954)
> @@ -330,3 +330,19 @@ linux_pci_unregister_driver(struct pci_driver *pdrv)
>   		devclass_delete_driver(bus, &pdrv->bsddriver);
>   	mtx_unlock(&Giant);
>   }
> +
> +void
> +linux_pci_unregister_drm_driver(struct pci_driver *pdrv)
> +{
> +	devclass_t bus;
> +
> +	bus = devclass_find("vgapci");
> +
> +	spin_lock(&pci_lock);
> +	list_del(&pdrv->links);
> +	spin_unlock(&pci_lock);
> +	mtx_lock(&Giant);
> +	if (bus != NULL)
> +		devclass_delete_driver(bus, &pdrv->bsddriver);
> +	mtx_unlock(&Giant);
> +}
> 
> 

Please also MFC to 11-stable.

--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?cbead5a8-dd49-e48e-b6e2-ce315b7975c1>