Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1283145

Re: [PATCH 3/4] dmaengine: core: Introduce new, universal API to request a channel

From Peter Ujfalusi <peter.ujfalusi@ti.com>
Newsgroups linux.kernel
Subject Re: [PATCH 3/4] dmaengine: core: Introduce new, universal API to request a channel
Date 2015-12-03 16:50 +0100
Message-ID <qBEiS-71h-13@gated-at.bofh.it> (permalink)
References <qBDd8-6lI-9@gated-at.bofh.it> <qBDd8-6lI-13@gated-at.bofh.it> <qBE9c-6XG-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 12/03/2015 05:32 PM, Arnd Bergmann wrote:
> On Thursday 03 December 2015 16:33:11 Peter Ujfalusi wrote:
>> +
>> +/**
>> + * dma_request_chan - try to allocate an exclusive slave channel
>> + * @dev:       pointer to client device structure
>> + * @name:      slave channel name
>> + *
>> + * Returns pointer to appropriate DMA channel on success or an error pointer.
>> + */
>> +struct dma_chan *dma_request_chan(struct device *dev, const char *name)
>> +{
>> +       struct dma_device *d, *_d;
>> +       struct dma_chan *chan = NULL;
>> +
>> +       /* If device-tree is present get slave info from here */
>> +       if (dev->of_node)
>> +               chan = of_dma_request_slave_channel(dev->of_node, name);
>> +
>> +       /* If device was enumerated by ACPI get slave info from here */
>> +       if (has_acpi_companion(dev) && !chan)
>> +               chan = acpi_dma_request_slave_chan_by_name(dev, name);
> 
> I just noticed that you are creating this as a new interface, rather than
> changing dma_request_slave_channel_reason() and making the old interface
> a static inline wrapper. What is the reasoning behind that?

Oh, it was in my plans. Will do it for v02

> I think if we make both interfaces do the same thing, it's easier
> to do the migration.
> 
>> +       if (chan) {
>> +               /* Valid channel found */
>> +               if (!IS_ERR(chan) || PTR_ERR(chan) == -EPROBE_DEFER)
>> +                       return chan;
>> +
>> +               pr_warn("%s: %s DMA request failed, falling back to legacy\n",
>> +                       __func__, dev->of_node ? "OF" : "ACPI");
>> +       }
> 
> Maybe print the error code as well?

Or remove the print altogether?
In a healthy system we will either get the channel or the EPROBE_DEFER, in
case of the platforms where the DT lookup does not work we expect errors and
it is 'normal'.
I think if we fail via DT/ACPI and we fail with legacy also then the client
driver will say something about it anyways, or deal with it as it see fits.

-- 
Péter
--
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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] dmaengine: New 'universal' API for requesting channel Peter Ujfalusi <peter.ujfalusi@ti.com> - 2015-12-03 15:40 +0100
  [PATCH 4/4] dmaengine: edma: Add support for DMA filter mapping to slave devices Peter Ujfalusi <peter.ujfalusi@ti.com> - 2015-12-03 15:40 +0100
    Re: [PATCH 4/4] dmaengine: edma: Add support for DMA filter mapping to slave devices Arnd Bergmann <arnd@arndb.de> - 2015-12-03 16:40 +0100
      Re: [PATCH 4/4] dmaengine: edma: Add support for DMA filter mapping  to slave devices Peter Ujfalusi <peter.ujfalusi@ti.com> - 2015-12-03 16:50 +0100
        Re: [PATCH 4/4] dmaengine: edma: Add support for DMA filter mapping  to slave devices Peter Ujfalusi <peter.ujfalusi@ti.com> - 2015-12-08 14:20 +0100
  [PATCH 3/4] dmaengine: core: Introduce new, universal API to request a channel Peter Ujfalusi <peter.ujfalusi@ti.com> - 2015-12-03 15:40 +0100
    Re: [PATCH 3/4] dmaengine: core: Introduce new, universal API to request a channel Arnd Bergmann <arnd@arndb.de> - 2015-12-03 16:40 +0100
      Re: [PATCH 3/4] dmaengine: core: Introduce new, universal API to request a channel Arnd Bergmann <arnd@arndb.de> - 2015-12-03 16:50 +0100
      Re: [PATCH 3/4] dmaengine: core: Introduce new, universal API to  request a channel Peter Ujfalusi <peter.ujfalusi@ti.com> - 2015-12-03 16:50 +0100
    Re: [PATCH 3/4] dmaengine: core: Introduce new, universal API to  request a channel Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-12-03 17:40 +0100
  Re: [PATCH 0/4] dmaengine: New 'universal' API for requesting channel Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-12-03 17:40 +0100

csiph-web