All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drivers/mailbox: Add Aspeed mailbox driver
@ 2017-02-07 23:36 Cyril Bur
  2017-02-09  4:39   ` Joel Stanley
  2017-09-04  7:17 ` Cyril Bur
  0 siblings, 2 replies; 12+ messages in thread
From: Cyril Bur @ 2017-02-07 23:36 UTC (permalink / raw)
  To: jassisinghbrar, linux-kernel; +Cc: benh, mikey, joel, openbmc

This provides access to the mbox registers on the ast2400 and ast2500
SoCs.

This driver allows arbitrary reads and writes to the 16 data registers as
the other end may have configured the mbox hardware to provide an
interrupt when a specific register gets written to.

Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
---
V2:
   s/ASpeed/Aspeed/
   Reword Kconfig options
   Use tristate for config symbol

 drivers/mailbox/Kconfig       |   8 +
 drivers/mailbox/Makefile      |   2 +
 drivers/mailbox/aspeed-mbox.c | 334 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 344 insertions(+)
 create mode 100644 drivers/mailbox/aspeed-mbox.c

diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig
index ceff415f201c..e24044d5c219 100644
--- a/drivers/mailbox/Kconfig
+++ b/drivers/mailbox/Kconfig
@@ -152,4 +152,12 @@ config BCM_PDC_MBOX
 	  Mailbox implementation for the Broadcom PDC ring manager,
 	  which provides access to various offload engines on Broadcom
 	  SoCs. Say Y here if you want to use the Broadcom PDC.
+
+config ASPEED_LPC_MBOX
+	depends on (ARCH_ASPEED || COMPILE_TEST) && REGMAP && MFD_SYSCON
+	tristate "Aspeed LPC Mailbox Controller"
+	---help---
+	  Provides a driver for the MBOX registers found on Aspeed SOCs
+	  (AST2400 and AST2500). This driver provides a device for aspeed
+	  mbox registers
 endif
diff --git a/drivers/mailbox/Makefile b/drivers/mailbox/Makefile
index 7dde4f609ae8..73165a79b517 100644
--- a/drivers/mailbox/Makefile
+++ b/drivers/mailbox/Makefile
@@ -31,3 +31,5 @@ obj-$(CONFIG_HI6220_MBOX)	+= hi6220-mailbox.o
 obj-$(CONFIG_BCM_PDC_MBOX)	+= bcm-pdc-mailbox.o
 
 obj-$(CONFIG_TEGRA_HSP_MBOX)	+= tegra-hsp.o
+
+obj-$(CONFIG_ASPEED_LPC_MBOX)	+= aspeed-mbox.o
diff --git a/drivers/mailbox/aspeed-mbox.c b/drivers/mailbox/aspeed-mbox.c
new file mode 100644
index 000000000000..0f0c711bafee
--- /dev/null
+++ b/drivers/mailbox/aspeed-mbox.c
@@ -0,0 +1,334 @@
+/*
+ * Copyright 2017 IBM Corporation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#include <linux/interrupt.h>
+#include <linux/mfd/syscon.h>
+#include <linux/miscdevice.h>
+#include <linux/module.h>
+#include <linux/of_irq.h>
+#include <linux/platform_device.h>
+#include <linux/poll.h>
+#include <linux/regmap.h>
+#include <linux/slab.h>
+
+#define DEVICE_NAME	"aspeed-mbox"
+
+#define ASPEED_MBOX_NUM_REGS 16
+
+#define ASPEED_MBOX_DATA_0 0x00
+#define ASPEED_MBOX_STATUS_0 0x40
+#define ASPEED_MBOX_STATUS_1 0x44
+#define ASPEED_MBOX_BMC_CTRL 0x48
+#define   ASPEED_MBOX_CTRL_RECV BIT(7)
+#define   ASPEED_MBOX_CTRL_MASK BIT(1)
+#define   ASPEED_MBOX_CTRL_SEND BIT(0)
+#define ASPEED_MBOX_HOST_CTRL 0x4c
+#define ASPEED_MBOX_INTERRUPT_0 0x50
+#define ASPEED_MBOX_INTERRUPT_1 0x54
+
+struct aspeed_mbox {
+	struct miscdevice	miscdev;
+	struct regmap		*regmap;
+	unsigned int		base;
+	wait_queue_head_t	queue;
+	struct mutex		mutex;
+};
+
+static atomic_t aspeed_mbox_open_count = ATOMIC_INIT(0);
+
+static u8 aspeed_mbox_inb(struct aspeed_mbox *mbox, int reg)
+{
+	/*
+	 * The mbox registers are actually only one byte but are addressed
+	 * four bytes apart. The other three bytes are marked 'reserved',
+	 * they *should* be zero but lets not rely on it.
+	 * I am going to rely on the fact we can casually read/write to them...
+	 */
+	unsigned int val = 0xff; /* If regmap throws an error return 0xff */
+	int rc = regmap_read(mbox->regmap, mbox->base + reg, &val);
+
+	if (rc)
+		dev_err(mbox->miscdev.parent, "regmap_read() failed with "
+				"%d (reg: 0x%08x)\n", rc, reg);
+
+	return val & 0xff;
+}
+
+static void aspeed_mbox_outb(struct aspeed_mbox *mbox, u8 data, int reg)
+{
+	int rc = regmap_write(mbox->regmap, mbox->base + reg, data);
+
+	if (rc)
+		dev_err(mbox->miscdev.parent, "regmap_write() failed with "
+				"%d (data: %u reg: 0x%08x)\n", rc, data, reg);
+}
+
+static struct aspeed_mbox *file_mbox(struct file *file)
+{
+	return container_of(file->private_data, struct aspeed_mbox, miscdev);
+}
+
+static int aspeed_mbox_open(struct inode *inode, struct file *file)
+{
+	struct aspeed_mbox *mbox = file_mbox(file);
+
+	if (atomic_inc_return(&aspeed_mbox_open_count) == 1) {
+		/*
+		 * Clear the interrupt status bit if it was left on and unmask
+		 * interrupts.
+		 * ASPEED_MBOX_CTRL_RECV bit is W1C, this also unmasks in 1 step
+		 */
+		aspeed_mbox_outb(mbox, ASPEED_MBOX_CTRL_RECV, ASPEED_MBOX_BMC_CTRL);
+		return 0;
+	}
+
+	atomic_dec(&aspeed_mbox_open_count);
+	return -EBUSY;
+}
+
+static ssize_t aspeed_mbox_read(struct file *file, char __user *buf,
+				size_t count, loff_t *ppos)
+{
+	struct aspeed_mbox *mbox = file_mbox(file);
+	char __user *p = buf;
+	ssize_t ret;
+	int i;
+
+	if (!access_ok(VERIFY_WRITE, buf, count))
+		return -EFAULT;
+
+	if (count + *ppos > ASPEED_MBOX_NUM_REGS)
+		return -EINVAL;
+
+	if (file->f_flags & O_NONBLOCK) {
+		if (!(aspeed_mbox_inb(mbox, ASPEED_MBOX_BMC_CTRL) &
+				ASPEED_MBOX_CTRL_RECV))
+			return -EAGAIN;
+	} else if (wait_event_interruptible(mbox->queue,
+				aspeed_mbox_inb(mbox, ASPEED_MBOX_BMC_CTRL) &
+				ASPEED_MBOX_CTRL_RECV)) {
+		return -ERESTARTSYS;
+	}
+
+	mutex_lock(&mbox->mutex);
+
+	for (i = *ppos; count > 0 && i < ASPEED_MBOX_NUM_REGS; i++) {
+		uint8_t reg = aspeed_mbox_inb(mbox, ASPEED_MBOX_DATA_0 + (i * 4));
+
+		ret = __put_user(reg, p);
+		if (ret)
+			goto out_unlock;
+
+		p++;
+		count--;
+	}
+
+	/* ASPEED_MBOX_CTRL_RECV bit is write to clear, this also unmasks in 1 step */
+	aspeed_mbox_outb(mbox, ASPEED_MBOX_CTRL_RECV, ASPEED_MBOX_BMC_CTRL);
+	ret = p - buf;
+
+out_unlock:
+	mutex_unlock(&mbox->mutex);
+	return ret;
+}
+
+static ssize_t aspeed_mbox_write(struct file *file, const char __user *buf,
+				size_t count, loff_t *ppos)
+{
+	struct aspeed_mbox *mbox = file_mbox(file);
+	const char __user *p = buf;
+	ssize_t ret;
+	char c;
+	int i;
+
+	if (!access_ok(VERIFY_READ, buf, count))
+		return -EFAULT;
+
+	if (count + *ppos > ASPEED_MBOX_NUM_REGS)
+		return -EINVAL;
+
+	mutex_lock(&mbox->mutex);
+
+	for (i = *ppos; count > 0 && i < ASPEED_MBOX_NUM_REGS; i++) {
+		ret = __get_user(c, p);
+		if (ret)
+			goto out_unlock;
+
+		aspeed_mbox_outb(mbox, c, ASPEED_MBOX_DATA_0 + (i * 4));
+		p++;
+		count--;
+	}
+
+	aspeed_mbox_outb(mbox, ASPEED_MBOX_CTRL_SEND, ASPEED_MBOX_BMC_CTRL);
+	ret = p - buf;
+
+out_unlock:
+	mutex_unlock(&mbox->mutex);
+	return ret;
+}
+
+static unsigned int aspeed_mbox_poll(struct file *file, poll_table *wait)
+{
+	struct aspeed_mbox *mbox = file_mbox(file);
+	unsigned int mask = 0;
+
+	poll_wait(file, &mbox->queue, wait);
+
+	if (aspeed_mbox_inb(mbox, ASPEED_MBOX_BMC_CTRL) & ASPEED_MBOX_CTRL_RECV)
+		mask |= POLLIN;
+
+	return mask;
+}
+
+static int aspeed_mbox_release(struct inode *inode, struct file *file)
+{
+	atomic_dec(&aspeed_mbox_open_count);
+	return 0;
+}
+
+static const struct file_operations aspeed_mbox_fops = {
+	.owner		= THIS_MODULE,
+	.llseek		= no_seek_end_llseek,
+	.read		= aspeed_mbox_read,
+	.write		= aspeed_mbox_write,
+	.open		= aspeed_mbox_open,
+	.release	= aspeed_mbox_release,
+	.poll		= aspeed_mbox_poll,
+};
+
+static irqreturn_t aspeed_mbox_irq(int irq, void *arg)
+{
+	struct aspeed_mbox *mbox = arg;
+
+	if (!(aspeed_mbox_inb(mbox, ASPEED_MBOX_BMC_CTRL) & ASPEED_MBOX_CTRL_RECV))
+		return IRQ_NONE;
+
+	/*
+	 * Leave the status bit set so that we know the data is for us,
+	 * clear it once it has been read.
+	 */
+
+	/* Mask it off, we'll clear it when we the data gets read */
+	aspeed_mbox_outb(mbox, ASPEED_MBOX_CTRL_MASK, ASPEED_MBOX_BMC_CTRL);
+
+	wake_up(&mbox->queue);
+	return IRQ_HANDLED;
+}
+
+static int aspeed_mbox_config_irq(struct aspeed_mbox *mbox,
+		struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	int rc, irq;
+
+	irq = irq_of_parse_and_map(dev->of_node, 0);
+	if (!irq)
+		return -ENODEV;
+
+	rc = devm_request_irq(dev, irq, aspeed_mbox_irq,
+			IRQF_SHARED, DEVICE_NAME, mbox);
+	if (rc < 0) {
+		dev_err(dev, "Unable to request IRQ %d\n", irq);
+		return rc;
+	}
+
+	/*
+	 * Disable all register based interrupts.
+	 */
+	aspeed_mbox_outb(mbox, 0x00, ASPEED_MBOX_INTERRUPT_0); /* regs 0 - 7 */
+	aspeed_mbox_outb(mbox, 0x00, ASPEED_MBOX_INTERRUPT_1); /* regs 8 - 15 */
+
+	/* These registers are write one to clear. Clear them. */
+	aspeed_mbox_outb(mbox, 0xff, ASPEED_MBOX_STATUS_0);
+	aspeed_mbox_outb(mbox, 0xff, ASPEED_MBOX_STATUS_1);
+
+	aspeed_mbox_outb(mbox, ASPEED_MBOX_CTRL_RECV, ASPEED_MBOX_BMC_CTRL);
+	return 0;
+}
+
+static int aspeed_mbox_probe(struct platform_device *pdev)
+{
+	struct aspeed_mbox *mbox;
+	struct device *dev;
+	int rc;
+
+	dev = &pdev->dev;
+
+	mbox = devm_kzalloc(dev, sizeof(*mbox), GFP_KERNEL);
+	if (!mbox)
+		return -ENOMEM;
+
+	dev_set_drvdata(&pdev->dev, mbox);
+
+	rc = of_property_read_u32(dev->of_node, "reg", &mbox->base);
+	if (rc) {
+		dev_err(dev, "Couldn't read reg device-tree property\n");
+		return rc;
+	}
+
+	mbox->regmap = syscon_node_to_regmap(
+			pdev->dev.parent->of_node);
+	if (IS_ERR(mbox->regmap)) {
+		dev_err(dev, "Couldn't get regmap\n");
+		return -ENODEV;
+	}
+
+	mutex_init(&mbox->mutex);
+	init_waitqueue_head(&mbox->queue);
+
+	mbox->miscdev.minor = MISC_DYNAMIC_MINOR;
+	mbox->miscdev.name = DEVICE_NAME;
+	mbox->miscdev.fops = &aspeed_mbox_fops;
+	mbox->miscdev.parent = dev;
+	rc = misc_register(&mbox->miscdev);
+	if (rc) {
+		dev_err(dev, "Unable to register device\n");
+		return rc;
+	}
+
+	rc = aspeed_mbox_config_irq(mbox, pdev);
+	if (rc) {
+		dev_err(dev, "Failed to configure IRQ\n");
+		misc_deregister(&mbox->miscdev);
+		return rc;
+	}
+
+	return 0;
+}
+
+static int aspeed_mbox_remove(struct platform_device *pdev)
+{
+	struct aspeed_mbox *mbox = dev_get_drvdata(&pdev->dev);
+
+	misc_deregister(&mbox->miscdev);
+
+	return 0;
+}
+
+static const struct of_device_id aspeed_mbox_match[] = {
+	{ .compatible = "aspeed,ast2400-mbox" },
+	{ .compatible = "aspeed,ast2500-mbox" },
+	{ },
+};
+
+static struct platform_driver aspeed_mbox_driver = {
+	.driver = {
+		.name		= DEVICE_NAME,
+		.of_match_table = aspeed_mbox_match,
+	},
+	.probe = aspeed_mbox_probe,
+	.remove = aspeed_mbox_remove,
+};
+
+module_platform_driver(aspeed_mbox_driver);
+
+MODULE_DEVICE_TABLE(of, aspeed_mbox_match);
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Cyril Bur <cyrilbur@gmail.com>");
+MODULE_DESCRIPTION("Aspeed mailbox device driver");
-- 
2.11.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] drivers/mailbox: Add Aspeed mailbox driver
  2017-02-07 23:36 [PATCH v2] drivers/mailbox: Add Aspeed mailbox driver Cyril Bur
