From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A45B1C433E0 for ; Wed, 10 Mar 2021 09:29:29 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1952D64F81 for ; Wed, 10 Mar 2021 09:29:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1952D64F81 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Subject:Cc:To: From:Message-ID:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=70nqcvAdXoIhgK7qgkRMe0myuJ+VXAZyBh30ZQDE50I=; b=esyDstuYtg1o71ysAIbt5BVND O6IuOUXwe7e3m7TnFi7TAj1eZBIVDjooF1rDpvsbPgnlU1QgFGaE/FaqP6kXcSywEArKax2w0LxRA ZEDp2y/TmIbf4heE6InyOoebzBtIj9bS6WyRvqom93avfi+6kb8mESsXemJKmMRBbvSKTmAgWPdPQ l+2j8IXbXrHk+k3riTpDqjCudTLrofwb5eZE1srLjCCOkaBenbK5jm57xH2o8yzTlHU5JhpUuNVQW qCrjsGRbKdh+kJylRZT7RdcZU4J22BRnfhloGhpozdYn09YLzFuxGBhTIxa8orDycbF1iBYevl0iP OVaGoRNTg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lJv9c-006SrV-QD; Wed, 10 Mar 2021 09:29:20 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lJv9R-006SqM-L3; Wed, 10 Mar 2021 09:29:11 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0664964F81; Wed, 10 Mar 2021 09:29:08 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lJv9N-000ipf-Lt; Wed, 10 Mar 2021 09:29:05 +0000 Date: Wed, 10 Mar 2021 09:29:04 +0000 Message-ID: <87czw7xspr.wl-maz@kernel.org> From: Marc Zyngier To: Jianjun Wang Cc: Bjorn Helgaas , Rob Herring , Lorenzo Pieralisi , Ryder Lee , Philipp Zabel , "Matthias\ Brugger" , , , , , , "Sj\ Huang" , , , , , , , Subject: Re: [v8,4/7] PCI: mediatek-gen3: Add INTx support In-Reply-To: <1615345515.25662.12.camel@mhfsdcap03> References: <20210224061132.26526-1-jianjun.wang@mediatek.com> <20210224061132.26526-5-jianjun.wang@mediatek.com> <87r1koy442.wl-maz@kernel.org> <1615345515.25662.12.camel@mhfsdcap03> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: jianjun.wang@mediatek.com, bhelgaas@google.com, robh+dt@kernel.org, lorenzo.pieralisi@arm.com, ryder.lee@mediatek.com, p.zabel@pengutronix.de, matthias.bgg@gmail.com, linux-pci@vger.kernel.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, sj.huang@mediatek.com, youlin.pei@mediatek.com, chuanjia.liu@mediatek.com, qizhong.cheng@mediatek.com, sin_jieyang@mediatek.com, drinkcat@chromium.org, Rex-BC.Chen@mediatek.com, anson.chuang@mediatek.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210310_092909_980367_BA580B3E X-CRM114-Status: GOOD ( 23.84 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Wed, 10 Mar 2021 03:05:15 +0000, Jianjun Wang wrote: > > On Tue, 2021-03-09 at 11:10 +0000, Marc Zyngier wrote: > > On Wed, 24 Feb 2021 06:11:29 +0000, > > Jianjun Wang wrote: > > > > > > +static struct irq_chip mtk_intx_irq_chip = { > > > + .irq_enable = mtk_intx_unmask, > > > + .irq_disable = mtk_intx_mask, > > > > Please get rid of enable/disable. Given that you already have > > mask/unmask with the *same* implementation, this offers zero benefit. > > Hi Marc, > > Thanks for your review. > > We need to support suspend/resume feature, the HW will be powered off > when the system is suspended, and its register value will be cleared. If > the enable/disable callback is not implemented, the unmask function will > not be called when the system resume, so INTx will remain disabled. > > Can I keep the enable/disable callback? Or do we have any solutions to > restore the register value when the system resume? Isn't that the job of the suspend/resume support to save and restore the full state of the device? You shouldn't rely on the implicit behaviours of the irq subsystem across suspend/resume. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44C30C433E0 for ; Wed, 10 Mar 2021 09:30:49 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A17CF64FEF for ; Wed, 10 Mar 2021 09:30:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A17CF64FEF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Subject:Cc:To: From:Message-ID:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=IjqL56EfgH2/NsrNVO4KlxZiwz2nHfbwAjpFl8UxtuM=; b=MAoLRI8fGAkmZSCHm0xQnb0gS TTy7TUfWJw4nDIwFuKAb4CXU3zqFTO60dXrEq9OOMmeuqJ64nbkjFftw5exkqxExjZ0XMFF3eduS3 bIUqH27l8VGZKUPLenUWplEJ0f6Xzn2tuy7KTVUcQF/S5ZHIM9MafSEZDxXxeg1JUm3j670eycjU9 q7ybV4pj9cdkmG/xGqnRP5wrIcO8hHyWFh1MxHduCqTWAINuxko45BYSKlNwk36on4M+JFQnaVFHs 1uMPFOpoINhN3eUC+o/v1syFvZNJsk4mddQcXyt9nRUspzPkWTSzQwsCETAHxbMChDlyQtv0uk4Ak ZEPijaqxQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lJv9X-006Sqx-0a; Wed, 10 Mar 2021 09:29:15 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lJv9R-006SqM-L3; Wed, 10 Mar 2021 09:29:11 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0664964F81; Wed, 10 Mar 2021 09:29:08 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lJv9N-000ipf-Lt; Wed, 10 Mar 2021 09:29:05 +0000 Date: Wed, 10 Mar 2021 09:29:04 +0000 Message-ID: <87czw7xspr.wl-maz@kernel.org> From: Marc Zyngier To: Jianjun Wang Cc: Bjorn Helgaas , Rob Herring , Lorenzo Pieralisi , Ryder Lee , Philipp Zabel , "Matthias\ Brugger" , , , , , , "Sj\ Huang" , , , , , , , Subject: Re: [v8,4/7] PCI: mediatek-gen3: Add INTx support In-Reply-To: <1615345515.25662.12.camel@mhfsdcap03> References: <20210224061132.26526-1-jianjun.wang@mediatek.com> <20210224061132.26526-5-jianjun.wang@mediatek.com> <87r1koy442.wl-maz@kernel.org> <1615345515.25662.12.camel@mhfsdcap03> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: jianjun.wang@mediatek.com, bhelgaas@google.com, robh+dt@kernel.org, lorenzo.pieralisi@arm.com, ryder.lee@mediatek.com, p.zabel@pengutronix.de, matthias.bgg@gmail.com, linux-pci@vger.kernel.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, sj.huang@mediatek.com, youlin.pei@mediatek.com, chuanjia.liu@mediatek.com, qizhong.cheng@mediatek.com, sin_jieyang@mediatek.com, drinkcat@chromium.org, Rex-BC.Chen@mediatek.com, anson.chuang@mediatek.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210310_092909_980367_BA580B3E X-CRM114-Status: GOOD ( 23.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 10 Mar 2021 03:05:15 +0000, Jianjun Wang wrote: > > On Tue, 2021-03-09 at 11:10 +0000, Marc Zyngier wrote: > > On Wed, 24 Feb 2021 06:11:29 +0000, > > Jianjun Wang wrote: > > > > > > +static struct irq_chip mtk_intx_irq_chip = { > > > + .irq_enable = mtk_intx_unmask, > > > + .irq_disable = mtk_intx_mask, > > > > Please get rid of enable/disable. Given that you already have > > mask/unmask with the *same* implementation, this offers zero benefit. > > Hi Marc, > > Thanks for your review. > > We need to support suspend/resume feature, the HW will be powered off > when the system is suspended, and its register value will be cleared. If > the enable/disable callback is not implemented, the unmask function will > not be called when the system resume, so INTx will remain disabled. > > Can I keep the enable/disable callback? Or do we have any solutions to > restore the register value when the system resume? Isn't that the job of the suspend/resume support to save and restore the full state of the device? You shouldn't rely on the implicit behaviours of the irq subsystem across suspend/resume. Thanks, M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel