All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/15] mmc: core: A start to slim down public mmc headers
@ 2017-01-13 13:14 Ulf Hansson
  2017-01-13 13:14   ` Ulf Hansson
                   ` (15 more replies)
  0 siblings, 16 replies; 50+ messages in thread
From: Ulf Hansson @ 2017-01-13 13:14 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson; +Cc: Jaehoon Chung, Adrian Hunter, Linus Walleij

Changes in v3:
	- As patch 1 was applied from version 2, it has been dropped from the
	series.
	- Folded in a four new changes in patch 1->4/15, to solve build issues
	for davinci, mips and pxa.

Changes in v2:
	- As patch 1->11 was applied from version 1, those have been dropped
	from the series.
	- Folded in a new change in patch 1/12, to solve a build issue for imx
	which is using the mxcmmc platform data header.
	- Added reviews/acks.


Ideally we should not expose functions nor structures as being public available
as the interface for mmc - unless they really are intended to be used like that.

Unfortunate this is not the case today and which has lead to the mmc interface
in some cases being abused. That of course has its own problems, but we can
still move things in the right direction, which is what this series intend to
do. More precisely, it moves things that can be easily moved from the public mmc
headers to the private mmc headers.

This should be considered as a first step of improving the situation, further
additional changes will have to continue this path.


Ulf Hansson (15):
  ARM: pxa: Don't rely on public mmc header to include leds.h
  ARM: davinci: Don't rely on public mmc header to include leds.h
  ARM: davinci: Don't rely on public mmc header to include interrupt.h
  MIPS: Alchemy: Don't rely on public mmc header to include interrupt.h
  mmc: core: First step in cleaning up public mmc header files
  mmc: core: First step in cleaning up private mmc header files
  mmc: core: Move public functions from core.h to private headers
  mmc: core: Move some host specific public functions to host.h
  mmc: core: Move erase/trim/discard defines from public core.h to mmc.h
  mmc: core: Remove unused struct _mmc_csd from public mmc.h header
  mmc: omap: Don't use mmc_card_present() when validating for inserted
    card
  mmc: vub300: Don't use mmc_card_present() when validating for inserted
    card
  mmc: core: Move public functions from card.h to private headers
  mmc: core: Move public functions from host.h to private headers
  mmc: core: Don't use extern declarations of public mmc functions

 arch/arm/mach-davinci/board-da850-evm.c     |   1 +
 arch/arm/mach-davinci/board-dm644x-evm.c    |   1 +
 arch/arm/mach-davinci/board-neuros-osd2.c   |   1 +
 arch/arm/mach-davinci/board-omapl138-hawk.c |   1 +
 arch/arm/mach-pxa/balloon3.c                |   1 +
 arch/arm/mach-pxa/colibri-pxa270-income.c   |   1 +
 arch/arm/mach-pxa/corgi.c                   |   1 +
 arch/arm/mach-pxa/trizeps4.c                |   1 +
 arch/arm/mach-pxa/vpac270.c                 |   1 +
 arch/arm/mach-pxa/zeus.c                    |   1 +
 arch/arm/mach-pxa/zylonite.c                |   1 +
 arch/mips/alchemy/devboards/db1300.c        |   1 +
 drivers/mmc/core/block.c                    |   6 +
 drivers/mmc/core/block.h                    |   8 +
 drivers/mmc/core/bus.c                      |   2 +
 drivers/mmc/core/bus.h                      |  16 +-
 drivers/mmc/core/card.h                     | 223 +++++++++++++++++++++++++
 drivers/mmc/core/core.c                     |   1 +
 drivers/mmc/core/core.h                     |  41 ++++-
 drivers/mmc/core/debugfs.c                  |   2 +
 drivers/mmc/core/host.h                     |  48 ++++++
 drivers/mmc/core/mmc.c                      |  13 ++
 drivers/mmc/core/mmc_ops.h                  |  14 ++
 drivers/mmc/core/mmc_test.c                 |   5 +
 drivers/mmc/core/pwrseq.h                   |   6 +-
 drivers/mmc/core/queue.c                    |   2 +
 drivers/mmc/core/queue.h                    |   6 +-
 drivers/mmc/core/quirks.c                   |   2 +
 drivers/mmc/core/sd.c                       |   2 +
 drivers/mmc/core/sd.h                       |   5 +-
 drivers/mmc/core/sd_ops.h                   |   9 ++
 drivers/mmc/core/sdio.c                     |   2 +
 drivers/mmc/core/sdio_bus.c                 |   1 +
 drivers/mmc/core/sdio_bus.h                 |   3 +
 drivers/mmc/core/sdio_cis.h                 |   3 +
 drivers/mmc/core/sdio_io.c                  |   2 +
 drivers/mmc/core/sdio_irq.c                 |   2 +
 drivers/mmc/core/sdio_ops.h                 |   5 +
 drivers/mmc/core/slot-gpio.h                |   2 +
 drivers/mmc/host/omap.c                     |   2 +-
 drivers/mmc/host/vub300.c                   |   6 +-
 include/linux/mmc/card.h                    | 242 ----------------------------
 include/linux/mmc/core.h                    |  86 ++--------
 include/linux/mmc/host.h                    |  63 ++------
 include/linux/mmc/mmc.h                     |  59 ++-----
 include/linux/mmc/slot-gpio.h               |   3 +
 46 files changed, 478 insertions(+), 426 deletions(-)
 create mode 100644 drivers/mmc/core/card.h

-- 
1.9.1


^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v3 01/15] ARM: pxa: Don't rely on public mmc header to include leds.h
  2017-01-13 13:14 [PATCH v3 00/15] mmc: core: A start to slim down public mmc headers Ulf Hansson
@ 2017-01-13 13:14   ` Ulf Hansson
  2017-01-13 13:14   ` Ulf Hansson
                     ` (14 subsequent siblings)
  15 siblings, 0 replies; 50+ messages in thread
From: Ulf Hansson @ 2017-01-13 13:14 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson
  Cc: Jaehoon Chung, Adrian Hunter, Linus Walleij, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, linux-arm-kernel

Some of the pxa platforms, balloon3, colibri-pxa270-income, corgi,
trizeps4, vpac270, zeus and zylonite depends on leds.h. Explicitly include
it instead of relying on the public mmc header host.h.

Cc: Daniel Mack <daniel@zonque.org>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: <linux-arm-kernel@lists.infradead.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---

I am seeking an ack for this change as following changes for mmc in the
series, has build-dependencies to it.

---
 arch/arm/mach-pxa/balloon3.c              | 1 +
 arch/arm/mach-pxa/colibri-pxa270-income.c | 1 +
 arch/arm/mach-pxa/corgi.c                 | 1 +
 arch/arm/mach-pxa/trizeps4.c              | 1 +
 arch/arm/mach-pxa/vpac270.c               | 1 +
 arch/arm/mach-pxa/zeus.c                  | 1 +
 arch/arm/mach-pxa/zylonite.c              | 1 +
 7 files changed, 7 insertions(+)

diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c
index 8a3c409..d452a49 100644
--- a/arch/arm/mach-pxa/balloon3.c
+++ b/arch/arm/mach-pxa/balloon3.c
@@ -17,6 +17,7 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/interrupt.h>
+#include <linux/leds.h>
 #include <linux/sched.h>
 #include <linux/bitops.h>
 #include <linux/fb.h>
diff --git a/arch/arm/mach-pxa/colibri-pxa270-income.c b/arch/arm/mach-pxa/colibri-pxa270-income.c
index 8cff770..d7cf47d 100644
--- a/arch/arm/mach-pxa/colibri-pxa270-income.c
+++ b/arch/arm/mach-pxa/colibri-pxa270-income.c
@@ -17,6 +17,7 @@
 #include <linux/gpio.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
+#include <linux/leds.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index 183cd34..7270f0d 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -19,6 +19,7 @@
 #include <linux/major.h>
 #include <linux/fs.h>
 #include <linux/interrupt.h>
+#include <linux/leds.h>
 #include <linux/mmc/host.h>
 #include <linux/mtd/physmap.h>
 #include <linux/pm.h>
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c
index ea78bc5..3dd13b4 100644
--- a/arch/arm/mach-pxa/trizeps4.c
+++ b/arch/arm/mach-pxa/trizeps4.c
@@ -16,6 +16,7 @@
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 #include <linux/interrupt.h>
+#include <linux/leds.h>
 #include <linux/export.h>
 #include <linux/sched.h>
 #include <linux/bitops.h>
diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c
index c006ee9..70ab3ad 100644
--- a/arch/arm/mach-pxa/vpac270.c
+++ b/arch/arm/mach-pxa/vpac270.c
@@ -15,6 +15,7 @@
 #include <linux/irq.h>
 #include <linux/gpio_keys.h>
 #include <linux/input.h>
+#include <linux/leds.h>
 #include <linux/gpio.h>
 #include <linux/usb/gpio_vbus.h>
 #include <linux/mtd/mtd.h>
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c
index 3b94ecf..ecbcaee 100644
--- a/arch/arm/mach-pxa/zeus.c
+++ b/arch/arm/mach-pxa/zeus.c
@@ -13,6 +13,7 @@
 
 #include <linux/cpufreq.h>
 #include <linux/interrupt.h>
+#include <linux/leds.h>
 #include <linux/irq.h>
 #include <linux/pm.h>
 #include <linux/gpio.h>
diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c
index 3642389..4268552 100644
--- a/arch/arm/mach-pxa/zylonite.c
+++ b/arch/arm/mach-pxa/zylonite.c
@@ -16,6 +16,7 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
+#include <linux/leds.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v3 01/15] ARM: pxa: Don't rely on public mmc header to include leds.h
@ 2017-01-13 13:14   ` Ulf Hansson
  0 siblings, 0 replies; 50+ messages in thread
From: Ulf Hansson @ 2017-01-13 13:14 UTC (permalink / raw)
  To: linux-arm-kernel

Some of the pxa platforms, balloon3, colibri-pxa270-income, corgi,
trizeps4, vpac270, zeus and zylonite depends on leds.h. Explicitly include
it instead of relying on the public mmc header host.h.

Cc: Daniel Mack <daniel@zonque.org>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: <linux-arm-kernel@lists.infradead.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---

I am seeking an ack for this change as following changes for mmc in the
series, has build-dependencies to it.

---
 arch/arm/mach-pxa/balloon3.c              | 1 +
 arch/arm/mach-pxa/colibri-pxa270-income.c | 1 +
 arch/arm/mach-pxa/corgi.c                 | 1 +
 arch/arm/mach-pxa/trizeps4.c              | 1 +
 arch/arm/mach-pxa/vpac270.c               | 1 +
 arch/arm/mach-pxa/zeus.c                  | 1 +
 arch/arm/mach-pxa/zylonite.c              | 1 +
 7 files changed, 7 insertions(+)

diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c
index 8a3c409..d452a49 100644
--- a/arch/arm/mach-pxa/balloon3.c
+++ b/arch/arm/mach-pxa/balloon3.c
@@ -17,6 +17,7 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/interrupt.h>
+#include <linux/leds.h>
 #include <linux/sched.h>
 #include <linux/bitops.h>
 #include <linux/fb.h>
diff --git a/arch/arm/mach-pxa/colibri-pxa270-income.c b/arch/arm/mach-pxa/colibri-pxa270-income.c
index 8cff770..d7cf47d 100644
--- a/arch/arm/mach-pxa/colibri-pxa270-income.c
+++ b/arch/arm/mach-pxa/colibri-pxa270-income.c
@@ -17,6 +17,7 @@
 #include <linux/gpio.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
+#include <linux/leds.h>
 #include <linux/ioport.h>
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index 183cd34..7270f0d 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -19,6 +19,7 @@
 #include <linux/major.h>
 #include <linux/fs.h>
 #include <linux/interrupt.h>
+#include <linux/leds.h>
 #include <linux/mmc/host.h>
 #include <linux/mtd/physmap.h>
 #include <linux/pm.h>
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c
index ea78bc5..3dd13b4 100644
--- a/arch/arm/mach-pxa/trizeps4.c
+++ b/arch/arm/mach-pxa/trizeps4.c
@@ -16,6 +16,7 @@
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 #include <linux/interrupt.h>
+#include <linux/leds.h>
 #include <linux/export.h>
 #include <linux/sched.h>
 #include <linux/bitops.h>
diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c
index c006ee9..70ab3ad 100644
--- a/arch/arm/mach-pxa/vpac270.c
+++ b/arch/arm/mach-pxa/vpac270.c
@@ -15,6 +15,7 @@
 #include <linux/irq.h>
 #include <linux/gpio_keys.h>
 #include <linux/input.h>
+#include <linux/leds.h>
 #include <linux/gpio.h>
 #include <linux/usb/gpio_vbus.h>
 #include <linux/mtd/mtd.h>
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c
index 3b94ecf..ecbcaee 100644
--- a/arch/arm/mach-pxa/zeus.c
+++ b/arch/arm/mach-pxa/zeus.c
@@ -13,6 +13,7 @@
 
 #include <linux/cpufreq.h>
 #include <linux/interrupt.h>
+#include <linux/leds.h>
 #include <linux/irq.h>
 #include <linux/pm.h>
 #include <linux/gpio.h>
diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c
index 3642389..4268552 100644
--- a/arch/arm/mach-pxa/zylonite.c
+++ b/arch/arm/mach-pxa/zylonite.c
@@ -16,6 +16,7 @@
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
+#include <linux/leds.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v3 02/15] ARM: davinci: Don't rely on public mmc header to include leds.h
  2017-01-13 13:14 [PATCH v3 00/15] mmc: core: A start to slim down public mmc headers Ulf Hansson
@ 2017-01-13 13:14   ` Ulf Hansson
  2017-01-13 13:14   ` Ulf Hansson
                     ` (14 subsequent siblings)
  15 siblings, 0 replies; 50+ messages in thread
From: Ulf Hansson @ 2017-01-13 13:14 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson
  Cc: Jaehoon Chung, Adrian Hunter, Linus Walleij, Sekhar Nori,
	Kevin Hilman, linux-arm-kernel

Some of the davinci boards, da850-evm, dm644x-evm and neuros-osd2 depends
on leds.h. Explicitly include it instead of relying on the public mmc
header host.h.

Cc: Sekhar Nori <nsekhar@ti.com>
Cc: Kevin Hilman <khilman@kernel.org>
Cc: <linux-arm-kernel@lists.infradead.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---

I am seeking an ack for this change as following changes for mmc in the
series, has build-dependencies to it.

---
 arch/arm/mach-davinci/board-da850-evm.c   | 1 +
 arch/arm/mach-davinci/board-dm644x-evm.c  | 1 +
 arch/arm/mach-davinci/board-neuros-osd2.c | 1 +
 3 files changed, 3 insertions(+)

diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index aac3ab1..df3ca38 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -18,6 +18,7 @@
 #include <linux/gpio/machine.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
+#include <linux/leds.h>
 #include <linux/i2c.h>
 #include <linux/platform_data/at24.h>
 #include <linux/platform_data/pca953x.h>
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 521e4097..023480b 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -25,6 +25,7 @@
 #include <linux/videodev2.h>
 #include <linux/v4l2-dv-timings.h>
 #include <linux/export.h>
+#include <linux/leds.h>
 
 #include <media/i2c/tvp514x.h>
 
diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c
index ad10017..0a78388 100644
--- a/arch/arm/mach-davinci/board-neuros-osd2.c
+++ b/arch/arm/mach-davinci/board-neuros-osd2.c
@@ -25,6 +25,7 @@
  */
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
+#include <linux/leds.h>
 #include <linux/mtd/partitions.h>
 #include <linux/platform_data/gpio-davinci.h>
 #include <linux/platform_data/i2c-davinci.h>
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v3 02/15] ARM: davinci: Don't rely on public mmc header to include leds.h
@ 2017-01-13 13:14   ` Ulf Hansson
  0 siblings, 0 replies; 50+ messages in thread
From: Ulf Hansson @ 2017-01-13 13:14 UTC (permalink / raw)
  To: linux-arm-kernel

Some of the davinci boards, da850-evm, dm644x-evm and neuros-osd2 depends
on leds.h. Explicitly include it instead of relying on the public mmc
header host.h.

Cc: Sekhar Nori <nsekhar@ti.com>
Cc: Kevin Hilman <khilman@kernel.org>
Cc: <linux-arm-kernel@lists.infradead.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---

I am seeking an ack for this change as following changes for mmc in the
series, has build-dependencies to it.

---
 arch/arm/mach-davinci/board-da850-evm.c   | 1 +
 arch/arm/mach-davinci/board-dm644x-evm.c  | 1 +
 arch/arm/mach-davinci/board-neuros-osd2.c | 1 +
 3 files changed, 3 insertions(+)

diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c
index aac3ab1..df3ca38 100644
--- a/arch/arm/mach-davinci/board-da850-evm.c
+++ b/arch/arm/mach-davinci/board-da850-evm.c
@@ -18,6 +18,7 @@
 #include <linux/gpio/machine.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
+#include <linux/leds.h>
 #include <linux/i2c.h>
 #include <linux/platform_data/at24.h>
 #include <linux/platform_data/pca953x.h>
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 521e4097..023480b 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -25,6 +25,7 @@
 #include <linux/videodev2.h>
 #include <linux/v4l2-dv-timings.h>
 #include <linux/export.h>
+#include <linux/leds.h>
 
 #include <media/i2c/tvp514x.h>
 
diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c
index ad10017..0a78388 100644
--- a/arch/arm/mach-davinci/board-neuros-osd2.c
+++ b/arch/arm/mach-davinci/board-neuros-osd2.c
@@ -25,6 +25,7 @@
  */
 #include <linux/platform_device.h>
 #include <linux/gpio.h>
+#include <linux/leds.h>
 #include <linux/mtd/partitions.h>
 #include <linux/platform_data/gpio-davinci.h>
 #include <linux/platform_data/i2c-davinci.h>
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v3 03/15] ARM: davinci: Don't rely on public mmc header to include interrupt.h
  2017-01-13 13:14 [PATCH v3 00/15] mmc: core: A start to slim down public mmc headers Ulf Hansson
@ 2017-01-13 13:14   ` Ulf Hansson
  2017-01-13 13:14   ` Ulf Hansson
                     ` (14 subsequent siblings)
  15 siblings, 0 replies; 50+ messages in thread
From: Ulf Hansson @ 2017-01-13 13:14 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson
  Cc: Jaehoon Chung, Adrian Hunter, Linus Walleij, Sekhar Nori,
	Kevin Hilman, linux-arm-kernel

The davinci board omapl138-hawk, depends on interrupt.h. Explicitly include
it instead of relying on the public mmc header host.h.

Cc: Sekhar Nori <nsekhar@ti.com>
Cc: Kevin Hilman <khilman@kernel.org>
Cc: <linux-arm-kernel@lists.infradead.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---

I am seeking an ack for this change as following changes for mmc in the
series, has build-dependencies to it.

---
 arch/arm/mach-davinci/board-omapl138-hawk.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-davinci/board-omapl138-hawk.c b/arch/arm/mach-davinci/board-omapl138-hawk.c
index 41d5500..a3e7807 100644
--- a/arch/arm/mach-davinci/board-omapl138-hawk.c
+++ b/arch/arm/mach-davinci/board-omapl138-hawk.c
@@ -12,6 +12,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/console.h>
+#include <linux/interrupt.h>
 #include <linux/gpio.h>
 #include <linux/gpio/machine.h>
 #include <linux/platform_data/gpio-davinci.h>
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v3 03/15] ARM: davinci: Don't rely on public mmc header to include interrupt.h
@ 2017-01-13 13:14   ` Ulf Hansson
  0 siblings, 0 replies; 50+ messages in thread
From: Ulf Hansson @ 2017-01-13 13:14 UTC (permalink / raw)
  To: linux-arm-kernel

The davinci board omapl138-hawk, depends on interrupt.h. Explicitly include
it instead of relying on the public mmc header host.h.

Cc: Sekhar Nori <nsekhar@ti.com>
Cc: Kevin Hilman <khilman@kernel.org>
Cc: <linux-arm-kernel@lists.infradead.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---

I am seeking an ack for this change as following changes for mmc in the
series, has build-dependencies to it.

---
 arch/arm/mach-davinci/board-omapl138-hawk.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-davinci/board-omapl138-hawk.c b/arch/arm/mach-davinci/board-omapl138-hawk.c
index 41d5500..a3e7807 100644
--- a/arch/arm/mach-davinci/board-omapl138-hawk.c
+++ b/arch/arm/mach-davinci/board-omapl138-hawk.c
@@ -12,6 +12,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/console.h>
+#include <linux/interrupt.h>
 #include <linux/gpio.h>
 #include <linux/gpio/machine.h>
 #include <linux/platform_data/gpio-davinci.h>
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v3 04/15] MIPS: Alchemy: Don't rely on public mmc header to include interrupt.h
@ 2017-01-13 13:14   ` Ulf Hansson
  0 siblings, 0 replies; 50+ messages in thread
From: Ulf Hansson @ 2017-01-13 13:14 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson
  Cc: Jaehoon Chung, Adrian Hunter, Linus Walleij, Ralf Baechle, linux-mips

The MIPS Alchemy db1300 dev board depends on interrupt.h. Explicitly
include it instead of relying on the public mmc header host.h.

Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: <linux-mips@linux-mips.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---

I am seeking an ack for this change as following changes for mmc in the
series, has build-dependencies to it.

---
 arch/mips/alchemy/devboards/db1300.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/mips/alchemy/devboards/db1300.c b/arch/mips/alchemy/devboards/db1300.c
index d3c087f..a5504f5 100644
--- a/arch/mips/alchemy/devboards/db1300.c
+++ b/arch/mips/alchemy/devboards/db1300.c
@@ -13,6 +13,7 @@
 #include <linux/i2c.h>
 #include <linux/io.h>
 #include <linux/leds.h>
+#include <linux/interrupt.h>
 #include <linux/ata_platform.h>
 #include <linux/mmc/host.h>
 #include <linux/module.h>
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v3 04/15] MIPS: Alchemy: Don't rely on public mmc header to include interrupt.h
@ 2017-01-13 13:14   ` Ulf Hansson
  0 siblings, 0 replies; 50+ messages in thread
From: Ulf Hansson @ 2017-01-13 13:14 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson
  Cc: Jaehoon Chung, Adrian Hunter, Linus Walleij, Ralf Baechle, linux-mips

The MIPS Alchemy db1300 dev board depends on interrupt.h. Explicitly
include it instead of relying on the public mmc header host.h.

Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: <linux-mips@linux-mips.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---

I am seeking an ack for this change as following changes for mmc in the
series, has build-dependencies to it.

---
 arch/mips/alchemy/devboards/db1300.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/mips/alchemy/devboards/db1300.c b/arch/mips/alchemy/devboards/db1300.c
index d3c087f..a5504f5 100644
--- a/arch/mips/alchemy/devboards/db1300.c
+++ b/arch/mips/alchemy/devboards/db1300.c
@@ -13,6 +13,7 @@
 #include <linux/i2c.h>
 #include <linux/io.h>
 #include <linux/leds.h>
+#include <linux/interrupt.h>
 #include <linux/ata_platform.h>
 #include <linux/mmc/host.h>
 #include <linux/module.h>
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v3 05/15] mmc: core: First step in cleaning up public mmc header files
  2017-01-13 13:14 [PATCH v3 00/15] mmc: core: A start to slim down public mmc headers Ulf Hansson
                   ` (3 preceding siblings ...)
  2017-01-13 13:14   ` Ulf Hansson
@ 2017-01-13 13:14 ` Ulf Hansson
  2017-01-16  2:54   ` Shawn Lin
  2017-01-13 13:14 ` [PATCH v3 06/15] mmc: core: First step in cleaning up private " Ulf Hansson
                   ` (10 subsequent siblings)
  15 siblings, 1 reply; 50+ messages in thread
From: Ulf Hansson @ 2017-01-13 13:14 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson; +Cc: Jaehoon Chung, Adrian Hunter, Linus Walleij

This is the first step in cleaning up the public mmc header files. In this
change we makes sure each header file builds standalone, as that helps to
resolve dependencies.

While changing this, it also seems reasonable to stop including other
headers from inside a header itself which it don't depend upon.
Additionally, in some cases such dependencies are better resolved by
forward declaring the needed struct.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 include/linux/mmc/card.h      | 2 --
 include/linux/mmc/core.h      | 3 +--
 include/linux/mmc/host.h      | 9 ++-------
 include/linux/mmc/mmc.h       | 2 ++
 include/linux/mmc/slot-gpio.h | 3 +++
 5 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 00449e5..ca64f5b 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -11,7 +11,6 @@
 #define LINUX_MMC_CARD_H
 
 #include <linux/device.h>