@ 2017-02-09  4:39   ` Joel Stanley
  2017-09-04  7:17 ` Cyril Bur
  1 sibling, 0 replies; 12+ messages in thread
From: Joel Stanley @ 2017-02-09  4:39 UTC (permalink / raw)
  To: Cyril Bur
  Cc: Jassi Brar, linux-kernel, Benjamin Herrenschmidt,
	Michael Neuling, OpenBMC Maillist

On Wed, Feb 8, 2017 at 10:06 AM, Cyril Bur <cyrilbur@gmail.com> wrote:
> This provides access to the mbox registers on the ast2400 and ast2500
> SoCs.
>
> This driver allows arbitrary reads and writes to the 16 data registers as
> the other end may have configured the mbox hardware to provide an
> interrupt when a specific register gets written to.
>
> Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
> ---
> V2:
>    s/ASpeed/Aspeed/
>    Reword Kconfig options
>    Use tristate for config symbol
>
>  drivers/mailbox/Kconfig       |   8 +
>  drivers/mailbox/Makefile      |   2 +
>  drivers/mailbox/aspeed-mbox.c | 334 ++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 344 insertions(+)
>  create mode 100644 drivers/mailbox/aspeed-mbox.c
>
> diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig
> index ceff415f201c..e24044d5c219 100644
> --- a/drivers/mailbox/Kconfig
> +++ b/drivers/mailbox/Kconfig
> @@ -152,4 +152,12 @@ config BCM_PDC_MBOX
>           Mailbox implementation for the Broadcom PDC ring manager,
>           which provides access to various offload engines on Broadcom
>           SoCs. Say Y here if you want to use the Broadcom PDC.
> +
> +config ASPEED_LPC_MBOX
> +       depends on (ARCH_ASPEED || COMPILE_TEST) && REGMAP && MFD_SYSCON
> +       tristate "Aspeed LPC Mailbox Controller"
> +       ---help---
> +         Provides a driver for the MBOX registers found on Aspeed SOCs
> +         (AST2400 and AST2500). This driver provides a device for aspeed
> +         mbox registers

You repeat yourself.

Mention that this driver is for the the BMC side.

> diff --git a/drivers/mailbox/aspeed-mbox.c b/drivers/mailbox/aspeed-mbox.c

