dma:tegra: avoid int overflow for transferred cnt
authorChristopher Freeman <cfreeman@nvidia.com>
Tue, 6 May 2014 20:13:58 +0000 (13:13 -0700)
committermobile promotions <svcmobile_promotions@nvidia.com>
Mon, 7 Dec 2015 21:50:51 +0000 (13:50 -0800)
commita920ab9693a14eb42d1514b252356ab799466d8c
tree21b282280a24ed2ab7e4849b967fbff92b528409
parentd3c739d0b72d0aa2316149da59d24dccd54c742b
dma:tegra: avoid int overflow for transferred cnt

bytes_transferred will overflow during long audio playbacks.  Since the
driver only ever consults this value modulo bytes_requested, store the value
modulo bytes_requested to prevent overflow.

BUG=chrome-os-partner:28376
TEST=Video/audio playback for >4 hours

Bug 200157067

Change-Id: I67ec972a6abcda0944728592c6c6ff319ea2486b
Reviewed-on: https://chromium-review.googlesource.com/198540
(cherry picked from commit a7ca1e2b0d1bbfa8ea480ac30fee73b85039881e)
Signed-off-by: Christopher Freeman <cfreeman@nvidia.com>
Signed-off-by: Diwakar Paliwal <dpaliwal@nvidia.com>
Reviewed-on: http://git-master/r/840880
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinod Subbarayalu <vsubbarayalu@nvidia.com>
Reviewed-by: Pierre Gervais <pgervais@nvidia.com>
drivers/dma/tegra20-apb-dma.c