diff mbox series

[1/2] dt-bindings: spi: fsl-lpspi: Option to allow stalling

Message ID 20180925203701.13605-2-dangtranhieu2012@gmail.com (mailing list archive)
State New, archived
Headers show
Series spi: fsl-lpspi: Option to prevent FIFO under/overrun | expand

Commit Message

Hieu Tran Dang Sept. 25, 2018, 8:37 p.m. UTC
This patch add fsl,allow-stalling property documentation for fsl-lpspi

Signed-off-by: Hieu Tran Dang <dangtranhieu2012@gmail.com>
---
 Documentation/devicetree/bindings/spi/spi-fsl-lpspi.txt | 2 ++
 1 file changed, 2 insertions(+)

Comments

Rob Herring (Arm) Sept. 26, 2018, 2:26 p.m. UTC | #1
DT bindings should be sent to DT list.

On Tue, Sep 25, 2018 at 3:37 PM Hieu Tran Dang
<dangtranhieu2012@gmail.com> wrote:
>
> This patch add fsl,allow-stalling property documentation for fsl-lpspi
>
> Signed-off-by: Hieu Tran Dang <dangtranhieu2012@gmail.com>
> ---
>  Documentation/devicetree/bindings/spi/spi-fsl-lpspi.txt | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/spi/spi-fsl-lpspi.txt b/Documentation/devicetree/bindings/spi/spi-fsl-lpspi.txt
> index 4af132606b37..2b012b8cb05e 100644
> --- a/Documentation/devicetree/bindings/spi/spi-fsl-lpspi.txt
> +++ b/Documentation/devicetree/bindings/spi/spi-fsl-lpspi.txt
> @@ -6,6 +6,8 @@ Required properties:
>  - reg : address and length of the lpspi master registers
>  - interrupts : lpspi interrupt
>  - clocks : lpspi clock specifier
> +- fsl,allow-stall : allow stalling of transfers when the transmit FIFO is empty
> +  or when the receive FIFO is full

This seems odd. That seems like what normal behavior should be.

Rob
Hieu Tran Dang Sept. 26, 2018, 2:37 p.m. UTC | #2
>
> DT bindings should be sent to DT list.
>

DT bindings already sent to DT list, included here for completeness
sake. Of course, this is my first patch to the kernel so I might have
completely been wrong about the process. I can create another patch
set to send to correct list if necessary.

> On Tue, Sep 25, 2018 at 3:37 PM Hieu Tran Dang
> <dangtranhieu2012@gmail.com> wrote:
> >
> > This patch add fsl,allow-stalling property documentation for fsl-lpspi
> >
> > Signed-off-by: Hieu Tran Dang <dangtranhieu2012@gmail.com>
> > ---
> >  Documentation/devicetree/bindings/spi/spi-fsl-lpspi.txt | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/spi/spi-fsl-lpspi.txt b/Documentation/devicetree/bindings/spi/spi-fsl-lpspi.txt
> > index 4af132606b37..2b012b8cb05e 100644
> > --- a/Documentation/devicetree/bindings/spi/spi-fsl-lpspi.txt
> > +++ b/Documentation/devicetree/bindings/spi/spi-fsl-lpspi.txt
> > @@ -6,6 +6,8 @@ Required properties:
> >  - reg : address and length of the lpspi master registers
> >  - interrupts : lpspi interrupt
> >  - clocks : lpspi clock specifier
> > +- fsl,allow-stall : allow stalling of transfers when the transmit FIFO is empty
> > +  or when the receive FIFO is full
>
> This seems odd. That seems like what normal behavior should be.
>
> Rob

Default value of the register is to allow stalling (NOSTALL bit not
set) but the spi-fsl-lpspi driver defaults to setting the NOSTALL bit
in CFGR1. To me, it's more logical to leave the NOSTALL bit off with
fsl,nostall binding to set the bit but as I am not sure if there are
other drivers depending on the NOSTALL bit being set and not wanting
to break other drivers hence introduction of this binding to keep the
current default behavior.
Mark Brown Sept. 27, 2018, 10:47 p.m. UTC | #3
On Wed, Sep 26, 2018 at 09:37:39PM +0700, Đặng Trần Hiếu wrote:

> Default value of the register is to allow stalling (NOSTALL bit not
> set) but the spi-fsl-lpspi driver defaults to setting the NOSTALL bit
> in CFGR1. To me, it's more logical to leave the NOSTALL bit off with
> fsl,nostall binding to set the bit but as I am not sure if there are
> other drivers depending on the NOSTALL bit being set and not wanting
> to break other drivers hence introduction of this binding to keep the
> current default behavior.

I can't see a situation where you'd actively want to report an error
rather than stall, stalling allows us to handle things gracefully by
restarting things.  Even if it's a timeout situation it sounds like we
can unblock by reading/writing the stalled FIFO, and normally you'd be
resetting the entire IP anyway.  I'd imagine the driver is this way
either through an oversight or because there's some bug on some silicon
which means that stalling breaks.

Probably best to just always enable stalling unless I'm misreading
things, if it is silicon bugs on some versions then either a whitelist
or blacklist of SoCs to enable on (depending on how common the bug is)
would be the way forwards - that way SoCs where it works get the benefit.
Hieu Tran Dang Oct. 1, 2018, 1:12 a.m. UTC | #4
Agree. I will create new patch which will just allow stalling by default.

Vào Th 6, 28 thg 9, 2018 vào lúc 05:47 Mark Brown <broonie@kernel.org> đã viết:
>
> On Wed, Sep 26, 2018 at 09:37:39PM +0700, Đặng Trần Hiếu wrote:
>
> > Default value of the register is to allow stalling (NOSTALL bit not
> > set) but the spi-fsl-lpspi driver defaults to setting the NOSTALL bit
> > in CFGR1. To me, it's more logical to leave the NOSTALL bit off with
> > fsl,nostall binding to set the bit but as I am not sure if there are
> > other drivers depending on the NOSTALL bit being set and not wanting
> > to break other drivers hence introduction of this binding to keep the
> > current default behavior.
>
> I can't see a situation where you'd actively want to report an error
> rather than stall, stalling allows us to handle things gracefully by
> restarting things.  Even if it's a timeout situation it sounds like we
> can unblock by reading/writing the stalled FIFO, and normally you'd be
> resetting the entire IP anyway.  I'd imagine the driver is this way
> either through an oversight or because there's some bug on some silicon
> which means that stalling breaks.
>
> Probably best to just always enable stalling unless I'm misreading
> things, if it is silicon bugs on some versions then either a whitelist
> or blacklist of SoCs to enable on (depending on how common the bug is)
> would be the way forwards - that way SoCs where it works get the benefit.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/spi/spi-fsl-lpspi.txt b/Documentation/devicetree/bindings/spi/spi-fsl-lpspi.txt
index 4af132606b37..2b012b8cb05e 100644
--- a/Documentation/devicetree/bindings/spi/spi-fsl-lpspi.txt
+++ b/Documentation/devicetree/bindings/spi/spi-fsl-lpspi.txt
@@ -6,6 +6,8 @@  Required properties:
 - reg : address and length of the lpspi master registers
 - interrupts : lpspi interrupt
 - clocks : lpspi clock specifier
+- fsl,allow-stall : allow stalling of transfers when the transmit FIFO is empty
+  or when the receive FIFO is full
 
 Examples: