mbox series

[v3,0/4] i2c: designware: add i2c gpio recovery option

Message ID 1504073857-122449-1-git-send-email-preid@electromag.com.au
Headers show
Series i2c: designware: add i2c gpio recovery option | expand

Message

Phil Reid Aug. 30, 2017, 6:17 a.m. UTC
Changes from V1:
- In review Andy suggested change the i2c core to use the gpiod
  I've added a patch that allows the gradual switching of drivers 
  to using gpiod interface. The old interface is preserved so
  that changes can be made incrementally.
- I've update Tim's patch for the designware driver to use the new
  interface. Tweaked a couple of things to his patch and fixed
  up things Andy id in last review. 
  The core changes in p1 don't require the get/set scl/sda functions.
  Hopefully I've done the right thing with preserving authorship and
  signoff.

Changes from V2:
- Rebase on https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git/
  i2c/for-next
  No intentional changes, but needed to move i2c_dw_plat_prepare_clk to common
  for the master recovery functions to use. which is included as two additional
  patches.


Phil Reid (4):
  i2c: Switch to using gpiod interface for gpio bus recovery
  i2c: designware: move i2c_dw_plat_prepare_clk to common
  i2c: designware: rename i2c_dw_plat_prepare_clk to i2c_dw_prepare_clk

Tim Sander (1):
  i2c: designware: add i2c gpio recovery option

 drivers/i2c/busses/i2c-designware-common.c  | 24 ++++++++++--
 drivers/i2c/busses/i2c-designware-core.h    |  2 +
 drivers/i2c/busses/i2c-designware-master.c  | 57 +++++++++++++++++++++++++++++
 drivers/i2c/busses/i2c-designware-platdrv.c | 18 ++-------
 drivers/i2c/i2c-core-base.c                 | 22 +++++++++--
 include/linux/i2c.h                         |  2 +
 6 files changed, 103 insertions(+), 22 deletions(-)

Comments

Phil Reid Sept. 28, 2017, 7:37 a.m. UTC | #1
On 30/08/2017 14:17, Phil Reid wrote:
> Changes from V1:
> - In review Andy suggested change the i2c core to use the gpiod
>    I've added a patch that allows the gradual switching of drivers
>    to using gpiod interface. The old interface is preserved so
>    that changes can be made incrementally.
> - I've update Tim's patch for the designware driver to use the new
>    interface. Tweaked a couple of things to his patch and fixed
>    up things Andy id in last review.
>    The core changes in p1 don't require the get/set scl/sda functions.
>    Hopefully I've done the right thing with preserving authorship and
>    signoff.
> 
> Changes from V2:
> - Rebase on https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git/
>    i2c/for-next
>    No intentional changes, but needed to move i2c_dw_plat_prepare_clk to common
>    for the master recovery functions to use. which is included as two additional
>    patches.
> 
> 
> Phil Reid (4):
>    i2c: Switch to using gpiod interface for gpio bus recovery
>    i2c: designware: move i2c_dw_plat_prepare_clk to common
>    i2c: designware: rename i2c_dw_plat_prepare_clk to i2c_dw_prepare_clk
> 
> Tim Sander (1):
>    i2c: designware: add i2c gpio recovery option
> 
>   drivers/i2c/busses/i2c-designware-common.c  | 24 ++++++++++--
>   drivers/i2c/busses/i2c-designware-core.h    |  2 +
>   drivers/i2c/busses/i2c-designware-master.c  | 57 +++++++++++++++++++++++++++++
>   drivers/i2c/busses/i2c-designware-platdrv.c | 18 ++-------
>   drivers/i2c/i2c-core-base.c                 | 22 +++++++++--
>   include/linux/i2c.h                         |  2 +
>   6 files changed, 103 insertions(+), 22 deletions(-)
> 