> +static int aspeed_mbox_probe(struct platform_device *pdev)
> +{
> +       struct aspeed_mbox *mbox;
> +       struct device *dev;
> +       int rc;
> +
> +       dev = &pdev->dev;
> +
> +       mbox = devm_kzalloc(dev, sizeof(*mbox), GFP_KERNEL);
> +       if (!mbox)
> +               return -ENOMEM;
> +
> +       dev_set_drvdata(&pdev->dev, mbox);
> +
> +       rc = of_property_read_u32(dev->of_node, "reg", &mbox->base);
> +       if (rc) {
> +               dev_err(dev, "Couldn't read reg device-tree property\n");
> +               return rc;
> +       }

I think we want to use of_address_to_resource here.

> +
> +static const struct of_device_id aspeed_mbox_match[] = {
> +       { .compatible = "aspeed,ast2400-mbox" },
> +       { .compatible = "aspeed,ast2500-mbox" },
> +       { },

I didn't see the bindings in this series. Have they already been accepted?

Cheers,

Joel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] drivers/mailbox: Add Aspeed mailbox driver
@ 2017-02-09  4:39   ` Joel Stanley
  0 siblings, 0 replies; 12+ messages in thread
From: Joel Stanley @ 2017-02-09  4:39 UTC (permalink / raw)
  To: Cyril Bur
  Cc: Jassi Brar, linux-kernel, Benjamin Herrenschmidt,
	Michael Neuling, OpenBMC Maillist

On Wed, Feb 8, 2017 at 10:06 AM, Cyril Bur <cyrilbur@gmail.com> wrote:
> This provides access to the mbox registers on the ast2400 and ast2500
> SoCs.
>
> This driver allows arbitrary reads and writes to the 16 data registers as
> the other end may have configured the mbox hardware to provide an
> interrupt when a specific register gets written to.
>
> Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
> ---
> V2:
>    s/ASpeed/Aspeed/
>    Reword Kconfig options
>    Use tristate for config symbol
>
>  drivers/mailbox/Kconfig       |   8 +
>  drivers/mailbox/Makefile      |   2 +
>  drivers/mailbox/aspeed-mbox.c | 334 ++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 344 insertions(+)
>  create mode 100644 drivers/mailbox/aspeed-mbox.c
>
> diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig
> index ceff415f201c..e24044d5c219 100644
> --- a/drivers/mailbox/Kconfig
> +++ b/drivers/mailbox/Kconfig
> @@ -152,4 +152,12 @@ config BCM_PDC_MBOX
>           Mailbox implementation for the Broadcom PDC ring manager,
>           which provides access to various offload engines on Broadcom
>           SoCs. Say Y here if you want to use the Broadcom PDC.
> +
> +config ASPEED_LPC_MBOX
> +       depends on (ARCH_ASPEED || COMPILE_TEST) && REGMAP && MFD_SYSCON
> +       tristate "Aspeed LPC Mailbox Controller"
> +       ---help---
> +         Provides a driver for the MBOX registers found on Aspeed SOCs
> +         (AST2400 and AST2500). This driver provides a device for aspeed
> +         mbox registers

You repeat yourself.

Mention that this driver is for the the BMC side.

> diff --git a/drivers/mailbox/aspeed-mbox.c b/drivers/mailbox/aspeed-mbox.c

> +static int aspeed_mbox_probe(struct platform_device *pdev)
> +{
> +       struct aspeed_mbox *mbox;
> +       struct device *dev;
> +       int rc;
> +
> +       dev = &pdev->dev;
> +
> +       mbox = devm_kzalloc(dev, sizeof(*mbox), GFP_KERNEL);
> +       if (!mbox)
> +               return -ENOMEM;
> +
> +       dev_set_drvdata(&pdev->dev, mbox);
> +
> +       rc = of_property_read_u32(dev->of_node, "reg", &mbox->base);
> +       if (rc) {
> +               dev_err(dev, "Couldn't read reg device-tree property\n");
> +               return rc;
> +       }

I think we want to use of_address_to_resource here.

> +
> +static const struct of_device_id aspeed_mbox_match[] = {
> +       { .compatible = "aspeed,ast2400-mbox" },
> +       { .compatible = "aspeed,ast2500-mbox" },
> +       { },

I didn't see the bindings in this series. Have they already been accepted?

Cheers,

Joel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] drivers/mailbox: Add Aspeed mailbox driver
  2017-02-09  4:39   ` Joel Stanley
@ 2017-05-03  8:02     ` Suraj Jitindar Singh
  -1 siblings, 0 replies; 12+ messages in thread
From: Suraj Jitindar Singh @ 2017-05-03  8:02 UTC (permalink / raw)
  To: Jassi Brar; +Cc: Joel Stanley, Cyril Bur, linux-kernel, OpenBMC Maillist

***PING***

Are there any comments on this stopping it going upstream?

Do we think this would better belong in /drivers/misc rather than as a
mailbox driver?

Looking to get some discussion going and this moving along :)

Suraj

On Thu, 2017-02-09 at 15:09 +1030, Joel Stanley wrote:
> On Wed, Feb 8, 2017 at 10:06 AM, Cyril Bur <cyrilbur@gmail.com>
> wrote:
> > 
> > This provides access to the mbox registers on the ast2400 and
> > ast2500
> > SoCs.
> > 
> > This driver allows arbitrary reads and writes to the 16 data
> > registers as
> > the other end may have configured the mbox hardware to provide an
> > interrupt when a specific register gets written to.
> > 
> > Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
> > ---
> > V2:
> >    s/ASpeed/Aspeed/
> >    Reword Kconfig options
> >    Use tristate for config symbol
> > 
> >  drivers/mailbox/Kconfig       |   8 +
> >  drivers/mailbox/Makefile      |   2 +
> >  drivers/mailbox/aspeed-mbox.c | 334
> > ++++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 344 insertions(+)
> >  create mode 100644 drivers/mailbox/aspeed-mbox.c
> > 
> > diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig
> > index ceff415f201c..e24044d5c219 100644
> > --- a/drivers/mailbox/Kconfig
> > +++ b/drivers/mailbox/Kconfig
> > @@ -152,4 +152,12 @@ config BCM_PDC_MBOX
> >           Mailbox implementation for the Broadcom PDC ring manager,
> >           which provides access to various offload engines on
> > Broadcom
> >           SoCs. Say Y here if you want to use the Broadcom PDC.
> > +
> > +config ASPEED_LPC_MBOX
> > +       depends on (ARCH_ASPEED || COMPILE_TEST) && REGMAP &&
> > MFD_SYSCON
> > +       tristate "Aspeed LPC Mailbox Controller"
> > +       ---help---
> > +         Provides a driver for the MBOX registers found on Aspeed
> > SOCs
> > +         (AST2400 and AST2500). This driver provides a device for
> > aspeed
> > +         mbox registers
> You repeat yourself.
> 
> Mention that this driver is for the the BMC side.
> 
> > 
> > diff --git a/drivers/mailbox/aspeed-mbox.c
> > b/drivers/mailbox/aspeed-mbox.c
> > 
> > +static int aspeed_mbox_probe(struct platform_device *pdev)
> > +{
> > +       struct aspeed_mbox *mbox;
> > +       struct device *dev;
> > +       int rc;
> > +
> > +       dev = &pdev->dev;
> > +
> > +       mbox = devm_kzalloc(dev, sizeof(*mbox), GFP_KERNEL);
> > +       if (!mbox)
> > +               return -ENOMEM;
> > +
> > +       dev_set_drvdata(&pdev->dev, mbox);
> > +
> > +       rc = of_property_read_u32(dev->of_node, "reg", &mbox-
> > >base);
> > +       if (rc) {
> > +               dev_err(dev, "Couldn't read reg device-tree
> > property\n");
> > +               return rc;
> > +       }
> I think we want to use of_address_to_resource here.
> 
> > 
> > +
> > +static const struct of_device_id aspeed_mbox_match[] = {
> > +       { .compatible = "aspeed,ast2400-mbox" },
> > +       { .compatible = "aspeed,ast2500-mbox" },
> > +       { },
> I didn't see the bindings in this series. Have they already been
> accepted?
> 
> Cheers,
> 
> Joel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] drivers/mailbox: Add Aspeed mailbox driver
@ 2017-05-03  8:02     ` Suraj Jitindar Singh
  0 siblings, 0 replies; 12+ messages in thread
From: Suraj Jitindar Singh @ 2017-05-03  8:02 UTC (permalink / raw)
  To: Jassi Brar; +Cc: Joel Stanley, Cyril Bur, linux-kernel, OpenBMC Maillist

***PING***

Are there any comments on this stopping it going upstream?

Do we think this would better belong in /drivers/misc rather than as a
mailbox driver?

Looking to get some discussion going and this moving along :)

Suraj

