Re: [PATCH v3 2/3] mmc: tmio: fix reset operation

2018-11-01 Thread Masahiro Yamada
rl_read16_and_16_as_32(_host, > CTL_IRQ_MASK); > tmio_mmc_disable_mmc_irqs(_host, TMIO_MASK_ALL); > @@ -1329,7 +1333,7 @@ int tmio_mmc_host_runtime_resume(struct device *dev) > struct tmio_mmc_host *host = dev_get_drvdata(dev); > > tmio_mmc_clk_enable(host); > - host->reset(host); > + tmio_mmc_hw_reset(host->mmc); > > if (host->clk_cache) > host->set_clock(host, host->clk_cache); > -- > 2.19.1 > -- Best Regards Masahiro Yamada

Re: [PATCH v3 1/3] mmc: tmio: enable module clock before resetting when resuming

2018-11-01 Thread Masahiro Yamada
Masaharu Hayakawa. > > Signed-off-by: Niklas Söderlund Reviewed-by: Masahiro Yamada > --- > drivers/mmc/host/tmio_mmc_core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/mmc/host/tmio_mmc_core.c > b/drivers/mmc/host/tmio_mmc_core

[PATCH] mmc: tmio: simplify the DMA mode test

2018-10-12 Thread Masahiro Yamada
force_pio into host->dma_on. host->dma_on represents whether the DMA is currently enabled or not. This flag is set false in the beginning of each command, then should be set true by tmio_mmc_start_dma() when the DMA is turned on. Signed-off-by: Masahiro Yamada --- drivers/mmc/host/

[PATCH v3 2/2] mmc: tmio: remove TMIO_MMC_HAVE_HIGH_REG flag

2018-10-09 Thread Masahiro Yamada
and delete the TMIO_MMC_HAVE_HIGH_REG flag. Signed-off-by: Masahiro Yamada --- Changes in v3: None Changes in v2: None drivers/mmc/host/tmio_mmc.c | 7 +-- drivers/mmc/host/tmio_mmc.h | 3 --- include/linux/mfd/tmio.h| 7 --- 3 files changed, 5 insertions(+), 12 deletions(-) diff

[PATCH v3 0/2] mmc: tmio: remove confusing TMIO_MMC_HAVE_HIGH_REG flag

2018-10-09 Thread Masahiro Yamada
CTL_SDIO_REGS is a register specific to tmio_mmc.c Currently, we handle it in tmio_mmc_core.c, hence need TMIO_MMC_HAVE_HIGH_REG flag to prevent the other platforms from accessing to it. We can just move CTL_SDIO_REGS to tmio_mmc.c and delete the confusing TMIO_MMC_HAVE_HIGH_REG flag. Masahiro

[PATCH v3 1/2] mmc: tmio: move MFD variant reset to a platform hook

2018-10-09 Thread Masahiro Yamada
CTL_RESET_SDIO register is specific to the TMIO MFD (tmio_mmc.c). Add a new hook host->reset() for performing a platform-specific reset sequence, and move CTL_RESET_SDIO over there. Signed-off-by: Masahiro Yamada --- Changes in v3: - Replace all tmio_mmc_reset() calls with host->

Re: [PATCH v2 1/2] mmc: tmio: move MFD variant reset to a platform hook

2018-10-09 Thread Masahiro Yamada
et = tmio_mmc_reset; > > So, you populate the new pointer here... > > > + if (!_host->reset) > > + _host->reset = tmio_mmc_reset; > > ... and here. But it seems never used anywhere? Or am I missing > something? > Bummer. I am totally screwed up. V3 is right away. Thanks! -- Best Regards Masahiro Yamada

Re: [PATCH] kbuild: fix kernel/bounds.c 'W=1' warning

2018-10-08 Thread Masahiro Yamada
On Mon, Oct 8, 2018 at 7:01 PM Kieran Bingham wrote: > > On 06/10/18 23:06, Masahiro Yamada wrote: > > On Sun, Oct 7, 2018 at 6:58 AM Masahiro Yamada > > wrote: > >> > >> Hi Miguel, > >> > >> > >> On Sun, Oct 7, 2018 at 6:18 AM Mig

Re: [PATCH] kbuild: fix kernel/bounds.c 'W=1' warning

2018-10-06 Thread Masahiro Yamada
On Sun, Oct 7, 2018 at 6:58 AM Masahiro Yamada wrote: > > Hi Miguel, > > > On Sun, Oct 7, 2018 at 6:18 AM Miguel Ojeda > wrote: > > > > On Fri, Oct 5, 2018 at 10:35 AM Arnd Bergmann wrote: > > > > > > Building any configuration with 'make W=

Re: [PATCH] kbuild: fix kernel/bounds.c 'W=1' warning

2018-10-06 Thread Masahiro Yamada
/generated/bounds.h */ DEFINE(NR_PAGEFLAGS, __NR_PAGEFLAGS); masahiro@grover:~/ref/linux$ make W=1 prepare CC kernel/bounds.s kernel/bounds.c:16:13: warning: no previous prototype for ‘foo’ [-Wmissing-prototypes] void __used foo(void) ^ CC arch/x86/kernel/asm-offsets.s -- Best Regards Masahiro Yamada

Re: [PATCH] kbuild: fix kernel/bounds.c 'W=1' warning

2018-10-06 Thread Masahiro Yamada
__NR_PAGEFLAGS); > @@ -23,4 +23,6 @@ void foo(void) > #endif > DEFINE(SPINLOCK_SIZE, sizeof(spinlock_t)); > /* End of constants */ > + > + return 0; > } > -- > 2.18.0 > -- Best Regards Masahiro Yamada

