Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp365013ybt; Wed, 24 Jun 2020 00:55:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycldXkEGKvlMhTTOAJtY/1oRLnShVLvuofLa3NXNJngBO/kjkps7U8PeM2BY2ta3Aw851i X-Received: by 2002:a17:906:e2ca:: with SMTP id gr10mr13643072ejb.81.1592985347286; Wed, 24 Jun 2020 00:55:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592985347; cv=none; d=google.com; s=arc-20160816; b=oeTDLh90kyxzQbkzk7Mq7l+TL99d/wdNYrrThR5D+6O+RlKtSd2ifDrD8NdbYBNIQr MGkiQACU5qM+aE8w6mCq8UV1s7EY7oPWXGXB98lPguqbs4UGnGKJjX5grSzC+juG0RnA OEcvj/95nrdR1THcWclBLKyvgNtKFWExzaAoR9WxlGNVZwcL35zlje+o9rZKWt9kmPKT 4LTBQoYnEIDV2osWrergF+tKRkm4WeFa8h+gRoyiEnhFjZfANDly22A0O1Weu/KzSgy7 At/ddO0ZLz3Tm5uBk7fuTS4MVWYDT6WQH2UBHVaBMbFirS/OJJNFgL9PpCPbs3NiqHpT AVtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=HchOAYgfADUXbUMw7ZpVQKAZ22EQYwg6D29eeix4ofU=; b=0ckTtz6Z7DZvulEqZkLVqmHcYmum4nmJNSmSUp1YyIu3haVUhza2JcKSMkiu1UcTL6 xYf3vk18wx187s1EyjUo/pbRr45NJGeOHrDHcP31cXIS6yoHPwDfHXH+ZjWIO34GaFI9 Nb3gDDGHaQKqslsDCZ+qEf0LDOOHoOUcjT/glhXa7+1dXnhfoUO5X8lfx6sFhFNL1BCw MiN1J5rTiDF7gcT5eIHTCqEQsb94qR9MWfB316cnFYVt2pW8D2jdLs8ZrNeqIPopOMpi DBKdLpfLwJimcSdq/wbucdbO4lEQsr3dHYFoSfwCJE0lxg3/Z2OzFwNovguTPmm5EDis 8oEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jUbxlwf7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d15si12451205edp.112.2020.06.24.00.55.24; Wed, 24 Jun 2020 00:55:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jUbxlwf7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390133AbgFXHym (ORCPT + 99 others); Wed, 24 Jun 2020 03:54:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:53082 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388655AbgFXHym (ORCPT ); Wed, 24 Jun 2020 03:54:42 -0400 Received: from localhost (unknown [171.61.66.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A6D0E2085B; Wed, 24 Jun 2020 07:54:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592985281; bh=u5bGPxHpfck/MVpaAVun2T5RtLrj3PWfCkxiaVjC2tE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jUbxlwf7G39+dXkwsQB9wAmXBVX/OxV4FMeuXH3pSxehhaFfL6ituJFd22m2SfM7M kRNaK0kf1iLgAqLaX7GPsuQyJ0p3YY/4TWG69FbrQcfSOIPU9VXYI0pgt5cz86VfB0 14aLRMW8mG2ApfRAs08FVZyiLKjDvj769xv+UN2M= Date: Wed, 24 Jun 2020 13:24:37 +0530 From: Vinod Koul To: Sugar Zhang Cc: Heiko Stuebner , linux-rockchip@lists.infradead.org, Dan Williams , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 01/13] dmaengine: pl330: Remove the burst limit for quirk 'NO-FLUSHP' Message-ID: <20200624075437.GT2324254@vkoul-mobl> References: <1591665267-37713-1-git-send-email-sugar.zhang@rock-chips.com> <1591665267-37713-2-git-send-email-sugar.zhang@rock-chips.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1591665267-37713-2-git-send-email-sugar.zhang@rock-chips.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09-06-20, 09:14, Sugar Zhang wrote: > There is no reason to limit the performance on the 'NO-FLUSHP' SoCs, > cuz these platforms are just that the 'FLUSHP' instruction is broken. Lets not use terms like cuz... 'because' is perfect term :) It can rephrased to: There is no reason to limit the performance on the 'NO-FLUSHP' SoCs beacuse 'FLUSHP' instruction is broken on these platforms, so remove the limit to improve the efficiency > so, remove the limit to improve the efficiency. > > Signed-off-by: Sugar Zhang > --- > > Changes in v2: None > > drivers/dma/pl330.c | 34 ++++++++++++++++++++++------------ > 1 file changed, 22 insertions(+), 12 deletions(-) > > diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c > index 6a158ee..ff0a91f 100644 > --- a/drivers/dma/pl330.c > +++ b/drivers/dma/pl330.c > @@ -1183,9 +1183,6 @@ static inline int _ldst_peripheral(struct pl330_dmac *pl330, > { > int off = 0; > > - if (pl330->quirks & PL330_QUIRK_BROKEN_NO_FLUSHP) > - cond = BURST; > - > /* > * do FLUSHP at beginning to clear any stale dma requests before the > * first WFP. > @@ -1231,8 +1228,9 @@ static int _bursts(struct pl330_dmac *pl330, unsigned dry_run, u8 buf[], > } > > /* > - * transfer dregs with single transfers to peripheral, or a reduced size burst > - * for mem-to-mem. > + * only the unaligned bursts transfers have the dregs. > + * transfer dregs with a reduced size burst to peripheral, > + * or a reduced size burst for mem-to-mem. This is not related to broken flush and should be a different patch explaining why this changes were done > */ > static int _dregs(struct pl330_dmac *pl330, unsigned int dry_run, u8 buf[], > const struct _xfer_spec *pxs, int transfer_length) > @@ -1247,8 +1245,23 @@ static int _dregs(struct pl330_dmac *pl330, unsigned int dry_run, u8 buf[], > case DMA_MEM_TO_DEV: > /* fall through */ > case DMA_DEV_TO_MEM: > - off += _ldst_peripheral(pl330, dry_run, &buf[off], pxs, > - transfer_length, SINGLE); > + /* > + * dregs_len = (total bytes - BURST_TO_BYTE(bursts, ccr)) / > + * BRST_SIZE(ccr) > + * the dregs len must be smaller than burst len, > + * so, for higher efficiency, we can modify CCR > + * to use a reduced size burst len for the dregs. > + */ > + dregs_ccr = pxs->ccr; > + dregs_ccr &= ~((0xf << CC_SRCBRSTLEN_SHFT) | > + (0xf << CC_DSTBRSTLEN_SHFT)); > + dregs_ccr |= (((transfer_length - 1) & 0xf) << > + CC_SRCBRSTLEN_SHFT); > + dregs_ccr |= (((transfer_length - 1) & 0xf) << > + CC_DSTBRSTLEN_SHFT); > + off += _emit_MOV(dry_run, &buf[off], CCR, dregs_ccr); > + off += _ldst_peripheral(pl330, dry_run, &buf[off], pxs, 1, > + BURST); > break; > > case DMA_MEM_TO_MEM: > @@ -2221,9 +2234,7 @@ static bool pl330_prep_slave_fifo(struct dma_pl330_chan *pch, > > static int fixup_burst_len(int max_burst_len, int quirks) > { > - if (quirks & PL330_QUIRK_BROKEN_NO_FLUSHP) > - return 1; > - else if (max_burst_len > PL330_MAX_BURST) > + if (max_burst_len > PL330_MAX_BURST) > return PL330_MAX_BURST; > else if (max_burst_len < 1) > return 1; > @@ -3128,8 +3139,7 @@ pl330_probe(struct amba_device *adev, const struct amba_id *id) > pd->dst_addr_widths = PL330_DMA_BUSWIDTHS; > pd->directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); > pd->residue_granularity = DMA_RESIDUE_GRANULARITY_BURST; > - pd->max_burst = ((pl330->quirks & PL330_QUIRK_BROKEN_NO_FLUSHP) ? > - 1 : PL330_MAX_BURST); > + pd->max_burst = PL330_MAX_BURST; > > ret = dma_async_device_register(pd); > if (ret) { > -- > 2.7.4 > > -- ~Vinod