From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752994AbbJNKuL (ORCPT ); Wed, 14 Oct 2015 06:50:11 -0400 Received: from mga01.intel.com ([192.55.52.88]:26993 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751930AbbJNKuG (ORCPT ); Wed, 14 Oct 2015 06:50:06 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,681,1437462000"; d="scan'208";a="826390263" Date: Wed, 14 Oct 2015 16:23:10 +0530 From: Vinod Koul To: Lars-Peter Clausen Cc: Shawn Lin , Addy Ke , Heiko Stuebner , alsa-devel@alsa-project.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, Doug Anderson , Takashi Iwai , dmaengine@vger.kernel.org, Mark Brown , Olof Johansson , Sonny Rao , linux-arm-kernel@lists.infradead.org Subject: Re: [alsa-devel] [PATCH v5 06/10] dmaengine: add API for getting dma controller's quirk Message-ID: <20151014105310.GQ27370@localhost> 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> <561629D6.9010702@metafoo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <561629D6.9010702@metafoo.de> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 08, 2015 at 10:31:18AM +0200, Lars-Peter Clausen wrote: > > 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 t add broken quirk for all of them ,here and > > there, which seems to be a disaster:( > > The problem with this API is that it transports values with device specific > meanings over a generic API. Which is generally speaking not a good idea > because the consumer witch is supposed to be generic suddenly needs to know > which provider it is talking to. > > A better solution in this case typically is either introduce a generic API > with generic values or a custom API with custom values, but don't mix the two. > > > > > I would appreciate it if you could give me some suggestions at your earliest > > convenience. :) > > In this case I think the best way to handle this is not quirks, but rather > expose the actual maximum burst size using the DMA capabilities API. Since > supporting only a certain burst depth is not really a quirk. All hardware > has a limit for this and for some it might be larger or smaller than for > others and it might be the same IP core but the maximum size depends on some > IP core parameters. So this should be discoverable. yes that makes more sense than adding quirks, exposing the right values which should be a readable property for driver will ensure it works on system with/without quirks -- ~Vinod