Merge remote-tracking branch 'drm/drm-next' into drm-misc-next
drm-next is forwarded to v4.20-rc1, and we need this to make a patch series apply. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
This commit is contained in:
@@ -81,9 +81,19 @@ static long sun4i_dclk_round_rate(struct clk_hw *hw, unsigned long rate,
|
||||
int i;
|
||||
|
||||
for (i = tcon->dclk_min_div; i <= tcon->dclk_max_div; i++) {
|
||||
unsigned long ideal = rate * i;
|
||||
u64 ideal = (u64)rate * i;
|
||||
unsigned long rounded;
|
||||
|
||||
/*
|
||||
* ideal has overflowed the max value that can be stored in an
|
||||
* unsigned long, and every clk operation we might do on a
|
||||
* truncated u64 value will give us incorrect results.
|
||||
* Let's just stop there since bigger dividers will result in
|
||||
* the same overflow issue.
|
||||
*/
|
||||
if (ideal > ULONG_MAX)
|
||||
goto out;
|
||||
|
||||
rounded = clk_hw_round_rate(clk_hw_get_parent(hw),
|
||||
ideal);
|
||||
|
||||
|
Reference in New Issue
Block a user