* [PATCH] accel/ivpu: Remove D3hot delay for Meteorlake
@ 2023-03-31 11:40 Stanislaw Gruszka
2023-03-31 19:26 ` Bjorn Helgaas
0 siblings, 1 reply; 3+ messages in thread
From: Stanislaw Gruszka @ 2023-03-31 11:40 UTC (permalink / raw)
To: dri-devel
Cc: Oded Gabbay, Jacek Lawrynowicz, Jeffrey Hugo, linux-pci,
Karol Wachowski, Stanislaw Gruszka
From: Karol Wachowski <karol.wachowski@linux.intel.com>
VPU on MTL has hardware optimizations and does not require 10ms
D0 - D3hot transition delay imposed by PCI specification.
The delay removal is traditionally done by adding PCI ID to
quirk_remove_dhot_delay() in drivers/pci/quirks.c . But since
we do not need that optimization before driver probe and we
can better specify in the ivpu driver on what (future) hardware
use the optimization, we do not use quirk_remove_dhot_delay()
for that.
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
---
drivers/accel/ivpu/ivpu_drv.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/accel/ivpu/ivpu_drv.c b/drivers/accel/ivpu/ivpu_drv.c
index 3be4a5a2b07a..cf9925c0a8ad 100644
--- a/drivers/accel/ivpu/ivpu_drv.c
+++ b/drivers/accel/ivpu/ivpu_drv.c
@@ -442,6 +442,10 @@ static int ivpu_pci_init(struct ivpu_device *vdev)
/* Clear any pending errors */
pcie_capability_clear_word(pdev, PCI_EXP_DEVSTA, 0x3f);
+ /* VPU MTL does not require PCI spec 10m D3hot delay */
+ if (ivpu_is_mtl(vdev))
+ pdev->d3hot_delay = 0;
+
ret = pcim_enable_device(pdev);
if (ret) {
ivpu_err(vdev, "Failed to enable PCI device: %d\n", ret);
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] accel/ivpu: Remove D3hot delay for Meteorlake
2023-03-31 11:40 [PATCH] accel/ivpu: Remove D3hot delay for Meteorlake Stanislaw Gruszka
@ 2023-03-31 19:26 ` Bjorn Helgaas
2023-04-03 12:10 ` Stanislaw Gruszka
0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Helgaas @ 2023-03-31 19:26 UTC (permalink / raw)
To: Stanislaw Gruszka
Cc: dri-devel, Oded Gabbay, Jacek Lawrynowicz, Jeffrey Hugo,
linux-pci, Karol Wachowski
On Fri, Mar 31, 2023 at 01:40:27PM +0200, Stanislaw Gruszka wrote:
> From: Karol Wachowski <karol.wachowski@linux.intel.com>
>
> VPU on MTL has hardware optimizations and does not require 10ms
> D0 - D3hot transition delay imposed by PCI specification.
PCIe r6.0, sec 5.9.
> The delay removal is traditionally done by adding PCI ID to
> quirk_remove_dhot_delay() in drivers/pci/quirks.c . But since
quirk_remove_d3hot_delay()
> we do not need that optimization before driver probe and we
> can better specify in the ivpu driver on what (future) hardware
> use the optimization, we do not use quirk_remove_dhot_delay()
Again.
> for that.
>
> Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
> Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
> ---
> drivers/accel/ivpu/ivpu_drv.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/accel/ivpu/ivpu_drv.c b/drivers/accel/ivpu/ivpu_drv.c
> index 3be4a5a2b07a..cf9925c0a8ad 100644
> --- a/drivers/accel/ivpu/ivpu_drv.c
> +++ b/drivers/accel/ivpu/ivpu_drv.c
> @@ -442,6 +442,10 @@ static int ivpu_pci_init(struct ivpu_device *vdev)
> /* Clear any pending errors */
> pcie_capability_clear_word(pdev, PCI_EXP_DEVSTA, 0x3f);
>
> + /* VPU MTL does not require PCI spec 10m D3hot delay */
> + if (ivpu_is_mtl(vdev))
> + pdev->d3hot_delay = 0;
d3hot_delay is used after a D0->D3hot transition, after a D3hot->D0
transition, and after the D0->D3hot and D3hot->D0 transitions in
pci_pm_reset().
I assume this device can tolerate removing *all* of those delays,
right?
> ret = pcim_enable_device(pdev);
> if (ret) {
> ivpu_err(vdev, "Failed to enable PCI device: %d\n", ret);
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] accel/ivpu: Remove D3hot delay for Meteorlake
2023-03-31 19:26 ` Bjorn Helgaas
@ 2023-04-03 12:10 ` Stanislaw Gruszka
0 siblings, 0 replies; 3+ messages in thread
From: Stanislaw Gruszka @ 2023-04-03 12:10 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Jeffrey Hugo, linux-pci, Oded Gabbay, dri-devel, Karol Wachowski,
Jacek Lawrynowicz
On Fri, Mar 31, 2023 at 02:26:04PM -0500, Bjorn Helgaas wrote:
> On Fri, Mar 31, 2023 at 01:40:27PM +0200, Stanislaw Gruszka wrote:
> > From: Karol Wachowski <karol.wachowski@linux.intel.com>
> >
> > VPU on MTL has hardware optimizations and does not require 10ms
> > D0 - D3hot transition delay imposed by PCI specification.
>
> PCIe r6.0, sec 5.9.
>
> > The delay removal is traditionally done by adding PCI ID to
> > quirk_remove_dhot_delay() in drivers/pci/quirks.c . But since
>
> quirk_remove_d3hot_delay()
>
> > we do not need that optimization before driver probe and we
> > can better specify in the ivpu driver on what (future) hardware
> > use the optimization, we do not use quirk_remove_dhot_delay()
>
> Again.
I Will fix the commit message in v2.
> > for that.
> >
> > Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
> > Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
> > ---
> > drivers/accel/ivpu/ivpu_drv.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/accel/ivpu/ivpu_drv.c b/drivers/accel/ivpu/ivpu_drv.c
> > index 3be4a5a2b07a..cf9925c0a8ad 100644
> > --- a/drivers/accel/ivpu/ivpu_drv.c
> > +++ b/drivers/accel/ivpu/ivpu_drv.c
> > @@ -442,6 +442,10 @@ static int ivpu_pci_init(struct ivpu_device *vdev)
> > /* Clear any pending errors */
> > pcie_capability_clear_word(pdev, PCI_EXP_DEVSTA, 0x3f);
> >
> > + /* VPU MTL does not require PCI spec 10m D3hot delay */
> > + if (ivpu_is_mtl(vdev))
> > + pdev->d3hot_delay = 0;
>
> d3hot_delay is used after a D0->D3hot transition, after a D3hot->D0
> transition, and after the D0->D3hot and D3hot->D0 transitions in
> pci_pm_reset().
>
> I assume this device can tolerate removing *all* of those delays,
> right?
Yes.
Regards
Stanislaw
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-04-03 12:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-31 11:40 [PATCH] accel/ivpu: Remove D3hot delay for Meteorlake Stanislaw Gruszka
2023-03-31 19:26 ` Bjorn Helgaas
2023-04-03 12:10 ` Stanislaw Gruszka
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).