From patchwork Sun Sep 25 02:10:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sinan Kaya X-Patchwork-Id: 9349415 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 0C2696077A for ; Sun, 25 Sep 2016 02:10:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA6C628E99 for ; Sun, 25 Sep 2016 02:10:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF16328E9D; Sun, 25 Sep 2016 02:10:49 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 6D94728E9B for ; Sun, 25 Sep 2016 02:10:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965516AbcIYCKn (ORCPT ); Sat, 24 Sep 2016 22:10:43 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:59674 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965459AbcIYCKm (ORCPT ); Sat, 24 Sep 2016 22:10:42 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id ACA83612F8; Sun, 25 Sep 2016 02:10:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1474769441; bh=BvLZUQbOesu04RZUErdy7pazHaxrqKJpwUoGIPQcjzY=; h=From:To:Cc:Subject:Date:From; b=kdLsTdWLoJWLRwr8EObfn7NW4ECx9hUcBfWgdxD6kEMk1HryBzgtOgkm3bbZqs3qN +CqThtxfS2U/GL/PIU8XH3tPAMGb2sO8zMW46oZGe6oEJUp4xxEw2l7zH6WsCEqXAI 4HCmvzkp6favaH4wjdvLOVrB72GvPbzdmRPhNUA4= Received: from drakthul.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 462C4612F6; Sun, 25 Sep 2016 02:10:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1474769441; bh=BvLZUQbOesu04RZUErdy7pazHaxrqKJpwUoGIPQcjzY=; h=From:To:Cc:Subject:Date:From; b=kdLsTdWLoJWLRwr8EObfn7NW4ECx9hUcBfWgdxD6kEMk1HryBzgtOgkm3bbZqs3qN +CqThtxfS2U/GL/PIU8XH3tPAMGb2sO8zMW46oZGe6oEJUp4xxEw2l7zH6WsCEqXAI 4HCmvzkp6favaH4wjdvLOVrB72GvPbzdmRPhNUA4= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 462C4612F6 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=okaya@codeaurora.org From: Sinan Kaya To: linux-pci@vger.kernel.org, timur@codeaurora.org, cov@codeaurora.org, vikrams@codeaurora.org Cc: linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sinan Kaya , linux-kernel@vger.kernel.org Subject: [PATCH] PCI: enable extended tags support for PCIe endpoints Date: Sat, 24 Sep 2016 22:10:34 -0400 Message-Id: <1474769434-5756-1-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 1.9.1 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 Each PCIe device can issue up to 32 transactions at a time by default. Each transaction is tracked by a tag number on the bus. 32 outstanding transactions is not enough for some performance critical applications especially when a lot of small sized frames are transmitted. Extended tags support increases this number to 256. Devices not supporting extended tags tie-off this field to 0. According to ECN, it is safe to enable this feature for all PCIe endpoints. Signed-off-by: Sinan Kaya --- drivers/pci/probe.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 93f280d..2424f38 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1505,12 +1505,19 @@ static void program_hpp_type2(struct pci_dev *dev, struct hpp_type2 *hpp) */ } +static int pci_configure_extended_tags(struct pci_dev *dev) +{ + return pcie_capability_set_word(dev, PCI_EXP_DEVCTL, + PCI_EXP_DEVCTL_EXT_TAG); +} + static void pci_configure_device(struct pci_dev *dev) { struct hotplug_params hpp; int ret; pci_configure_mps(dev); + pci_configure_extended_tags(dev); memset(&hpp, 0, sizeof(hpp)); ret = pci_get_hp_params(dev, &hpp);