From 19d270b8a11457da3b2f8c049517d0ddf2bd7426 Mon Sep 17 00:00:00 2001 From: Marcel Ziswiler Date: Fri, 20 Apr 2018 11:34:14 +0200 Subject: linux-toradex-mainline: more patches also for apalis t30 Move the USB device aka gadget fix from Tezi to here. Add patches to force fixed IDs for SDMMC controllers. Add patch to fix for PLL_U rate configuration (T30). Add Apalis T30 specific patch for PCIe fix hacks. Signed-off-by: Marcel Ziswiler Acked-by: Stefan Agner (cherry picked from commit 7da6da579b7d90b7ca6560c880bd3f58ecb73df2) --- ...016-Revert-mmc-core-simplify-ida-handling.patch | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 recipes-kernel/linux/linux-toradex-mainline-4.14/0016-Revert-mmc-core-simplify-ida-handling.patch (limited to 'recipes-kernel/linux/linux-toradex-mainline-4.14/0016-Revert-mmc-core-simplify-ida-handling.patch') diff --git a/recipes-kernel/linux/linux-toradex-mainline-4.14/0016-Revert-mmc-core-simplify-ida-handling.patch b/recipes-kernel/linux/linux-toradex-mainline-4.14/0016-Revert-mmc-core-simplify-ida-handling.patch new file mode 100644 index 0000000..4a8ba85 --- /dev/null +++ b/recipes-kernel/linux/linux-toradex-mainline-4.14/0016-Revert-mmc-core-simplify-ida-handling.patch @@ -0,0 +1,64 @@ +From 50a063a5271868aaf17ee86741e6452a6c405a50 Mon Sep 17 00:00:00 2001 +Message-Id: <50a063a5271868aaf17ee86741e6452a6c405a50.1529072479.git.marcel.ziswiler@toradex.com> +In-Reply-To: +References: +From: Marcel Ziswiler +Date: Thu, 19 Apr 2018 13:49:30 +0200 +Subject: [PATCH 16/27] Revert "mmc: core: simplify ida handling" + +This reverts commit 7413d1f509eb0ee605973c1a6da9911700c80012. + +Signed-off-by: Marcel Ziswiler +--- + drivers/mmc/core/host.c | 20 ++++++++++++++++---- + 1 file changed, 16 insertions(+), 4 deletions(-) + +diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c +index 3740fb0052a4..841b9ce01a8e 100644 +--- a/drivers/mmc/core/host.c ++++ b/drivers/mmc/core/host.c +@@ -35,11 +35,14 @@ + #define cls_dev_to_mmc_host(d) container_of(d, struct mmc_host, class_dev) + + static DEFINE_IDA(mmc_host_ida); ++static DEFINE_SPINLOCK(mmc_host_lock); + + static void mmc_host_classdev_release(struct device *dev) + { + struct mmc_host *host = cls_dev_to_mmc_host(dev); +- ida_simple_remove(&mmc_host_ida, host->index); ++ spin_lock(&mmc_host_lock); ++ ida_remove(&mmc_host_ida, host->index); ++ spin_unlock(&mmc_host_lock); + kfree(host); + } + +@@ -358,13 +361,22 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev) + /* scanning will be enabled when we're ready */ + host->rescan_disable = 1; + +- err = ida_simple_get(&mmc_host_ida, 0, 0, GFP_KERNEL); +- if (err < 0) { ++again: ++ if (!ida_pre_get(&mmc_host_ida, GFP_KERNEL)) { + kfree(host); + return NULL; + } + +- host->index = err; ++ spin_lock(&mmc_host_lock); ++ err = ida_get_new(&mmc_host_ida, &host->index); ++ spin_unlock(&mmc_host_lock); ++ ++ if (err == -EAGAIN) { ++ goto again; ++ } else if (err) { ++ kfree(host); ++ return NULL; ++ } + + dev_set_name(&host->class_dev, "mmc%d", host->index); + +-- +2.14.4 + -- cgit v1.2.3