From: Nicholas Mc Guire <der.herr@hofr.at>
To: David Miller <davem@davemloft.net>
Cc: hofrat@osadl.org, kas@fi.muni.cz, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cosa: use msecs_to_jiffies for conversions
Date: Sun, 7 Jun 2015 10:25:58 +0200 [thread overview]
Message-ID: <20150607082558.GA9670@opentech.at> (raw)
In-Reply-To: <20150607.001800.854104281240414676.davem@davemloft.net>
On Sun, 07 Jun 2015, David Miller wrote:
> From: Nicholas Mc Guire <hofrat@osadl.org>
> Date: Sat, 6 Jun 2015 09:51:51 +0200
>
> > @@ -517,7 +517,7 @@ static int cosa_probe(int base, int irq, int dma)
> > */
> > set_current_state(TASK_INTERRUPTIBLE);
> > cosa_putstatus(cosa, SR_TX_INT_ENA);
> > - schedule_timeout(30);
> > + schedule_timeout(msecs_to_jiffies(300));
> > irq = probe_irq_off(irqs);
> > /* Disable all IRQs from the card */
> > cosa_putstatus(cosa, 0);
>
> You are making these transformations completely inconsistently.
>
> You're converting it to msecs in some patches and here you are doing
> something else.
>
As noted in the cosa case the code predated configurable HZ so the
30 was definitely assuming HZ=100 and therefor it should probably be 300
now - I do not think that is inconsisten and it was explained in the
patch. I only can make the HZ=100 assumption if the code predates
configurable HZ otherwise I leave it at the nominal value and put a note
in that it may be a significant change and needs review.
What alternative would you suggest ?
> Please do _all_ of these transformations consistently and in a way
> that minimizes the chances of breaking things.
>
> And the only way to do that is to strictly convert these cases to
> whatever it works out to when HZ=100 since that is strictly the
> environment all of this old code was written in.
>
for the dscc4 case Im not sure - that seems to have gone in in 2.4
and that had HZ configurable. The cosa case was checked
again 2.2.26 (no config HZ) and the timeout there was 30 -> 300ms.
I think that this is consistent with respect to the limited available
information of the timeout unit in the code.
thx!
hofrat
next prev parent reply other threads:[~2015-06-07 8:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-06 7:51 [PATCH] cosa: use msecs_to_jiffies for conversions Nicholas Mc Guire
2015-06-07 7:18 ` David Miller
2015-06-07 8:25 ` Nicholas Mc Guire [this message]
2015-06-08 6:46 ` David Miller
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=20150607082558.GA9670@opentech.at \
--to=der.herr@hofr.at \
--cc=davem@davemloft.net \
--cc=hofrat@osadl.org \
--cc=kas@fi.muni.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).