[PATCH] mmc: renesas_sdhi: rename DTRAN_MODE_BUS_WID_TH to DTRAN_MODE_BUS_WIDTH

2018-10-03 Thread Masahiro Yamada
Socionext UniPhier SoCs use the almost the same internal DMAC. My datasheet says 'BUS_WIDTH' instead of 'BUS_WID_TH'. I suspect this is a typo. Signed-off-by: Masahiro Yamada --- drivers/mmc/host/renesas_sdhi_internal_dmac.c | 4 ++-- 1 file changed, 2 insertions(+),

[PATCH v2 2/2] mmc: tmio: remove TMIO_MMC_HAVE_HIGH_REG flag

2018-10-03 Thread Masahiro Yamada
tmio_mmc.c and delete the TMIO_MMC_HAVE_HIGH_REG flag. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/mmc/host/tmio_mmc.c | 7 +-- drivers/mmc/host/tmio_mmc.h | 3 --- include/linux/mfd/tmio.h| 7 --- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/mmc

[PATCH v2 0/2] mmc: tmio: remove confusing TMIO_MMC_HAVE_HIGH_REG flag

2018-10-03 Thread Masahiro Yamada
CTL_SDIO_REGS is a register specific to tmio_mmc.c Currently, we handle it in tmio_mmc_core.c, hence need TMIO_MMC_HAVE_HIGH_REG flag to prevent the other platforms from accessing to it. We can just move CTL_SDIO_REGS to tmio_mmc.c and delete the confusing TMIO_MMC_HAVE_HIGH_REG flag. Masahiro

[PATCH v2 1/2] mmc: tmio: move MFD variant reset to a platform hook

2018-10-03 Thread Masahiro Yamada
CTL_RESET_SDIO register is specific to the TMIO MFD (tmio_mmc.c). Add a new hook host->reset for performing a platform-specific reset sequence, and move CTL_RESET_SDIO over there. Signed-off-by: Masahiro Yamada --- Changes in v2: - Preserve the current sequence for tmio_mmc.c drivers/

Re: [PATCH 1/2] mmc: tmio: move MFD variant reset to a platform hook

2018-10-03 Thread Masahiro Yamada
Hi Wolfram, On Wed, Oct 3, 2018 at 8:02 AM Wolfram Sang wrote: > > Hi Yamada-san, > > On Mon, Oct 01, 2018 at 09:31:01PM +0900, Masahiro Yamada wrote: > > CTL_RESET_SDIO register is specific to the TMIO MFD (tmio_mmc.c). > > > > Add a new hook host->reset f

[PATCH 0/2] mmc: tmio: remove confusing TMIO_MMC_HAVE_HIGH_REG flag

2018-10-01 Thread Masahiro Yamada
. Masahiro Yamada (2): mmc: tmio: move MFD variant reset to a platform hook mmc: tmio: remove TMIO_MMC_HAVE_HIGH_REG flag drivers/mmc/host/tmio_mmc.c | 16 ++-- drivers/mmc/host/tmio_mmc.h | 4 +--- drivers/mmc/host/tmio_mmc_core.c | 7 +++ include/linux/mfd/tmio.h

[PATCH 2/2] mmc: tmio: remove TMIO_MMC_HAVE_HIGH_REG flag

2018-10-01 Thread Masahiro Yamada
tmio_mmc.c and delete the TMIO_MMC_HAVE_HIGH_REG flag. Signed-off-by: Masahiro Yamada --- drivers/mmc/host/tmio_mmc.c | 7 +-- drivers/mmc/host/tmio_mmc.h | 3 --- include/linux/mfd/tmio.h| 7 --- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/mmc/host/tmio_mmc.c b

[PATCH 1/2] mmc: tmio: move MFD variant reset to a platform hook

2018-10-01 Thread Masahiro Yamada
CTL_RESET_SDIO register is specific to the TMIO MFD (tmio_mmc.c). Add a new hook host->reset for performing a platform-specific reset sequence, and move CTL_RESET_SDIO over there. Signed-off-by: Masahiro Yamada --- drivers/mmc/host/tmio_mmc.c | 9 + drivers/mmc/host/tmio_mm

Re: [PATCH v2 0/7] mmc: tmio: refactor TMIO core a bit and add UniPhier SD/eMMC controller support

2018-08-20 Thread Masahiro Yamada
> Thanks for the review! But, this version is not applicable to Linus' tree due to commit db924bba47c80. Resolving the conflict is not trivial. I will rebase and send v3, but I do not understand the quirks Renesas is adding to the TMIO core code. -- Best Regards Masahiro Yamada

[PATCH v2 5/7] mmc: renesas_sdhi: merge clk_{start,stop} functions to set_clock

2018-08-16 Thread Masahiro Yamada
renesas_sdhi_clk_start() and renesas_sdhi_clk_stop() are now only called from renesas_sdhi_set_clock(). Merge them. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/mmc/host/renesas_sdhi_core.c | 39 +++- 1 file changed, 12 insertions(+), 27

[PATCH v2 0/7] mmc: tmio: refactor TMIO core a bit and add UniPhier SD/eMMC controller support

2018-08-16 Thread Masahiro Yamada
Add UniPhier SD/eMMC controller support. As a preparation, I changed tmio_mmc_set_clock() to a platform hook. The clock rate setting is platform-specific, and UniPhier variants will add another way. I thought it would be better to split this to a hook to avoid a mess. Masahiro Yamada (7

[PATCH v2 2/7] mmc: tmio: move tmio_mmc_set_clock() to platform hook

2018-08-16 Thread Masahiro Yamada
. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/mmc/host/renesas_sdhi_core.c | 50 ++- drivers/mmc/host/tmio_mmc.c | 48 ++ drivers/mmc/host/tmio_mmc.h | 4 +- drivers/mmc/host/tmio_mmc_core.c

[PATCH v2 6/7] mmc: renesas_sdhi: refactor CLK_CTL bit calculation

2018-08-16 Thread Masahiro Yamada
ivisor <= 1' is easier to understand. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/mmc/host/renesas_sdhi_core.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas

[PATCH v2 7/7] mmc: tmio: refactor CLK_CTL bit calculation

2018-08-16 Thread Masahiro Yamada
ivisor <= 1' is easier to understand. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/mmc/host/tmio_mmc.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c index b031a77..e0

[PATCH v2 1/7] mmc: tmio: replace tmio_mmc_clk_stop() calls with tmio_mmc_set_clock()

2018-08-16 Thread Masahiro Yamada
tmio_mmc_clk_stop(host) is equivalent to tmio_mmc_set_clock(host, 0). This replacement is needed for the next commit. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/mmc/host/tmio_mmc_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mmc

[PATCH v2 3/7] dt-bindings: mmc: add DT binding for UniPhier SD/eMMC controller

2018-08-16 Thread Masahiro Yamada
This SD/eMMC controller is used for UniPhier SoC family. Signed-off-by: Masahiro Yamada Reviewed-by: Rob Herring --- Changes in v2: - Rename compatible "socionext,uniphier-sd-v3.1b" to "socionext,uniphier-sd-v3.1.1" .../devicetree/bindings/mmc/uniphie

[PATCH v2 4/7] mmc: uniphier-sd: add UniPhier SD/eMMC controller driver

2018-08-16 Thread Masahiro Yamada
troducing some hooks to cope with platform quirks, but this patch does not touch that for now. Signed-off-by: Masahiro Yamada --- Changes in v2: - Rename compatible "socionext,uniphier-sd-v3.1b" to "socionext,uniphier-sd-v3.1.1" - Use ->callback_result

[PATCH] ARM: dts: renesas: replace toshiba,mmc-wrprotect-disable with disable-wp

2018-04-16 Thread Masahiro Yamada
Follow up commit 788778b0d21a ("mmc: tmio: deprecate "toshiba, mmc-wrprotect-disable" DT property"). Signed-off-by: Masahiro Yamada --- arch/arm/boot/dts/r8a73a4-ape6evm.dts | 4 ++-- arch/arm/boot/dts/sh73a0.dtsi | 4 ++-- 2 files changed, 4 insertions(+), 4 deleti

Re: [PATCH] [RFC] drm: rcar-du: keep temporary dtb files around during build

2018-03-23 Thread Masahiro Yamada
ate rules, and let make chain them > automatically. > > Gr{oetje,eeting}s, > > Geert > I submit the patches. I'd like to queue them up for the next merge window, so your problems will be fixed if Kbuild pull requests are pulled. The driver Makefile has two problems. [1] Objects are always rebuilt due to missing 'targets' [2] Intermediate files are removed due to missing .SECONDARY (or .PRECIOUS) If you want to fix them by yourself, you can. But, those issues will be taken care of by the core Makefile. Specifically, [1] will be fixed by https://patchwork.kernel.org/patch/10304671/ and [2] by https://patchwork.kernel.org/patch/10304651/ -- Best Regards Masahiro Yamada

Re: [PATCH] [RFC] drm: rcar-du: keep temporary dtb files around during build

2018-03-22 Thread Masahiro Yamada
make chain them > automatically. > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- > ge...@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like > that. > -- Linus Torvalds This has been in my TODO list for a while, but I have not had time to finish it. Some people use .PRECIOUS to suppress file removal, but it is wrong IMO. .SECONDARY is the right one, but one problem is, this does not work with pattern rules. I will send a patch soon for the core improvement. -- Best Regards Masahiro Yamada

Re: [PATCH v3 11/16] mmc: tmio: deprecate "toshiba,mmc-wrprotect-disable" DT property

2018-03-17 Thread Masahiro Yamada
2018-02-08 4:32 GMT+09:00 Wolfram Sang : > On Thu, Jan 18, 2018 at 10:58:36AM +0900, Masahiro Yamada wrote: >> 2018-01-18 1:28 GMT+09:00 Masahiro Yamada : >> > This property is equivalent to "disable-wp" defined in >> > Documentation/devicetree/bindings/m

Re: [PATCH] mmc: renesas_sdhi: fix WP detection

2018-03-06 Thread Masahiro Yamada
2018-03-06 17:53 GMT+09:00 Wolfram Sang : > On Tue, Mar 06, 2018 at 12:48:19PM +0900, Masahiro Yamada wrote: >> 2018-03-06 5:48 GMT+09:00 Wolfram Sang : >> > Commit "mmc: renesas_sdhi: use MMC_CAP2_NO_WRITE_PROTECT instead of >> > TMIO own flag" activated MMC_C

Re: [PATCH] mmc: renesas_sdhi: fix WP detection

2018-03-05 Thread Masahiro Yamada
able this capability to re-enable WP GPIOs. > > Signed-off-by: Wolfram Sang > --- > > More testing revealed this. This time, I don't think squashing makes sense but > I am open to discussion here. -- Best Regards Masahiro Yamada

Re: [PATCH v3 00/16] mmc: tmio: another batch of TMIO MMC fixes and cleanups

2018-03-05 Thread Masahiro Yamada
r. In that case, can you add Tested-by to patch 12? -- Best Regards Masahiro Yamada

Re: [PATCH v3 00/16] mmc: tmio: another batch of TMIO MMC fixes and cleanups

2018-02-14 Thread Masahiro Yamada
ch/10170007/) Documentation/devicetree/bindings/mmc/tmio_mmc.txt -> Documentation/devicetree/bindings/mmc/mmc.txt Thanks. -- Best Regards Masahiro Yamada

