[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1439202205.4848.6.camel@synopsys.com>
Date: Mon, 10 Aug 2015 10:23:25 +0000
From: Alexey Brodkin <Alexey.Brodkin@...opsys.com>
To: "ben@...adent.org.uk" <ben@...adent.org.uk>
CC: "davem@...emloft.net" <davem@...emloft.net>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"arc-linux-dev@...opsys.com" <arc-linux-dev@...opsys.com>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"peppe.cavallaro@...com" <peppe.cavallaro@...com>,
"stable@...r.kernel.org" <stable@...r.kernel.org>
Subject: Re: [PATCH 3.2 047/110] stmmac: troubleshoot unexpected bits in
des0 & des1
Hi Ben,
On Mon, 2015-08-10 at 12:12 +0200, Ben Hutchings wrote:
> 3.2.71-rc1 review patch. If anyone has any objections, please let me know.
>
> ------------------
>
> From: Alexey Brodkin <Alexey.Brodkin@...opsys.com>
>
> commit f1590670ce069eefeb93916391a67643e6ad1630 upstream.
>
> Current implementation of descriptor init procedure only takes
> care about setting/clearing ownership flag in "des0"/"des1"
> fields while it is perfectly possible to get unexpected bits
> set because of the following factors:
>
> [1] On driver probe underlying memory allocated with
> dma_alloc_coherent() might not be zeroed and so
> it will be filled with garbage.
>
> [2] During driver operation some bits could be set by SD/MMC
> controller (for example error flags etc).
>
> And unexpected and/or randomly set flags in "des0"/"des1"
> fields may lead to unpredictable behavior of GMAC DMA block.
>
> This change addresses both items above with:
>
> [1] Use of dma_zalloc_coherent() instead of simple
> dma_alloc_coherent() to make sure allocated memory is
> zeroed. That shouldn't affect performance because
> this allocation only happens once on driver probe.
>
> [2] Do explicit zeroing of both "des0" and "des1" fields
> of all buffer descriptors during initialization of
> DMA transfer.
>
> And while at it fixed identation of dma_free_coherent()
> counterpart as well.
>
> Signed-off-by: Alexey Brodkin <abrodkin@...opsys.com>
> Cc: Giuseppe Cavallaro <peppe.cavallaro@...com>
> Cc: arc-linux-dev@...opsys.com
> Cc: linux-kernel@...r.kernel.org
> Cc: David Miller <davem@...emloft.net>
> Signed-off-by: David S. Miller <davem@...emloft.net>
> [bwh: Backported to 3.2:
> - Adjust context, indentation
> - Normal and extended descriptors are allocated in the same place here]
> Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
This patch looks good to me.
Moreover that was exactly what I initially done on top of 3.18, see
https://github.com/foss-for-synopsys-dwc-arc-processors/linux/commit/f2105b2ba9b3444568b32caca1ab253b88058fc2
So feel free to add Acked-by and/or Tested-by: Alexey Brodkin <abrodkin@...opsys.com>
-Alexey--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists