From patchwork Fri Mar 10 03:23:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cai Huoqing X-Patchwork-Id: 67198 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp668864wrd; Thu, 9 Mar 2023 19:50:36 -0800 (PST) X-Google-Smtp-Source: AK7set+pYjVE9L3JTJl6ekVgImHOuyTDU92K+z4Ttn5fswRQJlPxPNVprSrD3kUtLE94Yr2kqHYM X-Received: by 2002:a17:903:2290:b0:19e:25b4:7740 with SMTP id b16-20020a170903229000b0019e25b47740mr29426450plh.28.1678420236335; Thu, 09 Mar 2023 19:50:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678420236; cv=none; d=google.com; s=arc-20160816; b=qag8RJzVn9M3ywInl28HA5kZd4PUmqtc0Db9BZWMXghvS3qXibU/7Nb+vFHLR7tthq a9P/lAqgezZBo59XW2qQWfUfhgzml4gmKF0lLMPPwfwPNfSUsir4/G7iEl3MCUG/lIF0 vFRFz0QfC9OPJof1evk6ULbJK9B5puMfSOx0LmIT2N0aq1jE9qzID5L89HvTXJnuTpXg Kw/YFazEESkigTS1Y3Z6NOsXKCl7sSE/ciThai28LagB+mOKZRZbMyxU+Xl/XU9Legz7 dpkWShojn+Ha7omifxqLlCs5AzQQdgPpbZiDoE+B78CYlZrvvAOsIommm19uGVrSCMnM RmQw== 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=pP06L+IpLhISdvjGC5iq9vZgdcS3+6CJ+d3Vd5ZwOCA=; b=ywY5+oGG0sOc2BIX9qjr7VGj8uHYyNRnM9UlgRXL2flVUowObRtDq+aj/kNsaYbsHy Gw1kjp0E/ADCtTsN48C/iqFLjLmqfbOMlWsyBzOLTRfKqVCsimGsqWEmaPzYeArcFrSU DVZ6D//kPr0BwFdqFEd5BbZKI0GCe+NgQHe1MziQtuf/4qtKRnkSnK7SHvxiHk2uGPe/ m4RSTUiiVWXR3Mytl+O2S4a1d60mf+M6AR7Mi2rMIlX82tq3enz4bc2+hsSZvDUNnmYJ 6MI/8FFEcpdw9xbi5z5SCajgHLo8k43aEe/qHNTFKMlG1ehyse+rQNBL9GFllDzasxD8 nEig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Ctgbz0dE; 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 l10-20020a63f30a000000b00503a2a23fbdsi795086pgh.841.2023.03.09.19.50.21; Thu, 09 Mar 2023 19:50:36 -0800 (PST) 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=Ctgbz0dE; 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 S229929AbjCJDZG (ORCPT + 99 others); Thu, 9 Mar 2023 22:25:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230136AbjCJDYy (ORCPT ); Thu, 9 Mar 2023 22:24:54 -0500 Received: from out-19.mta1.migadu.com (out-19.mta1.migadu.com [IPv6:2001:41d0:203:375::13]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE44EACB92 for ; Thu, 9 Mar 2023 19:24:23 -0800 (PST) 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=1678418662; 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=pP06L+IpLhISdvjGC5iq9vZgdcS3+6CJ+d3Vd5ZwOCA=; b=Ctgbz0dEUgNOhJUXMVBoshmkC7Ro1zJqglQ1LGU7OwR69fIP8obSyWBFq/7DKLbV1eCM9y xY4+w6SaAxr1S23w3+6yjlKF0C1RcmlkDIgWjoY18OL55ZIgyaQHvF8tqqNynE1bIraRdZ 4jPLa2jKCTZO/iWameuF5vKe84AiV3I= 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 v6 5/5] dmaengine: dw-edma: Optimization in dw_edma_v0_core_handle_int Date: Fri, 10 Mar 2023 11:23:38 +0800 Message-Id: <20230310032342.17395-6-cai.huoqing@linux.dev> In-Reply-To: <20230310032342.17395-1-cai.huoqing@linux.dev> References: <20230310032342.17395-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=unavailable 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?1759951177746379461?= X-GMAIL-MSGID: =?utf-8?q?1759951177746379461?= Optimization in dw_edma_v0_core_handle_int, remove some unnecessary wrapper function. Signed-off-by: Cai Huoqing --- v5->v6: 11.Remove some unnecessary wrapper function. 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 09c9cec652e1..097385e3e688 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 @@ irqreturn_t dw_edma_v0_core_handle_int(struct dw_edma_irq *dw_irq, enum dw_edma_ 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;