From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BE56C433E0 for ; Thu, 28 May 2020 15:19:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EA5C62075F for ; Thu, 28 May 2020 15:19:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2403975AbgE1PTH (ORCPT ); Thu, 28 May 2020 11:19:07 -0400 Received: from mail.baikalelectronics.com ([87.245.175.226]:43040 "EHLO mail.baikalelectronics.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404149AbgE1PTG (ORCPT ); Thu, 28 May 2020 11:19:06 -0400 Received: from localhost (unknown [127.0.0.1]) by mail.baikalelectronics.ru (Postfix) with ESMTP id 420DA80307C0; Thu, 28 May 2020 15:19:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at baikalelectronics.ru Received: from mail.baikalelectronics.ru ([127.0.0.1]) by localhost (mail.baikalelectronics.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r6jQPtQkf7QC; Thu, 28 May 2020 18:19:03 +0300 (MSK) Date: Thu, 28 May 2020 18:19:02 +0300 From: Serge Semin To: Andy Shevchenko CC: Serge Semin , Vinod Koul , Viresh Kumar , Dan Williams , Alexey Malahov , Thomas Bogendoerfer , Arnd Bergmann , Rob Herring , , , , Subject: Re: [PATCH v3 05/10] dmaengine: Introduce DMA-device device_caps callback Message-ID: <20200528151902.vemr7aolvtean2f3@mobilestation> References: <20200526225022.20405-1-Sergey.Semin@baikalelectronics.ru> <20200526225022.20405-6-Sergey.Semin@baikalelectronics.ru> <20200528144257.GS1634618@smile.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20200528144257.GS1634618@smile.fi.intel.com> X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org On Thu, May 28, 2020 at 05:42:57PM +0300, Andy Shevchenko wrote: > On Wed, May 27, 2020 at 01:50:16AM +0300, Serge Semin wrote: > > There are DMA devices (like ours version of Synopsys DW DMAC) which have > > DMA capabilities non-uniformly redistributed amongst the device channels. > > In order to provide a way of exposing the channel-specific parameters to > > the DMA engine consumers, we introduce a new DMA-device callback. In case > > if provided it gets called from the dma_get_slave_caps() method and is > > able to override the generic DMA-device capabilities. > > > + if (device->device_caps) > > + device->device_caps(chan, caps); > > + > > return 0; > > I dunno why this returns int, but either we get rid of this returned value > (perhaps in the future, b/c it's not directly related to this series), or > something like > > if (device->device_caps) > return device->device_caps(chan, caps); It returns int because dma_get_slave_caps() check parameters and some other stuff. Regarding device_caps() callback having a return value. IMO it's redundant. The only thing what the callback should do is to update the caps and device is supposed to know it' capabilities, otherwise who else should know? So I don't see why device_caps would be needed. -Sergey > > -- > With Best Regards, > Andy Shevchenko > >