Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753075AbbF3NCe (ORCPT ); Tue, 30 Jun 2015 09:02:34 -0400 Received: from eusmtp01.atmel.com ([212.144.249.243]:35066 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751323AbbF3NCZ (ORCPT ); Tue, 30 Jun 2015 09:02:25 -0400 Date: Tue, 30 Jun 2015 15:03:07 +0200 From: Ludovic Desroches To: , , CC: , , , Ludovic Desroches Subject: Re: [PATCH] dmaengine: at_xdmac: fix bug about channel configuration Message-ID: <20150630130307.GO18384@odux.rfo.atmel.com> Mail-Followup-To: linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, vinod.koul@intel.com, nicolas.ferre@atmel.com, maxime.ripard@free-electrons.com References: <1434550946-27750-1-git-send-email-ludovic.desroches@atmel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1434550946-27750-1-git-send-email-ludovic.desroches@atmel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2181 Lines: 60 Vinod, If you have no objection about his patch, could you take it? Thanks Ludovic On Wed, Jun 17, 2015 at 04:22:26PM +0200, Ludovic Desroches wrote: > When using descriptor view 2 or higher, we don't write the configuration > into AT_XDMAC_CC register because this configuration will be fetch from > the descriptor. Unfortunately, the PROT bit is not updated with this > method, we have to do it manually before enabling the channel. > > Signed-off-by: Ludovic Desroches > --- > drivers/dma/at_xdmac.c | 19 ++++++++++--------- > 1 file changed, 10 insertions(+), 9 deletions(-) > > diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c > index cf1213d..52ca1cc 100644 > --- a/drivers/dma/at_xdmac.c > +++ b/drivers/dma/at_xdmac.c > @@ -359,18 +359,19 @@ static void at_xdmac_start_xfer(struct at_xdmac_chan *atchan, > * descriptor view 2 since some fields of the configuration register > * depend on transfer size and src/dest addresses. > */ > - if (at_xdmac_chan_is_cyclic(atchan)) { > + if (at_xdmac_chan_is_cyclic(atchan)) > reg = AT_XDMAC_CNDC_NDVIEW_NDV1; > - at_xdmac_chan_write(atchan, AT_XDMAC_CC, first->lld.mbr_cfg); > - } else if (first->lld.mbr_ubc & AT_XDMAC_MBR_UBC_NDV3) { > + else if (first->lld.mbr_ubc & AT_XDMAC_MBR_UBC_NDV3) > reg = AT_XDMAC_CNDC_NDVIEW_NDV3; > - } else { > - /* > - * No need to write AT_XDMAC_CC reg, it will be done when the > - * descriptor is fecthed. > - */ > + else > reg = AT_XDMAC_CNDC_NDVIEW_NDV2; > - } > + /* > + * Even if the register will be updated from the configuration in the > + * descriptor when using view 2 or higher, the PROT bit won't be set > + * properly. This bit can be modified only by using the channel > + * configuration register. > + */ > + at_xdmac_chan_write(atchan, AT_XDMAC_CC, first->lld.mbr_cfg); > > reg |= AT_XDMAC_CNDC_NDDUP > | AT_XDMAC_CNDC_NDSUP > -- > 2.2.0 > -- 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/