Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp383354imm; Thu, 12 Jul 2018 22:15:28 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc+svoKZYQu84CWi7NNyp3aGcl7F/mdlB4S498SVkmp7VSbY4NRalk+1WbHXkywjzQAMp1I X-Received: by 2002:a65:40cd:: with SMTP id u13-v6mr4788407pgp.334.1531458928409; Thu, 12 Jul 2018 22:15:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531458928; cv=none; d=google.com; s=arc-20160816; b=Y47INbhwTNESSN8nTwaqNeOAegegx87R9gP5Y7wajzCjIwjwKTjzK6oOkHPCWFKsM6 GuKzLNfaUC9Q2FYmxB8/do4BFnQmRuU3+iDnrjBirMtPmvXiSttxML5edKYdmSPJaSVa xxXpseIxUlwjWM2ysNeA2h1HFmbAptv8CiU5obLxTvCiDVSrnlDIL7Lqvz35ZHm2dp4l cWrbVRntwasQN2u4eghTwUqs6FkmX/8UdnzATafnpNyimYc5yQ/G4pO2ehG9sViSvD85 iYVXAiTkmTX/hQ6OpBXq0C6NmNfYoQvSC0deLly5wXcRWsR3cuuZ4010NxpT129ZtgDg coCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=lGSfpkRE8VVCKV+i2u+Qy7pulwIOkv1O2fc9USFdSxc=; b=n2mLh99bYco08/nDK0L6ySrPmYHFg5nYcxnIYvOV1iTVZPVmAqVvXYZEJkpsjTMSeV 9LCMtwTxhPKw4Le2ypUwMi4paU3KjB7WLSNvRtRyCj1ZvtMr79Fc/ze0Vk5OOsxHHcLl cJ4GFcqSh0pRuyf5a+21NKRzmgQ0DLxuUHGE5jJEVsffwzBJZVu2rx+vRrTjAeQmCi6k Y7VRvEU3nK6aLgl3LCSxHEbgnYigfGo5DRslfJCTqOtu5sEVIiKOIffYGWFZXgqwfcDl RW7lxIqiwX8giFopb0J97p3tlPYdIIL708BwIpAyc9xkx+RwTb15q30LkgVrwBZQ2cvc qnkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=H0krVt+V; dkim=pass header.i=@codeaurora.org header.s=default header.b=H0krVt+V; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m1-v6si22451751pge.531.2018.07.12.22.15.13; Thu, 12 Jul 2018 22:15:28 -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=@codeaurora.org header.s=default header.b=H0krVt+V; dkim=pass header.i=@codeaurora.org header.s=default header.b=H0krVt+V; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726202AbeGMF1f (ORCPT + 99 others); Fri, 13 Jul 2018 01:27:35 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:52030 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725900AbeGMF1f (ORCPT ); Fri, 13 Jul 2018 01:27:35 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id BF5B360B10; Fri, 13 Jul 2018 05:14:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1531458878; bh=D0es5P1WT4M6hq3pICTqvGE1X50oxGPhXQE1A4StQM8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=H0krVt+V52b+oABovD7pz3Ec2W+32AtFdgQH3h1knIkXXLakZYeS5yU0Jooy0dCTN dUqoAbq5IYt/mnveqEsO5y8qpU0F6XdUclvhqzT7Nj+ywCNylTkjPj3zIxMyVBQe8P tFgB56kMX94//9cW9mpiums9WiXuF2ULpXu2ubcI= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 673D360250; Fri, 13 Jul 2018 05:14:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1531458878; bh=D0es5P1WT4M6hq3pICTqvGE1X50oxGPhXQE1A4StQM8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=H0krVt+V52b+oABovD7pz3Ec2W+32AtFdgQH3h1knIkXXLakZYeS5yU0Jooy0dCTN dUqoAbq5IYt/mnveqEsO5y8qpU0F6XdUclvhqzT7Nj+ywCNylTkjPj3zIxMyVBQe8P tFgB56kMX94//9cW9mpiums9WiXuF2ULpXu2ubcI= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 13 Jul 2018 10:44:38 +0530 From: poza@codeaurora.org To: Bharat Kumar Gogada Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, bhelgaas@google.com, linux-pci-owner@vger.kernel.org Subject: Re: [PATCH] PCI/AER: Enable SERR# forwarding in non ACPI flow In-Reply-To: <1531406719-18606-1-git-send-email-bharat.kumar.gogada@xilinx.com> References: <1531406719-18606-1-git-send-email-bharat.kumar.gogada@xilinx.com> Message-ID: X-Sender: poza@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-07-12 20:15, Bharat Kumar Gogada wrote: > Currently PCI_BRIDGE_CTL_SERR is being enabled only in > ACPI flow. > This bit is required for forwarding errors reported > by EP devices to upstream device. > This patch enables SERR# for Type-1 PCI device. > > Signed-off-by: Bharat Kumar Gogada > --- > drivers/pci/pcie/aer.c | 23 +++++++++++++++++++++++ > 1 files changed, 23 insertions(+), 0 deletions(-) > > diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c > index a2e8838..943e084 100644 > --- a/drivers/pci/pcie/aer.c > +++ b/drivers/pci/pcie/aer.c > @@ -343,6 +343,19 @@ int pci_enable_pcie_error_reporting(struct pci_dev > *dev) > if (!dev->aer_cap) > return -EIO; > > + if (!IS_ENABLED(CONFIG_ACPI) && > + dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { > + u16 control; > + > + /* > + * A Type-1 PCI bridge will not forward ERR_ messages coming > + * from an endpoint if SERR# forwarding is not enabled. > + */ > + pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &control); > + control |= PCI_BRIDGE_CTL_SERR; > + pci_write_config_word(dev, PCI_BRIDGE_CONTROL, control); > + } > + > return pcie_capability_set_word(dev, PCI_EXP_DEVCTL, > PCI_EXP_AER_FLAGS); > } > EXPORT_SYMBOL_GPL(pci_enable_pcie_error_reporting); > @@ -352,6 +365,16 @@ int pci_disable_pcie_error_reporting(struct > pci_dev *dev) > if (pcie_aer_get_firmware_first(dev)) > return -EIO; > > + if (!IS_ENABLED(CONFIG_ACPI) && > + dev->hdr_type == PCI_HEADER_TYPE_BRIDGE) { > + u16 control; > + > + /* Clear SERR Forwarding */ > + pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &control); > + control &= ~PCI_BRIDGE_CTL_SERR; > + pci_write_config_word(dev, PCI_BRIDGE_CONTROL, control); > + } > + > return pcie_capability_clear_word(dev, PCI_EXP_DEVCTL, > PCI_EXP_AER_FLAGS); > } Should this configuration no be set by Firmware ? why should Linux dictate it ? Regards, Oza.