linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Reset implementation for Zynq
       [not found] <20161021030847.6b4c15d01df5508dab02973c2a5944d9.645b3cfd21.mailapi@email21.godaddy.com>
@ 2016-10-21 17:04 ` Moritz Fischer
  2016-10-24  9:00   ` Philipp Zabel
  2016-11-08  6:34   ` Shubhrajyoti Datta
  0 siblings, 2 replies; 5+ messages in thread
From: Moritz Fischer @ 2016-10-21 17:04 UTC (permalink / raw)
  To: iztok.jeras; +Cc: p.zabel, linux-kernel

Iztok,

On Fri, Oct 21, 2016 at 03:08:47AM -0700, iztok.jeras@redpitaya.com wrote:
> Hi Moritz,
>  
> I was looking at your reset implementation for Zynq:
> https://github.com/Xilinx/linux-xlnx/blob/629041605b93343ad2e8971ceaac3edcef0b043b/drivers/reset/reset-zynq.c
> I went through related mailing list posts (including earlier versions of the patch) so I kind of understand what to change in the device tree.

Please look at the upstream kernel sources and use the mailing list
(lkml) if you want to report bugs. Xilinx' vendor tree might or might
not be up to date.

> I would like to use this driver to reset the Zynq I2C controller, since we have trouble with it getting into a lock up state.
> I plan to use function device_reset_optional() from:
> https://github.com/Xilinx/linux-xlnx/blob/629041605b93343ad2e8971ceaac3edcef0b043b/include/linux/reset.h
>  
> But this function is calling the reset function pointer from the reset_control_ops structure.
> For the zynq driver this function pointer is not defined, only assert, deassert and status are.
>  
> Is this a missing implementation, or is there a default implementation (I did not find one) which which performs an assert+deassert,
> or is there another set of reset APIs I should use inside the kernel.

You could just call reset_control_assert() and reset_control_deassert().
You're right there is currently no implementation for the 'reset' function for
zynq (and most of the other SoCs). I'll need to see if it makes sense at
all.

Please note that you'd probably have to modify the i2c driver to
integrate reset functionality cleanly.

Thanks,

Moritz

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Reset implementation for Zynq
  2016-10-21 17:04 ` Reset implementation for Zynq Moritz Fischer
@ 2016-10-24  9:00   ` Philipp Zabel
  2016-10-24 17:03     ` Moritz Fischer
  2016-11-08  6:34   ` Shubhrajyoti Datta
  1 sibling, 1 reply; 5+ messages in thread
From: Philipp Zabel @ 2016-10-24  9:00 UTC (permalink / raw)
  To: Moritz Fischer; +Cc: iztok.jeras, linux-kernel

Hi Iztok, Moritz,

Am Freitag, den 21.10.2016, 10:04 -0700 schrieb Moritz Fischer:
> Iztok,
> 
> On Fri, Oct 21, 2016 at 03:08:47AM -0700, iztok.jeras@redpitaya.com wrote:
> > Hi Moritz,
> >  
> > I was looking at your reset implementation for Zynq:
> > https://github.com/Xilinx/linux-xlnx/blob/629041605b93343ad2e8971ceaac3edcef0b043b/drivers/reset/reset-zynq.c
> > I went through related mailing list posts (including earlier versions of the patch) so I kind of understand what to change in the device tree.
> 
> Please look at the upstream kernel sources and use the mailing list
> (lkml) if you want to report bugs. Xilinx' vendor tree might or might
> not be up to date.
> 
> > I would like to use this driver to reset the Zynq I2C controller, since we have trouble with it getting into a lock up state.
> > I plan to use function device_reset_optional() from:
> > https://github.com/Xilinx/linux-xlnx/blob/629041605b93343ad2e8971ceaac3edcef0b043b/include/linux/reset.h
> >  
> > But this function is calling the reset function pointer from the reset_control_ops structure.
> > For the zynq driver this function pointer is not defined, only assert, deassert and status are.
> >  
> > Is this a missing implementation, or is there a default implementation (I did not find one) which which performs an assert+deassert,
> > or is there another set of reset APIs I should use inside the kernel.
> 
> You could just call reset_control_assert() and reset_control_deassert().
> You're right there is currently no implementation for the 'reset' function for
> zynq (and most of the other SoCs). I'll need to see if it makes sense at
> all.

The implementation of reset_control_reset in software really only makes
sense if the reset provider driver knows about the necessary delays for
all reset consumers.

> Please note that you'd probably have to modify the i2c driver to
> integrate reset functionality cleanly.
> 
> Thanks,
> 
> Moritz

regards
Philipp

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Reset implementation for Zynq
  2016-10-24  9:00   ` Philipp Zabel
