From patchwork Wed Mar 15 01:28:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cai Huoqing X-Patchwork-Id: 69918 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2080066wrd; Tue, 14 Mar 2023 18:33:36 -0700 (PDT) X-Google-Smtp-Source: AK7set+YpBDApeAvC5ubYwSJgrD8SRdWdpE1Ekir3r3d6rAYmEoCu0LYSYB//CIr5Offa2gnOpKq X-Received: by 2002:a05:6a21:998b:b0:ce:8028:e0ac with SMTP id ve11-20020a056a21998b00b000ce8028e0acmr46137699pzb.44.1678844015978; Tue, 14 Mar 2023 18:33:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678844015; cv=none; d=google.com; s=arc-20160816; b=ufK3XrdWNyrfCIC2eMfxl1LtLnoSeFKreQQpzpThwRiI17UD0lYZ1zvAyWY7Qgq6SM 7OZZ8x7oQMSG19t7Z10WOZXzkdwLsYlNDvhllszrcElJpJp4Q0bapkj0MQ1w1YIqad5+ LjsZPYdYnGe3DoAIAEQDP29Ni4xOtCpHpDd6enCI0jYOZg/T7Nlcxo+bFY1VhugUeAuB Pc6zoEdF3+6wPrM1U0ft6pZ6g/jG7wg8dIboMTyrBUflUBZypReyTrXd2H3HfeZsG5EB zT3brU9+Nm9zYVVyTMLMs9ueBM712mwWbuGDepJdk+jGtMbk0XbyZMcE86wLPXwlSFAZ qwEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=AuhZwNjSOPm/eDk+Fqlhqet/RDQ4z4+j3b/7ckisd5c=; b=N+rmOy+wTkEWnW6JjcWmrDjbFlyZtnWUptcXUddkRTvCTvDfeyfDD6uMnWEjySJVmV AreALU6BJgniP8hkmJVZewishiRtOYN4zCh1U3D2yGwqoVAmZZY9UYkaYLDBW9/dOxM6 piyoWELU9eEyETtVsB+0LfJlHSpgK2TS+rvQmjDvUE5t9t5mWw7uJEgzFqYDztTwtkYY nhI3vWmAzMlIOwyX9EL71vlmszaHUQLQ2He4rAmXKSrTciroeRbO0pDDuttjTS0sIdRh LA+pu2wb5kmKpTeG/A7uSO3PCafyutzcpaF5Fk35MKC0DsITSvG51ZtoMWXtIEZFaFjg wYYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=xFC47dqq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h70-20020a638349000000b00509bd53cd84si3555873pge.590.2023.03.14.18.33.21; Tue, 14 Mar 2023 18:33:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=xFC47dqq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229648AbjCOB34 (ORCPT + 99 others); Tue, 14 Mar 2023 21:29:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229644AbjCOB3y (ORCPT ); Tue, 14 Mar 2023 21:29:54 -0400 Received: from out-43.mta0.migadu.com (out-43.mta0.migadu.com [IPv6:2001:41d0:1004:224b::2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E755B1DB93 for ; Tue, 14 Mar 2023 18:29:22 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1678843761; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AuhZwNjSOPm/eDk+Fqlhqet/RDQ4z4+j3b/7ckisd5c=; b=xFC47dqql51lUOH4YGBLc5sJRb7ipvsq/2DBVELS8+7EwnKHoV7AXuihN2kHRzZyzn1/pi e5/5rxbjZP7wzx+B3LbJI1U5nVXy5e/Knjww1PrYN9z0eCG0vG5MWbEwLTRdvJ91yqGkq/ eLrBl8IowCzfytJHDvCcMklUMz2cVCQ= From: Cai Huoqing To: fancer.lancer@gmail.com Cc: Cai Huoqing , Gustavo Pimentel , Vinod Koul , Jingoo Han , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v7 5/5] dmaengine: dw-edma: Optimization in dw_edma_v0_core_handle_int Date: Wed, 15 Mar 2023 09:28:36 +0800 Message-Id: <20230315012840.6986-6-cai.huoqing@linux.dev> In-Reply-To: <20230315012840.6986-1-cai.huoqing@linux.dev> References: <20230315012840.6986-1-cai.huoqing@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760395542783385554?= X-GMAIL-MSGID: =?utf-8?q?1760395542783385554?= Optimization in dw_edma_v0_core_handle_int, remove some unnecessary wrapper function. Signed-off-by: Cai Huoqing --- v6 link: https://lore.kernel.org/lkml/20230310032342.17395-6-cai.huoqing@linux.dev/ drivers/dma/dw-edma/dw-edma-v0-core.c | 38 +++++---------------------- 1 file changed, 6 insertions(+), 32 deletions(-) diff --git a/drivers/dma/dw-edma/dw-edma-v0-core.c b/drivers/dma/dw-edma/dw-edma-v0-core.c index 16c48197d3c6..c3eab82cc1c7 100644 --- a/drivers/dma/dw-edma/dw-edma-v0-core.c +++ b/drivers/dma/dw-edma/dw-edma-v0-core.c @@ -258,34 +258,6 @@ static enum dma_status dw_edma_v0_core_ch_status(struct dw_edma_chan *chan) return DMA_ERROR; } -static void dw_edma_v0_core_clear_done_int(struct dw_edma_chan *chan) -{ - struct dw_edma *dw = chan->dw; - - SET_RW_32(dw, chan->dir, int_clear, - FIELD_PREP(EDMA_V0_DONE_INT_MASK, BIT(chan->id))); -} - -static void dw_edma_v0_core_clear_abort_int(struct dw_edma_chan *chan) -{ - struct dw_edma *dw = chan->dw; - - SET_RW_32(dw, chan->dir, int_clear, - FIELD_PREP(EDMA_V0_ABORT_INT_MASK, BIT(chan->id))); -} - -static u32 dw_edma_v0_core_status_done_int(struct dw_edma *dw, enum dw_edma_dir dir) -{ - return FIELD_GET(EDMA_V0_DONE_INT_MASK, - GET_RW_32(dw, dir, int_status)); -} - -static u32 dw_edma_v0_core_status_abort_int(struct dw_edma *dw, enum dw_edma_dir dir) -{ - return FIELD_GET(EDMA_V0_ABORT_INT_MASK, - GET_RW_32(dw, dir, int_status)); -} - static irqreturn_t dw_edma_v0_core_handle_int(struct dw_edma_irq *dw_irq, enum dw_edma_dir dir, dw_edma_handler_t done, dw_edma_handler_t abort) @@ -307,23 +279,25 @@ dw_edma_v0_core_handle_int(struct dw_edma_irq *dw_irq, enum dw_edma_dir dir, mask = dw_irq->rd_mask; } - val = dw_edma_v0_core_status_done_int(dw, dir); + val = FIELD_GET(EDMA_V0_DONE_INT_MASK, GET_RW_32(dw, dir, int_status)); val &= mask; for_each_set_bit(pos, &val, total) { chan = &dw->chan[pos + off]; - dw_edma_v0_core_clear_done_int(chan); + SET_RW_32(dw, chan->dir, int_clear, + FIELD_PREP(EDMA_V0_DONE_INT_MASK, BIT(chan->id))); done(chan); ret = IRQ_HANDLED; } - val = dw_edma_v0_core_status_abort_int(dw, dir); + val = FIELD_GET(EDMA_V0_ABORT_INT_MASK, GET_RW_32(dw, dir, int_status)); val &= mask; for_each_set_bit(pos, &val, total) { chan = &dw->chan[pos + off]; - dw_edma_v0_core_clear_abort_int(chan); + SET_RW_32(dw, chan->dir, int_clear, + FIELD_PREP(EDMA_V0_ABORT_INT_MASK, BIT(chan->id))); abort(chan); ret = IRQ_HANDLED;