* [PATCH -next] PCI: altera: Replace TLP_REQ_ID() with macro PCI_DEVID()
@ 2024-08-28 10:42 Jinjie Ruan
2024-08-28 15:56 ` Manivannan Sadhasivam
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Jinjie Ruan @ 2024-08-28 10:42 UTC (permalink / raw)
To: joyce.ooi, lpieralisi, kw, manivannan.sadhasivam, robh, bhelgaas,
linux-pci, linux-kernel
Cc: ruanjinjie
The TLP_REQ_ID's function is same as current PCI_DEVID()
macro, replace it.
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
drivers/pci/controller/pcie-altera.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/pci/controller/pcie-altera.c b/drivers/pci/controller/pcie-altera.c
index ef73baefaeb9..650b2dd81c48 100644
--- a/drivers/pci/controller/pcie-altera.c
+++ b/drivers/pci/controller/pcie-altera.c
@@ -55,12 +55,11 @@
#define TLP_READ_TAG 0x1d
#define TLP_WRITE_TAG 0x10
#define RP_DEVFN 0
-#define TLP_REQ_ID(bus, devfn) (((bus) << 8) | (devfn))
#define TLP_CFG_DW0(pcie, cfg) \
(((cfg) << 24) | \
TLP_PAYLOAD_SIZE)
#define TLP_CFG_DW1(pcie, tag, be) \
- (((TLP_REQ_ID(pcie->root_bus_nr, RP_DEVFN)) << 16) | (tag << 8) | (be))
+ (((PCI_DEVID(pcie->root_bus_nr, RP_DEVFN)) << 16) | (tag << 8) | (be))
#define TLP_CFG_DW2(bus, devfn, offset) \
(((bus) << 24) | ((devfn) << 16) | (offset))
#define TLP_COMP_STATUS(s) (((s) >> 13) & 7)
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH -next] PCI: altera: Replace TLP_REQ_ID() with macro PCI_DEVID()
2024-08-28 10:42 [PATCH -next] PCI: altera: Replace TLP_REQ_ID() with macro PCI_DEVID() Jinjie Ruan
@ 2024-08-28 15:56 ` Manivannan Sadhasivam
2024-09-06 6:34 ` Krzysztof Wilczyński
2024-09-10 0:30 ` Bjorn Helgaas
2 siblings, 0 replies; 5+ messages in thread
From: Manivannan Sadhasivam @ 2024-08-28 15:56 UTC (permalink / raw)
To: Jinjie Ruan
Cc: joyce.ooi, lpieralisi, kw, robh, bhelgaas, linux-pci,
linux-kernel
On Wed, Aug 28, 2024 at 06:42:02PM +0800, Jinjie Ruan wrote:
> The TLP_REQ_ID's function is same as current PCI_DEVID()
> macro, replace it.
>
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
- Mani
> ---
> drivers/pci/controller/pcie-altera.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/pci/controller/pcie-altera.c b/drivers/pci/controller/pcie-altera.c
> index ef73baefaeb9..650b2dd81c48 100644
> --- a/drivers/pci/controller/pcie-altera.c
> +++ b/drivers/pci/controller/pcie-altera.c
> @@ -55,12 +55,11 @@
> #define TLP_READ_TAG 0x1d
> #define TLP_WRITE_TAG 0x10
> #define RP_DEVFN 0
> -#define TLP_REQ_ID(bus, devfn) (((bus) << 8) | (devfn))
> #define TLP_CFG_DW0(pcie, cfg) \
> (((cfg) << 24) | \
> TLP_PAYLOAD_SIZE)
> #define TLP_CFG_DW1(pcie, tag, be) \
> - (((TLP_REQ_ID(pcie->root_bus_nr, RP_DEVFN)) << 16) | (tag << 8) | (be))
> + (((PCI_DEVID(pcie->root_bus_nr, RP_DEVFN)) << 16) | (tag << 8) | (be))
> #define TLP_CFG_DW2(bus, devfn, offset) \
> (((bus) << 24) | ((devfn) << 16) | (offset))
> #define TLP_COMP_STATUS(s) (((s) >> 13) & 7)
> --
> 2.34.1
>
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH -next] PCI: altera: Replace TLP_REQ_ID() with macro PCI_DEVID()
2024-08-28 10:42 [PATCH -next] PCI: altera: Replace TLP_REQ_ID() with macro PCI_DEVID() Jinjie Ruan
2024-08-28 15:56 ` Manivannan Sadhasivam
@ 2024-09-06 6:34 ` Krzysztof Wilczyński
2024-09-10 0:30 ` Bjorn Helgaas
2 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Wilczyński @ 2024-09-06 6:34 UTC (permalink / raw)
To: Jinjie Ruan
Cc: joyce.ooi, lpieralisi, manivannan.sadhasivam, robh, bhelgaas,
linux-pci, linux-kernel
Hello,
> The TLP_REQ_ID's function is same as current PCI_DEVID()
> macro, replace it.
Applied to controller/altera, thank you!
[1/1] PCI: altera: Replace TLP_REQ_ID() with macro PCI_DEVID()"
https://git.kernel.org/pci/pci/c/8745aaab60a6
Krzysztof
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH -next] PCI: altera: Replace TLP_REQ_ID() with macro PCI_DEVID()
2024-08-28 10:42 [PATCH -next] PCI: altera: Replace TLP_REQ_ID() with macro PCI_DEVID() Jinjie Ruan
2024-08-28 15:56 ` Manivannan Sadhasivam
2024-09-06 6:34 ` Krzysztof Wilczyński
@ 2024-09-10 0:30 ` Bjorn Helgaas
2024-09-10 19:12 ` Krzysztof Wilczyński
2 siblings, 1 reply; 5+ messages in thread
From: Bjorn Helgaas @ 2024-09-10 0:30 UTC (permalink / raw)
To: Jinjie Ruan
Cc: joyce.ooi, lpieralisi, kw, manivannan.sadhasivam, robh, bhelgaas,
linux-pci, linux-kernel
On Wed, Aug 28, 2024 at 06:42:02PM +0800, Jinjie Ruan wrote:
> The TLP_REQ_ID's function is same as current PCI_DEVID()
> macro, replace it.
>
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
> ---
> drivers/pci/controller/pcie-altera.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/pci/controller/pcie-altera.c b/drivers/pci/controller/pcie-altera.c
> index ef73baefaeb9..650b2dd81c48 100644
> --- a/drivers/pci/controller/pcie-altera.c
> +++ b/drivers/pci/controller/pcie-altera.c
> @@ -55,12 +55,11 @@
> #define TLP_READ_TAG 0x1d
> #define TLP_WRITE_TAG 0x10
> #define RP_DEVFN 0
> -#define TLP_REQ_ID(bus, devfn) (((bus) << 8) | (devfn))
> #define TLP_CFG_DW0(pcie, cfg) \
> (((cfg) << 24) | \
> TLP_PAYLOAD_SIZE)
> #define TLP_CFG_DW1(pcie, tag, be) \
> - (((TLP_REQ_ID(pcie->root_bus_nr, RP_DEVFN)) << 16) | (tag << 8) | (be))
> + (((PCI_DEVID(pcie->root_bus_nr, RP_DEVFN)) << 16) | (tag << 8) | (be))
This doesn't cause a problem per se, but PCI_DEVID() is defined
basically as a PCI core convenience without any particular connection
to the PCIe Requester ID format, so I don't think this is an
improvement.
I think it *would* be an improvement to move TLP_REQ_ID() to
drivers/pci/pci.h, where other drivers could share it.
It's obvious how the Requester ID must be laid out, but I took a quick
look through the PCIe spec and was surprised that I couldn't find a
clear definition of it, unlike the *Completer ID*, which is specified
in PCIe r6.0, sec 2.2.9.1.
Bjorn
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH -next] PCI: altera: Replace TLP_REQ_ID() with macro PCI_DEVID()
2024-09-10 0:30 ` Bjorn Helgaas
@ 2024-09-10 19:12 ` Krzysztof Wilczyński
0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Wilczyński @ 2024-09-10 19:12 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Jinjie Ruan, joyce.ooi, lpieralisi, manivannan.sadhasivam, robh,
bhelgaas, linux-pci, linux-kernel
Hello,
[...]
> > #define TLP_READ_TAG 0x1d
> > #define TLP_WRITE_TAG 0x10
> > #define RP_DEVFN 0
> > -#define TLP_REQ_ID(bus, devfn) (((bus) << 8) | (devfn))
> > #define TLP_CFG_DW0(pcie, cfg) \
> > (((cfg) << 24) | \
> > TLP_PAYLOAD_SIZE)
> > #define TLP_CFG_DW1(pcie, tag, be) \
> > - (((TLP_REQ_ID(pcie->root_bus_nr, RP_DEVFN)) << 16) | (tag << 8) | (be))
> > + (((PCI_DEVID(pcie->root_bus_nr, RP_DEVFN)) << 16) | (tag << 8) | (be))
>
> This doesn't cause a problem per se, but PCI_DEVID() is defined
> basically as a PCI core convenience without any particular connection
> to the PCIe Requester ID format, so I don't think this is an
> improvement.
I will drop this patch based on feedback from Bjorn.
Krzysztof
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-09-10 19:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-28 10:42 [PATCH -next] PCI: altera: Replace TLP_REQ_ID() with macro PCI_DEVID() Jinjie Ruan
2024-08-28 15:56 ` Manivannan Sadhasivam
2024-09-06 6:34 ` Krzysztof Wilczyński
2024-09-10 0:30 ` Bjorn Helgaas
2024-09-10 19:12 ` Krzysztof Wilczyński
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox