linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] platform/chrome: Add cros_ec_readmem() helpers for I2C/SPI based ECs
@ 2019-01-10  4:36 Moritz Fischer
  2019-01-21 17:32 ` Enric Balletbo Serra
  0 siblings, 1 reply; 6+ messages in thread
From: Moritz Fischer @ 2019-01-10  4:36 UTC (permalink / raw)
  To: linux-kernel
  Cc: enric.balletbo, bleung, groeck, lee.jones, moritz, Moritz Fischer

Add cros_ec_readmem() helpers for I2C/SPI based ECs.
Unlike the LPC based ECs the I2C/SPI based ones cannot just directly
read the mapped region, but have to resort to EC_CMD_READ_MEMMAP.

This is useful for things like accessing fan speeds or temperatures.

Signed-off-by: Moritz Fischer <mdf@kernel.org>
---

Hi all,

This can be used for a hwmon or thermal driver such as [1], but also
alone can be used with 'ectool' via the ioctl() interface.

Thanks,
Moritz


Changes from v2:
- Addressed KBuild complaint about max() with size_t vs unsigned int
  parameters

Changes from v1:
- Moved to drivers/platform/proto


[1] https://patchwork.kernel.org/patch/9670517/ (needs work)
---
 drivers/platform/chrome/cros_ec_i2c.c   |  1 +
 drivers/platform/chrome/cros_ec_proto.c | 39 +++++++++++++++++++++++++
 drivers/platform/chrome/cros_ec_spi.c   |  1 +
 include/linux/mfd/cros_ec.h             | 12 ++++++++
 4 files changed, 53 insertions(+)

diff --git a/drivers/platform/chrome/cros_ec_i2c.c b/drivers/platform/chrome/cros_ec_i2c.c
index ef9b4763356f..c3a9bee37b1d 100644
--- a/drivers/platform/chrome/cros_ec_i2c.c
+++ b/drivers/platform/chrome/cros_ec_i2c.c
@@ -303,6 +303,7 @@ static int cros_ec_i2c_probe(struct i2c_client *client,
 	ec_dev->irq = client->irq;
 	ec_dev->cmd_xfer = cros_ec_cmd_xfer_i2c;
 	ec_dev->pkt_xfer = cros_ec_pkt_xfer_i2c;
+	ec_dev->cmd_readmem = cros_ec_readmem;
 	ec_dev->phys_name = client->adapter->name;
 	ec_dev->din_size = sizeof(struct ec_host_response_i2c) +
 			   sizeof(struct ec_response_get_protocol_info);
diff --git a/drivers/platform/chrome/cros_ec_proto.c b/drivers/platform/chrome/cros_ec_proto.c
index cc7baf0ecb3c..d2ba662fc713 100644
--- a/drivers/platform/chrome/cros_ec_proto.c
+++ b/drivers/platform/chrome/cros_ec_proto.c
@@ -636,3 +636,42 @@ u32 cros_ec_get_host_event(struct cros_ec_device *ec_dev)
 	return host_event;
 }
 EXPORT_SYMBOL(cros_ec_get_host_event);
+
+int cros_ec_readmem(struct cros_ec_device *ec, unsigned int offset,
+		    unsigned int bytes, void *dest)
+{
+	struct ec_params_read_memmap *params;
+	struct cros_ec_command *msg;
+	int ret;
+
+	if (offset >= EC_MEMMAP_SIZE - bytes)
+		return -EINVAL;
+
+	msg = kzalloc(sizeof(*msg) + max_t(size_t, sizeof(*params), bytes),
+		      GFP_KERNEL);
+	if (!msg)
+		return -ENOMEM;
+
+	msg->version = 0;
+	msg->command = EC_CMD_READ_MEMMAP;
+	msg->insize = bytes;
+	msg->outsize = sizeof(*params);
+
+	params = (struct ec_params_read_memmap *)msg->data;
+	params->offset = offset;
+	params->size = bytes;
+
+	ret = cros_ec_cmd_xfer_status(ec, msg);
+	if (ret < 0) {
+		dev_warn(ec->dev, "cannot read mapped reg: %d/%d\n",
+			 ret, msg->result);
+		goto out_free;
+	}
+
+	memcpy(dest, msg->data, bytes);
+
+out_free:
+	kfree(msg);
+	return ret;
+}
+EXPORT_SYMBOL_GPL(cros_ec_readmem);
diff --git a/drivers/platform/chrome/cros_ec_spi.c b/drivers/platform/chrome/cros_ec_spi.c
index 2060d1483043..b95c1a25adfc 100644
--- a/drivers/platform/chrome/cros_ec_spi.c
+++ b/drivers/platform/chrome/cros_ec_spi.c
@@ -666,6 +666,7 @@ static int cros_ec_spi_probe(struct spi_device *spi)
 	ec_dev->irq = spi->irq;
 	ec_dev->cmd_xfer = cros_ec_cmd_xfer_spi;
 	ec_dev->pkt_xfer = cros_ec_pkt_xfer_spi;
+	ec_dev->cmd_readmem = cros_ec_readmem;
 	ec_dev->phys_name = dev_name(&ec_spi->spi->dev);
 	ec_dev->din_size = EC_MSG_PREAMBLE_COUNT +
 			   sizeof(struct ec_host_response) +
diff --git a/include/linux/mfd/cros_ec.h b/include/linux/mfd/cros_ec.h
index de8b588c8776..0228fb42dcda 100644
--- a/include/linux/mfd/cros_ec.h
+++ b/include/linux/mfd/cros_ec.h
@@ -335,6 +335,18 @@ int cros_ec_get_next_event(struct cros_ec_device *ec_dev, bool *wake_event);
  */
 u32 cros_ec_get_host_event(struct cros_ec_device *ec_dev);
 
+/**
+ * cros_ec_readmem - Read mapped memory in the ChromeOS EC
+ *
+ * @ec: Device to read from
+ * @offset: Offset to read within the mapped region
+ * @bytes: number of bytes to read
+ * @data: Return data
+ * @return: 0 if Ok, -ve on error
+ */
+int cros_ec_readmem(struct cros_ec_device *ec, unsigned int offset,
+		    unsigned int bytes, void *dest);
+
 /* sysfs stuff */
 extern struct attribute_group cros_ec_attr_group;
 extern struct attribute_group cros_ec_lightbar_attr_group;
-- 
2.20.1


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

* Re: [PATCH v3] platform/chrome: Add cros_ec_readmem() helpers for I2C/SPI based ECs
  2019-01-10  4:36 [PATCH v3] platform/chrome: Add cros_ec_readmem() helpers for I2C/SPI based ECs Moritz Fischer
@ 2019-01-21 17:32 ` Enric Balletbo Serra
  2019-01-21 18:40   ` Moritz Fischer
  0 siblings, 1 reply; 6+ messages in thread
From: Enric Balletbo Serra @ 2019-01-21 17:32 UTC (permalink / raw)
  To: Moritz Fischer
  Cc: linux-kernel, Enric Balletbo i Serra, Benson Leung,
	Guenter Roeck, Lee Jones, moritz

Hi Moritz,

Missatge de Moritz Fischer <mdf@kernel.org> del dia dj., 10 de gen.
2019 a les 5:40:
>
> Add cros_ec_readmem() helpers for I2C/SPI based ECs.
> Unlike the LPC based ECs the I2C/SPI based ones cannot just directly
> read the mapped region, but have to resort to EC_CMD_READ_MEMMAP.
>
> This is useful for things like accessing fan speeds or temperatures.
>
> Signed-off-by: Moritz Fischer <mdf@kernel.org>
> ---
>
> Hi all,
>
> This can be used for a hwmon or thermal driver such as [1], but also
> alone can be used with 'ectool' via the ioctl() interface.
>

ooi, did you try this with a Chromebook? Or only with your device?

I was a bit worried on the side effects to expose this command to
userspace, so I did a quick test, and to be honest I didn't like the
result. Issuing the ioctl resulted on a reboot on the Chromebook I
tested, which is not good. I didn't investigate more but I can say
that this change, at least, will need some rework. I'll try to
investigate a bit more on what is happening.

Thanks,
 Enric

> Thanks,
> Moritz
>
>
> Changes from v2:
> - Addressed KBuild complaint about max() with size_t vs unsigned int
>   parameters
>
> Changes from v1:
> - Moved to drivers/platform/proto
>
>
> [1] https://patchwork.kernel.org/patch/9670517/ (needs work)
> ---
>  drivers/platform/chrome/cros_ec_i2c.c   |  1 +
>  drivers/platform/chrome/cros_ec_proto.c | 39 +++++++++++++++++++++++++
>  drivers/platform/chrome/cros_ec_spi.c   |  1 +
>  include/linux/mfd/cros_ec.h             | 12 ++++++++
>  4 files changed, 53 insertions(+)
>
> diff --git a/drivers/platform/chrome/cros_ec_i2c.c b/drivers/platform/chrome/cros_ec_i2c.c
> index ef9b4763356f..c3a9bee37b1d 100644
> --- a/drivers/platform/chrome/cros_ec_i2c.c
> +++ b/drivers/platform/chrome/cros_ec_i2c.c
> @@ -303,6 +303,7 @@ static int cros_ec_i2c_probe(struct i2c_client *client,
>         ec_dev->irq = client->irq;
>         ec_dev->cmd_xfer = cros_ec_cmd_xfer_i2c;
>         ec_dev->pkt_xfer = cros_ec_pkt_xfer_i2c;
> +       ec_dev->cmd_readmem = cros_ec_readmem;
>         ec_dev->phys_name = client->adapter->name;
>         ec_dev->din_size = sizeof(struct ec_host_response_i2c) +
>                            sizeof(struct ec_response_get_protocol_info);
> diff --git a/drivers/platform/chrome/cros_ec_proto.c b/drivers/platform/chrome/cros_ec_proto.c
> index cc7baf0ecb3c..d2ba662fc713 100644
> --- a/drivers/platform/chrome/cros_ec_proto.c
> +++ b/drivers/platform/chrome/cros_ec_proto.c
> @@ -636,3 +636,42 @@ u32 cros_ec_get_host_event(struct cros_ec_device *ec_dev)
>         return host_event;
>  }
>  EXPORT_SYMBOL(cros_ec_get_host_event);
> +
> +int cros_ec_readmem(struct cros_ec_device *ec, unsigned int offset,
> +                   unsigned int bytes, void *dest)
> +{
> +       struct ec_params_read_memmap *params;
> +       struct cros_ec_command *msg;
> +       int ret;
> +
> +       if (offset >= EC_MEMMAP_SIZE - bytes)
> +               return -EINVAL;
> +
> +       msg = kzalloc(sizeof(*msg) + max_t(size_t, sizeof(*params), bytes),
> +                     GFP_KERNEL);
> +       if (!msg)
> +               return -ENOMEM;
> +
> +       msg->version = 0;
> +       msg->command = EC_CMD_READ_MEMMAP;
> +       msg->insize = bytes;
> +       msg->outsize = sizeof(*params);
> +
> +       params = (struct ec_params_read_memmap *)msg->data;
> +       params->offset = offset;
> +       params->size = bytes;
> +
> +       ret = cros_ec_cmd_xfer_status(ec, msg);
> +       if (ret < 0) {
> +               dev_warn(ec->dev, "cannot read mapped reg: %d/%d\n",
> +                        ret, msg->result);
> +               goto out_free;
> +       }
> +
> +       memcpy(dest, msg->data, bytes);
> +
> +out_free:
> +       kfree(msg);
> +       return ret;
> +}
> +EXPORT_SYMBOL_GPL(cros_ec_readmem);
> diff --git a/drivers/platform/chrome/cros_ec_spi.c b/drivers/platform/chrome/cros_ec_spi.c
> index 2060d1483043..b95c1a25adfc 100644
> --- a/drivers/platform/chrome/cros_ec_spi.c
> +++ b/drivers/platform/chrome/cros_ec_spi.c
> @@ -666,6 +666,7 @@ static int cros_ec_spi_probe(struct spi_device *spi)
>         ec_dev->irq = spi->irq;
>         ec_dev->cmd_xfer = cros_ec_cmd_xfer_spi;
>         ec_dev->pkt_xfer = cros_ec_pkt_xfer_spi;
> +       ec_dev->cmd_readmem = cros_ec_readmem;
>         ec_dev->phys_name = dev_name(&ec_spi->spi->dev);
>         ec_dev->din_size = EC_MSG_PREAMBLE_COUNT +
>                            sizeof(struct ec_host_response) +
> diff --git a/include/linux/mfd/cros_ec.h b/include/linux/mfd/cros_ec.h
> index de8b588c8776..0228fb42dcda 100644
> --- a/include/linux/mfd/cros_ec.h
> +++ b/include/linux/mfd/cros_ec.h
> @@ -335,6 +335,18 @@ int cros_ec_get_next_event(struct cros_ec_device *ec_dev, bool *wake_event);
>   */
>  u32 cros_ec_get_host_event(struct cros_ec_device *ec_dev);
>
> +/**
> + * cros_ec_readmem - Read mapped memory in the ChromeOS EC
> + *
> + * @ec: Device to read from
> + * @offset: Offset to read within the mapped region
> + * @bytes: number of bytes to read
> + * @data: Return data
> + * @return: 0 if Ok, -ve on error
> + */
> +int cros_ec_readmem(struct cros_ec_device *ec, unsigned int offset,
> +                   unsigned int bytes, void *dest);
> +
>  /* sysfs stuff */
>  extern struct attribute_group cros_ec_attr_group;
>  extern struct attribute_group cros_ec_lightbar_attr_group;
> --
> 2.20.1
>

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

* Re: [PATCH v3] platform/chrome: Add cros_ec_readmem() helpers for I2C/SPI based ECs
  2019-01-21 17:32 ` Enric Balletbo Serra