@ 2016-10-24 17:03     ` Moritz Fischer
  0 siblings, 0 replies; 5+ messages in thread
From: Moritz Fischer @ 2016-10-24 17:03 UTC (permalink / raw)
  To: Philipp Zabel; +Cc: iztok.jeras, linux-kernel

Philip,

On Mon, Oct 24, 2016 at 11:00:05AM +0200, Philipp Zabel wrote:
> Hi Iztok, Moritz,
> 
> Am Freitag, den 21.10.2016, 10:04 -0700 schrieb Moritz Fischer:
> > Iztok,
> > 
> > On Fri, Oct 21, 2016 at 03:08:47AM -0700, iztok.jeras@redpitaya.com wrote:
> > > Hi Moritz,
> > >  
> > > I was looking at your reset implementation for Zynq:
> > > https://github.com/Xilinx/linux-xlnx/blob/629041605b93343ad2e8971ceaac3edcef0b043b/drivers/reset/reset-zynq.c
> > > I went through related mailing list posts (including earlier versions of the patch) so I kind of understand what to change in the device tree.
> > 
> > Please look at the upstream kernel sources and use the mailing list
> > (lkml) if you want to report bugs. Xilinx' vendor tree might or might
> > not be up to date.
> > 
> > > I would like to use this driver to reset the Zynq I2C controller, since we have trouble with it getting into a lock up state.
> > > I plan to use function device_reset_optional() from:
> > > https://github.com/Xilinx/linux-xlnx/blob/629041605b93343ad2e8971ceaac3edcef0b043b/include/linux/reset.h
> > >  
> > > But this function is calling the reset function pointer from the reset_control_ops structure.
> > > For the zynq driver this function pointer is not defined, only assert, deassert and status are.
> > >  
> > > Is this a missing implementation, or is there a default implementation (I did not find one) which which performs an assert+deassert,
> > > or is there another set of reset APIs I should use inside the kernel.
> > 
> > You could just call reset_control_assert() and reset_control_deassert().
> > You're right there is currently no implementation for the 'reset' function for
> > zynq (and most of the other SoCs). I'll need to see if it makes sense at
> > all.
> 
> The implementation of reset_control_reset in software really only makes
> sense if the reset provider driver knows about the necessary delays for
> all reset consumers.

That's what I meant by needing to see if it makes sense at all; it makes
no sense to have a 'reset' if you don't know how long it needs to be
asserted for, since that's obviously a consumer property.

Thanks for clarifying,

Moritz

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Reset implementation for Zynq
  2016-10-21 17:04 ` Reset implementation for Zynq Moritz Fischer
  2016-10-24  9:00   ` Philipp Zabel
@ 2016-11-08  6:34   ` Shubhrajyoti Datta
       [not found]     ` <20161108024052.6b4c15d01df5508dab02973c2a5944d9.803a60fc5b.mailapi@email21.godaddy.com>
  1 sibling, 1 reply; 5+ messages in thread
From: Shubhrajyoti Datta @ 2016-11-08  6:34 UTC (permalink / raw)
  To: Moritz Fischer; +Cc: iztok.jeras, p.zabel, linux-kernel

On Fri, Oct 21, 2016 at 10:34 PM, Moritz Fischer
<moritz.fischer@ettus.com> wrote:
> Iztok,
>
> On Fri, Oct 21, 2016 at 03:08:47AM -0700, iztok.jeras@redpitaya.com wrote:
>> Hi Moritz,
>>
>> I was looking at your reset implementation for Zynq:
>> https://github.com/Xilinx/linux-xlnx/blob/629041605b93343ad2e8971ceaac3edcef0b043b/drivers/reset/reset-zynq.c
>> I went through related mailing list posts (including earlier versions of the patch) so I kind of understand what to change in the device tree.
>
> Please look at the upstream kernel sources and use the mailing list
> (lkml) if you want to report bugs. Xilinx' vendor tree might or might
> not be up to date.
>
>> I would like to use this driver to reset the Zynq I2C controller, since we have trouble with it getting into a lock up state.

Can you explain what you are facing and what is meant by lockup state.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Re: Reset implementation for Zynq
       [not found]     ` <20161108024052.6b4c15d01df5508dab02973c2a5944d9.803a60fc5b.mailapi@email21.godaddy.com>
@ 2016-11-08 11:56       ` Shubhrajyoti Datta
  0 siblings, 0 replies; 5+ messages in thread
From: Shubhrajyoti Datta @ 2016-11-08 11:56 UTC (permalink / raw)
  To: iztok.jeras; +Cc: Moritz Fischer, p.zabel, linux-kernel

Hi Iztok,



On Tue, Nov 8, 2016 at 3:10 PM,  <iztok.jeras@redpitaya.com> wrote:
> Hi Shubhrajyoti,
>
> By lockup state, I mean an undefined/unhandled state of the HW logic state
> machine,
> or something similar in the software driver.
> Based on symptoms I assume it is a HW lockup.
> In practice asking the driver for a new I2C transfer would result in
> nothing happening on the I2C bus (signals remain in hi-Z state).
> Driver or userspace tool reports a transfer error, but I did not copy it.
> And I did not check the state of the driver.
>
> To enter this mode it was enough to connect an oscilloscope probe to the SDA
> signal.
> The capacitance of the probe causes a deep voltage fall, which is quickly
> corrected by the pullup.
> I did not time the glitch, and the shape was partially defined by an I2C
> level shifter.
> The issue can be repeated with about 80% probability.
>
> There are two ways to get back to a working state:
> 1. create a longer zero pulse (about 50ms manual grounding) on SDA
> 2. reset the HW, this was done with a patched driver.
Thanks  for the explaination.
May be recovery mechanism  implementation could be considered.


>
> Regards,
> Iztok Jeras
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-11-08 11:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20161021030847.6b4c15d01df5508dab02973c2a5944d9.645b3cfd21.mailapi@email21.godaddy.com>
2016-10-21 17:04 ` Reset implementation for Zynq Moritz Fischer
2016-10-24  9:00   ` Philipp Zabel
2016-10-24 17:03     ` Moritz Fischer
2016-11-08  6:34   ` Shubhrajyoti Datta
     [not found]     ` <20161108024052.6b4c15d01df5508dab02973c2a5944d9.803a60fc5b.mailapi@email21.godaddy.com>
2016-11-08 11:56       ` Shubhrajyoti Datta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).