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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 97B48C07E9D for ; Mon, 26 Sep 2022 14:01:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KzoZDFpkIgTteWCoVeaYJR+ZE3P5a9cdBzOMtZ6L5EQ=; b=MrF80NS+O4NUuH hBg0+RGbfLs6+EhDTvYrIp+OMjkJkx1u5cpH5BOGP1KtmPn1dnYGsUwbyjqEPvvzKL+wVchGES2kC Za+WX6N1JLjpG8z7tP6CtQAkceBWhb7p/WGFYZJ0iDOuoQUPfloXniX5htb7+kcPARNeCjRT7+e2N duMXY1FoRpeAZ8qlLlPes5fSB1LxMDUIbktsi+GEUPOefS5dX7fHKI5hkJ1KWRkHRxV68ik9/+H4u +rlPsD2uEhq69gJA0FURczvAtUy9wNAZlofqn5TrTQJTzcnB6zwbExUVeoJQPl7WHp3hQcixj7SWr G8vZUMhbrU7TfSr+hUWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ocoen-005Flq-BJ; Mon, 26 Sep 2022 14:00:25 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ocoej-005FlA-CZ for linux-arm-kernel@lists.infradead.org; Mon, 26 Sep 2022 14:00:22 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8FAF960DE0; Mon, 26 Sep 2022 14:00:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B02FDC433C1; Mon, 26 Sep 2022 14:00:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664200820; bh=xQH4FsyT+Dv/FkIwMdXsyg+Yph7LcdP5Gv0oJ1Qxs0M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=crRE+EBu+h5LCZnCIkijcvAUhnwHc76d6SkoxoaORJHoOD3yDO1OY/3ma/YF14U9w i4vQCoW/0zZzYgmBd/0be6DjcYVkurnVBEmy+FwP8p5g5VDwFAu7H3ZhqwtavWEvsk FYNiM9w+ZSBtCjCxgiKWeJNtl6MhgYOEHSiN74qEuEKxm/63v3UWZUytpWeiRim9Ac TuYE2JIAQS0bTd7TgaBf2m0aq67argsHOIua4unZ2uL/TEgRzG+jcyXmlhTPD1hcFY DVEAZJedaLl/lPNkZUWs4ZUd+djWC6+1xNSe24/fNHu8PYE/YlCGfXPBqyYYhzHaN5 3IAvTgqmIYnrw== Date: Mon, 26 Sep 2022 16:00:13 +0200 From: Lorenzo Pieralisi To: Marc Zyngier Cc: Marek =?iso-8859-1?Q?Beh=FAn?= , Lorenzo Pieralisi , Bjorn Helgaas , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , pali@kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, tglx@linutronix.de Subject: Re: [PATCH 03/11] PCI: aardvark: Add support for DLLSC and hotplug interrupt Message-ID: References: <20220818135140.5996-1-kabel@kernel.org> <20220818135140.5996-4-kabel@kernel.org> <87r10al6a0.wl-maz@kernel.org> <868rm68g9k.wl-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <868rm68g9k.wl-maz@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220926_070021_525528_44D04903 X-CRM114-Status: GOOD ( 47.55 ) 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="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Sep 26, 2022 at 08:35:51AM -0400, Marc Zyngier wrote: > On Mon, 26 Sep 2022 07:49:55 -0400, > Lorenzo Pieralisi wrote: > > = > > On Sat, Sep 17, 2022 at 10:05:59AM +0100, Marc Zyngier wrote: > > > Hi Lorenzo, > > > = > > > On Fri, 09 Sep 2022 15:57:11 +0100, > > > Lorenzo Pieralisi wrote: > > > > = > > > > [+Marc, Thomas - I can't merge this code without them reviewing it, > > > > I am not sure at all you can mix the timer/IRQ code the way you do] > > > > = > > > > On Thu, Aug 18, 2022 at 03:51:32PM +0200, Marek Beh=FAn wrote: > > > > > From: Pali Roh=E1r > > > > > = > > > > > Add support for Data Link Layer State Change in the emulated slot > > > > > registers and hotplug interrupt via the emulated root bridge. > > > > > = > > > > > This is mainly useful for when an error causes link down event. W= ith > > > > > this change, drivers can try recovery. > > > > > = > > > > > Link down state change can be implemented because Aardvark suppor= ts Link > > > > > Down event interrupt. Use it for signaling that Data Link Layer L= ink is > > > > > not active anymore via Hot-Plug Interrupt on emulated root bridge. > > > > > = > > > > > Link up interrupt is not available on Aardvark, but we check for = whether > > > > > link is up in the advk_pcie_link_up() function. By triggering Hot= -Plug > > > > > Interrupt from this function we achieve Link up event, so long as= the > > > > > function is called (which it is after probe and when rescanning). > > > > > Although it is not ideal, it is better than nothing. > > > > = > > > > So before even coming to the code review: this patch does two thing= s. > > > > = > > > > 1) It adds support for handling the Link down state > > > > 2) It adds some code to emulate a Link-up event > > > > = > > > > Now, for (2). IIUC you are adding code to make sure that an HP > > > > event is triggered if advk_pcie_link_up() is called and it > > > > detects a Link-down->Link-up transition, that has to be notified > > > > through an HP event. > > > > = > > > > If that's correct, you have to explain to me please what this is > > > > actually achieving and a specific scenario where we want this to be > > > > implemented, in fine details; then we add it to the commit log. > > > > = > > > > That aside, the interaction of the timer and the IRQ domain code > > > > must be reviewed by Marc and Thomas to make sure this is not > > > > a gross violation of the respective subsystems usage. > > > = > > > I don't see anything being a "gross violation" here, at least from an > > > interrupt subsystem perspective. In a way, this is synthesising an > > > interrupt on the back of some other event, and as long as the context > > > is somehow appropriate (something that looks like an interrupt when > > > pretending there is one), this should be OK. Other subsystems such as > > > i2c GPIO expanders do similar things. > > = > > Right, thanks. > > = > > > The one thing I'm dubious about is the frequency of the timer. Asking > > > for a poll of the link every jiffy is bound to be expensive, and it > > > would be good to relax this as much as possible, specially on low-end > > > HW such as this, where every cycle counts. It is always going to be a > > > "best effort" thing, and the commit message doesn't say what's the > > > actual grace period to handle this (the spec probably has one). > > = > > AFAICS, the code does not poll the link. It sets a timer only if > > the link is checked (eg upon PCI bus forced rescan or config access) > > the link is up and it was down, to emulate a HP IRQ. > = > I still find the timer frequency pretty high, but surely the authors > of the code have worked out that this wasn't a problem. Please correct me if I am wrong but with mod_timer() all they want to do is emulating/firing an (hotplug) IRQ as soon as possible - a one-off. It is not a periodic timer - at least that's what I understand from the code and that's the reason why such a short interval was chosen but it should not be me who comment on that :) Again - that's just my understanding of this patch (the link-up portion). Lorenzo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel