Commit 34dcc466 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'mailbox-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jassibrar/mailbox

Pull mailbox updates from Jassi Brar:

 - redo the omap driver from legacy to mailbox api

 - enable bufferless IPI for zynqmp

 - add mhu-v3 driver

 - convert from tasklet to BH workqueue

 - add qcom MSM8974 APCS compatible IDs

* tag 'mailbox-v6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/jassibrar/mailbox: (24 commits)
  dt-bindings: mailbox: qcom-ipcc: Document the SDX75 IPCC
  dt-bindings: mailbox: qcom: Add MSM8974 APCS compatible
  mailbox: Convert from tasklet to BH workqueue
  mailbox: mtk-cmdq: Fix pm_runtime_get_sync() warning in mbox shutdown
  mailbox: mtk-cmdq-mailbox: fix module autoloading
  mailbox: zynqmp: handle SGI for shared IPI
  mailbox: arm_mhuv3: Add driver
  dt-bindings: mailbox: arm,mhuv3: Add bindings
  mailbox: omap: Remove kernel FIFO message queuing
  mailbox: omap: Reverse FIFO busy check logic
  mailbox: omap: Remove mbox_chan_to_omap_mbox()
  mailbox: omap: Use mbox_controller channel list directly
  mailbox: omap: Use function local struct mbox_controller
  mailbox: omap: Merge mailbox child node setup loops
  mailbox: omap: Use devm_pm_runtime_enable() helper
  mailbox: omap: Remove device class
  mailbox: omap: Remove unneeded header omap-mailbox.h
  mailbox: omap: Move fifo size check to point of use
  mailbox: omap: Move omap_mbox_irq_t into driver
  mailbox: omap: Remove unused omap_mbox_request_channel() function
  ...