Re: [PATCH v3 14/16] mmc: tmio: move TMIO_MASK_{READOP,WRITEOP} handling to correct place

2018-02-07 Thread Masahiro Yamada
2018-02-08 6:47 GMT+09:00 Wolfram Sang : > On Thu, Jan 18, 2018 at 01:28:14AM +0900, Masahiro Yamada wrote: >> As far as I tested the IP on UniPhier SoCs, TMIO_STAT_{RXRDY,TXRQ} >> are asserted for DMA mode as well as for PIO. I need to disable the >> those IRQs in dma_ops-&

Re: [PATCH v3 12/16] mmc: tmio: support IP-builtin card detection logic

2018-02-07 Thread Masahiro Yamada
2018-02-08 4:34 GMT+09:00 Wolfram Sang : > On Thu, Jan 18, 2018 at 01:28:12AM +0900, Masahiro Yamada wrote: >> A card detect GPIO is set up only for platforms with "cd-gpios" >> DT property or TMIO_MMC_USE_GPIO_CD flag. However, the driver >> core always uses mm

Re: [PATCH v3 11/16] mmc: tmio: deprecate "toshiba,mmc-wrprotect-disable" DT property

2018-01-17 Thread Masahiro Yamada
2018-01-18 1:28 GMT+09:00 Masahiro Yamada : > This property is equivalent to "disable-wp" defined in > Documentation/devicetree/bindings/mmc/tmio_mmc.txt This is mistake. "disable-wp" is defined in Documentation/devicetree/bindings/mmc/mmc.txt > The TMIO MMC c

Re: [PATCH v2 17/22] mmc: tmio: move TMIO_MASK_{READOP,WRITEOP} handling to correct place

2018-01-17 Thread Masahiro Yamada
Hi Wolfram, 2018-01-16 17:01 GMT+09:00 Wolfram Sang : > On Sat, Nov 25, 2017 at 01:24:52AM +0900, Masahiro Yamada wrote: >> This driver was largely extended by Renesas, but actually used by >> several SoC vendors. The current code does not work for UniPhier >> SoCs at lea

[PATCH v3 09/16] mmc: tmio: use MMC_CAP2_NO_WRITE_PROTECT instead of TMIO own flag

2018-01-17 Thread Masahiro Yamada
operty and "toshiba,mmc-wrprotect-disable" at the same time. I checked under arch/arm/boot/dts/ and arch/arm64/boot/dts/renesas/, and I did not see any Renesas boards with "wp-gpios". So, this conversion should be safe. Signed-off-by: Masahiro Yamada --- Changes in v3: - new

[PATCH v3 12/16] mmc: tmio: support IP-builtin card detection logic

2018-01-17 Thread Masahiro Yamada
vel of the CD line. Allow to use it if the GPIO is unused. Signed-off-by: Masahiro Yamada --- Changes in v3: - split out GPIO CD Changes in v2: None drivers/mmc/host/tmio_mmc_core.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/tmio_mmc_cor

[PATCH v3 04/16] mmc: tmio: remove dma_ops from tmio_mmc_host_probe() argument

2018-01-17 Thread Masahiro Yamada
Drivers need to set up various struct members for tmio_mmc_host before calling tmio_mmc_host_probe(). Do likewise for host->dma_ops instead of passing it as a function argument. Signed-off-by: Masahiro Yamada Reviewed-by: Wolfram Sang --- Changes in v3: None Changes in v2: None drivers/

[PATCH v3 15/16] mmc: tmio: clear force_pio flag before starting data transfer

2018-01-17 Thread Masahiro Yamada
this flag. Signed-off-by: Masahiro Yamada --- Changes in v3: - newly added Changes in v2: None drivers/mmc/host/tmio_mmc_core.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index 731552a..494f0b3

[PATCH v3 14/16] mmc: tmio: move TMIO_MASK_{READOP,WRITEOP} handling to correct place

2018-01-17 Thread Masahiro Yamada
s_ NULL because tmio_mmc_request_dma() is called after this code. Consequently, TMIO_MASK_{READOP,WRITEOP} are set here whether DMA is used or not. Remove this pointless code. Signed-off-by: Masahiro Yamada --- Changes in v3: - Remove the first paragraph of git-log - Clean up renesas drivers too Changes i

[PATCH v3 02/16] mmc: tmio: move clk_enable/disable out of tmio_mmc_host_probe()

2018-01-17 Thread Masahiro Yamada
ta to tmio_mmc_host_alloc() because renesas_sdhi_clk_enable() needs it to get the private data from tmio_mmc_host. Signed-off-by: Masahiro Yamada Reviewed-by: Wolfram Sang --- Changes in v3: None Changes in v2: - Newly added drivers/mmc/host/renesas_sdhi_core.c | 13 ++--- drivers/mmc/host/tmio_

[PATCH v3 05/16] mmc: slot-gpio: add a helper to check capability of GPIO WP detection

2018-01-17 Thread Masahiro Yamada
Like mmc_can_gpio_cd(), mmc_can_gpio_ro() will also be useful for host drivers to know whether GPIO write-protect detection is supported. Signed-off-by: Masahiro Yamada --- Changes in v3: - newly added Changes in v2: None drivers/mmc/core/slot-gpio.c | 8 include/linux/mmc/slot

