* [PATCH] ACPI/PCI: pci_link: use extended_irq union member when setting ext-irq shareable
@ 2020-04-10 13:14 Hans de Goede
2020-04-10 19:45 ` Bjorn Helgaas
0 siblings, 1 reply; 3+ messages in thread
From: Hans de Goede @ 2020-04-10 13:14 UTC (permalink / raw)
To: Rafael J . Wysocki, Len Brown, Bjorn Helgaas
Cc: Hans de Goede, linux-acpi, linux-pci
The case ACPI_RESOURCE_TYPE_EXTENDED_IRQ inside acpi_pci_link_set()
is correctly using resource->res.data.extended_irq.foo for most settings,
but for the sharable setting it sofar has accidentally been using
resource->res.data.irq.shareable instead of
resource->res.data.extended_irq.shareable.
Note that the old code happens to also work because the sharable field
offset is the same for both the acpi_resource_irq and
acpi_resource_extended_irq structs.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/acpi/pci_link.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
index 00a6da2121be..ed3d2182cf2c 100644
--- a/drivers/acpi/pci_link.c
+++ b/drivers/acpi/pci_link.c
@@ -322,10 +322,10 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
resource->res.data.extended_irq.polarity =
link->irq.polarity;
if (link->irq.triggering == ACPI_EDGE_SENSITIVE)
- resource->res.data.irq.shareable =
+ resource->res.data.extended_irq.shareable =
ACPI_EXCLUSIVE;
else
- resource->res.data.irq.shareable = ACPI_SHARED;
+ resource->res.data.extended_irq.shareable = ACPI_SHARED;
resource->res.data.extended_irq.interrupt_count = 1;
resource->res.data.extended_irq.interrupts[0] = irq;
/* ignore resource_source, it's optional */
--
2.26.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ACPI/PCI: pci_link: use extended_irq union member when setting ext-irq shareable
2020-04-10 13:14 [PATCH] ACPI/PCI: pci_link: use extended_irq union member when setting ext-irq shareable Hans de Goede
@ 2020-04-10 19:45 ` Bjorn Helgaas
2020-04-13 13:08 ` Hans de Goede
0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Helgaas @ 2020-04-10 19:45 UTC (permalink / raw)
To: Hans de Goede; +Cc: Rafael J . Wysocki, Len Brown, linux-acpi, linux-pci
On Fri, Apr 10, 2020 at 03:14:42PM +0200, Hans de Goede wrote:
> The case ACPI_RESOURCE_TYPE_EXTENDED_IRQ inside acpi_pci_link_set()
> is correctly using resource->res.data.extended_irq.foo for most settings,
> but for the sharable setting it sofar has accidentally been using
> resource->res.data.irq.shareable instead of
> resource->res.data.extended_irq.shareable.
>
> Note that the old code happens to also work because the sharable field
> offset is the same for both the acpi_resource_irq and
> acpi_resource_extended_irq structs.
s/sharable/shareable/ several times above
s/sofar/so far/
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> ---
> drivers/acpi/pci_link.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
> index 00a6da2121be..ed3d2182cf2c 100644
> --- a/drivers/acpi/pci_link.c
> +++ b/drivers/acpi/pci_link.c
> @@ -322,10 +322,10 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
> resource->res.data.extended_irq.polarity =
> link->irq.polarity;
> if (link->irq.triggering == ACPI_EDGE_SENSITIVE)
> - resource->res.data.irq.shareable =
> + resource->res.data.extended_irq.shareable =
> ACPI_EXCLUSIVE;
> else
> - resource->res.data.irq.shareable = ACPI_SHARED;
> + resource->res.data.extended_irq.shareable = ACPI_SHARED;
Ouch, looks like that copy/paste error has been there since the
beginning of git. Nice catch!
> resource->res.data.extended_irq.interrupt_count = 1;
> resource->res.data.extended_irq.interrupts[0] = irq;
> /* ignore resource_source, it's optional */
> --
> 2.26.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ACPI/PCI: pci_link: use extended_irq union member when setting ext-irq shareable
2020-04-10 19:45 ` Bjorn Helgaas
@ 2020-04-13 13:08 ` Hans de Goede
0 siblings, 0 replies; 3+ messages in thread
From: Hans de Goede @ 2020-04-13 13:08 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: Rafael J . Wysocki, Len Brown, linux-acpi, linux-pci
Hi,
On 4/10/20 9:45 PM, Bjorn Helgaas wrote:
> On Fri, Apr 10, 2020 at 03:14:42PM +0200, Hans de Goede wrote:
>> The case ACPI_RESOURCE_TYPE_EXTENDED_IRQ inside acpi_pci_link_set()
>> is correctly using resource->res.data.extended_irq.foo for most settings,
>> but for the sharable setting it sofar has accidentally been using
>> resource->res.data.irq.shareable instead of
>> resource->res.data.extended_irq.shareable.
>>
>> Note that the old code happens to also work because the sharable field
>> offset is the same for both the acpi_resource_irq and
>> acpi_resource_extended_irq structs.
>
> s/sharable/shareable/ several times above
> s/sofar/so far/
>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>
> Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Thanks, I'll send out a v2 with the spelling issues in the commit-msg fixed.
Regards,
Hans
>
>> ---
>> drivers/acpi/pci_link.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/acpi/pci_link.c b/drivers/acpi/pci_link.c
>> index 00a6da2121be..ed3d2182cf2c 100644
>> --- a/drivers/acpi/pci_link.c
>> +++ b/drivers/acpi/pci_link.c
>> @@ -322,10 +322,10 @@ static int acpi_pci_link_set(struct acpi_pci_link *link, int irq)
>> resource->res.data.extended_irq.polarity =
>> link->irq.polarity;
>> if (link->irq.triggering == ACPI_EDGE_SENSITIVE)
>> - resource->res.data.irq.shareable =
>> + resource->res.data.extended_irq.shareable =
>> ACPI_EXCLUSIVE;
>> else
>> - resource->res.data.irq.shareable = ACPI_SHARED;
>> + resource->res.data.extended_irq.shareable = ACPI_SHARED;
>
> Ouch, looks like that copy/paste error has been there since the
> beginning of git. Nice catch!
>
>> resource->res.data.extended_irq.interrupt_count = 1;
>> resource->res.data.extended_irq.interrupts[0] = irq;
>> /* ignore resource_source, it's optional */
>> --
>> 2.26.0
>>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-04-13 13:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-10 13:14 [PATCH] ACPI/PCI: pci_link: use extended_irq union member when setting ext-irq shareable Hans de Goede
2020-04-10 19:45 ` Bjorn Helgaas
2020-04-13 13:08 ` Hans de Goede
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).