Re: [PATCH v6 10/10] ath10k: sdio support
From: Kalle Valo <hidden>
Date: 2017-03-23 15:23:17
Kalle Valo [off-list ref] writes:
From: Erik Stromdahl <redacted> sdio/mailbox HIF implementation. Signed-off-by: Erik Stromdahl <redacted> Signed-off-by: Kalle Valo <redacted>
[...]
+static int ath10k_sdio_mbox_proc_cpu_intr(struct ath10k *ar)
+{
+ struct ath10k_sdio *ar_sdio =3D ath10k_sdio_priv(ar);
+ struct ath10k_sdio_irq_data *irq_data =3D &ar_sdio->irq_data;
+ u8 cpu_int_status, *reg_buf;
+ int ret;
+
+ mutex_lock(&irq_data->mtx);
+ cpu_int_status =3D irq_data->irq_proc_reg->cpu_int_status &
+ irq_data->irq_en_reg->cpu_int_status_en;
+ if (!cpu_int_status) {
+ ath10k_warn(ar, "CPU interrupt status is zero\n");
+ return -EIO;
+ }
+
+ /* Clear the interrupt */
+ irq_data->irq_proc_reg->cpu_int_status &=3D ~cpu_int_status;
+
+ /* Set up the register transfer buffer to hit the register 4 times ,
+ * this is done to make the access 4-byte aligned to mitigate issues
+ * with host bus interconnects that restrict bus transfer lengths to
+ * be a multiple of 4-bytes.
+ */
+ reg_buf =3D kzalloc(4, GFP_KERNEL);
+ if (!reg_buf)
+ return -ENOMEM;kbuild bot reported that I failed to release the mutex in these two return cases above, I'll fix that in v7. --=20 Kalle Valo=