Any comments on this series?
Jarkko Nikula Sept. 28, 2017, 9:55 a.m. UTC | #2
On 09/28/2017 10:37 AM, Phil Reid wrote:
> On 30/08/2017 14:17, Phil Reid wrote:
>> Changes from V1:
>> - In review Andy suggested change the i2c core to use the gpiod
>>    I've added a patch that allows the gradual switching of drivers
>>    to using gpiod interface. The old interface is preserved so
>>    that changes can be made incrementally.
>> - I've update Tim's patch for the designware driver to use the new
>>    interface. Tweaked a couple of things to his patch and fixed
>>    up things Andy id in last review.
>>    The core changes in p1 don't require the get/set scl/sda functions.
>>    Hopefully I've done the right thing with preserving authorship and
>>    signoff.
>>
>> Changes from V2:
>> - Rebase on 
>> https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git/
>>    i2c/for-next
>>    No intentional changes, but needed to move i2c_dw_plat_prepare_clk 
>> to common
>>    for the master recovery functions to use. which is included as two 
>> additional
>>    patches.
>>
>>
>> Phil Reid (4):
>>    i2c: Switch to using gpiod interface for gpio bus recovery
>>    i2c: designware: move i2c_dw_plat_prepare_clk to common
>>    i2c: designware: rename i2c_dw_plat_prepare_clk to i2c_dw_prepare_clk
>>
>> Tim Sander (1):
>>    i2c: designware: add i2c gpio recovery option
>>
>>   drivers/i2c/busses/i2c-designware-common.c  | 24 ++++++++++--
>>   drivers/i2c/busses/i2c-designware-core.h    |  2 +
>>   drivers/i2c/busses/i2c-designware-master.c  | 57 
>> +++++++++++++++++++++++++++++
>>   drivers/i2c/busses/i2c-designware-platdrv.c | 18 ++-------
>>   drivers/i2c/i2c-core-base.c                 | 22 +++++++++--
>>   include/linux/i2c.h                         |  2 +
>>   6 files changed, 103 insertions(+), 22 deletions(-)
>>
> 
> Any comments on this series?
> 
Thanks for reminder. This got buried under other activity... 
i2c-designware changes look ok at quick look.
Andy Shevchenko Sept. 28, 2017, 10:55 a.m. UTC | #3
On Thu, 2017-09-28 at 15:37 +0800, Phil Reid wrote:
> On 30/08/2017 14:17, Phil Reid wrote:
> > Changes from V1:
> > - In review Andy suggested change the i2c core to use the gpiod
> >    I've added a patch that allows the gradual switching of drivers
> >    to using gpiod interface. The old interface is preserved so
> >    that changes can be made incrementally.
> > - I've update Tim's patch for the designware driver to use the new
> >    interface. Tweaked a couple of things to his patch and fixed
> >    up things Andy id in last review.
> >    The core changes in p1 don't require the get/set scl/sda
> > functions.
> >    Hopefully I've done the right thing with preserving authorship
> > and
> >    signoff.

+Cc: Ferry.

Ferry, I think you might be interested in this series.
If so, perhaps Phil can include you in Cc for v4 of it.