On Thu, 2017-02-09 at 15:09 +1030, Joel Stanley wrote:
> On Wed, Feb 8, 2017 at 10:06 AM, Cyril Bur <cyrilbur@gmail.com>
> wrote:
> > 
> > This provides access to the mbox registers on the ast2400 and
> > ast2500
> > SoCs.
> > 
> > This driver allows arbitrary reads and writes to the 16 data
> > registers as
> > the other end may have configured the mbox hardware to provide an
> > interrupt when a specific register gets written to.
> > 
> > Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
> > ---
> > V2:
> >    s/ASpeed/Aspeed/
> >    Reword Kconfig options
> >    Use tristate for config symbol
> > 
> >  drivers/mailbox/Kconfig       |   8 +
> >  drivers/mailbox/Makefile      |   2 +
> >  drivers/mailbox/aspeed-mbox.c | 334
> > ++++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 344 insertions(+)
> >  create mode 100644 drivers/mailbox/aspeed-mbox.c
> > 
> > diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig
> > index ceff415f201c..e24044d5c219 100644
> > --- a/drivers/mailbox/Kconfig
> > +++ b/drivers/mailbox/Kconfig
> > @@ -152,4 +152,12 @@ config BCM_PDC_MBOX
> >           Mailbox implementation for the Broadcom PDC ring manager,
> >           which provides access to various offload engines on
> > Broadcom
> >           SoCs. Say Y here if you want to use the Broadcom PDC.
> > +
> > +config ASPEED_LPC_MBOX
> > +       depends on (ARCH_ASPEED || COMPILE_TEST) && REGMAP &&
> > MFD_SYSCON
> > +       tristate "Aspeed LPC Mailbox Controller"
> > +       ---help---
> > +         Provides a driver for the MBOX registers found on Aspeed
> > SOCs
> > +         (AST2400 and AST2500). This driver provides a device for
> > aspeed
> > +         mbox registers
> You repeat yourself.
> 
> Mention that this driver is for the the BMC side.
> 
> > 
> > diff --git a/drivers/mailbox/aspeed-mbox.c
> > b/drivers/mailbox/aspeed-mbox.c
> > 
> > +static int aspeed_mbox_probe(struct platform_device *pdev)
> > +{
> > +       struct aspeed_mbox *mbox;
> > +       struct device *dev;
> > +       int rc;
> > +
> > +       dev = &pdev->dev;
> > +
> > +       mbox = devm_kzalloc(dev, sizeof(*mbox), GFP_KERNEL);
> > +       if (!mbox)
> > +               return -ENOMEM;
> > +
> > +       dev_set_drvdata(&pdev->dev, mbox);
> > +
> > +       rc = of_property_read_u32(dev->of_node, "reg", &mbox-
> > >base);
> > +       if (rc) {
> > +               dev_err(dev, "Couldn't read reg device-tree
> > property\n");
> > +               return rc;
> > +       }
> I think we want to use of_address_to_resource here.
> 
> > 
> > +
> > +static const struct of_device_id aspeed_mbox_match[] = {
> > +       { .compatible = "aspeed,ast2400-mbox" },
> > +       { .compatible = "aspeed,ast2500-mbox" },
> > +       { },
> I didn't see the bindings in this series. Have they already been
> accepted?
> 
> Cheers,
> 
> Joel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] drivers/mailbox: Add Aspeed mailbox driver
  2017-02-07 23:36 [PATCH v2] drivers/mailbox: Add Aspeed mailbox driver Cyril Bur
  2017-02-09  4:39   ` Joel Stanley
@ 2017-09-04  7:17 ` Cyril Bur
  2017-09-04 14:43     ` Jassi Brar
  1 sibling, 1 reply; 12+ messages in thread
From: Cyril Bur @ 2017-09-04  7:17 UTC (permalink / raw)
  To: jassisinghbrar, linux-kernel; +Cc: openbmc, Joel Stanley, Greg KH

Hi,

I haven't heard anything about this driver. I'm trying to interpret if
the silence is because there is something fundamentally wrong with the
driver or is it because it doesn't use any of the mailbox
infrastructure it is being ignored.

Either way I'm happy to address the problems - in the event of there
being something wrong, I'm more than happy to take feedback and address
problems. If you would prefer to see it moved somewhere into char/misc,
this is also something I can do. Moving into char/misc is my preferred
option, I had a look at the mailbox infrastructure and it seems a bit
heavyweight for what this ultimately very simple driver is doing.

If you would be so kind as to let me know which direction to take.

Thanks,

Cyril

On Wed, 2017-02-08 at 10:36 +1100, Cyril Bur wrote:
> This provides access to the mbox registers on the ast2400 and ast2500
> SoCs.
> 
> This driver allows arbitrary reads and writes to the 16 data registers as
> the other end may have configured the mbox hardware to provide an
> interrupt when a specific register gets written to.
> 
> Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
> ---
> V2:
>    s/ASpeed/Aspeed/
>    Reword Kconfig options
>    Use tristate for config symbol
> 
>  drivers/mailbox/Kconfig       |   8 +
>  drivers/mailbox/Makefile      |   2 +
>  drivers/mailbox/aspeed-mbox.c | 334 ++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 344 insertions(+)
>  create mode 100644 drivers/mailbox/aspeed-mbox.c
> 
> diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig
> index ceff415f201c..e24044d5c219 100644
> --- a/drivers/mailbox/Kconfig
> +++ b/drivers/mailbox/Kconfig
> @@ -152,4 +152,12 @@ config BCM_PDC_MBOX
>  	  Mailbox implementation for the Broadcom PDC ring manager,
>  	  which provides access to various offload engines on Broadcom
>  	  SoCs. Say Y here if you want to use the Broadcom PDC.
> +
> +config ASPEED_LPC_MBOX
> +	depends on (ARCH_ASPEED || COMPILE_TEST) && REGMAP && MFD_SYSCON
> +	tristate "Aspeed LPC Mailbox Controller"
> +	---help---
> +	  Provides a driver for the MBOX registers found on Aspeed SOCs
> +	  (AST2400 and AST2500). This driver provides a device for aspeed
> +	  mbox registers
>  endif
> diff --git a/drivers/mailbox/Makefile b/drivers/mailbox/Makefile
> index 7dde4f609ae8..73165a79b517 100644
> --- a/drivers/mailbox/Makefile
> +++ b/drivers/mailbox/Makefile
> @@ -31,3 +31,5 @@ obj-$(CONFIG_HI6220_MBOX)	+= hi6220-mailbox.o
>  obj-$(CONFIG_BCM_PDC_MBOX)	+= bcm-pdc-mailbox.o
>  
>  obj-$(CONFIG_TEGRA_HSP_MBOX)	+= tegra-hsp.o
> +
> +obj-$(CONFIG_ASPEED_LPC_MBOX)	+= aspeed-mbox.o
> diff --git a/drivers/mailbox/aspeed-mbox.c b/drivers/mailbox/aspeed-mbox.c
> new file mode 100644
> index 000000000000..0f0c711bafee
> --- /dev/null
> +++ b/drivers/mailbox/aspeed-mbox.c
> @@ -0,0 +1,334 @@
> +/*
> + * Copyright 2017 IBM Corporation
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License
> + * as published by the Free Software Foundation; either version
> + * 2 of the License, or (at your option) any later version.
> + */
> +
> +#include <linux/interrupt.h>
> +#include <linux/mfd/syscon.h>
> +#include <linux/miscdevice.h>
> +#include <linux/module.h>
> +#include <linux/of_irq.h>
> +#include <linux/platform_device.h>
> +#include <linux/poll.h>
> +#include <linux/regmap.h>
> +#include <linux/slab.h>
> +
> +#define DEVICE_NAME	"aspeed-mbox"
> +
> +#define ASPEED_MBOX_NUM_REGS 16
> +
> +#define ASPEED_MBOX_DATA_0 0x00
> +#define ASPEED_MBOX_STATUS_0 0x40
> +#define ASPEED_MBOX_STATUS_1 0x44
> +#define ASPEED_MBOX_BMC_CTRL 0x48
> +#define   ASPEED_MBOX_CTRL_RECV BIT(7)
> +#define   ASPEED_MBOX_CTRL_MASK BIT(1)
> +#define   ASPEED_MBOX_CTRL_SEND BIT(0)
> +#define ASPEED_MBOX_HOST_CTRL 0x4c
> +#define ASPEED_MBOX_INTERRUPT_0 0x50
> +#define ASPEED_MBOX_INTERRUPT_1 0x54
> +
> +struct aspeed_mbox {
> +	struct miscdevice	miscdev;
> +	struct regmap		*regmap;
> +	unsigned int		base;
> +	wait_queue_head_t	queue;
> +	struct mutex		mutex;
> +};
> +
> +static atomic_t aspeed_mbox_open_count = ATOMIC_INIT(0);
> +
> +static u8 aspeed_mbox_inb(struct aspeed_mbox *mbox, int reg)
> +{
> +	/*
> +	 * The mbox registers are actually only one byte but are addressed
> +	 * four bytes apart. The other three bytes are marked 'reserved',
> +	 * they *should* be zero but lets not rely on it.
> +	 * I am going to rely on the fact we can casually read/write to them...
> +	 */
> +	unsigned int val = 0xff; /* If regmap throws an error return 0xff */
> +	int rc = regmap_read(mbox->regmap, mbox->base + reg, &val);
> +
> +	if (rc)
> +		dev_err(mbox->miscdev.parent, "regmap_read() failed with "
> +				"%d (reg: 0x%08x)\n", rc, reg);
> +
> +	return val & 0xff;
> +}
> +
> +static void aspeed_mbox_outb(struct aspeed_mbox *mbox, u8 data, int reg)
> +{
> +	int rc = regmap_write(mbox->regmap, mbox->base + reg, data);
> +
> +	if (rc)
> +		dev_err(mbox->miscdev.parent, "regmap_write() failed with "
> +				"%d (data: %u reg: 0x%08x)\n", rc, data, reg);
> +}
> +
> +static struct aspeed_mbox *file_mbox(struct file *file)
> +{
> +	return container_of(file->private_data, struct aspeed_mbox, miscdev);
> +}
> +
> +static int aspeed_mbox_open(struct inode *inode, struct file *file)
> +{
> +	struct aspeed_mbox *mbox = file_mbox(file);
> +
> +	if (atomic_inc_return(&aspeed_mbox_open_count) == 1) {
> +		/*
> +		 * Clear the interrupt status bit if it was left on and unmask
> +		 * interrupts.
> +		 * ASPEED_MBOX_CTRL_RECV bit is W1C, this also unmasks in 1 step
> +		 */
> +		aspeed_mbox_outb(mbox, ASPEED_MBOX_CTRL_RECV, ASPEED_MBOX_BMC_CTRL);
> +		return 0;
> +	}
> +
> +	atomic_dec(&aspeed_mbox_open_count);
> +	return -EBUSY;
> +}
> +
> +static ssize_t aspeed_mbox_read(struct file *file, char __user *buf,
> +				size_t count, loff_t *ppos)
> +{
> +	struct aspeed_mbox *mbox = file_mbox(file);
> +	char __user *p = buf;
> +	ssize_t ret;
> +	int i;
> +
> +	if (!access_ok(VERIFY_WRITE, buf, count))
> +		return -EFAULT;
> +
> +	if (count + *ppos > ASPEED_MBOX_NUM_REGS)
> +		return -EINVAL;
> +
> +	if (file->f_flags & O_NONBLOCK) {
> +		if (!(aspeed_mbox_inb(mbox, ASPEED_MBOX_BMC_CTRL) &
> +				ASPEED_MBOX_CTRL_RECV))
> +			return -EAGAIN;
> +	} else if (wait_event_interruptible(mbox->queue,
> +				aspeed_mbox_inb(mbox, ASPEED_MBOX_BMC_CTRL) &
> +				ASPEED_MBOX_CTRL_RECV)) {
> +		return -ERESTARTSYS;
> +	}
> +
> +	mutex_lock(&mbox->mutex);
> +
> +	for (i = *ppos; count > 0 && i < ASPEED_MBOX_NUM_REGS; i++) {
> +		uint8_t reg = aspeed_mbox_inb(mbox, ASPEED_MBOX_DATA_0 + (i * 4));
> +
> +		ret = __put_user(reg, p);
> +		if (ret)
> +			goto out_unlock;
> +
> +		p++;
> +		count--;
> +	}
> +
> +	/* ASPEED_MBOX_CTRL_RECV bit is write to clear, this also unmasks in 1 step */
> +	aspeed_mbox_outb(mbox, ASPEED_MBOX_CTRL_RECV, ASPEED_MBOX_BMC_CTRL);
> +	ret = p - buf;
> +
> +out_unlock:
> +	mutex_unlock(&mbox->mutex);
> +	return ret;
> +}
> +
> +static ssize_t aspeed_mbox_write(struct file *file, const char __user *buf,
> +				size_t count, loff_t *ppos)
> +{
> +	struct aspeed_mbox *mbox = file_mbox(file);
> +	const char __user *p = buf;
> +	ssize_t ret;
> +	char c;
> +	int i;
> +
> +	if (!access_ok(VERIFY_READ, buf, count))
> +		return -EFAULT;
> +
> +	if (count + *ppos > ASPEED_MBOX_NUM_REGS)
> +		return -EINVAL;
> +
> +	mutex_lock(&mbox->mutex);
> +
> +	for (i = *ppos; count > 0 && i < ASPEED_MBOX_NUM_REGS; i++) {
> +		ret = __get_user(c, p);
> +		if (ret)
> +			goto out_unlock;
> +
> +		aspeed_mbox_outb(mbox, c, ASPEED_MBOX_DATA_0 + (i * 4));
> +		p++;
> +		count--;
> +	}
> +
> +	aspeed_mbox_outb(mbox, ASPEED_MBOX_CTRL_SEND, ASPEED_MBOX_BMC_CTRL);
> +	ret = p - buf;
> +
> +out_unlock:
> +	mutex_unlock(&mbox->mutex);
> +	return ret;
> +}
> +
> +static unsigned int aspeed_mbox_poll(struct file *file, poll_table *wait)
> +{
> +	struct aspeed_mbox *mbox = file_mbox(file);
> +	unsigned int mask = 0;
> +
> +	poll_wait(file, &mbox->queue, wait);
> +
> +	if (aspeed_mbox_inb(mbox, ASPEED_MBOX_BMC_CTRL) & ASPEED_MBOX_CTRL_RECV)
> +		mask |= POLLIN;
> +
> +	return mask;
> +}
> +
> +static int aspeed_mbox_release(struct inode *inode, struct file *file)
> +{
> +	atomic_dec(&aspeed_mbox_open_count);
> +	return 0;
> +}
> +
> +static const struct file_operations aspeed_mbox_fops = {
> +	.owner		= THIS_MODULE,
> +	.llseek		= no_seek_end_llseek,
> +	.read		= aspeed_mbox_read,
> +	.write		= aspeed_mbox_write,
> +	.open		= aspeed_mbox_open,
> +	.release	= aspeed_mbox_release,
> +	.poll		= aspeed_mbox_poll,
> +};
> +
> +static irqreturn_t aspeed_mbox_irq(int irq, void *arg)
> +{
> +	struct aspeed_mbox *mbox = arg;
> +
> +	if (!(aspeed_mbox_inb(mbox, ASPEED_MBOX_BMC_CTRL) & ASPEED_MBOX_CTRL_RECV))
> +		return IRQ_NONE;
> +
> +	/*
> +	 * Leave the status bit set so that we know the data is for us,
> +	 * clear it once it has been read.
> +	 */
> +
> +	/* Mask it off, we'll clear it when we the data gets read */
> +	aspeed_mbox_outb(mbox, ASPEED_MBOX_CTRL_MASK, ASPEED_MBOX_BMC_CTRL);
> +
> +	wake_up(&mbox->queue);
> +	return IRQ_HANDLED;
> +}
> +
> +static int aspeed_mbox_config_irq(struct aspeed_mbox *mbox,
> +		struct platform_device *pdev)
> +{
> +	struct device *dev = &pdev->dev;
> +	int rc, irq;
> +
> +	irq = irq_of_parse_and_map(dev->of_node, 0);
> +	if (!irq)
> +		return -ENODEV;
> +
> +	rc = devm_request_irq(dev, irq, aspeed_mbox_irq,
> +			IRQF_SHARED, DEVICE_NAME, mbox);
> +	if (rc < 0) {
> +		dev_err(dev, "Unable to request IRQ %d\n", irq);
> +		return rc;
> +	}
> +
> +	/*
> +	 * Disable all register based interrupts.
> +	 */
> +	aspeed_mbox_outb(mbox, 0x00, ASPEED_MBOX_INTERRUPT_0); /* regs 0 - 7 */
> +	aspeed_mbox_outb(mbox, 0x00, ASPEED_MBOX_INTERRUPT_1); /* regs 8 - 15 */
> +
> +	/* These registers are write one to clear. Clear them. */
> +	aspeed_mbox_outb(mbox, 0xff, ASPEED_MBOX_STATUS_0);
> +	aspeed_mbox_outb(mbox, 0xff, ASPEED_MBOX_STATUS_1);
> +
> +	aspeed_mbox_outb(mbox, ASPEED_MBOX_CTRL_RECV, ASPEED_MBOX_BMC_CTRL);
> +	return 0;
> +}
> +
> +static int aspeed_mbox_probe(struct platform_device *pdev)
> +{
> +	struct aspeed_mbox *mbox;
> +	struct device *dev;
> +	int rc;
> +
> +	dev = &pdev->dev;
> +
> +	mbox = devm_kzalloc(dev, sizeof(*mbox), GFP_KERNEL);
> +	if (!mbox)
> +		return -ENOMEM;
> +
> +	dev_set_drvdata(&pdev->dev, mbox);
> +
> +	rc = of_property_read_u32(dev->of_node, "reg", &mbox->base);
> +	if (rc) {
> +		dev_err(dev, "Couldn't read reg device-tree property\n");
> +		return rc;
> +	}
> +
> +	mbox->regmap = syscon_node_to_regmap(
> +			pdev->dev.parent->of_node);
> +	if (IS_ERR(mbox->regmap)) {
> +		dev_err(dev, "Couldn't get regmap\n");
> +		return -ENODEV;
> +	}
> +
> +	mutex_init(&mbox->mutex);
> +	init_waitqueue_head(&mbox->queue);
> +
> +	mbox->miscdev.minor = MISC_DYNAMIC_MINOR;
> +	mbox->miscdev.name = DEVICE_NAME;
> +	mbox->miscdev.fops = &aspeed_mbox_fops;
> +	mbox->miscdev.parent = dev;
> +	rc = misc_register(&mbox->miscdev);
> +	if (rc) {
> +		dev_err(dev, "Unable to register device\n");
> +		return rc;
> +	}
> +
> +	rc = aspeed_mbox_config_irq(mbox, pdev);
> +	if (rc) {
> +		dev_err(dev, "Failed to configure IRQ\n");
> +		misc_deregister(&mbox->miscdev);
> +		return rc;
> +	}
> +
> +	return 0;
> +}
> +
> +static int aspeed_mbox_remove(struct platform_device *pdev)
> +{
> +	struct aspeed_mbox *mbox = dev_get_drvdata(&pdev->dev);
> +
> +	misc_deregister(&mbox->miscdev);
> +
> +	return 0;
> +}
> +
> +static const struct of_device_id aspeed_mbox_match[] = {
> +	{ .compatible = "aspeed,ast2400-mbox" },
> +	{ .compatible = "aspeed,ast2500-mbox" },
> +	{ },
> +};
> +
> +static struct platform_driver aspeed_mbox_driver = {
> +	.driver = {
> +		.name		= DEVICE_NAME,
> +		.of_match_table = aspeed_mbox_match,
> +	},
> +	.probe = aspeed_mbox_probe,
> +	.remove = aspeed_mbox_remove,
> +};
> +
> +module_platform_driver(aspeed_mbox_driver);
> +
> +MODULE_DEVICE_TABLE(of, aspeed_mbox_match);
> +MODULE_LICENSE("GPL");
> +MODULE_AUTHOR("Cyril Bur <cyrilbur@gmail.com>");
> +MODULE_DESCRIPTION("Aspeed mailbox device driver");

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] drivers/mailbox: Add Aspeed mailbox driver
  2017-09-04  7:17 ` Cyril Bur
@ 2017-09-04 14:43     ` Jassi Brar
  0 siblings, 0 replies; 12+ messages in thread
From: Jassi Brar @ 2017-09-04 14:43 UTC (permalink / raw)
  To: Cyril Bur; +Cc: Linux Kernel Mailing List, openbmc, Joel Stanley, Greg KH

On Mon, Sep 4, 2017 at 12:47 PM, Cyril Bur <cyrilbur@gmail.com> wrote:
> Hi,
>
> I haven't heard anything about this driver. I'm trying to interpret if
> the silence is because there is something fundamentally wrong with the
> driver or is it because it doesn't use any of the mailbox
> infrastructure it is being ignored.
>
Its the latter.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] drivers/mailbox: Add Aspeed mailbox driver
@ 2017-09-04 14:43     ` Jassi Brar
  0 siblings, 0 replies; 12+ messages in thread
From: Jassi Brar @ 2017-09-04 14:43 UTC (permalink / raw)
  To: Cyril Bur; +Cc: Linux Kernel Mailing List, openbmc, Joel Stanley, Greg KH

On Mon, Sep 4, 2017 at 12:47 PM, Cyril Bur <cyrilbur@gmail.com> wrote:
> Hi,
>
> I haven't heard anything about this driver. I'm trying to interpret if
> the silence is because there is something fundamentally wrong with the
> driver or is it because it doesn't use any of the mailbox
> infrastructure it is being ignored.
>
Its the latter.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] drivers/mailbox: Add Aspeed mailbox driver
  2017-09-04 14:43     ` Jassi Brar
@ 2017-09-04 23:37       ` Cyril Bur
  -1 siblings, 0 replies; 12+ messages in thread
From: Cyril Bur @ 2017-09-04 23:37 UTC (permalink / raw)
  To: Jassi Brar; +Cc: Linux Kernel Mailing List, openbmc, Joel Stanley, Greg KH

On Mon, 2017-09-04 at 20:13 +0530, Jassi Brar wrote:
> On Mon, Sep 4, 2017 at 12:47 PM, Cyril Bur <cyrilbur@gmail.com> wrote:
> > Hi,
> > 
> > I haven't heard anything about this driver. I'm trying to interpret if
> > the silence is because there is something fundamentally wrong with the
> > driver or is it because it doesn't use any of the mailbox
> > infrastructure it is being ignored.
> > 
> 
> Its the latter.

Great! Thanks for your response, I'll resend it under char/misc.

Kind regards,

Cyril

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] drivers/mailbox: Add Aspeed mailbox driver
@ 2017-09-04 23:37       ` Cyril Bur
  0 siblings, 0 replies; 12+ messages in thread
From: Cyril Bur @ 2017-09-04 23:37 UTC (permalink / raw)
  To: Jassi Brar; +Cc: Linux Kernel Mailing List, openbmc, Joel Stanley, Greg KH

On Mon, 2017-09-04 at 20:13 +0530, Jassi Brar wrote:
> On Mon, Sep 4, 2017 at 12:47 PM, Cyril Bur <cyrilbur@gmail.com> wrote:
> > Hi,
> > 
> > I haven't heard anything about this driver. I'm trying to interpret if
> > the silence is because there is something fundamentally wrong with the
> > driver or is it because it doesn't use any of the mailbox
> > infrastructure it is being ignored.
> > 
> 
> Its the latter.

Great! Thanks for your response, I'll resend it under char/misc.

Kind regards,

Cyril

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] drivers/mailbox: Add Aspeed mailbox driver
  2017-09-04 23:37       ` Cyril Bur
  (?)
