[RFC PATCH] brcmfmac: add 43751 SDIO ids and initialization

Marc Gonzalez marc.w.gonzalez at free.fr
Mon Mar 13 10:09:10 PDT 2023


On 13/03/2023 14:55, Marc Gonzalez wrote:

> Still trying to bisect this heisenbug into submission... :(
> 
> So far, I've pared it down to mmc_attach_sdio()
> 
> When probe WORKS, mmc_attach_sdio() returns 0.
> When probe FAILS, mmc_attach_sdio() returns ETIMEDOUT
> via mmc_send_io_op_cond(host, 0, &ocr);
> 
> Wrapping mmc_send_io_op_cond() in a loop
> makes it work on the second try.

Almost there, I think, I hope :)

DT prop "post-power-on-delay-ms" looks like what I needed all along.
It exists both for host (default 10 ms) and for pwrseq_simple (default 0 apparently).

/*
 * Apply power to the MMC stack.  This is a two-stage process.
 * First, we enable power to the card without the clock running.
 * We then wait a bit for the power to stabilise.  Finally,
 * enable the bus drivers and clock to the card.
 *
 * We must _NOT_ enable the clock prior to power stablising.
 *
 * If a host does all the power sequencing itself, ignore the
 * initial MMC_POWER_UP stage.
 */
void mmc_power_up(struct mmc_host *host, u32 ocr)

Calls:

mmc_delay(host->ios.power_delay_ms);
mmc_pwrseq_post_power_on(host);
  => msleep(pwrseq->post_power_on_delay_ms);
...
mmc_delay(host->ios.power_delay_ms);


QUESTION:
It's not clear to me why we sleep twice for host->ios.power_delay_ms?


Looks like all I need is to add post-power-on-delay-ms = <100>; to

	sdio_pwrseq: sdio-pwrseq {
		compatible = "mmc-pwrseq-simple";
		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
		clocks = <&wifi32k>;
		clock-names = "ext_clock";
	};

Will revert all my stabs in the dark, and boot the board 100 times
to check if this does the trick.

Regards




More information about the linux-amlogic mailing list