@ 2019-01-21 18:40   ` Moritz Fischer
  2019-01-21 22:19     ` Enric Balletbo Serra
  0 siblings, 1 reply; 6+ messages in thread
From: Moritz Fischer @ 2019-01-21 18:40 UTC (permalink / raw)
  To: Enric Balletbo Serra
  Cc: Moritz Fischer, linux-kernel, Enric Balletbo i Serra,
	Benson Leung, Guenter Roeck, Lee Jones, moritz

Hi Enrico,

On Mon, Jan 21, 2019 at 06:32:48PM +0100, Enric Balletbo Serra wrote:
> Hi Moritz,
> 
> Missatge de Moritz Fischer <mdf@kernel.org> del dia dj., 10 de gen.
> 2019 a les 5:40:
> >
> > Add cros_ec_readmem() helpers for I2C/SPI based ECs.
> > Unlike the LPC based ECs the I2C/SPI based ones cannot just directly
> > read the mapped region, but have to resort to EC_CMD_READ_MEMMAP.
> >
> > This is useful for things like accessing fan speeds or temperatures.
> >
> > Signed-off-by: Moritz Fischer <mdf@kernel.org>
> > ---
> >
> > Hi all,
> >
> > This can be used for a hwmon or thermal driver such as [1], but also
> > alone can be used with 'ectool' via the ioctl() interface.
> >
> 
> ooi, did you try this with a Chromebook? Or only with your device?