-#include <linux/mmc/core.h>
 #include <linux/mod_devicetable.h>
 
 struct mmc_cid {
@@ -206,7 +205,6 @@ struct sdio_cis {
 };
 
 struct mmc_host;
-struct mmc_ios;
 struct sdio_func;
 struct sdio_func_tuple;
 
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index e33cc74..64e2ddf 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -8,10 +8,9 @@
 #ifndef LINUX_MMC_CORE_H
 #define LINUX_MMC_CORE_H
 
-#include <linux/interrupt.h>
 #include <linux/completion.h>
+#include <linux/types.h>
 
-struct request;
 struct mmc_data;
 struct mmc_request;
 
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 8bc8841..8d38c76 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -10,16 +10,12 @@
 #ifndef LINUX_MMC_HOST_H
 #define LINUX_MMC_HOST_H
 
-#include <linux/leds.h>
-#include <linux/mutex.h>
-#include <linux/timer.h>
 #include <linux/sched.h>
 #include <linux/device.h>
 #include <linux/fault-inject.h>
 
 #include <linux/mmc/core.h>
 #include <linux/mmc/card.h>
-#include <linux/mmc/mmc.h>
 #include <linux/mmc/pm.h>
 
 struct mmc_ios {
@@ -82,6 +78,8 @@ struct mmc_ios {
 	bool enhanced_strobe;			/* hs400es selection */
 };
 
+struct mmc_host;
+
 struct mmc_host_ops {
 	/*
 	 * It is optional for the host to implement pre_req and post_req in
@@ -162,9 +160,6 @@ struct mmc_host_ops {
 				  unsigned int direction, int blk_size);
 };
 
-struct mmc_card;
-struct device;
-
 struct mmc_async_req {
 	/* active mmc request */
 	struct mmc_request	*mrq;
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index a074082..261772e 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -24,6 +24,8 @@
 #ifndef LINUX_MMC_MMC_H
 #define LINUX_MMC_MMC_H
 
+#include <linux/types.h>
+
 /* Standard MMC commands (4.1)           type  argument     response */
    /* class 1 */
 #define MMC_GO_IDLE_STATE         0   /* bc                          */
diff --git a/include/linux/mmc/slot-gpio.h b/include/linux/mmc/slot-gpio.h
index a7972cd..82f0d28 100644
--- a/include/linux/mmc/slot-gpio.h
+++ b/include/linux/mmc/slot-gpio.h
@@ -11,6 +11,9 @@
 #ifndef MMC_SLOT_GPIO_H
 #define MMC_SLOT_GPIO_H
 
+#include <linux/types.h>
+#include <linux/irqreturn.h>
+
 struct mmc_host;
 
 int mmc_gpio_get_ro(struct mmc_host *host);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v3 06/15] mmc: core: First step in cleaning up private mmc header files
  2017-01-13 13:14 [PATCH v3 00/15] mmc: core: A start to slim down public mmc headers Ulf Hansson
                   ` (4 preceding siblings ...)
  2017-01-13 13:14 ` [PATCH v3 05/15] mmc: core: First step in cleaning up public mmc header files Ulf Hansson
@ 2017-01-13 13:14 ` Ulf Hansson
  2017-01-16  2:56   ` Shawn Lin
  2017-01-13 13:14 ` [PATCH v3 07/15] mmc: core: Move public functions from core.h to private headers Ulf Hansson
                   ` (9 subsequent siblings)
  15 siblings, 1 reply; 50+ messages in thread
From: Ulf Hansson @ 2017-01-13 13:14 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson; +Cc: Jaehoon Chung, Adrian Hunter, Linus Walleij

This is the first step in cleaning up the private mmc header files. In this
change we makes sure each header file builds standalone, as that helps to
resolve dependencies.

While changing this, it also seems reasonable to stop including other
headers from inside a header itself which it don't depend upon.
Additionally, in some cases such dependencies are better resolved by
forward declaring the needed struct.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/mmc/core/block.h     | 8 ++++++++
 drivers/mmc/core/bus.h       | 4 ++++
 drivers/mmc/core/core.h      | 4 ++++
 drivers/mmc/core/host.h      | 3 ++-
 drivers/mmc/core/mmc_ops.h   | 5 +++++
 drivers/mmc/core/pwrseq.h    | 6 +++++-
 drivers/mmc/core/queue.h     | 6 +++++-
 drivers/mmc/core/sd.h        | 5 ++++-
 drivers/mmc/core/sd_ops.h    | 5 +++++
 drivers/mmc/core/sdio_bus.h  | 3 +++
 drivers/mmc/core/sdio_cis.h  | 3 +++
 drivers/mmc/core/sdio_ops.h  | 4 ++++
 drivers/mmc/core/slot-gpio.h | 2 ++
 13 files changed, 54 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/core/block.h b/drivers/mmc/core/block.h
index cdabb2e..00b7483 100644
--- a/drivers/mmc/core/block.h
+++ b/drivers/mmc/core/block.h
@@ -1 +1,9 @@
+#ifndef _MMC_CORE_BLOCK_H
+#define _MMC_CORE_BLOCK_H
+
+struct mmc_queue;
+struct request;
+
 int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req);
+
+#endif
diff --git a/drivers/mmc/core/bus.h b/drivers/mmc/core/bus.h
index 00a1971..93b516a 100644
--- a/drivers/mmc/core/bus.h
+++ b/drivers/mmc/core/bus.h
@@ -11,6 +11,10 @@
 #ifndef _MMC_CORE_BUS_H
 #define _MMC_CORE_BUS_H
 
+struct mmc_host;
+struct mmc_card;
+struct device_type;
+
 #define MMC_DEV_ATTR(name, fmt, args...)					\
 static ssize_t mmc_##name##_show (struct device *dev, struct device_attribute *attr, char *buf)	\
 {										\
diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h
index 0fa86a2..29b91ae 100644
--- a/drivers/mmc/core/core.h
+++ b/drivers/mmc/core/core.h
@@ -12,6 +12,10 @@
 #define _MMC_CORE_CORE_H
 
 #include <linux/delay.h>
+#include <linux/sched.h>
+
+struct mmc_host;
+struct mmc_card;
 
 #define MMC_CMD_RETRIES        3
 
diff --git a/drivers/mmc/core/host.h b/drivers/mmc/core/host.h
index 992bf53..366ce79 100644
--- a/drivers/mmc/core/host.h
+++ b/drivers/mmc/core/host.h
@@ -10,7 +10,8 @@
  */
 #ifndef _MMC_CORE_HOST_H
 #define _MMC_CORE_HOST_H
-#include <linux/mmc/host.h>
+
+struct mmc_host;
 
 int mmc_register_host_class(void);
 void mmc_unregister_host_class(void);
diff --git a/drivers/mmc/core/mmc_ops.h b/drivers/mmc/core/mmc_ops.h
index abd525e..e76365a 100644
--- a/drivers/mmc/core/mmc_ops.h
+++ b/drivers/mmc/core/mmc_ops.h
@@ -12,6 +12,11 @@
 #ifndef _MMC_MMC_OPS_H
 #define _MMC_MMC_OPS_H
 
+#include <linux/types.h>
+
+struct mmc_host;
+struct mmc_card;
+
 int mmc_select_card(struct mmc_card *card);
 int mmc_deselect_cards(struct mmc_host *host);
 int mmc_set_dsr(struct mmc_host *host);
diff --git a/drivers/mmc/core/pwrseq.h b/drivers/mmc/core/pwrseq.h
index d69e751..39c911a 100644
--- a/drivers/mmc/core/pwrseq.h
+++ b/drivers/mmc/core/pwrseq.h
@@ -8,7 +8,11 @@
 #ifndef _MMC_CORE_PWRSEQ_H
 #define _MMC_CORE_PWRSEQ_H
 
-#include <linux/mmc/host.h>
+#include <linux/types.h>
+
+struct mmc_host;
+struct device;
+struct module;
 
 struct mmc_pwrseq_ops {
 	void (*pre_power_on)(struct mmc_host *host);
diff --git a/drivers/mmc/core/queue.h b/drivers/mmc/core/queue.h
index dac8c3d..0cea02a 100644
--- a/drivers/mmc/core/queue.h
+++ b/drivers/mmc/core/queue.h
@@ -1,6 +1,11 @@
 #ifndef MMC_QUEUE_H
 #define MMC_QUEUE_H
 
+#include <linux/types.h>
+#include <linux/blkdev.h>
+#include <linux/mmc/core.h>
+#include <linux/mmc/host.h>
+
 static inline bool mmc_req_is_special(struct request *req)
 {
 	return req &&
@@ -9,7 +14,6 @@ static inline bool mmc_req_is_special(struct request *req)
 		 req_op(req) == REQ_OP_SECURE_ERASE);
 }
 
-struct request;
 struct task_struct;
 struct mmc_blk_data;
 
diff --git a/drivers/mmc/core/sd.h b/drivers/mmc/core/sd.h
index aab824a..1ada980 100644
--- a/drivers/mmc/core/sd.h
+++ b/drivers/mmc/core/sd.h
@@ -1,10 +1,13 @@
 #ifndef _MMC_CORE_SD_H
 #define _MMC_CORE_SD_H
 
-#include <linux/mmc/card.h>
+#include <linux/types.h>
 
 extern struct device_type sd_type;
 
+struct mmc_host;
+struct mmc_card;
+
 int mmc_sd_get_cid(struct mmc_host *host, u32 ocr, u32 *cid, u32 *rocr);
 int mmc_sd_get_csd(struct mmc_host *host, struct mmc_card *card);
 void mmc_decode_cid(struct mmc_card *card);
diff --git a/drivers/mmc/core/sd_ops.h b/drivers/mmc/core/sd_ops.h
index ffc2305..ac7223c 100644
--- a/drivers/mmc/core/sd_ops.h
+++ b/drivers/mmc/core/sd_ops.h
@@ -12,6 +12,11 @@
 #ifndef _MMC_SD_OPS_H
 #define _MMC_SD_OPS_H
 
+#include <linux/types.h>
+
+struct mmc_card;
+struct mmc_host;
+
 int mmc_app_set_bus_width(struct mmc_card *card, int width);
 int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr);
 int mmc_send_if_cond(struct mmc_host *host, u32 ocr);
diff --git a/drivers/mmc/core/sdio_bus.h b/drivers/mmc/core/sdio_bus.h
index 567a768..b69a254 100644
--- a/drivers/mmc/core/sdio_bus.h
+++ b/drivers/mmc/core/sdio_bus.h
@@ -11,6 +11,9 @@
 #ifndef _MMC_CORE_SDIO_BUS_H
 #define _MMC_CORE_SDIO_BUS_H
 
+struct mmc_card;
+struct sdio_func;
+
 struct sdio_func *sdio_alloc_func(struct mmc_card *card);
 int sdio_add_func(struct sdio_func *func);
 void sdio_remove_func(struct sdio_func *func);
diff --git a/drivers/mmc/core/sdio_cis.h b/drivers/mmc/core/sdio_cis.h
index 4d903c2..16aa563 100644
--- a/drivers/mmc/core/sdio_cis.h
+++ b/drivers/mmc/core/sdio_cis.h
@@ -14,6 +14,9 @@
 #ifndef _MMC_SDIO_CIS_H
 #define _MMC_SDIO_CIS_H
 
+struct mmc_card;
+struct sdio_func;
+
 int sdio_read_common_cis(struct mmc_card *card);
 void sdio_free_common_cis(struct mmc_card *card);
 
diff --git a/drivers/mmc/core/sdio_ops.h b/drivers/mmc/core/sdio_ops.h
index 5660c7f..e1c36d6 100644
--- a/drivers/mmc/core/sdio_ops.h
+++ b/drivers/mmc/core/sdio_ops.h
@@ -12,8 +12,12 @@
 #ifndef _MMC_SDIO_OPS_H
 #define _MMC_SDIO_OPS_H
 
+#include <linux/types.h>
 #include <linux/mmc/sdio.h>
 
+struct mmc_host;
+struct mmc_card;
+
 int mmc_send_io_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr);
 int mmc_io_rw_direct(struct mmc_card *card, int write, unsigned fn,
 	unsigned addr, u8 in, u8* out);
diff --git a/drivers/mmc/core/slot-gpio.h b/drivers/mmc/core/slot-gpio.h
index 8c1854d..a06fd84 100644
--- a/drivers/mmc/core/slot-gpio.h
+++ b/drivers/mmc/core/slot-gpio.h
@@ -8,6 +8,8 @@
 #ifndef _MMC_CORE_SLOTGPIO_H
 #define _MMC_CORE_SLOTGPIO_H
 
+struct mmc_host;
+
 int mmc_gpio_alloc(struct mmc_host *host);
 
 #endif
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v3 07/15] mmc: core: Move public functions from core.h to private headers
  2017-01-13 13:14 [PATCH v3 00/15] mmc: core: A start to slim down public mmc headers Ulf Hansson
                   ` (5 preceding siblings ...)
  2017-01-13 13:14 ` [PATCH v3 06/15] mmc: core: First step in cleaning up private " Ulf Hansson
@ 2017-01-13 13:14 ` Ulf Hansson
  2017-01-16  3:01   ` Shawn Lin
  2017-01-13 13:14 ` [PATCH v3 08/15] mmc: core: Move some host specific public functions to host.h Ulf Hansson
                   ` (8 subsequent siblings)
  15 siblings, 1 reply; 50+ messages in thread
From: Ulf Hansson @ 2017-01-13 13:14 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson; +Cc: Jaehoon Chung, Adrian Hunter, Linus Walleij

A significant amount of functions are available through the public mmc
core.h header file. Let's slim down this public mmc interface, as to
prevent users from abusing it, by moving some of the functions to private
mmc header files.

This change concentrates on moving the functions into private mmc headers,
following changes may continue with additional clean-ups, as an example
some functions can be turned into static.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/mmc/core/block.c    |  3 +++
 drivers/mmc/core/core.h     | 37 ++++++++++++++++++++++++++++++++-
 drivers/mmc/core/mmc_ops.h  |  9 ++++++++
 drivers/mmc/core/mmc_test.c |  2 ++
 drivers/mmc/core/queue.c    |  1 +
 drivers/mmc/core/sd_ops.h   |  4 ++++
 drivers/mmc/core/sdio_io.c  |  1 +
 drivers/mmc/core/sdio_irq.c |  1 +
 drivers/mmc/core/sdio_ops.h |  1 +
 include/linux/mmc/core.h    | 50 ---------------------------------------------
 10 files changed, 58 insertions(+), 51 deletions(-)

diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index 6adc3ce..41b5dbc 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -47,6 +47,9 @@
 
 #include "queue.h"
 #include "block.h"
+#include "core.h"
+#include "mmc_ops.h"
+#include "sd_ops.h"
 
 MODULE_ALIAS("mmc:block");
 #ifdef MODULE_PARAM_PREFIX
diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h
index 29b91ae..8a95c825 100644
--- a/drivers/mmc/core/core.h
+++ b/drivers/mmc/core/core.h
@@ -16,6 +16,7 @@
 
 struct mmc_host;
 struct mmc_card;
+struct mmc_request;
 
 #define MMC_CMD_RETRIES        3
 
@@ -73,6 +74,7 @@ static inline void mmc_delay(unsigned int ms)
 void mmc_stop_host(struct mmc_host *host);
 
 int _mmc_detect_card_removed(struct mmc_host *host);
+int mmc_detect_card_removed(struct mmc_host *host);
 
 int mmc_attach_mmc(struct mmc_host *host);
 int mmc_attach_sd(struct mmc_host *host);
@@ -102,5 +104,38 @@ static inline void mmc_register_pm_notifier(struct mmc_host *host) { }
 static inline void mmc_unregister_pm_notifier(struct mmc_host *host) { }
 #endif
 
-#endif
+void mmc_wait_for_req_done(struct mmc_host *host, struct mmc_request *mrq);
+bool mmc_is_req_done(struct mmc_host *host, struct mmc_request *mrq);
+
+int mmc_erase(struct mmc_card *card, unsigned int from, unsigned int nr,
+		unsigned int arg);
+int mmc_can_erase(struct mmc_card *card);
+int mmc_can_trim(struct mmc_card *card);
+int mmc_can_discard(struct mmc_card *card);
+int mmc_can_sanitize(struct mmc_card *card);
+int mmc_can_secure_erase_trim(struct mmc_card *card);
+int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from,
+			unsigned int nr);
+unsigned int mmc_calc_max_discard(struct mmc_card *card);
+
+int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen);
+int mmc_set_blockcount(struct mmc_card *card, unsigned int blockcount,
+			bool is_rel_write);
+
+int __mmc_claim_host(struct mmc_host *host, atomic_t *abort);
+void mmc_release_host(struct mmc_host *host);
+void mmc_get_card(struct mmc_card *card);
+void mmc_put_card(struct mmc_card *card);
+
+/**
+ *	mmc_claim_host - exclusively claim a host
+ *	@host: mmc host to claim
+ *
+ *	Claim a host for a set of operations.
+ */
+static inline void mmc_claim_host(struct mmc_host *host)
+{
+	__mmc_claim_host(host, NULL);
+}
 
+#endif
diff --git a/drivers/mmc/core/mmc_ops.h b/drivers/mmc/core/mmc_ops.h
index e76365a..74beea8 100644
--- a/drivers/mmc/core/mmc_ops.h
+++ b/drivers/mmc/core/mmc_ops.h
@@ -31,12 +31,21 @@
 int mmc_spi_set_crc(struct mmc_host *host, int use_crc);
 int mmc_bus_test(struct mmc_card *card, u8 bus_width);
 int mmc_send_hpi_cmd(struct mmc_card *card, u32 *status);
+int mmc_interrupt_hpi(struct mmc_card *card);
 int mmc_can_ext_csd(struct mmc_card *card);
+int mmc_get_ext_csd(struct mmc_card *card, u8 **new_ext_csd);
 int mmc_switch_status(struct mmc_card *card);
 int __mmc_switch_status(struct mmc_card *card, bool crc_err_fatal);
 int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value,
 		unsigned int timeout_ms, unsigned char timing,
 		bool use_busy_signal, bool send_status,	bool retry_crc_err);
+int mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value,
+		unsigned int timeout_ms);
+int mmc_stop_bkops(struct mmc_card *card);
+int mmc_read_bkops_status(struct mmc_card *card);
+void mmc_start_bkops(struct mmc_card *card, bool from_exception);
+int mmc_can_reset(struct mmc_card *card);
+int mmc_flush_cache(struct mmc_card *card);
 
 #endif
 
diff --git a/drivers/mmc/core/mmc_test.c b/drivers/mmc/core/mmc_test.c
index d350bd6..8075ad1 100644
--- a/drivers/mmc/core/mmc_test.c
+++ b/drivers/mmc/core/mmc_test.c
@@ -22,6 +22,8 @@
 #include <linux/seq_file.h>
 #include <linux/module.h>
 
+#include "core.h"
+
 #define RESULT_OK		0
 #define RESULT_FAIL		1
 #define RESULT_UNSUP_HOST	2
diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c
index b198662..8f5bf5f8 100644
--- a/drivers/mmc/core/queue.c
+++ b/drivers/mmc/core/queue.c
@@ -20,6 +20,7 @@
 
 #include "queue.h"
 #include "block.h"
+#include "core.h"
 
 #define MMC_QUEUE_BOUNCESZ	65536
 
diff --git a/drivers/mmc/core/sd_ops.h b/drivers/mmc/core/sd_ops.h
index ac7223c..784f8e6 100644
--- a/drivers/mmc/core/sd_ops.h
+++ b/drivers/mmc/core/sd_ops.h
@@ -16,6 +16,7 @@
 
 struct mmc_card;
 struct mmc_host;
+struct mmc_command;
 
 int mmc_app_set_bus_width(struct mmc_card *card, int width);
 int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr);
@@ -25,6 +26,9 @@
 int mmc_sd_switch(struct mmc_card *card, int mode, int group,
 	u8 value, u8 *resp);
 int mmc_app_sd_status(struct mmc_card *card, void *ssr);
+int mmc_app_cmd(struct mmc_host *host, struct mmc_card *card);
+int mmc_wait_for_app_cmd(struct mmc_host *host, struct mmc_card *card,
+	struct mmc_command *cmd, int retries);
 
 #endif
 
diff --git a/drivers/mmc/core/sdio_io.c b/drivers/mmc/core/sdio_io.c
index 406e5f0..76fe6d5 100644
--- a/drivers/mmc/core/sdio_io.c
+++ b/drivers/mmc/core/sdio_io.c
@@ -16,6 +16,7 @@
 #include <linux/mmc/sdio_func.h>
 
 #include "sdio_ops.h"
+#include "core.h"
 
 /**
  *	sdio_claim_host - exclusively claim a bus for a certain SDIO function
diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
index f1faf9a..d084635 100644
--- a/drivers/mmc/core/sdio_irq.c
+++ b/drivers/mmc/core/sdio_irq.c
@@ -27,6 +27,7 @@
 #include <linux/mmc/sdio_func.h>
 
 #include "sdio_ops.h"
+#include "core.h"
 
 static int process_sdio_pending_irqs(struct mmc_host *host)
 {
diff --git a/drivers/mmc/core/sdio_ops.h b/drivers/mmc/core/sdio_ops.h
index e1c36d6..bed8a83 100644
--- a/drivers/mmc/core/sdio_ops.h
+++ b/drivers/mmc/core/sdio_ops.h
@@ -24,6 +24,7 @@ int mmc_io_rw_direct(struct mmc_card *card, int write, unsigned fn,
 int mmc_io_rw_extended(struct mmc_card *card, int write, unsigned fn,
 	unsigned addr, int incr_addr, u8 *buf, unsigned blocks, unsigned blksz);
 int sdio_reset(struct mmc_host *host);
+unsigned int mmc_align_data_size(struct mmc_card *card, unsigned int sz);
 
 static inline bool mmc_is_io_op(u32 opcode)
 {
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 64e2ddf..e679a86 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -158,25 +158,13 @@ struct mmc_request {
 struct mmc_card;
 struct mmc_async_req;
 
-extern int mmc_stop_bkops(struct mmc_card *);
-extern int mmc_read_bkops_status(struct mmc_card *);
 extern struct mmc_async_req *mmc_start_req(struct mmc_host *,
 					   struct mmc_async_req *,
 					   enum mmc_blk_status *);
-extern int mmc_interrupt_hpi(struct mmc_card *);
 extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *);
-extern void mmc_wait_for_req_done(struct mmc_host *host,
-				  struct mmc_request *mrq);
-extern bool mmc_is_req_done(struct mmc_host *host, struct mmc_request *mrq);
 extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);
-extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *);
-extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *,
-	struct mmc_command *, int);
-extern void mmc_start_bkops(struct mmc_card *card, bool from_exception);
-extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int);
 extern int mmc_send_tuning(struct mmc_host *host, u32 opcode, int *cmd_error);
 extern int mmc_abort_tuning(struct mmc_host *host, u32 opcode);
-extern int mmc_get_ext_csd(struct mmc_card *card, u8 **new_ext_csd);
 
 #define MMC_ERASE_ARG		0x00000000
 #define MMC_SECURE_ERASE_ARG	0x80000000
@@ -188,46 +176,8 @@ extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *,
 #define MMC_SECURE_ARGS		0x80000000
 #define MMC_TRIM_ARGS		0x00008001
 
-extern int mmc_erase(struct mmc_card *card, unsigned int from, unsigned int nr,
-		     unsigned int arg);
-extern int mmc_can_erase(struct mmc_card *card);
-extern int mmc_can_trim(struct mmc_card *card);
-extern int mmc_can_discard(struct mmc_card *card);
-extern int mmc_can_sanitize(struct mmc_card *card);
-extern int mmc_can_secure_erase_trim(struct mmc_card *card);
-extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from,
-				   unsigned int nr);
-extern unsigned int mmc_calc_max_discard(struct mmc_card *card);
-
-extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen);
-extern int mmc_set_blockcount(struct mmc_card *card, unsigned int blockcount,
-			      bool is_rel_write);
 extern int mmc_hw_reset(struct mmc_host *host);
-extern int mmc_can_reset(struct mmc_card *card);
-
 extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *);
-extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int);
-
-extern int __mmc_claim_host(struct mmc_host *host, atomic_t *abort);
-extern void mmc_release_host(struct mmc_host *host);
-
-extern void mmc_get_card(struct mmc_card *card);
-extern void mmc_put_card(struct mmc_card *card);
-
-extern int mmc_flush_cache(struct mmc_card *);
-
-extern int mmc_detect_card_removed(struct mmc_host *host);
-
-/**
- *	mmc_claim_host - exclusively claim a host
- *	@host: mmc host to claim
- *
- *	Claim a host for a set of operations.
- */
-static inline void mmc_claim_host(struct mmc_host *host)
-{
-	__mmc_claim_host(host, NULL);
-}
 
 struct device_node;
 extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v3 08/15] mmc: core: Move some host specific public functions to host.h
  2017-01-13 13:14 [PATCH v3 00/15] mmc: core: A start to slim down public mmc headers Ulf Hansson
                   ` (6 preceding siblings ...)
  2017-01-13 13:14 ` [PATCH v3 07/15] mmc: core: Move public functions from core.h to private headers Ulf Hansson
@ 2017-01-13 13:14 ` Ulf Hansson
  2017-01-16  3:02   ` Shawn Lin
  2017-01-13 13:14 ` [PATCH v3 09/15] mmc: core: Move erase/trim/discard defines from public core.h to mmc.h Ulf Hansson
                   ` (7 subsequent siblings)
  15 siblings, 1 reply; 50+ messages in thread
From: Ulf Hansson @ 2017-01-13 13:14 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson; +Cc: Jaehoon Chung, Adrian Hunter, Linus Walleij

Ideally the public mmc header file, core.h, shouldn't contain interfaces
particularly intended to be used by host drivers. Instead those should
remain in the host.h header file. Therefore, let's move a couple functions
from core.h to host.h.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
 include/linux/mmc/core.h | 6 ------
 include/linux/mmc/host.h | 6 ++++++
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index e679a86..faacc90 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -163,8 +163,6 @@ extern struct mmc_async_req *mmc_start_req(struct mmc_host *,
 					   enum mmc_blk_status *);
 extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *);
 extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);
-extern int mmc_send_tuning(struct mmc_host *host, u32 opcode, int *cmd_error);
-extern int mmc_abort_tuning(struct mmc_host *host, u32 opcode);
 
 #define MMC_ERASE_ARG		0x00000000
 #define MMC_SECURE_ERASE_ARG	0x80000000
@@ -179,8 +177,4 @@ extern struct mmc_async_req *mmc_start_req(struct mmc_host *,
 extern int mmc_hw_reset(struct mmc_host *host);
 extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *);
 
-struct device_node;
-extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max);
-extern int mmc_of_parse_voltage(struct device_node *np, u32 *mask);
-
 #endif /* LINUX_MMC_CORE_H */
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 8d38c76..7de0519 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -392,11 +392,14 @@ struct mmc_host {
 	unsigned long		private[0] ____cacheline_aligned;
 };
 
+struct device_node;
+
 struct mmc_host *mmc_alloc_host(int extra, struct device *);
 int mmc_add_host(struct mmc_host *);
 void mmc_remove_host(struct mmc_host *);
 void mmc_free_host(struct mmc_host *);
 int mmc_of_parse(struct mmc_host *host);
+int mmc_of_parse_voltage(struct device_node *np, u32 *mask);
 
 static inline void *mmc_priv(struct mmc_host *host)
 {
@@ -452,6 +455,7 @@ static inline int mmc_regulator_set_vqmmc(struct mmc_host *mmc,
 }
 #endif
 
+u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max);
 int mmc_regulator_get_supply(struct mmc_host *mmc);
 
 static inline int mmc_card_is_removable(struct mmc_host *host)
@@ -538,6 +542,8 @@ static inline bool mmc_can_retune(struct mmc_host *host)
 	return host->can_retune == 1;
 }
 
+int mmc_send_tuning(struct mmc_host *host, u32 opcode, int *cmd_error);
+int mmc_abort_tuning(struct mmc_host *host, u32 opcode);
 void mmc_retune_pause(struct mmc_host *host);
 void mmc_retune_unpause(struct mmc_host *host);
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v3 09/15] mmc: core: Move erase/trim/discard defines from public core.h to mmc.h
  2017-01-13 13:14 [PATCH v3 00/15] mmc: core: A start to slim down public mmc headers Ulf Hansson
                   ` (7 preceding siblings ...)
  2017-01-13 13:14 ` [PATCH v3 08/15] mmc: core: Move some host specific public functions to host.h Ulf Hansson
@ 2017-01-13 13:14 ` Ulf Hansson
  2017-01-16  3:05   ` Shawn Lin
  2017-01-13 13:14 ` [PATCH v3 10/15] mmc: core: Remove unused struct _mmc_csd from public mmc.h header Ulf Hansson
                   ` (6 subsequent siblings)
  15 siblings, 1 reply; 50+ messages in thread
From: Ulf Hansson @ 2017-01-13 13:14 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson; +Cc: Jaehoon Chung, Adrian Hunter, Linus Walleij

As the public mmc.h header already contains similar defines for other mmc
commands and arguments, let's move those for erase/trim/discard into here
as well.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
 include/linux/mmc/core.h | 10 ----------
 include/linux/mmc/mmc.h  | 13 ++++++++++++-
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index faacc90..6440e10 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -164,16 +164,6 @@ extern struct mmc_async_req *mmc_start_req(struct mmc_host *,
 extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *);
 extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);
 