@ 2017-09-05  6:25       ` Greg KH
  2017-09-05  7:10         ` Cyril Bur
  -1 siblings, 1 reply; 12+ messages in thread
From: Greg KH @ 2017-09-05  6:25 UTC (permalink / raw)
  To: Cyril Bur; +Cc: Jassi Brar, Linux Kernel Mailing List, openbmc, Joel Stanley

On Tue, Sep 05, 2017 at 09:37:19AM +1000, Cyril Bur wrote:
> On Mon, 2017-09-04 at 20:13 +0530, Jassi Brar wrote:
> > On Mon, Sep 4, 2017 at 12:47 PM, Cyril Bur <cyrilbur@gmail.com> wrote:
> > > Hi,
> > > 
> > > I haven't heard anything about this driver. I'm trying to interpret if
> > > the silence is because there is something fundamentally wrong with the
> > > driver or is it because it doesn't use any of the mailbox
> > > infrastructure it is being ignored.
> > > 
> > 
> > Its the latter.
> 
> Great! Thanks for your response, I'll resend it under char/misc.

Wait, no, please use the mailbox infrastructure for this, making a
one-off char/misc driver isn't ok when there is a framework for you to
use.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2] drivers/mailbox: Add Aspeed mailbox driver
  2017-09-05  6:25       ` Greg KH
@ 2017-09-05  7:10         ` Cyril Bur
  0 siblings, 0 replies; 12+ messages in thread