Nope, mine has a dead battery (and no fans ... :-/) 
> 
> I was a bit worried on the side effects to expose this command to
> userspace, so I did a quick test, and to be honest I didn't like the
> result. Issuing the ioctl resulted on a reboot on the Chromebook I
> tested, which is not good. I didn't investigate more but I can say
> that this change, at least, will need some rework. I'll try to
> investigate a bit more on what is happening.

That sounds bad :-/

What chromebook did you run this on (so I can look at the EC code it is
running and figure out what's the difference). Maybe it has a different
configuration. It wasn't an x86 chromebook, right?

What was the ioctl you ran?

Thanks for testing,
Moritz

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

* Re: [PATCH v3] platform/chrome: Add cros_ec_readmem() helpers for I2C/SPI based ECs
  2019-01-21 18:40   ` Moritz Fischer
@ 2019-01-21 22:19     ` Enric Balletbo Serra
  2019-01-22 21:09       ` Moritz Fischer
  0 siblings, 1 reply; 6+ messages in thread
From: Enric Balletbo Serra @ 2019-01-21 22:19 UTC (permalink / raw)
  To: Moritz Fischer
  Cc: linux-kernel, Enric Balletbo i Serra, Benson Leung,
	Guenter Roeck, Lee Jones, Moritz Fischer

Hi Moritz,

Missatge de Moritz Fischer <mdf@kernel.org> del dia dl., 21 de gen.
2019 a les 19:40:
>
> Hi Enrico,
>
> On Mon, Jan 21, 2019 at 06:32:48PM +0100, Enric Balletbo Serra wrote:
> > Hi Moritz,
> >
> > Missatge de Moritz Fischer <mdf@kernel.org> del dia dj., 10 de gen.
> > 2019 a les 5:40:
> > >
> > > Add cros_ec_readmem() helpers for I2C/SPI based ECs.
> > > Unlike the LPC based ECs the I2C/SPI based ones cannot just directly
> > > read the mapped region, but have to resort to EC_CMD_READ_MEMMAP.
> > >
> > > This is useful for things like accessing fan speeds or temperatures.
> > >
> > > Signed-off-by: Moritz Fischer <mdf@kernel.org>
> > > ---
> > >
> > > Hi all,
> > >
> > > This can be used for a hwmon or thermal driver such as [1], but also
> > > alone can be used with 'ectool' via the ioctl() interface.
> > >
> >
> > ooi, did you try this with a Chromebook? Or only with your device?
>
> Nope, mine has a dead battery (and no fans ... :-/)
> >
> > I was a bit worried on the side effects to expose this command to
> > userspace, so I did a quick test, and to be honest I didn't like the
> > result. Issuing the ioctl resulted on a reboot on the Chromebook I
> > tested, which is not good. I didn't investigate more but I can say
> > that this change, at least, will need some rework. I'll try to
> > investigate a bit more on what is happening.
>
> That sounds bad :-/
>
> What chromebook did you run this on (so I can look at the EC code it is
> running and figure out what's the difference). Maybe it has a different
> configuration. It wasn't an x86 chromebook, right?
>

I tried with a Samsung Chromebook Plus (arm64 Chromebook)

> What was the ioctl you ran?
>

The code that I ran is this: https://hastebin.com/cupecuvowi.py
No guarantee :) I'll try to look deeper tomorrow.

Thanks,
  Enric

> Thanks for testing,
> Moritz

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

* Re: [PATCH v3] platform/chrome: Add cros_ec_readmem() helpers for I2C/SPI based ECs
  2019-01-21 22:19     ` Enric Balletbo Serra
@ 2019-01-22 21:09       ` Moritz Fischer
  2019-01-23 11:33         ` Enric Balletbo Serra
  0 siblings, 1 reply; 6+ messages in thread
From: Moritz Fischer @ 2019-01-22 21:09 UTC (permalink / raw)
  To: Enric Balletbo Serra
  Cc: Moritz Fischer, linux-kernel, Enric Balletbo i Serra,
	Benson Leung, Guenter Roeck, Lee Jones, Moritz Fischer

Hi Enrico,

On Mon, Jan 21, 2019 at 11:19:34PM +0100, Enric Balletbo Serra wrote:
> I tried with a Samsung Chromebook Plus (arm64 Chromebook)
> 
> > What was the ioctl you ran?
> >
> 
> The code that I ran is this: https://hastebin.com/cupecuvowi.py
> No guarantee :) I'll try to look deeper tomorrow.

