* FAILED: patch "[PATCH] mtd: atmel_nand: Support variable RB_EDGE interrupts" failed to apply to 4.6-stable tree
@ 2016-06-04 21:57 gregkh
2016-06-06 7:57 ` Yang, Wenyou
0 siblings, 1 reply; 4+ messages in thread
From: gregkh @ 2016-06-04 21:57 UTC (permalink / raw)
To: romain.izard.pro, Wenyou.yang, boris.brezillon, computersforpeace,
robh, wenyou.yang
Cc: stable
The patch below does not apply to the 4.6-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
>From 5ddc7bd43ccc77173f149483fa27a0b8f85e09e5 Mon Sep 17 00:00:00 2001
From: Romain Izard <romain.izard.pro@gmail.com>
Date: Wed, 10 Feb 2016 10:56:23 +0100
Subject: [PATCH] mtd: atmel_nand: Support variable RB_EDGE interrupts
The NFC controller used to accelerate the NAND transfers on SAMA5 chips
can use either RB_EDGE0 or RB_EDGE3 as its ready/busy interrupt bit.
Use the controller's compatible string to select the correct bit.
For the binding:
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Wenyou Yang <Wenyou.yang@atmel.com>
Tested-by: Wenyou Yang <wenyou.yang@atmel.com>
Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
diff --git a/Documentation/devicetree/bindings/mtd/atmel-nand.txt b/Documentation/devicetree/bindings/mtd/atmel-nand.txt
index 7d4c8eb775a5..89b0db9801b0 100644
--- a/Documentation/devicetree/bindings/mtd/atmel-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/atmel-nand.txt
@@ -34,7 +34,7 @@ Optional properties:
- nand-on-flash-bbt: boolean to enable on flash bbt option if not present false
- Nand Flash Controller(NFC) is a slave driver under Atmel nand flash
- Required properties:
- - compatible : "atmel,sama5d3-nfc".
+ - compatible : "atmel,sama5d3-nfc" or "atmel,sama5d4-nfc".
- reg : should specify the address and size used for NFC command registers,
NFC registers and NFC Sram. NFC Sram address and size can be absent
if don't want to use it.
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index affe7a7e9ad7..06a3e11f6684 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -67,6 +67,10 @@ struct atmel_nand_caps {
bool pmecc_correct_erase_page;
};
+struct atmel_nand_nfc_caps {
+ uint32_t rb_mask;
+};
+
/* oob layout for large page size
* bad block info is on bytes 0 and 1
* the bytes have to be consecutives to avoid
@@ -111,6 +115,7 @@ struct atmel_nfc {
/* Point to the sram bank which include readed data via NFC */
void *data_in_sram;
bool will_write_sram;
+ const struct atmel_nand_nfc_caps *caps;
};
static struct atmel_nfc nand_nfc;
@@ -1675,9 +1680,9 @@ static irqreturn_t hsmc_interrupt(int irq, void *dev_id)
nfc_writel(host->nfc->hsmc_regs, IDR, NFC_SR_XFR_DONE);
ret = IRQ_HANDLED;
}
- if (pending & NFC_SR_RB_EDGE) {
+ if (pending & host->nfc->caps->rb_mask) {
complete(&host->nfc->comp_ready);
- nfc_writel(host->nfc->hsmc_regs, IDR, NFC_SR_RB_EDGE);
+ nfc_writel(host->nfc->hsmc_regs, IDR, host->nfc->caps->rb_mask);
ret = IRQ_HANDLED;
}
if (pending & NFC_SR_CMD_DONE) {
@@ -1695,7 +1700,7 @@ static void nfc_prepare_interrupt(struct atmel_nand_host *host, u32 flag)
if (flag & NFC_SR_XFR_DONE)
init_completion(&host->nfc->comp_xfer_done);
- if (flag & NFC_SR_RB_EDGE)
+ if (flag & host->nfc->caps->rb_mask)
init_completion(&host->nfc->comp_ready);
if (flag & NFC_SR_CMD_DONE)
@@ -1713,7 +1718,7 @@ static int nfc_wait_interrupt(struct atmel_nand_host *host, u32 flag)
if (flag & NFC_SR_XFR_DONE)
comp[index++] = &host->nfc->comp_xfer_done;
- if (flag & NFC_SR_RB_EDGE)
+ if (flag & host->nfc->caps->rb_mask)
comp[index++] = &host->nfc->comp_ready;
if (flag & NFC_SR_CMD_DONE)
@@ -1781,7 +1786,7 @@ static int nfc_device_ready(struct mtd_info *mtd)
dev_err(host->dev, "Lost the interrupt flags: 0x%08x\n",
mask & status);
- return status & NFC_SR_RB_EDGE;
+ return status & host->nfc->caps->rb_mask;
}
static void nfc_select_chip(struct mtd_info *mtd, int chip)
@@ -1954,8 +1959,8 @@ static void nfc_nand_command(struct mtd_info *mtd, unsigned int command,
}
/* fall through */
default:
- nfc_prepare_interrupt(host, NFC_SR_RB_EDGE);
- nfc_wait_interrupt(host, NFC_SR_RB_EDGE);
+ nfc_prepare_interrupt(host, host->nfc->caps->rb_mask);
+ nfc_wait_interrupt(host, host->nfc->caps->rb_mask);
}
}
@@ -2352,6 +2357,11 @@ static int atmel_nand_nfc_probe(struct platform_device *pdev)
}
}
+ nfc->caps = (const struct atmel_nand_nfc_caps *)
+ of_device_get_match_data(&pdev->dev);
+ if (!nfc->caps)
+ return -ENODEV;
+
nfc_writel(nfc->hsmc_regs, IDR, 0xffffffff);
nfc_readl(nfc->hsmc_regs, SR); /* clear the NFC_SR */
@@ -2380,8 +2390,17 @@ static int atmel_nand_nfc_remove(struct platform_device *pdev)
return 0;
}
+static const struct atmel_nand_nfc_caps sama5d3_nfc_caps = {
+ .rb_mask = NFC_SR_RB_EDGE0,
+};
+
+static const struct atmel_nand_nfc_caps sama5d4_nfc_caps = {
+ .rb_mask = NFC_SR_RB_EDGE3,
+};
+
static const struct of_device_id atmel_nand_nfc_match[] = {
- { .compatible = "atmel,sama5d3-nfc" },
+ { .compatible = "atmel,sama5d3-nfc", .data = &sama5d3_nfc_caps },
+ { .compatible = "atmel,sama5d4-nfc", .data = &sama5d4_nfc_caps },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, atmel_nand_nfc_match);
diff --git a/drivers/mtd/nand/atmel_nand_nfc.h b/drivers/mtd/nand/atmel_nand_nfc.h
index 4d5d26221a7e..0bbc1fa97dba 100644
--- a/drivers/mtd/nand/atmel_nand_nfc.h
+++ b/drivers/mtd/nand/atmel_nand_nfc.h
@@ -42,7 +42,8 @@
#define NFC_SR_UNDEF (1 << 21)
#define NFC_SR_AWB (1 << 22)
#define NFC_SR_ASE (1 << 23)
-#define NFC_SR_RB_EDGE (1 << 24)
+#define NFC_SR_RB_EDGE0 (1 << 24)
+#define NFC_SR_RB_EDGE3 (1 << 27)
#define ATMEL_HSMC_NFC_IER 0x0c
#define ATMEL_HSMC_NFC_IDR 0x10
^ permalink raw reply related [flat|nested] 4+ messages in thread
* RE: FAILED: patch "[PATCH] mtd: atmel_nand: Support variable RB_EDGE interrupts" failed to apply to 4.6-stable tree
2016-06-04 21:57 FAILED: patch "[PATCH] mtd: atmel_nand: Support variable RB_EDGE interrupts" failed to apply to 4.6-stable tree gregkh
@ 2016-06-06 7:57 ` Yang, Wenyou
2016-06-06 20:23 ` Brian Norris
0 siblings, 1 reply; 4+ messages in thread
From: Yang, Wenyou @ 2016-06-06 7:57 UTC (permalink / raw)
To: gregkh@linuxfoundation.org, romain.izard.pro@gmail.com,
boris.brezillon@free-electrons.com, computersforpeace@gmail.com,
robh@kernel.org
Cc: stable@vger.kernel.org
> -----Original Message-----
> From: gregkh@linuxfoundation.org [mailto:gregkh@linuxfoundation.org]
> Sent: 2016年6月5日 5:58
> To: romain.izard.pro@gmail.com; Yang, Wenyou <Wenyou.Yang@atmel.com>;
> boris.brezillon@free-electrons.com; computersforpeace@gmail.com;
> robh@kernel.org; Yang, Wenyou <Wenyou.Yang@atmel.com>
> Cc: stable@vger.kernel.org
> Subject: FAILED: patch "[PATCH] mtd: atmel_nand: Support variable RB_EDGE
> interrupts" failed to apply to 4.6-stable tree
>
>
> The patch below does not apply to the 4.6-stable tree.
> If someone wants it applied there, or to any other stable or longterm tree, then
> please email the backport, including the original git commit id to
> <stable@vger.kernel.org>.
This patch is unneeded.
It has been reverted by the commit 53b74ed2d0b4 ("Revert "mtd: atmel_nand: Support variable RB_EDGE interrupts"").
Please don't apply this one.
>
> thanks,
>
> greg k-h
>
> ------------------ original commit in Linus's tree ------------------
>
> From 5ddc7bd43ccc77173f149483fa27a0b8f85e09e5 Mon Sep 17 00:00:00 2001
> From: Romain Izard <romain.izard.pro@gmail.com>
> Date: Wed, 10 Feb 2016 10:56:23 +0100
> Subject: [PATCH] mtd: atmel_nand: Support variable RB_EDGE interrupts
>
> The NFC controller used to accelerate the NAND transfers on SAMA5 chips can
> use either RB_EDGE0 or RB_EDGE3 as its ready/busy interrupt bit.
>
> Use the controller's compatible string to select the correct bit.
>
> For the binding:
> Acked-by: Rob Herring <robh@kernel.org>
>
> Reviewed-by: Wenyou Yang <Wenyou.yang@atmel.com>
> Tested-by: Wenyou Yang <wenyou.yang@atmel.com>
> Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com>
> Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
>
> diff --git a/Documentation/devicetree/bindings/mtd/atmel-nand.txt
> b/Documentation/devicetree/bindings/mtd/atmel-nand.txt
> index 7d4c8eb775a5..89b0db9801b0 100644
> --- a/Documentation/devicetree/bindings/mtd/atmel-nand.txt
> +++ b/Documentation/devicetree/bindings/mtd/atmel-nand.txt
> @@ -34,7 +34,7 @@ Optional properties:
> - nand-on-flash-bbt: boolean to enable on flash bbt option if not present false
> - Nand Flash Controller(NFC) is a slave driver under Atmel nand flash
> - Required properties:
> - - compatible : "atmel,sama5d3-nfc".
> + - compatible : "atmel,sama5d3-nfc" or "atmel,sama5d4-nfc".
> - reg : should specify the address and size used for NFC command registers,
> NFC registers and NFC Sram. NFC Sram address and size can be
> absent
> if don't want to use it.
> diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c index
> affe7a7e9ad7..06a3e11f6684 100644
> --- a/drivers/mtd/nand/atmel_nand.c
> +++ b/drivers/mtd/nand/atmel_nand.c
> @@ -67,6 +67,10 @@ struct atmel_nand_caps {
> bool pmecc_correct_erase_page;
> };
>
> +struct atmel_nand_nfc_caps {
> + uint32_t rb_mask;
> +};
> +
> /* oob layout for large page size
> * bad block info is on bytes 0 and 1
> * the bytes have to be consecutives to avoid @@ -111,6 +115,7 @@ struct
> atmel_nfc {
> /* Point to the sram bank which include readed data via NFC */
> void *data_in_sram;
> bool will_write_sram;
> + const struct atmel_nand_nfc_caps *caps;
> };
> static struct atmel_nfc nand_nfc;
>
> @@ -1675,9 +1680,9 @@ static irqreturn_t hsmc_interrupt(int irq, void *dev_id)
> nfc_writel(host->nfc->hsmc_regs, IDR, NFC_SR_XFR_DONE);
> ret = IRQ_HANDLED;
> }
> - if (pending & NFC_SR_RB_EDGE) {
> + if (pending & host->nfc->caps->rb_mask) {
> complete(&host->nfc->comp_ready);
> - nfc_writel(host->nfc->hsmc_regs, IDR, NFC_SR_RB_EDGE);
> + nfc_writel(host->nfc->hsmc_regs, IDR, host->nfc->caps-
> >rb_mask);
> ret = IRQ_HANDLED;
> }
> if (pending & NFC_SR_CMD_DONE) {
> @@ -1695,7 +1700,7 @@ static void nfc_prepare_interrupt(struct
> atmel_nand_host *host, u32 flag)
> if (flag & NFC_SR_XFR_DONE)
> init_completion(&host->nfc->comp_xfer_done);
>
> - if (flag & NFC_SR_RB_EDGE)
> + if (flag & host->nfc->caps->rb_mask)
> init_completion(&host->nfc->comp_ready);
>
> if (flag & NFC_SR_CMD_DONE)
> @@ -1713,7 +1718,7 @@ static int nfc_wait_interrupt(struct atmel_nand_host
> *host, u32 flag)
> if (flag & NFC_SR_XFR_DONE)
> comp[index++] = &host->nfc->comp_xfer_done;
>
> - if (flag & NFC_SR_RB_EDGE)
> + if (flag & host->nfc->caps->rb_mask)
> comp[index++] = &host->nfc->comp_ready;
>
> if (flag & NFC_SR_CMD_DONE)
> @@ -1781,7 +1786,7 @@ static int nfc_device_ready(struct mtd_info *mtd)
> dev_err(host->dev, "Lost the interrupt flags: 0x%08x\n",
> mask & status);
>
> - return status & NFC_SR_RB_EDGE;
> + return status & host->nfc->caps->rb_mask;
> }
>
> static void nfc_select_chip(struct mtd_info *mtd, int chip) @@ -1954,8 +1959,8
> @@ static void nfc_nand_command(struct mtd_info *mtd, unsigned int command,
> }
> /* fall through */
> default:
> - nfc_prepare_interrupt(host, NFC_SR_RB_EDGE);
> - nfc_wait_interrupt(host, NFC_SR_RB_EDGE);
> + nfc_prepare_interrupt(host, host->nfc->caps->rb_mask);
> + nfc_wait_interrupt(host, host->nfc->caps->rb_mask);
> }
> }
>
> @@ -2352,6 +2357,11 @@ static int atmel_nand_nfc_probe(struct
> platform_device *pdev)
> }
> }
>
> + nfc->caps = (const struct atmel_nand_nfc_caps *)
> + of_device_get_match_data(&pdev->dev);
> + if (!nfc->caps)
> + return -ENODEV;
> +
> nfc_writel(nfc->hsmc_regs, IDR, 0xffffffff);
> nfc_readl(nfc->hsmc_regs, SR); /* clear the NFC_SR */
>
> @@ -2380,8 +2390,17 @@ static int atmel_nand_nfc_remove(struct
> platform_device *pdev)
> return 0;
> }
>
> +static const struct atmel_nand_nfc_caps sama5d3_nfc_caps = {
> + .rb_mask = NFC_SR_RB_EDGE0,
> +};
> +
> +static const struct atmel_nand_nfc_caps sama5d4_nfc_caps = {
> + .rb_mask = NFC_SR_RB_EDGE3,
> +};
> +
> static const struct of_device_id atmel_nand_nfc_match[] = {
> - { .compatible = "atmel,sama5d3-nfc" },
> + { .compatible = "atmel,sama5d3-nfc", .data = &sama5d3_nfc_caps },
> + { .compatible = "atmel,sama5d4-nfc", .data = &sama5d4_nfc_caps },
> { /* sentinel */ }
> };
> MODULE_DEVICE_TABLE(of, atmel_nand_nfc_match); diff --git
> a/drivers/mtd/nand/atmel_nand_nfc.h b/drivers/mtd/nand/atmel_nand_nfc.h
> index 4d5d26221a7e..0bbc1fa97dba 100644
> --- a/drivers/mtd/nand/atmel_nand_nfc.h
> +++ b/drivers/mtd/nand/atmel_nand_nfc.h
> @@ -42,7 +42,8 @@
> #define NFC_SR_UNDEF (1 << 21)
> #define NFC_SR_AWB (1 << 22)
> #define NFC_SR_ASE (1 << 23)
> -#define NFC_SR_RB_EDGE (1 << 24)
> +#define NFC_SR_RB_EDGE0 (1 << 24)
> +#define NFC_SR_RB_EDGE3 (1 << 27)
>
> #define ATMEL_HSMC_NFC_IER 0x0c
> #define ATMEL_HSMC_NFC_IDR 0x10
Best Regards,
Wenyou Yang
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: FAILED: patch "[PATCH] mtd: atmel_nand: Support variable RB_EDGE interrupts" failed to apply to 4.6-stable tree
2016-06-06 7:57 ` Yang, Wenyou
@ 2016-06-06 20:23 ` Brian Norris
2016-06-06 20:46 ` gregkh
0 siblings, 1 reply; 4+ messages in thread
From: Brian Norris @ 2016-06-06 20:23 UTC (permalink / raw)
To: Yang, Wenyou
Cc: gregkh@linuxfoundation.org, romain.izard.pro@gmail.com,
boris.brezillon@free-electrons.com, robh@kernel.org,
stable@vger.kernel.org
On Mon, Jun 06, 2016 at 07:57:56AM +0000, Yang, Wenyou wrote:
> > -----Original Message-----
> > From: gregkh@linuxfoundation.org [mailto:gregkh@linuxfoundation.org]
> > Sent: 2016年6月5日 5:58
> > To: romain.izard.pro@gmail.com; Yang, Wenyou <Wenyou.Yang@atmel.com>;
> > boris.brezillon@free-electrons.com; computersforpeace@gmail.com;
> > robh@kernel.org; Yang, Wenyou <Wenyou.Yang@atmel.com>
> > Cc: stable@vger.kernel.org
> > Subject: FAILED: patch "[PATCH] mtd: atmel_nand: Support variable RB_EDGE
> > interrupts" failed to apply to 4.6-stable tree
> >
> >
> > The patch below does not apply to the 4.6-stable tree.
> > If someone wants it applied there, or to any other stable or longterm tree, then
> > please email the backport, including the original git commit id to
> > <stable@vger.kernel.org>.
>
> This patch is unneeded.
> It has been reverted by the commit 53b74ed2d0b4 ("Revert "mtd: atmel_nand: Support variable RB_EDGE interrupts"").
>
> Please don't apply this one.
>
> >
> > thanks,
> >
> > greg k-h
> >
> > ------------------ original commit in Linus's tree ------------------
> >
> > From 5ddc7bd43ccc77173f149483fa27a0b8f85e09e5 Mon Sep 17 00:00:00 2001
> > From: Romain Izard <romain.izard.pro@gmail.com>
> > Date: Wed, 10 Feb 2016 10:56:23 +0100
> > Subject: [PATCH] mtd: atmel_nand: Support variable RB_EDGE interrupts
Why is commit 5ddc7bd43ccc77173f149483fa27a0b8f85e09e5 even showing up
here? If this was automated, then that seems like a bug in the -stable
scripts. Commit 5ddc7bd43ccc77173f149483fa27a0b8f85e09e5 was already in
v4.6, and it had no for-stable tags. The above patch mentioned by Wenyou
*was* marked for -stable (though I'm no longer confident it is actually
-stable material; but that's a different story):
commit 53b74ed2d0b4 ("Revert "mtd: atmel_nand: Support variable RB_EDGE interrupts"")
Brian
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: FAILED: patch "[PATCH] mtd: atmel_nand: Support variable RB_EDGE interrupts" failed to apply to 4.6-stable tree
2016-06-06 20:23 ` Brian Norris
@ 2016-06-06 20:46 ` gregkh
0 siblings, 0 replies; 4+ messages in thread
From: gregkh @ 2016-06-06 20:46 UTC (permalink / raw)
To: Brian Norris
Cc: Yang, Wenyou, romain.izard.pro@gmail.com,
boris.brezillon@free-electrons.com, robh@kernel.org,
stable@vger.kernel.org
On Mon, Jun 06, 2016 at 01:23:27PM -0700, Brian Norris wrote:
> On Mon, Jun 06, 2016 at 07:57:56AM +0000, Yang, Wenyou wrote:
> > > -----Original Message-----
> > > From: gregkh@linuxfoundation.org [mailto:gregkh@linuxfoundation.org]
> > > Sent: 2016年6月5日 5:58
> > > To: romain.izard.pro@gmail.com; Yang, Wenyou <Wenyou.Yang@atmel.com>;
> > > boris.brezillon@free-electrons.com; computersforpeace@gmail.com;
> > > robh@kernel.org; Yang, Wenyou <Wenyou.Yang@atmel.com>
> > > Cc: stable@vger.kernel.org
> > > Subject: FAILED: patch "[PATCH] mtd: atmel_nand: Support variable RB_EDGE
> > > interrupts" failed to apply to 4.6-stable tree
> > >
> > >
> > > The patch below does not apply to the 4.6-stable tree.
> > > If someone wants it applied there, or to any other stable or longterm tree, then
> > > please email the backport, including the original git commit id to
> > > <stable@vger.kernel.org>.
> >
> > This patch is unneeded.
> > It has been reverted by the commit 53b74ed2d0b4 ("Revert "mtd: atmel_nand: Support variable RB_EDGE interrupts"").
> >
> > Please don't apply this one.
> >
> > >
> > > thanks,
> > >
> > > greg k-h
> > >
> > > ------------------ original commit in Linus's tree ------------------
> > >
> > > From 5ddc7bd43ccc77173f149483fa27a0b8f85e09e5 Mon Sep 17 00:00:00 2001
> > > From: Romain Izard <romain.izard.pro@gmail.com>
> > > Date: Wed, 10 Feb 2016 10:56:23 +0100
> > > Subject: [PATCH] mtd: atmel_nand: Support variable RB_EDGE interrupts
>
> Why is commit 5ddc7bd43ccc77173f149483fa27a0b8f85e09e5 even showing up
> here? If this was automated, then that seems like a bug in the -stable
> scripts.
In looking at this, I have NO idea how this even was attempted to be
added to the stable tree. Maybe it was a cut-and-paste error on my part
when I sent out the "did not apply" message? But why would I even have
this commit open in a window?
I really don't know, sorry, I can't see any email from anyone asking me
to apply it, nor any script that actually picked it up to try to apply
it (nothing is ever auto-applied, I have to approve each commit after
reviewing them.)
So, sorry for the noise, I was dealing with a few hundred patches and
something messed up here, sorry.
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-06-06 20:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-04 21:57 FAILED: patch "[PATCH] mtd: atmel_nand: Support variable RB_EDGE interrupts" failed to apply to 4.6-stable tree gregkh
2016-06-06 7:57 ` Yang, Wenyou
2016-06-06 20:23 ` Brian Norris
2016-06-06 20:46 ` gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).