-#define MMC_ERASE_ARG		0x00000000
-#define MMC_SECURE_ERASE_ARG	0x80000000
-#define MMC_TRIM_ARG		0x00000001
-#define MMC_DISCARD_ARG		0x00000003
-#define MMC_SECURE_TRIM1_ARG	0x80000001
-#define MMC_SECURE_TRIM2_ARG	0x80008000
-
-#define MMC_SECURE_ARGS		0x80000000
-#define MMC_TRIM_ARGS		0x00008001
-
 extern int mmc_hw_reset(struct mmc_host *host);
 extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *);
 
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index 261772e..8f78543 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -462,12 +462,23 @@ struct _mmc_csd {
 /*
  * MMC_SWITCH access modes
  */
-
 #define MMC_SWITCH_MODE_CMD_SET		0x00	/* Change the command set */
 #define MMC_SWITCH_MODE_SET_BITS	0x01	/* Set bits which are 1 in value */
 #define MMC_SWITCH_MODE_CLEAR_BITS	0x02	/* Clear bits which are 1 in value */
 #define MMC_SWITCH_MODE_WRITE_BYTE	0x03	/* Set target to value */
 
+/*
+ * Erase/trim/discard
+ */
+#define MMC_ERASE_ARG			0x00000000
+#define MMC_SECURE_ERASE_ARG		0x80000000
+#define MMC_TRIM_ARG			0x00000001
+#define MMC_DISCARD_ARG			0x00000003
+#define MMC_SECURE_TRIM1_ARG		0x80000001
+#define MMC_SECURE_TRIM2_ARG		0x80008000
+#define MMC_SECURE_ARGS			0x80000000
+#define MMC_TRIM_ARGS			0x00008001
+
 #define mmc_driver_type_mask(n)		(1 << (n))
 
 #endif /* LINUX_MMC_MMC_H */
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v3 10/15] mmc: core: Remove unused struct _mmc_csd from public mmc.h header
  2017-01-13 13:14 [PATCH v3 00/15] mmc: core: A start to slim down public mmc headers Ulf Hansson
                   ` (8 preceding siblings ...)
  2017-01-13 13:14 ` [PATCH v3 09/15] mmc: core: Move erase/trim/discard defines from public core.h to mmc.h Ulf Hansson
@ 2017-01-13 13:14 ` Ulf Hansson
  2017-01-16  3:07   ` Shawn Lin
  2017-01-13 13:14 ` [PATCH v3 11/15] mmc: omap: Don't use mmc_card_present() when validating for inserted card Ulf Hansson
                   ` (5 subsequent siblings)
  15 siblings, 1 reply; 50+ messages in thread
From: Ulf Hansson @ 2017-01-13 13:14 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson; +Cc: Jaehoon Chung, Adrian Hunter, Linus Walleij

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
 include/linux/mmc/mmc.h | 44 --------------------------------------------
 1 file changed, 44 deletions(-)

diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index 8f78543..7406d9b 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -184,50 +184,6 @@ static inline bool mmc_op_multi(u32 opcode)
 #define R2_SPI_OUT_OF_RANGE	(1 << 15)	/* or CSD overwrite */
 #define R2_SPI_CSD_OVERWRITE	R2_SPI_OUT_OF_RANGE
 
-/* These are unpacked versions of the actual responses */
-
-struct _mmc_csd {
-	u8  csd_structure;
-	u8  spec_vers;
-	u8  taac;
-	u8  nsac;
-	u8  tran_speed;
-	u16 ccc;
-	u8  read_bl_len;
-	u8  read_bl_partial;
-	u8  write_blk_misalign;
-	u8  read_blk_misalign;
-	u8  dsr_imp;
-	u16 c_size;
-	u8  vdd_r_curr_min;
-	u8  vdd_r_curr_max;
-	u8  vdd_w_curr_min;
-	u8  vdd_w_curr_max;
-	u8  c_size_mult;
-	union {
-		struct { /* MMC system specification version 3.1 */
-			u8  erase_grp_size;
-			u8  erase_grp_mult;
-		} v31;
-		struct { /* MMC system specification version 2.2 */
-			u8  sector_size;
-			u8  erase_grp_size;
-		} v22;
-	} erase;
-	u8  wp_grp_size;
-	u8  wp_grp_enable;
-	u8  default_ecc;
-	u8  r2w_factor;
-	u8  write_bl_len;
-	u8  write_bl_partial;
-	u8  file_format_grp;
-	u8  copy;
-	u8  perm_write_protect;
-	u8  tmp_write_protect;
-	u8  file_format;
-	u8  ecc;
-};
-
 /*
  * OCR bits are mostly in host.h
  */
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v3 11/15] mmc: omap: Don't use mmc_card_present() when validating for inserted card
  2017-01-13 13:14 [PATCH v3 00/15] mmc: core: A start to slim down public mmc headers Ulf Hansson
                   ` (9 preceding siblings ...)
  2017-01-13 13:14 ` [PATCH v3 10/15] mmc: core: Remove unused struct _mmc_csd from public mmc.h header Ulf Hansson
@ 2017-01-13 13:14 ` Ulf Hansson
  2017-01-13 13:14 ` [PATCH v3 12/15] mmc: vub300: " Ulf Hansson
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 50+ messages in thread
From: Ulf Hansson @ 2017-01-13 13:14 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson
  Cc: Jaehoon Chung, Adrian Hunter, Linus Walleij, linux-omap,
	Tony Lindgren, Jarkko Nikula

The mmc_card_present() function helps the mmc core to track an internal
state of the card device. More importantly, it's not intended to be used by
mmc host drivers to check for an inserted card. Therefore, let's stop using
it and instead rely on checking for a valid pointer to a struct mmc_card,
as it should be good enough.

Cc: linux-omap@vger.kernel.org
Cc: Tony Lindgren <tony@atomide.com>
Cc: Jarkko Nikula <jarkko.nikula@bitmer.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/mmc/host/omap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index be3c49f..bd49f34 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -893,7 +893,7 @@ static void mmc_omap_cover_handler(unsigned long param)
 	 * If no card is inserted, we postpone polling until
 	 * the cover has been closed.
 	 */
-	if (slot->mmc->card == NULL || !mmc_card_present(slot->mmc->card))
+	if (slot->mmc->card == NULL)
 		return;
 
 	mod_timer(&slot->cover_timer,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v3 12/15] mmc: vub300: Don't use mmc_card_present() when validating for inserted card
  2017-01-13 13:14 [PATCH v3 00/15] mmc: core: A start to slim down public mmc headers Ulf Hansson
                   ` (10 preceding siblings ...)
  2017-01-13 13:14 ` [PATCH v3 11/15] mmc: omap: Don't use mmc_card_present() when validating for inserted card Ulf Hansson
@ 2017-01-13 13:14 ` Ulf Hansson
  2017-01-13 13:14 ` [PATCH v3 13/15] mmc: core: Move public functions from card.h to private headers Ulf Hansson
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 50+ messages in thread
From: Ulf Hansson @ 2017-01-13 13:14 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson; +Cc: Jaehoon Chung, Adrian Hunter, Linus Walleij

The mmc_card_present() function helps the mmc core to track an internal
state of the card device. More importantly, it's not intended to be used by
mmc host drivers to check for an inserted card. Therefore, let's stop using
it and instead rely on checking for a valid pointer to a struct mmc_card,
as it should be good enough.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/mmc/host/vub300.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/host/vub300.c b/drivers/mmc/host/vub300.c
index 21ea776..c061e7c 100644
--- a/drivers/mmc/host/vub300.c
+++ b/drivers/mmc/host/vub300.c
@@ -726,8 +726,7 @@ static void vub300_deadwork_thread(struct work_struct *work)
 		 */
 	} else if (vub300->card_present) {
 		check_vub300_port_status(vub300);
-	} else if (vub300->mmc && vub300->mmc->card &&
-		   mmc_card_present(vub300->mmc->card)) {
+	} else if (vub300->mmc && vub300->mmc->card) {
 		/*
 		 * the MMC core must not have responded
 		 * to the previous indication - lets
@@ -1754,8 +1753,7 @@ static void vub300_cmndwork_thread(struct work_struct *work)
 		int data_length;
 		mutex_lock(&vub300->cmd_mutex);
 		init_completion(&vub300->command_complete);
-		if (likely(vub300->vub_name[0]) || !vub300->mmc->card ||
-		    !mmc_card_present(vub300->mmc->card)) {
+		if (likely(vub300->vub_name[0]) || !vub300->mmc->card) {
 			/*
 			 * the name of the EMPTY Pseudo firmware file
 			 * is used as a flag to indicate that the file
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v3 13/15] mmc: core: Move public functions from card.h to private headers
  2017-01-13 13:14 [PATCH v3 00/15] mmc: core: A start to slim down public mmc headers Ulf Hansson
                   ` (11 preceding siblings ...)
  2017-01-13 13:14 ` [PATCH v3 12/15] mmc: vub300: " Ulf Hansson
@ 2017-01-13 13:14 ` Ulf Hansson
  2017-01-16  3:10   ` Shawn Lin
  2017-01-13 13:14 ` [PATCH v3 14/15] mmc: core: Move public functions from host.h " Ulf Hansson
                   ` (2 subsequent siblings)
  15 siblings, 1 reply; 50+ messages in thread
From: Ulf Hansson @ 2017-01-13 13:14 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson; +Cc: Jaehoon Chung, Adrian Hunter, Linus Walleij

A significant amount of functions and other definitions are available
through the public mmc card.h header file. Let's slim down this public mmc
interface, as to prevent users from abusing it, by moving some of the
functions/definitions to private mmc header files.

This change concentrates on moving the functions into private mmc headers,
following changes may continue with additional clean-ups.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/mmc/core/block.c    |   2 +
 drivers/mmc/core/bus.c      |   1 +
 drivers/mmc/core/bus.h      |  14 ++-
 drivers/mmc/core/card.h     | 223 ++++++++++++++++++++++++++++++++++++++++
 drivers/mmc/core/core.c     |   1 +
 drivers/mmc/core/debugfs.c  |   1 +
 drivers/mmc/core/mmc.c      |  13 +++
 drivers/mmc/core/mmc_test.c |   2 +
 drivers/mmc/core/queue.c    |   1 +
 drivers/mmc/core/quirks.c   |   2 +
 drivers/mmc/core/sd.c       |   1 +
 drivers/mmc/core/sdio.c     |   1 +
 drivers/mmc/core/sdio_bus.c |   1 +
 drivers/mmc/core/sdio_io.c  |   1 +
 drivers/mmc/core/sdio_irq.c |   1 +
 include/linux/mmc/card.h    | 240 --------------------------------------------
 16 files changed, 263 insertions(+), 242 deletions(-)
 create mode 100644 drivers/mmc/core/card.h

diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index 41b5dbc..a8300be 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -48,6 +48,8 @@
 #include "queue.h"
 #include "block.h"
 #include "core.h"
+#include "card.h"
+#include "bus.h"
 #include "mmc_ops.h"
 #include "sd_ops.h"
 
diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index c64266f..3be2e6a 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -23,6 +23,7 @@
 #include <linux/mmc/host.h>
 
 #include "core.h"
+#include "card.h"
 #include "sdio_cis.h"
 #include "bus.h"
 
diff --git a/drivers/mmc/core/bus.h b/drivers/mmc/core/bus.h
index 93b516a..72b0ef0 100644
--- a/drivers/mmc/core/bus.h
+++ b/drivers/mmc/core/bus.h
@@ -11,9 +11,10 @@
 #ifndef _MMC_CORE_BUS_H
 #define _MMC_CORE_BUS_H
 
+#include <linux/device.h>
+
 struct mmc_host;
 struct mmc_card;
-struct device_type;
 
 #define MMC_DEV_ATTR(name, fmt, args...)					\
 static ssize_t mmc_##name##_show (struct device *dev, struct device_attribute *attr, char *buf)	\
@@ -31,5 +32,14 @@ struct mmc_card *mmc_alloc_card(struct mmc_host *host,
 int mmc_register_bus(void);
 void mmc_unregister_bus(void);
 
-#endif
+struct mmc_driver {
+	struct device_driver drv;
+	int (*probe)(struct mmc_card *card);
+	void (*remove)(struct mmc_card *card);
+	void (*shutdown)(struct mmc_card *card);
+};
 
+int mmc_register_driver(struct mmc_driver *drv);
+void mmc_unregister_driver(struct mmc_driver *drv);
+
+#endif
diff --git a/drivers/mmc/core/card.h b/drivers/mmc/core/card.h
new file mode 100644
index 0000000..95e8fc5
--- /dev/null
+++ b/drivers/mmc/core/card.h
@@ -0,0 +1,223 @@
+/*
+ * Private header for the mmc subsystem
+ *
+ * Copyright (C) 2016 Linaro Ltd
+ *
+ * Author: Ulf Hansson <ulf.hansson@linaro.org>
+ *
+ * License terms: GNU General Public License (GPL) version 2
+ */
+
+#ifndef _MMC_CORE_CARD_H
+#define _MMC_CORE_CARD_H
+
+#include <linux/mmc/card.h>
+
+#define mmc_card_name(c)	((c)->cid.prod_name)
+#define mmc_card_id(c)		(dev_name(&(c)->dev))
+#define mmc_dev_to_card(d)	container_of(d, struct mmc_card, dev)
+
+/* Card states */
+#define MMC_STATE_PRESENT	(1<<0)		/* present in sysfs */
+#define MMC_STATE_READONLY	(1<<1)		/* card is read-only */
+#define MMC_STATE_BLOCKADDR	(1<<2)		/* card uses block-addressing */
+#define MMC_CARD_SDXC		(1<<3)		/* card is SDXC */
+#define MMC_CARD_REMOVED	(1<<4)		/* card has been removed */
+#define MMC_STATE_DOING_BKOPS	(1<<5)		/* card is doing BKOPS */
+#define MMC_STATE_SUSPENDED	(1<<6)		/* card is suspended */
+
+#define mmc_card_present(c)	((c)->state & MMC_STATE_PRESENT)
+#define mmc_card_readonly(c)	((c)->state & MMC_STATE_READONLY)
+#define mmc_card_blockaddr(c)	((c)->state & MMC_STATE_BLOCKADDR)
+#define mmc_card_ext_capacity(c) ((c)->state & MMC_CARD_SDXC)
+#define mmc_card_removed(c)	((c) && ((c)->state & MMC_CARD_REMOVED))
+#define mmc_card_doing_bkops(c)	((c)->state & MMC_STATE_DOING_BKOPS)
+#define mmc_card_suspended(c)	((c)->state & MMC_STATE_SUSPENDED)
+
+#define mmc_card_set_present(c)	((c)->state |= MMC_STATE_PRESENT)
+#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY)
+#define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR)
+#define mmc_card_set_ext_capacity(c) ((c)->state |= MMC_CARD_SDXC)
+#define mmc_card_set_removed(c) ((c)->state |= MMC_CARD_REMOVED)
+#define mmc_card_set_doing_bkops(c)	((c)->state |= MMC_STATE_DOING_BKOPS)
+#define mmc_card_clr_doing_bkops(c)	((c)->state &= ~MMC_STATE_DOING_BKOPS)
+#define mmc_card_set_suspended(c) ((c)->state |= MMC_STATE_SUSPENDED)
+#define mmc_card_clr_suspended(c) ((c)->state &= ~MMC_STATE_SUSPENDED)
+
+/*
+ * The world is not perfect and supplies us with broken mmc/sdio devices.
+ * For at least some of these bugs we need a work-around.
+ */
+struct mmc_fixup {
+	/* CID-specific fields. */
+	const char *name;
+
+	/* Valid revision range */
+	u64 rev_start, rev_end;
+
+	unsigned int manfid;
+	unsigned short oemid;
+
+	/* SDIO-specific fields. You can use SDIO_ANY_ID here of course */
+	u16 cis_vendor, cis_device;
+
+	/* for MMC cards */
+	unsigned int ext_csd_rev;
+
+	void (*vendor_fixup)(struct mmc_card *card, int data);
+	int data;
+};
+
+#define CID_MANFID_ANY (-1u)
+#define CID_OEMID_ANY ((unsigned short) -1)
+#define CID_NAME_ANY (NULL)
+
+#define EXT_CSD_REV_ANY (-1u)
+
+#define CID_MANFID_SANDISK      0x2
+#define CID_MANFID_TOSHIBA      0x11
+#define CID_MANFID_MICRON       0x13
+#define CID_MANFID_SAMSUNG      0x15
+#define CID_MANFID_KINGSTON     0x70
+#define CID_MANFID_HYNIX	0x90
+
+#define END_FIXUP { NULL }
+
+#define _FIXUP_EXT(_name, _manfid, _oemid, _rev_start, _rev_end,	\
+		   _cis_vendor, _cis_device,				\
+		   _fixup, _data, _ext_csd_rev)				\
+	{						\
+		.name = (_name),			\
+		.manfid = (_manfid),			\
+		.oemid = (_oemid),			\
+		.rev_start = (_rev_start),		\
+		.rev_end = (_rev_end),			\
+		.cis_vendor = (_cis_vendor),		\
+		.cis_device = (_cis_device),		\
+		.vendor_fixup = (_fixup),		\
+		.data = (_data),			\
+		.ext_csd_rev = (_ext_csd_rev),		\
+	}
+
+#define MMC_FIXUP_REV(_name, _manfid, _oemid, _rev_start, _rev_end,	\
+		      _fixup, _data, _ext_csd_rev)			\
+	_FIXUP_EXT(_name, _manfid,					\
+		   _oemid, _rev_start, _rev_end,			\
+		   SDIO_ANY_ID, SDIO_ANY_ID,				\
+		   _fixup, _data, _ext_csd_rev)				\
+
+#define MMC_FIXUP(_name, _manfid, _oemid, _fixup, _data) \
+	MMC_FIXUP_REV(_name, _manfid, _oemid, 0, -1ull, _fixup, _data,	\
+		      EXT_CSD_REV_ANY)
+
+#define MMC_FIXUP_EXT_CSD_REV(_name, _manfid, _oemid, _fixup, _data,	\
+			      _ext_csd_rev)				\
+	MMC_FIXUP_REV(_name, _manfid, _oemid, 0, -1ull, _fixup, _data,	\
+		      _ext_csd_rev)
+
+#define SDIO_FIXUP(_vendor, _device, _fixup, _data)			\
+	_FIXUP_EXT(CID_NAME_ANY, CID_MANFID_ANY,			\
+		    CID_OEMID_ANY, 0, -1ull,				\
+		   _vendor, _device,					\
+		   _fixup, _data, EXT_CSD_REV_ANY)			\
+
+#define cid_rev(hwrev, fwrev, year, month)	\
+	(((u64) hwrev) << 40 |			\
+	 ((u64) fwrev) << 32 |			\
+	 ((u64) year) << 16 |			\
+	 ((u64) month))
+
+#define cid_rev_card(card)			\
+	cid_rev(card->cid.hwrev,		\
+		    card->cid.fwrev,		\
+		    card->cid.year,		\
+		    card->cid.month)
+
+/*
+ * Unconditionally quirk add/remove.
+ */
+static inline void __maybe_unused add_quirk(struct mmc_card *card, int data)
+{
+	card->quirks |= data;
+}
+
+static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data)
+{
+	card->quirks &= ~data;
+}
+
+/*
+ * Quirk add/remove for MMC products.
+ */
+static inline void __maybe_unused add_quirk_mmc(struct mmc_card *card, int data)
+{
+	if (mmc_card_mmc(card))
+		card->quirks |= data;
+}
+
+static inline void __maybe_unused remove_quirk_mmc(struct mmc_card *card,
+						   int data)
+{
+	if (mmc_card_mmc(card))
+		card->quirks &= ~data;
+}
+
+/*
+ * Quirk add/remove for SD products.
+ */
+static inline void __maybe_unused add_quirk_sd(struct mmc_card *card, int data)
+{
+	if (mmc_card_sd(card))
+		card->quirks |= data;
+}
+
+static inline void __maybe_unused remove_quirk_sd(struct mmc_card *card,
+						   int data)
+{
+	if (mmc_card_sd(card))
+		card->quirks &= ~data;
+}
+
+static inline int mmc_card_lenient_fn0(const struct mmc_card *c)
+{
+	return c->quirks & MMC_QUIRK_LENIENT_FN0;
+}
+
+static inline int mmc_blksz_for_byte_mode(const struct mmc_card *c)
+{
+	return c->quirks & MMC_QUIRK_BLKSZ_FOR_BYTE_MODE;
+}
+
+static inline int mmc_card_disable_cd(const struct mmc_card *c)
+{
+	return c->quirks & MMC_QUIRK_DISABLE_CD;
+}
+
+static inline int mmc_card_nonstd_func_interface(const struct mmc_card *c)
+{
+	return c->quirks & MMC_QUIRK_NONSTD_FUNC_IF;
+}
+
+static inline int mmc_card_broken_byte_mode_512(const struct mmc_card *c)
+{
+	return c->quirks & MMC_QUIRK_BROKEN_BYTE_MODE_512;
+}
+
+static inline int mmc_card_long_read_time(const struct mmc_card *c)
+{
+	return c->quirks & MMC_QUIRK_LONG_READ_TIME;
+}
+
+static inline int mmc_card_broken_irq_polling(const struct mmc_card *c)
+{
+	return c->quirks & MMC_QUIRK_BROKEN_IRQ_POLLING;
+}
+
+static inline int mmc_card_broken_hpi(const struct mmc_card *c)
+{
+	return c->quirks & MMC_QUIRK_BROKEN_HPI;
+}
+
+void mmc_fixup_device(struct mmc_card *card, const struct mmc_fixup *table);
+
+#endif
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 3b34a75..8c45825 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -40,6 +40,7 @@
 #include <trace/events/mmc.h>
 
 #include "core.h"
+#include "card.h"
 #include "bus.h"
 #include "host.h"
 #include "sdio_bus.h"
diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
index 30623b8..2843e6a 100644
--- a/drivers/mmc/core/debugfs.c
+++ b/drivers/mmc/core/debugfs.c
@@ -20,6 +20,7 @@
 #include <linux/mmc/host.h>
 
 #include "core.h"
+#include "card.h"
 #include "mmc_ops.h"
 
 #ifdef CONFIG_FAIL_MMC_REQUEST
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index ec2e85c..b91abe0 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -21,6 +21,7 @@
 #include <linux/mmc/mmc.h>
 
 #include "core.h"
+#include "card.h"
 #include "host.h"
 #include "bus.h"
 #include "mmc_ops.h"
@@ -307,6 +308,18 @@ static void mmc_manage_enhanced_area(struct mmc_card *card, u8 *ext_csd)
 	}
 }
 
+static void mmc_part_add(struct mmc_card *card, unsigned int size,
+			 unsigned int part_cfg, char *name, int idx, bool ro,
+			 int area_type)
+{
+	card->part[card->nr_parts].size = size;
+	card->part[card->nr_parts].part_cfg = part_cfg;
+	sprintf(card->part[card->nr_parts].name, name, idx);
+	card->part[card->nr_parts].force_ro = ro;
+	card->part[card->nr_parts].area_type = area_type;
+	card->nr_parts++;
+}
+
 static void mmc_manage_gp_partitions(struct mmc_card *card, u8 *ext_csd)
 {
 	int idx;
diff --git a/drivers/mmc/core/mmc_test.c b/drivers/mmc/core/mmc_test.c
index 8075ad1..8dd2115 100644
--- a/drivers/mmc/core/mmc_test.c
+++ b/drivers/mmc/core/mmc_test.c
@@ -23,6 +23,8 @@
 #include <linux/module.h>
 
 #include "core.h"
+#include "card.h"
+#include "bus.h"
 
 #define RESULT_OK		0
 #define RESULT_FAIL		1
diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c
index 8f5bf5f8..611f5c6 100644
--- a/drivers/mmc/core/queue.c
+++ b/drivers/mmc/core/queue.c
@@ -21,6 +21,7 @@
 #include "queue.h"
 #include "block.h"
 #include "core.h"
+#include "card.h"
 
 #define MMC_QUEUE_BOUNCESZ	65536
 
diff --git a/drivers/mmc/core/quirks.c b/drivers/mmc/core/quirks.c
index ca9cade..bf25a9c 100644
--- a/drivers/mmc/core/quirks.c
+++ b/drivers/mmc/core/quirks.c
@@ -15,6 +15,8 @@
 #include <linux/mmc/card.h>
 #include <linux/mmc/sdio_ids.h>
 
+#include "card.h"
+
 #ifndef SDIO_VENDOR_ID_TI
 #define SDIO_VENDOR_ID_TI		0x0097
 #endif
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index a614f37..d66b08d 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -22,6 +22,7 @@
 #include <linux/mmc/sd.h>
 
 #include "core.h"
+#include "card.h"
 #include "bus.h"
 #include "mmc_ops.h"
 #include "sd.h"
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 6810b3a..5419c0d 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -20,6 +20,7 @@
 #include <linux/mmc/sdio_ids.h>
 
 #include "core.h"
+#include "card.h"
 #include "bus.h"
 #include "sd.h"
 #include "sdio_bus.h"
diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c
index 86f5b32..e992a7f 100644
--- a/drivers/mmc/core/sdio_bus.c
+++ b/drivers/mmc/core/sdio_bus.c
@@ -25,6 +25,7 @@
 #include <linux/of.h>
 
 #include "core.h"
+#include "card.h"
 #include "sdio_cis.h"
 #include "sdio_bus.h"
 
diff --git a/drivers/mmc/core/sdio_io.c b/drivers/mmc/core/sdio_io.c
index 76fe6d5..74195d7 100644
--- a/drivers/mmc/core/sdio_io.c
+++ b/drivers/mmc/core/sdio_io.c
@@ -17,6 +17,7 @@
 
 #include "sdio_ops.h"
 #include "core.h"
+#include "card.h"
 
 /**
  *	sdio_claim_host - exclusively claim a bus for a certain SDIO function
diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
index d084635..d29faf2 100644
--- a/drivers/mmc/core/sdio_irq.c
+++ b/drivers/mmc/core/sdio_irq.c
@@ -28,6 +28,7 @@
 
 #include "sdio_ops.h"
 #include "core.h"
+#include "card.h"
 
 static int process_sdio_pending_irqs(struct mmc_host *host)
 {
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index ca64f5b..29d00c9 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -248,13 +248,6 @@ struct mmc_card {
 #define MMC_TYPE_SDIO		2		/* SDIO card */
 #define MMC_TYPE_SD_COMBO	3		/* SD combo (IO+mem) card */
 	unsigned int		state;		/* (our) card state */
-#define MMC_STATE_PRESENT	(1<<0)		/* present in sysfs */
-#define MMC_STATE_READONLY	(1<<1)		/* card is read-only */
-#define MMC_STATE_BLOCKADDR	(1<<2)		/* card uses block-addressing */
-#define MMC_CARD_SDXC		(1<<3)		/* card is SDXC */
-#define MMC_CARD_REMOVED	(1<<4)		/* card has been removed */
-#define MMC_STATE_DOING_BKOPS	(1<<5)		/* card is doing BKOPS */
-#define MMC_STATE_SUSPENDED	(1<<6)		/* card is suspended */
 	unsigned int		quirks; 	/* card quirks */
 #define MMC_QUIRK_LENIENT_FN0	(1<<0)		/* allow SDIO FN0 writes outside of the VS CCCR range */
 #define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1)	/* use func->cur_blksize */
@@ -273,7 +266,6 @@ struct mmc_card {
 #define MMC_QUIRK_TRIM_BROKEN	(1<<12)		/* Skip trim */
 #define MMC_QUIRK_BROKEN_HPI	(1<<13)		/* Disable broken HPI support */
 
-
 	unsigned int		erase_size;	/* erase size in sectors */
  	unsigned int		erase_shift;	/* if erase unit is power 2 */
  	unsigned int		pref_erase;	/* in sectors */
@@ -309,245 +301,13 @@ struct mmc_card {
 	unsigned int    nr_parts;
 };
 
-/*
- * This function fill contents in mmc_part.
- */
-static inline void mmc_part_add(struct mmc_card *card, unsigned int size,
-			unsigned int part_cfg, char *name, int idx, bool ro,
-			int area_type)
-{
-	card->part[card->nr_parts].size = size;
-	card->part[card->nr_parts].part_cfg = part_cfg;
-	sprintf(card->part[card->nr_parts].name, name, idx);
-	card->part[card->nr_parts].force_ro = ro;
-	card->part[card->nr_parts].area_type = area_type;
-	card->nr_parts++;
-}
-
 static inline bool mmc_large_sector(struct mmc_card *card)
 {
 	return card->ext_csd.data_sector_size == 4096;
 }
 
-/*
- *  The world is not perfect and supplies us with broken mmc/sdio devices.
- *  For at least some of these bugs we need a work-around.
- */
-
-struct mmc_fixup {
-	/* CID-specific fields. */
-	const char *name;
-
-	/* Valid revision range */
-	u64 rev_start, rev_end;
-
-	unsigned int manfid;
-	unsigned short oemid;
-
-	/* SDIO-specfic fields. You can use SDIO_ANY_ID here of course */
-	u16 cis_vendor, cis_device;
-
-	/* for MMC cards */
-	unsigned int ext_csd_rev;
-
-	void (*vendor_fixup)(struct mmc_card *card, int data);
-	int data;
-};
-
-#define CID_MANFID_ANY (-1u)
-#define CID_OEMID_ANY ((unsigned short) -1)
-#define CID_NAME_ANY (NULL)
-
-#define EXT_CSD_REV_ANY (-1u)
-
-#define CID_MANFID_SANDISK      0x2
-#define CID_MANFID_TOSHIBA      0x11
-#define CID_MANFID_MICRON       0x13
-#define CID_MANFID_SAMSUNG      0x15
-#define CID_MANFID_KINGSTON     0x70
-#define CID_MANFID_HYNIX	0x90
-
-#define END_FIXUP { NULL }
-
-#define _FIXUP_EXT(_name, _manfid, _oemid, _rev_start, _rev_end,	\
-		   _cis_vendor, _cis_device,				\
-		   _fixup, _data, _ext_csd_rev)				\
-	{						   \
-		.name = (_name),			   \
-		.manfid = (_manfid),			   \
-		.oemid = (_oemid),			   \
-		.rev_start = (_rev_start),		   \
-		.rev_end = (_rev_end),			   \
-		.cis_vendor = (_cis_vendor),		   \
-		.cis_device = (_cis_device),		   \
-		.vendor_fixup = (_fixup),		   \
-		.data = (_data),			   \
-		.ext_csd_rev = (_ext_csd_rev),		   \
-	 }
-
-#define MMC_FIXUP_REV(_name, _manfid, _oemid, _rev_start, _rev_end,	\
-		      _fixup, _data, _ext_csd_rev)			\
-	_FIXUP_EXT(_name, _manfid,					\
-		   _oemid, _rev_start, _rev_end,			\
-		   SDIO_ANY_ID, SDIO_ANY_ID,				\
-		   _fixup, _data, _ext_csd_rev)				\
-
-#define MMC_FIXUP(_name, _manfid, _oemid, _fixup, _data) \
-	MMC_FIXUP_REV(_name, _manfid, _oemid, 0, -1ull, _fixup, _data,	\
-		      EXT_CSD_REV_ANY)
-
-#define MMC_FIXUP_EXT_CSD_REV(_name, _manfid, _oemid, _fixup, _data,	\
-			      _ext_csd_rev)				\
-	MMC_FIXUP_REV(_name, _manfid, _oemid, 0, -1ull, _fixup, _data,	\
-		      _ext_csd_rev)
-
-#define SDIO_FIXUP(_vendor, _device, _fixup, _data)			\
-	_FIXUP_EXT(CID_NAME_ANY, CID_MANFID_ANY,			\
-		    CID_OEMID_ANY, 0, -1ull,				\
-		   _vendor, _device,					\
-		   _fixup, _data, EXT_CSD_REV_ANY)			\
-
-#define cid_rev(hwrev, fwrev, year, month)	\
-	(((u64) hwrev) << 40 |                  \
-	 ((u64) fwrev) << 32 |                  \
-	 ((u64) year) << 16 |                   \
-	 ((u64) month))
-
-#define cid_rev_card(card)		  \
-	cid_rev(card->cid.hwrev,	  \
-		    card->cid.fwrev,      \
-		    card->cid.year,	  \
-		    card->cid.month)
-
-/*
- * Unconditionally quirk add/remove.
- */
-
-static inline void __maybe_unused add_quirk(struct mmc_card *card, int data)
-{
-	card->quirks |= data;
-}
-
-static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data)
-{
-	card->quirks &= ~data;
-}
-
 #define mmc_card_mmc(c)		((c)->type == MMC_TYPE_MMC)
 #define mmc_card_sd(c)		((c)->type == MMC_TYPE_SD)
 #define mmc_card_sdio(c)	((c)->type == MMC_TYPE_SDIO)
 
