Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp2342712pxb; Sun, 15 Nov 2020 00:56:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJxp8XYab4PjUNoX8ElKiFumA+YJHdhJgjsZrnGRcvH3B0HGGeWgjuxiid14D3djONxVJF8D X-Received: by 2002:a17:906:b799:: with SMTP id dt25mr9876758ejb.183.1605430577969; Sun, 15 Nov 2020 00:56:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605430577; cv=none; d=google.com; s=arc-20160816; b=bBbTkYpnRauKCxkbgrDBspfCXa4CezyWM4xdCYJNleD13BhH0mF7K2VrXH/8x+BysE IraxCy/XZTjwG+LHY2U+wgClQWk4FKQmTlxgczfhXQml401K+rcrAYs/etjiUeMLcPjj bhPtyjdXCZV4gNmIUAMfcjsUpLYd9nd3IIL1u9nf7dzqrbkD8K1VgF6DMJV3QF46hwQG Dl/8ui2OpyC+nmmamhZ+CCVjU/U2fP1mh7/dsFwKyZs8iic/HL2hwdcpJ8jl6K/73jIB f4xNaWgsofVLp+MvI55O6/mGlcZ4A/lpahn8Lh2j3bAwmbKQJBTAeqLPVYBJKRBLlvuw KlDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=aBsAhFmyCtD/EH0BULXEqpNnYa7Lrv6+fP6SaU+xpk0=; b=OPpINl9JLPZ5kXBSieGXh3x6xlXHZ/OSkACnwoFuUeKIPwA8bQ9nXkT9X1jQgw5cLX O2WeV36RTme4qAcA9kUufCKAKYc5rOQ+tNY+hlG9Xnu1CPaeeZMQJobEHMzE+83KNt/f HYbOHsF7hdJ4bwyH7ZbiRyx5E27y1p+6A5pxvCtHIiRZCn+rtT6EtfIq4SzXd677dJb9 sZako4Xtylni0V2392T6ZSA9gr9zIDNsDLc74GRBS8X5PhkTIjGkmXf8o5/Y9fuJQ0mF N376L2jTCeC22oK5uJDzrnFM4mC3MgFzpoo7RfGkVl39XFZNfyDVj5V9RKg7mF7hQO5z +RSQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f24si9532854ejq.520.2020.11.15.00.55.54; Sun, 15 Nov 2020 00:56:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726642AbgKOIoR (ORCPT + 99 others); Sun, 15 Nov 2020 03:44:17 -0500 Received: from muru.com ([72.249.23.125]:48306 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726647AbgKOInc (ORCPT ); Sun, 15 Nov 2020 03:43:32 -0500 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 1C11780A0; Sun, 15 Nov 2020 08:43:17 +0000 (UTC) Date: Sun, 15 Nov 2020 10:43:08 +0200 From: Tony Lindgren To: Tim Harvey Cc: Lee Jones , open list , Carl Philipp Klemm , Laxminath Kasam , Merlijn Wajer , Mark Brown , Pavel Machek , Sebastian Reichel Subject: Re: [PATCH] mfd: cpcap: Fix interrupt regression with regmap clear_ack Message-ID: <20201115084308.GY26857@atomide.com> References: <20201111170613.46057-1-tony@atomide.com> <20201113102134.GI3718728@dell> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Tim Harvey [201113 22:07]: > 3a6f0fb7b8eb ("regmap: irq: Add support to clear ack registers") > appears to not only add the new clear_ack case it also attempts to > resolve the long standing ack_invert issue with this change: > > - ret = regmap_write(map, reg, data->status_buf[i]); > + if (chip->ack_invert) > + ret = regmap_write(map, reg, > + ~data->status_buf[i]); > + else > + ret = regmap_write(map, reg, > + data->status_buf[i]); Yes that's what I noticed too. And that's why cpcap was working for me with ack_invert and without it earlier. > However, this still doesn't resolve the issue I have with my > device/driver because it ends up writing 1's to all the other bits in > the ack register which keeps my device's interrupt from de-asserting. > Perhaps that's a strange behavior of my device that it allows you to > 'set' interrupt source bits which causes the interrupt to stay > asserted? I'm also wondering if my issue is that I currently have the > interrupt registered as such: > > ret = devm_regmap_add_irq_chip(dev, gsc->regmap, client->irq, > IRQF_ONESHOT | IRQF_SHARED | IRQF_TRIGGER_FALLING, 0, &gsc_irq_chip, > &irq_data); > > Perhaps this should be IRQF_TRIGGER_LOW as the device will not > de-assert its IRQ# until all source bits are cleared. Yes could be. For cpcap, we have IRQ_TYPE_LEVEL_HIGH configured in the motorola-cpcap-mapphone.dtsi file. > Tony, I thought that your pcap issue was that it truly did not have an > inverted ack and the fact that ack_invert did not work was why you > never noticed any issue. If this is true I would think you would want > to disable ack_invert but not necessarily enable clear_ack. Did your > testing show it needed to toggle the ack to clear it? Well I looked at the v3.0.8 Motorola Linux Android kernel, it actually does clear_ack. So I'd rather keep the same logic as we have no proper documentation for cpcap. I also confirmed still works without ack_invert too while ack_invert now is broken. But using clear_ack now that we have it working seems safer. Regards, Tony