From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754556AbbJGOcU (ORCPT ); Wed, 7 Oct 2015 10:32:20 -0400 Received: from mga02.intel.com ([134.134.136.20]:28519 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753982AbbJGOcS (ORCPT ); Wed, 7 Oct 2015 10:32:18 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,649,1437462000"; d="scan'208";a="821456545" Date: Wed, 7 Oct 2015 15:32:06 +0100 From: Vinod Koul To: Shawn Lin Cc: 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 Subject: Re: [PATCH v5 06/10] dmaengine: add API for getting dma controller's quirk Message-ID: <20151007143205.GG3320@vkoul-mobl.iind.intel.com> 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> <56139289.7000005@rock-chips.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56139289.7000005@rock-chips.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 06, 2015 at 05:21:13PM +0800, Shawn Lin wrote: > >>+ 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 > > I laready gave one re-read the above lines. Anyway I went ahead and read the usage. You are setting the slave parameters for this. I can see two ways: 1. Have the quirk to driver and based on quirk reset the slave settings when they are set by client. 2. Put this in DT and set the dma properties based on these quirks and let driver and cleint be agnostic to it -- ~Vinod