-#define mmc_card_present(c)	((c)->state & MMC_STATE_PRESENT)
-#define mmc_card_readonly(c)	((c)->state & MMC_STATE_READONLY)
-#define mmc_card_blockaddr(c)	((c)->state & MMC_STATE_BLOCKADDR)
-#define mmc_card_ext_capacity(c) ((c)->state & MMC_CARD_SDXC)
-#define mmc_card_removed(c)	((c) && ((c)->state & MMC_CARD_REMOVED))
-#define mmc_card_doing_bkops(c)	((c)->state & MMC_STATE_DOING_BKOPS)
-#define mmc_card_suspended(c)	((c)->state & MMC_STATE_SUSPENDED)
-
-#define mmc_card_set_present(c)	((c)->state |= MMC_STATE_PRESENT)
-#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY)
-#define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR)
-#define mmc_card_set_ext_capacity(c) ((c)->state |= MMC_CARD_SDXC)
-#define mmc_card_set_removed(c) ((c)->state |= MMC_CARD_REMOVED)
-#define mmc_card_set_doing_bkops(c)	((c)->state |= MMC_STATE_DOING_BKOPS)
-#define mmc_card_clr_doing_bkops(c)	((c)->state &= ~MMC_STATE_DOING_BKOPS)
-#define mmc_card_set_suspended(c) ((c)->state |= MMC_STATE_SUSPENDED)
-#define mmc_card_clr_suspended(c) ((c)->state &= ~MMC_STATE_SUSPENDED)
-
-/*
- * Quirk add/remove for MMC products.
- */
-
-static inline void __maybe_unused add_quirk_mmc(struct mmc_card *card, int data)
-{
-	if (mmc_card_mmc(card))
-		card->quirks |= data;
-}
-
-static inline void __maybe_unused remove_quirk_mmc(struct mmc_card *card,
-						   int data)
-{
-	if (mmc_card_mmc(card))
-		card->quirks &= ~data;
-}
-
-/*
- * Quirk add/remove for SD products.
- */
-
-static inline void __maybe_unused add_quirk_sd(struct mmc_card *card, int data)
-{
-	if (mmc_card_sd(card))
-		card->quirks |= data;
-}
-
-static inline void __maybe_unused remove_quirk_sd(struct mmc_card *card,
-						   int data)
-{
-	if (mmc_card_sd(card))
-		card->quirks &= ~data;
-}
-
-static inline int mmc_card_lenient_fn0(const struct mmc_card *c)
-{
-	return c->quirks & MMC_QUIRK_LENIENT_FN0;
-}
-
-static inline int mmc_blksz_for_byte_mode(const struct mmc_card *c)
-{
-	return c->quirks & MMC_QUIRK_BLKSZ_FOR_BYTE_MODE;
-}
-
-static inline int mmc_card_disable_cd(const struct mmc_card *c)
-{
-	return c->quirks & MMC_QUIRK_DISABLE_CD;
-}
-
-static inline int mmc_card_nonstd_func_interface(const struct mmc_card *c)
-{
-	return c->quirks & MMC_QUIRK_NONSTD_FUNC_IF;
-}
-
-static inline int mmc_card_broken_byte_mode_512(const struct mmc_card *c)
-{
-	return c->quirks & MMC_QUIRK_BROKEN_BYTE_MODE_512;
-}
-
-static inline int mmc_card_long_read_time(const struct mmc_card *c)
-{
-	return c->quirks & MMC_QUIRK_LONG_READ_TIME;
-}
-
-static inline int mmc_card_broken_irq_polling(const struct mmc_card *c)
-{
-	return c->quirks & MMC_QUIRK_BROKEN_IRQ_POLLING;
-}
-
-static inline int mmc_card_broken_hpi(const struct mmc_card *c)
-{
-	return c->quirks & MMC_QUIRK_BROKEN_HPI;
-}
-
-#define mmc_card_name(c)	((c)->cid.prod_name)
-#define mmc_card_id(c)		(dev_name(&(c)->dev))
-
-#define mmc_dev_to_card(d)	container_of(d, struct mmc_card, dev)
-
-/*
- * MMC device driver (e.g., Flash card, I/O card...)
- */
-struct mmc_driver {
-	struct device_driver drv;
-	int (*probe)(struct mmc_card *);
-	void (*remove)(struct mmc_card *);
-	void (*shutdown)(struct mmc_card *);
-};
-
-extern int mmc_register_driver(struct mmc_driver *);
-extern void mmc_unregister_driver(struct mmc_driver *);
-
-extern void mmc_fixup_device(struct mmc_card *card,
-			     const struct mmc_fixup *table);
-
 #endif /* LINUX_MMC_CARD_H */
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v3 14/15] mmc: core: Move public functions from host.h to private headers
  2017-01-13 13:14 [PATCH v3 00/15] mmc: core: A start to slim down public mmc headers Ulf Hansson
                   ` (12 preceding siblings ...)
  2017-01-13 13:14 ` [PATCH v3 13/15] mmc: core: Move public functions from card.h to private headers Ulf Hansson
@ 2017-01-13 13:14 ` Ulf Hansson
  2017-01-16  3:14   ` Shawn Lin
  2017-01-13 13:14 ` [PATCH v3 15/15] mmc: core: Don't use extern declarations of public mmc functions Ulf Hansson
  2017-01-17 15:08 ` [PATCH v3 00/15] mmc: core: A start to slim down public mmc headers Ulf Hansson
  15 siblings, 1 reply; 50+ messages in thread
From: Ulf Hansson @ 2017-01-13 13:14 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson; +Cc: Jaehoon Chung, Adrian Hunter, Linus Walleij

A significant amount of functions are available through the public mmc
host.h header file. Let's slim down this public mmc interface, as to
prevent users from abusing it, by moving some of the functions to private
mmc host.h header file.

This change concentrates on moving the functions into private mmc headers,
following changes may continue with additional clean-ups.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/mmc/core/block.c    |  1 +
 drivers/mmc/core/bus.c      |  1 +
 drivers/mmc/core/debugfs.c  |  1 +
 drivers/mmc/core/host.h     | 49 ++++++++++++++++++++++++++++++++++++++++++++-
 drivers/mmc/core/mmc_test.c |  1 +
 drivers/mmc/core/sd.c       |  1 +
 drivers/mmc/core/sdio.c     |  1 +
 include/linux/mmc/host.h    | 48 ++------------------------------------------
 8 files changed, 56 insertions(+), 47 deletions(-)

diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index a8300be..7bd0338 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -49,6 +49,7 @@
 #include "block.h"
 #include "core.h"
 #include "card.h"
+#include "host.h"
 #include "bus.h"
 #include "mmc_ops.h"
 #include "sd_ops.h"
diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index 3be2e6a..3012465 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -24,6 +24,7 @@
 
 #include "core.h"
 #include "card.h"
+#include "host.h"
 #include "sdio_cis.h"
 #include "bus.h"
 
diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
index 2843e6a..a1fba57 100644
--- a/drivers/mmc/core/debugfs.c
+++ b/drivers/mmc/core/debugfs.c
@@ -21,6 +21,7 @@
 
 #include "core.h"
 #include "card.h"
+#include "host.h"
 #include "mmc_ops.h"
 
 #ifdef CONFIG_FAIL_MMC_REQUEST
diff --git a/drivers/mmc/core/host.h b/drivers/mmc/core/host.h
index 366ce79..fb6a76a 100644
--- a/drivers/mmc/core/host.h
+++ b/drivers/mmc/core/host.h
@@ -11,7 +11,7 @@
 #ifndef _MMC_CORE_HOST_H
 #define _MMC_CORE_HOST_H
 
-struct mmc_host;
+#include <linux/mmc/host.h>
 
 int mmc_register_host_class(void);
 void mmc_unregister_host_class(void);
@@ -21,6 +21,53 @@
 void mmc_retune_hold(struct mmc_host *host);
 void mmc_retune_release(struct mmc_host *host);
 int mmc_retune(struct mmc_host *host);
+void mmc_retune_pause(struct mmc_host *host);
+void mmc_retune_unpause(struct mmc_host *host);
+
+static inline void mmc_retune_recheck(struct mmc_host *host)
+{
+	if (host->hold_retune <= 1)
+		host->retune_now = 1;
+}
+
+static inline int mmc_host_cmd23(struct mmc_host *host)
+{
+	return host->caps & MMC_CAP_CMD23;
+}
+
+static inline int mmc_boot_partition_access(struct mmc_host *host)
+{
+	return !(host->caps2 & MMC_CAP2_BOOTPART_NOACC);
+}
+
+static inline int mmc_host_uhs(struct mmc_host *host)
+{
+	return host->caps &
+		(MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 |
+		 MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR104 |
+		 MMC_CAP_UHS_DDR50);
+}
+
+static inline bool mmc_card_hs200(struct mmc_card *card)
+{
+	return card->host->ios.timing == MMC_TIMING_MMC_HS200;
+}
+
+static inline bool mmc_card_ddr52(struct mmc_card *card)
+{
+	return card->host->ios.timing == MMC_TIMING_MMC_DDR52;
+}
+
+static inline bool mmc_card_hs400(struct mmc_card *card)
+{
+	return card->host->ios.timing == MMC_TIMING_MMC_HS400;
+}
+
+static inline bool mmc_card_hs400es(struct mmc_card *card)
+{
+	return card->host->ios.enhanced_strobe;
+}
+
 
 #endif
 
diff --git a/drivers/mmc/core/mmc_test.c b/drivers/mmc/core/mmc_test.c
index 8dd2115..83d193c 100644
--- a/drivers/mmc/core/mmc_test.c
+++ b/drivers/mmc/core/mmc_test.c
@@ -24,6 +24,7 @@
 
 #include "core.h"
 #include "card.h"
+#include "host.h"
 #include "bus.h"
 
 #define RESULT_OK		0
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index d66b08d..8b4f139 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -23,6 +23,7 @@
 
 #include "core.h"
 #include "card.h"
+#include "host.h"
 #include "bus.h"
 #include "mmc_ops.h"
 #include "sd.h"
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 5419c0d..261c886 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -21,6 +21,7 @@
 
 #include "core.h"
 #include "card.h"
+#include "host.h"
 #include "bus.h"
 #include "sd.h"
 #include "sdio_bus.h"
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 7de0519..97699d5 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -473,56 +473,20 @@ static inline int mmc_card_wake_sdio_irq(struct mmc_host *host)
 	return host->pm_flags & MMC_PM_WAKE_SDIO_IRQ;
 }
 
-static inline int mmc_host_cmd23(struct mmc_host *host)
-{
-	return host->caps & MMC_CAP_CMD23;
-}
-
-static inline int mmc_boot_partition_access(struct mmc_host *host)
-{
-	return !(host->caps2 & MMC_CAP2_BOOTPART_NOACC);
-}
-
-static inline int mmc_host_uhs(struct mmc_host *host)
-{
-	return host->caps &
-		(MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 |
-		 MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR104 |
-		 MMC_CAP_UHS_DDR50);
-}
-
+/* TODO: Move to private header */
 static inline int mmc_card_hs(struct mmc_card *card)
 {
 	return card->host->ios.timing == MMC_TIMING_SD_HS ||
 		card->host->ios.timing == MMC_TIMING_MMC_HS;
 }
 
+/* TODO: Move to private header */
 static inline int mmc_card_uhs(struct mmc_card *card)
 {
 	return card->host->ios.timing >= MMC_TIMING_UHS_SDR12 &&
 		card->host->ios.timing <= MMC_TIMING_UHS_DDR50;
 }
 
-static inline bool mmc_card_hs200(struct mmc_card *card)
-{
-	return card->host->ios.timing == MMC_TIMING_MMC_HS200;
-}
-
-static inline bool mmc_card_ddr52(struct mmc_card *card)
-{
-	return card->host->ios.timing == MMC_TIMING_MMC_DDR52;
-}
-
-static inline bool mmc_card_hs400(struct mmc_card *card)
-{
-	return card->host->ios.timing == MMC_TIMING_MMC_HS400;
-}
-
-static inline bool mmc_card_hs400es(struct mmc_card *card)
-{
-	return card->host->ios.enhanced_strobe;
-}
-
 void mmc_retune_timer_stop(struct mmc_host *host);
 
 static inline void mmc_retune_needed(struct mmc_host *host)
@@ -531,12 +495,6 @@ static inline void mmc_retune_needed(struct mmc_host *host)
 		host->need_retune = 1;
 }
 
-static inline void mmc_retune_recheck(struct mmc_host *host)
-{
-	if (host->hold_retune <= 1)
-		host->retune_now = 1;
-}
-
 static inline bool mmc_can_retune(struct mmc_host *host)
 {
 	return host->can_retune == 1;
@@ -544,7 +502,5 @@ static inline bool mmc_can_retune(struct mmc_host *host)
 
 int mmc_send_tuning(struct mmc_host *host, u32 opcode, int *cmd_error);
 int mmc_abort_tuning(struct mmc_host *host, u32 opcode);
-void mmc_retune_pause(struct mmc_host *host);
-void mmc_retune_unpause(struct mmc_host *host);
 
 #endif /* LINUX_MMC_HOST_H */
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* [PATCH v3 15/15] mmc: core: Don't use extern declarations of public mmc functions
  2017-01-13 13:14 [PATCH v3 00/15] mmc: core: A start to slim down public mmc headers Ulf Hansson
                   ` (13 preceding siblings ...)
  2017-01-13 13:14 ` [PATCH v3 14/15] mmc: core: Move public functions from host.h " Ulf Hansson
@ 2017-01-13 13:14 ` Ulf Hansson
  2017-01-16  3:16   ` Shawn Lin
  2017-01-17 15:08 ` [PATCH v3 00/15] mmc: core: A start to slim down public mmc headers Ulf Hansson
  15 siblings, 1 reply; 50+ messages in thread
From: Ulf Hansson @ 2017-01-13 13:14 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson; +Cc: Jaehoon Chung, Adrian Hunter, Linus Walleij

Using extern when declaring functions in the public header, core.h, is
redundant. Let's just remove the use of it.

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
---
 include/linux/mmc/core.h | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 6440e10..6dcb339 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -158,13 +158,14 @@ struct mmc_request {
 struct mmc_card;
 struct mmc_async_req;
 
-extern struct mmc_async_req *mmc_start_req(struct mmc_host *,
-					   struct mmc_async_req *,
-					   enum mmc_blk_status *);
-extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *);
-extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);
-
-extern int mmc_hw_reset(struct mmc_host *host);
-extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *);
+struct mmc_async_req *mmc_start_req(struct mmc_host *host,
+				struct mmc_async_req *areq,
+				enum mmc_blk_status *ret_stat);
+void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq);
+int mmc_wait_for_cmd(struct mmc_host *host, struct mmc_command *cmd,
+		int retries);
+
+int mmc_hw_reset(struct mmc_host *host);
+void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card);
 
 #endif /* LINUX_MMC_CORE_H */
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 50+ messages in thread

* Re: [PATCH v3 02/15] ARM: davinci: Don't rely on public mmc header to include leds.h
  2017-01-13 13:14   ` Ulf Hansson
@ 2017-01-13 13:26     ` Sekhar Nori
  -1 siblings, 0 replies; 50+ messages in thread
From: Sekhar Nori @ 2017-01-13 13:26 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc
  Cc: Jaehoon Chung, Adrian Hunter, Linus Walleij, Kevin Hilman,
	linux-arm-kernel

On Friday 13 January 2017 06:44 PM, Ulf Hansson wrote:
> Some of the davinci boards, da850-evm, dm644x-evm and neuros-osd2 depends
> on leds.h. Explicitly include it instead of relying on the public mmc
> header host.h.
> 
> Cc: Sekhar Nori <nsekhar@ti.com>
> Cc: Kevin Hilman <khilman@kernel.org>
> Cc: <linux-arm-kernel@lists.infradead.org>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

Acked-by: Sekhar Nori <nsekhar@ti.com>

Thanks,
Sekhar

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v3 02/15] ARM: davinci: Don't rely on public mmc header to include leds.h
@ 2017-01-13 13:26     ` Sekhar Nori
  0 siblings, 0 replies; 50+ messages in thread
From: Sekhar Nori @ 2017-01-13 13:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 13 January 2017 06:44 PM, Ulf Hansson wrote:
> Some of the davinci boards, da850-evm, dm644x-evm and neuros-osd2 depends
> on leds.h. Explicitly include it instead of relying on the public mmc
> header host.h.
> 
> Cc: Sekhar Nori <nsekhar@ti.com>
> Cc: Kevin Hilman <khilman@kernel.org>
> Cc: <linux-arm-kernel@lists.infradead.org>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

Acked-by: Sekhar Nori <nsekhar@ti.com>

Thanks,
Sekhar

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v3 03/15] ARM: davinci: Don't rely on public mmc header to include interrupt.h
  2017-01-13 13:14   ` Ulf Hansson
@ 2017-01-13 13:38     ` Sekhar Nori
  -1 siblings, 0 replies; 50+ messages in thread
From: Sekhar Nori @ 2017-01-13 13:38 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc
  Cc: Jaehoon Chung, Adrian Hunter, Linus Walleij, Kevin Hilman,
	linux-arm-kernel

On Friday 13 January 2017 06:44 PM, Ulf Hansson wrote:
> The davinci board omapl138-hawk, depends on interrupt.h. Explicitly include
> it instead of relying on the public mmc header host.h.
> 
> Cc: Sekhar Nori <nsekhar@ti.com>
> Cc: Kevin Hilman <khilman@kernel.org>
> Cc: <linux-arm-kernel@lists.infradead.org>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

Acked-by: Sekhar Nori <nsekhar@ti.com>

Additionally checked that 02/15 and 03/15 do not clash with anything I
have queued so far. And built test my tree + these two patches with
davinci_all_defconfig.

Thanks,
Sekhar

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v3 03/15] ARM: davinci: Don't rely on public mmc header to include interrupt.h
@ 2017-01-13 13:38     ` Sekhar Nori
  0 siblings, 0 replies; 50+ messages in thread
From: Sekhar Nori @ 2017-01-13 13:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Friday 13 January 2017 06:44 PM, Ulf Hansson wrote:
> The davinci board omapl138-hawk, depends on interrupt.h. Explicitly include
> it instead of relying on the public mmc header host.h.
> 
> Cc: Sekhar Nori <nsekhar@ti.com>
> Cc: Kevin Hilman <khilman@kernel.org>
> Cc: <linux-arm-kernel@lists.infradead.org>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

Acked-by: Sekhar Nori <nsekhar@ti.com>

Additionally checked that 02/15 and 03/15 do not clash with anything I
have queued so far. And built test my tree + these two patches with
davinci_all_defconfig.

Thanks,
Sekhar

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v3 05/15] mmc: core: First step in cleaning up public mmc header files
  2017-01-13 13:14 ` [PATCH v3 05/15] mmc: core: First step in cleaning up public mmc header files Ulf Hansson
@ 2017-01-16  2:54   ` Shawn Lin
  0 siblings, 0 replies; 50+ messages in thread
From: Shawn Lin @ 2017-01-16  2:54 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc
  Cc: shawn.lin, Jaehoon Chung, Adrian Hunter, Linus Walleij

On 2017/1/13 21:14, Ulf Hansson wrote:
> This is the first step in cleaning up the public mmc header files. In this
> change we makes sure each header file builds standalone, as that helps to
> resolve dependencies.
>
> While changing this, it also seems reasonable to stop including other
> headers from inside a header itself which it don't depend upon.
> Additionally, in some cases such dependencies are better resolved by
> forward declaring the needed struct.
>

Look nice,

Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>

> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> ---
>  include/linux/mmc/card.h      | 2 --
>  include/linux/mmc/core.h      | 3 +--
>  include/linux/mmc/host.h      | 9 ++-------
>  include/linux/mmc/mmc.h       | 2 ++
>  include/linux/mmc/slot-gpio.h | 3 +++
>  5 files changed, 8 insertions(+), 11 deletions(-)
>
> diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
> index 00449e5..ca64f5b 100644
> --- a/include/linux/mmc/card.h
> +++ b/include/linux/mmc/card.h
> @@ -11,7 +11,6 @@
>  #define LINUX_MMC_CARD_H
>
>  #include <linux/device.h>
> -#include <linux/mmc/core.h>
>  #include <linux/mod_devicetable.h>
>
>  struct mmc_cid {
> @@ -206,7 +205,6 @@ struct sdio_cis {
>  };
>
>  struct mmc_host;
> -struct mmc_ios;
>  struct sdio_func;
>  struct sdio_func_tuple;
>
> diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
> index e33cc74..64e2ddf 100644
> --- a/include/linux/mmc/core.h
> +++ b/include/linux/mmc/core.h
> @@ -8,10 +8,9 @@
>  #ifndef LINUX_MMC_CORE_H
>  #define LINUX_MMC_CORE_H
>
> -#include <linux/interrupt.h>
>  #include <linux/completion.h>
> +#include <linux/types.h>
>
> -struct request;
>  struct mmc_data;
>  struct mmc_request;
>
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index 8bc8841..8d38c76 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -10,16 +10,12 @@
>  #ifndef LINUX_MMC_HOST_H
>  #define LINUX_MMC_HOST_H
>
> -#include <linux/leds.h>
> -#include <linux/mutex.h>
> -#include <linux/timer.h>
>  #include <linux/sched.h>
>  #include <linux/device.h>
>  #include <linux/fault-inject.h>
>
>  #include <linux/mmc/core.h>
>  #include <linux/mmc/card.h>
> -#include <linux/mmc/mmc.h>
>  #include <linux/mmc/pm.h>
>
>  struct mmc_ios {
> @@ -82,6 +78,8 @@ struct mmc_ios {
>  	bool enhanced_strobe;			/* hs400es selection */
>  };
>
> +struct mmc_host;
> +
>  struct mmc_host_ops {
>  	/*
>  	 * It is optional for the host to implement pre_req and post_req in
> @@ -162,9 +160,6 @@ struct mmc_host_ops {
>  				  unsigned int direction, int blk_size);
>  };
>
> -struct mmc_card;
> -struct device;
> -
>  struct mmc_async_req {
>  	/* active mmc request */
>  	struct mmc_request	*mrq;
> diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
> index a074082..261772e 100644
> --- a/include/linux/mmc/mmc.h
> +++ b/include/linux/mmc/mmc.h
> @@ -24,6 +24,8 @@
>  #ifndef LINUX_MMC_MMC_H
>  #define LINUX_MMC_MMC_H
>
> +#include <linux/types.h>
> +
>  /* Standard MMC commands (4.1)           type  argument     response */
>     /* class 1 */
>  #define MMC_GO_IDLE_STATE         0   /* bc                          */
> diff --git a/include/linux/mmc/slot-gpio.h b/include/linux/mmc/slot-gpio.h
> index a7972cd..82f0d28 100644
> --- a/include/linux/mmc/slot-gpio.h
> +++ b/include/linux/mmc/slot-gpio.h
> @@ -11,6 +11,9 @@
>  #ifndef MMC_SLOT_GPIO_H
>  #define MMC_SLOT_GPIO_H
>
> +#include <linux/types.h>
> +#include <linux/irqreturn.h>
> +
>  struct mmc_host;
>
>  int mmc_gpio_get_ro(struct mmc_host *host);
>


-- 
Best Regards
Shawn Lin


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v3 06/15] mmc: core: First step in cleaning up private mmc header files
  2017-01-13 13:14 ` [PATCH v3 06/15] mmc: core: First step in cleaning up private " Ulf Hansson
