Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1084036rwl; Fri, 24 Mar 2023 06:11:02 -0700 (PDT) X-Google-Smtp-Source: AKy350b1/NHrrycxX+jF1eSjzioKQtYy4n74aQVLU9gSMoSvZK7g14wcRoA89mlZ5AZGGOXJepyM X-Received: by 2002:a17:906:c344:b0:8cf:fda0:5b9b with SMTP id ci4-20020a170906c34400b008cffda05b9bmr2586625ejb.22.1679663462445; Fri, 24 Mar 2023 06:11:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679663462; cv=none; d=google.com; s=arc-20160816; b=r0TaVo9QT3bj7GEIRlhI1R7O70qG+OOROgpB31m9KhyFZXMOfLjys1OctWjyavRGjQ DI4cjvwFONFKToJqn8Ozx6n9BfTWtyh4MVmfeohAZeUd8gzN+/BLPRAq3luqQROU5jmO jojgDhf7GqHgybz9yghT/lS1mzRyDEgrNz1KxZYuIhpUBe80AESIQ+4BXvq8kHRYa8An GmT79VoIzBHOtq9RPttjxdAZvrXrw24hFCkdqcmX1NJKeyWE9RNc7uquxOJC1/wqWd8n Yqz/i+GELYXSk38M4ApXTwECNn8C3xphRriy1B6WB8sLmJIMfFnQ3/+B3L8HNtnMw8Go clOg== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=beaHYk4b0xIx4JQCeJ7Rbi2htRk2mvqoOU7MSS3WMFQ=; b=YADvRm8Qy8agtkKjbVJGO8nTAfSjJdcuim9p6R5yXSu9Qy+VjX7a4Jb29d/kD3PWnm jnsymTbs56hHCGl+KynFyOdnoalJO4S2fy7NbcQs/ACniwP2oKk5Gqm8rLKmCiF4jspa 6noJkNxBVQTE6U13TKD3tVuX8pls/eegoP5SHwzjf+PEV0GNJkgY2fcPRtjHqqt3OwCu aiFOcgW+szSkEby5ySf/s19vAuY/UKeS89WI8X4VOGLd9UQceQm2M0EVvaGuwUQsJ3mj obQPQtLO55AXUoLc3C2pw+Rue1KA0gGT/p6F8YLNVaa4TSDXFT0COoW9ByH5JZyaLd0S 8c0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=meJLw8pR; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg12-20020a170907970c00b009332591a3e2si22758486ejc.24.2023.03.24.06.10.36; Fri, 24 Mar 2023 06:11:02 -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=@bootlin.com header.s=gm1 header.b=meJLw8pR; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231161AbjCXMsZ (ORCPT + 99 others); Fri, 24 Mar 2023 08:48:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbjCXMsX (ORCPT ); Fri, 24 Mar 2023 08:48:23 -0400 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5A5C1FCB; Fri, 24 Mar 2023 05:48:21 -0700 (PDT) Received: (Authenticated sender: maxime.chevallier@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id 69CDC1BF213; Fri, 24 Mar 2023 12:48:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1679662100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=beaHYk4b0xIx4JQCeJ7Rbi2htRk2mvqoOU7MSS3WMFQ=; b=meJLw8pRvEt5Bjnjc80nXyhHpSx7o5W5tDHkHTuVYKroWjc+P/JxZ+WtM7bwY1VXG3Ghbd i+M2JV/fF8rzneIR1UlnTGQfcOz2zVB1sHWNXCxdBizMBgerzwjPKer/mhV1O27R7uQv1q 9c88Om74IGAMeXbllBsBzp78r/G8g/zKxyJhAeMy+bKaKOe+uLMeoN4EHLbu6vXuuTFA79 2EccSWSi39cxdQ/MCZabLDAxfx6oPatHZKt5LQJSi0oCK/HNIHgAv0MUcIG/TjeQdCq4Hf 7VpHSn2UhttLB8zXjb3FF1uUSHmm9nH3RfGTx/+5EPGNqlscf6TS78EwPjK15A== Date: Fri, 24 Mar 2023 13:48:17 +0100 From: Maxime Chevallier To: Andrew Lunn Cc: Mark Brown , Greg Kroah-Hartman , rafael@kernel.org, Colin Foster , Vladimir Oltean , Lee Jones , davem@davemloft.net, Eric Dumazet , Jakub Kicinski , Paolo Abeni , Heiner Kallweit , Russell King , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, thomas.petazzoni@bootlin.com Subject: Re: [RFC 4/7] mfd: ocelot-spi: Change the regmap stride to reflect the real one Message-ID: <20230324134817.50358271@pc-7.home> In-Reply-To: References: <20230324093644.464704-1-maxime.chevallier@bootlin.com> <20230324093644.464704-5-maxime.chevallier@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 4.1.1 (GTK 3.24.36; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS 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 Hello Andrew, On Fri, 24 Mar 2023 13:11:07 +0100 Andrew Lunn wrote: > On Fri, Mar 24, 2023 at 10:36:41AM +0100, Maxime Chevallier wrote: > > When used over SPI, the register addresses needs to be translated, > > compared to when used over MMIO. The translation consists in > > applying an offset with reg_base, then downshifting the registers > > by 2. This actually changes the register stride from 4 to 1. > > > > Signed-off-by: Maxime Chevallier > > --- > > drivers/mfd/ocelot-spi.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/mfd/ocelot-spi.c b/drivers/mfd/ocelot-spi.c > > index 2d1349a10ca9..107cda0544aa 100644 > > --- a/drivers/mfd/ocelot-spi.c > > +++ b/drivers/mfd/ocelot-spi.c > > @@ -124,7 +124,7 @@ static int ocelot_spi_initialize(struct device > > *dev) > > static const struct regmap_config ocelot_spi_regmap_config = { > > .reg_bits = 24, > > - .reg_stride = 4, > > + .reg_stride = 1, > > .reg_shift = REGMAP_DOWNSHIFT(2), > > .val_bits = 32, > > This does not look like a bisectable change? Or did it never work > before? Actually this works in all cases because of "regmap: check for alignment on translated register addresses" in this series. Before this series, I think using a stride of 1 would have worked too, as any 4-byte-aligned accesses are also 1-byte aligned. But that's also why I need review on this, my understanding is that reg_stride is used just as a check for alignment, and I couldn't test this ocelot-related patch on the real HW, so please take it with a grain of salt :( Thanks, Maxime > Andrew