* [PATCH 0/4] meson-nand: small code improvements @ 2019-04-11 22:00 ` Martin Blumenstingl 0 siblings, 0 replies; 52+ messages in thread From: Martin Blumenstingl @ 2019-04-11 22:00 UTC (permalink / raw) To: liang.yang, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, Martin Blumenstingl, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel This series comes with four small improvements for the meson-nand driver: * the first patches are replacing open-coded logic with existing utilities / helpers * the third patch drops some unnecessary casting after changing the type of the info buffer parameter from "u8 *" to "void *" * the fourth patch adjusts the usage of init_completion with what the documentation suggests I have tested these patches as best as I could on my Meson8m2 board using experimental patches on top of this series which add support for this older SoC to the meson-nand driver. Liang, can you please test this series on GXL and/or AXG so I don't break the NFC driver on these newer SoCs? All of my GXL/GXM boards have eMMC instead of raw NAND, so I cannot test it on these newer SoCs myself. This series is meant to be applied to the nand/next tree. Martin Blumenstingl (4): mtd: rawnand: meson: use struct_size macro mtd: rawnand: meson: use of_property_count_elems_of_size helper mtd: rawnand: meson: use a void pointer for meson_nfc_dma_buffer_setup mtd: rawnand: meson: only initialize the RB completion once drivers/mtd/nand/raw/meson_nand.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) -- 2.21.0 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic ^ permalink raw reply [flat|nested] 52+ messages in thread
* [PATCH 0/4] meson-nand: small code improvements @ 2019-04-11 22:00 ` Martin Blumenstingl 0 siblings, 0 replies; 52+ messages in thread From: Martin Blumenstingl @ 2019-04-11 22:00 UTC (permalink / raw) To: liang.yang, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: linux-arm-kernel, marek.vasut, linux-kernel, computersforpeace, dwmw2, bbrezillon, jianxin.pan, Martin Blumenstingl This series comes with four small improvements for the meson-nand driver: * the first patches are replacing open-coded logic with existing utilities / helpers * the third patch drops some unnecessary casting after changing the type of the info buffer parameter from "u8 *" to "void *" * the fourth patch adjusts the usage of init_completion with what the documentation suggests I have tested these patches as best as I could on my Meson8m2 board using experimental patches on top of this series which add support for this older SoC to the meson-nand driver. Liang, can you please test this series on GXL and/or AXG so I don't break the NFC driver on these newer SoCs? All of my GXL/GXM boards have eMMC instead of raw NAND, so I cannot test it on these newer SoCs myself. This series is meant to be applied to the nand/next tree. Martin Blumenstingl (4): mtd: rawnand: meson: use struct_size macro mtd: rawnand: meson: use of_property_count_elems_of_size helper mtd: rawnand: meson: use a void pointer for meson_nfc_dma_buffer_setup mtd: rawnand: meson: only initialize the RB completion once drivers/mtd/nand/raw/meson_nand.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) -- 2.21.0 ^ permalink raw reply [flat|nested] 52+ messages in thread
* [PATCH 0/4] meson-nand: small code improvements @ 2019-04-11 22:00 ` Martin Blumenstingl 0 siblings, 0 replies; 52+ messages in thread From: Martin Blumenstingl @ 2019-04-11 22:00 UTC (permalink / raw) To: liang.yang, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, Martin Blumenstingl, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel This series comes with four small improvements for the meson-nand driver: * the first patches are replacing open-coded logic with existing utilities / helpers * the third patch drops some unnecessary casting after changing the type of the info buffer parameter from "u8 *" to "void *" * the fourth patch adjusts the usage of init_completion with what the documentation suggests I have tested these patches as best as I could on my Meson8m2 board using experimental patches on top of this series which add support for this older SoC to the meson-nand driver. Liang, can you please test this series on GXL and/or AXG so I don't break the NFC driver on these newer SoCs? All of my GXL/GXM boards have eMMC instead of raw NAND, so I cannot test it on these newer SoCs myself. This series is meant to be applied to the nand/next tree. Martin Blumenstingl (4): mtd: rawnand: meson: use struct_size macro mtd: rawnand: meson: use of_property_count_elems_of_size helper mtd: rawnand: meson: use a void pointer for meson_nfc_dma_buffer_setup mtd: rawnand: meson: only initialize the RB completion once drivers/mtd/nand/raw/meson_nand.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) -- 2.21.0 _______________________________________________ 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] 52+ messages in thread
* [PATCH 0/4] meson-nand: small code improvements @ 2019-04-11 22:00 ` Martin Blumenstingl 0 siblings, 0 replies; 52+ messages in thread From: Martin Blumenstingl @ 2019-04-11 22:00 UTC (permalink / raw) To: liang.yang, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, Martin Blumenstingl, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel This series comes with four small improvements for the meson-nand driver: * the first patches are replacing open-coded logic with existing utilities / helpers * the third patch drops some unnecessary casting after changing the type of the info buffer parameter from "u8 *" to "void *" * the fourth patch adjusts the usage of init_completion with what the documentation suggests I have tested these patches as best as I could on my Meson8m2 board using experimental patches on top of this series which add support for this older SoC to the meson-nand driver. Liang, can you please test this series on GXL and/or AXG so I don't break the NFC driver on these newer SoCs? All of my GXL/GXM boards have eMMC instead of raw NAND, so I cannot test it on these newer SoCs myself. This series is meant to be applied to the nand/next tree. Martin Blumenstingl (4): mtd: rawnand: meson: use struct_size macro mtd: rawnand: meson: use of_property_count_elems_of_size helper mtd: rawnand: meson: use a void pointer for meson_nfc_dma_buffer_setup mtd: rawnand: meson: only initialize the RB completion once drivers/mtd/nand/raw/meson_nand.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) -- 2.21.0 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ ^ permalink raw reply [flat|nested] 52+ messages in thread
* [PATCH 1/4] mtd: rawnand: meson: use struct_size macro 2019-04-11 22:00 ` Martin Blumenstingl (?) (?) @ 2019-04-11 22:00 ` Martin Blumenstingl -1 siblings, 0 replies; 52+ messages in thread From: Martin Blumenstingl @ 2019-04-11 22:00 UTC (permalink / raw) To: liang.yang, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, Martin Blumenstingl, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel Use the recently introduced struct_size macro instead of open-coding it's logic. No functional changes. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> --- drivers/mtd/nand/raw/meson_nand.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c index cb0b03e36a35..c1a6af57dab5 100644 --- a/drivers/mtd/nand/raw/meson_nand.c +++ b/drivers/mtd/nand/raw/meson_nand.c @@ -1242,8 +1242,7 @@ meson_nfc_nand_chip_init(struct device *dev, return -EINVAL; } - meson_chip = devm_kzalloc(dev, - sizeof(*meson_chip) + (nsels * sizeof(u8)), + meson_chip = devm_kzalloc(dev, struct_size(meson_chip, sels, nsels), GFP_KERNEL); if (!meson_chip) return -ENOMEM; -- 2.21.0 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic ^ permalink raw reply related [flat|nested] 52+ messages in thread
* [PATCH 1/4] mtd: rawnand: meson: use struct_size macro @ 2019-04-11 22:00 ` Martin Blumenstingl 0 siblings, 0 replies; 52+ messages in thread From: Martin Blumenstingl @ 2019-04-11 22:00 UTC (permalink / raw) To: liang.yang, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: linux-arm-kernel, marek.vasut, linux-kernel, computersforpeace, dwmw2, bbrezillon, jianxin.pan, Martin Blumenstingl Use the recently introduced struct_size macro instead of open-coding it's logic. No functional changes. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> --- drivers/mtd/nand/raw/meson_nand.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c index cb0b03e36a35..c1a6af57dab5 100644 --- a/drivers/mtd/nand/raw/meson_nand.c +++ b/drivers/mtd/nand/raw/meson_nand.c @@ -1242,8 +1242,7 @@ meson_nfc_nand_chip_init(struct device *dev, return -EINVAL; } - meson_chip = devm_kzalloc(dev, - sizeof(*meson_chip) + (nsels * sizeof(u8)), + meson_chip = devm_kzalloc(dev, struct_size(meson_chip, sels, nsels), GFP_KERNEL); if (!meson_chip) return -ENOMEM; -- 2.21.0 ^ permalink raw reply related [flat|nested] 52+ messages in thread
* [PATCH 1/4] mtd: rawnand: meson: use struct_size macro @ 2019-04-11 22:00 ` Martin Blumenstingl 0 siblings, 0 replies; 52+ messages in thread From: Martin Blumenstingl @ 2019-04-11 22:00 UTC (permalink / raw) To: liang.yang, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, Martin Blumenstingl, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel Use the recently introduced struct_size macro instead of open-coding it's logic. No functional changes. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> --- drivers/mtd/nand/raw/meson_nand.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c index cb0b03e36a35..c1a6af57dab5 100644 --- a/drivers/mtd/nand/raw/meson_nand.c +++ b/drivers/mtd/nand/raw/meson_nand.c @@ -1242,8 +1242,7 @@ meson_nfc_nand_chip_init(struct device *dev, return -EINVAL; } - meson_chip = devm_kzalloc(dev, - sizeof(*meson_chip) + (nsels * sizeof(u8)), + meson_chip = devm_kzalloc(dev, struct_size(meson_chip, sels, nsels), GFP_KERNEL); if (!meson_chip) return -ENOMEM; -- 2.21.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 52+ messages in thread
* [PATCH 1/4] mtd: rawnand: meson: use struct_size macro @ 2019-04-11 22:00 ` Martin Blumenstingl 0 siblings, 0 replies; 52+ messages in thread From: Martin Blumenstingl @ 2019-04-11 22:00 UTC (permalink / raw) To: liang.yang, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, Martin Blumenstingl, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel Use the recently introduced struct_size macro instead of open-coding it's logic. No functional changes. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> --- drivers/mtd/nand/raw/meson_nand.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c index cb0b03e36a35..c1a6af57dab5 100644 --- a/drivers/mtd/nand/raw/meson_nand.c +++ b/drivers/mtd/nand/raw/meson_nand.c @@ -1242,8 +1242,7 @@ meson_nfc_nand_chip_init(struct device *dev, return -EINVAL; } - meson_chip = devm_kzalloc(dev, - sizeof(*meson_chip) + (nsels * sizeof(u8)), + meson_chip = devm_kzalloc(dev, struct_size(meson_chip, sels, nsels), GFP_KERNEL); if (!meson_chip) return -ENOMEM; -- 2.21.0 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ ^ permalink raw reply related [flat|nested] 52+ messages in thread
* Re: [PATCH 1/4] mtd: rawnand: meson: use struct_size macro 2019-04-11 22:00 ` Martin Blumenstingl (?) (?) @ 2019-04-15 6:01 ` Liang Yang -1 siblings, 0 replies; 52+ messages in thread From: Liang Yang @ 2019-04-15 6:01 UTC (permalink / raw) To: Martin Blumenstingl, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel Hello Martin and Miquel, On 2019/4/12 6:00, Martin Blumenstingl wrote: > Use the recently introduced struct_size macro instead of open-coding > it's logic. > No functional changes. > > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> > --- > drivers/mtd/nand/raw/meson_nand.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > index cb0b03e36a35..c1a6af57dab5 100644 > --- a/drivers/mtd/nand/raw/meson_nand.c > +++ b/drivers/mtd/nand/raw/meson_nand.c > @@ -1242,8 +1242,7 @@ meson_nfc_nand_chip_init(struct device *dev, > return -EINVAL; > } > > - meson_chip = devm_kzalloc(dev, > - sizeof(*meson_chip) + (nsels * sizeof(u8)), > + meson_chip = devm_kzalloc(dev, struct_size(meson_chip, sels, nsels), > GFP_KERNEL); Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > if (!meson_chip) > return -ENOMEM; > _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic ^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 1/4] mtd: rawnand: meson: use struct_size macro @ 2019-04-15 6:01 ` Liang Yang 0 siblings, 0 replies; 52+ messages in thread From: Liang Yang @ 2019-04-15 6:01 UTC (permalink / raw) To: Martin Blumenstingl, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: linux-arm-kernel, marek.vasut, linux-kernel, computersforpeace, dwmw2, bbrezillon, jianxin.pan Hello Martin and Miquel, On 2019/4/12 6:00, Martin Blumenstingl wrote: > Use the recently introduced struct_size macro instead of open-coding > it's logic. > No functional changes. > > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> > --- > drivers/mtd/nand/raw/meson_nand.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > index cb0b03e36a35..c1a6af57dab5 100644 > --- a/drivers/mtd/nand/raw/meson_nand.c > +++ b/drivers/mtd/nand/raw/meson_nand.c > @@ -1242,8 +1242,7 @@ meson_nfc_nand_chip_init(struct device *dev, > return -EINVAL; > } > > - meson_chip = devm_kzalloc(dev, > - sizeof(*meson_chip) + (nsels * sizeof(u8)), > + meson_chip = devm_kzalloc(dev, struct_size(meson_chip, sels, nsels), > GFP_KERNEL); Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > if (!meson_chip) > return -ENOMEM; > ^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 1/4] mtd: rawnand: meson: use struct_size macro @ 2019-04-15 6:01 ` Liang Yang 0 siblings, 0 replies; 52+ messages in thread From: Liang Yang @ 2019-04-15 6:01 UTC (permalink / raw) To: Martin Blumenstingl, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel Hello Martin and Miquel, On 2019/4/12 6:00, Martin Blumenstingl wrote: > Use the recently introduced struct_size macro instead of open-coding > it's logic. > No functional changes. > > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> > --- > drivers/mtd/nand/raw/meson_nand.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > index cb0b03e36a35..c1a6af57dab5 100644 > --- a/drivers/mtd/nand/raw/meson_nand.c > +++ b/drivers/mtd/nand/raw/meson_nand.c > @@ -1242,8 +1242,7 @@ meson_nfc_nand_chip_init(struct device *dev, > return -EINVAL; > } > > - meson_chip = devm_kzalloc(dev, > - sizeof(*meson_chip) + (nsels * sizeof(u8)), > + meson_chip = devm_kzalloc(dev, struct_size(meson_chip, sels, nsels), > GFP_KERNEL); Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > if (!meson_chip) > return -ENOMEM; > _______________________________________________ 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] 52+ messages in thread
* Re: [PATCH 1/4] mtd: rawnand: meson: use struct_size macro @ 2019-04-15 6:01 ` Liang Yang 0 siblings, 0 replies; 52+ messages in thread From: Liang Yang @ 2019-04-15 6:01 UTC (permalink / raw) To: Martin Blumenstingl, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel Hello Martin and Miquel, On 2019/4/12 6:00, Martin Blumenstingl wrote: > Use the recently introduced struct_size macro instead of open-coding > it's logic. > No functional changes. > > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> > --- > drivers/mtd/nand/raw/meson_nand.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > index cb0b03e36a35..c1a6af57dab5 100644 > --- a/drivers/mtd/nand/raw/meson_nand.c > +++ b/drivers/mtd/nand/raw/meson_nand.c > @@ -1242,8 +1242,7 @@ meson_nfc_nand_chip_init(struct device *dev, > return -EINVAL; > } > > - meson_chip = devm_kzalloc(dev, > - sizeof(*meson_chip) + (nsels * sizeof(u8)), > + meson_chip = devm_kzalloc(dev, struct_size(meson_chip, sels, nsels), > GFP_KERNEL); Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > if (!meson_chip) > return -ENOMEM; > ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ ^ permalink raw reply [flat|nested] 52+ messages in thread
* [PATCH 2/4] mtd: rawnand: meson: use of_property_count_elems_of_size helper 2019-04-11 22:00 ` Martin Blumenstingl (?) (?) @ 2019-04-11 22:00 ` Martin Blumenstingl -1 siblings, 0 replies; 52+ messages in thread From: Martin Blumenstingl @ 2019-04-11 22:00 UTC (permalink / raw) To: liang.yang, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, Martin Blumenstingl, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel Use the of_property_count_elems_of_size() helper instead of open-coding it's logic. As a bonus this will now error out if the "reg" property values use an incorrect size (anything other than sizeof(u32)). Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> --- drivers/mtd/nand/raw/meson_nand.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c index c1a6af57dab5..9a6023638101 100644 --- a/drivers/mtd/nand/raw/meson_nand.c +++ b/drivers/mtd/nand/raw/meson_nand.c @@ -1233,10 +1233,7 @@ meson_nfc_nand_chip_init(struct device *dev, int ret, i; u32 tmp, nsels; - if (!of_get_property(np, "reg", &nsels)) - return -EINVAL; - - nsels /= sizeof(u32); + nsels = of_property_count_elems_of_size(np, "reg", sizeof(u32)); if (!nsels || nsels > MAX_CE_NUM) { dev_err(dev, "invalid register property size\n"); return -EINVAL; -- 2.21.0 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic ^ permalink raw reply related [flat|nested] 52+ messages in thread
* [PATCH 2/4] mtd: rawnand: meson: use of_property_count_elems_of_size helper @ 2019-04-11 22:00 ` Martin Blumenstingl 0 siblings, 0 replies; 52+ messages in thread From: Martin Blumenstingl @ 2019-04-11 22:00 UTC (permalink / raw) To: liang.yang, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: linux-arm-kernel, marek.vasut, linux-kernel, computersforpeace, dwmw2, bbrezillon, jianxin.pan, Martin Blumenstingl Use the of_property_count_elems_of_size() helper instead of open-coding it's logic. As a bonus this will now error out if the "reg" property values use an incorrect size (anything other than sizeof(u32)). Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> --- drivers/mtd/nand/raw/meson_nand.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c index c1a6af57dab5..9a6023638101 100644 --- a/drivers/mtd/nand/raw/meson_nand.c +++ b/drivers/mtd/nand/raw/meson_nand.c @@ -1233,10 +1233,7 @@ meson_nfc_nand_chip_init(struct device *dev, int ret, i; u32 tmp, nsels; - if (!of_get_property(np, "reg", &nsels)) - return -EINVAL; - - nsels /= sizeof(u32); + nsels = of_property_count_elems_of_size(np, "reg", sizeof(u32)); if (!nsels || nsels > MAX_CE_NUM) { dev_err(dev, "invalid register property size\n"); return -EINVAL; -- 2.21.0 ^ permalink raw reply related [flat|nested] 52+ messages in thread
* [PATCH 2/4] mtd: rawnand: meson: use of_property_count_elems_of_size helper @ 2019-04-11 22:00 ` Martin Blumenstingl 0 siblings, 0 replies; 52+ messages in thread From: Martin Blumenstingl @ 2019-04-11 22:00 UTC (permalink / raw) To: liang.yang, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, Martin Blumenstingl, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel Use the of_property_count_elems_of_size() helper instead of open-coding it's logic. As a bonus this will now error out if the "reg" property values use an incorrect size (anything other than sizeof(u32)). Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> --- drivers/mtd/nand/raw/meson_nand.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c index c1a6af57dab5..9a6023638101 100644 --- a/drivers/mtd/nand/raw/meson_nand.c +++ b/drivers/mtd/nand/raw/meson_nand.c @@ -1233,10 +1233,7 @@ meson_nfc_nand_chip_init(struct device *dev, int ret, i; u32 tmp, nsels; - if (!of_get_property(np, "reg", &nsels)) - return -EINVAL; - - nsels /= sizeof(u32); + nsels = of_property_count_elems_of_size(np, "reg", sizeof(u32)); if (!nsels || nsels > MAX_CE_NUM) { dev_err(dev, "invalid register property size\n"); return -EINVAL; -- 2.21.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 52+ messages in thread
* [PATCH 2/4] mtd: rawnand: meson: use of_property_count_elems_of_size helper @ 2019-04-11 22:00 ` Martin Blumenstingl 0 siblings, 0 replies; 52+ messages in thread From: Martin Blumenstingl @ 2019-04-11 22:00 UTC (permalink / raw) To: liang.yang, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, Martin Blumenstingl, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel Use the of_property_count_elems_of_size() helper instead of open-coding it's logic. As a bonus this will now error out if the "reg" property values use an incorrect size (anything other than sizeof(u32)). Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> --- drivers/mtd/nand/raw/meson_nand.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c index c1a6af57dab5..9a6023638101 100644 --- a/drivers/mtd/nand/raw/meson_nand.c +++ b/drivers/mtd/nand/raw/meson_nand.c @@ -1233,10 +1233,7 @@ meson_nfc_nand_chip_init(struct device *dev, int ret, i; u32 tmp, nsels; - if (!of_get_property(np, "reg", &nsels)) - return -EINVAL; - - nsels /= sizeof(u32); + nsels = of_property_count_elems_of_size(np, "reg", sizeof(u32)); if (!nsels || nsels > MAX_CE_NUM) { dev_err(dev, "invalid register property size\n"); return -EINVAL; -- 2.21.0 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ ^ permalink raw reply related [flat|nested] 52+ messages in thread
* Re: [PATCH 2/4] mtd: rawnand: meson: use of_property_count_elems_of_size helper 2019-04-11 22:00 ` Martin Blumenstingl (?) (?) @ 2019-04-15 6:02 ` Liang Yang -1 siblings, 0 replies; 52+ messages in thread From: Liang Yang @ 2019-04-15 6:02 UTC (permalink / raw) To: Martin Blumenstingl, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel On 2019/4/12 6:00, Martin Blumenstingl wrote: > Use the of_property_count_elems_of_size() helper instead of open-coding > it's logic. As a bonus this will now error out if the "reg" property > values use an incorrect size (anything other than sizeof(u32)). > > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> > --- > drivers/mtd/nand/raw/meson_nand.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > index c1a6af57dab5..9a6023638101 100644 > --- a/drivers/mtd/nand/raw/meson_nand.c > +++ b/drivers/mtd/nand/raw/meson_nand.c > @@ -1233,10 +1233,7 @@ meson_nfc_nand_chip_init(struct device *dev, > int ret, i; > u32 tmp, nsels; > > - if (!of_get_property(np, "reg", &nsels)) > - return -EINVAL; > - > - nsels /= sizeof(u32); > + nsels = of_property_count_elems_of_size(np, "reg", sizeof(u32)); Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > if (!nsels || nsels > MAX_CE_NUM) { > dev_err(dev, "invalid register property size\n"); > return -EINVAL; > _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic ^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 2/4] mtd: rawnand: meson: use of_property_count_elems_of_size helper @ 2019-04-15 6:02 ` Liang Yang 0 siblings, 0 replies; 52+ messages in thread From: Liang Yang @ 2019-04-15 6:02 UTC (permalink / raw) To: Martin Blumenstingl, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: linux-arm-kernel, marek.vasut, linux-kernel, computersforpeace, dwmw2, bbrezillon, jianxin.pan On 2019/4/12 6:00, Martin Blumenstingl wrote: > Use the of_property_count_elems_of_size() helper instead of open-coding > it's logic. As a bonus this will now error out if the "reg" property > values use an incorrect size (anything other than sizeof(u32)). > > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> > --- > drivers/mtd/nand/raw/meson_nand.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > index c1a6af57dab5..9a6023638101 100644 > --- a/drivers/mtd/nand/raw/meson_nand.c > +++ b/drivers/mtd/nand/raw/meson_nand.c > @@ -1233,10 +1233,7 @@ meson_nfc_nand_chip_init(struct device *dev, > int ret, i; > u32 tmp, nsels; > > - if (!of_get_property(np, "reg", &nsels)) > - return -EINVAL; > - > - nsels /= sizeof(u32); > + nsels = of_property_count_elems_of_size(np, "reg", sizeof(u32)); Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > if (!nsels || nsels > MAX_CE_NUM) { > dev_err(dev, "invalid register property size\n"); > return -EINVAL; > ^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 2/4] mtd: rawnand: meson: use of_property_count_elems_of_size helper @ 2019-04-15 6:02 ` Liang Yang 0 siblings, 0 replies; 52+ messages in thread From: Liang Yang @ 2019-04-15 6:02 UTC (permalink / raw) To: Martin Blumenstingl, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel On 2019/4/12 6:00, Martin Blumenstingl wrote: > Use the of_property_count_elems_of_size() helper instead of open-coding > it's logic. As a bonus this will now error out if the "reg" property > values use an incorrect size (anything other than sizeof(u32)). > > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> > --- > drivers/mtd/nand/raw/meson_nand.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > index c1a6af57dab5..9a6023638101 100644 > --- a/drivers/mtd/nand/raw/meson_nand.c > +++ b/drivers/mtd/nand/raw/meson_nand.c > @@ -1233,10 +1233,7 @@ meson_nfc_nand_chip_init(struct device *dev, > int ret, i; > u32 tmp, nsels; > > - if (!of_get_property(np, "reg", &nsels)) > - return -EINVAL; > - > - nsels /= sizeof(u32); > + nsels = of_property_count_elems_of_size(np, "reg", sizeof(u32)); Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > if (!nsels || nsels > MAX_CE_NUM) { > dev_err(dev, "invalid register property size\n"); > return -EINVAL; > _______________________________________________ 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] 52+ messages in thread
* Re: [PATCH 2/4] mtd: rawnand: meson: use of_property_count_elems_of_size helper @ 2019-04-15 6:02 ` Liang Yang 0 siblings, 0 replies; 52+ messages in thread From: Liang Yang @ 2019-04-15 6:02 UTC (permalink / raw) To: Martin Blumenstingl, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel On 2019/4/12 6:00, Martin Blumenstingl wrote: > Use the of_property_count_elems_of_size() helper instead of open-coding > it's logic. As a bonus this will now error out if the "reg" property > values use an incorrect size (anything other than sizeof(u32)). > > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> > --- > drivers/mtd/nand/raw/meson_nand.c | 5 +---- > 1 file changed, 1 insertion(+), 4 deletions(-) > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > index c1a6af57dab5..9a6023638101 100644 > --- a/drivers/mtd/nand/raw/meson_nand.c > +++ b/drivers/mtd/nand/raw/meson_nand.c > @@ -1233,10 +1233,7 @@ meson_nfc_nand_chip_init(struct device *dev, > int ret, i; > u32 tmp, nsels; > > - if (!of_get_property(np, "reg", &nsels)) > - return -EINVAL; > - > - nsels /= sizeof(u32); > + nsels = of_property_count_elems_of_size(np, "reg", sizeof(u32)); Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > if (!nsels || nsels > MAX_CE_NUM) { > dev_err(dev, "invalid register property size\n"); > return -EINVAL; > ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ ^ permalink raw reply [flat|nested] 52+ messages in thread
* [PATCH 3/4] mtd: rawnand: meson: use a void pointer for meson_nfc_dma_buffer_setup 2019-04-11 22:00 ` Martin Blumenstingl (?) (?) @ 2019-04-11 22:00 ` Martin Blumenstingl -1 siblings, 0 replies; 52+ messages in thread From: Martin Blumenstingl @ 2019-04-11 22:00 UTC (permalink / raw) To: liang.yang, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, Martin Blumenstingl, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel This simplifies the code because it gets rid of the casts to an u8-pointer when passing "info_buf" from struct meson_nfc_nand_chip. Also it gets rid of the cast of the u8 databuf pointer to a void pointer. The logic inside meson_nfc_dma_buffer_setup() doesn't care about the pointer types themselves because it only passes them to dma_map_single which accepts a void pointer. No functional changes. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> --- drivers/mtd/nand/raw/meson_nand.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c index 9a6023638101..57cc4bd3f665 100644 --- a/drivers/mtd/nand/raw/meson_nand.c +++ b/drivers/mtd/nand/raw/meson_nand.c @@ -470,15 +470,15 @@ static int meson_nfc_ecc_correct(struct nand_chip *nand, u32 *bitflips, return ret; } -static int meson_nfc_dma_buffer_setup(struct nand_chip *nand, u8 *databuf, - int datalen, u8 *infobuf, int infolen, +static int meson_nfc_dma_buffer_setup(struct nand_chip *nand, void *databuf, + int datalen, void *infobuf, int infolen, enum dma_data_direction dir) { struct meson_nfc *nfc = nand_get_controller_data(nand); u32 cmd; int ret = 0; - nfc->daddr = dma_map_single(nfc->dev, (void *)databuf, datalen, dir); + nfc->daddr = dma_map_single(nfc->dev, databuf, datalen, dir); ret = dma_mapping_error(nfc->dev, nfc->daddr); if (ret) { dev_err(nfc->dev, "DMA mapping error\n"); @@ -645,7 +645,7 @@ static int meson_nfc_write_page_sub(struct nand_chip *nand, return ret; ret = meson_nfc_dma_buffer_setup(nand, meson_chip->data_buf, - data_len, (u8 *)meson_chip->info_buf, + data_len, meson_chip->info_buf, info_len, DMA_TO_DEVICE); if (ret) return ret; @@ -729,7 +729,7 @@ static int meson_nfc_read_page_sub(struct nand_chip *nand, return ret; ret = meson_nfc_dma_buffer_setup(nand, meson_chip->data_buf, - data_len, (u8 *)meson_chip->info_buf, + data_len, meson_chip->info_buf, info_len, DMA_FROM_DEVICE); if (ret) return ret; -- 2.21.0 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic ^ permalink raw reply related [flat|nested] 52+ messages in thread
* [PATCH 3/4] mtd: rawnand: meson: use a void pointer for meson_nfc_dma_buffer_setup @ 2019-04-11 22:00 ` Martin Blumenstingl 0 siblings, 0 replies; 52+ messages in thread From: Martin Blumenstingl @ 2019-04-11 22:00 UTC (permalink / raw) To: liang.yang, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: linux-arm-kernel, marek.vasut, linux-kernel, computersforpeace, dwmw2, bbrezillon, jianxin.pan, Martin Blumenstingl This simplifies the code because it gets rid of the casts to an u8-pointer when passing "info_buf" from struct meson_nfc_nand_chip. Also it gets rid of the cast of the u8 databuf pointer to a void pointer. The logic inside meson_nfc_dma_buffer_setup() doesn't care about the pointer types themselves because it only passes them to dma_map_single which accepts a void pointer. No functional changes. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> --- drivers/mtd/nand/raw/meson_nand.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c index 9a6023638101..57cc4bd3f665 100644 --- a/drivers/mtd/nand/raw/meson_nand.c +++ b/drivers/mtd/nand/raw/meson_nand.c @@ -470,15 +470,15 @@ static int meson_nfc_ecc_correct(struct nand_chip *nand, u32 *bitflips, return ret; } -static int meson_nfc_dma_buffer_setup(struct nand_chip *nand, u8 *databuf, - int datalen, u8 *infobuf, int infolen, +static int meson_nfc_dma_buffer_setup(struct nand_chip *nand, void *databuf, + int datalen, void *infobuf, int infolen, enum dma_data_direction dir) { struct meson_nfc *nfc = nand_get_controller_data(nand); u32 cmd; int ret = 0; - nfc->daddr = dma_map_single(nfc->dev, (void *)databuf, datalen, dir); + nfc->daddr = dma_map_single(nfc->dev, databuf, datalen, dir); ret = dma_mapping_error(nfc->dev, nfc->daddr); if (ret) { dev_err(nfc->dev, "DMA mapping error\n"); @@ -645,7 +645,7 @@ static int meson_nfc_write_page_sub(struct nand_chip *nand, return ret; ret = meson_nfc_dma_buffer_setup(nand, meson_chip->data_buf, - data_len, (u8 *)meson_chip->info_buf, + data_len, meson_chip->info_buf, info_len, DMA_TO_DEVICE); if (ret) return ret; @@ -729,7 +729,7 @@ static int meson_nfc_read_page_sub(struct nand_chip *nand, return ret; ret = meson_nfc_dma_buffer_setup(nand, meson_chip->data_buf, - data_len, (u8 *)meson_chip->info_buf, + data_len, meson_chip->info_buf, info_len, DMA_FROM_DEVICE); if (ret) return ret; -- 2.21.0 ^ permalink raw reply related [flat|nested] 52+ messages in thread
* [PATCH 3/4] mtd: rawnand: meson: use a void pointer for meson_nfc_dma_buffer_setup @ 2019-04-11 22:00 ` Martin Blumenstingl 0 siblings, 0 replies; 52+ messages in thread From: Martin Blumenstingl @ 2019-04-11 22:00 UTC (permalink / raw) To: liang.yang, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, Martin Blumenstingl, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel This simplifies the code because it gets rid of the casts to an u8-pointer when passing "info_buf" from struct meson_nfc_nand_chip. Also it gets rid of the cast of the u8 databuf pointer to a void pointer. The logic inside meson_nfc_dma_buffer_setup() doesn't care about the pointer types themselves because it only passes them to dma_map_single which accepts a void pointer. No functional changes. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> --- drivers/mtd/nand/raw/meson_nand.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c index 9a6023638101..57cc4bd3f665 100644 --- a/drivers/mtd/nand/raw/meson_nand.c +++ b/drivers/mtd/nand/raw/meson_nand.c @@ -470,15 +470,15 @@ static int meson_nfc_ecc_correct(struct nand_chip *nand, u32 *bitflips, return ret; } -static int meson_nfc_dma_buffer_setup(struct nand_chip *nand, u8 *databuf, - int datalen, u8 *infobuf, int infolen, +static int meson_nfc_dma_buffer_setup(struct nand_chip *nand, void *databuf, + int datalen, void *infobuf, int infolen, enum dma_data_direction dir) { struct meson_nfc *nfc = nand_get_controller_data(nand); u32 cmd; int ret = 0; - nfc->daddr = dma_map_single(nfc->dev, (void *)databuf, datalen, dir); + nfc->daddr = dma_map_single(nfc->dev, databuf, datalen, dir); ret = dma_mapping_error(nfc->dev, nfc->daddr); if (ret) { dev_err(nfc->dev, "DMA mapping error\n"); @@ -645,7 +645,7 @@ static int meson_nfc_write_page_sub(struct nand_chip *nand, return ret; ret = meson_nfc_dma_buffer_setup(nand, meson_chip->data_buf, - data_len, (u8 *)meson_chip->info_buf, + data_len, meson_chip->info_buf, info_len, DMA_TO_DEVICE); if (ret) return ret; @@ -729,7 +729,7 @@ static int meson_nfc_read_page_sub(struct nand_chip *nand, return ret; ret = meson_nfc_dma_buffer_setup(nand, meson_chip->data_buf, - data_len, (u8 *)meson_chip->info_buf, + data_len, meson_chip->info_buf, info_len, DMA_FROM_DEVICE); if (ret) return ret; -- 2.21.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 52+ messages in thread
* [PATCH 3/4] mtd: rawnand: meson: use a void pointer for meson_nfc_dma_buffer_setup @ 2019-04-11 22:00 ` Martin Blumenstingl 0 siblings, 0 replies; 52+ messages in thread From: Martin Blumenstingl @ 2019-04-11 22:00 UTC (permalink / raw) To: liang.yang, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, Martin Blumenstingl, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel This simplifies the code because it gets rid of the casts to an u8-pointer when passing "info_buf" from struct meson_nfc_nand_chip. Also it gets rid of the cast of the u8 databuf pointer to a void pointer. The logic inside meson_nfc_dma_buffer_setup() doesn't care about the pointer types themselves because it only passes them to dma_map_single which accepts a void pointer. No functional changes. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> --- drivers/mtd/nand/raw/meson_nand.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c index 9a6023638101..57cc4bd3f665 100644 --- a/drivers/mtd/nand/raw/meson_nand.c +++ b/drivers/mtd/nand/raw/meson_nand.c @@ -470,15 +470,15 @@ static int meson_nfc_ecc_correct(struct nand_chip *nand, u32 *bitflips, return ret; } -static int meson_nfc_dma_buffer_setup(struct nand_chip *nand, u8 *databuf, - int datalen, u8 *infobuf, int infolen, +static int meson_nfc_dma_buffer_setup(struct nand_chip *nand, void *databuf, + int datalen, void *infobuf, int infolen, enum dma_data_direction dir) { struct meson_nfc *nfc = nand_get_controller_data(nand); u32 cmd; int ret = 0; - nfc->daddr = dma_map_single(nfc->dev, (void *)databuf, datalen, dir); + nfc->daddr = dma_map_single(nfc->dev, databuf, datalen, dir); ret = dma_mapping_error(nfc->dev, nfc->daddr); if (ret) { dev_err(nfc->dev, "DMA mapping error\n"); @@ -645,7 +645,7 @@ static int meson_nfc_write_page_sub(struct nand_chip *nand, return ret; ret = meson_nfc_dma_buffer_setup(nand, meson_chip->data_buf, - data_len, (u8 *)meson_chip->info_buf, + data_len, meson_chip->info_buf, info_len, DMA_TO_DEVICE); if (ret) return ret; @@ -729,7 +729,7 @@ static int meson_nfc_read_page_sub(struct nand_chip *nand, return ret; ret = meson_nfc_dma_buffer_setup(nand, meson_chip->data_buf, - data_len, (u8 *)meson_chip->info_buf, + data_len, meson_chip->info_buf, info_len, DMA_FROM_DEVICE); if (ret) return ret; -- 2.21.0 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ ^ permalink raw reply related [flat|nested] 52+ messages in thread
* Re: [PATCH 3/4] mtd: rawnand: meson: use a void pointer for meson_nfc_dma_buffer_setup 2019-04-11 22:00 ` Martin Blumenstingl (?) (?) @ 2019-04-15 6:03 ` Liang Yang -1 siblings, 0 replies; 52+ messages in thread From: Liang Yang @ 2019-04-15 6:03 UTC (permalink / raw) To: Martin Blumenstingl, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel On 2019/4/12 6:00, Martin Blumenstingl wrote: > This simplifies the code because it gets rid of the casts to an > u8-pointer when passing "info_buf" from struct meson_nfc_nand_chip. > Also it gets rid of the cast of the u8 databuf pointer to a void > pointer. > The logic inside meson_nfc_dma_buffer_setup() doesn't care about the > pointer types themselves because it only passes them to dma_map_single > which accepts a void pointer. > > No functional changes. > > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> > --- > drivers/mtd/nand/raw/meson_nand.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > index 9a6023638101..57cc4bd3f665 100644 > --- a/drivers/mtd/nand/raw/meson_nand.c > +++ b/drivers/mtd/nand/raw/meson_nand.c > @@ -470,15 +470,15 @@ static int meson_nfc_ecc_correct(struct nand_chip *nand, u32 *bitflips, > return ret; > } > > -static int meson_nfc_dma_buffer_setup(struct nand_chip *nand, u8 *databuf, > - int datalen, u8 *infobuf, int infolen, > +static int meson_nfc_dma_buffer_setup(struct nand_chip *nand, void *databuf, > + int datalen, void *infobuf, int infolen, > enum dma_data_direction dir) Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > { > struct meson_nfc *nfc = nand_get_controller_data(nand); > u32 cmd; > int ret = 0; > > - nfc->daddr = dma_map_single(nfc->dev, (void *)databuf, datalen, dir); > + nfc->daddr = dma_map_single(nfc->dev, databuf, datalen, dir); > ret = dma_mapping_error(nfc->dev, nfc->daddr); > if (ret) { > dev_err(nfc->dev, "DMA mapping error\n"); > @@ -645,7 +645,7 @@ static int meson_nfc_write_page_sub(struct nand_chip *nand, > return ret; > > ret = meson_nfc_dma_buffer_setup(nand, meson_chip->data_buf, > - data_len, (u8 *)meson_chip->info_buf, > + data_len, meson_chip->info_buf, > info_len, DMA_TO_DEVICE); Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > if (ret) > return ret; > @@ -729,7 +729,7 @@ static int meson_nfc_read_page_sub(struct nand_chip *nand, > return ret; > > ret = meson_nfc_dma_buffer_setup(nand, meson_chip->data_buf, > - data_len, (u8 *)meson_chip->info_buf, > + data_len, meson_chip->info_buf, Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > info_len, DMA_FROM_DEVICE); > if (ret) > return ret; > _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic ^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 3/4] mtd: rawnand: meson: use a void pointer for meson_nfc_dma_buffer_setup @ 2019-04-15 6:03 ` Liang Yang 0 siblings, 0 replies; 52+ messages in thread From: Liang Yang @ 2019-04-15 6:03 UTC (permalink / raw) To: Martin Blumenstingl, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: linux-arm-kernel, marek.vasut, linux-kernel, computersforpeace, dwmw2, bbrezillon, jianxin.pan On 2019/4/12 6:00, Martin Blumenstingl wrote: > This simplifies the code because it gets rid of the casts to an > u8-pointer when passing "info_buf" from struct meson_nfc_nand_chip. > Also it gets rid of the cast of the u8 databuf pointer to a void > pointer. > The logic inside meson_nfc_dma_buffer_setup() doesn't care about the > pointer types themselves because it only passes them to dma_map_single > which accepts a void pointer. > > No functional changes. > > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> > --- > drivers/mtd/nand/raw/meson_nand.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > index 9a6023638101..57cc4bd3f665 100644 > --- a/drivers/mtd/nand/raw/meson_nand.c > +++ b/drivers/mtd/nand/raw/meson_nand.c > @@ -470,15 +470,15 @@ static int meson_nfc_ecc_correct(struct nand_chip *nand, u32 *bitflips, > return ret; > } > > -static int meson_nfc_dma_buffer_setup(struct nand_chip *nand, u8 *databuf, > - int datalen, u8 *infobuf, int infolen, > +static int meson_nfc_dma_buffer_setup(struct nand_chip *nand, void *databuf, > + int datalen, void *infobuf, int infolen, > enum dma_data_direction dir) Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > { > struct meson_nfc *nfc = nand_get_controller_data(nand); > u32 cmd; > int ret = 0; > > - nfc->daddr = dma_map_single(nfc->dev, (void *)databuf, datalen, dir); > + nfc->daddr = dma_map_single(nfc->dev, databuf, datalen, dir); > ret = dma_mapping_error(nfc->dev, nfc->daddr); > if (ret) { > dev_err(nfc->dev, "DMA mapping error\n"); > @@ -645,7 +645,7 @@ static int meson_nfc_write_page_sub(struct nand_chip *nand, > return ret; > > ret = meson_nfc_dma_buffer_setup(nand, meson_chip->data_buf, > - data_len, (u8 *)meson_chip->info_buf, > + data_len, meson_chip->info_buf, > info_len, DMA_TO_DEVICE); Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > if (ret) > return ret; > @@ -729,7 +729,7 @@ static int meson_nfc_read_page_sub(struct nand_chip *nand, > return ret; > > ret = meson_nfc_dma_buffer_setup(nand, meson_chip->data_buf, > - data_len, (u8 *)meson_chip->info_buf, > + data_len, meson_chip->info_buf, Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > info_len, DMA_FROM_DEVICE); > if (ret) > return ret; > ^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 3/4] mtd: rawnand: meson: use a void pointer for meson_nfc_dma_buffer_setup @ 2019-04-15 6:03 ` Liang Yang 0 siblings, 0 replies; 52+ messages in thread From: Liang Yang @ 2019-04-15 6:03 UTC (permalink / raw) To: Martin Blumenstingl, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel On 2019/4/12 6:00, Martin Blumenstingl wrote: > This simplifies the code because it gets rid of the casts to an > u8-pointer when passing "info_buf" from struct meson_nfc_nand_chip. > Also it gets rid of the cast of the u8 databuf pointer to a void > pointer. > The logic inside meson_nfc_dma_buffer_setup() doesn't care about the > pointer types themselves because it only passes them to dma_map_single > which accepts a void pointer. > > No functional changes. > > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> > --- > drivers/mtd/nand/raw/meson_nand.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > index 9a6023638101..57cc4bd3f665 100644 > --- a/drivers/mtd/nand/raw/meson_nand.c > +++ b/drivers/mtd/nand/raw/meson_nand.c > @@ -470,15 +470,15 @@ static int meson_nfc_ecc_correct(struct nand_chip *nand, u32 *bitflips, > return ret; > } > > -static int meson_nfc_dma_buffer_setup(struct nand_chip *nand, u8 *databuf, > - int datalen, u8 *infobuf, int infolen, > +static int meson_nfc_dma_buffer_setup(struct nand_chip *nand, void *databuf, > + int datalen, void *infobuf, int infolen, > enum dma_data_direction dir) Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > { > struct meson_nfc *nfc = nand_get_controller_data(nand); > u32 cmd; > int ret = 0; > > - nfc->daddr = dma_map_single(nfc->dev, (void *)databuf, datalen, dir); > + nfc->daddr = dma_map_single(nfc->dev, databuf, datalen, dir); > ret = dma_mapping_error(nfc->dev, nfc->daddr); > if (ret) { > dev_err(nfc->dev, "DMA mapping error\n"); > @@ -645,7 +645,7 @@ static int meson_nfc_write_page_sub(struct nand_chip *nand, > return ret; > > ret = meson_nfc_dma_buffer_setup(nand, meson_chip->data_buf, > - data_len, (u8 *)meson_chip->info_buf, > + data_len, meson_chip->info_buf, > info_len, DMA_TO_DEVICE); Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > if (ret) > return ret; > @@ -729,7 +729,7 @@ static int meson_nfc_read_page_sub(struct nand_chip *nand, > return ret; > > ret = meson_nfc_dma_buffer_setup(nand, meson_chip->data_buf, > - data_len, (u8 *)meson_chip->info_buf, > + data_len, meson_chip->info_buf, Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > info_len, DMA_FROM_DEVICE); > if (ret) > return ret; > _______________________________________________ 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] 52+ messages in thread
* Re: [PATCH 3/4] mtd: rawnand: meson: use a void pointer for meson_nfc_dma_buffer_setup @ 2019-04-15 6:03 ` Liang Yang 0 siblings, 0 replies; 52+ messages in thread From: Liang Yang @ 2019-04-15 6:03 UTC (permalink / raw) To: Martin Blumenstingl, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel On 2019/4/12 6:00, Martin Blumenstingl wrote: > This simplifies the code because it gets rid of the casts to an > u8-pointer when passing "info_buf" from struct meson_nfc_nand_chip. > Also it gets rid of the cast of the u8 databuf pointer to a void > pointer. > The logic inside meson_nfc_dma_buffer_setup() doesn't care about the > pointer types themselves because it only passes them to dma_map_single > which accepts a void pointer. > > No functional changes. > > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> > --- > drivers/mtd/nand/raw/meson_nand.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > index 9a6023638101..57cc4bd3f665 100644 > --- a/drivers/mtd/nand/raw/meson_nand.c > +++ b/drivers/mtd/nand/raw/meson_nand.c > @@ -470,15 +470,15 @@ static int meson_nfc_ecc_correct(struct nand_chip *nand, u32 *bitflips, > return ret; > } > > -static int meson_nfc_dma_buffer_setup(struct nand_chip *nand, u8 *databuf, > - int datalen, u8 *infobuf, int infolen, > +static int meson_nfc_dma_buffer_setup(struct nand_chip *nand, void *databuf, > + int datalen, void *infobuf, int infolen, > enum dma_data_direction dir) Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > { > struct meson_nfc *nfc = nand_get_controller_data(nand); > u32 cmd; > int ret = 0; > > - nfc->daddr = dma_map_single(nfc->dev, (void *)databuf, datalen, dir); > + nfc->daddr = dma_map_single(nfc->dev, databuf, datalen, dir); > ret = dma_mapping_error(nfc->dev, nfc->daddr); > if (ret) { > dev_err(nfc->dev, "DMA mapping error\n"); > @@ -645,7 +645,7 @@ static int meson_nfc_write_page_sub(struct nand_chip *nand, > return ret; > > ret = meson_nfc_dma_buffer_setup(nand, meson_chip->data_buf, > - data_len, (u8 *)meson_chip->info_buf, > + data_len, meson_chip->info_buf, > info_len, DMA_TO_DEVICE); Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > if (ret) > return ret; > @@ -729,7 +729,7 @@ static int meson_nfc_read_page_sub(struct nand_chip *nand, > return ret; > > ret = meson_nfc_dma_buffer_setup(nand, meson_chip->data_buf, > - data_len, (u8 *)meson_chip->info_buf, > + data_len, meson_chip->info_buf, Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > info_len, DMA_FROM_DEVICE); > if (ret) > return ret; > ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ ^ permalink raw reply [flat|nested] 52+ messages in thread
* [PATCH 4/4] mtd: rawnand: meson: only initialize the RB completion once 2019-04-11 22:00 ` Martin Blumenstingl (?) (?) @ 2019-04-11 22:00 ` Martin Blumenstingl -1 siblings, 0 replies; 52+ messages in thread From: Martin Blumenstingl @ 2019-04-11 22:00 UTC (permalink / raw) To: liang.yang, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, Martin Blumenstingl, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel Documentation/scheduler/completion.txt states: Calling init_completion() on the same completion object twice is most likely a bug as it re-initializes the queue to an empty queue and enqueued tasks could get "lost" - use reinit_completion() in that case, but be aware of other races. Initialize nfc->completion in meson_nfc_probe using init_completion and change the call in meson_nfc_queue_rb to reinit_completion so the logic matches what the documentation suggests. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> --- drivers/mtd/nand/raw/meson_nand.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c index 57cc4bd3f665..ea57ddcec41e 100644 --- a/drivers/mtd/nand/raw/meson_nand.c +++ b/drivers/mtd/nand/raw/meson_nand.c @@ -400,7 +400,7 @@ static int meson_nfc_queue_rb(struct meson_nfc *nfc, int timeout_ms) cfg |= NFC_RB_IRQ_EN; writel(cfg, nfc->reg_base + NFC_REG_CFG); - init_completion(&nfc->completion); + reinit_completion(&nfc->completion); /* use the max erase time as the maximum clock for waiting R/B */ cmd = NFC_CMD_RB | NFC_CMD_RB_INT @@ -1380,6 +1380,7 @@ static int meson_nfc_probe(struct platform_device *pdev) nand_controller_init(&nfc->controller); INIT_LIST_HEAD(&nfc->chips); + init_completion(&nfc->completion); nfc->dev = dev; -- 2.21.0 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic ^ permalink raw reply related [flat|nested] 52+ messages in thread
* [PATCH 4/4] mtd: rawnand: meson: only initialize the RB completion once @ 2019-04-11 22:00 ` Martin Blumenstingl 0 siblings, 0 replies; 52+ messages in thread From: Martin Blumenstingl @ 2019-04-11 22:00 UTC (permalink / raw) To: liang.yang, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: linux-arm-kernel, marek.vasut, linux-kernel, computersforpeace, dwmw2, bbrezillon, jianxin.pan, Martin Blumenstingl Documentation/scheduler/completion.txt states: Calling init_completion() on the same completion object twice is most likely a bug as it re-initializes the queue to an empty queue and enqueued tasks could get "lost" - use reinit_completion() in that case, but be aware of other races. Initialize nfc->completion in meson_nfc_probe using init_completion and change the call in meson_nfc_queue_rb to reinit_completion so the logic matches what the documentation suggests. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> --- drivers/mtd/nand/raw/meson_nand.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c index 57cc4bd3f665..ea57ddcec41e 100644 --- a/drivers/mtd/nand/raw/meson_nand.c +++ b/drivers/mtd/nand/raw/meson_nand.c @@ -400,7 +400,7 @@ static int meson_nfc_queue_rb(struct meson_nfc *nfc, int timeout_ms) cfg |= NFC_RB_IRQ_EN; writel(cfg, nfc->reg_base + NFC_REG_CFG); - init_completion(&nfc->completion); + reinit_completion(&nfc->completion); /* use the max erase time as the maximum clock for waiting R/B */ cmd = NFC_CMD_RB | NFC_CMD_RB_INT @@ -1380,6 +1380,7 @@ static int meson_nfc_probe(struct platform_device *pdev) nand_controller_init(&nfc->controller); INIT_LIST_HEAD(&nfc->chips); + init_completion(&nfc->completion); nfc->dev = dev; -- 2.21.0 ^ permalink raw reply related [flat|nested] 52+ messages in thread
* [PATCH 4/4] mtd: rawnand: meson: only initialize the RB completion once @ 2019-04-11 22:00 ` Martin Blumenstingl 0 siblings, 0 replies; 52+ messages in thread From: Martin Blumenstingl @ 2019-04-11 22:00 UTC (permalink / raw) To: liang.yang, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, Martin Blumenstingl, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel Documentation/scheduler/completion.txt states: Calling init_completion() on the same completion object twice is most likely a bug as it re-initializes the queue to an empty queue and enqueued tasks could get "lost" - use reinit_completion() in that case, but be aware of other races. Initialize nfc->completion in meson_nfc_probe using init_completion and change the call in meson_nfc_queue_rb to reinit_completion so the logic matches what the documentation suggests. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> --- drivers/mtd/nand/raw/meson_nand.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c index 57cc4bd3f665..ea57ddcec41e 100644 --- a/drivers/mtd/nand/raw/meson_nand.c +++ b/drivers/mtd/nand/raw/meson_nand.c @@ -400,7 +400,7 @@ static int meson_nfc_queue_rb(struct meson_nfc *nfc, int timeout_ms) cfg |= NFC_RB_IRQ_EN; writel(cfg, nfc->reg_base + NFC_REG_CFG); - init_completion(&nfc->completion); + reinit_completion(&nfc->completion); /* use the max erase time as the maximum clock for waiting R/B */ cmd = NFC_CMD_RB | NFC_CMD_RB_INT @@ -1380,6 +1380,7 @@ static int meson_nfc_probe(struct platform_device *pdev) nand_controller_init(&nfc->controller); INIT_LIST_HEAD(&nfc->chips); + init_completion(&nfc->completion); nfc->dev = dev; -- 2.21.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 52+ messages in thread
* [PATCH 4/4] mtd: rawnand: meson: only initialize the RB completion once @ 2019-04-11 22:00 ` Martin Blumenstingl 0 siblings, 0 replies; 52+ messages in thread From: Martin Blumenstingl @ 2019-04-11 22:00 UTC (permalink / raw) To: liang.yang, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, Martin Blumenstingl, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel Documentation/scheduler/completion.txt states: Calling init_completion() on the same completion object twice is most likely a bug as it re-initializes the queue to an empty queue and enqueued tasks could get "lost" - use reinit_completion() in that case, but be aware of other races. Initialize nfc->completion in meson_nfc_probe using init_completion and change the call in meson_nfc_queue_rb to reinit_completion so the logic matches what the documentation suggests. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> --- drivers/mtd/nand/raw/meson_nand.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c index 57cc4bd3f665..ea57ddcec41e 100644 --- a/drivers/mtd/nand/raw/meson_nand.c +++ b/drivers/mtd/nand/raw/meson_nand.c @@ -400,7 +400,7 @@ static int meson_nfc_queue_rb(struct meson_nfc *nfc, int timeout_ms) cfg |= NFC_RB_IRQ_EN; writel(cfg, nfc->reg_base + NFC_REG_CFG); - init_completion(&nfc->completion); + reinit_completion(&nfc->completion); /* use the max erase time as the maximum clock for waiting R/B */ cmd = NFC_CMD_RB | NFC_CMD_RB_INT @@ -1380,6 +1380,7 @@ static int meson_nfc_probe(struct platform_device *pdev) nand_controller_init(&nfc->controller); INIT_LIST_HEAD(&nfc->chips); + init_completion(&nfc->completion); nfc->dev = dev; -- 2.21.0 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ ^ permalink raw reply related [flat|nested] 52+ messages in thread
* Re: [PATCH 4/4] mtd: rawnand: meson: only initialize the RB completion once 2019-04-11 22:00 ` Martin Blumenstingl (?) (?) @ 2019-04-15 6:04 ` Liang Yang -1 siblings, 0 replies; 52+ messages in thread From: Liang Yang @ 2019-04-15 6:04 UTC (permalink / raw) To: Martin Blumenstingl, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel On 2019/4/12 6:00, Martin Blumenstingl wrote: > Documentation/scheduler/completion.txt states: > Calling init_completion() on the same completion object twice is > most likely a bug as it re-initializes the queue to an empty queue and > enqueued tasks could get "lost" - use reinit_completion() in that case, > but be aware of other races. > > Initialize nfc->completion in meson_nfc_probe using init_completion and > change the call in meson_nfc_queue_rb to reinit_completion so the logic > matches what the documentation suggests. > > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> > --- > drivers/mtd/nand/raw/meson_nand.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > index 57cc4bd3f665..ea57ddcec41e 100644 > --- a/drivers/mtd/nand/raw/meson_nand.c > +++ b/drivers/mtd/nand/raw/meson_nand.c > @@ -400,7 +400,7 @@ static int meson_nfc_queue_rb(struct meson_nfc *nfc, int timeout_ms) > cfg |= NFC_RB_IRQ_EN; > writel(cfg, nfc->reg_base + NFC_REG_CFG); > > - init_completion(&nfc->completion); > + reinit_completion(&nfc->completion); Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > > /* use the max erase time as the maximum clock for waiting R/B */ > cmd = NFC_CMD_RB | NFC_CMD_RB_INT > @@ -1380,6 +1380,7 @@ static int meson_nfc_probe(struct platform_device *pdev) > > nand_controller_init(&nfc->controller); > INIT_LIST_HEAD(&nfc->chips); > + init_completion(&nfc->completion); Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > > nfc->dev = dev; > > _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic ^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 4/4] mtd: rawnand: meson: only initialize the RB completion once @ 2019-04-15 6:04 ` Liang Yang 0 siblings, 0 replies; 52+ messages in thread From: Liang Yang @ 2019-04-15 6:04 UTC (permalink / raw) To: Martin Blumenstingl, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: linux-arm-kernel, marek.vasut, linux-kernel, computersforpeace, dwmw2, bbrezillon, jianxin.pan On 2019/4/12 6:00, Martin Blumenstingl wrote: > Documentation/scheduler/completion.txt states: > Calling init_completion() on the same completion object twice is > most likely a bug as it re-initializes the queue to an empty queue and > enqueued tasks could get "lost" - use reinit_completion() in that case, > but be aware of other races. > > Initialize nfc->completion in meson_nfc_probe using init_completion and > change the call in meson_nfc_queue_rb to reinit_completion so the logic > matches what the documentation suggests. > > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> > --- > drivers/mtd/nand/raw/meson_nand.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > index 57cc4bd3f665..ea57ddcec41e 100644 > --- a/drivers/mtd/nand/raw/meson_nand.c > +++ b/drivers/mtd/nand/raw/meson_nand.c > @@ -400,7 +400,7 @@ static int meson_nfc_queue_rb(struct meson_nfc *nfc, int timeout_ms) > cfg |= NFC_RB_IRQ_EN; > writel(cfg, nfc->reg_base + NFC_REG_CFG); > > - init_completion(&nfc->completion); > + reinit_completion(&nfc->completion); Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > > /* use the max erase time as the maximum clock for waiting R/B */ > cmd = NFC_CMD_RB | NFC_CMD_RB_INT > @@ -1380,6 +1380,7 @@ static int meson_nfc_probe(struct platform_device *pdev) > > nand_controller_init(&nfc->controller); > INIT_LIST_HEAD(&nfc->chips); > + init_completion(&nfc->completion); Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > > nfc->dev = dev; > > ^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 4/4] mtd: rawnand: meson: only initialize the RB completion once @ 2019-04-15 6:04 ` Liang Yang 0 siblings, 0 replies; 52+ messages in thread From: Liang Yang @ 2019-04-15 6:04 UTC (permalink / raw) To: Martin Blumenstingl, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel On 2019/4/12 6:00, Martin Blumenstingl wrote: > Documentation/scheduler/completion.txt states: > Calling init_completion() on the same completion object twice is > most likely a bug as it re-initializes the queue to an empty queue and > enqueued tasks could get "lost" - use reinit_completion() in that case, > but be aware of other races. > > Initialize nfc->completion in meson_nfc_probe using init_completion and > change the call in meson_nfc_queue_rb to reinit_completion so the logic > matches what the documentation suggests. > > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> > --- > drivers/mtd/nand/raw/meson_nand.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > index 57cc4bd3f665..ea57ddcec41e 100644 > --- a/drivers/mtd/nand/raw/meson_nand.c > +++ b/drivers/mtd/nand/raw/meson_nand.c > @@ -400,7 +400,7 @@ static int meson_nfc_queue_rb(struct meson_nfc *nfc, int timeout_ms) > cfg |= NFC_RB_IRQ_EN; > writel(cfg, nfc->reg_base + NFC_REG_CFG); > > - init_completion(&nfc->completion); > + reinit_completion(&nfc->completion); Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > > /* use the max erase time as the maximum clock for waiting R/B */ > cmd = NFC_CMD_RB | NFC_CMD_RB_INT > @@ -1380,6 +1380,7 @@ static int meson_nfc_probe(struct platform_device *pdev) > > nand_controller_init(&nfc->controller); > INIT_LIST_HEAD(&nfc->chips); > + init_completion(&nfc->completion); Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > > nfc->dev = dev; > > _______________________________________________ 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] 52+ messages in thread
* Re: [PATCH 4/4] mtd: rawnand: meson: only initialize the RB completion once @ 2019-04-15 6:04 ` Liang Yang 0 siblings, 0 replies; 52+ messages in thread From: Liang Yang @ 2019-04-15 6:04 UTC (permalink / raw) To: Martin Blumenstingl, linux-amlogic, linux-mtd, richard, miquel.raynal Cc: jianxin.pan, bbrezillon, linux-kernel, marek.vasut, computersforpeace, dwmw2, linux-arm-kernel On 2019/4/12 6:00, Martin Blumenstingl wrote: > Documentation/scheduler/completion.txt states: > Calling init_completion() on the same completion object twice is > most likely a bug as it re-initializes the queue to an empty queue and > enqueued tasks could get "lost" - use reinit_completion() in that case, > but be aware of other races. > > Initialize nfc->completion in meson_nfc_probe using init_completion and > change the call in meson_nfc_queue_rb to reinit_completion so the logic > matches what the documentation suggests. > > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> > --- > drivers/mtd/nand/raw/meson_nand.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > index 57cc4bd3f665..ea57ddcec41e 100644 > --- a/drivers/mtd/nand/raw/meson_nand.c > +++ b/drivers/mtd/nand/raw/meson_nand.c > @@ -400,7 +400,7 @@ static int meson_nfc_queue_rb(struct meson_nfc *nfc, int timeout_ms) > cfg |= NFC_RB_IRQ_EN; > writel(cfg, nfc->reg_base + NFC_REG_CFG); > > - init_completion(&nfc->completion); > + reinit_completion(&nfc->completion); Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > > /* use the max erase time as the maximum clock for waiting R/B */ > cmd = NFC_CMD_RB | NFC_CMD_RB_INT > @@ -1380,6 +1380,7 @@ static int meson_nfc_probe(struct platform_device *pdev) > > nand_controller_init(&nfc->controller); > INIT_LIST_HEAD(&nfc->chips); > + init_completion(&nfc->completion); Tested-by:Liang Yang <liang.yang@amlogic.com> Acked-by: Liang Yang <liang.yang@amlogic.com> > > nfc->dev = dev; > > ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ ^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 4/4] mtd: rawnand: meson: only initialize the RB completion once 2019-04-15 6:04 ` Liang Yang (?) (?) @ 2019-04-18 19:44 ` Martin Blumenstingl -1 siblings, 0 replies; 52+ messages in thread From: Martin Blumenstingl @ 2019-04-18 19:44 UTC (permalink / raw) To: Liang Yang Cc: jianxin.pan, bbrezillon, richard, linux-kernel, marek.vasut, linux-mtd, miquel.raynal, linux-amlogic, computersforpeace, dwmw2, linux-arm-kernel Hi Liang, On Mon, Apr 15, 2019 at 8:04 AM Liang Yang <liang.yang@amlogic.com> wrote: > > > On 2019/4/12 6:00, Martin Blumenstingl wrote: > > Documentation/scheduler/completion.txt states: > > Calling init_completion() on the same completion object twice is > > most likely a bug as it re-initializes the queue to an empty queue and > > enqueued tasks could get "lost" - use reinit_completion() in that case, > > but be aware of other races. > > > > Initialize nfc->completion in meson_nfc_probe using init_completion and > > change the call in meson_nfc_queue_rb to reinit_completion so the logic > > matches what the documentation suggests. > > > > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> > > --- > > drivers/mtd/nand/raw/meson_nand.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > > index 57cc4bd3f665..ea57ddcec41e 100644 > > --- a/drivers/mtd/nand/raw/meson_nand.c > > +++ b/drivers/mtd/nand/raw/meson_nand.c > > @@ -400,7 +400,7 @@ static int meson_nfc_queue_rb(struct meson_nfc *nfc, int timeout_ms) > > cfg |= NFC_RB_IRQ_EN; > > writel(cfg, nfc->reg_base + NFC_REG_CFG); > > > > - init_completion(&nfc->completion); > > + reinit_completion(&nfc->completion); > Tested-by:Liang Yang <liang.yang@amlogic.com> > Acked-by: Liang Yang <liang.yang@amlogic.com> thank you for reviewing and testing my patches! [...] > Tested-by:Liang Yang <liang.yang@amlogic.com> > Acked-by: Liang Yang <liang.yang@amlogic.com> please consider the following note for future code-reviews: most maintainers take the patch from patchwork and apply it to their git tree. however, patchwork is not smart enough to detect when the same Tested-by/Acked-by is sent multiple times. this results in the same Tested-by/Acked-by being listed multiple times in the final commit: [0] what I do instead is to reply with one set of Tested-by/Acked-by (below the author's Signed-off-by) which is then valid for the whole patch. There's no problem to have Tested-by and Acked-by at the same time, the issue only shows up if you send Acked-by (or any other tag) for the same patch multiple times. Have a great day! Regards, Martin [0] https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git/commit/?h=nand/next&id=39e01956e2f70ff9f0e97db1a69c9847aa1d5d8b _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic ^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 4/4] mtd: rawnand: meson: only initialize the RB completion once @ 2019-04-18 19:44 ` Martin Blumenstingl 0 siblings, 0 replies; 52+ messages in thread From: Martin Blumenstingl @ 2019-04-18 19:44 UTC (permalink / raw) To: Liang Yang Cc: linux-amlogic, linux-mtd, richard, miquel.raynal, linux-arm-kernel, marek.vasut, linux-kernel, computersforpeace, dwmw2, bbrezillon, jianxin.pan Hi Liang, On Mon, Apr 15, 2019 at 8:04 AM Liang Yang <liang.yang@amlogic.com> wrote: > > > On 2019/4/12 6:00, Martin Blumenstingl wrote: > > Documentation/scheduler/completion.txt states: > > Calling init_completion() on the same completion object twice is > > most likely a bug as it re-initializes the queue to an empty queue and > > enqueued tasks could get "lost" - use reinit_completion() in that case, > > but be aware of other races. > > > > Initialize nfc->completion in meson_nfc_probe using init_completion and > > change the call in meson_nfc_queue_rb to reinit_completion so the logic > > matches what the documentation suggests. > > > > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> > > --- > > drivers/mtd/nand/raw/meson_nand.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > > index 57cc4bd3f665..ea57ddcec41e 100644 > > --- a/drivers/mtd/nand/raw/meson_nand.c > > +++ b/drivers/mtd/nand/raw/meson_nand.c > > @@ -400,7 +400,7 @@ static int meson_nfc_queue_rb(struct meson_nfc *nfc, int timeout_ms) > > cfg |= NFC_RB_IRQ_EN; > > writel(cfg, nfc->reg_base + NFC_REG_CFG); > > > > - init_completion(&nfc->completion); > > + reinit_completion(&nfc->completion); > Tested-by:Liang Yang <liang.yang@amlogic.com> > Acked-by: Liang Yang <liang.yang@amlogic.com> thank you for reviewing and testing my patches! [...] > Tested-by:Liang Yang <liang.yang@amlogic.com> > Acked-by: Liang Yang <liang.yang@amlogic.com> please consider the following note for future code-reviews: most maintainers take the patch from patchwork and apply it to their git tree. however, patchwork is not smart enough to detect when the same Tested-by/Acked-by is sent multiple times. this results in the same Tested-by/Acked-by being listed multiple times in the final commit: [0] what I do instead is to reply with one set of Tested-by/Acked-by (below the author's Signed-off-by) which is then valid for the whole patch. There's no problem to have Tested-by and Acked-by at the same time, the issue only shows up if you send Acked-by (or any other tag) for the same patch multiple times. Have a great day! Regards, Martin [0] https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git/commit/?h=nand/next&id=39e01956e2f70ff9f0e97db1a69c9847aa1d5d8b ^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 4/4] mtd: rawnand: meson: only initialize the RB completion once @ 2019-04-18 19:44 ` Martin Blumenstingl 0 siblings, 0 replies; 52+ messages in thread From: Martin Blumenstingl @ 2019-04-18 19:44 UTC (permalink / raw) To: Liang Yang Cc: jianxin.pan, bbrezillon, richard, linux-kernel, marek.vasut, linux-mtd, miquel.raynal, linux-amlogic, computersforpeace, dwmw2, linux-arm-kernel Hi Liang, On Mon, Apr 15, 2019 at 8:04 AM Liang Yang <liang.yang@amlogic.com> wrote: > > > On 2019/4/12 6:00, Martin Blumenstingl wrote: > > Documentation/scheduler/completion.txt states: > > Calling init_completion() on the same completion object twice is > > most likely a bug as it re-initializes the queue to an empty queue and > > enqueued tasks could get "lost" - use reinit_completion() in that case, > > but be aware of other races. > > > > Initialize nfc->completion in meson_nfc_probe using init_completion and > > change the call in meson_nfc_queue_rb to reinit_completion so the logic > > matches what the documentation suggests. > > > > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> > > --- > > drivers/mtd/nand/raw/meson_nand.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > > index 57cc4bd3f665..ea57ddcec41e 100644 > > --- a/drivers/mtd/nand/raw/meson_nand.c > > +++ b/drivers/mtd/nand/raw/meson_nand.c > > @@ -400,7 +400,7 @@ static int meson_nfc_queue_rb(struct meson_nfc *nfc, int timeout_ms) > > cfg |= NFC_RB_IRQ_EN; > > writel(cfg, nfc->reg_base + NFC_REG_CFG); > > > > - init_completion(&nfc->completion); > > + reinit_completion(&nfc->completion); > Tested-by:Liang Yang <liang.yang@amlogic.com> > Acked-by: Liang Yang <liang.yang@amlogic.com> thank you for reviewing and testing my patches! [...] > Tested-by:Liang Yang <liang.yang@amlogic.com> > Acked-by: Liang Yang <liang.yang@amlogic.com> please consider the following note for future code-reviews: most maintainers take the patch from patchwork and apply it to their git tree. however, patchwork is not smart enough to detect when the same Tested-by/Acked-by is sent multiple times. this results in the same Tested-by/Acked-by being listed multiple times in the final commit: [0] what I do instead is to reply with one set of Tested-by/Acked-by (below the author's Signed-off-by) which is then valid for the whole patch. There's no problem to have Tested-by and Acked-by at the same time, the issue only shows up if you send Acked-by (or any other tag) for the same patch multiple times. Have a great day! Regards, Martin [0] https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git/commit/?h=nand/next&id=39e01956e2f70ff9f0e97db1a69c9847aa1d5d8b _______________________________________________ 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] 52+ messages in thread
* Re: [PATCH 4/4] mtd: rawnand: meson: only initialize the RB completion once @ 2019-04-18 19:44 ` Martin Blumenstingl 0 siblings, 0 replies; 52+ messages in thread From: Martin Blumenstingl @ 2019-04-18 19:44 UTC (permalink / raw) To: Liang Yang Cc: jianxin.pan, bbrezillon, richard, linux-kernel, marek.vasut, linux-mtd, miquel.raynal, linux-amlogic, computersforpeace, dwmw2, linux-arm-kernel Hi Liang, On Mon, Apr 15, 2019 at 8:04 AM Liang Yang <liang.yang@amlogic.com> wrote: > > > On 2019/4/12 6:00, Martin Blumenstingl wrote: > > Documentation/scheduler/completion.txt states: > > Calling init_completion() on the same completion object twice is > > most likely a bug as it re-initializes the queue to an empty queue and > > enqueued tasks could get "lost" - use reinit_completion() in that case, > > but be aware of other races. > > > > Initialize nfc->completion in meson_nfc_probe using init_completion and > > change the call in meson_nfc_queue_rb to reinit_completion so the logic > > matches what the documentation suggests. > > > > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> > > --- > > drivers/mtd/nand/raw/meson_nand.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > > index 57cc4bd3f665..ea57ddcec41e 100644 > > --- a/drivers/mtd/nand/raw/meson_nand.c > > +++ b/drivers/mtd/nand/raw/meson_nand.c > > @@ -400,7 +400,7 @@ static int meson_nfc_queue_rb(struct meson_nfc *nfc, int timeout_ms) > > cfg |= NFC_RB_IRQ_EN; > > writel(cfg, nfc->reg_base + NFC_REG_CFG); > > > > - init_completion(&nfc->completion); > > + reinit_completion(&nfc->completion); > Tested-by:Liang Yang <liang.yang@amlogic.com> > Acked-by: Liang Yang <liang.yang@amlogic.com> thank you for reviewing and testing my patches! [...] > Tested-by:Liang Yang <liang.yang@amlogic.com> > Acked-by: Liang Yang <liang.yang@amlogic.com> please consider the following note for future code-reviews: most maintainers take the patch from patchwork and apply it to their git tree. however, patchwork is not smart enough to detect when the same Tested-by/Acked-by is sent multiple times. this results in the same Tested-by/Acked-by being listed multiple times in the final commit: [0] what I do instead is to reply with one set of Tested-by/Acked-by (below the author's Signed-off-by) which is then valid for the whole patch. There's no problem to have Tested-by and Acked-by at the same time, the issue only shows up if you send Acked-by (or any other tag) for the same patch multiple times. Have a great day! Regards, Martin [0] https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git/commit/?h=nand/next&id=39e01956e2f70ff9f0e97db1a69c9847aa1d5d8b ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ ^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 4/4] mtd: rawnand: meson: only initialize the RB completion once 2019-04-18 19:44 ` Martin Blumenstingl (?) (?) @ 2019-04-19 3:52 ` Liang Yang -1 siblings, 0 replies; 52+ messages in thread From: Liang Yang @ 2019-04-19 3:52 UTC (permalink / raw) To: Martin Blumenstingl Cc: jianxin.pan, bbrezillon, richard, linux-kernel, marek.vasut, linux-mtd, miquel.raynal, linux-amlogic, computersforpeace, dwmw2, linux-arm-kernel Hi Martin, On 2019/4/19 3:44, Martin Blumenstingl wrote: > Hi Liang, > > On Mon, Apr 15, 2019 at 8:04 AM Liang Yang <liang.yang@amlogic.com> wrote: >> >> >> On 2019/4/12 6:00, Martin Blumenstingl wrote: >>> Documentation/scheduler/completion.txt states: >>> Calling init_completion() on the same completion object twice is >>> most likely a bug as it re-initializes the queue to an empty queue and >>> enqueued tasks could get "lost" - use reinit_completion() in that case, >>> but be aware of other races. >>> >>> Initialize nfc->completion in meson_nfc_probe using init_completion and >>> change the call in meson_nfc_queue_rb to reinit_completion so the logic >>> matches what the documentation suggests. >>> >>> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> >>> --- >>> drivers/mtd/nand/raw/meson_nand.c | 3 ++- >>> 1 file changed, 2 insertions(+), 1 deletion(-) >>> >>> diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c >>> index 57cc4bd3f665..ea57ddcec41e 100644 >>> --- a/drivers/mtd/nand/raw/meson_nand.c >>> +++ b/drivers/mtd/nand/raw/meson_nand.c >>> @@ -400,7 +400,7 @@ static int meson_nfc_queue_rb(struct meson_nfc *nfc, int timeout_ms) >>> cfg |= NFC_RB_IRQ_EN; >>> writel(cfg, nfc->reg_base + NFC_REG_CFG); >>> >>> - init_completion(&nfc->completion); >>> + reinit_completion(&nfc->completion); >> Tested-by:Liang Yang <liang.yang@amlogic.com> >> Acked-by: Liang Yang <liang.yang@amlogic.com> > thank you for reviewing and testing my patches! > > [...] >> Tested-by:Liang Yang <liang.yang@amlogic.com> >> Acked-by: Liang Yang <liang.yang@amlogic.com> > please consider the following note for future code-reviews: > most maintainers take the patch from patchwork and apply it to their git tree. > however, patchwork is not smart enough to detect when the same > Tested-by/Acked-by is sent multiple times. > this results in the same Tested-by/Acked-by being listed multiple > times in the final commit: [0] > > what I do instead is to reply with one set of Tested-by/Acked-by > (below the author's Signed-off-by) which is then valid for the whole > patch. > There's no problem to have Tested-by and Acked-by at the same time, > the issue only shows up if you send Acked-by (or any other tag) for > the same patch multiple times. > Thanks. Well, I known about it now. > > Have a great day! > Regards, > Martin > > > [0] https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git/commit/?h=nand/next&id=39e01956e2f70ff9f0e97db1a69c9847aa1d5d8b > > . > _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic ^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 4/4] mtd: rawnand: meson: only initialize the RB completion once @ 2019-04-19 3:52 ` Liang Yang 0 siblings, 0 replies; 52+ messages in thread From: Liang Yang @ 2019-04-19 3:52 UTC (permalink / raw) To: Martin Blumenstingl Cc: linux-amlogic, linux-mtd, richard, miquel.raynal, linux-arm-kernel, marek.vasut, linux-kernel, computersforpeace, dwmw2, bbrezillon, jianxin.pan Hi Martin, On 2019/4/19 3:44, Martin Blumenstingl wrote: > Hi Liang, > > On Mon, Apr 15, 2019 at 8:04 AM Liang Yang <liang.yang@amlogic.com> wrote: >> >> >> On 2019/4/12 6:00, Martin Blumenstingl wrote: >>> Documentation/scheduler/completion.txt states: >>> Calling init_completion() on the same completion object twice is >>> most likely a bug as it re-initializes the queue to an empty queue and >>> enqueued tasks could get "lost" - use reinit_completion() in that case, >>> but be aware of other races. >>> >>> Initialize nfc->completion in meson_nfc_probe using init_completion and >>> change the call in meson_nfc_queue_rb to reinit_completion so the logic >>> matches what the documentation suggests. >>> >>> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> >>> --- >>> drivers/mtd/nand/raw/meson_nand.c | 3 ++- >>> 1 file changed, 2 insertions(+), 1 deletion(-) >>> >>> diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c >>> index 57cc4bd3f665..ea57ddcec41e 100644 >>> --- a/drivers/mtd/nand/raw/meson_nand.c >>> +++ b/drivers/mtd/nand/raw/meson_nand.c >>> @@ -400,7 +400,7 @@ static int meson_nfc_queue_rb(struct meson_nfc *nfc, int timeout_ms) >>> cfg |= NFC_RB_IRQ_EN; >>> writel(cfg, nfc->reg_base + NFC_REG_CFG); >>> >>> - init_completion(&nfc->completion); >>> + reinit_completion(&nfc->completion); >> Tested-by:Liang Yang <liang.yang@amlogic.com> >> Acked-by: Liang Yang <liang.yang@amlogic.com> > thank you for reviewing and testing my patches! > > [...] >> Tested-by:Liang Yang <liang.yang@amlogic.com> >> Acked-by: Liang Yang <liang.yang@amlogic.com> > please consider the following note for future code-reviews: > most maintainers take the patch from patchwork and apply it to their git tree. > however, patchwork is not smart enough to detect when the same > Tested-by/Acked-by is sent multiple times. > this results in the same Tested-by/Acked-by being listed multiple > times in the final commit: [0] > > what I do instead is to reply with one set of Tested-by/Acked-by > (below the author's Signed-off-by) which is then valid for the whole > patch. > There's no problem to have Tested-by and Acked-by at the same time, > the issue only shows up if you send Acked-by (or any other tag) for > the same patch multiple times. > Thanks. Well, I known about it now. > > Have a great day! > Regards, > Martin > > > [0] https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git/commit/?h=nand/next&id=39e01956e2f70ff9f0e97db1a69c9847aa1d5d8b > > . > ^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 4/4] mtd: rawnand: meson: only initialize the RB completion once @ 2019-04-19 3:52 ` Liang Yang 0 siblings, 0 replies; 52+ messages in thread From: Liang Yang @ 2019-04-19 3:52 UTC (permalink / raw) To: Martin Blumenstingl Cc: jianxin.pan, bbrezillon, richard, linux-kernel, marek.vasut, linux-mtd, miquel.raynal, linux-amlogic, computersforpeace, dwmw2, linux-arm-kernel Hi Martin, On 2019/4/19 3:44, Martin Blumenstingl wrote: > Hi Liang, > > On Mon, Apr 15, 2019 at 8:04 AM Liang Yang <liang.yang@amlogic.com> wrote: >> >> >> On 2019/4/12 6:00, Martin Blumenstingl wrote: >>> Documentation/scheduler/completion.txt states: >>> Calling init_completion() on the same completion object twice is >>> most likely a bug as it re-initializes the queue to an empty queue and >>> enqueued tasks could get "lost" - use reinit_completion() in that case, >>> but be aware of other races. >>> >>> Initialize nfc->completion in meson_nfc_probe using init_completion and >>> change the call in meson_nfc_queue_rb to reinit_completion so the logic >>> matches what the documentation suggests. >>> >>> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> >>> --- >>> drivers/mtd/nand/raw/meson_nand.c | 3 ++- >>> 1 file changed, 2 insertions(+), 1 deletion(-) >>> >>> diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c >>> index 57cc4bd3f665..ea57ddcec41e 100644 >>> --- a/drivers/mtd/nand/raw/meson_nand.c >>> +++ b/drivers/mtd/nand/raw/meson_nand.c >>> @@ -400,7 +400,7 @@ static int meson_nfc_queue_rb(struct meson_nfc *nfc, int timeout_ms) >>> cfg |= NFC_RB_IRQ_EN; >>> writel(cfg, nfc->reg_base + NFC_REG_CFG); >>> >>> - init_completion(&nfc->completion); >>> + reinit_completion(&nfc->completion); >> Tested-by:Liang Yang <liang.yang@amlogic.com> >> Acked-by: Liang Yang <liang.yang@amlogic.com> > thank you for reviewing and testing my patches! > > [...] >> Tested-by:Liang Yang <liang.yang@amlogic.com> >> Acked-by: Liang Yang <liang.yang@amlogic.com> > please consider the following note for future code-reviews: > most maintainers take the patch from patchwork and apply it to their git tree. > however, patchwork is not smart enough to detect when the same > Tested-by/Acked-by is sent multiple times. > this results in the same Tested-by/Acked-by being listed multiple > times in the final commit: [0] > > what I do instead is to reply with one set of Tested-by/Acked-by > (below the author's Signed-off-by) which is then valid for the whole > patch. > There's no problem to have Tested-by and Acked-by at the same time, > the issue only shows up if you send Acked-by (or any other tag) for > the same patch multiple times. > Thanks. Well, I known about it now. > > Have a great day! > Regards, > Martin > > > [0] https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git/commit/?h=nand/next&id=39e01956e2f70ff9f0e97db1a69c9847aa1d5d8b > > . > _______________________________________________ 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] 52+ messages in thread
* Re: [PATCH 4/4] mtd: rawnand: meson: only initialize the RB completion once @ 2019-04-19 3:52 ` Liang Yang 0 siblings, 0 replies; 52+ messages in thread From: Liang Yang @ 2019-04-19 3:52 UTC (permalink / raw) To: Martin Blumenstingl Cc: jianxin.pan, bbrezillon, richard, linux-kernel, marek.vasut, linux-mtd, miquel.raynal, linux-amlogic, computersforpeace, dwmw2, linux-arm-kernel Hi Martin, On 2019/4/19 3:44, Martin Blumenstingl wrote: > Hi Liang, > > On Mon, Apr 15, 2019 at 8:04 AM Liang Yang <liang.yang@amlogic.com> wrote: >> >> >> On 2019/4/12 6:00, Martin Blumenstingl wrote: >>> Documentation/scheduler/completion.txt states: >>> Calling init_completion() on the same completion object twice is >>> most likely a bug as it re-initializes the queue to an empty queue and >>> enqueued tasks could get "lost" - use reinit_completion() in that case, >>> but be aware of other races. >>> >>> Initialize nfc->completion in meson_nfc_probe using init_completion and >>> change the call in meson_nfc_queue_rb to reinit_completion so the logic >>> matches what the documentation suggests. >>> >>> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> >>> --- >>> drivers/mtd/nand/raw/meson_nand.c | 3 ++- >>> 1 file changed, 2 insertions(+), 1 deletion(-) >>> >>> diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c >>> index 57cc4bd3f665..ea57ddcec41e 100644 >>> --- a/drivers/mtd/nand/raw/meson_nand.c >>> +++ b/drivers/mtd/nand/raw/meson_nand.c >>> @@ -400,7 +400,7 @@ static int meson_nfc_queue_rb(struct meson_nfc *nfc, int timeout_ms) >>> cfg |= NFC_RB_IRQ_EN; >>> writel(cfg, nfc->reg_base + NFC_REG_CFG); >>> >>> - init_completion(&nfc->completion); >>> + reinit_completion(&nfc->completion); >> Tested-by:Liang Yang <liang.yang@amlogic.com> >> Acked-by: Liang Yang <liang.yang@amlogic.com> > thank you for reviewing and testing my patches! > > [...] >> Tested-by:Liang Yang <liang.yang@amlogic.com> >> Acked-by: Liang Yang <liang.yang@amlogic.com> > please consider the following note for future code-reviews: > most maintainers take the patch from patchwork and apply it to their git tree. > however, patchwork is not smart enough to detect when the same > Tested-by/Acked-by is sent multiple times. > this results in the same Tested-by/Acked-by being listed multiple > times in the final commit: [0] > > what I do instead is to reply with one set of Tested-by/Acked-by > (below the author's Signed-off-by) which is then valid for the whole > patch. > There's no problem to have Tested-by and Acked-by at the same time, > the issue only shows up if you send Acked-by (or any other tag) for > the same patch multiple times. > Thanks. Well, I known about it now. > > Have a great day! > Regards, > Martin > > > [0] https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git/commit/?h=nand/next&id=39e01956e2f70ff9f0e97db1a69c9847aa1d5d8b > > . > ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ ^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 4/4] mtd: rawnand: meson: only initialize the RB completion once 2019-04-18 19:44 ` Martin Blumenstingl (?) (?) @ 2019-04-19 9:00 ` Miquel Raynal -1 siblings, 0 replies; 52+ messages in thread From: Miquel Raynal @ 2019-04-19 9:00 UTC (permalink / raw) To: Martin Blumenstingl Cc: jianxin.pan, bbrezillon, richard, linux-kernel, marek.vasut, Liang Yang, linux-mtd, linux-amlogic, computersforpeace, dwmw2, linux-arm-kernel Hi Martin, Martin Blumenstingl <martin.blumenstingl@googlemail.com> wrote on Thu, 18 Apr 2019 21:44:05 +0200: > Hi Liang, > > On Mon, Apr 15, 2019 at 8:04 AM Liang Yang <liang.yang@amlogic.com> wrote: > > > > > > On 2019/4/12 6:00, Martin Blumenstingl wrote: > > > Documentation/scheduler/completion.txt states: > > > Calling init_completion() on the same completion object twice is > > > most likely a bug as it re-initializes the queue to an empty queue and > > > enqueued tasks could get "lost" - use reinit_completion() in that case, > > > but be aware of other races. > > > > > > Initialize nfc->completion in meson_nfc_probe using init_completion and > > > change the call in meson_nfc_queue_rb to reinit_completion so the logic > > > matches what the documentation suggests. > > > > > > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> > > > --- > > > drivers/mtd/nand/raw/meson_nand.c | 3 ++- > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > > > index 57cc4bd3f665..ea57ddcec41e 100644 > > > --- a/drivers/mtd/nand/raw/meson_nand.c > > > +++ b/drivers/mtd/nand/raw/meson_nand.c > > > @@ -400,7 +400,7 @@ static int meson_nfc_queue_rb(struct meson_nfc *nfc, int timeout_ms) > > > cfg |= NFC_RB_IRQ_EN; > > > writel(cfg, nfc->reg_base + NFC_REG_CFG); > > > > > > - init_completion(&nfc->completion); > > > + reinit_completion(&nfc->completion); > > Tested-by:Liang Yang <liang.yang@amlogic.com> > > Acked-by: Liang Yang <liang.yang@amlogic.com> > thank you for reviewing and testing my patches! > > [...] > > Tested-by:Liang Yang <liang.yang@amlogic.com> > > Acked-by: Liang Yang <liang.yang@amlogic.com> > please consider the following note for future code-reviews: > most maintainers take the patch from patchwork and apply it to their git tree. > however, patchwork is not smart enough to detect when the same > Tested-by/Acked-by is sent multiple times. > this results in the same Tested-by/Acked-by being listed multiple > times in the final commit: [0] > > what I do instead is to reply with one set of Tested-by/Acked-by > (below the author's Signed-off-by) which is then valid for the whole > patch. > There's no problem to have Tested-by and Acked-by at the same time, > the issue only shows up if you send Acked-by (or any other tag) for > the same patch multiple times. Crap, I did not noticed that. Thanks for pointing it. I don't have time right now to fix it and send a new PR, I'll see in one week. Thanks, Miquèl _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic ^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 4/4] mtd: rawnand: meson: only initialize the RB completion once @ 2019-04-19 9:00 ` Miquel Raynal 0 siblings, 0 replies; 52+ messages in thread From: Miquel Raynal @ 2019-04-19 9:00 UTC (permalink / raw) To: Martin Blumenstingl Cc: Liang Yang, linux-amlogic, linux-mtd, richard, linux-arm-kernel, marek.vasut, linux-kernel, computersforpeace, dwmw2, bbrezillon, jianxin.pan Hi Martin, Martin Blumenstingl <martin.blumenstingl@googlemail.com> wrote on Thu, 18 Apr 2019 21:44:05 +0200: > Hi Liang, > > On Mon, Apr 15, 2019 at 8:04 AM Liang Yang <liang.yang@amlogic.com> wrote: > > > > > > On 2019/4/12 6:00, Martin Blumenstingl wrote: > > > Documentation/scheduler/completion.txt states: > > > Calling init_completion() on the same completion object twice is > > > most likely a bug as it re-initializes the queue to an empty queue and > > > enqueued tasks could get "lost" - use reinit_completion() in that case, > > > but be aware of other races. > > > > > > Initialize nfc->completion in meson_nfc_probe using init_completion and > > > change the call in meson_nfc_queue_rb to reinit_completion so the logic > > > matches what the documentation suggests. > > > > > > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> > > > --- > > > drivers/mtd/nand/raw/meson_nand.c | 3 ++- > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > > > index 57cc4bd3f665..ea57ddcec41e 100644 > > > --- a/drivers/mtd/nand/raw/meson_nand.c > > > +++ b/drivers/mtd/nand/raw/meson_nand.c > > > @@ -400,7 +400,7 @@ static int meson_nfc_queue_rb(struct meson_nfc *nfc, int timeout_ms) > > > cfg |= NFC_RB_IRQ_EN; > > > writel(cfg, nfc->reg_base + NFC_REG_CFG); > > > > > > - init_completion(&nfc->completion); > > > + reinit_completion(&nfc->completion); > > Tested-by:Liang Yang <liang.yang@amlogic.com> > > Acked-by: Liang Yang <liang.yang@amlogic.com> > thank you for reviewing and testing my patches! > > [...] > > Tested-by:Liang Yang <liang.yang@amlogic.com> > > Acked-by: Liang Yang <liang.yang@amlogic.com> > please consider the following note for future code-reviews: > most maintainers take the patch from patchwork and apply it to their git tree. > however, patchwork is not smart enough to detect when the same > Tested-by/Acked-by is sent multiple times. > this results in the same Tested-by/Acked-by being listed multiple > times in the final commit: [0] > > what I do instead is to reply with one set of Tested-by/Acked-by > (below the author's Signed-off-by) which is then valid for the whole > patch. > There's no problem to have Tested-by and Acked-by at the same time, > the issue only shows up if you send Acked-by (or any other tag) for > the same patch multiple times. Crap, I did not noticed that. Thanks for pointing it. I don't have time right now to fix it and send a new PR, I'll see in one week. Thanks, Miquèl ^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 4/4] mtd: rawnand: meson: only initialize the RB completion once @ 2019-04-19 9:00 ` Miquel Raynal 0 siblings, 0 replies; 52+ messages in thread From: Miquel Raynal @ 2019-04-19 9:00 UTC (permalink / raw) To: Martin Blumenstingl Cc: jianxin.pan, bbrezillon, richard, linux-kernel, marek.vasut, Liang Yang, linux-mtd, linux-amlogic, computersforpeace, dwmw2, linux-arm-kernel Hi Martin, Martin Blumenstingl <martin.blumenstingl@googlemail.com> wrote on Thu, 18 Apr 2019 21:44:05 +0200: > Hi Liang, > > On Mon, Apr 15, 2019 at 8:04 AM Liang Yang <liang.yang@amlogic.com> wrote: > > > > > > On 2019/4/12 6:00, Martin Blumenstingl wrote: > > > Documentation/scheduler/completion.txt states: > > > Calling init_completion() on the same completion object twice is > > > most likely a bug as it re-initializes the queue to an empty queue and > > > enqueued tasks could get "lost" - use reinit_completion() in that case, > > > but be aware of other races. > > > > > > Initialize nfc->completion in meson_nfc_probe using init_completion and > > > change the call in meson_nfc_queue_rb to reinit_completion so the logic > > > matches what the documentation suggests. > > > > > > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> > > > --- > > > drivers/mtd/nand/raw/meson_nand.c | 3 ++- > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > > > index 57cc4bd3f665..ea57ddcec41e 100644 > > > --- a/drivers/mtd/nand/raw/meson_nand.c > > > +++ b/drivers/mtd/nand/raw/meson_nand.c > > > @@ -400,7 +400,7 @@ static int meson_nfc_queue_rb(struct meson_nfc *nfc, int timeout_ms) > > > cfg |= NFC_RB_IRQ_EN; > > > writel(cfg, nfc->reg_base + NFC_REG_CFG); > > > > > > - init_completion(&nfc->completion); > > > + reinit_completion(&nfc->completion); > > Tested-by:Liang Yang <liang.yang@amlogic.com> > > Acked-by: Liang Yang <liang.yang@amlogic.com> > thank you for reviewing and testing my patches! > > [...] > > Tested-by:Liang Yang <liang.yang@amlogic.com> > > Acked-by: Liang Yang <liang.yang@amlogic.com> > please consider the following note for future code-reviews: > most maintainers take the patch from patchwork and apply it to their git tree. > however, patchwork is not smart enough to detect when the same > Tested-by/Acked-by is sent multiple times. > this results in the same Tested-by/Acked-by being listed multiple > times in the final commit: [0] > > what I do instead is to reply with one set of Tested-by/Acked-by > (below the author's Signed-off-by) which is then valid for the whole > patch. > There's no problem to have Tested-by and Acked-by at the same time, > the issue only shows up if you send Acked-by (or any other tag) for > the same patch multiple times. Crap, I did not noticed that. Thanks for pointing it. I don't have time right now to fix it and send a new PR, I'll see in one week. Thanks, Miquèl _______________________________________________ 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] 52+ messages in thread
* Re: [PATCH 4/4] mtd: rawnand: meson: only initialize the RB completion once @ 2019-04-19 9:00 ` Miquel Raynal 0 siblings, 0 replies; 52+ messages in thread From: Miquel Raynal @ 2019-04-19 9:00 UTC (permalink / raw) To: Martin Blumenstingl Cc: jianxin.pan, bbrezillon, richard, linux-kernel, marek.vasut, Liang Yang, linux-mtd, linux-amlogic, computersforpeace, dwmw2, linux-arm-kernel Hi Martin, Martin Blumenstingl <martin.blumenstingl@googlemail.com> wrote on Thu, 18 Apr 2019 21:44:05 +0200: > Hi Liang, > > On Mon, Apr 15, 2019 at 8:04 AM Liang Yang <liang.yang@amlogic.com> wrote: > > > > > > On 2019/4/12 6:00, Martin Blumenstingl wrote: > > > Documentation/scheduler/completion.txt states: > > > Calling init_completion() on the same completion object twice is > > > most likely a bug as it re-initializes the queue to an empty queue and > > > enqueued tasks could get "lost" - use reinit_completion() in that case, > > > but be aware of other races. > > > > > > Initialize nfc->completion in meson_nfc_probe using init_completion and > > > change the call in meson_nfc_queue_rb to reinit_completion so the logic > > > matches what the documentation suggests. > > > > > > Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> > > > --- > > > drivers/mtd/nand/raw/meson_nand.c | 3 ++- > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c > > > index 57cc4bd3f665..ea57ddcec41e 100644 > > > --- a/drivers/mtd/nand/raw/meson_nand.c > > > +++ b/drivers/mtd/nand/raw/meson_nand.c > > > @@ -400,7 +400,7 @@ static int meson_nfc_queue_rb(struct meson_nfc *nfc, int timeout_ms) > > > cfg |= NFC_RB_IRQ_EN; > > > writel(cfg, nfc->reg_base + NFC_REG_CFG); > > > > > > - init_completion(&nfc->completion); > > > + reinit_completion(&nfc->completion); > > Tested-by:Liang Yang <liang.yang@amlogic.com> > > Acked-by: Liang Yang <liang.yang@amlogic.com> > thank you for reviewing and testing my patches! > > [...] > > Tested-by:Liang Yang <liang.yang@amlogic.com> > > Acked-by: Liang Yang <liang.yang@amlogic.com> > please consider the following note for future code-reviews: > most maintainers take the patch from patchwork and apply it to their git tree. > however, patchwork is not smart enough to detect when the same > Tested-by/Acked-by is sent multiple times. > this results in the same Tested-by/Acked-by being listed multiple > times in the final commit: [0] > > what I do instead is to reply with one set of Tested-by/Acked-by > (below the author's Signed-off-by) which is then valid for the whole > patch. > There's no problem to have Tested-by and Acked-by at the same time, > the issue only shows up if you send Acked-by (or any other tag) for > the same patch multiple times. Crap, I did not noticed that. Thanks for pointing it. I don't have time right now to fix it and send a new PR, I'll see in one week. Thanks, Miquèl ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ ^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 0/4] meson-nand: small code improvements 2019-04-11 22:00 ` Martin Blumenstingl (?) (?) @ 2019-04-18 16:22 ` Miquel Raynal -1 siblings, 0 replies; 52+ messages in thread From: Miquel Raynal @ 2019-04-18 16:22 UTC (permalink / raw) To: Martin Blumenstingl Cc: jianxin.pan, bbrezillon, richard, linux-kernel, marek.vasut, liang.yang, linux-mtd, linux-amlogic, computersforpeace, dwmw2, linux-arm-kernel Hi Martin, Martin Blumenstingl <martin.blumenstingl@googlemail.com> wrote on Fri, 12 Apr 2019 00:00:52 +0200: > This series comes with four small improvements for the meson-nand > driver: > * the first patches are replacing open-coded logic with existing > utilities / helpers > * the third patch drops some unnecessary casting after changing > the type of the info buffer parameter from "u8 *" to "void *" > * the fourth patch adjusts the usage of init_completion with what the > documentation suggests > > I have tested these patches as best as I could on my Meson8m2 board > using experimental patches on top of this series which add support for > this older SoC to the meson-nand driver. > > Liang, can you please test this series on GXL and/or AXG so I don't > break the NFC driver on these newer SoCs? All of my GXL/GXM boards > have eMMC instead of raw NAND, so I cannot test it on these newer SoCs > myself. > > This series is meant to be applied to the nand/next tree. > > > Martin Blumenstingl (4): > mtd: rawnand: meson: use struct_size macro > mtd: rawnand: meson: use of_property_count_elems_of_size helper > mtd: rawnand: meson: use a void pointer for meson_nfc_dma_buffer_setup > mtd: rawnand: meson: only initialize the RB completion once > > drivers/mtd/nand/raw/meson_nand.c | 21 +++++++++------------ > 1 file changed, 9 insertions(+), 12 deletions(-) > Series applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git branch nand/next. Thanks, Miquèl _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic ^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 0/4] meson-nand: small code improvements @ 2019-04-18 16:22 ` Miquel Raynal 0 siblings, 0 replies; 52+ messages in thread From: Miquel Raynal @ 2019-04-18 16:22 UTC (permalink / raw) To: Martin Blumenstingl Cc: liang.yang, linux-amlogic, linux-mtd, richard, linux-arm-kernel, marek.vasut, linux-kernel, computersforpeace, dwmw2, bbrezillon, jianxin.pan Hi Martin, Martin Blumenstingl <martin.blumenstingl@googlemail.com> wrote on Fri, 12 Apr 2019 00:00:52 +0200: > This series comes with four small improvements for the meson-nand > driver: > * the first patches are replacing open-coded logic with existing > utilities / helpers > * the third patch drops some unnecessary casting after changing > the type of the info buffer parameter from "u8 *" to "void *" > * the fourth patch adjusts the usage of init_completion with what the > documentation suggests > > I have tested these patches as best as I could on my Meson8m2 board > using experimental patches on top of this series which add support for > this older SoC to the meson-nand driver. > > Liang, can you please test this series on GXL and/or AXG so I don't > break the NFC driver on these newer SoCs? All of my GXL/GXM boards > have eMMC instead of raw NAND, so I cannot test it on these newer SoCs > myself. > > This series is meant to be applied to the nand/next tree. > > > Martin Blumenstingl (4): > mtd: rawnand: meson: use struct_size macro > mtd: rawnand: meson: use of_property_count_elems_of_size helper > mtd: rawnand: meson: use a void pointer for meson_nfc_dma_buffer_setup > mtd: rawnand: meson: only initialize the RB completion once > > drivers/mtd/nand/raw/meson_nand.c | 21 +++++++++------------ > 1 file changed, 9 insertions(+), 12 deletions(-) > Series applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git branch nand/next. Thanks, Miquèl ^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 0/4] meson-nand: small code improvements @ 2019-04-18 16:22 ` Miquel Raynal 0 siblings, 0 replies; 52+ messages in thread From: Miquel Raynal @ 2019-04-18 16:22 UTC (permalink / raw) To: Martin Blumenstingl Cc: jianxin.pan, bbrezillon, richard, linux-kernel, marek.vasut, liang.yang, linux-mtd, linux-amlogic, computersforpeace, dwmw2, linux-arm-kernel Hi Martin, Martin Blumenstingl <martin.blumenstingl@googlemail.com> wrote on Fri, 12 Apr 2019 00:00:52 +0200: > This series comes with four small improvements for the meson-nand > driver: > * the first patches are replacing open-coded logic with existing > utilities / helpers > * the third patch drops some unnecessary casting after changing > the type of the info buffer parameter from "u8 *" to "void *" > * the fourth patch adjusts the usage of init_completion with what the > documentation suggests > > I have tested these patches as best as I could on my Meson8m2 board > using experimental patches on top of this series which add support for > this older SoC to the meson-nand driver. > > Liang, can you please test this series on GXL and/or AXG so I don't > break the NFC driver on these newer SoCs? All of my GXL/GXM boards > have eMMC instead of raw NAND, so I cannot test it on these newer SoCs > myself. > > This series is meant to be applied to the nand/next tree. > > > Martin Blumenstingl (4): > mtd: rawnand: meson: use struct_size macro > mtd: rawnand: meson: use of_property_count_elems_of_size helper > mtd: rawnand: meson: use a void pointer for meson_nfc_dma_buffer_setup > mtd: rawnand: meson: only initialize the RB completion once > > drivers/mtd/nand/raw/meson_nand.c | 21 +++++++++------------ > 1 file changed, 9 insertions(+), 12 deletions(-) > Series applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git branch nand/next. Thanks, Miquèl _______________________________________________ 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] 52+ messages in thread
* Re: [PATCH 0/4] meson-nand: small code improvements @ 2019-04-18 16:22 ` Miquel Raynal 0 siblings, 0 replies; 52+ messages in thread From: Miquel Raynal @ 2019-04-18 16:22 UTC (permalink / raw) To: Martin Blumenstingl Cc: jianxin.pan, bbrezillon, richard, linux-kernel, marek.vasut, liang.yang, linux-mtd, linux-amlogic, computersforpeace, dwmw2, linux-arm-kernel Hi Martin, Martin Blumenstingl <martin.blumenstingl@googlemail.com> wrote on Fri, 12 Apr 2019 00:00:52 +0200: > This series comes with four small improvements for the meson-nand > driver: > * the first patches are replacing open-coded logic with existing > utilities / helpers > * the third patch drops some unnecessary casting after changing > the type of the info buffer parameter from "u8 *" to "void *" > * the fourth patch adjusts the usage of init_completion with what the > documentation suggests > > I have tested these patches as best as I could on my Meson8m2 board > using experimental patches on top of this series which add support for > this older SoC to the meson-nand driver. > > Liang, can you please test this series on GXL and/or AXG so I don't > break the NFC driver on these newer SoCs? All of my GXL/GXM boards > have eMMC instead of raw NAND, so I cannot test it on these newer SoCs > myself. > > This series is meant to be applied to the nand/next tree. > > > Martin Blumenstingl (4): > mtd: rawnand: meson: use struct_size macro > mtd: rawnand: meson: use of_property_count_elems_of_size helper > mtd: rawnand: meson: use a void pointer for meson_nfc_dma_buffer_setup > mtd: rawnand: meson: only initialize the RB completion once > > drivers/mtd/nand/raw/meson_nand.c | 21 +++++++++------------ > 1 file changed, 9 insertions(+), 12 deletions(-) > Series applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git branch nand/next. Thanks, Miquèl ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ ^ permalink raw reply [flat|nested] 52+ messages in thread
end of thread, other threads:[~2019-04-19 20:02 UTC | newest] Thread overview: 52+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-04-11 22:00 [PATCH 0/4] meson-nand: small code improvements Martin Blumenstingl 2019-04-11 22:00 ` Martin Blumenstingl 2019-04-11 22:00 ` Martin Blumenstingl 2019-04-11 22:00 ` Martin Blumenstingl 2019-04-11 22:00 ` [PATCH 1/4] mtd: rawnand: meson: use struct_size macro Martin Blumenstingl 2019-04-11 22:00 ` Martin Blumenstingl 2019-04-11 22:00 ` Martin Blumenstingl 2019-04-11 22:00 ` Martin Blumenstingl 2019-04-15 6:01 ` Liang Yang 2019-04-15 6:01 ` Liang Yang 2019-04-15 6:01 ` Liang Yang 2019-04-15 6:01 ` Liang Yang 2019-04-11 22:00 ` [PATCH 2/4] mtd: rawnand: meson: use of_property_count_elems_of_size helper Martin Blumenstingl 2019-04-11 22:00 ` Martin Blumenstingl 2019-04-11 22:00 ` Martin Blumenstingl 2019-04-11 22:00 ` Martin Blumenstingl 2019-04-15 6:02 ` Liang Yang 2019-04-15 6:02 ` Liang Yang 2019-04-15 6:02 ` Liang Yang 2019-04-15 6:02 ` Liang Yang 2019-04-11 22:00 ` [PATCH 3/4] mtd: rawnand: meson: use a void pointer for meson_nfc_dma_buffer_setup Martin Blumenstingl 2019-04-11 22:00 ` Martin Blumenstingl 2019-04-11 22:00 ` Martin Blumenstingl 2019-04-11 22:00 ` Martin Blumenstingl 2019-04-15 6:03 ` Liang Yang 2019-04-15 6:03 ` Liang Yang 2019-04-15 6:03 ` Liang Yang 2019-04-15 6:03 ` Liang Yang 2019-04-11 22:00 ` [PATCH 4/4] mtd: rawnand: meson: only initialize the RB completion once Martin Blumenstingl 2019-04-11 22:00 ` Martin Blumenstingl 2019-04-11 22:00 ` Martin Blumenstingl 2019-04-11 22:00 ` Martin Blumenstingl 2019-04-15 6:04 ` Liang Yang 2019-04-15 6:04 ` Liang Yang 2019-04-15 6:04 ` Liang Yang 2019-04-15 6:04 ` Liang Yang 2019-04-18 19:44 ` Martin Blumenstingl 2019-04-18 19:44 ` Martin Blumenstingl 2019-04-18 19:44 ` Martin Blumenstingl 2019-04-18 19:44 ` Martin Blumenstingl 2019-04-19 3:52 ` Liang Yang 2019-04-19 3:52 ` Liang Yang 2019-04-19 3:52 ` Liang Yang 2019-04-19 3:52 ` Liang Yang 2019-04-19 9:00 ` Miquel Raynal 2019-04-19 9:00 ` Miquel Raynal 2019-04-19 9:00 ` Miquel Raynal 2019-04-19 9:00 ` Miquel Raynal 2019-04-18 16:22 ` [PATCH 0/4] meson-nand: small code improvements Miquel Raynal 2019-04-18 16:22 ` Miquel Raynal 2019-04-18 16:22 ` Miquel Raynal 2019-04-18 16:22 ` Miquel Raynal
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.