unloading and reloading DTO doesn't work for GPIO reconfiguration

Following Derek Molloy's page on DTO GPIO configuration:


Unloading and reloading an overlay doesn’t work. If I make an overlay
for a single pin, with a setting of 0×27 (input with pull-down enable), it
works right after boot. Same for pull-up (0×37). But if I try to unload the
overlay (echo ‘-overlay_number’ >$SLOTS) and load one with the opposite
pull setting it doesn’t seem to take: I still get high if it was initially
configured with pull-up, or low if initially configured with pull-down.

Is there anything in the overlay example itself that might be causing this,
or is it just a bug somewhere?

Unloading *ANY* overlay is essentially broken. Results will vary from
not doing anything to crashing the kernel.

If you want to unload a previously loaded device-tree overlay, you need
to reboot.

This will hopefully be fixed in the future as device-tree change-sets
have been incorporated into the mainline kernel code.