devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Elad Nachman <enachman@marvell.com>
Cc: thomas.petazzoni@bootlin.com, bhelgaas@google.com,
	lpieralisi@kernel.org, robh@kernel.org, kw@linux.com,
	krzysztof.kozlowski+dt@linaro.org, linux-pci@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, Raz Adashi <raza@marvell.com>
Subject: Re: [PATCH v4 2/8] PCI: armada8k: Add AC5 SoC support
Date: Mon, 13 Mar 2023 14:43:49 -0500	[thread overview]
Message-ID: <20230313194349.GA1529210@bhelgaas> (raw)
In-Reply-To: <20230313124016.17102-3-enachman@marvell.com>

On Mon, Mar 13, 2023 at 02:40:10PM +0200, Elad Nachman wrote:
> From: Raz Adashi <raza@marvell.com>
> 
> pcie-armada8k driver is utilized to serve also AC5.
> 
> Driver assumes interrupt mask registers are located
> in the same address inboth CPUs. This assumption is
> incorrect - fix it for AC5.

s/inboth/in both/

Rewrap to fill 75 columns.

> +#define PCIE_VENDOR_REGS_OFFSET		0x8000	/* in ac5 is 0x10000 */

Don't add this comment in patch [2/8] and then update it in patch
[6/8].  Make it what you want the first time.  Also nice if you make
it fit in 80 columns like the rest of the file.

> -static const struct dw_pcie_ops dw_pcie_ops = {
> +static u32 ac5_xlate_dbi_reg(u32 reg)
> +{
> +	/* Handle AC5 ATU access */
> +	if ((reg & ~0xfffff) == PCIE_ATU_ACCESS_MASK_AC5) {
> +		reg &= 0xfffff;
> +		/* ATU registers offset is 0xC00 + 0x200 * n,
> +		 * from RFU registers.
> +		 */
> +		reg = 0xc000 | (0x200 * (reg >> 9)) | (reg & 0xff);
> +	} else if ((reg & 0xfffff000) == PCIE_VENDOR_REGS_OFFSET) {
> +		/* PCIe RFU registers in A8K are at offset 0x8000 from base
> +		 * (0xf2600000) while in AC5 offset is 0x10000 from base
> +		 * (0x800a0000) therefore need the addition of 0x8000.
> +		 */
> +		reg += PCIE_VENDOR_REGS_OFFSET;

This is a hidden assumption that the AC5 offset (0x10000) happens to
be twice PCIE_VENDOR_REGS_OFFSET (0x8000).  I think the AC5 offset
deserves its own separate #define.

Use the conventional multi-line comment style:

  /*
   * ...
   */

> +	pci->ops = data->pcie_ops;
>  	pci->dev = dev;
> -	pci->ops = &dw_pcie_ops;

The diff is easier to read if you don't move the "pci->ops ="
assignment.  Move it if there's a *reason* to move it, but leave it
at the same spot otherwise.

  reply	other threads:[~2023-03-13 19:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-13 12:40 [PATCH v4 0/8] PCI: dwc: Add support for Marvell AC5 SoC Elad Nachman
2023-03-13 12:40 ` [PATCH v4 1/8] dt-bindings: PCI: armada8k: Add compatible string for " Elad Nachman
2023-03-13 12:40 ` [PATCH v4 2/8] PCI: armada8k: Add AC5 SoC support Elad Nachman
2023-03-13 19:43   ` Bjorn Helgaas [this message]
2023-03-22 23:19   ` Serge Semin
2023-03-13 12:40 ` [PATCH v4 3/8] PCI: armada8k: Add AC5 MSI support Elad Nachman
2023-03-22 23:23   ` Serge Semin
2023-03-13 12:40 ` [PATCH v4 4/8] dt-bindings: PCI: dwc: Add dma-ranges, region mask Elad Nachman
2023-03-17 18:30   ` Rob Herring
2023-03-13 12:40 ` [PATCH v4 5/8] PCI: armada8k: support AC5 INTx PCIe interrupts Elad Nachman
2023-03-13 12:40 ` [PATCH v4 6/8] PCI: armada8k: support reg regions according to DT Elad Nachman
2023-03-13 12:40 ` [PATCH v4 7/8] PCI: dwc: Introduce configurable DMA mask Elad Nachman
2023-03-17 18:23   ` Rob Herring
2023-03-27 17:01     ` Robin Murphy
2023-03-13 12:40 ` [PATCH v4 8/8] PCI: dwc: Introduce region limit from DT Elad Nachman
2023-03-13 19:48   ` Bjorn Helgaas
2023-03-14 20:48     ` Serge Semin
2023-03-23  0:11   ` Serge Semin
2023-03-13 19:22 ` [PATCH v4 0/8] PCI: dwc: Add support for Marvell AC5 SoC Bjorn Helgaas

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=20230313194349.GA1529210@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=enachman@marvell.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kw@linux.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=raza@marvell.com \
    --cc=robh@kernel.org \
    --cc=thomas.petazzoni@bootlin.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).