Received: by 10.213.65.68 with SMTP id h4csp2115745imn; Sun, 8 Apr 2018 20:06:29 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+O//H/1XrcjbybjJzBr+02QMffpWDaO62molL+mu9gNKN+kar8noSXRJ/TZfCuGMJeFOBW X-Received: by 10.98.185.15 with SMTP id z15mr20246893pfe.199.1523243189902; Sun, 08 Apr 2018 20:06:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243189; cv=none; d=google.com; s=arc-20160816; b=jcRCqfB/IGWQ08xsImTSvD2iwWMtZidFogjzid8gyu4pi63X9krxljomr6Jh9ia63U 8Pz37BrClh22Bxgv3j7eKGgpHgXtwXrcjXJsbLQ6eoYXP7Nd3/FSiQTTHwqlyrhUF0zU pS/vBMzDXtQrTETUSedisve2Gp91S0zeXhga0fp4XUnqI5sPU4rGuPDFSxHZx5OFnxkW o2FvsrOfnXn5M7bHYL+Ii9c4GIT2k3CNYNOk17SbWiXdUWWFeRba9d3cDctGuG91mC06 Fh5FnqCgQyrRPNgWtBwBb2SJXyXzP6Jhb8OwEYKF4Pmxq3KsLKWbSJ2A+goV6lmhbSNs f40w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=i74QuB/baBah8EhUf/8zfE5JSDlEl0W4495P8hvN6Ds=; b=yJerTWtm7BmNlKzsGzwthuPQo3J7IV+6Mc10BMfmOKc0Yq4PD9v6hzWYnxberfw+90 bk5+1LRPyRUpn2oThNWLApcn7uAM7Zz3H7yKZGCebHC2RRBU3zvD8fL5tR3HI3QsbDkn HGg+RcUiQiRigm4/WPAwn7+atRuC5saAba+tmjEPCePJrAYzWPnYBSP8I/hWP/v0XQvl KkeWES5FVSwVM5EKZqvt/hjFE/Gvpe81FApmzQWujTobvTTRfaAxbpf7lQw0HWzrDP81 0OhVnWnliHW16u5LxEf/nHOUnxgHwgpZD6KgIyA90+W49ujpO7cYdDcSB/E+PsxhQtGp SZiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=BsAh6DUa; 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=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y13si12067162pfd.47.2018.04.08.20.05.52; Sun, 08 Apr 2018 20:06:29 -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=@microsoft.com header.s=selector1 header.b=BsAh6DUa; 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=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756293AbeDIAb1 (ORCPT + 99 others); Sun, 8 Apr 2018 20:31:27 -0400 Received: from mail-by2nam03on0126.outbound.protection.outlook.com ([104.47.42.126]:54752 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754839AbeDIAbV (ORCPT ); Sun, 8 Apr 2018 20:31:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=i74QuB/baBah8EhUf/8zfE5JSDlEl0W4495P8hvN6Ds=; b=BsAh6DUaQbt0+ikOvz2v58Ok4jPRq+dIZAHPJ7EFSP/cl0sgLho5PIxgmJhMZt2gxnfn5oXFXJMiAgk6wKWlzMKmaZGaiqYZ3CLuagdiwjgCb0V2KGTa+seO317ny+Fz8McadlLKscCED26hRmJ01t8sOtI/jD9s4S7aJqc3+us= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0917.namprd21.prod.outlook.com (52.132.132.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:31:16 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:31:16 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Bjorn Helgaas , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 167/293] PCI: Enable ECRC only if device supports it Thread-Topic: [PATCH AUTOSEL for 4.9 167/293] PCI: Enable ECRC only if device supports it Thread-Index: AQHTz5k1l51dP4XOK0KQtNTkA5ebew== Date: Mon, 9 Apr 2018 00:25:05 +0000 Message-ID: <20180409002239.163177-167-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0917;7:XOUqUUJrm00bJVeJH+dBafdtlkRhASiVMnJPzetyR5HWB7E/09FXvM38NttC6B54di1yUenMs3COlg8UZe+Nnf7TKDFyFD5spJlIqTm2jQvyioSFqjcILv6eIZ5mrurQl3M2LQvmAlvPDaeKaFpW+EN/bR7kmwMGz+YjuEfRTAY2s1eRDmPo+YKsYFr0lS+QqSzQgr7rhcq34cbPTs/cYr1WMLIkttE0oYg0S6uDvTv8V8hGSB5QRfVS2tOme7G3;20:XwS9wbcO7A9veUfB5AvnRibu6WI8adbQmCwbGuIRMlSMXCAgIVyJGdIXS2VLy1uK2zFbpTmOr7gQcpzF0qYGi11fSvr6NhFTRxMwjvfaF9YjznARIyWgBCw/p3G10qcBWSi9pwFgsEWPEHn2Sy/qoVXNtorVmE7Z7HHWbSoXt6I= X-MS-Office365-Filtering-Correlation-Id: 02a20fea-6215-49d1-d3dd-08d59db134a5 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603328)(7193020);SRVR:DM5PR2101MB0917; x-ms-traffictypediagnostic: DM5PR2101MB0917: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(211254476889703)(211936372134217)(153496737603132)(24339691489775)(211171220733660)(56004941905204); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0917;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0917; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39380400002)(39860400002)(366004)(396003)(346002)(376002)(189003)(199004)(99286004)(22452003)(106356001)(26005)(110136005)(478600001)(54906003)(10290500003)(316002)(1076002)(72206003)(186003)(4326008)(97736004)(66066001)(11346002)(25786009)(86362001)(575784001)(476003)(446003)(2906002)(6666003)(6486002)(105586002)(86612001)(3280700002)(3660700001)(6512007)(3846002)(6306002)(6116002)(6436002)(2616005)(486006)(53936002)(7736002)(8676002)(81166006)(81156014)(8936002)(68736007)(305945005)(10090500001)(76176011)(6506007)(102836004)(36756003)(107886003)(2900100001)(2501003)(14454004)(966005)(5660300001)(5250100002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0917;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: oZs1AM2wbJdsfHCQyNHDgyLZBB3D4gai5mgXKl6Cy3CLXYa6rif7XBPHM1YElFSysFGsXUd8W9Vc6ybvJSNlBEefTZMcMNlgQ0RA4bIlHeLidFJ7fkCamaO3nG4r5rubXjG099HY1Fl2BCwgus0hYo9Wly9HbZDK8bU3dwVYpah76fRXymNE28ty4SS12Tlm5gZUlruMkNVFMHP7t+USCNKFZsydsAYp642gZzrGlgjISAyitpFyWYRqn/xK9RGauRaEpHO4zMLjWQOQHnTY5HqN/mZdfh71E6HFK3rEyAoz1+oFLF/+mkHSdXmuWT19rrmrDpyHD5lj/ppQsAlcaheMGmlS6LLI1m1o+9U5ryYQrgbaipsDDi4FMoZDXaQns0wxgsOw+GC+UAQoRHZTh0UwyJ995XUIABcwDePOwYI= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 02a20fea-6215-49d1-d3dd-08d59db134a5 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:25:05.2064 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0917 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bjorn Helgaas [ Upstream commit 675734baa361cf044033bb60594dea33d8d8da36 ] John reported that an Intel QuickAssist crypto accelerator didn't work in a Dell PowerEdge R730. The problem seems to be that we enabled ECRC when the device doesn't support it: 85:00.0 Co-processor [0b40]: Intel Corporation DH895XCC Series QAT [8086:= 0435] Capabilities: [100 v1] Advanced Error Reporting AERCap: First Error Pointer: 00, GenCap- CGenEn+ ChkCap- ChkEn+ 1302fcf0d03e ("PCI: Configure *all* devices, not just hot-added ones") exposed the problem because it applies settings from the _HPX method to all devices, not just hot-added ones. The R730 supplies an _HPX method that allows the kernel to enable ECRC. Only enable ECRC if the device advertises support for it. Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1571798 Fixes: 1302fcf0d03e ("PCI: Configure *all* devices, not just hot-added ones= ") Reported-by: John Mazzie Signed-off-by: Bjorn Helgaas Signed-off-by: Sasha Levin --- drivers/pci/probe.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index a98be6db7e93..7f5178cb3415 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1536,6 +1536,11 @@ static void program_hpp_type2(struct pci_dev *dev, s= truct hpp_type2 *hpp) /* Initialize Advanced Error Capabilities and Control Register */ pci_read_config_dword(dev, pos + PCI_ERR_CAP, ®32); reg32 =3D (reg32 & hpp->adv_err_cap_and) | hpp->adv_err_cap_or; + /* Don't enable ECRC generation or checking if unsupported */ + if (!(reg32 & PCI_ERR_CAP_ECRC_GENC)) + reg32 &=3D ~PCI_ERR_CAP_ECRC_GENE; + if (!(reg32 & PCI_ERR_CAP_ECRC_CHKC)) + reg32 &=3D ~PCI_ERR_CAP_ECRC_CHKE; pci_write_config_dword(dev, pos + PCI_ERR_CAP, reg32); =20 /* --=20 2.15.1