Message ID | 1281020864-26842-4-git-send-email-vapier@gentoo.org |
---|---|
State | Accepted |
Commit | 752b957a37ee1cc09fccb39a8bc5843edf32119b |
Headers | show |
On Thu, 2010-08-05 at 11:07 -0400, Mike Frysinger wrote: > > + while (bfin_read_NFC_RST() & ECC_RST) > + cpu_relax(); All applied, but I'd be happier if this one had some kind of timeout and didn't have the potential to loop forever if the hardware misbehaves.
On Thu, Aug 5, 2010 at 11:16, David Woodhouse wrote: > On Thu, 2010-08-05 at 11:07 -0400, Mike Frysinger wrote: >> >> + while (bfin_read_NFC_RST() & ECC_RST) >> + cpu_relax(); > > All applied, but I'd be happier if this one had some kind of timeout and > didn't have the potential to loop forever if the hardware misbehaves. ive opened a tracker item for it -mike
On Thu, Aug 5, 2010 at 11:16 PM, David Woodhouse <dwmw2@infradead.org> wrote: > On Thu, 2010-08-05 at 11:07 -0400, Mike Frysinger wrote: >> >> + while (bfin_read_NFC_RST() & ECC_RST) >> + cpu_relax(); > > All applied, but I'd be happier if this one had some kind of timeout and > didn't have the potential to loop forever if the hardware misbehaves. If this loop forever, it means a chip bug and really has no any way to continue to run the system. So the point is "bfin_read_NFC_RST() & ECC_RST" will must be real for the right chip, if the chip has bug, there should be workaround but not a timeout. > > -- > David Woodhouse Open Source Technology Centre > David.Woodhouse@intel.com Intel Corporation > > > _______________________________________________ > Uclinux-dist-devel mailing list > Uclinux-dist-devel@blackfin.uclinux.org > https://blackfin.uclinux.org/mailman/listinfo/uclinux-dist-devel >
On Sun, Aug 15, 2010 at 22:54, Barry Song wrote: > On Thu, Aug 5, 2010 at 11:16 PM, David Woodhouse wrote: >> On Thu, 2010-08-05 at 11:07 -0400, Mike Frysinger wrote: >>> >>> + while (bfin_read_NFC_RST() & ECC_RST) >>> + cpu_relax(); >> >> All applied, but I'd be happier if this one had some kind of timeout and >> didn't have the potential to loop forever if the hardware misbehaves. > > If this loop forever, it means a chip bug and really has no any way to > continue to run the system. So the point is "bfin_read_NFC_RST() & > ECC_RST" will must be real for the right chip, if the chip has bug, > there should be workaround but not a timeout. i think the presumption on the linux/driver side is that hardware has the tendency to suck, so rather than hang the whole system because the NFC flakes out, it should recover gracefully. so spitting out NAND I/O errors all over the console is preferable to a system that goes nowhere. personally, i think it depends on the driver/situation, and in the embedded world, i tend to agree with you Barry in that a dead subpiece is the same as the whole system being dead. but my opinion doesnt matter much if the subsystem maintainers reject the patches ;). -mike
diff --git a/drivers/mtd/nand/bf5xx_nand.c b/drivers/mtd/nand/bf5xx_nand.c index b553705..949f656 100644 --- a/drivers/mtd/nand/bf5xx_nand.c +++ b/drivers/mtd/nand/bf5xx_nand.c @@ -507,6 +507,8 @@ static void bf5xx_nand_dma_rw(struct mtd_info *mtd, */ bfin_write_NFC_RST(ECC_RST); SSYNC(); + while (bfin_read_NFC_RST() & ECC_RST) + cpu_relax(); disable_dma(CH_NFC); clear_dma_irqstat(CH_NFC);