I fixed it up to run with python3, but on my device I got either a
protocol error if len is > 120:

root@ni-n3xx-313ABDC:~# python3 foo
Testing EC_DEV_IOCRDMEM cmd
I/O error(71): Protocol error

or it worked for lengths <= 120:

root@ni-n3xx-313ABDC:~# python3 foo
Testing EC_DEV_IOCRDMEM cmd
6b 6f ff ff ff ff ff ff ff ff ff ff ff ff ff ff f0 0f f0 0f ff ff ff ff 
ff ff ff ff ff ff ff ff 45 43 01 02 00 01 01 00 00 00 00 00 00 00 00 00
05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[...]

Did you try smaller reads? If that works maybe we'll have to filter in
the kernel to prevent large reads from crashing the EC?

Thanks,

Moritz

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

* Re: [PATCH v3] platform/chrome: Add cros_ec_readmem() helpers for I2C/SPI based ECs
  2019-01-22 21:09       ` Moritz Fischer
@ 2019-01-23 11:33         ` Enric Balletbo Serra
  0 siblings, 0 replies; 6+ messages in thread
From: Enric Balletbo Serra @ 2019-01-23 11:33 UTC (permalink / raw)
  To: Moritz Fischer
  Cc: linux-kernel, Enric Balletbo i Serra, Benson Leung,
	Guenter Roeck, Lee Jones, Moritz Fischer

Missatge de Moritz Fischer <mdf@kernel.org> del dia dt., 22 de gen.
2019 a les 22:09:
>
> Hi Enrico,
>
> On Mon, Jan 21, 2019 at 11:19:34PM +0100, Enric Balletbo Serra wrote:
> > I tried with a Samsung Chromebook Plus (arm64 Chromebook)
> >
> > > What was the ioctl you ran?
> > >
> >
> > The code that I ran is this: https://hastebin.com/cupecuvowi.py
> > No guarantee :) I'll try to look deeper tomorrow.
>
> I fixed it up to run with python3, but on my device I got either a
> protocol error if len is > 120:
>
> root@ni-n3xx-313ABDC:~# python3 foo
> Testing EC_DEV_IOCRDMEM cmd
> I/O error(71): Protocol error
>
> or it worked for lengths <= 120:
>
> root@ni-n3xx-313ABDC:~# python3 foo
> Testing EC_DEV_IOCRDMEM cmd
> 6b 6f ff ff ff ff ff ff ff ff ff ff ff ff ff ff f0 0f f0 0f ff ff ff ff
> ff ff ff ff ff ff ff ff 45 43 01 02 00 01 01 00 00 00 00 00 00 00 00 00
> 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
> [...]
>
> Did you try smaller reads? If that works maybe we'll have to filter in
> the kernel to prevent large reads from crashing the EC?
>

