Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1459856 > unrolled thread

[RESEND PATCH 0/2] cros_ec: utilize cros_ec_cmd_xfer_status()

Started byBrian Norris <briannorris@chromium.org>
First post2016-08-10 22:40 +0200
Last post2016-08-10 23:20 +0200
Articles 6 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [RESEND PATCH 0/2] cros_ec: utilize cros_ec_cmd_xfer_status() Brian Norris <briannorris@chromium.org> - 2016-08-10 22:40 +0200
    [RESEND PATCH 1/2] i2c: cros-ec-tunnel: Fix usage of cros_ec_cmd_xfer() Brian Norris <briannorris@chromium.org> - 2016-08-10 22:40 +0200
      Re: [RESEND PATCH 1/2] i2c: cros-ec-tunnel: Fix usage of  cros_ec_cmd_xfer() Guenter Roeck <linux@roeck-us.net> - 2016-08-10 23:20 +0200
      Re: [RESEND PATCH 1/2] i2c: cros-ec-tunnel: Fix usage of  cros_ec_cmd_xfer() Wolfram Sang <wsa@the-dreams.de> - 2016-08-15 00:30 +0200
    [RESEND PATCH 2/2] Input: cros_ec_keyb - Fix usage of cros_ec_cmd_xfer() Brian Norris <briannorris@chromium.org> - 2016-08-10 22:40 +0200
      Re: [RESEND PATCH 2/2] Input: cros_ec_keyb - Fix usage of  cros_ec_cmd_xfer() Guenter Roeck <linux@roeck-us.net> - 2016-08-10 23:20 +0200

#1459856 — [RESEND PATCH 0/2] cros_ec: utilize cros_ec_cmd_xfer_status()

FromBrian Norris <briannorris@chromium.org>
Date2016-08-10 22:40 +0200
Subject[RESEND PATCH 0/2] cros_ec: utilize cros_ec_cmd_xfer_status()
Message-ID<s4Isa-1A3-23@gated-at.bofh.it>
Hi all,

This is a resend of some patches I sent previously:

https://lkml.org/lkml/2016/7/25/488

There are no changes to the patch content. Only some additional commit
description and tagging.

The cros_ec_cmd_xfer_status() helper (which helps us better handle some error
scenarios) is now present in v4.8-rc1.

These can be taken independently by their subsystem maintainers. (Wolfram and
Dmitry, who already acked them.)

Regards,
Brian

Brian Norris (2):
  i2c: cros-ec-tunnel: Fix usage of cros_ec_cmd_xfer()
  Input: cros_ec_keyb - Fix usage of cros_ec_cmd_xfer()

 drivers/i2c/busses/i2c-cros-ec-tunnel.c | 2 +-
 drivers/input/keyboard/cros_ec_keyb.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
2.8.0.rc3.226.g39d4020

[toc] | [next] | [standalone]


#1459872 — [RESEND PATCH 1/2] i2c: cros-ec-tunnel: Fix usage of cros_ec_cmd_xfer()

FromBrian Norris <briannorris@chromium.org>
Date2016-08-10 22:40 +0200
Subject[RESEND PATCH 1/2] i2c: cros-ec-tunnel: Fix usage of cros_ec_cmd_xfer()
Message-ID<s4Isb-1A3-55@gated-at.bofh.it>
In reply to#1459856
cros_ec_cmd_xfer returns success status if the command transport
completes successfully, but the execution result is incorrectly ignored.
In many cases, the execution result is assumed to be successful, leading
to ignored errors and operating on uninitialized data.

We've recently introduced the cros_ec_cmd_xfer_status() helper to avoid these
problems. Let's use it.

[Regarding the 'Fixes' tag; there is significant refactoring since the driver's
introduction, but the underlying logical error exists throughout I believe]

Fixes: 9d230c9e4f4e ("i2c: ChromeOS EC tunnel driver")
Cc: <stable@vger.kernel.org> # 9798ac6d32c1 mfd: cros_ec: Add cros_ec_cmd_xfer_status() helper
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Wolfram Sang <wsa@the-dreams.de>
---
 drivers/i2c/busses/i2c-cros-ec-tunnel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-cros-ec-tunnel.c b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
