From: Conor Dooley <conor@kernel.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Conor Dooley <conor.dooley@microchip.com>,
Thierry Reding <thierry.reding@gmail.com>,
Daire McNamara <daire.mcnamara@microchip.com>,
linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org,
linux-riscv@lists.infradead.org
Subject: Re: [PATCH v12 1/2] pwm: add microchip soft ip corePWM driver
Date: Mon, 5 Dec 2022 17:13:42 +0000 [thread overview]
Message-ID: <Y44mxp9Wr/aEdaxE@spud> (raw)
In-Reply-To: <20221205160328.wn4rcs6uxuuaxftd@pengutronix.de>
[-- Attachment #1.1: Type: text/plain, Size: 2486 bytes --]
On Mon, Dec 05, 2022 at 05:03:28PM +0100, Uwe Kleine-König wrote:
> Hello Conor,
>
> On Mon, Dec 05, 2022 at 03:21:55PM +0000, Conor Dooley wrote:
> > I came into work today thinking that I could just rebase on top of your
> > patchset and send out a v13, but that was unfortunately not the case :/
> >
> > So uh, it turns out that I was wrong about the behaviour of the
> > sync_update register's bit.
> > It turns out that that bit holds it's value until the IP block is reset,
> > and /does not/ get cleared at the start of the next period.
> > I'm really not sure how it worked when I tested the other week [0], so I
> > spent the first half of the day trying to figure out what on earth had
> > happened to my FPGA image. I must've picked the wrong image when I went
> > to test it the other week that had the wrong configuration somehow.
> >
> > As a result, I've gone and hacked up another way of transferring the
> > burden of waiting - setting a timer for the period, backed by a
> > completion. get_state() and apply() now both check for the completion
> > and time out otherwise. I'm half tempted to tack RFC back onto the
> > series as I have not really messed with timers at all before and may
> > have done something off the wall.
> >
> > I pushed it out (see [1] in case you'd like to look) so that the bots
> > can have a play with it, since it'll be a few weeks before I'll have a
> > chance to properly test that I've broken nothing with this.
>
> I didn't look, but I'm convinced you don't need a timer. Something like
> the following should work, shouldn't it?:
Yeah & I did think of something along these lines. I was torn between
something that seemed heavy handed (timers) and calculating if enough
time had elapsed, which seemed a bit hacky.
Figured I was better off doing something quickly & asking rather than
polishing only to find out it was disliked ;)
>
> - in .apply() check the current time, add the current period and store
> the result to ddata->updatetimestamp
> - in .get_state do:
> if (current_time >= ddata->updatetimestamp)
> process fine
> else:
> timeout (or wait until ddata->updatetimestamp?)
>
> Actually I'd prefer to wait instead of -ETIMEOUT.
Prefer to wait in get_state() or in both it & apply()?
Depending on how far away updatetimestamp is, would we still not want to
time out if it is going to be a long time, no?
Thanks again Uwe,
Conor.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 161 bytes --]
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2022-12-05 17:13 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-10 9:35 [PATCH v12 0/2] Hey Uwe, all, Conor Dooley
2022-11-10 9:35 ` [PATCH v12 1/2] pwm: add microchip soft ip corePWM driver Conor Dooley
2022-11-17 16:49 ` Uwe Kleine-König
2022-11-17 17:38 ` Conor Dooley
2022-11-17 21:04 ` Uwe Kleine-König
2022-11-17 22:03 ` Conor Dooley
2022-11-21 15:29 ` Conor Dooley
2022-11-30 9:53 ` Conor Dooley
2022-11-30 10:37 ` Uwe Kleine-König
2022-11-30 11:15 ` Conor Dooley
2022-12-05 15:21 ` Conor Dooley
2022-12-05 16:03 ` Uwe Kleine-König
2022-12-05 17:13 ` Conor Dooley [this message]
2022-12-05 18:13 ` Uwe Kleine-König
2022-11-10 9:35 ` [PATCH v12 2/2] MAINTAINERS: add pwm to PolarFire SoC entry Conor Dooley
2022-11-10 9:38 ` [PATCH v12 0/2] Hey Uwe, all, Conor.Dooley
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=Y44mxp9Wr/aEdaxE@spud \
--to=conor@kernel.org \
--cc=conor.dooley@microchip.com \
--cc=daire.mcnamara@microchip.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=thierry.reding@gmail.com \
--cc=u.kleine-koenig@pengutronix.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox