Re: [PATCH v5 2/2] spi: Add generic SPI multiplexer

2020-11-20 Thread Nicolas Saenz Julienne
On Tue, 2020-11-17 at 00:08 +, Chris Packham wrote:
> On 14/11/20 4:46 am, Nicolas Saenz Julienne wrote:
> > Upon registering spi-mux's devices through spi_add_device() the kernel gets
> > stuck waiting for the 'spi_add_lock' mutex to be released. The mutex 
> > happens to
> > be held by spi-mux's parent SPI bus, which unluckily, is waiting for 
> > spi-mux's
> > probe to finish before releasing it.
> 
> I just re-tested my system with v5.10.0-rc4 and didn't see any problem. 
> My dts is pretty similar to yours the only obvious thing missing is 
> `mux-control-names = "spi";` and I also set `#size-cells = <1>;` (let me 
> know if you want me to post the whole thing).
> 
> It might be dependent on the host spi controller. The re-test I just did 
> was on a board using the spi-orion.c driver and I tested my original 
> change on a board using spi-bcm-qspi.c (I haven't got the board handy 
> right now but I could go and find one if necessary).

Found the issue, something silly on my side. Sorry for the noise.

Regards,
Nicolas



signature.asc
Description: This is a digitally signed message part


Re: [PATCH v5 2/2] spi: Add generic SPI multiplexer

2020-11-16 Thread Chris Packham

On 14/11/20 4:46 am, Nicolas Saenz Julienne wrote:
> Upon registering spi-mux's devices through spi_add_device() the kernel gets
> stuck waiting for the 'spi_add_lock' mutex to be released. The mutex happens 
> to
> be held by spi-mux's parent SPI bus, which unluckily, is waiting for spi-mux's
> probe to finish before releasing it.

I just re-tested my system with v5.10.0-rc4 and didn't see any problem. 
My dts is pretty similar to yours the only obvious thing missing is 
`mux-control-names = "spi";` and I also set `#size-cells = <1>;` (let me 
know if you want me to post the whole thing).

It might be dependent on the host spi controller. The re-test I just did 
was on a board using the spi-orion.c driver and I tested my original 
change on a board using spi-bcm-qspi.c (I haven't got the board handy 
right now but I could go and find one if necessary).

> I might aswell be doing something wrong. But so far I trust my DT
> implementation:
>
>{
>   status = "okay";
>   pinctrl-names = "default";
>   pinctrl-0 = <_gpio7>;
>
>   spi@0 {
>   compatible = "spi-mux";
>   reg = <0>;
>   #address-cells = <1>;
>   #size-cells = <0>;
>   spi-max-frequency = <1>;
>
>   mux-controls = <_mux>;
>
>   w5500@0 {
>   compatible = "wiznet,w5500";
>   reg = <0>;
>   pinctrl-names = "default";
>   pinctrl-0 = <_pins>;
>   interrupt-parent = <>;
>   interrupts = <27 IRQ_TYPE_EDGE_FALLING>;
>   spi-max-frequency = <3000>;
>   };
>
>   spi-flash@1 {
>   compatible = "jedec,spi-nor";
>   reg = <1>;
>   #address-cells = <1>;
>   #size-cells = <0>;
>   spi-max-frequency = <1600>;
>   };
>   };
>   };
>
> Regards,
> Nicolas

Re: [PATCH v5 2/2] spi: Add generic SPI multiplexer

2020-11-13 Thread Nicolas Saenz Julienne
Upon registering spi-mux's devices through spi_add_device() the kernel gets
stuck waiting for the 'spi_add_lock' mutex to be released. The mutex happens to
be held by spi-mux's parent SPI bus, which unluckily, is waiting for spi-mux's
probe to finish before releasing it.

I might aswell be doing something wrong. But so far I trust my DT
implementation:

 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <_gpio7>;

spi@0 {
compatible = "spi-mux";
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
spi-max-frequency = <1>;

mux-controls = <_mux>;

w5500@0 {
compatible = "wiznet,w5500";
reg = <0>;
pinctrl-names = "default";
pinctrl-0 = <_pins>;
interrupt-parent = <>;
interrupts = <27 IRQ_TYPE_EDGE_FALLING>;
spi-max-frequency = <3000>;
};

spi-flash@1 {
compatible = "jedec,spi-nor";
reg = <1>;
#address-cells = <1>;
#size-cells = <0>;
spi-max-frequency = <1600>;
};
};
};

Regards,
Nicolas