lkml.org 
[lkml]   [2023]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v4 08/11] PCI: microchip: Move IRQ init functions to pcie-plda-host.c
From


On 2023/8/25 20:09, Conor Dooley wrote:
> Daire, can you look at this one too please?
>
> On Fri, Aug 25, 2023 at 05:01:26PM +0800, Minda Chen wrote:
>> Move IRQ init functions to pcie-plda-host.c.
>> mc_handle_event() is merged to plda_handle_event().
>> Set most of the IRQ functions to static in pcie-plda-host.c
>>
>> Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
>
>> -void plda_handle_event(struct irq_desc *desc)
>> +static void plda_handle_event(struct irq_desc *desc)
>> {
>> struct plda_pcie_rp *port = irq_desc_get_handler_data(desc);
>> struct irq_chip *chip = irq_desc_get_chip(desc);
>> @@ -264,14 +268,18 @@ void plda_handle_event(struct irq_desc *desc)
>>
>> chained_irq_enter(chip, desc);
>>
>> - val = readl_relaxed(port->bridge_addr + ISTATUS_LOCAL);
>> - origin = val;
>> - val = val >> A_ATR_EVT_POST_ERR_SHIFT;
>> - events |= val & 0xff;
>> - if (origin & PM_MSI_INT_INTX_MASK)
>> - events |= BIT(EVENT_PM_MSI_INT_INTX);
>> - val = (origin >> PM_MSI_INT_MSI_SHIFT) & 0xf;
>> - events |= val << EVENT_PM_MSI_INT_MSI;
>> + if (port->ops && port->ops->get_events) {
>
> I still don't love the dancing here. Can you just always register a
> callback?
>
> Thanks,
> Conor.
>
OK, Thanks.
>> + events = port->ops->get_events(port);
>> + } else {
>> + val = readl_relaxed(port->bridge_addr + ISTATUS_LOCAL);
>> + origin = val;
>> + val = val >> A_ATR_EVT_POST_ERR_SHIFT;
>> + events |= val & 0xff;
>> + if (origin & PM_MSI_INT_INTX_MASK)
>> + events |= BIT(EVENT_PM_MSI_INT_INTX);
>> + val = (origin >> PM_MSI_INT_MSI_SHIFT) & 0xf;
>> + events |= val << EVENT_PM_MSI_INT_MSI;
>> + }
>>
>> for_each_set_bit(bit, &events, port->num_events)
>> generic_handle_domain_irq(port->event_domain, bit);

\
 
 \ /
  Last update: 2023-09-01 05:59    [W:0.100 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site