Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1730972

Re: [PATCH] pps-gpio: use IRQ edge config when not capturing both edges

From Tim Harvey <tharvey@gateworks.com>
Newsgroups linux.kernel
Subject Re: [PATCH] pps-gpio: use IRQ edge config when not capturing both edges
Date 2017-09-12 18:00 +0200
Message-ID <uoVLr-3bm-3@gated-at.bofh.it> (permalink)
References <unxBv-3aB-17@gated-at.bofh.it> <uo7Ym-2sD-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, Sep 10, 2017 at 3:43 AM, Rodolfo Giometti <giometti@enneenne.com> wrote:
> On 08/09/2017 21:53, Tim Harvey wrote:
>>
>> PPS signals with very short pulse-widths can be missed if their state
>> changes by the time the interrupt handler reads the GPIO pin state.
>>
>> To avoid this in the case where we are only looking for one edge we can
>> use the edge configuration for the pin state but fall back to reading the
>> pin if both edges are being watched.
>
>
> I disagree. The "rising_edge" status should be get from the hardware and not
> derived by an empirical computation. Or, at least, it should be specifically
> activated by setting something like this:
>
>         pps {
>                 pinctrl-names = "default";
>                 pinctrl-0 = <&pinctrl_pps>;
>
>                 gpios = <&gpio1 26 GPIO_ACTIVE_HIGH>;
>                 Yes-I-want-get-signal-status-in-an-epirical-way;
>
>                 compatible = "pps-gpio";
>                 status = "okay";
>         };
>
> This setting should also print a warning in order to be clear for the user
> that he/she should know what he/she is doing.
>
> Then the code should check also the compatibility with property
> "assert-falling-edge"...
>

Hi Rodolfo,

Do you agree with using the irq edge in general if/when it is
available to resolve the case where small pulse-widths can be caught?

I assumed because pps-gpio is the one configuring the irq based on
info->capture_clear and info->assert_falling_edge that that it made
sense to use that logic again when handling the interrupt but there is
likely a call I can make to determine the irq (edge) type based on the
irq.

Tim

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH] pps-gpio: use IRQ edge config when not capturing both edges Tim Harvey <tharvey@gateworks.com> - 2017-09-12 18:00 +0200
  Re: [PATCH] pps-gpio: use IRQ edge config when not capturing both  edges Rodolfo Giometti <giometti@enneenne.com> - 2017-09-12 18:30 +0200

csiph-web