Re: [PATCH 3/3] drivers/mmc/host: Add realtek sdmmc interface driver

From: Borislav Petkov
Date: Tue Jul 31 2012 - 14:11:42 EST


On Tue, Jul 31, 2012 at 03:42:56PM +0800, wei_wang@xxxxxxxxxxxxxx wrote:
> From: Wei WANG <wei_wang@xxxxxxxxxxxxxx>
>
> Realtek SD/MMC card interface driver is used to access
> SD/MMC card, with the help of Realtek card reader adapter driver.
>
> Signed-off-by: Wei WANG <wei_wang@xxxxxxxxxxxxxx>
> ---

[ â ]

> +static void __devexit realtek_sdmmc_remove(struct rtsx_dev *sock)
> +{
> + struct mmc_host *mmc = rtsx_get_drvdata(sock);
> + struct realtek_sdmmc *host;
> +
> + host = mmc_priv(mmc);
> + host->eject = 1;
> +
> + mutex_lock(&host->host_mutex);
> + if (host->mrq) {
> + dev_dbg(&(sock->dev),
> + "%s: Controller removed during transfer\n",
> + mmc_hostname(mmc));
> +
> + rtsx_complete_unfinished_transfer(sock);
> +
> + host->mrq->cmd->error = -ENOMEDIUM;
> + if (host->mrq->stop)
> + host->mrq->stop->error = -ENOMEDIUM;
> + mmc_request_done(mmc, host->mrq);
> + }
> + mutex_unlock(&host->host_mutex);
> +
> + mmc_remove_host(mmc);
> + mmc_free_host(mmc);
> +
> + pr_info(DRV_NAME
> + ": Realtek SDMMC controller has been removed\n");

Oh and this appears in the logs when I remove the card:

[11721.313471] rtsx_sdmmc: Realtek SDMMC controller has been removed

but it is simply polluting the logs with useless info that a card has
been removed.

If you really need those printk (same with the PCI-E driver) you could
try to use dev_dbg() like you do above.

Same for the probe function.

But, more importantly and while playing with this, I replugged the card
and it said:

[12072.632332] rtsx_core: MMC/SD card detected in socket 0:0
[12072.642855] rtsx_sdmmc: Realtek SDMMC controller found
[12073.839561] mmc0: error -110 whilst initialising SD card
[12075.138833] mmc0: error -110 whilst initialising SD card
[12076.438158] mmc0: error -110 whilst initialising SD card

and now I can't mount the card anymore:

$ mount /dev/mmcblk0 /mnt/tmp/
mount: /dev/mmcblk0 is not a valid block device

$ mount /dev/mmcblk0p1 /mnt/tmp/
mount: /dev/mmcblk0p1 is not a valid block device

Hmm..

--
Regards/Gruss,
Boris.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/