Re: [RFC PATCH] i2c: gpio: fault-injector: add 'lose_arbitration' injector

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Wolfram,

On Mon, Feb 11, 2019 at 9:59 PM Wolfram Sang <wsa@xxxxxxxxxxxxx> wrote:
> On Mon, Feb 11, 2019 at 11:30:56AM +0100, Geert Uytterhoeven wrote:
> > On Mon, Jan 21, 2019 at 3:29 PM Wolfram Sang
> > <wsa+renesas@xxxxxxxxxxxxxxxxxxxx> wrote:
> > > Here is a fault injector simulating 'arbitration lost' from multi-master
> > > setups. Read the docs for its usage.

> > > +       struct i2c_gpio_private_data *priv = dev_id;
> > > +
> > > +       setsda(&priv->bit_data, 0);
> > > +       udelay(200);
> >
> > Please add a #define for this value.
>
> Sure thing, this was a typical RFC marker :) It is now calculated based
> on bit_data.udelay and has a comment.

But that value bears no direct relation to the transfer speed as used by the
master to interfere with, right?
Still, you have to guess anyway.

> > > +DEFINE_DEBUGFS_ATTRIBUTE(fops_lose_arbitration, NULL, fops_lose_arbitration_set, "%llu\n");
> >
> > I think you can drop the format if you don't provide a "get" method.
> > Or just implement the "get" method, too ;-)
>
> Any pointer for that information? I seem to recall that the format
> string is also used to parse the user string to the set function. I
> sadly can't find that documented, but all the helper macros in
> fs/debugfs/file.c have a format string, too, even if WO.

fs/libfs.c:struct simple_attr {

        const char *fmt;        /* format for read operation */

It's being parsed using simple_strtoll(), so it takes whatever format is being
passed by the writer.

Perhaps you were confused by the term "read", which is from the point of
view of userspace, not of the driver.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux