Re: [PATCH V3 4/5] block: Add secure discard
Andrew Morton wrote: On Thu, 24 Jun 2010 11:44:23 +0300 Adrian Hunter adrian.hun...@nokia.com wrote: From b25b9a499f255ee5999c219525d82ef40382318c Mon Sep 17 00:00:00 2001 From: Adrian Hunter adrian.hun...@nokia.com Date: Wed, 23 Jun 2010 15:41:38 +0300 Subject: [PATCH 4/5] block: Add secure discard Secure discard is the same as discard except that all copies of the discarded sectors (perhaps created by garbage collection) must also be erased. That's not an awfully informative changelog. From a quick peek at the code it seems that you took your earlier design sketch: On Mon, Jun 14, 2010 at 02:10:06PM +0300, Adrian Hunter wrote: Needs a bio flag, a request flag, setup the request flag based on the bio flag, prevent merging secure and non-secure discards, prevent drivers doing non-secure discards for secure discards. Seems like a lot of little changes for something that no one wants. Shouldn't it wait for someone to need it first? and changed your mind and implemented it. Is that a correct interpretation? Yes. It does allude to that in [PATCH V3 0/5] Add MMC erase and secure erase V3 i.e. Changes from V2 - move the addition of BLKSECDISCARD to a separate patch and implement it using I/O requests - move the MMC support of secure discard to a separate patch and support the secure discard I/O request -- To unsubscribe from this list: send the line unsubscribe linux-mmc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v5 1/2] OMAP HSMMC: Adding a Flag to determine the type of Card detect
* kishore kadiyala kishorek.kadiy...@gmail.com [100621 09:49]: On Fri, Jun 18, 2010 at 1:49 AM, Andrew Morton a...@linux-foundation.org wrote: On Thu, 17 Jun 2010 20:56:58 +0530 (IST) kishore kadiyala kishore.kadiy...@ti.com wrote: --- a/arch/arm/plat-omap/include/plat/mmc.h +++ b/arch/arm/plat-omap/include/plat/mmc.h @@ -43,6 +43,9 @@ #define OMAP_MMC_MAX_SLOTS 2 +#define NON_GPIO 0 +#define GPIO 1 I'm counting about seven different definitions of GPIO in the kernel already. drivers/hwmon/it87.c: #define GPIO 0x07 drivers/media/dvb/dvb-usb/ec168.h: GPIO = 0x04, drivers/net/hamachi.c: GPIO=0x6E drivers/staging/rtl8187se/r8180_hw.h: #define GPIO 0x91 etcetera. It's a crazy identifier to use in a header file, and the chances of a miscompile-causing collision are increasing. enum cd_type { CD_TYPE_NON_GPIO = 0, CD_TYPE_GPIO = 1, }; OK , Will repost with above changes Please also do it the other way around where you pass CD_TYPE_NON_GPIO in the flags in the platform data. Then there's no need to patch all the existing boards. Tony -- To unsubscribe from this list: send the line unsubscribe linux-mmc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3] MMC: Add JZ4740 mmc driver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Andrew Morton wrote: On Mon, 28 Jun 2010 03:20:41 +0200 Lars-Peter Clausen l...@metafoo.de wrote: This patch adds support for the mmc controller on JZ4740 SoCs. Signed-off-by: Lars-Peter Clausen l...@metafoo.de Cc: Andrew Morton a...@linux-foundation.org Cc: Matt Fleming m...@console-pimps.org Cc: linux-mmc@vger.kernel.org ... +#define JZ4740_MMC_MAX_TIMEOUT 1000 That was a really big timeout. How long do 1e7 readw's take? Oh well. Hm, right. It doesn't hurt though. I'll do some tests and to try to come up with a more realistic value. ... +static void jz4740_mmc_clock_disable(struct jz4740_mmc_host *host) +{ +uint32_t status; + +writew(JZ_MMC_STRPCL_CLOCK_STOP, host-base + JZ_REG_MMC_STRPCL); +do { +status = readl(host-base + JZ_REG_MMC_STATUS); +} while (status JZ_MMC_STATUS_CLK_EN); +} + +static void jz4740_mmc_reset(struct jz4740_mmc_host *host) +{ +uint32_t status; + +writew(JZ_MMC_STRPCL_RESET, host-base + JZ_REG_MMC_STRPCL); +udelay(10); +do { +status = readl(host-base + JZ_REG_MMC_STATUS); +} while (status JZ_MMC_STATUS_IS_RESETTING); +} Maybe these should have a timeout too? Its very unlikely that these will ever timeout. But right, to be on the safe, there should be a timeout as well. ... +static inline unsigned int jz4740_mmc_wait_irq(struct jz4740_mmc_host *host, +unsigned int irq) +{ +unsigned int timeout = JZ4740_MMC_MAX_TIMEOUT; +uint16_t status; + +do { +status = readw(host-base + JZ_REG_MMC_IREG); +} while (!(status irq) --timeout); + +return timeout; +} This guy's too big to inline. Recent gcc's know that and they tend to uninline such things behind your back anwyay. Actually, even without the inline attribute and compiling with -Os gcc will inline this function by itself. ... +struct jz4740_mmc_platform_data { +int gpio_power; +int gpio_card_detect; +int gpio_read_only; +unsigned card_detect_active_low:1; +unsigned read_only_active_low:1; +unsigned power_active_low:1; + +unsigned data_1bit:1; +}; The bitfields will all share the same word, so modification of one field can race against modification of another field. Hence some form of locking which covers *all* the bitfields is needed. Is that a problem in this driver? They are all read-only in the driver. Thanks for reviewing the patch - - Lars -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkwsuDQACgkQBX4mSR26RiOiMACeMMNj4koCYFAUnxyM0LBr+wOZ x6oAnizk5CaAvZjQ2doXrD6ZYgDeNjSr =92D2 -END PGP SIGNATURE- -- To unsubscribe from this list: send the line unsubscribe linux-mmc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3] MMC: Add JZ4740 mmc driver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Matt Fleming wrote: On Mon, 28 Jun 2010 03:20:41 +0200, Lars-Peter Clausen l...@metafoo.de wrote: This patch adds support for the mmc controller on JZ4740 SoCs. Signed-off-by: Lars-Peter Clausen l...@metafoo.de Cc: Andrew Morton a...@linux-foundation.org Cc: Matt Fleming m...@console-pimps.org Cc: linux-mmc@vger.kernel.org --- Changes since v1 - Do not request IRQ with IRQF_DISABLED since it is a noop now - Use a generous slack for the timeout timer. It does not need to be accurate. Changes since v2 - Use sg_mapping_to iterate over sg elements in mmc read and write functions - Use bitops instead of a spinlock and a variable for testing whether a request has been finished. - Rework irq and timeout handling in order to get rid of locking in hot paths Acked-by: Matt Fleming m...@console-pimps.org Are you planning on maintaining this driver? If so, it'd be a good idea to update MAINTAINERS. Hi Thanks for reviewing the patch. I guess I should send a MAINTAINERS patch which adds entries for all of the JZ4740 drivers. - - Lars -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkwsuJUACgkQBX4mSR26RiNHVgCfTq+tc2I1QBniqijyUjNDxPIX GsEAn1xgPWz+L0uqHWthzJ+lMtFaUBtY =nVt9 -END PGP SIGNATURE- -- To unsubscribe from this list: send the line unsubscribe linux-mmc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/3] sdhci-pltfm: Add support for CNS3xxx SoC devices
On Fri, 25 Jun 2010 22:06:44 +0400 Anton Vorontsov avoront...@mvista.com wrote: There's nothing special, just SoC-specific ops and quirks. ... +static void sdhci_cns3xxx_set_clock(struct sdhci_host *host, unsigned int clock) +{ + struct device *dev = mmc_dev(host-mmc); + int div = 1; + u16 clk; + unsigned long timeout; + + if (clock == host-clock) + return; I assume that mmc core prevents this function from being exectued twice at the same time? + sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL); + + if (clock == 0) + goto out; + + while (host-max_clk / div clock) { + /* + * On CNS3xxx divider grows linearly up to 4, and then + * exponentially up to 256. + */ + if (div 4) + div += 1; + else if (div 256) + div *= 2; + else + break; + } + + dev_dbg(dev, desired SD clock: %d, actual: %d\n, + clock, host-max_clk / div); + + /* Divide by 3 is special. */ + if (div != 3) + div = 1; + + clk = div SDHCI_DIVIDER_SHIFT; + clk |= SDHCI_CLOCK_INT_EN; + sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL); + + timeout = 20; + while (!((clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL)) + SDHCI_CLOCK_INT_STABLE)) { + if (timeout == 0) { + dev_warn(dev, clock is unstable); + break; + } + timeout--; + mdelay(1); Could we have used the more polite msleep() here? + } + + clk |= SDHCI_CLOCK_CARD_EN; + sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL); +out: + host-clock = clock; +} + ... --- a/drivers/mmc/host/sdhci-pltfm.c +++ b/drivers/mmc/host/sdhci-pltfm.c @@ -158,6 +158,9 @@ static int __devexit sdhci_pltfm_remove(struct platform_device *pdev) static const struct platform_device_id sdhci_pltfm_ids[] = { { sdhci, }, +#ifdef CONFIG_MMC_SDHCI_CNS3XXX + { sdhci-cns3xxx, (kernel_ulong_t)sdhci_cns3xxx_pdata }, +#endif What the heck is this kernel_ulong_t thing and why did `struct platform_device_id' see a need to invent it?? { }, }; MODULE_DEVICE_TABLE(platform, sdhci_pltfm_ids); ... -- To unsubscribe from this list: send the line unsubscribe linux-mmc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
+ sdhci-pltfm-switch-to-module-device-table-matching.patch added to -mm tree
The patch titled sdhci-pltfm: switch to module device table matching has been added to the -mm tree. Its filename is sdhci-pltfm-switch-to-module-device-table-matching.patch Before you just go and hit reply, please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ -- Subject: sdhci-pltfm: switch to module device table matching From: Anton Vorontsov avoront...@mvista.com Sometimes want to place SoC-specific parts alongside with the generic driver, and to do so, we have to switch the driver over to the module device table matching. Note that drivers/mmc/host/sdhci-pltfm.h is so far empty, but it'll hold SoC-specific driver data handlers soon. Signed-off-by: Anton Vorontsov avoront...@mvista.com Cc: Ben Dooks b...@simtec.co.uk Cc: Richard Röjfors richard.rojf...@pelagicore.com Cc: linux-mmc@vger.kernel.org Signed-off-by: Andrew Morton a...@linux-foundation.org --- drivers/mmc/host/sdhci-pltfm.c | 14 +- drivers/mmc/host/sdhci-pltfm.h | 14 ++ 2 files changed, 27 insertions(+), 1 deletion(-) diff -puN drivers/mmc/host/sdhci-pltfm.c~sdhci-pltfm-switch-to-module-device-table-matching drivers/mmc/host/sdhci-pltfm.c --- a/drivers/mmc/host/sdhci-pltfm.c~sdhci-pltfm-switch-to-module-device-table-matching +++ a/drivers/mmc/host/sdhci-pltfm.c @@ -24,6 +24,7 @@ #include linux/delay.h #include linux/highmem.h +#include linux/mod_devicetable.h #include linux/platform_device.h #include linux/mmc/host.h @@ -32,6 +33,7 @@ #include linux/sdhci-pltfm.h #include sdhci.h +#include sdhci-pltfm.h /*\ * * @@ -51,10 +53,14 @@ static struct sdhci_ops sdhci_pltfm_ops static int __devinit sdhci_pltfm_probe(struct platform_device *pdev) { struct sdhci_pltfm_data *pdata = pdev-dev.platform_data; + const struct platform_device_id *platid = platform_get_device_id(pdev); struct sdhci_host *host; struct resource *iomem; int ret; + if (!pdata platid platid-driver_data) + pdata = (void *)platid-driver_data; + iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!iomem) { ret = -ENOMEM; @@ -150,6 +156,12 @@ static int __devexit sdhci_pltfm_remove( return 0; } +static const struct platform_device_id sdhci_pltfm_ids[] = { + { sdhci, }, + { }, +}; +MODULE_DEVICE_TABLE(platform, sdhci_pltfm_ids); + static struct platform_driver sdhci_pltfm_driver = { .driver = { .name = sdhci, @@ -157,6 +169,7 @@ static struct platform_driver sdhci_pltf }, .probe = sdhci_pltfm_probe, .remove = __devexit_p(sdhci_pltfm_remove), + .id_table = sdhci_pltfm_ids, }; /*\ @@ -181,4 +194,3 @@ module_exit(sdhci_drv_exit); MODULE_DESCRIPTION(Secure Digital Host Controller Interface platform driver); MODULE_AUTHOR(Mocean Laboratories i...@mocean-labs.com); MODULE_LICENSE(GPL v2); -MODULE_ALIAS(platform:sdhci); diff -puN /dev/null drivers/mmc/host/sdhci-pltfm.h --- /dev/null +++ a/drivers/mmc/host/sdhci-pltfm.h @@ -0,0 +1,14 @@ +/* + * Copyright 2010 MontaVista Software, LLC. + * + * Author: Anton Vorontsov avoront...@ru.mvista.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef _DRIVERS_MMC_SDHCI_PLTFM_H +#define _DRIVERS_MMC_SDHCI_PLTFM_H + +#endif /* _DRIVERS_MMC_SDHCI_PLTFM_H */ _ Patches currently in -mm which might be from avoront...@mvista.com are origin.patch linux-next.patch sdhci-pltfm-switch-to-module-device-table-matching.patch sdhci-pltfm-reorganize-makefile-entries-to-support-soc-devices.patch sdhci-pltfm-add-support-for-cns3xxx-soc-devices.patch -- To unsubscribe from this list: send the line unsubscribe linux-mmc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
+ sdhci-pltfm-reorganize-makefile-entries-to-support-soc-devices.patch added to -mm tree
The patch titled sdhci-pltfm: reorganize Makefile entries to support SoC devices has been added to the -mm tree. Its filename is sdhci-pltfm-reorganize-makefile-entries-to-support-soc-devices.patch Before you just go and hit reply, please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ -- Subject: sdhci-pltfm: reorganize Makefile entries to support SoC devices From: Anton Vorontsov avoront...@mvista.com Due to build system limitations, intermediate and final objects can't have the same names. And as we're going to start building SoC-specific objects, let's rename the module to sdhci-platform, into which we'll link sdhci-pltfm and SoC-specifc objects. There should be no issue in renaming as the driver uses modalias mechanism. This is exactly the same approach as in sdhci-of driver. Signed-off-by: Anton Vorontsov avoront...@mvista.com Cc: Ben Dooks b...@simtec.co.uk Cc: Richard Röjfors richard.rojf...@pelagicore.com Cc: linux-mmc@vger.kernel.org Signed-off-by: Andrew Morton a...@linux-foundation.org --- drivers/mmc/host/Makefile |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff -puN drivers/mmc/host/Makefile~sdhci-pltfm-reorganize-makefile-entries-to-support-soc-devices drivers/mmc/host/Makefile --- a/drivers/mmc/host/Makefile~sdhci-pltfm-reorganize-makefile-entries-to-support-soc-devices +++ a/drivers/mmc/host/Makefile @@ -12,7 +12,6 @@ obj-$(CONFIG_MMC_IMX) += imxmmc.o obj-$(CONFIG_MMC_MXC) += mxcmmc.o obj-$(CONFIG_MMC_SDHCI)+= sdhci.o obj-$(CONFIG_MMC_SDHCI_PCI)+= sdhci-pci.o -obj-$(CONFIG_MMC_SDHCI_PLTFM) += sdhci-pltfm.o obj-$(CONFIG_MMC_SDHCI_S3C)+= sdhci-s3c.o obj-$(CONFIG_MMC_SDHCI_SPEAR) += sdhci-spear.o obj-$(CONFIG_MMC_WBSD) += wbsd.o @@ -38,6 +37,9 @@ obj-$(CONFIG_SDH_BFIN)+= bfin_sdh.o obj-$(CONFIG_MMC_SH_MMCIF) += sh_mmcif.o obj-$(CONFIG_MMC_JZ4740) += jz4740_mmc.o +obj-$(CONFIG_MMC_SDHCI_PLTFM) += sdhci-platform.o +sdhci-platform-y := sdhci-pltfm.o + obj-$(CONFIG_MMC_SDHCI_OF) += sdhci-of.o sdhci-of-y := sdhci-of-core.o sdhci-of-$(CONFIG_MMC_SDHCI_OF_ESDHC) += sdhci-of-esdhc.o _ Patches currently in -mm which might be from avoront...@mvista.com are origin.patch linux-next.patch sdhci-pltfm-switch-to-module-device-table-matching.patch sdhci-pltfm-reorganize-makefile-entries-to-support-soc-devices.patch sdhci-pltfm-add-support-for-cns3xxx-soc-devices.patch -- To unsubscribe from this list: send the line unsubscribe linux-mmc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
+ omap-pandora-pass-wl1251-information-to-sdio-core.patch added to -mm tree
The patch titled omap: pandora: pass wl1251 information to SDIO core has been added to the -mm tree. Its filename is omap-pandora-pass-wl1251-information-to-sdio-core.patch Before you just go and hit reply, please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ -- Subject: omap: pandora: pass wl1251 information to SDIO core From: Grazvydas Ignotas nota...@gmail.com Pandora has TI WL1251 attached on MMC3, which is non-standard SDIO chip. Make use MMC_QUIRK_NONSTD_SDIO to tell SDIO core about it. Signed-off-by: Grazvydas Ignotas nota...@gmail.com Cc: Adrian Hunter adrian.hun...@nokia.com Cc: Tony Lindgren t...@atomide.com Cc: Bob Copeland m...@bobcopeland.com Cc: Kalle Valo kv...@adurom.com Cc: Madhusudhan Chikkature madhu...@ti.com Cc: Kishore Kadiyala kishore.kadiy...@ti.com Cc: Russell King li...@arm.linux.org.uk Cc: linux-mmc@vger.kernel.org Signed-off-by: Andrew Morton a...@linux-foundation.org --- arch/arm/mach-omap2/board-omap3pandora.c | 16 arch/arm/mach-omap2/hsmmc.c |1 + arch/arm/mach-omap2/hsmmc.h |4 3 files changed, 21 insertions(+) diff -puN arch/arm/mach-omap2/board-omap3pandora.c~omap-pandora-pass-wl1251-information-to-sdio-core arch/arm/mach-omap2/board-omap3pandora.c --- a/arch/arm/mach-omap2/board-omap3pandora.c~omap-pandora-pass-wl1251-information-to-sdio-core +++ a/arch/arm/mach-omap2/board-omap3pandora.c @@ -29,6 +29,7 @@ #include linux/input.h #include linux/input/matrix_keypad.h #include linux/gpio_keys.h +#include linux/mmc/card.h #include asm/mach-types.h #include asm/mach/arch.h @@ -227,6 +228,20 @@ static struct platform_device pandora_ds }, }; +static void pandora_wl1251_init_card(struct mmc_card *card) +{ + /* +* We have TI wl1251 attached to MMC3. Pass this information to +* SDIO core because it can't be probed by normal methods. +*/ + card-quirks |= MMC_QUIRK_NONSTD_SDIO; + card-cccr.wide_bus = 1; + card-cis.vendor = 0x104c; + card-cis.device = 0x9066; + card-cis.blksize = 512; + card-cis.max_dtr = 2000; +} + static struct omap2_hsmmc_info omap3pandora_mmc[] = { { .mmc= 1, @@ -248,6 +263,7 @@ static struct omap2_hsmmc_info omap3pand .wires = 4, .gpio_cd= -EINVAL, .gpio_wp= -EINVAL, + .init_card = pandora_wl1251_init_card, }, {} /* Terminator */ }; diff -puN arch/arm/mach-omap2/hsmmc.c~omap-pandora-pass-wl1251-information-to-sdio-core arch/arm/mach-omap2/hsmmc.c --- a/arch/arm/mach-omap2/hsmmc.c~omap-pandora-pass-wl1251-information-to-sdio-core +++ a/arch/arm/mach-omap2/hsmmc.c @@ -268,6 +268,7 @@ void __init omap2_hsmmc_init(struct omap mmc-slots[0].gpio_wp = c-gpio_wp; mmc-slots[0].remux = c-remux; + mmc-slots[0].init_card = c-init_card; if (c-cover_only) mmc-slots[0].cover = 1; diff -puN arch/arm/mach-omap2/hsmmc.h~omap-pandora-pass-wl1251-information-to-sdio-core arch/arm/mach-omap2/hsmmc.h --- a/arch/arm/mach-omap2/hsmmc.h~omap-pandora-pass-wl1251-information-to-sdio-core +++ a/arch/arm/mach-omap2/hsmmc.h @@ -6,6 +6,8 @@ * published by the Free Software Foundation. */ +struct mmc_card; + struct omap2_hsmmc_info { u8 mmc;/* controller 1/2/3 */ u8 wires; /* 1/4/8 wires */ @@ -23,6 +25,8 @@ struct omap2_hsmmc_info { int ocr_mask; /* temporary HACK */ /* Remux (pad configuation) when powering on/off */ void (*remux)(struct device *dev, int slot, int power_on); + /* init some special card */ + void (*init_card)(struct mmc_card *card); }; #if defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE) _ Patches currently in -mm which might be from nota...@gmail.com are linux-next.patch sdio-allow-non-standard-sdio-cards.patch omap_hsmmc-add-init_card-pass-through-callback.patch omap-pandora-pass-wl1251-information-to-sdio-core.patch -- To unsubscribe from this list: send the line unsubscribe linux-mmc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
+ omap_hsmmc-add-init_card-pass-through-callback.patch added to -mm tree
The patch titled omap_hsmmc: add init_card pass-through callback has been added to the -mm tree. Its filename is omap_hsmmc-add-init_card-pass-through-callback.patch Before you just go and hit reply, please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ -- Subject: omap_hsmmc: add init_card pass-through callback From: Grazvydas Ignotas nota...@gmail.com This will allow us to set up special cards in machine drivers just after they are detected by MMC core. Signed-off-by: Grazvydas Ignotas nota...@gmail.com Cc: Adrian Hunter adrian.hun...@nokia.com Cc: Tony Lindgren t...@atomide.com Cc: Bob Copeland m...@bobcopeland.com Cc: Kalle Valo kv...@adurom.com Cc: Madhusudhan Chikkature madhu...@ti.com Cc: Kishore Kadiyala kishore.kadiy...@ti.com Cc: Russell King li...@arm.linux.org.uk Cc: linux-mmc@vger.kernel.org Signed-off-by: Andrew Morton a...@linux-foundation.org --- arch/arm/plat-omap/include/plat/mmc.h |2 ++ drivers/mmc/host/omap_hsmmc.c | 10 ++ 2 files changed, 12 insertions(+) diff -puN arch/arm/plat-omap/include/plat/mmc.h~omap_hsmmc-add-init_card-pass-through-callback arch/arm/plat-omap/include/plat/mmc.h --- a/arch/arm/plat-omap/include/plat/mmc.h~omap_hsmmc-add-init_card-pass-through-callback +++ a/arch/arm/plat-omap/include/plat/mmc.h @@ -122,6 +122,8 @@ struct omap_mmc_platform_data { /* Call back after enabling / disabling regulators */ void (*after_set_reg)(struct device *dev, int slot, int power_on, int vdd); + /* if we have special card, init it using this callback */ + void (*init_card)(struct mmc_card *card); /* return MMC cover switch state, can be NULL if not supported. * diff -puN drivers/mmc/host/omap_hsmmc.c~omap_hsmmc-add-init_card-pass-through-callback drivers/mmc/host/omap_hsmmc.c --- a/drivers/mmc/host/omap_hsmmc.c~omap_hsmmc-add-init_card-pass-through-callback +++ a/drivers/mmc/host/omap_hsmmc.c @@ -1598,6 +1598,14 @@ static int omap_hsmmc_get_ro(struct mmc_ return mmc_slot(host).get_ro(host-dev, 0); } +static void omap_hsmmc_init_card(struct mmc_host *mmc, struct mmc_card *card) +{ + struct omap_hsmmc_host *host = mmc_priv(mmc); + + if (mmc_slot(host).init_card) + mmc_slot(host).init_card(card); +} + static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host) { u32 hctl, capa, value; @@ -1869,6 +1877,7 @@ static const struct mmc_host_ops omap_hs .set_ios = omap_hsmmc_set_ios, .get_cd = omap_hsmmc_get_cd, .get_ro = omap_hsmmc_get_ro, + .init_card = omap_hsmmc_init_card, /* NYET -- enable_sdio_irq */ }; @@ -1879,6 +1888,7 @@ static const struct mmc_host_ops omap_hs .set_ios = omap_hsmmc_set_ios, .get_cd = omap_hsmmc_get_cd, .get_ro = omap_hsmmc_get_ro, + .init_card = omap_hsmmc_init_card, /* NYET -- enable_sdio_irq */ }; _ Patches currently in -mm which might be from nota...@gmail.com are linux-next.patch sdio-allow-non-standard-sdio-cards.patch omap_hsmmc-add-init_card-pass-through-callback.patch omap-pandora-pass-wl1251-information-to-sdio-core.patch -- To unsubscribe from this list: send the line unsubscribe linux-mmc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
+ sdio-allow-non-standard-sdio-cards.patch added to -mm tree
The patch titled sdio: allow non-standard SDIO cards has been added to the -mm tree. Its filename is sdio-allow-non-standard-sdio-cards.patch Before you just go and hit reply, please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ -- Subject: sdio: allow non-standard SDIO cards From: Grazvydas Ignotas nota...@gmail.com There are some chips (like TI WL12xx series) that can be interfaced over SDIO but don't support the SDIO specification, meaning that they are missing CIA (Common I/O Area) with all it's registers. Current Linux SDIO implementation relies on those registers to identify and configure the card, so non-standard cards can not function and cause lots of warnings from the core when it reads invalid data from non-existent registers. After this patch, init_card() host callback can now set new quirk MMC_QUIRK_NONSTD_SDIO, which means that SDIO core should not try to access any standard SDIO registers and rely on init_card() to fill all SDIO structures instead. As those cards are usually embedded chips, all the required information can be obtained from machine board files by the host driver when it's called through init_card() callback. Signed-off-by: Grazvydas Ignotas nota...@gmail.com Cc: Adrian Hunter adrian.hun...@nokia.com Cc: Tony Lindgren t...@atomide.com Cc: Bob Copeland m...@bobcopeland.com Cc: Kalle Valo kv...@adurom.com Cc: Madhusudhan Chikkature madhu...@ti.com Cc: Kishore Kadiyala kishore.kadiy...@ti.com Cc: Russell King li...@arm.linux.org.uk Cc: linux-mmc@vger.kernel.org Signed-off-by: Andrew Morton a...@linux-foundation.org --- drivers/mmc/core/sdio.c | 36 ++-- include/linux/mmc/card.h |2 ++ 2 files changed, 32 insertions(+), 6 deletions(-) diff -puN drivers/mmc/core/sdio.c~sdio-allow-non-standard-sdio-cards drivers/mmc/core/sdio.c --- a/drivers/mmc/core/sdio.c~sdio-allow-non-standard-sdio-cards +++ a/drivers/mmc/core/sdio.c @@ -63,13 +63,19 @@ static int sdio_init_func(struct mmc_car func-num = fn; - ret = sdio_read_fbr(func); - if (ret) - goto fail; + if (!(card-quirks MMC_QUIRK_NONSTD_SDIO)) { + ret = sdio_read_fbr(func); + if (ret) + goto fail; - ret = sdio_read_func_cis(func); - if (ret) - goto fail; + ret = sdio_read_func_cis(func); + if (ret) + goto fail; + } else { + func-vendor = func-card-cis.vendor; + func-device = func-card-cis.device; + func-max_blksize = func-card-cis.blksize; + } card-sdio_func[fn - 1] = func; @@ -412,6 +418,23 @@ static int mmc_sdio_init_card(struct mmc goto remove; } + if (card-quirks MMC_QUIRK_NONSTD_SDIO) { + /* +* This is non-standard SDIO device, meaning it doesn't +* have any CIA (Common I/O area) registers present. +* It's host's responsibility to fill cccr and cis +* structures in init_card(). +*/ + mmc_set_clock(host, card-cis.max_dtr); + + if (card-cccr.high_speed) { + mmc_card_set_highspeed(card); + mmc_set_timing(card-host, MMC_TIMING_SD_HS); + } + + goto finish; + } + /* * Read the common registers. */ @@ -480,6 +503,7 @@ static int mmc_sdio_init_card(struct mmc else if (err) goto remove; +finish: if (!oldcard) host-card = card; return 0; diff -puN include/linux/mmc/card.h~sdio-allow-non-standard-sdio-cards include/linux/mmc/card.h --- a/include/linux/mmc/card.h~sdio-allow-non-standard-sdio-cards +++ a/include/linux/mmc/card.h @@ -103,6 +103,8 @@ struct mmc_card { #define MMC_QUIRK_LENIENT_FN0 (10) /* allow SDIO FN0 writes outside of the VS CCCR range */ #define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (11) /* use func-cur_blksize */ /* for byte mode */ +#define MMC_QUIRK_NONSTD_SDIO (12) /* non-standard SDIO card attached */ + /* (missing CIA registers) */ u32 raw_cid[4]; /* raw card CID */ u32 raw_csd[4]; /* raw card CSD */ _ Patches currently in -mm which might be from