Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1335371 > unrolled thread
| Started by | Jisheng Zhang <jszhang@marvell.com> |
|---|---|
| First post | 2016-02-16 14:20 +0100 |
| Last post | 2016-02-18 13:50 +0100 |
| Articles | 6 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH v5 00/13] mmc: use sdhci_pltfm_init for private allocation and clean up Jisheng Zhang <jszhang@marvell.com> - 2016-02-16 14:20 +0100
[PATCH v5 06/13] mmc: sdhci-of-arasan: use sdhci_pltfm_init for private allocation Jisheng Zhang <jszhang@marvell.com> - 2016-02-16 14:20 +0100
[PATCH v5 07/13] mmc: sdhci-of-at91: use sdhci_pltfm_init for private allocation Jisheng Zhang <jszhang@marvell.com> - 2016-02-16 14:20 +0100
[PATCH v5 01/13] mmc: sdhci-bcm2835: use sdhci_pltfm_init for private allocation Jisheng Zhang <jszhang@marvell.com> - 2016-02-16 14:20 +0100
Re: [PATCH v5 01/13] mmc: sdhci-bcm2835: use sdhci_pltfm_init for private allocation Eric Anholt <eric@anholt.net> - 2016-02-16 19:20 +0100
Re: [PATCH v5 00/13] mmc: use sdhci_pltfm_init for private allocation and clean up Ulf Hansson <ulf.hansson@linaro.org> - 2016-02-18 13:50 +0100
| From | Jisheng Zhang <jszhang@marvell.com> |
|---|---|
| Date | 2016-02-16 14:20 +0100 |
| Subject | [PATCH v5 00/13] mmc: use sdhci_pltfm_init for private allocation and clean up |
| Message-ID | <r2NHQ-8jx-3@gated-at.bofh.it> |
These patches are to complete the TODOs in Commit 0e748234293f ("mmc:
sdhci: Add size for caller in init+register"), I.E:
- todo: migrate clients to using allocation this way
- todo: remove priv variable once migration is complete
Since v4:
- based on Ulf's latest next branch
- add Adrian's Ack for all patches, add Thierry's Ack and Test for patch 11
add Sören Ack for patch 5.
Since v3:
- based on v4.5-rc1
- add Ludovic's ack for sdhci-of-at91 changes
- fix use-after-free in some drivers: some host drivers still needs to
access sdhci_pltfm_host->private after sdhci_pltfm_unregister(), but
the private should be already freed by sdhci_pltfm_unregister.
- add patch5 to fix one clk bug in sdhci_arasan_remove(). IMHO, It's
better to add this patch to fixes rather than waiting for next merge
window
Since v2:
- based on mmc next tree and remove all priv usage introduced in newly
commits in this tree
- don't break two lines if sdhci_pltfm_init() call could be put into
one line. Thank Ludovic Desroches.
Since v1:
- add new patch03 to factorise sdhci_msm_pdata outisde of sdhci_msm_host.
This is to fix drivers/mmc/host/sdhci-msm.c:440:32: warning: 'msm_host'
is used uninitialized in this function [-Wuninitialized]
- Add Arnd's Ack for all patches except patch3 which is new in v2
Jisheng Zhang (13):
mmc: sdhci-bcm2835: use sdhci_pltfm_init for private allocation
mmc: sdhci-esdhc-imx: use sdhci_pltfm_init for private allocation
mmc: sdhci-msm: factorise sdhci_msm_pdata outisde of sdhci_msm_host
mmc: sdhci-msm: use sdhci_pltfm_init for private allocation
mmc: sdhci-of-arasan: fix clk issue in sdhci_arasan_remove()
mmc: sdhci-of-arasan: use sdhci_pltfm_init for private allocation
mmc: sdhci-of-at91: use sdhci_pltfm_init for private allocation
mmc: sdhci-of-esdhc: use sdhci_pltfm_init for private allocation
mmc: sdhci-pxav3: use sdhci_pltfm_init for private allocation
mmc: sdhci-st: use sdhci_pltfm_init for private allocation
mmc: sdhci-tegra: use sdhci_pltfm_init for private allocation
mmc: sdhci-pxav2: remove unnecessary assignment of pltfm_host->priv
mmc: sdhci-pltfm: remove priv variable from sdhci_pltfm_host
drivers/mmc/host/sdhci-bcm2835.c | 14 +++----------
drivers/mmc/host/sdhci-esdhc-imx.c | 38 ++++++++++++++++--------------------
drivers/mmc/host/sdhci-msm.c | 25 +++++++++++-------------
drivers/mmc/host/sdhci-of-arasan.c | 33 +++++++++++++++----------------
drivers/mmc/host/sdhci-of-at91.c | 33 ++++++++++++++-----------------
drivers/mmc/host/sdhci-of-esdhc.c | 19 +++++++++---------
drivers/mmc/host/sdhci-pltfm.h | 1 -
drivers/mmc/host/sdhci-pxav2.c | 1 -
drivers/mmc/host/sdhci-pxav3.c | 20 ++++++++-----------
drivers/mmc/host/sdhci-st.c | 40 +++++++++++++++++++-------------------
drivers/mmc/host/sdhci-tegra.c | 21 +++++++-------------
11 files changed, 106 insertions(+), 139 deletions(-)
--
2.7.0
[toc] | [next] | [standalone]
| From | Jisheng Zhang <jszhang@marvell.com> |
|---|---|
| Date | 2016-02-16 14:20 +0100 |
| Subject | [PATCH v5 06/13] mmc: sdhci-of-arasan: use sdhci_pltfm_init for private allocation |
| Message-ID | <r2NHR-8jx-35@gated-at.bofh.it> |
| In reply to | #1335371 |
Commit 0e748234293f ("mmc: sdhci: Add size for caller in init+register")
allows users of sdhci_pltfm to allocate private space in calls to
sdhci_pltfm_init+sdhci_pltfm_register. This patch migrates the
sdhci-of-arasan driver to this allocation.
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/mmc/host/sdhci-of-arasan.c | 28 ++++++++++++----------------
1 file changed, 12 insertions(+), 16 deletions(-)
diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
index 8b4f8f7..1e4b5e0 100644
--- a/drivers/mmc/host/sdhci-of-arasan.c
+++ b/drivers/mmc/host/sdhci-of-arasan.c
@@ -81,7 +81,7 @@ static int sdhci_arasan_suspend(struct device *dev)
struct platform_device *pdev = to_platform_device(dev);
struct sdhci_host *host = platform_get_drvdata(pdev);
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
- struct sdhci_arasan_data *sdhci_arasan = pltfm_host->priv;
+ struct sdhci_arasan_data *sdhci_arasan = sdhci_pltfm_priv(pltfm_host);
int ret;
ret = sdhci_suspend_host(host);
@@ -106,7 +106,7 @@ static int sdhci_arasan_resume(struct device *dev)
struct platform_device *pdev = to_platform_device(dev);
struct sdhci_host *host = platform_get_drvdata(pdev);
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
- struct sdhci_arasan_data *sdhci_arasan = pltfm_host->priv;
+ struct sdhci_arasan_data *sdhci_arasan = sdhci_pltfm_priv(pltfm_host);
int ret;
ret = clk_enable(sdhci_arasan->clk_ahb);
@@ -137,10 +137,13 @@ static int sdhci_arasan_probe(struct platform_device *pdev)
struct sdhci_pltfm_host *pltfm_host;
struct sdhci_arasan_data *sdhci_arasan;
- sdhci_arasan = devm_kzalloc(&pdev->dev, sizeof(*sdhci_arasan),
- GFP_KERNEL);
- if (!sdhci_arasan)
- return -ENOMEM;
+ host = sdhci_pltfm_init(pdev, &sdhci_arasan_pdata,
+ sizeof(*sdhci_arasan));
+ if (IS_ERR(host))
+ return PTR_ERR(host);
+
+ pltfm_host = sdhci_priv(host);
+ sdhci_arasan = sdhci_pltfm_priv(pltfm_host);
sdhci_arasan->clk_ahb = devm_clk_get(&pdev->dev, "clk_ahb");
if (IS_ERR(sdhci_arasan->clk_ahb)) {
@@ -166,15 +169,7 @@ static int sdhci_arasan_probe(struct platform_device *pdev)
goto clk_dis_ahb;
}
- host = sdhci_pltfm_init(pdev, &sdhci_arasan_pdata, 0);
- if (IS_ERR(host)) {
- ret = PTR_ERR(host);
- goto clk_disable_all;
- }
-
sdhci_get_of_property(pdev);
- pltfm_host = sdhci_priv(host);
- pltfm_host->priv = sdhci_arasan;
pltfm_host->clk = clk_xin;
ret = mmc_of_parse(host->mmc);
@@ -204,11 +199,12 @@ static int sdhci_arasan_remove(struct platform_device *pdev)
int ret;
struct sdhci_host *host = platform_get_drvdata(pdev);
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
- struct sdhci_arasan_data *sdhci_arasan = pltfm_host->priv;
+ struct sdhci_arasan_data *sdhci_arasan = sdhci_pltfm_priv(pltfm_host);
+ struct clk *clk_ahb = sdhci_arasan->clk_ahb;
ret = sdhci_pltfm_unregister(pdev);
- clk_disable_unprepare(sdhci_arasan->clk_ahb);
+ clk_disable_unprepare(clk_ahb);
return ret;
}
--
2.7.0
[toc] | [prev] | [next] | [standalone]
| From | Jisheng Zhang <jszhang@marvell.com> |
|---|---|
| Date | 2016-02-16 14:20 +0100 |
| Subject | [PATCH v5 07/13] mmc: sdhci-of-at91: use sdhci_pltfm_init for private allocation |
| Message-ID | <r2NHR-8jx-43@gated-at.bofh.it> |
| In reply to | #1335371 |
Commit 0e748234293f ("mmc: sdhci: Add size for caller in init+register")
allows users of sdhci_pltfm to allocate private space in calls to
sdhci_pltfm_init+sdhci_pltfm_register. This patch migrates the
sdhci-of-at91 driver to this allocation.
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/mmc/host/sdhci-of-at91.c | 33 +++++++++++++++------------------
1 file changed, 15 insertions(+), 18 deletions(-)
diff --git a/drivers/mmc/host/sdhci-of-at91.c b/drivers/mmc/host/sdhci-of-at91.c
index 9cb86fb..35c02fc 100644
--- a/drivers/mmc/host/sdhci-of-at91.c
+++ b/drivers/mmc/host/sdhci-of-at91.c
@@ -58,7 +58,7 @@ static int sdhci_at91_runtime_suspend(struct device *dev)
{
struct sdhci_host *host = dev_get_drvdata(dev);
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
- struct sdhci_at91_priv *priv = pltfm_host->priv;
+ struct sdhci_at91_priv *priv = sdhci_pltfm_priv(pltfm_host);
int ret;
ret = sdhci_runtime_suspend_host(host);
@@ -74,7 +74,7 @@ static int sdhci_at91_runtime_resume(struct device *dev)
{
struct sdhci_host *host = dev_get_drvdata(dev);
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
- struct sdhci_at91_priv *priv = pltfm_host->priv;
+ struct sdhci_at91_priv *priv = sdhci_pltfm_priv(pltfm_host);
int ret;
ret = clk_prepare_enable(priv->mainck);
@@ -124,11 +124,12 @@ static int sdhci_at91_probe(struct platform_device *pdev)
return -EINVAL;
soc_data = match->data;
- priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
- if (!priv) {
- dev_err(&pdev->dev, "unable to allocate private data\n");
- return -ENOMEM;
- }
+ host = sdhci_pltfm_init(pdev, soc_data, sizeof(*priv));
+ if (IS_ERR(host))
+ return PTR_ERR(host);
+
+ pltfm_host = sdhci_priv(host);
+ priv = sdhci_pltfm_priv(pltfm_host);
priv->mainck = devm_clk_get(&pdev->dev, "baseclk");
if (IS_ERR(priv->mainck)) {
@@ -148,10 +149,6 @@ static int sdhci_at91_probe(struct platform_device *pdev)
return PTR_ERR(priv->gck);
}
- host = sdhci_pltfm_init(pdev, soc_data, 0);
- if (IS_ERR(host))
- return PTR_ERR(host);
-
/*
* The mult clock is provided by as a generated clock by the PMC
* controller. In order to set the rate of gck, we have to get the
@@ -191,9 +188,6 @@ static int sdhci_at91_probe(struct platform_device *pdev)
clk_prepare_enable(priv->mainck);
clk_prepare_enable(priv->gck);
- pltfm_host = sdhci_priv(host);
- pltfm_host->priv = priv;
-
ret = mmc_of_parse(host->mmc);
if (ret)
goto clocks_disable_unprepare;
@@ -231,7 +225,10 @@ static int sdhci_at91_remove(struct platform_device *pdev)
{
struct sdhci_host *host = platform_get_drvdata(pdev);
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
- struct sdhci_at91_priv *priv = pltfm_host->priv;
+ struct sdhci_at91_priv *priv = sdhci_pltfm_priv(pltfm_host);
+ struct clk *gck = priv->gck;
+ struct clk *hclock = priv->hclock;
+ struct clk *mainck = priv->mainck;
pm_runtime_get_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
@@ -239,9 +236,9 @@ static int sdhci_at91_remove(struct platform_device *pdev)
sdhci_pltfm_unregister(pdev);
- clk_disable_unprepare(priv->gck);
- clk_disable_unprepare(priv->hclock);
- clk_disable_unprepare(priv->mainck);
+ clk_disable_unprepare(gck);
+ clk_disable_unprepare(hclock);
+ clk_disable_unprepare(mainck);
return 0;
}
--
2.7.0
[toc] | [prev] | [next] | [standalone]
| From | Jisheng Zhang <jszhang@marvell.com> |
|---|---|
| Date | 2016-02-16 14:20 +0100 |
| Subject | [PATCH v5 01/13] mmc: sdhci-bcm2835: use sdhci_pltfm_init for private allocation |
| Message-ID | <r2NHR-8jx-47@gated-at.bofh.it> |
| In reply to | #1335371 |
Commit 0e748234293f ("mmc: sdhci: Add size for caller in init+register")
allows users of sdhci_pltfm to allocate private space in calls to
sdhci_pltfm_init+sdhci_pltfm_register. This patch migrates sdhci-bcm2835
to this allocation.
Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/mmc/host/sdhci-bcm2835.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/drivers/mmc/host/sdhci-bcm2835.c b/drivers/mmc/host/sdhci-bcm2835.c
index 1c65d46..4a6a1d1 100644
--- a/drivers/mmc/host/sdhci-bcm2835.c
+++ b/drivers/mmc/host/sdhci-bcm2835.c
@@ -74,7 +74,7 @@ static inline u32 bcm2835_sdhci_readl(struct sdhci_host *host, int reg)
static void bcm2835_sdhci_writew(struct sdhci_host *host, u16 val, int reg)
{
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
- struct bcm2835_sdhci *bcm2835_host = pltfm_host->priv;
+ struct bcm2835_sdhci *bcm2835_host = sdhci_pltfm_priv(pltfm_host);
u32 oldval = (reg == SDHCI_COMMAND) ? bcm2835_host->shadow :
bcm2835_sdhci_readl(host, reg & ~3);
u32 word_num = (reg >> 1) & 1;
@@ -152,20 +152,12 @@ static int bcm2835_sdhci_probe(struct platform_device *pdev)
struct sdhci_pltfm_host *pltfm_host;
int ret;
- host = sdhci_pltfm_init(pdev, &bcm2835_sdhci_pdata, 0);
+ host = sdhci_pltfm_init(pdev, &bcm2835_sdhci_pdata,
+ sizeof(*bcm2835_host));
if (IS_ERR(host))
return PTR_ERR(host);
- bcm2835_host = devm_kzalloc(&pdev->dev, sizeof(*bcm2835_host),
- GFP_KERNEL);
- if (!bcm2835_host) {
- dev_err(mmc_dev(host->mmc),
- "failed to allocate bcm2835_sdhci\n");
- return -ENOMEM;
- }
-
pltfm_host = sdhci_priv(host);
- pltfm_host->priv = bcm2835_host;
pltfm_host->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(pltfm_host->clk)) {
--
2.7.0
[toc] | [prev] | [next] | [standalone]
| From | Eric Anholt <eric@anholt.net> |
|---|---|
| Date | 2016-02-16 19:20 +0100 |
| Subject | Re: [PATCH v5 01/13] mmc: sdhci-bcm2835: use sdhci_pltfm_init for private allocation |
| Message-ID | <r2Soa-31B-13@gated-at.bofh.it> |
| In reply to | #1335376 |
[Multipart message — attachments visible in raw view] — view raw
Jisheng Zhang <jszhang@marvell.com> writes:
> Commit 0e748234293f ("mmc: sdhci: Add size for caller in init+register")
> allows users of sdhci_pltfm to allocate private space in calls to
> sdhci_pltfm_init+sdhci_pltfm_register. This patch migrates sdhci-bcm2835
> to this allocation.
>
> Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Eric Anholt <eric@anholt.net>
[toc] | [prev] | [next] | [standalone]
| From | Ulf Hansson <ulf.hansson@linaro.org> |
|---|---|
| Date | 2016-02-18 13:50 +0100 |
| Subject | Re: [PATCH v5 00/13] mmc: use sdhci_pltfm_init for private allocation and clean up |
| Message-ID | <r3wbU-5xP-15@gated-at.bofh.it> |
| In reply to | #1335371 |
On 16 February 2016 at 14:08, Jisheng Zhang <jszhang@marvell.com> wrote:
> These patches are to complete the TODOs in Commit 0e748234293f ("mmc:
> sdhci: Add size for caller in init+register"), I.E:
>
> - todo: migrate clients to using allocation this way
> - todo: remove priv variable once migration is complete
>
> Since v4:
> - based on Ulf's latest next branch
> - add Adrian's Ack for all patches, add Thierry's Ack and Test for patch 11
> add Sören Ack for patch 5.
>
> Since v3:
> - based on v4.5-rc1
> - add Ludovic's ack for sdhci-of-at91 changes
> - fix use-after-free in some drivers: some host drivers still needs to
> access sdhci_pltfm_host->private after sdhci_pltfm_unregister(), but
> the private should be already freed by sdhci_pltfm_unregister.
> - add patch5 to fix one clk bug in sdhci_arasan_remove(). IMHO, It's
> better to add this patch to fixes rather than waiting for next merge
> window
>
> Since v2:
> - based on mmc next tree and remove all priv usage introduced in newly
> commits in this tree
> - don't break two lines if sdhci_pltfm_init() call could be put into
> one line. Thank Ludovic Desroches.
>
> Since v1:
> - add new patch03 to factorise sdhci_msm_pdata outisde of sdhci_msm_host.
> This is to fix drivers/mmc/host/sdhci-msm.c:440:32: warning: 'msm_host'
> is used uninitialized in this function [-Wuninitialized]
> - Add Arnd's Ack for all patches except patch3 which is new in v2
>
>
> Jisheng Zhang (13):
> mmc: sdhci-bcm2835: use sdhci_pltfm_init for private allocation
> mmc: sdhci-esdhc-imx: use sdhci_pltfm_init for private allocation
> mmc: sdhci-msm: factorise sdhci_msm_pdata outisde of sdhci_msm_host
> mmc: sdhci-msm: use sdhci_pltfm_init for private allocation
> mmc: sdhci-of-arasan: fix clk issue in sdhci_arasan_remove()
> mmc: sdhci-of-arasan: use sdhci_pltfm_init for private allocation
> mmc: sdhci-of-at91: use sdhci_pltfm_init for private allocation
> mmc: sdhci-of-esdhc: use sdhci_pltfm_init for private allocation
> mmc: sdhci-pxav3: use sdhci_pltfm_init for private allocation
> mmc: sdhci-st: use sdhci_pltfm_init for private allocation
> mmc: sdhci-tegra: use sdhci_pltfm_init for private allocation
> mmc: sdhci-pxav2: remove unnecessary assignment of pltfm_host->priv
> mmc: sdhci-pltfm: remove priv variable from sdhci_pltfm_host
>
> drivers/mmc/host/sdhci-bcm2835.c | 14 +++----------
> drivers/mmc/host/sdhci-esdhc-imx.c | 38 ++++++++++++++++--------------------
> drivers/mmc/host/sdhci-msm.c | 25 +++++++++++-------------
> drivers/mmc/host/sdhci-of-arasan.c | 33 +++++++++++++++----------------
> drivers/mmc/host/sdhci-of-at91.c | 33 ++++++++++++++-----------------
> drivers/mmc/host/sdhci-of-esdhc.c | 19 +++++++++---------
> drivers/mmc/host/sdhci-pltfm.h | 1 -
> drivers/mmc/host/sdhci-pxav2.c | 1 -
> drivers/mmc/host/sdhci-pxav3.c | 20 ++++++++-----------
> drivers/mmc/host/sdhci-st.c | 40 +++++++++++++++++++-------------------
> drivers/mmc/host/sdhci-tegra.c | 21 +++++++-------------
> 11 files changed, 106 insertions(+), 139 deletions(-)
>
> --
> 2.7.0
>
Thanks, applied for next!
Kind regards
Uffe
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web