From mboxrd@z Thu Jan 1 00:00:00 1970 From: vinod.koul@intel.com (Vinod Koul) Date: Sun, 23 Aug 2015 19:38:23 +0530 Subject: [PATCH v4 2/2] dma: Add Xilinx zynqmp dma engine driver support In-Reply-To: References: <1438831173-8761-1-git-send-email-punnaia@xilinx.com> <1438831173-8761-2-git-send-email-punnaia@xilinx.com> <20150820061312.GA13546@localhost> Message-ID: <20150823140823.GA13546@localhost> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thu, Aug 20, 2015 at 12:01:27PM +0530, punnaiah choudary kalluri wrote: > On Thu, Aug 20, 2015 at 11:43 AM, Vinod Koul wrote: > > On Thu, Aug 06, 2015 at 08:49:33AM +0530, Punnaiah Choudary Kalluri wrote: > > > >> + list_for_each_entry_safe(desc, next, &chan->done_list, node) { > >> + dma_async_tx_callback callback; > >> + void *callback_param; > >> + > >> + list_del(&desc->node); > >> + > >> + callback = desc->async_tx.callback; > >> + callback_param = desc->async_tx.callback_param; > >> + if (callback) { > >> + if (in_interrupt()) > >> + spin_unlock_bh(&chan->lock); > >> + else > >> + spin_unlock(&chan->lock); > > > > This looks bad! > > Why would callback be called from different context. It should only be > > invoked from your tasklet > > During the terminate call, driver need to clean up the existing BDs so that time > this function will be called from the thread or process context in > addition to the > tasklet context. > > DO you have any suggestion here ? Yes you need to terminate but you don't need to invoke user for terminate flow. It is not expected. Terminate flow expect youu to clean the channels -- ~Vinod From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vinod Koul Subject: Re: [PATCH v4 2/2] dma: Add Xilinx zynqmp dma engine driver support Date: Sun, 23 Aug 2015 19:38:23 +0530 Message-ID: <20150823140823.GA13546@localhost> References: <1438831173-8761-1-git-send-email-punnaia@xilinx.com> <1438831173-8761-2-git-send-email-punnaia@xilinx.com> <20150820061312.GA13546@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: punnaiah choudary kalluri Cc: Punnaiah Choudary Kalluri , "robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org" , "pawel.moll-5wv7dgnIgG8@public.gmane.org" , "mark.rutland-5wv7dgnIgG8@public.gmane.org" , "ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org" , Kumar Gala , "michal.simek-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org" , dan.j.williams-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, dmaengine-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Punnaiah Choudary List-Id: devicetree@vger.kernel.org On Thu, Aug 20, 2015 at 12:01:27PM +0530, punnaiah choudary kalluri wrote: > On Thu, Aug 20, 2015 at 11:43 AM, Vinod Koul wrote: > > On Thu, Aug 06, 2015 at 08:49:33AM +0530, Punnaiah Choudary Kalluri wrote: > > > >> + list_for_each_entry_safe(desc, next, &chan->done_list, node) { > >> + dma_async_tx_callback callback; > >> + void *callback_param; > >> + > >> + list_del(&desc->node); > >> + > >> + callback = desc->async_tx.callback; > >> + callback_param = desc->async_tx.callback_param; > >> + if (callback) { > >> + if (in_interrupt()) > >> + spin_unlock_bh(&chan->lock); > >> + else > >> + spin_unlock(&chan->lock); > > > > This looks bad! > > Why would callback be called from different context. It should only be > > invoked from your tasklet > > During the terminate call, driver need to clean up the existing BDs so that time > this function will be called from the thread or process context in > addition to the > tasklet context. > > DO you have any suggestion here ? Yes you need to terminate but you don't need to invoke user for terminate flow. It is not expected. Terminate flow expect youu to clean the channels -- ~Vinod -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752882AbbHWOGT (ORCPT ); Sun, 23 Aug 2015 10:06:19 -0400 Received: from mga01.intel.com ([192.55.52.88]:58359 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752415AbbHWOGR (ORCPT ); Sun, 23 Aug 2015 10:06:17 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,732,1432623600"; d="scan'208";a="630682383" Date: Sun, 23 Aug 2015 19:38:23 +0530 From: Vinod Koul To: punnaiah choudary kalluri Cc: Punnaiah Choudary Kalluri , "robh+dt@kernel.org" , "pawel.moll@arm.com" , "mark.rutland@arm.com" , "ijc+devicetree@hellion.org.uk" , Kumar Gala , "michal.simek@xilinx.com" , dan.j.williams@intel.com, dmaengine@vger.kernel.org, "devicetree@vger.kernel.org" , linux-arm-kernel@lists.infradead.org, "linux-kernel@vger.kernel.org" , Punnaiah Choudary Subject: Re: [PATCH v4 2/2] dma: Add Xilinx zynqmp dma engine driver support Message-ID: <20150823140823.GA13546@localhost> References: <1438831173-8761-1-git-send-email-punnaia@xilinx.com> <1438831173-8761-2-git-send-email-punnaia@xilinx.com> <20150820061312.GA13546@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 20, 2015 at 12:01:27PM +0530, punnaiah choudary kalluri wrote: > On Thu, Aug 20, 2015 at 11:43 AM, Vinod Koul wrote: > > On Thu, Aug 06, 2015 at 08:49:33AM +0530, Punnaiah Choudary Kalluri wrote: > > > >> + list_for_each_entry_safe(desc, next, &chan->done_list, node) { > >> + dma_async_tx_callback callback; > >> + void *callback_param; > >> + > >> + list_del(&desc->node); > >> + > >> + callback = desc->async_tx.callback; > >> + callback_param = desc->async_tx.callback_param; > >> + if (callback) { > >> + if (in_interrupt()) > >> + spin_unlock_bh(&chan->lock); > >> + else > >> + spin_unlock(&chan->lock); > > > > This looks bad! > > Why would callback be called from different context. It should only be > > invoked from your tasklet > > During the terminate call, driver need to clean up the existing BDs so that time > this function will be called from the thread or process context in > addition to the > tasklet context. > > DO you have any suggestion here ? Yes you need to terminate but you don't need to invoke user for terminate flow. It is not expected. Terminate flow expect youu to clean the channels -- ~Vinod