[flashrom] [PATCH] Automatically release I/O permissions on shutdown

Michael Karcher flashrom at mkarcher.dialup.fu-berlin.de
Sat Jul 21 16:19:52 CEST 2012


Am Mittwoch, den 18.07.2012, 01:48 +0200 schrieb Carl-Daniel Hailfinger:
> get_io_perms() is renamed to rget_io_perms() and automatically registers
> a function to release I/O permissions on shutdown.
Sounds like a good idea, but what happens if two threads use different
programmers, both needing I/O permissions? You would need atomic
reference counts on the io permissions to fix that. I don't claim the
current code would not fail in spectecular ways on that use, but AFAIK
this is something we want to achieve in the long run (see the flashctx
stuff for example).

Apart from that, it seems good.

Do we want to use the chance and replace the exit(1) in get_io_perms by
a return value?

> Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
Acked-by: Michael Karcher <flashrom at mkarcher.dialup.fu-berlin.de>

Regards,
  Michael Karcher






More information about the flashrom mailing list