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: <20090814091819.GA27687@elte.hu>
Date:	Fri, 14 Aug 2009 11:18:19 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Thomas Gleixner <tglx@...utronix.de>
Cc:	Peter Zijlstra <peterz@...radead.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>,
	Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Trilok Soni <soni.trilok@...il.com>,
	Pavel Machek <pavel@....cz>,
	Brian Swetland <swetland@...gle.com>,
	Joonyoung Shim <jy0922.shim@...sung.com>,
	m.szyprowski@...sung.com, t.fujak@...sung.com,
	kyungmin.park@...sung.com, David Brownell <david-b@...bell.net>,
	Daniel Ribeiro <drwyrm@...il.com>, arve@...roid.com,
	Barry Song <21cnbao@...il.com>
Subject: Re: [RFC patch 2/3] genirq: Add buslock support for irq chips on
	slow busses


* Thomas Gleixner <tglx@...utronix.de> wrote:

> On Fri, 14 Aug 2009, Peter Zijlstra wrote:
> > On Thu, 2009-08-13 at 19:40 +0000, Thomas Gleixner wrote:
> > >  
> > > +/**
> > > + *	disable_slowbus_irq - disable an slowbus irq and wait for completion
> > > + *	@irq: Interrupt to disable
> > > + *
> > > + *	Disable the selected interrupt line.  Enables and Disables are
> > > + *	nested.
> > > + *	This function waits for any pending IRQ handlers for this interrupt
> > > + *	to complete before returning. If you use this function while
> > > + *	holding a resource the IRQ handler may need you will deadlock.
> > > + *
> > > + *	This function must not be called from IRQ context.
> > > + */
> > > +void disable_slowbus_irq(unsigned int irq)
> > > +{
> > > +	struct irq_desc *desc = irq_to_desc(irq);
> > > +
> > > +	if (!desc || !desc->chip || !desc->chip->bus_lock)
> > > +		return;
> > > +
> > > +	desc->chip->bus_lock(irq);
> > > +	disable_irq_nosync(irq);
> > > +	if (desc->action)
> > > +		synchronize_irq(irq);
> > > +	desc->chip->bus_sync_unlock(irq);
> > > +}
> > > +EXPORT_SYMBOL(disable_slowbus_irq);
> > 
> > Should we also not check that desc->chip->bus_lock is not set for the
> > regular function disable_irq()?
> > 
> > It seems to me mixing disable_irq() and disable_slowbus_irq() 
> > is a recipe for disaster.
> > 
> > Same for the other slowbus functions of course.
> 
> Yeah, that's what I wanted to avoid with the first version, which 
> did the conditional locking and did not require a separate API, 
> but Ingo frowned upon the conditional lock.

Mind posting that version too?

Conditional locking is really nasty but if the only other option is 
nastier there's not much we can do, is there?

	Ingo
--
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