All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] GPMI-NAND: Define ecc.strength
@ 2012-05-21  1:02 Marek Vasut
  2012-05-21  1:02 ` [PATCH 2/4] GPMI-NAND: Fixup compile issue Marek Vasut
                   ` (3 more replies)
  0 siblings, 4 replies; 43+ messages in thread
From: Marek Vasut @ 2012-05-21  1:02 UTC (permalink / raw)
  To: linux-arm-kernel

The ecc.strength wasn't set, resulting in the following crash:
[    2.550000] kernel BUG at drivers/mtd/nand/nand_base.c:3347!
[    2.550000] Internal error: Oops - BUG: 0 [#1] ARM
[    2.550000] Modules linked in:
[    2.550000] CPU: 0    Not tainted  (3.4.0-rc7-next-20120518-dirty #1211)
[    2.550000] PC is at nand_scan_tail+0x328/0x650
[    2.550000] LR is at nand_scan_tail+0x328/0x650
[    2.550000] pc : [<c020841c>]    lr : [<c020841c>]    psr: 20000013
[    2.550000] sp : c7443ea8  ip : c7448000  fp : c043dc70
[    2.550000] r10: 00000000  r9 : c059dd20  r8 : c7526300
[    2.550000] r7 : 00000001  r6 : c7479c08  r5 : c7526300  r4 : c7526098
[    2.550000] r3 : c7448000  r2 : 00000000  r1 : 00000001  r0 : 00000034
[    2.550000] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
[    2.550000] Control: 0005317f  Table: 40004000  DAC: 00000017
[    2.550000] Process swapper (pid: 1, stack limit = 0xc7442270)
[    2.550000] Stack: (0xc7443ea8 to 0xc7444000)
[    2.550000] 3ea0:                   c7526000 00000000 c7479c08 c02f68e0 c03d50ec c7526000
[    2.550000] 3ec0: c747c6e0 00000000 c0ae7720 00000004 00000000 00000000 c7479c08 c0ae7720
[    2.550000] 3ee0: c7479c3c c0593e20 c7572200 c01f6618 c01f6604 c01f55b0 c7479c08 c0593e20
[    2.550000] 3f00: c7479c3c c059dd20 c7572200 c01f57cc 00000000 c0593e20 c01f5738 c01f3d40
[    2.550000] 3f20: c74038a8 c74767d0 c0593e20 c04475ec c05901b8 c01f4e18 c03d50e0 c019d438
[    2.550000] 3f40: c7403800 c0593e20 c04475ec 00000000 c059dd20 c04475f8 c7442000 c01f5a70
[    2.550000] 3f60: 00000000 c044e98c c04475ec 00000000 c059dd20 c04475f8 c7442000 c043dc7c
[    2.550000] 3f80: c044e98c c0008824 c03d6c30 c040c4e4 00000006 00000006 c03b0ce4 c0bf54e0
[    2.550000] 3fa0: c044e98c c04475ec 00000006 c04475f8 0000004c c042a21c 00000000 c042a8b8
[    2.550000] 3fc0: 00000006 00000006 c042a21c 00000000 00000000 00000000 00000000 c042a7bc
[    2.550000] 3fe0: c000fab4 00000013 00000000 00000000 00000000 c000fab4 efbbfaa5 eaeafefe
[    2.550000] [<c020841c>] (nand_scan_tail+0x328/0x650) from [<c02f68e0>] (gpmi_nand_probe+0x43c/0x5a4)
[    2.550000] [<c02f68e0>] (gpmi_nand_probe+0x43c/0x5a4) from [<c01f6618>] (platform_drv_probe+0x14/0x18)
[    2.550000] [<c01f6618>] (platform_drv_probe+0x14/0x18) from [<c01f55b0>] (driver_probe_device+0x74/0x1fc)
[    2.550000] [<c01f55b0>] (driver_probe_device+0x74/0x1fc) from [<c01f57cc>] (__driver_attach+0x94/0x98)
[    2.550000] [<c01f57cc>] (__driver_attach+0x94/0x98) from [<c01f3d40>] (bus_for_each_dev+0x50/0x80)
[    2.550000] [<c01f3d40>] (bus_for_each_dev+0x50/0x80) from [<c01f4e18>] (bus_add_driver+0x188/0x25c)
[    2.550000] [<c01f4e18>] (bus_add_driver+0x188/0x25c) from [<c01f5a70>] (driver_register+0x78/0x138)
[    2.550000] [<c01f5a70>] (driver_register+0x78/0x138) from [<c043dc7c>] (gpmi_nand_init+0xc/0x30)
[    2.550000] [<c043dc7c>] (gpmi_nand_init+0xc/0x30) from [<c0008824>] (do_one_initcall+0x108/0x17c)
[    2.550000] [<c0008824>] (do_one_initcall+0x108/0x17c) from [<c042a8b8>] (kernel_init+0xfc/0x1bc)
[    2.550000] [<c042a8b8>] (kernel_init+0xfc/0x1bc) from [<c000fab4>] (kernel_thread_exit+0x0/0x8)
[    2.550000] Code: e3530000 1affff76 e59f02d0 eb03c16a (e7f001f2)
[    2.830000] ---[ end trace 3f05d4c0039432f1 ]---
[    2.840000] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Huang Shijie <b32955@freescale.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index 9b4c109..f5f3d761 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -1436,6 +1436,9 @@ static int gpmi_pre_bbt_scan(struct gpmi_nand_data  *this)
 	if (ret)
 		return ret;
 
+	/* Adjust the ECC strength according to the chip. */
+	this->nand.ecc.strength = this->bch_geometry.ecc_strength;
+
 	/* NAND boot init, depends on the gpmi_set_geometry(). */
 	return nand_boot_init(this);
 }
@@ -1494,6 +1497,7 @@ static int __devinit gpmi_nfc_init(struct gpmi_nand_data *this)
 	chip->options		|= NAND_NO_SUBPAGE_WRITE;
 	chip->ecc.mode		= NAND_ECC_HW;
 	chip->ecc.size		= 1;
+	chip->ecc.strength	= 8;
 	chip->ecc.layout	= &gpmi_hw_ecclayout;
 
 	/* Allocate a temporary DMA buffer for reading ID in the nand_scan() */
-- 
1.7.10

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

* [PATCH 2/4] GPMI-NAND: Fixup compile issue
  2012-05-21  1:02 [PATCH 1/4] GPMI-NAND: Define ecc.strength Marek Vasut
@ 2012-05-21  1:02 ` Marek Vasut
  2012-05-21  1:16   ` Shawn Guo
  2012-05-21  1:02 ` [PATCH 3/4] MXS-MMC: Move of_match_table out of CONFIG_PM Marek Vasut
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 43+ messages in thread
From: Marek Vasut @ 2012-05-21  1:02 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Huang Shijie <b32955@freescale.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
index f5f3d761..33111a9 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
@@ -486,7 +486,7 @@ static int __devinit acquire_resources(struct gpmi_nand_data *this)
 	if (ret)
 		goto exit_dma_channels;
 
-	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+	pinctrl = devm_pinctrl_get_select_default(&this->pdev->dev);
 	if (IS_ERR(pinctrl)) {
 		ret = PTR_ERR(pinctrl);
 		goto exit_pin;
-- 
1.7.10

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

* [PATCH 3/4] MXS-MMC: Move of_match_table out of CONFIG_PM
  2012-05-21  1:02 [PATCH 1/4] GPMI-NAND: Define ecc.strength Marek Vasut
  2012-05-21  1:02 ` [PATCH 2/4] GPMI-NAND: Fixup compile issue Marek Vasut
@ 2012-05-21  1:02 ` Marek Vasut
  2012-05-21  4:09     ` Shawn Guo
  2012-05-21  1:02 ` [PATCH 4/4] MXS-MMC: Add wp-inverted property Marek Vasut
  2012-05-21  1:14   ` Shawn Guo
  3 siblings, 1 reply; 43+ messages in thread
From: Marek Vasut @ 2012-05-21  1:02 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/mmc/host/mxs-mmc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 34a9026..277161d 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -894,8 +894,8 @@ static struct platform_driver mxs_mmc_driver = {
 		.owner	= THIS_MODULE,
 #ifdef CONFIG_PM
 		.pm	= &mxs_mmc_pm_ops,
-		.of_match_table = mxs_mmc_dt_ids,
 #endif
+		.of_match_table = mxs_mmc_dt_ids,
 	},
 };
 
-- 
1.7.10

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

* [PATCH 4/4] MXS-MMC: Add wp-inverted property
  2012-05-21  1:02 [PATCH 1/4] GPMI-NAND: Define ecc.strength Marek Vasut
  2012-05-21  1:02 ` [PATCH 2/4] GPMI-NAND: Fixup compile issue Marek Vasut
  2012-05-21  1:02 ` [PATCH 3/4] MXS-MMC: Move of_match_table out of CONFIG_PM Marek Vasut
@ 2012-05-21  1:02 ` Marek Vasut
  2012-05-21  1:39     ` Shawn Guo
  2012-05-21  7:22   ` Lothar Waßmann
  2012-05-21  1:14   ` Shawn Guo
  3 siblings, 2 replies; 43+ messages in thread
From: Marek Vasut @ 2012-05-21  1:02 UTC (permalink / raw)
  To: linux-arm-kernel

The write-protect GPIO is inverted on some boards. Handle such case.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
---
 Documentation/devicetree/bindings/mmc/mxs-mmc.txt |    1 +
 drivers/mmc/host/mxs-mmc.c                        |   11 ++++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mmc/mxs-mmc.txt b/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
index 14d870a..0a7d2cd 100644
--- a/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
+++ b/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
@@ -13,6 +13,7 @@ Required properties:
 
 Optional properties:
 - wp-gpios: Specify GPIOs for write protection
+- wp-inverted: Set if the write protection GPIO is inverted
 
 Examples:
 
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 277161d..119beb9 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -164,16 +164,23 @@ struct mxs_mmc_host {
 	spinlock_t			lock;
 	int				sdio_irq_en;
 	int				wp_gpio;
+	int				wp_inverted:1;
 };
 
 static int mxs_mmc_get_ro(struct mmc_host *mmc)
 {
 	struct mxs_mmc_host *host = mmc_priv(mmc);
+	int ret;
 
 	if (!gpio_is_valid(host->wp_gpio))
 		return -EINVAL;
 
-	return gpio_get_value(host->wp_gpio);
+	ret = gpio_get_value(host->wp_gpio);
+
+	if (host->wp_inverted)
+		ret = !ret;
+
+	return ret;
 }
 
 static int mxs_mmc_get_cd(struct mmc_host *mmc)
@@ -786,6 +793,8 @@ static int mxs_mmc_probe(struct platform_device *pdev)
 		else if (bus_width == 8)
 			mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
 		host->wp_gpio = of_get_named_gpio(np, "wp-gpios", 0);
