Thread (29 messages) 29 messages, 7 authors, 2012-01-11

Re: [PATCH net-next v2 2/4] can: cc770: add legacy ISA bus driver for the CC770 and AN82527

From: Wolfgang Grandegger <hidden>
Date: 2012-01-10 14:43:52
Also in: netdev

Possibly related (same subject, not in this thread)

On 01/10/2012 01:41 PM, Wolfgang Zarre wrote:
Hello David,
quoted
quoted
cc770_isa_port_write_reg_indirect(const struct cc770_priv *priv,
                           int reg, u8 val)
   {
       unsigned long base = (unsigned long)priv->reg_base;
+    unsigned long flags;

+    spin_lock_irqsave(&outb_lock, flags);
       outb(reg, base);
       outb(val, base + 1);
+    spin_unlock_irqrestore(&outb_lock, flags);   
Is there a 'read_reg_indirect' function??
Yes, there is.
quoted
If so it also needs to use the same mutex.
Actually, I don't think that we have a problem with mutex
beside that it's using just one inb() statement but having
for sure with an interrupt between both outb() statements which
seems to be critical for the cc770.
But the indirect read function also sets the address register before
reading the data using inb(). This sequence should also not be
interrupted and therefore we need to synchronize. For the indirect
access of the SJA1000 we also need to add spinlocks. Wonder why nobody
complained so far.

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