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: <AANLkTimYZ3GP8oWafOvotwT7kA4Sj26-=gb=T0SbhJ-p@mail.gmail.com>
Date:	Wed, 9 Mar 2011 10:15:52 -0600
From:	Bill Gatliff <bgat@...lgatliff.com>
To:	Lars-Peter Clausen <lars@...afoo.de>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PWM v6 1/3] PWM: Implement a generic PWM framework

Lars-Peter:

On Mon, Mar 7, 2011 at 1:26 PM, Lars-Peter Clausen <lars@...afoo.de> wrote:
> I was thinking about an interface similar to gpio_to_irq. So you could map a
> PWM device to a IRQ number and use the existing the existing genirq framework
> to manage the callback handler.

I really like this idea, though at the moment I don't see clearly how
to implement it.  I'm just a little rusty on those data structures,
that's all.

I'm going to pull all of the callback functionality out of the API,
and will take it as a task to make something like this possible in a
future update:

struct pwm_device *p;
request_irq(pwm_to_irq(p), my_pwm_callback, ...);

> Maybe I'm on the wrong track here though. Could you explain what your expected
> use case is for this part of the API? For example what would a driver using a
> PWM device normally be doing in the handler it passed to the PWM device?

Honestly, I'm not really sure how useful the callback functionality
is.  In fact, it's probably a bad idea to offer it because it allows
someone to do pulse counting for things like stepper motors, and I'm
already thinking about an API for that.  Abusing a PWM to do pulse
counting is pretty CPU-intensive.

The only time end-of-period interrupts come up is when someone wants
to do a coordinated stop i.e. doesn't want a short pulse.  But that's
really a concern for the driver, not users.

So in the above where I said that I might put the callback-like
functionality back into the API, actually I might not.  :)


b.g.
-- 
Bill Gatliff
bgat@...lgatliff.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