From patchwork Tue Nov 12 17:35:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 11239875 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8997616B1 for ; Tue, 12 Nov 2019 17:35:19 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7109D21D7F for ; Tue, 12 Nov 2019 17:35:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7109D21D7F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CCB766E951; Tue, 12 Nov 2019 17:35:16 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id DD6076E951; Tue, 12 Nov 2019 17:35:15 +0000 (UTC) Received: from localhost (unknown [69.71.4.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7CB18214E0; Tue, 12 Nov 2019 17:35:15 +0000 (UTC) From: Bjorn Helgaas To: Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , David Zhou , David Airlie , Daniel Vetter Subject: [PATCH V3 0/3] drm: replace magic numbers Date: Tue, 12 Nov 2019 11:35:00 -0600 Message-Id: <20191112173503.176611-1-helgaas@kernel.org> X-Mailer: git-send-email 2.24.0.rc1.363.gb1bccd3e3d-goog MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573580115; bh=+4EzQSM/k1VOif0/E/W/Xzv0GPRgNyMJHG5BQwoLXVU=; h=From:To:Cc:Subject:Date:From; b=mceh4Ur/VUEpqNhsdVlcNrzbKQFA3I3i+cQuPTI008T6RWy3FC2d15H05pRpKd3BW jWQWNqALKkTJyK/FbmzWRaDCohiyixeo0KKI1QAU4toEhNq++YbHzZVlVjoHQeVyeT 1bmiyZkFCmbQ0PnoDeuOgGmZUQ6HFRsRubGkHM00= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Frederick Lawler , linux-pci@vger.kernel.org, =?utf-8?q?Michel_D=C3=A4nzer?= , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Bjorn Helgaas Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Bjorn Helgaas amdgpu and radeon do a bit of mucking with the PCIe Link Control 2 register, some of it using hard-coded magic numbers. The idea here is to replace those with #defines. Since v2: - Fix a gpu_cfg2 case in amdgpu/si.c that I had missed - Separate out the functional changes for better bisection (thanks, Michel!) - Add #defines in a patch by themselves (so a GPU revert wouldn't break other potential users) - Squash all the magic number -> #define changes into one patch Since v1: - Add my signed-off-by and Alex's reviewed-by. Bjorn Helgaas (3): PCI: Add #defines for Enter Compliance, Transmit Margin drm: correct Transmit Margin masks drm: replace numbers with PCI_EXP_LNKCTL2 definitions drivers/gpu/drm/amd/amdgpu/cik.c | 22 ++++++++++++++-------- drivers/gpu/drm/amd/amdgpu/si.c | 22 ++++++++++++++-------- drivers/gpu/drm/radeon/cik.c | 22 ++++++++++++++-------- drivers/gpu/drm/radeon/si.c | 22 ++++++++++++++-------- include/uapi/linux/pci_regs.h | 2 ++ 5 files changed, 58 insertions(+), 32 deletions(-) Reviewed-by: Alex Deucher