Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1483303pxb; Wed, 10 Feb 2021 09:18:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJyMlTg2FcVK2RZoAMc6xMCwkZ7XgOAkUMMptdH7/vi0Vb8f3nTl2CWsISblKKhFik9hOmp3 X-Received: by 2002:a17:906:1d53:: with SMTP id o19mr4031021ejh.512.1612977502298; Wed, 10 Feb 2021 09:18:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612977502; cv=none; d=google.com; s=arc-20160816; b=Awn0Dg4lApV2cNBJN7TSRu4aVpTCI6OHaeAB3sPNO7Ihafjjep0aAVKLrKHFR56Nv5 AubC+KSOllUv78CL830XRGAv9iRve72dV/xq57X3OL1AUN7HQK0rsl9KFgRID7O9Jivr pPRox0rYM4TRKqBSiMPRZ4wq8snVHhP0rALcklSx0CWTFoo+3SRLDZNMYmmPGIbParwr /GVWY4hgpdDS1H+2dBg1qQ6yCqBnRK7rbZhkRwvf9LeTPKHTe1Bn/vbvWxmwAx63p9gU fkl5zyn8EaB4l6CXQXwZDgl252KS13k/r4eukdk+/qCcWTV1hKsd7NIjIQYYoiE3Le5D 0Lqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=zRGrC1gvxYUUpwYb7w7anX6wHYzZJGOo9ioM3U9cZD4=; b=hG2JGu2P9rLe491ZdUAgFjVfym044+IsNnaApUxmOLAGPqslTrLOs5l1vD8Co4eOuv 6pAeXcjwJpPEFD+kDm+ejGid/5dx8LRX5Dg7xEnAxc2KNaUY6TrSAa2Z2JeZbdBcWNRt ceyBEE+suRnLaj2YzjHew9F8HiZpXVBbYpS1eZOqDMJDhv0DZBEne6MOJkTdKIMFU4lw sO0cAMG43sRuRcnK0J5Ygepg8heYXcoh/3S56ysd5tlx9v+sHjBpAaXfwg5is+oAH0/c NMiepqvVZ67TrysUYQ8SwYdGR6ITIxkLWH30rrjSHqPoi0PWNqBT3kkM3w0ZmCrm/EA3 Afig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 10si1808781ejw.219.2021.02.10.09.17.58; Wed, 10 Feb 2021 09:18:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232180AbhBJROE (ORCPT + 99 others); Wed, 10 Feb 2021 12:14:04 -0500 Received: from mail-wr1-f45.google.com ([209.85.221.45]:45928 "EHLO mail-wr1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232359AbhBJRNS (ORCPT ); Wed, 10 Feb 2021 12:13:18 -0500 Received: by mail-wr1-f45.google.com with SMTP id m13so3378470wro.12; Wed, 10 Feb 2021 09:13:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=zRGrC1gvxYUUpwYb7w7anX6wHYzZJGOo9ioM3U9cZD4=; b=RI8LvvWbXhrlpIuJBMCz+ufVVezIvuoc+A9P+so+NzhQJQssbX5CXZyxbZzbLeyLRU ECKa/o5646YFL0oArktHvZgoYwQNtQcC00195IVY2BtjcVAtJKn8j7NnxCe06q63WRuY LVfSBmMGxLEQBzd8ISRkYsdYCRFNErZzJgPXC7dzQN8r9zFkMZfgMmzEy9TGLVP0qngc NUYgotTkisF9ZQxUtfCk/GhQ2JHDgaoSKmVnCYi23gUNrcHfA1++fLVKScTFTnlwIDQ1 RSCENvix6L5SvqGm2PfVCfMJJvpxbyTnEspmnO4eZDVstIEj55mFpEgtdKfi8w8wQVMt TXkg== X-Gm-Message-State: AOAM530KrEjzBpWE8/9P4AxSjeadUTjNqzWFuxhgttpgWHHVXz1COQcf 7ngS/Y1/W0z8s87Rnjt2khPWaQ7Oo7l3jA== X-Received: by 2002:adf:f54c:: with SMTP id j12mr4612293wrp.175.1612977158025; Wed, 10 Feb 2021 09:12:38 -0800 (PST) Received: from rocinante ([95.155.85.46]) by smtp.gmail.com with ESMTPSA id s10sm3787674wrm.5.2021.02.10.09.12.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Feb 2021 09:12:37 -0800 (PST) Date: Wed, 10 Feb 2021 18:12:36 +0100 From: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= To: Qiuxu Zhuo Cc: Bjorn Helgaas , Sean V Kelley , "Luck, Tony" , "Jin, Wen" , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] PCI/RCEC: Fix failure to inject errors to some RCiEP devices Message-ID: References: <20210210020516.95292-1-qiuxu.zhuo@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210210020516.95292-1-qiuxu.zhuo@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Qiuxu, Nice catch! Thank you for sending the fix over! [...] > On a Sapphire Rapids server, it failed to inject correctable errors > to the RCiEP device e8:02.0 which was associated with the RCEC device > e8:00.4. See the following error log before applying the patch: > > aer-inject -s e8:02.0 examples/correctable > Error: Failed to write, No such device > > This was because rcec_assoc_rciep() mistakenly used "rciep->devfn" as > device number to check whether the corresponding bit was set in > the RCiEPBitmap of the RCEC. So that the RCiEP device e8:02.0 wasn't > linked to the RCEC and resulted in the above error. > > Fix it by using PCI_SLOT() to convert rciep->devfn to device number. > Ensure that the RCiEP devices associated with the RCEC are linked to > the RCEC as the RCEC is enumerated. After applying the patch, correctable > errors can be injected to the RCiEP successfully. Would this only affect error injection or would this be also a generic problem with the driver itself causing issues regardless of whether it was an error injection or not for this particular device? I am asking, as there is a lot going on in the commit message. I wonder if simplifying this commit message so that it clearly explains what was broken, why, and how this patch is fixing it, would perhaps be an option? The backstory of how you found the issue while doing some testing and error injection is nice, but not sure if needed. What do you think? Krzysztof