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:	Fri, 29 Apr 2011 01:27:48 +0400
From:	Alexander Gordeev <lasaine@....cs.msu.su>
To:	Alexander Gordeev <lasaine@....cs.msu.su>
Cc:	James Nuss <jamesnuss@...ometrics.ca>,
	Rodolfo Giometti <rodolfo.giometti@...eenne.com>,
	linuxpps@...enneenne.com, linux-kernel@...r.kernel.org
Subject: Re: [LinuxPPS] [PATCH 2/2] pps: new client driver using IRQs

В Fri, 29 Apr 2011 00:55:24 +0400
Alexander Gordeev <lasaine@....cs.msu.su> пишет:

> В Thu, 28 Apr 2011 16:03:59 -0400
> James Nuss <jamesnuss@...ometrics.ca> пишет:
> 
> > Hi Alexander,
> > 
> > Thanks for reviewing the code.
> > 
> > On Thu, Apr 28, 2011 at 7:22 AM, Alexander Gordeev
> > <lasaine@....cs.msu.su> wrote:
> > > Hi James,
> > >
> > > В Wed, 27 Apr 2011 14:14:14 -0400
> > > James Nuss <jamesnuss@...ometrics.ca> пишет:
> > >
> > >> +             return -EINVAL;
> > >> +     }
> > >> +
> > >> +     res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> > >> +     if (res == NULL) {
> > >> +             pr_err(PPS_IRQ_NAME ": no IRQ resource was given");
> > >> +             return -EINVAL;
> > >> +     }
> > >> +
> > >> +     if (!(res->flags & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING))) {
> > >> +             pr_err(PPS_IRQ_NAME ": given IRQ resource must be edge triggered");
> > >> +             return -EINVAL;
> > >> +     }
> > >
> > > I think it doesn't actually expect that both flags are set because it
> > > always treats it as assert in the irq handler. What does your signal
> > > look like?
> > 
> > The conditional logic is that one of either IRQF_TRIGGER_RISING or
> > IRQF_TRIGGER_FALLING must be set. It doesn't make much sense to have
> > neither set for PPS signals.
> > My intention is that the driver is generic enough so you can register
> > an IRQ resource with either IRQF_TRIGGER_RISING or
> > IRQF_TRIGGER_FALLING and you will get and assert event for that edge.
> > Clear events are not generated as you suggest but I believe this is
> > OK.
> > My signal is a simple low-to-high transition indicating the PPS. But I
> > believe you could register a device using this driver referencing the
> > other edge if required.
> 
> Ok, but is there a way one can register an IRQ resource with both flags
> set? If yes, then it would be nice to have a stricter check here to
> prevent two situations:
> 1. none flag is set (it is already in place)
> 2. both flags are set
> 
> The latter will definitely mess things up, right?

I mean, one surely can register an IRQ resource with both flags set. And
if the underlying hardware works as it is described (i.e. raises an irq
on both edges) then it will be a problem.

-- 
  Alexander

Download attachment "signature.asc" of type "application/pgp-signature" (491 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