Commit a7cc308d authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull mailbox updates from Jassi Brar:

 - core: fix NULL message handling and add API to query TX queue slots

 - test: resolve concurrency bugs, dangling IRQs, and memory leaks

 - dt-bindings: qcom: add Eliza IPCC

 - mtk: fix address calculation and pointer handling bugs

 - cix: resolve SCMI suspend timeouts

 - misc memory allocation optimizations and cleanups

* tag 'mailbox-v7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/jassibrar/mailbox:
  mailbox: mailbox-test: make data_ready a per-instance variable
  mailbox: mailbox-test: initialize struct earlier
  mailbox: mailbox-test: don't free the reused channel
  mailbox: mailbox-test: handle channel errors consistently
  mailbox: update kdoc for struct mbox_controller
  mailbox: add sanity check for channel array
  mailbox: mailbox-test: free channels on probe error
  mailbox: prefix new constants with MBOX_
  dt-bindings: mailbox: qcom-ipcc: Document the Eliza Inter-Processor Communication Controller
  mailbox: cix: Add IRQF_NO_SUSPEND to mailbox interrupt
  mailbox: Fix NULL message support in mbox_send_message()
  mailbox: remove superfluous internal header
  mailbox: correct kdoc title for mbox_bind_client
  mailbox: test: really ignore optional memory resources
  mailbox: exynos: drop superfluous mbox setting per channel
  mailbox: mtk-cmdq: Fix CURR and END addr for task insert case
  mailbox: mtk-vcp-mailbox: Fix the return value in mtk_vcp_mbox_xlate()
  mailbox: hi6220: kzalloc + kcalloc to kzalloc
  mailbox: rockchip: kzalloc + kcalloc to kzalloc
  mailbox: add API to query available TX queue slots
parents 254f4963 6e937f4e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ properties:
  compatible:
    items:
      - enum:
          - qcom,eliza-ipcc
          - qcom,glymur-ipcc
          - qcom,kaanapali-ipcc
          - qcom,milos-ipcc
+2 −4
Original line number Diff line number Diff line
@@ -12,8 +12,6 @@
#include <linux/module.h>
#include <linux/platform_device.h>

#include "mailbox.h"

/*
 * The maximum transmission size is 32 words or 128 bytes.
 */
@@ -405,7 +403,7 @@ static int cix_mbox_startup(struct mbox_chan *chan)
	int index = cp->index, ret;
	u32 val;

	ret = request_irq(priv->irq, cix_mbox_isr, 0,
	ret = request_irq(priv->irq, cix_mbox_isr, IRQF_NO_SUSPEND,
			  dev_name(priv->dev), chan);
	if (ret) {
		dev_err(priv->dev, "Unable to acquire IRQ %d\n", priv->irq);
@@ -415,7 +413,7 @@ static int cix_mbox_startup(struct mbox_chan *chan)
	switch (cp->type) {
	case CIX_MBOX_TYPE_DB:
		/* Overwrite txdone_method for DB channel */
		chan->txdone_method = TXDONE_BY_ACK;
		chan->txdone_method = MBOX_TXDONE_BY_ACK;
		fallthrough;
	case CIX_MBOX_TYPE_REG:
		if (priv->dir == CIX_MBOX_TX) {
+0 −4
Original line number Diff line number Diff line
@@ -99,7 +99,6 @@ static int exynos_mbox_probe(struct platform_device *pdev)
	struct mbox_controller *mbox;
	struct mbox_chan *chans;
	struct clk *pclk;
	int i;

	exynos_mbox = devm_kzalloc(dev, sizeof(*exynos_mbox), GFP_KERNEL);
	if (!exynos_mbox)
@@ -129,9 +128,6 @@ static int exynos_mbox_probe(struct platform_device *pdev)
	mbox->ops = &exynos_mbox_chan_ops;
	mbox->of_xlate = exynos_mbox_of_xlate;

	for (i = 0; i < EXYNOS_MBOX_CHAN_COUNT; i++)
		chans[i].mbox = mbox;

	exynos_mbox->mbox = mbox;

	platform_set_drvdata(pdev, exynos_mbox);
+0 −2
Original line number Diff line number Diff line
@@ -15,8 +15,6 @@
#include <linux/platform_device.h>
#include <linux/slab.h>

#include "mailbox.h"

#define MBOX_CHAN_MAX			32

#define MBOX_RX				0x0
+5 −9
Original line number Diff line number Diff line
@@ -79,12 +79,12 @@ struct hi6220_mbox {
	/* region for mailbox */
	void __iomem *base;

	unsigned int chan_num;
	struct hi6220_mbox_chan *mchan;

	void *irq_map_chan[MBOX_CHAN_MAX];
	struct mbox_chan *chan;
	struct mbox_controller controller;

	unsigned int chan_num;
	struct hi6220_mbox_chan mchan[] __counted_by(chan_num);
};

static void mbox_set_state(struct hi6220_mbox *mbox,
@@ -267,16 +267,12 @@ static int hi6220_mbox_probe(struct platform_device *pdev)
	struct hi6220_mbox *mbox;
	int i, err;

	mbox = devm_kzalloc(dev, sizeof(*mbox), GFP_KERNEL);
	mbox = devm_kzalloc(dev, struct_size(mbox, mchan, MBOX_CHAN_MAX), GFP_KERNEL);
	if (!mbox)
		return -ENOMEM;

	mbox->dev = dev;
	mbox->chan_num = MBOX_CHAN_MAX;
	mbox->mchan = devm_kcalloc(dev,
		mbox->chan_num, sizeof(*mbox->mchan), GFP_KERNEL);
	if (!mbox->mchan)
		return -ENOMEM;
	mbox->dev = dev;

	mbox->chan = devm_kcalloc(dev,
		mbox->chan_num, sizeof(*mbox->chan), GFP_KERNEL);
Loading