Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp213843pxb; Thu, 31 Mar 2022 03:45:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+8PvFV5wFVulxBOEIHsG3Gew6uMbPtupzYkZAFeUqhhfZZl4GHSJKUfHFZWMgKySoRMJF X-Received: by 2002:a05:6a00:a0f:b0:4e1:309:83c0 with SMTP id p15-20020a056a000a0f00b004e1030983c0mr4755978pfh.68.1648723507536; Thu, 31 Mar 2022 03:45:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648723507; cv=none; d=google.com; s=arc-20160816; b=pCUifnFm4OK8KRzZy9kmLXYtcl9YbcB4ydqMyYYtbzRzdG96YI43pdJk8h2r3TdN26 EXheUhmM0YpK+ZNB+ZxBuVQIRO1bhEFMu96jPEYMBHJn3LWvBFgrtCABCmAufQZOGADF eXmpEGIvoxmkvADXgHXRSDQNTe59lj/tv/lq9IrMVft7O3mQwtYWvq+MkyPXTAM0qC8T QU0mtimQGn3lJ6x6hIPrZYhLAcJmDuzXF9GidF/y3E7/mzRHqFrcAzOO/RWS1rAS9FXh rQclQUdtaLLmRw8q+/vLEl9ZrQOYl5p3ChwZUW4m6mK7m3BksnvYkNSf+f9X9+VBGKzp SGRQ== 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=7Y9sH1ilTpHHtI2J78VQPs1hdQwZTdQyGGk6l1BJqMs=; b=z/xzUISnh/7RyukA3aK4wGXtTHToubOM32NxFhEHjmypsZ9Orv5fHa4HTopyJ1sK8U dDrEJld7pQylQqAmXCW54XXg7ULPwUFAgO6IFXBlw8rJJYrdEUBpRlksPc/5jcdhn8tu VQ0+T316ET7ybRyTXci5YL0+j3W/ScKiQCnfVVmYhnhYSlaMrPiGYrgm+1Sk7oxIh1xJ aVIFmo4rqjyoCGXPU/G0kHP6qlOLU77Bw23tMTBR0+RA7/EM+UaGr39mOCNS58OvxFR2 CDl/wHxwTICEDhfnKwCn0bKOmaT4A6TFhiOUpho8cc5XJCQh7okSG2yoFkV3lY4ecIEf 7+kg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s35-20020a634523000000b003816043ef03si26089828pga.248.2022.03.31.03.44.54; Thu, 31 Mar 2022 03:45:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231849AbiCaHM6 (ORCPT + 99 others); Thu, 31 Mar 2022 03:12:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231761AbiCaHMb (ORCPT ); Thu, 31 Mar 2022 03:12:31 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 31D455B3D0; Thu, 31 Mar 2022 00:10:40 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 8F2FD92009D; Thu, 31 Mar 2022 09:10:39 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 88B6192009B; Thu, 31 Mar 2022 08:10:39 +0100 (BST) Date: Thu, 31 Mar 2022 08:10:39 +0100 (BST) 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: [RESEND][PATCH v2 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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 --- No change from v1. --- arch/x86/pci/irq.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) linux-x86-pirq-router-sis85c503.diff Index: linux-macro/arch/x86/pci/irq.c =================================================================== --- linux-macro.orig/arch/x86/pci/irq.c +++ linux-macro/arch/x86/pci/irq.c @@ -641,11 +641,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; @@ -654,10 +655,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; @@ -666,8 +668,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; } @@ -966,13 +968,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)