diff options
author | Sujeev Dias <sdias@codeaurora.org> | 2017-01-17 23:39:20 -0800 |
---|---|---|
committer | Sujeev Dias <sdias@codeaurora.org> | 2017-03-11 12:16:31 -0800 |
commit | d0b53a6f0c31f451e44946c8033f9b11ebd52cb0 (patch) | |
tree | 3d8b7abcac083b6c50dbe5b76b264ca3c7759bc5 /drivers/platform | |
parent | 5ce3f182b801cf3b958cc991b7a3af619968dd15 (diff) |
mhi: core: fix memory alignment calculation
Fix issue of incorrectly truncating 64bit address
as a 32bit address during memory allocation for
MHI.
CRs-Fixed: 1113884
Change-Id: Iba5123b3710c805cabf63bb6a2958d8218d642e8
Signed-off-by: Sujeev Dias <sdias@codeaurora.org>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/msm/mhi/mhi_bhi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/platform/msm/mhi/mhi_bhi.c b/drivers/platform/msm/mhi/mhi_bhi.c index 87a393f9571f..0cc8967757ec 100644 --- a/drivers/platform/msm/mhi/mhi_bhi.c +++ b/drivers/platform/msm/mhi/mhi_bhi.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -39,7 +39,7 @@ static int bhi_alloc_bhie_xfer(struct mhi_device_ctxt *mhi_dev_ctxt, { struct bhi_ctxt_t *bhi_ctxt = &mhi_dev_ctxt->bhi_ctxt; struct device *dev = &mhi_dev_ctxt->plat_dev->dev; - const u32 align = bhi_ctxt->alignment - 1; + const phys_addr_t align = bhi_ctxt->alignment - 1; size_t seg_size = bhi_ctxt->firmware_info.segment_size; /* We need one additional entry for Vector Table */ int segments = DIV_ROUND_UP(size, seg_size) + 1; @@ -112,7 +112,7 @@ static int bhi_alloc_pbl_xfer(struct mhi_device_ctxt *mhi_dev_ctxt, size_t size) { struct bhi_ctxt_t *bhi_ctxt = &mhi_dev_ctxt->bhi_ctxt; - const u32 align_len = bhi_ctxt->alignment; + const phys_addr_t align_len = bhi_ctxt->alignment; size_t alloc_size = size + (align_len - 1); struct device *dev = &mhi_dev_ctxt->plat_dev->dev; |