Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp94835pxj; Wed, 23 Jun 2021 16:40:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNkIPefH81JMVwjIRQquMIlwodd4P9B0uhqhI3Mr4fjCsN4FNAMJ6dBeLQpAiUvESPei3m X-Received: by 2002:a17:906:1c4e:: with SMTP id l14mr2393039ejg.172.1624491646606; Wed, 23 Jun 2021 16:40:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624491646; cv=none; d=google.com; s=arc-20160816; b=FQcvj9cMz4Jex1E9pSbRAE21VhPfWy8S6FSqRUVPEMhqOmAJm8SRrwm+pPV+++czqI VjMXydExXccX8LZIlZ4U88K5kdtCblOh0bBd3P2lJoLuyuoBZfQyOSS/tG7HFCgafZpJ 7bTww2O7UhDN7aPwcS7Nim4WtExnsr6oUH33VfeFm9+xNRDB0O/YzCPGlZgIZAo/gIgN Dcd7oiRbbqDGNBCrUs/VVB2TuV/ioEEPPo5fjED+g2w4JDgQ1a9dXC3ziJtrNtfAS6Gt OZC7wmbTpphJiRbnEHeCidd9d2qZA1VmCKNlqGbdnhM4gybfMAvXp2eCOLbI9JSTOQRT Wpyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=S0GBhk0O3w2quJN2iFaAsp1YA1pT40N0ACjztuE3B80=; b=Rj7kF+M8M+lf2WasytNTwnY7p0+AGV0UsOAAAWpIwJko3aslqbnySQwDnrLZ0W4Lj9 TomkgHHVyauOPcS/VYBnri6JNhzC+1O+LC89WwqH0KIkOkZlpCt4iG37muH6F2PEczeL w+2dDr+hOtIlSt0/beKaTsi9f4ZL1XstdyM5p+G5FGNOkyk7Eg6dSN6EEYyo4UIDg9ze teMAtq54Z6klvnR0kbuiILcxQs55Dn9shq/O+pO2+mhFCJcUaQVTyKe7lJ1/yLpgvu/l Coae0kkVnu1OBxA37rIN4RAhh6PFzaZ/JnsJEgUH015pB1a37YRD9GtPf+c9pBrTly9U 7MsQ== 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 e12si1150224eds.468.2021.06.23.16.40.23; Wed, 23 Jun 2021 16:40:46 -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 S229929AbhFWXlT (ORCPT + 99 others); Wed, 23 Jun 2021 19:41:19 -0400 Received: from angie.orcam.me.uk ([78.133.224.34]:59842 "EHLO angie.orcam.me.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229916AbhFWXlS (ORCPT ); Wed, 23 Jun 2021 19:41:18 -0400 Received: by angie.orcam.me.uk (Postfix, from userid 500) id 5BB1B92009E; Thu, 24 Jun 2021 01:38:59 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 5A1DD92009D; Thu, 24 Jun 2021 01:38:59 +0200 (CEST) Date: Thu, 24 Jun 2021 01:38:59 +0200 (CEST) From: "Maciej W. Rozycki" To: Nikolai Zhubr , Bjorn Helgaas , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" cc: Arnd Bergmann , x86@kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH RFC 1/2] x86/PCI: Disambiguate SiS85C503 PIRQ router code entities In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In preparation to adding support for the SiS85C497 PIRQ router add `503' to the names of SiS85C503 PIRQ router code entities so that they clearly indicate which device they refer to. Also restructure `sis_router_probe' such that new device IDs will be just new switch cases. No functional change. Signed-off-by: Maciej W. Rozycki --- arch/x86/pci/irq.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) linux-x86-pirq-router-sis85c503.diff Index: linux-macro-ide/arch/x86/pci/irq.c =================================================================== --- linux-macro-ide.orig/arch/x86/pci/irq.c +++ linux-macro-ide/arch/x86/pci/irq.c @@ -389,11 +389,12 @@ static int pirq_cyrix_set(struct pci_dev * bit 6-4 are probably unused, not like 5595 */ -#define PIRQ_SIS_IRQ_MASK 0x0f -#define PIRQ_SIS_IRQ_DISABLE 0x80 -#define PIRQ_SIS_USB_ENABLE 0x40 +#define PIRQ_SIS503_IRQ_MASK 0x0f +#define PIRQ_SIS503_IRQ_DISABLE 0x80 +#define PIRQ_SIS503_USB_ENABLE 0x40 -static int pirq_sis_get(struct pci_dev *router, struct pci_dev *dev, int pirq) +static int pirq_sis503_get(struct pci_dev *router, struct pci_dev *dev, + int pirq) { u8 x; int reg; @@ -402,10 +403,11 @@ static int pirq_sis_get(struct pci_dev * if (reg >= 0x01 && reg <= 0x04) reg += 0x40; pci_read_config_byte(router, reg, &x); - return (x & PIRQ_SIS_IRQ_DISABLE) ? 0 : (x & PIRQ_SIS_IRQ_MASK); + return (x & PIRQ_SIS503_IRQ_DISABLE) ? 0 : (x & PIRQ_SIS503_IRQ_MASK); } -static int pirq_sis_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) +static int pirq_sis503_set(struct pci_dev *router, struct pci_dev *dev, + int pirq, int irq) { u8 x; int reg; @@ -414,8 +416,8 @@ static int pirq_sis_set(struct pci_dev * if (reg >= 0x01 && reg <= 0x04) reg += 0x40; pci_read_config_byte(router, reg, &x); - x &= ~(PIRQ_SIS_IRQ_MASK | PIRQ_SIS_IRQ_DISABLE); - x |= irq ? irq: PIRQ_SIS_IRQ_DISABLE; + x &= ~(PIRQ_SIS503_IRQ_MASK | PIRQ_SIS503_IRQ_DISABLE); + x |= irq ? irq : PIRQ_SIS503_IRQ_DISABLE; pci_write_config_byte(router, reg, x); return 1; } @@ -697,13 +699,14 @@ static __init int serverworks_router_pro static __init int sis_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) { - if (device != PCI_DEVICE_ID_SI_503) - return 0; - - r->name = "SIS"; - r->get = pirq_sis_get; - r->set = pirq_sis_set; - return 1; + switch (device) { + case PCI_DEVICE_ID_SI_503: + r->name = "SiS85C503"; + r->get = pirq_sis503_get; + r->set = pirq_sis503_set; + return 1; + } + return 0; } static __init int cyrix_router_probe(struct irq_router *r, struct pci_dev *router, u16 device)