OMAPFB: simplify locking
Kernel lock verification code has lately detected possible circular locking in omapfb. The exact problem is unclear, but omapfb's current locking seems to be overly complex. This patch simplifies the locking in the following ways: - Remove explicit omapfb mem region locking. I couldn't figure out the need for this, as long as we take care to take omapfb lock. - Get omapfb lock always, even if the operation is possibly only related to one fb_info. Better safe than sorry, and normally there's only one user for the fb so this shouldn't matter. - Make sure fb_info lock is taken first, then omapfb lock. With this patch the warnings about possible circular locking does not happen anymore. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
This commit is contained in:
@@ -62,8 +62,6 @@ struct omapfb2_mem_region {
|
||||
bool alloc; /* allocated by the driver */
|
||||
bool map; /* kernel mapped by the driver */
|
||||
atomic_t map_count;
|
||||
struct rw_semaphore lock;
|
||||
atomic_t lock_count;
|
||||
};
|
||||
|
||||
/* appended to fb_info */
|
||||
@@ -191,18 +189,4 @@ static inline int omapfb_overlay_enable(struct omap_overlay *ovl,
|
||||
return ovl->disable(ovl);
|
||||
}
|
||||
|
||||
static inline struct omapfb2_mem_region *
|
||||
omapfb_get_mem_region(struct omapfb2_mem_region *rg)
|
||||
{
|
||||
down_read_nested(&rg->lock, rg->id);
|
||||
atomic_inc(&rg->lock_count);
|
||||
return rg;
|
||||
}
|
||||
|
||||
static inline void omapfb_put_mem_region(struct omapfb2_mem_region *rg)
|
||||
{
|
||||
atomic_dec(&rg->lock_count);
|
||||
up_read(&rg->lock);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user