#482: spin_lock_irqsave problem
---------------------------------+------------------------------------------
      Reporter:  anonymous       |       Owner:     
          Type:  defect          |      Status:  new
      Priority:  major           |   Milestone:     
     Component:  madwifi: other  |     Version:     
    Resolution:                  |    Keywords:     
Patch_attached:  0               |  
---------------------------------+------------------------------------------
Old description:

> as i remember you must use only local variable to save flags on funcs
> like save_flags(), spin_lock_irqsave() etc. (maybe i'm wrong?). Now look
> at current code in madwifi_ng:
> #define ATH_NODE_UAPSD_LOCK_IRQ(_an)
> spin_lock_irqsave(&(_an)->an_uapsd_lock, (_an)->an_uapsd_lockflags)
> #define ATH_TXQ_LOCK_IRQ(_tq)
> spin_lock_irqsave(&(_tq)->axq_lock, (_tq)->axq_lockflags)
> #define ATH_RXBUF_LOCK_IRQ(_sc)
> spin_lock_irqsave(&(_sc)->sc_rxbuflock, (_sc)->sc_rxbuflockflags)
> it seems to me that you need macros like that:
> #define ATH_RXBUF_LOCK_IRQSAVE(_sc) do {                                \
>         unsigned long __ilockflags;                             \
>         spin_lock_irqsave(&(_sc)->sc_rxbuflock, __ilockflags);
> #define ATH_RXBUF_UNLOCK_IRQRESTORE(_sc)                \
>         spin_unlock_irqrestore(&(_sc)->sc_rxbuflock, __ilockflags);     \
> } while (0)

New description:

 as i remember you must use only local variable to save flags on funcs like
 save_flags(), spin_lock_irqsave() etc. (maybe i'm wrong?). Now look at
 current code in madwifi_ng:
 {{{
 #define ATH_NODE_UAPSD_LOCK_IRQ(_an)
 spin_lock_irqsave(&(_an)->an_uapsd_lock, (_an)->an_uapsd_lockflags)
 #define ATH_TXQ_LOCK_IRQ(_tq)
 spin_lock_irqsave(&(_tq)->axq_lock, (_tq)->axq_lockflags)
 #define ATH_RXBUF_LOCK_IRQ(_sc)
 spin_lock_irqsave(&(_sc)->sc_rxbuflock, (_sc)->sc_rxbuflockflags)
 }}}

 it seems to me that you need macros like that:
 {{{
 #define ATH_RXBUF_LOCK_IRQSAVE(_sc) do {                                \
         unsigned long __ilockflags;                             \
         spin_lock_irqsave(&(_sc)->sc_rxbuflock, __ilockflags);
 #define ATH_RXBUF_UNLOCK_IRQRESTORE(_sc)                \
         spin_unlock_irqrestore(&(_sc)->sc_rxbuflock, __ilockflags);     \
 } while (0)
 }}}

Comment (by mrenzmann):

 Nice attitude... "I'm too lazy to learn the syntax, so I submit a mostly
 unreadable ticket and let someone else handle that stuff". This is exactly
 the kind of attitude that makes a project like this one going. Thanks. :-(

 In addition the subject of your ticket isn't really a matter for a ticket,
 but would be better suited for a message to madwifi-devel.

-- 
Ticket URL: <http://madwifi.org/ticket/482>
MadWifi <http://madwifi.org/>
Multiband Atheros Driver for Wireless Fidelity

Reply via email to