All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nikolai Zhubr <zhubr.2@gmail.com>
To: "Maciej W. Rozycki" <macro@orcam.me.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Vitaly Kuznetsov <vkuznets@redhat.com>,
	Wanpeng Li <wanpengli@tencent.com>,
	Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
	x86@kernel.org, linux-pci@vger.kernel.org
Subject: Re: [PATCH 0/6] x86: PIRQ/ELCR-related fixes and updates
Date: Sat, 11 Sep 2021 18:31:47 +0300	[thread overview]
Message-ID: <613CCBE3.20802@gmail.com> (raw)
In-Reply-To: <61377A45.8030003@gmail.com>

Hello Maciej,

07.09.2021 17:42, I wrote:
> [ 0.625911] 8139too: 8139too Fast Ethernet driver 0.9.28
> [ 0.625911] 8139too 0000:00:03.0: PCI INT A -> PIRQ 10, mask def8, excl
> 0000
> [ 0.625911] 8139too 0000:00:03.0: PCI INT A -> newirq 11
> [ 0.630068] PCI: setting IRQ 15 as level-triggered
> [ 0.630068] -> edge
> [ 0.630068] 8139too 0000:00:03.0: found PCI INT A -> IRQ 15

Ok, I've sorted this out. Your patch works as intended, as long as the 
.link field values are encoded as numbers from 1 to 4. In the (severely 
obsolete) "$IRT" routing table I discovered in my BIOS, the .link values 
are some strange 0x10-0x28-0x41-0x89 numbers, whatever was the idea of 
BIOS writers behind this. AFAIK such numbering is not prohibited by PCI 
BIOS spec, but obviously it has to be in agreement with what register 
access routines expect, or otherwise it will all break apart.

Now because this old "$IRT" table can not normally be recognized anyway, 
I've converted the data to a more reasonable $PIR format, translating 
0x10-0x28-0x41-0x89 numbers into 1-2-3-4 along the way, and inserted 
this new table into a small unused ROM area. All looks good:
=====
[    0.623757] 8139too: 8139too Fast Ethernet driver 0.9.28
[    0.623757] 8139too 0000:00:03.0: PCI INT A -> PIRQ 01, mask def8, 
excl 0000
[    0.623757] 8139too 0000:00:03.0: PCI INT A -> newirq 11
[    0.623757] PCI: setting IRQ 11 as level-triggered
=====
Dumping registers with a separate program then confirmed that settings 
are correct indeed.
But I'd like to note that PIRQ values passed to pirq_finali_get/set 
should better be somewhow checked for validity, as otherwise some 
totally unrelated chipset registers are being unintentionally accessed.

I'm now going to test IRQ sharing.


Thank you,

Regards,
Nikolai


> [ 0.630068] 8139too 0000:00:03.0: IRQ routing conflict: have IRQ 11,
> want IRQ 15
> [ 0.641901] 8139too 0000:00:03.0 eth0: RealTek RTL8139 at 0xc2582f00,
> 00:11:6b:32:85:74, IRQ 11
>
> First, INTA is apparently routed to IRQ11 (and the network card works
> just fine with that), whereas pci code wants IRQ15 for some reason.
>
> Second, dumping chipset reg 44 shows that INTA is still set to EDGE mode
> anyway, although dumping port 4D1 now shows IRQ15 was changed to LEVEL
> mode, exactly as indicated in the above output. I'm not sure, but the
> datasheet (page 77) seems to indicate that INTx mode set in reg 44
> should match the respective IRQx mode in port 4Dx (Although the ROM BIOS
> seems to only have code to change triggering mode in the 44 register and
> does not care about port 4Dx whatsoever, which kinda contradicts the
> datasheet)
>
> I'll do some more digging later, but any hints are appreciated anyway.
>
>
> Thank you,
>
> Regards,
> Nikolai
>
>>
>> I'm a little busy at the moment with other stuff and may not be able to
>> look into it properly right now. There may be no solution, not at least
>> an easy one. A DMI quirk is not possible, because:
>>
>> DMI not present or invalid.
>>
>> There is a PCI BIOS:
>>
>> PCI: PCI BIOS revision 2.10 entry at 0xf6f41, last bus=0
>>
>> however, so CONFIG_PCI_BIOS just might work. Please try that too, by
>> choosing CONFIG_PCI_GOANY or CONFIG_PCI_GOBIOS (it may break things
>> horribly though I imagine).
>>
>> Maciej
>>
>


  reply	other threads:[~2021-09-11 15:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-20  3:27 [PATCH 0/6] x86: PIRQ/ELCR-related fixes and updates Maciej W. Rozycki
2021-07-20  3:27 ` [PATCH 1/6] x86: Add support for 0x22/0x23 port I/O configuration space Maciej W. Rozycki
2021-08-10 21:35   ` [tip: x86/irq] " tip-bot2 for Maciej W. Rozycki
2021-07-20  3:27 ` [PATCH 2/6] x86/PCI: Add support for the ALi M1487 (IBC) PIRQ router Maciej W. Rozycki
2021-08-10 21:35   ` [tip: x86/irq] " tip-bot2 for Maciej W. Rozycki
2021-07-20  3:27 ` [PATCH 3/6] x86/PCI: Add support for the Intel 82374EB/82374SB (ESC) " Maciej W. Rozycki
2021-08-10 21:35   ` [tip: x86/irq] " tip-bot2 for Maciej W. Rozycki
2021-07-20  3:28 ` [PATCH 4/6] x86/PCI: Add support for the Intel 82426EX " Maciej W. Rozycki
2021-08-10 21:35   ` [tip: x86/irq] " tip-bot2 for Maciej W. Rozycki
2021-07-20  3:28 ` [PATCH 5/6] x86: Avoid magic number with ELCR register accesses Maciej W. Rozycki
2021-08-10 21:35   ` [tip: x86/irq] " tip-bot2 for Maciej W. Rozycki
2021-07-20  3:28 ` [PATCH 6/6] x86: Fix typo s/ECLR/ELCR/ for the PIC register Maciej W. Rozycki
2021-08-10 21:35   ` [tip: x86/irq] " tip-bot2 for Maciej W. Rozycki
2021-07-21  0:12 ` [PATCH 0/6] x86: PIRQ/ELCR-related fixes and updates Bjorn Helgaas
2021-07-21 20:41   ` Thomas Gleixner
2021-08-15 22:22 ` Nikolai Zhubr
2021-08-16 22:30   ` Maciej W. Rozycki
2021-09-07 14:42     ` Nikolai Zhubr
2021-09-11 15:31       ` Nikolai Zhubr [this message]
2021-09-12 16:51         ` Nikolai Zhubr
2021-09-14  9:24       ` Maciej W. Rozycki
2021-09-16  0:25         ` Nikolai Zhubr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=613CCBE3.20802@gmail.com \
    --to=zhubr.2@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=jmattson@google.com \
    --cc=joro@8bytes.org \
    --cc=len.brown@intel.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=macro@orcam.me.uk \
    --cc=mingo@redhat.com \
    --cc=pavel@ucw.cz \
    --cc=pbonzini@redhat.com \
    --cc=rjw@rjwysocki.net \
    --cc=seanjc@google.com \
    --cc=tglx@linutronix.de \
    --cc=vkuznets@redhat.com \
    --cc=wanpengli@tencent.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.