dynamic attach of hinted devices

Brooks Davis brooks at freebsd.org
Fri Feb 10 11:42:55 UTC 2012


On Tue, Jan 31, 2012 at 09:38:57PM +0200, Aleksandr Rybalko wrote:
> Hi FreeBSD hackers,
> 
> at first I want to say this: :)
> WARNING: FOLLOWING DEVCTL PATCH MAY EASILY PANIC YOUR SYSTEM, PLEASE
> DO NOT TRY IT ON PRODUCTION SERVERS AND TRY IT WITH FILESYSTEMS MOUNTED
> AS READONLY :)))))
> 
> So I introduce two patches first one [1] used to migrate from
> static_hints or hints in the static_kenv to dynamic hints.
> 
> sysctl kern.hintmode=2 will copy hints from static hints or from static
> kenv and put it into dynamic kenv. Those will allow to manipulate hints
> values and attach hinted devices with devctl tool.
> 
> Second [2] allow attach/detach devices with userland tool devctl.
> 
> devctl tool allow add and initialize new devices which is not able to
> be autoenumerating, such a hinted devices.
> 
> Both designed to have ability update EEPROM items in runtime, since
> some device can't work in mode when it accessible like a EEPROM chip.
> 
> Example:
> # sysctl kern.hintmode=2
> # kenv hint.mx25l.0.at="spibus0"
> # kenv hint.mx25l.0.cs=0
> # kenv hint.mx25l.0.chipname="at25128"
> # devctl hinted spibus 0 mx25l 0
> mx25l0: <M25Pxx Flash Family> at cs 0 mode 0 on spibus0
> mx25l0: at25128, sector 64 bytes, 256 sectors
> GEOM: new disk flash/spi0
> 
> Someone may found it also useful for testing device attach/detach code
> (memory leaks, resource allocation, etc).
> 
> So, say me please your opinion.

I skimmed over the patch and the concept looks good to me.  I'm probably
not the right person to review this proposal in detail, but perhaps John
Baldwin (cc'd) could do it or suggest someone.

-- Brooks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 188 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20120210/86ce41aa/attachment.pgp


More information about the freebsd-arch mailing list