Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp698655imm; Fri, 1 Jun 2018 08:05:24 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJss/Xab7ktPnrcX/aTbtauRyzmnkzmG+7wzygf9+7EW/vdQKpsr11RhAomb9/wEBCo2RrF X-Received: by 2002:a65:644f:: with SMTP id s15-v6mr9216224pgv.228.1527865524000; Fri, 01 Jun 2018 08:05:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527865523; cv=none; d=google.com; s=arc-20160816; b=t/Nk3xZrYzixWIAxzMCIIp8LMTeGOfR46FbYv0/Gxh8oWP9Z91OMbYAckWIA2mEzij N154FOS+TcqQmXX7q5Njr9QVcqLEFGdmVIscI8JyQHHuQwDVastaR7n1g7bkbR3dZ6nc ouOmViqyiIKAdtPo+fW/M6ca+JW7pYZ8kyIAVAZboc+MrunVyaQDq033uGbt7GR5tZbK cvTAC2fIMY9bTWwV8wn3jarWx4OX86ZGZIHQWxBfodlwD14aRNQSja59vK7DUB9zOYzz nWsTYb+01Z6Qd67WdGqylvCDHM8Twy9waabmh206KqB2Ey5VZoIC+WE4hjhEtyWAVywr F/AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=9wV/O7huWoA3B1tCLmxVuYeniucPKX479RK3dRyYUm0=; b=sKN0GPL/wUbNr9IF9SxqpVpGzX/eWMmkf+gsBcaaQGQ5kf9sSQrlFf7RSDrJCebcka SDpf6g4L9LMF3qJ9JMoD0stL07ifuKDARcXB+4j6GZL9QCDPuQjug6To+Wu0g8bIBhQ9 o40BzIEorbx2Xal0cbIFHx0QxlOM6iFR4pvPJaB9a1mkV2zVsjP6f+xY55AqQC0/F2CH O62BJ2lMCQdsGa7S8Et8ad+0awpC4svyuboF5zcy8z5cWat6GJVssHrMMUDbx+T8ygtK BDppCzKoRHSSgNsOHctOhHkh0eA610gnAGmvW5WjEyVcjCzTloZjakC2Q+9/Up3/CeWv 4grQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nsCBMHDq; 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 j3-v6si39216701pld.300.2018.06.01.08.04.50; Fri, 01 Jun 2018 08:05:23 -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=nsCBMHDq; 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 S1752845AbeFAPCh (ORCPT + 99 others); Fri, 1 Jun 2018 11:02:37 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:40894 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751378AbeFAPCd (ORCPT ); Fri, 1 Jun 2018 11:02:33 -0400 Received: by mail-qk0-f193.google.com with SMTP id r66-v6so20098586qkr.7; Fri, 01 Jun 2018 08:02:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=9wV/O7huWoA3B1tCLmxVuYeniucPKX479RK3dRyYUm0=; b=nsCBMHDquTD8IeFUWsd8EOLt5IeKRL/RuW0LLlw5OTwbMrGkuxc6U+pN9WkdTQTQ/4 /mAhiUv5Bu4yUjus6dkmzUbDVFPATHjtGrIFOn8C+cm2ErOaQndmKxjiqCslreuYNbS6 CRbHtZUArCKFQgLhid9tMdxE+5imSPGHSzKUa3BN4i33qNttC+J+vXkK1JHX56lBiQqD Ac2ziIqUq5eCuDbF3El1W40/pzgKB76CjWKjvZY91n/zhg5sQnGLvOPxkcTFHTNWytkb TI8tf9jqw+ga9NpeD/PaDJdqsNlV4NhO+1LaKcyUnuYXHnFTflzd1JhBTfdWFemMQlJC BjZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=9wV/O7huWoA3B1tCLmxVuYeniucPKX479RK3dRyYUm0=; b=cNasvlQNbdj0RS5izTzS+gPbnS8hB1P3AZC/eTv1o73ikapk8zSB/Ai0pv9L6z5JeZ ZzjnbvH/YTM9hT8AzTHkBjPNf2hyMVf6H3Ksa7QMmIFu35bNBE095M45ElYb9kWtqc5V Rb67hlyujWOc3z4huUVQJx/YkK2ubsUrHTSKtIzVQwI3HOZUTVfLcXjDQ9wZDBr/nzTM lVGx/jSoT6IkGkj1FSBwOCbpbu/kd/xCnZUbk7gP9ItfibkorPXxt5KvIaGF/wwTS2g8 AdGOzr00X5kyF8QegPuPgc7xfZCnZKJp2HgGEDBlSt08CXkQezReZn81JecprdygODXr t7BA== X-Gm-Message-State: APt69E1h735aaLfnV1QqKyuovvmpiew9tjk0lQzfPbxCxACJW7iHCYfH 4v0a+d7NgiC6+I6PAMqoj1HimGqgoNEuimtZ8F0= X-Received: by 2002:a37:7742:: with SMTP id s63-v6mr10009045qkc.97.1527865352322; Fri, 01 Jun 2018 08:02:32 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a0c:98f9:0:0:0:0:0 with HTTP; Fri, 1 Jun 2018 08:02:31 -0700 (PDT) In-Reply-To: <1527654876-26716-1-git-send-email-okaya@codeaurora.org> References: <1527654876-26716-1-git-send-email-okaya@codeaurora.org> From: Andy Shevchenko Date: Fri, 1 Jun 2018 18:02:31 +0300 Message-ID: Subject: Re: [PATCH] PCI: move early dump functionality from x86 arch into the common code To: Sinan Kaya Cc: linux-pci@vger.kernel.org, Timur Tabi , linux-arm-msm@vger.kernel.org, linux-arm Mailing List , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Bjorn Helgaas , Christoffer Dall , "Paul E. McKenney" , Marc Zyngier , Kai-Heng Feng , Thymo van Beers , Frederic Weisbecker , Konrad Rzeszutek Wilk , Greg Kroah-Hartman , David Rientjes , Kate Stewart , Philippe Ombredanne , Tom Lendacky , Juergen Gross , Borislav Petkov , Mikulas Patocka , Petr Tesarik , Andy Lutomirski , Dou Liyang , Ram Pai , Boris Ostrovsky , "open list:DOCUMENTATION" , open list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 30, 2018 at 7:34 AM, Sinan Kaya wrote: > Move early dump functionality into common code so that it is available for > all archtiectures. No need to carry arch specific reads around as the read > hooks are already initialized by the time pci_setup_device() is getting > called during scan. > /* If set, the PCIe ATS capability will not be used. */ > static bool pcie_ats_disabled; > > +bool pci_early_dump; > + I didn't check above these, but maybe a good idea to add one line comment what is this about? > extern const unsigned char pcie_link_speed[]; > - > +extern bool pci_early_dump; > bool pcie_cap_has_lnkctl(const struct pci_dev *dev); > Hmm... I would rather not attach this line to some function declarations. > +static void early_dump_pci_device(struct pci_dev *pdev) > +{ > + u32 value[256 / 4]; > + int i; > + > + dev_info(&pdev->dev, "pci 0000:%02x:%02x.%d config space:\n", > + pdev->bus->number, PCI_SLOT(pdev->devfn), > + PCI_FUNC(pdev->devfn)); Shouldn't be this changed to pci_info() ? > + > + for (i = 0; i < 256; i += 4) > + pci_read_config_dword(pdev, i, &value[i / 4]); > + > + print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 16, 1, value, > + 256, false); > +} -- With Best Regards, Andy Shevchenko