From: Valentin Longchamp <valentin.longchamp-SkAbAL50j+5BDgjK7y7TUQ@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Linux SPI <linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Mark Marshall
<markmarshall14-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH] spi/fsl-espi: fix rx_buf in fsl_espi_cmd_trans()/fsl_espi_rw_trans()
Date: Tue, 20 May 2014 17:07:13 +0200 [thread overview]
Message-ID: <537B6FA1.5080200@keymile.com> (raw)
In-Reply-To: <20140519162200.GD12304-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
On 05/19/2014 06:22 PM, Mark Brown wrote:
> On Mon, May 19, 2014 at 05:30:24PM +0200, Valentin Longchamp wrote:
>> Or are you talking about the initial memcpy call that fills up the local buffer
>> in both rw_trans() and cmd_trans() ? And maybe your second point with the
>> scatterlists is about replacing these memcpy calls ?
>
> We shouldn't need this copy at all and therefore there should be no need
> to make sure it is copying into an adequately sized buffer. The only
> thing I can think that the memcpy() is for is ensuring that the data is
> sent from a physically contiguous buffer but scatter/gather should
> handle that.
>
OK I see your point. The problem is that I currently have no time to write/test
a patch that replaces this unnecessary memcpy() to the buffer with
scatter/gather, it will have to wait a bit.
On the other hand, the patch I have sent fixes a buffer overflow with the
current implementation so it could be good to take it if I don't send another
patch with the above improvement.
Valentin
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-05-20 15:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-16 14:46 [PATCH] spi/fsl-espi: fix rx_buf in fsl_espi_cmd_trans()/fsl_espi_rw_trans() Valentin Longchamp
[not found] ` <1400251581-26617-1-git-send-email-valentin.longchamp-SkAbAL50j+5BDgjK7y7TUQ@public.gmane.org>
2014-05-16 19:07 ` Mark Brown
[not found] ` <20140516190723.GT22111-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-05-19 15:30 ` Valentin Longchamp
[not found] ` <537A2390.4070203-SkAbAL50j+5BDgjK7y7TUQ@public.gmane.org>
2014-05-19 16:22 ` Mark Brown
[not found] ` <20140519162200.GD12304-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-05-20 15:07 ` Valentin Longchamp [this message]
2014-05-26 15:57 ` Mark Brown
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=537B6FA1.5080200@keymile.com \
--to=valentin.longchamp-skabal50j+5bdgjk7y7tuq@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=markmarshall14-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.