alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: alsa-devel@alsa-project.org
Cc: liam.r.girdwood@linux.intel.com, patches.audio@intel.com,
	broonie@kernel.org,
	"Subhransu S. Prusty" <subhransu.s.prusty@intel.com>
Subject: Re: [PATCH 8/8] ASoC: Intel: Allocate for the mailbox with max size
Date: Tue, 19 May 2015 14:56:11 +0530	[thread overview]
Message-ID: <20150519092611.GK3140@localhost> (raw)
In-Reply-To: <1431948361-12756-9-git-send-email-vinod.koul@intel.com>

On Mon, May 18, 2015 at 04:56:01PM +0530, Vinod Koul wrote:
> From: "Subhransu S. Prusty" <subhransu.s.prusty@intel.com>
> 
> Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
> ---
>  sound/soc/intel/common/sst-ipc.c | 15 +++++++++++++++
>  sound/soc/intel/common/sst-ipc.h |  4 ++--
>  2 files changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/intel/common/sst-ipc.c b/sound/soc/intel/common/sst-ipc.c
> index a7699f35a8d2..137bdfc35063 100644
> --- a/sound/soc/intel/common/sst-ipc.c
> +++ b/sound/soc/intel/common/sst-ipc.c
> @@ -128,6 +128,21 @@ static int msg_empty_list_init(struct sst_generic_ipc *ipc)
>  	if (ipc->msg == NULL)
>  		return -ENOMEM;
>  
> +	ipc->msg->tx_data = devm_kzalloc(ipc->dev,
> +			sizeof(ipc->tx_data_max_size), GFP_KERNEL);
> +	if (ipc->msg->tx_data == NULL) {
> +		kfree(ipc->msg);
> +		return -ENOMEM;
> +	}
> +
> +	ipc->msg->rx_data = devm_kzalloc(ipc->dev,
> +			sizeof(ipc->rx_data_max_size), GFP_KERNEL);
> +	if (ipc->msg->rx_data == NULL) {
> +		kfree(ipc->msg->tx_data);
> +		kfree(ipc->msg);
> +		return -ENOMEM;
> +	}
> +
>  	for (i = 0; i < IPC_EMPTY_LIST_SIZE; i++) {
we need to allocate the memory for each message in the queue, i will send
updated series now

-- 
~Vinod

>  		init_waitqueue_head(&ipc->msg[i].waitq);
>  		list_add(&ipc->msg[i].list, &ipc->empty_list);
> diff --git a/sound/soc/intel/common/sst-ipc.h b/sound/soc/intel/common/sst-ipc.h
> index 7139afd2547f..ceb7e468a3fa 100644
> --- a/sound/soc/intel/common/sst-ipc.h
> +++ b/sound/soc/intel/common/sst-ipc.h
> @@ -32,9 +32,9 @@ struct ipc_message {
>  	u64 header;
>  
>  	/* direction wrt host CPU */
> -	char tx_data[IPC_MAX_MAILBOX_BYTES];
> +	char *tx_data;
>  	size_t tx_size;
> -	char rx_data[IPC_MAX_MAILBOX_BYTES];
> +	char *rx_data;
>  	size_t rx_size;
>  
>  	wait_queue_head_t waitq;
> -- 
> 1.9.1
> 

-- 

      reply	other threads:[~2015-05-19  9:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-18 11:25 [PATCH 0/8] ASoC: Intel: refactor common SST IPC handling Vinod Koul
2015-05-18 11:25 ` [PATCH 1/8] ASoC: Intel: Create an ops to check for DSP busy Vinod Koul
2015-05-18 11:25 ` [PATCH 2/8] ASoC: Intel: Move the busy check to ops for Baytrail Vinod Koul
2015-05-18 11:25 ` [PATCH 3/8] ASoC: Intel: Move the busy check to ops for HSW Vinod Koul
2015-05-18 11:25 ` [PATCH 4/8] ASoC: Intel: Remove the direct register reference from common ipc Vinod Koul
2015-05-18 11:25 ` [PATCH 5/8] ASoC: Intel: Allow to configure max size for mailbox data Vinod Koul
2015-05-18 11:25 ` [PATCH 6/8] ASoC: Intel: Initialize max mailbox size for baytrail Vinod Koul
2015-05-18 11:26 ` [PATCH 7/8] ASoC: Intel: Initialize max mailbox size for haswell Vinod Koul
2015-05-18 11:26 ` [PATCH 8/8] ASoC: Intel: Allocate for the mailbox with max size Vinod Koul
2015-05-19  9:26   ` Vinod Koul [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150519092611.GK3140@localhost \
    --to=vinod.koul@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=patches.audio@intel.com \
    --cc=subhransu.s.prusty@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).