@ 2017-01-16  2:56   ` Shawn Lin
  0 siblings, 0 replies; 50+ messages in thread
From: Shawn Lin @ 2017-01-16  2:56 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc
  Cc: shawn.lin, Jaehoon Chung, Adrian Hunter, Linus Walleij

On 2017/1/13 21:14, Ulf Hansson wrote:
> This is the first step in cleaning up the private mmc header files. In this
> change we makes sure each header file builds standalone, as that helps to
> resolve dependencies.
>
> While changing this, it also seems reasonable to stop including other
> headers from inside a header itself which it don't depend upon.
> Additionally, in some cases such dependencies are better resolved by
> forward declaring the needed struct.
>

Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>

> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> ---
>  drivers/mmc/core/block.h     | 8 ++++++++
>  drivers/mmc/core/bus.h       | 4 ++++
>  drivers/mmc/core/core.h      | 4 ++++
>  drivers/mmc/core/host.h      | 3 ++-
>  drivers/mmc/core/mmc_ops.h   | 5 +++++
>  drivers/mmc/core/pwrseq.h    | 6 +++++-
>  drivers/mmc/core/queue.h     | 6 +++++-
>  drivers/mmc/core/sd.h        | 5 ++++-
>  drivers/mmc/core/sd_ops.h    | 5 +++++
>  drivers/mmc/core/sdio_bus.h  | 3 +++
>  drivers/mmc/core/sdio_cis.h  | 3 +++
>  drivers/mmc/core/sdio_ops.h  | 4 ++++
>  drivers/mmc/core/slot-gpio.h | 2 ++
>  13 files changed, 54 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/mmc/core/block.h b/drivers/mmc/core/block.h
> index cdabb2e..00b7483 100644
> --- a/drivers/mmc/core/block.h
> +++ b/drivers/mmc/core/block.h
> @@ -1 +1,9 @@
> +#ifndef _MMC_CORE_BLOCK_H
> +#define _MMC_CORE_BLOCK_H
> +
> +struct mmc_queue;
> +struct request;
> +
>  int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req);
> +
> +#endif
> diff --git a/drivers/mmc/core/bus.h b/drivers/mmc/core/bus.h
> index 00a1971..93b516a 100644
> --- a/drivers/mmc/core/bus.h
> +++ b/drivers/mmc/core/bus.h
> @@ -11,6 +11,10 @@
>  #ifndef _MMC_CORE_BUS_H
>  #define _MMC_CORE_BUS_H
>
> +struct mmc_host;
> +struct mmc_card;
> +struct device_type;
> +
>  #define MMC_DEV_ATTR(name, fmt, args...)					\
>  static ssize_t mmc_##name##_show (struct device *dev, struct device_attribute *attr, char *buf)	\
>  {										\
> diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h
> index 0fa86a2..29b91ae 100644
> --- a/drivers/mmc/core/core.h
> +++ b/drivers/mmc/core/core.h
> @@ -12,6 +12,10 @@
>  #define _MMC_CORE_CORE_H
>
>  #include <linux/delay.h>
> +#include <linux/sched.h>
> +
> +struct mmc_host;
> +struct mmc_card;
>
>  #define MMC_CMD_RETRIES        3
>
> diff --git a/drivers/mmc/core/host.h b/drivers/mmc/core/host.h
> index 992bf53..366ce79 100644
> --- a/drivers/mmc/core/host.h
> +++ b/drivers/mmc/core/host.h
> @@ -10,7 +10,8 @@
>   */
>  #ifndef _MMC_CORE_HOST_H
>  #define _MMC_CORE_HOST_H
> -#include <linux/mmc/host.h>
> +
> +struct mmc_host;
>
>  int mmc_register_host_class(void);
>  void mmc_unregister_host_class(void);
> diff --git a/drivers/mmc/core/mmc_ops.h b/drivers/mmc/core/mmc_ops.h
> index abd525e..e76365a 100644
> --- a/drivers/mmc/core/mmc_ops.h
> +++ b/drivers/mmc/core/mmc_ops.h
> @@ -12,6 +12,11 @@
>  #ifndef _MMC_MMC_OPS_H
>  #define _MMC_MMC_OPS_H
>
> +#include <linux/types.h>
> +
> +struct mmc_host;
> +struct mmc_card;
> +
>  int mmc_select_card(struct mmc_card *card);
>  int mmc_deselect_cards(struct mmc_host *host);
>  int mmc_set_dsr(struct mmc_host *host);
> diff --git a/drivers/mmc/core/pwrseq.h b/drivers/mmc/core/pwrseq.h
> index d69e751..39c911a 100644
> --- a/drivers/mmc/core/pwrseq.h
> +++ b/drivers/mmc/core/pwrseq.h
> @@ -8,7 +8,11 @@
>  #ifndef _MMC_CORE_PWRSEQ_H
>  #define _MMC_CORE_PWRSEQ_H
>
> -#include <linux/mmc/host.h>
> +#include <linux/types.h>
> +
> +struct mmc_host;
> +struct device;
> +struct module;
>
>  struct mmc_pwrseq_ops {
>  	void (*pre_power_on)(struct mmc_host *host);
> diff --git a/drivers/mmc/core/queue.h b/drivers/mmc/core/queue.h
> index dac8c3d..0cea02a 100644
> --- a/drivers/mmc/core/queue.h
> +++ b/drivers/mmc/core/queue.h
> @@ -1,6 +1,11 @@
>  #ifndef MMC_QUEUE_H
>  #define MMC_QUEUE_H
>
> +#include <linux/types.h>
> +#include <linux/blkdev.h>
> +#include <linux/mmc/core.h>
> +#include <linux/mmc/host.h>
> +
>  static inline bool mmc_req_is_special(struct request *req)
>  {
>  	return req &&
> @@ -9,7 +14,6 @@ static inline bool mmc_req_is_special(struct request *req)
>  		 req_op(req) == REQ_OP_SECURE_ERASE);
>  }
>
> -struct request;
>  struct task_struct;
>  struct mmc_blk_data;
>
> diff --git a/drivers/mmc/core/sd.h b/drivers/mmc/core/sd.h
> index aab824a..1ada980 100644
> --- a/drivers/mmc/core/sd.h
> +++ b/drivers/mmc/core/sd.h
> @@ -1,10 +1,13 @@
>  #ifndef _MMC_CORE_SD_H
>  #define _MMC_CORE_SD_H
>
> -#include <linux/mmc/card.h>
> +#include <linux/types.h>
>
>  extern struct device_type sd_type;
>
> +struct mmc_host;
> +struct mmc_card;
> +
>  int mmc_sd_get_cid(struct mmc_host *host, u32 ocr, u32 *cid, u32 *rocr);
>  int mmc_sd_get_csd(struct mmc_host *host, struct mmc_card *card);
>  void mmc_decode_cid(struct mmc_card *card);
> diff --git a/drivers/mmc/core/sd_ops.h b/drivers/mmc/core/sd_ops.h
> index ffc2305..ac7223c 100644
> --- a/drivers/mmc/core/sd_ops.h
> +++ b/drivers/mmc/core/sd_ops.h
> @@ -12,6 +12,11 @@
>  #ifndef _MMC_SD_OPS_H
>  #define _MMC_SD_OPS_H
>
> +#include <linux/types.h>
> +
> +struct mmc_card;
> +struct mmc_host;
> +
>  int mmc_app_set_bus_width(struct mmc_card *card, int width);
>  int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr);
>  int mmc_send_if_cond(struct mmc_host *host, u32 ocr);
> diff --git a/drivers/mmc/core/sdio_bus.h b/drivers/mmc/core/sdio_bus.h
> index 567a768..b69a254 100644
> --- a/drivers/mmc/core/sdio_bus.h
> +++ b/drivers/mmc/core/sdio_bus.h
> @@ -11,6 +11,9 @@
>  #ifndef _MMC_CORE_SDIO_BUS_H
>  #define _MMC_CORE_SDIO_BUS_H
>
> +struct mmc_card;
> +struct sdio_func;
> +
>  struct sdio_func *sdio_alloc_func(struct mmc_card *card);
>  int sdio_add_func(struct sdio_func *func);
>  void sdio_remove_func(struct sdio_func *func);
> diff --git a/drivers/mmc/core/sdio_cis.h b/drivers/mmc/core/sdio_cis.h
> index 4d903c2..16aa563 100644
> --- a/drivers/mmc/core/sdio_cis.h
> +++ b/drivers/mmc/core/sdio_cis.h
> @@ -14,6 +14,9 @@
>  #ifndef _MMC_SDIO_CIS_H
>  #define _MMC_SDIO_CIS_H
>
> +struct mmc_card;
> +struct sdio_func;
> +
>  int sdio_read_common_cis(struct mmc_card *card);
>  void sdio_free_common_cis(struct mmc_card *card);
>
> diff --git a/drivers/mmc/core/sdio_ops.h b/drivers/mmc/core/sdio_ops.h
> index 5660c7f..e1c36d6 100644
> --- a/drivers/mmc/core/sdio_ops.h
> +++ b/drivers/mmc/core/sdio_ops.h
> @@ -12,8 +12,12 @@
>  #ifndef _MMC_SDIO_OPS_H
>  #define _MMC_SDIO_OPS_H
>
> +#include <linux/types.h>
>  #include <linux/mmc/sdio.h>
>
> +struct mmc_host;
> +struct mmc_card;
> +
>  int mmc_send_io_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr);
>  int mmc_io_rw_direct(struct mmc_card *card, int write, unsigned fn,
>  	unsigned addr, u8 in, u8* out);
> diff --git a/drivers/mmc/core/slot-gpio.h b/drivers/mmc/core/slot-gpio.h
> index 8c1854d..a06fd84 100644
> --- a/drivers/mmc/core/slot-gpio.h
> +++ b/drivers/mmc/core/slot-gpio.h
> @@ -8,6 +8,8 @@
>  #ifndef _MMC_CORE_SLOTGPIO_H
>  #define _MMC_CORE_SLOTGPIO_H
>
> +struct mmc_host;
> +
>  int mmc_gpio_alloc(struct mmc_host *host);
>
>  #endif
>


-- 
Best Regards
Shawn Lin


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v3 07/15] mmc: core: Move public functions from core.h to private headers
  2017-01-13 13:14 ` [PATCH v3 07/15] mmc: core: Move public functions from core.h to private headers Ulf Hansson
@ 2017-01-16  3:01   ` Shawn Lin
  2017-01-17 15:07     ` Ulf Hansson
  0 siblings, 1 reply; 50+ messages in thread
From: Shawn Lin @ 2017-01-16  3:01 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc
  Cc: shawn.lin, Jaehoon Chung, Adrian Hunter, Linus Walleij

On 2017/1/13 21:14, Ulf Hansson wrote:
> A significant amount of functions are available through the public mmc
> core.h header file. Let's slim down this public mmc interface, as to
> prevent users from abusing it, by moving some of the functions to private
> mmc header files.
>
> This change concentrates on moving the functions into private mmc headers,
> following changes may continue with additional clean-ups, as an example
> some functions can be turned into static.
>

[...]

> @@ -16,6 +16,7 @@
>  #include <linux/mmc/sdio_func.h>
>
>  #include "sdio_ops.h"
> +#include "core.h"
>

Should we need move it before sdio_ops.h to
slightly keep the order? The same for sdio_orq.c change :)

Otherwise,

Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>

>  /**
>   *	sdio_claim_host - exclusively claim a bus for a certain SDIO function
> diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
> index f1faf9a..d084635 100644
> --- a/drivers/mmc/core/sdio_irq.c
> +++ b/drivers/mmc/core/sdio_irq.c
> @@ -27,6 +27,7 @@
>  #include <linux/mmc/sdio_func.h>
>
>  #include "sdio_ops.h"
> +#include "core.h"
>
>  static int process_sdio_pending_irqs(struct mmc_host *host)
>  {
> diff --git a/drivers/mmc/core/sdio_ops.h b/drivers/mmc/core/sdio_ops.h
> index e1c36d6..bed8a83 100644
> --- a/drivers/mmc/core/sdio_ops.h
> +++ b/drivers/mmc/core/sdio_ops.h
> @@ -24,6 +24,7 @@ int mmc_io_rw_direct(struct mmc_card *card, int write, unsigned fn,
>  int mmc_io_rw_extended(struct mmc_card *card, int write, unsigned fn,
>  	unsigned addr, int incr_addr, u8 *buf, unsigned blocks, unsigned blksz);
>  int sdio_reset(struct mmc_host *host);
> +unsigned int mmc_align_data_size(struct mmc_card *card, unsigned int sz);
>
>  static inline bool mmc_is_io_op(u32 opcode)
>  {
> diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
> index 64e2ddf..e679a86 100644
> --- a/include/linux/mmc/core.h
> +++ b/include/linux/mmc/core.h
> @@ -158,25 +158,13 @@ struct mmc_request {
>  struct mmc_card;
>  struct mmc_async_req;
>
> -extern int mmc_stop_bkops(struct mmc_card *);
> -extern int mmc_read_bkops_status(struct mmc_card *);
>  extern struct mmc_async_req *mmc_start_req(struct mmc_host *,
>  					   struct mmc_async_req *,
>  					   enum mmc_blk_status *);
> -extern int mmc_interrupt_hpi(struct mmc_card *);
>  extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *);
> -extern void mmc_wait_for_req_done(struct mmc_host *host,
> -				  struct mmc_request *mrq);
> -extern bool mmc_is_req_done(struct mmc_host *host, struct mmc_request *mrq);
>  extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);
> -extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *);
> -extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *,
> -	struct mmc_command *, int);
> -extern void mmc_start_bkops(struct mmc_card *card, bool from_exception);
> -extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int);
>  extern int mmc_send_tuning(struct mmc_host *host, u32 opcode, int *cmd_error);
>  extern int mmc_abort_tuning(struct mmc_host *host, u32 opcode);
> -extern int mmc_get_ext_csd(struct mmc_card *card, u8 **new_ext_csd);
>
>  #define MMC_ERASE_ARG		0x00000000
>  #define MMC_SECURE_ERASE_ARG	0x80000000
> @@ -188,46 +176,8 @@ extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *,
>  #define MMC_SECURE_ARGS		0x80000000
>  #define MMC_TRIM_ARGS		0x00008001
>
> -extern int mmc_erase(struct mmc_card *card, unsigned int from, unsigned int nr,
> -		     unsigned int arg);
> -extern int mmc_can_erase(struct mmc_card *card);
> -extern int mmc_can_trim(struct mmc_card *card);
> -extern int mmc_can_discard(struct mmc_card *card);
> -extern int mmc_can_sanitize(struct mmc_card *card);
> -extern int mmc_can_secure_erase_trim(struct mmc_card *card);
> -extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from,
> -				   unsigned int nr);
> -extern unsigned int mmc_calc_max_discard(struct mmc_card *card);
> -
> -extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen);
> -extern int mmc_set_blockcount(struct mmc_card *card, unsigned int blockcount,
> -			      bool is_rel_write);
>  extern int mmc_hw_reset(struct mmc_host *host);
> -extern int mmc_can_reset(struct mmc_card *card);
> -
>  extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *);
> -extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int);
> -
> -extern int __mmc_claim_host(struct mmc_host *host, atomic_t *abort);
> -extern void mmc_release_host(struct mmc_host *host);
> -
> -extern void mmc_get_card(struct mmc_card *card);
> -extern void mmc_put_card(struct mmc_card *card);
> -
> -extern int mmc_flush_cache(struct mmc_card *);
> -
> -extern int mmc_detect_card_removed(struct mmc_host *host);
> -
> -/**
> - *	mmc_claim_host - exclusively claim a host
> - *	@host: mmc host to claim
> - *
> - *	Claim a host for a set of operations.
> - */
> -static inline void mmc_claim_host(struct mmc_host *host)
> -{
> -	__mmc_claim_host(host, NULL);
> -}
>
>  struct device_node;
>  extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max);
>


-- 
Best Regards
Shawn Lin


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v3 08/15] mmc: core: Move some host specific public functions to host.h
  2017-01-13 13:14 ` [PATCH v3 08/15] mmc: core: Move some host specific public functions to host.h Ulf Hansson
@ 2017-01-16  3:02   ` Shawn Lin
  0 siblings, 0 replies; 50+ messages in thread
From: Shawn Lin @ 2017-01-16  3:02 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc
  Cc: shawn.lin, Jaehoon Chung, Adrian Hunter, Linus Walleij

On 2017/1/13 21:14, Ulf Hansson wrote:
> Ideally the public mmc header file, core.h, shouldn't contain interfaces
> particularly intended to be used by host drivers. Instead those should
> remain in the host.h header file. Therefore, let's move a couple functions
> from core.h to host.h.
>


Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>

> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  include/linux/mmc/core.h | 6 ------
>  include/linux/mmc/host.h | 6 ++++++
>  2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
> index e679a86..faacc90 100644
> --- a/include/linux/mmc/core.h
> +++ b/include/linux/mmc/core.h
> @@ -163,8 +163,6 @@ extern struct mmc_async_req *mmc_start_req(struct mmc_host *,
>  					   enum mmc_blk_status *);
>  extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *);
>  extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);
> -extern int mmc_send_tuning(struct mmc_host *host, u32 opcode, int *cmd_error);
> -extern int mmc_abort_tuning(struct mmc_host *host, u32 opcode);
>
>  #define MMC_ERASE_ARG		0x00000000
>  #define MMC_SECURE_ERASE_ARG	0x80000000
> @@ -179,8 +177,4 @@ extern struct mmc_async_req *mmc_start_req(struct mmc_host *,
>  extern int mmc_hw_reset(struct mmc_host *host);
>  extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *);
>
> -struct device_node;
> -extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max);
> -extern int mmc_of_parse_voltage(struct device_node *np, u32 *mask);
> -
>  #endif /* LINUX_MMC_CORE_H */
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index 8d38c76..7de0519 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -392,11 +392,14 @@ struct mmc_host {
>  	unsigned long		private[0] ____cacheline_aligned;
>  };
>
> +struct device_node;
> +
>  struct mmc_host *mmc_alloc_host(int extra, struct device *);
>  int mmc_add_host(struct mmc_host *);
>  void mmc_remove_host(struct mmc_host *);
>  void mmc_free_host(struct mmc_host *);
>  int mmc_of_parse(struct mmc_host *host);
> +int mmc_of_parse_voltage(struct device_node *np, u32 *mask);
>
>  static inline void *mmc_priv(struct mmc_host *host)
>  {
> @@ -452,6 +455,7 @@ static inline int mmc_regulator_set_vqmmc(struct mmc_host *mmc,
>  }
>  #endif
>
> +u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max);
>  int mmc_regulator_get_supply(struct mmc_host *mmc);
>
>  static inline int mmc_card_is_removable(struct mmc_host *host)
> @@ -538,6 +542,8 @@ static inline bool mmc_can_retune(struct mmc_host *host)
>  	return host->can_retune == 1;
>  }
>
> +int mmc_send_tuning(struct mmc_host *host, u32 opcode, int *cmd_error);
> +int mmc_abort_tuning(struct mmc_host *host, u32 opcode);
>  void mmc_retune_pause(struct mmc_host *host);
>  void mmc_retune_unpause(struct mmc_host *host);
>
>


-- 
Best Regards
Shawn Lin


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v3 09/15] mmc: core: Move erase/trim/discard defines from public core.h to mmc.h
  2017-01-13 13:14 ` [PATCH v3 09/15] mmc: core: Move erase/trim/discard defines from public core.h to mmc.h Ulf Hansson
@ 2017-01-16  3:05   ` Shawn Lin
  2017-01-17 15:06     ` Ulf Hansson
  0 siblings, 1 reply; 50+ messages in thread
From: Shawn Lin @ 2017-01-16  3:05 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc
  Cc: shawn.lin, Jaehoon Chung, Adrian Hunter, Linus Walleij

在 2017/1/13 21:14, Ulf Hansson 写道:
> As the public mmc.h header already contains similar defines for other mmc
> commands and arguments, let's move those for erase/trim/discard into here
> as well.
>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  include/linux/mmc/core.h | 10 ----------
>  include/linux/mmc/mmc.h  | 13 ++++++++++++-
>  2 files changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
> index faacc90..6440e10 100644
> --- a/include/linux/mmc/core.h
> +++ b/include/linux/mmc/core.h
> @@ -164,16 +164,6 @@ extern struct mmc_async_req *mmc_start_req(struct mmc_host *,
>  extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *);
>  extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);
>
> -#define MMC_ERASE_ARG		0x00000000
> -#define MMC_SECURE_ERASE_ARG	0x80000000
> -#define MMC_TRIM_ARG		0x00000001
> -#define MMC_DISCARD_ARG		0x00000003
> -#define MMC_SECURE_TRIM1_ARG	0x80000001
> -#define MMC_SECURE_TRIM2_ARG	0x80008000
> -
> -#define MMC_SECURE_ARGS		0x80000000
> -#define MMC_TRIM_ARGS		0x00008001
> -
>  extern int mmc_hw_reset(struct mmc_host *host);
>  extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *);
>
> diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
> index 261772e..8f78543 100644
> --- a/include/linux/mmc/mmc.h
> +++ b/include/linux/mmc/mmc.h
> @@ -462,12 +462,23 @@ struct _mmc_csd {
>  /*
>   * MMC_SWITCH access modes
>   */
> -

It's not relevant to remove this blank line?

Otherwise,

Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>

>  #define MMC_SWITCH_MODE_CMD_SET		0x00	/* Change the command set */
>  #define MMC_SWITCH_MODE_SET_BITS	0x01	/* Set bits which are 1 in value */
>  #define MMC_SWITCH_MODE_CLEAR_BITS	0x02	/* Clear bits which are 1 in value */
>  #define MMC_SWITCH_MODE_WRITE_BYTE	0x03	/* Set target to value */
>
> +/*
> + * Erase/trim/discard
> + */
> +#define MMC_ERASE_ARG			0x00000000
> +#define MMC_SECURE_ERASE_ARG		0x80000000
> +#define MMC_TRIM_ARG			0x00000001
> +#define MMC_DISCARD_ARG			0x00000003
> +#define MMC_SECURE_TRIM1_ARG		0x80000001
> +#define MMC_SECURE_TRIM2_ARG		0x80008000
> +#define MMC_SECURE_ARGS			0x80000000
> +#define MMC_TRIM_ARGS			0x00008001
> +
>  #define mmc_driver_type_mask(n)		(1 << (n))
>
>  #endif /* LINUX_MMC_MMC_H */
>


-- 
Best Regards
Shawn Lin


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v3 10/15] mmc: core: Remove unused struct _mmc_csd from public mmc.h header
  2017-01-13 13:14 ` [PATCH v3 10/15] mmc: core: Remove unused struct _mmc_csd from public mmc.h header Ulf Hansson
@ 2017-01-16  3:07   ` Shawn Lin
  2017-01-17 15:07     ` Ulf Hansson
  0 siblings, 1 reply; 50+ messages in thread
From: Shawn Lin @ 2017-01-16  3:07 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc
  Cc: shawn.lin, Jaehoon Chung, Adrian Hunter, Linus Walleij

On 2017/1/13 21:14, Ulf Hansson wrote:
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  include/linux/mmc/mmc.h | 44 --------------------------------------------
>  1 file changed, 44 deletions(-)
>

Looks quite strightforward, but it will be better if adding a
commit msg body here. Anyway,

Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>

> diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
> index 8f78543..7406d9b 100644
> --- a/include/linux/mmc/mmc.h
> +++ b/include/linux/mmc/mmc.h
> @@ -184,50 +184,6 @@ static inline bool mmc_op_multi(u32 opcode)
>  #define R2_SPI_OUT_OF_RANGE	(1 << 15)	/* or CSD overwrite */
>  #define R2_SPI_CSD_OVERWRITE	R2_SPI_OUT_OF_RANGE
>
> -/* These are unpacked versions of the actual responses */
> -
> -struct _mmc_csd {
> -	u8  csd_structure;
> -	u8  spec_vers;
> -	u8  taac;
> -	u8  nsac;
> -	u8  tran_speed;
> -	u16 ccc;
> -	u8  read_bl_len;
> -	u8  read_bl_partial;
> -	u8  write_blk_misalign;
> -	u8  read_blk_misalign;
> -	u8  dsr_imp;
> -	u16 c_size;
> -	u8  vdd_r_curr_min;
> -	u8  vdd_r_curr_max;
> -	u8  vdd_w_curr_min;
> -	u8  vdd_w_curr_max;
> -	u8  c_size_mult;
> -	union {
> -		struct { /* MMC system specification version 3.1 */
> -			u8  erase_grp_size;
> -			u8  erase_grp_mult;
> -		} v31;
> -		struct { /* MMC system specification version 2.2 */
> -			u8  sector_size;
> -			u8  erase_grp_size;
> -		} v22;
> -	} erase;
> -	u8  wp_grp_size;
> -	u8  wp_grp_enable;
> -	u8  default_ecc;
> -	u8  r2w_factor;
> -	u8  write_bl_len;
> -	u8  write_bl_partial;
> -	u8  file_format_grp;
> -	u8  copy;
> -	u8  perm_write_protect;
> -	u8  tmp_write_protect;
> -	u8  file_format;
> -	u8  ecc;
> -};
> -
>  /*
>   * OCR bits are mostly in host.h
>   */
>


-- 
Best Regards
Shawn Lin


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v3 13/15] mmc: core: Move public functions from card.h to private headers
  2017-01-13 13:14 ` [PATCH v3 13/15] mmc: core: Move public functions from card.h to private headers Ulf Hansson
@ 2017-01-16  3:10   ` Shawn Lin
  0 siblings, 0 replies; 50+ messages in thread
From: Shawn Lin @ 2017-01-16  3:10 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc
  Cc: shawn.lin, Jaehoon Chung, Adrian Hunter, Linus Walleij

在 2017/1/13 21:14, Ulf Hansson 写道:
> A significant amount of functions and other definitions are available
> through the public mmc card.h header file. Let's slim down this public mmc
> interface, as to prevent users from abusing it, by moving some of the
> functions/definitions to private mmc header files.
>
> This change concentrates on moving the functions into private mmc headers,
> following changes may continue with additional clean-ups.

Looks good,

Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>

