lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z46AhYi3DN4TtBKM@eichest-laptop>
Date: Mon, 20 Jan 2025 17:57:41 +0100
From: Stefan Eichenberger <eichest@...il.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: andrew@...n.ch, gregory.clement@...tlin.com,
	sebastian.hesselbarth@...il.com, shivamurthy.shastri@...utronix.de,
	anna-maria@...utronix.de, linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1] irqchip/irq-mvebu-icu: Fix irq_set_type for sei and
 nsr

On Mon, Jan 20, 2025 at 09:45:43AM +0100, Thomas Gleixner wrote:
> On Fri, Jan 17 2025 at 19:03, Stefan Eichenberger wrote:
> > It seems that irq_chip_set_type_parent is not failing. By adding some
> > debug messages to kernel/irq/manage.c I found that irqd_get_trigger_type
> > returns IRQF_TRIGGER_RISING even though it should return
> > IRQF_TRIGGER_HIGH according to the device tree. Maybe this was fixed
> > between 6.10 and 6.12 but I need to analyze that again in more detail.
> 
> The trigger type is fixed up in mvebu_icu_irq_domain_translate(), but
> that should be the same with the new code in mvebu_icu_translate().
> 
> Can you instrument mvebu_icu_translate() and validate that it is
> 
>     1) Invoked at all
> 
>     2) The type fixup is done:
> 
>        if (msi_data->subset_data->icu_group == ICU_GRP_SEI)
>               *type = IRQ_TYPE_EDGE_RISING;

Thanks a lot for pointing me in the right direction. I think I found
what is going on. My instrumentation showed that we still end up in that
function but the translation does not work. I think the reason is that
the msi_data conversion is wrong. The following patch would solve the
issue:

diff --git a/drivers/irqchip/irq-mvebu-icu.c b/drivers/irqchip/irq-mvebu-icu.c
index b337f6c05f18..4eebed39880a 100644
--- a/drivers/irqchip/irq-mvebu-icu.c
+++ b/drivers/irqchip/irq-mvebu-icu.c
@@ -68,7 +68,8 @@ static int mvebu_icu_translate(struct irq_domain *d, struct irq_fwspec *fwspec,
                               unsigned long *hwirq, unsigned int *type)
 {
        unsigned int param_count = static_branch_unlikely(&legacy_bindings) ? 3 : 2;
-       struct mvebu_icu_msi_data *msi_data = d->host_data;
+       struct msi_domain_info *info = d->host_data;
+       struct mvebu_icu_msi_data *msi_data = info->chip_data;
        struct mvebu_icu *icu = msi_data->icu;

        /* Check the count of the parameters in dt */

Do you agree with that fix? If so I will prepare a proper patch.

Thanks for your help, regards,
Stefan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