linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: bjorn.andersson@sonymobile.com (Bjorn Andersson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 5/8] soc: qcom: smd: Remove use of VLAIS
Date: Mon, 21 Sep 2015 18:16:51 -0700	[thread overview]
Message-ID: <20150922011651.GQ13472@usrtlx11787.corpusers.net> (raw)
In-Reply-To: <1441234011-4259-6-git-send-email-sboyd@codeaurora.org>

On Wed 02 Sep 15:46 PDT 2015, Stephen Boyd wrote:

> Usage of VLAIS prevents clang from compiling this file, and it
> also opens us to the possibility of allocating a large structure
> on the stack to the point that we blow past the limit of the
> kernel stack. Remove the VLAIS and allocate a structure on the
> heap with kmalloc so that we're safer and more clang friendly.
> 
[..]
> diff --git a/drivers/soc/qcom/smd-rpm.c b/drivers/soc/qcom/smd-rpm.c
[..]
>  	struct {
>  		struct qcom_rpm_header hdr;
>  		struct qcom_rpm_request req;
> -		u8 payload[count];
> -	} pkt;
> +		u8 payload[];
> +	} *pkt;
> +	size_t size = sizeof(*pkt) + count;
>  
[..]
>  
> -	ret = qcom_smd_send(rpm->rpm_channel, &pkt, sizeof(pkt));
> +	ret = qcom_smd_send(rpm->rpm_channel, pkt, sizeof(*pkt));

It would be good if we actually include the request in the packet and
not just the headers :)

s/sizeof(*pkt)/size/

Sorry for not spotting this before, made my device not boot now that it
showed up in linux-next. And oddly the 8974 RPM seems to just ack the
messages, without any indication of the request being truncated...


@Andy, I presume this is only on your -next, can you update the commit?
Or do you want a patch for it?

With this tiny change what we have on next-20150921 seems to work fine.

Regards,
Bjorn

  parent reply	other threads:[~2015-09-22  1:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-02 22:46 [PATCH v2 0/8] SMEM/SMD/SMD_RPM big endian support + tidying Stephen Boyd
2015-09-02 22:46 ` [PATCH v2 1/8] soc: qcom: Make qcom_smem_get() return a pointer Stephen Boyd
2015-09-03 17:02   ` Bjorn Andersson
2015-09-02 22:46 ` [PATCH v2 2/8] soc: qcom: smem: Handle big endian CPUs Stephen Boyd
2015-09-03 17:02   ` Bjorn Andersson
2015-09-02 22:46 ` [PATCH v2 3/8] soc: qcom: smd: Represent channel layout in structures Stephen Boyd
2015-09-02 22:46 ` [PATCH v2 4/8] soc: qcom: smd: Use __iowrite32_copy() instead of open-coding it Stephen Boyd
2015-09-02 22:46 ` [PATCH v2 5/8] soc: qcom: smd: Remove use of VLAIS Stephen Boyd
2015-09-03 17:02   ` Bjorn Andersson
2015-09-22  1:16   ` Bjorn Andersson [this message]
2015-09-22 15:34     ` Andy Gross
2015-09-02 22:46 ` [PATCH v2 6/8] soc: qcom: smd: Handle big endian CPUs Stephen Boyd
2015-09-03 17:02   ` Bjorn Andersson
2015-09-17 21:50   ` [PATCH v3 " Stephen Boyd
2015-09-02 22:46 ` [PATCH v2 7/8] soc: qcom: smd_rpm: " Stephen Boyd
2015-09-03 17:03   ` Bjorn Andersson
2015-09-02 22:46 ` [PATCH v2 8/8] regulator: qcom_smd: " Stephen Boyd
2015-09-03 17:03   ` Bjorn Andersson
2015-09-04 20:35 ` [PATCH v2 0/8] SMEM/SMD/SMD_RPM big endian support + tidying Andy Gross

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=20150922011651.GQ13472@usrtlx11787.corpusers.net \
    --to=bjorn.andersson@sonymobile.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).