lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090106111403.2bdc0f83@hskinnemoen-d830>
Date:	Tue, 6 Jan 2009 11:14:03 +0100
From:	Haavard Skinnemoen <haavard.skinnemoen@...el.com>
To:	Atsushi Nemoto <anemo@....ocn.ne.jp>
Cc:	anemo@....ocn.ne.jp, linux-kernel@...r.kernel.org,
	maciej.sosnowski@...el.com, dan.j.williams@...el.com
Subject: Re: dw_dmac driver questions

Atsushi Nemoto wrote:
> > > > Since dwc_scan_descriptors() was just called, all descriptors that were
> > > > completed successfully have been removed from the active list. So the
> > > > first entry must be the broken one.    
> > > 
> > > But the removal from the active list is done in tasklet too.  If the
> > > CPU was slow and DMA engine was fast enough, DMA engine will process
> > > multiple descriptors before the tasklet called, no ?  
> > 
> > The DMA engine stops if it encounters a bad address.  
> 
> Yes.  And it does not mean the bad descriptor is at head of the active
> queue.
> 
> 1) driver enqueue desc A to active list and start DMA engine
> 2) driver enqueue desc B to queue list
> 3) driver enqueue desc C to queue list  (desc C contains bad address)
> 4) DMA engine finish desc A and raise interrupt
> 5) tasklet remove desc A from active list and move desc B and C to active list
> 6) DMA engine finish desc B and raise interrupt
> 7) DMA engine abort desc C and raise interrupt
> 8) tasklet detect error
> 
> The point is the order of (7) and (8) cannot be expected.  If (7)
> comes first, the head of the active list contains desc B at (8) and
> that is not a bad descriptor.

The tasklet won't detect any errors unless the DMA controller flags it,
so (7) must happen before (8). That does not necessarily mean that the
interrupts from (6) and (7) get handled before (8), but I don't think
it matters because dwc_handle_error() calls dwc_scan_descriptors(),
which will remove desc B from the active list if it is finished. And it
must be finished if desc C has failed, so the failed descriptor will
always be at the head of the queue after dwc_scan_descriptors() returns.

Haavard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