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] [day] [month] [year] [list]
Date:	Fri, 5 Jun 2009 18:58:14 +0200
From:	Samuel Ortiz <sameo@...nedhand.com>
To:	pHilipp Zabel <philipp.zabel@...il.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/7] MFD: ASIC3: add clock handling for MFD cells

On Fri, Jun 05, 2009 at 06:27:20PM +0200, pHilipp Zabel wrote:
> On Fri, Jun 5, 2009 at 1:49 AM, Samuel Ortiz<sameo@...nedhand.com> wrote:
> > Hi Philipp,
> >
> > On Thu, Jun 04, 2009 at 08:36:11PM +0200, Philipp Zabel wrote:
> >> +
> >> +struct asic3_clk {
> >> +     int enabled;
> > You probably want to use a kref here.
> >
> >> +static int asic3_clk_enable(struct asic3 *asic, struct asic3_clk *clk)
> >> +{
> >> +     unsigned long flags;
> >> +     u32 cdex;
> >> +
> >> +     spin_lock_irqsave(&asic->lock, flags);
> >> +     if (clk->enabled++ == 0) {
> > using the kref API here would definitely be nicer.
> 
> While I agree that the kref API looks nice, I'm not convinced it is
> intended to be used in this case. We are not counting references here.
> There is no way to get the count back from the API, which we need to
> decide whether or not to flip the CDEX bits. 
Fair enough.


> We could misuse the
> release function pointer given to kref_put to turn off the clock, but
> I'd prefer to leave it the way it is now.
That's fine with me.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
--
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