All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Alex Deucher <alexander.deucher@amd.com>,
	Daniel Vetter <daniel.vetter@intel.com>,
	Sasha Levin <alexander.levin@verizon.com>
Subject: [PATCH 4.10 081/110] drm/mga: remove device_is_agp callback
Date: Mon, 10 Apr 2017 18:43:12 +0200	[thread overview]
Message-ID: <20170410164205.693960506@linuxfoundation.org> (raw)
In-Reply-To: <20170410164201.247583164@linuxfoundation.org>

4.10-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Daniel Vetter <daniel.vetter@ffwll.ch>

[ Upstream commit 858b2c1bf820ebfba89c5e2867ab882bdb5b2f5a ]

It's only for a device quirk, and we might as well do that in the load
callback.

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170125062657.19270-10-daniel.vetter@ffwll.ch
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/gpu/drm/mga/mga_dma.c |   20 +++++++++++++++++++-
 drivers/gpu/drm/mga/mga_drv.c |   37 -------------------------------------
 2 files changed, 19 insertions(+), 38 deletions(-)

--- a/drivers/gpu/drm/mga/mga_dma.c
+++ b/drivers/gpu/drm/mga/mga_dma.c
@@ -392,6 +392,24 @@ int mga_driver_load(struct drm_device *d
 	drm_mga_private_t *dev_priv;
 	int ret;
 
+	/* There are PCI versions of the G450.  These cards have the
+	 * same PCI ID as the AGP G450, but have an additional PCI-to-PCI
+	 * bridge chip.  We detect these cards, which are not currently
+	 * supported by this driver, by looking at the device ID of the
+	 * bus the "card" is on.  If vendor is 0x3388 (Hint Corp) and the
+	 * device is 0x0021 (HB6 Universal PCI-PCI bridge), we reject the
+	 * device.
+	 */
+	if ((dev->pdev->device == 0x0525) && dev->pdev->bus->self
+	    && (dev->pdev->bus->self->vendor == 0x3388)
+	    && (dev->pdev->bus->self->device == 0x0021)
+	    && dev->agp) {
+		/* FIXME: This should be quirked in the pci core, but oh well
+		 * the hw probably stopped existing. */
+		arch_phys_wc_del(dev->agp->agp_mtrr);
+		kfree(dev->agp);
+		dev->agp = NULL;
+	}
 	dev_priv = kzalloc(sizeof(drm_mga_private_t), GFP_KERNEL);
 	if (!dev_priv)
 		return -ENOMEM;
@@ -698,7 +716,7 @@ static int mga_do_pci_dma_bootstrap(stru
 static int mga_do_dma_bootstrap(struct drm_device *dev,
 				drm_mga_dma_bootstrap_t *dma_bs)
 {
-	const int is_agp = (dma_bs->agp_mode != 0) && drm_pci_device_is_agp(dev);
+	const int is_agp = (dma_bs->agp_mode != 0) && dev->agp;
 	int err;
 	drm_mga_private_t *const dev_priv =
 	    (drm_mga_private_t *) dev->dev_private;
--- a/drivers/gpu/drm/mga/mga_drv.c
+++ b/drivers/gpu/drm/mga/mga_drv.c
@@ -37,8 +37,6 @@
 
 #include <drm/drm_pciids.h>
 
-static int mga_driver_device_is_agp(struct drm_device *dev);
-
 static struct pci_device_id pciidlist[] = {
 	mga_PCI_IDS
 };
@@ -66,7 +64,6 @@ static struct drm_driver driver = {
 	.lastclose = mga_driver_lastclose,
 	.set_busid = drm_pci_set_busid,
 	.dma_quiescent = mga_driver_dma_quiescent,
-	.device_is_agp = mga_driver_device_is_agp,
 	.get_vblank_counter = mga_get_vblank_counter,
 	.enable_vblank = mga_enable_vblank,
 	.disable_vblank = mga_disable_vblank,
@@ -107,37 +104,3 @@ module_exit(mga_exit);
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL and additional rights");
-
-/**
- * Determine if the device really is AGP or not.
- *
- * In addition to the usual tests performed by \c drm_device_is_agp, this
- * function detects PCI G450 cards that appear to the system exactly like
- * AGP G450 cards.
- *
- * \param dev   The device to be tested.
- *
- * \returns
- * If the device is a PCI G450, zero is returned.  Otherwise 2 is returned.
- */
-static int mga_driver_device_is_agp(struct drm_device *dev)
-{
-	const struct pci_dev *const pdev = dev->pdev;
-
-	/* There are PCI versions of the G450.  These cards have the
-	 * same PCI ID as the AGP G450, but have an additional PCI-to-PCI
-	 * bridge chip.  We detect these cards, which are not currently
-	 * supported by this driver, by looking at the device ID of the
-	 * bus the "card" is on.  If vendor is 0x3388 (Hint Corp) and the
-	 * device is 0x0021 (HB6 Universal PCI-PCI bridge), we reject the
-	 * device.
-	 */
-
-	if ((pdev->device == 0x0525) && pdev->bus->self
-	    && (pdev->bus->self->vendor == 0x3388)
-	    && (pdev->bus->self->device == 0x0021)) {
-		return 0;
-	}
-
-	return 2;
-}

  parent reply	other threads:[~2017-04-10 16:52 UTC|newest]

Thread overview: 120+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-10 16:41 [PATCH 4.10 000/110] 4.10.10-stable review Greg Kroah-Hartman
2017-04-10 16:41 ` [PATCH 4.10 001/110] drm/vmwgfx: Type-check lookups of fence objects Greg Kroah-Hartman
2017-04-10 16:41 ` [PATCH 4.10 002/110] drm/vmwgfx: NULL pointer dereference in vmw_surface_define_ioctl() Greg Kroah-Hartman
2017-04-10 16:41 ` [PATCH 4.10 003/110] drm/vmwgfx: avoid calling vzalloc with a 0 size in vmw_get_cap_3d_ioctl() Greg Kroah-Hartman
2017-04-10 16:41 ` [PATCH 4.10 004/110] drm/ttm, drm/vmwgfx: Relax permission checking when opening surfaces Greg Kroah-Hartman
2017-04-10 16:41 ` [PATCH 4.10 005/110] drm/vmwgfx: Remove getparam error message Greg Kroah-Hartman
2017-04-10 16:41 ` [PATCH 4.10 006/110] drm/vmwgfx: fix integer overflow in vmw_surface_define_ioctl() Greg Kroah-Hartman
2017-04-10 16:41 ` [PATCH 4.10 007/110] PCI: thunder-pem: Add legacy firmware support for Cavium ThunderX host controller Greg Kroah-Hartman
2017-04-10 16:41 ` [PATCH 4.10 008/110] PCI: thunder-pem: Fix legacy firmware PEM-specific resources Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 009/110] sysfs: be careful of error returns from ops->show() Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 010/110] staging: android: ashmem: lseek failed due to no FMODE_LSEEK Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 011/110] arm/arm64: KVM: Take mmap_sem in stage2_unmap_vm Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 012/110] arm/arm64: KVM: Take mmap_sem in kvm_arch_prepare_memory_region Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 013/110] kvm: arm/arm64: Fix locking for kvm_free_stage2_pgd Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 014/110] iio: core: Fix IIO_VAL_FRACTIONAL_LOG2 for negative values Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 015/110] iio: st_pressure: initialize lps22hb bootime Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 016/110] iio: bmg160: reset chip when probing Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 017/110] arm64: mm: unaligned access by user-land should be received as SIGBUS Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 018/110] cfg80211: check rdev resume callback only for registered wiphy Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 019/110] Reset TreeId to zero on SMB2 TREE_CONNECT Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 020/110] mm/page_alloc.c: fix print order in show_free_areas() Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 021/110] ptrace: fix PTRACE_LISTEN race corrupting task->state Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 022/110] dax: fix radix tree insertion race Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 023/110] dm verity fec: limit error correction recursion Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 024/110] dm verity fec: fix bufio leaks Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 025/110] ACPI / gpio: do not fall back to parsing _CRS when we get a deferral Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 026/110] ACPI / scan: Prefer devices without _HID for _ADR matching Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 027/110] Kbuild: use cc-disable-warning consistently for maybe-uninitialized Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 028/110] jump label: fix passing kbuild_cflags when checking for asm goto support Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 029/110] orangefs: move features validation to fix filesystem hang Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 030/110] xfs: Honor FALLOC_FL_KEEP_SIZE when punching ends of files Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 031/110] ring-buffer: Fix return value check in test_ringbuffer() Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 032/110] mac80211: unconditionally start new netdev queues with iTXQ support Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 033/110] brcmfmac: use local iftype avoiding use-after-free of virtual interface Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 034/110] metag/usercopy: Drop unused macros Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 035/110] metag/usercopy: Fix alignment error checking Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 036/110] metag/usercopy: Add early abort to copy_to_user Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 037/110] metag/usercopy: Zero rest of buffer from copy_from_user Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 038/110] metag/usercopy: Set flags before ADDZ Greg Kroah-Hartman
2017-04-10 16:42   ` Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 039/110] metag/usercopy: Fix src fixup in from user rapf loops Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 040/110] metag/usercopy: Add missing fixups Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 041/110] drm/msm: adreno: fix build error without debugfs Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 042/110] powerpc: Disable HFSCR[TM] if TM is not supported Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 043/110] powerpc/mm: Add missing global TLB invalidate if cxl is active Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 044/110] powerpc/64: Fix flush_(d|i)cache_range() called from modules Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 045/110] powerpc: Dont try to fix up misaligned load-with-reservation instructions Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 046/110] powerpc/crypto/crc32c-vpmsum: Fix missing preempt_disable() Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 048/110] x86/mce: Dont print MCEs when mcelog is active Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 049/110] nios2: reserve boot memory for device tree Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 050/110] xtensa: make __pa work with uncached KSEG addresses Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 051/110] s390/decompressor: fix initrd corruption caused by bss clear Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 052/110] s390/uaccess: get_user() should zero on failure (again) Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 053/110] MIPS: Force o32 fp64 support on 32bit MIPS64r6 kernels Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 054/110] MIPS: ralink: Fix typos in rt3883 pinctrl Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 055/110] MIPS: End spinlocks with .insn Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 056/110] MIPS: Lantiq: fix missing xbar kernel panic Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 057/110] MIPS: Check TLB before handle_ri_rdhwr() for Loongson-3 Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 058/110] MIPS: Add MIPS_CPU_FTLB for Loongson-3A R2 Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 059/110] MIPS: Flush wrong invalid FTLB entry for huge page Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 060/110] MIPS: c-r4k: Fix Loongson-3s vcache/scache waysize calculation Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 061/110] drm/i915/gvt: Fix gvt scheduler interval time Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 062/110] drm/i915/kvmgt: fix suspicious rcu dereference usage Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 063/110] usb: dwc3: gadget: delay unmap of bounced requests Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 064/110] Documentation: stable-kernel-rules: fix stable-tag format Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 065/110] mm/mempolicy.c: fix error handling in set_mempolicy and mbind Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 066/110] random: use chacha20 for get_random_int/long Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 067/110] kvm: fix page struct leak in handle_vmon Greg Kroah-Hartman
2017-04-10 16:42 ` [PATCH 4.10 068/110] HID: multitouch: enable the Surface 4 Type Cover Pro (JP) to report multitouch data Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 069/110] drm/edid: constify edid quirk list Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 070/110] drm/i915: fix INTEL_BDW_IDS definition Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 071/110] drm/i915: more .is_mobile cleanups for BDW Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 072/110] drm/i915: actually drive the BDW reserved IDs Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 073/110] ASoC: Intel: bytcr_rt5640: quirks for Insyde devices Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 074/110] ARM: OMAP2+: Fix init for multiple quirks for the same SoC Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 075/110] usb: chipidea: msm: Rely on core to override AHBBURST Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 076/110] serial: 8250_omap: Add OMAP_DMA_TX_KICK quirk for AM437x Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 077/110] ARM: davinci: add skeleton for pdata-quirks Greg Kroah-Hartman
2017-04-11  8:13   ` Sekhar Nori
2017-04-11 14:41     ` Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 079/110] usb: host: xhci-plat: enable BROKEN_PED quirk if platform requested Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 080/110] usb: dwc3: host: pass quirk-broken-port-ped property for known broken revisions Greg Kroah-Hartman
2017-04-10 16:43 ` Greg Kroah-Hartman [this message]
2017-04-10 16:43 ` [PATCH 4.10 082/110] PCI: Add ACS quirk for Intel Union Point Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 083/110] PCI: xgene: Fix double free on init error Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 084/110] [media] rx51: broken build Greg Kroah-Hartman
2017-04-11 11:44   ` Sean Young
2017-04-11 14:42     ` Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 085/110] sata: ahci-da850: implement a workaround for the softreset quirk Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 086/110] ACPI / button: Change default behavior to lid_init_state=open Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 087/110] ASoC: codecs: rt5670: add quirk for Lenovo Thinkpad 10 Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 088/110] ASoC: Intel: Baytrail: " Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 089/110] ASoC: Intel: cht_bsw_rt5645: harden ACPI device detection Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 090/110] ASoC: Intel: cht_bsw_rt5645: add Baytrail MCLK support Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 091/110] ACPI: save NVS memory for Lenovo G50-45 Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 092/110] usb: musb: da8xx: Fix host mode suspend Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 094/110] HID: wacom: dont apply generic settings to old devices Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 095/110] arm: kernel: Add SMC structure parameter Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 096/110] firmware: qcom: scm: Fix interrupted SCM calls Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 097/110] ARM: smccc: Update HVC comment to describe new quirk parameter Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 098/110] PCI: Add Broadcom Northstar2 PAXC quirk for device class and MPSS Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 099/110] PCI: Disable MSI for HiSilicon Hip06/Hip07 Root Ports Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 100/110] mmc: sdhci-of-esdhc: remove default broken-cd for ARM Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 101/110] PCI: Sort the list of devices with D3 delay quirk by ID Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 102/110] PCI: Add ACS quirk for Qualcomm QDF2400 and QDF2432 Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 103/110] watchdog: s3c2410: Fix infinite interrupt in soft mode Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 105/110] tools/power turbostat: decode Baytrail CC6 and MC6 demotion configuration Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 106/110] tools/power turbostat: dump Atom P-states correctly Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 107/110] x86/reboot/quirks: Add ASUS EeeBook X205TA reboot quirk Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 108/110] x86/reboot/quirks: Add ASUS EeeBook X205TA/W " Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 109/110] usb-storage: Add ignore-residue quirk for Initio INIC-3619 Greg Kroah-Hartman
2017-04-10 16:43 ` [PATCH 4.10 110/110] x86/reboot/quirks: Fix typo in ASUS EeeBook X205TA reboot quirk Greg Kroah-Hartman
2017-04-10 20:39 ` [PATCH 4.10 000/110] 4.10.10-stable review Shuah Khan
2017-04-11  4:58   ` Greg Kroah-Hartman
2017-04-10 23:58 ` Andre Tomt
2017-04-11  4:55   ` Greg Kroah-Hartman
2017-04-11  3:17 ` Guenter Roeck
2017-04-11  4:48   ` Greg Kroah-Hartman
2017-04-11  5:04     ` Guenter Roeck
2017-04-11  5:02 ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170410164205.693960506@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=alexander.deucher@amd.com \
    --cc=alexander.levin@verizon.com \
    --cc=daniel.vetter@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.