[PATCH v3 01/16] mmc: tmio: ioremap memory resource in tmio_mmc_host_alloc()

2018-01-17 Thread Masahiro Yamada
d-off-by: Masahiro Yamada Reviewed-by: Wolfram Sang --- Changes in v3: None Changes in v2: None drivers/mmc/host/renesas_sdhi_core.c | 4 ++-- drivers/mmc/host/tmio_mmc.c | 4 +++- drivers/mmc/host/tmio_mmc_core.c | 16 +--- 3 files changed, 14 insertions(+), 10 dele

[PATCH v3 07/16] mmc: renesas_sdhi: use MMC_CAP2_NO_WRITE_PROTECT instead of TMIO own flag

2018-01-17 Thread Masahiro Yamada
ds with "wp-gpios". So, this conversion should be safe. Signed-off-by: Masahiro Yamada --- Changes in v3: - newly added Changes in v2: None drivers/mmc/host/renesas_sdhi_internal_dmac.c | 6 +++--- drivers/mmc/host/renesas_sdhi_sys_dmac.c | 16 2 files

[PATCH v3 16/16] mmc: tmio: remove useless TMIO_MASK_CMD handling in tmio_mmc_host_probe()

2018-01-17 Thread Masahiro Yamada
ask &= ~irq_mask; The logic is opposite between "->sdcard_irq_mask" and "irq_mask". The intention is not clear at a glance. Signed-off-by: Masahiro Yamada --- Changes in v3: None Changes in v2: - Newly added drivers/mmc/host/tmio_mmc_core.c | 3 --- 1 file changed

[PATCH v3 10/16] mmc: tmio: remove TMIO_MMC_WRPROTECT_DISABLE

2018-01-17 Thread Masahiro Yamada
The use of this flag has been replaced with MMC_CAP2_NO_WRITE_PROTECT. No platform defines this flag any more. Remove. Signed-off-by: Masahiro Yamada --- Changes in v3: - newly added Changes in v2: None drivers/mmc/host/tmio_mmc_core.c | 5 ++--- include/linux/mfd/tmio.h | 1 - 2

[PATCH v3 06/16] mmc: tmio: refactor .get_ro hook

2018-01-17 Thread Masahiro Yamada
the probe function, then set mmc_gpio_get_ro to .get_ro if it is the case. Signed-off-by: Masahiro Yamada --- Changes in v3: - newly added Changes in v2: None drivers/mmc/host/tmio_mmc_core.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/host

[PATCH v3 03/16] mmc: tmio: move {tmio_}mmc_of_parse() to tmio_mmc_host_alloc()

2018-01-17 Thread Masahiro Yamada
handle capabilities before mmc_add_host(). Move tmio_mmc_of_parse() likewise. Signed-off-by: Masahiro Yamada Reviewed-by: Wolfram Sang --- Changes in v3: None Changes in v2: - Newly added drivers/mmc/host/tmio_mmc_core.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions

[PATCH v3 08/16] sh: kfr2r09: use MMC_CAP2_NO_WRITE_PROTECT instead of TMIO own flag

2018-01-17 Thread Masahiro Yamada
P2_... returns 0 before calling ->get_ro() hook (i.e. it affects both IP own logic and GPIO detection). The TMIO MMC drivers do not set-up gpio_ro by themselves, so gpio_ro is obviously unused by legacy boards like this. So, this conversion should be safe. Signed-off-by: Masahiro Yamada --- C

[PATCH v3 11/16] mmc: tmio: deprecate "toshiba,mmc-wrprotect-disable" DT property

2018-01-17 Thread Masahiro Yamada
e same thing. Let's remove the description from the dt-binding to prevent new boards from using it. I am keeping the driver code for existing DT files, but added comments that this is deprecated. Signed-off-by: Masahiro Yamada --- Changes in v3: - newly added Changes in v2: None Document

[PATCH v3 00/16] mmc: tmio: another batch of TMIO MMC fixes and cleanups

2018-01-17 Thread Masahiro Yamada
: new patches (cleanups of WP flag) Patch 12: updated per Wolfram Patch 13: repost (almost reviewed) Patch 14: updated Patch 15: new Patch 16: repost (almost reviewed) Masahiro Yamada (16): mmc: tmio: ioremap memory resource in tmio_mmc_host_alloc() mmc: tmio: move clk_enable/disable out

Re: [PATCH v2 16/22] mmc: tmio: fix never-detected card insertion bug

2018-01-17 Thread Masahiro Yamada
;native_hogplug is 0. Then, my code does nothing, doesn't it? + if (_host->native_hotplug) + tmio_mmc_enable_mmc_irqs(_host, + TMIO_STAT_CARD_REMOVE | TMIO_STAT_CARD_INSERT); -- Best Regards Masahiro Yamada

[PATCH v3 13/16] mmc: tmio: fix never-detected card insertion bug

2018-01-17 Thread Masahiro Yamada
card is never detected. The card event IRQs must be enabled in probe/resume functions. Signed-off-by: Masahiro Yamada --- Changes in v3: None Changes in v2: - Newly added drivers/mmc/host/tmio_mmc_core.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/driv

Re: [PATCH v2 09/22] mmc: tmio: use mmc_can_gpio_cd() instead of checking TMIO_MMC_USE_GPIO_CD

2018-01-11 Thread Masahiro Yamada
Hi Ulf, 2018-01-02 21:56 GMT+09:00 Wolfram Sang : > On Sat, Nov 25, 2017 at 01:24:44AM +0900, Masahiro Yamada wrote: >> To use a GPIO line for card detection, TMIO_MMC_USE_GPIO_CD is set >> by a legacy board (arch/sh/boards/mach-ecovec24). >> >> For DT platforms, t

Re: [PATCH v2 16/22] mmc: tmio: fix never-detected card insertion bug

2018-01-05 Thread Masahiro Yamada
x/v4.15-rc6/source/drivers/mmc/core/core.c#L2818 [2] http://elixir.free-electrons.com/linux/v4.15-rc6/source/drivers/mmc/host/tmio_mmc_core.c#L656 [3] http://elixir.free-electrons.com/linux/v4.15-rc6/source/drivers/mmc/core/core.c#L1995 [4] http://elixir.free-electrons.com/linux/v4.15-rc6/source/drivers/mmc/host/tmio_mmc_core.c#L1105 -- Best Regards Masahiro Yamada

Re: [PATCH v2 00/22] mmc: tmio: various fixes and cleanups

2017-12-18 Thread Masahiro Yamada
Hi Ulf, 2017-12-15 18:18 GMT+09:00 Ulf Hansson : > On 24 November 2017 at 17:24, Masahiro Yamada > wrote: >> >> I am working on this IP for Socionext SoCs. >> >> I was hit by several issues, and noticed various >> clean-up candidates. >> >> -

Re: [RFC PATCH] mmc: tmio: use ioread* for repeated access to a register

2017-12-18 Thread Masahiro Yamada
vert maybe all of those? > > Yes, seems like a good idea. > > [...] > BTW, is ioread* preferred to read*? We need to eliminate the root cause. Other drivers using reads* cannot enable COMPILE_TEST for the same reason. Wolfram, Can you send a patch for sparc64? -- Best Regards Masahiro Yamada

Re: [PATCH v2 00/22] mmc: tmio: various fixes and cleanups

2017-12-15 Thread Masahiro Yamada
2017-12-15 18:18 GMT+09:00 Ulf Hansson : > On 24 November 2017 at 17:24, Masahiro Yamada > wrote: >> >> I am working on this IP for Socionext SoCs. >> >> I was hit by several issues, and noticed various >> clean-up candidates. >> >> - Fix and c

Re: [PATCH v2 10/22] mmc: tmio: support IP-builtin card detection logic

2017-12-05 Thread Masahiro Yamada
TMIO_STAT_SIGSTATE); } static const struct mmc_host_ops tmio_mmc_ops = { ... .get_cd = tmio_mmc_get_cd, ... }; int tmio_mmc_host_probe( ... ) { /* replace get_cd hook when we use GPIO for card detection */ if (mmc_can_gpio_cd(mmc)) _host->ops.get_cd = mmc_gpio_get_cd; } -- Best Regards Masahiro Yamada

Re: [PATCH v2 02/22] mmc: renesas_sdhi: remove wrong depends on to enable compile test

2017-12-04 Thread Masahiro Yamada
2017-12-05 0:25 GMT+09:00 Wolfram Sang : > On Sat, Nov 25, 2017 at 01:24:37AM +0900, Masahiro Yamada wrote: >> ARCH_RENESAS is a stronger condition than (ARM || ARM64). >> If ARCH_RENESAS is enabled, (ARM || ARM64) is met as well. >> >> What is worse, the fir

Re: [PATCH v2 00/22] mmc: tmio: various fixes and cleanups

2017-11-27 Thread Masahiro Yamada
forms, too. > > Other changes like moving stuff from tmio_core to renesas_sdhi is less > critical. Either it works or not, so that is easy to spot :) > > Which might be another argument for multiple smaller patch series. > > Nonetheless, I'll try to get this reviewed in the next days... Thanks! > All the best, > >Wolfram > > -- Best Regards Masahiro Yamada

[PATCH v2 20/22] mmc: tmio: move clk_enable/disable out of tmio_mmc_host_probe()

2017-11-24 Thread Masahiro Yamada
ta to tmio_mmc_host_alloc() because renesas_sdhi_clk_enable() needs it to get the private data from tmio_mmc_host. Signed-off-by: Masahiro Yamada --- Changes in v2: - Newly added drivers/mmc/host/renesas_sdhi_core.c | 13 ++--- drivers/mmc/host/tmio_mmc.c | 7 +-- drivers/mmc/host/tmio_

[PATCH v2 22/22] mmc: tmio: remove dma_ops from tmio_mmc_host_probe() argument

2017-11-24 Thread Masahiro Yamada
Drivers need to set up various struct members for tmio_mmc_host before calling tmio_mmc_host_probe(). Do likewise for host->dma_ops instead of passing it as a function argument. Signed-off-by: Masahiro Yamada --- Changes in v2: - Newly added drivers/mmc/host/renesas_sdhi_core.c

[PATCH v2 04/22] mmc: tmio: set tmio_mmc_host to driver data

2017-11-24 Thread Masahiro Yamada
The remove, suspend, resume hooks need to get tmio_mmc_host. It is tedious to call mmc_priv() to convert mmc_host to tmio_mmc_host. We can directly set tmio_mmc_host to driver data. Signed-off-by: Masahiro Yamada Acked-by: Wolfram Sang --- Changes in v2: None drivers/mmc/host

[PATCH v2 03/22] mmc: renesas_sdhi: remove eprobe jump label

2017-11-24 Thread Masahiro Yamada
"goto eprobe" does nothing. Return directly. Signed-off-by: Masahiro Yamada --- Changes in v2: - Fix a typo : renesas_sdhc -> renesas_sdhi - Restore the "ret" printout for devm_clk_get() drivers/mmc/host/renesas_sdhi_core.c | 10 -- 1 file changed, 4 ins

