Received: by 2002:ac0:de83:0:0:0:0:0 with SMTP id b3csp599223imk; Sun, 3 Jul 2022 04:30:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vmeWOs28RKQ+HlNtQQOA1s3qW7EDoNI3ipgZmZ9FvTJ2MAkoOxsiVY3ZIo1138vQFykgfZ X-Received: by 2002:a05:6402:2684:b0:435:afac:3670 with SMTP id w4-20020a056402268400b00435afac3670mr32993534edd.262.1656847839593; Sun, 03 Jul 2022 04:30:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656847839; cv=none; d=google.com; s=arc-20160816; b=NTE7/QfEgqEctcrz262fOitITQSA3EZ3iA+7KpinC3JGVqWXbW2EujyYrS2vcnzqum qYzqrp6clw8ZeMVMXcBlQb/MHOn6JK48iEREeiNMsuYkoEQzkfiljzHwXCf+7GLigsEr zBomarMyP729j8iNpMh5xrLmwwjzjOpvxoCzrg9l1b3hTSv1Xo169Px/llidVOb8mXxJ yMiPfbenayHrlRJURO2nbKw4koeVv0qx+nsjsK7OxSX3zPFbIUh9NhMYXva2sgLpJ2lv Wd14Er9f/W/AvVPb27bn6Ehw7rhLYZHVe/XrLHYXNLH4QUIKRDztyyJDU3rlQmTZafom wwpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:in-reply-to:subject :cc:to:from:references:dkim-signature; bh=7DUjjtXVZ1JAAkcFuhk8EQe1NcnY/rlPFrCMqUddOfE=; b=nRi32nJbsrx2j9hrhN2z5lii/lwZLQjQgUyBujJadYbnnzQUO0XYQFhjJ6UAwdJI4c ANVEViYBnSd61LHmeAbdJ7ZKaaBCBh2GuTNP0/FuRb8i2gVoenlh01LQj/M6Sz4158kj SzHvYkAz5xSdwUrkzFn5XZA+ETPhRXgIooA0BfSXQfx/2pc8Fp1VuddyG0NFr9M7kdwa QbhblSK1c48iTzdUcmxLr51aVF13OgXc/9CrI/lJk1rbjhVlQMikTdTNsbUd+2kro5WF PurEILjquparTuhNkvnvYF9UWbtsfir8n6j6zrqkV5teGM7WPag1eql8hM6iOR9v7lWQ LbEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oFvgtd6O; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cb6-20020a0564020b6600b0043a2630f128si1557674edb.125.2022.07.03.04.30.14; Sun, 03 Jul 2022 04:30:39 -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=@gmail.com header.s=20210112 header.b=oFvgtd6O; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232381AbiGCLFz (ORCPT + 99 others); Sun, 3 Jul 2022 07:05:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229993AbiGCLFx (ORCPT ); Sun, 3 Jul 2022 07:05:53 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A15B67643; Sun, 3 Jul 2022 04:05:52 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id cl1so9445503wrb.4; Sun, 03 Jul 2022 04:05:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:from:to:cc:subject:in-reply-to:date:message-id :mime-version; bh=7DUjjtXVZ1JAAkcFuhk8EQe1NcnY/rlPFrCMqUddOfE=; b=oFvgtd6O9hfvRAcNCd5d8OYRmqxxyQgYH6J+5+ylHpN23I2fFjJtvOR1QF2NH/CNlD AmfhiVcYW+oBZur0Hmb9eOEW58qEXaxnJuaxyElZ8NI7+cW+qHzbqx/iqjtqe64qi1fj R5RP06UTKNeLWc8fER6u4wTw9xXROBitppJMt5VDwtk7uIaETFljwoz7M3alxrsdjtoO PCfm8Ha6+NOTh2ujNqxo/0FeAGIunHNDMa4fJiv9Lcc20SgrKFww7zgDHVDjxJQY2pYJ maFTF1SBvjBtUCC2WV2morJunT39i6/qey3A6csF4sUGbklb97KO6iR6lsPPWLfm3J+Z s8zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=7DUjjtXVZ1JAAkcFuhk8EQe1NcnY/rlPFrCMqUddOfE=; b=190qCKE3bT8pgko8Ka8byK9xs9eM5rlFpf/OB0DT6h2McEQp/lcTcNs7RfSPqP5aDM 4+GhVGaQz60k6+oLaAnvtKUnu6f/Lc7QlrcwQckmJMhpgoV39au/GREixEXtqcDHr2EO uFraMavsxRC4Kd767DuxorL78JFdFVBtPqBYbfbIKWQ0+FmqqBD/WiF+9sWTxwNYDqB9 LyZlMduM8//aTadUgy0vTcktcMejduZOwkkBU1suSJZG2jThkXVh+u2OWaG2JsRggjxr XxLDY0l+5196G2wIUL5YIk/K3yqE7SMq/FLIGf0z7FypTX2ZfXfKNqywKNEyDGOV/hoP tI9g== X-Gm-Message-State: AJIora+EMooBTN8/AnjFXDBiHhDUMC6aD+zv7yql5bRiK4ehne1SNp84 yE5pFy5vT+aKGo4dO8gIMLfBaZgMyos= X-Received: by 2002:a05:6000:1547:b0:21b:a2e2:6151 with SMTP id 7-20020a056000154700b0021ba2e26151mr21597551wry.481.1656846351065; Sun, 03 Jul 2022 04:05:51 -0700 (PDT) Received: from localhost (92.40.202.9.threembb.co.uk. [92.40.202.9]) by smtp.gmail.com with ESMTPSA id d21-20020a1c7315000000b003a02cbf862esm15934392wmb.13.2022.07.03.04.05.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jul 2022 04:05:50 -0700 (PDT) References: <20220623211420.918875-1-aidanmacdonald.0x0@gmail.com> <20220623211420.918875-12-aidanmacdonald.0x0@gmail.com> From: Aidan MacDonald To: Marek Szyprowski Cc: broonie@kernel.org, gregkh@linuxfoundation.org, rafael@kernel.org, andy.shevchenko@gmail.com, mazziesaccount@gmail.com, linux-kernel@vger.kernel.org, Krzysztof Kozlowski , 'Linux Samsung SOC' Subject: Re: [PATCH v2 11/12] regmap-irq: Add get_irq_reg() callback In-reply-to: Date: Sun, 03 Jul 2022 12:06:58 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Marek Szyprowski writes: > Hi All, > > On 23.06.2022 23:14, Aidan MacDonald wrote: >> Replace the internal sub_irq_reg() function with a public callback >> that drivers can use when they have more complex register layouts. >> The default implementation is regmap_irq_get_irq_reg_linear(), used >> if the chip doesn't provide its own callback. >> >> Signed-off-by: Aidan MacDonald >> --- > > This patch landed in today's linux next-20220701 as commit bdf9b86cd3ad > ("regmap-irq: Add get_irq_reg() callback"). I've noticed that it causes > a regression on my test systems: the RTC alarm stopped working on all > boards with Samsung PMICs (drivers/mfd/sec*.c). There are no > warnings/oopses/etc. Waitng for the RTC alarm lasts forever, so it looks > that something is broken with interrupts. Reverting it on top of > linux-next fixes the issue. > > Unfortunately I'm going for a holidays for the whole next week and I'm > not able to analyze this issue further today. Krzysztof: maybe You will > be able to provide some more hints which regmap irq variant is broken? Fortunately it's nothing complicated -- just a typo. Thanks for testing. >> drivers/base/regmap/regmap-irq.c | 126 ++++++++++++++++++++----------- >> include/linux/regmap.h | 15 +++- >> 2 files changed, 93 insertions(+), 48 deletions(-) >> [..] >> +unsigned int regmap_irq_get_irq_reg_linear(struct regmap_irq_chip_data *data, >> + unsigned int base, int index) >> +{ >> + const struct regmap_irq_chip *chip = data->chip; >> + struct regmap *map = data->map; >> + >> + /* >> + * FIXME: This is for backward compatibility and should be removed >> + * when not_fixed_stride is dropped (it's only used by qcom-pm8008). >> + */ >> + if (chip->not_fixed_stride && chip->sub_reg_offsets) { >> + struct regmap_irq_sub_irq_map *subreg; >> + >> + subreg = &chip->sub_reg_offsets[0]; >> + return base + subreg->offset[0]; >> + } >> + >> + return base + index * map->reg_stride * chip->irq_reg_stride; chip->irq_reg_stride is usually 0. This should be data->irq_reg_stride, which will be corrected to the default value of 1. >> +} >> +EXPORT_SYMBOL_GPL(regmap_irq_get_irq_reg_linear); >> + >> /** >> * regmap_irq_set_type_config_simple() - Simple IRQ type configuration callback. >> * @buf: Buffer containing configuration register values, this is a 2D array of >> @@ -862,6 +891,11 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode, > > Best regards