Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6341235iog; Thu, 23 Jun 2022 17:17:17 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t+vU/SGYaK/0yj8opuHL4vS9pVZpqYCKZNffPB5U1XRmpVe5UttVEi1hVKGta30sxPNO1x X-Received: by 2002:a05:6402:452:b0:434:a373:f9f8 with SMTP id p18-20020a056402045200b00434a373f9f8mr14142137edw.290.1656029837714; Thu, 23 Jun 2022 17:17:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656029837; cv=none; d=google.com; s=arc-20160816; b=j3hQZhupUBBvMWlHv0ABGLITy7XnUVeMsVGI/q4zwyYUKV0Znt/gLnLBQ4K636okva hXk4xfSnjJFEoYhcU/jiqL7c6I3QBwhnsmMHweI7LSwMpw/ebf3XFxZTYqtc+hIwNlI/ apPkLdkuLw/56B80Qw8WT3NP6KXZX/yrEyZao5KqYJGe249DkpDHch/Cw0o6RDK7+IKO tgr0ewodmSbkYwZqdsq5vqE91YGF5B+yLUe6TMQpYB6Z5JVDEIKv7kpbYfk3v8fRELwM CXY7BOGrYB0EDOlHd0DIRFYJviwFnH1R2qoGtpy4hD6wYfP+pufLvjRpnzSfcNTzJG3U IUeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=V+hXaNzG1xRg90Us21edRjM0CTBX8UcXbRwupTdVLP4=; b=iMPov7b1hRc4dP3h7SFkcQ7sMY64g0t+uUQguZMVH0LkEU+cFbVwVH3+Tx2NA99gw8 VQdFqlKjjX3q7VgAIyyR0hFM3zGVG8Qy6IpclTqZoFtkupeNPLon7X7O/k/JxV0In1QE nmVSrU7tQFf/DvZrIW8P+uBcpATeJ+KAZzbcw+x5hkLNmo/qhdBXcjkNjFcZn1Ft/sDV 2DhN6w6Wdr7d3Za3b/wqlw5gweAyqjXA+40f5qvlgSfVhSf933uyzB+HE6hNUn8MjENt VSpUYLyiPbe3gO/r7E83CZJNtlkWLra4tKqXakhM5uwYhBHNOtC9po5k0Yk+iCiJunRg eMuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=cFYTK54l; 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=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga6-20020a1709070c0600b006fea036b38esi840680ejc.310.2022.06.23.17.16.49; Thu, 23 Jun 2022 17:17:17 -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=@quicinc.com header.s=qcdkim header.b=cFYTK54l; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231426AbiFXADe (ORCPT + 99 others); Thu, 23 Jun 2022 20:03:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229645AbiFXADd (ORCPT ); Thu, 23 Jun 2022 20:03:33 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FDE754BFE; Thu, 23 Jun 2022 17:03:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1656029012; x=1687565012; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=V+hXaNzG1xRg90Us21edRjM0CTBX8UcXbRwupTdVLP4=; b=cFYTK54l0Jj3I3KYIToLQgh2MBUdxyveACW4z74SGmzLY78dBMlA2Ces gJhBGQNfJIfQhtwa4d7XWjLXs74/YuMT/+UrtWBoFpycfC/5V1zxgfr3O kAoWJOq5ve7TsbkEfnJFg0bVzs3rz9UDFIU+ImMNbNX9hVSX2mjXQnvSf 0=; Received: from unknown (HELO ironmsg-SD-alpha.qualcomm.com) ([10.53.140.30]) by alexa-out-sd-01.qualcomm.com with ESMTP; 23 Jun 2022 17:03:32 -0700 X-QCInternal: smtphost Received: from nasanex01b.na.qualcomm.com ([10.46.141.250]) by ironmsg-SD-alpha.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2022 17:03:31 -0700 Received: from quicinc.com (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Thu, 23 Jun 2022 17:03:31 -0700 Date: Thu, 23 Jun 2022 17:03:30 -0700 From: Guru Das Srinagesh To: Andy Shevchenko CC: Aidan MacDonald , Mark Brown , Andy Gross , Bjorn Andersson , Srinivas Kandagatla , Banajit Goswami , Greg Kroah-Hartman , "Rafael J. Wysocki" , Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , MyungJoo Ham , Michael Walle , Linus Walleij , Bartosz Golaszewski , Thomas Gleixner , Marc Zyngier , Lee Jones , Manivannan Sadhasivam , Cristian Ciocaltea , Chen-Yu Tsai , , , Matti Vaittinen , , , , Jernej Skrabec , Samuel Holland , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , , linux-arm-msm , linux-arm Mailing List , , ALSA Development Mailing List Subject: Re: [PATCH 18/49] mfd: qcom-pm8008: Add broken_mask_unmask irq chip flag Message-ID: <20220624000329.GB21400@quicinc.com> References: <20220620200644.1961936-1-aidanmacdonald.0x0@gmail.com> <20220620200644.1961936-19-aidanmacdonald.0x0@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01b.na.qualcomm.com (10.46.141.250) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 On Tue, Jun 21, 2022 at 11:35:09AM +0200, Andy Shevchenko wrote: > On Mon, Jun 20, 2022 at 10:08 PM Aidan MacDonald > wrote: > > > > The qcom-pm8008 appears to use "1 to enable" convention for > > enabling interrupts, with separate set and clear registers. > > It's relying on masks and unmasks being inverted from their > > It relies > > > intuitive meaning, so it needs the broken_mask_unmask flag. > > How has it worked until now? It is as Aidan rightly pointed out. When I was writing the pm8008 driver, I found that the mask and unmask terminology used in the framework was inverted when it came to the hardware, so I had to make do and swap them. It works because in regmap_irq_sync_unlock(), the same mask is used to update mask_reg and unmask_reg, except that it is inverted for updating the unmask register. So, by just swapping which register gets updated with the plain mask and which one gets updated with the inverted mask, I could use the framework to accomplish the setting and clearing of the correct registers.