[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.58.0909141443090.17485@shell2.speakeasy.net>
Date: Mon, 14 Sep 2009 14:47:22 -0700 (PDT)
From: Trent Piepho <xyzzy@...akeasy.org>
To: Andreas Mohr <andi@...as.de>
cc: Guennadi Liakhovetski <g.liakhovetski@....de>,
Mauro Carvalho Chehab <mchehab@...radead.org>,
Luca Risolia <luca.risolia@...dio.unibo.it>,
linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: V4L2 drivers: potentially dangerous and inefficient msecs_to_jiffies()
calculation
On Mon, 14 Sep 2009, Andreas Mohr wrote:
> cam->module_param.frame_timeout *
> 1000 * msecs_to_jiffies(1) );
> multiple times each.
> What they should do instead is
> frame_timeout * msecs_to_jiffies(1000), I'd think.
> msecs_to_jiffies(1) is quite a bit too boldly assuming
> that all of the msecs_to_jiffies(x) implementation branches
> always round up.
It might also wait far longer than desired. On a 100 Hz kernel a jiffie is
10 ms. 1000 * msecs_to_jiffies(1) will wait 10 seconds instead of 1.
But, I believe there is an issue with msecs_to_jiffies(x) overflowing for
very high values of x. I'm not sure where that point is though.
--
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