Thread (17 messages) 17 messages, 3 authors, 2012-11-20

Re: [PATCH 1/8] bcma: add locking around GPIO register accesses

From: Hauke Mehrtens <hauke@hauke-m.de>
Date: 2012-11-20 21:05:38
Also in: linux-mips

On 11/20/2012 09:10 AM, John Crispin wrote:
Hi Hauke
quoted
u32 bcma_chipco_gpio_in(struct bcma_drv_cc *cc, u32 mask)
  {
-    return bcma_cc_read32(cc, BCMA_CC_GPIOIN)&  mask;
+    unsigned long flags;
+    u32 res;
+
+    spin_lock_irqsave(&cc->gpio_lock, flags);
+    res = bcma_cc_read32(cc, BCMA_CC_GPIOIN)&  mask;
+    spin_unlock_irqrestore(&cc->gpio_lock, flags);
+
+    return res;
  }
Hi Hauke,

do you need to lock the read access ?

if bcma_cc_read32() is a simple memory read wrapper you most likely wont
need the lock

    John
Yes you are right, I do not need it here, it is just needed for the
masked write to the other GPIO registers.

Hauke
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help