+		if (of_find_property(np, "wp-inverted", NULL))
+			host->wp_inverted = 1;
 	} else {
 		if (pdata->flags & SLOTF_8_BIT_CAPABLE)
 			mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
-- 
1.7.10

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

* Re: [PATCH 1/4] GPMI-NAND: Define ecc.strength
  2012-05-21  1:02 [PATCH 1/4] GPMI-NAND: Define ecc.strength Marek Vasut
@ 2012-05-21  1:14   ` Shawn Guo
  2012-05-21  1:02 ` [PATCH 3/4] MXS-MMC: Move of_match_table out of CONFIG_PM Marek Vasut
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 43+ messages in thread
From: Shawn Guo @ 2012-05-21  1:14 UTC (permalink / raw)
  To: Marek Vasut
  Cc: Fabio Estevam, Huang Shijie, linux-mtd, linux-arm-kernel,
	Artem Bityutskiy

So non-DT probe has the same issue?  Or this is a DT probe only issue?

Copy linux-mtd list and Artem Bityutskiy on this.

-- 
Regards,
Shawn

On Mon, May 21, 2012 at 03:02:17AM +0200, Marek Vasut wrote:
> The ecc.strength wasn't set, resulting in the following crash:
> [    2.550000] kernel BUG at drivers/mtd/nand/nand_base.c:3347!
> [    2.550000] Internal error: Oops - BUG: 0 [#1] ARM
> [    2.550000] Modules linked in:
> [    2.550000] CPU: 0    Not tainted  (3.4.0-rc7-next-20120518-dirty #1211)
> [    2.550000] PC is at nand_scan_tail+0x328/0x650
> [    2.550000] LR is at nand_scan_tail+0x328/0x650
> [    2.550000] pc : [<c020841c>]    lr : [<c020841c>]    psr: 20000013
> [    2.550000] sp : c7443ea8  ip : c7448000  fp : c043dc70
> [    2.550000] r10: 00000000  r9 : c059dd20  r8 : c7526300
> [    2.550000] r7 : 00000001  r6 : c7479c08  r5 : c7526300  r4 : c7526098
> [    2.550000] r3 : c7448000  r2 : 00000000  r1 : 00000001  r0 : 00000034
> [    2.550000] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
> [    2.550000] Control: 0005317f  Table: 40004000  DAC: 00000017
> [    2.550000] Process swapper (pid: 1, stack limit = 0xc7442270)
> [    2.550000] Stack: (0xc7443ea8 to 0xc7444000)
> [    2.550000] 3ea0:                   c7526000 00000000 c7479c08 c02f68e0 c03d50ec c7526000
> [    2.550000] 3ec0: c747c6e0 00000000 c0ae7720 00000004 00000000 00000000 c7479c08 c0ae7720
> [    2.550000] 3ee0: c7479c3c c0593e20 c7572200 c01f6618 c01f6604 c01f55b0 c7479c08 c0593e20
> [    2.550000] 3f00: c7479c3c c059dd20 c7572200 c01f57cc 00000000 c0593e20 c01f5738 c01f3d40
> [    2.550000] 3f20: c74038a8 c74767d0 c0593e20 c04475ec c05901b8 c01f4e18 c03d50e0 c019d438
> [    2.550000] 3f40: c7403800 c0593e20 c04475ec 00000000 c059dd20 c04475f8 c7442000 c01f5a70
> [    2.550000] 3f60: 00000000 c044e98c c04475ec 00000000 c059dd20 c04475f8 c7442000 c043dc7c
> [    2.550000] 3f80: c044e98c c0008824 c03d6c30 c040c4e4 00000006 00000006 c03b0ce4 c0bf54e0
> [    2.550000] 3fa0: c044e98c c04475ec 00000006 c04475f8 0000004c c042a21c 00000000 c042a8b8
> [    2.550000] 3fc0: 00000006 00000006 c042a21c 00000000 00000000 00000000 00000000 c042a7bc
> [    2.550000] 3fe0: c000fab4 00000013 00000000 00000000 00000000 c000fab4 efbbfaa5 eaeafefe
> [    2.550000] [<c020841c>] (nand_scan_tail+0x328/0x650) from [<c02f68e0>] (gpmi_nand_probe+0x43c/0x5a4)
> [    2.550000] [<c02f68e0>] (gpmi_nand_probe+0x43c/0x5a4) from [<c01f6618>] (platform_drv_probe+0x14/0x18)
> [    2.550000] [<c01f6618>] (platform_drv_probe+0x14/0x18) from [<c01f55b0>] (driver_probe_device+0x74/0x1fc)
> [    2.550000] [<c01f55b0>] (driver_probe_device+0x74/0x1fc) from [<c01f57cc>] (__driver_attach+0x94/0x98)
> [    2.550000] [<c01f57cc>] (__driver_attach+0x94/0x98) from [<c01f3d40>] (bus_for_each_dev+0x50/0x80)
> [    2.550000] [<c01f3d40>] (bus_for_each_dev+0x50/0x80) from [<c01f4e18>] (bus_add_driver+0x188/0x25c)
> [    2.550000] [<c01f4e18>] (bus_add_driver+0x188/0x25c) from [<c01f5a70>] (driver_register+0x78/0x138)
> [    2.550000] [<c01f5a70>] (driver_register+0x78/0x138) from [<c043dc7c>] (gpmi_nand_init+0xc/0x30)
> [    2.550000] [<c043dc7c>] (gpmi_nand_init+0xc/0x30) from [<c0008824>] (do_one_initcall+0x108/0x17c)
> [    2.550000] [<c0008824>] (do_one_initcall+0x108/0x17c) from [<c042a8b8>] (kernel_init+0xfc/0x1bc)
> [    2.550000] [<c042a8b8>] (kernel_init+0xfc/0x1bc) from [<c000fab4>] (kernel_thread_exit+0x0/0x8)
> [    2.550000] Code: e3530000 1affff76 e59f02d0 eb03c16a (e7f001f2)
> [    2.830000] ---[ end trace 3f05d4c0039432f1 ]---
> [    2.840000] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Huang Shijie <b32955@freescale.com>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Cc: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> index 9b4c109..f5f3d761 100644
> --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> @@ -1436,6 +1436,9 @@ static int gpmi_pre_bbt_scan(struct gpmi_nand_data  *this)
>  	if (ret)
>  		return ret;
>  
> +	/* Adjust the ECC strength according to the chip. */
> +	this->nand.ecc.strength = this->bch_geometry.ecc_strength;
> +
>  	/* NAND boot init, depends on the gpmi_set_geometry(). */
>  	return nand_boot_init(this);
>  }
> @@ -1494,6 +1497,7 @@ static int __devinit gpmi_nfc_init(struct gpmi_nand_data *this)
>  	chip->options		|= NAND_NO_SUBPAGE_WRITE;
>  	chip->ecc.mode		= NAND_ECC_HW;
>  	chip->ecc.size		= 1;
> +	chip->ecc.strength	= 8;
>  	chip->ecc.layout	= &gpmi_hw_ecclayout;
>  
>  	/* Allocate a temporary DMA buffer for reading ID in the nand_scan() */
> -- 
> 1.7.10
> 

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

* [PATCH 1/4] GPMI-NAND: Define ecc.strength
@ 2012-05-21  1:14   ` Shawn Guo
  0 siblings, 0 replies; 43+ messages in thread
From: Shawn Guo @ 2012-05-21  1:14 UTC (permalink / raw)
  To: linux-arm-kernel

So non-DT probe has the same issue?  Or this is a DT probe only issue?

Copy linux-mtd list and Artem Bityutskiy on this.

-- 
Regards,
Shawn

On Mon, May 21, 2012 at 03:02:17AM +0200, Marek Vasut wrote:
> The ecc.strength wasn't set, resulting in the following crash:
> [    2.550000] kernel BUG at drivers/mtd/nand/nand_base.c:3347!
> [    2.550000] Internal error: Oops - BUG: 0 [#1] ARM
> [    2.550000] Modules linked in:
> [    2.550000] CPU: 0    Not tainted  (3.4.0-rc7-next-20120518-dirty #1211)
> [    2.550000] PC is at nand_scan_tail+0x328/0x650
> [    2.550000] LR is at nand_scan_tail+0x328/0x650
> [    2.550000] pc : [<c020841c>]    lr : [<c020841c>]    psr: 20000013
> [    2.550000] sp : c7443ea8  ip : c7448000  fp : c043dc70
> [    2.550000] r10: 00000000  r9 : c059dd20  r8 : c7526300
> [    2.550000] r7 : 00000001  r6 : c7479c08  r5 : c7526300  r4 : c7526098
> [    2.550000] r3 : c7448000  r2 : 00000000  r1 : 00000001  r0 : 00000034
> [    2.550000] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
> [    2.550000] Control: 0005317f  Table: 40004000  DAC: 00000017
> [    2.550000] Process swapper (pid: 1, stack limit = 0xc7442270)
> [    2.550000] Stack: (0xc7443ea8 to 0xc7444000)
> [    2.550000] 3ea0:                   c7526000 00000000 c7479c08 c02f68e0 c03d50ec c7526000
> [    2.550000] 3ec0: c747c6e0 00000000 c0ae7720 00000004 00000000 00000000 c7479c08 c0ae7720
> [    2.550000] 3ee0: c7479c3c c0593e20 c7572200 c01f6618 c01f6604 c01f55b0 c7479c08 c0593e20
> [    2.550000] 3f00: c7479c3c c059dd20 c7572200 c01f57cc 00000000 c0593e20 c01f5738 c01f3d40
> [    2.550000] 3f20: c74038a8 c74767d0 c0593e20 c04475ec c05901b8 c01f4e18 c03d50e0 c019d438
> [    2.550000] 3f40: c7403800 c0593e20 c04475ec 00000000 c059dd20 c04475f8 c7442000 c01f5a70
> [    2.550000] 3f60: 00000000 c044e98c c04475ec 00000000 c059dd20 c04475f8 c7442000 c043dc7c
> [    2.550000] 3f80: c044e98c c0008824 c03d6c30 c040c4e4 00000006 00000006 c03b0ce4 c0bf54e0
> [    2.550000] 3fa0: c044e98c c04475ec 00000006 c04475f8 0000004c c042a21c 00000000 c042a8b8
> [    2.550000] 3fc0: 00000006 00000006 c042a21c 00000000 00000000 00000000 00000000 c042a7bc
> [    2.550000] 3fe0: c000fab4 00000013 00000000 00000000 00000000 c000fab4 efbbfaa5 eaeafefe
> [    2.550000] [<c020841c>] (nand_scan_tail+0x328/0x650) from [<c02f68e0>] (gpmi_nand_probe+0x43c/0x5a4)
> [    2.550000] [<c02f68e0>] (gpmi_nand_probe+0x43c/0x5a4) from [<c01f6618>] (platform_drv_probe+0x14/0x18)
> [    2.550000] [<c01f6618>] (platform_drv_probe+0x14/0x18) from [<c01f55b0>] (driver_probe_device+0x74/0x1fc)
> [    2.550000] [<c01f55b0>] (driver_probe_device+0x74/0x1fc) from [<c01f57cc>] (__driver_attach+0x94/0x98)
> [    2.550000] [<c01f57cc>] (__driver_attach+0x94/0x98) from [<c01f3d40>] (bus_for_each_dev+0x50/0x80)
> [    2.550000] [<c01f3d40>] (bus_for_each_dev+0x50/0x80) from [<c01f4e18>] (bus_add_driver+0x188/0x25c)
> [    2.550000] [<c01f4e18>] (bus_add_driver+0x188/0x25c) from [<c01f5a70>] (driver_register+0x78/0x138)
> [    2.550000] [<c01f5a70>] (driver_register+0x78/0x138) from [<c043dc7c>] (gpmi_nand_init+0xc/0x30)
> [    2.550000] [<c043dc7c>] (gpmi_nand_init+0xc/0x30) from [<c0008824>] (do_one_initcall+0x108/0x17c)
> [    2.550000] [<c0008824>] (do_one_initcall+0x108/0x17c) from [<c042a8b8>] (kernel_init+0xfc/0x1bc)
> [    2.550000] [<c042a8b8>] (kernel_init+0xfc/0x1bc) from [<c000fab4>] (kernel_thread_exit+0x0/0x8)
> [    2.550000] Code: e3530000 1affff76 e59f02d0 eb03c16a (e7f001f2)
> [    2.830000] ---[ end trace 3f05d4c0039432f1 ]---
> [    2.840000] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Huang Shijie <b32955@freescale.com>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Cc: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> index 9b4c109..f5f3d761 100644
> --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> @@ -1436,6 +1436,9 @@ static int gpmi_pre_bbt_scan(struct gpmi_nand_data  *this)
>  	if (ret)
>  		return ret;
>  
> +	/* Adjust the ECC strength according to the chip. */
> +	this->nand.ecc.strength = this->bch_geometry.ecc_strength;
> +
>  	/* NAND boot init, depends on the gpmi_set_geometry(). */
>  	return nand_boot_init(this);
>  }
> @@ -1494,6 +1497,7 @@ static int __devinit gpmi_nfc_init(struct gpmi_nand_data *this)
>  	chip->options		|= NAND_NO_SUBPAGE_WRITE;
>  	chip->ecc.mode		= NAND_ECC_HW;
>  	chip->ecc.size		= 1;
> +	chip->ecc.strength	= 8;
>  	chip->ecc.layout	= &gpmi_hw_ecclayout;
>  
>  	/* Allocate a temporary DMA buffer for reading ID in the nand_scan() */
> -- 
> 1.7.10
> 

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

* [PATCH 2/4] GPMI-NAND: Fixup compile issue
  2012-05-21  1:02 ` [PATCH 2/4] GPMI-NAND: Fixup compile issue Marek Vasut
@ 2012-05-21  1:16   ` Shawn Guo
  0 siblings, 0 replies; 43+ messages in thread
From: Shawn Guo @ 2012-05-21  1:16 UTC (permalink / raw)
  To: linux-arm-kernel

This one has been fixed on arm-soc.

Regards,
Shawn

On Mon, May 21, 2012 at 03:02:18AM +0200, Marek Vasut wrote:
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Huang Shijie <b32955@freescale.com>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Cc: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> index f5f3d761..33111a9 100644
> --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> @@ -486,7 +486,7 @@ static int __devinit acquire_resources(struct gpmi_nand_data *this)
>  	if (ret)
>  		goto exit_dma_channels;
>  
> -	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
> +	pinctrl = devm_pinctrl_get_select_default(&this->pdev->dev);
>  	if (IS_ERR(pinctrl)) {
>  		ret = PTR_ERR(pinctrl);
>  		goto exit_pin;
> -- 
> 1.7.10
> 

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

* Re: [PATCH 1/4] GPMI-NAND: Define ecc.strength
  2012-05-21  1:14   ` Shawn Guo
@ 2012-05-21  1:36     ` Marek Vasut
  -1 siblings, 0 replies; 43+ messages in thread
From: Marek Vasut @ 2012-05-21  1:36 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Fabio Estevam, Huang Shijie, linux-mtd, linux-arm-kernel,
	Artem Bityutskiy

Dear Shawn Guo,

> So non-DT probe has the same issue?  Or this is a DT probe only issue?

I started using DT, so I'm now fixing everything to work like it used to. Damn 
this DT conversion broke about everything.

> 
> Copy linux-mtd list and Artem Bityutskiy on this.
> 
> > The ecc.strength wasn't set, resulting in the following crash:
> > [    2.550000] kernel BUG at drivers/mtd/nand/nand_base.c:3347!
> > [    2.550000] Internal error: Oops - BUG: 0 [#1] ARM
> > [    2.550000] Modules linked in:
> > [    2.550000] CPU: 0    Not tainted  (3.4.0-rc7-next-20120518-dirty
> > #1211) [    2.550000] PC is at nand_scan_tail+0x328/0x650
> > [    2.550000] LR is at nand_scan_tail+0x328/0x650
> > [    2.550000] pc : [<c020841c>]    lr : [<c020841c>]    psr: 20000013
> > [    2.550000] sp : c7443ea8  ip : c7448000  fp : c043dc70
> > [    2.550000] r10: 00000000  r9 : c059dd20  r8 : c7526300
> > [    2.550000] r7 : 00000001  r6 : c7479c08  r5 : c7526300  r4 : c7526098
> > [    2.550000] r3 : c7448000  r2 : 00000000  r1 : 00000001  r0 : 00000034
> > [    2.550000] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM 
> > Segment kernel [    2.550000] Control: 0005317f  Table: 40004000  DAC:
> > 00000017 [    2.550000] Process swapper (pid: 1, stack limit =
> > 0xc7442270) [    2.550000] Stack: (0xc7443ea8 to 0xc7444000)
> > [    2.550000] 3ea0:                   c7526000 00000000 c7479c08
> > c02f68e0 c03d50ec c7526000 [    2.550000] 3ec0: c747c6e0 00000000
> > c0ae7720 00000004 00000000 00000000 c7479c08 c0ae7720 [    2.550000]
> > 3ee0: c7479c3c c0593e20 c7572200 c01f6618 c01f6604 c01f55b0 c7479c08
> > c0593e20 [    2.550000] 3f00: c7479c3c c059dd20 c7572200 c01f57cc
> > 00000000 c0593e20 c01f5738 c01f3d40 [    2.550000] 3f20: c74038a8
> > c74767d0 c0593e20 c04475ec c05901b8 c01f4e18 c03d50e0 c019d438 [   
> > 2.550000] 3f40: c7403800 c0593e20 c04475ec 00000000 c059dd20 c04475f8
> > c7442000 c01f5a70 [    2.550000] 3f60: 00000000 c044e98c c04475ec
> > 00000000 c059dd20 c04475f8 c7442000 c043dc7c [    2.550000] 3f80:
> > c044e98c c0008824 c03d6c30 c040c4e4 00000006 00000006 c03b0ce4 c0bf54e0
> > [    2.550000] 3fa0: c044e98c c04475ec 00000006 c04475f8 0000004c
> > c042a21c 00000000 c042a8b8 [    2.550000] 3fc0: 00000006 00000006
> > c042a21c 00000000 00000000 00000000 00000000 c042a7bc [    2.550000]
> > 3fe0: c000fab4 00000013 00000000 00000000 00000000 c000fab4 efbbfaa5
> > eaeafefe [    2.550000] [<c020841c>] (nand_scan_tail+0x328/0x650) from
> > [<c02f68e0>] (gpmi_nand_probe+0x43c/0x5a4) [    2.550000] [<c02f68e0>]
> > (gpmi_nand_probe+0x43c/0x5a4) from [<c01f6618>]
> > (platform_drv_probe+0x14/0x18) [    2.550000] [<c01f6618>]
> > (platform_drv_probe+0x14/0x18) from [<c01f55b0>]
> > (driver_probe_device+0x74/0x1fc) [    2.550000] [<c01f55b0>]
> > (driver_probe_device+0x74/0x1fc) from [<c01f57cc>]
> > (__driver_attach+0x94/0x98) [    2.550000] [<c01f57cc>]
> > (__driver_attach+0x94/0x98) from [<c01f3d40>]
> > (bus_for_each_dev+0x50/0x80) [    2.550000] [<c01f3d40>]
> > (bus_for_each_dev+0x50/0x80) from [<c01f4e18>]
> > (bus_add_driver+0x188/0x25c) [    2.550000] [<c01f4e18>]
> > (bus_add_driver+0x188/0x25c) from [<c01f5a70>]
> > (driver_register+0x78/0x138) [    2.550000] [<c01f5a70>]
> > (driver_register+0x78/0x138) from [<c043dc7c>] (gpmi_nand_init+0xc/0x30)
> > [    2.550000] [<c043dc7c>] (gpmi_nand_init+0xc/0x30) from [<c0008824>]
> > (do_one_initcall+0x108/0x17c) [    2.550000] [<c0008824>]
> > (do_one_initcall+0x108/0x17c) from [<c042a8b8>] (kernel_init+0xfc/0x1bc)
> > [    2.550000] [<c042a8b8>] (kernel_init+0xfc/0x1bc) from [<c000fab4>]
> > (kernel_thread_exit+0x0/0x8) [    2.550000] Code: e3530000 1affff76
> > e59f02d0 eb03c16a (e7f001f2) [    2.830000] ---[ end trace
> > 3f05d4c0039432f1 ]---
> > [    2.840000] Kernel panic - not syncing: Attempted to kill init!
> > exitcode=0x0000000b
> > 
> > Signed-off-by: Marek Vasut <marex@denx.de>
> > Cc: Huang Shijie <b32955@freescale.com>
> > Cc: Shawn Guo <shawn.guo@linaro.org>
> > Cc: Fabio Estevam <fabio.estevam@freescale.com>
> > ---
> > 
> >  drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> > b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c index 9b4c109..f5f3d761 100644
> > --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> > +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> > @@ -1436,6 +1436,9 @@ static int gpmi_pre_bbt_scan(struct gpmi_nand_data 
> > *this)
> > 
> >  	if (ret)
> >  	
> >  		return ret;
> > 
> > +	/* Adjust the ECC strength according to the chip. */
> > +	this->nand.ecc.strength = this->bch_geometry.ecc_strength;
> > +
> > 
> >  	/* NAND boot init, depends on the gpmi_set_geometry(). */
> >  	return nand_boot_init(this);
> >  
> >  }
> > 
> > @@ -1494,6 +1497,7 @@ static int __devinit gpmi_nfc_init(struct
> > gpmi_nand_data *this)
> > 
> >  	chip->options		|= NAND_NO_SUBPAGE_WRITE;
> >  	chip->ecc.mode		= NAND_ECC_HW;
> >  	chip->ecc.size		= 1;
> > 
> > +	chip->ecc.strength	= 8;
> > 
> >  	chip->ecc.layout	= &gpmi_hw_ecclayout;
> >  	
> >  	/* Allocate a temporary DMA buffer for reading ID in the nand_scan() */

Best regards,
Marek Vasut

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

* [PATCH 1/4] GPMI-NAND: Define ecc.strength
@ 2012-05-21  1:36     ` Marek Vasut
  0 siblings, 0 replies; 43+ messages in thread
From: Marek Vasut @ 2012-05-21  1:36 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Shawn Guo,

> So non-DT probe has the same issue?  Or this is a DT probe only issue?

I started using DT, so I'm now fixing everything to work like it used to. Damn 
this DT conversion broke about everything.

> 
> Copy linux-mtd list and Artem Bityutskiy on this.
> 
> > The ecc.strength wasn't set, resulting in the following crash:
> > [    2.550000] kernel BUG at drivers/mtd/nand/nand_base.c:3347!
> > [    2.550000] Internal error: Oops - BUG: 0 [#1] ARM
> > [    2.550000] Modules linked in:
> > [    2.550000] CPU: 0    Not tainted  (3.4.0-rc7-next-20120518-dirty
> > #1211) [    2.550000] PC is at nand_scan_tail+0x328/0x650
> > [    2.550000] LR is at nand_scan_tail+0x328/0x650
> > [    2.550000] pc : [<c020841c>]    lr : [<c020841c>]    psr: 20000013
> > [    2.550000] sp : c7443ea8  ip : c7448000  fp : c043dc70
> > [    2.550000] r10: 00000000  r9 : c059dd20  r8 : c7526300
> > [    2.550000] r7 : 00000001  r6 : c7479c08  r5 : c7526300  r4 : c7526098
> > [    2.550000] r3 : c7448000  r2 : 00000000  r1 : 00000001  r0 : 00000034
> > [    2.550000] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM 
> > Segment kernel [    2.550000] Control: 0005317f  Table: 40004000  DAC:
> > 00000017 [    2.550000] Process swapper (pid: 1, stack limit =
> > 0xc7442270) [    2.550000] Stack: (0xc7443ea8 to 0xc7444000)
> > [    2.550000] 3ea0:                   c7526000 00000000 c7479c08
> > c02f68e0 c03d50ec c7526000 [    2.550000] 3ec0: c747c6e0 00000000
> > c0ae7720 00000004 00000000 00000000 c7479c08 c0ae7720 [    2.550000]
> > 3ee0: c7479c3c c0593e20 c7572200 c01f6618 c01f6604 c01f55b0 c7479c08
> > c0593e20 [    2.550000] 3f00: c7479c3c c059dd20 c7572200 c01f57cc
> > 00000000 c0593e20 c01f5738 c01f3d40 [    2.550000] 3f20: c74038a8
> > c74767d0 c0593e20 c04475ec c05901b8 c01f4e18 c03d50e0 c019d438 [   
> > 2.550000] 3f40: c7403800 c0593e20 c04475ec 00000000 c059dd20 c04475f8
> > c7442000 c01f5a70 [    2.550000] 3f60: 00000000 c044e98c c04475ec
> > 00000000 c059dd20 c04475f8 c7442000 c043dc7c [    2.550000] 3f80:
> > c044e98c c0008824 c03d6c30 c040c4e4 00000006 00000006 c03b0ce4 c0bf54e0
> > [    2.550000] 3fa0: c044e98c c04475ec 00000006 c04475f8 0000004c
> > c042a21c 00000000 c042a8b8 [    2.550000] 3fc0: 00000006 00000006
> > c042a21c 00000000 00000000 00000000 00000000 c042a7bc [    2.550000]
> > 3fe0: c000fab4 00000013 00000000 00000000 00000000 c000fab4 efbbfaa5
> > eaeafefe [    2.550000] [<c020841c>] (nand_scan_tail+0x328/0x650) from
> > [<c02f68e0>] (gpmi_nand_probe+0x43c/0x5a4) [    2.550000] [<c02f68e0>]
> > (gpmi_nand_probe+0x43c/0x5a4) from [<c01f6618>]
> > (platform_drv_probe+0x14/0x18) [    2.550000] [<c01f6618>]
> > (platform_drv_probe+0x14/0x18) from [<c01f55b0>]
> > (driver_probe_device+0x74/0x1fc) [    2.550000] [<c01f55b0>]
> > (driver_probe_device+0x74/0x1fc) from [<c01f57cc>]
> > (__driver_attach+0x94/0x98) [    2.550000] [<c01f57cc>]
> > (__driver_attach+0x94/0x98) from [<c01f3d40>]
> > (bus_for_each_dev+0x50/0x80) [    2.550000] [<c01f3d40>]
> > (bus_for_each_dev+0x50/0x80) from [<c01f4e18>]
> > (bus_add_driver+0x188/0x25c) [    2.550000] [<c01f4e18>]
> > (bus_add_driver+0x188/0x25c) from [<c01f5a70>]
> > (driver_register+0x78/0x138) [    2.550000] [<c01f5a70>]
> > (driver_register+0x78/0x138) from [<c043dc7c>] (gpmi_nand_init+0xc/0x30)
> > [    2.550000] [<c043dc7c>] (gpmi_nand_init+0xc/0x30) from [<c0008824>]
> > (do_one_initcall+0x108/0x17c) [    2.550000] [<c0008824>]
> > (do_one_initcall+0x108/0x17c) from [<c042a8b8>] (kernel_init+0xfc/0x1bc)
> > [    2.550000] [<c042a8b8>] (kernel_init+0xfc/0x1bc) from [<c000fab4>]
> > (kernel_thread_exit+0x0/0x8) [    2.550000] Code: e3530000 1affff76
> > e59f02d0 eb03c16a (e7f001f2) [    2.830000] ---[ end trace
> > 3f05d4c0039432f1 ]---
> > [    2.840000] Kernel panic - not syncing: Attempted to kill init!
> > exitcode=0x0000000b
> > 
> > Signed-off-by: Marek Vasut <marex@denx.de>
> > Cc: Huang Shijie <b32955@freescale.com>
> > Cc: Shawn Guo <shawn.guo@linaro.org>
> > Cc: Fabio Estevam <fabio.estevam@freescale.com>
> > ---
> > 
> >  drivers/mtd/nand/gpmi-nand/gpmi-nand.c |    4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> > b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c index 9b4c109..f5f3d761 100644
> > --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> > +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c
> > @@ -1436,6 +1436,9 @@ static int gpmi_pre_bbt_scan(struct gpmi_nand_data 
> > *this)
> > 
> >  	if (ret)
> >  	
> >  		return ret;
> > 
> > +	/* Adjust the ECC strength according to the chip. */
> > +	this->nand.ecc.strength = this->bch_geometry.ecc_strength;
> > +
> > 
> >  	/* NAND boot init, depends on the gpmi_set_geometry(). */
> >  	return nand_boot_init(this);
> >  
> >  }
> > 
> > @@ -1494,6 +1497,7 @@ static int __devinit gpmi_nfc_init(struct
> > gpmi_nand_data *this)
> > 
> >  	chip->options		|= NAND_NO_SUBPAGE_WRITE;
> >  	chip->ecc.mode		= NAND_ECC_HW;
> >  	chip->ecc.size		= 1;
> > 
> > +	chip->ecc.strength	= 8;
> > 
> >  	chip->ecc.layout	= &gpmi_hw_ecclayout;
> >  	
> >  	/* Allocate a temporary DMA buffer for reading ID in the nand_scan() */

Best regards,
Marek Vasut

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

* Re: [PATCH 4/4] MXS-MMC: Add wp-inverted property
  2012-05-21  1:02 ` [PATCH 4/4] MXS-MMC: Add wp-inverted property Marek Vasut
@ 2012-05-21  1:39     ` Shawn Guo
  2012-05-21  7:22   ` Lothar Waßmann
  1 sibling, 0 replies; 43+ messages in thread
From: Shawn Guo @ 2012-05-21  1:39 UTC (permalink / raw)
  To: Marek Vasut; +Cc: linux-arm-kernel, Fabio Estevam, Chris Ball, linux-mmc

Copy Chris and linux-mmc, as I assume that the patch should go via mmc
tree after the merge window.

On Mon, May 21, 2012 at 03:02:20AM +0200, Marek Vasut wrote:
> The write-protect GPIO is inverted on some boards. Handle such case.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Cc: Fabio Estevam <fabio.estevam@freescale.com>

Acked-by: Shawn Guo <shawn.guo@linaro.org>

A coupe of nits though:

The subject prefix can better be "mmc: mxs-mmc: ".

> ---
>  Documentation/devicetree/bindings/mmc/mxs-mmc.txt |    1 +
>  drivers/mmc/host/mxs-mmc.c                        |   11 ++++++++++-
>  2 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/mxs-mmc.txt b/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
> index 14d870a..0a7d2cd 100644
> --- a/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
> +++ b/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
> @@ -13,6 +13,7 @@ Required properties:
>  
>  Optional properties:
>  - wp-gpios: Specify GPIOs for write protection
> +- wp-inverted: Set if the write protection GPIO is inverted
>  
>  Examples:
>  
> diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
> index 277161d..119beb9 100644
> --- a/drivers/mmc/host/mxs-mmc.c
> +++ b/drivers/mmc/host/mxs-mmc.c
> @@ -164,16 +164,23 @@ struct mxs_mmc_host {
>  	spinlock_t			lock;
>  	int				sdio_irq_en;
>  	int				wp_gpio;
> +	int				wp_inverted:1;
>  };
>  
>  static int mxs_mmc_get_ro(struct mmc_host *mmc)
>  {
>  	struct mxs_mmc_host *host = mmc_priv(mmc);
> +	int ret;
>  
>  	if (!gpio_is_valid(host->wp_gpio))
>  		return -EINVAL;
>  
> -	return gpio_get_value(host->wp_gpio);
> +	ret = gpio_get_value(host->wp_gpio);
> +
> +	if (host->wp_inverted)
> +		ret = !ret;
> +
> +	return ret;

The above lines can just be the one below?

	return (host->wp_inverted) ? !ret : ret;

>  }

-- 
Regards,
Shawn

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

* [PATCH 4/4] MXS-MMC: Add wp-inverted property
@ 2012-05-21  1:39     ` Shawn Guo
  0 siblings, 0 replies; 43+ messages in thread
From: Shawn Guo @ 2012-05-21  1:39 UTC (permalink / raw)
  To: linux-arm-kernel

Copy Chris and linux-mmc, as I assume that the patch should go via mmc
tree after the merge window.

On Mon, May 21, 2012 at 03:02:20AM +0200, Marek Vasut wrote:
> The write-protect GPIO is inverted on some boards. Handle such case.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Cc: Fabio Estevam <fabio.estevam@freescale.com>

Acked-by: Shawn Guo <shawn.guo@linaro.org>

A coupe of nits though:

The subject prefix can better be "mmc: mxs-mmc: ".

> ---
>  Documentation/devicetree/bindings/mmc/mxs-mmc.txt |    1 +
>  drivers/mmc/host/mxs-mmc.c                        |   11 ++++++++++-
>  2 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/mxs-mmc.txt b/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
> index 14d870a..0a7d2cd 100644
> --- a/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
> +++ b/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
> @@ -13,6 +13,7 @@ Required properties:
>  
>  Optional properties:
>  - wp-gpios: Specify GPIOs for write protection
> +- wp-inverted: Set if the write protection GPIO is inverted
>  
>  Examples:
>  
> diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
> index 277161d..119beb9 100644
> --- a/drivers/mmc/host/mxs-mmc.c
> +++ b/drivers/mmc/host/mxs-mmc.c
> @@ -164,16 +164,23 @@ struct mxs_mmc_host {
>  	spinlock_t			lock;
>  	int				sdio_irq_en;
>  	int				wp_gpio;
> +	int				wp_inverted:1;
>  };
>  
>  static int mxs_mmc_get_ro(struct mmc_host *mmc)
>  {
>  	struct mxs_mmc_host *host = mmc_priv(mmc);
> +	int ret;
>  
>  	if (!gpio_is_valid(host->wp_gpio))
>  		return -EINVAL;
>  
> -	return gpio_get_value(host->wp_gpio);
> +	ret = gpio_get_value(host->wp_gpio);
> +
> +	if (host->wp_inverted)
> +		ret = !ret;
> +
> +	return ret;

The above lines can just be the one below?

	return (host->wp_inverted) ? !ret : ret;

>  }

-- 
Regards,
Shawn

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

* Re: [PATCH 1/4] GPMI-NAND: Define ecc.strength
  2012-05-21  1:36     ` Marek Vasut
@ 2012-05-21  1:41       ` Shawn Guo
  -1 siblings, 0 replies; 43+ messages in thread
From: Shawn Guo @ 2012-05-21  1:41 UTC (permalink / raw)
  To: Marek Vasut
  Cc: Fabio Estevam, Huang Shijie, linux-mtd, linux-arm-kernel,
	Artem Bityutskiy

On Mon, May 21, 2012 at 03:36:41AM +0200, Marek Vasut wrote:
> Dear Shawn Guo,
> 
> > So non-DT probe has the same issue?  Or this is a DT probe only issue?
> 
> I started using DT, so I'm now fixing everything to work like it used to. Damn 
> this DT conversion broke about everything.
> 
So you are saying the issue is introduced by gpmi-nand DT conversion?

-- 
Regards,
Shawn

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

* [PATCH 1/4] GPMI-NAND: Define ecc.strength
@ 2012-05-21  1:41       ` Shawn Guo
  0 siblings, 0 replies; 43+ messages in thread
From: Shawn Guo @ 2012-05-21  1:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 21, 2012 at 03:36:41AM +0200, Marek Vasut wrote:
> Dear Shawn Guo,
> 
> > So non-DT probe has the same issue?  Or this is a DT probe only issue?
> 
> I started using DT, so I'm now fixing everything to work like it used to. Damn 
> this DT conversion broke about everything.
> 
So you are saying the issue is introduced by gpmi-nand DT conversion?

-- 
Regards,
Shawn

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

* Re: [PATCH 4/4] MXS-MMC: Add wp-inverted property
  2012-05-21  1:39     ` Shawn Guo
@ 2012-05-21  2:38       ` Marek Vasut
  -1 siblings, 0 replies; 43+ messages in thread
From: Marek Vasut @ 2012-05-21  2:38 UTC (permalink / raw)
  To: Shawn Guo; +Cc: linux-arm-kernel, Fabio Estevam, Chris Ball, linux-mmc

Dear Shawn Guo,

> Copy Chris and linux-mmc, as I assume that the patch should go via mmc
> tree after the merge window.
> 
> On Mon, May 21, 2012 at 03:02:20AM +0200, Marek Vasut wrote:
> > The write-protect GPIO is inverted on some boards. Handle such case.
> > 
> > Signed-off-by: Marek Vasut <marex@denx.de>
> > Cc: Shawn Guo <shawn.guo@linaro.org>
> > Cc: Fabio Estevam <fabio.estevam@freescale.com>
> 
> Acked-by: Shawn Guo <shawn.guo@linaro.org>
> 
> A coupe of nits though:
> 
> The subject prefix can better be "mmc: mxs-mmc: ".

Want me to resend it ?

> 
> > ---
> > 
> >  Documentation/devicetree/bindings/mmc/mxs-mmc.txt |    1 +
> >  drivers/mmc/host/mxs-mmc.c                        |   11 ++++++++++-
> >  2 files changed, 11 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
> > b/Documentation/devicetree/bindings/mmc/mxs-mmc.txt index
> > 14d870a..0a7d2cd 100644
> > --- a/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
> > +++ b/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
> > 
> > @@ -13,6 +13,7 @@ Required properties:
> >  Optional properties:
> >  - wp-gpios: Specify GPIOs for write protection
> > 
> > +- wp-inverted: Set if the write protection GPIO is inverted
> > 
> >  Examples:
> > diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
> > index 277161d..119beb9 100644
> > --- a/drivers/mmc/host/mxs-mmc.c
> > +++ b/drivers/mmc/host/mxs-mmc.c
> > @@ -164,16 +164,23 @@ struct mxs_mmc_host {
> > 
> >  	spinlock_t			lock;
> >  	int				sdio_irq_en;
> >  	int				wp_gpio;
> > 
> > +	int				wp_inverted:1;
> > 
> >  };
> >  
> >  static int mxs_mmc_get_ro(struct mmc_host *mmc)
> >  {
> >  
> >  	struct mxs_mmc_host *host = mmc_priv(mmc);
> > 
> > +	int ret;
> > 
> >  	if (!gpio_is_valid(host->wp_gpio))
> >  	
> >  		return -EINVAL;
> > 
> > -	return gpio_get_value(host->wp_gpio);
> > +	ret = gpio_get_value(host->wp_gpio);
> > +
> > +	if (host->wp_inverted)
> > +		ret = !ret;
> > +
> > +	return ret;
> 
> The above lines can just be the one below?
> 
> 	return (host->wp_inverted) ? !ret : ret;

I'd prefer to avoid the ternary operator, it's more readable as it is.

> 
> >  }

Best regards,
Marek Vasut

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

* [PATCH 4/4] MXS-MMC: Add wp-inverted property
@ 2012-05-21  2:38       ` Marek Vasut
  0 siblings, 0 replies; 43+ messages in thread
From: Marek Vasut @ 2012-05-21  2:38 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Shawn Guo,

> Copy Chris and linux-mmc, as I assume that the patch should go via mmc
> tree after the merge window.
> 
> On Mon, May 21, 2012 at 03:02:20AM +0200, Marek Vasut wrote:
> > The write-protect GPIO is inverted on some boards. Handle such case.
> > 
> > Signed-off-by: Marek Vasut <marex@denx.de>
> > Cc: Shawn Guo <shawn.guo@linaro.org>
> > Cc: Fabio Estevam <fabio.estevam@freescale.com>
> 
> Acked-by: Shawn Guo <shawn.guo@linaro.org>
> 
> A coupe of nits though:
> 
> The subject prefix can better be "mmc: mxs-mmc: ".

Want me to resend it ?

> 
> > ---
> > 
> >  Documentation/devicetree/bindings/mmc/mxs-mmc.txt |    1 +
> >  drivers/mmc/host/mxs-mmc.c                        |   11 ++++++++++-
> >  2 files changed, 11 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
> > b/Documentation/devicetree/bindings/mmc/mxs-mmc.txt index
> > 14d870a..0a7d2cd 100644
> > --- a/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
> > +++ b/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
> > 
> > @@ -13,6 +13,7 @@ Required properties:
> >  Optional properties:
> >  - wp-gpios: Specify GPIOs for write protection
> > 
> > +- wp-inverted: Set if the write protection GPIO is inverted
> > 
> >  Examples:
> > diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
> > index 277161d..119beb9 100644
> > --- a/drivers/mmc/host/mxs-mmc.c
> > +++ b/drivers/mmc/host/mxs-mmc.c
> > @@ -164,16 +164,23 @@ struct mxs_mmc_host {
> > 
> >  	spinlock_t			lock;
> >  	int				sdio_irq_en;
> >  	int				wp_gpio;
> > 
> > +	int				wp_inverted:1;
> > 
> >  };
> >  
> >  static int mxs_mmc_get_ro(struct mmc_host *mmc)
> >  {
> >  
> >  	struct mxs_mmc_host *host = mmc_priv(mmc);
> > 
> > +	int ret;
> > 
> >  	if (!gpio_is_valid(host->wp_gpio))
> >  	
> >  		return -EINVAL;
> > 
> > -	return gpio_get_value(host->wp_gpio);
> > +	ret = gpio_get_value(host->wp_gpio);
> > +
> > +	if (host->wp_inverted)
> > +		ret = !ret;
> > +
> > +	return ret;
> 
> The above lines can just be the one below?
> 
> 	return (host->wp_inverted) ? !ret : ret;

I'd prefer to avoid the ternary operator, it's more readable as it is.

> 
> >  }

Best regards,
Marek Vasut

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

* Re: [PATCH 1/4] GPMI-NAND: Define ecc.strength
  2012-05-21  1:41       ` Shawn Guo
@ 2012-05-21  2:40         ` Marek Vasut
  -1 siblings, 0 replies; 43+ messages in thread
From: Marek Vasut @ 2012-05-21  2:40 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Fabio Estevam, Huang Shijie, linux-mtd, linux-arm-kernel,
	Artem Bityutskiy

Dear Shawn Guo,

> On Mon, May 21, 2012 at 03:36:41AM +0200, Marek Vasut wrote:
> > Dear Shawn Guo,
> > 
> > > So non-DT probe has the same issue?  Or this is a DT probe only issue?
> > 
> > I started using DT, so I'm now fixing everything to work like it used to.
> > Damn this DT conversion broke about everything.
> 
> So you are saying the issue is introduced by gpmi-nand DT conversion?

I doubt so ... but noone ever could test it without DT bindings as you 
NAKed/stalled every single attempt to add the platform binding code. So this 
code was rotting in the tree, who knows how many bugs are still in it. Now I 
guess it's about time to start squashing the bugs.

Best regards,
Marek Vasut

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

* [PATCH 1/4] GPMI-NAND: Define ecc.strength
@ 2012-05-21  2:40         ` Marek Vasut
  0 siblings, 0 replies; 43+ messages in thread
From: Marek Vasut @ 2012-05-21  2:40 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Shawn Guo,

> On Mon, May 21, 2012 at 03:36:41AM +0200, Marek Vasut wrote:
> > Dear Shawn Guo,
> > 
> > > So non-DT probe has the same issue?  Or this is a DT probe only issue?
> > 
> > I started using DT, so I'm now fixing everything to work like it used to.
> > Damn this DT conversion broke about everything.
> 
> So you are saying the issue is introduced by gpmi-nand DT conversion?

I doubt so ... but noone ever could test it without DT bindings as you 
NAKed/stalled every single attempt to add the platform binding code. So this 
code was rotting in the tree, who knows how many bugs are still in it. Now I 
guess it's about time to start squashing the bugs.

Best regards,
Marek Vasut

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

* Re: [PATCH 1/4] GPMI-NAND: Define ecc.strength
  2012-05-21  1:41       ` Shawn Guo
@ 2012-05-21  2:44         ` Huang Shijie
  -1 siblings, 0 replies; 43+ messages in thread
From: Huang Shijie @ 2012-05-21  2:44 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Marek Vasut, Fabio Estevam, linux-mtd, linux-arm-kernel,
	Artem Bityutskiy

Hi Marek:
> On Mon, May 21, 2012 at 03:36:41AM +0200, Marek Vasut wrote:
>> Dear Shawn Guo,
>>
>>> So non-DT probe has the same issue?  Or this is a DT probe only issue?
>> I started using DT, so I'm now fixing everything to work like it used to. Damn
>> this DT conversion broke about everything.
>>
> So you are saying the issue is introduced by gpmi-nand DT conversion?
>
thanks for your work. :)
But the gpmi nand driver should not work right now.

The DT for gpmi-nand is in Artem's l2-mtd tree.
And the device node item in DTS for gpmi is not added now.( I ever 
submitted, but not accepted.)
Also the pinctrl item for gpmi is also not added not.

So I suggest you test it again when the next merge window opens, and all 
the code is merged to kernel.
If the bug still exits, please submit a fix patch then.

By the way, I really did not meet your error when I test the DT patches 
for gpmi.

thanks
Huang Shijie

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

* [PATCH 1/4] GPMI-NAND: Define ecc.strength
@ 2012-05-21  2:44         ` Huang Shijie
  0 siblings, 0 replies; 43+ messages in thread
From: Huang Shijie @ 2012-05-21  2:44 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Marek:
> On Mon, May 21, 2012 at 03:36:41AM +0200, Marek Vasut wrote:
>> Dear Shawn Guo,
>>
>>> So non-DT probe has the same issue?  Or this is a DT probe only issue?
>> I started using DT, so I'm now fixing everything to work like it used to. Damn
>> this DT conversion broke about everything.
>>
> So you are saying the issue is introduced by gpmi-nand DT conversion?
>
thanks for your work. :)
But the gpmi nand driver should not work right now.

The DT for gpmi-nand is in Artem's l2-mtd tree.
And the device node item in DTS for gpmi is not added now.( I ever 
submitted, but not accepted.)
Also the pinctrl item for gpmi is also not added not.

So I suggest you test it again when the next merge window opens, and all 
the code is merged to kernel.
If the bug still exits, please submit a fix patch then.

By the way, I really did not meet your error when I test the DT patches 
for gpmi.

thanks
Huang Shijie

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

* Re: [PATCH 4/4] MXS-MMC: Add wp-inverted property
  2012-05-21  2:38       ` Marek Vasut
@ 2012-05-21  2:48         ` Shawn Guo
  -1 siblings, 0 replies; 43+ messages in thread
From: Shawn Guo @ 2012-05-21  2:48 UTC (permalink / raw)
  To: Marek Vasut; +Cc: linux-arm-kernel, Fabio Estevam, Chris Ball, linux-mmc

On 21 May 2012 10:38, Marek Vasut <marex@denx.de> wrote:
>> The subject prefix can better be "mmc: mxs-mmc: ".
>
> Want me to resend it ?
>
It's Chris' call.

Regards,
Shawn

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

* [PATCH 4/4] MXS-MMC: Add wp-inverted property
@ 2012-05-21  2:48         ` Shawn Guo
  0 siblings, 0 replies; 43+ messages in thread
From: Shawn Guo @ 2012-05-21  2:48 UTC (permalink / raw)
  To: linux-arm-kernel

On 21 May 2012 10:38, Marek Vasut <marex@denx.de> wrote:
>> The subject prefix can better be "mmc: mxs-mmc: ".
>
> Want me to resend it ?
>
It's Chris' call.

Regards,
Shawn

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

* Re: [PATCH 1/4] GPMI-NAND: Define ecc.strength
  2012-05-21  2:40         ` Marek Vasut
@ 2012-05-21  3:08           ` Huang Shijie
  -1 siblings, 0 replies; 43+ messages in thread
From: Huang Shijie @ 2012-05-21  3:08 UTC (permalink / raw)
  To: Marek Vasut
  Cc: Fabio Estevam, Shawn Guo, linux-mtd, linux-arm-kernel, Artem Bityutskiy

于 2012年05月21日 10:40, Marek Vasut 写道:
> I doubt so ... but noone ever could test it without DT bindings as you
> NAKed/stalled every single attempt to add the platform binding code. So this
> code was rotting in the tree, who knows how many bugs are still in it. Now I
> guess it's about time to start squashing the bugs.
>
I checked the latest l2-mtd code. The bug does exit if the gpmi-nand 
driver can works(actually it can not).

I will test your patch.
Anyway, this patch should be sent to Artem, not the arm-soc.

thanks
Huang Shijie

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

* [PATCH 1/4] GPMI-NAND: Define ecc.strength
@ 2012-05-21  3:08           ` Huang Shijie
  0 siblings, 0 replies; 43+ messages in thread
From: Huang Shijie @ 2012-05-21  3:08 UTC (permalink / raw)
  To: linux-arm-kernel

? 2012?05?21? 10:40, Marek Vasut ??:
> I doubt so ... but noone ever could test it without DT bindings as you
> NAKed/stalled every single attempt to add the platform binding code. So this
> code was rotting in the tree, who knows how many bugs are still in it. Now I
> guess it's about time to start squashing the bugs.
>
I checked the latest l2-mtd code. The bug does exit if the gpmi-nand 
driver can works(actually it can not).

I will test your patch.
Anyway, this patch should be sent to Artem, not the arm-soc.

thanks
Huang Shijie

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

* Re: [PATCH 4/4] MXS-MMC: Add wp-inverted property
  2012-05-21  2:48         ` Shawn Guo
@ 2012-05-21  3:22           ` Chris Ball
  -1 siblings, 0 replies; 43+ messages in thread
From: Chris Ball @ 2012-05-21  3:22 UTC (permalink / raw)
  To: Shawn Guo; +Cc: Marek Vasut, linux-arm-kernel, Fabio Estevam, linux-mmc

Hi,

On Sun, May 20 2012, Shawn Guo wrote:
> On 21 May 2012 10:38, Marek Vasut <marex@denx.de> wrote:
>>> The subject prefix can better be "mmc: mxs-mmc: ".
>>
>> Want me to resend it ?
>>
> It's Chris' call.

Yes, please -- actually not just because of the subject prefix, which I
wouldn't mind fixing myself, but because I like having patches posted to
linux-mmc@ before they're applied.

Thanks!

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* [PATCH 4/4] MXS-MMC: Add wp-inverted property
@ 2012-05-21  3:22           ` Chris Ball
  0 siblings, 0 replies; 43+ messages in thread
From: Chris Ball @ 2012-05-21  3:22 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Sun, May 20 2012, Shawn Guo wrote:
> On 21 May 2012 10:38, Marek Vasut <marex@denx.de> wrote:
>>> The subject prefix can better be "mmc: mxs-mmc: ".
>>
>> Want me to resend it ?
>>
> It's Chris' call.

Yes, please -- actually not just because of the subject prefix, which I
wouldn't mind fixing myself, but because I like having patches posted to
linux-mmc@ before they're applied.

Thanks!

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* Re: [PATCH 4/4] MXS-MMC: Add wp-inverted property
  2012-05-21  3:22           ` Chris Ball
@ 2012-05-21  3:36             ` Marek Vasut
  -1 siblings, 0 replies; 43+ messages in thread
From: Marek Vasut @ 2012-05-21  3:36 UTC (permalink / raw)
  To: Chris Ball; +Cc: Shawn Guo, linux-arm-kernel, Fabio Estevam, linux-mmc

Dear Chris Ball,

> Hi,
> 
> On Sun, May 20 2012, Shawn Guo wrote:
> > On 21 May 2012 10:38, Marek Vasut <marex@denx.de> wrote:
> >>> The subject prefix can better be "mmc: mxs-mmc: ".
> >> 
> >> Want me to resend it ?
> > 
> > It's Chris' call.
> 
> Yes, please -- actually not just because of the subject prefix, which I
> wouldn't mind fixing myself, but because I like having patches posted to
> linux-mmc@ before they're applied.

Fixed now

> 
> Thanks!

You're welcome :)

> 
> - Chris.

Best regards,
Marek Vasut

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

* [PATCH 4/4] MXS-MMC: Add wp-inverted property
@ 2012-05-21  3:36             ` Marek Vasut
  0 siblings, 0 replies; 43+ messages in thread
From: Marek Vasut @ 2012-05-21  3:36 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Chris Ball,

> Hi,
> 
> On Sun, May 20 2012, Shawn Guo wrote:
> > On 21 May 2012 10:38, Marek Vasut <marex@denx.de> wrote:
> >>> The subject prefix can better be "mmc: mxs-mmc: ".
> >> 
> >> Want me to resend it ?
> > 
> > It's Chris' call.
> 
> Yes, please -- actually not just because of the subject prefix, which I
> wouldn't mind fixing myself, but because I like having patches posted to
> linux-mmc@ before they're applied.

Fixed now

> 
> Thanks!

You're welcome :)

> 
> - Chris.

Best regards,
Marek Vasut

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

* Re: [PATCH 1/4] GPMI-NAND: Define ecc.strength
  2012-05-21  3:45           ` Shawn Guo
@ 2012-05-21  3:39             ` Marek Vasut
  -1 siblings, 0 replies; 43+ messages in thread
From: Marek Vasut @ 2012-05-21  3:39 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Fabio Estevam, Artem Bityutskiy, Huang Shijie, linux-mtd,
	Shawn Guo, linux-arm-kernel

Dear Shawn Guo,

> On Mon, May 21, 2012 at 04:40:09AM +0200, Marek Vasut wrote:
> > > So you are saying the issue is introduced by gpmi-nand DT conversion?
> > 
> > I doubt so ...
> 
> I can be very sure that you haven't looked at the gpmi-nand DT
> conversion patches at all.
> 
> The bug has been there since day one.  The commit cfbc855b (mtd: nand:
> add sanity check of ecc strength to nand_scan_tail()) added a BUG() to
> catch it recently.
> 
> So please at least spend some time to know the real cause before
> pointing your figure to DT conversion.

Well ... since noone was really able to test the patch, noone figured out it's 
broken. We can agree on that, right.

And btw. by "I doubt so ..." I means exactly that I doubt the bug was caused by 
the DT conversion.

Best regards,
Marek Vasut

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

* [PATCH 1/4] GPMI-NAND: Define ecc.strength
@ 2012-05-21  3:39             ` Marek Vasut
  0 siblings, 0 replies; 43+ messages in thread
From: Marek Vasut @ 2012-05-21  3:39 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Shawn Guo,

> On Mon, May 21, 2012 at 04:40:09AM +0200, Marek Vasut wrote:
> > > So you are saying the issue is introduced by gpmi-nand DT conversion?
> > 
> > I doubt so ...
> 
> I can be very sure that you haven't looked at the gpmi-nand DT
> conversion patches at all.
> 
> The bug has been there since day one.  The commit cfbc855b (mtd: nand:
> add sanity check of ecc strength to nand_scan_tail()) added a BUG() to
> catch it recently.
> 
> So please at least spend some time to know the real cause before
> pointing your figure to DT conversion.

Well ... since noone was really able to test the patch, noone figured out it's 
broken. We can agree on that, right.

And btw. by "I doubt so ..." I means exactly that I doubt the bug was caused by 
the DT conversion.

Best regards,
Marek Vasut

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

* Re: [PATCH 1/4] GPMI-NAND: Define ecc.strength
  2012-05-21  2:44         ` Huang Shijie
@ 2012-05-21  3:43           ` Marek Vasut
  -1 siblings, 0 replies; 43+ messages in thread
From: Marek Vasut @ 2012-05-21  3:43 UTC (permalink / raw)
  To: Huang Shijie
  Cc: Fabio Estevam, Shawn Guo, linux-mtd, linux-arm-kernel, Artem Bityutskiy

Dear Huang Shijie,

> Hi Marek:
> > On Mon, May 21, 2012 at 03:36:41AM +0200, Marek Vasut wrote:
> >> Dear Shawn Guo,
> >> 
> >>> So non-DT probe has the same issue?  Or this is a DT probe only issue?
> >> 
> >> I started using DT, so I'm now fixing everything to work like it used
> >> to. Damn this DT conversion broke about everything.
> > 
> > So you are saying the issue is introduced by gpmi-nand DT conversion?
> 
> thanks for your work. :)
> But the gpmi nand driver should not work right now.

Why not? I tested, I could at least read stuff from it.

> The DT for gpmi-nand is in Artem's l2-mtd tree.
> And the device node item in DTS for gpmi is not added now.( I ever
> submitted, but not accepted.)

Well I crafted one myself, I need different pinmux settings anyway so I added my 
own pinmux configuration.

> Also the pinctrl item for gpmi is also not added not.
> 
> So I suggest you test it again when the next merge window opens, and all
> the code is merged to kernel.

Please ... Shawn explained that this bug will still be there. So why not get it 
in early to fix bug asap. I'll resend to artem now.

> If the bug still exits, please submit a fix patch then.
> 
> By the way, I really did not meet your error when I test the DT patches
> for gpmi.

Can you post your snippet?

> thanks
> Huang Shijie

Best regards,
Marek Vasut

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

* [PATCH 1/4] GPMI-NAND: Define ecc.strength
@ 2012-05-21  3:43           ` Marek Vasut
  0 siblings, 0 replies; 43+ messages in thread
From: Marek Vasut @ 2012-05-21  3:43 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Huang Shijie,

> Hi Marek:
> > On Mon, May 21, 2012 at 03:36:41AM +0200, Marek Vasut wrote:
> >> Dear Shawn Guo,
> >> 
> >>> So non-DT probe has the same issue?  Or this is a DT probe only issue?
> >> 
> >> I started using DT, so I'm now fixing everything to work like it used
> >> to. Damn this DT conversion broke about everything.
> > 
> > So you are saying the issue is introduced by gpmi-nand DT conversion?
> 
> thanks for your work. :)
> But the gpmi nand driver should not work right now.

Why not? I tested, I could at least read stuff from it.

> The DT for gpmi-nand is in Artem's l2-mtd tree.
> And the device node item in DTS for gpmi is not added now.( I ever
> submitted, but not accepted.)

Well I crafted one myself, I need different pinmux settings anyway so I added my 
own pinmux configuration.

> Also the pinctrl item for gpmi is also not added not.
> 
> So I suggest you test it again when the next merge window opens, and all
> the code is merged to kernel.

Please ... Shawn explained that this bug will still be there. So why not get it 
in early to fix bug asap. I'll resend to artem now.

> If the bug still exits, please submit a fix patch then.
> 
> By the way, I really did not meet your error when I test the DT patches
> for gpmi.

Can you post your snippet?

> thanks
> Huang Shijie

Best regards,
Marek Vasut

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

* Re: [PATCH 1/4] GPMI-NAND: Define ecc.strength
  2012-05-21  2:40         ` Marek Vasut
@ 2012-05-21  3:45           ` Shawn Guo
  -1 siblings, 0 replies; 43+ messages in thread
From: Shawn Guo @ 2012-05-21  3:45 UTC (permalink / raw)
  To: Marek Vasut
  Cc: Fabio Estevam, Artem Bityutskiy, Huang Shijie, linux-mtd,
	Shawn Guo, linux-arm-kernel

On Mon, May 21, 2012 at 04:40:09AM +0200, Marek Vasut wrote:
> > So you are saying the issue is introduced by gpmi-nand DT conversion?
> 
> I doubt so ...

I can be very sure that you haven't looked at the gpmi-nand DT
conversion patches at all.

The bug has been there since day one.  The commit cfbc855b (mtd: nand:
add sanity check of ecc strength to nand_scan_tail()) added a BUG() to
catch it recently.

So please at least spend some time to know the real cause before
pointing your figure to DT conversion.

-- 
Regards,
Shawn

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

* [PATCH 1/4] GPMI-NAND: Define ecc.strength
@ 2012-05-21  3:45           ` Shawn Guo
  0 siblings, 0 replies; 43+ messages in thread
From: Shawn Guo @ 2012-05-21  3:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, May 21, 2012 at 04:40:09AM +0200, Marek Vasut wrote:
> > So you are saying the issue is introduced by gpmi-nand DT conversion?
> 
> I doubt so ...

I can be very sure that you haven't looked at the gpmi-nand DT
conversion patches at all.

The bug has been there since day one.  The commit cfbc855b (mtd: nand:
add sanity check of ecc strength to nand_scan_tail()) added a BUG() to
catch it recently.

So please at least spend some time to know the real cause before
pointing your figure to DT conversion.

-- 
Regards,
Shawn

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

* Re: [PATCH 1/4] GPMI-NAND: Define ecc.strength
  2012-05-21  3:08           ` Huang Shijie
@ 2012-05-21  3:48             ` Marek Vasut
  -1 siblings, 0 replies; 43+ messages in thread
From: Marek Vasut @ 2012-05-21  3:48 UTC (permalink / raw)
  To: Huang Shijie
  Cc: Fabio Estevam, Shawn Guo, linux-mtd, linux-arm-kernel, Artem Bityutskiy

Dear Huang Shijie,

> 于 2012年05月21日 10:40, Marek Vasut 写道:
> > I doubt so ... but noone ever could test it without DT bindings as you
> > NAKed/stalled every single attempt to add the platform binding code. So
> > this code was rotting in the tree, who knows how many bugs are still in
> > it. Now I guess it's about time to start squashing the bugs.
> 
> I checked the latest l2-mtd code. The bug does exit if the gpmi-nand
> driver can works(actually it can not).

There's also the bug where you need to put gpmi@8000c000 into the DTS file 
instead of gpmi-nand@8000c000 ... maybe you should fix it?

Also, there's still the bug with subpage write size, "GPMI-NAND: Wrong ECC size 
in driver" thread in linux-mtd. That thread kind of died, but gpmi-nand is still 
broken in that way, it's depending on loose end of the mtd stack there. Won't 
hurt fixing that too, there was even a fix proposed.

> 
> I will test your patch.
> Anyway, this patch should be sent to Artem, not the arm-soc.

Resent, fixed, sorry for the inconvenience.

> 
> thanks
> Huang Shijie

Best regards,
Marek Vasut

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

* [PATCH 1/4] GPMI-NAND: Define ecc.strength
@ 2012-05-21  3:48             ` Marek Vasut
  0 siblings, 0 replies; 43+ messages in thread
From: Marek Vasut @ 2012-05-21  3:48 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Huang Shijie,

> ? 2012?05?21? 10:40, Marek Vasut ??:
> > I doubt so ... but noone ever could test it without DT bindings as you
> > NAKed/stalled every single attempt to add the platform binding code. So
> > this code was rotting in the tree, who knows how many bugs are still in
> > it. Now I guess it's about time to start squashing the bugs.
> 
> I checked the latest l2-mtd code. The bug does exit if the gpmi-nand
> driver can works(actually it can not).

There's also the bug where you need to put gpmi at 8000c000 into the DTS file 
instead of gpmi-nand at 8000c000 ... maybe you should fix it?

Also, there's still the bug with subpage write size, "GPMI-NAND: Wrong ECC size 
in driver" thread in linux-mtd. That thread kind of died, but gpmi-nand is still 
broken in that way, it's depending on loose end of the mtd stack there. Won't 
hurt fixing that too, there was even a fix proposed.

> 
> I will test your patch.
> Anyway, this patch should be sent to Artem, not the arm-soc.

Resent, fixed, sorry for the inconvenience.

> 
> thanks
> Huang Shijie

Best regards,
Marek Vasut

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

* Re: [PATCH 3/4] MXS-MMC: Move of_match_table out of CONFIG_PM
  2012-05-21  4:09     ` Shawn Guo
@ 2012-05-21  3:52       ` Chris Ball
  -1 siblings, 0 replies; 43+ messages in thread
From: Chris Ball @ 2012-05-21  3:52 UTC (permalink / raw)
  To: Shawn Guo
  Cc: Marek Vasut, linux-arm-kernel, Fabio Estevam, Shawn Guo, linux-mmc

Hi,

On Mon, May 21 2012, Shawn Guo wrote:
> Do you want me to queue this up for 3.5-rc with arm-soc tree or you can
> do that with mmc tree?  In case you can take care of it:
>
> Acked-by: Shawn Guo <shawn.guo@linaro.org>
>
> Marek,
>
> In case Chris want to take the patch and would ask you to repost it to
> copy linux-mmc, please fix the subject prefix also.

Thanks; yes, I'd like to take care of it, I'll make sure to add your ACK.
Marek, please repost this one too.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* [PATCH 3/4] MXS-MMC: Move of_match_table out of CONFIG_PM
@ 2012-05-21  3:52       ` Chris Ball
  0 siblings, 0 replies; 43+ messages in thread
From: Chris Ball @ 2012-05-21  3:52 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Mon, May 21 2012, Shawn Guo wrote:
> Do you want me to queue this up for 3.5-rc with arm-soc tree or you can
> do that with mmc tree?  In case you can take care of it:
>
> Acked-by: Shawn Guo <shawn.guo@linaro.org>
>
> Marek,
>
> In case Chris want to take the patch and would ask you to repost it to
> copy linux-mmc, please fix the subject prefix also.

Thanks; yes, I'd like to take care of it, I'll make sure to add your ACK.
Marek, please repost this one too.

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

* Re: [PATCH 3/4] MXS-MMC: Move of_match_table out of CONFIG_PM
  2012-05-21  1:02 ` [PATCH 3/4] MXS-MMC: Move of_match_table out of CONFIG_PM Marek Vasut
@ 2012-05-21  4:09     ` Shawn Guo
  0 siblings, 0 replies; 43+ messages in thread
From: Shawn Guo @ 2012-05-21  4:09 UTC (permalink / raw)
  To: Marek Vasut, Chris Ball
  Cc: linux-arm-kernel, Fabio Estevam, Shawn Guo, linux-mmc

Hi Chris,

Do you want me to queue this up for 3.5-rc with arm-soc tree or you can
do that with mmc tree?  In case you can take care of it:

Acked-by: Shawn Guo <shawn.guo@linaro.org>

Marek,

In case Chris want to take the patch and would ask you to repost it to
copy linux-mmc, please fix the subject prefix also.

Regards,
Shawn

On Mon, May 21, 2012 at 03:02:19AM +0200, Marek Vasut wrote:
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Cc: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  drivers/mmc/host/mxs-mmc.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
> index 34a9026..277161d 100644
> --- a/drivers/mmc/host/mxs-mmc.c
> +++ b/drivers/mmc/host/mxs-mmc.c
> @@ -894,8 +894,8 @@ static struct platform_driver mxs_mmc_driver = {
>  		.owner	= THIS_MODULE,
>  #ifdef CONFIG_PM
>  		.pm	= &mxs_mmc_pm_ops,
> -		.of_match_table = mxs_mmc_dt_ids,
>  #endif
> +		.of_match_table = mxs_mmc_dt_ids,
>  	},
>  };
>  
> -- 
> 1.7.10
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 


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

* [PATCH 3/4] MXS-MMC: Move of_match_table out of CONFIG_PM
@ 2012-05-21  4:09     ` Shawn Guo
  0 siblings, 0 replies; 43+ messages in thread
From: Shawn Guo @ 2012-05-21  4:09 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Chris,

Do you want me to queue this up for 3.5-rc with arm-soc tree or you can
do that with mmc tree?  In case you can take care of it:

Acked-by: Shawn Guo <shawn.guo@linaro.org>

Marek,

In case Chris want to take the patch and would ask you to repost it to
copy linux-mmc, please fix the subject prefix also.

Regards,
Shawn

On Mon, May 21, 2012 at 03:02:19AM +0200, Marek Vasut wrote:
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Cc: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  drivers/mmc/host/mxs-mmc.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
> index 34a9026..277161d 100644
> --- a/drivers/mmc/host/mxs-mmc.c
> +++ b/drivers/mmc/host/mxs-mmc.c
> @@ -894,8 +894,8 @@ static struct platform_driver mxs_mmc_driver = {
>  		.owner	= THIS_MODULE,
>  #ifdef CONFIG_PM
>  		.pm	= &mxs_mmc_pm_ops,
> -		.of_match_table = mxs_mmc_dt_ids,
>  #endif
> +		.of_match_table = mxs_mmc_dt_ids,
>  	},
>  };
>  
> -- 
> 1.7.10
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

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

