linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: Hector Martin <marcan@marcan.st>
Cc: sven@svenpeter.dev, maz@kernel.org, alyssa@rosenzweig.io,
	linux-pci@vger.kernel.org, bhelgaas@google.com,
	robh+dt@kernel.org, lorenzo.pieralisi@arm.com, kw@linux.com,
	stan@corellium.com, kettenis@openbsd.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 2/2] PCI: apple: Add driver for the Apple M1
Date: Wed, 18 Aug 2021 16:22:37 +0200 (CEST)	[thread overview]
Message-ID: <56140239180269fd@bloch.sibelius.xs4all.nl> (raw)
In-Reply-To: <092a2de3-6760-6398-e4de-2b24d30ac856@marcan.st> (message from Hector Martin on Wed, 18 Aug 2021 20:43:48 +0900)

> From: Hector Martin <marcan@marcan.st>
> Date: Wed, 18 Aug 2021 20:43:48 +0900
> 
> On 15/08/2021 21.33, Sven Peter wrote:
> > The magic comes from the original Corellium driver. It first masks
> > everything except for the interrupts in the next line, then acks
> > the interrupts it keeps enabled and then probably wants to wait
> > for PORT_INT_LINK_UP (or any of the other interrupts which seem to
> > indicate various error conditions) to fire but instead polls for
> > PORT_LINKSTS_UP.
> 
> Let's not take any magic numbers from their drivers (or what macOS does, 
> for that matter) without making an attempt to understand what they do, 
> unless it becomes clear it's incomprehensible. This has already bit us 
> in the past (the SError disable thing).

The driver should really only unmask the interrupts it handles in its
interrupt handler.  We should know the meaning of those bits so using
the appropriate symbolic names shouldn't be too difficult.

Didn't delve into this yet since U-Boot doesn't do interrupts (so I
don't touch the port interrupt registers there) and on OpenBSD I only
implemented MSIs for now as all the integrated devices support MSIs
just fine.  I'll need to revisit this at some point to support the
Thunderbolt ports.

  reply	other threads:[~2021-08-18 14:22 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-15  4:25 [RFC PATCH 0/2] Add PCI driver for the Apple M1 Alyssa Rosenzweig
2021-08-15  4:25 ` [RFC PATCH 1/2] dt-bindings: PCI: Add Apple PCI controller Alyssa Rosenzweig
2021-08-15  7:09   ` Marc Zyngier
     [not found]     ` <1566004903.6140692.1629015053757@ox-webmail.xs4all.nl>
2021-08-15  9:12       ` Marc Zyngier
2021-08-16  1:34     ` Alyssa Rosenzweig
2021-08-22 18:03       ` Mark Kettenis
2021-08-15  4:25 ` [RFC PATCH 2/2] PCI: apple: Add driver for the Apple M1 Alyssa Rosenzweig
2021-08-15  7:42   ` Marc Zyngier
2021-08-15  9:19     ` Marc Zyngier
2021-08-16  1:45       ` Alyssa Rosenzweig
2021-08-15 12:33     ` Sven Peter
2021-08-15 16:49       ` Marc Zyngier
2021-08-16  6:37         ` Sven Peter
2021-08-18 11:43       ` Hector Martin
2021-08-18 14:22         ` Mark Kettenis [this message]
2021-08-16  1:31     ` Alyssa Rosenzweig
2021-08-16 21:56       ` Marc Zyngier
2021-08-17  7:34         ` Arnd Bergmann
2021-08-17  8:12           ` Marc Zyngier
2021-08-17  7:35         ` Sven Peter
2021-08-15  7:43   ` Sven Peter
2021-08-15 21:40     ` Alyssa Rosenzweig
2021-08-15 20:57   ` Rob Herring
2021-08-15 21:33     ` Alyssa Rosenzweig
     [not found]   ` <CAHp75VeKeGgUgALLztA3Q3jizF2=OkSzU9bzaPmTHO9Pad=QOQ@mail.gmail.com>
2021-08-16  3:20     ` Alyssa Rosenzweig

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=56140239180269fd@bloch.sibelius.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=alyssa@rosenzweig.io \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kettenis@openbsd.org \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=marcan@marcan.st \
    --cc=maz@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=stan@corellium.com \
    --cc=sven@svenpeter.dev \
    /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 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).