From: Gregory CLEMENT <gregory.clement@free-electrons.com>
To: Marcin Wojtas <mw@semihalf.com>
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org,
ulf.hansson@linaro.org, sebastian.hesselbarth@gmail.com,
andrew@lunn.ch, jason@lakedaemon.net,
thomas.petazzoni@free-electrons.com, nadavh@marvell.com,
alior@marvell.com, tawfik@marvell.com, jaz@semihalf.com
Subject: Re: [PATCH 4/8] mmc: sdhci-pxav3: enable proper resuming on Armada 38x SoC
Date: Tue, 06 Oct 2015 16:51:15 +0200 [thread overview]
Message-ID: <877fn09hjw.fsf@free-electrons.com> (raw)
In-Reply-To: <1444094562-31165-5-git-send-email-mw@semihalf.com> (Marcin Wojtas's message of "Tue, 6 Oct 2015 03:22:38 +0200")
Hi Marcin,
On mar., oct. 06 2015, Marcin Wojtas <mw@semihalf.com> wrote:
> When resuming from suspend on Armada 38x SoC MBus windows have to be
> re-configured and for that purpose mv_conf_mbus_windows function needed
> rework. MBus windows register base address obtaining was moved to
> armada_38x_quirks function in order to be kept in pxa global structure,
> because it is used during a resume.
>
> This commit fixes resuming from suspend by calling MBus windows
> configuration routine and therefore enabling proper DMA operation.
>
> Signed-off-by: Marcin Wojtas <mw@semihalf.com>
> ---
> drivers/mmc/host/sdhci-pxav3.c | 39 ++++++++++++++++++++-------------------
> 1 file changed, 20 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
> index f5edf9d..3f71894 100644
> --- a/drivers/mmc/host/sdhci-pxav3.c
> +++ b/drivers/mmc/host/sdhci-pxav3.c
> @@ -63,6 +63,7 @@ struct sdhci_pxa {
> struct clk *clk_io;
> u8 power_mode;
> void __iomem *sdio3_conf_reg;
> + void __iomem *mbus_win_regs;
> };
>
> @@ -135,6 +120,14 @@ static int armada_38x_quirks(struct platform_device *pdev,
> struct sdhci_pxa *pxa = pltfm_host->priv;
> struct resource *res;
>
> + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mbus");
> + pxa->mbus_win_regs = devm_ioremap_resource(&pdev->dev, res);
[...]
> @@ -520,6 +514,13 @@ static int sdhci_pxav3_resume(struct device *dev)
> {
> int ret;
> struct sdhci_host *host = dev_get_drvdata(dev);
> + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> + struct sdhci_pxa *pxa = pltfm_host->priv;
> + struct device_node *np = dev->of_node;
> +
> + if (of_device_is_compatible(np, "marvell,armada-380-sdhci"))
> + ret = mv_conf_mbus_windows(dev, pxa->mbus_win_regs,
> + mv_mbus_dram_info());
I would find it cleaner to not rely on the device tree outise the probe
function. What about just testing pxa->mbus_win_regs ? As it is set only
if we need it, it should be a good test.
Thanks,
Gregory
--
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
WARNING: multiple messages have this Message-ID (diff)
From: gregory.clement@free-electrons.com (Gregory CLEMENT)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/8] mmc: sdhci-pxav3: enable proper resuming on Armada 38x SoC
Date: Tue, 06 Oct 2015 16:51:15 +0200 [thread overview]
Message-ID: <877fn09hjw.fsf@free-electrons.com> (raw)
In-Reply-To: <1444094562-31165-5-git-send-email-mw@semihalf.com> (Marcin Wojtas's message of "Tue, 6 Oct 2015 03:22:38 +0200")
Hi Marcin,
On mar., oct. 06 2015, Marcin Wojtas <mw@semihalf.com> wrote:
> When resuming from suspend on Armada 38x SoC MBus windows have to be
> re-configured and for that purpose mv_conf_mbus_windows function needed
> rework. MBus windows register base address obtaining was moved to
> armada_38x_quirks function in order to be kept in pxa global structure,
> because it is used during a resume.
>
> This commit fixes resuming from suspend by calling MBus windows
> configuration routine and therefore enabling proper DMA operation.
>
> Signed-off-by: Marcin Wojtas <mw@semihalf.com>
> ---
> drivers/mmc/host/sdhci-pxav3.c | 39 ++++++++++++++++++++-------------------
> 1 file changed, 20 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-pxav3.c b/drivers/mmc/host/sdhci-pxav3.c
> index f5edf9d..3f71894 100644
> --- a/drivers/mmc/host/sdhci-pxav3.c
> +++ b/drivers/mmc/host/sdhci-pxav3.c
> @@ -63,6 +63,7 @@ struct sdhci_pxa {
> struct clk *clk_io;
> u8 power_mode;
> void __iomem *sdio3_conf_reg;
> + void __iomem *mbus_win_regs;
> };
>
> @@ -135,6 +120,14 @@ static int armada_38x_quirks(struct platform_device *pdev,
> struct sdhci_pxa *pxa = pltfm_host->priv;
> struct resource *res;
>
> + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mbus");
> + pxa->mbus_win_regs = devm_ioremap_resource(&pdev->dev, res);
[...]
> @@ -520,6 +514,13 @@ static int sdhci_pxav3_resume(struct device *dev)
> {
> int ret;
> struct sdhci_host *host = dev_get_drvdata(dev);
> + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
> + struct sdhci_pxa *pxa = pltfm_host->priv;
> + struct device_node *np = dev->of_node;
> +
> + if (of_device_is_compatible(np, "marvell,armada-380-sdhci"))
> + ret = mv_conf_mbus_windows(dev, pxa->mbus_win_regs,
> + mv_mbus_dram_info());
I would find it cleaner to not rely on the device tree outise the probe
function. What about just testing pxa->mbus_win_regs ? As it is set only
if we need it, it should be a good test.
Thanks,
Gregory
--
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
next prev parent reply other threads:[~2015-10-06 14:58 UTC|newest]
Thread overview: 75+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-06 1:22 [PATCH 0/8] Armada 38x SDHCI driver improvements Marcin Wojtas
2015-10-06 1:22 ` Marcin Wojtas
2015-10-06 1:22 ` [PATCH 1/8] mmc: sdhci-pxav3: remove broken clock base quirk for Armada 38x sdhci driver Marcin Wojtas
2015-10-06 1:22 ` Marcin Wojtas
2015-10-06 1:22 ` Marcin Wojtas
2015-10-06 14:43 ` Gregory CLEMENT
2015-10-06 14:43 ` Gregory CLEMENT
2015-10-06 14:43 ` Gregory CLEMENT
2015-10-08 17:35 ` Ulf Hansson
2015-10-08 17:35 ` Ulf Hansson
2015-10-08 17:35 ` Ulf Hansson
2015-10-06 1:22 ` [PATCH 2/8] mmc: sdhci-pxav3: disable clock inversion for HS MMC cards Marcin Wojtas
2015-10-06 1:22 ` Marcin Wojtas
2015-10-06 1:22 ` Marcin Wojtas
2015-10-06 14:44 ` Gregory CLEMENT
2015-10-06 14:44 ` Gregory CLEMENT
2015-10-06 14:44 ` Gregory CLEMENT
2015-10-08 17:35 ` Ulf Hansson
2015-10-08 17:35 ` Ulf Hansson
2015-10-08 17:35 ` Ulf Hansson
2015-10-06 1:22 ` [PATCH 3/8] mmc: sdhci-pxav3: fix error handling of armada_38x_quirks Marcin Wojtas
2015-10-06 1:22 ` Marcin Wojtas
2015-10-06 1:22 ` Marcin Wojtas
2015-10-06 14:47 ` Gregory CLEMENT
2015-10-06 14:47 ` Gregory CLEMENT
2015-10-06 14:47 ` Gregory CLEMENT
2015-10-08 17:35 ` Ulf Hansson
2015-10-08 17:35 ` Ulf Hansson
2015-10-08 17:35 ` Ulf Hansson
2015-10-09 0:49 ` Marcin Wojtas
2015-10-09 0:49 ` Marcin Wojtas
2015-10-06 1:22 ` [PATCH 4/8] mmc: sdhci-pxav3: enable proper resuming on Armada 38x SoC Marcin Wojtas
2015-10-06 1:22 ` Marcin Wojtas
2015-10-06 1:22 ` Marcin Wojtas
2015-10-06 14:51 ` Gregory CLEMENT [this message]
2015-10-06 14:51 ` Gregory CLEMENT
2015-10-06 15:08 ` Marcin Wojtas
2015-10-06 15:08 ` Marcin Wojtas
2015-10-09 1:09 ` Jisheng Zhang
2015-10-09 1:09 ` Jisheng Zhang
2015-10-09 1:09 ` Jisheng Zhang
2015-10-09 9:48 ` Marcin Wojtas
2015-10-09 9:48 ` Marcin Wojtas
2015-10-06 1:22 ` [PATCH 5/8] mmc: sdhci-pxav3: enable usage of DAT3 pin as HW card detect Marcin Wojtas
2015-10-06 1:22 ` Marcin Wojtas
2015-10-06 1:22 ` Marcin Wojtas
2015-10-06 1:22 ` [PATCH 6/8] ARM: mvebu: enable SDHCI card detection using DAT3 pin on A388-GP Marcin Wojtas
2015-10-06 1:22 ` Marcin Wojtas
2015-10-06 3:31 ` Andrew Lunn
2015-10-06 3:31 ` Andrew Lunn
2015-10-06 7:02 ` Marcin Wojtas
2015-10-06 7:02 ` Marcin Wojtas
2015-10-06 14:45 ` Andrew Lunn
2015-10-06 14:45 ` Andrew Lunn
2015-10-06 15:05 ` Marcin Wojtas
2015-10-06 15:05 ` Marcin Wojtas
2015-10-06 16:23 ` Andrew Lunn
2015-10-06 16:23 ` Andrew Lunn
2015-10-06 15:05 ` Gregory CLEMENT
2015-10-06 15:05 ` Gregory CLEMENT
2015-10-06 15:05 ` Gregory CLEMENT
2015-10-06 15:35 ` Marcin Wojtas
2015-10-06 15:35 ` Marcin Wojtas
2015-10-06 16:20 ` Andrew Lunn
2015-10-06 16:20 ` Andrew Lunn
2015-10-06 1:22 ` [PATCH 7/8] mmc: sdhci: add init_card callback to sdhci Marcin Wojtas
2015-10-06 1:22 ` Marcin Wojtas
2015-10-06 1:22 ` [PATCH 8/8] mmc: sdhci-pxav3: enable modifying MMC_CARD bit during card initialization Marcin Wojtas
2015-10-06 1:22 ` Marcin Wojtas
2015-10-06 14:43 ` [PATCH 0/8] Armada 38x SDHCI driver improvements Gregory CLEMENT
2015-10-06 14:43 ` Gregory CLEMENT
2015-10-06 15:48 ` Marcin Wojtas
2015-10-06 15:48 ` Marcin Wojtas
2015-10-08 13:21 ` Marcin Wojtas
2015-10-08 13:21 ` Marcin Wojtas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877fn09hjw.fsf@free-electrons.com \
--to=gregory.clement@free-electrons.com \
--cc=alior@marvell.com \
--cc=andrew@lunn.ch \
--cc=jason@lakedaemon.net \
--cc=jaz@semihalf.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=mw@semihalf.com \
--cc=nadavh@marvell.com \
--cc=sebastian.hesselbarth@gmail.com \
--cc=tawfik@marvell.com \
--cc=thomas.petazzoni@free-electrons.com \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.