[PATCH v6 10/10] ath10k: sdio support

Kalle Valo kvalo at qca.qualcomm.com
Thu Mar 23 08:23:11 PDT 2017


Kalle Valo <kvalo at qca.qualcomm.com> writes:

> From: Erik Stromdahl <erik.stromdahl at gmail.com>
>
> sdio/mailbox HIF implementation.
>
> Signed-off-by: Erik Stromdahl <erik.stromdahl at gmail.com>
> Signed-off-by: Kalle Valo <kvalo at qca.qualcomm.com>

[...]

> +static int ath10k_sdio_mbox_proc_cpu_intr(struct ath10k *ar)
> +{
> +	struct ath10k_sdio *ar_sdio = ath10k_sdio_priv(ar);
> +	struct ath10k_sdio_irq_data *irq_data = &ar_sdio->irq_data;
> +	u8 cpu_int_status, *reg_buf;
> +	int ret;
> +
> +	mutex_lock(&irq_data->mtx);
> +	cpu_int_status = 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 &= ~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 = 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.

-- 
Kalle Valo


More information about the ath10k mailing list