>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/mmc/core/block.c    |   2 +
>  drivers/mmc/core/bus.c      |   1 +
>  drivers/mmc/core/bus.h      |  14 ++-
>  drivers/mmc/core/card.h     | 223 ++++++++++++++++++++++++++++++++++++++++
>  drivers/mmc/core/core.c     |   1 +
>  drivers/mmc/core/debugfs.c  |   1 +
>  drivers/mmc/core/mmc.c      |  13 +++
>  drivers/mmc/core/mmc_test.c |   2 +
>  drivers/mmc/core/queue.c    |   1 +
>  drivers/mmc/core/quirks.c   |   2 +
>  drivers/mmc/core/sd.c       |   1 +
>  drivers/mmc/core/sdio.c     |   1 +
>  drivers/mmc/core/sdio_bus.c |   1 +
>  drivers/mmc/core/sdio_io.c  |   1 +
>  drivers/mmc/core/sdio_irq.c |   1 +
>  include/linux/mmc/card.h    | 240 --------------------------------------------
>  16 files changed, 263 insertions(+), 242 deletions(-)
>  create mode 100644 drivers/mmc/core/card.h
>
> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
> index 41b5dbc..a8300be 100644
> --- a/drivers/mmc/core/block.c
> +++ b/drivers/mmc/core/block.c
> @@ -48,6 +48,8 @@
>  #include "queue.h"
>  #include "block.h"
>  #include "core.h"
> +#include "card.h"
> +#include "bus.h"
>  #include "mmc_ops.h"
>  #include "sd_ops.h"
>
> diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
> index c64266f..3be2e6a 100644
> --- a/drivers/mmc/core/bus.c
> +++ b/drivers/mmc/core/bus.c
> @@ -23,6 +23,7 @@
>  #include <linux/mmc/host.h>
>
>  #include "core.h"
> +#include "card.h"
>  #include "sdio_cis.h"
>  #include "bus.h"
>
> diff --git a/drivers/mmc/core/bus.h b/drivers/mmc/core/bus.h
> index 93b516a..72b0ef0 100644
> --- a/drivers/mmc/core/bus.h
> +++ b/drivers/mmc/core/bus.h
> @@ -11,9 +11,10 @@
>  #ifndef _MMC_CORE_BUS_H
>  #define _MMC_CORE_BUS_H
>
> +#include <linux/device.h>
> +
>  struct mmc_host;
>  struct mmc_card;
> -struct device_type;
>
>  #define MMC_DEV_ATTR(name, fmt, args...)					\
>  static ssize_t mmc_##name##_show (struct device *dev, struct device_attribute *attr, char *buf)	\
> @@ -31,5 +32,14 @@ struct mmc_card *mmc_alloc_card(struct mmc_host *host,
>  int mmc_register_bus(void);
>  void mmc_unregister_bus(void);
>
> -#endif
> +struct mmc_driver {
> +	struct device_driver drv;
> +	int (*probe)(struct mmc_card *card);
> +	void (*remove)(struct mmc_card *card);
> +	void (*shutdown)(struct mmc_card *card);
> +};
>
> +int mmc_register_driver(struct mmc_driver *drv);
> +void mmc_unregister_driver(struct mmc_driver *drv);
> +
> +#endif
> diff --git a/drivers/mmc/core/card.h b/drivers/mmc/core/card.h
> new file mode 100644
> index 0000000..95e8fc5
> --- /dev/null
> +++ b/drivers/mmc/core/card.h
> @@ -0,0 +1,223 @@
> +/*
> + * Private header for the mmc subsystem
> + *
> + * Copyright (C) 2016 Linaro Ltd
> + *
> + * Author: Ulf Hansson <ulf.hansson@linaro.org>
> + *
> + * License terms: GNU General Public License (GPL) version 2
> + */
> +
> +#ifndef _MMC_CORE_CARD_H
> +#define _MMC_CORE_CARD_H
> +
> +#include <linux/mmc/card.h>
> +
> +#define mmc_card_name(c)	((c)->cid.prod_name)
> +#define mmc_card_id(c)		(dev_name(&(c)->dev))
> +#define mmc_dev_to_card(d)	container_of(d, struct mmc_card, dev)
> +
> +/* Card states */
> +#define MMC_STATE_PRESENT	(1<<0)		/* present in sysfs */
> +#define MMC_STATE_READONLY	(1<<1)		/* card is read-only */
> +#define MMC_STATE_BLOCKADDR	(1<<2)		/* card uses block-addressing */
> +#define MMC_CARD_SDXC		(1<<3)		/* card is SDXC */
> +#define MMC_CARD_REMOVED	(1<<4)		/* card has been removed */
> +#define MMC_STATE_DOING_BKOPS	(1<<5)		/* card is doing BKOPS */
> +#define MMC_STATE_SUSPENDED	(1<<6)		/* card is suspended */
> +
> +#define mmc_card_present(c)	((c)->state & MMC_STATE_PRESENT)
> +#define mmc_card_readonly(c)	((c)->state & MMC_STATE_READONLY)
> +#define mmc_card_blockaddr(c)	((c)->state & MMC_STATE_BLOCKADDR)
> +#define mmc_card_ext_capacity(c) ((c)->state & MMC_CARD_SDXC)
> +#define mmc_card_removed(c)	((c) && ((c)->state & MMC_CARD_REMOVED))
> +#define mmc_card_doing_bkops(c)	((c)->state & MMC_STATE_DOING_BKOPS)
> +#define mmc_card_suspended(c)	((c)->state & MMC_STATE_SUSPENDED)
> +
> +#define mmc_card_set_present(c)	((c)->state |= MMC_STATE_PRESENT)
> +#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY)
> +#define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR)
> +#define mmc_card_set_ext_capacity(c) ((c)->state |= MMC_CARD_SDXC)
> +#define mmc_card_set_removed(c) ((c)->state |= MMC_CARD_REMOVED)
> +#define mmc_card_set_doing_bkops(c)	((c)->state |= MMC_STATE_DOING_BKOPS)
> +#define mmc_card_clr_doing_bkops(c)	((c)->state &= ~MMC_STATE_DOING_BKOPS)
> +#define mmc_card_set_suspended(c) ((c)->state |= MMC_STATE_SUSPENDED)
> +#define mmc_card_clr_suspended(c) ((c)->state &= ~MMC_STATE_SUSPENDED)
> +
> +/*
> + * The world is not perfect and supplies us with broken mmc/sdio devices.
> + * For at least some of these bugs we need a work-around.
> + */
> +struct mmc_fixup {
> +	/* CID-specific fields. */
> +	const char *name;
> +
> +	/* Valid revision range */
> +	u64 rev_start, rev_end;
> +
> +	unsigned int manfid;
> +	unsigned short oemid;
> +
> +	/* SDIO-specific fields. You can use SDIO_ANY_ID here of course */
> +	u16 cis_vendor, cis_device;
> +
> +	/* for MMC cards */
> +	unsigned int ext_csd_rev;
> +
> +	void (*vendor_fixup)(struct mmc_card *card, int data);
> +	int data;
> +};
> +
> +#define CID_MANFID_ANY (-1u)
> +#define CID_OEMID_ANY ((unsigned short) -1)
> +#define CID_NAME_ANY (NULL)
> +
> +#define EXT_CSD_REV_ANY (-1u)
> +
> +#define CID_MANFID_SANDISK      0x2
> +#define CID_MANFID_TOSHIBA      0x11
> +#define CID_MANFID_MICRON       0x13
> +#define CID_MANFID_SAMSUNG      0x15
> +#define CID_MANFID_KINGSTON     0x70
> +#define CID_MANFID_HYNIX	0x90
> +
> +#define END_FIXUP { NULL }
> +
> +#define _FIXUP_EXT(_name, _manfid, _oemid, _rev_start, _rev_end,	\
> +		   _cis_vendor, _cis_device,				\
> +		   _fixup, _data, _ext_csd_rev)				\
> +	{						\
> +		.name = (_name),			\
> +		.manfid = (_manfid),			\
> +		.oemid = (_oemid),			\
> +		.rev_start = (_rev_start),		\
> +		.rev_end = (_rev_end),			\
> +		.cis_vendor = (_cis_vendor),		\
> +		.cis_device = (_cis_device),		\
> +		.vendor_fixup = (_fixup),		\
> +		.data = (_data),			\
> +		.ext_csd_rev = (_ext_csd_rev),		\
> +	}
> +
> +#define MMC_FIXUP_REV(_name, _manfid, _oemid, _rev_start, _rev_end,	\
> +		      _fixup, _data, _ext_csd_rev)			\
> +	_FIXUP_EXT(_name, _manfid,					\
> +		   _oemid, _rev_start, _rev_end,			\
> +		   SDIO_ANY_ID, SDIO_ANY_ID,				\
> +		   _fixup, _data, _ext_csd_rev)				\
> +
> +#define MMC_FIXUP(_name, _manfid, _oemid, _fixup, _data) \
> +	MMC_FIXUP_REV(_name, _manfid, _oemid, 0, -1ull, _fixup, _data,	\
> +		      EXT_CSD_REV_ANY)
> +
> +#define MMC_FIXUP_EXT_CSD_REV(_name, _manfid, _oemid, _fixup, _data,	\
> +			      _ext_csd_rev)				\
> +	MMC_FIXUP_REV(_name, _manfid, _oemid, 0, -1ull, _fixup, _data,	\
> +		      _ext_csd_rev)
> +
> +#define SDIO_FIXUP(_vendor, _device, _fixup, _data)			\
> +	_FIXUP_EXT(CID_NAME_ANY, CID_MANFID_ANY,			\
> +		    CID_OEMID_ANY, 0, -1ull,				\
> +		   _vendor, _device,					\
> +		   _fixup, _data, EXT_CSD_REV_ANY)			\
> +
> +#define cid_rev(hwrev, fwrev, year, month)	\
> +	(((u64) hwrev) << 40 |			\
> +	 ((u64) fwrev) << 32 |			\
> +	 ((u64) year) << 16 |			\
> +	 ((u64) month))
> +
> +#define cid_rev_card(card)			\
> +	cid_rev(card->cid.hwrev,		\
> +		    card->cid.fwrev,		\
> +		    card->cid.year,		\
> +		    card->cid.month)
> +
> +/*
> + * Unconditionally quirk add/remove.
> + */
> +static inline void __maybe_unused add_quirk(struct mmc_card *card, int data)
> +{
> +	card->quirks |= data;
> +}
> +
> +static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data)
> +{
> +	card->quirks &= ~data;
> +}
> +
> +/*
> + * Quirk add/remove for MMC products.
> + */
> +static inline void __maybe_unused add_quirk_mmc(struct mmc_card *card, int data)
> +{
> +	if (mmc_card_mmc(card))
> +		card->quirks |= data;
> +}
> +
> +static inline void __maybe_unused remove_quirk_mmc(struct mmc_card *card,
> +						   int data)
> +{
> +	if (mmc_card_mmc(card))
> +		card->quirks &= ~data;
> +}
> +
> +/*
> + * Quirk add/remove for SD products.
> + */
> +static inline void __maybe_unused add_quirk_sd(struct mmc_card *card, int data)
> +{
> +	if (mmc_card_sd(card))
> +		card->quirks |= data;
> +}
> +
> +static inline void __maybe_unused remove_quirk_sd(struct mmc_card *card,
> +						   int data)
> +{
> +	if (mmc_card_sd(card))
> +		card->quirks &= ~data;
> +}
> +
> +static inline int mmc_card_lenient_fn0(const struct mmc_card *c)
> +{
> +	return c->quirks & MMC_QUIRK_LENIENT_FN0;
> +}
> +
> +static inline int mmc_blksz_for_byte_mode(const struct mmc_card *c)
> +{
> +	return c->quirks & MMC_QUIRK_BLKSZ_FOR_BYTE_MODE;
> +}
> +
> +static inline int mmc_card_disable_cd(const struct mmc_card *c)
> +{
> +	return c->quirks & MMC_QUIRK_DISABLE_CD;
> +}
> +
> +static inline int mmc_card_nonstd_func_interface(const struct mmc_card *c)
> +{
> +	return c->quirks & MMC_QUIRK_NONSTD_FUNC_IF;
> +}
> +
> +static inline int mmc_card_broken_byte_mode_512(const struct mmc_card *c)
> +{
> +	return c->quirks & MMC_QUIRK_BROKEN_BYTE_MODE_512;
> +}
> +
> +static inline int mmc_card_long_read_time(const struct mmc_card *c)
> +{
> +	return c->quirks & MMC_QUIRK_LONG_READ_TIME;
> +}
> +
> +static inline int mmc_card_broken_irq_polling(const struct mmc_card *c)
> +{
> +	return c->quirks & MMC_QUIRK_BROKEN_IRQ_POLLING;
> +}
> +
> +static inline int mmc_card_broken_hpi(const struct mmc_card *c)
> +{
> +	return c->quirks & MMC_QUIRK_BROKEN_HPI;
> +}
> +
> +void mmc_fixup_device(struct mmc_card *card, const struct mmc_fixup *table);
> +
> +#endif
> diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
> index 3b34a75..8c45825 100644
> --- a/drivers/mmc/core/core.c
> +++ b/drivers/mmc/core/core.c
> @@ -40,6 +40,7 @@
>  #include <trace/events/mmc.h>
>
>  #include "core.h"
> +#include "card.h"
>  #include "bus.h"
>  #include "host.h"
>  #include "sdio_bus.h"
> diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
> index 30623b8..2843e6a 100644
> --- a/drivers/mmc/core/debugfs.c
> +++ b/drivers/mmc/core/debugfs.c
> @@ -20,6 +20,7 @@
>  #include <linux/mmc/host.h>
>
>  #include "core.h"
> +#include "card.h"
>  #include "mmc_ops.h"
>
>  #ifdef CONFIG_FAIL_MMC_REQUEST
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index ec2e85c..b91abe0 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -21,6 +21,7 @@
>  #include <linux/mmc/mmc.h>
>
>  #include "core.h"
> +#include "card.h"
>  #include "host.h"
>  #include "bus.h"
>  #include "mmc_ops.h"
> @@ -307,6 +308,18 @@ static void mmc_manage_enhanced_area(struct mmc_card *card, u8 *ext_csd)
>  	}
>  }
>
> +static void mmc_part_add(struct mmc_card *card, unsigned int size,
> +			 unsigned int part_cfg, char *name, int idx, bool ro,
> +			 int area_type)
> +{
> +	card->part[card->nr_parts].size = size;
> +	card->part[card->nr_parts].part_cfg = part_cfg;
> +	sprintf(card->part[card->nr_parts].name, name, idx);
> +	card->part[card->nr_parts].force_ro = ro;
> +	card->part[card->nr_parts].area_type = area_type;
> +	card->nr_parts++;
> +}
> +
>  static void mmc_manage_gp_partitions(struct mmc_card *card, u8 *ext_csd)
>  {
>  	int idx;
> diff --git a/drivers/mmc/core/mmc_test.c b/drivers/mmc/core/mmc_test.c
> index 8075ad1..8dd2115 100644
> --- a/drivers/mmc/core/mmc_test.c
> +++ b/drivers/mmc/core/mmc_test.c
> @@ -23,6 +23,8 @@
>  #include <linux/module.h>
>
>  #include "core.h"
> +#include "card.h"
> +#include "bus.h"
>
>  #define RESULT_OK		0
>  #define RESULT_FAIL		1
> diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c
> index 8f5bf5f8..611f5c6 100644
> --- a/drivers/mmc/core/queue.c
> +++ b/drivers/mmc/core/queue.c
> @@ -21,6 +21,7 @@
>  #include "queue.h"
>  #include "block.h"
>  #include "core.h"
> +#include "card.h"
>
>  #define MMC_QUEUE_BOUNCESZ	65536
>
> diff --git a/drivers/mmc/core/quirks.c b/drivers/mmc/core/quirks.c
> index ca9cade..bf25a9c 100644
> --- a/drivers/mmc/core/quirks.c
> +++ b/drivers/mmc/core/quirks.c
> @@ -15,6 +15,8 @@
>  #include <linux/mmc/card.h>
>  #include <linux/mmc/sdio_ids.h>
>
> +#include "card.h"
> +
>  #ifndef SDIO_VENDOR_ID_TI
>  #define SDIO_VENDOR_ID_TI		0x0097
>  #endif
> diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
> index a614f37..d66b08d 100644
> --- a/drivers/mmc/core/sd.c
> +++ b/drivers/mmc/core/sd.c
> @@ -22,6 +22,7 @@
>  #include <linux/mmc/sd.h>
>
>  #include "core.h"
> +#include "card.h"
>  #include "bus.h"
>  #include "mmc_ops.h"
>  #include "sd.h"
> diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
> index 6810b3a..5419c0d 100644
> --- a/drivers/mmc/core/sdio.c
> +++ b/drivers/mmc/core/sdio.c
> @@ -20,6 +20,7 @@
>  #include <linux/mmc/sdio_ids.h>
>
>  #include "core.h"
> +#include "card.h"
>  #include "bus.h"
>  #include "sd.h"
>  #include "sdio_bus.h"
> diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c
> index 86f5b32..e992a7f 100644
> --- a/drivers/mmc/core/sdio_bus.c
> +++ b/drivers/mmc/core/sdio_bus.c
> @@ -25,6 +25,7 @@
>  #include <linux/of.h>
>
>  #include "core.h"
> +#include "card.h"
>  #include "sdio_cis.h"
>  #include "sdio_bus.h"
>
> diff --git a/drivers/mmc/core/sdio_io.c b/drivers/mmc/core/sdio_io.c
> index 76fe6d5..74195d7 100644
> --- a/drivers/mmc/core/sdio_io.c
> +++ b/drivers/mmc/core/sdio_io.c
> @@ -17,6 +17,7 @@
>
>  #include "sdio_ops.h"
>  #include "core.h"
> +#include "card.h"
>
>  /**
>   *	sdio_claim_host - exclusively claim a bus for a certain SDIO function
> diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
> index d084635..d29faf2 100644
> --- a/drivers/mmc/core/sdio_irq.c
> +++ b/drivers/mmc/core/sdio_irq.c
> @@ -28,6 +28,7 @@
>
>  #include "sdio_ops.h"
>  #include "core.h"
> +#include "card.h"
>
>  static int process_sdio_pending_irqs(struct mmc_host *host)
>  {
> diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
> index ca64f5b..29d00c9 100644
> --- a/include/linux/mmc/card.h
> +++ b/include/linux/mmc/card.h
> @@ -248,13 +248,6 @@ struct mmc_card {
>  #define MMC_TYPE_SDIO		2		/* SDIO card */
>  #define MMC_TYPE_SD_COMBO	3		/* SD combo (IO+mem) card */
>  	unsigned int		state;		/* (our) card state */
> -#define MMC_STATE_PRESENT	(1<<0)		/* present in sysfs */
> -#define MMC_STATE_READONLY	(1<<1)		/* card is read-only */
> -#define MMC_STATE_BLOCKADDR	(1<<2)		/* card uses block-addressing */
> -#define MMC_CARD_SDXC		(1<<3)		/* card is SDXC */
> -#define MMC_CARD_REMOVED	(1<<4)		/* card has been removed */
> -#define MMC_STATE_DOING_BKOPS	(1<<5)		/* card is doing BKOPS */
> -#define MMC_STATE_SUSPENDED	(1<<6)		/* card is suspended */
>  	unsigned int		quirks; 	/* card quirks */
>  #define MMC_QUIRK_LENIENT_FN0	(1<<0)		/* allow SDIO FN0 writes outside of the VS CCCR range */
>  #define MMC_QUIRK_BLKSZ_FOR_BYTE_MODE (1<<1)	/* use func->cur_blksize */
> @@ -273,7 +266,6 @@ struct mmc_card {
>  #define MMC_QUIRK_TRIM_BROKEN	(1<<12)		/* Skip trim */
>  #define MMC_QUIRK_BROKEN_HPI	(1<<13)		/* Disable broken HPI support */
>
> -
>  	unsigned int		erase_size;	/* erase size in sectors */
>   	unsigned int		erase_shift;	/* if erase unit is power 2 */
>   	unsigned int		pref_erase;	/* in sectors */
> @@ -309,245 +301,13 @@ struct mmc_card {
>  	unsigned int    nr_parts;
>  };
>
> -/*
> - * This function fill contents in mmc_part.
> - */
> -static inline void mmc_part_add(struct mmc_card *card, unsigned int size,
> -			unsigned int part_cfg, char *name, int idx, bool ro,
> -			int area_type)
> -{
> -	card->part[card->nr_parts].size = size;
> -	card->part[card->nr_parts].part_cfg = part_cfg;
> -	sprintf(card->part[card->nr_parts].name, name, idx);
> -	card->part[card->nr_parts].force_ro = ro;
> -	card->part[card->nr_parts].area_type = area_type;
> -	card->nr_parts++;
> -}
> -
>  static inline bool mmc_large_sector(struct mmc_card *card)
>  {
>  	return card->ext_csd.data_sector_size == 4096;
>  }
>
> -/*
> - *  The world is not perfect and supplies us with broken mmc/sdio devices.
> - *  For at least some of these bugs we need a work-around.
> - */
> -
> -struct mmc_fixup {
> -	/* CID-specific fields. */
> -	const char *name;
> -
> -	/* Valid revision range */
> -	u64 rev_start, rev_end;
> -
> -	unsigned int manfid;
> -	unsigned short oemid;
> -
> -	/* SDIO-specfic fields. You can use SDIO_ANY_ID here of course */
> -	u16 cis_vendor, cis_device;
> -
> -	/* for MMC cards */
> -	unsigned int ext_csd_rev;
> -
> -	void (*vendor_fixup)(struct mmc_card *card, int data);
> -	int data;
> -};
> -
> -#define CID_MANFID_ANY (-1u)
> -#define CID_OEMID_ANY ((unsigned short) -1)
> -#define CID_NAME_ANY (NULL)
> -
> -#define EXT_CSD_REV_ANY (-1u)
> -
> -#define CID_MANFID_SANDISK      0x2
> -#define CID_MANFID_TOSHIBA      0x11
> -#define CID_MANFID_MICRON       0x13
> -#define CID_MANFID_SAMSUNG      0x15
> -#define CID_MANFID_KINGSTON     0x70
> -#define CID_MANFID_HYNIX	0x90
> -
> -#define END_FIXUP { NULL }
> -
> -#define _FIXUP_EXT(_name, _manfid, _oemid, _rev_start, _rev_end,	\
> -		   _cis_vendor, _cis_device,				\
> -		   _fixup, _data, _ext_csd_rev)				\
> -	{						   \
> -		.name = (_name),			   \
> -		.manfid = (_manfid),			   \
> -		.oemid = (_oemid),			   \
> -		.rev_start = (_rev_start),		   \
> -		.rev_end = (_rev_end),			   \
> -		.cis_vendor = (_cis_vendor),		   \
> -		.cis_device = (_cis_device),		   \
> -		.vendor_fixup = (_fixup),		   \
> -		.data = (_data),			   \
> -		.ext_csd_rev = (_ext_csd_rev),		   \
> -	 }
> -
> -#define MMC_FIXUP_REV(_name, _manfid, _oemid, _rev_start, _rev_end,	\
> -		      _fixup, _data, _ext_csd_rev)			\
> -	_FIXUP_EXT(_name, _manfid,					\
> -		   _oemid, _rev_start, _rev_end,			\
> -		   SDIO_ANY_ID, SDIO_ANY_ID,				\
> -		   _fixup, _data, _ext_csd_rev)				\
> -
> -#define MMC_FIXUP(_name, _manfid, _oemid, _fixup, _data) \
> -	MMC_FIXUP_REV(_name, _manfid, _oemid, 0, -1ull, _fixup, _data,	\
> -		      EXT_CSD_REV_ANY)
> -
> -#define MMC_FIXUP_EXT_CSD_REV(_name, _manfid, _oemid, _fixup, _data,	\
> -			      _ext_csd_rev)				\
> -	MMC_FIXUP_REV(_name, _manfid, _oemid, 0, -1ull, _fixup, _data,	\
> -		      _ext_csd_rev)
> -
> -#define SDIO_FIXUP(_vendor, _device, _fixup, _data)			\
> -	_FIXUP_EXT(CID_NAME_ANY, CID_MANFID_ANY,			\
> -		    CID_OEMID_ANY, 0, -1ull,				\
> -		   _vendor, _device,					\
> -		   _fixup, _data, EXT_CSD_REV_ANY)			\
> -
> -#define cid_rev(hwrev, fwrev, year, month)	\
> -	(((u64) hwrev) << 40 |                  \
> -	 ((u64) fwrev) << 32 |                  \
> -	 ((u64) year) << 16 |                   \
> -	 ((u64) month))
> -
> -#define cid_rev_card(card)		  \
> -	cid_rev(card->cid.hwrev,	  \
> -		    card->cid.fwrev,      \
> -		    card->cid.year,	  \
> -		    card->cid.month)
> -
> -/*
> - * Unconditionally quirk add/remove.
> - */
> -
> -static inline void __maybe_unused add_quirk(struct mmc_card *card, int data)
> -{
> -	card->quirks |= data;
> -}
> -
> -static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data)
> -{
> -	card->quirks &= ~data;
> -}
> -
>  #define mmc_card_mmc(c)		((c)->type == MMC_TYPE_MMC)
>  #define mmc_card_sd(c)		((c)->type == MMC_TYPE_SD)
>  #define mmc_card_sdio(c)	((c)->type == MMC_TYPE_SDIO)
>
> -#define mmc_card_present(c)	((c)->state & MMC_STATE_PRESENT)
> -#define mmc_card_readonly(c)	((c)->state & MMC_STATE_READONLY)
> -#define mmc_card_blockaddr(c)	((c)->state & MMC_STATE_BLOCKADDR)
> -#define mmc_card_ext_capacity(c) ((c)->state & MMC_CARD_SDXC)
> -#define mmc_card_removed(c)	((c) && ((c)->state & MMC_CARD_REMOVED))
> -#define mmc_card_doing_bkops(c)	((c)->state & MMC_STATE_DOING_BKOPS)
> -#define mmc_card_suspended(c)	((c)->state & MMC_STATE_SUSPENDED)
> -
> -#define mmc_card_set_present(c)	((c)->state |= MMC_STATE_PRESENT)
> -#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY)
> -#define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR)
> -#define mmc_card_set_ext_capacity(c) ((c)->state |= MMC_CARD_SDXC)
> -#define mmc_card_set_removed(c) ((c)->state |= MMC_CARD_REMOVED)
> -#define mmc_card_set_doing_bkops(c)	((c)->state |= MMC_STATE_DOING_BKOPS)
> -#define mmc_card_clr_doing_bkops(c)	((c)->state &= ~MMC_STATE_DOING_BKOPS)
> -#define mmc_card_set_suspended(c) ((c)->state |= MMC_STATE_SUSPENDED)
> -#define mmc_card_clr_suspended(c) ((c)->state &= ~MMC_STATE_SUSPENDED)
> -
> -/*
> - * Quirk add/remove for MMC products.
> - */
> -
> -static inline void __maybe_unused add_quirk_mmc(struct mmc_card *card, int data)
> -{
> -	if (mmc_card_mmc(card))
> -		card->quirks |= data;
> -}
> -
> -static inline void __maybe_unused remove_quirk_mmc(struct mmc_card *card,
> -						   int data)
> -{
> -	if (mmc_card_mmc(card))
> -		card->quirks &= ~data;
> -}
> -
> -/*
> - * Quirk add/remove for SD products.
> - */
> -
> -static inline void __maybe_unused add_quirk_sd(struct mmc_card *card, int data)
> -{
> -	if (mmc_card_sd(card))
> -		card->quirks |= data;
> -}
> -
> -static inline void __maybe_unused remove_quirk_sd(struct mmc_card *card,
> -						   int data)
> -{
> -	if (mmc_card_sd(card))
> -		card->quirks &= ~data;
> -}
> -
> -static inline int mmc_card_lenient_fn0(const struct mmc_card *c)
> -{
> -	return c->quirks & MMC_QUIRK_LENIENT_FN0;
> -}
> -
> -static inline int mmc_blksz_for_byte_mode(const struct mmc_card *c)
> -{
> -	return c->quirks & MMC_QUIRK_BLKSZ_FOR_BYTE_MODE;
> -}
> -
> -static inline int mmc_card_disable_cd(const struct mmc_card *c)
> -{
> -	return c->quirks & MMC_QUIRK_DISABLE_CD;
> -}
> -
> -static inline int mmc_card_nonstd_func_interface(const struct mmc_card *c)
> -{
> -	return c->quirks & MMC_QUIRK_NONSTD_FUNC_IF;
> -}
> -
> -static inline int mmc_card_broken_byte_mode_512(const struct mmc_card *c)
> -{
> -	return c->quirks & MMC_QUIRK_BROKEN_BYTE_MODE_512;
> -}
> -
> -static inline int mmc_card_long_read_time(const struct mmc_card *c)
> -{
> -	return c->quirks & MMC_QUIRK_LONG_READ_TIME;
> -}
> -
> -static inline int mmc_card_broken_irq_polling(const struct mmc_card *c)
> -{
> -	return c->quirks & MMC_QUIRK_BROKEN_IRQ_POLLING;
> -}
> -
> -static inline int mmc_card_broken_hpi(const struct mmc_card *c)
> -{
> -	return c->quirks & MMC_QUIRK_BROKEN_HPI;
> -}
> -
> -#define mmc_card_name(c)	((c)->cid.prod_name)
> -#define mmc_card_id(c)		(dev_name(&(c)->dev))
> -
> -#define mmc_dev_to_card(d)	container_of(d, struct mmc_card, dev)
> -
> -/*
> - * MMC device driver (e.g., Flash card, I/O card...)
> - */
> -struct mmc_driver {
> -	struct device_driver drv;
> -	int (*probe)(struct mmc_card *);
> -	void (*remove)(struct mmc_card *);
> -	void (*shutdown)(struct mmc_card *);
> -};
> -
> -extern int mmc_register_driver(struct mmc_driver *);
> -extern void mmc_unregister_driver(struct mmc_driver *);
> -
> -extern void mmc_fixup_device(struct mmc_card *card,
> -			     const struct mmc_fixup *table);
> -
>  #endif /* LINUX_MMC_CARD_H */
>


