From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752094AbbJFJVZ (ORCPT ); Tue, 6 Oct 2015 05:21:25 -0400 Received: from lucky1.263xmail.com ([211.157.147.130]:41587 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750853AbbJFJVW (ORCPT ); Tue, 6 Oct 2015 05:21:22 -0400 X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 X-ADDR-CHECKED: 0 X-RL-SENDER: shawn.lin@rock-chips.com X-FST-TO: linux-spi@vger.kernel.org X-SENDER-IP: 220.200.5.252 X-LOGIN-NAME: shawn.lin@rock-chips.com X-UNIQUE-TAG: X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 Subject: Re: [PATCH v5 06/10] dmaengine: add API for getting dma controller's quirk To: Vinod Koul References: <1442187923-5736-1-git-send-email-shawn.lin@rock-chips.com> <1442188139-6017-1-git-send-email-shawn.lin@rock-chips.com> <20151005153746.GG13501@vkoul-mobl.iind.intel.com> Cc: shawn.lin@rock-chips.com, Heiko Stuebner , Jaroslav Kysela , Takashi Iwai , Mark Brown , Doug Anderson , Olof Johansson , Sonny Rao , Addy Ke , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, alsa-devel@alsa-project.org, linux-spi@vger.kernel.org From: Shawn Lin Message-ID: <56139289.7000005@rock-chips.com> Date: Tue, 6 Oct 2015 17:21:13 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151005153746.GG13501@vkoul-mobl.iind.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Vinod, On 2015/10/5 23:37, Vinod Koul wrote: > On Mon, Sep 14, 2015 at 07:48:59AM +0800, Shawn Lin wrote: >> Add dmaengine_get_quirks API for peripheral devices to query >> quirks if they need it to make special workaround due to broken >> dma controller design. >> >> Signed-off-by: Shawn Lin >> --- >> >> Changes in v5: None >> Changes in v4: None >> Changes in v3: None >> Changes in v2: None >> Changes in v1: None >> >> include/linux/dmaengine.h | 9 +++++++++ >> 1 file changed, 9 insertions(+) >> >> diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h >> index e2f5eb4..5174ca4 100644 >> --- a/include/linux/dmaengine.h >> +++ b/include/linux/dmaengine.h >> @@ -704,6 +704,7 @@ struct dma_device { >> >> int (*device_config)(struct dma_chan *chan, >> struct dma_slave_config *config); >> + int (*device_get_quirks)(struct dma_chan *chan); > > And why do we want to expose this to users? THis doesnt seem right! > Basically I agree not to expose dma's quirk to slave controllers...But, the fact I mentioned on cover letter explain the reasons why I have to let slave controllers know that they are working with a broken dma. It's a dilemma that if we don't want that to be exposed(let slave controllers' driver get the info via a API), we have to add broken quirk for all of them ,here and there, which seems to be a disaster:( I would appreciate it if you could give me some suggestions at your earliest convenience. :) > A quirk may exists but should be handled inside the controller driver and do > appropriate action. You don't tell users or expect them to handle these > -- Best Regards Shawn Lin