From patchwork Wed Jul 19 01:28:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Axtens X-Patchwork-Id: 9850243 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7F10A602C8 for ; Wed, 19 Jul 2017 01:29:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6FAFA285BA for ; Wed, 19 Jul 2017 01:29:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 648E9285CD; Wed, 19 Jul 2017 01:29:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 158AD285BA for ; Wed, 19 Jul 2017 01:29:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752190AbdGSB3u (ORCPT ); Tue, 18 Jul 2017 21:29:50 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34627 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751560AbdGSB3t (ORCPT ); Tue, 18 Jul 2017 21:29:49 -0400 Received: by mail-pg0-f67.google.com with SMTP id v190so4872924pgv.1 for ; Tue, 18 Jul 2017 18:29:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=w7WqZ5TEw3lTRbu3/EsP9LrHt8iDEGEswgneeWe37sY=; b=XhCl3XsE+XsdsRxc9r9HLqfksAZpZxKUCAKMXH5y5J8DoxvG+ZUwX0xPK2qoTGAJzQ Gkvp4+dabi2O1sZntqQYO6FPs2NqNiYXIj6tOuJwF2025ph0hDurITTzJqusJbRL82CM cPMcgNkWKEyQ9HzWMypccWGsOUUOGkbnkWVCY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=w7WqZ5TEw3lTRbu3/EsP9LrHt8iDEGEswgneeWe37sY=; b=iYGJ/cEUNt76cXvPR09TcangSG5PoqizY+fHG1/uWgdbTTNI/J9kPBxiHoaPZ4qTuc pHg9DgCuY7/58CJarajXs+NYZMR6H/NDF6NHMB7ij1eO34zmWCKgNanZMNRWmQYkpw+6 CSmOCxTqJy6QrfEeWmd11qy9a5IHUnPWah7ukclfuGWHROUVUa/lAbjwPl+Y4gVjgs2f Zd6ndvSv57RwB8z5bMeb/VFGnyBB+UZsggXIzhSt/N7Y0hSHhWHr2bkXOZ1Z4E7pmIT/ klFOeT8XWIdvgNLD9hxPHbVcx1b3puhxaiQNAZ7Bk7THwEEjA2V+FMPvmj75QcHql+8l KNKw== X-Gm-Message-State: AIVw112I4MnxbcfRHeklMSxu65zr/ltNgV9sibHMP6WThm1PUqAhopEM NnfThNx5Wa7OkE4SikpyqQ== X-Received: by 10.84.247.9 with SMTP id n9mr416736pll.287.1500427789226; Tue, 18 Jul 2017 18:29:49 -0700 (PDT) Received: from localhost.localdomain (203-59-51-51.dyn.iinet.net.au. [203.59.51.51]) by smtp.gmail.com with ESMTPSA id n90sm7582401pfk.105.2017.07.18.18.29.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Jul 2017 18:29:48 -0700 (PDT) From: Daniel Axtens To: linux-pci@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org Cc: benh@kernel.crashing.org, z.liuxinliang@hisilicon.com, zourongrong@gmail.com, catalin.marinas@arm.com, will.deacon@arm.com, gabriele.paoloni@huawei.com, helgass@kernel.org, airlied@linux.ie, daniel.vetter@intel.com, alex.williamson@redhat.com, Daniel Axtens , Brian King Subject: [PATCH 3/4] powerpc: replace vga_fixup() with generic code Date: Wed, 19 Jul 2017 11:28:38 +1000 Message-Id: <20170719012839.20124-6-dja@axtens.net> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170719012839.20124-1-dja@axtens.net> References: <20170719012839.20124-1-dja@axtens.net> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently, we do a PCI fixup to mark a default card so that Xorg autoconfiguration works. There is a new generic method to do this sort of vga fixup. Code-wise, it is identical, however instead of firing at the FIXUP_FINAL stage it fires at the FIXUP_ENABLE stage. This means a card will not be marked as default unless a driver enables it. Cc: Brian King Signed-off-by: Daniel Axtens --- Tested with xeyes on qemu TCG, which does use this code path. --- arch/powerpc/Kconfig | 1 + arch/powerpc/kernel/pci-common.c | 15 --------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 36f858c37ca7..c28b8eb1dce1 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -140,6 +140,7 @@ config PPC select ARCH_USE_BUILTIN_BSWAP select ARCH_USE_CMPXCHG_LOCKREF if PPC64 select ARCH_WANT_IPC_PARSE_VERSION + select ARCH_WANT_VGA_ARB_FALLBACK select ARCH_WEAK_RELEASE_ACQUIRE select BINFMT_ELF select BUILDTIME_EXTABLE_SORT diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index c95fdda3a2dc..7b093a4fa85d 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c @@ -1741,18 +1741,3 @@ static void fixup_hide_host_resource_fsl(struct pci_dev *dev) } DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MOTOROLA, PCI_ANY_ID, fixup_hide_host_resource_fsl); DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_FREESCALE, PCI_ANY_ID, fixup_hide_host_resource_fsl); - -static void fixup_vga(struct pci_dev *pdev) -{ - u16 cmd; - - if (vga_default_device()) - return; - - pci_read_config_word(pdev, PCI_COMMAND, &cmd); - if (cmd & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY)) - vga_set_default_device(pdev); - -} -DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID, - PCI_CLASS_DISPLAY_VGA, 8, fixup_vga);