aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-msm/smd.c
diff options
context:
space:
mode:
authorDaniel Walker <c_dwalke@quicinc.com>2010-03-16 16:29:44 -0700
committerDaniel Walker <dwalker@codeaurora.org>2010-05-12 09:18:32 -0700
commitbf83de4037780b11b27f1e32e33c1e8e7e42602e (patch)
treeb2baf37c32a4b4fc036383162b4fcb8eb241e4ed /arch/arm/mach-msm/smd.c
parent79848a2a7333eee6424b38c05b4ea4a0ce56eb47 (diff)
downloadkernel_samsung_smdk4412-bf83de4037780b11b27f1e32e33c1e8e7e42602e.zip
kernel_samsung_smdk4412-bf83de4037780b11b27f1e32e33c1e8e7e42602e.tar.gz
kernel_samsung_smdk4412-bf83de4037780b11b27f1e32e33c1e8e7e42602e.tar.bz2
arm: msm: smd: use either package v3 or v4 not both
This modifies SMD to use either the package v3 or package v4, but not both. The current code tries to allocate as v4 on all system which can produce a scary looking error message on boot up, smem_find(16, 40): wrong size 16424 smd_alloc_channel() cid=02 size=08192 'SMD_RPCCALL' With this error the code then falls back on the package v3 allocation method. This method is inefficient because it causes a slow down on some systems even when the allocation method can be determined at compile time. It also causes a kernel size increase that effects all system and is not needed. This change corrects the allocation to use one method or the other and not both. Signed-off-by: Daniel Walker <c_dwalke@quicinc.com>
Diffstat (limited to 'arch/arm/mach-msm/smd.c')
-rw-r--r--arch/arm/mach-msm/smd.c44
1 files changed, 1 insertions, 43 deletions
diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c
index b864592..130b7a7 100644
--- a/arch/arm/mach-msm/smd.c
+++ b/arch/arm/mach-msm/smd.c
@@ -605,48 +605,6 @@ static int smd_packet_read(smd_channel_t *ch, void *data, int len)
return r;
}
-static int smd_alloc_v2(struct smd_channel *ch)
-{
- struct smd_shared_v2 *shared2;
- void *buffer;
- unsigned buffer_sz;
-
- shared2 = smem_alloc(SMEM_SMD_BASE_ID + ch->n, sizeof(*shared2));
- buffer = smem_item(SMEM_SMD_FIFO_BASE_ID + ch->n, &buffer_sz);
-
- if (!buffer)
- return -1;
-
- /* buffer must be a power-of-two size */
- if (buffer_sz & (buffer_sz - 1))
- return -1;
-
- buffer_sz /= 2;
- ch->send = &shared2->ch0;
- ch->recv = &shared2->ch1;
- ch->send_data = buffer;
- ch->recv_data = buffer + buffer_sz;
- ch->fifo_size = buffer_sz;
- return 0;
-}
-
-static int smd_alloc_v1(struct smd_channel *ch)
-{
- struct smd_shared_v1 *shared1;
- shared1 = smem_alloc(ID_SMD_CHANNELS + ch->n, sizeof(*shared1));
- if (!shared1) {
- pr_err("smd_alloc_channel() cid %d does not exist\n", ch->n);
- return -1;
- }
- ch->send = &shared1->ch0;
- ch->recv = &shared1->ch1;
- ch->send_data = shared1->data0;
- ch->recv_data = shared1->data1;
- ch->fifo_size = SMD_BUF_SIZE;
- return 0;
-}
-
-
static int smd_alloc_channel(const char *name, uint32_t cid, uint32_t type)
{
struct smd_channel *ch;
@@ -658,7 +616,7 @@ static int smd_alloc_channel(const char *name, uint32_t cid, uint32_t type)
}
ch->n = cid;
- if (smd_alloc_v2(ch) && smd_alloc_v1(ch)) {
+ if (_smd_alloc_channel(ch)) {
kfree(ch);
return -1;
}