Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp901994rwb; Thu, 18 Aug 2022 14:31:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR66baANhniEx+fWmsKEs1rKGV92n6G5tl2EuujxWzj5QstmVGf0Azd3GM1mTseeZSfJ091t X-Received: by 2002:a17:907:b590:b0:730:9e4c:3d5f with SMTP id qx16-20020a170907b59000b007309e4c3d5fmr3020042ejc.169.1660858283662; Thu, 18 Aug 2022 14:31:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660858283; cv=none; d=google.com; s=arc-20160816; b=tWhAvxEHGoLs+2+3chiWGL1/Dnug1RLdzHHNl8p8uUi3meT7UtSPPlk3XStIJ9ya34 8/tsV/kJQSPbTqwij1XvVsJ+fhamukApDL9Mjunt3PZkCJ9W9kZ9OU+re6SxvwyTr1NO a3hQPdrOGyxtlV342/MH2UwKhGz/egwbVlODWwNZkrpUt5YR5kpNycN9JWWuJ5EhkE+b KUToqGmVR+mlDJ9gFA3teoyoeNqzEQPTO4rXR1LwWeFXLbbQz7pQ7TBVvdhEGznWbCsC lxPmDwCn+uKe3KLjogcsP6l+Xrm95VUuRNVHgbUzia2Ffl7vh0U0tJhB2lNlaZF9oAOI AM7Q== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=pYW7sT3jh29AWNhJvTI8IlA/O24S5q/YAiEWOzJFAt8=; b=lwzw3lZQB+ie0jjUl8AnrK0n7IIU1Rc481KR76pt5qMiEXsFhADtXS2i9y8qfp8U6v exR2lTYSMuJkCCNNko4fQxAd/0DCjbC4yQ10Srt+kYAnjeIMHs3TGuuk/41FMJeY2kOf 5yKcw4hvekMC9QqDFVmRzb/JGmhcuDnGiW4iw8H2PEkpNbM6HVcwSedhc7zH6iEmU3mj Z9RSmpVrk8tQJeBC7ztM+qpFFrUytYyStsOLyN8CPSiQRBaaskCfG6Weiid0c3S5VCoe rg/zwGPwMMOQOz2+HdBAxEf1xRS+uHrghi4KU2Hqh22eTxoTm4nmIqufqeRf2T3PbiuD 2OcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=LBOZg4+L; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w4-20020a056402268400b0043e14ec047bsi2208539edd.6.2022.08.18.14.30.57; Thu, 18 Aug 2022 14:31:23 -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=@lunn.ch header.s=20171124 header.b=LBOZg4+L; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346045AbiHRU1j (ORCPT + 99 others); Thu, 18 Aug 2022 16:27:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346007AbiHRU1f (ORCPT ); Thu, 18 Aug 2022 16:27:35 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [185.16.172.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48E2E12D09; Thu, 18 Aug 2022 13:27:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Transfer-Encoding:Content-Disposition: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:From: Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Content-Disposition: In-Reply-To:References; bh=pYW7sT3jh29AWNhJvTI8IlA/O24S5q/YAiEWOzJFAt8=; b=LB OZg4+L7ld0yvUo5vbEosaxy60S2JN+n31F0W6bAtTFxLs6MQHJpgBz+L31v9WbvWlpUf41AMDwhhO XYWuUBnJkNcFq8kiK1vx0Jh6LC0lDUoHRL5aQkgtR97Kc66Rn6kcDbYfQVzbLwD8fwFAnvozum9Dv LGhS1mJtgGWliC0=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1oOm6u-00DqE5-L3; Thu, 18 Aug 2022 22:27:24 +0200 Date: Thu, 18 Aug 2022 22:27:24 +0200 From: Andrew Lunn To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Bjorn Helgaas , Rob Herring , Sebastian Hesselbarth , Gregory Clement , Thomas Petazzoni , linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 2/4] PCI: mvebu: Implement support for interrupts on emulated bridge Message-ID: References: <20220817230036.817-1-pali@kernel.org> <20220817230036.817-3-pali@kernel.org> <20220818200737.7w2wqh62arfrskks@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220818200737.7w2wqh62arfrskks@pali> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Thu, Aug 18, 2022 at 10:07:37PM +0200, Pali Roh?r wrote: > On Thursday 18 August 2022 21:51:21 Andrew Lunn wrote: > > > -static irqreturn_t mvebu_pcie_irq_handler(int irq, void *arg) > > > +static irqreturn_t mvebu_pcie_error_irq_handler(int irq, void *arg) > > > +{ > > > + struct mvebu_pcie_port *port = arg; > > > + struct device *dev = &port->pcie->pdev->dev; > > > + u32 cause, unmask, status; > > > + > > > + cause = mvebu_readl(port, PCIE_INT_CAUSE_OFF); > > > + unmask = mvebu_readl(port, PCIE_INT_UNMASK_OFF); > > > + status = cause & unmask; > > > + > > > + /* "error" interrupt handler does not process INTX interrupts */ > > > + status &= ~(PCIE_INT_INTX(0) | PCIE_INT_INTX(1) | > > > + PCIE_INT_INTX(2) | PCIE_INT_INTX(3)); > > > > Just for my understanding... > > > > There are two interrupts > > yes > > > but the status information what those > > interrupts actually mean are all packed into one register? > > yes > > for masking individual interrupt events there is just one shared > register for both "intx" and "error" interrupt source. > > and also there is also just one shared "cause" register which says which > individual interrupt events happened. > > > I assume reading the clause register does not clear set bits? > > yes, reading does not clear any interrupt event. > > > Otherwise there > > would be a race condition. > > > Are these actually level interrupts > > yes > > > and in order to clear them you need to poke some other register? > > to clear individual interrupt event you have to write corresponding 1b > bit into that cause register. > > so if interrupts events BIT(24), BIT(16) and BIT(17) happened and > BIT(24), BIT(25), BIT(26), BIT(27) and BIT(16) are unmasked then CPU > receives two interrupts (one for intx:24-27 and one for err:16). kernel > will call interrupt handlers for both intx and err (possible also in > parallel if it unmasked on different CPUs) and each handler just clears > events which process. So writing BIT(16) into cause register clears only > event 16 and all other (24-27, 17) are still active. And level interrupt > (the correct one intx or err) is then triggered again. Thanks for the explanation. I don't know enough about PCI to be able to give a meaningful Reviewed-by, so i will leave that to the PCI maintainer. But the DT bits look good to me. Andrew