Re: [PATCH V5 2/2] mailbox: arm_mhuv2: Add driver
From: Jassi Brar
Date: Fri Nov 20 2020 - 14:07:05 EST
On Tue, Nov 17, 2020 at 4:02 AM Viresh Kumar <viresh.kumar@xxxxxxxxxx> wrote:
> +
> +/**
> + * struct mhuv2 - MHUv2 mailbox controller data
> + *
> + * @mbox: Mailbox controller belonging to the MHU frame.
> + * @send/recv: Base address of the register mapping region.
> + * @frame: Frame type: RECEIVER_FRAME or SENDER_FRAME.
> + * @irq: Interrupt.
> + * @windows: Channel windows implemented by the platform.
> + * @minor: Minor version of the controller.
> + * @length: Length of the protocols array in bytes.
> + * @protocols: Raw protocol information, derived from device tree.
> + * @doorbell_pending_lock: spinlock required for correct operation of Tx
> + * interrupt for doorbells.
> + */
> +struct mhuv2 {
> + struct mbox_controller mbox;
> + union {
> + struct mhu2_send_frame_reg __iomem *send;
> + struct mhu2_recv_frame_reg __iomem *recv;
> + };
> + enum mhuv2_frame frame;
> + unsigned int irq;
> + unsigned int windows;
> + unsigned int minor;
> + unsigned int length;
> + u32 *protocols;
> +
> + spinlock_t doorbell_pending_lock;
>
Can you please explain the need of this lock? Some usecase?
It should be unnecessary if the controller natively supports doorbell mode.
thanks.