From: Bjorn Helgaas <helgaas@kernel.org>
To: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: lpieralisi@kernel.org, robh+dt@kernel.org, kw@linux.com,
bhelgaas@google.com, krzk+dt@kernel.org,
marek.vasut+renesas@gmail.com, linux-pci@vger.kernel.org,
devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v7 7/9] PCI: rcar-gen4: Add R-Car Gen4 PCIe Host support
Date: Tue, 22 Nov 2022 09:04:37 -0600 [thread overview]
Message-ID: <20221122150437.GA187129@bhelgaas> (raw)
In-Reply-To: <20221121124400.1282768-8-yoshihiro.shimoda.uh@renesas.com>
On Mon, Nov 21, 2022 at 09:43:58PM +0900, Yoshihiro Shimoda wrote:
> Add R-Car Gen4 PCIe Host support. This controller is based on
> Synopsys DesignWare PCIe.
>
> This controller doesn't support MSI-X interrupt. So, introduce
> no_msix flag in struct dw_pcie_host_ops to clear MSI_FLAG_PCI_MSIX
> from dw_pcie_msi_domain_info.
> + /* Enable L1 Substates */
> + val = dw_pcie_readl_dbi(dw, L1PSCAP(PCI_L1SS_CTL1));
> + val &= ~PCI_L1SS_CTL1_L1SS_MASK;
> + val |= PCI_L1SS_CTL1_PCIPM_L1_2 | PCI_L1SS_CTL1_PCIPM_L1_1 |
> + PCI_L1SS_CTL1_ASPM_L1_2 | PCI_L1SS_CTL1_ASPM_L1_1;
> + dw_pcie_writel_dbi(dw, L1PSCAP(PCI_L1SS_CTL1), val);
This seems like something that ought to be done by the PCI core in
pcie/aspm.c. L1.2 also depends on LTR being supported and configured.
If it needs to be enabled here, can you expand the comment to say why
and how LTR is being configured?
> + rcar_gen4_pcie_disable_bar(dw, BAR0MASKF);
> + rcar_gen4_pcie_disable_bar(dw, BAR1MASKF);
> +
> + /* Set Root Control */
> + val = dw_pcie_readl_dbi(dw, EXPCAP(PCI_EXP_RTCTL));
> + val |= PCI_EXP_RTCTL_SECEE | PCI_EXP_RTCTL_SENFEE |
> + PCI_EXP_RTCTL_SEFEE | PCI_EXP_RTCTL_PMEIE |
> + PCI_EXP_RTCTL_CRSSVE;
> + dw_pcie_writel_dbi(dw, EXPCAP(PCI_EXP_RTCTL), val);
> +
> + /* Set Interrupt Disable, SERR# Enable, Parity Error Response */
> + val = dw_pcie_readl_dbi(dw, PCI_COMMAND);
> + val |= PCI_COMMAND_PARITY | PCI_COMMAND_SERR |
> + PCI_COMMAND_INTX_DISABLE;
> + dw_pcie_writel_dbi(dw, PCI_COMMAND, val);
> +
> + /* Enable SERR */
> + val = dw_pcie_readb_dbi(dw, PCI_BRIDGE_CONTROL);
> + val |= PCI_BRIDGE_CTL_SERR;
> + dw_pcie_writeb_dbi(dw, PCI_BRIDGE_CONTROL, val);
> +
> + /* Device control */
> + val = dw_pcie_readl_dbi(dw, EXPCAP(PCI_EXP_DEVCTL));
> + val |= PCI_EXP_DEVCTL_CERE | PCI_EXP_DEVCTL_NFERE |
> + PCI_EXP_DEVCTL_FERE | PCI_EXP_DEVCTL_URRE;
> + dw_pcie_writel_dbi(dw, EXPCAP(PCI_EXP_DEVCTL), val);
The above also looks like things that should be configured by the PCI
core.
> + dev_err(&pdev->dev, "Failed to initialize host\n");
> + dev_err(dev, "failed to request resource: %d\n", err);
Pick a capitalization style.
> + dev_err(dev, "%s: failed to resume/get Runtime PM\n", __func__);
The driver name + device ID + message text printed by dev_err() should
be enough that __func__ isn't needed.
Bjorn
next prev parent reply other threads:[~2022-11-22 15:04 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-21 12:43 [PATCH v7 0/9] PCI: rcar-gen4: Add R-Car Gen4 PCIe support Yoshihiro Shimoda
2022-11-21 12:43 ` [PATCH v7 1/9] dt-bindings: PCI: renesas: Add R-Car Gen4 PCIe Host Yoshihiro Shimoda
2022-11-21 12:43 ` [PATCH v7 2/9] dt-bindings: PCI: renesas: Add R-Car Gen4 PCIe Endpoint Yoshihiro Shimoda
2022-11-21 12:43 ` [PATCH v7 3/9] PCI: Add PCI_EXP_LNKCAP_MLW macros Yoshihiro Shimoda
2022-11-21 12:43 ` [PATCH v7 4/9] PCI: designware-ep: Expose dw_pcie_ep_exit() to module Yoshihiro Shimoda
2022-11-21 12:43 ` [PATCH v7 5/9] PCI: dwc: Avoid reading a register to detect whether eDMA exists Yoshihiro Shimoda
2022-11-22 13:55 ` Manivannan Sadhasivam
2022-11-27 23:55 ` Serge Semin
2022-11-28 2:52 ` Yoshihiro Shimoda
2022-11-28 11:59 ` Serge Semin
2022-11-28 12:41 ` Yoshihiro Shimoda
2022-11-28 16:11 ` Serge Semin
2022-11-29 0:21 ` Yoshihiro Shimoda
2022-12-08 12:26 ` Yoshihiro Shimoda
2022-12-08 14:01 ` Serge Semin
2022-12-09 7:45 ` Yoshihiro Shimoda
[not found] ` <HE1PR0401MB23319A9F4AF7630A82249D65881C9@HE1PR0401MB2331.eurprd04.prod.outlook.com>
2022-12-11 15:28 ` [EXT] " Serge Semin
2022-12-12 12:56 ` Manivannan Sadhasivam
2022-12-12 16:56 ` Serge Semin
2022-12-12 17:11 ` Manivannan Sadhasivam
2022-12-13 23:11 ` Serge Semin
2022-11-21 12:43 ` [PATCH v7 6/9] PCI: dwc: Add support for triggering legacy IRQs Yoshihiro Shimoda
2022-11-21 12:43 ` [PATCH v7 7/9] PCI: rcar-gen4: Add R-Car Gen4 PCIe Host support Yoshihiro Shimoda
2022-11-22 15:04 ` Bjorn Helgaas [this message]
2022-11-25 11:37 ` Yoshihiro Shimoda
2022-11-21 12:43 ` [PATCH v7 8/9] PCI: rcar-gen4-ep: Add R-Car Gen4 PCIe Endpoint support Yoshihiro Shimoda
2022-11-21 12:44 ` [PATCH v7 9/9] MAINTAINERS: Update PCI DRIVER FOR RENESAS R-CAR for R-Car Gen4 Yoshihiro Shimoda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221122150437.GA187129@bhelgaas \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kw@linux.com \
--cc=linux-pci@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=marek.vasut+renesas@gmail.com \
--cc=robh+dt@kernel.org \
--cc=yoshihiro.shimoda.uh@renesas.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).