Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp706677ybz; Wed, 15 Apr 2020 17:09:22 -0700 (PDT) X-Google-Smtp-Source: APiQypJlSmtSVrJRlfGaXokxY/YC7uMD0UOl2Cy5uTXsa2WYZdfNvuH+5rs0iKMpgWWoorVr5G2P X-Received: by 2002:a17:906:a39a:: with SMTP id k26mr7046248ejz.172.1586995761943; Wed, 15 Apr 2020 17:09:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586995761; cv=none; d=google.com; s=arc-20160816; b=qvGTLS9VLMD3u79A65z0uDyuLCvUKGD5ZG2VLiN6XCkj2oi1yUdMDLf1Q6x6zjIa8M 3303blvQF5nP0uaY5Vt2cuSHz5PpYhjHmZkzmhbtIZEiH8NjGxD56V7dIzbQhrL2/SRx IxnwQTCRdJejEiu5oPaL1X+sMYoBIcSxssQcA5bOrjs5jKZ4kIAS++vwDkUx/WrbzdS6 jKPGrh+0BeFbX4dO8jHG6OBG8S6IACABqQ20T3kdaeOljlhEV/d0pfERNTA5uTyeAhxw EU4BZCYbZ88b1wy2xqLiqLA4uG2Or5ZypUHTEzkJmxO2Z/WxUYizxn0bb4eTp0gkg/2y k9YA== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=bIrBbJ4tL/W/Y7cdC7SUUvU8+a+cICvtU1PX8U4oG/4=; b=n62kxiFymy+04XjyfPG2v6c7l4eZnDN54P8wG1KSzONbyC1xgfqMoAemSWscuN85f0 Bruj0Zm2eCR/Q+ddqtmTgBZ36ZngzKwPLw+C04YZoX8cc2OTYnVFAX160sKQ1vk4eVN0 BebyrDWHZSh6qqptG0XH7GUd2ypyXGZ6Z9t30Js2WP8G6KoLRZoGciC+wGSGVBdBa5QE qzJ8qTu7axEuoRm6t4EymIGoAcqmEnPY/XOUJmB1pT8jenbT22ozlLI2yLlUXX+Nce/J zKNimURfjjE0VydJRNYnGL++/iSSA8fua2rIl5I4v9FW3+q+OlYAFGOQ8fmIZ7+7GNK7 QFig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="slDrz/Gq"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i26si9799109edv.307.2020.04.15.17.08.58; Wed, 15 Apr 2020 17:09:21 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b="slDrz/Gq"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2634415AbgDOOg0 (ORCPT + 99 others); Wed, 15 Apr 2020 10:36:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:45414 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394095AbgDOOdH (ORCPT ); Wed, 15 Apr 2020 10:33:07 -0400 Received: from mail.kernel.org (ip5f5ad4d8.dynamic.kabel-deutschland.de [95.90.212.216]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E8177221F6; Wed, 15 Apr 2020 14:32:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586961172; bh=6GT3w41hn966DMyFfp0vsF/LFh19lPhK+l5rxKUUk5Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=slDrz/GqaVbF6kU/Xe8zRxwajE+AZVpN0x36xM3BMtH5XVS74kWwRCNie59CMMBmR e1d9caRv16rejnN1s4hAp481415EZvjek0tCuvKQMqRSEhAAZ3jhIt3pj8hXcFhtW8 sHPgKVlVRO6HRC0pdOdZqolficq9JS9vnDQncZgE= Received: from mchehab by mail.kernel.org with local (Exim 4.92.3) (envelope-from ) id 1jOj5u-006kQA-5d; Wed, 15 Apr 2020 16:32:50 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet Subject: [PATCH 31/34] docs: filesystems: convert sysfs-pci.txt to ReST Date: Wed, 15 Apr 2020 16:32:44 +0200 Message-Id: <07b7cf662d3552f78c01c096b4845121113a581d.1586960617.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.25.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org - Add a SPDX header; - Adjust document title; - Some whitespace fixes and new line breaks; - Mark literal blocks as such; - Add table markups; - Add it to filesystems/index.rst. Signed-off-by: Mauro Carvalho Chehab --- Documentation/filesystems/index.rst | 1 + .../{sysfs-pci.txt => sysfs-pci.rst} | 23 ++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) rename Documentation/filesystems/{sysfs-pci.txt => sysfs-pci.rst} (92%) diff --git a/Documentation/filesystems/index.rst b/Documentation/filesystems/index.rst index 6c5c312b8188..34d5f53931e7 100644 --- a/Documentation/filesystems/index.rst +++ b/Documentation/filesystems/index.rst @@ -36,6 +36,7 @@ algorithms work. quota seq_file sharedsubtree + sysfs-pci automount-support diff --git a/Documentation/filesystems/sysfs-pci.txt b/Documentation/filesystems/sysfs-pci.rst similarity index 92% rename from Documentation/filesystems/sysfs-pci.txt rename to Documentation/filesystems/sysfs-pci.rst index 06f1d64c6f70..a265f3e2cc80 100644 --- a/Documentation/filesystems/sysfs-pci.txt +++ b/Documentation/filesystems/sysfs-pci.rst @@ -1,8 +1,11 @@ +.. SPDX-License-Identifier: GPL-2.0 + +============================================ Accessing PCI device resources through sysfs --------------------------------------------- +============================================ sysfs, usually mounted at /sys, provides access to PCI resources on platforms -that support it. For example, a given bus might look like this: +that support it. For example, a given bus might look like this:: /sys/devices/pci0000:17 |-- 0000:17:00.0 @@ -30,8 +33,9 @@ This bus contains a single function device in slot 0. The domain and bus numbers are reproduced for convenience. Under the device directory are several files, each with their own function. + =================== ===================================================== file function - ---- -------- + =================== ===================================================== class PCI class (ascii, ro) config PCI config space (binary, rw) device PCI device (ascii, ro) @@ -40,13 +44,16 @@ files, each with their own function. local_cpus nearby CPU mask (cpumask, ro) remove remove device from kernel's list (ascii, wo) resource PCI resource host addresses (ascii, ro) - resource0..N PCI resource N, if present (binary, mmap, rw[1]) + resource0..N PCI resource N, if present (binary, mmap, rw\ [1]_) resource0_wc..N_wc PCI WC map resource N, if prefetchable (binary, mmap) revision PCI revision (ascii, ro) rom PCI ROM resource, if present (binary, ro) subsystem_device PCI subsystem device (ascii, ro) subsystem_vendor PCI subsystem vendor (ascii, ro) vendor PCI vendor (ascii, ro) + =================== ===================================================== + +:: ro - read only file rw - file is readable and writable @@ -56,7 +63,7 @@ files, each with their own function. binary - file contains binary data cpumask - file contains a cpumask type -[1] rw for RESOURCE_IO (I/O port) regions only +.. [1] rw for RESOURCE_IO (I/O port) regions only The read only files are informational, writes to them will be ignored, with the exception of the 'rom' file. Writable files can be used to perform @@ -67,11 +74,11 @@ don't support mmapping of certain resources, so be sure to check the return value from any attempted mmap. The most notable of these are I/O port resources, which also provide read/write access. -The 'enable' file provides a counter that indicates how many times the device +The 'enable' file provides a counter that indicates how many times the device has been enabled. If the 'enable' file currently returns '4', and a '1' is echoed into it, it will then return '5'. Echoing a '0' into it will decrease the count. Even when it returns to 0, though, some of the initialisation -may not be reversed. +may not be reversed. The 'rom' file is special in that it provides read-only access to the device's ROM file, if available. It's disabled by default, however, so applications @@ -93,7 +100,7 @@ Accessing legacy resources through sysfs Legacy I/O port and ISA memory resources are also provided in sysfs if the underlying platform supports them. They're located in the PCI class hierarchy, -e.g. +e.g.:: /sys/class/pci_bus/0000:17/ |-- bridge -> ../../../devices/pci0000:17 -- 2.25.2