[PATCH v2 01/22] mmc: renesas_sdhi: consolidate DMAC CONFIG options

2017-11-24 Thread Masahiro Yamada
The description in the Makefile is odd. Fix the CONFIG selection in a cleaner way. Signed-off-by: Masahiro Yamada Acked-by: Wolfram Sang --- Changes in v2: - Fix a typo consilidate -> consolidate drivers/mmc/host/Kconfig | 4 ++-- drivers/mmc/host/Makefile | 8 ++-- 2 files chan

[PATCH v2 19/22] mmc: tmio: ioremap memory resource in tmio_mmc_host_alloc()

2017-11-24 Thread Masahiro Yamada
d-off-by: Masahiro Yamada --- Changes in v2: - Newly added drivers/mmc/host/renesas_sdhi_core.c | 4 ++-- drivers/mmc/host/tmio_mmc.c | 4 +++- drivers/mmc/host/tmio_mmc_core.c | 16 +--- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/mmc

[PATCH v2 05/22] mmc: tmio: use devm_ioremap_resource() instead of devm_ioremap()

2017-11-24 Thread Masahiro Yamada
The TMIO core misses to call request_mem_region(). devm_ioremap_resource() takes care of it and makes the code cleaner. Signed-off-by: Masahiro Yamada Reviewed-by: Wolfram Sang Tested-by: Wolfram Sang --- Changes in v2: None drivers/mmc/host/tmio_mmc_core.c | 10 +++--- 1 file changed

[PATCH v2 00/22] mmc: tmio: various fixes and cleanups

2017-11-24 Thread Masahiro Yamada
starts - Fix weird IRQ handling I am getting more and more patches for TMIO. I put all in a single series to clarify the patch order. 1, 2, 4, 5, 6, 7 were already acked or reviewed by Wolfram Sang. Masahiro Yamada (22): mmc: renesas_sdhi: consolidate DMAC CONFIG options mmc: renesas_sdhi

[PATCH v2 06/22] mmc: tmio: move mmc_host_ops to struct tmio_mmc_host from static data

2017-11-24 Thread Masahiro Yamada
sdhci_alloc_host(). Copy the whole ops structure to host->mmc_host_ops, then override the hooks in malloc'ed data. Constify tmio_mmc_ops since it is now a template ops used by default. Signed-off-by: Masahiro Yamada Reviewed-by: Wolfram Sang Tested-by: Wolfram Sang --- Changes in v2:

[PATCH v2 15/22] mmc: tmio: change bus_shift to unsigned int

2017-11-24 Thread Masahiro Yamada
Sane values for bus_shift are: 0 - for 16 bit bus 1 - for 32 bit bus 2 - for 64 bit bus "unsigned long" is too much. Signed-off-by: Masahiro Yamada --- Changes in v2: - Newly added drivers/mmc/host/tmio_mmc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) di

[PATCH v2 11/22] mmc: renesas_sdhi: remove always false condition

2017-11-24 Thread Masahiro Yamada
renesas_sdhi_probe() always sets host->dma as follows: host->dma = dma_priv; !host->dma is always false. Signed-off-by: Masahiro Yamada --- Changes in v2: - Newly added drivers/mmc/host/renesas_sdhi_sys_dmac.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH v2 07/22] mmc: tmio, renesas_sdhi: set mmc_host_ops hooks directly

2017-11-24 Thread Masahiro Yamada
Drivers can set any mmc_host_ops hooks between tmio_mmc_host_alloc() and tmio_mmc_host_probe(). Remove duplicated hooks in tmio_mmc_host. Signed-off-by: Masahiro Yamada Reviewed-by: Wolfram Sang Tested-by: Wolfram Sang --- Changes in v2: - Rename "mmc_host_ops" to "ops&qu

[PATCH v2 08/22] mmc: tmio: move mmc_gpio_request_cd() before mmc_add_host()

2017-11-24 Thread Masahiro Yamada
Drivers do not need to call mmc_gpiod_request_cd_irq() explicitly because mmc_start_host() calls it. To make it work, cd_gpio must be set before mmc_add_host(). Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/mmc/host/tmio_mmc_core.c | 14 ++ 1 file changed, 6

[PATCH v2 16/22] mmc: tmio: fix never-detected card insertion bug

2017-11-24 Thread Masahiro Yamada
s never detected. The card event IRQs must be enabled in probe/resume functions. Signed-off-by: Masahiro Yamada --- Changes in v2: - Newly added drivers/mmc/host/tmio_mmc_core.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/tmio_mmc_core.c b/driv

[PATCH v2 14/22] mmc: tmio,renesas_sdhi: move ssc_tappos to renesas_sdhi.h

2017-11-24 Thread Masahiro Yamada
struct tmio_mmc_host has "scc_tappos", but in fact, it is Renesas private data. Move it to renesas_sdhi.h Signed-off-by: Masahiro Yamada --- Changes in v2: - Newly added drivers/mmc/host/renesas_sdhi.h | 1 + drivers/mmc/host/renesas_sdhi_core.c | 4 ++-- drivers/mmc/host/

[PATCH v2 09/22] mmc: tmio: use mmc_can_gpio_cd() instead of checking TMIO_MMC_USE_GPIO_CD

2017-11-24 Thread Masahiro Yamada
se() calls mmc_gpiod_request_cd() to set up ctx->cd_gpio if the "cd-gpios" property is specified. To cater to both cases, mmc_can_gpio_cd() is a correct way to check which card detection logic is used. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/mmc/host/tmio_mmc_core.c |

