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]
Date:	Tue, 30 Aug 2011 13:32:06 +0200 (CEST)
From:	Guennadi Liakhovetski <g.liakhovetski@....de>
To:	Vinod Koul <vinod.koul@...ux.intel.com>
cc:	linux-kernel@...r.kernel.org, linux-sh@...r.kernel.org,
	Dan Williams <dan.j.williams@...el.com>,
	Paul Mundt <lethal@...ux-sh.org>
Subject: Re: [PATCH] dma: shdma: transfer based runtime PM

On Tue, 30 Aug 2011, Vinod Koul wrote:

> On Tue, 2011-08-30 at 09:12 +0200, Guennadi Liakhovetski wrote:
> > On Mon, 29 Aug 2011, Vinod Koul wrote:
> > > > > Something like:
> > > > > /* since callback is set for last descriptor of chain, we call runtime
> > > > >  * put for that desc alone
> > > > >  */
> > > > > list_for_each_entry_safe(desc, __desc, sh_chan->ld_queue, node) {
> > > > > 	if (desc->async_tx.callback)
> > > > > 		pm_runtime_put(device);
> > > > 
> > > > Not all dma users have callbacks.
> > > Do you have such usage today, at least I dont :)
> > > Nevertheless, in tx_submit adding a simple flag in your drivers
> > > descriptor structure can tell you whether to call _put() or not. Agreed?
> > 
> > Yes, I agree, that one could make this work too. Still, I do not 
> > understand how and why this is better to the extent, that I have to 
> > reimplement my patch, retest and resubmit it. Maybe Dan or Paul have an 
> > opinion on this?
> But wont it make code look simpler and cleaner, you don't reply on your
> counters but on pm_runtime infrastructure to do the job.

Sorry, I see it differently. I don't use any counters in my patch. I'm 
only checking for empty queue, i.e., I'm just identifying the first 
descriptor submission and the last completion or termination.

> You juts need
> to call _put/_get at right places, which IMO l;ooks lot simpler than
> current approach

If we didn't have to check for exact symmetry, then yes, I agree, this 
would be cleaner. I.e., if we indeed had well-defined entry- and 
exit-points, which are guaranteed to be called exact same number of times. 
Like, e.g., with file open() / close() etc. But since we don't have this 
symmetry, and instead have to add flags and iterate lists, this doesn't 
look natural and simple to me anymore, sorry.

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
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