[re-adding CCs, please do not drop these] On Tue, 2007-09-11 at 09:20 -0700, Matti Linnanvuori wrote:Yes it is. If you have to wait a long time in an atomic context you've done something wrong. If you're only reading it from an atomic context you might consider storing a copy that can be quickly updated and protect that using a spinlock. do_update () { mutex_lock(&my_device_mutex); my_device_frob_state(&my_state); /* <-- this takes a _long_ while */ spin_lock_irq(&my_shadow_state_lock); my_shadow_state = state; /* <-- this is a quick memcopy */ spin_unlock_irq(&my_shadow_state_lock); mutex_unlock(&my_device_mutex); } do_read() { spin_lock_irq(&my_shadow_state); do_something_with_shadow_state(&mt_shadow_state); spin_unlock_irq(&my_shadow_state); return foo; } Not being too familiar with the timer stuff, it smells wrong what you say. As for the whole polling method, consider what Alan said, don't do it if you don't need to. You'll annoy people at no end. Try to push state changes where possible. -
| Greg Kroah-Hartman | [PATCH 008/196] Chinese: add translation of volatile-considered-harmful.txt |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg KH | Re: [Patch v2] Make PCI extended config space (MMCONFIG) a driver opt-in |
| Andrew Morton | -mm merge plans for 2.6.23 |
git: | |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Herbert Xu | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
| Rémi Denis-Courmont | [PATCH 01/14] Phonet global definitions |
