Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1229866 > unrolled thread
| Started by | Bjorn Andersson <bjorn.andersson@sonymobile.com> |
|---|---|
| First post | 2015-09-22 03:20 +0200 |
| Last post | 2015-09-22 17:40 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH v2 5/8] soc: qcom: smd: Remove use of VLAIS Bjorn Andersson <bjorn.andersson@sonymobile.com> - 2015-09-22 03:20 +0200
Re: [PATCH v2 5/8] soc: qcom: smd: Remove use of VLAIS Andy Gross <agross@codeaurora.org> - 2015-09-22 17:40 +0200
| From | Bjorn Andersson <bjorn.andersson@sonymobile.com> |
|---|---|
| Date | 2015-09-22 03:20 +0200 |
| Subject | Re: [PATCH v2 5/8] soc: qcom: smd: Remove use of VLAIS |
| Message-ID | <qbkpr-72u-3@gated-at.bofh.it> |
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Andy Gross <agross@codeaurora.org> |
|---|---|
| Date | 2015-09-22 17:40 +0200 |
| Message-ID | <qbxPI-10s-21@gated-at.bofh.it> |
| In reply to | #1229866 |
On Mon, Sep 21, 2015 at 06:16:51PM -0700, Bjorn Andersson wrote:
> 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?
I can fix it up.
--
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web