* [PATCH v2 0/4] IPU6 and IPU7 driver fixes
@ 2025-12-22 7:06 bingbu.cao
2025-12-22 7:06 ` [PATCH v2 1/4] media: staging/ipu7: ignore interrupts when device is suspended bingbu.cao
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: bingbu.cao @ 2025-12-22 7:06 UTC (permalink / raw)
To: linux-media, sakari.ailus
Cc: bingbu.cao, bingbu.cao, antti.laakso, mehdi.djait
From: Bingbu Cao <bingbu.cao@intel.com>
This patchsets contains some fixes for IPU7 driver, and
also cover a code cleanup for IPU6 driver. It also update
the CPHY settings for IPU7 according to the PHY specification
update.
---
v2: fix build warning: ‘cap_prog’ may be used uninitialized
---
Bingbu Cao (4):
media: staging/ipu7: ignore interrupts when device is suspended
media: staging/ipu7: call synchronous RPM suspend in probe failure
media: ipu7: update CDPHY register settings
media: ipu6/7: fix typo and coding errors in IPU mmu driver
drivers/media/pci/intel/ipu6/ipu6-mmu.c | 4 ++--
drivers/staging/media/ipu7/ipu7-buttress.c | 12 ++++++++++--
drivers/staging/media/ipu7/ipu7-isys-csi-phy.c | 13 ++++++++++---
drivers/staging/media/ipu7/ipu7-mmu.c | 2 +-
drivers/staging/media/ipu7/ipu7.c | 6 +++++-
5 files changed, 28 insertions(+), 9 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 12+ messages in thread* [PATCH v2 1/4] media: staging/ipu7: ignore interrupts when device is suspended 2025-12-22 7:06 [PATCH v2 0/4] IPU6 and IPU7 driver fixes bingbu.cao @ 2025-12-22 7:06 ` bingbu.cao 2025-12-22 8:43 ` Sakari Ailus 2025-12-22 7:06 ` [PATCH v2 2/4] media: staging/ipu7: call synchronous RPM suspend in probe failure bingbu.cao ` (2 subsequent siblings) 3 siblings, 1 reply; 12+ messages in thread From: bingbu.cao @ 2025-12-22 7:06 UTC (permalink / raw) To: linux-media, sakari.ailus Cc: bingbu.cao, bingbu.cao, antti.laakso, mehdi.djait From: Bingbu Cao <bingbu.cao@intel.com> IPU7 devices have shared interrupts with others. In some case when IPU7 device is suspended, driver get unexpected interrupt and invalid irq status 0xffffffff from ISR_STATUS and PB LOCAL_STATUS registers as interrupt is triggered from other device on shared irq line. In order to avoid this issue use pm_runtime_get_if_active() to check if IPU7 device is resumed, ignore the invalid irq status and use synchronize_irq() in suspend. Cc: Stable@vger.kernel.org Fixes: b7fe4c0019b1 ("media: staging/ipu7: add Intel IPU7 PCI device driver") Signed-off-by: Bingbu Cao <bingbu.cao@intel.com> --- drivers/staging/media/ipu7/ipu7-buttress.c | 12 ++++++++++-- drivers/staging/media/ipu7/ipu7.c | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/ipu7/ipu7-buttress.c b/drivers/staging/media/ipu7/ipu7-buttress.c index e5707f5e300b..e4328cafe91d 100644 --- a/drivers/staging/media/ipu7/ipu7-buttress.c +++ b/drivers/staging/media/ipu7/ipu7-buttress.c @@ -342,14 +342,22 @@ irqreturn_t ipu_buttress_isr(int irq, void *isp_ptr) u32 disable_irqs = 0; u32 irq_status; unsigned int i; + int active; - pm_runtime_get_noresume(dev); + active = pm_runtime_get_if_active(dev); + if (active <= 0) + return IRQ_NONE; pb_irq = readl(isp->pb_base + INTERRUPT_STATUS); writel(pb_irq, isp->pb_base + INTERRUPT_STATUS); /* check btrs ATS, CFI and IMR errors, BIT(0) is unused for IPU */ pb_local_irq = readl(isp->pb_base + BTRS_LOCAL_INTERRUPT_MASK); + if (WARN_ON_ONCE(pb_local_irq == 0xffffffff)) { + pm_runtime_put_noidle(dev); + return IRQ_NONE; + } + if (pb_local_irq & ~BIT(0)) { dev_warn(dev, "PB interrupt status 0x%x local 0x%x\n", pb_irq, pb_local_irq); @@ -365,7 +373,7 @@ irqreturn_t ipu_buttress_isr(int irq, void *isp_ptr) } irq_status = readl(isp->base + BUTTRESS_REG_IRQ_STATUS); - if (!irq_status) { + if (!irq_status || WARN_ON_ONCE(irq_status == 0xffffffff)) { pm_runtime_put_noidle(dev); return IRQ_NONE; } diff --git a/drivers/staging/media/ipu7/ipu7.c b/drivers/staging/media/ipu7/ipu7.c index 5cddc09c72bf..6c8c3eea44ac 100644 --- a/drivers/staging/media/ipu7/ipu7.c +++ b/drivers/staging/media/ipu7/ipu7.c @@ -2684,6 +2684,10 @@ static void ipu7_pci_reset_done(struct pci_dev *pdev) */ static int ipu7_suspend(struct device *dev) { + struct pci_dev *pdev = to_pci_dev(dev); + + synchronize_irq(pdev->irq); + return 0; } -- 2.34.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v2 1/4] media: staging/ipu7: ignore interrupts when device is suspended 2025-12-22 7:06 ` [PATCH v2 1/4] media: staging/ipu7: ignore interrupts when device is suspended bingbu.cao @ 2025-12-22 8:43 ` Sakari Ailus 2025-12-22 9:56 ` Bingbu Cao 0 siblings, 1 reply; 12+ messages in thread From: Sakari Ailus @ 2025-12-22 8:43 UTC (permalink / raw) To: bingbu.cao; +Cc: linux-media, bingbu.cao, antti.laakso, mehdi.djait Hi Bingbu, On Mon, Dec 22, 2025 at 03:06:26PM +0800, bingbu.cao@intel.com wrote: > From: Bingbu Cao <bingbu.cao@intel.com> > > IPU7 devices have shared interrupts with others. In some case when > IPU7 device is suspended, driver get unexpected interrupt and invalid > irq status 0xffffffff from ISR_STATUS and PB LOCAL_STATUS > registers as interrupt is triggered from other device on shared > irq line. > > In order to avoid this issue use pm_runtime_get_if_active() to check > if IPU7 device is resumed, ignore the invalid irq status and use > synchronize_irq() in suspend. > > Cc: Stable@vger.kernel.org > Fixes: b7fe4c0019b1 ("media: staging/ipu7: add Intel IPU7 PCI device driver") > Signed-off-by: Bingbu Cao <bingbu.cao@intel.com> > --- > drivers/staging/media/ipu7/ipu7-buttress.c | 12 ++++++++++-- > drivers/staging/media/ipu7/ipu7.c | 4 ++++ > 2 files changed, 14 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/media/ipu7/ipu7-buttress.c b/drivers/staging/media/ipu7/ipu7-buttress.c > index e5707f5e300b..e4328cafe91d 100644 > --- a/drivers/staging/media/ipu7/ipu7-buttress.c > +++ b/drivers/staging/media/ipu7/ipu7-buttress.c > @@ -342,14 +342,22 @@ irqreturn_t ipu_buttress_isr(int irq, void *isp_ptr) > u32 disable_irqs = 0; > u32 irq_status; > unsigned int i; > + int active; > > - pm_runtime_get_noresume(dev); > + active = pm_runtime_get_if_active(dev); > + if (active <= 0) > + return IRQ_NONE; > > pb_irq = readl(isp->pb_base + INTERRUPT_STATUS); > writel(pb_irq, isp->pb_base + INTERRUPT_STATUS); > > /* check btrs ATS, CFI and IMR errors, BIT(0) is unused for IPU */ > pb_local_irq = readl(isp->pb_base + BTRS_LOCAL_INTERRUPT_MASK); > + if (WARN_ON_ONCE(pb_local_irq == 0xffffffff)) { > + pm_runtime_put_noidle(dev); > + return IRQ_NONE; > + } > + > if (pb_local_irq & ~BIT(0)) { > dev_warn(dev, "PB interrupt status 0x%x local 0x%x\n", pb_irq, > pb_local_irq); > @@ -365,7 +373,7 @@ irqreturn_t ipu_buttress_isr(int irq, void *isp_ptr) > } > > irq_status = readl(isp->base + BUTTRESS_REG_IRQ_STATUS); > - if (!irq_status) { > + if (!irq_status || WARN_ON_ONCE(irq_status == 0xffffffff)) { > pm_runtime_put_noidle(dev); > return IRQ_NONE; Doesn't this apply to the ipu6 driver as well? E.g. on my Alder lake system the interrupt is shared with i801_smbus and processor_thermal_device_pci. It may be no interrupts are generated by those devices at inconvenient times for ipu6, but the ipu driver can't assume that. Is the WARN_ON_ONCE() necessary? I'd use dev_warn_once() here if you'd like to write a message to the log. > } > diff --git a/drivers/staging/media/ipu7/ipu7.c b/drivers/staging/media/ipu7/ipu7.c > index 5cddc09c72bf..6c8c3eea44ac 100644 > --- a/drivers/staging/media/ipu7/ipu7.c > +++ b/drivers/staging/media/ipu7/ipu7.c > @@ -2684,6 +2684,10 @@ static void ipu7_pci_reset_done(struct pci_dev *pdev) > */ > static int ipu7_suspend(struct device *dev) > { > + struct pci_dev *pdev = to_pci_dev(dev); > + > + synchronize_irq(pdev->irq); > + > return 0; > } > -- Kind regards, Sakari Ailus ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 1/4] media: staging/ipu7: ignore interrupts when device is suspended 2025-12-22 8:43 ` Sakari Ailus @ 2025-12-22 9:56 ` Bingbu Cao 0 siblings, 0 replies; 12+ messages in thread From: Bingbu Cao @ 2025-12-22 9:56 UTC (permalink / raw) To: Sakari Ailus, bingbu.cao; +Cc: linux-media, antti.laakso, mehdi.djait Sakari, Thanks for the review. On 12/22/25 4:43 PM, Sakari Ailus wrote: > Hi Bingbu, > > On Mon, Dec 22, 2025 at 03:06:26PM +0800, bingbu.cao@intel.com wrote: >> From: Bingbu Cao <bingbu.cao@intel.com> >> >> IPU7 devices have shared interrupts with others. In some case when >> IPU7 device is suspended, driver get unexpected interrupt and invalid >> irq status 0xffffffff from ISR_STATUS and PB LOCAL_STATUS >> registers as interrupt is triggered from other device on shared >> irq line. >> >> In order to avoid this issue use pm_runtime_get_if_active() to check >> if IPU7 device is resumed, ignore the invalid irq status and use >> synchronize_irq() in suspend. >> >> Cc: Stable@vger.kernel.org >> Fixes: b7fe4c0019b1 ("media: staging/ipu7: add Intel IPU7 PCI device driver") >> Signed-off-by: Bingbu Cao <bingbu.cao@intel.com> >> --- >> drivers/staging/media/ipu7/ipu7-buttress.c | 12 ++++++++++-- >> drivers/staging/media/ipu7/ipu7.c | 4 ++++ >> 2 files changed, 14 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/staging/media/ipu7/ipu7-buttress.c b/drivers/staging/media/ipu7/ipu7-buttress.c >> index e5707f5e300b..e4328cafe91d 100644 >> --- a/drivers/staging/media/ipu7/ipu7-buttress.c >> +++ b/drivers/staging/media/ipu7/ipu7-buttress.c >> @@ -342,14 +342,22 @@ irqreturn_t ipu_buttress_isr(int irq, void *isp_ptr) >> u32 disable_irqs = 0; >> u32 irq_status; >> unsigned int i; >> + int active; >> >> - pm_runtime_get_noresume(dev); >> + active = pm_runtime_get_if_active(dev); >> + if (active <= 0) >> + return IRQ_NONE; >> >> pb_irq = readl(isp->pb_base + INTERRUPT_STATUS); >> writel(pb_irq, isp->pb_base + INTERRUPT_STATUS); >> >> /* check btrs ATS, CFI and IMR errors, BIT(0) is unused for IPU */ >> pb_local_irq = readl(isp->pb_base + BTRS_LOCAL_INTERRUPT_MASK); >> + if (WARN_ON_ONCE(pb_local_irq == 0xffffffff)) { >> + pm_runtime_put_noidle(dev); >> + return IRQ_NONE; >> + } >> + >> if (pb_local_irq & ~BIT(0)) { >> dev_warn(dev, "PB interrupt status 0x%x local 0x%x\n", pb_irq, >> pb_local_irq); >> @@ -365,7 +373,7 @@ irqreturn_t ipu_buttress_isr(int irq, void *isp_ptr) >> } >> >> irq_status = readl(isp->base + BUTTRESS_REG_IRQ_STATUS); >> - if (!irq_status) { >> + if (!irq_status || WARN_ON_ONCE(irq_status == 0xffffffff)) { >> pm_runtime_put_noidle(dev); >> return IRQ_NONE; > > Doesn't this apply to the ipu6 driver as well? E.g. on my Alder lake system > the interrupt is shared with i801_smbus and processor_thermal_device_pci. > It may be no interrupts are generated by those devices at inconvenient > times for ipu6, but the ipu driver can't assume that. I remember that Stanislaw made a fix for IPU6. > > Is the WARN_ON_ONCE() necessary? I'd use dev_warn_once() here if you'd like > to write a message to the log. > I will update that, dev_warn_once() makes more sense. >> } >> diff --git a/drivers/staging/media/ipu7/ipu7.c b/drivers/staging/media/ipu7/ipu7.c >> index 5cddc09c72bf..6c8c3eea44ac 100644 >> --- a/drivers/staging/media/ipu7/ipu7.c >> +++ b/drivers/staging/media/ipu7/ipu7.c >> @@ -2684,6 +2684,10 @@ static void ipu7_pci_reset_done(struct pci_dev *pdev) >> */ >> static int ipu7_suspend(struct device *dev) >> { >> + struct pci_dev *pdev = to_pci_dev(dev); >> + >> + synchronize_irq(pdev->irq); >> + >> return 0; >> } >> > -- Best regards, Bingbu Cao ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2 2/4] media: staging/ipu7: call synchronous RPM suspend in probe failure 2025-12-22 7:06 [PATCH v2 0/4] IPU6 and IPU7 driver fixes bingbu.cao 2025-12-22 7:06 ` [PATCH v2 1/4] media: staging/ipu7: ignore interrupts when device is suspended bingbu.cao @ 2025-12-22 7:06 ` bingbu.cao 2025-12-22 8:36 ` Sakari Ailus 2025-12-22 7:06 ` [PATCH v2 3/4] media: ipu7: update CDPHY register settings bingbu.cao 2025-12-22 7:06 ` [PATCH v2 4/4] media: ipu6/7: fix typo and coding errors in IPU mmu driver bingbu.cao 3 siblings, 1 reply; 12+ messages in thread From: bingbu.cao @ 2025-12-22 7:06 UTC (permalink / raw) To: linux-media, sakari.ailus Cc: bingbu.cao, bingbu.cao, antti.laakso, mehdi.djait From: Bingbu Cao <bingbu.cao@intel.com> If firmware authentication failed during driver probe, driver call an asynchronous API to suspend the psys device but the bus device will be removed soon, thus runtime PM of bus device will be disabled soon, that will cancel the suspend request, so use synchronous suspend to make sure the runtime suspend before disabling its RPM. IPU7 hardware has constraints that the PSYS device must be powered off before ISYS, otherwise it will cause machine check error. Cc: Stable@vger.kernel.org Fixes: b7fe4c0019b1 ("media: staging/ipu7: add Intel IPU7 PCI device driver") Signed-off-by: Bingbu Cao <bingbu.cao@intel.com> --- drivers/staging/media/ipu7/ipu7.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/ipu7/ipu7.c b/drivers/staging/media/ipu7/ipu7.c index 6c8c3eea44ac..fa5a1867626f 100644 --- a/drivers/staging/media/ipu7/ipu7.c +++ b/drivers/staging/media/ipu7/ipu7.c @@ -2620,7 +2620,7 @@ static int ipu7_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) if (!IS_ERR_OR_NULL(isp->isys) && !IS_ERR_OR_NULL(isp->isys->mmu)) ipu7_mmu_cleanup(isp->isys->mmu); if (!IS_ERR_OR_NULL(isp->psys)) - pm_runtime_put(&isp->psys->auxdev.dev); + pm_runtime_put_sync(&isp->psys->auxdev.dev); ipu7_bus_del_devices(pdev); release_firmware(isp->cpd_fw); buttress_exit: -- 2.34.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v2 2/4] media: staging/ipu7: call synchronous RPM suspend in probe failure 2025-12-22 7:06 ` [PATCH v2 2/4] media: staging/ipu7: call synchronous RPM suspend in probe failure bingbu.cao @ 2025-12-22 8:36 ` Sakari Ailus 2025-12-22 10:03 ` Bingbu Cao 0 siblings, 1 reply; 12+ messages in thread From: Sakari Ailus @ 2025-12-22 8:36 UTC (permalink / raw) To: bingbu.cao; +Cc: linux-media, bingbu.cao, antti.laakso, mehdi.djait Hi Bingbu, Thanks for the patchset. On Mon, Dec 22, 2025 at 03:06:27PM +0800, bingbu.cao@intel.com wrote: > From: Bingbu Cao <bingbu.cao@intel.com> > > If firmware authentication failed during driver probe, driver call > an asynchronous API to suspend the psys device but the bus device > will be removed soon, thus runtime PM of bus device will be disabled > soon, that will cancel the suspend request, so use synchronous > suspend to make sure the runtime suspend before disabling its RPM. > > IPU7 hardware has constraints that the PSYS device must be powered > off before ISYS, otherwise it will cause machine check error. How does this differ from IPU6? In the ipu6 driver this has been addressed by making the PSYS a child of ISYS. Would this work on IPU7, too? > > Cc: Stable@vger.kernel.org > Fixes: b7fe4c0019b1 ("media: staging/ipu7: add Intel IPU7 PCI device driver") > Signed-off-by: Bingbu Cao <bingbu.cao@intel.com> > --- > drivers/staging/media/ipu7/ipu7.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/media/ipu7/ipu7.c b/drivers/staging/media/ipu7/ipu7.c > index 6c8c3eea44ac..fa5a1867626f 100644 > --- a/drivers/staging/media/ipu7/ipu7.c > +++ b/drivers/staging/media/ipu7/ipu7.c > @@ -2620,7 +2620,7 @@ static int ipu7_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) > if (!IS_ERR_OR_NULL(isp->isys) && !IS_ERR_OR_NULL(isp->isys->mmu)) > ipu7_mmu_cleanup(isp->isys->mmu); > if (!IS_ERR_OR_NULL(isp->psys)) > - pm_runtime_put(&isp->psys->auxdev.dev); > + pm_runtime_put_sync(&isp->psys->auxdev.dev); > ipu7_bus_del_devices(pdev); > release_firmware(isp->cpd_fw); > buttress_exit: -- Kind regards, Sakari Ailus ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 2/4] media: staging/ipu7: call synchronous RPM suspend in probe failure 2025-12-22 8:36 ` Sakari Ailus @ 2025-12-22 10:03 ` Bingbu Cao 2025-12-22 16:59 ` Sakari Ailus 0 siblings, 1 reply; 12+ messages in thread From: Bingbu Cao @ 2025-12-22 10:03 UTC (permalink / raw) To: Sakari Ailus, bingbu.cao; +Cc: linux-media, antti.laakso, mehdi.djait Sakari, Thanks for the review. On 12/22/25 4:36 PM, Sakari Ailus wrote: > Hi Bingbu, > > Thanks for the patchset. > > On Mon, Dec 22, 2025 at 03:06:27PM +0800, bingbu.cao@intel.com wrote: >> From: Bingbu Cao <bingbu.cao@intel.com> >> >> If firmware authentication failed during driver probe, driver call >> an asynchronous API to suspend the psys device but the bus device >> will be removed soon, thus runtime PM of bus device will be disabled >> soon, that will cancel the suspend request, so use synchronous >> suspend to make sure the runtime suspend before disabling its RPM. >> >> IPU7 hardware has constraints that the PSYS device must be powered >> off before ISYS, otherwise it will cause machine check error. > > How does this differ from IPU6? In the ipu6 driver this has been addressed > by making the PSYS a child of ISYS. Would this work on IPU7, too? For both IPU6 and IPU7, PSYS is child of ISYS. It can guarantee that PSYS auxiliary device will be powered off before ISYS except the probe failure case. Runtime PM disabling(in ipu7_bus_del_devices) may cancel the pending PSYS suspend request which cause machine check error on PTL which has clock hardware constraint. > >> >> Cc: Stable@vger.kernel.org >> Fixes: b7fe4c0019b1 ("media: staging/ipu7: add Intel IPU7 PCI device driver") >> Signed-off-by: Bingbu Cao <bingbu.cao@intel.com> >> --- >> drivers/staging/media/ipu7/ipu7.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/staging/media/ipu7/ipu7.c b/drivers/staging/media/ipu7/ipu7.c >> index 6c8c3eea44ac..fa5a1867626f 100644 >> --- a/drivers/staging/media/ipu7/ipu7.c >> +++ b/drivers/staging/media/ipu7/ipu7.c >> @@ -2620,7 +2620,7 @@ static int ipu7_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) >> if (!IS_ERR_OR_NULL(isp->isys) && !IS_ERR_OR_NULL(isp->isys->mmu)) >> ipu7_mmu_cleanup(isp->isys->mmu); >> if (!IS_ERR_OR_NULL(isp->psys)) >> - pm_runtime_put(&isp->psys->auxdev.dev); >> + pm_runtime_put_sync(&isp->psys->auxdev.dev); >> ipu7_bus_del_devices(pdev); >> release_firmware(isp->cpd_fw); >> buttress_exit: > -- Best regards, Bingbu Cao ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 2/4] media: staging/ipu7: call synchronous RPM suspend in probe failure 2025-12-22 10:03 ` Bingbu Cao @ 2025-12-22 16:59 ` Sakari Ailus 0 siblings, 0 replies; 12+ messages in thread From: Sakari Ailus @ 2025-12-22 16:59 UTC (permalink / raw) To: Bingbu Cao; +Cc: bingbu.cao, linux-media, antti.laakso, mehdi.djait Hi Bingbu, On Mon, Dec 22, 2025 at 06:03:02PM +0800, Bingbu Cao wrote: > Sakari, > > Thanks for the review. > > On 12/22/25 4:36 PM, Sakari Ailus wrote: > > Hi Bingbu, > > > > Thanks for the patchset. > > > > On Mon, Dec 22, 2025 at 03:06:27PM +0800, bingbu.cao@intel.com wrote: > >> From: Bingbu Cao <bingbu.cao@intel.com> > >> > >> If firmware authentication failed during driver probe, driver call > >> an asynchronous API to suspend the psys device but the bus device > >> will be removed soon, thus runtime PM of bus device will be disabled > >> soon, that will cancel the suspend request, so use synchronous > >> suspend to make sure the runtime suspend before disabling its RPM. > >> > >> IPU7 hardware has constraints that the PSYS device must be powered > >> off before ISYS, otherwise it will cause machine check error. > > > > How does this differ from IPU6? In the ipu6 driver this has been addressed > > by making the PSYS a child of ISYS. Would this work on IPU7, too? > > For both IPU6 and IPU7, PSYS is child of ISYS. It can guarantee that PSYS > auxiliary device will be powered off before ISYS except the probe failure > case. Runtime PM disabling(in ipu7_bus_del_devices) may cancel the pending > PSYS suspend request which cause machine check error on PTL which has clock > hardware constraint. Thanks for the explanation. The ipu6 driver is actually missing any pm_runtime_put*() in its probe error path. :-o > > > > >> > >> Cc: Stable@vger.kernel.org > >> Fixes: b7fe4c0019b1 ("media: staging/ipu7: add Intel IPU7 PCI device driver") > >> Signed-off-by: Bingbu Cao <bingbu.cao@intel.com> > >> --- > >> drivers/staging/media/ipu7/ipu7.c | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/drivers/staging/media/ipu7/ipu7.c b/drivers/staging/media/ipu7/ipu7.c > >> index 6c8c3eea44ac..fa5a1867626f 100644 > >> --- a/drivers/staging/media/ipu7/ipu7.c > >> +++ b/drivers/staging/media/ipu7/ipu7.c > >> @@ -2620,7 +2620,7 @@ static int ipu7_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) > >> if (!IS_ERR_OR_NULL(isp->isys) && !IS_ERR_OR_NULL(isp->isys->mmu)) > >> ipu7_mmu_cleanup(isp->isys->mmu); > >> if (!IS_ERR_OR_NULL(isp->psys)) > >> - pm_runtime_put(&isp->psys->auxdev.dev); > >> + pm_runtime_put_sync(&isp->psys->auxdev.dev); > >> ipu7_bus_del_devices(pdev); > >> release_firmware(isp->cpd_fw); > >> buttress_exit: > > > -- Kind regards, Sakari Ailus ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH v2 3/4] media: ipu7: update CDPHY register settings 2025-12-22 7:06 [PATCH v2 0/4] IPU6 and IPU7 driver fixes bingbu.cao 2025-12-22 7:06 ` [PATCH v2 1/4] media: staging/ipu7: ignore interrupts when device is suspended bingbu.cao 2025-12-22 7:06 ` [PATCH v2 2/4] media: staging/ipu7: call synchronous RPM suspend in probe failure bingbu.cao @ 2025-12-22 7:06 ` bingbu.cao 2025-12-22 7:06 ` [PATCH v2 4/4] media: ipu6/7: fix typo and coding errors in IPU mmu driver bingbu.cao 3 siblings, 0 replies; 12+ messages in thread From: bingbu.cao @ 2025-12-22 7:06 UTC (permalink / raw) To: linux-media, sakari.ailus Cc: bingbu.cao, bingbu.cao, antti.laakso, mehdi.djait From: Bingbu Cao <bingbu.cao@intel.com> Some CPHY settings needs to updated according to the latest guide from SNPS. Program 45ohm for tuning resistance to fix CPHY problem and update the ITMINRX and GMODE for CPHY. Cc: Stable@vger.kernel.org Fixes: a516d36bdc3d ("media: staging/ipu7: add IPU7 input system device driver") Signed-off-by: Bingbu Cao <bingbu.cao@intel.com> --- drivers/staging/media/ipu7/ipu7-isys-csi-phy.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/ipu7/ipu7-isys-csi-phy.c b/drivers/staging/media/ipu7/ipu7-isys-csi-phy.c index 2d5717883518..3f15af3b4c79 100644 --- a/drivers/staging/media/ipu7/ipu7-isys-csi-phy.c +++ b/drivers/staging/media/ipu7/ipu7-isys-csi-phy.c @@ -124,6 +124,7 @@ static const struct cdr_fbk_cap_prog_params table7[] = { { 1350, 1589, 4 }, { 1590, 1949, 5 }, { 1950, 2499, 6 }, + { 2500, 3500, 7 }, { } }; @@ -838,9 +839,10 @@ static void ipu7_isys_cphy_config(struct ipu7_isys *isys, u8 id, u8 lanes, dwc_phy_write_mask(isys, id, reg + 0x400 * i, reset_thresh, 9, 11); + /* Tuning ITMINRX to 2 for CPHY */ reg = CORE_DIG_CLANE_0_RW_LP_0; for (i = 0; i < trios; i++) - dwc_phy_write_mask(isys, id, reg + 0x400 * i, 1, 12, 15); + dwc_phy_write_mask(isys, id, reg + 0x400 * i, 2, 12, 15); reg = CORE_DIG_CLANE_0_RW_LP_2; for (i = 0; i < trios; i++) @@ -860,7 +862,11 @@ static void ipu7_isys_cphy_config(struct ipu7_isys *isys, u8 id, u8 lanes, for (i = 0; i < (lanes + 1); i++) { reg = CORE_DIG_IOCTRL_RW_AFE_LANE0_CTRL_2_9 + 0x400 * i; dwc_phy_write_mask(isys, id, reg, 4U, 0, 2); - dwc_phy_write_mask(isys, id, reg, 0U, 3, 4); + /* Set GMODE to 2 when CPHY >= 1.5Gsps */ + if (mbps >= 1500) + dwc_phy_write_mask(isys, id, reg, 2U, 3, 4); + else + dwc_phy_write_mask(isys, id, reg, 0U, 3, 4); reg = CORE_DIG_IOCTRL_RW_AFE_LANE0_CTRL_2_7 + 0x400 * i; dwc_phy_write_mask(isys, id, reg, cap_prog, 10, 12); @@ -930,8 +936,9 @@ static int ipu7_isys_phy_config(struct ipu7_isys *isys, u8 id, u8 lanes, 7, 12, 14); dwc_phy_write_mask(isys, id, CORE_DIG_IOCTRL_RW_AFE_CB_CTRL_2_7, 0, 8, 10); + /* resistance tuning: 1 for 45ohm, 0 for 50ohm */ dwc_phy_write_mask(isys, id, CORE_DIG_IOCTRL_RW_AFE_CB_CTRL_2_5, - 0, 8, 8); + 1, 8, 8); if (aggregation) phy_mode = isys->csi2[0].phy_mode; -- 2.34.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH v2 4/4] media: ipu6/7: fix typo and coding errors in IPU mmu driver 2025-12-22 7:06 [PATCH v2 0/4] IPU6 and IPU7 driver fixes bingbu.cao ` (2 preceding siblings ...) 2025-12-22 7:06 ` [PATCH v2 3/4] media: ipu7: update CDPHY register settings bingbu.cao @ 2025-12-22 7:06 ` bingbu.cao 2025-12-22 8:39 ` Sakari Ailus 3 siblings, 1 reply; 12+ messages in thread From: bingbu.cao @ 2025-12-22 7:06 UTC (permalink / raw) To: linux-media, sakari.ailus Cc: bingbu.cao, bingbu.cao, antti.laakso, mehdi.djait From: Bingbu Cao <bingbu.cao@intel.com> Fix the coding errors in ipu6-mmu.c and ipu7-mmu.c, it has no impact on current driver functionality, however it needs a fix. Fixes: 9163d83573e4 ("media: intel/ipu6: add IPU6 DMA mapping API and MMU table") Fixes: 71d81c25683a ("media: staging/ipu7: add IPU7 DMA APIs and MMU mapping") Signed-off-by: Bingbu Cao <bingbu.cao@intel.com> --- drivers/media/pci/intel/ipu6/ipu6-mmu.c | 4 ++-- drivers/staging/media/ipu7/ipu7-mmu.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/pci/intel/ipu6/ipu6-mmu.c b/drivers/media/pci/intel/ipu6/ipu6-mmu.c index 6d1c0b90169d..85cc6d5b4dd1 100644 --- a/drivers/media/pci/intel/ipu6/ipu6-mmu.c +++ b/drivers/media/pci/intel/ipu6/ipu6-mmu.c @@ -102,7 +102,7 @@ static void page_table_dump(struct ipu6_mmu_info *mmu_info) if (mmu_info->l1_pt[l1_idx] == mmu_info->dummy_l2_pteval) continue; - l2_phys = TBL_PHYS_ADDR(mmu_info->l1_pt[l1_idx];) + l2_phys = TBL_PHYS_ADDR(mmu_info->l1_pt[l1_idx]); dev_dbg(mmu_info->dev, "l1 entry %u; iovas 0x%8.8x-0x%8.8x, at %pap\n", l1_idx, iova, iova + ISP_PAGE_SIZE, &l2_phys); @@ -248,7 +248,7 @@ static u32 *alloc_l2_pt(struct ipu6_mmu_info *mmu_info) dev_dbg(mmu_info->dev, "alloc_l2: get_zeroed_page() = %p\n", pt); - for (i = 0; i < ISP_L1PT_PTES; i++) + for (i = 0; i < ISP_L2PT_PTES; i++) pt[i] = mmu_info->dummy_page_pteval; return pt; diff --git a/drivers/staging/media/ipu7/ipu7-mmu.c b/drivers/staging/media/ipu7/ipu7-mmu.c index ded1986eb8ba..ea35cce4830a 100644 --- a/drivers/staging/media/ipu7/ipu7-mmu.c +++ b/drivers/staging/media/ipu7/ipu7-mmu.c @@ -231,7 +231,7 @@ static u32 *alloc_l2_pt(struct ipu7_mmu_info *mmu_info) dev_dbg(mmu_info->dev, "alloc_l2: get_zeroed_page() = %p\n", pt); - for (i = 0; i < ISP_L1PT_PTES; i++) + for (i = 0; i < ISP_L2PT_PTES; i++) pt[i] = mmu_info->dummy_page_pteval; return pt; -- 2.34.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH v2 4/4] media: ipu6/7: fix typo and coding errors in IPU mmu driver 2025-12-22 7:06 ` [PATCH v2 4/4] media: ipu6/7: fix typo and coding errors in IPU mmu driver bingbu.cao @ 2025-12-22 8:39 ` Sakari Ailus 2025-12-22 10:04 ` Bingbu Cao 0 siblings, 1 reply; 12+ messages in thread From: Sakari Ailus @ 2025-12-22 8:39 UTC (permalink / raw) To: bingbu.cao; +Cc: linux-media, bingbu.cao, antti.laakso, mehdi.djait Hi Bingbu, On Mon, Dec 22, 2025 at 03:06:29PM +0800, bingbu.cao@intel.com wrote: > From: Bingbu Cao <bingbu.cao@intel.com> > > Fix the coding errors in ipu6-mmu.c and ipu7-mmu.c, it has > no impact on current driver functionality, however it needs > a fix. Please wrap paragraphs (using your $EDITOR perhaps?) to use as much as possible but still at most 75 characters per line. The above should look like: Fix the coding errors in ipu6-mmu.c and ipu7-mmu.c, it has no impact on current driver functionality, however it needs a fix. > > Fixes: 9163d83573e4 ("media: intel/ipu6: add IPU6 DMA mapping API and MMU table") > Fixes: 71d81c25683a ("media: staging/ipu7: add IPU7 DMA APIs and MMU mapping") Could you split this into two separate patches, please? > Signed-off-by: Bingbu Cao <bingbu.cao@intel.com> > --- > drivers/media/pci/intel/ipu6/ipu6-mmu.c | 4 ++-- > drivers/staging/media/ipu7/ipu7-mmu.c | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/media/pci/intel/ipu6/ipu6-mmu.c b/drivers/media/pci/intel/ipu6/ipu6-mmu.c > index 6d1c0b90169d..85cc6d5b4dd1 100644 > --- a/drivers/media/pci/intel/ipu6/ipu6-mmu.c > +++ b/drivers/media/pci/intel/ipu6/ipu6-mmu.c > @@ -102,7 +102,7 @@ static void page_table_dump(struct ipu6_mmu_info *mmu_info) > if (mmu_info->l1_pt[l1_idx] == mmu_info->dummy_l2_pteval) > continue; > > - l2_phys = TBL_PHYS_ADDR(mmu_info->l1_pt[l1_idx];) > + l2_phys = TBL_PHYS_ADDR(mmu_info->l1_pt[l1_idx]); > dev_dbg(mmu_info->dev, > "l1 entry %u; iovas 0x%8.8x-0x%8.8x, at %pap\n", > l1_idx, iova, iova + ISP_PAGE_SIZE, &l2_phys); > @@ -248,7 +248,7 @@ static u32 *alloc_l2_pt(struct ipu6_mmu_info *mmu_info) > > dev_dbg(mmu_info->dev, "alloc_l2: get_zeroed_page() = %p\n", pt); > > - for (i = 0; i < ISP_L1PT_PTES; i++) > + for (i = 0; i < ISP_L2PT_PTES; i++) > pt[i] = mmu_info->dummy_page_pteval; > > return pt; > diff --git a/drivers/staging/media/ipu7/ipu7-mmu.c b/drivers/staging/media/ipu7/ipu7-mmu.c > index ded1986eb8ba..ea35cce4830a 100644 > --- a/drivers/staging/media/ipu7/ipu7-mmu.c > +++ b/drivers/staging/media/ipu7/ipu7-mmu.c > @@ -231,7 +231,7 @@ static u32 *alloc_l2_pt(struct ipu7_mmu_info *mmu_info) > > dev_dbg(mmu_info->dev, "alloc_l2: get_zeroed_page() = %p\n", pt); > > - for (i = 0; i < ISP_L1PT_PTES; i++) > + for (i = 0; i < ISP_L2PT_PTES; i++) > pt[i] = mmu_info->dummy_page_pteval; > > return pt; -- Regards, Sakari Ailus ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH v2 4/4] media: ipu6/7: fix typo and coding errors in IPU mmu driver 2025-12-22 8:39 ` Sakari Ailus @ 2025-12-22 10:04 ` Bingbu Cao 0 siblings, 0 replies; 12+ messages in thread From: Bingbu Cao @ 2025-12-22 10:04 UTC (permalink / raw) To: Sakari Ailus, bingbu.cao; +Cc: linux-media, antti.laakso, mehdi.djait Sakari, Thanks for the review. On 12/22/25 4:39 PM, Sakari Ailus wrote: > Hi Bingbu, > > On Mon, Dec 22, 2025 at 03:06:29PM +0800, bingbu.cao@intel.com wrote: >> From: Bingbu Cao <bingbu.cao@intel.com> >> >> Fix the coding errors in ipu6-mmu.c and ipu7-mmu.c, it has >> no impact on current driver functionality, however it needs >> a fix. > > Please wrap paragraphs (using your $EDITOR perhaps?) to use as much as > possible but still at most 75 characters per line. The above should look > like: > > Fix the coding errors in ipu6-mmu.c and ipu7-mmu.c, it has no impact on > current driver functionality, however it needs a fix. Thanks, I will. > >> >> Fixes: 9163d83573e4 ("media: intel/ipu6: add IPU6 DMA mapping API and MMU table") >> Fixes: 71d81c25683a ("media: staging/ipu7: add IPU7 DMA APIs and MMU mapping") > > Could you split this into two separate patches, please? Yes, I will update in v3. > >> Signed-off-by: Bingbu Cao <bingbu.cao@intel.com> >> --- >> drivers/media/pci/intel/ipu6/ipu6-mmu.c | 4 ++-- >> drivers/staging/media/ipu7/ipu7-mmu.c | 2 +- >> 2 files changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/media/pci/intel/ipu6/ipu6-mmu.c b/drivers/media/pci/intel/ipu6/ipu6-mmu.c >> index 6d1c0b90169d..85cc6d5b4dd1 100644 >> --- a/drivers/media/pci/intel/ipu6/ipu6-mmu.c >> +++ b/drivers/media/pci/intel/ipu6/ipu6-mmu.c >> @@ -102,7 +102,7 @@ static void page_table_dump(struct ipu6_mmu_info *mmu_info) >> if (mmu_info->l1_pt[l1_idx] == mmu_info->dummy_l2_pteval) >> continue; >> >> - l2_phys = TBL_PHYS_ADDR(mmu_info->l1_pt[l1_idx];) >> + l2_phys = TBL_PHYS_ADDR(mmu_info->l1_pt[l1_idx]); >> dev_dbg(mmu_info->dev, >> "l1 entry %u; iovas 0x%8.8x-0x%8.8x, at %pap\n", >> l1_idx, iova, iova + ISP_PAGE_SIZE, &l2_phys); >> @@ -248,7 +248,7 @@ static u32 *alloc_l2_pt(struct ipu6_mmu_info *mmu_info) >> >> dev_dbg(mmu_info->dev, "alloc_l2: get_zeroed_page() = %p\n", pt); >> >> - for (i = 0; i < ISP_L1PT_PTES; i++) >> + for (i = 0; i < ISP_L2PT_PTES; i++) >> pt[i] = mmu_info->dummy_page_pteval; >> >> return pt; >> diff --git a/drivers/staging/media/ipu7/ipu7-mmu.c b/drivers/staging/media/ipu7/ipu7-mmu.c >> index ded1986eb8ba..ea35cce4830a 100644 >> --- a/drivers/staging/media/ipu7/ipu7-mmu.c >> +++ b/drivers/staging/media/ipu7/ipu7-mmu.c >> @@ -231,7 +231,7 @@ static u32 *alloc_l2_pt(struct ipu7_mmu_info *mmu_info) >> >> dev_dbg(mmu_info->dev, "alloc_l2: get_zeroed_page() = %p\n", pt); >> >> - for (i = 0; i < ISP_L1PT_PTES; i++) >> + for (i = 0; i < ISP_L2PT_PTES; i++) >> pt[i] = mmu_info->dummy_page_pteval; >> >> return pt; > -- Best regards, Bingbu Cao ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2025-12-22 16:59 UTC | newest] Thread overview: 12+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-12-22 7:06 [PATCH v2 0/4] IPU6 and IPU7 driver fixes bingbu.cao 2025-12-22 7:06 ` [PATCH v2 1/4] media: staging/ipu7: ignore interrupts when device is suspended bingbu.cao 2025-12-22 8:43 ` Sakari Ailus 2025-12-22 9:56 ` Bingbu Cao 2025-12-22 7:06 ` [PATCH v2 2/4] media: staging/ipu7: call synchronous RPM suspend in probe failure bingbu.cao 2025-12-22 8:36 ` Sakari Ailus 2025-12-22 10:03 ` Bingbu Cao 2025-12-22 16:59 ` Sakari Ailus 2025-12-22 7:06 ` [PATCH v2 3/4] media: ipu7: update CDPHY register settings bingbu.cao 2025-12-22 7:06 ` [PATCH v2 4/4] media: ipu6/7: fix typo and coding errors in IPU mmu driver bingbu.cao 2025-12-22 8:39 ` Sakari Ailus 2025-12-22 10:04 ` Bingbu Cao
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox