Patch "mmc: dw_mmc: Factor out dw_mci_init_slot_caps" has been added to the 4.14-stable tree
This is a note to let you know that I've just added the patch titled
mmc: dw_mmc: Factor out dw_mci_init_slot_caps
to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
mmc-dw_mmc-factor-out-dw_mci_init_slot_caps.patch
and it can be found in the queue-4.14 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
a4faa4929ed3be15e2d500d2405f992f6dedc8ebMon Sep 17 00:00:00 2001
From: Shawn Lin <[email protected]>
Date: Sat, 24 Feb 2018 14:17:22 +0800
Subject: mmc: dw_mmc: Factor out dw_mci_init_slot_caps
From: Shawn Lin <[email protected]>
commit a4faa4929ed3be15e2d500d2405f992f6dedc8eb upstream.
Factor out dw_mci_init_slot_caps to consolidate parsing all differents types of capabilities from host contrllers. No functional change intended.
--- drivers/mmc/host/dw_mmc.c | 73 +++++++++++++++++++++++++++------------------- 1 file changed, 43 insertions(+), 30 deletions(-)
drivers/mmc/host/dw_mmc.c +43 -30
@@ -2762,12 +2762,50 @@ static irqreturn_t dw_mci_interrupt(intreturn IRQ_HANDLED ; } +static int dw_mci_init_slot_caps (struct dw_mci_slot *slot) +{ +struct dw_mci *host = slot->host; +const struct dw_mci_drv_data *drv_data = host->drv_data; +struct mmc_host *mmc = slot->mmc; +int ctrl_id; + +if (host->pdata->caps) + mmc->caps = host->pdata->caps; + +/* +* Support MMC_CAP_ERASE by default. +* It needs to use trim/discard/erase commands. +*/ + mmc->caps |=MMC_CAP_ERASE ; + +if (host->pdata->pm_caps) + mmc->pm_caps = host->pdata->pm_caps; + +if (host->dev->of_node) { + ctrl_id =of_alias_get_id (host->dev->of_node,"mshc" ); +if (ctrl_id <0 ) + ctrl_id =0 ; + }else { + ctrl_id =to_platform_device (host->dev)->id; + } +if (drv_data && drv_data->caps) + mmc->caps |= drv_data->caps[ctrl_id]; + +if (host->pdata->caps2) + mmc->caps2 = host->pdata->caps2; + +/* Process SDIO IRQs through the sdio_irq_work. */ +if (mmc->caps &MMC_CAP_SDIO_IRQ ) + mmc->caps2 |=MMC_CAP2_SDIO_IRQ_NOTHREAD ; + +return 0 ; +} +static int dw_mci_init_slot (struct dw_mci *host) {struct mmc_host *mmc;struct dw_mci_slot *slot; -const struct dw_mci_drv_data *drv_data = host->drv_data; -int ctrl_id, ret; +int ret;u32 freq[2 ]; mmc =mmc_alloc_host (sizeof (struct dw_mci_slot ), host->dev);
@@ -2801,38 +2839,13 @@ static int dw_mci_init_slot(struct dw_mcif (!mmc->ocr_avail) mmc->ocr_avail =MMC_VDD_32_33 |MMC_VDD_33_34 ; -if (host->pdata->caps) - mmc->caps = host->pdata->caps; - -/* -* Support MMC_CAP_ERASE by default. -* It needs to use trim/discard/erase commands. -*/ - mmc->caps |=MMC_CAP_ERASE ; - -if (host->pdata->pm_caps) - mmc->pm_caps = host->pdata->pm_caps; - -if (host->dev->of_node) { - ctrl_id =of_alias_get_id (host->dev->of_node,"mshc" ); -if (ctrl_id <0 ) - ctrl_id =0 ; - }else { - ctrl_id =to_platform_device (host->dev)->id; - } -if (drv_data && drv_data->caps) - mmc->caps |= drv_data->caps[ctrl_id]; - -if (host->pdata->caps2) - mmc->caps2 = host->pdata->caps2; - ret =mmc_of_parse (mmc);if (ret) goto err_host_allocated; -/* Process SDIO IRQs through the sdio_irq_work. */ -if (mmc->caps &MMC_CAP_SDIO_IRQ ) - mmc->caps2 |=MMC_CAP2_SDIO_IRQ_NOTHREAD ; + ret =dw_mci_init_slot_caps (slot); +if (ret) + goto err_host_allocated;/* Useful defaults if platform data is unset. */ if (host->use_dma ==TRANS_MODE_IDMAC ) {
Patches currently in stable-queue which might be from [email protected] are
queue-4.14/mmc-dw_mmc-factor-out-dw_mci_init_slot_caps.patch queue-4.14/mmc-dw_mmc-fix-out-of-bounds-access-for-slot-s-caps.patch queue-4.14/mmc-dw_mmc-avoid-accessing-registers-in-runtime-suspended-state.patch queue-4.14/mmc-dw_mmc-k3-fix-out-of-bounds-access-through-dt-alias.patch