linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bojan Prtvar <bojan.prtvar@rt-rk.com>
To: linux-mmc@vger.kernel.org
Subject: How to trigger sdio bus probing from user space
Date: Fri, 27 Sep 2013 12:19:57 +0200	[thread overview]
Message-ID: <52455BCD.5040309@rt-rk.com> (raw)

Hi,

Is there a clean way to trigger sdio bus probing from user space?

I have a non removable sdio WiFi/BT module on embedded system that needs
to be tested and calibrated on production line.
In order to speed up production process, I need to be able to replace
the  WiFi/BT modules in run time without reboot.
Modules are connected to the host with a ribbon cable, not with a  sdio
connector.

I came up with fallowing two-part solution:
a)
I extended WiFi driver's /proc interface with a call to
mmc_detect_change()
b)
I also needed to let the sdio host think module is removable by
commenting fallowing in sdhci-mv.c:
sdhci_mv_probe_dt(struct platform_device *pdev)
{
    struct device_node *np = pdev->dev.of_node;
    struct sdhci_host *host = platform_get_drvdata(pdev);

    if (of_get_property(np, "mrvl,card-wired", NULL)) {
        /*
         * RT-RK
         * We need to comment out these in order to be able to
         * trigger sdio bus probing on the fly
         */
        //host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
        //host->mmc->caps |= MMC_CAP_NONREMOVABLE;
    }

This works in situations when working modules are inserted.
Unfortunately, it does not work in case when broken module is inserted
on production line.
In this case production board needs to be rebooted, because the WiFi
driver's /proc interface is gone, and I can not force a call to
mmc_detect_change() any more.

Is there cleaner and better approach?

Best regards,
Bojan


             reply	other threads:[~2013-09-27 10:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-27 10:19 Bojan Prtvar [this message]
2013-09-27 13:56 ` [PATCH] Re: How to trigger sdio bus probing from user space Romain Izard
2013-09-30 11:56   ` Bojan Prtvar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52455BCD.5040309@rt-rk.com \
    --to=bojan.prtvar@rt-rk.com \
    --cc=linux-mmc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).