So looks like I can read up to 161 bytes, if I read 162 to 169 bytes
the EC fails to respond and if I read more than 169 bytes it simply
resets the machine. I didn't look the code yet.

root@debian:~# python
/home/debian/Tests/cros_ec/scripts/cros-ec-readmem.py 160
Testing EC_DEV_IOCRDMEM cmd (size 160)
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 45 43 01 00 01 01 01 00 00 00 00 00 00 00
00 00
01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9f 21 00 00 0e 01 00
00 59 13 00 00 0b 00 00 00 14 14 00 00 b0 1d 00 00 9a 13 00 00 35 01
00 00
53 44 49 00 00 00 00 00 34 33 35 32 44 35 31 00 30 46 38 32 00 00 00
00 4c 49 4f 4e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

root@debian:~# python
/home/debian/Tests/cros_ec/scripts/cros-ec-readmem.py 161
Testing EC_DEV_IOCRDMEM cmd (size 161)
[  425.053205] cros-ec-spi spi2.0: cannot read mapped reg: -71/14
I/O error(71): Protocol error
root@debian:~# python
/home/debian/Tests/cros_ec/scripts/cros-ec-readmem.py 162
Testing EC_DEV_IOCRDMEM cmd (size 162)
[  427.208065] cros-ec-spi spi2.0: cannot read mapped reg: -71/14
I/O error(71): Protocol error

