linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Noralf Trønnes" <noralf@tronnes.org>
To: Michal Suchanek <hramrach@gmail.com>,
	Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: fbtft: do not allocate huge txbuf
Date: Thu, 9 Jun 2016 18:20:17 +0200	[thread overview]
Message-ID: <8dfb88dd-ee33-349d-200e-ff5619f872bb@tronnes.org> (raw)
In-Reply-To: <1f3abe9aabf3fee9d01b5aa8e93859b0f7ed7142.1465484464.git.hramrach@gmail.com>


Den 09.06.2016 17:08, skrev Michal Suchanek:
> txbuflen can be set to arbitrary value by user and it is also set
> automagically to the maximum transfer size of the SPI master controller.

AFAICT this is a result of your previous patch. Please make a new version of
your previous patch with this fix in it. Also make a note in that thread 
that
a new version is made so Greg doesn't pull it when he sees my ack. He
handles a large volume of patches so let's make it as easy as we can for 
him.

Thanks,
Noralf.

> Do not allocate the buffer when larger than vmem. When my SPI master
> controller reports maximum transfer size 16M the probe of fbtft fails.
>
> Signed-off-by: Michal Suchanek <hramrach@gmail.com>
> ---
>   drivers/staging/fbtft/fbtft-core.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c
> index f3bdc8f..b95cf69 100644
> --- a/drivers/staging/fbtft/fbtft-core.c
> +++ b/drivers/staging/fbtft/fbtft-core.c
> @@ -820,6 +820,8 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display,
>   	/* Transmit buffer */
>   	if (txbuflen == -1)
>   		txbuflen = vmem_size + 2; /* add in case startbyte is used */
> +	if (txbuflen >= vmem_size + 2)
> +		txbuflen = 0;
>   
>   #ifdef __LITTLE_ENDIAN
>   	if ((!txbuflen) && (bpp > 8))

       reply	other threads:[~2016-06-09 16:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1f3abe9aabf3fee9d01b5aa8e93859b0f7ed7142.1465484464.git.hramrach@gmail.com>
2016-06-09 16:20 ` Noralf Trønnes [this message]
2016-06-09 17:18   ` [PATCH] staging: fbtft: do not allocate huge txbuf Michal Suchanek
2016-06-09 18:42     ` Noralf Trønnes

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=8dfb88dd-ee33-349d-200e-ff5619f872bb@tronnes.org \
    --to=noralf@tronnes.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hramrach@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thomas.petazzoni@free-electrons.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).