[PATCH v2 17/22] mmc: tmio: move TMIO_MASK_{READOP,WRITEOP} handling to correct place

2017-11-24 Thread Masahiro Yamada
This does not take care of a case where ->force_pio is set, but unset later. After all, the correct place to handle those flags is just before starting the data transfer. Signed-off-by: Masahiro Yamada --- Changes in v2: - Newly added drivers/mmc/host/tmio_mmc_core.c | 18 --

[PATCH v2 10/22] mmc: tmio: support IP-builtin card detection logic

2017-11-24 Thread Masahiro Yamada
vel of the CD line. Allow to use it if the GPIO is unused. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/mmc/host/tmio_mmc_core.c | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc

[PATCH v2 21/22] mmc: tmio: move {tmio_}mmc_of_parse() to tmio_mmc_host_alloc()

2017-11-24 Thread Masahiro Yamada
handle capabilities before mmc_add_host(). Move tmio_mmc_of_parse() likewise. Signed-off-by: Masahiro Yamada --- Changes in v2: - Newly added drivers/mmc/host/tmio_mmc_core.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/tmio_mmc_core.c

[PATCH v2 12/22] mmc: tmio,renesas_sdhi: move struct tmio_mmc_dma to renesas_sdhi.h

2017-11-24 Thread Masahiro Yamada
necessary to convert the tmio_mmc_host pointer into the renesas_sdhi pointer. Signed-off-by: Masahiro Yamada --- Changes in v2: - Newly added drivers/mmc/host/renesas_sdhi.h | 19 +++ drivers/mmc/host/renesas_sdhi_core.c | 14 -- drivers/mmc/host

[PATCH v2 13/22] mmc: tmio,renesas_sdhi: move Renesas-specific DMA data to renesas_sdhi.h

2017-11-24 Thread Masahiro Yamada
struct tmio_mmc_host has "dma_dataend" and "dma_complete", but in fact, they are Renesas private data. Move them to renesas_sdhi.h Signed-off-by: Masahiro Yamada --- Changes in v2: - Newly added drivers/mmc/host/renesas_sdhi.h | 2

[PATCH v2 18/22] mmc: tmio: remove useless TMIO_MASK_CMD handling in tmio_mmc_host_probe()

2017-11-24 Thread Masahiro Yamada
ask &= ~irq_mask; The logic is opposite between "->sdcard_irq_mask" and "irq_mask". The intention is not clear at a glance. Signed-off-by: Masahiro Yamada --- Changes in v2: - Newly added drivers/mmc/host/tmio_mmc_core.c | 3 --- 1 file changed, 3 deletions(-)

[PATCH v2 02/22] mmc: renesas_sdhi: remove wrong depends on to enable compile test

2017-11-24 Thread Masahiro Yamada
ARCH_RENESAS is a stronger condition than (ARM || ARM64). If ARCH_RENESAS is enabled, (ARM || ARM64) is met as well. What is worse, the first depends on line prevents COMPILE_TEST from enabling this driver. It should be removed. Signed-off-by: Masahiro Yamada Acked-by: Wolfram Sang

Re: [PATCH] drm: remove NULL pointer check for clk_disable_unprepare

2017-05-20 Thread Masahiro Yamada
2017-05-21 2:58 GMT+09:00 Masahiro Yamada : > After long term efforts of fixing non-common clock implementations, > clk_disable() is a no-op for a NULL pointer input, and this is now > tree-wide consistent. > > All clock consumers can safely call clk_disable(_unprepare) without

[PATCH] drm: remove NULL pointer check for clk_disable_unprepare

2017-05-20 Thread Masahiro Yamada
After long term efforts of fixing non-common clock implementations, clk_disable() is a no-op for a NULL pointer input, and this is now tree-wide consistent. All clock consumers can safely call clk_disable(_unprepare) without NULL pointer check. Signed-off-by: Masahiro Yamada --- drivers/gpu

Re: [PATCH v2] clk: let clk_disable() return immediately if clk is NULL or error

2016-04-13 Thread Masahiro Yamada
Hi Stephen, 2016-04-14 9:33 GMT+09:00 Stephen Boyd : > On 04/08, Masahiro Yamada wrote: >> >> >> This makes our driver programming life easier. >> >> >> For example, let's see drivers/tty/serial/8250/8250_of.c >> >> >> The "c

Re: [PATCH v2] clk: let clk_disable() return immediately if clk is NULL or error

2016-04-08 Thread Masahiro Yamada
2016-04-08 19:06 GMT+09:00 Ralf Baechle : > On Thu, Apr 07, 2016 at 05:33:28PM -0700, Stephen Boyd wrote: > >> On 04/05, Masahiro Yamada wrote: >> > The clk_disable() in the common clock framework (drivers/clk/clk.c) >> > returns immediately if a given clk is

Re: [PATCH v2] clk: let clk_disable() return immediately if clk is NULL or error

2016-04-07 Thread Masahiro Yamada
Hi Stephen, 2016-04-08 9:33 GMT+09:00 Stephen Boyd : > On 04/05, Masahiro Yamada wrote: >> The clk_disable() in the common clock framework (drivers/clk/clk.c) >> returns immediately if a given clk is NULL or an error pointer. It >> allows clock consumers to call

[PATCH v2] clk: let clk_disable() return immediately if clk is NULL or error

2016-04-04 Thread Masahiro Yamada
checking is missing from some of non-common clk_disable() implementations. This prevents us from completely dropping NULL/error checking from callers. Let's make it tree-wide consistent by adding IS_ERR_OR_NULL(clk) to all callees. Signed-off-by: Masahiro Yamada Acked-by: Greg Ungerer Ack