lkml.org 
[lkml]   [2014]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] i2c: stub: Add support for SMBus block commands
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.

> 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.

Thanks,
Guenter



\
 
 \ /
  Last update: 2014-07-13 17:41    [W:0.230 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site