tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: panic on zero length SCSI read



On Mon, Nov 30, 2009 at 02:09:52PM +0000, Julian Coleman wrote:
> Hi,
> 
> I was reading a music CD with cdparanoia on sparc64.  The drive failed to
> read a sector from the disk and the machine paniced with:
> 
>   iommu_dvmamap_sync: segment too short 0
> 
> and the backtrace was:
> 
>   _iommu_dvmamap_sync()
>   iommu_dvmamap_sync()
>   esiop_scsipi_request()
>   scsipi_run_queue()
> 
> A fix for the panic is simple (see attached), but I wonder if instead, esiop
> should be modified to not call bus_dmamap_sync() if the length is 0?  In this
> case, it is esiop_cmd->cmd_c.dmamap_cmd->dm_mapsize at line 1608 of esiop.c
> in current sources:
> 
>               bus_dmamap_sync(sc->sc_c.sc_dmat, esiop_cmd->cmd_c.dmamap_cmd,
>                   0, esiop_cmd->cmd_c.dmamap_cmd->dm_mapsize,
>                   BUS_DMASYNC_PREWRITE);
> 
> but perhaps the same applies in other cases too.

I think it's better to fix bus_dma(9) because other drivers may call sync
with a 0 len too ...

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index