Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1382226
| From | Olliver Schinagl <oliver@schinagl.nl> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 1/2] mmc: core: Improve marking broken HPI through devicetree |
| Date | 2016-04-19 09:30 +0200 |
| Message-ID | <rpygG-33S-7@gated-at.bofh.it> (permalink) |
| References | <rpygF-33S-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
In patch 81f8a7be66 Hans de Goede added a patch to allow marking an mmc
device as to having an broken HPI implementation. After talking some
with Hans, we now think it is actually the mmc controller that can be
broken and not support broken HPI's.
This patch adds a new capability, mmc-broken-hpi, which allows us to
mark a broken hpi implementation on the host level.
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
---
drivers/mmc/core/host.c | 2 ++
drivers/mmc/core/mmc.c | 2 +-
include/linux/mmc/host.h | 1 +
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index 6e4c55a..9b63b36 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -270,6 +270,8 @@ int mmc_of_parse(struct mmc_host *host)
host->caps |= MMC_CAP_HW_RESET;
if (of_property_read_bool(np, "cap-sdio-irq"))
host->caps |= MMC_CAP_SDIO_IRQ;
+ if (of_property_read_bool(np, "mmc-broken-hpi"))
+ host->caps |= MMC_CAP_BROKEN_HPI;
if (of_property_read_bool(np, "full-pwr-cycle"))
host->caps2 |= MMC_CAP2_FULL_PWR_CYCLE;
if (of_property_read_bool(np, "keep-power-in-suspend"))
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 4dbe3df..9a19562 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1592,7 +1592,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
/*
* Enable HPI feature (if supported)
*/
- if (card->ext_csd.hpi) {
+ if (card->ext_csd.hpi && !(host->caps & MMC_CAP_BROKEN_HPI)) {
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
EXT_CSD_HPI_MGMT, 1,
card->ext_csd.generic_cmd6_time);
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 8dd4d29..20f758e 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -264,6 +264,7 @@ struct mmc_host {
#define MMC_CAP_DRIVER_TYPE_A (1 << 23) /* Host supports Driver Type A */
#define MMC_CAP_DRIVER_TYPE_C (1 << 24) /* Host supports Driver Type C */
#define MMC_CAP_DRIVER_TYPE_D (1 << 25) /* Host supports Driver Type D */
+#define MMC_CAP_BROKEN_HPI (1 << 29) /* Host support for HPI is broken */
#define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */
#define MMC_CAP_HW_RESET (1 << 31) /* Hardware reset */
--
2.8.0.rc3
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCHv1 0/2] mmc: Move broken-hpi also to the chipset level Olliver Schinagl <oliver@schinagl.nl> - 2016-04-19 09:30 +0200
[PATCH 2/2] mmc: sunxi: Mark the HPI of the mmc controller broken by default Olliver Schinagl <oliver@schinagl.nl> - 2016-04-19 09:30 +0200
[PATCH 1/2] mmc: core: Improve marking broken HPI through devicetree Olliver Schinagl <oliver@schinagl.nl> - 2016-04-19 09:30 +0200
Re: [PATCH 1/2] mmc: core: Improve marking broken HPI through devicetree Ulf Hansson <ulf.hansson@linaro.org> - 2016-04-19 11:30 +0200
Re: [PATCH 1/2] mmc: core: Improve marking broken HPI through devicetree Olliver Schinagl <oliver@schinagl.nl> - 2016-04-19 11:50 +0200
Re: [PATCH 1/2] mmc: core: Improve marking broken HPI through devicetree Jaehoon Chung <jh80.chung@samsung.com> - 2016-04-19 11:50 +0200
Re: [PATCH 1/2] mmc: core: Improve marking broken HPI through devicetree Olliver Schinagl <oliver@schinagl.nl> - 2016-04-19 14:30 +0200
Re: [PATCH 1/2] mmc: core: Improve marking broken HPI through devicetree Jaehoon Chung <jh80.chung@samsung.com> - 2016-04-19 14:50 +0200
Re: [PATCH 1/2] mmc: core: Improve marking broken HPI through devicetree Ulf Hansson <ulf.hansson@linaro.org> - 2016-04-19 12:00 +0200
Re: [PATCH 1/2] mmc: core: Improve marking broken HPI through devicetree Hans de Goede <hdegoede@redhat.com> - 2016-04-19 13:30 +0200
Re: [PATCH 1/2] mmc: core: Improve marking broken HPI through devicetree Olliver Schinagl <oliver@schinagl.nl> - 2016-04-19 14:50 +0200
Re: [PATCH 1/2] mmc: core: Improve marking broken HPI through devicetree Ulf Hansson <ulf.hansson@linaro.org> - 2016-04-19 21:30 +0200
Re: [PATCH 1/2] mmc: core: Improve marking broken HPI through devicetree Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-04-19 13:00 +0200
Re: [PATCH 1/2] mmc: core: Improve marking broken HPI through devicetree Olliver Schinagl <oliver@schinagl.nl> - 2016-04-19 14:30 +0200
Re: [PATCH 1/2] mmc: core: Improve marking broken HPI through devicetree Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-04-19 15:30 +0200
csiph-web