diff mbox series

[2/3] hw/psi-p9: Follow the external IRQ policy

Message ID 20190830043025.30605-2-oohall@gmail.com
State Superseded
Headers show
Series [1/3] hw/psi-p9: Mask OPAL-owned LSIs without handlers | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (7b12d5489fcfd73ef7ec0cb27eff7f8a5f13b238)
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present

Commit Message

Oliver O'Halloran Aug. 30, 2019, 4:30 a.m. UTC
The P8 PSI support follows the external IRQ policy and the P9 PSI
doesn't. There are no P9 platforms which define an .external_irq()
in the platform structure so this should not cause any functional
changes.

Linux is smart enough to mask LSIs without a registered handler so
directing them at the OS should be safe.

Cc: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 hw/psi.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Cédric Le Goater Sept. 3, 2019, 5:50 p.m. UTC | #1
On 30/08/2019 06:30, Oliver O'Halloran wrote:
> The P8 PSI support follows the external IRQ policy and the P9 PSI
> doesn't. There are no P9 platforms which define an .external_irq()
> in the platform structure so this should not cause any functional
> changes.
> 
> Linux is smart enough to mask LSIs without a registered handler so
> directing them at the OS should be safe.

Minor comments below.

Reviewed-by: Cédric Le Goater <clg@kaod.org>

 
> Cc: Cédric Le Goater <clg@kaod.org>
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
> ---
>  hw/psi.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/hw/psi.c b/hw/psi.c
> index d4b20f1f015f..01c815ccf7b2 100644
> --- a/hw/psi.c
> +++ b/hw/psi.c
> @@ -601,6 +601,10 @@ static uint64_t psi_p9_irq_attributes(struct irq_source *is __unused,
>  	 if (is_lpc_serirq)
>  		 return lpc_get_irq_policy(psi->chip_id, idx - P9_PSI_IRQ_LPC_SIRQ0);

whitespace issues above ^

>  
> +	if (idx == P9_PSI_IRQ_EXTERNAL)
> +		if (psi_ext_irq_policy == EXTERNAL_IRQ_POLICY_LINUX)
> +			return IRQ_ATTR_TARGET_LINUX | IRQ_ATTR_TYPE_LSI;

I don't think we need the 'IRQ_ATTR_TYPE_LSI' flag when targeting Linux.

> +
>  	return IRQ_ATTR_TARGET_OPAL | IRQ_ATTR_TYPE_LSI;
>  }
>  
>
diff mbox series

Patch

diff --git a/hw/psi.c b/hw/psi.c
index d4b20f1f015f..01c815ccf7b2 100644
--- a/hw/psi.c
+++ b/hw/psi.c
@@ -601,6 +601,10 @@  static uint64_t psi_p9_irq_attributes(struct irq_source *is __unused,
 	 if (is_lpc_serirq)
 		 return lpc_get_irq_policy(psi->chip_id, idx - P9_PSI_IRQ_LPC_SIRQ0);
 
+	if (idx == P9_PSI_IRQ_EXTERNAL)
+		if (psi_ext_irq_policy == EXTERNAL_IRQ_POLICY_LINUX)
+			return IRQ_ATTR_TARGET_LINUX | IRQ_ATTR_TYPE_LSI;
+
 	return IRQ_ATTR_TARGET_OPAL | IRQ_ATTR_TYPE_LSI;
 }