ARM: tegra11: clock: Clip aggregated shared bus BW
Alex Frid [Wed, 1 Aug 2012 19:39:00 +0000 (12:39 -0700)]
Clip aggregated shared bus BW to bus maximum rate.

Change-Id: I9193a3f2fb526f66a008cecc24b002d92ef5a877
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/120264
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

arch/arm/mach-tegra/tegra11_clocks.c

index 7e3583f..f5f4303 100644 (file)
@@ -4366,6 +4366,8 @@ static int tegra11_clk_shared_bus_update(struct clk *bus)
                        switch (c->u.shared_bus_user.mode) {
                        case SHARED_BW:
                                bw += request_rate;
+                               if (bw > bus->max_rate)
+                                       bw = bus->max_rate;
                                break;
                        case SHARED_CEILING:
                                ceiling = min(request_rate, ceiling);