Received: by 10.192.165.148 with SMTP id m20csp2013284imm; Sat, 28 Apr 2018 10:09:11 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpFxxdd2ZIGJpM+vgDgQoHi0QvxqMmd5KJXtvdkg7gmq4cd8AjUL/cXTicjFlP5wAvmomWb X-Received: by 2002:a17:902:22a:: with SMTP id 39-v6mr6661246plc.128.1524935351564; Sat, 28 Apr 2018 10:09:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524935351; cv=none; d=google.com; s=arc-20160816; b=rTFHw3P7oTd/zoZcVEyVaDT80d75qgcEoREjus0Mry5uTmmheeVux78ebSYyJZCplh v8eG/SOT9PKpKrcKXljEwQ4eQzW6KAZnWfEWUhDrV6+SUIbTj0NqkY+z1kAkqJY69sXJ twtbozAPkTh79TjXrjb4wp6m2X+tML2D3IJc0A/Xotsta1gZcu6ZVU+9VeoMLonHnz3O wCmYObFlGe0leuY3ZY2xSvE1+c5uUN52jSOiL76FEEB4lNG/mAmWNefFqJpPJ5dhfHkg rChL6T1A3JjoL4sA0vYReJZY8yIytpRA2Y1AelcHZAlnHD7rdu/jMzVKh23SUtiem1Nk iNsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:dkim-signature :arc-authentication-results; bh=CIDt2qv51r1bOItDlc5RhNE/7LKYSVmAu+YovgAOfW8=; b=GE5KrdUK6jNEfofM4La6+aC4pdk3wI+vTeVgRo4hWBuSvqfCiiBVpN8gp9GAbmvCXL dqkH7afzxy6VAqDnl5WMw1JSqy3AHEhl/mfatHZqWNpMrqX7UjOPYYwmgqt0b0b3eNF9 gZu7C/jkfE1gr2MOtOkd8z07AkvBFLn0qNuWFYNu4ZSlxgXMqBM4ulxR8v8zW7JmGD5T zpj7rMVYVw4CtLdVdJCG2G1SER2KhcEBfFn90xTkbP4yIR2vFO8eAf6xlPqHLms/x9wO NOZJ0FkwB2vNRRoYIzmKxwBi2hFeA9zc5Efs2+up2WrSN1kMlTfYuQ6QV7smFEUDSa3W Wk9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QvHYu8AE; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l9si3897883pff.270.2018.04.28.10.08.57; Sat, 28 Apr 2018 10:09:11 -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=@gmail.com header.s=20161025 header.b=QvHYu8AE; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758912AbeD1RHw (ORCPT + 99 others); Sat, 28 Apr 2018 13:07:52 -0400 Received: from mail-ot0-f196.google.com ([74.125.82.196]:34505 "EHLO mail-ot0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752121AbeD1RHu (ORCPT ); Sat, 28 Apr 2018 13:07:50 -0400 Received: by mail-ot0-f196.google.com with SMTP id i5-v6so5437778oth.1; Sat, 28 Apr 2018 10:07:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=CIDt2qv51r1bOItDlc5RhNE/7LKYSVmAu+YovgAOfW8=; b=QvHYu8AEruZQthreGQ2sC8JmBR2FP32nA4XX+S+RUfYl9KGuJlPRvXuS5R258dpr2g nZWUgjTQkl/7yXHGij1kDWK4YcSpt8qaNwIZxyeQI1PqC+lvoH8AYTZ3jC9iAfSXwYH8 Objln0M96AFJ94NgTXcKjUk4hYXKl/W7mmf13IsFUIupTNThJAgeZ7DC1QPrz0jGdIPs rggQ9lxB/6ZAIRsHQ/uPjY6RfN4EEuljS0iFn1V53guyFZ/SUzah3XfMyY+sfvU0rrtf Rst4z1e8UuEAcwS/v+lRd0iyxGfvO/f0F0KSpUJfwkOCu23zg68BJC6QvBMkfVdIsOYx X7Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=CIDt2qv51r1bOItDlc5RhNE/7LKYSVmAu+YovgAOfW8=; b=oUzTvrwAMFOggU62J2vW226d2LcxZzt0y6+UldU+XszmrkYs3u8U+ouvpsoQZF9hqL xtjjP4tOMo6FcJ2JHKRKvumfkkiKynZR1h/d3iPSufWk2OoWQdJvM2gVjtBuStDoFRYv Y3Hpk0lNhippXrPqypk5pPJSrdn78/we1t1oxYrZ3NZmhJ4kpKjtlc5IZzI46iJOlBhd qYJtpJtrxTd6jMNj18muHi28/uJy/Wt6euOAurp94Fp1qlgB0hBuH2j/ZK7/cYHOfcOQ 0K8u1PQ7NuYwVdF0ZrpO5+NduutsdaOLAOtGgAPmem8AJ4/T7UhmCs8jvbbY4SCljhTB ZAeQ== X-Gm-Message-State: ALQs6tD7XSkBsA9ZWSt17GstI7zur8EV8vQvrMtJ80JTXKqHH7sY+i8S veSIroc1NggGRtWe+/I+S6c= X-Received: by 2002:a9d:310b:: with SMTP id e11-v6mr4657919otc.84.1524935269875; Sat, 28 Apr 2018 10:07:49 -0700 (PDT) Received: from nukespec.gtech ([2601:2c1:8500:500b::e4e]) by smtp.gmail.com with ESMTPSA id g143-v6sm929409oic.53.2018.04.28.10.07.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Apr 2018 10:07:49 -0700 (PDT) Subject: Re: [PATCH RESEND] PCI/AER: Use a common function to print AER error bits From: "Alex G." To: Bjorn Helgaas Cc: bhelgaas@google.com, linux-pci@vger.kernel.org, gregkh@linuxfoundation.org, fred@fredlawl.com, linux-kernel@vger.kernel.org, alex_gagniuc@dellteam.com, austin_bolen@dell.com, keith.busch@intel.com References: <20180417170943.1767-1-mr.nuke.me@gmail.com> <20180427224337.GC73256@bhelgaas-glaptop.roam.corp.google.com> <12343e44-2d8a-51e1-a0be-e6804e9bd8a3@gmail.com> Message-ID: <220bb125-b933-abf3-7b30-63446634e8d6@gmail.com> Date: Sat, 28 Apr 2018 12:07:48 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <12343e44-2d8a-51e1-a0be-e6804e9bd8a3@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/28/2018 11:46 AM, Alex G. wrote: > On 04/27/2018 05:43 PM, Bjorn Helgaas wrote: >> On Tue, Apr 17, 2018 at 12:09:43PM -0500, Alexandru Gagniuc wrote: (snip) >>> +    memset(&info, 0, sizeof(info)); >>> +    info.severity = aer_severity; >>> +    info.status = status; >>> +    info.mask = mask; >>> +    info.first_error = 0x1f; >> >> I like this patch a lot, but where does this "first_error = 0x1f" come >> from? > > aer_(un)correctable_error_string don't go to [0x1f], so this guarantees > us we don't print "(First)". > >> I assume this is supposed to be the "First Error Pointer" in the >> Advanced Error Capabilities and Control register (PCIe r4.0, sec >> 7.8.4.7).  There is a "cap_control" field in struct >> aer_capability_regs; should we be using that here? > > There is a way to extract it from the PCI regs, and it's quite simple. > IIRC, it should be all f's when the capability is not implemented. I > wanted to avoid any further parsing of PCI regs in this patch. I could update the offending line to say: + info.first_error = PCI_ERR_CAP_FEP(aer->cap_control); Though I still have the concerns with validating CPER data: > I can see a way to use even more common printk code, but that requires > validating the PCI regs we get from firmware. That means we need to make > a guarantee about CPER that is beyond the scope of this patch. > > Alex >