Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp507696pxb; Wed, 18 Aug 2021 07:24:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfcBJ0dn5Wdy2mQMDXqsLsJqwxdXCoaBkyVJoPtU5uTPP1WwTk+dOgX465ZMpZejQivluZ X-Received: by 2002:a17:906:5855:: with SMTP id h21mr9723410ejs.230.1629296691238; Wed, 18 Aug 2021 07:24:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629296691; cv=none; d=google.com; s=arc-20160816; b=wupYbyETCLXlZSpeUeHTeLHSoPWWSdUs/+jtTj0kVvQ09d1BUOuTTEdkMhlnmdpkvd SHpJAJbjk8p7RPfWaNfBSSxHGddpKoUlHwJmnGLTmdQBj+kcoG2QxKRXZqXHqb6xreMC vIILdRVFXs1Rq54pHXPXHq5/6Ex5wP4vQ9Uw/Jj+fMDsKlOw70zdwmffNxF7QF1BY9hC yLon0a+Kzj8PgjopVuFk1QR0szQE2DlrFolssCEnvd4dLAlAR1fo5NllCn8y9kZpI22e gmh199ZWhXe9f0ckBo7sYIeLkcbUn0F3l6pczhMcNCQtGLGrK7qNa1wHnxshMrQvRJcq i83g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:references:subject:in-reply-to:cc:to :from:date; bh=8aeD2I/R3wNvTkOSSemaIr6ymAALjUMsVf7GvmbB+Z8=; b=a5lqijNrfpK7mSjxgHxoBQw6n/G0+ysYooj1tfSYt6egTctTUJJGk77pLZKE1vwGZe HWD4Kn6K4IPwXVv1zAJ1DwH6zoyqYzQJUVcklHV87PA48REXaahS6r6GJDEEEpbJLIvt xa/npNpMQn9afQZ1eNGEH34vrQQfvklfNmzTkIvSF/vvm6YdYOhxcqTOvLFJifPC/vQY RHKhQBO/TIAxwMB4Q7mrGdtGv1BOZaejWW4Mn+T5wFq9e4xBx2RDXiTI0lJlI4FTkw3i ycWyKFVRYqnSFsdOGhpSz6hpRyKha9vZ+3V3JLDVg5kqakxuvmYuEiHPc8Qbc418cULv CdMw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i2si18001ejp.581.2021.08.18.07.24.26; Wed, 18 Aug 2021 07:24:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238995AbhHROXX (ORCPT + 99 others); Wed, 18 Aug 2021 10:23:23 -0400 Received: from sibelius.xs4all.nl ([83.163.83.176]:60681 "EHLO sibelius.xs4all.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238544AbhHROXQ (ORCPT ); Wed, 18 Aug 2021 10:23:16 -0400 Received: from localhost (bloch.sibelius.xs4all.nl [local]) by bloch.sibelius.xs4all.nl (OpenSMTPD) with ESMTPA id 3d105b57; Wed, 18 Aug 2021 16:22:37 +0200 (CEST) Date: Wed, 18 Aug 2021 16:22:37 +0200 (CEST) From: Mark Kettenis To: Hector Martin 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 In-Reply-To: <092a2de3-6760-6398-e4de-2b24d30ac856@marcan.st> (message from Hector Martin on Wed, 18 Aug 2021 20:43:48 +0900) Subject: Re: [RFC PATCH 2/2] PCI: apple: Add driver for the Apple M1 References: <20210815042525.36878-1-alyssa@rosenzweig.io> <20210815042525.36878-3-alyssa@rosenzweig.io> <87a6lj17d1.wl-maz@kernel.org> <8650c850-2642-4582-ae97-a95134bda3e2@www.fastmail.com> <092a2de3-6760-6398-e4de-2b24d30ac856@marcan.st> Message-ID: <56140239180269fd@bloch.sibelius.xs4all.nl> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > From: Hector Martin > 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.