Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755637Ab3HLL14 (ORCPT ); Mon, 12 Aug 2013 07:27:56 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:32866 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752123Ab3HLL1x (ORCPT ); Mon, 12 Aug 2013 07:27:53 -0400 Message-ID: <52087921.8040101@ti.com> Date: Mon, 12 Aug 2013 11:26:49 +0530 From: Sekhar Nori User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130404 Thunderbird/17.0.5 MIME-Version: 1.0 To: Joel Fernandes CC: Tony Lindgren , Santosh Shilimkar , Sricharan R , Rajendra Nayak , Lokesh Vutla , Matt Porter , Grant Likely , Rob Herring , Vinod Koul , Dan Williams , Mark Brown , Benoit Cousson , Russell King , Arnd Bergmann , Olof Johansson , Balaji TK , Gururaja Hebbar , Chris Ball , Jason Kridner , Linux OMAP List , Linux ARM Kernel List , Linux DaVinci Kernel List , Linux Kernel Mailing List , Linux MMC List Subject: Re: [PATCH v3 08/12] dma: edma: Add one more required slot to MAX slots References: <1375719297-12871-1-git-send-email-joelf@ti.com> <1375719297-12871-9-git-send-email-joelf@ti.com> In-Reply-To: <1375719297-12871-9-git-send-email-joelf@ti.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1413 Lines: 46 On Monday 05 August 2013 09:44 PM, Joel Fernandes wrote: > We'd now need a separate slot just for the channel and separate > ones for the 2 linked sets, so we make adjustments to allocate > an extra channel accordingly. > > Signed-off-by: Joel Fernandes No need for a separate patch for this, just do this in the patch where you include the two linked sets. > --- > drivers/dma/edma.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c > index a242269..df50a04 100644 > --- a/drivers/dma/edma.c > +++ b/drivers/dma/edma.c > @@ -48,7 +48,7 @@ > > /* Max of 16 segments per channel to conserve PaRAM slots */ > #define MAX_NR_SG 16 > -#define EDMA_MAX_SLOTS MAX_NR_SG > +#define EDMA_MAX_SLOTS (MAX_NR_SG+1) > #define EDMA_DESCRIPTORS 16 > > struct edma_desc { > @@ -311,6 +311,9 @@ static struct dma_async_tx_descriptor *edma_prep_slave_sg( > > num_slots_needed = sg_len > MAX_NR_SG ? MAX_NR_SG : sg_len; > > + /* Allocate one extra to account for the channel itself */ > + num_slots_needed++; You can do: nslots = min(MAX_NR_SG, sg_len) + 1; Thanks, Sekhar -- 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/