1 Fix double negation of bitmask in dc_ep_icu_disable andwr32_mask.
2 Also add locking to ensure the masking is applied atomically.
6 @@ -68,12 +68,22 @@ void dc_ep_icu_disable(struct dc_ep_priv
8 void dc_ep_icu_dis_intr(struct dc_ep_priv *priv, u32 bits)
10 - wr32_mask(~bits, 0, ICU_IMER);
11 + struct dc_aca *aca = to_aca(priv);
12 + unsigned long flags;
14 + spin_lock_irqsave(&aca->icu_lock, flags);
15 + wr32_mask(bits, 0, ICU_IMER);
16 + spin_unlock_irqrestore(&aca->icu_lock, flags);
19 void dc_ep_icu_en_intr(struct dc_ep_priv *priv, u32 bits)
21 + struct dc_aca *aca = to_aca(priv);
22 + unsigned long flags;
24 + spin_lock_irqsave(&aca->icu_lock, flags);
25 wr32_mask(0, bits, ICU_IMER);
26 + spin_unlock_irqrestore(&aca->icu_lock, flags);
29 void dc_ep_assert_device(struct dc_ep_priv *priv, u32 bits)
32 @@ -1158,6 +1158,7 @@ void dc_aca_info_init(struct dc_ep_priv
33 struct dc_aca *aca = to_aca(priv);
35 aca->initialized = false;
36 + spin_lock_init(&aca->icu_lock);
37 spin_lock_init(&aca->clk_lock);
38 spin_lock_init(&aca->rcu_lock);
39 mutex_init(&aca->pin_lock);
42 @@ -470,6 +470,7 @@ struct aca_hif_params {
46 + spinlock_t icu_lock;
49 struct mutex pin_lock;