Discussion:
intelspi: don't leak spibus children on detach
Yuri Pankov
2018-09-08 16:16:32 UTC
Permalink
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.

Loading...