* Re: [PATCH 3/4] MXS-MMC: Move of_match_table out of CONFIG_PM
  2012-05-21  3:52       ` Chris Ball
@ 2012-05-21  4:33         ` Marek Vasut
  -1 siblings, 0 replies; 43+ messages in thread
From: Marek Vasut @ 2012-05-21  4:33 UTC (permalink / raw)
  To: Chris Ball
  Cc: Shawn Guo, linux-arm-kernel, Fabio Estevam, Shawn Guo, linux-mmc

Dear Chris Ball,

> Hi,
> 
> On Mon, May 21 2012, Shawn Guo wrote:
> > Do you want me to queue this up for 3.5-rc with arm-soc tree or you can
> > do that with mmc tree?  In case you can take care of it:
> > 
> > Acked-by: Shawn Guo <shawn.guo@linaro.org>
> > 
> > Marek,
> > 
> > In case Chris want to take the patch and would ask you to repost it to
> > copy linux-mmc, please fix the subject prefix also.
> 
> Thanks; yes, I'd like to take care of it, I'll make sure to add your ACK.
> Marek, please repost this one too.

Will do, and will be careful about the MLs next time.

> 
> - Chris.

Best regards,
Marek Vasut

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

* [PATCH 3/4] MXS-MMC: Move of_match_table out of CONFIG_PM
@ 2012-05-21  4:33         ` Marek Vasut
  0 siblings, 0 replies; 43+ messages in thread
From: Marek Vasut @ 2012-05-21  4:33 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Chris Ball,

> Hi,
> 
> On Mon, May 21 2012, Shawn Guo wrote:
> > Do you want me to queue this up for 3.5-rc with arm-soc tree or you can
> > do that with mmc tree?  In case you can take care of it:
> > 
> > Acked-by: Shawn Guo <shawn.guo@linaro.org>
> > 
> > Marek,
> > 
> > In case Chris want to take the patch and would ask you to repost it to
> > copy linux-mmc, please fix the subject prefix also.
> 
> Thanks; yes, I'd like to take care of it, I'll make sure to add your ACK.
> Marek, please repost this one too.

Will do, and will be careful about the MLs next time.

> 
> - Chris.

Best regards,
Marek Vasut

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

* [PATCH 4/4] MXS-MMC: Add wp-inverted property
  2012-05-21  1:02 ` [PATCH 4/4] MXS-MMC: Add wp-inverted property Marek Vasut
  2012-05-21  1:39     ` Shawn Guo
@ 2012-05-21  7:22   ` Lothar Waßmann
  2012-05-21 17:38     ` Marek Vasut
  1 sibling, 1 reply; 43+ messages in thread
From: Lothar Waßmann @ 2012-05-21  7:22 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Marek Vasut writes:
> The write-protect GPIO is inverted on some boards. Handle such case.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> Cc: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  Documentation/devicetree/bindings/mmc/mxs-mmc.txt |    1 +
>  drivers/mmc/host/mxs-mmc.c                        |   11 ++++++++++-
>  2 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/mxs-mmc.txt b/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
> index 14d870a..0a7d2cd 100644
> --- a/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
> +++ b/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
> @@ -13,6 +13,7 @@ Required properties:
>  
>  Optional properties:
>  - wp-gpios: Specify GPIOs for write protection
> +- wp-inverted: Set if the write protection GPIO is inverted
>  
>  Examples:
>  
> diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
> index 277161d..119beb9 100644
> --- a/drivers/mmc/host/mxs-mmc.c
> +++ b/drivers/mmc/host/mxs-mmc.c
> @@ -164,16 +164,23 @@ struct mxs_mmc_host {
>  	spinlock_t			lock;
>  	int				sdio_irq_en;
>  	int				wp_gpio;
> +	int				wp_inverted:1;
>  };
>  
>  static int mxs_mmc_get_ro(struct mmc_host *mmc)
>  {
>  	struct mxs_mmc_host *host = mmc_priv(mmc);
> +	int ret;
>  
>  	if (!gpio_is_valid(host->wp_gpio))
>  		return -EINVAL;
>  
> -	return gpio_get_value(host->wp_gpio);
> +	ret = gpio_get_value(host->wp_gpio);
> +
> +	if (host->wp_inverted)
> +		ret = !ret;
> +
> +	return ret;
>  }
>  
>  static int mxs_mmc_get_cd(struct mmc_host *mmc)
> @@ -786,6 +793,8 @@ static int mxs_mmc_probe(struct platform_device *pdev)
>  		else if (bus_width == 8)
>  			mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
>  		host->wp_gpio = of_get_named_gpio(np, "wp-gpios", 0);
> +		if (of_find_property(np, "wp-inverted", NULL))
> +			host->wp_inverted = 1;
>
Why not simply specify the GPIO in question as being active-low in the
GPIO definition and use of_get_named_gpio_flags()?


Lothar Wa?mann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstra?e 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Gesch?ftsf?hrer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info at karo-electronics.de
___________________________________________________________

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

* [PATCH 4/4] MXS-MMC: Add wp-inverted property
  2012-05-21  7:22   ` Lothar Waßmann
