From: Jaehoon Chung <jh80.chung@samsung.com>
To: Shawn Lin <shawn.lin@rock-chips.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mmc: dw_mmc: remove DW_MCI_QUIRK_BROKEN_CARD_DETECTION quirk
Date: Thu, 21 Jan 2016 10:43:00 +0900 [thread overview]
Message-ID: <56A037A4.4040402@samsung.com> (raw)
In-Reply-To: <1453107026-19814-1-git-send-email-shawn.lin@rock-chips.com>
Hi, Shawn.
After applied this patch at my dw-mmc git, i found some problem.
So I will revert this until fixing problem.
On 01/18/2016 05:50 PM, Shawn Lin wrote:
> dw_mmc already use mmc_of_parse to get "broken-cd" property,
> but it considered "broken-cd" to be a quirk in its driver. We
> don't need this quirk here, and just take what we need from
> mmc->caps.
>
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
> ---
>
> drivers/mmc/host/dw_mmc.c | 23 +++--------------------
> include/linux/mmc/dw_mmc.h | 4 +---
> 2 files changed, 4 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 7128351..bbf9ca6 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -1450,12 +1450,11 @@ static int dw_mci_get_cd(struct mmc_host *mmc)
> {
> int present;
> struct dw_mci_slot *slot = mmc_priv(mmc);
> - struct dw_mci_board *brd = slot->host->pdata;
> struct dw_mci *host = slot->host;
> int gpio_cd = mmc_gpio_get_cd(mmc);
>
> /* Use platform get_cd function, else try onboard card detect */
> - if ((brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION) ||
> + if ((mmc->caps & MMC_CAP_NEEDS_POLL) ||
> (mmc->caps & MMC_CAP_NONREMOVABLE))
> present = 1;
> else if (!IS_ERR_VALUE(gpio_cd))
> @@ -2840,23 +2839,13 @@ static void dw_mci_dto_timer(unsigned long arg)
> }
>
> #ifdef CONFIG_OF
> -static struct dw_mci_of_quirks {
> - char *quirk;
> - int id;
> -} of_quirks[] = {
> - {
> - .quirk = "broken-cd",
> - .id = DW_MCI_QUIRK_BROKEN_CARD_DETECTION,
> - },
> -};
> -
> static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)
> {
> struct dw_mci_board *pdata;
> struct device *dev = host->dev;
> struct device_node *np = dev->of_node;
> const struct dw_mci_drv_data *drv_data = host->drv_data;
> - int idx, ret;
> + int ret;
> u32 clock_frequency;
>
> pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
> @@ -2871,11 +2860,6 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)
> pdata->num_slots = 1;
> }
>
> - /* get quirks */
> - for (idx = 0; idx < ARRAY_SIZE(of_quirks); idx++)
> - if (of_get_property(np, of_quirks[idx].quirk, NULL))
> - pdata->quirks |= of_quirks[idx].id;
> -
> if (of_property_read_u32(np, "fifo-depth", &pdata->fifo_depth))
> dev_info(dev,
> "fifo-depth property not found, using value of FIFOTH register as default\n");
> @@ -2908,13 +2892,12 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)
>
> static void dw_mci_enable_cd(struct dw_mci *host)
> {
> - struct dw_mci_board *brd = host->pdata;
> unsigned long irqflags;
> u32 temp;
> int i;
>
> /* No need for CD if broken card detection */
> - if (brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION)
> + if (host->cur_slot->mmc->caps & MMC_CAP_NEEDS_POLL)
dw_mci_enable_cd is called in dw_mci_probe.
So host->cur_slot is not assigned to anything..
Best Regards,
Jaehoon Chung
> return;
>
> /* No need for CD if all slots have a non-error GPIO */
> diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h
> index 89df7ab..250d822 100644
> --- a/include/linux/mmc/dw_mmc.h
> +++ b/include/linux/mmc/dw_mmc.h
> @@ -235,10 +235,8 @@ struct dw_mci_dma_ops {
> };
>
> /* IP Quirks/flags. */
> -/* Unreliable card detection */
> -#define DW_MCI_QUIRK_BROKEN_CARD_DETECTION BIT(0)
> /* Timer for broken data transfer over scheme */
> -#define DW_MCI_QUIRK_BROKEN_DTO BIT(1)
> +#define DW_MCI_QUIRK_BROKEN_DTO BIT(0)
>
> struct dma_pdata;
>
>
next prev parent reply other threads:[~2016-01-21 1:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-18 8:50 [PATCH] mmc: dw_mmc: remove DW_MCI_QUIRK_BROKEN_CARD_DETECTION quirk Shawn Lin
2016-01-21 1:43 ` Jaehoon Chung [this message]
2016-01-21 6:49 ` Shawn Lin
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=56A037A4.4040402@samsung.com \
--to=jh80.chung@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=shawn.lin@rock-chips.com \
--cc=ulf.hansson@linaro.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