[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <56140239180269fd@bloch.sibelius.xs4all.nl>
Date: Wed, 18 Aug 2021 16:22:37 +0200 (CEST)
From: Mark Kettenis <mark.kettenis@...all.nl>
To: Hector Martin <marcan@...can.st>
Cc: sven@...npeter.dev, maz@...nel.org, alyssa@...enzweig.io,
linux-pci@...r.kernel.org, bhelgaas@...gle.com, robh+dt@...nel.org,
lorenzo.pieralisi@....com, kw@...ux.com, stan@...ellium.com,
kettenis@...nbsd.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 2/2] PCI: apple: Add driver for the Apple M1
> From: Hector Martin <marcan@...can.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.
Powered by blists - more mailing lists