From: Guenter Roeck <linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
To: Jean Delvare <jdelvare-l3A5Bk7waGM@public.gmane.org>
Cc: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>,
Randy Dunlap <rdunlap-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2] i2c: stub: Add support for SMBus block commands
Date: Sun, 13 Jul 2014 08:46:41 -0700 [thread overview]
Message-ID: <53C2A9E1.2080807@roeck-us.net> (raw)
In-Reply-To: <20140713171343.0a4ba58d-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
On 07/13/2014 08:13 AM, Jean Delvare wrote:
> On Sun, 13 Jul 2014 08:04:54 -0700, Guenter Roeck wrote:
>> On 07/13/2014 12:21 AM, Jean Delvare wrote:
>>> Hi Guenter,
>>>
>>> On Sat, 12 Jul 2014 08:05:49 -0700, Guenter Roeck wrote:
>>>> Any idea how we could inject errors ? Error path testing would be quite useful.
>>>
>>> Good idea. This should probably be done with a sysfs attribute so that
>>> it can be turned on and off as desired. Off by default, of course. Some
>>> other subsystems already support error injection, you could check how
>>> they are doing it, do that we do not diverge needlessly.
>>>
>>> Do you think there is any value in failing with different error codes,
>>> or just -EIO is enough?
>>
>> How about writing the error code to return into the attribute ?
>> Write anything negative, and it is returned as error. Write 0,
>> and the driver works as normal.
>
> This is smart, I like it :)
>
>>> Do you think it should fail all the time when error injection is
>>> enabled, or is there a value in having only a certain % of commands
>>> fail?
>>
>> For my purposes I would want it to fail reliably. We could add some fanciness,
>> though: Provide a second attribute which specifies how many operations should
>> pass before the first failure.
>
> Let's start simple and just implement what you need.
>
I would actually benefit from both. The ability to return an error unconditionally
lets me test the first error path. The ability to return an error starting with the
n-th transfer lets me test the n-th error path.
Guenter
WARNING: multiple messages have this Message-ID (diff)
From: Guenter Roeck <linux@roeck-us.net>
To: Jean Delvare <jdelvare@suse.de>
Cc: Wolfram Sang <wsa@the-dreams.de>,
Randy Dunlap <rdunlap@infradead.org>,
linux-i2c@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] i2c: stub: Add support for SMBus block commands
Date: Sun, 13 Jul 2014 08:46:41 -0700 [thread overview]
Message-ID: <53C2A9E1.2080807@roeck-us.net> (raw)
In-Reply-To: <20140713171343.0a4ba58d@endymion.delvare>
On 07/13/2014 08:13 AM, Jean Delvare wrote:
> On Sun, 13 Jul 2014 08:04:54 -0700, Guenter Roeck wrote:
>> On 07/13/2014 12:21 AM, Jean Delvare wrote:
>>> Hi Guenter,
>>>
>>> On Sat, 12 Jul 2014 08:05:49 -0700, Guenter Roeck wrote:
>>>> Any idea how we could inject errors ? Error path testing would be quite useful.
>>>
>>> Good idea. This should probably be done with a sysfs attribute so that
>>> it can be turned on and off as desired. Off by default, of course. Some
>>> other subsystems already support error injection, you could check how
>>> they are doing it, do that we do not diverge needlessly.
>>>
>>> Do you think there is any value in failing with different error codes,
>>> or just -EIO is enough?
>>
>> How about writing the error code to return into the attribute ?
>> Write anything negative, and it is returned as error. Write 0,
>> and the driver works as normal.
>
> This is smart, I like it :)
>
>>> Do you think it should fail all the time when error injection is
>>> enabled, or is there a value in having only a certain % of commands
>>> fail?
>>
>> For my purposes I would want it to fail reliably. We could add some fanciness,
>> though: Provide a second attribute which specifies how many operations should
>> pass before the first failure.
>
> Let's start simple and just implement what you need.
>
I would actually benefit from both. The ability to return an error unconditionally
lets me test the first error path. The ability to return an error starting with the
n-th transfer lets me test the n-th error path.
Guenter
next prev parent reply other threads:[~2014-07-13 15:46 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-07 14:23 [PATCH v2] i2c: stub: Add support for SMBus block commands Guenter Roeck
2014-07-07 14:23 ` Guenter Roeck
2014-07-08 19:54 ` Jean Delvare
[not found] ` <20140708215453.0677d3ed-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2014-07-08 20:05 ` Guenter Roeck
2014-07-08 20:05 ` Guenter Roeck
2014-07-12 9:20 ` Jean Delvare
[not found] ` <20140712112019.618d8a03-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2014-07-12 14:26 ` Guenter Roeck
2014-07-12 14:26 ` Guenter Roeck
2014-07-12 15:05 ` Guenter Roeck
2014-07-12 15:05 ` Guenter Roeck
2014-07-13 7:21 ` Jean Delvare
2014-07-13 15:04 ` Guenter Roeck
2014-07-13 15:13 ` Jean Delvare
[not found] ` <20140713171343.0a4ba58d-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2014-07-13 15:46 ` Guenter Roeck [this message]
2014-07-13 15:46 ` Guenter Roeck
[not found] ` <53C2A9E1.2080807-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2014-07-13 18:29 ` Sanford Rockowitz
2014-07-13 18:29 ` Sanford Rockowitz
2014-07-17 13:21 ` Wolfram Sang
2014-07-17 13:40 ` Jean Delvare
[not found] ` <20140717154020.650ad59c-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2014-07-17 16:56 ` [PATCH v3] " Guenter Roeck
2014-07-17 16:56 ` Guenter Roeck
2014-07-17 17:12 ` Wolfram Sang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53C2A9E1.2080807@roeck-us.net \
--to=linux-0h96xk9xttrk1umjsbkqmq@public.gmane.org \
--cc=jdelvare-l3A5Bk7waGM@public.gmane.org \
--cc=linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=rdunlap-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
--cc=wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.