All of lore.kernel.org
 help / color / mirror / Atom feed
From: Danilo Krummrich <danilokrummrich@dk-develop.de>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	linus.walleij@linaro.org
Subject: Re: [PATCH 1/3] input: ps2-gpio: use ktime for IRQ timekeeping
Date: Tue, 15 Feb 2022 13:09:33 +0100	[thread overview]
Message-ID: <YguX/dDxtDMYUviz@pollux> (raw)
In-Reply-To: <YgtEwMQMrp3uQinK@google.com>

Hi Dmitry,

On Mon, Feb 14, 2022 at 10:14:24PM -0800, Dmitry Torokhov wrote:
> Hi Danilo,
> 
> On Fri, Feb 11, 2022 at 10:22:56PM +0100, Danilo Krummrich wrote:
> > @@ -128,20 +155,33 @@ static irqreturn_t ps2_gpio_irq_rx(struct ps2_gpio_data *drvdata)
> >  	unsigned char byte, cnt;
> >  	int data;
> >  	int rxflags = 0;
> > -	static unsigned long old_jiffies;
> > +	static ktime_t t_last, t_now;
> > +	s64 us_delta;
> >  
> >  	byte = drvdata->rx_byte;
> >  	cnt = drvdata->rx_cnt;
> >  
> > -	if (old_jiffies == 0)
> > -		old_jiffies = jiffies;
> > +	t_now = ktime_get();
> > +	if (t_last == 0)
> 
> Instead of checking this every time, do you think we could seed the
> value in ps2_gpio_open() (and also make it per-port, not static)?
Oops! Sure, I'll send a v2.

I will also add another patch to refactor struct ps2_gpio_data to clearly
separate rx and tx state data, otherwise it might start to become a bit messy.
> 
> Thanks.
> 
> -- 
> Dmitry

- Danilo

  reply	other threads:[~2022-02-15 12:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-11 21:22 input: ps2-gpio: use ktime for IRQ timekeeping Danilo Krummrich
2022-02-11 21:22 ` [PATCH 1/3] " Danilo Krummrich
2022-02-15  6:14   ` Dmitry Torokhov
2022-02-15 12:09     ` Danilo Krummrich [this message]
2022-02-11 21:22 ` [PATCH 2/3] input: ps2-gpio: remove tx timeout from ps2_gpio_irq_tx() Danilo Krummrich
2022-02-11 21:22 ` [PATCH 3/3] input: ps2-gpio: don't send rx data before the stop bit Danilo Krummrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YguX/dDxtDMYUviz@pollux \
    --to=danilokrummrich@dk-develop.de \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.