parents ab7b884a 10b98582
This diff is collapsed.
...@@ -30,6 +30,7 @@ properties: ...@@ -30,6 +30,7 @@ properties:
- const: syscon - const: syscon
- items: - items:
- enum: - enum:
- qcom,msm8974-apcs-kpss-global
- qcom,msm8976-apcs-kpss-global - qcom,msm8976-apcs-kpss-global
- const: qcom,msm8994-apcs-kpss-global - const: qcom,msm8994-apcs-kpss-global
- const: syscon - const: syscon
......
...@@ -28,6 +28,7 @@ properties: ...@@ -28,6 +28,7 @@ properties:
- qcom,sa8775p-ipcc - qcom,sa8775p-ipcc
- qcom,sc7280-ipcc - qcom,sc7280-ipcc
- qcom,sc8280xp-ipcc - qcom,sc8280xp-ipcc
- qcom,sdx75-ipcc
- qcom,sm6350-ipcc - qcom,sm6350-ipcc
- qcom,sm6375-ipcc - qcom,sm6375-ipcc
- qcom,sm8250-ipcc - qcom,sm8250-ipcc
......
...@@ -13195,6 +13195,15 @@ F: Documentation/devicetree/bindings/mailbox/arm,mhuv2.yaml ...@@ -13195,6 +13195,15 @@ F: Documentation/devicetree/bindings/mailbox/arm,mhuv2.yaml
F: drivers/mailbox/arm_mhuv2.c F: drivers/mailbox/arm_mhuv2.c
F: include/linux/mailbox/arm_mhuv2_message.h F: include/linux/mailbox/arm_mhuv2_message.h
MAILBOX ARM MHUv3
M: Sudeep Holla <sudeep.holla@arm.com>
M: Cristian Marussi <cristian.marussi@arm.com>
L: linux-kernel@vger.kernel.org
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
S: Maintained
F: Documentation/devicetree/bindings/mailbox/arm,mhuv3.yaml
F: drivers/mailbox/arm_mhuv3.c
MAN-PAGES: MANUAL PAGES FOR LINUX -- Sections 2, 3, 4, 5, and 7 MAN-PAGES: MANUAL PAGES FOR LINUX -- Sections 2, 3, 4, 5, and 7
M: Alejandro Colomar <alx@kernel.org> M: Alejandro Colomar <alx@kernel.org>
L: linux-man@vger.kernel.org L: linux-man@vger.kernel.org
......
...@@ -23,6 +23,18 @@ config ARM_MHU_V2 ...@@ -23,6 +23,18 @@ config ARM_MHU_V2
Say Y here if you want to build the ARM MHUv2 controller driver, Say Y here if you want to build the ARM MHUv2 controller driver,
which provides unidirectional mailboxes between processing elements. which provides unidirectional mailboxes between processing elements.
config ARM_MHU_V3
tristate "ARM MHUv3 Mailbox"
depends on HAS_IOMEM || COMPILE_TEST
depends on OF
help
Say Y here if you want to build the ARM MHUv3 controller driver,
which provides unidirectional mailboxes between processing elements.
ARM MHUv3 controllers can implement a varying number of extensions
that provides different means of transports: supported extensions
will be discovered and possibly managed at probe-time.
config IMX_MBOX config IMX_MBOX
tristate "i.MX Mailbox" tristate "i.MX Mailbox"
depends on ARCH_MXC || COMPILE_TEST depends on ARCH_MXC || COMPILE_TEST
...@@ -68,15 +80,6 @@ config OMAP2PLUS_MBOX ...@@ -68,15 +80,6 @@ config OMAP2PLUS_MBOX
OMAP2/3; or IPU, IVA HD and DSP in OMAP4/5. Say Y here if you OMAP2/3; or IPU, IVA HD and DSP in OMAP4/5. Say Y here if you
want to use OMAP2+ Mailbox framework support. want to use OMAP2+ Mailbox framework support.
config OMAP_MBOX_KFIFO_SIZE
int "Mailbox kfifo default buffer size (bytes)"
depends on OMAP2PLUS_MBOX
default 256
help
Specify the default size of mailbox's kfifo buffers (bytes).
This can also be changed at runtime (via the mbox_kfifo_size
module parameter).
config ROCKCHIP_MBOX config ROCKCHIP_MBOX
bool "Rockchip Soc Integrated Mailbox Support" bool "Rockchip Soc Integrated Mailbox Support"
depends on ARCH_ROCKCHIP || COMPILE_TEST depends on ARCH_ROCKCHIP || COMPILE_TEST
......
...@@ -9,6 +9,8 @@ obj-$(CONFIG_ARM_MHU) += arm_mhu.o arm_mhu_db.o ...@@ -9,6 +9,8 @@ obj-$(CONFIG_ARM_MHU) += arm_mhu.o arm_mhu_db.o
obj-$(CONFIG_ARM_MHU_V2) += arm_mhuv2.o obj-$(CONFIG_ARM_MHU_V2) += arm_mhuv2.o
obj-$(CONFIG_ARM_MHU_V3) += arm_mhuv3.o
obj-$(CONFIG_IMX_MBOX) += imx-mailbox.o obj-$(CONFIG_IMX_MBOX) += imx-mailbox.o
obj-$(CONFIG_ARMADA_37XX_RWTM_MBOX) += armada-37xx-rwtm-mailbox.o obj-$(CONFIG_ARMADA_37XX_RWTM_MBOX) += armada-37xx-rwtm-mailbox.o
......
This diff is collapsed.
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#include <linux/dma-direction.h> #include <linux/dma-direction.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/dmapool.h> #include <linux/dmapool.h>
#include <linux/workqueue.h>
#define PDC_SUCCESS 0 #define PDC_SUCCESS 0
...@@ -293,8 +294,8 @@ struct pdc_state { ...@@ -293,8 +294,8 @@ struct pdc_state {
unsigned int pdc_irq; unsigned int pdc_irq;
/* tasklet for deferred processing after DMA rx interrupt */ /* work for deferred processing after DMA rx interrupt */
struct tasklet_struct rx_tasklet; struct work_struct rx_work;
/* Number of bytes of receive status prior to each rx frame */ /* Number of bytes of receive status prior to each rx frame */
u32 rx_status_len; u32 rx_status_len;
...@@ -952,18 +953,18 @@ static irqreturn_t pdc_irq_handler(int irq, void *data) ...@@ -952,18 +953,18 @@ static irqreturn_t pdc_irq_handler(int irq, void *data)
iowrite32(intstatus, pdcs->pdc_reg_vbase + PDC_INTSTATUS_OFFSET); iowrite32(intstatus, pdcs->pdc_reg_vbase + PDC_INTSTATUS_OFFSET);
/* Wakeup IRQ thread */ /* Wakeup IRQ thread */
tasklet_schedule(&pdcs->rx_tasklet); queue_work(system_bh_wq, &pdcs->rx_work);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
/** /**
* pdc_tasklet_cb() - Tasklet callback that runs the deferred processing after * pdc_work_cb() - Work callback that runs the deferred processing after
* a DMA receive interrupt. Reenables the receive interrupt. * a DMA receive interrupt. Reenables the receive interrupt.
* @t: Pointer to the Altera sSGDMA channel structure * @t: Pointer to the Altera sSGDMA channel structure
*/ */
static void pdc_tasklet_cb(struct tasklet_struct *t) static void pdc_work_cb(struct work_struct *t)
{ {
struct pdc_state *pdcs = from_tasklet(pdcs, t, rx_tasklet); struct pdc_state *pdcs = from_work(pdcs, t, rx_work);
pdc_receive(pdcs); pdc_receive(pdcs);
...@@ -1577,8 +1578,8 @@ static int pdc_probe(struct platform_device *pdev) ...@@ -1577,8 +1578,8 @@ static int pdc_probe(struct platform_device *pdev)
pdc_hw_init(pdcs); pdc_hw_init(pdcs);
/* Init tasklet for deferred DMA rx processing */ /* Init work for deferred DMA rx processing */
tasklet_setup(&pdcs->rx_tasklet, pdc_tasklet_cb); INIT_WORK(&pdcs->rx_work, pdc_work_cb);
err = pdc_interrupts_init(pdcs); err = pdc_interrupts_init(pdcs);
if (err) if (err)
...@@ -1595,7 +1596,7 @@ static int pdc_probe(struct platform_device *pdev) ...@@ -1595,7 +1596,7 @@ static int pdc_probe(struct platform_device *pdev)
return PDC_SUCCESS; return PDC_SUCCESS;
cleanup_buf_pool: cleanup_buf_pool:
tasklet_kill(&pdcs->rx_tasklet); cancel_work_sync(&pdcs->rx_work);
dma_pool_destroy(pdcs->rx_buf_pool); dma_pool_destroy(pdcs->rx_buf_pool);
cleanup_ring_pool: cleanup_ring_pool:
...@@ -1611,7 +1612,7 @@ static void pdc_remove(struct platform_device *pdev) ...@@ -1611,7 +1612,7 @@ static void pdc_remove(struct platform_device *pdev)
pdc_free_debugfs(); pdc_free_debugfs();
tasklet_kill(&pdcs->rx_tasklet); cancel_work_sync(&pdcs->rx_work);
pdc_hw_disable(pdcs); pdc_hw_disable(pdcs);
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/suspend.h> #include <linux/suspend.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/workqueue.h>
#include "mailbox.h" #include "mailbox.h"
...@@ -80,7 +81,7 @@ struct imx_mu_con_priv { ...@@ -80,7 +81,7 @@ struct imx_mu_con_priv {
char irq_desc[IMX_MU_CHAN_NAME_SIZE]; char irq_desc[IMX_MU_CHAN_NAME_SIZE];
enum imx_mu_chan_type type; enum imx_mu_chan_type type;
struct mbox_chan *chan; struct mbox_chan *chan;
struct tasklet_struct txdb_tasklet; struct work_struct txdb_work;
}; };
struct imx_mu_priv { struct imx_mu_priv {
...@@ -232,7 +233,7 @@ static int imx_mu_generic_tx(struct imx_mu_priv *priv, ...@@ -232,7 +233,7 @@ static int imx_mu_generic_tx(struct imx_mu_priv *priv,
break; break;
case IMX_MU_TYPE_TXDB: case IMX_MU_TYPE_TXDB:
imx_mu_xcr_rmw(priv, IMX_MU_GCR, IMX_MU_xCR_GIRn(priv->dcfg->type, cp->idx), 0); imx_mu_xcr_rmw(priv, IMX_MU_GCR, IMX_MU_xCR_GIRn(priv->dcfg->type, cp->idx), 0);
tasklet_schedule(&cp->txdb_tasklet); queue_work(system_bh_wq, &cp->txdb_work);
break; break;
case IMX_MU_TYPE_TXDB_V2: case IMX_MU_TYPE_TXDB_V2:
imx_mu_xcr_rmw(priv, IMX_MU_GCR, IMX_MU_xCR_GIRn(priv->dcfg->type, cp->idx), 0); imx_mu_xcr_rmw(priv, IMX_MU_GCR, IMX_MU_xCR_GIRn(priv->dcfg->type, cp->idx), 0);
...@@ -420,7 +421,7 @@ static int imx_mu_seco_tx(struct imx_mu_priv *priv, struct imx_mu_con_priv *cp, ...@@ -420,7 +421,7 @@ static int imx_mu_seco_tx(struct imx_mu_priv *priv, struct imx_mu_con_priv *cp,
} }
/* Simulate hack for mbox framework */ /* Simulate hack for mbox framework */
tasklet_schedule(&cp->txdb_tasklet); queue_work(system_bh_wq, &cp->txdb_work);
break; break;
default: default:
...@@ -484,9 +485,9 @@ static int imx_mu_seco_rxdb(struct imx_mu_priv *priv, struct imx_mu_con_priv *cp ...@@ -484,9 +485,9 @@ static int imx_mu_seco_rxdb(struct imx_mu_priv *priv, struct imx_mu_con_priv *cp
return err; return err;
} }
static void imx_mu_txdb_tasklet(unsigned long data) static void imx_mu_txdb_work(struct work_struct *t)
{ {
struct imx_mu_con_priv *cp = (struct imx_mu_con_priv *)data; struct imx_mu_con_priv *cp = from_work(cp, t, txdb_work);
mbox_chan_txdone(cp->chan, 0); mbox_chan_txdone(cp->chan, 0);
} }
...@@ -570,8 +571,7 @@ static int imx_mu_startup(struct mbox_chan *chan) ...@@ -570,8 +571,7 @@ static int imx_mu_startup(struct mbox_chan *chan)
if (cp->type == IMX_MU_TYPE_TXDB) { if (cp->type == IMX_MU_TYPE_TXDB) {
/* Tx doorbell don't have ACK support */ /* Tx doorbell don't have ACK support */
tasklet_init(&cp->txdb_tasklet, imx_mu_txdb_tasklet, INIT_WORK(&cp->txdb_work, imx_mu_txdb_work);
(unsigned long)cp);
return 0; return 0;
} }
...@@ -615,7 +615,7 @@ static void imx_mu_shutdown(struct mbox_chan *chan) ...@@ -615,7 +615,7 @@ static void imx_mu_shutdown(struct mbox_chan *chan)
} }
if (cp->type == IMX_MU_TYPE_TXDB) { if (cp->type == IMX_MU_TYPE_TXDB) {
tasklet_kill(&cp->txdb_tasklet); cancel_work_sync(&cp->txdb_work);
pm_runtime_put_sync(priv->dev); pm_runtime_put_sync(priv->dev);
return; return;
} }
......
...@@ -465,7 +465,7 @@ static void cmdq_mbox_shutdown(struct mbox_chan *chan) ...@@ -465,7 +465,7 @@ static void cmdq_mbox_shutdown(struct mbox_chan *chan)
struct cmdq_task *task, *tmp; struct cmdq_task *task, *tmp;
unsigned long flags; unsigned long flags;
WARN_ON(pm_runtime_get_sync(cmdq->mbox.dev)); WARN_ON(pm_runtime_get_sync(cmdq->mbox.dev) < 0);
spin_lock_irqsave(&thread->chan->lock, flags); spin_lock_irqsave(&thread->chan->lock, flags);
if (list_empty(&thread->task_busy_list)) if (list_empty(&thread->task_busy_list))
...@@ -765,6 +765,7 @@ static const struct of_device_id cmdq_of_ids[] = { ...@@ -765,6 +765,7 @@ static const struct of_device_id cmdq_of_ids[] = {
{.compatible = "mediatek,mt8195-gce", .data = (void *)&gce_plat_mt8195}, {.compatible = "mediatek,mt8195-gce", .data = (void *)&gce_plat_mt8195},
{} {}
}; };
MODULE_DEVICE_TABLE(of, cmdq_of_ids);
static struct platform_driver cmdq_drv = { static struct platform_driver cmdq_drv = {
.probe = cmdq_probe, .probe = cmdq_probe,
......
This diff is collapsed.
This diff is collapsed.
/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
/*
* This header provides constants for the defined MHUv3 types.
*/
#ifndef _DT_BINDINGS_ARM_MHUV3_DT_H
#define _DT_BINDINGS_ARM_MHUV3_DT_H
#define DBE_EXT 0
#define FCE_EXT 1
#define FE_EXT 2
#endif /* _DT_BINDINGS_ARM_MHUV3_DT_H */
...@@ -10,17 +10,4 @@ typedef uintptr_t mbox_msg_t; ...@@ -10,17 +10,4 @@ typedef uintptr_t mbox_msg_t;
#define omap_mbox_message(data) (u32)(mbox_msg_t)(data) #define omap_mbox_message(data) (u32)(mbox_msg_t)(data)
typedef int __bitwise omap_mbox_irq_t;
#define IRQ_TX ((__force omap_mbox_irq_t) 1)
#define IRQ_RX ((__force omap_mbox_irq_t) 2)
struct mbox_chan;
struct mbox_client;
struct mbox_chan *omap_mbox_request_channel(struct mbox_client *cl,
const char *chan_name);
void omap_mbox_enable_irq(struct mbox_chan *chan, omap_mbox_irq_t irq);
void omap_mbox_disable_irq(struct mbox_chan *chan, omap_mbox_irq_t irq);
#endif /* OMAP_MAILBOX_H */ #endif /* OMAP_MAILBOX_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment