Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2269878ybi; Thu, 18 Jul 2019 06:00:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqzI9eVWIDNn39/GyqfSIbo3hrn48y5XOBgXxQdhwvG0dYjcCz/6EDKSlDUWGBcU2dpjjFtj X-Received: by 2002:a65:4c4d:: with SMTP id l13mr7352063pgr.156.1563454802875; Thu, 18 Jul 2019 06:00:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563454802; cv=none; d=google.com; s=arc-20160816; b=cHDm6wuTiIZxgZCBQ/By8ugdfEoU0Vmp1yZZqTHujhO7F09iWUa/sfcG+8+GZqTpY7 Ni6g6yRd3s+zBcFyI4+J4AP8iQrcc2h7pQoNk+3U4rkEbHC3jyPzkxGOzz4Yaji9nnSg Il6z6IuV0O/8YprBUW3EIAqmUAHC5Kh67hR7/wv67x3i2SuWU6QEtDn1Zakb3ErC6iEI PJQUEvlXPcuPDMKam63PICdv/le6G9+fDeU2uvw+wME/lAoYEyJL0UJkiwJKyS8R6QKc 6vVzw8AFPPg/csOljjPcWxJgBsXl/28WxHPAH9qlpGAoUQcKmb3ORwlXuhomnQZ9Azcu AfDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=xzSmfnXRcQ0lncJ4oY1al5Tz1krJ5LsMFDXPD4J+9Yg=; b=XImIQMAMBDwEZCjKJ9h5Bl1Q8lEErTtC+lPVX6+oki153EgJV9fvh2d6h2swLNhvzh QAVkGfcrpJ9SFvBJh+j5y9kCTtYMshb5yQr2VMP+Oc9QZKx56nfFdWFSd+o7AUpUCXWL MaH829r6VuW7bAGfR/3NPnPhxGBNH23qC9XMtfoA7ttzitYcn36xUYC1B3SPRzomKlK5 6sAq51TeYqWA+QYjAE46//u328YqIC3zy/JV8aiN0teSdUB9zgp3X4u/lrFNDipPoeWy UB99SlluG7GxRqJ88xlf1zVd3xWXAmZkwPbgKR6lyrAYIhC77zh7bruh3hCWl8qzsfdW OvbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=vrDiNZ9R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p16si601551pgh.410.2019.07.18.05.59.45; Thu, 18 Jul 2019 06:00:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=vrDiNZ9R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390365AbfGRM7I (ORCPT + 99 others); Thu, 18 Jul 2019 08:59:08 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:42459 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390336AbfGRM7I (ORCPT ); Thu, 18 Jul 2019 08:59:08 -0400 Received: by mail-wr1-f68.google.com with SMTP id x1so13597075wrr.9 for ; Thu, 18 Jul 2019 05:59:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xzSmfnXRcQ0lncJ4oY1al5Tz1krJ5LsMFDXPD4J+9Yg=; b=vrDiNZ9Rnx+Zqc1cpL3YQZDzoErYg0d+VFDXepCbcF5cGqaeFx3c5BM0tQ4QkrU+Dy eFw7529GaRzASlFP2QTx4bc+pWcBPFWDu83jKCCl5zrzGxW6xXSB6aB78CJM2XP/7g6G m4Qj9Xmmtms+/YX1I6yLI3HSgIxoQjQo6HVkQ3S2L3MccYLA3RNRhq2hYgbFhvO2XjbT RhPHTJqDlRmTuE2cHcHNErAT2w67a168Rqb9Dhq/MDemJRn86AupD5qAmlvHcKGLjcTX M/bfxIMC6vKZw+ZYxrx2/4R+pffU7qa4XIVMpKXPSyIY44DjzV9bD3Ie/idMEctL5wDk JkNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xzSmfnXRcQ0lncJ4oY1al5Tz1krJ5LsMFDXPD4J+9Yg=; b=dfShGhYaOrO1eWzLs8WFw1WftRPna2j8TaLMNCcHt9hUgb+GnYkzFIwm2ltGZncKVP eOqNIQ3oQljJ0uLan8uL8RPR+BxLIMEHKmUULILufT/SXQtbTIxKfqrXqzaSlai34wMm ygR0IBs1IukMSOgp2vx9Z36B8QRBzMBKK+EVuw7dOXkoOjYKa2PtClLo7PPH1MVyqisN EF40n/0O8r+fW95d4HJlr5dRSTluMoopHCL9NfPlVXDqxig7sap6qWpdDuzGW5sZR5Nw +YfWlYTcqfU5i8mW51IhbIdAsnEiaL84C50mLWffwLOc9RK6wckaID1/vE3zJHvUCVVl v3JA== X-Gm-Message-State: APjAAAVKgRNBLEV1ASddeZtO+TCs3FjXvjIE5qiaffoiZdoCV05jG/90 lMlefS54C20bBItfg6wI3yaR+xrYQygz83OfLFjr X-Received: by 2002:adf:a344:: with SMTP id d4mr49759564wrb.237.1563454745883; Thu, 18 Jul 2019 05:59:05 -0700 (PDT) MIME-Version: 1.0 References: <20190718020745.8867-1-fred@fredlawl.com> <20190718020745.8867-2-fred@fredlawl.com> In-Reply-To: <20190718020745.8867-2-fred@fredlawl.com> From: Bjorn Helgaas Date: Thu, 18 Jul 2019 07:58:52 -0500 Message-ID: Subject: Re: [PATCH] drm/amdgpu: Prefer pcie_capability_read_word() To: Frederick Lawler Cc: David Airlie , daniel@ffwll.ch, amd-gfx@lists.freedesktop.org, DRI mailing list , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 17, 2019 at 9:08 PM Frederick Lawler wrote: > > Commit 8c0d3a02c130 ("PCI: Add accessors for PCI Express Capability") > added accessors for the PCI Express Capability so that drivers didn't > need to be aware of differences between v1 and v2 of the PCI > Express Capability. > > Replace pci_read_config_word() and pci_write_config_word() calls with > pcie_capability_read_word() and pcie_capability_write_word(). > > Signed-off-by: Frederick Lawler > - pci_read_config_word(adev->pdev, gpu_pos + PCI_EXP_LNKCTL2, &tmp16); > + pcie_capability_read_word(adev->pdev, > + PCI_EXP_LNKCTL2, > + &tmp16); > tmp16 &= ~((1 << 4) | (7 << 9)); > tmp16 |= (gpu_cfg2 & ((1 << 4) | (7 << 9))); Same comments as for radeon. Looks like a lot of similar code between radeon and amdgpu.