Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1715252ybl; Tue, 3 Dec 2019 11:29:39 -0800 (PST) X-Google-Smtp-Source: APXvYqyk48lN1t0YbWRxgnn8RTUMu6EikyNgec8s58qGo1PyMDEwhWzJHwVPyqLkanTvwspfSmJH X-Received: by 2002:a9d:75c7:: with SMTP id c7mr4403735otl.12.1575401378979; Tue, 03 Dec 2019 11:29:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575401378; cv=none; d=google.com; s=arc-20160816; b=cdNvvAHwMTGUd3iSmn4sXKdmyW9nLWsJQwEhUBUzghP1lkOG1FMfumvdby4DxbSM7x QAQLsJxGi8kyliFhFe+CIzRPkTIAvtLGM0IlnQUituDfcfTKHpNqKbodAGhg90MV34td dIHpgt3qfI4LnQmhTmMzYQ6Kv6YyJ2nsYAVC6oLYb5VmyTd2i/ire4Gu7xZ66mhSS4T1 Ze7CT20lCDzKwn9rXEG1rb3fFc+nJuedHrPeTBYDk1DGhChl/J5rhq4OtV4DDcVMLVbg f6Nx8KlbkADegBomc9tIS1LkB0OdGPW6NnJG9qvxN9tu0eYoJP4zgUxoCOwePYtD4MVQ 0UIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=0PgT9Sm6MTMXuNLnykZQsd6rodt9b9uQNxM2B4NE8NA=; b=Mvp/gy0EEQvXwOQfDY/YZpSb/6LQa2d55FEux2RpsG5PelAXfwSAs7NQ+BXVj9ZpB9 STjNWN1nhCjxydacXSzpv8OZP+yfsqipkN5f9ffdfVdJRoZB/CAb3VihKx3QyHaSU4IU D/JDmo2t47IennO/+bo9Zqcgl/B89E9OmLH6Z2vW6Cm8ecs/owmIemkerPt1XmrnhzVt L2su/Qd0Y2M5+cJWncHMBCT1IV2Af+XNYQ1e/z4U+uGang/Hu3eMK7Ge0vHuE0pDEECy CAVYlnKTW904VA88j0MRGJLl98rwEZYAU6FEgI4OTfwGga2LvWOpm9NzgGZP5vDYfiH7 tUig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DWtDNKTC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y3si1803621ote.235.2019.12.03.11.29.26; Tue, 03 Dec 2019 11:29:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DWtDNKTC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727388AbfLCT1l (ORCPT + 99 others); Tue, 3 Dec 2019 14:27:41 -0500 Received: from mail-pj1-f66.google.com ([209.85.216.66]:40969 "EHLO mail-pj1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726932AbfLCT1l (ORCPT ); Tue, 3 Dec 2019 14:27:41 -0500 Received: by mail-pj1-f66.google.com with SMTP id ca19so1901482pjb.8; Tue, 03 Dec 2019 11:27:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0PgT9Sm6MTMXuNLnykZQsd6rodt9b9uQNxM2B4NE8NA=; b=DWtDNKTCoDd8AVCIaKWfQfjF6A4gU6y0pXYZm1LWLNrAeN5pJ9Y396tGvuAKw2+hjS 9I0LbSyqQ7l9MmBlbcleBIcWLxNqWH2bsVLpQ+ej/42KKf0q3gq/rnkxuw6tkqD5Iju4 MAlpnzmxV8tZ8LLrVN/c+JoRc0dk9pz8WRgp/Y+xcIAGODoylB4pay2xzNuzBhRz2VsS 95AyBS/cKU80PT2U9kwEHMkM1ATpRNwkmL30hBQckrBKSZq3//5quE+bwi0lOB6eXZMt 2akPUnbWrXS8XxcfKD5SXmiaP6FvnzlR+5jSGWF7M3GKsCanmAcbZgk34LXmIxqC9Lpv 2IyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0PgT9Sm6MTMXuNLnykZQsd6rodt9b9uQNxM2B4NE8NA=; b=lVPPJLKx2uAkeBeV9JvW/RIcaWuIkjlVZnGf5yI6zvI9jjCzvLBCLDCEcPB71D3Kpy nByuIoC23mdxSldcTjIeXeap/7F9g9whCJf78haWWtlHO6ImALCo/0aTpMMLXLPwcNSo WkqjCVy6yR1m2wItoy43SzdfqmkL1m7erob4epyJwlmkSEgA2t3ofu3LLSKVLBGaIhxy DVWCfOOEVsaf7CYdXatnpDb+0wUnZvzpQYLIGhMFAmomrzbtYQigG3TMyVZPBmjYT+BX xdsYtn/RdVerN2PfU9HPPszGSPc9fuiUiiHwznmZ+YaLDWrd1MMdrK/9mcCn/+vdaWZC kF6w== X-Gm-Message-State: APjAAAXmp/QKxDq6vRQj+gMWkYcEL9sXP5tC6LNOIwU0fYL095bUbzsF CWfE2rDXuppe3er9n6SciygcPp8UCjktsf42w0c= X-Received: by 2002:a17:90b:3109:: with SMTP id gc9mr7346216pjb.30.1575401260458; Tue, 03 Dec 2019 11:27:40 -0800 (PST) MIME-Version: 1.0 References: <1575349026-8743-1-git-send-email-srinath.mannam@broadcom.com> <1575349026-8743-3-git-send-email-srinath.mannam@broadcom.com> <20191203155514.GE18399@e119886-lin.cambridge.arm.com> In-Reply-To: <20191203155514.GE18399@e119886-lin.cambridge.arm.com> From: Andy Shevchenko Date: Tue, 3 Dec 2019 21:27:30 +0200 Message-ID: Subject: Re: [PATCH v3 2/6] PCI: iproc: Add INTx support with better modeling To: Andrew Murray Cc: Srinath Mannam , Lorenzo Pieralisi , Bjorn Helgaas , Florian Fainelli , Ray Jui , Rob Herring , Mark Rutland , Arnd Bergmann , bcm-kernel-feedback-list , linux-pci@vger.kernel.org, devicetree , linux-arm Mailing List , Linux Kernel Mailing List , Ray Jui Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 3, 2019 at 5:55 PM Andrew Murray wrote: > On Tue, Dec 03, 2019 at 10:27:02AM +0530, Srinath Mannam wrote: > > + /* go through INTx A, B, C, D until all interrupts are handled */ > > + do { > > + status = iproc_pcie_read_reg(pcie, IPROC_PCIE_INTX_CSR); > > By performing this read once and outside of the do/while loop you may improve > performance. I wonder how probable it is to get another INTx whilst handling > one? May I ask how it can be improved? One read will be needed any way, and so does this code. > > + for_each_set_bit(bit, &status, PCI_NUM_INTX) { > > + virq = irq_find_mapping(pcie->irq_domain, bit); > > + if (virq) > > + generic_handle_irq(virq); > > + else > > + dev_err(dev, "unexpected INTx%u\n", bit); > > + } > > + } while ((status & SYS_RC_INTX_MASK) != 0); -- With Best Regards, Andy Shevchenko