-- 
Best Regards
Shawn Lin


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v3 14/15] mmc: core: Move public functions from host.h to private headers
  2017-01-13 13:14 ` [PATCH v3 14/15] mmc: core: Move public functions from host.h " Ulf Hansson
@ 2017-01-16  3:14   ` Shawn Lin
  0 siblings, 0 replies; 50+ messages in thread
From: Shawn Lin @ 2017-01-16  3:14 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc
  Cc: shawn.lin, Jaehoon Chung, Adrian Hunter, Linus Walleij

On 2017/1/13 21:14, Ulf Hansson wrote:
> A significant amount of functions are available through the public mmc
> host.h header file. Let's slim down this public mmc interface, as to
> prevent users from abusing it, by moving some of the functions to private
> mmc host.h header file.
>
> This change concentrates on moving the functions into private mmc headers,
> following changes may continue with additional clean-ups.
>

The same comment for the order of header files, anyway

Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>

> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/mmc/core/block.c    |  1 +
>  drivers/mmc/core/bus.c      |  1 +
>  drivers/mmc/core/debugfs.c  |  1 +
>  drivers/mmc/core/host.h     | 49 ++++++++++++++++++++++++++++++++++++++++++++-
>  drivers/mmc/core/mmc_test.c |  1 +
>  drivers/mmc/core/sd.c       |  1 +
>  drivers/mmc/core/sdio.c     |  1 +
>  include/linux/mmc/host.h    | 48 ++------------------------------------------
>  8 files changed, 56 insertions(+), 47 deletions(-)
>
> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
> index a8300be..7bd0338 100644
> --- a/drivers/mmc/core/block.c
> +++ b/drivers/mmc/core/block.c
> @@ -49,6 +49,7 @@
>  #include "block.h"
>  #include "core.h"
>  #include "card.h"
> +#include "host.h"
>  #include "bus.h"
>  #include "mmc_ops.h"
>  #include "sd_ops.h"
> diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
> index 3be2e6a..3012465 100644
> --- a/drivers/mmc/core/bus.c
> +++ b/drivers/mmc/core/bus.c
> @@ -24,6 +24,7 @@
>
>  #include "core.h"
>  #include "card.h"
> +#include "host.h"
>  #include "sdio_cis.h"
>  #include "bus.h"
>
> diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
> index 2843e6a..a1fba57 100644
> --- a/drivers/mmc/core/debugfs.c
> +++ b/drivers/mmc/core/debugfs.c
> @@ -21,6 +21,7 @@
>
>  #include "core.h"
>  #include "card.h"
> +#include "host.h"
>  #include "mmc_ops.h"
>
>  #ifdef CONFIG_FAIL_MMC_REQUEST
> diff --git a/drivers/mmc/core/host.h b/drivers/mmc/core/host.h
> index 366ce79..fb6a76a 100644
> --- a/drivers/mmc/core/host.h
> +++ b/drivers/mmc/core/host.h
> @@ -11,7 +11,7 @@
>  #ifndef _MMC_CORE_HOST_H
>  #define _MMC_CORE_HOST_H
>
> -struct mmc_host;
> +#include <linux/mmc/host.h>
>
>  int mmc_register_host_class(void);
>  void mmc_unregister_host_class(void);
> @@ -21,6 +21,53 @@
>  void mmc_retune_hold(struct mmc_host *host);
>  void mmc_retune_release(struct mmc_host *host);
>  int mmc_retune(struct mmc_host *host);
> +void mmc_retune_pause(struct mmc_host *host);
> +void mmc_retune_unpause(struct mmc_host *host);
> +
> +static inline void mmc_retune_recheck(struct mmc_host *host)
> +{
> +	if (host->hold_retune <= 1)
> +		host->retune_now = 1;
> +}
> +
> +static inline int mmc_host_cmd23(struct mmc_host *host)
> +{
> +	return host->caps & MMC_CAP_CMD23;
> +}
> +
> +static inline int mmc_boot_partition_access(struct mmc_host *host)
> +{
> +	return !(host->caps2 & MMC_CAP2_BOOTPART_NOACC);
> +}
> +
> +static inline int mmc_host_uhs(struct mmc_host *host)
> +{
> +	return host->caps &
> +		(MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 |
> +		 MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR104 |
> +		 MMC_CAP_UHS_DDR50);
> +}
> +
> +static inline bool mmc_card_hs200(struct mmc_card *card)
> +{
> +	return card->host->ios.timing == MMC_TIMING_MMC_HS200;
> +}
> +
> +static inline bool mmc_card_ddr52(struct mmc_card *card)
> +{
> +	return card->host->ios.timing == MMC_TIMING_MMC_DDR52;
> +}
> +
> +static inline bool mmc_card_hs400(struct mmc_card *card)
> +{
> +	return card->host->ios.timing == MMC_TIMING_MMC_HS400;
> +}
> +
> +static inline bool mmc_card_hs400es(struct mmc_card *card)
> +{
> +	return card->host->ios.enhanced_strobe;
> +}
> +
>
>  #endif
>
> diff --git a/drivers/mmc/core/mmc_test.c b/drivers/mmc/core/mmc_test.c
> index 8dd2115..83d193c 100644
> --- a/drivers/mmc/core/mmc_test.c
> +++ b/drivers/mmc/core/mmc_test.c
> @@ -24,6 +24,7 @@
>
>  #include "core.h"
>  #include "card.h"
> +#include "host.h"
>  #include "bus.h"
>
>  #define RESULT_OK		0
> diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
> index d66b08d..8b4f139 100644
> --- a/drivers/mmc/core/sd.c
> +++ b/drivers/mmc/core/sd.c
> @@ -23,6 +23,7 @@
>
>  #include "core.h"
>  #include "card.h"
> +#include "host.h"
>  #include "bus.h"
>  #include "mmc_ops.h"
>  #include "sd.h"
> diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
> index 5419c0d..261c886 100644
> --- a/drivers/mmc/core/sdio.c
> +++ b/drivers/mmc/core/sdio.c
> @@ -21,6 +21,7 @@
>
>  #include "core.h"
>  #include "card.h"
> +#include "host.h"
>  #include "bus.h"
>  #include "sd.h"
>  #include "sdio_bus.h"
> diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
> index 7de0519..97699d5 100644
> --- a/include/linux/mmc/host.h
> +++ b/include/linux/mmc/host.h
> @@ -473,56 +473,20 @@ static inline int mmc_card_wake_sdio_irq(struct mmc_host *host)
>  	return host->pm_flags & MMC_PM_WAKE_SDIO_IRQ;
>  }
>
> -static inline int mmc_host_cmd23(struct mmc_host *host)
> -{
> -	return host->caps & MMC_CAP_CMD23;
> -}
> -
> -static inline int mmc_boot_partition_access(struct mmc_host *host)
> -{
> -	return !(host->caps2 & MMC_CAP2_BOOTPART_NOACC);
> -}
> -
> -static inline int mmc_host_uhs(struct mmc_host *host)
> -{
> -	return host->caps &
> -		(MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 |
> -		 MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR104 |
> -		 MMC_CAP_UHS_DDR50);
> -}
> -
> +/* TODO: Move to private header */
>  static inline int mmc_card_hs(struct mmc_card *card)
>  {
>  	return card->host->ios.timing == MMC_TIMING_SD_HS ||
>  		card->host->ios.timing == MMC_TIMING_MMC_HS;
>  }
>
> +/* TODO: Move to private header */
>  static inline int mmc_card_uhs(struct mmc_card *card)
>  {
>  	return card->host->ios.timing >= MMC_TIMING_UHS_SDR12 &&
>  		card->host->ios.timing <= MMC_TIMING_UHS_DDR50;
>  }
>
> -static inline bool mmc_card_hs200(struct mmc_card *card)
> -{
> -	return card->host->ios.timing == MMC_TIMING_MMC_HS200;
> -}
> -
> -static inline bool mmc_card_ddr52(struct mmc_card *card)
> -{
> -	return card->host->ios.timing == MMC_TIMING_MMC_DDR52;
> -}
> -
> -static inline bool mmc_card_hs400(struct mmc_card *card)
> -{
> -	return card->host->ios.timing == MMC_TIMING_MMC_HS400;
> -}
> -
> -static inline bool mmc_card_hs400es(struct mmc_card *card)
> -{
> -	return card->host->ios.enhanced_strobe;
> -}
> -
>  void mmc_retune_timer_stop(struct mmc_host *host);
>
>  static inline void mmc_retune_needed(struct mmc_host *host)
> @@ -531,12 +495,6 @@ static inline void mmc_retune_needed(struct mmc_host *host)
>  		host->need_retune = 1;
>  }
>
> -static inline void mmc_retune_recheck(struct mmc_host *host)
> -{
> -	if (host->hold_retune <= 1)
> -		host->retune_now = 1;
> -}
> -
>  static inline bool mmc_can_retune(struct mmc_host *host)
>  {
>  	return host->can_retune == 1;
> @@ -544,7 +502,5 @@ static inline bool mmc_can_retune(struct mmc_host *host)
>
>  int mmc_send_tuning(struct mmc_host *host, u32 opcode, int *cmd_error);
>  int mmc_abort_tuning(struct mmc_host *host, u32 opcode);
> -void mmc_retune_pause(struct mmc_host *host);
> -void mmc_retune_unpause(struct mmc_host *host);
>
>  #endif /* LINUX_MMC_HOST_H */
>


-- 
Best Regards
Shawn Lin


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v3 15/15] mmc: core: Don't use extern declarations of public mmc functions
  2017-01-13 13:14 ` [PATCH v3 15/15] mmc: core: Don't use extern declarations of public mmc functions Ulf Hansson
@ 2017-01-16  3:16   ` Shawn Lin
  0 siblings, 0 replies; 50+ messages in thread
From: Shawn Lin @ 2017-01-16  3:16 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc
  Cc: shawn.lin, Jaehoon Chung, Adrian Hunter, Linus Walleij

On 2017/1/13 21:14, Ulf Hansson wrote:
> Using extern when declaring functions in the public header, core.h, is
> redundant. Let's just remove the use of it.
>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  include/linux/mmc/core.h | 17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)
>


Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>

> diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
> index 6440e10..6dcb339 100644
> --- a/include/linux/mmc/core.h
> +++ b/include/linux/mmc/core.h
> @@ -158,13 +158,14 @@ struct mmc_request {
>  struct mmc_card;
>  struct mmc_async_req;
>
> -extern struct mmc_async_req *mmc_start_req(struct mmc_host *,
> -					   struct mmc_async_req *,
> -					   enum mmc_blk_status *);
> -extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *);
> -extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);
> -
> -extern int mmc_hw_reset(struct mmc_host *host);
> -extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *);
> +struct mmc_async_req *mmc_start_req(struct mmc_host *host,
> +				struct mmc_async_req *areq,
> +				enum mmc_blk_status *ret_stat);
> +void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq);
> +int mmc_wait_for_cmd(struct mmc_host *host, struct mmc_command *cmd,
> +		int retries);
> +
> +int mmc_hw_reset(struct mmc_host *host);
> +void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card);
>
>  #endif /* LINUX_MMC_CORE_H */
>


-- 
Best Regards
Shawn Lin


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v3 04/15] MIPS: Alchemy: Don't rely on public mmc header to include interrupt.h
  2017-01-13 13:14   ` Ulf Hansson
  (?)
@ 2017-01-17 14:50   ` Ralf Baechle
  -1 siblings, 0 replies; 50+ messages in thread
From: Ralf Baechle @ 2017-01-17 14:50 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: linux-mmc, Jaehoon Chung, Adrian Hunter, Linus Walleij, linux-mips

On Fri, Jan 13, 2017 at 02:14:05PM +0100, Ulf Hansson wrote:

> The MIPS Alchemy db1300 dev board depends on interrupt.h. Explicitly
> include it instead of relying on the public mmc header host.h.
> 
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: <linux-mips@linux-mips.org>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> ---
> 
> I am seeking an ack for this change as following changes for mmc in the
> series, has build-dependencies to it.

Acked-by: Ralf Baechle <ralf@linux-mips.org>

  Ralf

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v3 09/15] mmc: core: Move erase/trim/discard defines from public core.h to mmc.h
  2017-01-16  3:05   ` Shawn Lin
@ 2017-01-17 15:06     ` Ulf Hansson
  0 siblings, 0 replies; 50+ messages in thread
From: Ulf Hansson @ 2017-01-17 15:06 UTC (permalink / raw)
  To: Shawn Lin; +Cc: linux-mmc, Jaehoon Chung, Adrian Hunter, Linus Walleij

On 16 January 2017 at 04:05, Shawn Lin <shawn.lin@rock-chips.com> wrote:
> 在 2017/1/13 21:14, Ulf Hansson 写道:
>>
>> As the public mmc.h header already contains similar defines for other mmc
>> commands and arguments, let's move those for erase/trim/discard into here
>> as well.
>>
>> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
>> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>> ---
>>  include/linux/mmc/core.h | 10 ----------
>>  include/linux/mmc/mmc.h  | 13 ++++++++++++-
>>  2 files changed, 12 insertions(+), 11 deletions(-)
>>
>> diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
>> index faacc90..6440e10 100644
>> --- a/include/linux/mmc/core.h
>> +++ b/include/linux/mmc/core.h
>> @@ -164,16 +164,6 @@ extern struct mmc_async_req *mmc_start_req(struct
>> mmc_host *,
>>  extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *);
>>  extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *,
>> int);
>>
>> -#define MMC_ERASE_ARG          0x00000000
>> -#define MMC_SECURE_ERASE_ARG   0x80000000
>> -#define MMC_TRIM_ARG           0x00000001
>> -#define MMC_DISCARD_ARG                0x00000003
>> -#define MMC_SECURE_TRIM1_ARG   0x80000001
>> -#define MMC_SECURE_TRIM2_ARG   0x80008000
>> -
>> -#define MMC_SECURE_ARGS                0x80000000
>> -#define MMC_TRIM_ARGS          0x00008001
>> -
>>  extern int mmc_hw_reset(struct mmc_host *host);
>>  extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card
>> *);
>>
>> diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
>> index 261772e..8f78543 100644
>> --- a/include/linux/mmc/mmc.h
>> +++ b/include/linux/mmc/mmc.h
>> @@ -462,12 +462,23 @@ struct _mmc_csd {
>>  /*
>>   * MMC_SWITCH access modes
>>   */
>> -
>
>
> It's not relevant to remove this blank line?

Well, as I am anyway doing "clean-ups" I thought it make sense to fold
it in here. Seems a bit too much for a separate patch for that.

>
> Otherwise,
>
> Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
>
>>  #define MMC_SWITCH_MODE_CMD_SET                0x00    /* Change the
>> command set */
>>  #define MMC_SWITCH_MODE_SET_BITS       0x01    /* Set bits which are 1 in
>> value */
>>  #define MMC_SWITCH_MODE_CLEAR_BITS     0x02    /* Clear bits which are 1
>> in value */
>>  #define MMC_SWITCH_MODE_WRITE_BYTE     0x03    /* Set target to value */
>>
>> +/*
>> + * Erase/trim/discard
>> + */
>> +#define MMC_ERASE_ARG                  0x00000000
>> +#define MMC_SECURE_ERASE_ARG           0x80000000
>> +#define MMC_TRIM_ARG                   0x00000001
>> +#define MMC_DISCARD_ARG                        0x00000003
>> +#define MMC_SECURE_TRIM1_ARG           0x80000001
>> +#define MMC_SECURE_TRIM2_ARG           0x80008000
>> +#define MMC_SECURE_ARGS                        0x80000000
>> +#define MMC_TRIM_ARGS                  0x00008001
>> +
>>  #define mmc_driver_type_mask(n)                (1 << (n))
>>
>>  #endif /* LINUX_MMC_MMC_H */
>>
>
>
> --
> Best Regards
> Shawn Lin
>


Kind regards
Uffe

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v3 10/15] mmc: core: Remove unused struct _mmc_csd from public mmc.h header
  2017-01-16  3:07   ` Shawn Lin
@ 2017-01-17 15:07     ` Ulf Hansson
  0 siblings, 0 replies; 50+ messages in thread
From: Ulf Hansson @ 2017-01-17 15:07 UTC (permalink / raw)
  To: Shawn Lin; +Cc: linux-mmc, Jaehoon Chung, Adrian Hunter, Linus Walleij

On 16 January 2017 at 04:07, Shawn Lin <shawn.lin@rock-chips.com> wrote:
> On 2017/1/13 21:14, Ulf Hansson wrote:
>>
>> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
>> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
>> ---
>>  include/linux/mmc/mmc.h | 44 --------------------------------------------
>>  1 file changed, 44 deletions(-)
>>
>
> Looks quite strightforward, but it will be better if adding a
> commit msg body here. Anyway,

I didn't know what to put there besides what is already said in the header. :-)

Anyway, I try to elaborate a bit and add something.

[...]

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v3 07/15] mmc: core: Move public functions from core.h to private headers
  2017-01-16  3:01   ` Shawn Lin
@ 2017-01-17 15:07     ` Ulf Hansson
  0 siblings, 0 replies; 50+ messages in thread
From: Ulf Hansson @ 2017-01-17 15:07 UTC (permalink / raw)
  To: Shawn Lin; +Cc: linux-mmc, Jaehoon Chung, Adrian Hunter, Linus Walleij

On 16 January 2017 at 04:01, Shawn Lin <shawn.lin@rock-chips.com> wrote:
> On 2017/1/13 21:14, Ulf Hansson wrote:
>>
>> A significant amount of functions are available through the public mmc
>> core.h header file. Let's slim down this public mmc interface, as to
>> prevent users from abusing it, by moving some of the functions to private
>> mmc header files.
>>
>> This change concentrates on moving the functions into private mmc headers,
>> following changes may continue with additional clean-ups, as an example
>> some functions can be turned into static.
>>
>
> [...]
>
>> @@ -16,6 +16,7 @@
>>  #include <linux/mmc/sdio_func.h>
>>
>>  #include "sdio_ops.h"
>> +#include "core.h"
>>
>
> Should we need move it before sdio_ops.h to
> slightly keep the order? The same for sdio_orq.c change :)

One of the points in this series is also to fix header dependencies
properly. In other words, each header must be able to build
standalone. This removes any constraints on the order of how we
include them. To test each header for this, I have some local
Makefiles and c-files.

That said, I don't think there is an existing order we need or should
maintain (unless because we think it looks nice). If that would be the
case, it's should be considered as a bug.

[...]

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v3 00/15] mmc: core: A start to slim down public mmc headers
  2017-01-13 13:14 [PATCH v3 00/15] mmc: core: A start to slim down public mmc headers Ulf Hansson
                   ` (14 preceding siblings ...)
  2017-01-13 13:14 ` [PATCH v3 15/15] mmc: core: Don't use extern declarations of public mmc functions Ulf Hansson
@ 2017-01-17 15:08 ` Ulf Hansson
  15 siblings, 0 replies; 50+ messages in thread
From: Ulf Hansson @ 2017-01-17 15:08 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson; +Cc: Jaehoon Chung, Adrian Hunter, Linus Walleij

On 13 January 2017 at 14:14, Ulf Hansson <ulf.hansson@linaro.org> wrote:
> Changes in v3:
>         - As patch 1 was applied from version 2, it has been dropped from the
>         series.
>         - Folded in a four new changes in patch 1->4/15, to solve build issues
>         for davinci, mips and pxa.
>
> Changes in v2:
>         - As patch 1->11 was applied from version 1, those have been dropped
>         from the series.
>         - Folded in a new change in patch 1/12, to solve a build issue for imx
>         which is using the mxcmmc platform data header.
>         - Added reviews/acks.
>
>
> Ideally we should not expose functions nor structures as being public available
> as the interface for mmc - unless they really are intended to be used like that.
>
> Unfortunate this is not the case today and which has lead to the mmc interface
> in some cases being abused. That of course has its own problems, but we can
> still move things in the right direction, which is what this series intend to
> do. More precisely, it moves things that can be easily moved from the public mmc
> headers to the private mmc headers.
>
> This should be considered as a first step of improving the situation, further
> additional changes will have to continue this path.
>
>
> Ulf Hansson (15):
>   ARM: pxa: Don't rely on public mmc header to include leds.h
>   ARM: davinci: Don't rely on public mmc header to include leds.h
>   ARM: davinci: Don't rely on public mmc header to include interrupt.h
>   MIPS: Alchemy: Don't rely on public mmc header to include interrupt.h
>   mmc: core: First step in cleaning up public mmc header files
>   mmc: core: First step in cleaning up private mmc header files
>   mmc: core: Move public functions from core.h to private headers
>   mmc: core: Move some host specific public functions to host.h
>   mmc: core: Move erase/trim/discard defines from public core.h to mmc.h
>   mmc: core: Remove unused struct _mmc_csd from public mmc.h header
>   mmc: omap: Don't use mmc_card_present() when validating for inserted
>     card
>   mmc: vub300: Don't use mmc_card_present() when validating for inserted
>     card
>   mmc: core: Move public functions from card.h to private headers
>   mmc: core: Move public functions from host.h to private headers
>   mmc: core: Don't use extern declarations of public mmc functions
>
>  arch/arm/mach-davinci/board-da850-evm.c     |   1 +
>  arch/arm/mach-davinci/board-dm644x-evm.c    |   1 +
>  arch/arm/mach-davinci/board-neuros-osd2.c   |   1 +
>  arch/arm/mach-davinci/board-omapl138-hawk.c |   1 +
>  arch/arm/mach-pxa/balloon3.c                |   1 +
>  arch/arm/mach-pxa/colibri-pxa270-income.c   |   1 +
>  arch/arm/mach-pxa/corgi.c                   |   1 +
>  arch/arm/mach-pxa/trizeps4.c                |   1 +
>  arch/arm/mach-pxa/vpac270.c                 |   1 +
>  arch/arm/mach-pxa/zeus.c                    |   1 +
>  arch/arm/mach-pxa/zylonite.c                |   1 +
>  arch/mips/alchemy/devboards/db1300.c        |   1 +
>  drivers/mmc/core/block.c                    |   6 +
>  drivers/mmc/core/block.h                    |   8 +
>  drivers/mmc/core/bus.c                      |   2 +
>  drivers/mmc/core/bus.h                      |  16 +-
>  drivers/mmc/core/card.h                     | 223 +++++++++++++++++++++++++
>  drivers/mmc/core/core.c                     |   1 +
>  drivers/mmc/core/core.h                     |  41 ++++-
>  drivers/mmc/core/debugfs.c                  |   2 +
>  drivers/mmc/core/host.h                     |  48 ++++++
>  drivers/mmc/core/mmc.c                      |  13 ++
>  drivers/mmc/core/mmc_ops.h                  |  14 ++
>  drivers/mmc/core/mmc_test.c                 |   5 +
>  drivers/mmc/core/pwrseq.h                   |   6 +-
>  drivers/mmc/core/queue.c                    |   2 +
>  drivers/mmc/core/queue.h                    |   6 +-
>  drivers/mmc/core/quirks.c                   |   2 +
>  drivers/mmc/core/sd.c                       |   2 +
>  drivers/mmc/core/sd.h                       |   5 +-
>  drivers/mmc/core/sd_ops.h                   |   9 ++
>  drivers/mmc/core/sdio.c                     |   2 +
>  drivers/mmc/core/sdio_bus.c                 |   1 +
>  drivers/mmc/core/sdio_bus.h                 |   3 +
>  drivers/mmc/core/sdio_cis.h                 |   3 +
>  drivers/mmc/core/sdio_io.c                  |   2 +
>  drivers/mmc/core/sdio_irq.c                 |   2 +
>  drivers/mmc/core/sdio_ops.h                 |   5 +
>  drivers/mmc/core/slot-gpio.h                |   2 +
>  drivers/mmc/host/omap.c                     |   2 +-
>  drivers/mmc/host/vub300.c                   |   6 +-
>  include/linux/mmc/card.h                    | 242 ----------------------------
>  include/linux/mmc/core.h                    |  86 ++--------
>  include/linux/mmc/host.h                    |  63 ++------
>  include/linux/mmc/mmc.h                     |  59 ++-----
>  include/linux/mmc/slot-gpio.h               |   3 +
>  46 files changed, 478 insertions(+), 426 deletions(-)
>  create mode 100644 drivers/mmc/core/card.h
>
> --
> 1.9.1
>

I have applied this for next. Thanks everybody for reviews, acks and test.
The pxa changes isn't acked yet, however I can add that later on.

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v3 01/15] ARM: pxa: Don't rely on public mmc header to include leds.h
  2017-01-13 13:14   ` Ulf Hansson
@ 2017-01-20  8:01     ` Robert Jarzmik
  -1 siblings, 0 replies; 50+ messages in thread
From: Robert Jarzmik @ 2017-01-20  8:01 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: linux-mmc, Jaehoon Chung, Adrian Hunter, Linus Walleij,
	Daniel Mack, Haojian Zhuang, linux-arm-kernel

Ulf Hansson <ulf.hansson@linaro.org> writes:

> Some of the pxa platforms, balloon3, colibri-pxa270-income, corgi,
> trizeps4, vpac270, zeus and zylonite depends on leds.h. Explicitly include
> it instead of relying on the public mmc header host.h.
>
> Cc: Daniel Mack <daniel@zonque.org>
> Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
> Cc: Robert Jarzmik <robert.jarzmik@free.fr>
> Cc: <linux-arm-kernel@lists.infradead.org>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> ---
>
> I am seeking an ack for this change as following changes for mmc in the
> series, has build-dependencies to it.
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>

Actually I already have a patch for arch/arm/mach-pxa/idp.c which adds this
include also in my -next tree, just in case you're tempted to modify this one,
which would conflict with my pxa tree.

An other point, I checked which files don't have a leds.h :
 - grep -ls _led arch/arm/mach-pxa/*.c > /tmp/a
 - grep -ls 'linux/leds.h' arch/arm/mach-pxa/*.c > /tmp/b
 - sdiff -s /tmp/a /tmp/b
This gives me :
	balloon3.c
	colibri-pxa270-income.c
	corgi.c
	corgi_pm.c
	em-x270.c
	ezx.c
	hx4700.c
	magician.c
	palmld.c
	palmtc.c
	palmtreo.c
	palmz72.c
	spitz_pm.c
	tosa.c
	trizeps4.c
	vpac270.c
	z2.c
	zeus.c
	zylonite.c
	zylonite_pxa300.c
	zylonite_pxa320.c

So I was wondering how you made the choice of which files you add the include to
and which you don't touch ?

Cheers.

--
Robert

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v3 01/15] ARM: pxa: Don't rely on public mmc header to include leds.h
@ 2017-01-20  8:01     ` Robert Jarzmik
  0 siblings, 0 replies; 50+ messages in thread
From: Robert Jarzmik @ 2017-01-20  8:01 UTC (permalink / raw)
  To: linux-arm-kernel

Ulf Hansson <ulf.hansson@linaro.org> writes:

> Some of the pxa platforms, balloon3, colibri-pxa270-income, corgi,
> trizeps4, vpac270, zeus and zylonite depends on leds.h. Explicitly include
> it instead of relying on the public mmc header host.h.
>
> Cc: Daniel Mack <daniel@zonque.org>
> Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
> Cc: Robert Jarzmik <robert.jarzmik@free.fr>
> Cc: <linux-arm-kernel@lists.infradead.org>
> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
> ---
>
> I am seeking an ack for this change as following changes for mmc in the
> series, has build-dependencies to it.
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>

Actually I already have a patch for arch/arm/mach-pxa/idp.c which adds this
include also in my -next tree, just in case you're tempted to modify this one,
which would conflict with my pxa tree.

An other point, I checked which files don't have a leds.h :
 - grep -ls _led arch/arm/mach-pxa/*.c > /tmp/a
 - grep -ls 'linux/leds.h' arch/arm/mach-pxa/*.c > /tmp/b
 - sdiff -s /tmp/a /tmp/b
This gives me :
	balloon3.c
	colibri-pxa270-income.c
	corgi.c
	corgi_pm.c
	em-x270.c
	ezx.c
	hx4700.c
	magician.c
	palmld.c
	palmtc.c
	palmtreo.c
	palmz72.c
	spitz_pm.c
	tosa.c
	trizeps4.c
	vpac270.c
	z2.c
	zeus.c
	zylonite.c
	zylonite_pxa300.c
	zylonite_pxa320.c

So I was wondering how you made the choice of which files you add the include to
and which you don't touch ?

Cheers.

--
Robert

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v3 01/15] ARM: pxa: Don't rely on public mmc header to include leds.h
  2017-01-20  8:01     ` Robert Jarzmik
@ 2017-01-20  8:27       ` Ulf Hansson
  -1 siblings, 0 replies; 50+ messages in thread
From: Ulf Hansson @ 2017-01-20  8:27 UTC (permalink / raw)
  To: Robert Jarzmik
  Cc: linux-mmc, Jaehoon Chung, Adrian Hunter, Linus Walleij,
	Daniel Mack, Haojian Zhuang, linux-arm-kernel

On 20 January 2017 at 09:01, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
> Ulf Hansson <ulf.hansson@linaro.org> writes:
>
>> Some of the pxa platforms, balloon3, colibri-pxa270-income, corgi,
>> trizeps4, vpac270, zeus and zylonite depends on leds.h. Explicitly include
>> it instead of relying on the public mmc header host.h.
>>
>> Cc: Daniel Mack <daniel@zonque.org>
>> Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
>> Cc: Robert Jarzmik <robert.jarzmik@free.fr>
>> Cc: <linux-arm-kernel@lists.infradead.org>
>> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
>> ---
>>
>> I am seeking an ack for this change as following changes for mmc in the
>> series, has build-dependencies to it.
> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
>
> Actually I already have a patch for arch/arm/mach-pxa/idp.c which adds this
> include also in my -next tree, just in case you're tempted to modify this one,
> which would conflict with my pxa tree.
>
> An other point, I checked which files don't have a leds.h :
>  - grep -ls _led arch/arm/mach-pxa/*.c > /tmp/a
>  - grep -ls 'linux/leds.h' arch/arm/mach-pxa/*.c > /tmp/b
>  - sdiff -s /tmp/a /tmp/b
> This gives me :
>         balloon3.c
>         colibri-pxa270-income.c
>         corgi.c
>         corgi_pm.c
>         em-x270.c
>         ezx.c
>         hx4700.c
>         magician.c
>         palmld.c
>         palmtc.c
>         palmtreo.c
>         palmz72.c
>         spitz_pm.c
>         tosa.c
>         trizeps4.c
>         vpac270.c
>         z2.c
>         zeus.c
>         zylonite.c
>         zylonite_pxa300.c
>         zylonite_pxa320.c
>
> So I was wondering how you made the choice of which files you add the include to
> and which you don't touch ?

By building the pxa_defconfig, see what errors it reports and then fix them.

Isn't pxa_defconfig building all the variants?

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v3 01/15] ARM: pxa: Don't rely on public mmc header to include leds.h
@ 2017-01-20  8:27       ` Ulf Hansson
  0 siblings, 0 replies; 50+ messages in thread
From: Ulf Hansson @ 2017-01-20  8:27 UTC (permalink / raw)
  To: linux-arm-kernel

On 20 January 2017 at 09:01, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
> Ulf Hansson <ulf.hansson@linaro.org> writes:
>
>> Some of the pxa platforms, balloon3, colibri-pxa270-income, corgi,
>> trizeps4, vpac270, zeus and zylonite depends on leds.h. Explicitly include
>> it instead of relying on the public mmc header host.h.
>>
>> Cc: Daniel Mack <daniel@zonque.org>
>> Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
>> Cc: Robert Jarzmik <robert.jarzmik@free.fr>
>> Cc: <linux-arm-kernel@lists.infradead.org>
>> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
>> ---
>>
>> I am seeking an ack for this change as following changes for mmc in the
>> series, has build-dependencies to it.
> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
>
> Actually I already have a patch for arch/arm/mach-pxa/idp.c which adds this
> include also in my -next tree, just in case you're tempted to modify this one,
> which would conflict with my pxa tree.
>
> An other point, I checked which files don't have a leds.h :
>  - grep -ls _led arch/arm/mach-pxa/*.c > /tmp/a
>  - grep -ls 'linux/leds.h' arch/arm/mach-pxa/*.c > /tmp/b
>  - sdiff -s /tmp/a /tmp/b
> This gives me :
>         balloon3.c
>         colibri-pxa270-income.c
>         corgi.c
>         corgi_pm.c
>         em-x270.c
>         ezx.c
>         hx4700.c
>         magician.c
>         palmld.c
>         palmtc.c
>         palmtreo.c
>         palmz72.c
>         spitz_pm.c
>         tosa.c
>         trizeps4.c
>         vpac270.c
>         z2.c
>         zeus.c
>         zylonite.c
>         zylonite_pxa300.c
>         zylonite_pxa320.c
>
> So I was wondering how you made the choice of which files you add the include to
> and which you don't touch ?

By building the pxa_defconfig, see what errors it reports and then fix them.

Isn't pxa_defconfig building all the variants?

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v3 01/15] ARM: pxa: Don't rely on public mmc header to include leds.h
  2017-01-20  8:27       ` Ulf Hansson
@ 2017-01-20 19:34         ` Robert Jarzmik
  -1 siblings, 0 replies; 50+ messages in thread
From: Robert Jarzmik @ 2017-01-20 19:34 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: linux-mmc, Jaehoon Chung, Adrian Hunter, Linus Walleij,
	Daniel Mack, Haojian Zhuang, linux-arm-kernel

Ulf Hansson <ulf.hansson@linaro.org> writes:

> On 20 January 2017 at 09:01, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
>> Ulf Hansson <ulf.hansson@linaro.org> writes:
>> So I was wondering how you made the choice of which files you add the include to
>> and which you don't touch ?
>
> By building the pxa_defconfig, see what errors it reports and then fix them.
>
> Isn't pxa_defconfig building all the variants?
Euh actually it should, but it's not.

The file was built from all _existing_ pxa defconfigs in arch/arm/configs/. The
trick is that there were many pxa boards for which no defconfig file was
available, and therefore they "escape" the pxa_defconfig coverage.

Cheers.

-- 
Robert

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v3 01/15] ARM: pxa: Don't rely on public mmc header to include leds.h
@ 2017-01-20 19:34         ` Robert Jarzmik
  0 siblings, 0 replies; 50+ messages in thread
From: Robert Jarzmik @ 2017-01-20 19:34 UTC (permalink / raw)
  To: linux-arm-kernel

Ulf Hansson <ulf.hansson@linaro.org> writes:

> On 20 January 2017 at 09:01, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
>> Ulf Hansson <ulf.hansson@linaro.org> writes:
>> So I was wondering how you made the choice of which files you add the include to
>> and which you don't touch ?
>
> By building the pxa_defconfig, see what errors it reports and then fix them.
>
> Isn't pxa_defconfig building all the variants?
Euh actually it should, but it's not.

The file was built from all _existing_ pxa defconfigs in arch/arm/configs/. The
trick is that there were many pxa boards for which no defconfig file was
available, and therefore they "escape" the pxa_defconfig coverage.

Cheers.

-- 
Robert

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v3 01/15] ARM: pxa: Don't rely on public mmc header to include leds.h
  2017-01-20 19:34         ` Robert Jarzmik
@ 2017-01-22 10:25           ` Robert Jarzmik
  -1 siblings, 0 replies; 50+ messages in thread
From: Robert Jarzmik @ 2017-01-22 10:25 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Linus Walleij, linux-mmc, Adrian Hunter, Haojian Zhuang,
	Jaehoon Chung, linux-arm-kernel, Daniel Mack

Robert Jarzmik <robert.jarzmik@free.fr> writes:

> Ulf Hansson <ulf.hansson@linaro.org> writes:
>
>> On 20 January 2017 at 09:01, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
>>> Ulf Hansson <ulf.hansson@linaro.org> writes:
>>> So I was wondering how you made the choice of which files you add the include to
>>> and which you don't touch ?
>>
>> By building the pxa_defconfig, see what errors it reports and then fix them.
>>
>> Isn't pxa_defconfig building all the variants?
> Euh actually it should, but it's not.

And actually thanks to a suggestion from Russell to improve my search line, I
came up with the command line bellow, and perhaps you could fix the others with
one command line and respin the patch ?

Here it is :

for f in $(grep -l _led arch/arm/mach-pxa/*.c | xargs grep -L linux/leds.h); do
sed -i '0,/^#include <linux\/[l-m].*>$/{s/\(#include <linux\/[l-m].*\)/#include
<linux\/leds.h>\n\1/}' $f; done

Cheers.

-- 
Robert

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v3 01/15] ARM: pxa: Don't rely on public mmc header to include leds.h
@ 2017-01-22 10:25           ` Robert Jarzmik
  0 siblings, 0 replies; 50+ messages in thread
From: Robert Jarzmik @ 2017-01-22 10:25 UTC (permalink / raw)
  To: linux-arm-kernel

Robert Jarzmik <robert.jarzmik@free.fr> writes:

> Ulf Hansson <ulf.hansson@linaro.org> writes:
>
>> On 20 January 2017 at 09:01, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
>>> Ulf Hansson <ulf.hansson@linaro.org> writes:
>>> So I was wondering how you made the choice of which files you add the include to
>>> and which you don't touch ?
>>
>> By building the pxa_defconfig, see what errors it reports and then fix them.
>>
>> Isn't pxa_defconfig building all the variants?
> Euh actually it should, but it's not.

And actually thanks to a suggestion from Russell to improve my search line, I
came up with the command line bellow, and perhaps you could fix the others with
one command line and respin the patch ?

Here it is :

for f in $(grep -l _led arch/arm/mach-pxa/*.c | xargs grep -L linux/leds.h); do
sed -i '0,/^#include <linux\/[l-m].*>$/{s/\(#include <linux\/[l-m].*\)/#include
<linux\/leds.h>\n\1/}' $f; done

Cheers.

-- 
Robert

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v3 01/15] ARM: pxa: Don't rely on public mmc header to include leds.h
  2017-01-22 10:25           ` Robert Jarzmik
@ 2017-01-24  7:57             ` Ulf Hansson
  -1 siblings, 0 replies; 50+ messages in thread
From: Ulf Hansson @ 2017-01-24  7:57 UTC (permalink / raw)
  To: Robert Jarzmik
  Cc: Linus Walleij, linux-mmc, Adrian Hunter, Haojian Zhuang,
	Jaehoon Chung, linux-arm-kernel, Daniel Mack

On 22 January 2017 at 11:25, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
> Robert Jarzmik <robert.jarzmik@free.fr> writes:
>
>> Ulf Hansson <ulf.hansson@linaro.org> writes:
>>
>>> On 20 January 2017 at 09:01, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
>>>> Ulf Hansson <ulf.hansson@linaro.org> writes:
>>>> So I was wondering how you made the choice of which files you add the include to
>>>> and which you don't touch ?
>>>
>>> By building the pxa_defconfig, see what errors it reports and then fix them.
>>>
>>> Isn't pxa_defconfig building all the variants?
>> Euh actually it should, but it's not.
>
> And actually thanks to a suggestion from Russell to improve my search line, I
> came up with the command line bellow, and perhaps you could fix the others with
> one command line and respin the patch ?
>
> Here it is :
>
> for f in $(grep -l _led arch/arm/mach-pxa/*.c | xargs grep -L linux/leds.h); do
> sed -i '0,/^#include <linux\/[l-m].*>$/{s/\(#include <linux\/[l-m].*\)/#include
> <linux\/leds.h>\n\1/}' $f; done
>
> Cheers.

Robert, thanks for helping out!

While running the above command-line, the following files becomes changed:

arch/arm/mach-pxa/zylonite_pxa300.c
arch/arm/mach-pxa/zylonite_pxa320.c
arch/arm/mach-pxa/palmld.c
arch/arm/mach-pxa/palmtc.c
arch/arm/mach-pxa/ezx.c
arch/arm/mach-pxa/em-x270.c
arch/arm/mach-pxa/hx4700.c
arch/arm/mach-pxa/magician.c
arch/arm/mach-pxa/palmtreo.c
arch/arm/mach-pxa/corgi_pm.c
arch/arm/mach-pxa/spitz_pm.c
arch/arm/mach-pxa/tosa.c
arch/arm/mach-pxa/z2.c

However, already by building pxa_defconfig, I have verified that these
files are being build successfully without any changes needed.

Because of that, I am not sure I would like to make any additional
changes as a part of this series. I think it's easier if you later on
deal with that as clean-ups via your pxa tree instead, does that make
sense to you as well?

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v3 01/15] ARM: pxa: Don't rely on public mmc header to include leds.h
@ 2017-01-24  7:57             ` Ulf Hansson
  0 siblings, 0 replies; 50+ messages in thread
From: Ulf Hansson @ 2017-01-24  7:57 UTC (permalink / raw)
  To: linux-arm-kernel

On 22 January 2017 at 11:25, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
> Robert Jarzmik <robert.jarzmik@free.fr> writes:
>
>> Ulf Hansson <ulf.hansson@linaro.org> writes:
>>
>>> On 20 January 2017 at 09:01, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
>>>> Ulf Hansson <ulf.hansson@linaro.org> writes:
>>>> So I was wondering how you made the choice of which files you add the include to
>>>> and which you don't touch ?
>>>
>>> By building the pxa_defconfig, see what errors it reports and then fix them.
>>>
>>> Isn't pxa_defconfig building all the variants?
>> Euh actually it should, but it's not.
>
> And actually thanks to a suggestion from Russell to improve my search line, I
> came up with the command line bellow, and perhaps you could fix the others with
> one command line and respin the patch ?
>
> Here it is :
>
> for f in $(grep -l _led arch/arm/mach-pxa/*.c | xargs grep -L linux/leds.h); do
> sed -i '0,/^#include <linux\/[l-m].*>$/{s/\(#include <linux\/[l-m].*\)/#include
> <linux\/leds.h>\n\1/}' $f; done
>
> Cheers.

Robert, thanks for helping out!

While running the above command-line, the following files becomes changed:

arch/arm/mach-pxa/zylonite_pxa300.c
arch/arm/mach-pxa/zylonite_pxa320.c
arch/arm/mach-pxa/palmld.c
arch/arm/mach-pxa/palmtc.c
arch/arm/mach-pxa/ezx.c
arch/arm/mach-pxa/em-x270.c
arch/arm/mach-pxa/hx4700.c
arch/arm/mach-pxa/magician.c
arch/arm/mach-pxa/palmtreo.c
arch/arm/mach-pxa/corgi_pm.c
arch/arm/mach-pxa/spitz_pm.c
arch/arm/mach-pxa/tosa.c
arch/arm/mach-pxa/z2.c

However, already by building pxa_defconfig, I have verified that these
files are being build successfully without any changes needed.

Because of that, I am not sure I would like to make any additional
changes as a part of this series. I think it's easier if you later on
deal with that as clean-ups via your pxa tree instead, does that make
sense to you as well?

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v3 01/15] ARM: pxa: Don't rely on public mmc header to include leds.h
  2017-01-24  7:57             ` Ulf Hansson
@ 2017-01-24 16:34               ` Robert Jarzmik
  -1 siblings, 0 replies; 50+ messages in thread
From: Robert Jarzmik @ 2017-01-24 16:34 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: linux-mmc, Jaehoon Chung, Adrian Hunter, Linus Walleij,
	Daniel Mack, Haojian Zhuang, linux-arm-kernel

Ulf Hansson <ulf.hansson@linaro.org> writes:

> On 22 January 2017 at 11:25, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
>> Robert Jarzmik <robert.jarzmik@free.fr> writes:
>>
>>> Ulf Hansson <ulf.hansson@linaro.org> writes:
>>>
>>>> On 20 January 2017 at 09:01, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
>>>>> Ulf Hansson <ulf.hansson@linaro.org> writes:
>>>>> So I was wondering how you made the choice of which files you add the include to
>>>>> and which you don't touch ?
>>>>
>>>> By building the pxa_defconfig, see what errors it reports and then fix them.
>>>>
>>>> Isn't pxa_defconfig building all the variants?
>>> Euh actually it should, but it's not.
>>
>> And actually thanks to a suggestion from Russell to improve my search line, I
>> came up with the command line bellow, and perhaps you could fix the others with
>> one command line and respin the patch ?
>>
>> Here it is :
>>
>> for f in $(grep -l _led arch/arm/mach-pxa/*.c | xargs grep -L linux/leds.h); do
>> sed -i '0,/^#include <linux\/[l-m].*>$/{s/\(#include <linux\/[l-m].*\)/#include
>> <linux\/leds.h>\n\1/}' $f; done
>>
>> Cheers.
>
> Robert, thanks for helping out!
>
> While running the above command-line, the following files becomes changed:
>
> arch/arm/mach-pxa/zylonite_pxa300.c
> arch/arm/mach-pxa/zylonite_pxa320.c
> arch/arm/mach-pxa/palmld.c
> arch/arm/mach-pxa/palmtc.c
> arch/arm/mach-pxa/ezx.c
> arch/arm/mach-pxa/em-x270.c
> arch/arm/mach-pxa/hx4700.c
> arch/arm/mach-pxa/magician.c
> arch/arm/mach-pxa/palmtreo.c
> arch/arm/mach-pxa/corgi_pm.c
> arch/arm/mach-pxa/spitz_pm.c
> arch/arm/mach-pxa/tosa.c
> arch/arm/mach-pxa/z2.c
Indeed.

> However, already by building pxa_defconfig, I have verified that these
> files are being build successfully without any changes needed.
Ha so for some (all ?) of them, another include is providing the leds.h,
interesting. For many of them it is either :
 - linux/power_supply.h
 - linux/gpio_charger.h
 - an mfd device (such as mfd/htc-pasic3.h)
 - etc ...

> Because of that, I am not sure I would like to make any additional
> changes as a part of this series. I think it's easier if you later on
> deal with that as clean-ups via your pxa tree instead, does that make
> sense to you as well?
Yeah as you wish, after all you're removing the leds.h and you'r patch addresses
that, it's beyond its scope to fix all pxa boards which don't include leds.h
properly.

Cheers.

-- 
Robert

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v3 01/15] ARM: pxa: Don't rely on public mmc header to include leds.h
@ 2017-01-24 16:34               ` Robert Jarzmik
  0 siblings, 0 replies; 50+ messages in thread
From: Robert Jarzmik @ 2017-01-24 16:34 UTC (permalink / raw)
  To: linux-arm-kernel

Ulf Hansson <ulf.hansson@linaro.org> writes:

> On 22 January 2017 at 11:25, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
>> Robert Jarzmik <robert.jarzmik@free.fr> writes:
>>
>>> Ulf Hansson <ulf.hansson@linaro.org> writes:
>>>
>>>> On 20 January 2017 at 09:01, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
>>>>> Ulf Hansson <ulf.hansson@linaro.org> writes:
>>>>> So I was wondering how you made the choice of which files you add the include to
>>>>> and which you don't touch ?
>>>>
>>>> By building the pxa_defconfig, see what errors it reports and then fix them.
>>>>
>>>> Isn't pxa_defconfig building all the variants?
>>> Euh actually it should, but it's not.
>>
>> And actually thanks to a suggestion from Russell to improve my search line, I
>> came up with the command line bellow, and perhaps you could fix the others with
>> one command line and respin the patch ?
>>
>> Here it is :
>>
>> for f in $(grep -l _led arch/arm/mach-pxa/*.c | xargs grep -L linux/leds.h); do
>> sed -i '0,/^#include <linux\/[l-m].*>$/{s/\(#include <linux\/[l-m].*\)/#include
>> <linux\/leds.h>\n\1/}' $f; done
>>
>> Cheers.
>
> Robert, thanks for helping out!
>
> While running the above command-line, the following files becomes changed:
>
> arch/arm/mach-pxa/zylonite_pxa300.c
> arch/arm/mach-pxa/zylonite_pxa320.c
> arch/arm/mach-pxa/palmld.c
> arch/arm/mach-pxa/palmtc.c
> arch/arm/mach-pxa/ezx.c
> arch/arm/mach-pxa/em-x270.c
> arch/arm/mach-pxa/hx4700.c
> arch/arm/mach-pxa/magician.c
> arch/arm/mach-pxa/palmtreo.c
> arch/arm/mach-pxa/corgi_pm.c
> arch/arm/mach-pxa/spitz_pm.c
> arch/arm/mach-pxa/tosa.c
> arch/arm/mach-pxa/z2.c
Indeed.

> However, already by building pxa_defconfig, I have verified that these
> files are being build successfully without any changes needed.
Ha so for some (all ?) of them, another include is providing the leds.h,
interesting. For many of them it is either :
 - linux/power_supply.h
 - linux/gpio_charger.h
 - an mfd device (such as mfd/htc-pasic3.h)
 - etc ...

> Because of that, I am not sure I would like to make any additional
> changes as a part of this series. I think it's easier if you later on
> deal with that as clean-ups via your pxa tree instead, does that make
> sense to you as well?
Yeah as you wish, after all you're removing the leds.h and you'r patch addresses
that, it's beyond its scope to fix all pxa boards which don't include leds.h
properly.

Cheers.

-- 
Robert

^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2017-01-24 16:34 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-13 13:14 [PATCH v3 00/15] mmc: core: A start to slim down public mmc headers Ulf Hansson
2017-01-13 13:14 ` [PATCH v3 01/15] ARM: pxa: Don't rely on public mmc header to include leds.h Ulf Hansson
2017-01-13 13:14   ` Ulf Hansson
2017-01-20  8:01   ` Robert Jarzmik
2017-01-20  8:01     ` Robert Jarzmik
2017-01-20  8:27     ` Ulf Hansson
2017-01-20  8:27       ` Ulf Hansson
2017-01-20 19:34       ` Robert Jarzmik
2017-01-20 19:34         ` Robert Jarzmik
2017-01-22 10:25         ` Robert Jarzmik
2017-01-22 10:25           ` Robert Jarzmik
2017-01-24  7:57           ` Ulf Hansson
2017-01-24  7:57             ` Ulf Hansson
2017-01-24 16:34             ` Robert Jarzmik
2017-01-24 16:34               ` Robert Jarzmik
2017-01-13 13:14 ` [PATCH v3 02/15] ARM: davinci: " Ulf Hansson
2017-01-13 13:14   ` Ulf Hansson
2017-01-13 13:26   ` Sekhar Nori
2017-01-13 13:26     ` Sekhar Nori
2017-01-13 13:14 ` [PATCH v3 03/15] ARM: davinci: Don't rely on public mmc header to include interrupt.h Ulf Hansson
2017-01-13 13:14   ` Ulf Hansson
2017-01-13 13:38   ` Sekhar Nori
2017-01-13 13:38     ` Sekhar Nori
2017-01-13 13:14 ` [PATCH v3 04/15] MIPS: Alchemy: " Ulf Hansson
2017-01-13 13:14   ` Ulf Hansson
2017-01-17 14:50   ` Ralf Baechle
2017-01-13 13:14 ` [PATCH v3 05/15] mmc: core: First step in cleaning up public mmc header files Ulf Hansson
2017-01-16  2:54   ` Shawn Lin
2017-01-13 13:14 ` [PATCH v3 06/15] mmc: core: First step in cleaning up private " Ulf Hansson
2017-01-16  2:56   ` Shawn Lin
2017-01-13 13:14 ` [PATCH v3 07/15] mmc: core: Move public functions from core.h to private headers Ulf Hansson
2017-01-16  3:01   ` Shawn Lin
2017-01-17 15:07     ` Ulf Hansson
2017-01-13 13:14 ` [PATCH v3 08/15] mmc: core: Move some host specific public functions to host.h Ulf Hansson
2017-01-16  3:02   ` Shawn Lin
2017-01-13 13:14 ` [PATCH v3 09/15] mmc: core: Move erase/trim/discard defines from public core.h to mmc.h Ulf Hansson
2017-01-16  3:05   ` Shawn Lin
2017-01-17 15:06     ` Ulf Hansson
2017-01-13 13:14 ` [PATCH v3 10/15] mmc: core: Remove unused struct _mmc_csd from public mmc.h header Ulf Hansson
2017-01-16  3:07   ` Shawn Lin
2017-01-17 15:07     ` Ulf Hansson
2017-01-13 13:14 ` [PATCH v3 11/15] mmc: omap: Don't use mmc_card_present() when validating for inserted card Ulf Hansson
2017-01-13 13:14 ` [PATCH v3 12/15] mmc: vub300: " Ulf Hansson
2017-01-13 13:14 ` [PATCH v3 13/15] mmc: core: Move public functions from card.h to private headers Ulf Hansson
2017-01-16  3:10   ` Shawn Lin
2017-01-13 13:14 ` [PATCH v3 14/15] mmc: core: Move public functions from host.h " Ulf Hansson
2017-01-16  3:14   ` Shawn Lin
2017-01-13 13:14 ` [PATCH v3 15/15] mmc: core: Don't use extern declarations of public mmc functions Ulf Hansson
2017-01-16  3:16   ` Shawn Lin
2017-01-17 15:08 ` [PATCH v3 00/15] mmc: core: A start to slim down public mmc headers Ulf Hansson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.