root@debian:~# python
/home/debian/Tests/cros_ec/scripts/cros-ec-readmem.py 163
Testing EC_DEV_IOCRDMEM cmd (size 163)
[  429.845069] cros-ec-spi spi2.0: cannot read mapped reg: -71/14
I/O error(71): Protocol error
root@debian:~# python
/home/debian/Tests/cros_ec/scripts/cros-ec-readmem.py 164
Testing EC_DEV_IOCRDMEM cmd (size 164)[  431.968014] cros-ec-spi
spi2.0: cannot read mapped reg: -71/14

I/O error(71): Protocol error

root@debian:~# python
/home/debian/Tests/cros_ec/scripts/cros-ec-readmem.py 165
Testing EC_DEV_IOCRDMEM cmd (size 165)
[  440.289340] cros-ec-spi spi2.0: EC failed to respond in time
[  440.296271] cros-ec-spi spi2.0: Command xfer error (err:-110)
[  440.302732] cros-ec-spi spi2.0: cannot read mapped reg: -110/0
I/O error(110): Connection timed out

root@debian:~# python
/home/debian/Tests/cros_ec/scripts/cros-ec-readmem.py 166
Testing EC_DEV_IOCRDMEM cmd (size 166)
[  443.953212] cros-ec-spi spi2.0: EC failed to respond in time
[  443.960095] cros-ec-spi spi2.0: Command xfer error (err:-110)
[  443.966554] cros-ec-spi spi2.0: cannot read mapped reg: -110/0
I/O error(110): Connection timed out

root@debian:~# python
/home/debian/Tests/cros_ec/scripts/cros-ec-readmem.py 167
Testing EC_DEV_IOCRDMEM cmd (size 167)
[  446.585416] cros-ec-spi spi2.0: EC failed to respond in time
[  446.592335] cros-ec-spi spi2.0: Command xfer error (err:-110)
[  446.598798] cros-ec-spi spi2.0: cannot read mapped reg: -110/0
I/O error(110): Connection timed out

root@debian:~# python /home/debian/Tests/cros_ec/scripts/cros-ec-readmem.py 168
Testing EC_DEV_IOCRDMEM cmd (size 168)
[  449.337255] cros-ec-spi spi2.0: EC failed to respond in time
[  449.344140] cros-ec-spi spi2.0: Command xfer error (err:-110)
[  449.350588] cros-ec-spi spi2.0: cannot read mapped reg: -110/0
I/O error(110): Connection timed out

root@debian:~# python /home/debian/Tests/cros_ec/scripts/cros-ec-readmem.py 169
Testing EC_DEV_IOCRDMEM cmd (size 169)
l%(NAPEK@       @%vZ__|+~/g?sڬ}mj}u??UwWo;_ۻI6go{]uw]{m}w.ͼ�ߵ

And the machine reboots ...


> Thanks,
>
> Moritz

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

end of thread, other threads:[~2019-01-23 11:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-10  4:36 [PATCH v3] platform/chrome: Add cros_ec_readmem() helpers for I2C/SPI based ECs Moritz Fischer
2019-01-21 17:32 ` Enric Balletbo Serra
2019-01-21 18:40   ` Moritz Fischer
2019-01-21 22:19     ` Enric Balletbo Serra
2019-01-22 21:09       ` Moritz Fischer
2019-01-23 11:33         ` Enric Balletbo Serra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).