From patchwork Sat May 6 14:17:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artur Rojek X-Patchwork-Id: 90761 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1085149vqo; Sat, 6 May 2023 07:25:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6HhqlKrcJ160rHXBIZ7eFV8OdJAzHpaekKTFchKxN2uZtf3bzl+ZqJUx8UKYeLn4Ub4PQg X-Received: by 2002:a17:902:7402:b0:1a9:7a7c:2086 with SMTP id g2-20020a170902740200b001a97a7c2086mr4563704pll.27.1683383100620; Sat, 06 May 2023 07:25:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683383100; cv=none; d=google.com; s=arc-20160816; b=X+51xl1HLWYVqtPgsCcHSYBAJ5pfTP1mdOjNRhbvRj7HAmwscdf5z7CWobVZHlNVPl DlA8wAwr0GLOVsfa0TqU7lbGa0Xqd+z7HM4pyUICdNq4jbYC6fFPsAS6jmj8O7nTiJyg dHA1xOBip8PN+aYcVpew8t7P7yR6Y0ufXLGBYOOcQ3UsO3amwGPzl5XHE8xKDmyWAAQt PbrPKoqHCM9B9tUa7WaRBA302L4pb5rG9OKSd+iG9bpKb0vaADOP4RzgzIdEEDG54cPt 2DEVYzDUaa+gxblxnRxxJJOUVbaTiPiIKUOY6JoGAYAIIOx+YCYzVr8kwlOfPf03+f5R PYng== 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; bh=VchaOpwfjpkU/eTq/AyqsvTzN+pJ9XHTrtq1yMhUouA=; b=dOwYNawoKFb/WBEJBsYHr1uaHgzHV41sDbN7AnX9PxBBx8nRktxI8d8VypuggrXfP0 h1Ou2qUjdxirTs5EImX0aFmkLl7GLTaOcUrCUnPOHm0fUVmpNLGN0lD9nAmMjnLhnb+D +aAAptBbCdRvvrVnWE55YLs2KqOLFxnKjkQT4rsrFqFdjGm0SVuFDAexJIXKU84TDxg1 ESg6aa5xULRS0ocVxxjYf/E7B46nQIwIeuwrKbB6IUURMCi0QG0Vs845Dz/LpLriOgAo wfD9zTuHG5C/+3tUvLtuzbY9KWy5i5iJ0QVhCT6VvQ1DM7jvWYWs67PGtvyHRV5/fdyF IB3w== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id iw19-20020a170903045300b001a9b4bda723si3758388plb.421.2023.05.06.07.24.45; Sat, 06 May 2023 07:25:00 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232860AbjEFORx (ORCPT + 99 others); Sat, 6 May 2023 10:17:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232778AbjEFORt (ORCPT ); Sat, 6 May 2023 10:17:49 -0400 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 020E319D47; Sat, 6 May 2023 07:17:39 -0700 (PDT) Received: (Authenticated sender: contact@artur-rojek.eu) by mail.gandi.net (Postfix) with ESMTPSA id 07AB420002; Sat, 6 May 2023 14:17:36 +0000 (UTC) From: Artur Rojek To: Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz Cc: Rafael Ignacio Zurita , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, Artur Rojek Subject: [PATCH 1/2] sh: dma: fix `dmaor_read_reg`/`dmaor_write_reg` macros Date: Sat, 6 May 2023 16:17:02 +0200 Message-Id: <20230506141703.65605-2-contact@artur-rojek.eu> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230506141703.65605-1-contact@artur-rojek.eu> References: <20230506141703.65605-1-contact@artur-rojek.eu> MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, T_SPF_TEMPERROR 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?1765155118385429686?= X-GMAIL-MSGID: =?utf-8?q?1765155118385429686?= Squash two bugs introduced into said macros in 7f47c7189b3e, preventing them from proper operation: 1) Add DMAOR register offset into the address of the hw reg access, 2) Correct a nasty typo in the DMAOR base calculation for `dmaor_write_reg`. Signed-off-by: Artur Rojek Reviewed-by: Geert Uytterhoeven Reviewed-by: John Paul Adrian Glaubitz --- arch/sh/drivers/dma/dma-sh.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/sh/drivers/dma/dma-sh.c b/arch/sh/drivers/dma/dma-sh.c index 96c626c2cd0a..14c18ebda400 100644 --- a/arch/sh/drivers/dma/dma-sh.c +++ b/arch/sh/drivers/dma/dma-sh.c @@ -254,8 +254,11 @@ static int sh_dmac_get_dma_residue(struct dma_channel *chan) * DMAOR bases are broken out amongst channel groups. DMAOR0 manages * channels 0 - 5, DMAOR1 6 - 11 (optional). */ -#define dmaor_read_reg(n) __raw_readw(dma_find_base((n)*6)) -#define dmaor_write_reg(n, data) __raw_writew(data, dma_find_base(n)*6) +#define dmaor_read_reg(n) __raw_readw(dma_find_base((n) * 6) + \ + DMAOR) +#define dmaor_write_reg(n, data) __raw_writew(data, \ + dma_find_base((n) * 6) + \ + DMAOR) static inline int dmaor_reset(int no) {