Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3128231pxf; Mon, 15 Mar 2021 02:02:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPKsoSzzkvPIQk/31gHaYvGMSVqXzhG3RSj8hTsDNcyKTjReL89k4JFADEytbrPn2Uky1Y X-Received: by 2002:a17:906:37db:: with SMTP id o27mr22755685ejc.60.1615798935354; Mon, 15 Mar 2021 02:02:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615798935; cv=none; d=google.com; s=arc-20160816; b=nDymH8HCXJ+K5C/Kvqm853PkAygXx8zK0tZC7oqhiXQeAVMcLQmJpv7m5eoZ7UbhHi x7MY1B+fmIR5pn/myVH4nEf8RV1GMV3foX/GLZuvsOJH5AzXvVGnVZoqmIDBnONRKxc6 eZ5z+7bEcizA+noS2D3ZGkEvMQtXEy4ePlKaVQGpUlpJ9rYQtKQamFh7mIsDiXJqCOV1 7NiXbh6EGNw/gMlb4izCc45YjGybCC1r/j4eTlvj7b6pw9F5X+EQ6T1j4B88/ftGiSiy LjIyjsEZ5547evL4RWGP4FBpECNWOTJb9gvZ9/dSHAZExvJeF6E/VhGAO+QDmVIvHqH/ Gbfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=kfAAPWp08T40t+2HJcYwqZ0+Tya27sQ6T7NpZF7yBug=; b=lXACRnDR51n2PyczE+E7eNWCpQ/SYuHnp9+LWQSL6rUjRV5S447yxK/696R3gPU8M8 3a42OHoue+h8qCPldGq+g4P/kJLK/jFcEeDEMhur4SDzCZnieCg+wyo1xoBzIPjCWIve mhVYWlxigyP8FGuL3wcfMSpU9GHjftNWKDGwYmk5/wI080EkVU9qsAfpZ+uTXGpXC/vh x36l7jdF8tFTfWhi6XSsc9XD+JM1mW5Ea0zj+KuIKLiFtgW71hLGMsYVo08k0iOq9pcW ncm9+mVheEjLMeoRXXdXnyYafVELDkJVVpo2ODfIcJElSEIn0VAAwBE9uri9UR/RAlkg kgLQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x12si9908995edd.423.2021.03.15.02.01.52; Mon, 15 Mar 2021 02:02:15 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229687AbhCOI7P (ORCPT + 99 others); Mon, 15 Mar 2021 04:59:15 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:36512 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229649AbhCOI7D (ORCPT ); Mon, 15 Mar 2021 04:59:03 -0400 X-UUID: 82d7528d58eb468f880f50929af6b1df-20210315 X-UUID: 82d7528d58eb468f880f50929af6b1df-20210315 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 726664109; Mon, 15 Mar 2021 16:58:59 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 15 Mar 2021 16:58:57 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 15 Mar 2021 16:58:57 +0800 From: Mark-PK Tsai To: , Mark-PK Tsai CC: , , , , , , , Subject: Re: [PATCH v2] irqchip/irq-mst: Support polarity configuration Date: Mon, 15 Mar 2021 16:58:55 +0800 Message-ID: <20210315085855.23730-1-mark-pk.tsai@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 5007523079440117CCE27AD2F0035B5726B867D344927A1A117F87F9928E1A362000:8 X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daniel Palmer > On Fri, 12 Mar 2021 at 01:11, Mark-PK Tsai wrote: > > Why irq could accept either? > > As the irq intc has no way to clear it's triggered state (no eoi) it > must just pass the signal through instead of latching it? > Otherwise it would latch once and never again right? That's what I > really didn't understand. > If it just passes the signal through and maybe inverts it then the GIC > can use edge or level I think. Yes, but if we accidentally loss a irq and the interrupt is edge triggered which is latch to level by mst-intc, we will miss all the follow irqs because the driver didn't reset the interrupt status. Actually, I'm not sure if it's possible. But even if it's not, I think use level for parent GIC can better match the hardware signal processing. > > > So maybe we don't need to do extra work to check the type for an fiq or irq controller? > > I think without the eoi callback for the fiq it would only ever fire > once. I don't think doing the same eoi callback for the irq intc hurts > anything but it wouldn't do anything either from what I can tell. The reason why I don't do the same eoi callback for irq intc is that it's not ont spec. And some of MTK TV SoC use it for certain debug function which may cause unexpected result. > > > And I will update the patch as following: > > I think maybe Marc or someone else that knows better than I do should > comment on what needs to happen. > My input is just that the fiq controller seems to trigger on an edge, > holds it's signal to the GIC high until eoi happens and then only > triggers again on an edge. > I guess it doesn't matter if it's an edge or level if that's how it > works but you'd only get one interrupt out of it per edge even if > configured as a level interrupt. > > The main thing I didn't want was filtering out edge interrupts > entirely as that breaks using edge interrupts with gpios i.e. using > gpiomon. > With the changes to set the polarity it can now detect rising or > falling edge gpio events. :) Thanks for your feedback and I will send patch v4 which includes the change I proposed in this thread.