On Wednesday 14 November 2007, Thomas Gleixner wrote:As Haavard had noted. The "requested" flag is actually serving as a longterm bit-level lock, which -- assuming well-behaved callers, and no debug instrumentation -- obviates any need to grab a spinlock in hot paths. That's what the gpio_request() call does, although it's using something isomorphic to a refcount, not an actual refcount. The key observation here is that we already *have* a bit which is serving as a per-gpio lock. It's just never been viewed as a lock before. :) No, we still need to use a spinlock to protect table changes. The reason for that is briefly: - gpio_request()/gpio_free() have so far been optional. Most platforms implement them as NOPs, not all drivers use them. (Having gpiolib in place should help change that ...) - gpio_direction_input()/gpio_direction_output() implicitly request the pins, if they weren't already requested. - Those input/output direction-setting calls may be called in IRQ contexts, which means (on non-RT kernels) no mutex. So we're actually in good shape; just take out a bit of code (or turn it into debugging instrumentation) and I don't think anyone will complain about the locking any more. - Dave -
| Greg KH | [RFC] sample kobject implementation |
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
| Paul E. McKenney | [PATCH RFC 2/9] RCU: Fix barriers |
| Joe Perches | [PATCH 011/148] include/asm-x86/bug.h: checkpatch cleanups - formatting only |
git: | |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 15/37] dccp: Set per-connection CCIDs via socket options |
| Linus Torvalds | Re: [GIT]: Networking |
| Jeff Garzik | Re: [PATCH] drivers/net: remove network drivers' last few uses of IRQF_SAMPLE_RANDOM |