From: Cyril Bur @ 2017-09-05  7:10 UTC (permalink / raw)
  To: Greg KH; +Cc: Jassi Brar, Linux Kernel Mailing List, openbmc, Joel Stanley

On Tue, 2017-09-05 at 08:25 +0200, Greg KH wrote:
> On Tue, Sep 05, 2017 at 09:37:19AM +1000, Cyril Bur wrote:
> > On Mon, 2017-09-04 at 20:13 +0530, Jassi Brar wrote:
> > > On Mon, Sep 4, 2017 at 12:47 PM, Cyril Bur <cyrilbur@gmail.com> wrote:
> > > > Hi,
> > > > 
> > > > I haven't heard anything about this driver. I'm trying to interpret if
> > > > the silence is because there is something fundamentally wrong with the
> > > > driver or is it because it doesn't use any of the mailbox
> > > > infrastructure it is being ignored.
> > > > 
> > > 
> > > Its the latter.
> > 
> > Great! Thanks for your response, I'll resend it under char/misc.
> 
> Wait, no, please use the mailbox infrastructure for this, making a
> one-off char/misc driver isn't ok when there is a framework for you to
> use.
> 

Thanks very much for your response.

Yes you're absolutely correct, I'll send it to drivers/mailbox. I look
forward to working more closely with Jassi. I'll be sure to fully and
completely exploit all the features of this mailbox framework.

Looking forward to continued development,

Thanks very much to all involved,

Cyril

> thanks,
> 
> greg k-h

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-09-05  7:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-07 23:36 [PATCH v2] drivers/mailbox: Add Aspeed mailbox driver Cyril Bur
2017-02-09  4:39 ` Joel Stanley
2017-02-09  4:39   ` Joel Stanley
2017-05-03  8:02   ` Suraj Jitindar Singh
2017-05-03  8:02     ` Suraj Jitindar Singh
2017-09-04  7:17 ` Cyril Bur
2017-09-04 14:43   ` Jassi Brar
2017-09-04 14:43     ` Jassi Brar
2017-09-04 23:37     ` Cyril Bur
2017-09-04 23:37       ` Cyril Bur
2017-09-05  6:25       ` Greg KH
2017-09-05  7:10         ` Cyril Bur

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.