This is the third part of a series I wrote sometime ago where I manually
convert lots of files to be properly parsed by Sphinx as ReST files.
As it touches on lot of stuff, this series is based on today's linux-next,
at tag next-20190617.
The first version of this series had 57 patches. The first part with 28 patches
were already merged. The second part has 29 patches. This series with 22
patches finishes the conversion part of my series. That's because I opted to
do ~1 patch per converted directory.
That sounds too much to be send on a single round. So, I'm opting to split
it on 3 parts for the conversion.
After having those three patch series merged, I should submit a final patch
series adding orphaned books to existing ones (with ~50 patches), to be
applied on a convenient moment (probably late on a merge window).
Those patches should probably be good to be merged either by subsystem
maintainers or via the docs tree.
I opted to mark new files not included yet to the main index.rst (directly or
indirectly) with the :orphan: tag, in order to avoid adding warnings to the
build system. This should be removed after we find a "home" for all
the converted files within the new document tree arrangement, after I
submit the third part.
Both this series and the other parts of this work are on my devel git tree,
at:
https://git.linuxtv.org/mchehab/experimental.git/log/?h=convert_rst_renames_v5.1
The final output in html (after all patches I currently have, including
the upcoming series) can be seen at:
https://www.infradead.org/~mchehab/rst_conversion/
It contains all pending work from my side related to the conversion, plus
the patches I finished a first version today with contains the renaming
patches and de-orphan changes.
Mauro Carvalho Chehab (22):
docs: Documentation/*.txt: rename all ReST files to *.rst
docs: ioctl-number.txt: convert it to ReST format
docs: ioctl: convert to ReST
docs: thermal: convert to ReST
docs: rapidio: convert to ReST
docs: blockdev: convert to ReST
docs: perf: convert to ReST
docs: sysctl: convert to ReST
docs: block: convert to ReST
docs: security: move some books to it and update
docs: admin-guide: add .rst files from the main dir
docs: driver-api: add .rst files from the main dir
docs: x86: move two x86-specific files to x86 arch dir
docs: usb: rename files to .rst and add them to drivers-api
docs: driver-api: add a chapter for memory-related API
docs: driver-api: add xilinx driver API documentation
docs: add arch doc directories to the index
docs: admin-guide: move sysctl directory to it
docs: driver-api: add remaining converted dirs to it
docs: extcon: move it to acpi dir and convert it to ReST
docs: admin-guide: add laptops documentation
admin-guide: add kdump documentation into it
CREDITS | 2 +-
Documentation/ABI/removed/sysfs-class-rfkill | 2 +-
Documentation/ABI/stable/sysfs-class-rfkill | 2 +-
Documentation/ABI/stable/sysfs-devices-node | 2 +-
Documentation/ABI/testing/procfs-diskstats | 2 +-
Documentation/ABI/testing/sysfs-block | 2 +-
Documentation/ABI/testing/sysfs-block-device | 2 +-
.../ABI/testing/sysfs-class-switchtec | 2 +-
.../ABI/testing/sysfs-devices-system-cpu | 4 +-
.../ABI/testing/sysfs-platform-asus-laptop | 2 +-
Documentation/PCI/pci.rst | 8 +-
Documentation/{ => admin-guide}/aoe/aoe.rst | 4 +-
.../{ => admin-guide}/aoe/autoload.sh | 1 -
.../{ => admin-guide}/aoe/examples.rst | 0
Documentation/{ => admin-guide}/aoe/index.rst | 2 -
Documentation/{ => admin-guide}/aoe/status.sh | 0
Documentation/{ => admin-guide}/aoe/todo.rst | 0
.../{ => admin-guide}/aoe/udev-install.sh | 4 +-
Documentation/{ => admin-guide}/aoe/udev.txt | 8 +-
.../{btmrvl.txt => admin-guide/btmrvl.rst} | 0
Documentation/admin-guide/bug-hunting.rst | 4 +-
.../cgroup-v1/blkio-controller.rst | 0
.../{ => admin-guide}/cgroup-v1/cgroups.rst | 4 +-
.../{ => admin-guide}/cgroup-v1/cpuacct.rst | 0
.../{ => admin-guide}/cgroup-v1/cpusets.rst | 2 +-
.../{ => admin-guide}/cgroup-v1/devices.rst | 0
.../cgroup-v1/freezer-subsystem.rst | 0
.../{ => admin-guide}/cgroup-v1/hugetlb.rst | 0
.../{ => admin-guide}/cgroup-v1/index.rst | 2 -
.../cgroup-v1/memcg_test.rst | 4 +-
.../{ => admin-guide}/cgroup-v1/memory.rst | 0
.../{ => admin-guide}/cgroup-v1/net_cls.rst | 0
.../{ => admin-guide}/cgroup-v1/net_prio.rst | 0
.../{ => admin-guide}/cgroup-v1/pids.rst | 0
.../{ => admin-guide}/cgroup-v1/rdma.rst | 0
Documentation/admin-guide/cgroup-v2.rst | 2 +-
.../clearing-warn-once.rst} | 0
.../cpu-load.rst} | 0
.../cputopology.rst} | 0
.../efi-stub.rst} | 0
.../{highuid.txt => admin-guide/highuid.rst} | 2 +-
Documentation/admin-guide/hw-vuln/l1tf.rst | 4 +-
.../hw_random.rst} | 0
Documentation/admin-guide/index.rst | 26 +
.../{iostats.txt => admin-guide/iostats.rst} | 0
.../{ => admin-guide}/kdump/gdbmacros.txt | 0
.../{ => admin-guide}/kdump/index.rst | 1 -
.../{ => admin-guide}/kdump/kdump.rst | 0
.../{ => admin-guide}/kdump/vmcoreinfo.rst | 0
.../admin-guide/kernel-parameters.txt | 46 +-
.../kernel-per-cpu-kthreads.rst} | 4 +-
.../{ => admin-guide}/laptops/asus-laptop.rst | 0
.../laptops/disk-shock-protection.rst | 0
.../{ => admin-guide}/laptops/index.rst | 1 -
.../{ => admin-guide}/laptops/laptop-mode.rst | 0
.../{ => admin-guide}/laptops/lg-laptop.rst | 1 -
.../{ => admin-guide}/laptops/sony-laptop.rst | 0
.../{ => admin-guide}/laptops/sonypi.rst | 0
.../laptops/thinkpad-acpi.rst | 6 +-
.../laptops/toshiba_haps.rst | 0
.../lcd-panel-cgram.rst | 2 -
.../{ldm.txt => admin-guide/ldm.rst} | 3 +-
.../lockup-watchdogs.rst} | 0
.../mm/cma_debugfs.rst} | 2 -
Documentation/admin-guide/mm/index.rst | 2 +-
Documentation/admin-guide/mm/ksm.rst | 2 +-
.../admin-guide/mm/numa_memory_policy.rst | 2 +-
.../numastat.rst} | 3 +-
.../{pnp.txt => admin-guide/pnp.rst} | 11 +-
.../{rtc.txt => admin-guide/rtc.rst} | 6 +-
.../{svga.txt => admin-guide/svga.rst} | 0
.../abi.txt => admin-guide/sysctl/abi.rst} | 71 +-
.../fs.txt => admin-guide/sysctl/fs.rst} | 142 +--
.../README => admin-guide/sysctl/index.rst} | 34 +-
.../sysctl/kernel.rst} | 378 ++++----
.../net.txt => admin-guide/sysctl/net.rst} | 141 ++-
.../sysctl/sunrpc.rst} | 13 +-
.../user.txt => admin-guide/sysctl/user.rst} | 32 +-
.../vm.txt => admin-guide/sysctl/vm.rst} | 264 ++---
.../video-output.rst} | 1 -
Documentation/arm/index.rst | 2 -
Documentation/arm64/index.rst | 2 -
.../{bfq-iosched.txt => bfq-iosched.rst} | 68 +-
.../block/{biodoc.txt => biodoc.rst} | 366 ++++---
.../block/{biovecs.txt => biovecs.rst} | 20 +-
.../block/{capability.txt => capability.rst} | 17 +-
...ne-partition.txt => cmdline-partition.rst} | 13 +-
...{data-integrity.txt => data-integrity.rst} | 60 +-
...dline-iosched.txt => deadline-iosched.rst} | 21 +-
Documentation/block/index.rst | 25 +
.../block/{ioprio.txt => ioprio.rst} | 95 +-
.../{kyber-iosched.txt => kyber-iosched.rst} | 3 +-
.../block/{null_blk.txt => null_blk.rst} | 65 +-
Documentation/block/{pr.txt => pr.rst} | 18 +-
.../{queue-sysfs.txt => queue-sysfs.rst} | 7 +-
.../block/{request.txt => request.rst} | 47 +-
Documentation/block/{stat.txt => stat.rst} | 13 +-
...witching-sched.txt => switching-sched.rst} | 28 +-
...ontrol.txt => writeback_cache_control.rst} | 12 +-
...structure-v9.txt => data-structure-v9.rst} | 6 +-
Documentation/blockdev/drbd/figures.rst | 28 +
.../blockdev/drbd/{README.txt => index.rst} | 15 +-
.../blockdev/{floppy.txt => floppy.rst} | 88 +-
Documentation/blockdev/index.rst | 16 +
Documentation/blockdev/{nbd.txt => nbd.rst} | 2 +-
.../blockdev/{paride.txt => paride.rst} | 194 ++--
.../blockdev/{ramdisk.txt => ramdisk.rst} | 55 +-
Documentation/blockdev/{zram.txt => zram.rst} | 197 ++--
Documentation/core-api/printk-formats.rst | 2 +-
Documentation/device-mapper/statistics.rst | 4 +-
.../devicetree/bindings/phy/phy-bindings.txt | 2 +-
.../atomic_bitops.rst} | 1 -
.../bt8xxgpio.rst} | 1 -
.../bus-virt-phys-mapping.rst} | 52 +-
.../{connector => driver-api}/connector.rst | 2 -
.../{console => driver-api}/console.rst | 2 -
.../{crc32.txt => driver-api/crc32.rst} | 0
.../{dcdbas.txt => driver-api/dcdbas.rst} | 0
.../debugging-modules.rst} | 0
.../debugging-via-ohci1394.rst} | 0
.../{dell_rbu.txt => driver-api/dell_rbu.rst} | 1 -
.../{digsig.txt => driver-api/digsig.rst} | 0
.../{EDID/howto.rst => driver-api/edid.rst} | 2 -
.../{eisa.txt => driver-api/eisa.rst} | 0
.../futex-requeue-pi.rst} | 0
.../gcc-plugins.rst} | 0
.../hwspinlock.rst} | 0
Documentation/driver-api/index.rst | 71 +-
.../io-mapping.rst} | 0
.../io_ordering.rst} | 0
.../{IPMI.txt => driver-api/ipmi.rst} | 0
.../irq-affinity.rst} | 0
.../irq-domain.rst} | 0
Documentation/{IRQ.txt => driver-api/irq.rst} | 0
.../irqflags-tracing.rst} | 1 -
Documentation/{isa.txt => driver-api/isa.rst} | 0
.../{isapnp.txt => driver-api/isapnp.rst} | 0
.../{kobject.txt => driver-api/kobject.rst} | 4 +-
.../{kprobes.txt => driver-api/kprobes.rst} | 1 -
.../{kref.txt => driver-api/kref.rst} | 0
.../pblk.txt => driver-api/lightnvm-pblk.rst} | 0
Documentation/{lzo.txt => driver-api/lzo.rst} | 0
.../{mailbox.txt => driver-api/mailbox.rst} | 0
.../men-chameleon-bus.rst} | 0
.../mm/dma-api-howto.rst} | 0
.../mm/dma-api.rst} | 6 +-
.../mm/dma-attributes.rst} | 0
.../mm/dma-isa-lpc.rst} | 2 +-
Documentation/driver-api/mm/index.rst | 11 +
.../nommu-mmap.rst} | 0
Documentation/{ntb.txt => driver-api/ntb.rst} | 0
Documentation/{nvmem => driver-api}/nvmem.rst | 2 -
.../{padata.txt => driver-api/padata.rst} | 0
.../parport-lowlevel.rst} | 0
.../percpu-rw-semaphore.rst} | 0
.../{pi-futex.txt => driver-api/pi-futex.rst} | 0
Documentation/driver-api/pps.rst | 2 -
.../preempt-locking.rst} | 2 +-
.../{pti => driver-api}/pti_intel_mid.rst | 2 -
Documentation/driver-api/ptp.rst | 2 -
Documentation/{pwm.txt => driver-api/pwm.rst} | 0
.../{rbtree.txt => driver-api/rbtree.rst} | 52 +-
.../remoteproc.rst} | 2 +-
.../{rfkill.txt => driver-api/rfkill.rst} | 0
.../robust-futex-ABI.rst} | 0
.../robust-futexes.rst} | 0
.../{rpmsg.txt => driver-api/rpmsg.rst} | 0
.../{sgi-ioc4.txt => driver-api/sgi-ioc4.rst} | 0
.../{SM501.txt => driver-api/sm501.rst} | 0
.../smsc_ece1099.rst} | 0
.../speculation.rst} | 8 +-
.../static-keys.rst} | 0
.../switchtec.rst} | 2 +-
.../sync_file.rst} | 0
Documentation/{tee.txt => driver-api/tee.rst} | 0
.../this_cpu_ops.rst} | 0
.../unaligned-memory-access.rst} | 0
Documentation/driver-api/usb/dma.rst | 6 +-
.../vfio-mediated-device.rst} | 2 +-
.../{vfio.txt => driver-api/vfio.rst} | 0
.../{ => driver-api}/xilinx/eemi.rst | 0
.../{ => driver-api}/xilinx/index.rst | 1 -
.../{xillybus.txt => driver-api/xillybus.rst} | 0
Documentation/{xz.txt => driver-api/xz.rst} | 0
.../{zorro.txt => driver-api/zorro.rst} | 5 +-
Documentation/driver-model/device.rst | 2 +-
Documentation/fb/fbcon.rst | 4 +-
Documentation/fb/vesafb.rst | 2 +-
Documentation/filesystems/proc.txt | 2 +-
Documentation/filesystems/sysfs.txt | 2 +-
Documentation/filesystems/tmpfs.txt | 2 +-
.../acpi/extcon-intel-int3496.rst} | 14 +-
Documentation/firmware-guide/acpi/index.rst | 1 +
Documentation/gpu/drm-mm.rst | 2 +-
Documentation/ia64/index.rst | 2 -
Documentation/ia64/irq-redir.rst | 2 +-
Documentation/index.rst | 14 +
...g-up-ioctls.txt => botching-up-ioctls.rst} | 1 +
Documentation/ioctl/{cdrom.txt => cdrom.rst} | 908 +++++++++++-------
Documentation/ioctl/{hdio.txt => hdio.rst} | 835 ++++++++++------
Documentation/ioctl/index.rst | 16 +
...{ioctl-decoding.txt => ioctl-decoding.rst} | 13 +-
.../{ioctl-number.txt => ioctl-number.rst} | 588 ++++++------
Documentation/locking/rt-mutex.rst | 2 +-
Documentation/m68k/index.rst | 2 -
Documentation/memory-barriers.txt | 6 +-
Documentation/mic/index.rst | 2 -
Documentation/networking/ip-sysctl.txt | 2 +-
Documentation/networking/scaling.rst | 4 +-
.../perf/{arm-ccn.txt => arm-ccn.rst} | 18 +-
.../perf/{arm_dsu_pmu.txt => arm_dsu_pmu.rst} | 5 +-
.../perf/{hisi-pmu.txt => hisi-pmu.rst} | 35 +-
Documentation/perf/index.rst | 16 +
.../perf/{qcom_l2_pmu.txt => qcom_l2_pmu.rst} | 3 +-
.../perf/{qcom_l3_pmu.txt => qcom_l3_pmu.rst} | 3 +-
.../{thunderx2-pmu.txt => thunderx2-pmu.rst} | 25 +-
.../perf/{xgene-pmu.txt => xgene-pmu.rst} | 3 +-
Documentation/{phy.txt => phy.rst} | 2 +
Documentation/phy/samsung-usb2.rst | 2 -
.../powerpc/firmware-assisted-dump.rst | 2 +-
Documentation/process/submit-checklist.rst | 2 +-
Documentation/rapidio/index.rst | 15 +
.../{mport_cdev.txt => mport_cdev.rst} | 47 +-
.../rapidio/{rapidio.txt => rapidio.rst} | 39 +-
.../rapidio/{rio_cm.txt => rio_cm.rst} | 66 +-
.../rapidio/{sysfs.txt => sysfs.rst} | 4 +
.../rapidio/{tsi721.txt => tsi721.rst} | 45 +-
Documentation/riscv/index.rst | 2 -
Documentation/s390/index.rst | 2 -
Documentation/s390/vfio-ccw.rst | 6 +-
Documentation/scheduler/index.rst | 2 -
Documentation/scheduler/sched-deadline.rst | 2 +-
Documentation/scheduler/sched-design-CFS.rst | 2 +-
Documentation/scheduler/sched-rt-group.rst | 2 +-
Documentation/security/index.rst | 5 +-
.../security/{LSM.rst => lsm-development.rst} | 0
Documentation/{lsm.txt => security/lsm.rst} | 0
Documentation/{SAK.txt => security/sak.rst} | 1 -
.../{siphash.txt => security/siphash.rst} | 0
Documentation/security/tpm/index.rst | 1 +
Documentation/security/tpm/xen-tpmfront.rst | 2 -
Documentation/sparc/index.rst | 2 -
...pu-cooling-api.txt => cpu-cooling-api.rst} | 39 +-
.../{exynos_thermal => exynos_thermal.rst} | 47 +-
...emulation => exynos_thermal_emulation.rst} | 66 +-
Documentation/thermal/index.rst | 18 +
...el_powerclamp.txt => intel_powerclamp.rst} | 177 ++--
.../{nouveau_thermal => nouveau_thermal.rst} | 54 +-
...ower_allocator.txt => power_allocator.rst} | 140 +--
.../thermal/{sysfs-api.txt => sysfs-api.rst} | 490 ++++++----
...hermal => x86_pkg_temperature_thermal.rst} | 28 +-
Documentation/trace/kprobetrace.rst | 2 +-
.../it_IT/process/submit-checklist.rst | 2 +-
.../translations/ko_KR/memory-barriers.txt | 6 +-
Documentation/translations/zh_CN/IRQ.txt | 4 +-
.../translations/zh_CN/filesystems/sysfs.txt | 2 +-
.../translations/zh_CN/io_ordering.txt | 4 +-
.../translations/zh_CN/oops-tracing.txt | 4 +-
.../zh_CN/process/submit-checklist.rst | 2 +-
Documentation/usb/{acm.txt => acm.rst} | 0
.../{authorization.txt => authorization.rst} | 0
.../usb/{chipidea.txt => chipidea.rst} | 0
Documentation/usb/{dwc3.txt => dwc3.rst} | 0
Documentation/usb/{ehci.txt => ehci.rst} | 0
.../usb/{functionfs.txt => functionfs.rst} | 0
...{gadget-testing.txt => gadget-testing.rst} | 4 +-
...adget_configfs.txt => gadget_configfs.rst} | 0
.../usb/{gadget_hid.txt => gadget_hid.rst} | 0
.../{gadget_multi.txt => gadget_multi.rst} | 0
...{gadget_printer.txt => gadget_printer.rst} | 0
.../{gadget_serial.txt => gadget_serial.rst} | 0
Documentation/usb/index.rst | 39 +
.../usb/{iuu_phoenix.txt => iuu_phoenix.rst} | 0
.../{mass-storage.txt => mass-storage.rst} | 0
...{misc_usbsevseg.txt => misc_usbsevseg.rst} | 0
.../usb/{mtouchusb.txt => mtouchusb.rst} | 0
Documentation/usb/{ohci.txt => ohci.rst} | 0
Documentation/usb/{rio.txt => rio.rst} | 0
Documentation/usb/text_files.rst | 29 +
.../usb/{usb-help.txt => usb-help.rst} | 0
.../usb/{usb-serial.txt => usb-serial.rst} | 0
...{usbip_protocol.txt => usbip_protocol.rst} | 0
Documentation/usb/{usbmon.txt => usbmon.rst} | 0
...-overview.txt => wusb-design-overview.rst} | 0
Documentation/vm/numa.rst | 4 +-
Documentation/vm/page_migration.rst | 2 +-
Documentation/vm/unevictable-lru.rst | 4 +-
Documentation/w1/w1.netlink | 2 +-
Documentation/watchdog/hpwdt.rst | 4 +-
Documentation/x86/index.rst | 2 +
.../{Intel-IOMMU.txt => x86/intel-iommu.rst} | 1 +
.../{intel_txt.txt => x86/intel_txt.rst} | 1 +
Documentation/x86/topology.rst | 2 +-
.../x86/x86_64/fake-numa-for-cpusets.rst | 4 +-
Documentation/xtensa/index.rst | 2 -
MAINTAINERS | 106 +-
arch/Kconfig | 4 +-
arch/arm/Kconfig | 4 +-
arch/arm64/Kconfig | 2 +-
arch/ia64/hp/common/sba_iommu.c | 12 +-
arch/ia64/sn/pci/pci_dma.c | 4 +-
arch/parisc/Kconfig | 2 +-
arch/parisc/kernel/pci-dma.c | 2 +-
arch/sh/Kconfig | 4 +-
arch/sparc/Kconfig | 2 +-
arch/unicore32/include/asm/io.h | 2 +-
arch/x86/Kconfig | 8 +-
arch/x86/include/asm/dma-mapping.h | 4 +-
arch/x86/kernel/amd_gart_64.c | 2 +-
block/Kconfig | 4 +-
block/Kconfig.iosched | 2 +-
block/bfq-iosched.c | 2 +-
block/blk-integrity.c | 2 +-
block/ioprio.c | 2 +-
block/mq-deadline.c | 2 +-
block/partitions/Kconfig | 2 +-
block/partitions/cmdline.c | 2 +-
drivers/base/core.c | 2 +-
drivers/block/Kconfig | 8 +-
drivers/block/floppy.c | 2 +-
drivers/block/zram/Kconfig | 6 +-
drivers/char/Kconfig | 6 +-
drivers/char/hw_random/core.c | 2 +-
drivers/char/ipmi/Kconfig | 2 +-
drivers/char/ipmi/ipmi_si_hotmod.c | 2 +-
drivers/char/ipmi/ipmi_si_intf.c | 2 +-
drivers/dma-buf/Kconfig | 2 +-
drivers/gpio/Kconfig | 2 +-
drivers/gpu/drm/Kconfig | 2 +-
drivers/gpu/drm/drm_ioctl.c | 2 +-
drivers/parisc/sba_iommu.c | 16 +-
drivers/pci/switch/Kconfig | 2 +-
drivers/perf/qcom_l3_pmu.c | 2 +-
drivers/platform/x86/Kconfig | 8 +-
drivers/platform/x86/dcdbas.c | 2 +-
drivers/platform/x86/dell_rbu.c | 2 +-
drivers/pnp/isapnp/Kconfig | 2 +-
drivers/rapidio/Kconfig | 2 +-
drivers/tty/Kconfig | 2 +-
drivers/usb/Kconfig | 2 +-
drivers/usb/class/Kconfig | 2 +-
drivers/usb/gadget/Kconfig | 6 +-
drivers/usb/gadget/function/f_mass_storage.c | 2 +-
drivers/usb/gadget/legacy/Kconfig | 6 +-
drivers/usb/host/Kconfig | 2 +-
drivers/usb/misc/Kconfig | 2 +-
drivers/usb/mon/Kconfig | 2 +-
drivers/usb/serial/Kconfig | 10 +-
drivers/usb/serial/belkin_sa.c | 2 +-
drivers/usb/serial/belkin_sa.h | 2 +-
drivers/usb/serial/cypress_m8.c | 2 +-
drivers/usb/serial/empeg.c | 2 +-
drivers/usb/serial/ftdi_sio.c | 2 +-
drivers/usb/serial/ir-usb.c | 2 +-
drivers/usb/serial/keyspan_pda.c | 2 +-
drivers/usb/serial/omninet.c | 2 +-
drivers/usb/serial/oti6858.c | 2 +-
drivers/usb/serial/pl2303.c | 2 +-
drivers/usb/serial/usb-serial.c | 2 +-
drivers/usb/serial/visor.c | 2 +-
drivers/usb/serial/visor.h | 2 +-
drivers/usb/serial/whiteheat.c | 2 +-
drivers/usb/serial/whiteheat.h | 2 +-
drivers/vfio/Kconfig | 2 +-
drivers/vfio/mdev/Kconfig | 2 +-
drivers/w1/Kconfig | 2 +-
fs/proc/Kconfig | 2 +-
include/asm-generic/bitops/atomic.h | 2 +-
include/linux/cgroup-defs.h | 2 +-
include/linux/dma-mapping.h | 2 +-
include/linux/hw_random.h | 2 +-
include/linux/io-mapping.h | 2 +-
include/linux/jump_label.h | 2 +-
include/linux/kobject.h | 2 +-
include/linux/kobject_ns.h | 2 +-
include/linux/rbtree.h | 2 +-
include/linux/rbtree_augmented.h | 2 +-
include/linux/thermal.h | 4 +-
include/media/videobuf-dma-sg.h | 2 +-
include/uapi/linux/bpf.h | 2 +-
include/uapi/rdma/rdma_user_ioctl_cmds.h | 2 +-
init/Kconfig | 6 +-
kernel/cgroup/cpuset.c | 2 +-
kernel/dma/debug.c | 2 +-
kernel/padata.c | 2 +-
kernel/panic.c | 2 +-
lib/Kconfig | 2 +-
lib/Kconfig.debug | 2 +-
lib/crc32.c | 2 +-
lib/kobject.c | 4 +-
lib/lzo/lzo1x_decompress_safe.c | 2 +-
lib/xz/Kconfig | 2 +-
mm/Kconfig | 2 +-
mm/nommu.c | 2 +-
mm/swap.c | 2 +-
samples/Kconfig | 2 +-
samples/kprobes/kprobe_example.c | 2 +-
samples/kprobes/kretprobe_example.c | 2 +-
scripts/gcc-plugins/Kconfig | 2 +-
security/Kconfig | 2 +-
security/device_cgroup.c | 2 +-
tools/include/linux/rbtree.h | 2 +-
tools/include/linux/rbtree_augmented.h | 2 +-
tools/include/uapi/linux/bpf.h | 2 +-
tools/testing/selftests/zram/README | 2 +-
405 files changed, 4491 insertions(+), 2896 deletions(-)
rename Documentation/{ => admin-guide}/aoe/aoe.rst (97%)
rename Documentation/{ => admin-guide}/aoe/autoload.sh (99%)
rename Documentation/{ => admin-guide}/aoe/examples.rst (100%)
rename Documentation/{ => admin-guide}/aoe/index.rst (95%)
rename Documentation/{ => admin-guide}/aoe/status.sh (100%)
rename Documentation/{ => admin-guide}/aoe/todo.rst (100%)
rename Documentation/{ => admin-guide}/aoe/udev-install.sh (92%)
rename Documentation/{ => admin-guide}/aoe/udev.txt (91%)
rename Documentation/{btmrvl.txt => admin-guide/btmrvl.rst} (100%)
rename Documentation/{ => admin-guide}/cgroup-v1/blkio-controller.rst (100%)
rename Documentation/{ => admin-guide}/cgroup-v1/cgroups.rst (99%)
rename Documentation/{ => admin-guide}/cgroup-v1/cpuacct.rst (100%)
rename Documentation/{ => admin-guide}/cgroup-v1/cpusets.rst (99%)
rename Documentation/{ => admin-guide}/cgroup-v1/devices.rst (100%)
rename Documentation/{ => admin-guide}/cgroup-v1/freezer-subsystem.rst (100%)
rename Documentation/{ => admin-guide}/cgroup-v1/hugetlb.rst (100%)
rename Documentation/{ => admin-guide}/cgroup-v1/index.rst (97%)
rename Documentation/{ => admin-guide}/cgroup-v1/memcg_test.rst (98%)
rename Documentation/{ => admin-guide}/cgroup-v1/memory.rst (100%)
rename Documentation/{ => admin-guide}/cgroup-v1/net_cls.rst (100%)
rename Documentation/{ => admin-guide}/cgroup-v1/net_prio.rst (100%)
rename Documentation/{ => admin-guide}/cgroup-v1/pids.rst (100%)
rename Documentation/{ => admin-guide}/cgroup-v1/rdma.rst (100%)
rename Documentation/{clearing-warn-once.txt => admin-guide/clearing-warn-once.rst} (100%)
rename Documentation/{cpu-load.txt => admin-guide/cpu-load.rst} (100%)
rename Documentation/{cputopology.txt => admin-guide/cputopology.rst} (100%)
rename Documentation/{efi-stub.txt => admin-guide/efi-stub.rst} (100%)
rename Documentation/{highuid.txt => admin-guide/highuid.rst} (99%)
rename Documentation/{hw_random.txt => admin-guide/hw_random.rst} (100%)
rename Documentation/{iostats.txt => admin-guide/iostats.rst} (100%)
rename Documentation/{ => admin-guide}/kdump/gdbmacros.txt (100%)
rename Documentation/{ => admin-guide}/kdump/index.rst (97%)
rename Documentation/{ => admin-guide}/kdump/kdump.rst (100%)
rename Documentation/{ => admin-guide}/kdump/vmcoreinfo.rst (100%)
rename Documentation/{kernel-per-CPU-kthreads.txt => admin-guide/kernel-per-cpu-kthreads.rst} (98%)
rename Documentation/{ => admin-guide}/laptops/asus-laptop.rst (100%)
rename Documentation/{ => admin-guide}/laptops/disk-shock-protection.rst (100%)
rename Documentation/{ => admin-guide}/laptops/index.rst (95%)
rename Documentation/{ => admin-guide}/laptops/laptop-mode.rst (100%)
rename Documentation/{ => admin-guide}/laptops/lg-laptop.rst (99%)
rename Documentation/{ => admin-guide}/laptops/sony-laptop.rst (100%)
rename Documentation/{ => admin-guide}/laptops/sonypi.rst (100%)
rename Documentation/{ => admin-guide}/laptops/thinkpad-acpi.rst (99%)
rename Documentation/{ => admin-guide}/laptops/toshiba_haps.rst (100%)
rename Documentation/{auxdisplay => admin-guide}/lcd-panel-cgram.rst (99%)
rename Documentation/{ldm.txt => admin-guide/ldm.rst} (98%)
rename Documentation/{lockup-watchdogs.txt => admin-guide/lockup-watchdogs.rst} (100%)
rename Documentation/{cma/debugfs.rst => admin-guide/mm/cma_debugfs.rst} (98%)
rename Documentation/{numastat.txt => admin-guide/numastat.rst} (93%)
rename Documentation/{pnp.txt => admin-guide/pnp.rst} (98%)
rename Documentation/{rtc.txt => admin-guide/rtc.rst} (99%)
rename Documentation/{svga.txt => admin-guide/svga.rst} (100%)
rename Documentation/{sysctl/abi.txt => admin-guide/sysctl/abi.rst} (30%)
rename Documentation/{sysctl/fs.txt => admin-guide/sysctl/fs.rst} (77%)
rename Documentation/{sysctl/README => admin-guide/sysctl/index.rst} (78%)
rename Documentation/{sysctl/kernel.txt => admin-guide/sysctl/kernel.rst} (79%)
rename Documentation/{sysctl/net.txt => admin-guide/sysctl/net.rst} (85%)
rename Documentation/{sysctl/sunrpc.txt => admin-guide/sysctl/sunrpc.rst} (62%)
rename Documentation/{sysctl/user.txt => admin-guide/sysctl/user.rst} (77%)
rename Documentation/{sysctl/vm.txt => admin-guide/sysctl/vm.rst} (84%)
rename Documentation/{video-output.txt => admin-guide/video-output.rst} (99%)
rename Documentation/block/{bfq-iosched.txt => bfq-iosched.rst} (95%)
rename Documentation/block/{biodoc.txt => biodoc.rst} (83%)
rename Documentation/block/{biovecs.txt => biovecs.rst} (92%)
rename Documentation/block/{capability.txt => capability.rst} (40%)
rename Documentation/block/{cmdline-partition.txt => cmdline-partition.rst} (92%)
rename Documentation/block/{data-integrity.txt => data-integrity.rst} (91%)
rename Documentation/block/{deadline-iosched.txt => deadline-iosched.rst} (89%)
create mode 100644 Documentation/block/index.rst
rename Documentation/block/{ioprio.txt => ioprio.rst} (75%)
rename Documentation/block/{kyber-iosched.txt => kyber-iosched.rst} (86%)
rename Documentation/block/{null_blk.txt => null_blk.rst} (60%)
rename Documentation/block/{pr.txt => pr.rst} (93%)
rename Documentation/block/{queue-sysfs.txt => queue-sysfs.rst} (99%)
rename Documentation/block/{request.txt => request.rst} (59%)
rename Documentation/block/{stat.txt => stat.rst} (89%)
rename Documentation/block/{switching-sched.txt => switching-sched.rst} (67%)
rename Documentation/block/{writeback_cache_control.txt => writeback_cache_control.rst} (94%)
rename Documentation/blockdev/drbd/{data-structure-v9.txt => data-structure-v9.rst} (94%)
create mode 100644 Documentation/blockdev/drbd/figures.rst
rename Documentation/blockdev/drbd/{README.txt => index.rst} (55%)
rename Documentation/blockdev/{floppy.txt => floppy.rst} (81%)
create mode 100644 Documentation/blockdev/index.rst
rename Documentation/blockdev/{nbd.txt => nbd.rst} (96%)
rename Documentation/blockdev/{paride.txt => paride.rst} (81%)
rename Documentation/blockdev/{ramdisk.txt => ramdisk.rst} (84%)
rename Documentation/blockdev/{zram.txt => zram.rst} (76%)
rename Documentation/{atomic_bitops.txt => driver-api/atomic_bitops.rst} (99%)
rename Documentation/{bt8xxgpio.txt => driver-api/bt8xxgpio.rst} (99%)
rename Documentation/{bus-virt-phys-mapping.txt => driver-api/bus-virt-phys-mapping.rst} (93%)
rename Documentation/{connector => driver-api}/connector.rst (99%)
rename Documentation/{console => driver-api}/console.rst (99%)
rename Documentation/{crc32.txt => driver-api/crc32.rst} (100%)
rename Documentation/{dcdbas.txt => driver-api/dcdbas.rst} (100%)
rename Documentation/{debugging-modules.txt => driver-api/debugging-modules.rst} (100%)
rename Documentation/{debugging-via-ohci1394.txt => driver-api/debugging-via-ohci1394.rst} (100%)
rename Documentation/{dell_rbu.txt => driver-api/dell_rbu.rst} (99%)
rename Documentation/{digsig.txt => driver-api/digsig.rst} (100%)
rename Documentation/{EDID/howto.rst => driver-api/edid.rst} (99%)
rename Documentation/{eisa.txt => driver-api/eisa.rst} (100%)
rename Documentation/{futex-requeue-pi.txt => driver-api/futex-requeue-pi.rst} (100%)
rename Documentation/{gcc-plugins.txt => driver-api/gcc-plugins.rst} (100%)
rename Documentation/{hwspinlock.txt => driver-api/hwspinlock.rst} (100%)
rename Documentation/{io-mapping.txt => driver-api/io-mapping.rst} (100%)
rename Documentation/{io_ordering.txt => driver-api/io_ordering.rst} (100%)
rename Documentation/{IPMI.txt => driver-api/ipmi.rst} (100%)
rename Documentation/{IRQ-affinity.txt => driver-api/irq-affinity.rst} (100%)
rename Documentation/{IRQ-domain.txt => driver-api/irq-domain.rst} (100%)
rename Documentation/{IRQ.txt => driver-api/irq.rst} (100%)
rename Documentation/{irqflags-tracing.txt => driver-api/irqflags-tracing.rst} (99%)
rename Documentation/{isa.txt => driver-api/isa.rst} (100%)
rename Documentation/{isapnp.txt => driver-api/isapnp.rst} (100%)
rename Documentation/{kobject.txt => driver-api/kobject.rst} (99%)
rename Documentation/{kprobes.txt => driver-api/kprobes.rst} (99%)
rename Documentation/{kref.txt => driver-api/kref.rst} (100%)
rename Documentation/{lightnvm/pblk.txt => driver-api/lightnvm-pblk.rst} (100%)
rename Documentation/{lzo.txt => driver-api/lzo.rst} (100%)
rename Documentation/{mailbox.txt => driver-api/mailbox.rst} (100%)
rename Documentation/{men-chameleon-bus.txt => driver-api/men-chameleon-bus.rst} (100%)
rename Documentation/{DMA-API-HOWTO.txt => driver-api/mm/dma-api-howto.rst} (100%)
rename Documentation/{DMA-API.txt => driver-api/mm/dma-api.rst} (99%)
rename Documentation/{DMA-attributes.txt => driver-api/mm/dma-attributes.rst} (100%)
rename Documentation/{DMA-ISA-LPC.txt => driver-api/mm/dma-isa-lpc.rst} (98%)
create mode 100644 Documentation/driver-api/mm/index.rst
rename Documentation/{nommu-mmap.txt => driver-api/nommu-mmap.rst} (100%)
rename Documentation/{ntb.txt => driver-api/ntb.rst} (100%)
rename Documentation/{nvmem => driver-api}/nvmem.rst (99%)
rename Documentation/{padata.txt => driver-api/padata.rst} (100%)
rename Documentation/{parport-lowlevel.txt => driver-api/parport-lowlevel.rst} (100%)
rename Documentation/{percpu-rw-semaphore.txt => driver-api/percpu-rw-semaphore.rst} (100%)
rename Documentation/{pi-futex.txt => driver-api/pi-futex.rst} (100%)
rename Documentation/{preempt-locking.txt => driver-api/preempt-locking.rst} (99%)
rename Documentation/{pti => driver-api}/pti_intel_mid.rst (99%)
rename Documentation/{pwm.txt => driver-api/pwm.rst} (100%)
rename Documentation/{rbtree.txt => driver-api/rbtree.rst} (94%)
rename Documentation/{remoteproc.txt => driver-api/remoteproc.rst} (99%)
rename Documentation/{rfkill.txt => driver-api/rfkill.rst} (100%)
rename Documentation/{robust-futex-ABI.txt => driver-api/robust-futex-ABI.rst} (100%)
rename Documentation/{robust-futexes.txt => driver-api/robust-futexes.rst} (100%)
rename Documentation/{rpmsg.txt => driver-api/rpmsg.rst} (100%)
rename Documentation/{sgi-ioc4.txt => driver-api/sgi-ioc4.rst} (100%)
rename Documentation/{SM501.txt => driver-api/sm501.rst} (100%)
rename Documentation/{smsc_ece1099.txt => driver-api/smsc_ece1099.rst} (100%)
rename Documentation/{speculation.txt => driver-api/speculation.rst} (100%)
rename Documentation/{static-keys.txt => driver-api/static-keys.rst} (100%)
rename Documentation/{switchtec.txt => driver-api/switchtec.rst} (97%)
rename Documentation/{sync_file.txt => driver-api/sync_file.rst} (100%)
rename Documentation/{tee.txt => driver-api/tee.rst} (100%)
rename Documentation/{this_cpu_ops.txt => driver-api/this_cpu_ops.rst} (100%)
rename Documentation/{unaligned-memory-access.txt => driver-api/unaligned-memory-access.rst} (100%)
rename Documentation/{vfio-mediated-device.txt => driver-api/vfio-mediated-device.rst} (99%)
rename Documentation/{vfio.txt => driver-api/vfio.rst} (100%)
rename Documentation/{ => driver-api}/xilinx/eemi.rst (100%)
rename Documentation/{ => driver-api}/xilinx/index.rst (94%)
rename Documentation/{xillybus.txt => driver-api/xillybus.rst} (100%)
rename Documentation/{xz.txt => driver-api/xz.rst} (100%)
rename Documentation/{zorro.txt => driver-api/zorro.rst} (99%)
rename Documentation/{extcon/intel-int3496.txt => firmware-guide/acpi/extcon-intel-int3496.rst} (66%)
rename Documentation/ioctl/{botching-up-ioctls.txt => botching-up-ioctls.rst} (99%)
rename Documentation/ioctl/{cdrom.txt => cdrom.rst} (39%)
rename Documentation/ioctl/{hdio.txt => hdio.rst} (54%)
create mode 100644 Documentation/ioctl/index.rst
rename Documentation/ioctl/{ioctl-decoding.txt => ioctl-decoding.rst} (54%)
rename Documentation/ioctl/{ioctl-number.txt => ioctl-number.rst} (11%)
rename Documentation/perf/{arm-ccn.txt => arm-ccn.rst} (86%)
rename Documentation/perf/{arm_dsu_pmu.txt => arm_dsu_pmu.rst} (92%)
rename Documentation/perf/{hisi-pmu.txt => hisi-pmu.rst} (73%)
create mode 100644 Documentation/perf/index.rst
rename Documentation/perf/{qcom_l2_pmu.txt => qcom_l2_pmu.rst} (94%)
rename Documentation/perf/{qcom_l3_pmu.txt => qcom_l3_pmu.rst} (93%)
rename Documentation/perf/{thunderx2-pmu.txt => thunderx2-pmu.rst} (73%)
rename Documentation/perf/{xgene-pmu.txt => xgene-pmu.rst} (96%)
rename Documentation/{phy.txt => phy.rst} (99%)
create mode 100644 Documentation/rapidio/index.rst
rename Documentation/rapidio/{mport_cdev.txt => mport_cdev.rst} (84%)
rename Documentation/rapidio/{rapidio.txt => rapidio.rst} (97%)
rename Documentation/rapidio/{rio_cm.txt => rio_cm.rst} (76%)
rename Documentation/rapidio/{sysfs.txt => sysfs.rst} (75%)
rename Documentation/rapidio/{tsi721.txt => tsi721.rst} (79%)
rename Documentation/security/{LSM.rst => lsm-development.rst} (100%)
rename Documentation/{lsm.txt => security/lsm.rst} (100%)
rename Documentation/{SAK.txt => security/sak.rst} (99%)
rename Documentation/{siphash.txt => security/siphash.rst} (100%)
rename Documentation/thermal/{cpu-cooling-api.txt => cpu-cooling-api.rst} (82%)
rename Documentation/thermal/{exynos_thermal => exynos_thermal.rst} (67%)
rename Documentation/thermal/{exynos_thermal_emulation => exynos_thermal_emulation.rst} (36%)
create mode 100644 Documentation/thermal/index.rst
rename Documentation/thermal/{intel_powerclamp.txt => intel_powerclamp.rst} (76%)
rename Documentation/thermal/{nouveau_thermal => nouveau_thermal.rst} (64%)
rename Documentation/thermal/{power_allocator.txt => power_allocator.rst} (74%)
rename Documentation/thermal/{sysfs-api.txt => sysfs-api.rst} (66%)
rename Documentation/thermal/{x86_pkg_temperature_thermal => x86_pkg_temperature_thermal.rst} (80%)
rename Documentation/usb/{acm.txt => acm.rst} (100%)
rename Documentation/usb/{authorization.txt => authorization.rst} (100%)
rename Documentation/usb/{chipidea.txt => chipidea.rst} (100%)
rename Documentation/usb/{dwc3.txt => dwc3.rst} (100%)
rename Documentation/usb/{ehci.txt => ehci.rst} (100%)
rename Documentation/usb/{functionfs.txt => functionfs.rst} (100%)
rename Documentation/usb/{gadget-testing.txt => gadget-testing.rst} (99%)
rename Documentation/usb/{gadget_configfs.txt => gadget_configfs.rst} (100%)
rename Documentation/usb/{gadget_hid.txt => gadget_hid.rst} (100%)
rename Documentation/usb/{gadget_multi.txt => gadget_multi.rst} (100%)
rename Documentation/usb/{gadget_printer.txt => gadget_printer.rst} (100%)
rename Documentation/usb/{gadget_serial.txt => gadget_serial.rst} (100%)
create mode 100644 Documentation/usb/index.rst
rename Documentation/usb/{iuu_phoenix.txt => iuu_phoenix.rst} (100%)
rename Documentation/usb/{mass-storage.txt => mass-storage.rst} (100%)
rename Documentation/usb/{misc_usbsevseg.txt => misc_usbsevseg.rst} (100%)
rename Documentation/usb/{mtouchusb.txt => mtouchusb.rst} (100%)
rename Documentation/usb/{ohci.txt => ohci.rst} (100%)
rename Documentation/usb/{rio.txt => rio.rst} (100%)
create mode 100644 Documentation/usb/text_files.rst
rename Documentation/usb/{usb-help.txt => usb-help.rst} (100%)
rename Documentation/usb/{usb-serial.txt => usb-serial.rst} (100%)
rename Documentation/usb/{usbip_protocol.txt => usbip_protocol.rst} (100%)
rename Documentation/usb/{usbmon.txt => usbmon.rst} (100%)
rename Documentation/usb/{WUSB-Design-overview.txt => wusb-design-overview.rst} (100%)
rename Documentation/{Intel-IOMMU.txt => x86/intel-iommu.rst} (99%)
rename Documentation/{intel_txt.txt => x86/intel_txt.rst} (99%)
--
2.21.0
Rename the thermal documentation files to ReST, add an
index for them and adjust in order to produce a nice html
output via the Sphinx build system.
At its new index.rst, let's add a :orphan: while this is not linked to
the main index.rst file, in order to avoid build warnings.
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
---
...pu-cooling-api.txt => cpu-cooling-api.rst} | 39 +-
.../{exynos_thermal => exynos_thermal.rst} | 47 +-
...emulation => exynos_thermal_emulation.rst} | 66 +--
Documentation/thermal/index.rst | 18 +
...el_powerclamp.txt => intel_powerclamp.rst} | 177 +++----
.../{nouveau_thermal => nouveau_thermal.rst} | 54 +-
...ower_allocator.txt => power_allocator.rst} | 140 ++---
.../thermal/{sysfs-api.txt => sysfs-api.rst} | 490 ++++++++++++------
...hermal => x86_pkg_temperature_thermal.rst} | 28 +-
MAINTAINERS | 2 +-
include/linux/thermal.h | 4 +-
11 files changed, 665 insertions(+), 400 deletions(-)
rename Documentation/thermal/{cpu-cooling-api.txt => cpu-cooling-api.rst} (82%)
rename Documentation/thermal/{exynos_thermal => exynos_thermal.rst} (67%)
rename Documentation/thermal/{exynos_thermal_emulation => exynos_thermal_emulation.rst} (36%)
create mode 100644 Documentation/thermal/index.rst
rename Documentation/thermal/{intel_powerclamp.txt => intel_powerclamp.rst} (76%)
rename Documentation/thermal/{nouveau_thermal => nouveau_thermal.rst} (64%)
rename Documentation/thermal/{power_allocator.txt => power_allocator.rst} (74%)
rename Documentation/thermal/{sysfs-api.txt => sysfs-api.rst} (66%)
rename Documentation/thermal/{x86_pkg_temperature_thermal => x86_pkg_temperature_thermal.rst} (80%)
diff --git a/Documentation/thermal/cpu-cooling-api.txt b/Documentation/thermal/cpu-cooling-api.rst
similarity index 82%
rename from Documentation/thermal/cpu-cooling-api.txt
rename to Documentation/thermal/cpu-cooling-api.rst
index 7df567eaea1a..645d914c45a6 100644
--- a/Documentation/thermal/cpu-cooling-api.txt
+++ b/Documentation/thermal/cpu-cooling-api.rst
@@ -1,5 +1,6 @@
+=======================
CPU cooling APIs How To
-===================================
+=======================
Written by Amit Daniel Kachhap <[email protected]>
@@ -8,40 +9,54 @@ Updated: 6 Jan 2015
Copyright (c) 2012 Samsung Electronics Co., Ltd(http://www.samsung.com)
0. Introduction
+===============
The generic cpu cooling(freq clipping) provides registration/unregistration APIs
to the caller. The binding of the cooling devices to the trip point is left for
the user. The registration APIs returns the cooling device pointer.
1. cpu cooling APIs
+===================
1.1 cpufreq registration/unregistration APIs
-1.1.1 struct thermal_cooling_device *cpufreq_cooling_register(
- struct cpumask *clip_cpus)
+--------------------------------------------
+
+ ::
+
+ struct thermal_cooling_device
+ *cpufreq_cooling_register(struct cpumask *clip_cpus)
This interface function registers the cpufreq cooling device with the name
"thermal-cpufreq-%x". This api can support multiple instances of cpufreq
cooling devices.
- clip_cpus: cpumask of cpus where the frequency constraints will happen.
+ clip_cpus:
+ cpumask of cpus where the frequency constraints will happen.
-1.1.2 struct thermal_cooling_device *of_cpufreq_cooling_register(
- struct cpufreq_policy *policy)
+ ::
+
+ struct thermal_cooling_device
+ *of_cpufreq_cooling_register(struct cpufreq_policy *policy)
This interface function registers the cpufreq cooling device with
the name "thermal-cpufreq-%x" linking it with a device tree node, in
order to bind it via the thermal DT code. This api can support multiple
instances of cpufreq cooling devices.
- policy: CPUFreq policy.
+ policy:
+ CPUFreq policy.
-1.1.3 void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)
+
+ ::
+
+ void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)
This interface function unregisters the "thermal-cpufreq-%x" cooling device.
cdev: Cooling device pointer which has to be unregistered.
2. Power models
+===============
The power API registration functions provide a simple power model for
CPUs. The current power is calculated as dynamic power (static power isn't
@@ -65,9 +80,9 @@ For a given processor implementation the primary factors are:
variation. In pathological cases this variation can be significant,
but typically it is of a much lesser impact than the factors above.
-A high level dynamic power consumption model may then be represented as:
+A high level dynamic power consumption model may then be represented as::
-Pdyn = f(run) * Voltage^2 * Frequency * Utilisation
+ Pdyn = f(run) * Voltage^2 * Frequency * Utilisation
f(run) here represents the described execution behaviour and its
result has a units of Watts/Hz/Volt^2 (this often expressed in
@@ -80,9 +95,9 @@ factors. Therefore, in initial implementation that contribution is
represented as a constant coefficient. This is a simplification
consistent with the relative contribution to overall power variation.
-In this simplified representation our model becomes:
+In this simplified representation our model becomes::
-Pdyn = Capacitance * Voltage^2 * Frequency * Utilisation
+ Pdyn = Capacitance * Voltage^2 * Frequency * Utilisation
Where `capacitance` is a constant that represents an indicative
running time dynamic power coefficient in fundamental units of
diff --git a/Documentation/thermal/exynos_thermal b/Documentation/thermal/exynos_thermal.rst
similarity index 67%
rename from Documentation/thermal/exynos_thermal
rename to Documentation/thermal/exynos_thermal.rst
index 9010c4416967..5bd556566c70 100644
--- a/Documentation/thermal/exynos_thermal
+++ b/Documentation/thermal/exynos_thermal.rst
@@ -1,8 +1,11 @@
+========================
Kernel driver exynos_tmu
-=================
+========================
Supported chips:
+
* ARM SAMSUNG EXYNOS4, EXYNOS5 series of SoC
+
Datasheet: Not publicly available
Authors: Donggeun Kim <[email protected]>
@@ -19,32 +22,39 @@ Temperature can be taken from the temperature code.
There are three equations converting from temperature to temperature code.
The three equations are:
- 1. Two point trimming
+ 1. Two point trimming::
+
Tc = (T - 25) * (TI2 - TI1) / (85 - 25) + TI1
- 2. One point trimming
+ 2. One point trimming::
+
Tc = T + TI1 - 25
- 3. No trimming
+ 3. No trimming::
+
Tc = T + 50
- Tc: Temperature code, T: Temperature,
- TI1: Trimming info for 25 degree Celsius (stored at TRIMINFO register)
+ Tc:
+ Temperature code, T: Temperature,
+ TI1:
+ Trimming info for 25 degree Celsius (stored at TRIMINFO register)
Temperature code measured at 25 degree Celsius which is unchanged
- TI2: Trimming info for 85 degree Celsius (stored at TRIMINFO register)
+ TI2:
+ Trimming info for 85 degree Celsius (stored at TRIMINFO register)
Temperature code measured at 85 degree Celsius which is unchanged
TMU(Thermal Management Unit) in EXYNOS4/5 generates interrupt
when temperature exceeds pre-defined levels.
The maximum number of configurable threshold is five.
-The threshold levels are defined as follows:
+The threshold levels are defined as follows::
+
Level_0: current temperature > trigger_level_0 + threshold
Level_1: current temperature > trigger_level_1 + threshold
Level_2: current temperature > trigger_level_2 + threshold
Level_3: current temperature > trigger_level_3 + threshold
- The threshold and each trigger_level are set
- through the corresponding registers.
+The threshold and each trigger_level are set
+through the corresponding registers.
When an interrupt occurs, this driver notify kernel thermal framework
with the function exynos_report_trigger.
@@ -54,24 +64,27 @@ it can be used to synchronize the cooling action.
TMU driver description:
-----------------------
-The exynos thermal driver is structured as,
+The exynos thermal driver is structured as::
Kernel Core thermal framework
(thermal_core.c, step_wise.c, cpu_cooling.c)
^
|
|
-TMU configuration data -------> TMU Driver <------> Exynos Core thermal wrapper
-(exynos_tmu_data.c) (exynos_tmu.c) (exynos_thermal_common.c)
-(exynos_tmu_data.h) (exynos_tmu.h) (exynos_thermal_common.h)
+ TMU configuration data -----> TMU Driver <----> Exynos Core thermal wrapper
+ (exynos_tmu_data.c) (exynos_tmu.c) (exynos_thermal_common.c)
+ (exynos_tmu_data.h) (exynos_tmu.h) (exynos_thermal_common.h)
-a) TMU configuration data: This consist of TMU register offsets/bitfields
+a) TMU configuration data:
+ This consist of TMU register offsets/bitfields
described through structure exynos_tmu_registers. Also several
other platform data (struct exynos_tmu_platform_data) members
are used to configure the TMU.
-b) TMU driver: This component initialises the TMU controller and sets different
+b) TMU driver:
+ This component initialises the TMU controller and sets different
thresholds. It invokes core thermal implementation with the call
exynos_report_trigger.
-c) Exynos Core thermal wrapper: This provides 3 wrapper function to use the
+c) Exynos Core thermal wrapper:
+ This provides 3 wrapper function to use the
Kernel core thermal framework. They are exynos_unregister_thermal,
exynos_register_thermal and exynos_report_trigger.
diff --git a/Documentation/thermal/exynos_thermal_emulation b/Documentation/thermal/exynos_thermal_emulation.rst
similarity index 36%
rename from Documentation/thermal/exynos_thermal_emulation
rename to Documentation/thermal/exynos_thermal_emulation.rst
index b15efec6ca28..c21d10838bc5 100644
--- a/Documentation/thermal/exynos_thermal_emulation
+++ b/Documentation/thermal/exynos_thermal_emulation.rst
@@ -1,5 +1,6 @@
-EXYNOS EMULATION MODE
-========================
+=====================
+Exynos Emulation Mode
+=====================
Copyright (C) 2012 Samsung Electronics
@@ -8,46 +9,53 @@ Written by Jonghwa Lee <[email protected]>
Description
-----------
-Exynos 4x12 (4212, 4412) and 5 series provide emulation mode for thermal management unit.
-Thermal emulation mode supports software debug for TMU's operation. User can set temperature
-manually with software code and TMU will read current temperature from user value not from
-sensor's value.
+Exynos 4x12 (4212, 4412) and 5 series provide emulation mode for thermal
+management unit. Thermal emulation mode supports software debug for
+TMU's operation. User can set temperature manually with software code
+and TMU will read current temperature from user value not from sensor's
+value.
-Enabling CONFIG_THERMAL_EMULATION option will make this support available.
-When it's enabled, sysfs node will be created as
+Enabling CONFIG_THERMAL_EMULATION option will make this support
+available. When it's enabled, sysfs node will be created as
/sys/devices/virtual/thermal/thermal_zone'zone id'/emul_temp.
-The sysfs node, 'emul_node', will contain value 0 for the initial state. When you input any
-temperature you want to update to sysfs node, it automatically enable emulation mode and
-current temperature will be changed into it.
-(Exynos also supports user changeable delay time which would be used to delay of
- changing temperature. However, this node only uses same delay of real sensing time, 938us.)
+The sysfs node, 'emul_node', will contain value 0 for the initial state.
+When you input any temperature you want to update to sysfs node, it
+automatically enable emulation mode and current temperature will be
+changed into it.
-Exynos emulation mode requires synchronous of value changing and enabling. It means when you
-want to update the any value of delay or next temperature, then you have to enable emulation
-mode at the same time. (Or you have to keep the mode enabling.) If you don't, it fails to
-change the value to updated one and just use last succeessful value repeatedly. That's why
-this node gives users the right to change termerpature only. Just one interface makes it more
-simply to use.
+(Exynos also supports user changeable delay time which would be used to
+delay of changing temperature. However, this node only uses same delay
+of real sensing time, 938us.)
+
+Exynos emulation mode requires synchronous of value changing and
+enabling. It means when you want to update the any value of delay or
+next temperature, then you have to enable emulation mode at the same
+time. (Or you have to keep the mode enabling.) If you don't, it fails to
+change the value to updated one and just use last succeessful value
+repeatedly. That's why this node gives users the right to change
+termerpature only. Just one interface makes it more simply to use.
Disabling emulation mode only requires writing value 0 to sysfs node.
+::
-TEMP 120 |
+
+ TEMP 120 |
|
100 |
|
80 |
- | +-----------
- 60 | | |
- | +-------------| |
+ | +-----------
+ 60 | | |
+ | +-------------| |
40 | | | |
- | | | |
- 20 | | | +----------
- | | | | |
+ | | | |
+ 20 | | | +----------
+ | | | | |
0 |______________|_____________|__________|__________|_________
- A A A A TIME
+ A A A A TIME
|<----->| |<----->| |<----->| |
| 938us | | | | | |
-emulation : 0 50 | 70 | 20 | 0
-current temp : sensor 50 70 20 sensor
+ emulation : 0 50 | 70 | 20 | 0
+ current temp: sensor 50 70 20 sensor
diff --git a/Documentation/thermal/index.rst b/Documentation/thermal/index.rst
new file mode 100644
index 000000000000..8c1c00146cad
--- /dev/null
+++ b/Documentation/thermal/index.rst
@@ -0,0 +1,18 @@
+:orphan:
+
+=======
+Thermal
+=======
+
+.. toctree::
+ :maxdepth: 1
+
+ cpu-cooling-api
+ sysfs-api
+ power_allocator
+
+ exynos_thermal
+ exynos_thermal_emulation
+ intel_powerclamp
+ nouveau_thermal
+ x86_pkg_temperature_thermal
diff --git a/Documentation/thermal/intel_powerclamp.txt b/Documentation/thermal/intel_powerclamp.rst
similarity index 76%
rename from Documentation/thermal/intel_powerclamp.txt
rename to Documentation/thermal/intel_powerclamp.rst
index b5df21168fbc..3f6dfb0b3ea6 100644
--- a/Documentation/thermal/intel_powerclamp.txt
+++ b/Documentation/thermal/intel_powerclamp.rst
@@ -1,10 +1,13 @@
- =======================
- INTEL POWERCLAMP DRIVER
- =======================
-By: Arjan van de Ven <[email protected]>
- Jacob Pan <[email protected]>
+=======================
+Intel Powerclamp Driver
+=======================
+
+By:
+ - Arjan van de Ven <[email protected]>
+ - Jacob Pan <[email protected]>
+
+.. Contents:
-Contents:
(*) Introduction
- Goals and Objectives
@@ -23,7 +26,6 @@ Contents:
- Generic Thermal Layer (sysfs)
- Kernel APIs (TBD)
-============
INTRODUCTION
============
@@ -47,7 +49,6 @@ scalability, and user experience. In many cases, clear advantage is
shown over taking the CPU offline or modulating the CPU clock.
-===================
THEORY OF OPERATION
===================
@@ -57,11 +58,12 @@ Idle Injection
On modern Intel processors (Nehalem or later), package level C-state
residency is available in MSRs, thus also available to the kernel.
-These MSRs are:
- #define MSR_PKG_C2_RESIDENCY 0x60D
- #define MSR_PKG_C3_RESIDENCY 0x3F8
- #define MSR_PKG_C6_RESIDENCY 0x3F9
- #define MSR_PKG_C7_RESIDENCY 0x3FA
+These MSRs are::
+
+ #define MSR_PKG_C2_RESIDENCY 0x60D
+ #define MSR_PKG_C3_RESIDENCY 0x3F8
+ #define MSR_PKG_C6_RESIDENCY 0x3F9
+ #define MSR_PKG_C7_RESIDENCY 0x3FA
If the kernel can also inject idle time to the system, then a
closed-loop control system can be established that manages package
@@ -96,19 +98,21 @@ are not masked. Tests show that the extra wakeups from scheduler tick
have a dramatic impact on the effectiveness of the powerclamp driver
on large scale systems (Westmere system with 80 processors).
-CPU0
- ____________ ____________
-kidle_inject/0 | sleep | mwait | sleep |
- _________| |________| |_______
- duration
-CPU1
- ____________ ____________
-kidle_inject/1 | sleep | mwait | sleep |
- _________| |________| |_______
- ^
- |
- |
- roundup(jiffies, interval)
+::
+
+ CPU0
+ ____________ ____________
+ kidle_inject/0 | sleep | mwait | sleep |
+ _________| |________| |_______
+ duration
+ CPU1
+ ____________ ____________
+ kidle_inject/1 | sleep | mwait | sleep |
+ _________| |________| |_______
+ ^
+ |
+ |
+ roundup(jiffies, interval)
Only one CPU is allowed to collect statistics and update global
control parameters. This CPU is referred to as the controlling CPU in
@@ -148,7 +152,7 @@ b) determine the amount of compensation needed at each target ratio
Compensation to each target ratio consists of two parts:
- a) steady state error compensation
+ a) steady state error compensation
This is to offset the error occurring when the system can
enter idle without extra wakeups (such as external interrupts).
@@ -158,41 +162,42 @@ Compensation to each target ratio consists of two parts:
slowing down CPU activities.
A debugfs file is provided for the user to examine compensation
-progress and results, such as on a Westmere system.
-[jacob@nex01 ~]$ cat
-/sys/kernel/debug/intel_powerclamp/powerclamp_calib
-controlling cpu: 0
-pct confidence steady dynamic (compensation)
-0 0 0 0
-1 1 0 0
-2 1 1 0
-3 3 1 0
-4 3 1 0
-5 3 1 0
-6 3 1 0
-7 3 1 0
-8 3 1 0
-...
-30 3 2 0
-31 3 2 0
-32 3 1 0
-33 3 2 0
-34 3 1 0
-35 3 2 0
-36 3 1 0
-37 3 2 0
-38 3 1 0
-39 3 2 0
-40 3 3 0
-41 3 1 0
-42 3 2 0
-43 3 1 0
-44 3 1 0
-45 3 2 0
-46 3 3 0
-47 3 0 0
-48 3 2 0
-49 3 3 0
+progress and results, such as on a Westmere system::
+
+ [jacob@nex01 ~]$ cat
+ /sys/kernel/debug/intel_powerclamp/powerclamp_calib
+ controlling cpu: 0
+ pct confidence steady dynamic (compensation)
+ 0 0 0 0
+ 1 1 0 0
+ 2 1 1 0
+ 3 3 1 0
+ 4 3 1 0
+ 5 3 1 0
+ 6 3 1 0
+ 7 3 1 0
+ 8 3 1 0
+ ...
+ 30 3 2 0
+ 31 3 2 0
+ 32 3 1 0
+ 33 3 2 0
+ 34 3 1 0
+ 35 3 2 0
+ 36 3 1 0
+ 37 3 2 0
+ 38 3 1 0
+ 39 3 2 0
+ 40 3 3 0
+ 41 3 1 0
+ 42 3 2 0
+ 43 3 1 0
+ 44 3 1 0
+ 45 3 2 0
+ 46 3 3 0
+ 47 3 0 0
+ 48 3 2 0
+ 49 3 3 0
Calibration occurs during runtime. No offline method is available.
Steady state compensation is used only when confidence levels of all
@@ -217,9 +222,8 @@ keeps track of clamping kernel threads, even after they are migrated
to other CPUs, after a CPU offline event.
-=====================
Performance Analysis
-=====================
+====================
This section describes the general performance data collected on
multiple systems, including Westmere (80P) and Ivy Bridge (4P, 8P).
@@ -257,16 +261,15 @@ achieve up to 40% better performance per watt. (measured by a spin
counter summed over per CPU counting threads spawned for all running
CPUs).
-====================
Usage and Interfaces
====================
The powerclamp driver is registered to the generic thermal layer as a
-cooling device. Currently, it’s not bound to any thermal zones.
+cooling device. Currently, it’s not bound to any thermal zones::
-jacob@chromoly:/sys/class/thermal/cooling_device14$ grep . *
-cur_state:0
-max_state:50
-type:intel_powerclamp
+ jacob@chromoly:/sys/class/thermal/cooling_device14$ grep . *
+ cur_state:0
+ max_state:50
+ type:intel_powerclamp
cur_state allows user to set the desired idle percentage. Writing 0 to
cur_state will stop idle injection. Writing a value between 1 and
@@ -278,9 +281,9 @@ cur_state returns value -1 instead of 0 which is to avoid confusing
100% busy state with the disabled state.
Example usage:
-- To inject 25% idle time
-$ sudo sh -c "echo 25 > /sys/class/thermal/cooling_device80/cur_state
-"
+- To inject 25% idle time::
+
+ $ sudo sh -c "echo 25 > /sys/class/thermal/cooling_device80/cur_state
If the system is not busy and has more than 25% idle time already,
then the powerclamp driver will not start idle injection. Using Top
@@ -292,23 +295,23 @@ idle time is accounted as normal idle in that common code path is
taken as the idle task.
In this example, 24.1% idle is shown. This helps the system admin or
-user determine the cause of slowdown, when a powerclamp driver is in action.
+user determine the cause of slowdown, when a powerclamp driver is in action::
-Tasks: 197 total, 1 running, 196 sleeping, 0 stopped, 0 zombie
-Cpu(s): 71.2%us, 4.7%sy, 0.0%ni, 24.1%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
-Mem: 3943228k total, 1689632k used, 2253596k free, 74960k buffers
-Swap: 4087804k total, 0k used, 4087804k free, 945336k cached
+ Tasks: 197 total, 1 running, 196 sleeping, 0 stopped, 0 zombie
+ Cpu(s): 71.2%us, 4.7%sy, 0.0%ni, 24.1%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
+ Mem: 3943228k total, 1689632k used, 2253596k free, 74960k buffers
+ Swap: 4087804k total, 0k used, 4087804k free, 945336k cached
- PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
- 3352 jacob 20 0 262m 644 428 S 286 0.0 0:17.16 spin
- 3341 root -51 0 0 0 0 D 25 0.0 0:01.62 kidle_inject/0
- 3344 root -51 0 0 0 0 D 25 0.0 0:01.60 kidle_inject/3
- 3342 root -51 0 0 0 0 D 25 0.0 0:01.61 kidle_inject/1
- 3343 root -51 0 0 0 0 D 25 0.0 0:01.60 kidle_inject/2
- 2935 jacob 20 0 696m 125m 35m S 5 3.3 0:31.11 firefox
- 1546 root 20 0 158m 20m 6640 S 3 0.5 0:26.97 Xorg
- 2100 jacob 20 0 1223m 88m 30m S 3 2.3 0:23.68 compiz
+ PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
+ 3352 jacob 20 0 262m 644 428 S 286 0.0 0:17.16 spin
+ 3341 root -51 0 0 0 0 D 25 0.0 0:01.62 kidle_inject/0
+ 3344 root -51 0 0 0 0 D 25 0.0 0:01.60 kidle_inject/3
+ 3342 root -51 0 0 0 0 D 25 0.0 0:01.61 kidle_inject/1
+ 3343 root -51 0 0 0 0 D 25 0.0 0:01.60 kidle_inject/2
+ 2935 jacob 20 0 696m 125m 35m S 5 3.3 0:31.11 firefox
+ 1546 root 20 0 158m 20m 6640 S 3 0.5 0:26.97 Xorg
+ 2100 jacob 20 0 1223m 88m 30m S 3 2.3 0:23.68 compiz
Tests have shown that by using the powerclamp driver as a cooling
device, a PID based userspace thermal controller can manage to
diff --git a/Documentation/thermal/nouveau_thermal b/Documentation/thermal/nouveau_thermal.rst
similarity index 64%
rename from Documentation/thermal/nouveau_thermal
rename to Documentation/thermal/nouveau_thermal.rst
index 6e17a11efcb0..37255fd6735d 100644
--- a/Documentation/thermal/nouveau_thermal
+++ b/Documentation/thermal/nouveau_thermal.rst
@@ -1,13 +1,15 @@
+=====================
Kernel driver nouveau
-===================
+=====================
Supported chips:
+
* NV43+
Authors: Martin Peres (mupuf) <[email protected]>
Description
----------
+-----------
This driver allows to read the GPU core temperature, drive the GPU fan and
set temperature alarms.
@@ -19,20 +21,25 @@ interface is likely not to work. This document may then not cover your situation
entirely.
Temperature management
---------------------
+----------------------
Temperature is exposed under as a read-only HWMON attribute temp1_input.
In order to protect the GPU from overheating, Nouveau supports 4 configurable
temperature thresholds:
- * Fan_boost: Fan speed is set to 100% when reaching this temperature;
- * Downclock: The GPU will be downclocked to reduce its power dissipation;
- * Critical: The GPU is put on hold to further lower power dissipation;
- * Shutdown: Shut the computer down to protect your GPU.
+ * Fan_boost:
+ Fan speed is set to 100% when reaching this temperature;
+ * Downclock:
+ The GPU will be downclocked to reduce its power dissipation;
+ * Critical:
+ The GPU is put on hold to further lower power dissipation;
+ * Shutdown:
+ Shut the computer down to protect your GPU.
-WARNING: Some of these thresholds may not be used by Nouveau depending
-on your chipset.
+WARNING:
+ Some of these thresholds may not be used by Nouveau depending
+ on your chipset.
The default value for these thresholds comes from the GPU's vbios. These
thresholds can be configured thanks to the following HWMON attributes:
@@ -46,19 +53,24 @@ NOTE: Remember that the values are stored as milli degrees Celsius. Don't forget
to multiply!
Fan management
-------------
+--------------
Not all cards have a drivable fan. If you do, then the following HWMON
attributes should be available:
- * pwm1_enable: Current fan management mode (NONE, MANUAL or AUTO);
- * pwm1: Current PWM value (power percentage);
- * pwm1_min: The minimum PWM speed allowed;
- * pwm1_max: The maximum PWM speed allowed (bypassed when hitting Fan_boost);
+ * pwm1_enable:
+ Current fan management mode (NONE, MANUAL or AUTO);
+ * pwm1:
+ Current PWM value (power percentage);
+ * pwm1_min:
+ The minimum PWM speed allowed;
+ * pwm1_max:
+ The maximum PWM speed allowed (bypassed when hitting Fan_boost);
You may also have the following attribute:
- * fan1_input: Speed in RPM of your fan.
+ * fan1_input:
+ Speed in RPM of your fan.
Your fan can be driven in different modes:
@@ -66,14 +78,16 @@ Your fan can be driven in different modes:
* 1: The fan can be driven in manual (use pwm1 to change the speed);
* 2; The fan is driven automatically depending on the temperature.
-NOTE: Be sure to use the manual mode if you want to drive the fan speed manually
+NOTE:
+ Be sure to use the manual mode if you want to drive the fan speed manually
-NOTE2: When operating in manual mode outside the vbios-defined
-[PWM_min, PWM_max] range, the reported fan speed (RPM) may not be accurate
-depending on your hardware.
+NOTE2:
+ When operating in manual mode outside the vbios-defined
+ [PWM_min, PWM_max] range, the reported fan speed (RPM) may not be accurate
+ depending on your hardware.
Bug reports
----------
+-----------
Thermal management on Nouveau is new and may not work on all cards. If you have
inquiries, please ping mupuf on IRC (#nouveau, freenode).
diff --git a/Documentation/thermal/power_allocator.txt b/Documentation/thermal/power_allocator.rst
similarity index 74%
rename from Documentation/thermal/power_allocator.txt
rename to Documentation/thermal/power_allocator.rst
index 9fb0ff06dca9..67b6a3297238 100644
--- a/Documentation/thermal/power_allocator.txt
+++ b/Documentation/thermal/power_allocator.rst
@@ -1,3 +1,4 @@
+=================================
Power allocator governor tunables
=================================
@@ -25,36 +26,36 @@ temperature as the control input and power as the controlled output:
P_max = k_p * e + k_i * err_integral + k_d * diff_err + sustainable_power
where
- e = desired_temperature - current_temperature
- err_integral is the sum of previous errors
- diff_err = e - previous_error
+ - e = desired_temperature - current_temperature
+ - err_integral is the sum of previous errors
+ - diff_err = e - previous_error
-It is similar to the one depicted below:
+It is similar to the one depicted below::
- k_d
- |
-current_temp |
- | v
- | +----------+ +---+
- | +----->| diff_err |-->| X |------+
- | | +----------+ +---+ |
- | | | tdp actor
- | | k_i | | get_requested_power()
- | | | | | | |
- | | | | | | | ...
- v | v v v v v
- +---+ | +-------+ +---+ +---+ +---+ +----------+
- | S |-------+----->| sum e |----->| X |--->| S |-->| S |-->|power |
- +---+ | +-------+ +---+ +---+ +---+ |allocation|
- ^ | ^ +----------+
- | | | | |
- | | +---+ | | |
- | +------->| X |-------------------+ v v
- | +---+ granted performance
-desired_temperature ^
- |
- |
- k_po/k_pu
+ k_d
+ |
+ current_temp |
+ | v
+ | +----------+ +---+
+ | +----->| diff_err |-->| X |------+
+ | | +----------+ +---+ |
+ | | | tdp actor
+ | | k_i | | get_requested_power()
+ | | | | | | |
+ | | | | | | | ...
+ v | v v v v v
+ +---+ | +-------+ +---+ +---+ +---+ +----------+
+ | S |-----+----->| sum e |----->| X |--->| S |-->| S |-->|power |
+ +---+ | +-------+ +---+ +---+ +---+ |allocation|
+ ^ | ^ +----------+
+ | | | | |
+ | | +---+ | | |
+ | +------->| X |-------------------+ v v
+ | +---+ granted performance
+ desired_temperature ^
+ |
+ |
+ k_po/k_pu
Sustainable power
-----------------
@@ -73,7 +74,7 @@ is typically 2000mW, while on a 10" tablet is around 4500mW (may vary
depending on screen size).
If you are using device tree, do add it as a property of the
-thermal-zone. For example:
+thermal-zone. For example::
thermal-zones {
soc_thermal {
@@ -85,7 +86,7 @@ thermal-zone. For example:
Instead, if the thermal zone is registered from the platform code, pass a
`thermal_zone_params` that has a `sustainable_power`. If no
`thermal_zone_params` were being passed, then something like below
-will suffice:
+will suffice::
static const struct thermal_zone_params tz_params = {
.sustainable_power = 3500,
@@ -112,18 +113,18 @@ available capacity at a low temperature. On the other hand, a high
value of `k_pu` will result in the governor granting very high power
while temperature is low, and may lead to temperature overshooting.
-The default value for `k_pu` is:
+The default value for `k_pu` is::
2 * sustainable_power / (desired_temperature - switch_on_temp)
This means that at `switch_on_temp` the output of the controller's
proportional term will be 2 * `sustainable_power`. The default value
-for `k_po` is:
+for `k_po` is::
sustainable_power / (desired_temperature - switch_on_temp)
Focusing on the proportional and feed forward values of the PID
-controller equation we have:
+controller equation we have::
P_max = k_p * e + sustainable_power
@@ -134,21 +135,23 @@ is the desired one, then the proportional component is zero and
thermal equilibrium under constant load. `sustainable_power` is only
an estimate, which is the reason for closed-loop control such as this.
-Expanding `k_pu` we get:
+Expanding `k_pu` we get::
+
P_max = 2 * sustainable_power * (T_set - T) / (T_set - T_on) +
- sustainable_power
+ sustainable_power
-where
- T_set is the desired temperature
- T is the current temperature
- T_on is the switch on temperature
+where:
+
+ - T_set is the desired temperature
+ - T is the current temperature
+ - T_on is the switch on temperature
When the current temperature is the switch_on temperature, the above
-formula becomes:
+formula becomes::
P_max = 2 * sustainable_power * (T_set - T_on) / (T_set - T_on) +
- sustainable_power = 2 * sustainable_power + sustainable_power =
- 3 * sustainable_power
+ sustainable_power = 2 * sustainable_power + sustainable_power =
+ 3 * sustainable_power
Therefore, the proportional term alone linearly decreases power from
3 * `sustainable_power` to `sustainable_power` as the temperature
@@ -178,11 +181,18 @@ Cooling device power API
Cooling devices controlled by this governor must supply the additional
"power" API in their `cooling_device_ops`. It consists on three ops:
-1. int get_requested_power(struct thermal_cooling_device *cdev,
- struct thermal_zone_device *tz, u32 *power);
-@cdev: The `struct thermal_cooling_device` pointer
-@tz: thermal zone in which we are currently operating
-@power: pointer in which to store the calculated power
+1. ::
+
+ int get_requested_power(struct thermal_cooling_device *cdev,
+ struct thermal_zone_device *tz, u32 *power);
+
+
+@cdev:
+ The `struct thermal_cooling_device` pointer
+@tz:
+ thermal zone in which we are currently operating
+@power:
+ pointer in which to store the calculated power
`get_requested_power()` calculates the power requested by the device
in milliwatts and stores it in @power . It should return 0 on
@@ -190,23 +200,37 @@ success, -E* on failure. This is currently used by the power
allocator governor to calculate how much power to give to each cooling
device.
-2. int state2power(struct thermal_cooling_device *cdev, struct
- thermal_zone_device *tz, unsigned long state, u32 *power);
-@cdev: The `struct thermal_cooling_device` pointer
-@tz: thermal zone in which we are currently operating
-@state: A cooling device state
-@power: pointer in which to store the equivalent power
+2. ::
+
+ int state2power(struct thermal_cooling_device *cdev, struct
+ thermal_zone_device *tz, unsigned long state,
+ u32 *power);
+
+@cdev:
+ The `struct thermal_cooling_device` pointer
+@tz:
+ thermal zone in which we are currently operating
+@state:
+ A cooling device state
+@power:
+ pointer in which to store the equivalent power
Convert cooling device state @state into power consumption in
milliwatts and store it in @power. It should return 0 on success, -E*
on failure. This is currently used by thermal core to calculate the
maximum power that an actor can consume.
-3. int power2state(struct thermal_cooling_device *cdev, u32 power,
- unsigned long *state);
-@cdev: The `struct thermal_cooling_device` pointer
-@power: power in milliwatts
-@state: pointer in which to store the resulting state
+3. ::
+
+ int power2state(struct thermal_cooling_device *cdev, u32 power,
+ unsigned long *state);
+
+@cdev:
+ The `struct thermal_cooling_device` pointer
+@power:
+ power in milliwatts
+@state:
+ pointer in which to store the resulting state
Calculate a cooling device state that would make the device consume at
most @power mW and store it in @state. It should return 0 on success,
diff --git a/Documentation/thermal/sysfs-api.txt b/Documentation/thermal/sysfs-api.rst
similarity index 66%
rename from Documentation/thermal/sysfs-api.txt
rename to Documentation/thermal/sysfs-api.rst
index c3fa500df92c..e4930761d3e5 100644
--- a/Documentation/thermal/sysfs-api.txt
+++ b/Documentation/thermal/sysfs-api.rst
@@ -1,3 +1,4 @@
+===================================
Generic Thermal Sysfs driver How To
===================================
@@ -9,6 +10,7 @@ Copyright (c) 2008 Intel Corporation
0. Introduction
+===============
The generic thermal sysfs provides a set of interfaces for thermal zone
devices (sensors) and thermal cooling devices (fan, processor...) to register
@@ -25,59 +27,90 @@ An intelligent thermal management application can make decisions based on
inputs from thermal zone attributes (the current temperature and trip point
temperature) and throttle appropriate devices.
-[0-*] denotes any positive number starting from 0
-[1-*] denotes any positive number starting from 1
+- `[0-*]` denotes any positive number starting from 0
+- `[1-*]` denotes any positive number starting from 1
1. thermal sysfs driver interface functions
+===========================================
1.1 thermal zone device interface
-1.1.1 struct thermal_zone_device *thermal_zone_device_register(char *type,
- int trips, int mask, void *devdata,
- struct thermal_zone_device_ops *ops,
- const struct thermal_zone_params *tzp,
- int passive_delay, int polling_delay))
+---------------------------------
+
+ ::
+
+ struct thermal_zone_device
+ *thermal_zone_device_register(char *type,
+ int trips, int mask, void *devdata,
+ struct thermal_zone_device_ops *ops,
+ const struct thermal_zone_params *tzp,
+ int passive_delay, int polling_delay))
This interface function adds a new thermal zone device (sensor) to
- /sys/class/thermal folder as thermal_zone[0-*]. It tries to bind all the
+ /sys/class/thermal folder as `thermal_zone[0-*]`. It tries to bind all the
thermal cooling devices registered at the same time.
- type: the thermal zone type.
- trips: the total number of trip points this thermal zone supports.
- mask: Bit string: If 'n'th bit is set, then trip point 'n' is writeable.
- devdata: device private data
- ops: thermal zone device call-backs.
- .bind: bind the thermal zone device with a thermal cooling device.
- .unbind: unbind the thermal zone device with a thermal cooling device.
- .get_temp: get the current temperature of the thermal zone.
- .set_trips: set the trip points window. Whenever the current temperature
+ type:
+ the thermal zone type.
+ trips:
+ the total number of trip points this thermal zone supports.
+ mask:
+ Bit string: If 'n'th bit is set, then trip point 'n' is writeable.
+ devdata:
+ device private data
+ ops:
+ thermal zone device call-backs.
+
+ .bind:
+ bind the thermal zone device with a thermal cooling device.
+ .unbind:
+ unbind the thermal zone device with a thermal cooling device.
+ .get_temp:
+ get the current temperature of the thermal zone.
+ .set_trips:
+ set the trip points window. Whenever the current temperature
is updated, the trip points immediately below and above the
current temperature are found.
- .get_mode: get the current mode (enabled/disabled) of the thermal zone.
- - "enabled" means the kernel thermal management is enabled.
- - "disabled" will prevent kernel thermal driver action upon trip points
- so that user applications can take charge of thermal management.
- .set_mode: set the mode (enabled/disabled) of the thermal zone.
- .get_trip_type: get the type of certain trip point.
- .get_trip_temp: get the temperature above which the certain trip point
+ .get_mode:
+ get the current mode (enabled/disabled) of the thermal zone.
+
+ - "enabled" means the kernel thermal management is
+ enabled.
+ - "disabled" will prevent kernel thermal driver action
+ upon trip points so that user applications can take
+ charge of thermal management.
+ .set_mode:
+ set the mode (enabled/disabled) of the thermal zone.
+ .get_trip_type:
+ get the type of certain trip point.
+ .get_trip_temp:
+ get the temperature above which the certain trip point
will be fired.
- .set_emul_temp: set the emulation temperature which helps in debugging
+ .set_emul_temp:
+ set the emulation temperature which helps in debugging
different threshold temperature points.
- tzp: thermal zone platform parameters.
- passive_delay: number of milliseconds to wait between polls when
+ tzp:
+ thermal zone platform parameters.
+ passive_delay:
+ number of milliseconds to wait between polls when
performing passive cooling.
- polling_delay: number of milliseconds to wait between polls when checking
+ polling_delay:
+ number of milliseconds to wait between polls when checking
whether trip points have been crossed (0 for interrupt driven systems).
+ ::
-1.1.2 void thermal_zone_device_unregister(struct thermal_zone_device *tz)
+ void thermal_zone_device_unregister(struct thermal_zone_device *tz)
This interface function removes the thermal zone device.
It deletes the corresponding entry from /sys/class/thermal folder and
unbinds all the thermal cooling devices it uses.
-1.1.3 struct thermal_zone_device *thermal_zone_of_sensor_register(
- struct device *dev, int sensor_id, void *data,
- const struct thermal_zone_of_device_ops *ops)
+ ::
+
+ struct thermal_zone_device
+ *thermal_zone_of_sensor_register(struct device *dev, int sensor_id,
+ void *data,
+ const struct thermal_zone_of_device_ops *ops)
This interface adds a new sensor to a DT thermal zone.
This function will search the list of thermal zones described in
@@ -87,25 +120,33 @@ temperature) and throttle appropriate devices.
thermal zone device.
The parameters for this interface are:
- dev: Device node of sensor containing valid node pointer in
+
+ dev:
+ Device node of sensor containing valid node pointer in
dev->of_node.
- sensor_id: a sensor identifier, in case the sensor IP has more
+ sensor_id:
+ a sensor identifier, in case the sensor IP has more
than one sensors
- data: a private pointer (owned by the caller) that will be
+ data:
+ a private pointer (owned by the caller) that will be
passed back, when a temperature reading is needed.
- ops: struct thermal_zone_of_device_ops *.
+ ops:
+ `struct thermal_zone_of_device_ops *`.
- get_temp: a pointer to a function that reads the
+ ============== =======================================
+ get_temp a pointer to a function that reads the
sensor temperature. This is mandatory
callback provided by sensor driver.
- set_trips: a pointer to a function that sets a
+ set_trips a pointer to a function that sets a
temperature window. When this window is
left the driver must inform the thermal
core via thermal_zone_device_update.
- get_trend: a pointer to a function that reads the
+ get_trend a pointer to a function that reads the
sensor temperature trend.
- set_emul_temp: a pointer to a function that sets
+ set_emul_temp a pointer to a function that sets
sensor emulated temperature.
+ ============== =======================================
+
The thermal zone temperature is provided by the get_temp() function
pointer of thermal_zone_of_device_ops. When called, it will
have the private pointer @data back.
@@ -114,8 +155,10 @@ temperature) and throttle appropriate devices.
handle. Caller should check the return handle with IS_ERR() for finding
whether success or not.
-1.1.4 void thermal_zone_of_sensor_unregister(struct device *dev,
- struct thermal_zone_device *tzd)
+ ::
+
+ void thermal_zone_of_sensor_unregister(struct device *dev,
+ struct thermal_zone_device *tzd)
This interface unregisters a sensor from a DT thermal zone which was
successfully added by interface thermal_zone_of_sensor_register().
@@ -124,21 +167,29 @@ temperature) and throttle appropriate devices.
interface. It will also silent the zone by remove the .get_temp() and
get_trend() thermal zone device callbacks.
-1.1.5 struct thermal_zone_device *devm_thermal_zone_of_sensor_register(
- struct device *dev, int sensor_id,
- void *data, const struct thermal_zone_of_device_ops *ops)
+ ::
+
+ struct thermal_zone_device
+ *devm_thermal_zone_of_sensor_register(struct device *dev,
+ int sensor_id,
+ void *data,
+ const struct thermal_zone_of_device_ops *ops)
This interface is resource managed version of
thermal_zone_of_sensor_register().
+
All details of thermal_zone_of_sensor_register() described in
section 1.1.3 is applicable here.
+
The benefit of using this interface to register sensor is that it
is not require to explicitly call thermal_zone_of_sensor_unregister()
in error path or during driver unbinding as this is done by driver
resource manager.
-1.1.6 void devm_thermal_zone_of_sensor_unregister(struct device *dev,
- struct thermal_zone_device *tzd)
+ ::
+
+ void devm_thermal_zone_of_sensor_unregister(struct device *dev,
+ struct thermal_zone_device *tzd)
This interface is resource managed version of
thermal_zone_of_sensor_unregister().
@@ -147,123 +198,186 @@ temperature) and throttle appropriate devices.
Normally this function will not need to be called and the resource
management code will ensure that the resource is freed.
-1.1.7 int thermal_zone_get_slope(struct thermal_zone_device *tz)
+ ::
+
+ int thermal_zone_get_slope(struct thermal_zone_device *tz)
This interface is used to read the slope attribute value
for the thermal zone device, which might be useful for platform
drivers for temperature calculations.
-1.1.8 int thermal_zone_get_offset(struct thermal_zone_device *tz)
+ ::
+
+ int thermal_zone_get_offset(struct thermal_zone_device *tz)
This interface is used to read the offset attribute value
for the thermal zone device, which might be useful for platform
drivers for temperature calculations.
1.2 thermal cooling device interface
-1.2.1 struct thermal_cooling_device *thermal_cooling_device_register(char *name,
- void *devdata, struct thermal_cooling_device_ops *)
+------------------------------------
+
+
+ ::
+
+ struct thermal_cooling_device
+ *thermal_cooling_device_register(char *name,
+ void *devdata, struct thermal_cooling_device_ops *)
This interface function adds a new thermal cooling device (fan/processor/...)
- to /sys/class/thermal/ folder as cooling_device[0-*]. It tries to bind itself
+ to /sys/class/thermal/ folder as `cooling_device[0-*]`. It tries to bind itself
to all the thermal zone devices registered at the same time.
- name: the cooling device name.
- devdata: device private data.
- ops: thermal cooling devices call-backs.
- .get_max_state: get the Maximum throttle state of the cooling device.
- .get_cur_state: get the Currently requested throttle state of the cooling device.
- .set_cur_state: set the Current throttle state of the cooling device.
-
-1.2.2 void thermal_cooling_device_unregister(struct thermal_cooling_device *cdev)
+
+ name:
+ the cooling device name.
+ devdata:
+ device private data.
+ ops:
+ thermal cooling devices call-backs.
+
+ .get_max_state:
+ get the Maximum throttle state of the cooling device.
+ .get_cur_state:
+ get the Currently requested throttle state of the
+ cooling device.
+ .set_cur_state:
+ set the Current throttle state of the cooling device.
+
+ ::
+
+ void thermal_cooling_device_unregister(struct thermal_cooling_device *cdev)
This interface function removes the thermal cooling device.
It deletes the corresponding entry from /sys/class/thermal folder and
unbinds itself from all the thermal zone devices using it.
1.3 interface for binding a thermal zone device with a thermal cooling device
-1.3.1 int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz,
- int trip, struct thermal_cooling_device *cdev,
- unsigned long upper, unsigned long lower, unsigned int weight);
+-----------------------------------------------------------------------------
+
+ ::
+
+ int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz,
+ int trip, struct thermal_cooling_device *cdev,
+ unsigned long upper, unsigned long lower, unsigned int weight);
This interface function binds a thermal cooling device to a particular trip
point of a thermal zone device.
+
This function is usually called in the thermal zone device .bind callback.
- tz: the thermal zone device
- cdev: thermal cooling device
- trip: indicates which trip point in this thermal zone the cooling device
- is associated with.
- upper:the Maximum cooling state for this trip point.
- THERMAL_NO_LIMIT means no upper limit,
+
+ tz:
+ the thermal zone device
+ cdev:
+ thermal cooling device
+ trip:
+ indicates which trip point in this thermal zone the cooling device
+ is associated with.
+ upper:
+ the Maximum cooling state for this trip point.
+ THERMAL_NO_LIMIT means no upper limit,
and the cooling device can be in max_state.
- lower:the Minimum cooling state can be used for this trip point.
- THERMAL_NO_LIMIT means no lower limit,
+ lower:
+ the Minimum cooling state can be used for this trip point.
+ THERMAL_NO_LIMIT means no lower limit,
and the cooling device can be in cooling state 0.
- weight: the influence of this cooling device in this thermal
- zone. See 1.4.1 below for more information.
+ weight:
+ the influence of this cooling device in this thermal
+ zone. See 1.4.1 below for more information.
-1.3.2 int thermal_zone_unbind_cooling_device(struct thermal_zone_device *tz,
- int trip, struct thermal_cooling_device *cdev);
+ ::
+
+ int thermal_zone_unbind_cooling_device(struct thermal_zone_device *tz,
+ int trip, struct thermal_cooling_device *cdev);
This interface function unbinds a thermal cooling device from a particular
trip point of a thermal zone device. This function is usually called in
the thermal zone device .unbind callback.
- tz: the thermal zone device
- cdev: thermal cooling device
- trip: indicates which trip point in this thermal zone the cooling device
- is associated with.
+
+ tz:
+ the thermal zone device
+ cdev:
+ thermal cooling device
+ trip:
+ indicates which trip point in this thermal zone the cooling device
+ is associated with.
1.4 Thermal Zone Parameters
-1.4.1 struct thermal_bind_params
+---------------------------
+
+ ::
+
+ struct thermal_bind_params
+
This structure defines the following parameters that are used to bind
a zone with a cooling device for a particular trip point.
- .cdev: The cooling device pointer
- .weight: The 'influence' of a particular cooling device on this
- zone. This is relative to the rest of the cooling
- devices. For example, if all cooling devices have a
- weight of 1, then they all contribute the same. You can
- use percentages if you want, but it's not mandatory. A
- weight of 0 means that this cooling device doesn't
- contribute to the cooling of this zone unless all cooling
- devices have a weight of 0. If all weights are 0, then
- they all contribute the same.
- .trip_mask:This is a bit mask that gives the binding relation between
- this thermal zone and cdev, for a particular trip point.
- If nth bit is set, then the cdev and thermal zone are bound
- for trip point n.
- .binding_limits: This is an array of cooling state limits. Must have
- exactly 2 * thermal_zone.number_of_trip_points. It is an
- array consisting of tuples <lower-state upper-state> of
- state limits. Each trip will be associated with one state
- limit tuple when binding. A NULL pointer means
- <THERMAL_NO_LIMITS THERMAL_NO_LIMITS> on all trips.
- These limits are used when binding a cdev to a trip point.
- .match: This call back returns success(0) if the 'tz and cdev' need to
+
+ .cdev:
+ The cooling device pointer
+ .weight:
+ The 'influence' of a particular cooling device on this
+ zone. This is relative to the rest of the cooling
+ devices. For example, if all cooling devices have a
+ weight of 1, then they all contribute the same. You can
+ use percentages if you want, but it's not mandatory. A
+ weight of 0 means that this cooling device doesn't
+ contribute to the cooling of this zone unless all cooling
+ devices have a weight of 0. If all weights are 0, then
+ they all contribute the same.
+ .trip_mask:
+ This is a bit mask that gives the binding relation between
+ this thermal zone and cdev, for a particular trip point.
+ If nth bit is set, then the cdev and thermal zone are bound
+ for trip point n.
+ .binding_limits:
+ This is an array of cooling state limits. Must have
+ exactly 2 * thermal_zone.number_of_trip_points. It is an
+ array consisting of tuples <lower-state upper-state> of
+ state limits. Each trip will be associated with one state
+ limit tuple when binding. A NULL pointer means
+ <THERMAL_NO_LIMITS THERMAL_NO_LIMITS> on all trips.
+ These limits are used when binding a cdev to a trip point.
+ .match:
+ This call back returns success(0) if the 'tz and cdev' need to
be bound, as per platform data.
-1.4.2 struct thermal_zone_params
+
+ ::
+
+ struct thermal_zone_params
+
This structure defines the platform level parameters for a thermal zone.
This data, for each thermal zone should come from the platform layer.
This is an optional feature where some platforms can choose not to
provide this data.
- .governor_name: Name of the thermal governor used for this zone
- .no_hwmon: a boolean to indicate if the thermal to hwmon sysfs interface
- is required. when no_hwmon == false, a hwmon sysfs interface
- will be created. when no_hwmon == true, nothing will be done.
- In case the thermal_zone_params is NULL, the hwmon interface
- will be created (for backward compatibility).
- .num_tbps: Number of thermal_bind_params entries for this zone
- .tbp: thermal_bind_params entries
+
+ .governor_name:
+ Name of the thermal governor used for this zone
+ .no_hwmon:
+ a boolean to indicate if the thermal to hwmon sysfs interface
+ is required. when no_hwmon == false, a hwmon sysfs interface
+ will be created. when no_hwmon == true, nothing will be done.
+ In case the thermal_zone_params is NULL, the hwmon interface
+ will be created (for backward compatibility).
+ .num_tbps:
+ Number of thermal_bind_params entries for this zone
+ .tbp:
+ thermal_bind_params entries
2. sysfs attributes structure
+=============================
+== ================
RO read only value
WO write only value
RW read/write value
+== ================
Thermal sysfs attributes will be represented under /sys/class/thermal.
Hwmon sysfs I/F extension is also available under /sys/class/hwmon
if hwmon is compiled in or built as a module.
-Thermal zone device sys I/F, created once it's registered:
-/sys/class/thermal/thermal_zone[0-*]:
+Thermal zone device sys I/F, created once it's registered::
+
+ /sys/class/thermal/thermal_zone[0-*]:
|---type: Type of the thermal zone
|---temp: Current temperature
|---mode: Working mode of the thermal zone
@@ -282,8 +396,9 @@ Thermal zone device sys I/F, created once it's registered:
|---slope: Slope constant applied as linear extrapolation
|---offset: Offset constant applied as linear extrapolation
-Thermal cooling device sys I/F, created once it's registered:
-/sys/class/thermal/cooling_device[0-*]:
+Thermal cooling device sys I/F, created once it's registered::
+
+ /sys/class/thermal/cooling_device[0-*]:
|---type: Type of the cooling device(processor/fan/...)
|---max_state: Maximum cooling state of the cooling device
|---cur_state: Current cooling state of the cooling device
@@ -299,11 +414,13 @@ the relationship between a thermal zone and its associated cooling device.
They are created/removed for each successful execution of
thermal_zone_bind_cooling_device/thermal_zone_unbind_cooling_device.
-/sys/class/thermal/thermal_zone[0-*]:
+::
+
+ /sys/class/thermal/thermal_zone[0-*]:
|---cdev[0-*]: [0-*]th cooling device in current thermal zone
|---cdev[0-*]_trip_point: Trip point that cdev[0-*] is associated with
|---cdev[0-*]_weight: Influence of the cooling device in
- this thermal zone
+ this thermal zone
Besides the thermal zone device sysfs I/F and cooling device sysfs I/F,
the generic thermal driver also creates a hwmon sysfs I/F for each _type_
@@ -311,16 +428,17 @@ of thermal zone device. E.g. the generic thermal driver registers one hwmon
class device and build the associated hwmon sysfs I/F for all the registered
ACPI thermal zones.
-/sys/class/hwmon/hwmon[0-*]:
+::
+
+ /sys/class/hwmon/hwmon[0-*]:
|---name: The type of the thermal zone devices
|---temp[1-*]_input: The current temperature of thermal zone [1-*]
|---temp[1-*]_critical: The critical trip point of thermal zone [1-*]
Please read Documentation/hwmon/sysfs-interface.rst for additional information.
-***************************
-* Thermal zone attributes *
-***************************
+Thermal zone attributes
+-----------------------
type
Strings which represent the thermal zone type.
@@ -340,54 +458,67 @@ mode
This file gives information about the algorithm that is currently
managing the thermal zone. It can be either default kernel based
algorithm or user space application.
- enabled = enable Kernel Thermal management.
- disabled = Preventing kernel thermal zone driver actions upon
+
+ enabled
+ enable Kernel Thermal management.
+ disabled
+ Preventing kernel thermal zone driver actions upon
trip points so that user application can take full
charge of the thermal management.
+
RW, Optional
policy
One of the various thermal governors used for a particular zone.
+
RW, Required
available_policies
Available thermal governors which can be used for a particular zone.
+
RO, Required
-trip_point_[0-*]_temp
+`trip_point_[0-*]_temp`
The temperature above which trip point will be fired.
+
Unit: millidegree Celsius
+
RO, Optional
-trip_point_[0-*]_type
+`trip_point_[0-*]_type`
Strings which indicate the type of the trip point.
- E.g. it can be one of critical, hot, passive, active[0-*] for ACPI
+
+ E.g. it can be one of critical, hot, passive, `active[0-*]` for ACPI
thermal zone.
+
RO, Optional
-trip_point_[0-*]_hyst
+`trip_point_[0-*]_hyst`
The hysteresis value for a trip point, represented as an integer
Unit: Celsius
RW, Optional
-cdev[0-*]
+`cdev[0-*]`
Sysfs link to the thermal cooling device node where the sys I/F
for cooling device throttling control represents.
+
RO, Optional
-cdev[0-*]_trip_point
- The trip point in this thermal zone which cdev[0-*] is associated
+`cdev[0-*]_trip_point`
+ The trip point in this thermal zone which `cdev[0-*]` is associated
with; -1 means the cooling device is not associated with any trip
point.
+
RO, Optional
-cdev[0-*]_weight
- The influence of cdev[0-*] in this thermal zone. This value
- is relative to the rest of cooling devices in the thermal
- zone. For example, if a cooling device has a weight double
- than that of other, it's twice as effective in cooling the
- thermal zone.
- RW, Optional
+`cdev[0-*]_weight`
+ The influence of `cdev[0-*]` in this thermal zone. This value
+ is relative to the rest of cooling devices in the thermal
+ zone. For example, if a cooling device has a weight double
+ than that of other, it's twice as effective in cooling the
+ thermal zone.
+
+ RW, Optional
passive
Attribute is only present for zones in which the passive cooling
@@ -395,8 +526,11 @@ passive
and can be set to a temperature (in millidegrees) to enable a
passive trip point for the zone. Activation is done by polling with
an interval of 1 second.
+
Unit: millidegrees Celsius
+
Valid values: 0 (disabled) or greater than 1000
+
RW, Optional
emul_temp
@@ -407,17 +541,21 @@ emul_temp
threshold and its associated cooling action. This is write only node
and writing 0 on this node should disable emulation.
Unit: millidegree Celsius
+
WO, Optional
- WARNING: Be careful while enabling this option on production systems,
- because userland can easily disable the thermal policy by simply
- flooding this sysfs node with low temperature values.
+ WARNING:
+ Be careful while enabling this option on production systems,
+ because userland can easily disable the thermal policy by simply
+ flooding this sysfs node with low temperature values.
sustainable_power
An estimate of the sustained power that can be dissipated by
the thermal zone. Used by the power allocator governor. For
- more information see Documentation/thermal/power_allocator.txt
+ more information see Documentation/thermal/power_allocator.rst
+
Unit: milliwatts
+
RW, Optional
k_po
@@ -425,7 +563,8 @@ k_po
controller during temperature overshoot. Temperature overshoot
is when the current temperature is above the "desired
temperature" trip point. For more information see
- Documentation/thermal/power_allocator.txt
+ Documentation/thermal/power_allocator.rst
+
RW, Optional
k_pu
@@ -433,20 +572,23 @@ k_pu
controller during temperature undershoot. Temperature undershoot
is when the current temperature is below the "desired
temperature" trip point. For more information see
- Documentation/thermal/power_allocator.txt
+ Documentation/thermal/power_allocator.rst
+
RW, Optional
k_i
The integral term of the power allocator governor's PID
controller. This term allows the PID controller to compensate
for long term drift. For more information see
- Documentation/thermal/power_allocator.txt
+ Documentation/thermal/power_allocator.rst
+
RW, Optional
k_d
The derivative term of the power allocator governor's PID
controller. For more information see
- Documentation/thermal/power_allocator.txt
+ Documentation/thermal/power_allocator.rst
+
RW, Optional
integral_cutoff
@@ -456,8 +598,10 @@ integral_cutoff
example, if integral_cutoff is 0, then the integral term only
accumulates error when temperature is above the desired
temperature trip point. For more information see
- Documentation/thermal/power_allocator.txt
+ Documentation/thermal/power_allocator.rst
+
Unit: millidegree Celsius
+
RW, Optional
slope
@@ -465,6 +609,7 @@ slope
to determine a hotspot temperature based off the sensor's
raw readings. It is up to the device driver to determine
the usage of these values.
+
RW, Optional
offset
@@ -472,28 +617,33 @@ offset
to determine a hotspot temperature based off the sensor's
raw readings. It is up to the device driver to determine
the usage of these values.
+
RW, Optional
-*****************************
-* Cooling device attributes *
-*****************************
+Cooling device attributes
+-------------------------
type
String which represents the type of device, e.g:
+
- for generic ACPI: should be "Fan", "Processor" or "LCD"
- for memory controller device on intel_menlow platform:
should be "Memory controller".
+
RO, Required
max_state
The maximum permissible cooling state of this cooling device.
+
RO, Required
cur_state
The current cooling state of this cooling device.
The value can any integer numbers between 0 and max_state:
+
- cur_state == 0 means no cooling
- cur_state == max_state means the maximum cooling.
+
RW, Required
stats/reset
@@ -508,9 +658,11 @@ stats/time_in_state_ms:
units here is 10mS (similar to other time exported in /proc).
RO, Required
+
stats/total_trans:
A single positive value showing the total number of times the state of a
cooling device is changed.
+
RO, Required
stats/trans_table:
@@ -522,6 +674,7 @@ stats/trans_table:
RO, Required
3. A simple implementation
+==========================
ACPI thermal zone may support multiple trip points like critical, hot,
passive, active. If an ACPI thermal zone supports critical, passive,
@@ -532,11 +685,10 @@ thermal_cooling_device. Both are considered to have the same
effectiveness in cooling the thermal zone.
If the processor is listed in _PSL method, and the fan is listed in _AL0
-method, the sys I/F structure will be built like this:
+method, the sys I/F structure will be built like this::
-/sys/class/thermal:
-
-|thermal_zone1:
+ /sys/class/thermal:
+ |thermal_zone1:
|---type: acpitz
|---temp: 37000
|---mode: enabled
@@ -557,24 +709,24 @@ method, the sys I/F structure will be built like this:
|---cdev1_trip_point: 2 /* cdev1 can be used for active[0]*/
|---cdev1_weight: 1024
-|cooling_device0:
+ |cooling_device0:
|---type: Processor
|---max_state: 8
|---cur_state: 0
-|cooling_device3:
+ |cooling_device3:
|---type: Fan
|---max_state: 2
|---cur_state: 0
-/sys/class/hwmon:
-
-|hwmon0:
+ /sys/class/hwmon:
+ |hwmon0:
|---name: acpitz
|---temp1_input: 37000
|---temp1_crit: 100000
4. Event Notification
+=====================
The framework includes a simple notification mechanism, in the form of a
netlink event. Netlink socket initialization is done during the _init_
@@ -587,21 +739,28 @@ event will be one of:{THERMAL_AUX0, THERMAL_AUX1, THERMAL_CRITICAL,
THERMAL_DEV_FAULT}. Notification can be sent when the current temperature
crosses any of the configured thresholds.
-5. Export Symbol APIs:
+5. Export Symbol APIs
+=====================
+
+5.1. get_tz_trend
+-----------------
-5.1: get_tz_trend:
This function returns the trend of a thermal zone, i.e the rate of change
of temperature of the thermal zone. Ideally, the thermal sensor drivers
are supposed to implement the callback. If they don't, the thermal
framework calculated the trend by comparing the previous and the current
temperature values.
-5.2:get_thermal_instance:
+5.2. get_thermal_instance
+-------------------------
+
This function returns the thermal_instance corresponding to a given
{thermal_zone, cooling_device, trip_point} combination. Returns NULL
if such an instance does not exist.
-5.3:thermal_notify_framework:
+5.3. thermal_notify_framework
+-----------------------------
+
This function handles the trip events from sensor drivers. It starts
throttling the cooling devices according to the policy configured.
For CRITICAL and HOT trip points, this notifies the respective drivers,
@@ -609,12 +768,15 @@ and does actual throttling for other trip points i.e ACTIVE and PASSIVE.
The throttling policy is based on the configured platform data; if no
platform data is provided, this uses the step_wise throttling policy.
-5.4:thermal_cdev_update:
+5.4. thermal_cdev_update
+------------------------
+
This function serves as an arbitrator to set the state of a cooling
device. It sets the cooling device to the deepest cooling state if
possible.
-6. thermal_emergency_poweroff:
+6. thermal_emergency_poweroff
+=============================
On an event of critical trip temperature crossing. Thermal framework
allows the system to shutdown gracefully by calling orderly_poweroff().
diff --git a/Documentation/thermal/x86_pkg_temperature_thermal b/Documentation/thermal/x86_pkg_temperature_thermal.rst
similarity index 80%
rename from Documentation/thermal/x86_pkg_temperature_thermal
rename to Documentation/thermal/x86_pkg_temperature_thermal.rst
index 17a3a4c0a0ca..f134dbd3f5a9 100644
--- a/Documentation/thermal/x86_pkg_temperature_thermal
+++ b/Documentation/thermal/x86_pkg_temperature_thermal.rst
@@ -1,19 +1,23 @@
+===================================
Kernel driver: x86_pkg_temp_thermal
-===================
+===================================
Supported chips:
+
* x86: with package level thermal management
+
(Verify using: CPUID.06H:EAX[bit 6] =1)
Authors: Srinivas Pandruvada <[email protected]>
Reference
----
+---------
+
Intel® 64 and IA-32 Architectures Software Developer’s Manual (Jan, 2013):
Chapter 14.6: PACKAGE LEVEL THERMAL MANAGEMENT
Description
----------
+-----------
This driver register CPU digital temperature package level sensor as a thermal
zone with maximum two user mode configurable trip points. Number of trip points
@@ -25,23 +29,27 @@ take any action to control temperature.
Threshold management
--------------------
Each package will register as a thermal zone under /sys/class/thermal.
-Example:
-/sys/class/thermal/thermal_zone1
+
+Example::
+
+ /sys/class/thermal/thermal_zone1
This contains two trip points:
+
- trip_point_0_temp
- trip_point_1_temp
User can set any temperature between 0 to TJ-Max temperature. Temperature units
-are in milli-degree Celsius. Refer to "Documentation/thermal/sysfs-api.txt" for
+are in milli-degree Celsius. Refer to "Documentation/thermal/sysfs-api.rst" for
thermal sys-fs details.
Any value other than 0 in these trip points, can trigger thermal notifications.
Setting 0, stops sending thermal notifications.
-Thermal notifications: To get kobject-uevent notifications, set the thermal zone
-policy to "user_space". For example: echo -n "user_space" > policy
-
-
+Thermal notifications:
+To get kobject-uevent notifications, set the thermal zone
+policy to "user_space".
+For example::
+ echo -n "user_space" > policy
diff --git a/MAINTAINERS b/MAINTAINERS
index d9e214f68e52..b2254bc8e495 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -15687,7 +15687,7 @@ M: Viresh Kumar <[email protected]>
M: Javi Merino <[email protected]>
L: [email protected]
S: Supported
-F: Documentation/thermal/cpu-cooling-api.txt
+F: Documentation/thermal/cpu-cooling-api.rst
F: drivers/thermal/cpu_cooling.c
F: include/linux/cpu_cooling.h
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 15a4ca5d7099..681047f8cc05 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -251,7 +251,7 @@ struct thermal_bind_params {
* platform characterization. This value is relative to the
* rest of the weights so a cooling device whose weight is
* double that of another cooling device is twice as
- * effective. See Documentation/thermal/sysfs-api.txt for more
+ * effective. See Documentation/thermal/sysfs-api.rst for more
* information.
*/
int weight;
@@ -259,7 +259,7 @@ struct thermal_bind_params {
/*
* This is a bit mask that gives the binding relation between this
* thermal zone and cdev, for a particular trip point.
- * See Documentation/thermal/sysfs-api.txt for more information.
+ * See Documentation/thermal/sysfs-api.rst for more information.
*/
int trip_mask;
--
2.21.0
Now that several arch documents were converted to ReST,
add their indexes to Documentation/index.rst and remove the
:orphan: from them.
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
---
Documentation/arm/index.rst | 2 --
Documentation/arm64/index.rst | 2 --
Documentation/ia64/index.rst | 2 --
Documentation/index.rst | 10 ++++++++++
Documentation/m68k/index.rst | 2 --
Documentation/riscv/index.rst | 2 --
Documentation/s390/index.rst | 2 --
Documentation/sparc/index.rst | 2 --
Documentation/xtensa/index.rst | 2 --
9 files changed, 10 insertions(+), 16 deletions(-)
diff --git a/Documentation/arm/index.rst b/Documentation/arm/index.rst
index bd316d1a1802..9c2f781f4685 100644
--- a/Documentation/arm/index.rst
+++ b/Documentation/arm/index.rst
@@ -1,5 +1,3 @@
-:orphan:
-
================
ARM Architecture
================
diff --git a/Documentation/arm64/index.rst b/Documentation/arm64/index.rst
index 018b7836ecb7..96b696ba4e6c 100644
--- a/Documentation/arm64/index.rst
+++ b/Documentation/arm64/index.rst
@@ -1,5 +1,3 @@
-:orphan:
-
==================
ARM64 Architecture
==================
diff --git a/Documentation/ia64/index.rst b/Documentation/ia64/index.rst
index a3e3052ad6e2..ef99475f672b 100644
--- a/Documentation/ia64/index.rst
+++ b/Documentation/ia64/index.rst
@@ -1,5 +1,3 @@
-:orphan:
-
==================
IA-64 Architecture
==================
diff --git a/Documentation/index.rst b/Documentation/index.rst
index 2f9bf37b8989..82cd9528dff0 100644
--- a/Documentation/index.rst
+++ b/Documentation/index.rst
@@ -116,7 +116,17 @@ implementation.
:maxdepth: 2
sh/index
+ arm/index
+ arm64/index
+ ia64/index
+ m68k/index
+ powerpc/index
+ riscv/index
+ s390/index
+ sh/index
+ sparc/index
x86/index
+ xtensa/index
Filesystem Documentation
------------------------
diff --git a/Documentation/m68k/index.rst b/Documentation/m68k/index.rst
index f3273ec075c3..aa121cfcbbd9 100644
--- a/Documentation/m68k/index.rst
+++ b/Documentation/m68k/index.rst
@@ -1,5 +1,3 @@
-:orphan:
-
=================
m68k Architecture
=================
diff --git a/Documentation/riscv/index.rst b/Documentation/riscv/index.rst
index c4b906d9b5a7..e3ca0922a8c2 100644
--- a/Documentation/riscv/index.rst
+++ b/Documentation/riscv/index.rst
@@ -1,5 +1,3 @@
-:orphan:
-
===================
RISC-V architecture
===================
diff --git a/Documentation/s390/index.rst b/Documentation/s390/index.rst
index 1a914da2a07b..4602312909d3 100644
--- a/Documentation/s390/index.rst
+++ b/Documentation/s390/index.rst
@@ -1,5 +1,3 @@
-:orphan:
-
=================
s390 Architecture
=================
diff --git a/Documentation/sparc/index.rst b/Documentation/sparc/index.rst
index 91f7d6643dd5..71cff621f243 100644
--- a/Documentation/sparc/index.rst
+++ b/Documentation/sparc/index.rst
@@ -1,5 +1,3 @@
-:orphan:
-
==================
Sparc Architecture
==================
diff --git a/Documentation/xtensa/index.rst b/Documentation/xtensa/index.rst
index 5a24e365e35f..239c5f0a5c67 100644
--- a/Documentation/xtensa/index.rst
+++ b/Documentation/xtensa/index.rst
@@ -1,5 +1,3 @@
-:orphan:
-
===================
Xtensa Architecture
===================
--
2.21.0
The docs under Documentation/laptops contain users specific
information.
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
---
Documentation/ABI/testing/sysfs-block-device | 2 +-
Documentation/ABI/testing/sysfs-platform-asus-laptop | 2 +-
Documentation/admin-guide/index.rst | 1 +
Documentation/admin-guide/kernel-parameters.txt | 2 +-
Documentation/{ => admin-guide}/laptops/asus-laptop.rst | 0
.../{ => admin-guide}/laptops/disk-shock-protection.rst | 0
Documentation/{ => admin-guide}/laptops/index.rst | 1 -
Documentation/{ => admin-guide}/laptops/laptop-mode.rst | 0
Documentation/{ => admin-guide}/laptops/lg-laptop.rst | 1 -
Documentation/{ => admin-guide}/laptops/sony-laptop.rst | 0
Documentation/{ => admin-guide}/laptops/sonypi.rst | 0
Documentation/{ => admin-guide}/laptops/thinkpad-acpi.rst | 0
Documentation/{ => admin-guide}/laptops/toshiba_haps.rst | 0
Documentation/admin-guide/sysctl/vm.rst | 4 ++--
MAINTAINERS | 4 ++--
drivers/char/Kconfig | 2 +-
drivers/platform/x86/Kconfig | 4 ++--
17 files changed, 11 insertions(+), 12 deletions(-)
rename Documentation/{ => admin-guide}/laptops/asus-laptop.rst (100%)
rename Documentation/{ => admin-guide}/laptops/disk-shock-protection.rst (100%)
rename Documentation/{ => admin-guide}/laptops/index.rst (95%)
rename Documentation/{ => admin-guide}/laptops/laptop-mode.rst (100%)
rename Documentation/{ => admin-guide}/laptops/lg-laptop.rst (99%)
rename Documentation/{ => admin-guide}/laptops/sony-laptop.rst (100%)
rename Documentation/{ => admin-guide}/laptops/sonypi.rst (100%)
rename Documentation/{ => admin-guide}/laptops/thinkpad-acpi.rst (100%)
rename Documentation/{ => admin-guide}/laptops/toshiba_haps.rst (100%)
diff --git a/Documentation/ABI/testing/sysfs-block-device b/Documentation/ABI/testing/sysfs-block-device
index 0d57bbb4fddc..17f2bc7dd261 100644
--- a/Documentation/ABI/testing/sysfs-block-device
+++ b/Documentation/ABI/testing/sysfs-block-device
@@ -45,7 +45,7 @@ Description:
- Values below -2 are rejected with -EINVAL
For more information, see
- Documentation/laptops/disk-shock-protection.rst
+ Documentation/admin-guide/laptops/disk-shock-protection.rst
What: /sys/block/*/device/ncq_prio_enable
diff --git a/Documentation/ABI/testing/sysfs-platform-asus-laptop b/Documentation/ABI/testing/sysfs-platform-asus-laptop
index d67fa4bafa70..8b0e8205a6a2 100644
--- a/Documentation/ABI/testing/sysfs-platform-asus-laptop
+++ b/Documentation/ABI/testing/sysfs-platform-asus-laptop
@@ -31,7 +31,7 @@ Description:
To control the LED display, use the following :
echo 0x0T000DDD > /sys/devices/platform/asus_laptop/
where T control the 3 letters display, and DDD the 3 digits display.
- The DDD table can be found in Documentation/laptops/asus-laptop.rst
+ The DDD table can be found in Documentation/admin-guide/laptops/asus-laptop.rst
What: /sys/devices/platform/asus_laptop/bluetooth
Date: January 2007
diff --git a/Documentation/admin-guide/index.rst b/Documentation/admin-guide/index.rst
index 5940ce8d16af..e4f0cb2a02bd 100644
--- a/Documentation/admin-guide/index.rst
+++ b/Documentation/admin-guide/index.rst
@@ -79,6 +79,7 @@ configure specific aspects of kernel behavior to your liking.
aoe/index
perf-security
acpi/index
+ laptops/index
btmrvl
clearing-warn-once
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 0b17312b9198..69a9e2e66dfb 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -4356,7 +4356,7 @@
Format: <integer>
sonypi.*= [HW] Sony Programmable I/O Control Device driver
- See Documentation/laptops/sonypi.rst
+ See Documentation/admin-guide/laptops/sonypi.rst
spectre_v2= [X86] Control mitigation of Spectre variant 2
(indirect branch speculation) vulnerability.
diff --git a/Documentation/laptops/asus-laptop.rst b/Documentation/admin-guide/laptops/asus-laptop.rst
similarity index 100%
rename from Documentation/laptops/asus-laptop.rst
rename to Documentation/admin-guide/laptops/asus-laptop.rst
diff --git a/Documentation/laptops/disk-shock-protection.rst b/Documentation/admin-guide/laptops/disk-shock-protection.rst
similarity index 100%
rename from Documentation/laptops/disk-shock-protection.rst
rename to Documentation/admin-guide/laptops/disk-shock-protection.rst
diff --git a/Documentation/laptops/index.rst b/Documentation/admin-guide/laptops/index.rst
similarity index 95%
rename from Documentation/laptops/index.rst
rename to Documentation/admin-guide/laptops/index.rst
index 001a30910d09..6b554e39863b 100644
--- a/Documentation/laptops/index.rst
+++ b/Documentation/admin-guide/laptops/index.rst
@@ -1,4 +1,3 @@
-:orphan:
==============
Laptop Drivers
diff --git a/Documentation/laptops/laptop-mode.rst b/Documentation/admin-guide/laptops/laptop-mode.rst
similarity index 100%
rename from Documentation/laptops/laptop-mode.rst
rename to Documentation/admin-guide/laptops/laptop-mode.rst
diff --git a/Documentation/laptops/lg-laptop.rst b/Documentation/admin-guide/laptops/lg-laptop.rst
similarity index 99%
rename from Documentation/laptops/lg-laptop.rst
rename to Documentation/admin-guide/laptops/lg-laptop.rst
index f2c2ffe31101..ce9b14671cb9 100644
--- a/Documentation/laptops/lg-laptop.rst
+++ b/Documentation/admin-guide/laptops/lg-laptop.rst
@@ -1,6 +1,5 @@
.. SPDX-License-Identifier: GPL-2.0+
-:orphan:
LG Gram laptop extra features
=============================
diff --git a/Documentation/laptops/sony-laptop.rst b/Documentation/admin-guide/laptops/sony-laptop.rst
similarity index 100%
rename from Documentation/laptops/sony-laptop.rst
rename to Documentation/admin-guide/laptops/sony-laptop.rst
diff --git a/Documentation/laptops/sonypi.rst b/Documentation/admin-guide/laptops/sonypi.rst
similarity index 100%
rename from Documentation/laptops/sonypi.rst
rename to Documentation/admin-guide/laptops/sonypi.rst
diff --git a/Documentation/laptops/thinkpad-acpi.rst b/Documentation/admin-guide/laptops/thinkpad-acpi.rst
similarity index 100%
rename from Documentation/laptops/thinkpad-acpi.rst
rename to Documentation/admin-guide/laptops/thinkpad-acpi.rst
diff --git a/Documentation/laptops/toshiba_haps.rst b/Documentation/admin-guide/laptops/toshiba_haps.rst
similarity index 100%
rename from Documentation/laptops/toshiba_haps.rst
rename to Documentation/admin-guide/laptops/toshiba_haps.rst
diff --git a/Documentation/admin-guide/sysctl/vm.rst b/Documentation/admin-guide/sysctl/vm.rst
index 4940ab610eb7..d918b11326f3 100644
--- a/Documentation/admin-guide/sysctl/vm.rst
+++ b/Documentation/admin-guide/sysctl/vm.rst
@@ -108,7 +108,7 @@ block_dump
==========
block_dump enables block I/O debugging when set to a nonzero value. More
-information on block I/O debugging is in Documentation/laptops/laptop-mode.rst.
+information on block I/O debugging is in Documentation/admin-guide/laptops/laptop-mode.rst.
compact_memory
@@ -298,7 +298,7 @@ laptop_mode
===========
laptop_mode is a knob that controls "laptop mode". All the things that are
-controlled by this knob are discussed in Documentation/laptops/laptop-mode.rst.
+controlled by this knob are discussed in Documentation/admin-guide/laptops/laptop-mode.rst.
legacy_va_layout
diff --git a/MAINTAINERS b/MAINTAINERS
index b7c81bd0f8e8..ab170522ec55 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8927,7 +8927,7 @@ M: Matan Ziv-Av <[email protected]>
L: [email protected]
S: Maintained
F: Documentation/ABI/testing/sysfs-platform-lg-laptop
-F: Documentation/laptops/lg-laptop.rst
+F: Documentation/admin-guide/laptops/lg-laptop.rst
F: drivers/platform/x86/lg-laptop.c
LG2160 MEDIA DRIVER
@@ -14756,7 +14756,7 @@ M: Mattia Dongili <[email protected]>
L: [email protected]
W: http://www.linux.it/~malattia/wiki/index.php/Sony_drivers
S: Maintained
-F: Documentation/laptops/sony-laptop.rst
+F: Documentation/admin-guide/laptops/sony-laptop.rst
F: drivers/char/sonypi.c
F: drivers/platform/x86/sony-laptop.c
F: include/linux/sony-laptop.h
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index 3a0f94929814..3e866885a405 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -382,7 +382,7 @@ config SONYPI
Device which can be found in many (all ?) Sony Vaio laptops.
If you have one of those laptops, read
- <file:Documentation/laptops/sonypi.rst>, and say Y or M here.
+ <file:Documentation/admin-guide/laptops/sonypi.rst>, and say Y or M here.
To compile this driver as a module, choose M here: the
module will be called sonypi.
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 9d866b6753fe..430f7f619553 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -451,7 +451,7 @@ config SONY_LAPTOP
screen brightness control, Fn keys and allows powering on/off some
devices.
- Read <file:Documentation/laptops/sony-laptop.rst> for more information.
+ Read <file:Documentation/admin-guide/laptops/sony-laptop.rst> for more information.
config SONYPI_COMPAT
bool "Sonypi compatibility"
@@ -503,7 +503,7 @@ config THINKPAD_ACPI
support for Fn-Fx key combinations, Bluetooth control, video
output switching, ThinkLight control, UltraBay eject and more.
For more information about this driver see
- <file:Documentation/laptops/thinkpad-acpi.rst> and
+ <file:Documentation/admin-guide/laptops/thinkpad-acpi.rst> and
<http://ibm-acpi.sf.net/> .
This driver was formerly known as ibm-acpi.
--
2.21.0
The following files belong to security:
Documentation/security/LSM.rst -> Documentation/security/lsm-development.rst
Documentation/lsm.txt -> Documentation/security/lsm.rst
Documentation/SAK.txt -> Documentation/security/sak.rst
Documentation/siphash.txt -> Documentation/security/siphash.rst
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
---
Documentation/security/index.rst | 5 ++++-
Documentation/security/{LSM.rst => lsm-development.rst} | 0
Documentation/{ => security}/lsm.rst | 2 --
Documentation/{SAK.rst => security/sak.rst} | 2 --
Documentation/{ => security}/siphash.rst | 2 --
Documentation/security/tpm/index.rst | 1 +
Documentation/security/tpm/xen-tpmfront.rst | 2 --
7 files changed, 5 insertions(+), 9 deletions(-)
rename Documentation/security/{LSM.rst => lsm-development.rst} (100%)
rename Documentation/{ => security}/lsm.rst (99%)
rename Documentation/{SAK.rst => security/sak.rst} (99%)
rename Documentation/{ => security}/siphash.rst (99%)
diff --git a/Documentation/security/index.rst b/Documentation/security/index.rst
index aad6d92ffe31..fc503dd689a7 100644
--- a/Documentation/security/index.rst
+++ b/Documentation/security/index.rst
@@ -8,7 +8,10 @@ Security Documentation
credentials
IMA-templates
keys/index
- LSM
+ lsm
+ lsm-development
+ sak
SCTP
self-protection
+ siphash
tpm/index
diff --git a/Documentation/security/LSM.rst b/Documentation/security/lsm-development.rst
similarity index 100%
rename from Documentation/security/LSM.rst
rename to Documentation/security/lsm-development.rst
diff --git a/Documentation/lsm.rst b/Documentation/security/lsm.rst
similarity index 99%
rename from Documentation/lsm.rst
rename to Documentation/security/lsm.rst
index 4f0b1a6ea76c..ad4dfd020e0d 100644
--- a/Documentation/lsm.rst
+++ b/Documentation/security/lsm.rst
@@ -1,5 +1,3 @@
-:orphan:
-
========================================================
Linux Security Modules: General Security Hooks for Linux
========================================================
diff --git a/Documentation/SAK.rst b/Documentation/security/sak.rst
similarity index 99%
rename from Documentation/SAK.rst
rename to Documentation/security/sak.rst
index 73dd10fa4337..64e667da93e0 100644
--- a/Documentation/SAK.rst
+++ b/Documentation/security/sak.rst
@@ -1,5 +1,3 @@
-:orphan:
-
=========================================
Linux Secure Attention Key (SAK) handling
=========================================
diff --git a/Documentation/siphash.rst b/Documentation/security/siphash.rst
similarity index 99%
rename from Documentation/siphash.rst
rename to Documentation/security/siphash.rst
index 833eef3a7956..9965821ab333 100644
--- a/Documentation/siphash.rst
+++ b/Documentation/security/siphash.rst
@@ -1,5 +1,3 @@
-:orphan:
-
===========================
SipHash - a short input PRF
===========================
diff --git a/Documentation/security/tpm/index.rst b/Documentation/security/tpm/index.rst
index af77a7bbb070..3296533e54cf 100644
--- a/Documentation/security/tpm/index.rst
+++ b/Documentation/security/tpm/index.rst
@@ -5,3 +5,4 @@ Trusted Platform Module documentation
.. toctree::
tpm_vtpm_proxy
+ xen-tpmfront
diff --git a/Documentation/security/tpm/xen-tpmfront.rst b/Documentation/security/tpm/xen-tpmfront.rst
index 98a16ab87360..00d5b1db227d 100644
--- a/Documentation/security/tpm/xen-tpmfront.rst
+++ b/Documentation/security/tpm/xen-tpmfront.rst
@@ -1,5 +1,3 @@
-:orphan:
-
=============================
Virtual TPM interface for Xen
=============================
--
2.21.0
Rename the perf documentation files to ReST, add an
index for them and adjust in order to produce a nice html
output via the Sphinx build system.
At its new index.rst, let's add a :orphan: while this is not linked to
the main index.rst file, in order to avoid build warnings.
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
---
.../perf/{arm-ccn.txt => arm-ccn.rst} | 18 +++++-----
.../perf/{arm_dsu_pmu.txt => arm_dsu_pmu.rst} | 5 +--
.../perf/{hisi-pmu.txt => hisi-pmu.rst} | 35 +++++++++++--------
Documentation/perf/index.rst | 16 +++++++++
.../perf/{qcom_l2_pmu.txt => qcom_l2_pmu.rst} | 3 +-
.../perf/{qcom_l3_pmu.txt => qcom_l3_pmu.rst} | 3 +-
.../{thunderx2-pmu.txt => thunderx2-pmu.rst} | 25 ++++++-------
.../perf/{xgene-pmu.txt => xgene-pmu.rst} | 3 +-
MAINTAINERS | 4 +--
drivers/perf/qcom_l3_pmu.c | 2 +-
10 files changed, 72 insertions(+), 42 deletions(-)
rename Documentation/perf/{arm-ccn.txt => arm-ccn.rst} (86%)
rename Documentation/perf/{arm_dsu_pmu.txt => arm_dsu_pmu.rst} (92%)
rename Documentation/perf/{hisi-pmu.txt => hisi-pmu.rst} (73%)
create mode 100644 Documentation/perf/index.rst
rename Documentation/perf/{qcom_l2_pmu.txt => qcom_l2_pmu.rst} (94%)
rename Documentation/perf/{qcom_l3_pmu.txt => qcom_l3_pmu.rst} (93%)
rename Documentation/perf/{thunderx2-pmu.txt => thunderx2-pmu.rst} (73%)
rename Documentation/perf/{xgene-pmu.txt => xgene-pmu.rst} (96%)
diff --git a/Documentation/perf/arm-ccn.txt b/Documentation/perf/arm-ccn.rst
similarity index 86%
rename from Documentation/perf/arm-ccn.txt
rename to Documentation/perf/arm-ccn.rst
index 15cdb7bc57c3..832b0c64023a 100644
--- a/Documentation/perf/arm-ccn.txt
+++ b/Documentation/perf/arm-ccn.rst
@@ -1,3 +1,4 @@
+==========================
ARM Cache Coherent Network
==========================
@@ -29,6 +30,7 @@ Crosspoint watchpoint-based events (special "event" value 0xfe)
require "xp" and "vc" as as above plus "port" (device port index),
"dir" (transmit/receive direction), comparator values ("cmp_l"
and "cmp_h") and "mask", being index of the comparator mask.
+
Masks are defined separately from the event description
(due to limited number of the config values) in the "cmp_mask"
directory, with first 8 configurable by user and additional
@@ -44,16 +46,16 @@ request the events on this processor (if not, the perf_event->cpu value
will be overwritten anyway). In case of this processor being offlined,
the events are migrated to another one and the attribute is updated.
-Example of perf tool use:
+Example of perf tool use::
-/ # perf list | grep ccn
- ccn/cycles/ [Kernel PMU event]
-<...>
- ccn/xp_valid_flit,xp=?,port=?,vc=?,dir=?/ [Kernel PMU event]
-<...>
+ / # perf list | grep ccn
+ ccn/cycles/ [Kernel PMU event]
+ <...>
+ ccn/xp_valid_flit,xp=?,port=?,vc=?,dir=?/ [Kernel PMU event]
+ <...>
-/ # perf stat -a -e ccn/cycles/,ccn/xp_valid_flit,xp=1,port=0,vc=1,dir=1/ \
- sleep 1
+ / # perf stat -a -e ccn/cycles/,ccn/xp_valid_flit,xp=1,port=0,vc=1,dir=1/ \
+ sleep 1
The driver does not support sampling, therefore "perf record" will
not work. Per-task (without "-a") perf sessions are not supported.
diff --git a/Documentation/perf/arm_dsu_pmu.txt b/Documentation/perf/arm_dsu_pmu.rst
similarity index 92%
rename from Documentation/perf/arm_dsu_pmu.txt
rename to Documentation/perf/arm_dsu_pmu.rst
index d611e15f5add..7fd34db75d13 100644
--- a/Documentation/perf/arm_dsu_pmu.txt
+++ b/Documentation/perf/arm_dsu_pmu.rst
@@ -1,3 +1,4 @@
+==================================
ARM DynamIQ Shared Unit (DSU) PMU
==================================
@@ -13,7 +14,7 @@ PMU doesn't support process specific events and cannot be used in sampling mode.
The DSU provides a bitmap for a subset of implemented events via hardware
registers. There is no way for the driver to determine if the other events
are available or not. Hence the driver exposes only those events advertised
-by the DSU, in "events" directory under :
+by the DSU, in "events" directory under::
/sys/bus/event_sources/devices/arm_dsu_<N>/
@@ -23,6 +24,6 @@ and use the raw event code for the unlisted events.
The driver also exposes the CPUs connected to the DSU instance in "associated_cpus".
-e.g usage :
+e.g usage::
perf stat -a -e arm_dsu_0/cycles/
diff --git a/Documentation/perf/hisi-pmu.txt b/Documentation/perf/hisi-pmu.rst
similarity index 73%
rename from Documentation/perf/hisi-pmu.txt
rename to Documentation/perf/hisi-pmu.rst
index 267a028b2741..404a5c3d9d00 100644
--- a/Documentation/perf/hisi-pmu.txt
+++ b/Documentation/perf/hisi-pmu.rst
@@ -1,5 +1,7 @@
+======================================================
HiSilicon SoC uncore Performance Monitoring Unit (PMU)
======================================================
+
The HiSilicon SoC chip includes various independent system device PMUs
such as L3 cache (L3C), Hydra Home Agent (HHA) and DDRC. These PMUs are
independent and have hardware logic to gather statistics and performance
@@ -11,11 +13,13 @@ called Super CPU cluster (SCCL) and is made up of 6 CCLs. Each SCCL has
two HHAs (0 - 1) and four DDRCs (0 - 3), respectively.
HiSilicon SoC uncore PMU driver
----------------------------------------
+-------------------------------
+
Each device PMU has separate registers for event counting, control and
interrupt, and the PMU driver shall register perf PMU drivers like L3C,
HHA and DDRC etc. The available events and configuration options shall
-be described in the sysfs, see :
+be described in the sysfs, see:
+
/sys/devices/hisi_sccl{X}_<l3c{Y}/hha{Y}/ddrc{Y}>/, or
/sys/bus/event_source/devices/hisi_sccl{X}_<l3c{Y}/hha{Y}/ddrc{Y}>.
The "perf list" command shall list the available events from sysfs.
@@ -24,27 +28,30 @@ Each L3C, HHA and DDRC is registered as a separate PMU with perf. The PMU
name will appear in event listing as hisi_sccl<sccl-id>_module<index-id>.
where "sccl-id" is the identifier of the SCCL and "index-id" is the index of
module.
+
e.g. hisi_sccl3_l3c0/rd_hit_cpipe is READ_HIT_CPIPE event of L3C index #0 in
SCCL ID #3.
+
e.g. hisi_sccl1_hha0/rx_operations is RX_OPERATIONS event of HHA index #0 in
SCCL ID #1.
The driver also provides a "cpumask" sysfs attribute, which shows the CPU core
ID used to count the uncore PMU event.
-Example usage of perf:
-$# perf list
-hisi_sccl3_l3c0/rd_hit_cpipe/ [kernel PMU event]
-------------------------------------------
-hisi_sccl3_l3c0/wr_hit_cpipe/ [kernel PMU event]
-------------------------------------------
-hisi_sccl1_l3c0/rd_hit_cpipe/ [kernel PMU event]
-------------------------------------------
-hisi_sccl1_l3c0/wr_hit_cpipe/ [kernel PMU event]
-------------------------------------------
+Example usage of perf::
-$# perf stat -a -e hisi_sccl3_l3c0/rd_hit_cpipe/ sleep 5
-$# perf stat -a -e hisi_sccl3_l3c0/config=0x02/ sleep 5
+ $# perf list
+ hisi_sccl3_l3c0/rd_hit_cpipe/ [kernel PMU event]
+ ------------------------------------------
+ hisi_sccl3_l3c0/wr_hit_cpipe/ [kernel PMU event]
+ ------------------------------------------
+ hisi_sccl1_l3c0/rd_hit_cpipe/ [kernel PMU event]
+ ------------------------------------------
+ hisi_sccl1_l3c0/wr_hit_cpipe/ [kernel PMU event]
+ ------------------------------------------
+
+ $# perf stat -a -e hisi_sccl3_l3c0/rd_hit_cpipe/ sleep 5
+ $# perf stat -a -e hisi_sccl3_l3c0/config=0x02/ sleep 5
The current driver does not support sampling. So "perf record" is unsupported.
Also attach to a task is unsupported as the events are all uncore.
diff --git a/Documentation/perf/index.rst b/Documentation/perf/index.rst
new file mode 100644
index 000000000000..4bf848e27f26
--- /dev/null
+++ b/Documentation/perf/index.rst
@@ -0,0 +1,16 @@
+:orphan:
+
+===========================
+Performance monitor support
+===========================
+
+.. toctree::
+ :maxdepth: 1
+
+ hisi-pmu
+ qcom_l2_pmu
+ qcom_l3_pmu
+ arm-ccn
+ xgene-pmu
+ arm_dsu_pmu
+ thunderx2-pmu
diff --git a/Documentation/perf/qcom_l2_pmu.txt b/Documentation/perf/qcom_l2_pmu.rst
similarity index 94%
rename from Documentation/perf/qcom_l2_pmu.txt
rename to Documentation/perf/qcom_l2_pmu.rst
index b25b97659ab9..c130178a4a55 100644
--- a/Documentation/perf/qcom_l2_pmu.txt
+++ b/Documentation/perf/qcom_l2_pmu.rst
@@ -1,3 +1,4 @@
+=====================================================================
Qualcomm Technologies Level-2 Cache Performance Monitoring Unit (PMU)
=====================================================================
@@ -28,7 +29,7 @@ The driver provides a "cpumask" sysfs attribute which contains a mask
consisting of one CPU per cluster which will be used to handle all the PMU
events on that cluster.
-Examples for use with perf:
+Examples for use with perf::
perf stat -e l2cache_0/config=0x001/,l2cache_0/config=0x042/ -a sleep 1
diff --git a/Documentation/perf/qcom_l3_pmu.txt b/Documentation/perf/qcom_l3_pmu.rst
similarity index 93%
rename from Documentation/perf/qcom_l3_pmu.txt
rename to Documentation/perf/qcom_l3_pmu.rst
index 96b3a9444a0d..a3d014a46bfd 100644
--- a/Documentation/perf/qcom_l3_pmu.txt
+++ b/Documentation/perf/qcom_l3_pmu.rst
@@ -1,3 +1,4 @@
+===========================================================================
Qualcomm Datacenter Technologies L3 Cache Performance Monitoring Unit (PMU)
===========================================================================
@@ -17,7 +18,7 @@ The hardware implements 32bit event counters and has a flat 8bit event space
exposed via the "event" format attribute. In addition to the 32bit physical
counters the driver supports virtual 64bit hardware counters by using hardware
counter chaining. This feature is exposed via the "lc" (long counter) format
-flag. E.g.:
+flag. E.g.::
perf stat -e l3cache_0_0/read-miss,lc/
diff --git a/Documentation/perf/thunderx2-pmu.txt b/Documentation/perf/thunderx2-pmu.rst
similarity index 73%
rename from Documentation/perf/thunderx2-pmu.txt
rename to Documentation/perf/thunderx2-pmu.rst
index dffc57143736..08e33675853a 100644
--- a/Documentation/perf/thunderx2-pmu.txt
+++ b/Documentation/perf/thunderx2-pmu.rst
@@ -1,3 +1,4 @@
+=============================================================
Cavium ThunderX2 SoC Performance Monitoring Unit (PMU UNCORE)
=============================================================
@@ -24,18 +25,18 @@ and configuration options under sysfs, see
The driver does not support sampling, therefore "perf record" will not
work. Per-task perf sessions are also not supported.
-Examples:
+Examples::
-# perf stat -a -e uncore_dmc_0/cnt_cycles/ sleep 1
+ # perf stat -a -e uncore_dmc_0/cnt_cycles/ sleep 1
-# perf stat -a -e \
-uncore_dmc_0/cnt_cycles/,\
-uncore_dmc_0/data_transfers/,\
-uncore_dmc_0/read_txns/,\
-uncore_dmc_0/write_txns/ sleep 1
+ # perf stat -a -e \
+ uncore_dmc_0/cnt_cycles/,\
+ uncore_dmc_0/data_transfers/,\
+ uncore_dmc_0/read_txns/,\
+ uncore_dmc_0/write_txns/ sleep 1
-# perf stat -a -e \
-uncore_l3c_0/read_request/,\
-uncore_l3c_0/read_hit/,\
-uncore_l3c_0/inv_request/,\
-uncore_l3c_0/inv_hit/ sleep 1
+ # perf stat -a -e \
+ uncore_l3c_0/read_request/,\
+ uncore_l3c_0/read_hit/,\
+ uncore_l3c_0/inv_request/,\
+ uncore_l3c_0/inv_hit/ sleep 1
diff --git a/Documentation/perf/xgene-pmu.txt b/Documentation/perf/xgene-pmu.rst
similarity index 96%
rename from Documentation/perf/xgene-pmu.txt
rename to Documentation/perf/xgene-pmu.rst
index d7cff4454e5b..644f8ed89152 100644
--- a/Documentation/perf/xgene-pmu.txt
+++ b/Documentation/perf/xgene-pmu.rst
@@ -1,3 +1,4 @@
+================================================
APM X-Gene SoC Performance Monitoring Unit (PMU)
================================================
@@ -33,7 +34,7 @@ each PMU, please refer to APM X-Gene User Manual.
Each perf driver also provides a "cpumask" sysfs attribute, which contains a
single CPU ID of the processor which will be used to handle all the PMU events.
-Example for perf tool use:
+Example for perf tool use::
/ # perf list | grep -e l3c -e iob -e mcb -e mc
l3c0/ackq-full/ [Kernel PMU event]
diff --git a/MAINTAINERS b/MAINTAINERS
index 163327d6a856..2f8e1543caff 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1139,7 +1139,7 @@ APPLIED MICRO (APM) X-GENE SOC PMU
M: Khuong Dinh <[email protected]>
S: Supported
F: drivers/perf/xgene_pmu.c
-F: Documentation/perf/xgene-pmu.txt
+F: Documentation/perf/xgene-pmu.rst
F: Documentation/devicetree/bindings/perf/apm-xgene-pmu.txt
APTINA CAMERA SENSOR PLL
@@ -7180,7 +7180,7 @@ M: Shaokun Zhang <[email protected]>
W: http://www.hisilicon.com
S: Supported
F: drivers/perf/hisilicon
-F: Documentation/perf/hisi-pmu.txt
+F: Documentation/perf/hisi-pmu.rst
HISILICON ROCE DRIVER
M: Lijun Ou <[email protected]>
diff --git a/drivers/perf/qcom_l3_pmu.c b/drivers/perf/qcom_l3_pmu.c
index 15b8c10c2b2b..90f88ce5192b 100644
--- a/drivers/perf/qcom_l3_pmu.c
+++ b/drivers/perf/qcom_l3_pmu.c
@@ -8,7 +8,7 @@
* the slices. User space needs to aggregate to individual counts to provide
* a global picture.
*
- * See Documentation/perf/qcom_l3_pmu.txt for more details.
+ * See Documentation/perf/qcom_l3_pmu.rst for more details.
*
* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
*/
--
2.21.0
The current file there (emmi) provides a description of
the driver uAPI and kAPI.
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
---
Documentation/driver-api/index.rst | 1 +
Documentation/{ => driver-api}/xilinx/eemi.rst | 0
Documentation/{ => driver-api}/xilinx/index.rst | 1 -
3 files changed, 1 insertion(+), 1 deletion(-)
rename Documentation/{ => driver-api}/xilinx/eemi.rst (100%)
rename Documentation/{ => driver-api}/xilinx/index.rst (94%)
diff --git a/Documentation/driver-api/index.rst b/Documentation/driver-api/index.rst
index 492b96003af2..6935d973ff5b 100644
--- a/Documentation/driver-api/index.rst
+++ b/Documentation/driver-api/index.rst
@@ -124,6 +124,7 @@ available subsections can be seen below.
unaligned-memory-access
vfio
vfio-mediated-device
+ xilinx/index
xillybus
xz
zorro
diff --git a/Documentation/xilinx/eemi.rst b/Documentation/driver-api/xilinx/eemi.rst
similarity index 100%
rename from Documentation/xilinx/eemi.rst
rename to Documentation/driver-api/xilinx/eemi.rst
diff --git a/Documentation/xilinx/index.rst b/Documentation/driver-api/xilinx/index.rst
similarity index 94%
rename from Documentation/xilinx/index.rst
rename to Documentation/driver-api/xilinx/index.rst
index 01cc1a0714df..13f7589ed442 100644
--- a/Documentation/xilinx/index.rst
+++ b/Documentation/driver-api/xilinx/index.rst
@@ -1,4 +1,3 @@
-:orphan:
===========
Xilinx FPGA
--
2.21.0
The stuff under sysctl describes /sys interface from userspace
point of view. So, add it to the admin-guide and remove the
:orphan: from its index file.
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
---
CREDITS | 2 +-
Documentation/admin-guide/index.rst | 1 +
Documentation/admin-guide/kernel-parameters.txt | 2 +-
Documentation/admin-guide/mm/index.rst | 2 +-
Documentation/admin-guide/mm/ksm.rst | 2 +-
Documentation/{ => admin-guide}/sysctl/abi.rst | 0
Documentation/{ => admin-guide}/sysctl/fs.rst | 0
Documentation/{ => admin-guide}/sysctl/index.rst | 2 --
Documentation/{ => admin-guide}/sysctl/kernel.rst | 0
Documentation/{ => admin-guide}/sysctl/net.rst | 0
Documentation/{ => admin-guide}/sysctl/sunrpc.rst | 0
Documentation/{ => admin-guide}/sysctl/user.rst | 0
Documentation/{ => admin-guide}/sysctl/vm.rst | 0
Documentation/core-api/printk-formats.rst | 2 +-
Documentation/filesystems/proc.txt | 2 +-
Documentation/networking/ip-sysctl.txt | 2 +-
Documentation/vm/unevictable-lru.rst | 2 +-
fs/proc/Kconfig | 2 +-
kernel/panic.c | 2 +-
mm/swap.c | 2 +-
20 files changed, 12 insertions(+), 13 deletions(-)
rename Documentation/{ => admin-guide}/sysctl/abi.rst (100%)
rename Documentation/{ => admin-guide}/sysctl/fs.rst (100%)
rename Documentation/{ => admin-guide}/sysctl/index.rst (99%)
rename Documentation/{ => admin-guide}/sysctl/kernel.rst (100%)
rename Documentation/{ => admin-guide}/sysctl/net.rst (100%)
rename Documentation/{ => admin-guide}/sysctl/sunrpc.rst (100%)
rename Documentation/{ => admin-guide}/sysctl/user.rst (100%)
rename Documentation/{ => admin-guide}/sysctl/vm.rst (100%)
diff --git a/CREDITS b/CREDITS
index 681335f42491..652480755300 100644
--- a/CREDITS
+++ b/CREDITS
@@ -3120,7 +3120,7 @@ S: France
N: Rik van Riel
E: [email protected]
W: http://www.surriel.com/
-D: Linux-MM site, Documentation/sysctl/*, swap/mm readaround
+D: Linux-MM site, Documentation/admin-guide/sysctl/*, swap/mm readaround
D: kswapd fixes, random kernel hacker, rmap VM,
D: nl.linux.org administrator, minor scheduler additions
S: Red Hat Boston
diff --git a/Documentation/admin-guide/index.rst b/Documentation/admin-guide/index.rst
index ba9ff8e3b45a..5940ce8d16af 100644
--- a/Documentation/admin-guide/index.rst
+++ b/Documentation/admin-guide/index.rst
@@ -16,6 +16,7 @@ etc.
README
kernel-parameters
devices
+ sysctl/index
This section describes CPU vulnerabilities and their mitigations.
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 2f8751323f6d..0b17312b9198 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -3159,7 +3159,7 @@
numa_zonelist_order= [KNL, BOOT] Select zonelist order for NUMA.
'node', 'default' can be specified
This can be set from sysctl after boot.
- See Documentation/sysctl/vm.rst for details.
+ See Documentation/admin-guide/sysctl/vm.rst for details.
ohci1394_dma=early [HW] enable debugging via the ohci1394 driver.
See Documentation/driver-api/debugging-via-ohci1394.rst for more
diff --git a/Documentation/admin-guide/mm/index.rst b/Documentation/admin-guide/mm/index.rst
index f5e92f33f96e..5f61a6c429e0 100644
--- a/Documentation/admin-guide/mm/index.rst
+++ b/Documentation/admin-guide/mm/index.rst
@@ -11,7 +11,7 @@ processes address space and many other cool things.
Linux memory management is a complex system with many configurable
settings. Most of these settings are available via ``/proc``
filesystem and can be quired and adjusted using ``sysctl``. These APIs
-are described in Documentation/sysctl/vm.rst and in `man 5 proc`_.
+are described in Documentation/admin-guide/sysctl/vm.rst and in `man 5 proc`_.
.. _man 5 proc: http://man7.org/linux/man-pages/man5/proc.5.html
diff --git a/Documentation/admin-guide/mm/ksm.rst b/Documentation/admin-guide/mm/ksm.rst
index 7b2b8767c0b4..874eb0c77d34 100644
--- a/Documentation/admin-guide/mm/ksm.rst
+++ b/Documentation/admin-guide/mm/ksm.rst
@@ -59,7 +59,7 @@ MADV_UNMERGEABLE is applied to a range which was never MADV_MERGEABLE.
If a region of memory must be split into at least one new MADV_MERGEABLE
or MADV_UNMERGEABLE region, the madvise may return ENOMEM if the process
-will exceed ``vm.max_map_count`` (see Documentation/sysctl/vm.rst).
+will exceed ``vm.max_map_count`` (see Documentation/admin-guide/sysctl/vm.rst).
Like other madvise calls, they are intended for use on mapped areas of
the user address space: they will report ENOMEM if the specified range
diff --git a/Documentation/sysctl/abi.rst b/Documentation/admin-guide/sysctl/abi.rst
similarity index 100%
rename from Documentation/sysctl/abi.rst
rename to Documentation/admin-guide/sysctl/abi.rst
diff --git a/Documentation/sysctl/fs.rst b/Documentation/admin-guide/sysctl/fs.rst
similarity index 100%
rename from Documentation/sysctl/fs.rst
rename to Documentation/admin-guide/sysctl/fs.rst
diff --git a/Documentation/sysctl/index.rst b/Documentation/admin-guide/sysctl/index.rst
similarity index 99%
rename from Documentation/sysctl/index.rst
rename to Documentation/admin-guide/sysctl/index.rst
index efbcde8c1c9c..03346f98c7b9 100644
--- a/Documentation/sysctl/index.rst
+++ b/Documentation/admin-guide/sysctl/index.rst
@@ -1,5 +1,3 @@
-:orphan:
-
===========================
Documentation for /proc/sys
===========================
diff --git a/Documentation/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst
similarity index 100%
rename from Documentation/sysctl/kernel.rst
rename to Documentation/admin-guide/sysctl/kernel.rst
diff --git a/Documentation/sysctl/net.rst b/Documentation/admin-guide/sysctl/net.rst
similarity index 100%
rename from Documentation/sysctl/net.rst
rename to Documentation/admin-guide/sysctl/net.rst
diff --git a/Documentation/sysctl/sunrpc.rst b/Documentation/admin-guide/sysctl/sunrpc.rst
similarity index 100%
rename from Documentation/sysctl/sunrpc.rst
rename to Documentation/admin-guide/sysctl/sunrpc.rst
diff --git a/Documentation/sysctl/user.rst b/Documentation/admin-guide/sysctl/user.rst
similarity index 100%
rename from Documentation/sysctl/user.rst
rename to Documentation/admin-guide/sysctl/user.rst
diff --git a/Documentation/sysctl/vm.rst b/Documentation/admin-guide/sysctl/vm.rst
similarity index 100%
rename from Documentation/sysctl/vm.rst
rename to Documentation/admin-guide/sysctl/vm.rst
diff --git a/Documentation/core-api/printk-formats.rst b/Documentation/core-api/printk-formats.rst
index 1d8e748f909f..c6224d039bcb 100644
--- a/Documentation/core-api/printk-formats.rst
+++ b/Documentation/core-api/printk-formats.rst
@@ -119,7 +119,7 @@ Kernel Pointers
For printing kernel pointers which should be hidden from unprivileged
users. The behaviour of %pK depends on the kptr_restrict sysctl - see
-Documentation/sysctl/kernel.rst for more details.
+Documentation/admin-guide/sysctl/kernel.rst for more details.
Unmodified Addresses
--------------------
diff --git a/Documentation/filesystems/proc.txt b/Documentation/filesystems/proc.txt
index a226061fa109..d551e091df47 100644
--- a/Documentation/filesystems/proc.txt
+++ b/Documentation/filesystems/proc.txt
@@ -1479,7 +1479,7 @@ review the kernel documentation in the directory /usr/src/linux/Documentation.
This chapter is heavily based on the documentation included in the pre 2.2
kernels, and became part of it in version 2.2.1 of the Linux kernel.
-Please see: Documentation/sysctl/ directory for descriptions of these
+Please see: Documentation/admin-guide/sysctl/ directory for descriptions of these
entries.
------------------------------------------------------------------------------
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index 8626b175b192..8adaf27820de 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -2276,7 +2276,7 @@ addr_scope_policy - INTEGER
/proc/sys/net/core/*
- Please see: Documentation/sysctl/net.rst for descriptions of these entries.
+ Please see: Documentation/admin-guide/sysctl/net.rst for descriptions of these entries.
/proc/sys/net/unix/*
diff --git a/Documentation/vm/unevictable-lru.rst b/Documentation/vm/unevictable-lru.rst
index 997dfbf13b99..17d0861b0f1d 100644
--- a/Documentation/vm/unevictable-lru.rst
+++ b/Documentation/vm/unevictable-lru.rst
@@ -439,7 +439,7 @@ Compacting MLOCKED Pages
The unevictable LRU can be scanned for compactable regions and the default
behavior is to do so. /proc/sys/vm/compact_unevictable_allowed controls
-this behavior (see Documentation/sysctl/vm.rst). Once scanning of the
+this behavior (see Documentation/admin-guide/sysctl/vm.rst). Once scanning of the
unevictable LRU is enabled, the work of compaction is mostly handled by
the page migration code and the same work flow as described in MIGRATING
MLOCKED PAGES will apply.
diff --git a/fs/proc/Kconfig b/fs/proc/Kconfig
index cba429db95d9..cb5629bd5fff 100644
--- a/fs/proc/Kconfig
+++ b/fs/proc/Kconfig
@@ -73,7 +73,7 @@ config PROC_SYSCTL
interface is through /proc/sys. If you say Y here a tree of
modifiable sysctl entries will be generated beneath the
/proc/sys directory. They are explained in the files
- in <file:Documentation/sysctl/>. Note that enabling this
+ in <file:Documentation/admin-guide/sysctl/>. Note that enabling this
option will enlarge the kernel by at least 8 KB.
As it is generally a good thing, you should say Y here unless
diff --git a/kernel/panic.c b/kernel/panic.c
index e0ea74bbb41d..057540b6eee9 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -372,7 +372,7 @@ const struct taint_flag taint_flags[TAINT_FLAGS_COUNT] = {
/**
* print_tainted - return a string to represent the kernel taint state.
*
- * For individual taint flag meanings, see Documentation/sysctl/kernel.rst
+ * For individual taint flag meanings, see Documentation/admin-guide/sysctl/kernel.rst
*
* The string is overwritten by the next call to print_tainted(),
* but is always NULL terminated.
diff --git a/mm/swap.c b/mm/swap.c
index 83a2a15f4836..ae300397dfda 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -8,7 +8,7 @@
/*
* This file contains the default values for the operation of the
* Linux VM subsystem. Fine-tuning documentation can be found in
- * Documentation/sysctl/vm.rst.
+ * Documentation/admin-guide/sysctl/vm.rst.
* Started 18.12.91
* Swap aging added 23.2.95, Stephen Tweedie.
* Buffermem limits added 12.3.98, Rik van Riel.
--
2.21.0
The conversion itself is simple: add a markup for the
title of this file and add markups for both tables.
Yet, the big table here with IOCTL numbers is badly formatted:
on several lines, the "Include File" column has some values that
are bigger than the reserved space there.
Also, on several places, a comment was misplaced at the "Include
File" space.
So, most of the work here is to actually ensure that each field
will be properly fixed.
Also worth to mention that some URLs have the asterisk character
on it. Well, Sphinx has an issue with asterisks in the middle
of an string. As this is URL, use the alternate format: %2A.
As a side effect of this patch, it is now a lot easier to see that
some reserved ioctl numbers are missing the include files
where it is supposed to be used.
PS.: While this is part of a subdir, I opted to convert this
single file alone, as this file has a potential of conflicts,
as most subsystem maintainers touch it.
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
---
.../{ioctl-number.txt => ioctl-number.rst} | 588 +++++++++---------
Documentation/process/submit-checklist.rst | 2 +-
.../it_IT/process/submit-checklist.rst | 2 +-
.../zh_CN/process/submit-checklist.rst | 2 +-
include/uapi/rdma/rdma_user_ioctl_cmds.h | 2 +-
5 files changed, 304 insertions(+), 292 deletions(-)
rename Documentation/ioctl/{ioctl-number.txt => ioctl-number.rst} (11%)
diff --git a/Documentation/ioctl/ioctl-number.txt b/Documentation/ioctl/ioctl-number.rst
similarity index 11%
rename from Documentation/ioctl/ioctl-number.txt
rename to Documentation/ioctl/ioctl-number.rst
index c9558146ac58..e6d07badafb1 100644
--- a/Documentation/ioctl/ioctl-number.txt
+++ b/Documentation/ioctl/ioctl-number.rst
@@ -1,15 +1,23 @@
+:orphan:
+
+=============
Ioctl Numbers
+=============
+
19 October 1999
+
Michael Elizabeth Chastain
<[email protected]>
If you are adding new ioctl's to the kernel, you should use the _IO
macros defined in <linux/ioctl.h>:
+ ====== == ============================================
_IO an ioctl with no parameters
_IOW an ioctl with write parameters (copy_from_user)
_IOR an ioctl with read parameters (copy_to_user)
_IOWR an ioctl with both write and read parameters.
+ ====== == ============================================
'Write' and 'read' are from the user's point of view, just like the
system calls 'write' and 'read'. For example, a SET_FOO ioctl would
@@ -60,291 +68,295 @@ This table lists ioctls visible from user land for Linux/x86. It contains
most drivers up to 2.6.31, but I know I am missing some. There has been
no attempt to list non-X86 architectures or ioctls from drivers/staging/.
-Code Seq#(hex) Include File Comments
-========================================================
-0x00 00-1F linux/fs.h conflict!
-0x00 00-1F scsi/scsi_ioctl.h conflict!
-0x00 00-1F linux/fb.h conflict!
-0x00 00-1F linux/wavefront.h conflict!
-0x02 all linux/fd.h
-0x03 all linux/hdreg.h
-0x04 D2-DC linux/umsdos_fs.h Dead since 2.6.11, but don't reuse these.
-0x06 all linux/lp.h
-0x09 all linux/raid/md_u.h
-0x10 00-0F drivers/char/s390/vmcp.h
-0x10 10-1F arch/s390/include/uapi/sclp_ctl.h
-0x10 20-2F arch/s390/include/uapi/asm/hypfs.h
-0x12 all linux/fs.h
- linux/blkpg.h
-0x1b all InfiniBand Subsystem <http://infiniband.sourceforge.net/>
-0x20 all drivers/cdrom/cm206.h
-0x22 all scsi/sg.h
-'!' 00-1F uapi/linux/seccomp.h
-'#' 00-3F IEEE 1394 Subsystem Block for the entire subsystem
-'$' 00-0F linux/perf_counter.h, linux/perf_event.h
-'%' 00-0F include/uapi/linux/stm.h
- System Trace Module subsystem
- <mailto:[email protected]>
-'&' 00-07 drivers/firewire/nosy-user.h
-'1' 00-1F <linux/timepps.h> PPS kit from Ulrich Windl
- <ftp://ftp.de.kernel.org/pub/linux/daemons/ntp/PPS/>
-'2' 01-04 linux/i2o.h
-'3' 00-0F drivers/s390/char/raw3270.h conflict!
-'3' 00-1F linux/suspend_ioctls.h conflict!
- and kernel/power/user.c
-'8' all SNP8023 advanced NIC card
- <mailto:[email protected]>
-';' 64-7F linux/vfio.h
-'@' 00-0F linux/radeonfb.h conflict!
-'@' 00-0F drivers/video/aty/aty128fb.c conflict!
-'A' 00-1F linux/apm_bios.h conflict!
-'A' 00-0F linux/agpgart.h conflict!
- and drivers/char/agp/compat_ioctl.h
-'A' 00-7F sound/asound.h conflict!
-'B' 00-1F linux/cciss_ioctl.h conflict!
-'B' 00-0F include/linux/pmu.h conflict!
-'B' C0-FF advanced bbus
- <mailto:[email protected]>
-'C' all linux/soundcard.h conflict!
-'C' 01-2F linux/capi.h conflict!
-'C' F0-FF drivers/net/wan/cosa.h conflict!
-'D' all arch/s390/include/asm/dasd.h
-'D' 40-5F drivers/scsi/dpt/dtpi_ioctl.h
-'D' 05 drivers/scsi/pmcraid.h
-'E' all linux/input.h conflict!
-'E' 00-0F xen/evtchn.h conflict!
-'F' all linux/fb.h conflict!
-'F' 01-02 drivers/scsi/pmcraid.h conflict!
-'F' 20 drivers/video/fsl-diu-fb.h conflict!
-'F' 20 drivers/video/intelfb/intelfb.h conflict!
-'F' 20 linux/ivtvfb.h conflict!
-'F' 20 linux/matroxfb.h conflict!
-'F' 20 drivers/video/aty/atyfb_base.c conflict!
-'F' 00-0F video/da8xx-fb.h conflict!
-'F' 80-8F linux/arcfb.h conflict!
-'F' DD video/sstfb.h conflict!
-'G' 00-3F drivers/misc/sgi-gru/grulib.h conflict!
-'G' 00-0F linux/gigaset_dev.h conflict!
-'H' 00-7F linux/hiddev.h conflict!
-'H' 00-0F linux/hidraw.h conflict!
-'H' 01 linux/mei.h conflict!
-'H' 02 linux/mei.h conflict!
-'H' 03 linux/mei.h conflict!
-'H' 00-0F sound/asound.h conflict!
-'H' 20-40 sound/asound_fm.h conflict!
-'H' 80-8F sound/sfnt_info.h conflict!
-'H' 10-8F sound/emu10k1.h conflict!
-'H' 10-1F sound/sb16_csp.h conflict!
-'H' 10-1F sound/hda_hwdep.h conflict!
-'H' 40-4F sound/hdspm.h conflict!
-'H' 40-4F sound/hdsp.h conflict!
-'H' 90 sound/usb/usx2y/usb_stream.h
-'H' A0 uapi/linux/usb/cdc-wdm.h
-'H' C0-F0 net/bluetooth/hci.h conflict!
-'H' C0-DF net/bluetooth/hidp/hidp.h conflict!
-'H' C0-DF net/bluetooth/cmtp/cmtp.h conflict!
-'H' C0-DF net/bluetooth/bnep/bnep.h conflict!
-'H' F1 linux/hid-roccat.h <mailto:[email protected]>
-'H' F8-FA sound/firewire.h
-'I' all linux/isdn.h conflict!
-'I' 00-0F drivers/isdn/divert/isdn_divert.h conflict!
-'I' 40-4F linux/mISDNif.h conflict!
-'J' 00-1F drivers/scsi/gdth_ioctl.h
-'K' all linux/kd.h
-'L' 00-1F linux/loop.h conflict!
-'L' 10-1F drivers/scsi/mpt3sas/mpt3sas_ctl.h conflict!
-'L' 20-2F linux/lightnvm.h
-'L' E0-FF linux/ppdd.h encrypted disk device driver
- <http://linux01.gwdg.de/~alatham/ppdd.html>
-'M' all linux/soundcard.h conflict!
-'M' 01-16 mtd/mtd-abi.h conflict!
- and drivers/mtd/mtdchar.c
-'M' 01-03 drivers/scsi/megaraid/megaraid_sas.h
-'M' 00-0F drivers/video/fsl-diu-fb.h conflict!
-'N' 00-1F drivers/usb/scanner.h
-'N' 40-7F drivers/block/nvme.c
-'O' 00-06 mtd/ubi-user.h UBI
-'P' all linux/soundcard.h conflict!
-'P' 60-6F sound/sscape_ioctl.h conflict!
-'P' 00-0F drivers/usb/class/usblp.c conflict!
-'P' 01-09 drivers/misc/pci_endpoint_test.c conflict!
-'Q' all linux/soundcard.h
-'R' 00-1F linux/random.h conflict!
-'R' 01 linux/rfkill.h conflict!
-'R' C0-DF net/bluetooth/rfcomm.h
-'S' all linux/cdrom.h conflict!
-'S' 80-81 scsi/scsi_ioctl.h conflict!
-'S' 82-FF scsi/scsi.h conflict!
-'S' 00-7F sound/asequencer.h conflict!
-'T' all linux/soundcard.h conflict!
-'T' 00-AF sound/asound.h conflict!
-'T' all arch/x86/include/asm/ioctls.h conflict!
-'T' C0-DF linux/if_tun.h conflict!
-'U' all sound/asound.h conflict!
-'U' 00-CF linux/uinput.h conflict!
-'U' 00-EF linux/usbdevice_fs.h
-'U' C0-CF drivers/bluetooth/hci_uart.h
-'V' all linux/vt.h conflict!
-'V' all linux/videodev2.h conflict!
-'V' C0 linux/ivtvfb.h conflict!
-'V' C0 linux/ivtv.h conflict!
-'V' C0 media/davinci/vpfe_capture.h conflict!
-'V' C0 media/si4713.h conflict!
-'W' 00-1F linux/watchdog.h conflict!
-'W' 00-1F linux/wanrouter.h conflict! (pre 3.9)
-'W' 00-3F sound/asound.h conflict!
-'W' 40-5F drivers/pci/switch/switchtec.c
-'X' all fs/xfs/xfs_fs.h conflict!
- and fs/xfs/linux-2.6/xfs_ioctl32.h
- and include/linux/falloc.h
- and linux/fs.h
-'X' all fs/ocfs2/ocfs_fs.h conflict!
-'X' 01 linux/pktcdvd.h conflict!
-'Y' all linux/cyclades.h
-'Z' 14-15 drivers/message/fusion/mptctl.h
-'[' 00-3F linux/usb/tmc.h USB Test and Measurement Devices
- <mailto:[email protected]>
-'a' all linux/atm*.h, linux/sonet.h ATM on linux
- <http://lrcwww.epfl.ch/>
-'a' 00-0F drivers/crypto/qat/qat_common/adf_cfg_common.h conflict! qat driver
-'b' 00-FF conflict! bit3 vme host bridge
- <mailto:[email protected]>
-'c' all linux/cm4000_cs.h conflict!
-'c' 00-7F linux/comstats.h conflict!
-'c' 00-7F linux/coda.h conflict!
-'c' 00-1F linux/chio.h conflict!
-'c' 80-9F arch/s390/include/asm/chsc.h conflict!
-'c' A0-AF arch/x86/include/asm/msr.h conflict!
-'d' 00-FF linux/char/drm/drm.h conflict!
-'d' 02-40 pcmcia/ds.h conflict!
-'d' F0-FF linux/digi1.h
-'e' all linux/digi1.h conflict!
-'f' 00-1F linux/ext2_fs.h conflict!
-'f' 00-1F linux/ext3_fs.h conflict!
-'f' 00-0F fs/jfs/jfs_dinode.h conflict!
-'f' 00-0F fs/ext4/ext4.h conflict!
-'f' 00-0F linux/fs.h conflict!
-'f' 00-0F fs/ocfs2/ocfs2_fs.h conflict!
-'g' 00-0F linux/usb/gadgetfs.h
-'g' 20-2F linux/usb/g_printer.h
-'h' 00-7F conflict! Charon filesystem
- <mailto:[email protected]>
-'h' 00-1F linux/hpet.h conflict!
-'h' 80-8F fs/hfsplus/ioctl.c
-'i' 00-3F linux/i2o-dev.h conflict!
-'i' 0B-1F linux/ipmi.h conflict!
-'i' 80-8F linux/i8k.h
-'j' 00-3F linux/joystick.h
-'k' 00-0F linux/spi/spidev.h conflict!
-'k' 00-05 video/kyro.h conflict!
-'k' 10-17 linux/hsi/hsi_char.h HSI character device
-'l' 00-3F linux/tcfs_fs.h transparent cryptographic file system
- <http://web.archive.org/web/*/http://mikonos.dia.unisa.it/tcfs>
-'l' 40-7F linux/udf_fs_i.h in development:
- <http://sourceforge.net/projects/linux-udf/>
-'m' 00-09 linux/mmtimer.h conflict!
-'m' all linux/mtio.h conflict!
-'m' all linux/soundcard.h conflict!
-'m' all linux/synclink.h conflict!
-'m' 00-19 drivers/message/fusion/mptctl.h conflict!
-'m' 00 drivers/scsi/megaraid/megaraid_ioctl.h conflict!
-'n' 00-7F linux/ncp_fs.h and fs/ncpfs/ioctl.c
-'n' 80-8F uapi/linux/nilfs2_api.h NILFS2
-'n' E0-FF linux/matroxfb.h matroxfb
-'o' 00-1F fs/ocfs2/ocfs2_fs.h OCFS2
-'o' 00-03 mtd/ubi-user.h conflict! (OCFS2 and UBI overlaps)
-'o' 40-41 mtd/ubi-user.h UBI
-'o' 01-A1 linux/dvb/*.h DVB
-'p' 00-0F linux/phantom.h conflict! (OpenHaptics needs this)
-'p' 00-1F linux/rtc.h conflict!
-'p' 00-3F linux/mc146818rtc.h conflict!
-'p' 40-7F linux/nvram.h
-'p' 80-9F linux/ppdev.h user-space parport
- <mailto:[email protected]>
-'p' A1-A5 linux/pps.h LinuxPPS
- <mailto:[email protected]>
-'q' 00-1F linux/serio.h
-'q' 80-FF linux/telephony.h Internet PhoneJACK, Internet LineJACK
- linux/ixjuser.h <http://web.archive.org/web/*/http://www.quicknet.net>
-'r' 00-1F linux/msdos_fs.h and fs/fat/dir.c
-'s' all linux/cdk.h
-'t' 00-7F linux/ppp-ioctl.h
-'t' 80-8F linux/isdn_ppp.h
-'t' 90-91 linux/toshiba.h toshiba and toshiba_acpi SMM
-'u' 00-1F linux/smb_fs.h gone
-'u' 20-3F linux/uvcvideo.h USB video class host driver
-'u' 40-4f linux/udmabuf.h userspace dma-buf misc device
-'v' 00-1F linux/ext2_fs.h conflict!
-'v' 00-1F linux/fs.h conflict!
-'v' 00-0F linux/sonypi.h conflict!
-'v' 00-0F media/v4l2-subdev.h conflict!
-'v' C0-FF linux/meye.h conflict!
-'w' all CERN SCI driver
-'y' 00-1F packet based user level communications
- <mailto:[email protected]>
-'z' 00-3F CAN bus card conflict!
- <mailto:[email protected]>
-'z' 40-7F CAN bus card conflict!
- <mailto:[email protected]>
-'z' 10-4F drivers/s390/crypto/zcrypt_api.h conflict!
-'|' 00-7F linux/media.h
-0x80 00-1F linux/fb.h
-0x89 00-06 arch/x86/include/asm/sockios.h
-0x89 0B-DF linux/sockios.h
-0x89 E0-EF linux/sockios.h SIOCPROTOPRIVATE range
-0x89 E0-EF linux/dn.h PROTOPRIVATE range
-0x89 F0-FF linux/sockios.h SIOCDEVPRIVATE range
-0x8B all linux/wireless.h
-0x8C 00-3F WiNRADiO driver
- <http://www.winradio.com.au/>
-0x90 00 drivers/cdrom/sbpcd.h
-0x92 00-0F drivers/usb/mon/mon_bin.c
-0x93 60-7F linux/auto_fs.h
-0x94 all fs/btrfs/ioctl.h Btrfs filesystem
- and linux/fs.h some lifted to vfs/generic
-0x97 00-7F fs/ceph/ioctl.h Ceph file system
-0x99 00-0F 537-Addinboard driver
- <mailto:[email protected]>
-0xA0 all linux/sdp/sdp.h Industrial Device Project
- <mailto:[email protected]>
-0xA1 0 linux/vtpm_proxy.h TPM Emulator Proxy Driver
-0xA3 80-8F Port ACL in development:
- <mailto:[email protected]>
-0xA3 90-9F linux/dtlk.h
-0xA4 00-1F uapi/linux/tee.h Generic TEE subsystem
-0xAA 00-3F linux/uapi/linux/userfaultfd.h
-0xAB 00-1F linux/nbd.h
-0xAC 00-1F linux/raw.h
-0xAD 00 Netfilter device in development:
- <mailto:[email protected]>
-0xAE all linux/kvm.h Kernel-based Virtual Machine
- <mailto:[email protected]>
-0xAF 00-1F linux/fsl_hypervisor.h Freescale hypervisor
-0xB0 all RATIO devices in development:
- <mailto:[email protected]>
-0xB1 00-1F PPPoX <mailto:[email protected]>
-0xB3 00 linux/mmc/ioctl.h
-0xB4 00-0F linux/gpio.h <mailto:[email protected]>
-0xB5 00-0F uapi/linux/rpmsg.h <mailto:[email protected]>
-0xB6 all linux/fpga-dfl.h
-0xC0 00-0F linux/usb/iowarrior.h
-0xCA 00-0F uapi/misc/cxl.h
-0xCA 10-2F uapi/misc/ocxl.h
-0xCA 80-BF uapi/scsi/cxlflash_ioctl.h
-0xCB 00-1F CBM serial IEC bus in development:
- <mailto:[email protected]>
-0xCC 00-0F drivers/misc/ibmvmc.h pseries VMC driver
-0xCD 01 linux/reiserfs_fs.h
-0xCF 02 fs/cifs/ioctl.c
-0xDB 00-0F drivers/char/mwave/mwavepub.h
-0xDD 00-3F ZFCP device driver see drivers/s390/scsi/
- <mailto:[email protected]>
-0xE5 00-3F linux/fuse.h
-0xEC 00-01 drivers/platform/chrome/cros_ec_dev.h ChromeOS EC driver
-0xF3 00-3F drivers/usb/misc/sisusbvga/sisusb.h sisfb (in development)
- <mailto:[email protected]>
-0xF4 00-1F video/mbxfb.h mbxfb
- <mailto:[email protected]>
-0xF6 all LTTng Linux Trace Toolkit Next Generation
- <mailto:[email protected]>
-0xFD all linux/dm-ioctl.h
+==== ===== ======================================================= ================================================================
+Code Seq# Include File Comments
+ (hex)
+==== ===== ======================================================= ================================================================
+0x00 00-1F linux/fs.h conflict!
+0x00 00-1F scsi/scsi_ioctl.h conflict!
+0x00 00-1F linux/fb.h conflict!
+0x00 00-1F linux/wavefront.h conflict!
+0x02 all linux/fd.h
+0x03 all linux/hdreg.h
+0x04 D2-DC linux/umsdos_fs.h Dead since 2.6.11, but don't reuse these.
+0x06 all linux/lp.h
+0x09 all linux/raid/md_u.h
+0x10 00-0F drivers/char/s390/vmcp.h
+0x10 10-1F arch/s390/include/uapi/sclp_ctl.h
+0x10 20-2F arch/s390/include/uapi/asm/hypfs.h
+0x12 all linux/fs.h
+ linux/blkpg.h
+0x1b all InfiniBand Subsystem
+ <http://infiniband.sourceforge.net/>
+0x20 all drivers/cdrom/cm206.h
+0x22 all scsi/sg.h
+'!' 00-1F uapi/linux/seccomp.h
+'#' 00-3F IEEE 1394 Subsystem
+ Block for the entire subsystem
+'$' 00-0F linux/perf_counter.h, linux/perf_event.h
+'%' 00-0F include/uapi/linux/stm.h System Trace Module subsystem
+ <mailto:[email protected]>
+'&' 00-07 drivers/firewire/nosy-user.h
+'1' 00-1F linux/timepps.h PPS kit from Ulrich Windl
+ <ftp://ftp.de.kernel.org/pub/linux/daemons/ntp/PPS/>
+'2' 01-04 linux/i2o.h
+'3' 00-0F drivers/s390/char/raw3270.h conflict!
+'3' 00-1F linux/suspend_ioctls.h, conflict!
+ kernel/power/user.c
+'8' all SNP8023 advanced NIC card
+ <mailto:[email protected]>
+';' 64-7F linux/vfio.h
+'@' 00-0F linux/radeonfb.h conflict!
+'@' 00-0F drivers/video/aty/aty128fb.c conflict!
+'A' 00-1F linux/apm_bios.h conflict!
+'A' 00-0F linux/agpgart.h, conflict!
+ drivers/char/agp/compat_ioctl.h
+'A' 00-7F sound/asound.h conflict!
+'B' 00-1F linux/cciss_ioctl.h conflict!
+'B' 00-0F include/linux/pmu.h conflict!
+'B' C0-FF advanced bbus <mailto:[email protected]>
+'C' all linux/soundcard.h conflict!
+'C' 01-2F linux/capi.h conflict!
+'C' F0-FF drivers/net/wan/cosa.h conflict!
+'D' all arch/s390/include/asm/dasd.h
+'D' 40-5F drivers/scsi/dpt/dtpi_ioctl.h
+'D' 05 drivers/scsi/pmcraid.h
+'E' all linux/input.h conflict!
+'E' 00-0F xen/evtchn.h conflict!
+'F' all linux/fb.h conflict!
+'F' 01-02 drivers/scsi/pmcraid.h conflict!
+'F' 20 drivers/video/fsl-diu-fb.h conflict!
+'F' 20 drivers/video/intelfb/intelfb.h conflict!
+'F' 20 linux/ivtvfb.h conflict!
+'F' 20 linux/matroxfb.h conflict!
+'F' 20 drivers/video/aty/atyfb_base.c conflict!
+'F' 00-0F video/da8xx-fb.h conflict!
+'F' 80-8F linux/arcfb.h conflict!
+'F' DD video/sstfb.h conflict!
+'G' 00-3F drivers/misc/sgi-gru/grulib.h conflict!
+'G' 00-0F linux/gigaset_dev.h conflict!
+'H' 00-7F linux/hiddev.h conflict!
+'H' 00-0F linux/hidraw.h conflict!
+'H' 01 linux/mei.h conflict!
+'H' 02 linux/mei.h conflict!
+'H' 03 linux/mei.h conflict!
+'H' 00-0F sound/asound.h conflict!
+'H' 20-40 sound/asound_fm.h conflict!
+'H' 80-8F sound/sfnt_info.h conflict!
+'H' 10-8F sound/emu10k1.h conflict!
+'H' 10-1F sound/sb16_csp.h conflict!
+'H' 10-1F sound/hda_hwdep.h conflict!
+'H' 40-4F sound/hdspm.h conflict!
+'H' 40-4F sound/hdsp.h conflict!
+'H' 90 sound/usb/usx2y/usb_stream.h
+'H' A0 uapi/linux/usb/cdc-wdm.h
+'H' C0-F0 net/bluetooth/hci.h conflict!
+'H' C0-DF net/bluetooth/hidp/hidp.h conflict!
+'H' C0-DF net/bluetooth/cmtp/cmtp.h conflict!
+'H' C0-DF net/bluetooth/bnep/bnep.h conflict!
+'H' F1 linux/hid-roccat.h <mailto:[email protected]>
+'H' F8-FA sound/firewire.h
+'I' all linux/isdn.h conflict!
+'I' 00-0F drivers/isdn/divert/isdn_divert.h conflict!
+'I' 40-4F linux/mISDNif.h conflict!
+'J' 00-1F drivers/scsi/gdth_ioctl.h
+'K' all linux/kd.h
+'L' 00-1F linux/loop.h conflict!
+'L' 10-1F drivers/scsi/mpt3sas/mpt3sas_ctl.h conflict!
+'L' 20-2F linux/lightnvm.h
+'L' E0-FF linux/ppdd.h encrypted disk device driver
+ <http://linux01.gwdg.de/~alatham/ppdd.html>
+'M' all linux/soundcard.h conflict!
+'M' 01-16 mtd/mtd-abi.h conflict!
+ and drivers/mtd/mtdchar.c
+'M' 01-03 drivers/scsi/megaraid/megaraid_sas.h
+'M' 00-0F drivers/video/fsl-diu-fb.h conflict!
+'N' 00-1F drivers/usb/scanner.h
+'N' 40-7F drivers/block/nvme.c
+'O' 00-06 mtd/ubi-user.h UBI
+'P' all linux/soundcard.h conflict!
+'P' 60-6F sound/sscape_ioctl.h conflict!
+'P' 00-0F drivers/usb/class/usblp.c conflict!
+'P' 01-09 drivers/misc/pci_endpoint_test.c conflict!
+'Q' all linux/soundcard.h
+'R' 00-1F linux/random.h conflict!
+'R' 01 linux/rfkill.h conflict!
+'R' C0-DF net/bluetooth/rfcomm.h
+'S' all linux/cdrom.h conflict!
+'S' 80-81 scsi/scsi_ioctl.h conflict!
+'S' 82-FF scsi/scsi.h conflict!
+'S' 00-7F sound/asequencer.h conflict!
+'T' all linux/soundcard.h conflict!
+'T' 00-AF sound/asound.h conflict!
+'T' all arch/x86/include/asm/ioctls.h conflict!
+'T' C0-DF linux/if_tun.h conflict!
+'U' all sound/asound.h conflict!
+'U' 00-CF linux/uinput.h conflict!
+'U' 00-EF linux/usbdevice_fs.h
+'U' C0-CF drivers/bluetooth/hci_uart.h
+'V' all linux/vt.h conflict!
+'V' all linux/videodev2.h conflict!
+'V' C0 linux/ivtvfb.h conflict!
+'V' C0 linux/ivtv.h conflict!
+'V' C0 media/davinci/vpfe_capture.h conflict!
+'V' C0 media/si4713.h conflict!
+'W' 00-1F linux/watchdog.h conflict!
+'W' 00-1F linux/wanrouter.h conflict! (pre 3.9)
+'W' 00-3F sound/asound.h conflict!
+'W' 40-5F drivers/pci/switch/switchtec.c
+'X' all fs/xfs/xfs_fs.h, conflict!
+ fs/xfs/linux-2.6/xfs_ioctl32.h,
+ include/linux/falloc.h,
+ linux/fs.h,
+'X' all fs/ocfs2/ocfs_fs.h conflict!
+'X' 01 linux/pktcdvd.h conflict!
+'Y' all linux/cyclades.h
+'Z' 14-15 drivers/message/fusion/mptctl.h
+'[' 00-3F linux/usb/tmc.h USB Test and Measurement Devices
+ <mailto:[email protected]>
+'a' all linux/atm*.h, linux/sonet.h ATM on linux
+ <http://lrcwww.epfl.ch/>
+'a' 00-0F drivers/crypto/qat/qat_common/adf_cfg_common.h conflict! qat driver
+'b' 00-FF conflict! bit3 vme host bridge
+ <mailto:[email protected]>
+'c' all linux/cm4000_cs.h conflict!
+'c' 00-7F linux/comstats.h conflict!
+'c' 00-7F linux/coda.h conflict!
+'c' 00-1F linux/chio.h conflict!
+'c' 80-9F arch/s390/include/asm/chsc.h conflict!
+'c' A0-AF arch/x86/include/asm/msr.h conflict!
+'d' 00-FF linux/char/drm/drm.h conflict!
+'d' 02-40 pcmcia/ds.h conflict!
+'d' F0-FF linux/digi1.h
+'e' all linux/digi1.h conflict!
+'f' 00-1F linux/ext2_fs.h conflict!
+'f' 00-1F linux/ext3_fs.h conflict!
+'f' 00-0F fs/jfs/jfs_dinode.h conflict!
+'f' 00-0F fs/ext4/ext4.h conflict!
+'f' 00-0F linux/fs.h conflict!
+'f' 00-0F fs/ocfs2/ocfs2_fs.h conflict!
+'g' 00-0F linux/usb/gadgetfs.h
+'g' 20-2F linux/usb/g_printer.h
+'h' 00-7F conflict! Charon filesystem
+ <mailto:[email protected]>
+'h' 00-1F linux/hpet.h conflict!
+'h' 80-8F fs/hfsplus/ioctl.c
+'i' 00-3F linux/i2o-dev.h conflict!
+'i' 0B-1F linux/ipmi.h conflict!
+'i' 80-8F linux/i8k.h
+'j' 00-3F linux/joystick.h
+'k' 00-0F linux/spi/spidev.h conflict!
+'k' 00-05 video/kyro.h conflict!
+'k' 10-17 linux/hsi/hsi_char.h HSI character device
+'l' 00-3F linux/tcfs_fs.h transparent cryptographic file system
+ <http://web.archive.org/web/%2A/http://mikonos.dia.unisa.it/tcfs>
+'l' 40-7F linux/udf_fs_i.h in development:
+ <http://sourceforge.net/projects/linux-udf/>
+'m' 00-09 linux/mmtimer.h conflict!
+'m' all linux/mtio.h conflict!
+'m' all linux/soundcard.h conflict!
+'m' all linux/synclink.h conflict!
+'m' 00-19 drivers/message/fusion/mptctl.h conflict!
+'m' 00 drivers/scsi/megaraid/megaraid_ioctl.h conflict!
+'n' 00-7F linux/ncp_fs.h and fs/ncpfs/ioctl.c
+'n' 80-8F uapi/linux/nilfs2_api.h NILFS2
+'n' E0-FF linux/matroxfb.h matroxfb
+'o' 00-1F fs/ocfs2/ocfs2_fs.h OCFS2
+'o' 00-03 mtd/ubi-user.h conflict! (OCFS2 and UBI overlaps)
+'o' 40-41 mtd/ubi-user.h UBI
+'o' 01-A1 `linux/dvb/*.h` DVB
+'p' 00-0F linux/phantom.h conflict! (OpenHaptics needs this)
+'p' 00-1F linux/rtc.h conflict!
+'p' 00-3F linux/mc146818rtc.h conflict!
+'p' 40-7F linux/nvram.h
+'p' 80-9F linux/ppdev.h user-space parport
+ <mailto:[email protected]>
+'p' A1-A5 linux/pps.h LinuxPPS
+ <mailto:[email protected]>
+'q' 00-1F linux/serio.h
+'q' 80-FF linux/telephony.h Internet PhoneJACK, Internet LineJACK
+ linux/ixjuser.h <http://web.archive.org/web/%2A/http://www.quicknet.net>
+'r' 00-1F linux/msdos_fs.h and fs/fat/dir.c
+'s' all linux/cdk.h
+'t' 00-7F linux/ppp-ioctl.h
+'t' 80-8F linux/isdn_ppp.h
+'t' 90-91 linux/toshiba.h toshiba and toshiba_acpi SMM
+'u' 00-1F linux/smb_fs.h gone
+'u' 20-3F linux/uvcvideo.h USB video class host driver
+'u' 40-4f linux/udmabuf.h userspace dma-buf misc device
+'v' 00-1F linux/ext2_fs.h conflict!
+'v' 00-1F linux/fs.h conflict!
+'v' 00-0F linux/sonypi.h conflict!
+'v' 00-0F media/v4l2-subdev.h conflict!
+'v' C0-FF linux/meye.h conflict!
+'w' all CERN SCI driver
+'y' 00-1F packet based user level communications
+ <mailto:[email protected]>
+'z' 00-3F CAN bus card conflict!
+ <mailto:[email protected]>
+'z' 40-7F CAN bus card conflict!
+ <mailto:[email protected]>
+'z' 10-4F drivers/s390/crypto/zcrypt_api.h conflict!
+'|' 00-7F linux/media.h
+0x80 00-1F linux/fb.h
+0x89 00-06 arch/x86/include/asm/sockios.h
+0x89 0B-DF linux/sockios.h
+0x89 E0-EF linux/sockios.h SIOCPROTOPRIVATE range
+0x89 E0-EF linux/dn.h PROTOPRIVATE range
+0x89 F0-FF linux/sockios.h SIOCDEVPRIVATE range
+0x8B all linux/wireless.h
+0x8C 00-3F WiNRADiO driver
+ <http://www.winradio.com.au/>
+0x90 00 drivers/cdrom/sbpcd.h
+0x92 00-0F drivers/usb/mon/mon_bin.c
+0x93 60-7F linux/auto_fs.h
+0x94 all fs/btrfs/ioctl.h Btrfs filesystem
+ and linux/fs.h some lifted to vfs/generic
+0x97 00-7F fs/ceph/ioctl.h Ceph file system
+0x99 00-0F 537-Addinboard driver
+ <mailto:[email protected]>
+0xA0 all linux/sdp/sdp.h Industrial Device Project
+ <mailto:[email protected]>
+0xA1 0 linux/vtpm_proxy.h TPM Emulator Proxy Driver
+0xA3 80-8F Port ACL in development:
+ <mailto:[email protected]>
+0xA3 90-9F linux/dtlk.h
+0xA4 00-1F uapi/linux/tee.h Generic TEE subsystem
+0xAA 00-3F linux/uapi/linux/userfaultfd.h
+0xAB 00-1F linux/nbd.h
+0xAC 00-1F linux/raw.h
+0xAD 00 Netfilter device in development:
+ <mailto:[email protected]>
+0xAE all linux/kvm.h Kernel-based Virtual Machine
+ <mailto:[email protected]>
+0xAF 00-1F linux/fsl_hypervisor.h Freescale hypervisor
+0xB0 all RATIO devices in development:
+ <mailto:[email protected]>
+0xB1 00-1F PPPoX
+ <mailto:[email protected]>
+0xB3 00 linux/mmc/ioctl.h
+0xB4 00-0F linux/gpio.h <mailto:[email protected]>
+0xB5 00-0F uapi/linux/rpmsg.h <mailto:[email protected]>
+0xB6 all linux/fpga-dfl.h
+0xC0 00-0F linux/usb/iowarrior.h
+0xCA 00-0F uapi/misc/cxl.h
+0xCA 10-2F uapi/misc/ocxl.h
+0xCA 80-BF uapi/scsi/cxlflash_ioctl.h
+0xCB 00-1F CBM serial IEC bus in development:
+ <mailto:[email protected]>
+0xCC 00-0F drivers/misc/ibmvmc.h pseries VMC driver
+0xCD 01 linux/reiserfs_fs.h
+0xCF 02 fs/cifs/ioctl.c
+0xDB 00-0F drivers/char/mwave/mwavepub.h
+0xDD 00-3F ZFCP device driver see drivers/s390/scsi/
+ <mailto:[email protected]>
+0xE5 00-3F linux/fuse.h
+0xEC 00-01 drivers/platform/chrome/cros_ec_dev.h ChromeOS EC driver
+0xF3 00-3F drivers/usb/misc/sisusbvga/sisusb.h sisfb (in development)
+ <mailto:[email protected]>
+0xF4 00-1F video/mbxfb.h mbxfb
+ <mailto:[email protected]>
+0xF6 all LTTng Linux Trace Toolkit Next Generation
+ <mailto:[email protected]>
+0xFD all linux/dm-ioctl.h
+==== ===== ======================================================= ================================================================
diff --git a/Documentation/process/submit-checklist.rst b/Documentation/process/submit-checklist.rst
index 365efc9e4aa8..8e56337d422d 100644
--- a/Documentation/process/submit-checklist.rst
+++ b/Documentation/process/submit-checklist.rst
@@ -107,7 +107,7 @@ and elsewhere regarding submitting Linux kernel patches.
and why.
26) If any ioctl's are added by the patch, then also update
- ``Documentation/ioctl/ioctl-number.txt``.
+ ``Documentation/ioctl/ioctl-number.rst``.
27) If your modified source code depends on or uses any of the kernel
APIs or features that are related to the following ``Kconfig`` symbols,
diff --git a/Documentation/translations/it_IT/process/submit-checklist.rst b/Documentation/translations/it_IT/process/submit-checklist.rst
index ea74cae958d7..995ee69fab11 100644
--- a/Documentation/translations/it_IT/process/submit-checklist.rst
+++ b/Documentation/translations/it_IT/process/submit-checklist.rst
@@ -117,7 +117,7 @@ sottomissione delle patch, in particolare
sorgenti che ne spieghi la logica: cosa fanno e perché.
25) Se la patch aggiunge nuove chiamate ioctl, allora aggiornate
- ``Documentation/ioctl/ioctl-number.txt``.
+ ``Documentation/ioctl/ioctl-number.rst``.
26) Se il codice che avete modificato dipende o usa una qualsiasi interfaccia o
funzionalità del kernel che è associata a uno dei seguenti simboli
diff --git a/Documentation/translations/zh_CN/process/submit-checklist.rst b/Documentation/translations/zh_CN/process/submit-checklist.rst
index f4785d2b0491..8738c55e42a2 100644
--- a/Documentation/translations/zh_CN/process/submit-checklist.rst
+++ b/Documentation/translations/zh_CN/process/submit-checklist.rst
@@ -97,7 +97,7 @@ Linux内核补丁提交清单
24) 所有内存屏障例如 ``barrier()``, ``rmb()``, ``wmb()`` 都需要源代码中的注
释来解释它们正在执行的操作及其原因的逻辑。
-25) 如果补丁添加了任何ioctl,那么也要更新 ``Documentation/ioctl/ioctl-number.txt``
+25) 如果补丁添加了任何ioctl,那么也要更新 ``Documentation/ioctl/ioctl-number.rst``
26) 如果修改后的源代码依赖或使用与以下 ``Kconfig`` 符号相关的任何内核API或
功能,则在禁用相关 ``Kconfig`` 符号和/或 ``=m`` (如果该选项可用)的情况
diff --git a/include/uapi/rdma/rdma_user_ioctl_cmds.h b/include/uapi/rdma/rdma_user_ioctl_cmds.h
index 26213f49f5c8..54e16a589472 100644
--- a/include/uapi/rdma/rdma_user_ioctl_cmds.h
+++ b/include/uapi/rdma/rdma_user_ioctl_cmds.h
@@ -36,7 +36,7 @@
#include <linux/types.h>
#include <linux/ioctl.h>
-/* Documentation/ioctl/ioctl-number.txt */
+/* Documentation/ioctl/ioctl-number.rst */
#define RDMA_IOCTL_MAGIC 0x1b
#define RDMA_VERBS_IOCTL \
_IOWR(RDMA_IOCTL_MAGIC, 1, struct ib_uverbs_ioctl_hdr)
--
2.21.0
On Tuesday, June 18, 2019 11:05:26 PM CEST Mauro Carvalho Chehab wrote:
> The conversion itself is simple: add a markup for the
> title of this file and add markups for both tables.
>
> Yet, the big table here with IOCTL numbers is badly formatted:
> on several lines, the "Include File" column has some values that
> are bigger than the reserved space there.
>
> Also, on several places, a comment was misplaced at the "Include
> File" space.
>
> So, most of the work here is to actually ensure that each field
> will be properly fixed.
>
> Also worth to mention that some URLs have the asterisk character
> on it. Well, Sphinx has an issue with asterisks in the middle
> of an string. As this is URL, use the alternate format: %2A.
>
> As a side effect of this patch, it is now a lot easier to see that
> some reserved ioctl numbers are missing the include files
> where it is supposed to be used.
>
> PS.: While this is part of a subdir, I opted to convert this
> single file alone, as this file has a potential of conflicts,
> as most subsystem maintainers touch it.
>
> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
> ---
> .../{ioctl-number.txt => ioctl-number.rst} | 588 +++++++++---------
> Documentation/process/submit-checklist.rst | 2 +-
> .../it_IT/process/submit-checklist.rst | 2 +-
> .../zh_CN/process/submit-checklist.rst | 2 +-
> include/uapi/rdma/rdma_user_ioctl_cmds.h | 2 +-
Acked-by: Federico Vaga <[email protected]>
--
Federico Vaga
http://www.federicovaga.it/
On Wed, Jun 19, 2019 at 12:05 AM Mauro Carvalho Chehab
<[email protected]> wrote:
>
> The docs under Documentation/laptops contain users specific
> information.
>
Acked-by: Andy Shevchenko <[email protected]>
with a caveat about Documentation/admin-guide/sysctl/vm.rst.
How block bump is related to laptops? It sounds rather common
debugging feature, no?
> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
> ---
> Documentation/ABI/testing/sysfs-block-device | 2 +-
> Documentation/ABI/testing/sysfs-platform-asus-laptop | 2 +-
> Documentation/admin-guide/index.rst | 1 +
> Documentation/admin-guide/kernel-parameters.txt | 2 +-
> Documentation/{ => admin-guide}/laptops/asus-laptop.rst | 0
> .../{ => admin-guide}/laptops/disk-shock-protection.rst | 0
> Documentation/{ => admin-guide}/laptops/index.rst | 1 -
> Documentation/{ => admin-guide}/laptops/laptop-mode.rst | 0
> Documentation/{ => admin-guide}/laptops/lg-laptop.rst | 1 -
> Documentation/{ => admin-guide}/laptops/sony-laptop.rst | 0
> Documentation/{ => admin-guide}/laptops/sonypi.rst | 0
> Documentation/{ => admin-guide}/laptops/thinkpad-acpi.rst | 0
> Documentation/{ => admin-guide}/laptops/toshiba_haps.rst | 0
> Documentation/admin-guide/sysctl/vm.rst | 4 ++--
> MAINTAINERS | 4 ++--
> drivers/char/Kconfig | 2 +-
> drivers/platform/x86/Kconfig | 4 ++--
> 17 files changed, 11 insertions(+), 12 deletions(-)
> rename Documentation/{ => admin-guide}/laptops/asus-laptop.rst (100%)
> rename Documentation/{ => admin-guide}/laptops/disk-shock-protection.rst (100%)
> rename Documentation/{ => admin-guide}/laptops/index.rst (95%)
> rename Documentation/{ => admin-guide}/laptops/laptop-mode.rst (100%)
> rename Documentation/{ => admin-guide}/laptops/lg-laptop.rst (99%)
> rename Documentation/{ => admin-guide}/laptops/sony-laptop.rst (100%)
> rename Documentation/{ => admin-guide}/laptops/sonypi.rst (100%)
> rename Documentation/{ => admin-guide}/laptops/thinkpad-acpi.rst (100%)
> rename Documentation/{ => admin-guide}/laptops/toshiba_haps.rst (100%)
>
> diff --git a/Documentation/ABI/testing/sysfs-block-device b/Documentation/ABI/testing/sysfs-block-device
> index 0d57bbb4fddc..17f2bc7dd261 100644
> --- a/Documentation/ABI/testing/sysfs-block-device
> +++ b/Documentation/ABI/testing/sysfs-block-device
> @@ -45,7 +45,7 @@ Description:
> - Values below -2 are rejected with -EINVAL
>
> For more information, see
> - Documentation/laptops/disk-shock-protection.rst
> + Documentation/admin-guide/laptops/disk-shock-protection.rst
>
>
> What: /sys/block/*/device/ncq_prio_enable
> diff --git a/Documentation/ABI/testing/sysfs-platform-asus-laptop b/Documentation/ABI/testing/sysfs-platform-asus-laptop
> index d67fa4bafa70..8b0e8205a6a2 100644
> --- a/Documentation/ABI/testing/sysfs-platform-asus-laptop
> +++ b/Documentation/ABI/testing/sysfs-platform-asus-laptop
> @@ -31,7 +31,7 @@ Description:
> To control the LED display, use the following :
> echo 0x0T000DDD > /sys/devices/platform/asus_laptop/
> where T control the 3 letters display, and DDD the 3 digits display.
> - The DDD table can be found in Documentation/laptops/asus-laptop.rst
> + The DDD table can be found in Documentation/admin-guide/laptops/asus-laptop.rst
>
> What: /sys/devices/platform/asus_laptop/bluetooth
> Date: January 2007
> diff --git a/Documentation/admin-guide/index.rst b/Documentation/admin-guide/index.rst
> index 5940ce8d16af..e4f0cb2a02bd 100644
> --- a/Documentation/admin-guide/index.rst
> +++ b/Documentation/admin-guide/index.rst
> @@ -79,6 +79,7 @@ configure specific aspects of kernel behavior to your liking.
> aoe/index
> perf-security
> acpi/index
> + laptops/index
>
> btmrvl
> clearing-warn-once
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 0b17312b9198..69a9e2e66dfb 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -4356,7 +4356,7 @@
> Format: <integer>
>
> sonypi.*= [HW] Sony Programmable I/O Control Device driver
> - See Documentation/laptops/sonypi.rst
> + See Documentation/admin-guide/laptops/sonypi.rst
>
> spectre_v2= [X86] Control mitigation of Spectre variant 2
> (indirect branch speculation) vulnerability.
> diff --git a/Documentation/laptops/asus-laptop.rst b/Documentation/admin-guide/laptops/asus-laptop.rst
> similarity index 100%
> rename from Documentation/laptops/asus-laptop.rst
> rename to Documentation/admin-guide/laptops/asus-laptop.rst
> diff --git a/Documentation/laptops/disk-shock-protection.rst b/Documentation/admin-guide/laptops/disk-shock-protection.rst
> similarity index 100%
> rename from Documentation/laptops/disk-shock-protection.rst
> rename to Documentation/admin-guide/laptops/disk-shock-protection.rst
> diff --git a/Documentation/laptops/index.rst b/Documentation/admin-guide/laptops/index.rst
> similarity index 95%
> rename from Documentation/laptops/index.rst
> rename to Documentation/admin-guide/laptops/index.rst
> index 001a30910d09..6b554e39863b 100644
> --- a/Documentation/laptops/index.rst
> +++ b/Documentation/admin-guide/laptops/index.rst
> @@ -1,4 +1,3 @@
> -:orphan:
>
> ==============
> Laptop Drivers
> diff --git a/Documentation/laptops/laptop-mode.rst b/Documentation/admin-guide/laptops/laptop-mode.rst
> similarity index 100%
> rename from Documentation/laptops/laptop-mode.rst
> rename to Documentation/admin-guide/laptops/laptop-mode.rst
> diff --git a/Documentation/laptops/lg-laptop.rst b/Documentation/admin-guide/laptops/lg-laptop.rst
> similarity index 99%
> rename from Documentation/laptops/lg-laptop.rst
> rename to Documentation/admin-guide/laptops/lg-laptop.rst
> index f2c2ffe31101..ce9b14671cb9 100644
> --- a/Documentation/laptops/lg-laptop.rst
> +++ b/Documentation/admin-guide/laptops/lg-laptop.rst
> @@ -1,6 +1,5 @@
> .. SPDX-License-Identifier: GPL-2.0+
>
> -:orphan:
>
> LG Gram laptop extra features
> =============================
> diff --git a/Documentation/laptops/sony-laptop.rst b/Documentation/admin-guide/laptops/sony-laptop.rst
> similarity index 100%
> rename from Documentation/laptops/sony-laptop.rst
> rename to Documentation/admin-guide/laptops/sony-laptop.rst
> diff --git a/Documentation/laptops/sonypi.rst b/Documentation/admin-guide/laptops/sonypi.rst
> similarity index 100%
> rename from Documentation/laptops/sonypi.rst
> rename to Documentation/admin-guide/laptops/sonypi.rst
> diff --git a/Documentation/laptops/thinkpad-acpi.rst b/Documentation/admin-guide/laptops/thinkpad-acpi.rst
> similarity index 100%
> rename from Documentation/laptops/thinkpad-acpi.rst
> rename to Documentation/admin-guide/laptops/thinkpad-acpi.rst
> diff --git a/Documentation/laptops/toshiba_haps.rst b/Documentation/admin-guide/laptops/toshiba_haps.rst
> similarity index 100%
> rename from Documentation/laptops/toshiba_haps.rst
> rename to Documentation/admin-guide/laptops/toshiba_haps.rst
> diff --git a/Documentation/admin-guide/sysctl/vm.rst b/Documentation/admin-guide/sysctl/vm.rst
> index 4940ab610eb7..d918b11326f3 100644
> --- a/Documentation/admin-guide/sysctl/vm.rst
> +++ b/Documentation/admin-guide/sysctl/vm.rst
> @@ -108,7 +108,7 @@ block_dump
> ==========
>
> block_dump enables block I/O debugging when set to a nonzero value. More
> -information on block I/O debugging is in Documentation/laptops/laptop-mode.rst.
> +information on block I/O debugging is in Documentation/admin-guide/laptops/laptop-mode.rst.
>
>
> compact_memory
> @@ -298,7 +298,7 @@ laptop_mode
> ===========
>
> laptop_mode is a knob that controls "laptop mode". All the things that are
> -controlled by this knob are discussed in Documentation/laptops/laptop-mode.rst.
> +controlled by this knob are discussed in Documentation/admin-guide/laptops/laptop-mode.rst.
>
>
> legacy_va_layout
> diff --git a/MAINTAINERS b/MAINTAINERS
> index b7c81bd0f8e8..ab170522ec55 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -8927,7 +8927,7 @@ M: Matan Ziv-Av <[email protected]>
> L: [email protected]
> S: Maintained
> F: Documentation/ABI/testing/sysfs-platform-lg-laptop
> -F: Documentation/laptops/lg-laptop.rst
> +F: Documentation/admin-guide/laptops/lg-laptop.rst
> F: drivers/platform/x86/lg-laptop.c
>
> LG2160 MEDIA DRIVER
> @@ -14756,7 +14756,7 @@ M: Mattia Dongili <[email protected]>
> L: [email protected]
> W: http://www.linux.it/~malattia/wiki/index.php/Sony_drivers
> S: Maintained
> -F: Documentation/laptops/sony-laptop.rst
> +F: Documentation/admin-guide/laptops/sony-laptop.rst
> F: drivers/char/sonypi.c
> F: drivers/platform/x86/sony-laptop.c
> F: include/linux/sony-laptop.h
> diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
> index 3a0f94929814..3e866885a405 100644
> --- a/drivers/char/Kconfig
> +++ b/drivers/char/Kconfig
> @@ -382,7 +382,7 @@ config SONYPI
> Device which can be found in many (all ?) Sony Vaio laptops.
>
> If you have one of those laptops, read
> - <file:Documentation/laptops/sonypi.rst>, and say Y or M here.
> + <file:Documentation/admin-guide/laptops/sonypi.rst>, and say Y or M here.
>
> To compile this driver as a module, choose M here: the
> module will be called sonypi.
> diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
> index 9d866b6753fe..430f7f619553 100644
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
> @@ -451,7 +451,7 @@ config SONY_LAPTOP
> screen brightness control, Fn keys and allows powering on/off some
> devices.
>
> - Read <file:Documentation/laptops/sony-laptop.rst> for more information.
> + Read <file:Documentation/admin-guide/laptops/sony-laptop.rst> for more information.
>
> config SONYPI_COMPAT
> bool "Sonypi compatibility"
> @@ -503,7 +503,7 @@ config THINKPAD_ACPI
> support for Fn-Fx key combinations, Bluetooth control, video
> output switching, ThinkLight control, UltraBay eject and more.
> For more information about this driver see
> - <file:Documentation/laptops/thinkpad-acpi.rst> and
> + <file:Documentation/admin-guide/laptops/thinkpad-acpi.rst> and
> <http://ibm-acpi.sf.net/> .
>
> This driver was formerly known as ibm-acpi.
> --
> 2.21.0
>
--
With Best Regards,
Andy Shevchenko
On 二, 2019-06-18 at 18:05 -0300, Mauro Carvalho Chehab wrote:
> Rename the thermal documentation files to ReST, add an
> index for them and adjust in order to produce a nice html
> output via the Sphinx build system.
>
> At its new index.rst, let's add a :orphan: while this is not linked
> to
> the main index.rst file, in order to avoid build warnings.
>
> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Acked-by: Zhang Rui <[email protected]>
should I apply this patch or you have a separate tree for all these
changes?
thanks,
rui
> ---
> ...pu-cooling-api.txt => cpu-cooling-api.rst} | 39 +-
> .../{exynos_thermal => exynos_thermal.rst} | 47 +-
> ...emulation => exynos_thermal_emulation.rst} | 66 +--
> Documentation/thermal/index.rst | 18 +
> ...el_powerclamp.txt => intel_powerclamp.rst} | 177 +++----
> .../{nouveau_thermal => nouveau_thermal.rst} | 54 +-
> ...ower_allocator.txt => power_allocator.rst} | 140 ++---
> .../thermal/{sysfs-api.txt => sysfs-api.rst} | 490 ++++++++++++--
> ----
> ...hermal => x86_pkg_temperature_thermal.rst} | 28 +-
> MAINTAINERS | 2 +-
> include/linux/thermal.h | 4 +-
> 11 files changed, 665 insertions(+), 400 deletions(-)
> rename Documentation/thermal/{cpu-cooling-api.txt => cpu-cooling-
> api.rst} (82%)
> rename Documentation/thermal/{exynos_thermal => exynos_thermal.rst}
> (67%)
> rename Documentation/thermal/{exynos_thermal_emulation =>
> exynos_thermal_emulation.rst} (36%)
> create mode 100644 Documentation/thermal/index.rst
> rename Documentation/thermal/{intel_powerclamp.txt =>
> intel_powerclamp.rst} (76%)
> rename Documentation/thermal/{nouveau_thermal =>
> nouveau_thermal.rst} (64%)
> rename Documentation/thermal/{power_allocator.txt =>
> power_allocator.rst} (74%)
> rename Documentation/thermal/{sysfs-api.txt => sysfs-api.rst} (66%)
> rename Documentation/thermal/{x86_pkg_temperature_thermal =>
> x86_pkg_temperature_thermal.rst} (80%)
>
> diff --git a/Documentation/thermal/cpu-cooling-api.txt
> b/Documentation/thermal/cpu-cooling-api.rst
> similarity index 82%
> rename from Documentation/thermal/cpu-cooling-api.txt
> rename to Documentation/thermal/cpu-cooling-api.rst
> index 7df567eaea1a..645d914c45a6 100644
> --- a/Documentation/thermal/cpu-cooling-api.txt
> +++ b/Documentation/thermal/cpu-cooling-api.rst
> @@ -1,5 +1,6 @@
> +=======================
> CPU cooling APIs How To
> -===================================
> +=======================
>
> Written by Amit Daniel Kachhap <[email protected]>
>
> @@ -8,40 +9,54 @@ Updated: 6 Jan 2015
> Copyright (c) 2012 Samsung Electronics Co., Ltd(http://www.samsung.
> com)
>
> 0. Introduction
> +===============
>
> The generic cpu cooling(freq clipping) provides
> registration/unregistration APIs
> to the caller. The binding of the cooling devices to the trip point
> is left for
> the user. The registration APIs returns the cooling device pointer.
>
> 1. cpu cooling APIs
> +===================
>
> 1.1 cpufreq registration/unregistration APIs
> -1.1.1 struct thermal_cooling_device *cpufreq_cooling_register(
> - struct cpumask *clip_cpus)
> +--------------------------------------------
> +
> + ::
> +
> + struct thermal_cooling_device
> + *cpufreq_cooling_register(struct cpumask *clip_cpus)
>
> This interface function registers the cpufreq cooling device
> with the name
> "thermal-cpufreq-%x". This api can support multiple instances of
> cpufreq
> cooling devices.
>
> - clip_cpus: cpumask of cpus where the frequency constraints will
> happen.
> + clip_cpus:
> + cpumask of cpus where the frequency constraints will happen.
>
> -1.1.2 struct thermal_cooling_device *of_cpufreq_cooling_register(
> - struct cpufreq_policy
> *policy)
> + ::
> +
> + struct thermal_cooling_device
> + *of_cpufreq_cooling_register(struct cpufreq_policy *policy)
>
> This interface function registers the cpufreq cooling device
> with
> the name "thermal-cpufreq-%x" linking it with a device tree
> node, in
> order to bind it via the thermal DT code. This api can support
> multiple
> instances of cpufreq cooling devices.
>
> - policy: CPUFreq policy.
> + policy:
> + CPUFreq policy.
>
> -1.1.3 void cpufreq_cooling_unregister(struct thermal_cooling_device
> *cdev)
> +
> + ::
> +
> + void cpufreq_cooling_unregister(struct
> thermal_cooling_device *cdev)
>
> This interface function unregisters the "thermal-cpufreq-%x"
> cooling device.
>
> cdev: Cooling device pointer which has to be unregistered.
>
> 2. Power models
> +===============
>
> The power API registration functions provide a simple power model
> for
> CPUs. The current power is calculated as dynamic power (static
> power isn't
> @@ -65,9 +80,9 @@ For a given processor implementation the primary
> factors are:
> variation. In pathological cases this variation can be
> significant,
> but typically it is of a much lesser impact than the factors
> above.
>
> -A high level dynamic power consumption model may then be represented
> as:
> +A high level dynamic power consumption model may then be represented
> as::
>
> -Pdyn = f(run) * Voltage^2 * Frequency * Utilisation
> + Pdyn = f(run) * Voltage^2 * Frequency * Utilisation
>
> f(run) here represents the described execution behaviour and its
> result has a units of Watts/Hz/Volt^2 (this often expressed in
> @@ -80,9 +95,9 @@ factors. Therefore, in initial implementation that
> contribution is
> represented as a constant coefficient. This is a simplification
> consistent with the relative contribution to overall power
> variation.
>
> -In this simplified representation our model becomes:
> +In this simplified representation our model becomes::
>
> -Pdyn = Capacitance * Voltage^2 * Frequency * Utilisation
> + Pdyn = Capacitance * Voltage^2 * Frequency * Utilisation
>
> Where `capacitance` is a constant that represents an indicative
> running time dynamic power coefficient in fundamental units of
> diff --git a/Documentation/thermal/exynos_thermal
> b/Documentation/thermal/exynos_thermal.rst
> similarity index 67%
> rename from Documentation/thermal/exynos_thermal
> rename to Documentation/thermal/exynos_thermal.rst
> index 9010c4416967..5bd556566c70 100644
> --- a/Documentation/thermal/exynos_thermal
> +++ b/Documentation/thermal/exynos_thermal.rst
> @@ -1,8 +1,11 @@
> +========================
> Kernel driver exynos_tmu
> -=================
> +========================
>
> Supported chips:
> +
> * ARM SAMSUNG EXYNOS4, EXYNOS5 series of SoC
> +
> Datasheet: Not publicly available
>
> Authors: Donggeun Kim <[email protected]>
> @@ -19,32 +22,39 @@ Temperature can be taken from the temperature
> code.
> There are three equations converting from temperature to temperature
> code.
>
> The three equations are:
> - 1. Two point trimming
> + 1. Two point trimming::
> +
> Tc = (T - 25) * (TI2 - TI1) / (85 - 25) + TI1
>
> - 2. One point trimming
> + 2. One point trimming::
> +
> Tc = T + TI1 - 25
>
> - 3. No trimming
> + 3. No trimming::
> +
> Tc = T + 50
>
> - Tc: Temperature code, T: Temperature,
> - TI1: Trimming info for 25 degree Celsius (stored at TRIMINFO
> register)
> + Tc:
> + Temperature code, T: Temperature,
> + TI1:
> + Trimming info for 25 degree Celsius (stored at TRIMINFO
> register)
> Temperature code measured at 25 degree Celsius which is
> unchanged
> - TI2: Trimming info for 85 degree Celsius (stored at TRIMINFO
> register)
> + TI2:
> + Trimming info for 85 degree Celsius (stored at TRIMINFO
> register)
> Temperature code measured at 85 degree Celsius which is
> unchanged
>
> TMU(Thermal Management Unit) in EXYNOS4/5 generates interrupt
> when temperature exceeds pre-defined levels.
> The maximum number of configurable threshold is five.
> -The threshold levels are defined as follows:
> +The threshold levels are defined as follows::
> +
> Level_0: current temperature > trigger_level_0 + threshold
> Level_1: current temperature > trigger_level_1 + threshold
> Level_2: current temperature > trigger_level_2 + threshold
> Level_3: current temperature > trigger_level_3 + threshold
>
> - The threshold and each trigger_level are set
> - through the corresponding registers.
> +The threshold and each trigger_level are set
> +through the corresponding registers.
>
> When an interrupt occurs, this driver notify kernel thermal
> framework
> with the function exynos_report_trigger.
> @@ -54,24 +64,27 @@ it can be used to synchronize the cooling action.
> TMU driver description:
> -----------------------
>
> -The exynos thermal driver is structured as,
> +The exynos thermal driver is structured as::
>
> Kernel Core thermal
> framework
> (thermal_core.c, step_wise.c,
> cpu_cooling.c)
> ^
> |
> |
> -TMU configuration data -------> TMU Driver <------> Exynos Core
> thermal wrapper
> -(exynos_tmu_data.c) (exynos_tmu.c) (exynos_th
> ermal_common.c)
> -(exynos_tmu_data.h) (exynos_tmu.h) (exynos_th
> ermal_common.h)
> + TMU configuration data -----> TMU Driver <----> Exynos Core
> thermal wrapper
> + (exynos_tmu_data.c) (exynos_tmu.c) (exynos_
> thermal_common.c)
> + (exynos_tmu_data.h) (exynos_tmu.h) (exynos_
> thermal_common.h)
>
> -a) TMU configuration data: This consist of TMU register
> offsets/bitfields
> +a) TMU configuration data:
> + This consist of TMU register offsets/bitfields
> described through structure exynos_tmu_registers.
> Also several
> other platform data (struct
> exynos_tmu_platform_data) members
> are used to configure the TMU.
> -b) TMU driver: This component initialises the TMU controller and
> sets different
> +b) TMU driver:
> + This component initialises the TMU controller and
> sets different
> thresholds. It invokes core thermal implementation
> with the call
> exynos_report_trigger.
> -c) Exynos Core thermal wrapper: This provides 3 wrapper function to
> use the
> +c) Exynos Core thermal wrapper:
> + This provides 3 wrapper function to use the
> Kernel core thermal framework. They are
> exynos_unregister_thermal,
> exynos_register_thermal and exynos_report_trigger.
> diff --git a/Documentation/thermal/exynos_thermal_emulation
> b/Documentation/thermal/exynos_thermal_emulation.rst
> similarity index 36%
> rename from Documentation/thermal/exynos_thermal_emulation
> rename to Documentation/thermal/exynos_thermal_emulation.rst
> index b15efec6ca28..c21d10838bc5 100644
> --- a/Documentation/thermal/exynos_thermal_emulation
> +++ b/Documentation/thermal/exynos_thermal_emulation.rst
> @@ -1,5 +1,6 @@
> -EXYNOS EMULATION MODE
> -========================
> +=====================
> +Exynos Emulation Mode
> +=====================
>
> Copyright (C) 2012 Samsung Electronics
>
> @@ -8,46 +9,53 @@ Written by Jonghwa Lee <[email protected]>
> Description
> -----------
>
> -Exynos 4x12 (4212, 4412) and 5 series provide emulation mode for
> thermal management unit.
> -Thermal emulation mode supports software debug for TMU's operation.
> User can set temperature
> -manually with software code and TMU will read current temperature
> from user value not from
> -sensor's value.
> +Exynos 4x12 (4212, 4412) and 5 series provide emulation mode for
> thermal
> +management unit. Thermal emulation mode supports software debug for
> +TMU's operation. User can set temperature manually with software
> code
> +and TMU will read current temperature from user value not from
> sensor's
> +value.
>
> -Enabling CONFIG_THERMAL_EMULATION option will make this support
> available.
> -When it's enabled, sysfs node will be created as
> +Enabling CONFIG_THERMAL_EMULATION option will make this support
> +available. When it's enabled, sysfs node will be created as
> /sys/devices/virtual/thermal/thermal_zone'zone id'/emul_temp.
>
> -The sysfs node, 'emul_node', will contain value 0 for the initial
> state. When you input any
> -temperature you want to update to sysfs node, it automatically
> enable emulation mode and
> -current temperature will be changed into it.
> -(Exynos also supports user changeable delay time which would be used
> to delay of
> - changing temperature. However, this node only uses same delay of
> real sensing time, 938us.)
> +The sysfs node, 'emul_node', will contain value 0 for the initial
> state.
> +When you input any temperature you want to update to sysfs node, it
> +automatically enable emulation mode and current temperature will be
> +changed into it.
>
> -Exynos emulation mode requires synchronous of value changing and
> enabling. It means when you
> -want to update the any value of delay or next temperature, then you
> have to enable emulation
> -mode at the same time. (Or you have to keep the mode enabling.) If
> you don't, it fails to
> -change the value to updated one and just use last succeessful value
> repeatedly. That's why
> -this node gives users the right to change termerpature only. Just
> one interface makes it more
> -simply to use.
> +(Exynos also supports user changeable delay time which would be used
> to
> +delay of changing temperature. However, this node only uses same
> delay
> +of real sensing time, 938us.)
> +
> +Exynos emulation mode requires synchronous of value changing and
> +enabling. It means when you want to update the any value of delay or
> +next temperature, then you have to enable emulation mode at the same
> +time. (Or you have to keep the mode enabling.) If you don't, it
> fails to
> +change the value to updated one and just use last succeessful value
> +repeatedly. That's why this node gives users the right to change
> +termerpature only. Just one interface makes it more simply to use.
>
> Disabling emulation mode only requires writing value 0 to sysfs
> node.
>
> +::
>
> -TEMP 120 |
> +
> + TEMP 120 |
> |
> 100 |
> |
> 80 |
> - | +-----------
> - 60 | | |
> - | +-------------| |
> + | +-----------
> + 60 | | |
> + | +-------------| |
> 40 | | | |
> - | | | |
> - 20 | | | +-
> ---------
> - | | | |
> |
> + | | | |
> + 20 | | | +----
> ------
> + | | | |
> |
> 0
> |______________|_____________|__________|__________|_________
> - A A A
> A TIME
> + A A A
> A TIME
> |<----->| |<----->| |<----->|
> |
> | 938us | | | | |
> |
> -emulation : 0 50 | 70 | 20 |
> 0
> -current temp : sensor 50 70 20
> sensor
> + emulation : 0 50 | 70 | 20 |
> 0
> + current temp: sensor 50 70 20
> sensor
> diff --git a/Documentation/thermal/index.rst
> b/Documentation/thermal/index.rst
> new file mode 100644
> index 000000000000..8c1c00146cad
> --- /dev/null
> +++ b/Documentation/thermal/index.rst
> @@ -0,0 +1,18 @@
> +:orphan:
> +
> +=======
> +Thermal
> +=======
> +
> +.. toctree::
> + :maxdepth: 1
> +
> + cpu-cooling-api
> + sysfs-api
> + power_allocator
> +
> + exynos_thermal
> + exynos_thermal_emulation
> + intel_powerclamp
> + nouveau_thermal
> + x86_pkg_temperature_thermal
> diff --git a/Documentation/thermal/intel_powerclamp.txt
> b/Documentation/thermal/intel_powerclamp.rst
> similarity index 76%
> rename from Documentation/thermal/intel_powerclamp.txt
> rename to Documentation/thermal/intel_powerclamp.rst
> index b5df21168fbc..3f6dfb0b3ea6 100644
> --- a/Documentation/thermal/intel_powerclamp.txt
> +++ b/Documentation/thermal/intel_powerclamp.rst
> @@ -1,10 +1,13 @@
> - =======================
> - INTEL POWERCLAMP DRIVER
> - =======================
> -By: Arjan van de Ven <[email protected]>
> - Jacob Pan <[email protected]>
> +=======================
> +Intel Powerclamp Driver
> +=======================
> +
> +By:
> + - Arjan van de Ven <[email protected]>
> + - Jacob Pan <[email protected]>
> +
> +.. Contents:
>
> -Contents:
> (*) Introduction
> - Goals and Objectives
>
> @@ -23,7 +26,6 @@ Contents:
> - Generic Thermal Layer (sysfs)
> - Kernel APIs (TBD)
>
> -============
> INTRODUCTION
> ============
>
> @@ -47,7 +49,6 @@ scalability, and user experience. In many cases,
> clear advantage is
> shown over taking the CPU offline or modulating the CPU clock.
>
>
> -===================
> THEORY OF OPERATION
> ===================
>
> @@ -57,11 +58,12 @@ Idle Injection
> On modern Intel processors (Nehalem or later), package level C-state
> residency is available in MSRs, thus also available to the kernel.
>
> -These MSRs are:
> - #define MSR_PKG_C2_RESIDENCY 0x60D
> - #define MSR_PKG_C3_RESIDENCY 0x3F8
> - #define MSR_PKG_C6_RESIDENCY 0x3F9
> - #define MSR_PKG_C7_RESIDENCY 0x3FA
> +These MSRs are::
> +
> + #define MSR_PKG_C2_RESIDENCY 0x60D
> + #define MSR_PKG_C3_RESIDENCY 0x3F8
> + #define MSR_PKG_C6_RESIDENCY 0x3F9
> + #define MSR_PKG_C7_RESIDENCY 0x3FA
>
> If the kernel can also inject idle time to the system, then a
> closed-loop control system can be established that manages package
> @@ -96,19 +98,21 @@ are not masked. Tests show that the extra wakeups
> from scheduler tick
> have a dramatic impact on the effectiveness of the powerclamp driver
> on large scale systems (Westmere system with 80 processors).
>
> -CPU0
> - ____________ ____________
> -kidle_inject/0 | sleep | mwait | sleep |
> - _________| |________| |_______
> - duration
> -CPU1
> - ____________ ____________
> -kidle_inject/1 | sleep | mwait | sleep |
> - _________| |________| |_______
> - ^
> - |
> - |
> - roundup(jiffies, interval)
> +::
> +
> + CPU0
> + ____________ ____________
> + kidle_inject/0 | sleep | mwait | sleep |
> + _________| |________| |_______
> + duration
> + CPU1
> + ____________ ____________
> + kidle_inject/1 | sleep | mwait | sleep |
> + _________| |________| |_______
> + ^
> + |
> + |
> + roundup(jiffies, interval)
>
> Only one CPU is allowed to collect statistics and update global
> control parameters. This CPU is referred to as the controlling CPU
> in
> @@ -148,7 +152,7 @@ b) determine the amount of compensation needed at
> each target ratio
>
> Compensation to each target ratio consists of two parts:
>
> - a) steady state error compensation
> + a) steady state error compensation
> This is to offset the error occurring when the system can
> enter idle without extra wakeups (such as external
> interrupts).
>
> @@ -158,41 +162,42 @@ Compensation to each target ratio consists of
> two parts:
> slowing down CPU activities.
>
> A debugfs file is provided for the user to examine compensation
> -progress and results, such as on a Westmere system.
> -[jacob@nex01 ~]$ cat
> -/sys/kernel/debug/intel_powerclamp/powerclamp_calib
> -controlling cpu: 0
> -pct confidence steady dynamic (compensation)
> -0 0 0 0
> -1 1 0 0
> -2 1 1 0
> -3 3 1 0
> -4 3 1 0
> -5 3 1 0
> -6 3 1 0
> -7 3 1 0
> -8 3 1 0
> -...
> -30 3 2 0
> -31 3 2 0
> -32 3 1 0
> -33 3 2 0
> -34 3 1 0
> -35 3 2 0
> -36 3 1 0
> -37 3 2 0
> -38 3 1 0
> -39 3 2 0
> -40 3 3 0
> -41 3 1 0
> -42 3 2 0
> -43 3 1 0
> -44 3 1 0
> -45 3 2 0
> -46 3 3 0
> -47 3 0 0
> -48 3 2 0
> -49 3 3 0
> +progress and results, such as on a Westmere system::
> +
> + [jacob@nex01 ~]$ cat
> + /sys/kernel/debug/intel_powerclamp/powerclamp_calib
> + controlling cpu: 0
> + pct confidence steady dynamic (compensation)
> + 0 0 0 0
> + 1 1 0 0
> + 2 1 1 0
> + 3 3 1 0
> + 4 3 1 0
> + 5 3 1 0
> + 6 3 1 0
> + 7 3 1 0
> + 8 3 1 0
> + ...
> + 30 3 2 0
> + 31 3 2 0
> + 32 3 1 0
> + 33 3 2 0
> + 34 3 1 0
> + 35 3 2 0
> + 36 3 1 0
> + 37 3 2 0
> + 38 3 1 0
> + 39 3 2 0
> + 40 3 3 0
> + 41 3 1 0
> + 42 3 2 0
> + 43 3 1 0
> + 44 3 1 0
> + 45 3 2 0
> + 46 3 3 0
> + 47 3 0 0
> + 48 3 2 0
> + 49 3 3 0
>
> Calibration occurs during runtime. No offline method is available.
> Steady state compensation is used only when confidence levels of all
> @@ -217,9 +222,8 @@ keeps track of clamping kernel threads, even
> after they are migrated
> to other CPUs, after a CPU offline event.
>
>
> -=====================
> Performance Analysis
> -=====================
> +====================
> This section describes the general performance data collected on
> multiple systems, including Westmere (80P) and Ivy Bridge (4P, 8P).
>
> @@ -257,16 +261,15 @@ achieve up to 40% better performance per watt.
> (measured by a spin
> counter summed over per CPU counting threads spawned for all running
> CPUs).
>
> -====================
> Usage and Interfaces
> ====================
> The powerclamp driver is registered to the generic thermal layer as
> a
> -cooling device. Currently, it’s not bound to any thermal zones.
> +cooling device. Currently, it’s not bound to any thermal zones::
>
> -jacob@chromoly:/sys/class/thermal/cooling_device14$ grep . *
> -cur_state:0
> -max_state:50
> -type:intel_powerclamp
> + jacob@chromoly:/sys/class/thermal/cooling_device14$ grep . *
> + cur_state:0
> + max_state:50
> + type:intel_powerclamp
>
> cur_state allows user to set the desired idle percentage. Writing 0
> to
> cur_state will stop idle injection. Writing a value between 1 and
> @@ -278,9 +281,9 @@ cur_state returns value -1 instead of 0 which is
> to avoid confusing
> 100% busy state with the disabled state.
>
> Example usage:
> -- To inject 25% idle time
> -$ sudo sh -c "echo 25 >
> /sys/class/thermal/cooling_device80/cur_state
> -"
> +- To inject 25% idle time::
> +
> + $ sudo sh -c "echo 25 >
> /sys/class/thermal/cooling_device80/cur_state
>
> If the system is not busy and has more than 25% idle time already,
> then the powerclamp driver will not start idle injection. Using Top
> @@ -292,23 +295,23 @@ idle time is accounted as normal idle in that
> common code path is
> taken as the idle task.
>
> In this example, 24.1% idle is shown. This helps the system admin or
> -user determine the cause of slowdown, when a powerclamp driver is in
> action.
> +user determine the cause of slowdown, when a powerclamp driver is in
> action::
>
>
> -Tasks: 197 total, 1 running, 196 sleeping, 0 stopped, 0 zombie
> -Cpu(s): 71.2%us, 4.7%sy, 0.0%ni,
> 24.1%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
> -Mem: 3943228k total, 1689632k used, 2253596k free, 74960k
> buffers
> -Swap: 4087804k total, 0k used, 4087804k free, 945336k
> cached
> + Tasks: 197 total, 1 running, 196 sleeping, 0 stopped, 0
> zombie
> + Cpu(s): 71.2%us, 4.7%sy, 0.0%ni,
> 24.1%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
> + Mem: 3943228k total, 1689632k used, 2253596k free, 74960k
> buffers
> + Swap: 4087804k total, 0k used, 4087804k free, 945336k
> cached
>
> - PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
> - 3352 jacob 20 0 262m 644 428 S 286 0.0 0:17.16 spin
> - 3341 root -51 0 0 0 0 D 25 0.0 0:01.62
> kidle_inject/0
> - 3344 root -51 0 0 0 0 D 25 0.0 0:01.60
> kidle_inject/3
> - 3342 root -51 0 0 0 0 D 25 0.0 0:01.61
> kidle_inject/1
> - 3343 root -51 0 0 0 0 D 25 0.0 0:01.60
> kidle_inject/2
> - 2935 jacob 20 0 696m 125m 35m S 5 3.3 0:31.11 firefox
> - 1546 root 20 0 158m 20m 6640 S 3 0.5 0:26.97 Xorg
> - 2100 jacob 20 0 1223m 88m 30m S 3 2.3 0:23.68 compiz
> + PID USER PR NI VIRT RES SHR S %CPU
> %MEM TIME+ COMMAND
> + 3352 jacob 20 0 262m 644 428 S 286 0.0 0:17.16 spin
> + 3341 root -51 0 0 0 0 D 25 0.0 0:01.62
> kidle_inject/0
> + 3344 root -51 0 0 0 0 D 25 0.0 0:01.60
> kidle_inject/3
> + 3342 root -51 0 0 0 0 D 25 0.0 0:01.61
> kidle_inject/1
> + 3343 root -51 0 0 0 0 D 25 0.0 0:01.60
> kidle_inject/2
> + 2935 jacob 20 0 696m 125m 35m S 5 3.3 0:31.11
> firefox
> + 1546 root 20 0 158m 20m 6640 S 3 0.5 0:26.97 Xorg
> + 2100 jacob 20 0 1223m 88m 30m S 3 2.3 0:23.68
> compiz
>
> Tests have shown that by using the powerclamp driver as a cooling
> device, a PID based userspace thermal controller can manage to
> diff --git a/Documentation/thermal/nouveau_thermal
> b/Documentation/thermal/nouveau_thermal.rst
> similarity index 64%
> rename from Documentation/thermal/nouveau_thermal
> rename to Documentation/thermal/nouveau_thermal.rst
> index 6e17a11efcb0..37255fd6735d 100644
> --- a/Documentation/thermal/nouveau_thermal
> +++ b/Documentation/thermal/nouveau_thermal.rst
> @@ -1,13 +1,15 @@
> +=====================
> Kernel driver nouveau
> -===================
> +=====================
>
> Supported chips:
> +
> * NV43+
>
> Authors: Martin Peres (mupuf) <[email protected]>
>
> Description
> ----------
> +-----------
>
> This driver allows to read the GPU core temperature, drive the GPU
> fan and
> set temperature alarms.
> @@ -19,20 +21,25 @@ interface is likely not to work. This document
> may then not cover your situation
> entirely.
>
> Temperature management
> ---------------------
> +----------------------
>
> Temperature is exposed under as a read-only HWMON attribute
> temp1_input.
>
> In order to protect the GPU from overheating, Nouveau supports 4
> configurable
> temperature thresholds:
>
> - * Fan_boost: Fan speed is set to 100% when reaching this
> temperature;
> - * Downclock: The GPU will be downclocked to reduce its power
> dissipation;
> - * Critical: The GPU is put on hold to further lower power
> dissipation;
> - * Shutdown: Shut the computer down to protect your GPU.
> + * Fan_boost:
> + Fan speed is set to 100% when reaching this temperature;
> + * Downclock:
> + The GPU will be downclocked to reduce its power dissipation;
> + * Critical:
> + The GPU is put on hold to further lower power dissipation;
> + * Shutdown:
> + Shut the computer down to protect your GPU.
>
> -WARNING: Some of these thresholds may not be used by Nouveau
> depending
> -on your chipset.
> +WARNING:
> + Some of these thresholds may not be used by Nouveau
> depending
> + on your chipset.
>
> The default value for these thresholds comes from the GPU's vbios.
> These
> thresholds can be configured thanks to the following HWMON
> attributes:
> @@ -46,19 +53,24 @@ NOTE: Remember that the values are stored as
> milli degrees Celsius. Don't forget
> to multiply!
>
> Fan management
> -------------
> +--------------
>
> Not all cards have a drivable fan. If you do, then the following
> HWMON
> attributes should be available:
>
> - * pwm1_enable: Current fan management mode (NONE, MANUAL or AUTO);
> - * pwm1: Current PWM value (power percentage);
> - * pwm1_min: The minimum PWM speed allowed;
> - * pwm1_max: The maximum PWM speed allowed (bypassed when hitting
> Fan_boost);
> + * pwm1_enable:
> + Current fan management mode (NONE, MANUAL or AUTO);
> + * pwm1:
> + Current PWM value (power percentage);
> + * pwm1_min:
> + The minimum PWM speed allowed;
> + * pwm1_max:
> + The maximum PWM speed allowed (bypassed when hitting
> Fan_boost);
>
> You may also have the following attribute:
>
> - * fan1_input: Speed in RPM of your fan.
> + * fan1_input:
> + Speed in RPM of your fan.
>
> Your fan can be driven in different modes:
>
> @@ -66,14 +78,16 @@ Your fan can be driven in different modes:
> * 1: The fan can be driven in manual (use pwm1 to change the
> speed);
> * 2; The fan is driven automatically depending on the temperature.
>
> -NOTE: Be sure to use the manual mode if you want to drive the fan
> speed manually
> +NOTE:
> + Be sure to use the manual mode if you want to drive the fan speed
> manually
>
> -NOTE2: When operating in manual mode outside the vbios-defined
> -[PWM_min, PWM_max] range, the reported fan speed (RPM) may not be
> accurate
> -depending on your hardware.
> +NOTE2:
> + When operating in manual mode outside the vbios-defined
> + [PWM_min, PWM_max] range, the reported fan speed (RPM) may not be
> accurate
> + depending on your hardware.
>
> Bug reports
> ----------
> +-----------
>
> Thermal management on Nouveau is new and may not work on all cards.
> If you have
> inquiries, please ping mupuf on IRC (#nouveau, freenode).
> diff --git a/Documentation/thermal/power_allocator.txt
> b/Documentation/thermal/power_allocator.rst
> similarity index 74%
> rename from Documentation/thermal/power_allocator.txt
> rename to Documentation/thermal/power_allocator.rst
> index 9fb0ff06dca9..67b6a3297238 100644
> --- a/Documentation/thermal/power_allocator.txt
> +++ b/Documentation/thermal/power_allocator.rst
> @@ -1,3 +1,4 @@
> +=================================
> Power allocator governor tunables
> =================================
>
> @@ -25,36 +26,36 @@ temperature as the control input and power as the
> controlled output:
> P_max = k_p * e + k_i * err_integral + k_d * diff_err +
> sustainable_power
>
> where
> - e = desired_temperature - current_temperature
> - err_integral is the sum of previous errors
> - diff_err = e - previous_error
> + - e = desired_temperature - current_temperature
> + - err_integral is the sum of previous errors
> + - diff_err = e - previous_error
>
> -It is similar to the one depicted below:
> +It is similar to the one depicted below::
>
> - k_d
> - |
> -current_temp |
> - | v
> - | +----------+ +---+
> - | +----->| diff_err |-->| X |------+
> - | | +----------+ +---+ |
> - | | | tdp ac
> tor
> - | | k_i | | get_reque
> sted_power()
> - | | | | | |
> |
> - | | | | | |
> | ...
> - v | v v v v
> v
> - +---+ | +-------+ +---+ +---+ +---+ +-----
> -----+
> - | S |-------+----->| sum e |----->| X |--->| S |-->| S |
> -->|power |
> - +---+ | +-------+ +---+ +---+ +---
> + |allocation|
> - ^ | ^ +-----
> -----+
> - | | | |
> |
> - | | +---
> + | | |
> - | +------->| X |-------------------
> + v v
> - | +---+ granted
> performance
> -desired_temperature ^
> - |
> - |
> - k_po/k_pu
> + k_d
> + |
> + current_temp |
> + | v
> + | +----------+ +---+
> + | +----->| diff_err |-->| X |------+
> + | | +----------+ +---+ |
> + | | | tdp ac
> tor
> + | | k_i | | get_reque
> sted_power()
> + | | | | | |
> |
> + | | | | | |
> | ...
> + v | v v v v
> v
> + +---+ | +-------+ +---+ +---+ +---+ +-----
> -----+
> + | S |-----+----->| sum e |----->| X |--->| S |-->| S |
> -->|power |
> + +---+ | +-------+ +---+ +---+ +---
> + |allocation|
> + ^ | ^ +-----
> -----+
> + | | | |
> |
> + | | +---
> + | | |
> + | +------->| X |-------------------
> + v v
> + | +---+ granted
> performance
> + desired_temperature ^
> + |
> + |
> + k_po/k_pu
>
> Sustainable power
> -----------------
> @@ -73,7 +74,7 @@ is typically 2000mW, while on a 10" tablet is
> around 4500mW (may vary
> depending on screen size).
>
> If you are using device tree, do add it as a property of the
> -thermal-zone. For example:
> +thermal-zone. For example::
>
> thermal-zones {
> soc_thermal {
> @@ -85,7 +86,7 @@ thermal-zone. For example:
> Instead, if the thermal zone is registered from the platform code,
> pass a
> `thermal_zone_params` that has a `sustainable_power`. If no
> `thermal_zone_params` were being passed, then something like below
> -will suffice:
> +will suffice::
>
> static const struct thermal_zone_params tz_params = {
> .sustainable_power = 3500,
> @@ -112,18 +113,18 @@ available capacity at a low temperature. On
> the other hand, a high
> value of `k_pu` will result in the governor granting very high power
> while temperature is low, and may lead to temperature overshooting.
>
> -The default value for `k_pu` is:
> +The default value for `k_pu` is::
>
> 2 * sustainable_power / (desired_temperature - switch_on_temp)
>
> This means that at `switch_on_temp` the output of the controller's
> proportional term will be 2 * `sustainable_power`. The default
> value
> -for `k_po` is:
> +for `k_po` is::
>
> sustainable_power / (desired_temperature - switch_on_temp)
>
> Focusing on the proportional and feed forward values of the PID
> -controller equation we have:
> +controller equation we have::
>
> P_max = k_p * e + sustainable_power
>
> @@ -134,21 +135,23 @@ is the desired one, then the proportional
> component is zero and
> thermal equilibrium under constant load. `sustainable_power` is
> only
> an estimate, which is the reason for closed-loop control such as
> this.
>
> -Expanding `k_pu` we get:
> +Expanding `k_pu` we get::
> +
> P_max = 2 * sustainable_power * (T_set - T) / (T_set - T_on) +
> - sustainable_power
> + sustainable_power
>
> -where
> - T_set is the desired temperature
> - T is the current temperature
> - T_on is the switch on temperature
> +where:
> +
> + - T_set is the desired temperature
> + - T is the current temperature
> + - T_on is the switch on temperature
>
> When the current temperature is the switch_on temperature, the above
> -formula becomes:
> +formula becomes::
>
> P_max = 2 * sustainable_power * (T_set - T_on) / (T_set - T_on)
> +
> - sustainable_power = 2 * sustainable_power +
> sustainable_power =
> - 3 * sustainable_power
> + sustainable_power = 2 * sustainable_power +
> sustainable_power =
> + 3 * sustainable_power
>
> Therefore, the proportional term alone linearly decreases power from
> 3 * `sustainable_power` to `sustainable_power` as the temperature
> @@ -178,11 +181,18 @@ Cooling device power API
> Cooling devices controlled by this governor must supply the
> additional
> "power" API in their `cooling_device_ops`. It consists on three
> ops:
>
> -1. int get_requested_power(struct thermal_cooling_device *cdev,
> - struct thermal_zone_device *tz, u32 *power);
> -@cdev: The `struct thermal_cooling_device` pointer
> -@tz: thermal zone in which we are currently operating
> -@power: pointer in which to store the calculated power
> +1. ::
> +
> + int get_requested_power(struct thermal_cooling_device *cdev,
> + struct thermal_zone_device *tz, u32
> *power);
> +
> +
> +@cdev:
> + The `struct thermal_cooling_device` pointer
> +@tz:
> + thermal zone in which we are currently operating
> +@power:
> + pointer in which to store the calculated power
>
> `get_requested_power()` calculates the power requested by the device
> in milliwatts and stores it in @power . It should return 0 on
> @@ -190,23 +200,37 @@ success, -E* on failure. This is currently
> used by the power
> allocator governor to calculate how much power to give to each
> cooling
> device.
>
> -2. int state2power(struct thermal_cooling_device *cdev, struct
> - thermal_zone_device *tz, unsigned long state, u32 *power);
> -@cdev: The `struct thermal_cooling_device` pointer
> -@tz: thermal zone in which we are currently operating
> -@state: A cooling device state
> -@power: pointer in which to store the equivalent power
> +2. ::
> +
> + int state2power(struct thermal_cooling_device *cdev, struct
> + thermal_zone_device *tz, unsigned long
> state,
> + u32 *power);
> +
> +@cdev:
> + The `struct thermal_cooling_device` pointer
> +@tz:
> + thermal zone in which we are currently operating
> +@state:
> + A cooling device state
> +@power:
> + pointer in which to store the equivalent power
>
> Convert cooling device state @state into power consumption in
> milliwatts and store it in @power. It should return 0 on success,
> -E*
> on failure. This is currently used by thermal core to calculate the
> maximum power that an actor can consume.
>
> -3. int power2state(struct thermal_cooling_device *cdev, u32 power,
> - unsigned long *state);
> -@cdev: The `struct thermal_cooling_device` pointer
> -@power: power in milliwatts
> -@state: pointer in which to store the resulting state
> +3. ::
> +
> + int power2state(struct thermal_cooling_device *cdev, u32
> power,
> + unsigned long *state);
> +
> +@cdev:
> + The `struct thermal_cooling_device` pointer
> +@power:
> + power in milliwatts
> +@state:
> + pointer in which to store the resulting state
>
> Calculate a cooling device state that would make the device consume
> at
> most @power mW and store it in @state. It should return 0 on
> success,
> diff --git a/Documentation/thermal/sysfs-api.txt
> b/Documentation/thermal/sysfs-api.rst
> similarity index 66%
> rename from Documentation/thermal/sysfs-api.txt
> rename to Documentation/thermal/sysfs-api.rst
> index c3fa500df92c..e4930761d3e5 100644
> --- a/Documentation/thermal/sysfs-api.txt
> +++ b/Documentation/thermal/sysfs-api.rst
> @@ -1,3 +1,4 @@
> +===================================
> Generic Thermal Sysfs driver How To
> ===================================
>
> @@ -9,6 +10,7 @@ Copyright (c) 2008 Intel Corporation
>
>
> 0. Introduction
> +===============
>
> The generic thermal sysfs provides a set of interfaces for thermal
> zone
> devices (sensors) and thermal cooling devices (fan, processor...) to
> register
> @@ -25,59 +27,90 @@ An intelligent thermal management application can
> make decisions based on
> inputs from thermal zone attributes (the current temperature and
> trip point
> temperature) and throttle appropriate devices.
>
> -[0-*] denotes any positive number starting from 0
> -[1-*] denotes any positive number starting from 1
> +- `[0-*]` denotes any positive number starting from 0
> +- `[1-*]` denotes any positive number starting from 1
>
> 1. thermal sysfs driver interface functions
> +===========================================
>
> 1.1 thermal zone device interface
> -1.1.1 struct thermal_zone_device *thermal_zone_device_register(char
> *type,
> - int trips, int mask, void *devdata,
> - struct thermal_zone_device_ops *ops,
> - const struct thermal_zone_params *tzp,
> - int passive_delay, int polling_delay))
> +---------------------------------
> +
> + ::
> +
> + struct thermal_zone_device
> + *thermal_zone_device_register(char *type,
> + int trips, int mask, void
> *devdata,
> + struct thermal_zone_device_ops
> *ops,
> + const struct
> thermal_zone_params *tzp,
> + int passive_delay, int
> polling_delay))
>
> This interface function adds a new thermal zone device (sensor)
> to
> - /sys/class/thermal folder as thermal_zone[0-*]. It tries to bind
> all the
> + /sys/class/thermal folder as `thermal_zone[0-*]`. It tries to
> bind all the
> thermal cooling devices registered at the same time.
>
> - type: the thermal zone type.
> - trips: the total number of trip points this thermal zone
> supports.
> - mask: Bit string: If 'n'th bit is set, then trip point 'n' is
> writeable.
> - devdata: device private data
> - ops: thermal zone device call-backs.
> - .bind: bind the thermal zone device with a thermal cooling
> device.
> - .unbind: unbind the thermal zone device with a thermal
> cooling device.
> - .get_temp: get the current temperature of the thermal zone.
> - .set_trips: set the trip points window. Whenever the current
> temperature
> + type:
> + the thermal zone type.
> + trips:
> + the total number of trip points this thermal zone supports.
> + mask:
> + Bit string: If 'n'th bit is set, then trip point 'n' is
> writeable.
> + devdata:
> + device private data
> + ops:
> + thermal zone device call-backs.
> +
> + .bind:
> + bind the thermal zone device with a thermal cooling
> device.
> + .unbind:
> + unbind the thermal zone device with a thermal
> cooling device.
> + .get_temp:
> + get the current temperature of the thermal zone.
> + .set_trips:
> + set the trip points window. Whenever the current
> temperature
> is updated, the trip points immediately below
> and above the
> current temperature are found.
> - .get_mode: get the current mode (enabled/disabled) of the
> thermal zone.
> - - "enabled" means the kernel thermal management is
> enabled.
> - - "disabled" will prevent kernel thermal driver action
> upon trip points
> - so that user applications can take charge of thermal
> management.
> - .set_mode: set the mode (enabled/disabled) of the thermal
> zone.
> - .get_trip_type: get the type of certain trip point.
> - .get_trip_temp: get the temperature above which the certain
> trip point
> + .get_mode:
> + get the current mode (enabled/disabled) of the
> thermal zone.
> +
> + - "enabled" means the kernel thermal
> management is
> + enabled.
> + - "disabled" will prevent kernel thermal
> driver action
> + upon trip points so that user applications
> can take
> + charge of thermal management.
> + .set_mode:
> + set the mode (enabled/disabled) of the thermal zone.
> + .get_trip_type:
> + get the type of certain trip point.
> + .get_trip_temp:
> + get the temperature above which the certain
> trip point
> will be fired.
> - .set_emul_temp: set the emulation temperature which helps in
> debugging
> + .set_emul_temp:
> + set the emulation temperature which helps in
> debugging
> different threshold temperature points.
> - tzp: thermal zone platform parameters.
> - passive_delay: number of milliseconds to wait between polls when
> + tzp:
> + thermal zone platform parameters.
> + passive_delay:
> + number of milliseconds to wait between polls when
> performing passive cooling.
> - polling_delay: number of milliseconds to wait between polls when
> checking
> + polling_delay:
> + number of milliseconds to wait between polls when checking
> whether trip points have been crossed (0 for interrupt
> driven systems).
>
> + ::
>
> -1.1.2 void thermal_zone_device_unregister(struct thermal_zone_device
> *tz)
> + void thermal_zone_device_unregister(struct
> thermal_zone_device *tz)
>
> This interface function removes the thermal zone device.
> It deletes the corresponding entry from /sys/class/thermal
> folder and
> unbinds all the thermal cooling devices it uses.
>
> -1.1.3 struct thermal_zone_device *thermal_zone_of_sensor_register(
> - struct device *dev, int sensor_id, void *data,
> - const struct thermal_zone_of_device_ops *ops)
> + ::
> +
> + struct thermal_zone_device
> + *thermal_zone_of_sensor_register(struct device *dev, int
> sensor_id,
> + void *data,
> + const struct
> thermal_zone_of_device_ops *ops)
>
> This interface adds a new sensor to a DT thermal zone.
> This function will search the list of thermal zones
> described in
> @@ -87,25 +120,33 @@ temperature) and throttle appropriate devices.
> thermal zone device.
>
> The parameters for this interface are:
> - dev: Device node of sensor containing valid
> node pointer in
> +
> + dev:
> + Device node of sensor containing valid node
> pointer in
> dev->of_node.
> - sensor_id: a sensor identifier, in case the sensor IP
> has more
> + sensor_id:
> + a sensor identifier, in case the sensor IP
> has more
> than one sensors
> - data: a private pointer (owned by the caller)
> that will be
> + data:
> + a private pointer (owned by the caller) that
> will be
> passed back, when a temperature reading is
> needed.
> - ops: struct thermal_zone_of_device_ops *.
> + ops:
> + `struct thermal_zone_of_device_ops *`.
>
> - get_temp: a pointer to a function
> that reads the
> + ============== ============================
> ===========
> + get_temp a pointer to a function that
> reads the
> sensor temperature. This is
> mandatory
> callback provided by sensor
> driver.
> - set_trips: a pointer to a function that
> sets a
> + set_trips a pointer to a function
> that sets a
> temperature window. When
> this window is
> left the driver must inform
> the thermal
> core via
> thermal_zone_device_update.
> - get_trend: a pointer to a function
> that reads the
> + get_trend a pointer to a function
> that reads the
> sensor temperature trend.
> - set_emul_temp: a pointer to a
> function that sets
> + set_emul_temp a pointer to a function
> that sets
> sensor emulated temperature.
> + ============== ============================
> ===========
> +
> The thermal zone temperature is provided by the get_temp()
> function
> pointer of thermal_zone_of_device_ops. When called, it will
> have the private pointer @data back.
> @@ -114,8 +155,10 @@ temperature) and throttle appropriate devices.
> handle. Caller should check the return handle with IS_ERR()
> for finding
> whether success or not.
>
> -1.1.4 void thermal_zone_of_sensor_unregister(struct device *dev,
> - struct thermal_zone_device *tzd)
> + ::
> +
> + void thermal_zone_of_sensor_unregister(struct device
> *dev,
> + struct
> thermal_zone_device *tzd)
>
> This interface unregisters a sensor from a DT thermal zone
> which was
> successfully added by interface
> thermal_zone_of_sensor_register().
> @@ -124,21 +167,29 @@ temperature) and throttle appropriate devices.
> interface. It will also silent the zone by remove the
> .get_temp() and
> get_trend() thermal zone device callbacks.
>
> -1.1.5 struct thermal_zone_device
> *devm_thermal_zone_of_sensor_register(
> - struct device *dev, int sensor_id,
> - void *data, const struct thermal_zone_of_device_ops
> *ops)
> + ::
> +
> + struct thermal_zone_device
> + *devm_thermal_zone_of_sensor_register(struct device *dev,
> + int sensor_id,
> + void *data,
> + const struct
> thermal_zone_of_device_ops *ops)
>
> This interface is resource managed version of
> thermal_zone_of_sensor_register().
> +
> All details of thermal_zone_of_sensor_register() described
> in
> section 1.1.3 is applicable here.
> +
> The benefit of using this interface to register sensor is
> that it
> is not require to explicitly call
> thermal_zone_of_sensor_unregister()
> in error path or during driver unbinding as this is done by
> driver
> resource manager.
>
> -1.1.6 void devm_thermal_zone_of_sensor_unregister(struct device
> *dev,
> - struct thermal_zone_device *tzd)
> + ::
> +
> + void devm_thermal_zone_of_sensor_unregister(struct
> device *dev,
> + struct
> thermal_zone_device *tzd)
>
> This interface is resource managed version of
> thermal_zone_of_sensor_unregister().
> @@ -147,123 +198,186 @@ temperature) and throttle appropriate
> devices.
> Normally this function will not need to be called and the
> resource
> management code will ensure that the resource is freed.
>
> -1.1.7 int thermal_zone_get_slope(struct thermal_zone_device *tz)
> + ::
> +
> + int thermal_zone_get_slope(struct
> thermal_zone_device *tz)
>
> This interface is used to read the slope attribute value
> for the thermal zone device, which might be useful for
> platform
> drivers for temperature calculations.
>
> -1.1.8 int thermal_zone_get_offset(struct thermal_zone_device *tz)
> + ::
> +
> + int thermal_zone_get_offset(struct
> thermal_zone_device *tz)
>
> This interface is used to read the offset attribute value
> for the thermal zone device, which might be useful for
> platform
> drivers for temperature calculations.
>
> 1.2 thermal cooling device interface
> -1.2.1 struct thermal_cooling_device
> *thermal_cooling_device_register(char *name,
> - void *devdata, struct thermal_cooling_device_ops *)
> +------------------------------------
> +
> +
> + ::
> +
> + struct thermal_cooling_device
> + *thermal_cooling_device_register(char *name,
> + void *devdata, struct
> thermal_cooling_device_ops *)
>
> This interface function adds a new thermal cooling device
> (fan/processor/...)
> - to /sys/class/thermal/ folder as cooling_device[0-*]. It tries
> to bind itself
> + to /sys/class/thermal/ folder as `cooling_device[0-*]`. It tries
> to bind itself
> to all the thermal zone devices registered at the same time.
> - name: the cooling device name.
> - devdata: device private data.
> - ops: thermal cooling devices call-backs.
> - .get_max_state: get the Maximum throttle state of the
> cooling device.
> - .get_cur_state: get the Currently requested throttle state
> of the cooling device.
> - .set_cur_state: set the Current throttle state of the
> cooling device.
> -
> -1.2.2 void thermal_cooling_device_unregister(struct
> thermal_cooling_device *cdev)
> +
> + name:
> + the cooling device name.
> + devdata:
> + device private data.
> + ops:
> + thermal cooling devices call-backs.
> +
> + .get_max_state:
> + get the Maximum throttle state of the cooling
> device.
> + .get_cur_state:
> + get the Currently requested throttle state of the
> + cooling device.
> + .set_cur_state:
> + set the Current throttle state of the cooling
> device.
> +
> + ::
> +
> + void thermal_cooling_device_unregister(struct
> thermal_cooling_device *cdev)
>
> This interface function removes the thermal cooling device.
> It deletes the corresponding entry from /sys/class/thermal
> folder and
> unbinds itself from all the thermal zone devices using it.
>
> 1.3 interface for binding a thermal zone device with a thermal
> cooling device
> -1.3.1 int thermal_zone_bind_cooling_device(struct
> thermal_zone_device *tz,
> - int trip, struct thermal_cooling_device *cdev,
> - unsigned long upper, unsigned long lower, unsigned int
> weight);
> +------------------------------------------------------------------
> -----------
> +
> + ::
> +
> + int thermal_zone_bind_cooling_device(struct
> thermal_zone_device *tz,
> + int trip, struct thermal_cooling_device *cdev,
> + unsigned long upper, unsigned long lower, unsigned
> int weight);
>
> This interface function binds a thermal cooling device to a
> particular trip
> point of a thermal zone device.
> +
> This function is usually called in the thermal zone device .bind
> callback.
> - tz: the thermal zone device
> - cdev: thermal cooling device
> - trip: indicates which trip point in this thermal zone the
> cooling device
> - is associated with.
> - upper:the Maximum cooling state for this trip point.
> - THERMAL_NO_LIMIT means no upper limit,
> +
> + tz:
> + the thermal zone device
> + cdev:
> + thermal cooling device
> + trip:
> + indicates which trip point in this thermal zone the
> cooling device
> + is associated with.
> + upper:
> + the Maximum cooling state for this trip point.
> + THERMAL_NO_LIMIT means no upper limit,
> and the cooling device can be in max_state.
> - lower:the Minimum cooling state can be used for this trip point.
> - THERMAL_NO_LIMIT means no lower limit,
> + lower:
> + the Minimum cooling state can be used for this trip point.
> + THERMAL_NO_LIMIT means no lower limit,
> and the cooling device can be in cooling state 0.
> - weight: the influence of this cooling device in this thermal
> - zone. See 1.4.1 below for more information.
> + weight:
> + the influence of this cooling device in this thermal
> + zone. See 1.4.1 below for more information.
>
> -1.3.2 int thermal_zone_unbind_cooling_device(struct
> thermal_zone_device *tz,
> - int trip, struct thermal_cooling_device *cdev);
> + ::
> +
> + int thermal_zone_unbind_cooling_device(struct
> thermal_zone_device *tz,
> + int trip, struct
> thermal_cooling_device *cdev);
>
> This interface function unbinds a thermal cooling device from a
> particular
> trip point of a thermal zone device. This function is usually
> called in
> the thermal zone device .unbind callback.
> - tz: the thermal zone device
> - cdev: thermal cooling device
> - trip: indicates which trip point in this thermal zone the
> cooling device
> - is associated with.
> +
> + tz:
> + the thermal zone device
> + cdev:
> + thermal cooling device
> + trip:
> + indicates which trip point in this thermal zone the cooling
> device
> + is associated with.
>
> 1.4 Thermal Zone Parameters
> -1.4.1 struct thermal_bind_params
> +---------------------------
> +
> + ::
> +
> + struct thermal_bind_params
> +
> This structure defines the following parameters that are used to
> bind
> a zone with a cooling device for a particular trip point.
> - .cdev: The cooling device pointer
> - .weight: The 'influence' of a particular cooling device on this
> - zone. This is relative to the rest of the cooling
> - devices. For example, if all cooling devices have a
> - weight of 1, then they all contribute the same. You can
> - use percentages if you want, but it's not mandatory. A
> - weight of 0 means that this cooling device doesn't
> - contribute to the cooling of this zone unless all
> cooling
> - devices have a weight of 0. If all weights are 0, then
> - they all contribute the same.
> - .trip_mask:This is a bit mask that gives the binding relation
> between
> - this thermal zone and cdev, for a particular trip
> point.
> - If nth bit is set, then the cdev and thermal zone are
> bound
> - for trip point n.
> - .binding_limits: This is an array of cooling state limits. Must
> have
> - exactly 2 * thermal_zone.number_of_trip_points.
> It is an
> - array consisting of tuples <lower-state upper-
> state> of
> - state limits. Each trip will be associated with
> one state
> - limit tuple when binding. A NULL pointer means
> - <THERMAL_NO_LIMITS THERMAL_NO_LIMITS> on all
> trips.
> - These limits are used when binding a cdev to a
> trip point.
> - .match: This call back returns success(0) if the 'tz and cdev'
> need to
> +
> + .cdev:
> + The cooling device pointer
> + .weight:
> + The 'influence' of a particular cooling device on this
> + zone. This is relative to the rest of the cooling
> + devices. For example, if all cooling devices have a
> + weight of 1, then they all contribute the same. You can
> + use percentages if you want, but it's not mandatory. A
> + weight of 0 means that this cooling device doesn't
> + contribute to the cooling of this zone unless all
> cooling
> + devices have a weight of 0. If all weights are 0, then
> + they all contribute the same.
> + .trip_mask:
> + This is a bit mask that gives the binding relation
> between
> + this thermal zone and cdev, for a particular trip
> point.
> + If nth bit is set, then the cdev and thermal zone are
> bound
> + for trip point n.
> + .binding_limits:
> + This is an array of cooling state limits. Must
> have
> + exactly 2 * thermal_zone.number_of_trip_points.
> It is an
> + array consisting of tuples <lower-state upper-
> state> of
> + state limits. Each trip will be associated with
> one state
> + limit tuple when binding. A NULL pointer means
> + <THERMAL_NO_LIMITS THERMAL_NO_LIMITS> on all
> trips.
> + These limits are used when binding a cdev to a
> trip point.
> + .match:
> + This call back returns success(0) if the 'tz and cdev'
> need to
> be bound, as per platform data.
> -1.4.2 struct thermal_zone_params
> +
> + ::
> +
> + struct thermal_zone_params
> +
> This structure defines the platform level parameters for a
> thermal zone.
> This data, for each thermal zone should come from the platform
> layer.
> This is an optional feature where some platforms can choose not
> to
> provide this data.
> - .governor_name: Name of the thermal governor used for this zone
> - .no_hwmon: a boolean to indicate if the thermal to hwmon sysfs
> interface
> - is required. when no_hwmon == false, a hwmon sysfs
> interface
> - will be created. when no_hwmon == true, nothing will
> be done.
> - In case the thermal_zone_params is NULL, the hwmon
> interface
> - will be created (for backward compatibility).
> - .num_tbps: Number of thermal_bind_params entries for this zone
> - .tbp: thermal_bind_params entries
> +
> + .governor_name:
> + Name of the thermal governor used for this zone
> + .no_hwmon:
> + a boolean to indicate if the thermal to hwmon sysfs
> interface
> + is required. when no_hwmon == false, a hwmon sysfs
> interface
> + will be created. when no_hwmon == true, nothing will
> be done.
> + In case the thermal_zone_params is NULL, the hwmon
> interface
> + will be created (for backward compatibility).
> + .num_tbps:
> + Number of thermal_bind_params entries for this zone
> + .tbp:
> + thermal_bind_params entries
>
> 2. sysfs attributes structure
> +=============================
>
> +== ================
> RO read only value
> WO write only value
> RW read/write value
> +== ================
>
> Thermal sysfs attributes will be represented under
> /sys/class/thermal.
> Hwmon sysfs I/F extension is also available under /sys/class/hwmon
> if hwmon is compiled in or built as a module.
>
> -Thermal zone device sys I/F, created once it's registered:
> -/sys/class/thermal/thermal_zone[0-*]:
> +Thermal zone device sys I/F, created once it's registered::
> +
> + /sys/class/thermal/thermal_zone[0-*]:
> |---type: Type of the thermal zone
> |---temp: Current temperature
> |---mode: Working mode of the thermal
> zone
> @@ -282,8 +396,9 @@ Thermal zone device sys I/F, created once it's
> registered:
> |---slope: Slope constant applied as linear
> extrapolation
> |---offset: Offset constant applied as linear
> extrapolation
>
> -Thermal cooling device sys I/F, created once it's registered:
> -/sys/class/thermal/cooling_device[0-*]:
> +Thermal cooling device sys I/F, created once it's registered::
> +
> + /sys/class/thermal/cooling_device[0-*]:
> |---type: Type of the cooling
> device(processor/fan/...)
> |---max_state: Maximum cooling state of the
> cooling device
> |---cur_state: Current cooling state of the
> cooling device
> @@ -299,11 +414,13 @@ the relationship between a thermal zone and its
> associated cooling device.
> They are created/removed for each successful execution of
> thermal_zone_bind_cooling_device/thermal_zone_unbind_cooling_device.
>
> -/sys/class/thermal/thermal_zone[0-*]:
> +::
> +
> + /sys/class/thermal/thermal_zone[0-*]:
> |---cdev[0-*]: [0-*]th cooling device in current
> thermal zone
> |---cdev[0-*]_trip_point: Trip point that cdev[0-*] is
> associated with
> |---cdev[0-*]_weight: Influence of the cooling device in
> - this thermal zone
> + this thermal zone
>
> Besides the thermal zone device sysfs I/F and cooling device sysfs
> I/F,
> the generic thermal driver also creates a hwmon sysfs I/F for each
> _type_
> @@ -311,16 +428,17 @@ of thermal zone device. E.g. the generic
> thermal driver registers one hwmon
> class device and build the associated hwmon sysfs I/F for all the
> registered
> ACPI thermal zones.
>
> -/sys/class/hwmon/hwmon[0-*]:
> +::
> +
> + /sys/class/hwmon/hwmon[0-*]:
> |---name: The type of the thermal zone
> devices
> |---temp[1-*]_input: The current temperature of thermal
> zone [1-*]
> |---temp[1-*]_critical: The critical trip point of
> thermal zone [1-*]
>
> Please read Documentation/hwmon/sysfs-interface.rst for additional
> information.
>
> -***************************
> -* Thermal zone attributes *
> -***************************
> +Thermal zone attributes
> +-----------------------
>
> type
> Strings which represent the thermal zone type.
> @@ -340,54 +458,67 @@ mode
> This file gives information about the algorithm that is
> currently
> managing the thermal zone. It can be either default kernel
> based
> algorithm or user space application.
> - enabled = enable Kernel Thermal management.
> - disabled = Preventing kernel thermal zone driver
> actions upon
> +
> + enabled
> + enable Kernel Thermal management.
> + disabled
> + Preventing kernel thermal zone driver
> actions upon
> trip points so that user application can
> take full
> charge of the thermal management.
> +
> RW, Optional
>
> policy
> One of the various thermal governors used for a particular
> zone.
> +
> RW, Required
>
> available_policies
> Available thermal governors which can be used for a
> particular zone.
> +
> RO, Required
>
> -trip_point_[0-*]_temp
> +`trip_point_[0-*]_temp`
> The temperature above which trip point will be fired.
> +
> Unit: millidegree Celsius
> +
> RO, Optional
>
> -trip_point_[0-*]_type
> +`trip_point_[0-*]_type`
> Strings which indicate the type of the trip point.
> - E.g. it can be one of critical, hot, passive, active[0-*]
> for ACPI
> +
> + E.g. it can be one of critical, hot, passive, `active[0-*]`
> for ACPI
> thermal zone.
> +
> RO, Optional
>
> -trip_point_[0-*]_hyst
> +`trip_point_[0-*]_hyst`
> The hysteresis value for a trip point, represented as an
> integer
> Unit: Celsius
> RW, Optional
>
> -cdev[0-*]
> +`cdev[0-*]`
> Sysfs link to the thermal cooling device node where the sys
> I/F
> for cooling device throttling control represents.
> +
> RO, Optional
>
> -cdev[0-*]_trip_point
> - The trip point in this thermal zone which cdev[0-*] is
> associated
> +`cdev[0-*]_trip_point`
> + The trip point in this thermal zone which `cdev[0-*]` is
> associated
> with; -1 means the cooling device is not associated with any
> trip
> point.
> +
> RO, Optional
>
> -cdev[0-*]_weight
> - The influence of cdev[0-*] in this thermal zone. This value
> - is relative to the rest of cooling devices in the thermal
> - zone. For example, if a cooling device has a weight double
> - than that of other, it's twice as effective in cooling the
> - thermal zone.
> - RW, Optional
> +`cdev[0-*]_weight`
> + The influence of `cdev[0-*]` in this thermal zone. This
> value
> + is relative to the rest of cooling devices in the thermal
> + zone. For example, if a cooling device has a weight double
> + than that of other, it's twice as effective in cooling the
> + thermal zone.
> +
> + RW, Optional
>
> passive
> Attribute is only present for zones in which the passive
> cooling
> @@ -395,8 +526,11 @@ passive
> and can be set to a temperature (in millidegrees) to enable
> a
> passive trip point for the zone. Activation is done by
> polling with
> an interval of 1 second.
> +
> Unit: millidegrees Celsius
> +
> Valid values: 0 (disabled) or greater than 1000
> +
> RW, Optional
>
> emul_temp
> @@ -407,17 +541,21 @@ emul_temp
> threshold and its associated cooling action. This is write
> only node
> and writing 0 on this node should disable emulation.
> Unit: millidegree Celsius
> +
> WO, Optional
>
> - WARNING: Be careful while enabling this option on
> production systems,
> - because userland can easily disable the thermal policy by
> simply
> - flooding this sysfs node with low temperature values.
> + WARNING:
> + Be careful while enabling this option on production
> systems,
> + because userland can easily disable the thermal policy
> by simply
> + flooding this sysfs node with low temperature values.
>
> sustainable_power
> An estimate of the sustained power that can be dissipated by
> the thermal zone. Used by the power allocator governor. For
> - more information see
> Documentation/thermal/power_allocator.txt
> + more information see
> Documentation/thermal/power_allocator.rst
> +
> Unit: milliwatts
> +
> RW, Optional
>
> k_po
> @@ -425,7 +563,8 @@ k_po
> controller during temperature overshoot. Temperature
> overshoot
> is when the current temperature is above the "desired
> temperature" trip point. For more information see
> - Documentation/thermal/power_allocator.txt
> + Documentation/thermal/power_allocator.rst
> +
> RW, Optional
>
> k_pu
> @@ -433,20 +572,23 @@ k_pu
> controller during temperature undershoot. Temperature
> undershoot
> is when the current temperature is below the "desired
> temperature" trip point. For more information see
> - Documentation/thermal/power_allocator.txt
> + Documentation/thermal/power_allocator.rst
> +
> RW, Optional
>
> k_i
> The integral term of the power allocator governor's PID
> controller. This term allows the PID controller to
> compensate
> for long term drift. For more information see
> - Documentation/thermal/power_allocator.txt
> + Documentation/thermal/power_allocator.rst
> +
> RW, Optional
>
> k_d
> The derivative term of the power allocator governor's PID
> controller. For more information see
> - Documentation/thermal/power_allocator.txt
> + Documentation/thermal/power_allocator.rst
> +
> RW, Optional
>
> integral_cutoff
> @@ -456,8 +598,10 @@ integral_cutoff
> example, if integral_cutoff is 0, then the integral term
> only
> accumulates error when temperature is above the desired
> temperature trip point. For more information see
> - Documentation/thermal/power_allocator.txt
> + Documentation/thermal/power_allocator.rst
> +
> Unit: millidegree Celsius
> +
> RW, Optional
>
> slope
> @@ -465,6 +609,7 @@ slope
> to determine a hotspot temperature based off the sensor's
> raw readings. It is up to the device driver to determine
> the usage of these values.
> +
> RW, Optional
>
> offset
> @@ -472,28 +617,33 @@ offset
> to determine a hotspot temperature based off the sensor's
> raw readings. It is up to the device driver to determine
> the usage of these values.
> +
> RW, Optional
>
> -*****************************
> -* Cooling device attributes *
> -*****************************
> +Cooling device attributes
> +-------------------------
>
> type
> String which represents the type of device, e.g:
> +
> - for generic ACPI: should be "Fan", "Processor" or "LCD"
> - for memory controller device on intel_menlow platform:
> should be "Memory controller".
> +
> RO, Required
>
> max_state
> The maximum permissible cooling state of this cooling
> device.
> +
> RO, Required
>
> cur_state
> The current cooling state of this cooling device.
> The value can any integer numbers between 0 and max_state:
> +
> - cur_state == 0 means no cooling
> - cur_state == max_state means the maximum cooling.
> +
> RW, Required
>
> stats/reset
> @@ -508,9 +658,11 @@ stats/time_in_state_ms:
> units here is 10mS (similar to other time exported in
> /proc).
> RO, Required
>
> +
> stats/total_trans:
> A single positive value showing the total number of times
> the state of a
> cooling device is changed.
> +
> RO, Required
>
> stats/trans_table:
> @@ -522,6 +674,7 @@ stats/trans_table:
> RO, Required
>
> 3. A simple implementation
> +==========================
>
> ACPI thermal zone may support multiple trip points like critical,
> hot,
> passive, active. If an ACPI thermal zone supports critical, passive,
> @@ -532,11 +685,10 @@ thermal_cooling_device. Both are considered to
> have the same
> effectiveness in cooling the thermal zone.
>
> If the processor is listed in _PSL method, and the fan is listed in
> _AL0
> -method, the sys I/F structure will be built like this:
> +method, the sys I/F structure will be built like this::
>
> -/sys/class/thermal:
> -
> -|thermal_zone1:
> + /sys/class/thermal:
> + |thermal_zone1:
> |---type: acpitz
> |---temp: 37000
> |---mode: enabled
> @@ -557,24 +709,24 @@ method, the sys I/F structure will be built
> like this:
> |---cdev1_trip_point: 2 /* cdev1 can be used for
> active[0]*/
> |---cdev1_weight: 1024
>
> -|cooling_device0:
> + |cooling_device0:
> |---type: Processor
> |---max_state: 8
> |---cur_state: 0
>
> -|cooling_device3:
> + |cooling_device3:
> |---type: Fan
> |---max_state: 2
> |---cur_state: 0
>
> -/sys/class/hwmon:
> -
> -|hwmon0:
> + /sys/class/hwmon:
> + |hwmon0:
> |---name: acpitz
> |---temp1_input: 37000
> |---temp1_crit: 100000
>
> 4. Event Notification
> +=====================
>
> The framework includes a simple notification mechanism, in the form
> of a
> netlink event. Netlink socket initialization is done during the
> _init_
> @@ -587,21 +739,28 @@ event will be one of:{THERMAL_AUX0,
> THERMAL_AUX1, THERMAL_CRITICAL,
> THERMAL_DEV_FAULT}. Notification can be sent when the current
> temperature
> crosses any of the configured thresholds.
>
> -5. Export Symbol APIs:
> +5. Export Symbol APIs
> +=====================
> +
> +5.1. get_tz_trend
> +-----------------
>
> -5.1: get_tz_trend:
> This function returns the trend of a thermal zone, i.e the rate of
> change
> of temperature of the thermal zone. Ideally, the thermal sensor
> drivers
> are supposed to implement the callback. If they don't, the thermal
> framework calculated the trend by comparing the previous and the
> current
> temperature values.
>
> -5.2:get_thermal_instance:
> +5.2. get_thermal_instance
> +-------------------------
> +
> This function returns the thermal_instance corresponding to a given
> {thermal_zone, cooling_device, trip_point} combination. Returns NULL
> if such an instance does not exist.
>
> -5.3:thermal_notify_framework:
> +5.3. thermal_notify_framework
> +-----------------------------
> +
> This function handles the trip events from sensor drivers. It starts
> throttling the cooling devices according to the policy configured.
> For CRITICAL and HOT trip points, this notifies the respective
> drivers,
> @@ -609,12 +768,15 @@ and does actual throttling for other trip
> points i.e ACTIVE and PASSIVE.
> The throttling policy is based on the configured platform data; if
> no
> platform data is provided, this uses the step_wise throttling
> policy.
>
> -5.4:thermal_cdev_update:
> +5.4. thermal_cdev_update
> +------------------------
> +
> This function serves as an arbitrator to set the state of a cooling
> device. It sets the cooling device to the deepest cooling state if
> possible.
>
> -6. thermal_emergency_poweroff:
> +6. thermal_emergency_poweroff
> +=============================
>
> On an event of critical trip temperature crossing. Thermal framework
> allows the system to shutdown gracefully by calling
> orderly_poweroff().
> diff --git a/Documentation/thermal/x86_pkg_temperature_thermal
> b/Documentation/thermal/x86_pkg_temperature_thermal.rst
> similarity index 80%
> rename from Documentation/thermal/x86_pkg_temperature_thermal
> rename to Documentation/thermal/x86_pkg_temperature_thermal.rst
> index 17a3a4c0a0ca..f134dbd3f5a9 100644
> --- a/Documentation/thermal/x86_pkg_temperature_thermal
> +++ b/Documentation/thermal/x86_pkg_temperature_thermal.rst
> @@ -1,19 +1,23 @@
> +===================================
> Kernel driver: x86_pkg_temp_thermal
> -===================
> +===================================
>
> Supported chips:
> +
> * x86: with package level thermal management
> +
> (Verify using: CPUID.06H:EAX[bit 6] =1)
>
> Authors: Srinivas Pandruvada <[email protected]>
>
> Reference
> ----
> +---------
> +
> Intel® 64 and IA-32 Architectures Software Developer’s Manual (Jan,
> 2013):
> Chapter 14.6: PACKAGE LEVEL THERMAL MANAGEMENT
>
> Description
> ----------
> +-----------
>
> This driver register CPU digital temperature package level sensor as
> a thermal
> zone with maximum two user mode configurable trip points. Number of
> trip points
> @@ -25,23 +29,27 @@ take any action to control temperature.
> Threshold management
> --------------------
> Each package will register as a thermal zone under
> /sys/class/thermal.
> -Example:
> -/sys/class/thermal/thermal_zone1
> +
> +Example::
> +
> + /sys/class/thermal/thermal_zone1
>
> This contains two trip points:
> +
> - trip_point_0_temp
> - trip_point_1_temp
>
> User can set any temperature between 0 to TJ-Max temperature.
> Temperature units
> -are in milli-degree Celsius. Refer to "Documentation/thermal/sysfs-
> api.txt" for
> +are in milli-degree Celsius. Refer to "Documentation/thermal/sysfs-
> api.rst" for
> thermal sys-fs details.
>
> Any value other than 0 in these trip points, can trigger thermal
> notifications.
> Setting 0, stops sending thermal notifications.
>
> -Thermal notifications: To get kobject-uevent notifications, set the
> thermal zone
> -policy to "user_space". For example: echo -n "user_space" > policy
> -
> -
> +Thermal notifications:
> +To get kobject-uevent notifications, set the thermal zone
> +policy to "user_space".
>
> +For example::
>
> + echo -n "user_space" > policy
> diff --git a/MAINTAINERS b/MAINTAINERS
> index d9e214f68e52..b2254bc8e495 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -15687,7 +15687,7 @@ M: Viresh Kumar <[email protected]
> rg>
> M: Javi Merino <[email protected]>
> L: [email protected]
> S: Supported
> -F: Documentation/thermal/cpu-cooling-api.txt
> +F: Documentation/thermal/cpu-cooling-api.rst
> F: drivers/thermal/cpu_cooling.c
> F: include/linux/cpu_cooling.h
>
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index 15a4ca5d7099..681047f8cc05 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -251,7 +251,7 @@ struct thermal_bind_params {
> * platform characterization. This value is relative to the
> * rest of the weights so a cooling device whose weight is
> * double that of another cooling device is twice as
> - * effective. See Documentation/thermal/sysfs-api.txt for
> more
> + * effective. See Documentation/thermal/sysfs-api.rst for
> more
> * information.
> */
> int weight;
> @@ -259,7 +259,7 @@ struct thermal_bind_params {
> /*
> * This is a bit mask that gives the binding relation
> between this
> * thermal zone and cdev, for a particular trip point.
> - * See Documentation/thermal/sysfs-api.txt for more
> information.
> + * See Documentation/thermal/sysfs-api.rst for more
> information.
> */
> int trip_mask;
>
Em Tue, 25 Jun 2019 21:40:11 +0800
Zhang Rui <[email protected]> escreveu:
> On 二, 2019-06-18 at 18:05 -0300, Mauro Carvalho Chehab wrote:
> > Rename the thermal documentation files to ReST, add an
> > index for them and adjust in order to produce a nice html
> > output via the Sphinx build system.
> >
> > At its new index.rst, let's add a :orphan: while this is not linked
> > to
> > the main index.rst file, in order to avoid build warnings.
> >
> > Signed-off-by: Mauro Carvalho Chehab <[email protected]>
>
> Acked-by: Zhang Rui <[email protected]>
>
> should I apply this patch or you have a separate tree for all these
> changes?
Feel free to apply it directly to your tree. The patches on this
series are pretty much independent.
>
> thanks,
> rui
> > ---
> > ...pu-cooling-api.txt => cpu-cooling-api.rst} | 39 +-
> > .../{exynos_thermal => exynos_thermal.rst} | 47 +-
> > ...emulation => exynos_thermal_emulation.rst} | 66 +--
> > Documentation/thermal/index.rst | 18 +
> > ...el_powerclamp.txt => intel_powerclamp.rst} | 177 +++----
> > .../{nouveau_thermal => nouveau_thermal.rst} | 54 +-
> > ...ower_allocator.txt => power_allocator.rst} | 140 ++---
> > .../thermal/{sysfs-api.txt => sysfs-api.rst} | 490 ++++++++++++--
> > ----
> > ...hermal => x86_pkg_temperature_thermal.rst} | 28 +-
> > MAINTAINERS | 2 +-
> > include/linux/thermal.h | 4 +-
> > 11 files changed, 665 insertions(+), 400 deletions(-)
> > rename Documentation/thermal/{cpu-cooling-api.txt => cpu-cooling-
> > api.rst} (82%)
> > rename Documentation/thermal/{exynos_thermal => exynos_thermal.rst}
> > (67%)
> > rename Documentation/thermal/{exynos_thermal_emulation =>
> > exynos_thermal_emulation.rst} (36%)
> > create mode 100644 Documentation/thermal/index.rst
> > rename Documentation/thermal/{intel_powerclamp.txt =>
> > intel_powerclamp.rst} (76%)
> > rename Documentation/thermal/{nouveau_thermal =>
> > nouveau_thermal.rst} (64%)
> > rename Documentation/thermal/{power_allocator.txt =>
> > power_allocator.rst} (74%)
> > rename Documentation/thermal/{sysfs-api.txt => sysfs-api.rst} (66%)
> > rename Documentation/thermal/{x86_pkg_temperature_thermal =>
> > x86_pkg_temperature_thermal.rst} (80%)
> >
> > diff --git a/Documentation/thermal/cpu-cooling-api.txt
> > b/Documentation/thermal/cpu-cooling-api.rst
> > similarity index 82%
> > rename from Documentation/thermal/cpu-cooling-api.txt
> > rename to Documentation/thermal/cpu-cooling-api.rst
> > index 7df567eaea1a..645d914c45a6 100644
> > --- a/Documentation/thermal/cpu-cooling-api.txt
> > +++ b/Documentation/thermal/cpu-cooling-api.rst
> > @@ -1,5 +1,6 @@
> > +=======================
> > CPU cooling APIs How To
> > -===================================
> > +=======================
> >
> > Written by Amit Daniel Kachhap <[email protected]>
> >
> > @@ -8,40 +9,54 @@ Updated: 6 Jan 2015
> > Copyright (c) 2012 Samsung Electronics Co., Ltd(http://www.samsung.
> > com)
> >
> > 0. Introduction
> > +===============
> >
> > The generic cpu cooling(freq clipping) provides
> > registration/unregistration APIs
> > to the caller. The binding of the cooling devices to the trip point
> > is left for
> > the user. The registration APIs returns the cooling device pointer.
> >
> > 1. cpu cooling APIs
> > +===================
> >
> > 1.1 cpufreq registration/unregistration APIs
> > -1.1.1 struct thermal_cooling_device *cpufreq_cooling_register(
> > - struct cpumask *clip_cpus)
> > +--------------------------------------------
> > +
> > + ::
> > +
> > + struct thermal_cooling_device
> > + *cpufreq_cooling_register(struct cpumask *clip_cpus)
> >
> > This interface function registers the cpufreq cooling device
> > with the name
> > "thermal-cpufreq-%x". This api can support multiple instances of
> > cpufreq
> > cooling devices.
> >
> > - clip_cpus: cpumask of cpus where the frequency constraints will
> > happen.
> > + clip_cpus:
> > + cpumask of cpus where the frequency constraints will happen.
> >
> > -1.1.2 struct thermal_cooling_device *of_cpufreq_cooling_register(
> > - struct cpufreq_policy
> > *policy)
> > + ::
> > +
> > + struct thermal_cooling_device
> > + *of_cpufreq_cooling_register(struct cpufreq_policy *policy)
> >
> > This interface function registers the cpufreq cooling device
> > with
> > the name "thermal-cpufreq-%x" linking it with a device tree
> > node, in
> > order to bind it via the thermal DT code. This api can support
> > multiple
> > instances of cpufreq cooling devices.
> >
> > - policy: CPUFreq policy.
> > + policy:
> > + CPUFreq policy.
> >
> > -1.1.3 void cpufreq_cooling_unregister(struct thermal_cooling_device
> > *cdev)
> > +
> > + ::
> > +
> > + void cpufreq_cooling_unregister(struct
> > thermal_cooling_device *cdev)
> >
> > This interface function unregisters the "thermal-cpufreq-%x"
> > cooling device.
> >
> > cdev: Cooling device pointer which has to be unregistered.
> >
> > 2. Power models
> > +===============
> >
> > The power API registration functions provide a simple power model
> > for
> > CPUs. The current power is calculated as dynamic power (static
> > power isn't
> > @@ -65,9 +80,9 @@ For a given processor implementation the primary
> > factors are:
> > variation. In pathological cases this variation can be
> > significant,
> > but typically it is of a much lesser impact than the factors
> > above.
> >
> > -A high level dynamic power consumption model may then be represented
> > as:
> > +A high level dynamic power consumption model may then be represented
> > as::
> >
> > -Pdyn = f(run) * Voltage^2 * Frequency * Utilisation
> > + Pdyn = f(run) * Voltage^2 * Frequency * Utilisation
> >
> > f(run) here represents the described execution behaviour and its
> > result has a units of Watts/Hz/Volt^2 (this often expressed in
> > @@ -80,9 +95,9 @@ factors. Therefore, in initial implementation that
> > contribution is
> > represented as a constant coefficient. This is a simplification
> > consistent with the relative contribution to overall power
> > variation.
> >
> > -In this simplified representation our model becomes:
> > +In this simplified representation our model becomes::
> >
> > -Pdyn = Capacitance * Voltage^2 * Frequency * Utilisation
> > + Pdyn = Capacitance * Voltage^2 * Frequency * Utilisation
> >
> > Where `capacitance` is a constant that represents an indicative
> > running time dynamic power coefficient in fundamental units of
> > diff --git a/Documentation/thermal/exynos_thermal
> > b/Documentation/thermal/exynos_thermal.rst
> > similarity index 67%
> > rename from Documentation/thermal/exynos_thermal
> > rename to Documentation/thermal/exynos_thermal.rst
> > index 9010c4416967..5bd556566c70 100644
> > --- a/Documentation/thermal/exynos_thermal
> > +++ b/Documentation/thermal/exynos_thermal.rst
> > @@ -1,8 +1,11 @@
> > +========================
> > Kernel driver exynos_tmu
> > -=================
> > +========================
> >
> > Supported chips:
> > +
> > * ARM SAMSUNG EXYNOS4, EXYNOS5 series of SoC
> > +
> > Datasheet: Not publicly available
> >
> > Authors: Donggeun Kim <[email protected]>
> > @@ -19,32 +22,39 @@ Temperature can be taken from the temperature
> > code.
> > There are three equations converting from temperature to temperature
> > code.
> >
> > The three equations are:
> > - 1. Two point trimming
> > + 1. Two point trimming::
> > +
> > Tc = (T - 25) * (TI2 - TI1) / (85 - 25) + TI1
> >
> > - 2. One point trimming
> > + 2. One point trimming::
> > +
> > Tc = T + TI1 - 25
> >
> > - 3. No trimming
> > + 3. No trimming::
> > +
> > Tc = T + 50
> >
> > - Tc: Temperature code, T: Temperature,
> > - TI1: Trimming info for 25 degree Celsius (stored at TRIMINFO
> > register)
> > + Tc:
> > + Temperature code, T: Temperature,
> > + TI1:
> > + Trimming info for 25 degree Celsius (stored at TRIMINFO
> > register)
> > Temperature code measured at 25 degree Celsius which is
> > unchanged
> > - TI2: Trimming info for 85 degree Celsius (stored at TRIMINFO
> > register)
> > + TI2:
> > + Trimming info for 85 degree Celsius (stored at TRIMINFO
> > register)
> > Temperature code measured at 85 degree Celsius which is
> > unchanged
> >
> > TMU(Thermal Management Unit) in EXYNOS4/5 generates interrupt
> > when temperature exceeds pre-defined levels.
> > The maximum number of configurable threshold is five.
> > -The threshold levels are defined as follows:
> > +The threshold levels are defined as follows::
> > +
> > Level_0: current temperature > trigger_level_0 + threshold
> > Level_1: current temperature > trigger_level_1 + threshold
> > Level_2: current temperature > trigger_level_2 + threshold
> > Level_3: current temperature > trigger_level_3 + threshold
> >
> > - The threshold and each trigger_level are set
> > - through the corresponding registers.
> > +The threshold and each trigger_level are set
> > +through the corresponding registers.
> >
> > When an interrupt occurs, this driver notify kernel thermal
> > framework
> > with the function exynos_report_trigger.
> > @@ -54,24 +64,27 @@ it can be used to synchronize the cooling action.
> > TMU driver description:
> > -----------------------
> >
> > -The exynos thermal driver is structured as,
> > +The exynos thermal driver is structured as::
> >
> > Kernel Core thermal
> > framework
> > (thermal_core.c, step_wise.c,
> > cpu_cooling.c)
> > ^
> > |
> > |
> > -TMU configuration data -------> TMU Driver <------> Exynos Core
> > thermal wrapper
> > -(exynos_tmu_data.c) (exynos_tmu.c) (exynos_th
> > ermal_common.c)
> > -(exynos_tmu_data.h) (exynos_tmu.h) (exynos_th
> > ermal_common.h)
> > + TMU configuration data -----> TMU Driver <----> Exynos Core
> > thermal wrapper
> > + (exynos_tmu_data.c) (exynos_tmu.c) (exynos_
> > thermal_common.c)
> > + (exynos_tmu_data.h) (exynos_tmu.h) (exynos_
> > thermal_common.h)
> >
> > -a) TMU configuration data: This consist of TMU register
> > offsets/bitfields
> > +a) TMU configuration data:
> > + This consist of TMU register offsets/bitfields
> > described through structure exynos_tmu_registers.
> > Also several
> > other platform data (struct
> > exynos_tmu_platform_data) members
> > are used to configure the TMU.
> > -b) TMU driver: This component initialises the TMU controller and
> > sets different
> > +b) TMU driver:
> > + This component initialises the TMU controller and
> > sets different
> > thresholds. It invokes core thermal implementation
> > with the call
> > exynos_report_trigger.
> > -c) Exynos Core thermal wrapper: This provides 3 wrapper function to
> > use the
> > +c) Exynos Core thermal wrapper:
> > + This provides 3 wrapper function to use the
> > Kernel core thermal framework. They are
> > exynos_unregister_thermal,
> > exynos_register_thermal and exynos_report_trigger.
> > diff --git a/Documentation/thermal/exynos_thermal_emulation
> > b/Documentation/thermal/exynos_thermal_emulation.rst
> > similarity index 36%
> > rename from Documentation/thermal/exynos_thermal_emulation
> > rename to Documentation/thermal/exynos_thermal_emulation.rst
> > index b15efec6ca28..c21d10838bc5 100644
> > --- a/Documentation/thermal/exynos_thermal_emulation
> > +++ b/Documentation/thermal/exynos_thermal_emulation.rst
> > @@ -1,5 +1,6 @@
> > -EXYNOS EMULATION MODE
> > -========================
> > +=====================
> > +Exynos Emulation Mode
> > +=====================
> >
> > Copyright (C) 2012 Samsung Electronics
> >
> > @@ -8,46 +9,53 @@ Written by Jonghwa Lee <[email protected]>
> > Description
> > -----------
> >
> > -Exynos 4x12 (4212, 4412) and 5 series provide emulation mode for
> > thermal management unit.
> > -Thermal emulation mode supports software debug for TMU's operation.
> > User can set temperature
> > -manually with software code and TMU will read current temperature
> > from user value not from
> > -sensor's value.
> > +Exynos 4x12 (4212, 4412) and 5 series provide emulation mode for
> > thermal
> > +management unit. Thermal emulation mode supports software debug for
> > +TMU's operation. User can set temperature manually with software
> > code
> > +and TMU will read current temperature from user value not from
> > sensor's
> > +value.
> >
> > -Enabling CONFIG_THERMAL_EMULATION option will make this support
> > available.
> > -When it's enabled, sysfs node will be created as
> > +Enabling CONFIG_THERMAL_EMULATION option will make this support
> > +available. When it's enabled, sysfs node will be created as
> > /sys/devices/virtual/thermal/thermal_zone'zone id'/emul_temp.
> >
> > -The sysfs node, 'emul_node', will contain value 0 for the initial
> > state. When you input any
> > -temperature you want to update to sysfs node, it automatically
> > enable emulation mode and
> > -current temperature will be changed into it.
> > -(Exynos also supports user changeable delay time which would be used
> > to delay of
> > - changing temperature. However, this node only uses same delay of
> > real sensing time, 938us.)
> > +The sysfs node, 'emul_node', will contain value 0 for the initial
> > state.
> > +When you input any temperature you want to update to sysfs node, it
> > +automatically enable emulation mode and current temperature will be
> > +changed into it.
> >
> > -Exynos emulation mode requires synchronous of value changing and
> > enabling. It means when you
> > -want to update the any value of delay or next temperature, then you
> > have to enable emulation
> > -mode at the same time. (Or you have to keep the mode enabling.) If
> > you don't, it fails to
> > -change the value to updated one and just use last succeessful value
> > repeatedly. That's why
> > -this node gives users the right to change termerpature only. Just
> > one interface makes it more
> > -simply to use.
> > +(Exynos also supports user changeable delay time which would be used
> > to
> > +delay of changing temperature. However, this node only uses same
> > delay
> > +of real sensing time, 938us.)
> > +
> > +Exynos emulation mode requires synchronous of value changing and
> > +enabling. It means when you want to update the any value of delay or
> > +next temperature, then you have to enable emulation mode at the same
> > +time. (Or you have to keep the mode enabling.) If you don't, it
> > fails to
> > +change the value to updated one and just use last succeessful value
> > +repeatedly. That's why this node gives users the right to change
> > +termerpature only. Just one interface makes it more simply to use.
> >
> > Disabling emulation mode only requires writing value 0 to sysfs
> > node.
> >
> > +::
> >
> > -TEMP 120 |
> > +
> > + TEMP 120 |
> > |
> > 100 |
> > |
> > 80 |
> > - | +-----------
> > - 60 | | |
> > - | +-------------| |
> > + | +-----------
> > + 60 | | |
> > + | +-------------| |
> > 40 | | | |
> > - | | | |
> > - 20 | | | +-
> > ---------
> > - | | | |
> > |
> > + | | | |
> > + 20 | | | +----
> > ------
> > + | | | |
> > |
> > 0
> > |______________|_____________|__________|__________|_________
> > - A A A
> > A TIME
> > + A A A
> > A TIME
> > |<----->| |<----->| |<----->|
> > |
> > | 938us | | | | |
> > |
> > -emulation : 0 50 | 70 | 20 |
> > 0
> > -current temp : sensor 50 70 20
> > sensor
> > + emulation : 0 50 | 70 | 20 |
> > 0
> > + current temp: sensor 50 70 20
> > sensor
> > diff --git a/Documentation/thermal/index.rst
> > b/Documentation/thermal/index.rst
> > new file mode 100644
> > index 000000000000..8c1c00146cad
> > --- /dev/null
> > +++ b/Documentation/thermal/index.rst
> > @@ -0,0 +1,18 @@
> > +:orphan:
> > +
> > +=======
> > +Thermal
> > +=======
> > +
> > +.. toctree::
> > + :maxdepth: 1
> > +
> > + cpu-cooling-api
> > + sysfs-api
> > + power_allocator
> > +
> > + exynos_thermal
> > + exynos_thermal_emulation
> > + intel_powerclamp
> > + nouveau_thermal
> > + x86_pkg_temperature_thermal
> > diff --git a/Documentation/thermal/intel_powerclamp.txt
> > b/Documentation/thermal/intel_powerclamp.rst
> > similarity index 76%
> > rename from Documentation/thermal/intel_powerclamp.txt
> > rename to Documentation/thermal/intel_powerclamp.rst
> > index b5df21168fbc..3f6dfb0b3ea6 100644
> > --- a/Documentation/thermal/intel_powerclamp.txt
> > +++ b/Documentation/thermal/intel_powerclamp.rst
> > @@ -1,10 +1,13 @@
> > - =======================
> > - INTEL POWERCLAMP DRIVER
> > - =======================
> > -By: Arjan van de Ven <[email protected]>
> > - Jacob Pan <[email protected]>
> > +=======================
> > +Intel Powerclamp Driver
> > +=======================
> > +
> > +By:
> > + - Arjan van de Ven <[email protected]>
> > + - Jacob Pan <[email protected]>
> > +
> > +.. Contents:
> >
> > -Contents:
> > (*) Introduction
> > - Goals and Objectives
> >
> > @@ -23,7 +26,6 @@ Contents:
> > - Generic Thermal Layer (sysfs)
> > - Kernel APIs (TBD)
> >
> > -============
> > INTRODUCTION
> > ============
> >
> > @@ -47,7 +49,6 @@ scalability, and user experience. In many cases,
> > clear advantage is
> > shown over taking the CPU offline or modulating the CPU clock.
> >
> >
> > -===================
> > THEORY OF OPERATION
> > ===================
> >
> > @@ -57,11 +58,12 @@ Idle Injection
> > On modern Intel processors (Nehalem or later), package level C-state
> > residency is available in MSRs, thus also available to the kernel.
> >
> > -These MSRs are:
> > - #define MSR_PKG_C2_RESIDENCY 0x60D
> > - #define MSR_PKG_C3_RESIDENCY 0x3F8
> > - #define MSR_PKG_C6_RESIDENCY 0x3F9
> > - #define MSR_PKG_C7_RESIDENCY 0x3FA
> > +These MSRs are::
> > +
> > + #define MSR_PKG_C2_RESIDENCY 0x60D
> > + #define MSR_PKG_C3_RESIDENCY 0x3F8
> > + #define MSR_PKG_C6_RESIDENCY 0x3F9
> > + #define MSR_PKG_C7_RESIDENCY 0x3FA
> >
> > If the kernel can also inject idle time to the system, then a
> > closed-loop control system can be established that manages package
> > @@ -96,19 +98,21 @@ are not masked. Tests show that the extra wakeups
> > from scheduler tick
> > have a dramatic impact on the effectiveness of the powerclamp driver
> > on large scale systems (Westmere system with 80 processors).
> >
> > -CPU0
> > - ____________ ____________
> > -kidle_inject/0 | sleep | mwait | sleep |
> > - _________| |________| |_______
> > - duration
> > -CPU1
> > - ____________ ____________
> > -kidle_inject/1 | sleep | mwait | sleep |
> > - _________| |________| |_______
> > - ^
> > - |
> > - |
> > - roundup(jiffies, interval)
> > +::
> > +
> > + CPU0
> > + ____________ ____________
> > + kidle_inject/0 | sleep | mwait | sleep |
> > + _________| |________| |_______
> > + duration
> > + CPU1
> > + ____________ ____________
> > + kidle_inject/1 | sleep | mwait | sleep |
> > + _________| |________| |_______
> > + ^
> > + |
> > + |
> > + roundup(jiffies, interval)
> >
> > Only one CPU is allowed to collect statistics and update global
> > control parameters. This CPU is referred to as the controlling CPU
> > in
> > @@ -148,7 +152,7 @@ b) determine the amount of compensation needed at
> > each target ratio
> >
> > Compensation to each target ratio consists of two parts:
> >
> > - a) steady state error compensation
> > + a) steady state error compensation
> > This is to offset the error occurring when the system can
> > enter idle without extra wakeups (such as external
> > interrupts).
> >
> > @@ -158,41 +162,42 @@ Compensation to each target ratio consists of
> > two parts:
> > slowing down CPU activities.
> >
> > A debugfs file is provided for the user to examine compensation
> > -progress and results, such as on a Westmere system.
> > -[jacob@nex01 ~]$ cat
> > -/sys/kernel/debug/intel_powerclamp/powerclamp_calib
> > -controlling cpu: 0
> > -pct confidence steady dynamic (compensation)
> > -0 0 0 0
> > -1 1 0 0
> > -2 1 1 0
> > -3 3 1 0
> > -4 3 1 0
> > -5 3 1 0
> > -6 3 1 0
> > -7 3 1 0
> > -8 3 1 0
> > -...
> > -30 3 2 0
> > -31 3 2 0
> > -32 3 1 0
> > -33 3 2 0
> > -34 3 1 0
> > -35 3 2 0
> > -36 3 1 0
> > -37 3 2 0
> > -38 3 1 0
> > -39 3 2 0
> > -40 3 3 0
> > -41 3 1 0
> > -42 3 2 0
> > -43 3 1 0
> > -44 3 1 0
> > -45 3 2 0
> > -46 3 3 0
> > -47 3 0 0
> > -48 3 2 0
> > -49 3 3 0
> > +progress and results, such as on a Westmere system::
> > +
> > + [jacob@nex01 ~]$ cat
> > + /sys/kernel/debug/intel_powerclamp/powerclamp_calib
> > + controlling cpu: 0
> > + pct confidence steady dynamic (compensation)
> > + 0 0 0 0
> > + 1 1 0 0
> > + 2 1 1 0
> > + 3 3 1 0
> > + 4 3 1 0
> > + 5 3 1 0
> > + 6 3 1 0
> > + 7 3 1 0
> > + 8 3 1 0
> > + ...
> > + 30 3 2 0
> > + 31 3 2 0
> > + 32 3 1 0
> > + 33 3 2 0
> > + 34 3 1 0
> > + 35 3 2 0
> > + 36 3 1 0
> > + 37 3 2 0
> > + 38 3 1 0
> > + 39 3 2 0
> > + 40 3 3 0
> > + 41 3 1 0
> > + 42 3 2 0
> > + 43 3 1 0
> > + 44 3 1 0
> > + 45 3 2 0
> > + 46 3 3 0
> > + 47 3 0 0
> > + 48 3 2 0
> > + 49 3 3 0
> >
> > Calibration occurs during runtime. No offline method is available.
> > Steady state compensation is used only when confidence levels of all
> > @@ -217,9 +222,8 @@ keeps track of clamping kernel threads, even
> > after they are migrated
> > to other CPUs, after a CPU offline event.
> >
> >
> > -=====================
> > Performance Analysis
> > -=====================
> > +====================
> > This section describes the general performance data collected on
> > multiple systems, including Westmere (80P) and Ivy Bridge (4P, 8P).
> >
> > @@ -257,16 +261,15 @@ achieve up to 40% better performance per watt.
> > (measured by a spin
> > counter summed over per CPU counting threads spawned for all running
> > CPUs).
> >
> > -====================
> > Usage and Interfaces
> > ====================
> > The powerclamp driver is registered to the generic thermal layer as
> > a
> > -cooling device. Currently, it’s not bound to any thermal zones.
> > +cooling device. Currently, it’s not bound to any thermal zones::
> >
> > -jacob@chromoly:/sys/class/thermal/cooling_device14$ grep . *
> > -cur_state:0
> > -max_state:50
> > -type:intel_powerclamp
> > + jacob@chromoly:/sys/class/thermal/cooling_device14$ grep . *
> > + cur_state:0
> > + max_state:50
> > + type:intel_powerclamp
> >
> > cur_state allows user to set the desired idle percentage. Writing 0
> > to
> > cur_state will stop idle injection. Writing a value between 1 and
> > @@ -278,9 +281,9 @@ cur_state returns value -1 instead of 0 which is
> > to avoid confusing
> > 100% busy state with the disabled state.
> >
> > Example usage:
> > -- To inject 25% idle time
> > -$ sudo sh -c "echo 25 >
> > /sys/class/thermal/cooling_device80/cur_state
> > -"
> > +- To inject 25% idle time::
> > +
> > + $ sudo sh -c "echo 25 >
> > /sys/class/thermal/cooling_device80/cur_state
> >
> > If the system is not busy and has more than 25% idle time already,
> > then the powerclamp driver will not start idle injection. Using Top
> > @@ -292,23 +295,23 @@ idle time is accounted as normal idle in that
> > common code path is
> > taken as the idle task.
> >
> > In this example, 24.1% idle is shown. This helps the system admin or
> > -user determine the cause of slowdown, when a powerclamp driver is in
> > action.
> > +user determine the cause of slowdown, when a powerclamp driver is in
> > action::
> >
> >
> > -Tasks: 197 total, 1 running, 196 sleeping, 0 stopped, 0 zombie
> > -Cpu(s): 71.2%us, 4.7%sy, 0.0%ni,
> > 24.1%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
> > -Mem: 3943228k total, 1689632k used, 2253596k free, 74960k
> > buffers
> > -Swap: 4087804k total, 0k used, 4087804k free, 945336k
> > cached
> > + Tasks: 197 total, 1 running, 196 sleeping, 0 stopped, 0
> > zombie
> > + Cpu(s): 71.2%us, 4.7%sy, 0.0%ni,
> > 24.1%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
> > + Mem: 3943228k total, 1689632k used, 2253596k free, 74960k
> > buffers
> > + Swap: 4087804k total, 0k used, 4087804k free, 945336k
> > cached
> >
> > - PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
> > - 3352 jacob 20 0 262m 644 428 S 286 0.0 0:17.16 spin
> > - 3341 root -51 0 0 0 0 D 25 0.0 0:01.62
> > kidle_inject/0
> > - 3344 root -51 0 0 0 0 D 25 0.0 0:01.60
> > kidle_inject/3
> > - 3342 root -51 0 0 0 0 D 25 0.0 0:01.61
> > kidle_inject/1
> > - 3343 root -51 0 0 0 0 D 25 0.0 0:01.60
> > kidle_inject/2
> > - 2935 jacob 20 0 696m 125m 35m S 5 3.3 0:31.11 firefox
> > - 1546 root 20 0 158m 20m 6640 S 3 0.5 0:26.97 Xorg
> > - 2100 jacob 20 0 1223m 88m 30m S 3 2.3 0:23.68 compiz
> > + PID USER PR NI VIRT RES SHR S %CPU
> > %MEM TIME+ COMMAND
> > + 3352 jacob 20 0 262m 644 428 S 286 0.0 0:17.16 spin
> > + 3341 root -51 0 0 0 0 D 25 0.0 0:01.62
> > kidle_inject/0
> > + 3344 root -51 0 0 0 0 D 25 0.0 0:01.60
> > kidle_inject/3
> > + 3342 root -51 0 0 0 0 D 25 0.0 0:01.61
> > kidle_inject/1
> > + 3343 root -51 0 0 0 0 D 25 0.0 0:01.60
> > kidle_inject/2
> > + 2935 jacob 20 0 696m 125m 35m S 5 3.3 0:31.11
> > firefox
> > + 1546 root 20 0 158m 20m 6640 S 3 0.5 0:26.97 Xorg
> > + 2100 jacob 20 0 1223m 88m 30m S 3 2.3 0:23.68
> > compiz
> >
> > Tests have shown that by using the powerclamp driver as a cooling
> > device, a PID based userspace thermal controller can manage to
> > diff --git a/Documentation/thermal/nouveau_thermal
> > b/Documentation/thermal/nouveau_thermal.rst
> > similarity index 64%
> > rename from Documentation/thermal/nouveau_thermal
> > rename to Documentation/thermal/nouveau_thermal.rst
> > index 6e17a11efcb0..37255fd6735d 100644
> > --- a/Documentation/thermal/nouveau_thermal
> > +++ b/Documentation/thermal/nouveau_thermal.rst
> > @@ -1,13 +1,15 @@
> > +=====================
> > Kernel driver nouveau
> > -===================
> > +=====================
> >
> > Supported chips:
> > +
> > * NV43+
> >
> > Authors: Martin Peres (mupuf) <[email protected]>
> >
> > Description
> > ----------
> > +-----------
> >
> > This driver allows to read the GPU core temperature, drive the GPU
> > fan and
> > set temperature alarms.
> > @@ -19,20 +21,25 @@ interface is likely not to work. This document
> > may then not cover your situation
> > entirely.
> >
> > Temperature management
> > ---------------------
> > +----------------------
> >
> > Temperature is exposed under as a read-only HWMON attribute
> > temp1_input.
> >
> > In order to protect the GPU from overheating, Nouveau supports 4
> > configurable
> > temperature thresholds:
> >
> > - * Fan_boost: Fan speed is set to 100% when reaching this
> > temperature;
> > - * Downclock: The GPU will be downclocked to reduce its power
> > dissipation;
> > - * Critical: The GPU is put on hold to further lower power
> > dissipation;
> > - * Shutdown: Shut the computer down to protect your GPU.
> > + * Fan_boost:
> > + Fan speed is set to 100% when reaching this temperature;
> > + * Downclock:
> > + The GPU will be downclocked to reduce its power dissipation;
> > + * Critical:
> > + The GPU is put on hold to further lower power dissipation;
> > + * Shutdown:
> > + Shut the computer down to protect your GPU.
> >
> > -WARNING: Some of these thresholds may not be used by Nouveau
> > depending
> > -on your chipset.
> > +WARNING:
> > + Some of these thresholds may not be used by Nouveau
> > depending
> > + on your chipset.
> >
> > The default value for these thresholds comes from the GPU's vbios.
> > These
> > thresholds can be configured thanks to the following HWMON
> > attributes:
> > @@ -46,19 +53,24 @@ NOTE: Remember that the values are stored as
> > milli degrees Celsius. Don't forget
> > to multiply!
> >
> > Fan management
> > -------------
> > +--------------
> >
> > Not all cards have a drivable fan. If you do, then the following
> > HWMON
> > attributes should be available:
> >
> > - * pwm1_enable: Current fan management mode (NONE, MANUAL or AUTO);
> > - * pwm1: Current PWM value (power percentage);
> > - * pwm1_min: The minimum PWM speed allowed;
> > - * pwm1_max: The maximum PWM speed allowed (bypassed when hitting
> > Fan_boost);
> > + * pwm1_enable:
> > + Current fan management mode (NONE, MANUAL or AUTO);
> > + * pwm1:
> > + Current PWM value (power percentage);
> > + * pwm1_min:
> > + The minimum PWM speed allowed;
> > + * pwm1_max:
> > + The maximum PWM speed allowed (bypassed when hitting
> > Fan_boost);
> >
> > You may also have the following attribute:
> >
> > - * fan1_input: Speed in RPM of your fan.
> > + * fan1_input:
> > + Speed in RPM of your fan.
> >
> > Your fan can be driven in different modes:
> >
> > @@ -66,14 +78,16 @@ Your fan can be driven in different modes:
> > * 1: The fan can be driven in manual (use pwm1 to change the
> > speed);
> > * 2; The fan is driven automatically depending on the temperature.
> >
> > -NOTE: Be sure to use the manual mode if you want to drive the fan
> > speed manually
> > +NOTE:
> > + Be sure to use the manual mode if you want to drive the fan speed
> > manually
> >
> > -NOTE2: When operating in manual mode outside the vbios-defined
> > -[PWM_min, PWM_max] range, the reported fan speed (RPM) may not be
> > accurate
> > -depending on your hardware.
> > +NOTE2:
> > + When operating in manual mode outside the vbios-defined
> > + [PWM_min, PWM_max] range, the reported fan speed (RPM) may not be
> > accurate
> > + depending on your hardware.
> >
> > Bug reports
> > ----------
> > +-----------
> >
> > Thermal management on Nouveau is new and may not work on all cards.
> > If you have
> > inquiries, please ping mupuf on IRC (#nouveau, freenode).
> > diff --git a/Documentation/thermal/power_allocator.txt
> > b/Documentation/thermal/power_allocator.rst
> > similarity index 74%
> > rename from Documentation/thermal/power_allocator.txt
> > rename to Documentation/thermal/power_allocator.rst
> > index 9fb0ff06dca9..67b6a3297238 100644
> > --- a/Documentation/thermal/power_allocator.txt
> > +++ b/Documentation/thermal/power_allocator.rst
> > @@ -1,3 +1,4 @@
> > +=================================
> > Power allocator governor tunables
> > =================================
> >
> > @@ -25,36 +26,36 @@ temperature as the control input and power as the
> > controlled output:
> > P_max = k_p * e + k_i * err_integral + k_d * diff_err +
> > sustainable_power
> >
> > where
> > - e = desired_temperature - current_temperature
> > - err_integral is the sum of previous errors
> > - diff_err = e - previous_error
> > + - e = desired_temperature - current_temperature
> > + - err_integral is the sum of previous errors
> > + - diff_err = e - previous_error
> >
> > -It is similar to the one depicted below:
> > +It is similar to the one depicted below::
> >
> > - k_d
> > - |
> > -current_temp |
> > - | v
> > - | +----------+ +---+
> > - | +----->| diff_err |-->| X |------+
> > - | | +----------+ +---+ |
> > - | | | tdp ac
> > tor
> > - | | k_i | | get_reque
> > sted_power()
> > - | | | | | |
> > |
> > - | | | | | |
> > | ...
> > - v | v v v v
> > v
> > - +---+ | +-------+ +---+ +---+ +---+ +-----
> > -----+
> > - | S |-------+----->| sum e |----->| X |--->| S |-->| S |
> > -->|power |
> > - +---+ | +-------+ +---+ +---+ +---
> > + |allocation|
> > - ^ | ^ +-----
> > -----+
> > - | | | |
> > |
> > - | | +---
> > + | | |
> > - | +------->| X |-------------------
> > + v v
> > - | +---+ granted
> > performance
> > -desired_temperature ^
> > - |
> > - |
> > - k_po/k_pu
> > + k_d
> > + |
> > + current_temp |
> > + | v
> > + | +----------+ +---+
> > + | +----->| diff_err |-->| X |------+
> > + | | +----------+ +---+ |
> > + | | | tdp ac
> > tor
> > + | | k_i | | get_reque
> > sted_power()
> > + | | | | | |
> > |
> > + | | | | | |
> > | ...
> > + v | v v v v
> > v
> > + +---+ | +-------+ +---+ +---+ +---+ +-----
> > -----+
> > + | S |-----+----->| sum e |----->| X |--->| S |-->| S |
> > -->|power |
> > + +---+ | +-------+ +---+ +---+ +---
> > + |allocation|
> > + ^ | ^ +-----
> > -----+
> > + | | | |
> > |
> > + | | +---
> > + | | |
> > + | +------->| X |-------------------
> > + v v
> > + | +---+ granted
> > performance
> > + desired_temperature ^
> > + |
> > + |
> > + k_po/k_pu
> >
> > Sustainable power
> > -----------------
> > @@ -73,7 +74,7 @@ is typically 2000mW, while on a 10" tablet is
> > around 4500mW (may vary
> > depending on screen size).
> >
> > If you are using device tree, do add it as a property of the
> > -thermal-zone. For example:
> > +thermal-zone. For example::
> >
> > thermal-zones {
> > soc_thermal {
> > @@ -85,7 +86,7 @@ thermal-zone. For example:
> > Instead, if the thermal zone is registered from the platform code,
> > pass a
> > `thermal_zone_params` that has a `sustainable_power`. If no
> > `thermal_zone_params` were being passed, then something like below
> > -will suffice:
> > +will suffice::
> >
> > static const struct thermal_zone_params tz_params = {
> > .sustainable_power = 3500,
> > @@ -112,18 +113,18 @@ available capacity at a low temperature. On
> > the other hand, a high
> > value of `k_pu` will result in the governor granting very high power
> > while temperature is low, and may lead to temperature overshooting.
> >
> > -The default value for `k_pu` is:
> > +The default value for `k_pu` is::
> >
> > 2 * sustainable_power / (desired_temperature - switch_on_temp)
> >
> > This means that at `switch_on_temp` the output of the controller's
> > proportional term will be 2 * `sustainable_power`. The default
> > value
> > -for `k_po` is:
> > +for `k_po` is::
> >
> > sustainable_power / (desired_temperature - switch_on_temp)
> >
> > Focusing on the proportional and feed forward values of the PID
> > -controller equation we have:
> > +controller equation we have::
> >
> > P_max = k_p * e + sustainable_power
> >
> > @@ -134,21 +135,23 @@ is the desired one, then the proportional
> > component is zero and
> > thermal equilibrium under constant load. `sustainable_power` is
> > only
> > an estimate, which is the reason for closed-loop control such as
> > this.
> >
> > -Expanding `k_pu` we get:
> > +Expanding `k_pu` we get::
> > +
> > P_max = 2 * sustainable_power * (T_set - T) / (T_set - T_on) +
> > - sustainable_power
> > + sustainable_power
> >
> > -where
> > - T_set is the desired temperature
> > - T is the current temperature
> > - T_on is the switch on temperature
> > +where:
> > +
> > + - T_set is the desired temperature
> > + - T is the current temperature
> > + - T_on is the switch on temperature
> >
> > When the current temperature is the switch_on temperature, the above
> > -formula becomes:
> > +formula becomes::
> >
> > P_max = 2 * sustainable_power * (T_set - T_on) / (T_set - T_on)
> > +
> > - sustainable_power = 2 * sustainable_power +
> > sustainable_power =
> > - 3 * sustainable_power
> > + sustainable_power = 2 * sustainable_power +
> > sustainable_power =
> > + 3 * sustainable_power
> >
> > Therefore, the proportional term alone linearly decreases power from
> > 3 * `sustainable_power` to `sustainable_power` as the temperature
> > @@ -178,11 +181,18 @@ Cooling device power API
> > Cooling devices controlled by this governor must supply the
> > additional
> > "power" API in their `cooling_device_ops`. It consists on three
> > ops:
> >
> > -1. int get_requested_power(struct thermal_cooling_device *cdev,
> > - struct thermal_zone_device *tz, u32 *power);
> > -@cdev: The `struct thermal_cooling_device` pointer
> > -@tz: thermal zone in which we are currently operating
> > -@power: pointer in which to store the calculated power
> > +1. ::
> > +
> > + int get_requested_power(struct thermal_cooling_device *cdev,
> > + struct thermal_zone_device *tz, u32
> > *power);
> > +
> > +
> > +@cdev:
> > + The `struct thermal_cooling_device` pointer
> > +@tz:
> > + thermal zone in which we are currently operating
> > +@power:
> > + pointer in which to store the calculated power
> >
> > `get_requested_power()` calculates the power requested by the device
> > in milliwatts and stores it in @power . It should return 0 on
> > @@ -190,23 +200,37 @@ success, -E* on failure. This is currently
> > used by the power
> > allocator governor to calculate how much power to give to each
> > cooling
> > device.
> >
> > -2. int state2power(struct thermal_cooling_device *cdev, struct
> > - thermal_zone_device *tz, unsigned long state, u32 *power);
> > -@cdev: The `struct thermal_cooling_device` pointer
> > -@tz: thermal zone in which we are currently operating
> > -@state: A cooling device state
> > -@power: pointer in which to store the equivalent power
> > +2. ::
> > +
> > + int state2power(struct thermal_cooling_device *cdev, struct
> > + thermal_zone_device *tz, unsigned long
> > state,
> > + u32 *power);
> > +
> > +@cdev:
> > + The `struct thermal_cooling_device` pointer
> > +@tz:
> > + thermal zone in which we are currently operating
> > +@state:
> > + A cooling device state
> > +@power:
> > + pointer in which to store the equivalent power
> >
> > Convert cooling device state @state into power consumption in
> > milliwatts and store it in @power. It should return 0 on success,
> > -E*
> > on failure. This is currently used by thermal core to calculate the
> > maximum power that an actor can consume.
> >
> > -3. int power2state(struct thermal_cooling_device *cdev, u32 power,
> > - unsigned long *state);
> > -@cdev: The `struct thermal_cooling_device` pointer
> > -@power: power in milliwatts
> > -@state: pointer in which to store the resulting state
> > +3. ::
> > +
> > + int power2state(struct thermal_cooling_device *cdev, u32
> > power,
> > + unsigned long *state);
> > +
> > +@cdev:
> > + The `struct thermal_cooling_device` pointer
> > +@power:
> > + power in milliwatts
> > +@state:
> > + pointer in which to store the resulting state
> >
> > Calculate a cooling device state that would make the device consume
> > at
> > most @power mW and store it in @state. It should return 0 on
> > success,
> > diff --git a/Documentation/thermal/sysfs-api.txt
> > b/Documentation/thermal/sysfs-api.rst
> > similarity index 66%
> > rename from Documentation/thermal/sysfs-api.txt
> > rename to Documentation/thermal/sysfs-api.rst
> > index c3fa500df92c..e4930761d3e5 100644
> > --- a/Documentation/thermal/sysfs-api.txt
> > +++ b/Documentation/thermal/sysfs-api.rst
> > @@ -1,3 +1,4 @@
> > +===================================
> > Generic Thermal Sysfs driver How To
> > ===================================
> >
> > @@ -9,6 +10,7 @@ Copyright (c) 2008 Intel Corporation
> >
> >
> > 0. Introduction
> > +===============
> >
> > The generic thermal sysfs provides a set of interfaces for thermal
> > zone
> > devices (sensors) and thermal cooling devices (fan, processor...) to
> > register
> > @@ -25,59 +27,90 @@ An intelligent thermal management application can
> > make decisions based on
> > inputs from thermal zone attributes (the current temperature and
> > trip point
> > temperature) and throttle appropriate devices.
> >
> > -[0-*] denotes any positive number starting from 0
> > -[1-*] denotes any positive number starting from 1
> > +- `[0-*]` denotes any positive number starting from 0
> > +- `[1-*]` denotes any positive number starting from 1
> >
> > 1. thermal sysfs driver interface functions
> > +===========================================
> >
> > 1.1 thermal zone device interface
> > -1.1.1 struct thermal_zone_device *thermal_zone_device_register(char
> > *type,
> > - int trips, int mask, void *devdata,
> > - struct thermal_zone_device_ops *ops,
> > - const struct thermal_zone_params *tzp,
> > - int passive_delay, int polling_delay))
> > +---------------------------------
> > +
> > + ::
> > +
> > + struct thermal_zone_device
> > + *thermal_zone_device_register(char *type,
> > + int trips, int mask, void
> > *devdata,
> > + struct thermal_zone_device_ops
> > *ops,
> > + const struct
> > thermal_zone_params *tzp,
> > + int passive_delay, int
> > polling_delay))
> >
> > This interface function adds a new thermal zone device (sensor)
> > to
> > - /sys/class/thermal folder as thermal_zone[0-*]. It tries to bind
> > all the
> > + /sys/class/thermal folder as `thermal_zone[0-*]`. It tries to
> > bind all the
> > thermal cooling devices registered at the same time.
> >
> > - type: the thermal zone type.
> > - trips: the total number of trip points this thermal zone
> > supports.
> > - mask: Bit string: If 'n'th bit is set, then trip point 'n' is
> > writeable.
> > - devdata: device private data
> > - ops: thermal zone device call-backs.
> > - .bind: bind the thermal zone device with a thermal cooling
> > device.
> > - .unbind: unbind the thermal zone device with a thermal
> > cooling device.
> > - .get_temp: get the current temperature of the thermal zone.
> > - .set_trips: set the trip points window. Whenever the current
> > temperature
> > + type:
> > + the thermal zone type.
> > + trips:
> > + the total number of trip points this thermal zone supports.
> > + mask:
> > + Bit string: If 'n'th bit is set, then trip point 'n' is
> > writeable.
> > + devdata:
> > + device private data
> > + ops:
> > + thermal zone device call-backs.
> > +
> > + .bind:
> > + bind the thermal zone device with a thermal cooling
> > device.
> > + .unbind:
> > + unbind the thermal zone device with a thermal
> > cooling device.
> > + .get_temp:
> > + get the current temperature of the thermal zone.
> > + .set_trips:
> > + set the trip points window. Whenever the current
> > temperature
> > is updated, the trip points immediately below
> > and above the
> > current temperature are found.
> > - .get_mode: get the current mode (enabled/disabled) of the
> > thermal zone.
> > - - "enabled" means the kernel thermal management is
> > enabled.
> > - - "disabled" will prevent kernel thermal driver action
> > upon trip points
> > - so that user applications can take charge of thermal
> > management.
> > - .set_mode: set the mode (enabled/disabled) of the thermal
> > zone.
> > - .get_trip_type: get the type of certain trip point.
> > - .get_trip_temp: get the temperature above which the certain
> > trip point
> > + .get_mode:
> > + get the current mode (enabled/disabled) of the
> > thermal zone.
> > +
> > + - "enabled" means the kernel thermal
> > management is
> > + enabled.
> > + - "disabled" will prevent kernel thermal
> > driver action
> > + upon trip points so that user applications
> > can take
> > + charge of thermal management.
> > + .set_mode:
> > + set the mode (enabled/disabled) of the thermal zone.
> > + .get_trip_type:
> > + get the type of certain trip point.
> > + .get_trip_temp:
> > + get the temperature above which the certain
> > trip point
> > will be fired.
> > - .set_emul_temp: set the emulation temperature which helps in
> > debugging
> > + .set_emul_temp:
> > + set the emulation temperature which helps in
> > debugging
> > different threshold temperature points.
> > - tzp: thermal zone platform parameters.
> > - passive_delay: number of milliseconds to wait between polls when
> > + tzp:
> > + thermal zone platform parameters.
> > + passive_delay:
> > + number of milliseconds to wait between polls when
> > performing passive cooling.
> > - polling_delay: number of milliseconds to wait between polls when
> > checking
> > + polling_delay:
> > + number of milliseconds to wait between polls when checking
> > whether trip points have been crossed (0 for interrupt
> > driven systems).
> >
> > + ::
> >
> > -1.1.2 void thermal_zone_device_unregister(struct thermal_zone_device
> > *tz)
> > + void thermal_zone_device_unregister(struct
> > thermal_zone_device *tz)
> >
> > This interface function removes the thermal zone device.
> > It deletes the corresponding entry from /sys/class/thermal
> > folder and
> > unbinds all the thermal cooling devices it uses.
> >
> > -1.1.3 struct thermal_zone_device *thermal_zone_of_sensor_register(
> > - struct device *dev, int sensor_id, void *data,
> > - const struct thermal_zone_of_device_ops *ops)
> > + ::
> > +
> > + struct thermal_zone_device
> > + *thermal_zone_of_sensor_register(struct device *dev, int
> > sensor_id,
> > + void *data,
> > + const struct
> > thermal_zone_of_device_ops *ops)
> >
> > This interface adds a new sensor to a DT thermal zone.
> > This function will search the list of thermal zones
> > described in
> > @@ -87,25 +120,33 @@ temperature) and throttle appropriate devices.
> > thermal zone device.
> >
> > The parameters for this interface are:
> > - dev: Device node of sensor containing valid
> > node pointer in
> > +
> > + dev:
> > + Device node of sensor containing valid node
> > pointer in
> > dev->of_node.
> > - sensor_id: a sensor identifier, in case the sensor IP
> > has more
> > + sensor_id:
> > + a sensor identifier, in case the sensor IP
> > has more
> > than one sensors
> > - data: a private pointer (owned by the caller)
> > that will be
> > + data:
> > + a private pointer (owned by the caller) that
> > will be
> > passed back, when a temperature reading is
> > needed.
> > - ops: struct thermal_zone_of_device_ops *.
> > + ops:
> > + `struct thermal_zone_of_device_ops *`.
> >
> > - get_temp: a pointer to a function
> > that reads the
> > + ============== ============================
> > ===========
> > + get_temp a pointer to a function that
> > reads the
> > sensor temperature. This is
> > mandatory
> > callback provided by sensor
> > driver.
> > - set_trips: a pointer to a function that
> > sets a
> > + set_trips a pointer to a function
> > that sets a
> > temperature window. When
> > this window is
> > left the driver must inform
> > the thermal
> > core via
> > thermal_zone_device_update.
> > - get_trend: a pointer to a function
> > that reads the
> > + get_trend a pointer to a function
> > that reads the
> > sensor temperature trend.
> > - set_emul_temp: a pointer to a
> > function that sets
> > + set_emul_temp a pointer to a function
> > that sets
> > sensor emulated temperature.
> > + ============== ============================
> > ===========
> > +
> > The thermal zone temperature is provided by the get_temp()
> > function
> > pointer of thermal_zone_of_device_ops. When called, it will
> > have the private pointer @data back.
> > @@ -114,8 +155,10 @@ temperature) and throttle appropriate devices.
> > handle. Caller should check the return handle with IS_ERR()
> > for finding
> > whether success or not.
> >
> > -1.1.4 void thermal_zone_of_sensor_unregister(struct device *dev,
> > - struct thermal_zone_device *tzd)
> > + ::
> > +
> > + void thermal_zone_of_sensor_unregister(struct device
> > *dev,
> > + struct
> > thermal_zone_device *tzd)
> >
> > This interface unregisters a sensor from a DT thermal zone
> > which was
> > successfully added by interface
> > thermal_zone_of_sensor_register().
> > @@ -124,21 +167,29 @@ temperature) and throttle appropriate devices.
> > interface. It will also silent the zone by remove the
> > .get_temp() and
> > get_trend() thermal zone device callbacks.
> >
> > -1.1.5 struct thermal_zone_device
> > *devm_thermal_zone_of_sensor_register(
> > - struct device *dev, int sensor_id,
> > - void *data, const struct thermal_zone_of_device_ops
> > *ops)
> > + ::
> > +
> > + struct thermal_zone_device
> > + *devm_thermal_zone_of_sensor_register(struct device *dev,
> > + int sensor_id,
> > + void *data,
> > + const struct
> > thermal_zone_of_device_ops *ops)
> >
> > This interface is resource managed version of
> > thermal_zone_of_sensor_register().
> > +
> > All details of thermal_zone_of_sensor_register() described
> > in
> > section 1.1.3 is applicable here.
> > +
> > The benefit of using this interface to register sensor is
> > that it
> > is not require to explicitly call
> > thermal_zone_of_sensor_unregister()
> > in error path or during driver unbinding as this is done by
> > driver
> > resource manager.
> >
> > -1.1.6 void devm_thermal_zone_of_sensor_unregister(struct device
> > *dev,
> > - struct thermal_zone_device *tzd)
> > + ::
> > +
> > + void devm_thermal_zone_of_sensor_unregister(struct
> > device *dev,
> > + struct
> > thermal_zone_device *tzd)
> >
> > This interface is resource managed version of
> > thermal_zone_of_sensor_unregister().
> > @@ -147,123 +198,186 @@ temperature) and throttle appropriate
> > devices.
> > Normally this function will not need to be called and the
> > resource
> > management code will ensure that the resource is freed.
> >
> > -1.1.7 int thermal_zone_get_slope(struct thermal_zone_device *tz)
> > + ::
> > +
> > + int thermal_zone_get_slope(struct
> > thermal_zone_device *tz)
> >
> > This interface is used to read the slope attribute value
> > for the thermal zone device, which might be useful for
> > platform
> > drivers for temperature calculations.
> >
> > -1.1.8 int thermal_zone_get_offset(struct thermal_zone_device *tz)
> > + ::
> > +
> > + int thermal_zone_get_offset(struct
> > thermal_zone_device *tz)
> >
> > This interface is used to read the offset attribute value
> > for the thermal zone device, which might be useful for
> > platform
> > drivers for temperature calculations.
> >
> > 1.2 thermal cooling device interface
> > -1.2.1 struct thermal_cooling_device
> > *thermal_cooling_device_register(char *name,
> > - void *devdata, struct thermal_cooling_device_ops *)
> > +------------------------------------
> > +
> > +
> > + ::
> > +
> > + struct thermal_cooling_device
> > + *thermal_cooling_device_register(char *name,
> > + void *devdata, struct
> > thermal_cooling_device_ops *)
> >
> > This interface function adds a new thermal cooling device
> > (fan/processor/...)
> > - to /sys/class/thermal/ folder as cooling_device[0-*]. It tries
> > to bind itself
> > + to /sys/class/thermal/ folder as `cooling_device[0-*]`. It tries
> > to bind itself
> > to all the thermal zone devices registered at the same time.
> > - name: the cooling device name.
> > - devdata: device private data.
> > - ops: thermal cooling devices call-backs.
> > - .get_max_state: get the Maximum throttle state of the
> > cooling device.
> > - .get_cur_state: get the Currently requested throttle state
> > of the cooling device.
> > - .set_cur_state: set the Current throttle state of the
> > cooling device.
> > -
> > -1.2.2 void thermal_cooling_device_unregister(struct
> > thermal_cooling_device *cdev)
> > +
> > + name:
> > + the cooling device name.
> > + devdata:
> > + device private data.
> > + ops:
> > + thermal cooling devices call-backs.
> > +
> > + .get_max_state:
> > + get the Maximum throttle state of the cooling
> > device.
> > + .get_cur_state:
> > + get the Currently requested throttle state of the
> > + cooling device.
> > + .set_cur_state:
> > + set the Current throttle state of the cooling
> > device.
> > +
> > + ::
> > +
> > + void thermal_cooling_device_unregister(struct
> > thermal_cooling_device *cdev)
> >
> > This interface function removes the thermal cooling device.
> > It deletes the corresponding entry from /sys/class/thermal
> > folder and
> > unbinds itself from all the thermal zone devices using it.
> >
> > 1.3 interface for binding a thermal zone device with a thermal
> > cooling device
> > -1.3.1 int thermal_zone_bind_cooling_device(struct
> > thermal_zone_device *tz,
> > - int trip, struct thermal_cooling_device *cdev,
> > - unsigned long upper, unsigned long lower, unsigned int
> > weight);
> > +------------------------------------------------------------------
> > -----------
> > +
> > + ::
> > +
> > + int thermal_zone_bind_cooling_device(struct
> > thermal_zone_device *tz,
> > + int trip, struct thermal_cooling_device *cdev,
> > + unsigned long upper, unsigned long lower, unsigned
> > int weight);
> >
> > This interface function binds a thermal cooling device to a
> > particular trip
> > point of a thermal zone device.
> > +
> > This function is usually called in the thermal zone device .bind
> > callback.
> > - tz: the thermal zone device
> > - cdev: thermal cooling device
> > - trip: indicates which trip point in this thermal zone the
> > cooling device
> > - is associated with.
> > - upper:the Maximum cooling state for this trip point.
> > - THERMAL_NO_LIMIT means no upper limit,
> > +
> > + tz:
> > + the thermal zone device
> > + cdev:
> > + thermal cooling device
> > + trip:
> > + indicates which trip point in this thermal zone the
> > cooling device
> > + is associated with.
> > + upper:
> > + the Maximum cooling state for this trip point.
> > + THERMAL_NO_LIMIT means no upper limit,
> > and the cooling device can be in max_state.
> > - lower:the Minimum cooling state can be used for this trip point.
> > - THERMAL_NO_LIMIT means no lower limit,
> > + lower:
> > + the Minimum cooling state can be used for this trip point.
> > + THERMAL_NO_LIMIT means no lower limit,
> > and the cooling device can be in cooling state 0.
> > - weight: the influence of this cooling device in this thermal
> > - zone. See 1.4.1 below for more information.
> > + weight:
> > + the influence of this cooling device in this thermal
> > + zone. See 1.4.1 below for more information.
> >
> > -1.3.2 int thermal_zone_unbind_cooling_device(struct
> > thermal_zone_device *tz,
> > - int trip, struct thermal_cooling_device *cdev);
> > + ::
> > +
> > + int thermal_zone_unbind_cooling_device(struct
> > thermal_zone_device *tz,
> > + int trip, struct
> > thermal_cooling_device *cdev);
> >
> > This interface function unbinds a thermal cooling device from a
> > particular
> > trip point of a thermal zone device. This function is usually
> > called in
> > the thermal zone device .unbind callback.
> > - tz: the thermal zone device
> > - cdev: thermal cooling device
> > - trip: indicates which trip point in this thermal zone the
> > cooling device
> > - is associated with.
> > +
> > + tz:
> > + the thermal zone device
> > + cdev:
> > + thermal cooling device
> > + trip:
> > + indicates which trip point in this thermal zone the cooling
> > device
> > + is associated with.
> >
> > 1.4 Thermal Zone Parameters
> > -1.4.1 struct thermal_bind_params
> > +---------------------------
> > +
> > + ::
> > +
> > + struct thermal_bind_params
> > +
> > This structure defines the following parameters that are used to
> > bind
> > a zone with a cooling device for a particular trip point.
> > - .cdev: The cooling device pointer
> > - .weight: The 'influence' of a particular cooling device on this
> > - zone. This is relative to the rest of the cooling
> > - devices. For example, if all cooling devices have a
> > - weight of 1, then they all contribute the same. You can
> > - use percentages if you want, but it's not mandatory. A
> > - weight of 0 means that this cooling device doesn't
> > - contribute to the cooling of this zone unless all
> > cooling
> > - devices have a weight of 0. If all weights are 0, then
> > - they all contribute the same.
> > - .trip_mask:This is a bit mask that gives the binding relation
> > between
> > - this thermal zone and cdev, for a particular trip
> > point.
> > - If nth bit is set, then the cdev and thermal zone are
> > bound
> > - for trip point n.
> > - .binding_limits: This is an array of cooling state limits. Must
> > have
> > - exactly 2 * thermal_zone.number_of_trip_points.
> > It is an
> > - array consisting of tuples <lower-state upper-
> > state> of
> > - state limits. Each trip will be associated with
> > one state
> > - limit tuple when binding. A NULL pointer means
> > - <THERMAL_NO_LIMITS THERMAL_NO_LIMITS> on all
> > trips.
> > - These limits are used when binding a cdev to a
> > trip point.
> > - .match: This call back returns success(0) if the 'tz and cdev'
> > need to
> > +
> > + .cdev:
> > + The cooling device pointer
> > + .weight:
> > + The 'influence' of a particular cooling device on this
> > + zone. This is relative to the rest of the cooling
> > + devices. For example, if all cooling devices have a
> > + weight of 1, then they all contribute the same. You can
> > + use percentages if you want, but it's not mandatory. A
> > + weight of 0 means that this cooling device doesn't
> > + contribute to the cooling of this zone unless all
> > cooling
> > + devices have a weight of 0. If all weights are 0, then
> > + they all contribute the same.
> > + .trip_mask:
> > + This is a bit mask that gives the binding relation
> > between
> > + this thermal zone and cdev, for a particular trip
> > point.
> > + If nth bit is set, then the cdev and thermal zone are
> > bound
> > + for trip point n.
> > + .binding_limits:
> > + This is an array of cooling state limits. Must
> > have
> > + exactly 2 * thermal_zone.number_of_trip_points.
> > It is an
> > + array consisting of tuples <lower-state upper-
> > state> of
> > + state limits. Each trip will be associated with
> > one state
> > + limit tuple when binding. A NULL pointer means
> > + <THERMAL_NO_LIMITS THERMAL_NO_LIMITS> on all
> > trips.
> > + These limits are used when binding a cdev to a
> > trip point.
> > + .match:
> > + This call back returns success(0) if the 'tz and cdev'
> > need to
> > be bound, as per platform data.
> > -1.4.2 struct thermal_zone_params
> > +
> > + ::
> > +
> > + struct thermal_zone_params
> > +
> > This structure defines the platform level parameters for a
> > thermal zone.
> > This data, for each thermal zone should come from the platform
> > layer.
> > This is an optional feature where some platforms can choose not
> > to
> > provide this data.
> > - .governor_name: Name of the thermal governor used for this zone
> > - .no_hwmon: a boolean to indicate if the thermal to hwmon sysfs
> > interface
> > - is required. when no_hwmon == false, a hwmon sysfs
> > interface
> > - will be created. when no_hwmon == true, nothing will
> > be done.
> > - In case the thermal_zone_params is NULL, the hwmon
> > interface
> > - will be created (for backward compatibility).
> > - .num_tbps: Number of thermal_bind_params entries for this zone
> > - .tbp: thermal_bind_params entries
> > +
> > + .governor_name:
> > + Name of the thermal governor used for this zone
> > + .no_hwmon:
> > + a boolean to indicate if the thermal to hwmon sysfs
> > interface
> > + is required. when no_hwmon == false, a hwmon sysfs
> > interface
> > + will be created. when no_hwmon == true, nothing will
> > be done.
> > + In case the thermal_zone_params is NULL, the hwmon
> > interface
> > + will be created (for backward compatibility).
> > + .num_tbps:
> > + Number of thermal_bind_params entries for this zone
> > + .tbp:
> > + thermal_bind_params entries
> >
> > 2. sysfs attributes structure
> > +=============================
> >
> > +== ================
> > RO read only value
> > WO write only value
> > RW read/write value
> > +== ================
> >
> > Thermal sysfs attributes will be represented under
> > /sys/class/thermal.
> > Hwmon sysfs I/F extension is also available under /sys/class/hwmon
> > if hwmon is compiled in or built as a module.
> >
> > -Thermal zone device sys I/F, created once it's registered:
> > -/sys/class/thermal/thermal_zone[0-*]:
> > +Thermal zone device sys I/F, created once it's registered::
> > +
> > + /sys/class/thermal/thermal_zone[0-*]:
> > |---type: Type of the thermal zone
> > |---temp: Current temperature
> > |---mode: Working mode of the thermal
> > zone
> > @@ -282,8 +396,9 @@ Thermal zone device sys I/F, created once it's
> > registered:
> > |---slope: Slope constant applied as linear
> > extrapolation
> > |---offset: Offset constant applied as linear
> > extrapolation
> >
> > -Thermal cooling device sys I/F, created once it's registered:
> > -/sys/class/thermal/cooling_device[0-*]:
> > +Thermal cooling device sys I/F, created once it's registered::
> > +
> > + /sys/class/thermal/cooling_device[0-*]:
> > |---type: Type of the cooling
> > device(processor/fan/...)
> > |---max_state: Maximum cooling state of the
> > cooling device
> > |---cur_state: Current cooling state of the
> > cooling device
> > @@ -299,11 +414,13 @@ the relationship between a thermal zone and its
> > associated cooling device.
> > They are created/removed for each successful execution of
> > thermal_zone_bind_cooling_device/thermal_zone_unbind_cooling_device.
> >
> > -/sys/class/thermal/thermal_zone[0-*]:
> > +::
> > +
> > + /sys/class/thermal/thermal_zone[0-*]:
> > |---cdev[0-*]: [0-*]th cooling device in current
> > thermal zone
> > |---cdev[0-*]_trip_point: Trip point that cdev[0-*] is
> > associated with
> > |---cdev[0-*]_weight: Influence of the cooling device in
> > - this thermal zone
> > + this thermal zone
> >
> > Besides the thermal zone device sysfs I/F and cooling device sysfs
> > I/F,
> > the generic thermal driver also creates a hwmon sysfs I/F for each
> > _type_
> > @@ -311,16 +428,17 @@ of thermal zone device. E.g. the generic
> > thermal driver registers one hwmon
> > class device and build the associated hwmon sysfs I/F for all the
> > registered
> > ACPI thermal zones.
> >
> > -/sys/class/hwmon/hwmon[0-*]:
> > +::
> > +
> > + /sys/class/hwmon/hwmon[0-*]:
> > |---name: The type of the thermal zone
> > devices
> > |---temp[1-*]_input: The current temperature of thermal
> > zone [1-*]
> > |---temp[1-*]_critical: The critical trip point of
> > thermal zone [1-*]
> >
> > Please read Documentation/hwmon/sysfs-interface.rst for additional
> > information.
> >
> > -***************************
> > -* Thermal zone attributes *
> > -***************************
> > +Thermal zone attributes
> > +-----------------------
> >
> > type
> > Strings which represent the thermal zone type.
> > @@ -340,54 +458,67 @@ mode
> > This file gives information about the algorithm that is
> > currently
> > managing the thermal zone. It can be either default kernel
> > based
> > algorithm or user space application.
> > - enabled = enable Kernel Thermal management.
> > - disabled = Preventing kernel thermal zone driver
> > actions upon
> > +
> > + enabled
> > + enable Kernel Thermal management.
> > + disabled
> > + Preventing kernel thermal zone driver
> > actions upon
> > trip points so that user application can
> > take full
> > charge of the thermal management.
> > +
> > RW, Optional
> >
> > policy
> > One of the various thermal governors used for a particular
> > zone.
> > +
> > RW, Required
> >
> > available_policies
> > Available thermal governors which can be used for a
> > particular zone.
> > +
> > RO, Required
> >
> > -trip_point_[0-*]_temp
> > +`trip_point_[0-*]_temp`
> > The temperature above which trip point will be fired.
> > +
> > Unit: millidegree Celsius
> > +
> > RO, Optional
> >
> > -trip_point_[0-*]_type
> > +`trip_point_[0-*]_type`
> > Strings which indicate the type of the trip point.
> > - E.g. it can be one of critical, hot, passive, active[0-*]
> > for ACPI
> > +
> > + E.g. it can be one of critical, hot, passive, `active[0-*]`
> > for ACPI
> > thermal zone.
> > +
> > RO, Optional
> >
> > -trip_point_[0-*]_hyst
> > +`trip_point_[0-*]_hyst`
> > The hysteresis value for a trip point, represented as an
> > integer
> > Unit: Celsius
> > RW, Optional
> >
> > -cdev[0-*]
> > +`cdev[0-*]`
> > Sysfs link to the thermal cooling device node where the sys
> > I/F
> > for cooling device throttling control represents.
> > +
> > RO, Optional
> >
> > -cdev[0-*]_trip_point
> > - The trip point in this thermal zone which cdev[0-*] is
> > associated
> > +`cdev[0-*]_trip_point`
> > + The trip point in this thermal zone which `cdev[0-*]` is
> > associated
> > with; -1 means the cooling device is not associated with any
> > trip
> > point.
> > +
> > RO, Optional
> >
> > -cdev[0-*]_weight
> > - The influence of cdev[0-*] in this thermal zone. This value
> > - is relative to the rest of cooling devices in the thermal
> > - zone. For example, if a cooling device has a weight double
> > - than that of other, it's twice as effective in cooling the
> > - thermal zone.
> > - RW, Optional
> > +`cdev[0-*]_weight`
> > + The influence of `cdev[0-*]` in this thermal zone. This
> > value
> > + is relative to the rest of cooling devices in the thermal
> > + zone. For example, if a cooling device has a weight double
> > + than that of other, it's twice as effective in cooling the
> > + thermal zone.
> > +
> > + RW, Optional
> >
> > passive
> > Attribute is only present for zones in which the passive
> > cooling
> > @@ -395,8 +526,11 @@ passive
> > and can be set to a temperature (in millidegrees) to enable
> > a
> > passive trip point for the zone. Activation is done by
> > polling with
> > an interval of 1 second.
> > +
> > Unit: millidegrees Celsius
> > +
> > Valid values: 0 (disabled) or greater than 1000
> > +
> > RW, Optional
> >
> > emul_temp
> > @@ -407,17 +541,21 @@ emul_temp
> > threshold and its associated cooling action. This is write
> > only node
> > and writing 0 on this node should disable emulation.
> > Unit: millidegree Celsius
> > +
> > WO, Optional
> >
> > - WARNING: Be careful while enabling this option on
> > production systems,
> > - because userland can easily disable the thermal policy by
> > simply
> > - flooding this sysfs node with low temperature values.
> > + WARNING:
> > + Be careful while enabling this option on production
> > systems,
> > + because userland can easily disable the thermal policy
> > by simply
> > + flooding this sysfs node with low temperature values.
> >
> > sustainable_power
> > An estimate of the sustained power that can be dissipated by
> > the thermal zone. Used by the power allocator governor. For
> > - more information see
> > Documentation/thermal/power_allocator.txt
> > + more information see
> > Documentation/thermal/power_allocator.rst
> > +
> > Unit: milliwatts
> > +
> > RW, Optional
> >
> > k_po
> > @@ -425,7 +563,8 @@ k_po
> > controller during temperature overshoot. Temperature
> > overshoot
> > is when the current temperature is above the "desired
> > temperature" trip point. For more information see
> > - Documentation/thermal/power_allocator.txt
> > + Documentation/thermal/power_allocator.rst
> > +
> > RW, Optional
> >
> > k_pu
> > @@ -433,20 +572,23 @@ k_pu
> > controller during temperature undershoot. Temperature
> > undershoot
> > is when the current temperature is below the "desired
> > temperature" trip point. For more information see
> > - Documentation/thermal/power_allocator.txt
> > + Documentation/thermal/power_allocator.rst
> > +
> > RW, Optional
> >
> > k_i
> > The integral term of the power allocator governor's PID
> > controller. This term allows the PID controller to
> > compensate
> > for long term drift. For more information see
> > - Documentation/thermal/power_allocator.txt
> > + Documentation/thermal/power_allocator.rst
> > +
> > RW, Optional
> >
> > k_d
> > The derivative term of the power allocator governor's PID
> > controller. For more information see
> > - Documentation/thermal/power_allocator.txt
> > + Documentation/thermal/power_allocator.rst
> > +
> > RW, Optional
> >
> > integral_cutoff
> > @@ -456,8 +598,10 @@ integral_cutoff
> > example, if integral_cutoff is 0, then the integral term
> > only
> > accumulates error when temperature is above the desired
> > temperature trip point. For more information see
> > - Documentation/thermal/power_allocator.txt
> > + Documentation/thermal/power_allocator.rst
> > +
> > Unit: millidegree Celsius
> > +
> > RW, Optional
> >
> > slope
> > @@ -465,6 +609,7 @@ slope
> > to determine a hotspot temperature based off the sensor's
> > raw readings. It is up to the device driver to determine
> > the usage of these values.
> > +
> > RW, Optional
> >
> > offset
> > @@ -472,28 +617,33 @@ offset
> > to determine a hotspot temperature based off the sensor's
> > raw readings. It is up to the device driver to determine
> > the usage of these values.
> > +
> > RW, Optional
> >
> > -*****************************
> > -* Cooling device attributes *
> > -*****************************
> > +Cooling device attributes
> > +-------------------------
> >
> > type
> > String which represents the type of device, e.g:
> > +
> > - for generic ACPI: should be "Fan", "Processor" or "LCD"
> > - for memory controller device on intel_menlow platform:
> > should be "Memory controller".
> > +
> > RO, Required
> >
> > max_state
> > The maximum permissible cooling state of this cooling
> > device.
> > +
> > RO, Required
> >
> > cur_state
> > The current cooling state of this cooling device.
> > The value can any integer numbers between 0 and max_state:
> > +
> > - cur_state == 0 means no cooling
> > - cur_state == max_state means the maximum cooling.
> > +
> > RW, Required
> >
> > stats/reset
> > @@ -508,9 +658,11 @@ stats/time_in_state_ms:
> > units here is 10mS (similar to other time exported in
> > /proc).
> > RO, Required
> >
> > +
> > stats/total_trans:
> > A single positive value showing the total number of times
> > the state of a
> > cooling device is changed.
> > +
> > RO, Required
> >
> > stats/trans_table:
> > @@ -522,6 +674,7 @@ stats/trans_table:
> > RO, Required
> >
> > 3. A simple implementation
> > +==========================
> >
> > ACPI thermal zone may support multiple trip points like critical,
> > hot,
> > passive, active. If an ACPI thermal zone supports critical, passive,
> > @@ -532,11 +685,10 @@ thermal_cooling_device. Both are considered to
> > have the same
> > effectiveness in cooling the thermal zone.
> >
> > If the processor is listed in _PSL method, and the fan is listed in
> > _AL0
> > -method, the sys I/F structure will be built like this:
> > +method, the sys I/F structure will be built like this::
> >
> > -/sys/class/thermal:
> > -
> > -|thermal_zone1:
> > + /sys/class/thermal:
> > + |thermal_zone1:
> > |---type: acpitz
> > |---temp: 37000
> > |---mode: enabled
> > @@ -557,24 +709,24 @@ method, the sys I/F structure will be built
> > like this:
> > |---cdev1_trip_point: 2 /* cdev1 can be used for
> > active[0]*/
> > |---cdev1_weight: 1024
> >
> > -|cooling_device0:
> > + |cooling_device0:
> > |---type: Processor
> > |---max_state: 8
> > |---cur_state: 0
> >
> > -|cooling_device3:
> > + |cooling_device3:
> > |---type: Fan
> > |---max_state: 2
> > |---cur_state: 0
> >
> > -/sys/class/hwmon:
> > -
> > -|hwmon0:
> > + /sys/class/hwmon:
> > + |hwmon0:
> > |---name: acpitz
> > |---temp1_input: 37000
> > |---temp1_crit: 100000
> >
> > 4. Event Notification
> > +=====================
> >
> > The framework includes a simple notification mechanism, in the form
> > of a
> > netlink event. Netlink socket initialization is done during the
> > _init_
> > @@ -587,21 +739,28 @@ event will be one of:{THERMAL_AUX0,
> > THERMAL_AUX1, THERMAL_CRITICAL,
> > THERMAL_DEV_FAULT}. Notification can be sent when the current
> > temperature
> > crosses any of the configured thresholds.
> >
> > -5. Export Symbol APIs:
> > +5. Export Symbol APIs
> > +=====================
> > +
> > +5.1. get_tz_trend
> > +-----------------
> >
> > -5.1: get_tz_trend:
> > This function returns the trend of a thermal zone, i.e the rate of
> > change
> > of temperature of the thermal zone. Ideally, the thermal sensor
> > drivers
> > are supposed to implement the callback. If they don't, the thermal
> > framework calculated the trend by comparing the previous and the
> > current
> > temperature values.
> >
> > -5.2:get_thermal_instance:
> > +5.2. get_thermal_instance
> > +-------------------------
> > +
> > This function returns the thermal_instance corresponding to a given
> > {thermal_zone, cooling_device, trip_point} combination. Returns NULL
> > if such an instance does not exist.
> >
> > -5.3:thermal_notify_framework:
> > +5.3. thermal_notify_framework
> > +-----------------------------
> > +
> > This function handles the trip events from sensor drivers. It starts
> > throttling the cooling devices according to the policy configured.
> > For CRITICAL and HOT trip points, this notifies the respective
> > drivers,
> > @@ -609,12 +768,15 @@ and does actual throttling for other trip
> > points i.e ACTIVE and PASSIVE.
> > The throttling policy is based on the configured platform data; if
> > no
> > platform data is provided, this uses the step_wise throttling
> > policy.
> >
> > -5.4:thermal_cdev_update:
> > +5.4. thermal_cdev_update
> > +------------------------
> > +
> > This function serves as an arbitrator to set the state of a cooling
> > device. It sets the cooling device to the deepest cooling state if
> > possible.
> >
> > -6. thermal_emergency_poweroff:
> > +6. thermal_emergency_poweroff
> > +=============================
> >
> > On an event of critical trip temperature crossing. Thermal framework
> > allows the system to shutdown gracefully by calling
> > orderly_poweroff().
> > diff --git a/Documentation/thermal/x86_pkg_temperature_thermal
> > b/Documentation/thermal/x86_pkg_temperature_thermal.rst
> > similarity index 80%
> > rename from Documentation/thermal/x86_pkg_temperature_thermal
> > rename to Documentation/thermal/x86_pkg_temperature_thermal.rst
> > index 17a3a4c0a0ca..f134dbd3f5a9 100644
> > --- a/Documentation/thermal/x86_pkg_temperature_thermal
> > +++ b/Documentation/thermal/x86_pkg_temperature_thermal.rst
> > @@ -1,19 +1,23 @@
> > +===================================
> > Kernel driver: x86_pkg_temp_thermal
> > -===================
> > +===================================
> >
> > Supported chips:
> > +
> > * x86: with package level thermal management
> > +
> > (Verify using: CPUID.06H:EAX[bit 6] =1)
> >
> > Authors: Srinivas Pandruvada <[email protected]>
> >
> > Reference
> > ----
> > +---------
> > +
> > Intel® 64 and IA-32 Architectures Software Developer’s Manual (Jan,
> > 2013):
> > Chapter 14.6: PACKAGE LEVEL THERMAL MANAGEMENT
> >
> > Description
> > ----------
> > +-----------
> >
> > This driver register CPU digital temperature package level sensor as
> > a thermal
> > zone with maximum two user mode configurable trip points. Number of
> > trip points
> > @@ -25,23 +29,27 @@ take any action to control temperature.
> > Threshold management
> > --------------------
> > Each package will register as a thermal zone under
> > /sys/class/thermal.
> > -Example:
> > -/sys/class/thermal/thermal_zone1
> > +
> > +Example::
> > +
> > + /sys/class/thermal/thermal_zone1
> >
> > This contains two trip points:
> > +
> > - trip_point_0_temp
> > - trip_point_1_temp
> >
> > User can set any temperature between 0 to TJ-Max temperature.
> > Temperature units
> > -are in milli-degree Celsius. Refer to "Documentation/thermal/sysfs-
> > api.txt" for
> > +are in milli-degree Celsius. Refer to "Documentation/thermal/sysfs-
> > api.rst" for
> > thermal sys-fs details.
> >
> > Any value other than 0 in these trip points, can trigger thermal
> > notifications.
> > Setting 0, stops sending thermal notifications.
> >
> > -Thermal notifications: To get kobject-uevent notifications, set the
> > thermal zone
> > -policy to "user_space". For example: echo -n "user_space" > policy
> > -
> > -
> > +Thermal notifications:
> > +To get kobject-uevent notifications, set the thermal zone
> > +policy to "user_space".
> >
> > +For example::
> >
> > + echo -n "user_space" > policy
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index d9e214f68e52..b2254bc8e495 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -15687,7 +15687,7 @@ M: Viresh Kumar <[email protected]
> > rg>
> > M: Javi Merino <[email protected]>
> > L: [email protected]
> > S: Supported
> > -F: Documentation/thermal/cpu-cooling-api.txt
> > +F: Documentation/thermal/cpu-cooling-api.rst
> > F: drivers/thermal/cpu_cooling.c
> > F: include/linux/cpu_cooling.h
> >
> > diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> > index 15a4ca5d7099..681047f8cc05 100644
> > --- a/include/linux/thermal.h
> > +++ b/include/linux/thermal.h
> > @@ -251,7 +251,7 @@ struct thermal_bind_params {
> > * platform characterization. This value is relative to the
> > * rest of the weights so a cooling device whose weight is
> > * double that of another cooling device is twice as
> > - * effective. See Documentation/thermal/sysfs-api.txt for
> > more
> > + * effective. See Documentation/thermal/sysfs-api.rst for
> > more
> > * information.
> > */
> > int weight;
> > @@ -259,7 +259,7 @@ struct thermal_bind_params {
> > /*
> > * This is a bit mask that gives the binding relation
> > between this
> > * thermal zone and cdev, for a particular trip point.
> > - * See Documentation/thermal/sysfs-api.txt for more
> > information.
> > + * See Documentation/thermal/sysfs-api.rst for more
> > information.
> > */
> > int trip_mask;
> >
Thanks,
Mauro
On 二, 2019-06-25 at 10:53 -0300, Mauro Carvalho Chehab wrote:
> Em Tue, 25 Jun 2019 21:40:11 +0800
> Zhang Rui <[email protected]> escreveu:
>
> >
> > On 二, 2019-06-18 at 18:05 -0300, Mauro Carvalho Chehab wrote:
> > >
> > > Rename the thermal documentation files to ReST, add an
> > > index for them and adjust in order to produce a nice html
> > > output via the Sphinx build system.
> > >
> > > At its new index.rst, let's add a :orphan: while this is not
> > > linked
> > > to
> > > the main index.rst file, in order to avoid build warnings.
> > >
> > > Signed-off-by: Mauro Carvalho Chehab <[email protected]>
> > >
> > Acked-by: Zhang Rui <[email protected]>
> >
> > should I apply this patch or you have a separate tree for all these
> > changes?
> Feel free to apply it directly to your tree. The patches on this
> series are pretty much independent.
>
okay, queued for 5.3-rc1.
thanks,
rui
> >
> >
> > thanks,
> > rui
> > >
> > > ---
> > > ...pu-cooling-api.txt => cpu-cooling-api.rst} | 39 +-
> > > .../{exynos_thermal => exynos_thermal.rst} | 47 +-
> > > ...emulation => exynos_thermal_emulation.rst} | 66 +--
> > > Documentation/thermal/index.rst | 18 +
> > > ...el_powerclamp.txt => intel_powerclamp.rst} | 177 +++----
> > > .../{nouveau_thermal => nouveau_thermal.rst} | 54 +-
> > > ...ower_allocator.txt => power_allocator.rst} | 140 ++---
> > > .../thermal/{sysfs-api.txt => sysfs-api.rst} | 490
> > > ++++++++++++--
> > > ----
> > > ...hermal => x86_pkg_temperature_thermal.rst} | 28 +-
> > > MAINTAINERS | 2 +-
> > > include/linux/thermal.h | 4 +-
> > > 11 files changed, 665 insertions(+), 400 deletions(-)
> > > rename Documentation/thermal/{cpu-cooling-api.txt => cpu-
> > > cooling-
> > > api.rst} (82%)
> > > rename Documentation/thermal/{exynos_thermal =>
> > > exynos_thermal.rst}
> > > (67%)
> > > rename Documentation/thermal/{exynos_thermal_emulation =>
> > > exynos_thermal_emulation.rst} (36%)
> > > create mode 100644 Documentation/thermal/index.rst
> > > rename Documentation/thermal/{intel_powerclamp.txt =>
> > > intel_powerclamp.rst} (76%)
> > > rename Documentation/thermal/{nouveau_thermal =>
> > > nouveau_thermal.rst} (64%)
> > > rename Documentation/thermal/{power_allocator.txt =>
> > > power_allocator.rst} (74%)
> > > rename Documentation/thermal/{sysfs-api.txt => sysfs-api.rst}
> > > (66%)
> > > rename Documentation/thermal/{x86_pkg_temperature_thermal =>
> > > x86_pkg_temperature_thermal.rst} (80%)
> > >
> > > diff --git a/Documentation/thermal/cpu-cooling-api.txt
> > > b/Documentation/thermal/cpu-cooling-api.rst
> > > similarity index 82%
> > > rename from Documentation/thermal/cpu-cooling-api.txt
> > > rename to Documentation/thermal/cpu-cooling-api.rst
> > > index 7df567eaea1a..645d914c45a6 100644
> > > --- a/Documentation/thermal/cpu-cooling-api.txt
> > > +++ b/Documentation/thermal/cpu-cooling-api.rst
> > > @@ -1,5 +1,6 @@
> > > +=======================
> > > CPU cooling APIs How To
> > > -===================================
> > > +=======================
> > >
> > > Written by Amit Daniel Kachhap <[email protected]>
> > >
> > > @@ -8,40 +9,54 @@ Updated: 6 Jan 2015
> > > Copyright (c) 2012 Samsung Electronics Co., Ltd(http://www.sams
> > > ung.
> > > com)
> > >
> > > 0. Introduction
> > > +===============
> > >
> > > The generic cpu cooling(freq clipping) provides
> > > registration/unregistration APIs
> > > to the caller. The binding of the cooling devices to the trip
> > > point
> > > is left for
> > > the user. The registration APIs returns the cooling device
> > > pointer.
> > >
> > > 1. cpu cooling APIs
> > > +===================
> > >
> > > 1.1 cpufreq registration/unregistration APIs
> > > -1.1.1 struct thermal_cooling_device *cpufreq_cooling_register(
> > > - struct cpumask *clip_cpus)
> > > +--------------------------------------------
> > > +
> > > + ::
> > > +
> > > + struct thermal_cooling_device
> > > + *cpufreq_cooling_register(struct cpumask *clip_cpus)
> > >
> > > This interface function registers the cpufreq cooling device
> > > with the name
> > > "thermal-cpufreq-%x". This api can support multiple
> > > instances of
> > > cpufreq
> > > cooling devices.
> > >
> > > - clip_cpus: cpumask of cpus where the frequency constraints
> > > will
> > > happen.
> > > + clip_cpus:
> > > + cpumask of cpus where the frequency constraints will
> > > happen.
> > >
> > > -1.1.2 struct thermal_cooling_device
> > > *of_cpufreq_cooling_register(
> > > - struct cpufreq_policy
> > > *policy)
> > > + ::
> > > +
> > > + struct thermal_cooling_device
> > > + *of_cpufreq_cooling_register(struct cpufreq_policy
> > > *policy)
> > >
> > > This interface function registers the cpufreq cooling device
> > > with
> > > the name "thermal-cpufreq-%x" linking it with a device tree
> > > node, in
> > > order to bind it via the thermal DT code. This api can
> > > support
> > > multiple
> > > instances of cpufreq cooling devices.
> > >
> > > - policy: CPUFreq policy.
> > > + policy:
> > > + CPUFreq policy.
> > >
> > > -1.1.3 void cpufreq_cooling_unregister(struct
> > > thermal_cooling_device
> > > *cdev)
> > > +
> > > + ::
> > > +
> > > + void cpufreq_cooling_unregister(struct
> > > thermal_cooling_device *cdev)
> > >
> > > This interface function unregisters the "thermal-cpufreq-%x"
> > > cooling device.
> > >
> > > cdev: Cooling device pointer which has to be unregistered.
> > >
> > > 2. Power models
> > > +===============
> > >
> > > The power API registration functions provide a simple power
> > > model
> > > for
> > > CPUs. The current power is calculated as dynamic power (static
> > > power isn't
> > > @@ -65,9 +80,9 @@ For a given processor implementation the
> > > primary
> > > factors are:
> > > variation. In pathological cases this variation can be
> > > significant,
> > > but typically it is of a much lesser impact than the factors
> > > above.
> > >
> > > -A high level dynamic power consumption model may then be
> > > represented
> > > as:
> > > +A high level dynamic power consumption model may then be
> > > represented
> > > as::
> > >
> > > -Pdyn = f(run) * Voltage^2 * Frequency * Utilisation
> > > + Pdyn = f(run) * Voltage^2 * Frequency * Utilisation
> > >
> > > f(run) here represents the described execution behaviour and its
> > > result has a units of Watts/Hz/Volt^2 (this often expressed in
> > > @@ -80,9 +95,9 @@ factors. Therefore, in initial implementation
> > > that
> > > contribution is
> > > represented as a constant coefficient. This is a simplification
> > > consistent with the relative contribution to overall power
> > > variation.
> > >
> > > -In this simplified representation our model becomes:
> > > +In this simplified representation our model becomes::
> > >
> > > -Pdyn = Capacitance * Voltage^2 * Frequency * Utilisation
> > > + Pdyn = Capacitance * Voltage^2 * Frequency * Utilisation
> > >
> > > Where `capacitance` is a constant that represents an indicative
> > > running time dynamic power coefficient in fundamental units of
> > > diff --git a/Documentation/thermal/exynos_thermal
> > > b/Documentation/thermal/exynos_thermal.rst
> > > similarity index 67%
> > > rename from Documentation/thermal/exynos_thermal
> > > rename to Documentation/thermal/exynos_thermal.rst
> > > index 9010c4416967..5bd556566c70 100644
> > > --- a/Documentation/thermal/exynos_thermal
> > > +++ b/Documentation/thermal/exynos_thermal.rst
> > > @@ -1,8 +1,11 @@
> > > +========================
> > > Kernel driver exynos_tmu
> > > -=================
> > > +========================
> > >
> > > Supported chips:
> > > +
> > > * ARM SAMSUNG EXYNOS4, EXYNOS5 series of SoC
> > > +
> > > Datasheet: Not publicly available
> > >
> > > Authors: Donggeun Kim <[email protected]>
> > > @@ -19,32 +22,39 @@ Temperature can be taken from the temperature
> > > code.
> > > There are three equations converting from temperature to
> > > temperature
> > > code.
> > >
> > > The three equations are:
> > > - 1. Two point trimming
> > > + 1. Two point trimming::
> > > +
> > > Tc = (T - 25) * (TI2 - TI1) / (85 - 25) + TI1
> > >
> > > - 2. One point trimming
> > > + 2. One point trimming::
> > > +
> > > Tc = T + TI1 - 25
> > >
> > > - 3. No trimming
> > > + 3. No trimming::
> > > +
> > > Tc = T + 50
> > >
> > > - Tc: Temperature code, T: Temperature,
> > > - TI1: Trimming info for 25 degree Celsius (stored at TRIMINFO
> > > register)
> > > + Tc:
> > > + Temperature code, T: Temperature,
> > > + TI1:
> > > + Trimming info for 25 degree Celsius (stored at TRIMINFO
> > > register)
> > > Temperature code measured at 25 degree Celsius which is
> > > unchanged
> > > - TI2: Trimming info for 85 degree Celsius (stored at TRIMINFO
> > > register)
> > > + TI2:
> > > + Trimming info for 85 degree Celsius (stored at TRIMINFO
> > > register)
> > > Temperature code measured at 85 degree Celsius which is
> > > unchanged
> > >
> > > TMU(Thermal Management Unit) in EXYNOS4/5 generates interrupt
> > > when temperature exceeds pre-defined levels.
> > > The maximum number of configurable threshold is five.
> > > -The threshold levels are defined as follows:
> > > +The threshold levels are defined as follows::
> > > +
> > > Level_0: current temperature > trigger_level_0 + threshold
> > > Level_1: current temperature > trigger_level_1 + threshold
> > > Level_2: current temperature > trigger_level_2 + threshold
> > > Level_3: current temperature > trigger_level_3 + threshold
> > >
> > > - The threshold and each trigger_level are set
> > > - through the corresponding registers.
> > > +The threshold and each trigger_level are set
> > > +through the corresponding registers.
> > >
> > > When an interrupt occurs, this driver notify kernel thermal
> > > framework
> > > with the function exynos_report_trigger.
> > > @@ -54,24 +64,27 @@ it can be used to synchronize the cooling
> > > action.
> > > TMU driver description:
> > > -----------------------
> > >
> > > -The exynos thermal driver is structured as,
> > > +The exynos thermal driver is structured as::
> > >
> > > Kernel Core thermal
> > > framework
> > > (thermal_core.c, step_wise.c,
> > > cpu_cooling.c)
> > >
> > > ^
> > >
> > > |
> > >
> > > |
> > > -TMU configuration data -------> TMU Driver <------> Exynos Core
> > > thermal wrapper
> > > -(exynos_tmu_data.c) (exynos_tmu.c) (exyno
> > > s_th
> > > ermal_common.c)
> > > -(exynos_tmu_data.h) (exynos_tmu.h) (exyno
> > > s_th
> > > ermal_common.h)
> > > + TMU configuration data -----> TMU Driver <----> Exynos Core
> > > thermal wrapper
> > > + (exynos_tmu_data.c) (exynos_tmu.c) (exy
> > > nos_
> > > thermal_common.c)
> > > + (exynos_tmu_data.h) (exynos_tmu.h) (exy
> > > nos_
> > > thermal_common.h)
> > >
> > > -a) TMU configuration data: This consist of TMU register
> > > offsets/bitfields
> > > +a) TMU configuration data:
> > > + This consist of TMU register offsets/bitfields
> > > described through structure
> > > exynos_tmu_registers.
> > > Also several
> > > other platform data (struct
> > > exynos_tmu_platform_data) members
> > > are used to configure the TMU.
> > > -b) TMU driver: This component initialises the TMU controller and
> > > sets different
> > > +b) TMU driver:
> > > + This component initialises the TMU controller
> > > and
> > > sets different
> > > thresholds. It invokes core thermal
> > > implementation
> > > with the call
> > > exynos_report_trigger.
> > > -c) Exynos Core thermal wrapper: This provides 3 wrapper function
> > > to
> > > use the
> > > +c) Exynos Core thermal wrapper:
> > > + This provides 3 wrapper function to use the
> > > Kernel core thermal framework. They are
> > > exynos_unregister_thermal,
> > > exynos_register_thermal and
> > > exynos_report_trigger.
> > > diff --git a/Documentation/thermal/exynos_thermal_emulation
> > > b/Documentation/thermal/exynos_thermal_emulation.rst
> > > similarity index 36%
> > > rename from Documentation/thermal/exynos_thermal_emulation
> > > rename to Documentation/thermal/exynos_thermal_emulation.rst
> > > index b15efec6ca28..c21d10838bc5 100644
> > > --- a/Documentation/thermal/exynos_thermal_emulation
> > > +++ b/Documentation/thermal/exynos_thermal_emulation.rst
> > > @@ -1,5 +1,6 @@
> > > -EXYNOS EMULATION MODE
> > > -========================
> > > +=====================
> > > +Exynos Emulation Mode
> > > +=====================
> > >
> > > Copyright (C) 2012 Samsung Electronics
> > >
> > > @@ -8,46 +9,53 @@ Written by Jonghwa Lee <[email protected]
> > > m>
> > > Description
> > > -----------
> > >
> > > -Exynos 4x12 (4212, 4412) and 5 series provide emulation mode for
> > > thermal management unit.
> > > -Thermal emulation mode supports software debug for TMU's
> > > operation.
> > > User can set temperature
> > > -manually with software code and TMU will read current
> > > temperature
> > > from user value not from
> > > -sensor's value.
> > > +Exynos 4x12 (4212, 4412) and 5 series provide emulation mode for
> > > thermal
> > > +management unit. Thermal emulation mode supports software debug
> > > for
> > > +TMU's operation. User can set temperature manually with software
> > > code
> > > +and TMU will read current temperature from user value not from
> > > sensor's
> > > +value.
> > >
> > > -Enabling CONFIG_THERMAL_EMULATION option will make this support
> > > available.
> > > -When it's enabled, sysfs node will be created as
> > > +Enabling CONFIG_THERMAL_EMULATION option will make this support
> > > +available. When it's enabled, sysfs node will be created as
> > > /sys/devices/virtual/thermal/thermal_zone'zone id'/emul_temp.
> > >
> > > -The sysfs node, 'emul_node', will contain value 0 for the
> > > initial
> > > state. When you input any
> > > -temperature you want to update to sysfs node, it automatically
> > > enable emulation mode and
> > > -current temperature will be changed into it.
> > > -(Exynos also supports user changeable delay time which would be
> > > used
> > > to delay of
> > > - changing temperature. However, this node only uses same delay
> > > of
> > > real sensing time, 938us.)
> > > +The sysfs node, 'emul_node', will contain value 0 for the
> > > initial
> > > state.
> > > +When you input any temperature you want to update to sysfs node,
> > > it
> > > +automatically enable emulation mode and current temperature will
> > > be
> > > +changed into it.
> > >
> > > -Exynos emulation mode requires synchronous of value changing and
> > > enabling. It means when you
> > > -want to update the any value of delay or next temperature, then
> > > you
> > > have to enable emulation
> > > -mode at the same time. (Or you have to keep the mode enabling.)
> > > If
> > > you don't, it fails to
> > > -change the value to updated one and just use last succeessful
> > > value
> > > repeatedly. That's why
> > > -this node gives users the right to change termerpature only.
> > > Just
> > > one interface makes it more
> > > -simply to use.
> > > +(Exynos also supports user changeable delay time which would be
> > > used
> > > to
> > > +delay of changing temperature. However, this node only uses same
> > > delay
> > > +of real sensing time, 938us.)
> > > +
> > > +Exynos emulation mode requires synchronous of value changing and
> > > +enabling. It means when you want to update the any value of
> > > delay or
> > > +next temperature, then you have to enable emulation mode at the
> > > same
> > > +time. (Or you have to keep the mode enabling.) If you don't, it
> > > fails to
> > > +change the value to updated one and just use last succeessful
> > > value
> > > +repeatedly. That's why this node gives users the right to change
> > > +termerpature only. Just one interface makes it more simply to
> > > use.
> > >
> > > Disabling emulation mode only requires writing value 0 to sysfs
> > > node.
> > >
> > > +::
> > >
> > > -TEMP 120 |
> > > +
> > > + TEMP 120 |
> > > |
> > > 100 |
> > > |
> > > 80 |
> > > - | +-----------
> > > - 60 | | |
> > > - | +-------------| |
> > > + | +-----------
> > > + 60 | | |
> > > + | +-------------| |
> > > 40 | | | |
> > > - | | |
> > > |
> > > - 20 | | |
> > > +-
> > > ---------
> > > - | | |
> > > |
> > > |
> > > + | | | |
> > > + 20 | | | +
> > > ----
> > > ------
> > > + | | | |
> > >
> > > |
> > > 0
> > > >
> > > > ______________|_____________|__________|__________|_________
> > > - A A A
> > >
> > > A TIME
> > > + A A A
> > >
> > > A TIME
> > > |<----->| |<----->| |<----->|
> > >
> > > |
> > > | 938us | | | | |
> > >
> > > |
> > > -emulation : 0 50 | 70 | 20 |
> > >
> > > 0
> > > -current temp : sensor 50 70 20
> > >
> > > sensor
> > > + emulation : 0 50 | 70 | 20 |
> > >
> > > 0
> > > + current temp: sensor 50 70 20
> > >
> > > sensor
> > > diff --git a/Documentation/thermal/index.rst
> > > b/Documentation/thermal/index.rst
> > > new file mode 100644
> > > index 000000000000..8c1c00146cad
> > > --- /dev/null
> > > +++ b/Documentation/thermal/index.rst
> > > @@ -0,0 +1,18 @@
> > > +:orphan:
> > > +
> > > +=======
> > > +Thermal
> > > +=======
> > > +
> > > +.. toctree::
> > > + :maxdepth: 1
> > > +
> > > + cpu-cooling-api
> > > + sysfs-api
> > > + power_allocator
> > > +
> > > + exynos_thermal
> > > + exynos_thermal_emulation
> > > + intel_powerclamp
> > > + nouveau_thermal
> > > + x86_pkg_temperature_thermal
> > > diff --git a/Documentation/thermal/intel_powerclamp.txt
> > > b/Documentation/thermal/intel_powerclamp.rst
> > > similarity index 76%
> > > rename from Documentation/thermal/intel_powerclamp.txt
> > > rename to Documentation/thermal/intel_powerclamp.rst
> > > index b5df21168fbc..3f6dfb0b3ea6 100644
> > > --- a/Documentation/thermal/intel_powerclamp.txt
> > > +++ b/Documentation/thermal/intel_powerclamp.rst
> > > @@ -1,10 +1,13 @@
> > > - =======================
> > > - INTEL POWERCLAMP DRIVER
> > > - =======================
> > > -By: Arjan van de Ven <[email protected]>
> > > - Jacob Pan <[email protected]>
> > > +=======================
> > > +Intel Powerclamp Driver
> > > +=======================
> > > +
> > > +By:
> > > + - Arjan van de Ven <[email protected]>
> > > + - Jacob Pan <[email protected]>
> > > +
> > > +.. Contents:
> > >
> > > -Contents:
> > > (*) Introduction
> > > - Goals and Objectives
> > >
> > > @@ -23,7 +26,6 @@ Contents:
> > > - Generic Thermal Layer (sysfs)
> > > - Kernel APIs (TBD)
> > >
> > > -============
> > > INTRODUCTION
> > > ============
> > >
> > > @@ -47,7 +49,6 @@ scalability, and user experience. In many
> > > cases,
> > > clear advantage is
> > > shown over taking the CPU offline or modulating the CPU clock.
> > >
> > >
> > > -===================
> > > THEORY OF OPERATION
> > > ===================
> > >
> > > @@ -57,11 +58,12 @@ Idle Injection
> > > On modern Intel processors (Nehalem or later), package level C-
> > > state
> > > residency is available in MSRs, thus also available to the
> > > kernel.
> > >
> > > -These MSRs are:
> > > - #define MSR_PKG_C2_RESIDENCY 0x60D
> > > - #define MSR_PKG_C3_RESIDENCY 0x3F8
> > > - #define MSR_PKG_C6_RESIDENCY 0x3F9
> > > - #define MSR_PKG_C7_RESIDENCY 0x3FA
> > > +These MSRs are::
> > > +
> > > + #define MSR_PKG_C2_RESIDENCY 0x60D
> > > + #define MSR_PKG_C3_RESIDENCY 0x3F8
> > > + #define MSR_PKG_C6_RESIDENCY 0x3F9
> > > + #define MSR_PKG_C7_RESIDENCY 0x3FA
> > >
> > > If the kernel can also inject idle time to the system, then a
> > > closed-loop control system can be established that manages
> > > package
> > > @@ -96,19 +98,21 @@ are not masked. Tests show that the extra
> > > wakeups
> > > from scheduler tick
> > > have a dramatic impact on the effectiveness of the powerclamp
> > > driver
> > > on large scale systems (Westmere system with 80 processors).
> > >
> > > -CPU0
> > > - ____________ ____________
> > > -kidle_inject/0 | sleep | mwait | sleep |
> > > - _________| |________| |_______
> > > - duration
> > > -CPU1
> > > - ____________ ____________
> > > -kidle_inject/1 | sleep | mwait | sleep |
> > > - _________| |________| |_______
> > > - ^
> > > - |
> > > - |
> > > - roundup(jiffies, interval)
> > > +::
> > > +
> > > + CPU0
> > > + ____________ ____________
> > > + kidle_inject/0 | sleep | mwait | sleep |
> > > + _________| |________| |_______
> > > + duration
> > > + CPU1
> > > + ____________ ____________
> > > + kidle_inject/1 | sleep | mwait | sleep |
> > > + _________| |________| |_______
> > > + ^
> > > + |
> > > + |
> > > + roundup(jiffies, interval)
> > >
> > > Only one CPU is allowed to collect statistics and update global
> > > control parameters. This CPU is referred to as the controlling
> > > CPU
> > > in
> > > @@ -148,7 +152,7 @@ b) determine the amount of compensation
> > > needed at
> > > each target ratio
> > >
> > > Compensation to each target ratio consists of two parts:
> > >
> > > - a) steady state error compensation
> > > + a) steady state error compensation
> > > This is to offset the error occurring when the system
> > > can
> > > enter idle without extra wakeups (such as external
> > > interrupts).
> > >
> > > @@ -158,41 +162,42 @@ Compensation to each target ratio consists
> > > of
> > > two parts:
> > > slowing down CPU activities.
> > >
> > > A debugfs file is provided for the user to examine compensation
> > > -progress and results, such as on a Westmere system.
> > > -[jacob@nex01 ~]$ cat
> > > -/sys/kernel/debug/intel_powerclamp/powerclamp_calib
> > > -controlling cpu: 0
> > > -pct confidence steady dynamic (compensation)
> > > -0 0 0 0
> > > -1 1 0 0
> > > -2 1 1 0
> > > -3 3 1 0
> > > -4 3 1 0
> > > -5 3 1 0
> > > -6 3 1 0
> > > -7 3 1 0
> > > -8 3 1 0
> > > -...
> > > -30 3 2 0
> > > -31 3 2 0
> > > -32 3 1 0
> > > -33 3 2 0
> > > -34 3 1 0
> > > -35 3 2 0
> > > -36 3 1 0
> > > -37 3 2 0
> > > -38 3 1 0
> > > -39 3 2 0
> > > -40 3 3 0
> > > -41 3 1 0
> > > -42 3 2 0
> > > -43 3 1 0
> > > -44 3 1 0
> > > -45 3 2 0
> > > -46 3 3 0
> > > -47 3 0 0
> > > -48 3 2 0
> > > -49 3 3 0
> > > +progress and results, such as on a Westmere system::
> > > +
> > > + [jacob@nex01 ~]$ cat
> > > + /sys/kernel/debug/intel_powerclamp/powerclamp_calib
> > > + controlling cpu: 0
> > > + pct confidence steady dynamic (compensation)
> > > + 0 0 0 0
> > > + 1 1 0 0
> > > + 2 1 1 0
> > > + 3 3 1 0
> > > + 4 3 1 0
> > > + 5 3 1 0
> > > + 6 3 1 0
> > > + 7 3 1 0
> > > + 8 3 1 0
> > > + ...
> > > + 30 3 2 0
> > > + 31 3 2 0
> > > + 32 3 1 0
> > > + 33 3 2 0
> > > + 34 3 1 0
> > > + 35 3 2 0
> > > + 36 3 1 0
> > > + 37 3 2 0
> > > + 38 3 1 0
> > > + 39 3 2 0
> > > + 40 3 3 0
> > > + 41 3 1 0
> > > + 42 3 2 0
> > > + 43 3 1 0
> > > + 44 3 1 0
> > > + 45 3 2 0
> > > + 46 3 3 0
> > > + 47 3 0 0
> > > + 48 3 2 0
> > > + 49 3 3 0
> > >
> > > Calibration occurs during runtime. No offline method is
> > > available.
> > > Steady state compensation is used only when confidence levels of
> > > all
> > > @@ -217,9 +222,8 @@ keeps track of clamping kernel threads, even
> > > after they are migrated
> > > to other CPUs, after a CPU offline event.
> > >
> > >
> > > -=====================
> > > Performance Analysis
> > > -=====================
> > > +====================
> > > This section describes the general performance data collected on
> > > multiple systems, including Westmere (80P) and Ivy Bridge (4P,
> > > 8P).
> > >
> > > @@ -257,16 +261,15 @@ achieve up to 40% better performance per
> > > watt.
> > > (measured by a spin
> > > counter summed over per CPU counting threads spawned for all
> > > running
> > > CPUs).
> > >
> > > -====================
> > > Usage and Interfaces
> > > ====================
> > > The powerclamp driver is registered to the generic thermal layer
> > > as
> > > a
> > > -cooling device. Currently, it’s not bound to any thermal zones.
> > > +cooling device. Currently, it’s not bound to any thermal zones::
> > >
> > > -jacob@chromoly:/sys/class/thermal/cooling_device14$ grep . *
> > > -cur_state:0
> > > -max_state:50
> > > -type:intel_powerclamp
> > > + jacob@chromoly:/sys/class/thermal/cooling_device14$ grep . *
> > > + cur_state:0
> > > + max_state:50
> > > + type:intel_powerclamp
> > >
> > > cur_state allows user to set the desired idle percentage.
> > > Writing 0
> > > to
> > > cur_state will stop idle injection. Writing a value between 1
> > > and
> > > @@ -278,9 +281,9 @@ cur_state returns value -1 instead of 0 which
> > > is
> > > to avoid confusing
> > > 100% busy state with the disabled state.
> > >
> > > Example usage:
> > > -- To inject 25% idle time
> > > -$ sudo sh -c "echo 25 >
> > > /sys/class/thermal/cooling_device80/cur_state
> > > -"
> > > +- To inject 25% idle time::
> > > +
> > > + $ sudo sh -c "echo 25 >
> > > /sys/class/thermal/cooling_device80/cur_state
> > >
> > > If the system is not busy and has more than 25% idle time
> > > already,
> > > then the powerclamp driver will not start idle injection. Using
> > > Top
> > > @@ -292,23 +295,23 @@ idle time is accounted as normal idle in
> > > that
> > > common code path is
> > > taken as the idle task.
> > >
> > > In this example, 24.1% idle is shown. This helps the system
> > > admin or
> > > -user determine the cause of slowdown, when a powerclamp driver
> > > is in
> > > action.
> > > +user determine the cause of slowdown, when a powerclamp driver
> > > is in
> > > action::
> > >
> > >
> > > -Tasks: 197 total, 1 running, 196 sleeping, 0 stopped, 0
> > > zombie
> > > -Cpu(s): 71.2%us, 4.7%sy, 0.0%ni,
> > > 24.1%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
> > > -Mem: 3943228k total, 1689632k used, 2253596k free, 74960k
> > > buffers
> > > -Swap: 4087804k total, 0k used, 4087804k free, 945336k
> > > cached
> > > + Tasks: 197 total, 1 running, 196 sleeping, 0 stopped, 0
> > > zombie
> > > + Cpu(s): 71.2%us, 4.7%sy, 0.0%ni,
> > > 24.1%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
> > > + Mem: 3943228k total, 1689632k used, 2253596k
> > > free, 74960k
> > > buffers
> > > + Swap: 4087804k total, 0k used, 4087804k
> > > free, 945336k
> > > cached
> > >
> > > - PID USER PR NI VIRT RES SHR S %CPU
> > > %MEM TIME+ COMMAND
> > > - 3352 jacob 20 0 262m 644 428 S 286 0.0 0:17.16
> > > spin
> > > - 3341 root -51 0 0 0 0 D 25 0.0 0:01.62
> > > kidle_inject/0
> > > - 3344 root -51 0 0 0 0 D 25 0.0 0:01.60
> > > kidle_inject/3
> > > - 3342 root -51 0 0 0 0 D 25 0.0 0:01.61
> > > kidle_inject/1
> > > - 3343 root -51 0 0 0 0 D 25 0.0 0:01.60
> > > kidle_inject/2
> > > - 2935 jacob 20 0 696m 125m 35m S 5 3.3 0:31.11
> > > firefox
> > > - 1546 root 20 0 158m 20m 6640 S 3 0.5 0:26.97
> > > Xorg
> > > - 2100 jacob 20 0 1223m 88m 30m S 3 2.3 0:23.68
> > > compiz
> > > + PID USER PR NI VIRT RES SHR S %CPU
> > > %MEM TIME+ COMMAND
> > > + 3352 jacob 20 0 262m 644 428 S 286 0.0 0:17.16
> > > spin
> > > + 3341 root -51 0 0 0 0 D 25 0.0 0:01.62
> > > kidle_inject/0
> > > + 3344 root -51 0 0 0 0 D 25 0.0 0:01.60
> > > kidle_inject/3
> > > + 3342 root -51 0 0 0 0 D 25 0.0 0:01.61
> > > kidle_inject/1
> > > + 3343 root -51 0 0 0 0 D 25 0.0 0:01.60
> > > kidle_inject/2
> > > + 2935 jacob 20 0 696m 125m 35m S 5 3.3 0:31.11
> > > firefox
> > > + 1546 root 20 0 158m 20m 6640 S 3 0.5 0:26.97
> > > Xorg
> > > + 2100 jacob 20 0 1223m 88m 30m S 3 2.3 0:23.68
> > > compiz
> > >
> > > Tests have shown that by using the powerclamp driver as a
> > > cooling
> > > device, a PID based userspace thermal controller can manage to
> > > diff --git a/Documentation/thermal/nouveau_thermal
> > > b/Documentation/thermal/nouveau_thermal.rst
> > > similarity index 64%
> > > rename from Documentation/thermal/nouveau_thermal
> > > rename to Documentation/thermal/nouveau_thermal.rst
> > > index 6e17a11efcb0..37255fd6735d 100644
> > > --- a/Documentation/thermal/nouveau_thermal
> > > +++ b/Documentation/thermal/nouveau_thermal.rst
> > > @@ -1,13 +1,15 @@
> > > +=====================
> > > Kernel driver nouveau
> > > -===================
> > > +=====================
> > >
> > > Supported chips:
> > > +
> > > * NV43+
> > >
> > > Authors: Martin Peres (mupuf) <[email protected]>
> > >
> > > Description
> > > ----------
> > > +-----------
> > >
> > > This driver allows to read the GPU core temperature, drive the
> > > GPU
> > > fan and
> > > set temperature alarms.
> > > @@ -19,20 +21,25 @@ interface is likely not to work. This
> > > document
> > > may then not cover your situation
> > > entirely.
> > >
> > > Temperature management
> > > ---------------------
> > > +----------------------
> > >
> > > Temperature is exposed under as a read-only HWMON attribute
> > > temp1_input.
> > >
> > > In order to protect the GPU from overheating, Nouveau supports 4
> > > configurable
> > > temperature thresholds:
> > >
> > > - * Fan_boost: Fan speed is set to 100% when reaching this
> > > temperature;
> > > - * Downclock: The GPU will be downclocked to reduce its power
> > > dissipation;
> > > - * Critical: The GPU is put on hold to further lower power
> > > dissipation;
> > > - * Shutdown: Shut the computer down to protect your GPU.
> > > + * Fan_boost:
> > > + Fan speed is set to 100% when reaching this temperature;
> > > + * Downclock:
> > > + The GPU will be downclocked to reduce its power
> > > dissipation;
> > > + * Critical:
> > > + The GPU is put on hold to further lower power
> > > dissipation;
> > > + * Shutdown:
> > > + Shut the computer down to protect your GPU.
> > >
> > > -WARNING: Some of these thresholds may not be used by Nouveau
> > > depending
> > > -on your chipset.
> > > +WARNING:
> > > + Some of these thresholds may not be used by Nouveau
> > > depending
> > > + on your chipset.
> > >
> > > The default value for these thresholds comes from the GPU's
> > > vbios.
> > > These
> > > thresholds can be configured thanks to the following HWMON
> > > attributes:
> > > @@ -46,19 +53,24 @@ NOTE: Remember that the values are stored as
> > > milli degrees Celsius. Don't forget
> > > to multiply!
> > >
> > > Fan management
> > > -------------
> > > +--------------
> > >
> > > Not all cards have a drivable fan. If you do, then the following
> > > HWMON
> > > attributes should be available:
> > >
> > > - * pwm1_enable: Current fan management mode (NONE, MANUAL or
> > > AUTO);
> > > - * pwm1: Current PWM value (power percentage);
> > > - * pwm1_min: The minimum PWM speed allowed;
> > > - * pwm1_max: The maximum PWM speed allowed (bypassed when
> > > hitting
> > > Fan_boost);
> > > + * pwm1_enable:
> > > + Current fan management mode (NONE, MANUAL or AUTO);
> > > + * pwm1:
> > > + Current PWM value (power percentage);
> > > + * pwm1_min:
> > > + The minimum PWM speed allowed;
> > > + * pwm1_max:
> > > + The maximum PWM speed allowed (bypassed when hitting
> > > Fan_boost);
> > >
> > > You may also have the following attribute:
> > >
> > > - * fan1_input: Speed in RPM of your fan.
> > > + * fan1_input:
> > > + Speed in RPM of your fan.
> > >
> > > Your fan can be driven in different modes:
> > >
> > > @@ -66,14 +78,16 @@ Your fan can be driven in different modes:
> > > * 1: The fan can be driven in manual (use pwm1 to change the
> > > speed);
> > > * 2; The fan is driven automatically depending on the
> > > temperature.
> > >
> > > -NOTE: Be sure to use the manual mode if you want to drive the
> > > fan
> > > speed manually
> > > +NOTE:
> > > + Be sure to use the manual mode if you want to drive the fan
> > > speed
> > > manually
> > >
> > > -NOTE2: When operating in manual mode outside the vbios-defined
> > > -[PWM_min, PWM_max] range, the reported fan speed (RPM) may not
> > > be
> > > accurate
> > > -depending on your hardware.
> > > +NOTE2:
> > > + When operating in manual mode outside the vbios-defined
> > > + [PWM_min, PWM_max] range, the reported fan speed (RPM) may not
> > > be
> > > accurate
> > > + depending on your hardware.
> > >
> > > Bug reports
> > > ----------
> > > +-----------
> > >
> > > Thermal management on Nouveau is new and may not work on all
> > > cards.
> > > If you have
> > > inquiries, please ping mupuf on IRC (#nouveau, freenode).
> > > diff --git a/Documentation/thermal/power_allocator.txt
> > > b/Documentation/thermal/power_allocator.rst
> > > similarity index 74%
> > > rename from Documentation/thermal/power_allocator.txt
> > > rename to Documentation/thermal/power_allocator.rst
> > > index 9fb0ff06dca9..67b6a3297238 100644
> > > --- a/Documentation/thermal/power_allocator.txt
> > > +++ b/Documentation/thermal/power_allocator.rst
> > > @@ -1,3 +1,4 @@
> > > +=================================
> > > Power allocator governor tunables
> > > =================================
> > >
> > > @@ -25,36 +26,36 @@ temperature as the control input and power as
> > > the
> > > controlled output:
> > > P_max = k_p * e + k_i * err_integral + k_d * diff_err +
> > > sustainable_power
> > >
> > > where
> > > - e = desired_temperature - current_temperature
> > > - err_integral is the sum of previous errors
> > > - diff_err = e - previous_error
> > > + - e = desired_temperature - current_temperature
> > > + - err_integral is the sum of previous errors
> > > + - diff_err = e - previous_error
> > >
> > > -It is similar to the one depicted below:
> > > +It is similar to the one depicted below::
> > >
> > > - k_d
> > > - |
> > > -current_temp |
> > > - | v
> > > - | +----------+ +---+
> > > - | +----->| diff_err |-->| X |------+
> > > - | | +----------+ +---+ |
> > > - | | | tdp
> > > ac
> > > tor
> > > - | | k_i | | get_r
> > > eque
> > > sted_power()
> > > - | | | | |
> > > |
> > > |
> > > - | | | | |
> > > |
> > > | ...
> > > - v | v v v
> > > v
> > > v
> > > - +---+ | +-------+ +---+ +---+ +---+ +-
> > > ----
> > > -----+
> > > - | S |-------+----->| sum e |----->| X |--->| S |-->| S |
> > > -->|power |
> > > - +---+ | +-------+ +---+ +---+ +---
> > > + |allocation|
> > > - ^ | ^ +-
> > > ----
> > > -----+
> > > - | | |
> > > |
> > > |
> > > - | | +---
> > > + | | |
> > > - | +------->| X |-------------------
> > > + v v
> > > - | +---
> > > + granted
> > > performance
> > > -desired_temperature ^
> > > - |
> > > - |
> > > - k_po/k_pu
> > > + k_d
> > > + |
> > > + current_temp |
> > > + | v
> > > + | +----------+ +---+
> > > + | +----->| diff_err |-->| X |------+
> > > + | | +----------+ +---+ |
> > > + | | | tdp
> > > ac
> > > tor
> > > + | | k_i | | get_r
> > > eque
> > > sted_power()
> > > + | | | | |
> > > |
> > > |
> > > + | | | | |
> > > |
> > > | ...
> > > + v | v v v
> > > v
> > > v
> > > + +---+ | +-------+ +---+ +---+ +---+ +-
> > > ----
> > > -----+
> > > + | S |-----+----->| sum e |----->| X |--->| S |-->| S |
> > > -->|power |
> > > + +---+ | +-------+ +---+ +---+ +---
> > > + |allocation|
> > > + ^ | ^ +-
> > > ----
> > > -----+
> > > + | | |
> > > |
> > > |
> > > + | | +---
> > > + | | |
> > > + | +------->| X |-------------------
> > > + v v
> > > + | +---
> > > + granted
> > > performance
> > > + desired_temperature ^
> > > + |
> > > + |
> > > + k_po/k_pu
> > >
> > > Sustainable power
> > > -----------------
> > > @@ -73,7 +74,7 @@ is typically 2000mW, while on a 10" tablet is
> > > around 4500mW (may vary
> > > depending on screen size).
> > >
> > > If you are using device tree, do add it as a property of the
> > > -thermal-zone. For example:
> > > +thermal-zone. For example::
> > >
> > > thermal-zones {
> > > soc_thermal {
> > > @@ -85,7 +86,7 @@ thermal-zone. For example:
> > > Instead, if the thermal zone is registered from the platform
> > > code,
> > > pass a
> > > `thermal_zone_params` that has a `sustainable_power`. If no
> > > `thermal_zone_params` were being passed, then something like
> > > below
> > > -will suffice:
> > > +will suffice::
> > >
> > > static const struct thermal_zone_params tz_params = {
> > > .sustainable_power = 3500,
> > > @@ -112,18 +113,18 @@ available capacity at a low
> > > temperature. On
> > > the other hand, a high
> > > value of `k_pu` will result in the governor granting very high
> > > power
> > > while temperature is low, and may lead to temperature
> > > overshooting.
> > >
> > > -The default value for `k_pu` is:
> > > +The default value for `k_pu` is::
> > >
> > > 2 * sustainable_power / (desired_temperature -
> > > switch_on_temp)
> > >
> > > This means that at `switch_on_temp` the output of the
> > > controller's
> > > proportional term will be 2 * `sustainable_power`. The default
> > > value
> > > -for `k_po` is:
> > > +for `k_po` is::
> > >
> > > sustainable_power / (desired_temperature - switch_on_temp)
> > >
> > > Focusing on the proportional and feed forward values of the PID
> > > -controller equation we have:
> > > +controller equation we have::
> > >
> > > P_max = k_p * e + sustainable_power
> > >
> > > @@ -134,21 +135,23 @@ is the desired one, then the proportional
> > > component is zero and
> > > thermal equilibrium under constant load. `sustainable_power` is
> > > only
> > > an estimate, which is the reason for closed-loop control such as
> > > this.
> > >
> > > -Expanding `k_pu` we get:
> > > +Expanding `k_pu` we get::
> > > +
> > > P_max = 2 * sustainable_power * (T_set - T) / (T_set - T_on)
> > > +
> > > - sustainable_power
> > > + sustainable_power
> > >
> > > -where
> > > - T_set is the desired temperature
> > > - T is the current temperature
> > > - T_on is the switch on temperature
> > > +where:
> > > +
> > > + - T_set is the desired temperature
> > > + - T is the current temperature
> > > + - T_on is the switch on temperature
> > >
> > > When the current temperature is the switch_on temperature, the
> > > above
> > > -formula becomes:
> > > +formula becomes::
> > >
> > > P_max = 2 * sustainable_power * (T_set - T_on) / (T_set -
> > > T_on)
> > > +
> > > - sustainable_power = 2 * sustainable_power +
> > > sustainable_power =
> > > - 3 * sustainable_power
> > > + sustainable_power = 2 * sustainable_power +
> > > sustainable_power =
> > > + 3 * sustainable_power
> > >
> > > Therefore, the proportional term alone linearly decreases power
> > > from
> > > 3 * `sustainable_power` to `sustainable_power` as the
> > > temperature
> > > @@ -178,11 +181,18 @@ Cooling device power API
> > > Cooling devices controlled by this governor must supply the
> > > additional
> > > "power" API in their `cooling_device_ops`. It consists on three
> > > ops:
> > >
> > > -1. int get_requested_power(struct thermal_cooling_device *cdev,
> > > - struct thermal_zone_device *tz, u32 *power);
> > > -@cdev: The `struct thermal_cooling_device` pointer
> > > -@tz: thermal zone in which we are currently operating
> > > -@power: pointer in which to store the calculated power
> > > +1. ::
> > > +
> > > + int get_requested_power(struct thermal_cooling_device *cdev,
> > > + struct thermal_zone_device *tz, u32
> > > *power);
> > > +
> > > +
> > > +@cdev:
> > > + The `struct thermal_cooling_device` pointer
> > > +@tz:
> > > + thermal zone in which we are currently operating
> > > +@power:
> > > + pointer in which to store the calculated power
> > >
> > > `get_requested_power()` calculates the power requested by the
> > > device
> > > in milliwatts and stores it in @power . It should return 0 on
> > > @@ -190,23 +200,37 @@ success, -E* on failure. This is currently
> > > used by the power
> > > allocator governor to calculate how much power to give to each
> > > cooling
> > > device.
> > >
> > > -2. int state2power(struct thermal_cooling_device *cdev, struct
> > > - thermal_zone_device *tz, unsigned long state, u32
> > > *power);
> > > -@cdev: The `struct thermal_cooling_device` pointer
> > > -@tz: thermal zone in which we are currently operating
> > > -@state: A cooling device state
> > > -@power: pointer in which to store the equivalent power
> > > +2. ::
> > > +
> > > + int state2power(struct thermal_cooling_device *cdev,
> > > struct
> > > + thermal_zone_device *tz, unsigned long
> > > state,
> > > + u32 *power);
> > > +
> > > +@cdev:
> > > + The `struct thermal_cooling_device` pointer
> > > +@tz:
> > > + thermal zone in which we are currently operating
> > > +@state:
> > > + A cooling device state
> > > +@power:
> > > + pointer in which to store the equivalent power
> > >
> > > Convert cooling device state @state into power consumption in
> > > milliwatts and store it in @power. It should return 0 on
> > > success,
> > > -E*
> > > on failure. This is currently used by thermal core to calculate
> > > the
> > > maximum power that an actor can consume.
> > >
> > > -3. int power2state(struct thermal_cooling_device *cdev, u32
> > > power,
> > > - unsigned long *state);
> > > -@cdev: The `struct thermal_cooling_device` pointer
> > > -@power: power in milliwatts
> > > -@state: pointer in which to store the resulting state
> > > +3. ::
> > > +
> > > + int power2state(struct thermal_cooling_device *cdev, u32
> > > power,
> > > + unsigned long *state);
> > > +
> > > +@cdev:
> > > + The `struct thermal_cooling_device` pointer
> > > +@power:
> > > + power in milliwatts
> > > +@state:
> > > + pointer in which to store the resulting state
> > >
> > > Calculate a cooling device state that would make the device
> > > consume
> > > at
> > > most @power mW and store it in @state. It should return 0 on
> > > success,
> > > diff --git a/Documentation/thermal/sysfs-api.txt
> > > b/Documentation/thermal/sysfs-api.rst
> > > similarity index 66%
> > > rename from Documentation/thermal/sysfs-api.txt
> > > rename to Documentation/thermal/sysfs-api.rst
> > > index c3fa500df92c..e4930761d3e5 100644
> > > --- a/Documentation/thermal/sysfs-api.txt
> > > +++ b/Documentation/thermal/sysfs-api.rst
> > > @@ -1,3 +1,4 @@
> > > +===================================
> > > Generic Thermal Sysfs driver How To
> > > ===================================
> > >
> > > @@ -9,6 +10,7 @@ Copyright (c) 2008 Intel Corporation
> > >
> > >
> > > 0. Introduction
> > > +===============
> > >
> > > The generic thermal sysfs provides a set of interfaces for
> > > thermal
> > > zone
> > > devices (sensors) and thermal cooling devices (fan,
> > > processor...) to
> > > register
> > > @@ -25,59 +27,90 @@ An intelligent thermal management application
> > > can
> > > make decisions based on
> > > inputs from thermal zone attributes (the current temperature and
> > > trip point
> > > temperature) and throttle appropriate devices.
> > >
> > > -[0-*] denotes any positive number starting from 0
> > > -[1-*] denotes any positive number starting from 1
> > > +- `[0-*]` denotes any positive number starting from 0
> > > +- `[1-*]` denotes any positive number starting from 1
> > >
> > > 1. thermal sysfs driver interface functions
> > > +===========================================
> > >
> > > 1.1 thermal zone device interface
> > > -1.1.1 struct thermal_zone_device
> > > *thermal_zone_device_register(char
> > > *type,
> > > - int trips, int mask, void *devdata,
> > > - struct thermal_zone_device_ops *ops,
> > > - const struct thermal_zone_params *tzp,
> > > - int passive_delay, int polling_delay))
> > > +---------------------------------
> > > +
> > > + ::
> > > +
> > > + struct thermal_zone_device
> > > + *thermal_zone_device_register(char *type,
> > > + int trips, int mask, void
> > > *devdata,
> > > + struct
> > > thermal_zone_device_ops
> > > *ops,
> > > + const struct
> > > thermal_zone_params *tzp,
> > > + int passive_delay, int
> > > polling_delay))
> > >
> > > This interface function adds a new thermal zone device
> > > (sensor)
> > > to
> > > - /sys/class/thermal folder as thermal_zone[0-*]. It tries to
> > > bind
> > > all the
> > > + /sys/class/thermal folder as `thermal_zone[0-*]`. It tries
> > > to
> > > bind all the
> > > thermal cooling devices registered at the same time.
> > >
> > > - type: the thermal zone type.
> > > - trips: the total number of trip points this thermal zone
> > > supports.
> > > - mask: Bit string: If 'n'th bit is set, then trip point 'n'
> > > is
> > > writeable.
> > > - devdata: device private data
> > > - ops: thermal zone device call-backs.
> > > - .bind: bind the thermal zone device with a thermal
> > > cooling
> > > device.
> > > - .unbind: unbind the thermal zone device with a thermal
> > > cooling device.
> > > - .get_temp: get the current temperature of the thermal
> > > zone.
> > > - .set_trips: set the trip points window. Whenever the
> > > current
> > > temperature
> > > + type:
> > > + the thermal zone type.
> > > + trips:
> > > + the total number of trip points this thermal zone
> > > supports.
> > > + mask:
> > > + Bit string: If 'n'th bit is set, then trip point 'n' is
> > > writeable.
> > > + devdata:
> > > + device private data
> > > + ops:
> > > + thermal zone device call-backs.
> > > +
> > > + .bind:
> > > + bind the thermal zone device with a thermal
> > > cooling
> > > device.
> > > + .unbind:
> > > + unbind the thermal zone device with a thermal
> > > cooling device.
> > > + .get_temp:
> > > + get the current temperature of the thermal zone.
> > > + .set_trips:
> > > + set the trip points window. Whenever the
> > > current
> > > temperature
> > > is updated, the trip points immediately
> > > below
> > > and above the
> > > current temperature are found.
> > > - .get_mode: get the current mode (enabled/disabled) of
> > > the
> > > thermal zone.
> > > - - "enabled" means the kernel thermal management is
> > > enabled.
> > > - - "disabled" will prevent kernel thermal driver
> > > action
> > > upon trip points
> > > - so that user applications can take charge of
> > > thermal
> > > management.
> > > - .set_mode: set the mode (enabled/disabled) of the
> > > thermal
> > > zone.
> > > - .get_trip_type: get the type of certain trip point.
> > > - .get_trip_temp: get the temperature above which the
> > > certain
> > > trip point
> > > + .get_mode:
> > > + get the current mode (enabled/disabled) of
> > > the
> > > thermal zone.
> > > +
> > > + - "enabled" means the kernel thermal
> > > management is
> > > + enabled.
> > > + - "disabled" will prevent kernel thermal
> > > driver action
> > > + upon trip points so that user
> > > applications
> > > can take
> > > + charge of thermal management.
> > > + .set_mode:
> > > + set the mode (enabled/disabled) of the thermal
> > > zone.
> > > + .get_trip_type:
> > > + get the type of certain trip point.
> > > + .get_trip_temp:
> > > + get the temperature above which the
> > > certain
> > > trip point
> > > will be fired.
> > > - .set_emul_temp: set the emulation temperature which
> > > helps in
> > > debugging
> > > + .set_emul_temp:
> > > + set the emulation temperature which
> > > helps in
> > > debugging
> > > different threshold temperature points.
> > > - tzp: thermal zone platform parameters.
> > > - passive_delay: number of milliseconds to wait between polls
> > > when
> > > + tzp:
> > > + thermal zone platform parameters.
> > > + passive_delay:
> > > + number of milliseconds to wait between polls when
> > > performing passive cooling.
> > > - polling_delay: number of milliseconds to wait between polls
> > > when
> > > checking
> > > + polling_delay:
> > > + number of milliseconds to wait between polls when
> > > checking
> > > whether trip points have been crossed (0 for interrupt
> > > driven systems).
> > >
> > > + ::
> > >
> > > -1.1.2 void thermal_zone_device_unregister(struct
> > > thermal_zone_device
> > > *tz)
> > > + void thermal_zone_device_unregister(struct
> > > thermal_zone_device *tz)
> > >
> > > This interface function removes the thermal zone device.
> > > It deletes the corresponding entry from /sys/class/thermal
> > > folder and
> > > unbinds all the thermal cooling devices it uses.
> > >
> > > -1.1.3 struct thermal_zone_device
> > > *thermal_zone_of_sensor_register(
> > > - struct device *dev, int sensor_id, void *data,
> > > - const struct thermal_zone_of_device_ops *ops)
> > > + ::
> > > +
> > > + struct thermal_zone_device
> > > + *thermal_zone_of_sensor_register(struct device *dev,
> > > int
> > > sensor_id,
> > > + void *data,
> > > + const struct
> > > thermal_zone_of_device_ops *ops)
> > >
> > > This interface adds a new sensor to a DT thermal zone.
> > > This function will search the list of thermal zones
> > > described in
> > > @@ -87,25 +120,33 @@ temperature) and throttle appropriate
> > > devices.
> > > thermal zone device.
> > >
> > > The parameters for this interface are:
> > > - dev: Device node of sensor containing
> > > valid
> > > node pointer in
> > > +
> > > + dev:
> > > + Device node of sensor containing valid
> > > node
> > > pointer in
> > > dev->of_node.
> > > - sensor_id: a sensor identifier, in case the
> > > sensor IP
> > > has more
> > > + sensor_id:
> > > + a sensor identifier, in case the sensor
> > > IP
> > > has more
> > > than one sensors
> > > - data: a private pointer (owned by the
> > > caller)
> > > that will be
> > > + data:
> > > + a private pointer (owned by the caller)
> > > that
> > > will be
> > > passed back, when a temperature reading
> > > is
> > > needed.
> > > - ops: struct thermal_zone_of_device_ops *.
> > > + ops:
> > > + `struct thermal_zone_of_device_ops *`.
> > >
> > > - get_temp: a pointer to a function
> > > that reads the
> > > + ============== ========================
> > > ====
> > > ===========
> > > + get_temp a pointer to a function
> > > that
> > > reads the
> > > sensor temperature. This
> > > is
> > > mandatory
> > > callback provided by
> > > sensor
> > > driver.
> > > - set_trips: a pointer to a function
> > > that
> > > sets a
> > > + set_trips a pointer to a function
> > > that sets a
> > > temperature window. When
> > > this window is
> > > left the driver must
> > > inform
> > > the thermal
> > > core via
> > > thermal_zone_device_update.
> > > - get_trend: a pointer to a
> > > function
> > > that reads the
> > > + get_trend a pointer to a
> > > function
> > > that reads the
> > > sensor temperature
> > > trend.
> > > - set_emul_temp: a pointer to a
> > > function that sets
> > > + set_emul_temp a pointer to a
> > > function
> > > that sets
> > > sensor emulated
> > > temperature.
> > > + ============== ========================
> > > ====
> > > ===========
> > > +
> > > The thermal zone temperature is provided by the
> > > get_temp()
> > > function
> > > pointer of thermal_zone_of_device_ops. When called, it
> > > will
> > > have the private pointer @data back.
> > > @@ -114,8 +155,10 @@ temperature) and throttle appropriate
> > > devices.
> > > handle. Caller should check the return handle with
> > > IS_ERR()
> > > for finding
> > > whether success or not.
> > >
> > > -1.1.4 void thermal_zone_of_sensor_unregister(struct device *dev,
> > > - struct thermal_zone_device *tzd)
> > > + ::
> > > +
> > > + void thermal_zone_of_sensor_unregister(struct device
> > > *dev,
> > > + struct
> > > thermal_zone_device *tzd)
> > >
> > > This interface unregisters a sensor from a DT thermal
> > > zone
> > > which was
> > > successfully added by interface
> > > thermal_zone_of_sensor_register().
> > > @@ -124,21 +167,29 @@ temperature) and throttle appropriate
> > > devices.
> > > interface. It will also silent the zone by remove the
> > > .get_temp() and
> > > get_trend() thermal zone device callbacks.
> > >
> > > -1.1.5 struct thermal_zone_device
> > > *devm_thermal_zone_of_sensor_register(
> > > - struct device *dev, int sensor_id,
> > > - void *data, const struct
> > > thermal_zone_of_device_ops
> > > *ops)
> > > + ::
> > > +
> > > + struct thermal_zone_device
> > > + *devm_thermal_zone_of_sensor_register(struct device
> > > *dev,
> > > + int sensor_id,
> > > + void *data,
> > > + const struct
> > > thermal_zone_of_device_ops *ops)
> > >
> > > This interface is resource managed version of
> > > thermal_zone_of_sensor_register().
> > > +
> > > All details of thermal_zone_of_sensor_register()
> > > described
> > > in
> > > section 1.1.3 is applicable here.
> > > +
> > > The benefit of using this interface to register sensor
> > > is
> > > that it
> > > is not require to explicitly call
> > > thermal_zone_of_sensor_unregister()
> > > in error path or during driver unbinding as this is done
> > > by
> > > driver
> > > resource manager.
> > >
> > > -1.1.6 void devm_thermal_zone_of_sensor_unregister(struct device
> > > *dev,
> > > - struct thermal_zone_device *tzd)
> > > + ::
> > > +
> > > + void
> > > devm_thermal_zone_of_sensor_unregister(struct
> > > device *dev,
> > > + struct
> > > thermal_zone_device *tzd)
> > >
> > > This interface is resource managed version of
> > > thermal_zone_of_sensor_unregister().
> > > @@ -147,123 +198,186 @@ temperature) and throttle appropriate
> > > devices.
> > > Normally this function will not need to be called and
> > > the
> > > resource
> > > management code will ensure that the resource is freed.
> > >
> > > -1.1.7 int thermal_zone_get_slope(struct thermal_zone_device *tz)
> > > + ::
> > > +
> > > + int thermal_zone_get_slope(struct
> > > thermal_zone_device *tz)
> > >
> > > This interface is used to read the slope attribute value
> > > for the thermal zone device, which might be useful for
> > > platform
> > > drivers for temperature calculations.
> > >
> > > -1.1.8 int thermal_zone_get_offset(struct thermal_zone_device
> > > *tz)
> > > + ::
> > > +
> > > + int thermal_zone_get_offset(struct
> > > thermal_zone_device *tz)
> > >
> > > This interface is used to read the offset attribute
> > > value
> > > for the thermal zone device, which might be useful for
> > > platform
> > > drivers for temperature calculations.
> > >
> > > 1.2 thermal cooling device interface
> > > -1.2.1 struct thermal_cooling_device
> > > *thermal_cooling_device_register(char *name,
> > > - void *devdata, struct thermal_cooling_device_ops
> > > *)
> > > +------------------------------------
> > > +
> > > +
> > > + ::
> > > +
> > > + struct thermal_cooling_device
> > > + *thermal_cooling_device_register(char *name,
> > > + void *devdata, struct
> > > thermal_cooling_device_ops *)
> > >
> > > This interface function adds a new thermal cooling device
> > > (fan/processor/...)
> > > - to /sys/class/thermal/ folder as cooling_device[0-*]. It
> > > tries
> > > to bind itself
> > > + to /sys/class/thermal/ folder as `cooling_device[0-*]`. It
> > > tries
> > > to bind itself
> > > to all the thermal zone devices registered at the same time.
> > > - name: the cooling device name.
> > > - devdata: device private data.
> > > - ops: thermal cooling devices call-backs.
> > > - .get_max_state: get the Maximum throttle state of the
> > > cooling device.
> > > - .get_cur_state: get the Currently requested throttle
> > > state
> > > of the cooling device.
> > > - .set_cur_state: set the Current throttle state of the
> > > cooling device.
> > > -
> > > -1.2.2 void thermal_cooling_device_unregister(struct
> > > thermal_cooling_device *cdev)
> > > +
> > > + name:
> > > + the cooling device name.
> > > + devdata:
> > > + device private data.
> > > + ops:
> > > + thermal cooling devices call-backs.
> > > +
> > > + .get_max_state:
> > > + get the Maximum throttle state of the cooling
> > > device.
> > > + .get_cur_state:
> > > + get the Currently requested throttle state of
> > > the
> > > + cooling device.
> > > + .set_cur_state:
> > > + set the Current throttle state of the cooling
> > > device.
> > > +
> > > + ::
> > > +
> > > + void thermal_cooling_device_unregister(struct
> > > thermal_cooling_device *cdev)
> > >
> > > This interface function removes the thermal cooling device.
> > > It deletes the corresponding entry from /sys/class/thermal
> > > folder and
> > > unbinds itself from all the thermal zone devices using it.
> > >
> > > 1.3 interface for binding a thermal zone device with a thermal
> > > cooling device
> > > -1.3.1 int thermal_zone_bind_cooling_device(struct
> > > thermal_zone_device *tz,
> > > - int trip, struct thermal_cooling_device *cdev,
> > > - unsigned long upper, unsigned long lower, unsigned int
> > > weight);
> > > +--------------------------------------------------------------
> > > ----
> > > -----------
> > > +
> > > + ::
> > > +
> > > + int thermal_zone_bind_cooling_device(struct
> > > thermal_zone_device *tz,
> > > + int trip, struct thermal_cooling_device *cdev,
> > > + unsigned long upper, unsigned long lower,
> > > unsigned
> > > int weight);
> > >
> > > This interface function binds a thermal cooling device to a
> > > particular trip
> > > point of a thermal zone device.
> > > +
> > > This function is usually called in the thermal zone device
> > > .bind
> > > callback.
> > > - tz: the thermal zone device
> > > - cdev: thermal cooling device
> > > - trip: indicates which trip point in this thermal zone the
> > > cooling device
> > > - is associated with.
> > > - upper:the Maximum cooling state for this trip point.
> > > - THERMAL_NO_LIMIT means no upper limit,
> > > +
> > > + tz:
> > > + the thermal zone device
> > > + cdev:
> > > + thermal cooling device
> > > + trip:
> > > + indicates which trip point in this thermal zone the
> > > cooling device
> > > + is associated with.
> > > + upper:
> > > + the Maximum cooling state for this trip point.
> > > + THERMAL_NO_LIMIT means no upper limit,
> > > and the cooling device can be in max_state.
> > > - lower:the Minimum cooling state can be used for this trip
> > > point.
> > > - THERMAL_NO_LIMIT means no lower limit,
> > > + lower:
> > > + the Minimum cooling state can be used for this trip
> > > point.
> > > + THERMAL_NO_LIMIT means no lower limit,
> > > and the cooling device can be in cooling state 0.
> > > - weight: the influence of this cooling device in this thermal
> > > - zone. See 1.4.1 below for more information.
> > > + weight:
> > > + the influence of this cooling device in this thermal
> > > + zone. See 1.4.1 below for more information.
> > >
> > > -1.3.2 int thermal_zone_unbind_cooling_device(struct
> > > thermal_zone_device *tz,
> > > - int trip, struct thermal_cooling_device *cdev);
> > > + ::
> > > +
> > > + int thermal_zone_unbind_cooling_device(struct
> > > thermal_zone_device *tz,
> > > + int trip, struct
> > > thermal_cooling_device *cdev);
> > >
> > > This interface function unbinds a thermal cooling device
> > > from a
> > > particular
> > > trip point of a thermal zone device. This function is
> > > usually
> > > called in
> > > the thermal zone device .unbind callback.
> > > - tz: the thermal zone device
> > > - cdev: thermal cooling device
> > > - trip: indicates which trip point in this thermal zone the
> > > cooling device
> > > - is associated with.
> > > +
> > > + tz:
> > > + the thermal zone device
> > > + cdev:
> > > + thermal cooling device
> > > + trip:
> > > + indicates which trip point in this thermal zone the
> > > cooling
> > > device
> > > + is associated with.
> > >
> > > 1.4 Thermal Zone Parameters
> > > -1.4.1 struct thermal_bind_params
> > > +---------------------------
> > > +
> > > + ::
> > > +
> > > + struct thermal_bind_params
> > > +
> > > This structure defines the following parameters that are
> > > used to
> > > bind
> > > a zone with a cooling device for a particular trip point.
> > > - .cdev: The cooling device pointer
> > > - .weight: The 'influence' of a particular cooling device on
> > > this
> > > - zone. This is relative to the rest of the cooling
> > > - devices. For example, if all cooling devices have a
> > > - weight of 1, then they all contribute the same. You
> > > can
> > > - use percentages if you want, but it's not
> > > mandatory. A
> > > - weight of 0 means that this cooling device doesn't
> > > - contribute to the cooling of this zone unless all
> > > cooling
> > > - devices have a weight of 0. If all weights are 0,
> > > then
> > > - they all contribute the same.
> > > - .trip_mask:This is a bit mask that gives the binding
> > > relation
> > > between
> > > - this thermal zone and cdev, for a particular trip
> > > point.
> > > - If nth bit is set, then the cdev and thermal zone
> > > are
> > > bound
> > > - for trip point n.
> > > - .binding_limits: This is an array of cooling state limits.
> > > Must
> > > have
> > > - exactly 2 *
> > > thermal_zone.number_of_trip_points.
> > > It is an
> > > - array consisting of tuples <lower-state
> > > upper-
> > > state> of
> > > - state limits. Each trip will be associated
> > > with
> > > one state
> > > - limit tuple when binding. A NULL pointer
> > > means
> > > - <THERMAL_NO_LIMITS THERMAL_NO_LIMITS> on
> > > all
> > > trips.
> > > - These limits are used when binding a cdev
> > > to a
> > > trip point.
> > > - .match: This call back returns success(0) if the 'tz and
> > > cdev'
> > > need to
> > > +
> > > + .cdev:
> > > + The cooling device pointer
> > > + .weight:
> > > + The 'influence' of a particular cooling device on
> > > this
> > > + zone. This is relative to the rest of the cooling
> > > + devices. For example, if all cooling devices have a
> > > + weight of 1, then they all contribute the same. You
> > > can
> > > + use percentages if you want, but it's not
> > > mandatory. A
> > > + weight of 0 means that this cooling device doesn't
> > > + contribute to the cooling of this zone unless all
> > > cooling
> > > + devices have a weight of 0. If all weights are 0,
> > > then
> > > + they all contribute the same.
> > > + .trip_mask:
> > > + This is a bit mask that gives the binding
> > > relation
> > > between
> > > + this thermal zone and cdev, for a particular trip
> > > point.
> > > + If nth bit is set, then the cdev and thermal zone
> > > are
> > > bound
> > > + for trip point n.
> > > + .binding_limits:
> > > + This is an array of cooling state limits.
> > > Must
> > > have
> > > + exactly 2 *
> > > thermal_zone.number_of_trip_points.
> > > It is an
> > > + array consisting of tuples <lower-state
> > > upper-
> > > state> of
> > > + state limits. Each trip will be associated
> > > with
> > > one state
> > > + limit tuple when binding. A NULL pointer
> > > means
> > > + <THERMAL_NO_LIMITS THERMAL_NO_LIMITS> on
> > > all
> > > trips.
> > > + These limits are used when binding a cdev
> > > to a
> > > trip point.
> > > + .match:
> > > + This call back returns success(0) if the 'tz and
> > > cdev'
> > > need to
> > > be bound, as per platform data.
> > > -1.4.2 struct thermal_zone_params
> > > +
> > > + ::
> > > +
> > > + struct thermal_zone_params
> > > +
> > > This structure defines the platform level parameters for a
> > > thermal zone.
> > > This data, for each thermal zone should come from the
> > > platform
> > > layer.
> > > This is an optional feature where some platforms can choose
> > > not
> > > to
> > > provide this data.
> > > - .governor_name: Name of the thermal governor used for this
> > > zone
> > > - .no_hwmon: a boolean to indicate if the thermal to hwmon
> > > sysfs
> > > interface
> > > - is required. when no_hwmon == false, a hwmon
> > > sysfs
> > > interface
> > > - will be created. when no_hwmon == true, nothing
> > > will
> > > be done.
> > > - In case the thermal_zone_params is NULL, the
> > > hwmon
> > > interface
> > > - will be created (for backward compatibility).
> > > - .num_tbps: Number of thermal_bind_params entries for this
> > > zone
> > > - .tbp: thermal_bind_params entries
> > > +
> > > + .governor_name:
> > > + Name of the thermal governor used for this zone
> > > + .no_hwmon:
> > > + a boolean to indicate if the thermal to hwmon
> > > sysfs
> > > interface
> > > + is required. when no_hwmon == false, a hwmon
> > > sysfs
> > > interface
> > > + will be created. when no_hwmon == true, nothing
> > > will
> > > be done.
> > > + In case the thermal_zone_params is NULL, the
> > > hwmon
> > > interface
> > > + will be created (for backward compatibility).
> > > + .num_tbps:
> > > + Number of thermal_bind_params entries for this
> > > zone
> > > + .tbp:
> > > + thermal_bind_params entries
> > >
> > > 2. sysfs attributes structure
> > > +=============================
> > >
> > > +== ================
> > > RO read only value
> > > WO write only value
> > > RW read/write value
> > > +== ================
> > >
> > > Thermal sysfs attributes will be represented under
> > > /sys/class/thermal.
> > > Hwmon sysfs I/F extension is also available under
> > > /sys/class/hwmon
> > > if hwmon is compiled in or built as a module.
> > >
> > > -Thermal zone device sys I/F, created once it's registered:
> > > -/sys/class/thermal/thermal_zone[0-*]:
> > > +Thermal zone device sys I/F, created once it's registered::
> > > +
> > > + /sys/class/thermal/thermal_zone[0-*]:
> > > |---type: Type of the thermal zone
> > > |---temp: Current temperature
> > > |---mode: Working mode of the thermal
> > > zone
> > > @@ -282,8 +396,9 @@ Thermal zone device sys I/F, created once
> > > it's
> > > registered:
> > > |---slope: Slope constant applied as linear
> > > extrapolation
> > > |---offset: Offset constant applied as
> > > linear
> > > extrapolation
> > >
> > > -Thermal cooling device sys I/F, created once it's registered:
> > > -/sys/class/thermal/cooling_device[0-*]:
> > > +Thermal cooling device sys I/F, created once it's registered::
> > > +
> > > + /sys/class/thermal/cooling_device[0-*]:
> > > |---type: Type of the cooling
> > > device(processor/fan/...)
> > > |---max_state: Maximum cooling state of the
> > > cooling device
> > > |---cur_state: Current cooling state of the
> > > cooling device
> > > @@ -299,11 +414,13 @@ the relationship between a thermal zone and
> > > its
> > > associated cooling device.
> > > They are created/removed for each successful execution of
> > > thermal_zone_bind_cooling_device/thermal_zone_unbind_cooling_dev
> > > ice.
> > >
> > > -/sys/class/thermal/thermal_zone[0-*]:
> > > +::
> > > +
> > > + /sys/class/thermal/thermal_zone[0-*]:
> > > |---cdev[0-*]: [0-*]th cooling device in
> > > current
> > > thermal zone
> > > |---cdev[0-*]_trip_point: Trip point that cdev[0-*]
> > > is
> > > associated with
> > > |---cdev[0-*]_weight: Influence of the cooling device
> > > in
> > > - this thermal zone
> > > + this thermal zone
> > >
> > > Besides the thermal zone device sysfs I/F and cooling device
> > > sysfs
> > > I/F,
> > > the generic thermal driver also creates a hwmon sysfs I/F for
> > > each
> > > _type_
> > > @@ -311,16 +428,17 @@ of thermal zone device. E.g. the generic
> > > thermal driver registers one hwmon
> > > class device and build the associated hwmon sysfs I/F for all
> > > the
> > > registered
> > > ACPI thermal zones.
> > >
> > > -/sys/class/hwmon/hwmon[0-*]:
> > > +::
> > > +
> > > + /sys/class/hwmon/hwmon[0-*]:
> > > |---name: The type of the thermal
> > > zone
> > > devices
> > > |---temp[1-*]_input: The current temperature of
> > > thermal
> > > zone [1-*]
> > > |---temp[1-*]_critical: The critical trip point of
> > > thermal zone [1-*]
> > >
> > > Please read Documentation/hwmon/sysfs-interface.rst for
> > > additional
> > > information.
> > >
> > > -***************************
> > > -* Thermal zone attributes *
> > > -***************************
> > > +Thermal zone attributes
> > > +-----------------------
> > >
> > > type
> > > Strings which represent the thermal zone type.
> > > @@ -340,54 +458,67 @@ mode
> > > This file gives information about the algorithm that is
> > > currently
> > > managing the thermal zone. It can be either default
> > > kernel
> > > based
> > > algorithm or user space application.
> > > - enabled = enable Kernel Thermal
> > > management.
> > > - disabled = Preventing kernel thermal zone driver
> > > actions upon
> > > +
> > > + enabled
> > > + enable Kernel Thermal management.
> > > + disabled
> > > + Preventing kernel thermal zone driver
> > > actions upon
> > > trip points so that user application
> > > can
> > > take full
> > > charge of the thermal management.
> > > +
> > > RW, Optional
> > >
> > > policy
> > > One of the various thermal governors used for a
> > > particular
> > > zone.
> > > +
> > > RW, Required
> > >
> > > available_policies
> > > Available thermal governors which can be used for a
> > > particular zone.
> > > +
> > > RO, Required
> > >
> > > -trip_point_[0-*]_temp
> > > +`trip_point_[0-*]_temp`
> > > The temperature above which trip point will be fired.
> > > +
> > > Unit: millidegree Celsius
> > > +
> > > RO, Optional
> > >
> > > -trip_point_[0-*]_type
> > > +`trip_point_[0-*]_type`
> > > Strings which indicate the type of the trip point.
> > > - E.g. it can be one of critical, hot, passive, active[0-
> > > *]
> > > for ACPI
> > > +
> > > + E.g. it can be one of critical, hot, passive, `active[0-
> > > *]`
> > > for ACPI
> > > thermal zone.
> > > +
> > > RO, Optional
> > >
> > > -trip_point_[0-*]_hyst
> > > +`trip_point_[0-*]_hyst`
> > > The hysteresis value for a trip point, represented as an
> > > integer
> > > Unit: Celsius
> > > RW, Optional
> > >
> > > -cdev[0-*]
> > > +`cdev[0-*]`
> > > Sysfs link to the thermal cooling device node where the
> > > sys
> > > I/F
> > > for cooling device throttling control represents.
> > > +
> > > RO, Optional
> > >
> > > -cdev[0-*]_trip_point
> > > - The trip point in this thermal zone which cdev[0-*] is
> > > associated
> > > +`cdev[0-*]_trip_point`
> > > + The trip point in this thermal zone which `cdev[0-*]` is
> > > associated
> > > with; -1 means the cooling device is not associated with
> > > any
> > > trip
> > > point.
> > > +
> > > RO, Optional
> > >
> > > -cdev[0-*]_weight
> > > - The influence of cdev[0-*] in this thermal zone. This
> > > value
> > > - is relative to the rest of cooling devices in the
> > > thermal
> > > - zone. For example, if a cooling device has a weight
> > > double
> > > - than that of other, it's twice as effective in cooling
> > > the
> > > - thermal zone.
> > > - RW, Optional
> > > +`cdev[0-*]_weight`
> > > + The influence of `cdev[0-*]` in this thermal zone. This
> > > value
> > > + is relative to the rest of cooling devices in the
> > > thermal
> > > + zone. For example, if a cooling device has a weight
> > > double
> > > + than that of other, it's twice as effective in cooling
> > > the
> > > + thermal zone.
> > > +
> > > + RW, Optional
> > >
> > > passive
> > > Attribute is only present for zones in which the passive
> > > cooling
> > > @@ -395,8 +526,11 @@ passive
> > > and can be set to a temperature (in millidegrees) to
> > > enable
> > > a
> > > passive trip point for the zone. Activation is done by
> > > polling with
> > > an interval of 1 second.
> > > +
> > > Unit: millidegrees Celsius
> > > +
> > > Valid values: 0 (disabled) or greater than 1000
> > > +
> > > RW, Optional
> > >
> > > emul_temp
> > > @@ -407,17 +541,21 @@ emul_temp
> > > threshold and its associated cooling action. This is
> > > write
> > > only node
> > > and writing 0 on this node should disable emulation.
> > > Unit: millidegree Celsius
> > > +
> > > WO, Optional
> > >
> > > - WARNING: Be careful while enabling this option on
> > > production systems,
> > > - because userland can easily disable the thermal policy
> > > by
> > > simply
> > > - flooding this sysfs node with low temperature values.
> > > + WARNING:
> > > + Be careful while enabling this option on production
> > > systems,
> > > + because userland can easily disable the thermal
> > > policy
> > > by simply
> > > + flooding this sysfs node with low temperature
> > > values.
> > >
> > > sustainable_power
> > > An estimate of the sustained power that can be
> > > dissipated by
> > > the thermal zone. Used by the power allocator governor.
> > > For
> > > - more information see
> > > Documentation/thermal/power_allocator.txt
> > > + more information see
> > > Documentation/thermal/power_allocator.rst
> > > +
> > > Unit: milliwatts
> > > +
> > > RW, Optional
> > >
> > > k_po
> > > @@ -425,7 +563,8 @@ k_po
> > > controller during temperature overshoot. Temperature
> > > overshoot
> > > is when the current temperature is above the "desired
> > > temperature" trip point. For more information see
> > > - Documentation/thermal/power_allocator.txt
> > > + Documentation/thermal/power_allocator.rst
> > > +
> > > RW, Optional
> > >
> > > k_pu
> > > @@ -433,20 +572,23 @@ k_pu
> > > controller during temperature undershoot. Temperature
> > > undershoot
> > > is when the current temperature is below the "desired
> > > temperature" trip point. For more information see
> > > - Documentation/thermal/power_allocator.txt
> > > + Documentation/thermal/power_allocator.rst
> > > +
> > > RW, Optional
> > >
> > > k_i
> > > The integral term of the power allocator governor's PID
> > > controller. This term allows the PID controller to
> > > compensate
> > > for long term drift. For more information see
> > > - Documentation/thermal/power_allocator.txt
> > > + Documentation/thermal/power_allocator.rst
> > > +
> > > RW, Optional
> > >
> > > k_d
> > > The derivative term of the power allocator governor's
> > > PID
> > > controller. For more information see
> > > - Documentation/thermal/power_allocator.txt
> > > + Documentation/thermal/power_allocator.rst
> > > +
> > > RW, Optional
> > >
> > > integral_cutoff
> > > @@ -456,8 +598,10 @@ integral_cutoff
> > > example, if integral_cutoff is 0, then the integral term
> > > only
> > > accumulates error when temperature is above the desired
> > > temperature trip point. For more information see
> > > - Documentation/thermal/power_allocator.txt
> > > + Documentation/thermal/power_allocator.rst
> > > +
> > > Unit: millidegree Celsius
> > > +
> > > RW, Optional
> > >
> > > slope
> > > @@ -465,6 +609,7 @@ slope
> > > to determine a hotspot temperature based off the
> > > sensor's
> > > raw readings. It is up to the device driver to determine
> > > the usage of these values.
> > > +
> > > RW, Optional
> > >
> > > offset
> > > @@ -472,28 +617,33 @@ offset
> > > to determine a hotspot temperature based off the
> > > sensor's
> > > raw readings. It is up to the device driver to determine
> > > the usage of these values.
> > > +
> > > RW, Optional
> > >
> > > -*****************************
> > > -* Cooling device attributes *
> > > -*****************************
> > > +Cooling device attributes
> > > +-------------------------
> > >
> > > type
> > > String which represents the type of device, e.g:
> > > +
> > > - for generic ACPI: should be "Fan", "Processor" or
> > > "LCD"
> > > - for memory controller device on intel_menlow platform:
> > > should be "Memory controller".
> > > +
> > > RO, Required
> > >
> > > max_state
> > > The maximum permissible cooling state of this cooling
> > > device.
> > > +
> > > RO, Required
> > >
> > > cur_state
> > > The current cooling state of this cooling device.
> > > The value can any integer numbers between 0 and
> > > max_state:
> > > +
> > > - cur_state == 0 means no cooling
> > > - cur_state == max_state means the maximum cooling.
> > > +
> > > RW, Required
> > >
> > > stats/reset
> > > @@ -508,9 +658,11 @@ stats/time_in_state_ms:
> > > units here is 10mS (similar to other time exported in
> > > /proc).
> > > RO, Required
> > >
> > > +
> > > stats/total_trans:
> > > A single positive value showing the total number of
> > > times
> > > the state of a
> > > cooling device is changed.
> > > +
> > > RO, Required
> > >
> > > stats/trans_table:
> > > @@ -522,6 +674,7 @@ stats/trans_table:
> > > RO, Required
> > >
> > > 3. A simple implementation
> > > +==========================
> > >
> > > ACPI thermal zone may support multiple trip points like
> > > critical,
> > > hot,
> > > passive, active. If an ACPI thermal zone supports critical,
> > > passive,
> > > @@ -532,11 +685,10 @@ thermal_cooling_device. Both are considered
> > > to
> > > have the same
> > > effectiveness in cooling the thermal zone.
> > >
> > > If the processor is listed in _PSL method, and the fan is listed
> > > in
> > > _AL0
> > > -method, the sys I/F structure will be built like this:
> > > +method, the sys I/F structure will be built like this::
> > >
> > > -/sys/class/thermal:
> > > -
> > > -|thermal_zone1:
> > > + /sys/class/thermal:
> > > + |thermal_zone1:
> > > |---type: acpitz
> > > |---temp: 37000
> > > |---mode: enabled
> > > @@ -557,24 +709,24 @@ method, the sys I/F structure will be built
> > > like this:
> > > |---cdev1_trip_point: 2 /* cdev1 can be used
> > > for
> > > active[0]*/
> > > |---cdev1_weight: 1024
> > >
> > > -|cooling_device0:
> > > + |cooling_device0:
> > > |---type: Processor
> > > |---max_state: 8
> > > |---cur_state: 0
> > >
> > > -|cooling_device3:
> > > + |cooling_device3:
> > > |---type: Fan
> > > |---max_state: 2
> > > |---cur_state: 0
> > >
> > > -/sys/class/hwmon:
> > > -
> > > -|hwmon0:
> > > + /sys/class/hwmon:
> > > + |hwmon0:
> > > |---name: acpitz
> > > |---temp1_input: 37000
> > > |---temp1_crit: 100000
> > >
> > > 4. Event Notification
> > > +=====================
> > >
> > > The framework includes a simple notification mechanism, in the
> > > form
> > > of a
> > > netlink event. Netlink socket initialization is done during the
> > > _init_
> > > @@ -587,21 +739,28 @@ event will be one of:{THERMAL_AUX0,
> > > THERMAL_AUX1, THERMAL_CRITICAL,
> > > THERMAL_DEV_FAULT}. Notification can be sent when the current
> > > temperature
> > > crosses any of the configured thresholds.
> > >
> > > -5. Export Symbol APIs:
> > > +5. Export Symbol APIs
> > > +=====================
> > > +
> > > +5.1. get_tz_trend
> > > +-----------------
> > >
> > > -5.1: get_tz_trend:
> > > This function returns the trend of a thermal zone, i.e the rate
> > > of
> > > change
> > > of temperature of the thermal zone. Ideally, the thermal sensor
> > > drivers
> > > are supposed to implement the callback. If they don't, the
> > > thermal
> > > framework calculated the trend by comparing the previous and the
> > > current
> > > temperature values.
> > >
> > > -5.2:get_thermal_instance:
> > > +5.2. get_thermal_instance
> > > +-------------------------
> > > +
> > > This function returns the thermal_instance corresponding to a
> > > given
> > > {thermal_zone, cooling_device, trip_point} combination. Returns
> > > NULL
> > > if such an instance does not exist.
> > >
> > > -5.3:thermal_notify_framework:
> > > +5.3. thermal_notify_framework
> > > +-----------------------------
> > > +
> > > This function handles the trip events from sensor drivers. It
> > > starts
> > > throttling the cooling devices according to the policy
> > > configured.
> > > For CRITICAL and HOT trip points, this notifies the respective
> > > drivers,
> > > @@ -609,12 +768,15 @@ and does actual throttling for other trip
> > > points i.e ACTIVE and PASSIVE.
> > > The throttling policy is based on the configured platform data;
> > > if
> > > no
> > > platform data is provided, this uses the step_wise throttling
> > > policy.
> > >
> > > -5.4:thermal_cdev_update:
> > > +5.4. thermal_cdev_update
> > > +------------------------
> > > +
> > > This function serves as an arbitrator to set the state of a
> > > cooling
> > > device. It sets the cooling device to the deepest cooling state
> > > if
> > > possible.
> > >
> > > -6. thermal_emergency_poweroff:
> > > +6. thermal_emergency_poweroff
> > > +=============================
> > >
> > > On an event of critical trip temperature crossing. Thermal
> > > framework
> > > allows the system to shutdown gracefully by calling
> > > orderly_poweroff().
> > > diff --git a/Documentation/thermal/x86_pkg_temperature_thermal
> > > b/Documentation/thermal/x86_pkg_temperature_thermal.rst
> > > similarity index 80%
> > > rename from Documentation/thermal/x86_pkg_temperature_thermal
> > > rename to Documentation/thermal/x86_pkg_temperature_thermal.rst
> > > index 17a3a4c0a0ca..f134dbd3f5a9 100644
> > > --- a/Documentation/thermal/x86_pkg_temperature_thermal
> > > +++ b/Documentation/thermal/x86_pkg_temperature_thermal.rst
> > > @@ -1,19 +1,23 @@
> > > +===================================
> > > Kernel driver: x86_pkg_temp_thermal
> > > -===================
> > > +===================================
> > >
> > > Supported chips:
> > > +
> > > * x86: with package level thermal management
> > > +
> > > (Verify using: CPUID.06H:EAX[bit 6] =1)
> > >
> > > Authors: Srinivas Pandruvada <[email protected]
> > > m>
> > >
> > > Reference
> > > ----
> > > +---------
> > > +
> > > Intel® 64 and IA-32 Architectures Software Developer’s Manual
> > > (Jan,
> > > 2013):
> > > Chapter 14.6: PACKAGE LEVEL THERMAL MANAGEMENT
> > >
> > > Description
> > > ----------
> > > +-----------
> > >
> > > This driver register CPU digital temperature package level
> > > sensor as
> > > a thermal
> > > zone with maximum two user mode configurable trip points. Number
> > > of
> > > trip points
> > > @@ -25,23 +29,27 @@ take any action to control temperature.
> > > Threshold management
> > > --------------------
> > > Each package will register as a thermal zone under
> > > /sys/class/thermal.
> > > -Example:
> > > -/sys/class/thermal/thermal_zone1
> > > +
> > > +Example::
> > > +
> > > + /sys/class/thermal/thermal_zone1
> > >
> > > This contains two trip points:
> > > +
> > > - trip_point_0_temp
> > > - trip_point_1_temp
> > >
> > > User can set any temperature between 0 to TJ-Max temperature.
> > > Temperature units
> > > -are in milli-degree Celsius. Refer to
> > > "Documentation/thermal/sysfs-
> > > api.txt" for
> > > +are in milli-degree Celsius. Refer to
> > > "Documentation/thermal/sysfs-
> > > api.rst" for
> > > thermal sys-fs details.
> > >
> > > Any value other than 0 in these trip points, can trigger thermal
> > > notifications.
> > > Setting 0, stops sending thermal notifications.
> > >
> > > -Thermal notifications: To get kobject-uevent notifications, set
> > > the
> > > thermal zone
> > > -policy to "user_space". For example: echo -n "user_space" >
> > > policy
> > > -
> > > -
> > > +Thermal notifications:
> > > +To get kobject-uevent notifications, set the thermal zone
> > > +policy to "user_space".
> > >
> > > +For example::
> > >
> > > + echo -n "user_space" > policy
> > > diff --git a/MAINTAINERS b/MAINTAINERS
> > > index d9e214f68e52..b2254bc8e495 100644
> > > --- a/MAINTAINERS
> > > +++ b/MAINTAINERS
> > > @@ -15687,7 +15687,7 @@ M: Viresh Kumar <viresh.kumar@lina
> > > ro.o
> > > rg>
> > > M: Javi Merino <[email protected]>
> > > L: [email protected]
> > > S: Supported
> > > -F: Documentation/thermal/cpu-cooling-api.txt
> > > +F: Documentation/thermal/cpu-cooling-api.rst
> > > F: drivers/thermal/cpu_cooling.c
> > > F: include/linux/cpu_cooling.h
> > >
> > > diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> > > index 15a4ca5d7099..681047f8cc05 100644
> > > --- a/include/linux/thermal.h
> > > +++ b/include/linux/thermal.h
> > > @@ -251,7 +251,7 @@ struct thermal_bind_params {
> > > * platform characterization. This value is relative to
> > > the
> > > * rest of the weights so a cooling device whose weight
> > > is
> > > * double that of another cooling device is twice as
> > > - * effective. See Documentation/thermal/sysfs-api.txt
> > > for
> > > more
> > > + * effective. See Documentation/thermal/sysfs-api.rst
> > > for
> > > more
> > > * information.
> > > */
> > > int weight;
> > > @@ -259,7 +259,7 @@ struct thermal_bind_params {
> > > /*
> > > * This is a bit mask that gives the binding relation
> > > between this
> > > * thermal zone and cdev, for a particular trip point.
> > > - * See Documentation/thermal/sysfs-api.txt for more
> > > information.
> > > + * See Documentation/thermal/sysfs-api.rst for more
> > > information.
> > > */
> > > int trip_mask;
> > >
>
>
> Thanks,
> Mauro