From: "Walker, Benjamin" <benjamin.walker@intel.com>
To: Vinod Koul <vkoul@kernel.org>
Cc: <dmaengine@vger.kernel.org>, <ludovic.desroches@microchip.com>,
<okaya@kernel.org>, <dave.jiang@intel.com>,
Tudor Ambarus <tudor.ambarus@microchip.com>
Subject: Re: [RFC PATCH 2/4] dmaengine: at_hdmac: In atc_prep_dma_memset, treat value as a single byte
Date: Fri, 18 Feb 2022 14:42:00 -0700 [thread overview]
Message-ID: <7dea976c-3685-84ea-d2b5-dfeddc0f2045@intel.com> (raw)
In-Reply-To: <YguS4m1dRci/nBmz@matsya>
On 2/15/2022 4:47 AM, Vinod Koul wrote:
> On 28-01-22, 11:39, Ben Walker wrote:
>> The value passed in to .prep_dma_memset is to be treated as a single
>> byte repeating pattern.
>>
>> Signed-off-by: Ben Walker <benjamin.walker@intel.com>
>> Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
>> Cc: Tudor Ambarus <tudor.ambarus@microchip.com>
>> ---
>> drivers/dma/at_hdmac.c | 10 +++++++++-
>> 1 file changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
>> index 30ae36124b1db..6defca514a614 100644
>> --- a/drivers/dma/at_hdmac.c
>> +++ b/drivers/dma/at_hdmac.c
>> @@ -942,6 +942,7 @@ atc_prep_dma_memset(struct dma_chan *chan, dma_addr_t dest, int value,
>> struct at_desc *desc;
>> void __iomem *vaddr;
>> dma_addr_t paddr;
>> + unsigned char fill_pattern;
>>
>> dev_vdbg(chan2dev(chan), "%s: d%pad v0x%x l0x%zx f0x%lx\n", __func__,
>> &dest, value, len, flags);
>> @@ -963,7 +964,14 @@ atc_prep_dma_memset(struct dma_chan *chan, dma_addr_t dest, int value,
>> __func__);
>> return NULL;
>> }
>> - *(u32*)vaddr = value;
>> +
>> + /* Only the first byte of value is to be used according to dmaengine */
>> + fill_pattern = (unsigned char)value;
>
> why cast as unsigned?
No good reason - I didn't think negatives would be used. I've updated
this to be signed in the v2.
>
>> +
>> + *(u32*)vaddr = (fill_pattern << 24) |
>> + (fill_pattern << 16) |
>> + (fill_pattern << 8) |
>> + fill_pattern;
>>
>> desc = atc_create_memset_desc(chan, paddr, dest, len);
>> if (!desc) {
>> --
>> 2.33.1
>
next prev parent reply other threads:[~2022-02-18 21:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-28 18:39 [RFC PATCH 0/4] dmaengine: memset clarifications and fixes Ben Walker
2022-01-28 18:39 ` [RFC PATCH 1/4] dmaengine: Document dmaengine_prep_dma_memset Ben Walker
2022-02-15 11:44 ` Vinod Koul
2022-02-18 21:37 ` Walker, Benjamin
2022-01-28 18:39 ` [RFC PATCH 2/4] dmaengine: at_hdmac: In atc_prep_dma_memset, treat value as a single byte Ben Walker
2022-02-15 11:47 ` Vinod Koul
2022-02-18 21:42 ` Walker, Benjamin [this message]
2022-01-28 18:39 ` [RFC PATCH 3/4] dmaengine: at_xdmac: In at_xdmac_prep_dma_memset, " Ben Walker
2022-01-28 18:39 ` [RFC PATCH 4/4] dmaengine: hidma: In hidma_prep_dma_memset " Ben Walker
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=7dea976c-3685-84ea-d2b5-dfeddc0f2045@intel.com \
--to=benjamin.walker@intel.com \
--cc=dave.jiang@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=ludovic.desroches@microchip.com \
--cc=okaya@kernel.org \
--cc=tudor.ambarus@microchip.com \
--cc=vkoul@kernel.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).