On 11/06/13 12:48, De Roo, Steven wrote: > I think 'tsi148_dma_list_exec()' should also be modified to check this error list ? > I don't think it's strictly necessary for the DMA, a DMA transfer will bail on a Bus error anyway and we do check for that already. This patch stops the list of errors from being built if error checking is not enabled and will therefore never be checked. This does leave the small issue of an ever expanding link list should error checking be turned on and only DMA transfers are conducted. Since the error checking is there because writes are always posted on the tsi148 (a change from the ca91cx42) the only reason to turn it on would be if you are going to be doing writes that you want to be flushed and a check done for errors before the command returns. Martyn > Kind regards, > Steven De Roo > > > -----Oorspronkelijk bericht----- > Van: Martyn Welch [mailto:martyn.welch@xxxxxx] > Verzonden: dinsdag 11 juni 2013 12:20 > Aan: Greg Kroah-Hartman > CC: devel@xxxxxxxxxxxxxxxxxxxx; Manohar Vanga; De Roo, Steven; Martyn Welch > Onderwerp: [PATCH] vme: tsi148: Only store VME bus errors if they will be checked > > The TSI148 driver provides an optional mechanism for ensuring that errors resulting from posted transfers are caught whilst still relevant. To do this errors are stored in a link list. If bus errors are not checked, this list would grow until available memory had been exhausted. > > Only store the errors in a link list if error detection is switched on. > > Reported-by: De Roo, Steven <steven.deroo@xxxxxxxxxxxxxxxxx> > Signed-off-by: Martyn Welch <martyn.welch@xxxxxx> > --- > drivers/vme/bridges/vme_tsi148.c | 28 +++++++++++++++++----------- > 1 files changed, 17 insertions(+), 11 deletions(-) > > diff --git a/drivers/vme/bridges/vme_tsi148.c b/drivers/vme/bridges/vme_tsi148.c > index 9c1aa4d..94ce64d 100644 > --- a/drivers/vme/bridges/vme_tsi148.c > +++ b/drivers/vme/bridges/vme_tsi148.c > @@ -169,7 +169,7 @@ static u32 tsi148_VERR_irqhandler(struct vme_bridge *tsi148_bridge) > unsigned int error_addr_high, error_addr_low; > unsigned long long error_addr; > u32 error_attrib; > - struct vme_bus_error *error; > + struct vme_bus_error *error = NULL; > struct tsi148_driver *bridge; > > bridge = tsi148_bridge->driver_priv; > @@ -186,16 +186,22 @@ static u32 tsi148_VERR_irqhandler(struct vme_bridge *tsi148_bridge) > "Occurred\n"); > } > > - error = kmalloc(sizeof(struct vme_bus_error), GFP_ATOMIC); > - if (error) { > - error->address = error_addr; > - error->attributes = error_attrib; > - list_add_tail(&error->list, &tsi148_bridge->vme_errors); > - } else { > - dev_err(tsi148_bridge->parent, "Unable to alloc memory for " > - "VMEbus Error reporting\n"); > - dev_err(tsi148_bridge->parent, "VME Bus Error at address: " > - "0x%llx, attributes: %08x\n", error_addr, error_attrib); > + if (err_chk) { > + error = kmalloc(sizeof(struct vme_bus_error), GFP_ATOMIC); > + if (error) { > + error->address = error_addr; > + error->attributes = error_attrib; > + list_add_tail(&error->list, &tsi148_bridge->vme_errors); > + } else { > + dev_err(tsi148_bridge->parent, > + "Unable to alloc memory for VMEbus Error reporting\n"); > + } > + } > + > + if (!error) { > + dev_err(tsi148_bridge->parent, > + "VME Bus Error at address: 0x%llx, attributes: %08x\n", > + error_addr, error_attrib); > } > > /* Clear Status */ > -- > 1.7.0.4 > -- Martyn Welch (Lead Software Engineer) | Registered in England and Wales GE Intelligent Platforms | (3828642) at 100 Barbirolli Square T +44(0)1327322748 | Manchester, M2 3AB E martyn.welch@xxxxxx | VAT:GB 927559189 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel