Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751228AbdGZHjB (ORCPT ); Wed, 26 Jul 2017 03:39:01 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:14301 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750813AbdGZHi6 (ORCPT ); Wed, 26 Jul 2017 03:38:58 -0400 From: Pierre Yves MORDRET To: Vinod Koul CC: Rob Herring , Mark Rutland , Maxime Coquelin , Alexandre TORGUE , Russell King , Dan Williams , "M'boumba Cedric Madianga" , Fabrice GASNIER , Herbert Xu , Fabien DESSENNE , Amelie DELAUNAY , "dmaengine@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v3 2/5] dmaengine: Add STM32 DMAMUX driver Thread-Topic: [PATCH v3 2/5] dmaengine: Add STM32 DMAMUX driver Thread-Index: AQHS9lJEsWaINqWfUEGtL1SBd5FJmqJfX72AgAObA4CAApdkgIAAI+EA Date: Wed, 26 Jul 2017 07:38:02 +0000 Message-ID: References: <1499343623-5964-1-git-send-email-pierre-yves.mordret@st.com> <1499343623-5964-3-git-send-email-pierre-yves.mordret@st.com> <20170722065133.GT3053@localhost> <2b916330-9b65-f4d5-817f-79b66cc236b3@st.com> <20170726052930.GF3053@localhost> In-Reply-To: <20170726052930.GF3053@localhost> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.75.127.49] Content-Type: text/plain; charset="utf-8" Content-ID: MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-07-26_03:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id v6Q7d5J1005831 Content-Length: 1816 Lines: 67 On 07/26/2017 07:29 AM, Vinod Koul wrote: > On Mon, Jul 24, 2017 at 01:55:10PM +0000, Pierre Yves MORDRET wrote: > >>>> + >>>> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); >>>> + if (!res) >>>> + return -ENODEV; >>>> + >>>> + iomem = devm_ioremap_resource(&pdev->dev, res); >>>> + if (!iomem) >>>> + return -ENOMEM; >>>> + >>>> + spin_lock_init(&stm32_dmamux->lock); >>>> + >>>> + stm32_dmamux->clk = devm_clk_get(&pdev->dev, NULL); >>>> + if (IS_ERR(stm32_dmamux->clk)) { >>>> + dev_info(&pdev->dev, "Missing controller clock\n"); >>> >>> Can you check for EPROBE_DEFER and print only for if that is not the error >>> otherwise we end up sapmming with defered probe issues >>> >> >> This is what you meant ? >> if (IS_ERR(stm32_dmamux->clk) != EPROBE_DEFER) { >> dev_info(&pdev->dev, "Missing controller clock\n"); >> return PTR_ERR(stm32_dmamux->clk); >> } >> >> OR >> >> if (IS_ERR(stm32_dmamux->clk)) { >> if (IS_ERR(stm32_dmamux->clk) != EPROBE_DEFER) >> dev_info(&pdev->dev, "Missing controller clock\n"); >> return PTR_ERR(stm32_dmamux->clk); >> } > > This one please > ok >> >>>> + >>>> +#ifndef __DMA_STM32_DMAMUX_H >>>> +#define __DMA_STM32_DMAMUX_H >>>> + >>>> +#if defined(CONFIG_STM32_DMAMUX) >>>> +int stm32_dmamux_set_config(struct device *dev, void *route_data, u32 chan_id); >>> >>> Why do we need a custom API in this case? >>> >> >> This API is called by DMA when a slave is requested by client. DMA can work >> without DMAMUX this API has been put in place to configure DMAMUX whether client >> is requesting a DMAMUX Channel instead of a DMA one. > > You mean the dmaengine driver right? > Yes. The API is mainly called by "device_config" through out STM32 DMA Driver when a router is in place for client. Please refer to Patch 4/5 on this set. Thanks Py