index a0d95ff682ae..2d5ff86398d0 100644
--- a/drivers/i2c/busses/i2c-cros-ec-tunnel.c
+++ b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
@@ -215,7 +215,7 @@ static int ec_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg i2c_msgs[],
 	msg->outsize = request_len;
 	msg->insize = response_len;
 
-	result = cros_ec_cmd_xfer(bus->ec, msg);
+	result = cros_ec_cmd_xfer_status(bus->ec, msg);
 	if (result < 0) {
 		dev_err(dev, "Error transferring EC i2c message %d\n", result);
 		goto exit;
-- 
2.8.0.rc3.226.g39d4020

[toc] | [prev] | [next] | [standalone]


#1459966 — Re: [RESEND PATCH 1/2] i2c: cros-ec-tunnel: Fix usage of cros_ec_cmd_xfer()

FromGuenter Roeck <linux@roeck-us.net>
Date2016-08-10 23:20 +0200
SubjectRe: [RESEND PATCH 1/2] i2c: cros-ec-tunnel: Fix usage of cros_ec_cmd_xfer()
Message-ID<s4J4S-259-49@gated-at.bofh.it>
In reply to#1459872
On Wed, Aug 10, 2016 at 01:37:18PM -0700, Brian Norris wrote:
> cros_ec_cmd_xfer returns success status if the command transport
> completes successfully, but the execution result is incorrectly ignored.
> In many cases, the execution result is assumed to be successful, leading
> to ignored errors and operating on uninitialized data.
> 
> We've recently introduced the cros_ec_cmd_xfer_status() helper to avoid these
> problems. Let's use it.
> 
> [Regarding the 'Fixes' tag; there is significant refactoring since the driver's
> introduction, but the underlying logical error exists throughout I believe]
> 
> Fixes: 9d230c9e4f4e ("i2c: ChromeOS EC tunnel driver")
> Cc: <stable@vger.kernel.org> # 9798ac6d32c1 mfd: cros_ec: Add cros_ec_cmd_xfer_status() helper
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
> Acked-by: Wolfram Sang <wsa@the-dreams.de>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/i2c/busses/i2c-cros-ec-tunnel.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-cros-ec-tunnel.c b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
> index a0d95ff682ae..2d5ff86398d0 100644
> --- a/drivers/i2c/busses/i2c-cros-ec-tunnel.c
> +++ b/drivers/i2c/busses/i2c-cros-ec-tunnel.c
> @@ -215,7 +215,7 @@ static int ec_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg i2c_msgs[],
>  	msg->outsize = request_len;
>  	msg->insize = response_len;
>  
> -	result = cros_ec_cmd_xfer(bus->ec, msg);
> +	result = cros_ec_cmd_xfer_status(bus->ec, msg);
>  	if (result < 0) {
>  		dev_err(dev, "Error transferring EC i2c message %d\n", result);
>  		goto exit;
> -- 
> 2.8.0.rc3.226.g39d4020
> 

[toc] | [prev] | [next] | [standalone]


#1462497 — Re: [RESEND PATCH 1/2] i2c: cros-ec-tunnel: Fix usage of cros_ec_cmd_xfer()

FromWolfram Sang <wsa@the-dreams.de>
Date2016-08-15 00:30 +0200
SubjectRe: [RESEND PATCH 1/2] i2c: cros-ec-tunnel: Fix usage of cros_ec_cmd_xfer()
Message-ID<s6c4O-5Fm-7@gated-at.bofh.it>
In reply to#1459872

[Multipart message — attachments visible in raw view] — view raw

On Wed, Aug 10, 2016 at 01:37:18PM -0700, Brian Norris wrote:
> cros_ec_cmd_xfer returns success status if the command transport
> completes successfully, but the execution result is incorrectly ignored.
> In many cases, the execution result is assumed to be successful, leading
> to ignored errors and operating on uninitialized data.
> 
> We've recently introduced the cros_ec_cmd_xfer_status() helper to avoid these
> problems. Let's use it.
> 
> [Regarding the 'Fixes' tag; there is significant refactoring since the driver's
> introduction, but the underlying logical error exists throughout I believe]
> 
> Fixes: 9d230c9e4f4e ("i2c: ChromeOS EC tunnel driver")
> Cc: <stable@vger.kernel.org> # 9798ac6d32c1 mfd: cros_ec: Add cros_ec_cmd_xfer_status() helper
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
> Acked-by: Wolfram Sang <wsa@the-dreams.de>

Applied to for-current, thanks!

[toc] | [prev] | [next] | [standalone]


#1459874 — [RESEND PATCH 2/2] Input: cros_ec_keyb - Fix usage of cros_ec_cmd_xfer()

FromBrian Norris <briannorris@chromium.org>
Date2016-08-10 22:40 +0200
Subject[RESEND PATCH 2/2] Input: cros_ec_keyb - Fix usage of cros_ec_cmd_xfer()
Message-ID<s4Isb-1A3-59@gated-at.bofh.it>
In reply to#1459856
cros_ec_cmd_xfer returns success status if the command transport
completes successfully, but the execution result is incorrectly ignored.
In many cases, the execution result is assumed to be successful, leading
to ignored errors and operating on uninitialized data.

We've recently introduced the cros_ec_cmd_xfer_status() helper to avoid these
problems. Let's use it.

[Regarding the 'Fixes' tag; there is significant refactoring since the driver's
introduction, but the underlying logical error exists throughout I believe]

Fixes: 6af6dc2d2aa6 ("input: Add ChromeOS EC keyboard driver")
Cc: <stable@vger.kernel.org> # 9798ac6d32c1 mfd: cros_ec: Add cros_ec_cmd_xfer_status() helper
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/keyboard/cros_ec_keyb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
index b01966dc7eb3..6e48616a3a88 100644
--- a/drivers/input/keyboard/cros_ec_keyb.c
+++ b/drivers/input/keyboard/cros_ec_keyb.c
@@ -160,7 +160,7 @@ static int cros_ec_keyb_get_state(struct cros_ec_keyb *ckdev, uint8_t *kb_state)
 	msg->insize = ckdev->cols;
 	msg->outsize = 0;
 
-	ret = cros_ec_cmd_xfer(ckdev->ec, msg);
+	ret = cros_ec_cmd_xfer_status(ckdev->ec, msg);
 	if (ret < 0) {
 		dev_err(ckdev->dev, "Error transferring EC message %d\n", ret);
 		goto exit;
-- 
2.8.0.rc3.226.g39d4020

[toc] | [prev] | [next] | [standalone]


#1459965 — Re: [RESEND PATCH 2/2] Input: cros_ec_keyb - Fix usage of cros_ec_cmd_xfer()

FromGuenter Roeck <linux@roeck-us.net>
Date2016-08-10 23:20 +0200
SubjectRe: [RESEND PATCH 2/2] Input: cros_ec_keyb - Fix usage of cros_ec_cmd_xfer()
Message-ID<s4J4S-259-47@gated-at.bofh.it>
In reply to#1459874
On Wed, Aug 10, 2016 at 01:37:19PM -0700, Brian Norris wrote:
> cros_ec_cmd_xfer returns success status if the command transport
> completes successfully, but the execution result is incorrectly ignored.
> In many cases, the execution result is assumed to be successful, leading
> to ignored errors and operating on uninitialized data.
> 
> We've recently introduced the cros_ec_cmd_xfer_status() helper to avoid these
> problems. Let's use it.
> 
> [Regarding the 'Fixes' tag; there is significant refactoring since the driver's
> introduction, but the underlying logical error exists throughout I believe]
> 
> Fixes: 6af6dc2d2aa6 ("input: Add ChromeOS EC keyboard driver")
> Cc: <stable@vger.kernel.org> # 9798ac6d32c1 mfd: cros_ec: Add cros_ec_cmd_xfer_status() helper
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/input/keyboard/cros_ec_keyb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c
> index b01966dc7eb3..6e48616a3a88 100644
> --- a/drivers/input/keyboard/cros_ec_keyb.c
> +++ b/drivers/input/keyboard/cros_ec_keyb.c
> @@ -160,7 +160,7 @@ static int cros_ec_keyb_get_state(struct cros_ec_keyb *ckdev, uint8_t *kb_state)
>  	msg->insize = ckdev->cols;
>  	msg->outsize = 0;
>  
> -	ret = cros_ec_cmd_xfer(ckdev->ec, msg);
> +	ret = cros_ec_cmd_xfer_status(ckdev->ec, msg);
>  	if (ret < 0) {
>  		dev_err(ckdev->dev, "Error transferring EC message %d\n", ret);
>  		goto exit;
> -- 
> 2.8.0.rc3.226.g39d4020
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web