> > 
> > Changes from V2:
> > - Rebase on https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linu
> > x.git/
> >    i2c/for-next
> >    No intentional changes, but needed to move
> > i2c_dw_plat_prepare_clk to common
> >    for the master recovery functions to use. which is included as
> > two additional
> >    patches.
> > 
> > 
> > Phil Reid (4):
> >    i2c: Switch to using gpiod interface for gpio bus recovery
> >    i2c: designware: move i2c_dw_plat_prepare_clk to common
> >    i2c: designware: rename i2c_dw_plat_prepare_clk to
> > i2c_dw_prepare_clk
> > 
> > Tim Sander (1):
> >    i2c: designware: add i2c gpio recovery option
> > 
> >   drivers/i2c/busses/i2c-designware-common.c  | 24 ++++++++++--
> >   drivers/i2c/busses/i2c-designware-core.h    |  2 +
> >   drivers/i2c/busses/i2c-designware-master.c  | 57
> > +++++++++++++++++++++++++++++
> >   drivers/i2c/busses/i2c-designware-platdrv.c | 18 ++-------
> >   drivers/i2c/i2c-core-base.c                 | 22 +++++++++--
> >   include/linux/i2c.h                         |  2 +
> >   6 files changed, 103 insertions(+), 22 deletions(-)
> > 
> 
> Any comments on this series?
>
Ferry Toth Oct. 4, 2017, 9:41 a.m. UTC | #4
Andy Shevchenko schreef op do 28-09-2017 om 13:55 [+0300]:
> On Thu, 2017-09-28 at 15:37 +0800, Phil Reid wrote:
> > On 30/08/2017 14:17, Phil Reid wrote:
> > > Changes from V1:
> > > - In review Andy suggested change the i2c core to use the gpiod
> > >    I've added a patch that allows the gradual switching of
> > > drivers
> > >    to using gpiod interface. The old interface is preserved so
> > >    that changes can be made incrementally.
> > > - I've update Tim's patch for the designware driver to use the
> > > new
> > >    interface. Tweaked a couple of things to his patch and fixed
> > >    up things Andy id in last review.
> > >    The core changes in p1 don't require the get/set scl/sda
> > > functions.
> > >    Hopefully I've done the right thing with preserving authorship
> > > and
> > >    signoff.
> 
> +Cc: Ferry.
> 
> Ferry, I think you might be interested in this series.
> If so, perhaps Phil can include you in Cc for v4 of it.

Thanks. I am interested in this, though I may be experiencing a
somewhat different issue.

I my case (Intel Edison on Arduino expansion board) there are 4 MUX
attached to the same i2c bus. On warm boot sometimes the first device
is not detected (as shown by i2c-detect). The 2nd - 4th devices are
detected fine.

It would seem that initially the bus is stuck accessing the first
device and recovers after this. But this is probably not the case, as
on successive warm reboots, the same first device remains undetected.

A cold boot fixes this.

To me that looks like the bus is not stuck, but the particular slave is
in the wrong state. 

I have not yet been able to figure out if this patch series only resets
a device when it holds the bus, or if it also resets a device that
doesn't respond or responds with garbled data, but I will look into it.

Up to now I have not found a reliable way to trigger the situation,
other than noting it seems to happen mostly after a kernel or u-boot
reflash. 

> > > 
> > > Changes from V2:
> > > - Rebase on https://git.kernel.org/pub/scm/linux/kernel/git/wsa/l
> > > inu
> > > x.git/
> > >    i2c/for-next
> > >    No intentional changes, but needed to move
> > > i2c_dw_plat_prepare_clk to common
> > >    for the master recovery functions to use. which is included as
> > > two additional
> > >    patches.
> > > 
> > > 
> > > Phil Reid (4):
> > >    i2c: Switch to using gpiod interface for gpio bus recovery
> > >    i2c: designware: move i2c_dw_plat_prepare_clk to common
> > >    i2c: designware: rename i2c_dw_plat_prepare_clk to
> > > i2c_dw_prepare_clk
> > > 
> > > Tim Sander (1):
> > >    i2c: designware: add i2c gpio recovery option
> > > 
> > >   drivers/i2c/busses/i2c-designware-common.c  | 24 ++++++++++--
> > >   drivers/i2c/busses/i2c-designware-core.h    |  2 +
> > >   drivers/i2c/busses/i2c-designware-master.c  | 57
> > > +++++++++++++++++++++++++++++
> > >   drivers/i2c/busses/i2c-designware-platdrv.c | 18 ++-------
> > >   drivers/i2c/i2c-core-base.c                 | 22 +++++++++--
> > >   include/linux/i2c.h                         |  2 +
> > >   6 files changed, 103 insertions(+), 22 deletions(-)
> > > 
> > 
> > Any comments on this series?
> > 
> 
>