From owner-svn-src-stable@freebsd.org Sat May 18 13:39:55 2019 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71C2F158B6E1; Sat, 18 May 2019 13:39:55 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9FC982C8F; Sat, 18 May 2019 13:39:54 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [176.74.212.121]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 86FA52601B1; Sat, 18 May 2019 15:39:52 +0200 (CEST) Subject: Re: svn commit: r347954 - in stable/12/sys/compat/linuxkpi/common: include/linux src To: Johannes Lundberg , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org References: <201905181327.x4IDR9EK005864@repo.freebsd.org> From: Hans Petter Selasky Message-ID: Date: Sat, 18 May 2019 15:39:23 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <201905181327.x4IDR9EK005864@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: E9FC982C8F X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.989,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 May 2019 13:39:55 -0000 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