Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Sep 2018 19:16:32 +0300
From:      Yuri Pankov <yuripv@yuripv.net>
To:        freebsd-hackers <freebsd-hackers@freebsd.org>
Subject:   intelspi: don't leak spibus children on detach
Message-ID:  <2fc2bf25-e619-26e6-559b-6235ba9d4fe4@yuripv.net>

next in thread | raw e-mail | index | archive | help
This one is a bit more involved than typo fixes, so I have opened a review:

https://reviews.freebsd.org/D17076

The point is storing the device_t for spibus we add on intelspi attach 
and deleting it on intelspi detach.  Currently it looks like below, 
without the patch we don't delete spibus children and loading intelspi 
would create new spibus numbers, which is wrong.

# kldload intelspi
spi0: <100 Series/C230 Series Chipset Family Serial IO GSPI #0> mem 
0x8272d000-0x8272dfff,0x80000000-0x8000007f irq 22 at device 30.2 on pci0
spibus0: <SPI bus> on spi0
spi1: <100 Series/C230 Series Chipset Family Serial IO GSPI #1> mem 
0x8272e000-0x8272efff,0x80000080-0x800000ff irq 23 at device 30.3 on pci0
spibus1: <SPI bus> on spi1
spigen0: <SPI Generic IO> at cs 0 mode 0 on spibus1
# kldunload intelspi
spibus0: detached
spi0: detached
spigen0: detached
spibus1: detached
spi1: detached

P.S. if there's a better way of submitting patches (PRs, lists, 
anything), please let me know, I have quite a few of them already 
looking at the mbp spi devices.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2fc2bf25-e619-26e6-559b-6235ba9d4fe4>