@ 2012-05-21 17:38     ` Marek Vasut
  0 siblings, 0 replies; 43+ messages in thread
From: Marek Vasut @ 2012-05-21 17:38 UTC (permalink / raw)
  To: linux-arm-kernel

Dear Lothar Wa?mann,

> Hi,
> 
> Marek Vasut writes:
> > The write-protect GPIO is inverted on some boards. Handle such case.
> > 
> > Signed-off-by: Marek Vasut <marex@denx.de>
> > Cc: Shawn Guo <shawn.guo@linaro.org>
> > Cc: Fabio Estevam <fabio.estevam@freescale.com>
> > ---
> > 
> >  Documentation/devicetree/bindings/mmc/mxs-mmc.txt |    1 +
> >  drivers/mmc/host/mxs-mmc.c                        |   11 ++++++++++-
> >  2 files changed, 11 insertions(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
> > b/Documentation/devicetree/bindings/mmc/mxs-mmc.txt index
> > 14d870a..0a7d2cd 100644
> > --- a/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
> > +++ b/Documentation/devicetree/bindings/mmc/mxs-mmc.txt
> > 
> > @@ -13,6 +13,7 @@ Required properties:
> >  Optional properties:
> >  - wp-gpios: Specify GPIOs for write protection
> > 
> > +- wp-inverted: Set if the write protection GPIO is inverted
> > 
> >  Examples:
> > diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
> > index 277161d..119beb9 100644
> > --- a/drivers/mmc/host/mxs-mmc.c
> > +++ b/drivers/mmc/host/mxs-mmc.c
> > @@ -164,16 +164,23 @@ struct mxs_mmc_host {
> > 
> >  	spinlock_t			lock;
> >  	int				sdio_irq_en;
> >  	int				wp_gpio;
> > 
> > +	int				wp_inverted:1;
> > 
> >  };
> >  
> >  static int mxs_mmc_get_ro(struct mmc_host *mmc)
> >  {
> >  
> >  	struct mxs_mmc_host *host = mmc_priv(mmc);
> > 
> > +	int ret;
> > 
> >  	if (!gpio_is_valid(host->wp_gpio))
> >  	
> >  		return -EINVAL;
> > 
> > -	return gpio_get_value(host->wp_gpio);
> > +	ret = gpio_get_value(host->wp_gpio);
> > +
> > +	if (host->wp_inverted)
> > +		ret = !ret;
> > +
> > +	return ret;
> > 
> >  }
> >  
> >  static int mxs_mmc_get_cd(struct mmc_host *mmc)
> > 
> > @@ -786,6 +793,8 @@ static int mxs_mmc_probe(struct platform_device
> > *pdev)
> > 
> >  		else if (bus_width == 8)
> >  		
> >  			mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
> >  		
> >  		host->wp_gpio = of_get_named_gpio(np, "wp-gpios", 0);
> > 
> > +		if (of_find_property(np, "wp-inverted", NULL))
> > +			host->wp_inverted = 1;
> 
> Why not simply specify the GPIO in question as being active-low in the
> GPIO definition and use of_get_named_gpio_flags()?

Just followed the cd-inverted pattern. Thanks for the hint, will poke into it.

> 
> Lothar Wa?mann

Best regards,
Marek Vasut

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

end of thread, other threads:[~2012-05-21 17:38 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-21  1:02 [PATCH 1/4] GPMI-NAND: Define ecc.strength Marek Vasut
2012-05-21  1:02 ` [PATCH 2/4] GPMI-NAND: Fixup compile issue Marek Vasut
2012-05-21  1:16   ` Shawn Guo
2012-05-21  1:02 ` [PATCH 3/4] MXS-MMC: Move of_match_table out of CONFIG_PM Marek Vasut
2012-05-21  4:09   ` Shawn Guo
2012-05-21  4:09     ` Shawn Guo
2012-05-21  3:52     ` Chris Ball
2012-05-21  3:52       ` Chris Ball
2012-05-21  4:33       ` Marek Vasut
2012-05-21  4:33         ` Marek Vasut
2012-05-21  1:02 ` [PATCH 4/4] MXS-MMC: Add wp-inverted property Marek Vasut
2012-05-21  1:39   ` Shawn Guo
2012-05-21  1:39     ` Shawn Guo
2012-05-21  2:38     ` Marek Vasut
2012-05-21  2:38       ` Marek Vasut
2012-05-21  2:48       ` Shawn Guo
2012-05-21  2:48         ` Shawn Guo
2012-05-21  3:22         ` Chris Ball
2012-05-21  3:22           ` Chris Ball
2012-05-21  3:36           ` Marek Vasut
2012-05-21  3:36             ` Marek Vasut
2012-05-21  7:22   ` Lothar Waßmann
2012-05-21 17:38     ` Marek Vasut
2012-05-21  1:14 ` [PATCH 1/4] GPMI-NAND: Define ecc.strength Shawn Guo
2012-05-21  1:14   ` Shawn Guo
2012-05-21  1:36   ` Marek Vasut
2012-05-21  1:36     ` Marek Vasut
2012-05-21  1:41     ` Shawn Guo
2012-05-21  1:41       ` Shawn Guo
2012-05-21  2:40       ` Marek Vasut
2012-05-21  2:40         ` Marek Vasut
2012-05-21  3:08         ` Huang Shijie
2012-05-21  3:08           ` Huang Shijie
2012-05-21  3:48           ` Marek Vasut
2012-05-21  3:48             ` Marek Vasut
2012-05-21  3:45         ` Shawn Guo
2012-05-21  3:45           ` Shawn Guo
2012-05-21  3:39           ` Marek Vasut
2012-05-21  3:39             ` Marek Vasut
2012-05-21  2:44       ` Huang Shijie
2012-05-21  2:44         ` Huang Shijie
2012-05-21  3:43         ` Marek Vasut
2012-05-21  3:43           ` Marek Vasut

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.