51 Commits

Author SHA1 Message Date
UtsavBalar1231
27639feb73 Merge remote-tracking branch 'origin/LE.UM.4.2.1.r1.3' into LE.UM.4.2.1.r1-02600-QCS404.0
* origin/LE.UM.4.2.1.r1.3:
  techpack: allow building data-kernel module
  qcacld-3.0: Handle tx_power_level under radio stat
  Fix for display suspend resume crash
  regulator: cpr3-regulator: Add support for sdm660
  Revert "ARM: dts: msm: fix NFC device probe issue for sdm660"
  ARM: dts: msm: Update the PM660 GPIO definitions
  clk: qcom: Restore dsi pll clk names for sdm660
  smcinvoke : Add locking to shared variables
  ARM: decompressor: avoid speculative prefetch from protected regions
  msm: sps: Fix the SPS_DBG macro definitions
  power: qpnp-smb2: Force power-role to UFP by default
  input: touchscreen: add raydium touch driver
  ARM: dts: msm: enable xbl boot loading for IPA FW on sdxprairie
  ARM: dts: msm: remove qcom_seecom node for qcs404
  defconfig: sa8155: Enable preempt and rcu debugging configs
  mhi: cntrl: qcom: expand debug modes for new device bringup
  msm: pcie: add sa8195 pci device id support
  msm: npu: Add support to get firmware capabilities
  defconfig: sa2150p: remove cnss driver from build
  ARM: dts: msm: Add qcom_gadget node for SA515M
  ARM: dts: ipc: Change sound card name
  crypto: msm: make qcrypto and qcedev independent of DEBUG_FS
  msm: npu: Allow context switch after processing IPC message
  ARM: dts: msm: remove DP pinctrl from sa6155, sa8155 and sa8195p
  msm: mhi_dev: Fix maximum number of HW channels
  msm: mhi_dev: Remove MHI hardware channel to IPA GSI mapping
  ARM: dts: msm: remove 2nd DP and eDP from sa8195p
  ARM: DTS: msm: Update DP PLL string for SDM660
  clk: qcom: mdss: DP PLL changes for SDM660
  net: stmmac: handle dma fatal irq for IPA channels
  power: qpnp-fg-gen3: Silence an instance of -Wsizeof-array-div in clear_cycle_counter
  defconfig: qti-quin-gvm: Enable virtualized FastRPC on GVM
  driver: boot_marker: enable bootloader log mount
  defconfig: Minimal Kernel config for qcs610
  USB: configfs: Clear deactivation flag in configfs_composite_unbind()
  msm: vidc: Check image encode capabilities
  defconfig: atoll: Enable dm-snapshot
  msm: camera: isp: variable should be accessed only if match is found
  data-kernel: EMac: S2D phase 2 changes
  defconfig: enable rmnet_data driver for wearable target
  ARM: dts: msm: config primary tdm on auto platform
  mmc: sdhci-msm: Enable EMMC_BOOT_SELECT bit
  usb: dwc3-msm: Avoid access of gsi_reg for non-GSI targets
  defconfig: sa515m: Build CNSS2 driver as loadable module
  msm_bus: fix compilation when CONFIG_DEBUG_FS is disabled
  ARM: dts: msm: Add model specific configurations for SA6155 VMs
  cnss2: Add DOMAIN_ATTR_GEOMETRY attribute support
  msm:ipa:mhi: send qmi endp_desc notification to Q6
  msm: camera: isp: Fix IRQ delay handling logic
  msm: camera: isp: Change state of all CID resource to RESERVE on deinit
  net: stmmac: Enable CRC clipping bit
  drivers: thermal: Avoid multiple TSENS controller re-init simultaneously
  mhi: netdev: Open mhi channels based on state notifications from host
  clk: fix compilation when CONFIG_DEBUG_FS is disabled
  ARM: dts: msm: Add property iommu-geometry for CNSS
  Revert "binder: implement binderfs"
  msm: vidc_3x: correct ion flags for CP_CAMERA_ENCODE context bank
  ARM: dts: msm: Fix mistaken description for pcie1&3 on sa8195p
  defconfig: msm: veth: Add Veth configs
  mhi: fix compilation when CONFIG_DEBUG_FS is disabled
  debugfs: Fix !DEBUG_FS debugfs_create_automount
  ufs: fix compilation when CONFIG_DEBUG_FS is disabled
  tsens: fix compilation when CONFIG_DEBUG_FS is disabled
  gsi: fix compilation when CONFIG_DEBUG_FS is disabled
  msm: ipa: Fix compilation errors when DEBUG_FS is disabled
  hdcp_qseecom: Maintain repeater_flag appropriately
  ARM: dts: msm: support to enable CRC using DTS
  ARM: dts: msm: Add always-on flag for L12A on sa8195
  diag: dci: Synchronize dci mempool buffers alloc and free
  msm: vidc_3x: Add new video driver to support CMA buffers
  dt: sm8155: Change copyright year in DT file
  msm: vidc_3x: Add changes to read video CMA configuration information
  mm/memblock.c: fix bug in early_dyn_memhotplug
  ARM: dts: qcom: Include PM660 dtsi for SDA429
  ARM: msm: dts: Enable sdp check timer for sdm429
  char: virtio_fastrpc: Fix compile warning
  phy-msm-usb: Perform sdp_check for SDP charger as well
  msm: vidc_3x: populate sid list for each context bank
  qrtr: usb_dev: Fix kthread usage
  iommu: iommu-debug: Fix the return string
  ARM: dts: msm: Enable PDC support for VM targets
  fw-api: CL 10441255 - update fw common interface files
  fw-api: CL 10438420 - update fw common interface files
  fw-api: CL 10437857 - update fw common interface files
  fw-api: CL 10407957 - update fw common interface files
  fw-api: CL 10402317 - update fw common interface files
  fw-api: CL 10382552 - update fw common interface files
  fw-api: CL 10372014 - update fw common interface files
  fw-api: CL 10366568 - update fw common interface files
  fw-api: CL 10356226 - update fw common interface files
  msm: ipa: update check flags to handle CONFIG_DEBUG_FS
  arm64: defconfig: Add IPA configs
  Release 5.2.03.26T
  ARM: dts: msm: Add IPA device configuration for SA8155
  ARM: dts: msm: Fix cx_cdev label size for MDM9607
  clk: qcom: mdss: add dsi phy 12nm clock
  ARM: dts: msm: Add default thermal zone rules for MDM9607
  ARM: dts: msm: Add regulator cooling device for MDM9607
  usb: dwc3: gadget: Block GSI DB update after END transfer on all EPs
  qcacld-3.0: Delete older PMK of all APs which have the same PMK
  ARM: dts: msm: Add qcom_gadget node for sdxprairie
  msm: npu: Continue npu_probe() when !DEBUG_FS
  qcom: qpnp-fg-gen4: Continue fg_gen4_probe() when !DEBUG_FS
  diag: Check for valid PCIe device
  Release 5.2.03.26S
  qcacld-3.0: Disable BTM offload to fw if a peer doesn't support PMF
  init: Remove modem mounting from kernel
  ARM: dts: msm: Add eMMC, SD card support on sdm429w
  msm: adsprpc: Put upper limit on IOMMU mapping size
  ARM: dts: msm: Add QMI cooling devices for MDM9607
  soc: swr-mstr: Add delay between fifo writes to avoid overflow/underflow
  asoc: wcd937x: Update retry logic for SWR logical addr
  soc: qcom: Increase bootmarker read buffer
  qcacld-3.0: Don't send disassoc frame to fw in case of HO failure
  diag: Initialize local variables
  mhi: core: Read transfer length from an event properly
  msm: vidc_3x: Add CMA support for video hardware
  ARM: dts: msm: Enable RTB for sdmshrike
  soc: qcom: Remove redundant bootstats
  defconfig: Add required configs for USB
  kernel: sysctl: make drop_caches write-only
  ARM: dts: msm: enable POMS on TD4330 cmd panel for trinket
  ARM: dts: msm: enable POMS on TD4330 panel for trinket
  ARM: dts: msm: Add secure display ion heap for GVMs
  ARM: dts: msm: Add BLSP DTSI nodes on sdm429
  ARM: dts: msm: Add DTS to support eMMC
  defconfig: msm: Add defconfig files for SA2150P-NAND
  Release 5.2.03.26R
  ARM: dts: msm: Add ATEML touch support for atoll target
  input: touchscreen: Add support for kernel command line parsing
  ARM: dts: msm: Enable constant fps feature for atoll CPhy panel
  disp: msm: dsi: refine the logic for mode filling and calculation
  disp: msm: dsi: add panel mode restriction for DFPS and RFI
  drm: msm: dsi-staging: CPhy constant fps porch calculation
  qcacld-3.0: drop frames in the RX thread queue during peer unmap
  defconfig: sdm429w: Add support for DEBUGCC for SDM429W
  msm: mhi_dev: Avoid re-alloc of netdev interface
  defconfig: msm: Thermal Enabled on mdm9607 target
  msm: ais: Fix powerup sequence in cam driver
  defconfig: sdm429-bg: Enable CPR, MEM-ACC, Haptics configs
  msm: v4l2loopback: to create V4L2 loopback devices
  msm:ipa:change IPA client mapping for mhi protocol
  sm8150: dt: sm8150-slpi-pinctrl: Typo mistake in gpio
  binder: implement binderfs
  msm: mhi_dev: Add proper check before accessing variable
  Revert "ARM: dts: msm: Add cmd mode panel support for SDM660 MTP"
  msm: veth_ipa: Introduce front end network driver
  net: stmmac: Ethtool half duplex not supported
  ARM: dts: msm: Add the CPR regulator node for SDM429w
  defconfig: sdmsteppe: Enable USB_VIDEO_CLASS
  Release 5.2.03.26Q
  defconfig: sdm429: Add MPROC defconfig for SDM429W
  ARM: dts: msm: add new HAB physical channels for DATA_NETWORK and HSI2S
  ARM: dts: qcom: Add MPROC device nodes for sdm429w
  qcacld-3.0: Avoid peer access after peer deletion
  PM / hibernate: Make passing hibernate offsets more friendly
  usb: dwc3-msm: Keep wakeup IRQs disabled for automotive platforms
  power: smb1398: Update the max-ilim current settings
  irqchip: qcom: pdc: Add a kernel config for pdc save/restore feature
  defconfig: msm: Enable PDC_VIRT on Quin GVM platform
  irqchip: qcom: pdc: Add support for pdc-virt
  clk: qcom: gcc-sdm429w: Update plls for SDM429W
  net: stmmac: Fixed ethool speed issue
  ARM: dts: msm: Add pcie1~3 support for sa8195 virtual machine
  clk: qcom: debugcc-sdm429w: Update debugcc Kconfig
  defconfig: sdm429: Enable BLSP, SLIMBUS driver defconfig
  ARM: dts: msm: Add SPS node for sdm429
  USB: phy: msm: Check for PHY reset handle also
  ARM: dts: msm: Add USB device nodes for sdm429
  clk: qcom: Add pcie1~3 virtio clocks for sa8195p
  uapi: add ADM_AUDPROC_PERSISTENT cal type
  ARM: dts: msm: Disable shared display on DP display sa8195
  Release 5.2.03.26P
  qcacld-3.0: Update OFDM and CCK flags for packet capture mode
  Release 5.2.03.26O
  qcacld-3.0: Copy peer and radio stats correctly
  qcacld-3.0: Handle LL stats for 2nd radio
  qcacld-3.0: Return LL stats resp in caller context
  diag: Save the correct task pointer while registering dci client
  qcacmn: Mark SRD channels conditionally passive
  ARM: dts: msm: Enable constant fps feature
  drm/msm/dsi-staging: Fix porch calculation issue for constant fps
  soc: qcom: hab: add some physical channels in HAB driver
  net: stmmac: Free IPA queue memory on netdev close
  power: smb1398: Fix SOC based SMB enable condition
  emac: emac RXC clock warning
  Release 5.2.03.26N
  ARM: dts: msm: EMAC phy hw reset delay timer
  driver: input: sensors: Increase the smi130 accel buffer samples size
  qcacld-3.0: Do not enable STA roaming if any NDI connection is active
  defconfig: sm8150: Enable dm-snapshot
  defconfig: sdmsteppe: Enable dm-snapshot
  net: stmmac: Set IOC for every TSO last desc
  fw-api: Define DEST_RING_CONSUMER_PREFET_TIMER macro for qca6750
  mhi: core: Fix out of bound channel id handling
  mhi: core: improve bandwidth switch events processing
  fw-api: CL 10334178 - update fw common interface files
  spi: spi-qcom-geni: Add error interrupt handling in spi driver
  ASoC: audio-ext-clk: Add pmi clk support for tasha
  ARM: dts: msm: Tasha snd node changes for sdm660
  fw-api: CL 10322687 - update fw common interface files
  fw-api: CL 10320987 - update fw common interface files
  Release 5.2.03.26M
  ARM: dts: msm: Disable shared display on DP display sa8155
  ARM: dts: msm: Disable shared display on DP display sa6155
  fw-api: CL 10317768 - update fw common interface files
  qcacld-3.0: Prevent RSO stop sent after vdev down
  fw-api: CL 10308469 - update fw common interface files
  Release 5.2.03.26L
  qcacld-3.0: Send PER config command before WMI_ROAM_SCAN_MODE command
  Release 5.2.03.26K
  qcacld-3.0: Lock all the entry of ch power info
  drivers: rmnet: shs: Add oom handler
  fw-api: CL 10295227 - update fw common interface files
  dsp: q6adm: Update the proper param_hdr for offset
  Revert "ASoC: Add Voice over pcie support"
  msm: mdss: add support to handle LP_RX_TO/BTA_TO errors for DSI 12nm PHY
  msm: mdss: perform DSI PHY s/w reset for 12nm PHY during unblank
  msm: mdss: update the MDSS DSI ULPS exit sequence
  msm: mdss: add support to program of HSTX drivers for DSI 12nm PHY
  msm: mdss: update DSI ULPS entry/exit sequence
  fw-api: CL 10270542 - update fw common interface files
  qcom: spmi-wled: Wait for OVPs before disable module
  ion: msm: Restrict VMID_CP_CAMERA_ENCODE to read only
  msm: vidc_3x: correct ion flags for CP_CAMERA_ENCODE context bank
  fw-api: CL 10262355 - update fw common interface files
  msm: vidc_3x: Add new video driver to support CMA buffers
  msm: vidc_3x: Add changes to read video CMA configuration information
  msm: vidc_3x: populate sid list for each context bank
  msm: vidc_3x: Add CMA support for video hardware
  drivers: net: can:Threshold update for time offset
  smcinvoke: Add suspend resume support
  SMCInvoke: Process requests for active clients
  msm: mdss: add support for DSI 12nm PHY in DSI driver
  drivers: rmnet: shs: add segmentation levels for slow start flows
  msm: vidc: Fix DCVS enablement
  vidc_3x: Fix qbuf error in gralloc buffers encoding
  data-kernel: EMAC: Change defualt value for phy reset delays.
  ARM: dts: msm: EMAC phy hw reset delay timer
  ARM: dts: msm: Disable minidump-id for Modem on SDM660
  autoconf: Enable legacy avtimer for sdm660
  diag: Add protection while accessing diag client map
  Revert "drivers: usb: gadget: Change gbam setup usage in rmnet function"
  ARM: dts: msm: EMAC phy hw reset delay timer
  ARM: dts: msm: EMAC phy hw reset delay timer
  data-kernel: EMAC: read phy hw reset delay time from dtsi
  bolero: tx-macro: Fix audio distortion during amic record
  va-macro: Add autosuspend after pm_runtime_get_sync
  qcacmn: Update the mc timer state after its deleted
  qcacld-3.0: Fix while condition in rrm_fill_beacon_ies()
  asoc: codecs: avoid crash after diconnecting DP cable
  mhi: core: move certain logs to controller log buffer
  mhi: cntrl: qcom: move certain logs to controller log buffer
  mhi: cntrl: qcom: reduce timesync and bootlogger log buffer size
  mhi: cntrl: qcom: add support for controller ipc logs
  cnss2: add support for controller IPC logs
  mhi: core: add log buffer for controller bootup and shutdown
  audio-kernel: Rename hw vote rsc to digital cdc rsc mgr
  msm: ipa2: Add change to fix ipa padding
  ARM: dts: msm: Update ADC_TM compatible field for PM660
  bindings: thermal: Add compatible field for PMIC4 ADC_TM
  thermal: adc_tm: Update support for PMIC4 ADC_TM
  asoc: add new path for in call recording
  audio-kernel: Synchronize hw vote and unvote requests
  asoc: sm8150: add proxy ports for call screening in machine driver
  ARM: dts: msm: Removing quiet-therm-step node
  vidc_3x: Query Entropy property only for H264 format
  asoc: add code change for pseudo playback and capture BE DAIs.
  ASoC: Add Voice over pcie support
  defconfig: arm64: msm: Enable USB RMNET & RNDIS using IPA over BAM2BAM
  usb: gadget: f_qc_rndis: Add RNDIS support using IPA over BAM2BAM
  fbdev: msm: fix merge errors in DP
  Revert "defconfig: arm64: msm: Enable USB RMNET & RNDIS using IPA over BAM2BAM"
  ARM: dts: msm: Add rpm-smd irq number for SDM660
  ARM: dts: msm: Update msm_ext_disp string
  autoconf: Enable leagay avtimer for sdm660
  defconfig: arm64: msm: Enable USB RMNET & RNDIS using IPA over BAM2BAM
  msm: ipa: Add low-level IPA client support
  Fixing compilation failures
  uapi/media: Fix buffer size issue for NV12_UBWC.
  soc: qcom: boot_stats: Add display boot KPI
  pfk: Fixed ICE slot number for bare metal
  clk: qcom: parents need enable during set rate for SDM660
  HID: core: add usage_page_preceding flag for hid_concatenate_usage_page().
  vidc_3x: Fix HFR recording issue.
  fbdev: msm: Use dynamic allocation for SID variable.
  Revert "fbdev: msm: disable sec display".
  ARM: dts: msm: modified interrupt interrupt type for smmu
  arm64: defconfig: Add IPA realted configs
  msm: ipa: Add Kconfig changes of IPA2 driver
  ARM: dts: msm: Add compatible rmnet version for ipa2
  msm: ipa2: Add changes compatible to kernel-4.14
  msm: ipa: Add support of IPA2 driver
  msm: Disable CSID virtualization and fix SID switching for SDM660
  defconfig: msm: Enable coresight replicator, qpdi for SDM660
  coresight: add qpdi driver support in upstream implementation
  ARM: dts: msm: coresight support for SDM660
  coresight: replicator: Add CoreSight Replicator driver
  msm: vidc: Re-calculate buffer requirement
  fbdev: msm: disable sec display
  ARM: dts: msm: fix NFC device probe issue for sdm660
  msm: fbdev: dp: Add dp intf to codec ops
  ARM: dts: msm: Add default thermal zone rules for SDM660
  media: v4l2-ctrls: Add missing entry in header_mode
  msm: vidc: Fix v4l2 format warnings
  ARM: dts: msm: Update WLED configuration for sdm660
  qcacld-3.0: Possible OOB write in rrm_process_radio_measurement_request
  fixing compilation issue
  msm: vidc_3x: Add partial cache operations support
  Revert "msm: vidc_3x: Add partial cache operations support"
  defconfig: msm: Disable CONFIG_BUILD_ARM64_APPENDED_DTB_IMAGE flag
  ARM: dts: msm: Add LPM residency for sdm660
  fbdev: msm: Remove CPU sync in dma buf unmap path
  ARM: dts: msm: Add panel changes for SDM660 QRD
  defconfig: msm: Enable DP Panel config
  msm: fbdev: dp: enable audio support over DP
  ARM: dts: msm: Update supply name for vdd cx-mx wlan rail
  mdss: fbdev: Fix fence timeout error check
  ARM: dts: msm: Add energy costs for SDM660
  ARM: dts: msm: Specify WLED configuration for sdm660 MTP
  ARM: dts: msm: Enable subsystem watchdog
  ARM: dts: msm: Enable WDSP SVA for SDM660
  ARM: dts: msm: Add TSENS in thermal_zone for SDM660
  ARM: dts: msm: Remove thermal sensor_info nodes
  defconfig: msm: Enable Thermal configs for SDM660
  ARM: dts: msm: add bcl_sensors thermal zones
  ARM: dts: msm: enable LMH DCVS driver for sdm660
  drivers: thermal: lmh_dcvs: Add support to enable legacy hardware feature
  ARM: dts: msm: add gpio_key VOL_UP button on SDM660
  ARM: dts: msm: Fix slave id for pm660l_gpio
  soc: qcom: dcc: DCC driver for SDM660
  msm: vidc_3x: Assign and pass hal buffer type to smem
  msm: vidc_3x: Add partial cache operations support
  Revert "msm: vidc_3x: disable smem_cache_operations for encoder"
  defconfig: msm: Enable DP Panel config
  msm: bus: removing warning
  clk: qcom: mdss: DSI and DP PLL changes for SDM660
  clk : qcom : Update mdss byte and pxl clk names
  fbdev: changes to enable recovery ui
  fbdev: msm: Add snapshot of mdss driver
  msm: fbdev: dp: update fbdev dp driver
  msm: fbdev: Add snapshot of DP driver
  ARM: DTS: msm: Enable 14nm DP PLL clk
  Revert "msm: mdss: dsi: Add support dual roi partial update"
  Revert "msm: mdss: add multiple partial update support"
  Revert "msm: mdss: add additional LM checks for dest scalar validation"
  Revert "fbdev: changes to enable recovery ui"
  Revert "fbdev: changes to enable recovery ui"
  usb: gadget: uvc: Update frame size as per frame type
  clk: remove workaround changes for SDM660
  ARM: dts: msm: Add dtbo support for sdm660 & sda660
  defconfig: sdm : Add configs for SDM660
  ARM: dts: msm: Add audio support for SDM660
  Revert "regulator: core: TEMP change register string size"
  ARM: dts: msm: Add cmd mode panel support for SDM660 MTP
  msm: vidc_3x: disable smem_cache_operations for encoder
  defconfig: msm: Enable CPR and FG related configs for SDM660
  drivers: irqchip: qcom: Add mpm pin data for sdm660
  defconfig: sdm : Add configs for SDM660
  ARM: dts: msm: Add MPM interrupt controller for sdm660..
  ARM: dts: msm: add support for frequency scaling for SDM660.
  Temporary commit : resolve build error.
  thermal: adc_tm: adc_init for sdm660
  ARM: dts: msm: add pmic support for SDM660
  ARM: dts: msm: Update GPU bw table for SDM660
  fbdev: changes to enable recovery ui
  iio: adc: Add DRAX_TEMP channel support
  ARM: dts: msm: Add device tree for SDM660
  ASoC: sdm660: Fix compilation issue of sdm660 drivers
  clk: qcom: Add snapshot of sdm660 clocks
  msm: vidc: remove additional checks in response_handler.
  vidc: Remove firmware_cb context bank.
  defconfig: vidc: Enable video drivers for sdm660.
  msm: vidc_3x: ION Upgrade changes for video.
  Revert "msm: vidc_3x: Add snapshot of video driver"
  Revert "msm: vidc_3x: ION Upgrade changes for video"
  Revert "vidc: Remove firmware_cb context bank"
  ARM: dts: msm: rename codec name
  mm-camera_v2: Check proper VFE h/w versions
  msm: kgsl: Change default pagetable creation sequence
  msm: kgsl: Remove workaround for GPU aperture programming
  ASoC: msm: Add support for WCD interrupt config via LPI TLMM
  Revert "ARM: dts: msm: Enable global pagetable for gpu on SDM660"
  msm: sde: Fixes to enable rotator for SDM660
  vidc: Remove firmware_cb context bank
  defconfig: msm: Enable PMIC related configs for SDM660
  defconfig: sdm : Update perf configs for SDM660
  msm: mdss: add additional LM checks for dest scalar validation
  msm: mdss: add multiple partial update support
  Audio-kernel: voice: TEMP enable voice call
  msm: mdss: dsi: Add support dual roi partial update
  Revert "vidc: Temporary change to remove secure context bank"
  Revert "BACKPORT: perf_event: Add support for LSM and SELinux checks"
  Linux 4.14.163
  perf/x86/intel/bts: Fix the use of page_private()
  xen/blkback: Avoid unmapping unmapped grant pages
  s390/smp: fix physical to logical CPU map for SMT
  net: add annotations on hh->hh_len lockless accesses
  arm64: dts: meson: odroid-c2: Disable usb_otg bus to avoid power failed warning
  ath9k_htc: Discard undersized packets
  ath9k_htc: Modify byte order for an error message
  rxrpc: Fix possible NULL pointer access in ICMP handling
  selftests: rtnetlink: add addresses with fixed life time
  powerpc/pseries/hvconsole: Fix stack overread via udbg
  drm/mst: Fix MST sideband up-reply failure handling
  scsi: qedf: Do not retry ELS request if qedf_alloc_cmd fails
  fix compat handling of FICLONERANGE, FIDEDUPERANGE and FS_IOC_FIEMAP
  tty: serial: msm_serial: Fix lockup for sysrq and oops
  dt-bindings: clock: renesas: rcar-usb2-clock-sel: Fix typo in example
  media: usb: fix memory leak in af9005_identify_state
  regulator: ab8500: Remove AB8505 USB regulator
  media: flexcop-usb: ensure -EIO is returned on error condition
  Bluetooth: Fix memory leak in hci_connect_le_scan
  Bluetooth: delete a stray unlock
  Bluetooth: btusb: fix PM leak in error case of setup
  platform/x86: pmc_atom: Add Siemens CONNECT X300 to critclk_systems DMI table
  xfs: don't check for AG deadlock for realtime files in bunmapi
  scsi: qla2xxx: Drop superfluous INIT_WORK of del_work
  nfsd4: fix up replay_matches_cache()
  PM / devfreq: Check NULL governor in available_governors_show
  arm64: Revert support for execute-only user mappings
  ftrace: Avoid potential division by zero in function profiler
  exit: panic before exit_mm() on global init exit
  ALSA: firewire-motu: Correct a typo in the clock proc string
  ALSA: cs4236: fix error return comparison of an unsigned integer
  tracing: Have the histogram compare functions convert to u64 first
  tracing: Fix lock inversion in trace_event_enable_tgid_record()
  gpiolib: fix up emulated open drain outputs
  ata: ahci_brcm: Fix AHCI resources management
  ata: ahci_brcm: Allow optional reset controller to be used
  ata: libahci_platform: Export again ahci_platform_<en/dis>able_phys()
  compat_ioctl: block: handle BLKREPORTZONE/BLKRESETZONE
  compat_ioctl: block: handle Persistent Reservations
  dmaengine: Fix access to uninitialized dma_slave_caps
  locks: print unsigned ino in /proc/locks
  pstore/ram: Write new dumps to start of recycled zones
  memcg: account security cred as well to kmemcg
  mm/zsmalloc.c: fix the migrated zspage statistics.
  media: cec: avoid decrementing transmit_queue_sz if it is 0
  media: cec: CEC 2.0-only bcast messages were ignored
  media: pulse8-cec: fix lost cec_transmit_attempt_done() call
  MIPS: Avoid VDSO ABI breakage due to global register variable
  drm/sun4i: hdmi: Remove duplicate cleanup calls
  ALSA: ice1724: Fix sleep-in-atomic in Infrasonic Quartet support code
  drm: limit to INT_MAX in create_blob ioctl
  taskstats: fix data-race
  xfs: fix mount failure crash on invalid iclog memory access
  PM / hibernate: memory_bm_find_bit(): Tighten node optimisation
  xen/balloon: fix ballooned page accounting without hotplug enabled
  xen-blkback: prevent premature module unload
  IB/mlx4: Follow mirror sequence of device add during device removal
  s390/cpum_sf: Avoid SBD overflow condition in irq handler
  s390/cpum_sf: Adjust sampling interval to avoid hitting sample limits
  md: raid1: check rdev before reference in raid1_sync_request func
  net: make socket read/write_iter() honor IOCB_NOWAIT
  usb: gadget: fix wrong endpoint desc
  drm/nouveau: Move the declaration of struct nouveau_conn_atom up a bit
  scsi: libsas: stop discovering if oob mode is disconnected
  scsi: iscsi: qla4xxx: fix double free in probe
  scsi: qla2xxx: Don't call qlt_async_event twice
  scsi: lpfc: Fix memory leak on lpfc_bsg_write_ebuf_set func
  rxe: correctly calculate iCRC for unaligned payloads
  RDMA/cma: add missed unregister_pernet_subsys in init failure
  PM / devfreq: Don't fail devfreq_dev_release if not in list
  iio: adc: max9611: Fix too short conversion time delay
  nvme_fc: add module to ops template to allow module references
  UPSTREAM: selinux: sidtab reverse lookup hash table
  UPSTREAM: selinux: avoid atomic_t usage in sidtab
  UPSTREAM: selinux: check sidtab limit before adding a new entry
  UPSTREAM: selinux: fix context string corruption in convert_context()
  BACKPORT: selinux: overhaul sidtab to fix bug and improve performance
  UPSTREAM: selinux: refactor mls_context_to_sid() and make it stricter
  UPSTREAM: selinux: Cleanup printk logging in services
  UPSTREAM: scsi: ilog2: create truly constant version for sparse
  BACKPORT: selinux: use separate table for initial SID lookup
  UPSTREAM: selinux: make "selinux_policycap_names[]" const char *
  UPSTREAM: selinux: refactor sidtab conversion
  BACKPORT: selinux: wrap AVC state
  UPSTREAM: selinux: wrap selinuxfs state
  UPSTREAM: selinux: rename the {is,set}_enforcing() functions
  BACKPORT: selinux: wrap global selinux state
  UPSTREAM: selinux: Use kmem_cache for hashtab_node
  BACKPORT: perf_event: Add support for LSM and SELinux checks
  audio-kernel: dsp: TEMP Enable bluetooth
  ARM: dts: msm: Update lpi offset for SDM660
  ASoC: sdm660_cdc: Update mbhc reg struct for IN2P_CLAMP_STATE
  vidc: Temporary change to remove secure context bank
  UPSTREAM: binder: Add binder_proc logging to binderfs
  UPSTREAM: binder: Make transaction_log available in binderfs
  UPSTREAM: binder: Add stats, state and transactions files
  UPSTREAM: binder: add a mount option to show global stats
  UPSTREAM: binder: Validate the default binderfs device names.
  UPSTREAM: binder: Add default binder devices through binderfs when configured
  UPSTREAM: binder: fix CONFIG_ANDROID_BINDER_DEVICES
  UPSTREAM: android: binder: use kstrdup instead of open-coding it
  UPSTREAM: binderfs: remove separate device_initcall()
  BACKPORT: binderfs: respect limit on binder control creation
  UPSTREAM: binderfs: switch from d_add() to d_instantiate()
  UPSTREAM: binderfs: drop lock in binderfs_binder_ctl_create
  UPSTREAM: binderfs: kill_litter_super() before cleanup
  UPSTREAM: binderfs: rework binderfs_binder_device_create()
  UPSTREAM: binderfs: rework binderfs_fill_super()
  UPSTREAM: binderfs: prevent renaming the control dentry
  UPSTREAM: binderfs: remove outdated comment
  UPSTREAM: binderfs: fix error return code in binderfs_fill_super()
  UPSTREAM: binderfs: handle !CONFIG_IPC_NS builds
  BACKPORT: binderfs: reserve devices for initial mount
  UPSTREAM: binderfs: rename header to binderfs.h
  BACKPORT: binderfs: implement "max" mount option
  UPSTREAM: binderfs: make each binderfs mount a new instance
  UPSTREAM: binderfs: remove wrong kern_mount() call
  BACKPORT: binder: implement binderfs
  UPSTREAM: binder: remove BINDER_DEBUG_ENTRY()
  UPSTREAM: seq_file: Introduce DEFINE_SHOW_ATTRIBUTE() helper macro
  Revert "msm: camera_v2: CPP AXI reset at close".
  msm: camera: dtsi: arm camera gpio config for sdm660.
  UPSTREAM: exit: panic before exit_mm() on global init exit
  soc: qcom: Add support for SDA660 into socinfo driver
  defconfig: sdm : Add configs for SDM660
  ARM: dts: msm: Add dts for SDA660.
  ANDROID: cpufreq_interactive: remove unused variable
  ARM: dts: msm: add pmic support for SDM660
  defconfig: sdm660: Enable camera driver support
  audio-kernel: Pull in latest code changes from 4.0 branch
  msm: mdss: Remove validate layer logs
  regulator: core: TEMP change register string size
  defconfig : msm: Enable snd config on SDM660
  ARM: dts: msm: Snd node changes for sdm660
  Revert "ARM: dts: msm: Audio changes for SDM660"
  asoc: fix NULL pointer de-reference in asoc drivers.
  asoc: msm-pcm: Add mutex lock to protect prvt data
  msm: vidc_3x: ION Upgrade changes for video
  msm: vidc_3x: Add snapshot of video driver
  ARM: dts: msm: Enable icnss interrupts and configs
  dts: Add restrict-access to adsp_mem
  ARM: dts: msm: update DT entries for fastRPC on SDM660
  Merge multi rect traffic changes into kernel.lnx.4.14.r22-rel
  fbdev: msm: Add backlight class support for FB driver
  ARM: dts: msm: Audio changes for SDM660
  Adding perf defconfig for SDM660.
  ARM: SDM: bringup changes for SDM660
  ARM: dts: msm: Enable global pagetable for gpu on SDM660
  power: qpnp-smb2: Use chg_param.smb_version in place of smb_version.
  ARM: dts: msm: SMP2P changes for sdm660
  soc: qcom: Force sequential boot for MSA modem
  Workaround: These are work around which need to de addressed
  soc: qcom: add snapshot of MBA based modem PIL
  defconfig : Enable QCOM_COMMAND_DB and QCOM_SECURE_BUFFER
  ARM: dts: msm: Add regulator property for SMMU nodes
  msm: kgsl: Add CX peak freq for Adreno512
  defconfig : Enable KGSL
  ARM: dts: msm: Enable WLED backlight
  defconfig : msm: Enable backlight configs
  msm: mdss: fix qseed3 op_mode register programming
  msm: mdss: Skip setting up Qseed3 for non-vig pipes
  msm: mdss: Change IOMMU map sequence during splash cleanup
  msm: mdss: share MDP smmu device mappings with other mdss clients
  msm: mdss: Add support for secure camera
  msm: mdss: Enable secure display and camera feature for msmcobalt
  Revert "power: qpnp-smb2: Use chg_param.smb_version in place of smb_version"
  msm: mdss: Initialize mdss v3 pp driver ops for msmfalcon
  Revert "soc: qcom: Remove legacy scm_call API support"
  msm: mdss: Add mdss capabilities for msmfalcon
  ARM: dts: msm: Add dt entry regulator-hw-type
  msm/sde/rotator: Add sdm660 MDP rev for rotator
  dtsi: dtsi changes
  defconfig: msm: Add sdm660_defconfig
  ARM: SDM: bringup changes for SDM660
  clk: qcom: Add snapshot of sdm660 clocks
  regulator: add snapshot of cpr3-regulator and dependent drivers
  mdss: 660.14 wA
  backlight: qcom-spmi-wled: Add compatible string for SDM660
  fbdev: msm: Do SMMU attach before buffer map
  msm: mdss: Separate PP programming to advanced and deferred modes
  msm: mdss: Add PA dither support for msmcobalt
  qcacld-3.0: Possible OOB write in rrm_process_radio_measurement_request
  Initial target definition for sdm660 on 4.14
  autoconf: new config files for sdm660
  qcacld-3.0: Fix buffer overflow in HTT MSG handling
  qcacld-3.0: set same IPA bandwidth for both cons and prod pipes
  iommu: arm-smmu: Fix dev_err formatting errors
  qcacmn: Fix incorrect ref counter of vdev
  qcacld-3.0: Dont create the session from add virt interface
  qcacmn: Fix ref leak of vdev if scan is rejected

Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
2020-06-07 09:59:18 +05:30
Andrei Vagin
5665ad36ee proc: add seq_put_decimal_ull_width to speed up /proc/pid/smaps
seq_put_decimal_ull_w(m, str, val, width) prints a decimal number with a
specified minimal field width.

It is equivalent of seq_printf(m, "%s%*d", str, width, val), but it
works much faster.

== test_smaps.py
  num = 0
  with open("/proc/1/smaps") as f:
          for x in xrange(10000):
                  data = f.read()
                  f.seek(0, 0)
==

== Before patch ==
  $ time python test_smaps.py
  real    0m4.593s
  user    0m0.398s
  sys     0m4.158s

== After patch ==
  $ time python test_smaps.py
  real    0m3.828s
  user    0m0.413s
  sys     0m3.408s

$ perf -g record python test_smaps.py
== Before patch ==
-   79.01%     3.36%  python   [kernel.kallsyms]    [k] show_smap.isra.33
   - 75.65% show_smap.isra.33
      + 48.85% seq_printf
      + 15.75% __walk_page_range
      + 9.70% show_map_vma.isra.23
        0.61% seq_puts

== After patch ==
-   75.51%     4.62%  python   [kernel.kallsyms]    [k] show_smap.isra.33
   - 70.88% show_smap.isra.33
      + 24.82% seq_put_decimal_ull_w
      + 19.78% __walk_page_range
      + 12.74% seq_printf
      + 11.08% show_map_vma.isra.23
      + 1.68% seq_puts

[akpm@linux-foundation.org: fix drivers/of/unittest.c build]
Link: http://lkml.kernel.org/r/20180212074931.7227-1-avagin@openvz.org
Signed-off-by: Andrei Vagin <avagin@openvz.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: UtsavisGreat <utsavbalar1231@gmail.com>
2020-05-26 12:13:42 +05:30
Andrei Vagin
1b15341cc0 procfs: add seq_put_hex_ll to speed up /proc/pid/maps
seq_put_hex_ll() prints a number in hexadecimal notation and works
faster than seq_printf().

== test.py
  num = 0
  with open("/proc/1/maps") as f:
          while num < 10000 :
                  data = f.read()
                  f.seek(0, 0)
                 num = num + 1
==

== Before patch ==
  $  time python test.py

  real	0m1.561s
  user	0m0.257s
  sys	0m1.302s

== After patch ==
  $ time python test.py

  real	0m0.986s
  user	0m0.279s
  sys	0m0.707s

$ perf -g record python test.py:

== Before patch ==
-   67.42%     2.82%  python   [kernel.kallsyms] [k] show_map_vma.isra.22
   - 64.60% show_map_vma.isra.22
      - 44.98% seq_printf
         - seq_vprintf
            - vsnprintf
               + 14.85% number
               + 12.22% format_decode
                 5.56% memcpy_erms
      + 15.06% seq_path
      + 4.42% seq_pad
   + 2.45% __GI___libc_read

== After patch ==
-   47.35%     3.38%  python   [kernel.kallsyms] [k] show_map_vma.isra.23
   - 43.97% show_map_vma.isra.23
      + 20.84% seq_path
      - 15.73% show_vma_header_prefix
           10.55% seq_put_hex_ll
         + 2.65% seq_put_decimal_ull
           0.95% seq_putc
      + 6.96% seq_pad
   + 2.94% __GI___libc_read

[avagin@openvz.org: use unsigned int instead of int where it is suitable]
  Link: http://lkml.kernel.org/r/20180214025619.4005-1-avagin@openvz.org
[avagin@openvz.org: v2]
  Link: http://lkml.kernel.org/r/20180117082050.25406-1-avagin@openvz.org
Link: http://lkml.kernel.org/r/20180112185812.7710-1-avagin@openvz.org
Signed-off-by: Andrei Vagin <avagin@openvz.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: UtsavisGreat <utsavbalar1231@gmail.com>
2020-05-26 12:13:40 +05:30
Andy Shevchenko
f05f10630a UPSTREAM: seq_file: Introduce DEFINE_SHOW_ATTRIBUTE() helper macro
The DEFINE_SHOW_ATTRIBUTE() helper macro would be useful for current
users, which are many of them, and for new comers to decrease code
duplication.

Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Darren Hart (VMware) <dvhart@infradead.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Bug: 136497735
(cherry picked from commit a08f06bb7a0743a7fc8d571899c93d882468096e)
Change-Id: Ib60cf57dc5e979915a83848919644150d82e7058
Signed-off-by: Hridya Valsaraju <hridya@google.com>
2020-01-06 18:33:56 +00:00
Greg Kroah-Hartman
b24413180f License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.

By default all files without license information are under the default
license of the kernel, which is GPL version 2.

Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier.  The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.

This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.

How this work was done:

Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
 - file had no licensing information it it.
 - file was a */uapi/* one with no licensing information in it,
 - file was a */uapi/* one with existing licensing information,

Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.

The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne.  Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.

The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed.  Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.

Criteria used to select files for SPDX license identifier tagging was:
 - Files considered eligible had to be source code files.
 - Make and config files were included as candidates if they contained >5
   lines of source
 - File already had some variant of a license header in it (even if <5
   lines).

All documentation files were explicitly excluded.

The following heuristics were used to determine which SPDX license
identifiers to apply.

 - when both scanners couldn't find any license traces, file was
   considered to have no license information in it, and the top level
   COPYING file license applied.

   For non */uapi/* files that summary was:

   SPDX license identifier                            # files
   ---------------------------------------------------|-------
   GPL-2.0                                              11139

   and resulted in the first patch in this series.

   If that file was a */uapi/* path one, it was "GPL-2.0 WITH
   Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:

   SPDX license identifier                            # files
   ---------------------------------------------------|-------
   GPL-2.0 WITH Linux-syscall-note                        930

   and resulted in the second patch in this series.

 - if a file had some form of licensing information in it, and was one
   of the */uapi/* ones, it was denoted with the Linux-syscall-note if
   any GPL family license was found in the file or had no licensing in
   it (per prior point).  Results summary:

   SPDX license identifier                            # files
   ---------------------------------------------------|------
   GPL-2.0 WITH Linux-syscall-note                       270
   GPL-2.0+ WITH Linux-syscall-note                      169
   ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
   ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
   LGPL-2.1+ WITH Linux-syscall-note                      15
   GPL-1.0+ WITH Linux-syscall-note                       14
   ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
   LGPL-2.0+ WITH Linux-syscall-note                       4
   LGPL-2.1 WITH Linux-syscall-note                        3
   ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
   ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1

   and that resulted in the third patch in this series.

 - when the two scanners agreed on the detected license(s), that became
   the concluded license(s).

 - when there was disagreement between the two scanners (one detected a
   license but the other didn't, or they both detected different
   licenses) a manual inspection of the file occurred.

 - In most cases a manual inspection of the information in the file
   resulted in a clear resolution of the license that should apply (and
   which scanner probably needed to revisit its heuristics).

 - When it was not immediately clear, the license identifier was
   confirmed with lawyers working with the Linux Foundation.

 - If there was any question as to the appropriate license identifier,
   the file was flagged for further research and to be revisited later
   in time.

In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.

Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights.  The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.

Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.

In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.

Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
 - a full scancode scan run, collecting the matched texts, detected
   license ids and scores
 - reviewing anything where there was a license detected (about 500+
   files) to ensure that the applied SPDX license was correct
 - reviewing anything where there was no detection but the patch license
   was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
   SPDX license was correct

This produced a worksheet with 20 files needing minor correction.  This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.

These .csv files were then reviewed by Greg.  Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected.  This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.)  Finally Greg ran the script using the .csv files to
generate the patches.

Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-02 11:10:55 +01:00
Joe Perches
75ba1d07fd seq/proc: modify seq_put_decimal_[u]ll to take a const char *, not char
Allow some seq_puts removals by taking a string instead of a single
char.

[akpm@linux-foundation.org: update vmstat_show(), per Joe]
Link: http://lkml.kernel.org/r/667e1cf3d436de91a5698170a1e98d882905e956.1470704995.git.joe@perches.com
Signed-off-by: Joe Perches <joe@perches.com>
Cc: Joe Perches <joe@perches.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-10-07 18:46:30 -07:00
Linus Torvalds
34dbbcdbf6 Make file credentials available to the seqfile interfaces
A lot of seqfile users seem to be using things like %pK that uses the
credentials of the current process, but that is actually completely
wrong for filesystem interfaces.

The unix semantics for permission checking files is to check permissions
at _open_ time, not at read or write time, and that is not just a small
detail: passing off stdin/stdout/stderr to a suid application and making
the actual IO happen in privileged context is a classic exploit
technique.

So if we want to be able to look at permissions at read time, we need to
use the file open credentials, not the current ones.  Normal file
accesses can just use "f_cred" (or any of the helper functions that do
that, like file_ns_capable()), but the seqfile interfaces do not have
any such options.

It turns out that seq_file _does_ save away the user_ns information of
the file, though.  Since user_ns is just part of the full credential
information, replace that special case with saving off the cred pointer
instead, and suddenly seq_file has all the permission information it
needs.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-04-14 12:56:09 -07:00
Joe Perches
6798a8caaf fs/seq_file: convert int seq_vprint/seq_printf/etc... returns to void
The seq_<foo> function return values were frequently misused.

See: commit 1f33c41c03 ("seq_file: Rename seq_overflow() to
     seq_has_overflowed() and make public")

All uses of these return values have been removed, so convert the
return types to void.

Miscellanea:

o Move seq_put_decimal_<type> and seq_escape prototypes closer the
  other seq_vprintf prototypes
o Reorder seq_putc and seq_puts to return early on overflow
o Add argument names to seq_vprintf and seq_printf
o Update the seq_escape kernel-doc
o Convert a couple of leading spaces to tabs in seq_escape

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-09-11 15:21:34 -07:00
Andy Shevchenko
37607102c4 seq_file: provide an analogue of print_hex_dump()
This introduces a new helper and switches current users to use it.  All
patches are compiled tested. kmemleak is tested via its own test suite.

This patch (of 6):

The new seq_hex_dump() is a complete analogue of print_hex_dump().

We have few users of this functionality already. It allows to reduce their
codebase.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Joe Perches <joe@perches.com>
Cc: Tadeusz Struk <tadeusz.struk@intel.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Ingo Tuchscherer <ingo.tuchscherer@de.ibm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-09-10 13:29:01 -07:00
Kees Cook
a068acf2ee fs: create and use seq_show_option for escaping
Many file systems that implement the show_options hook fail to correctly
escape their output which could lead to unescaped characters (e.g.  new
lines) leaking into /proc/mounts and /proc/[pid]/mountinfo files.  This
could lead to confusion, spoofed entries (resulting in things like
systemd issuing false d-bus "mount" notifications), and who knows what
else.  This looks like it would only be the root user stepping on
themselves, but it's possible weird things could happen in containers or
in other situations with delegated mount privileges.

Here's an example using overlay with setuid fusermount trusting the
contents of /proc/mounts (via the /etc/mtab symlink).  Imagine the use
of "sudo" is something more sneaky:

  $ BASE="ovl"
  $ MNT="$BASE/mnt"
  $ LOW="$BASE/lower"
  $ UP="$BASE/upper"
  $ WORK="$BASE/work/ 0 0
  none /proc fuse.pwn user_id=1000"
  $ mkdir -p "$LOW" "$UP" "$WORK"
  $ sudo mount -t overlay -o "lowerdir=$LOW,upperdir=$UP,workdir=$WORK" none /mnt
  $ cat /proc/mounts
  none /root/ovl/mnt overlay rw,relatime,lowerdir=ovl/lower,upperdir=ovl/upper,workdir=ovl/work/ 0 0
  none /proc fuse.pwn user_id=1000 0 0
  $ fusermount -u /proc
  $ cat /proc/mounts
  cat: /proc/mounts: No such file or directory

This fixes the problem by adding new seq_show_option and
seq_show_option_n helpers, and updating the vulnerable show_option
handlers to use them as needed.  Some, like SELinux, need to be open
coded due to unusual existing escape mechanisms.

[akpm@linux-foundation.org: add lost chunk, per Kees]
[keescook@chromium.org: seq_show_option should be using const parameters]
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Acked-by: Jan Kara <jack@suse.com>
Acked-by: Paul Moore <paul@paul-moore.com>
Cc: J. R. Okajima <hooanon05g@gmail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-09-04 16:54:41 -07:00
Miklos Szeredi
2726d56620 vfs: add seq_file_path() helper
Turn
	seq_path(..., &file->f_path, ...);
into
	seq_file_path(..., file, ...);

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2015-06-23 18:01:07 -04:00
Tejun Heo
46385326cc bitmap, cpumask, nodemask: remove dedicated formatting functions
Now that all bitmap formatting usages have been converted to
'%*pb[l]', the separate formatting functions are unnecessary.  The
following functions are removed.

* bitmap_scn[list]printf()
* cpumask_scnprintf(), cpulist_scnprintf()
* [__]nodemask_scnprintf(), [__]nodelist_scnprintf()
* seq_bitmap[_list](), seq_cpumask[_list](), seq_nodemask[_list]()
* seq_buf_bitmask()

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-02-13 21:21:39 -08:00
Joe Perches
1f33c41c03 seq_file: Rename seq_overflow() to seq_has_overflowed() and make public
The return values of seq_printf/puts/putc are frequently misused.

Start down a path to remove all the return value uses of these
functions.

Move the seq_overflow() to a global inlined function called
seq_has_overflowed() that can be used by the users of seq_file() calls.

Update the documentation to not show return types for seq_printf
et al.  Add a description of seq_has_overflowed().

Link: http://lkml.kernel.org/p/848ac7e3d1c31cddf638a8526fa3c59fa6fdeb8a.1412031505.git.joe@perches.com

Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Joe Perches <joe@perches.com>
[ Reworked the original patch from Joe ]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2014-10-29 20:26:06 -04:00
Tetsuo Handa
839cc2a94c seq_file: introduce seq_setwidth() and seq_pad()
There are several users who want to know bytes written by seq_*() for
alignment purpose.  Currently they are using %n format for knowing it
because seq_*() returns 0 on success.

This patch introduces seq_setwidth() and seq_pad() for allowing them to
align without using %n format.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Joe Perches <joe@perches.com>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-11-15 09:32:20 +09:00
Jeff Layton
0bc77381c1 seq_file: add seq_list_*_percpu helpers
When we convert the file_lock_list to a set of percpu lists, we'll need
a way to iterate over them in order to output /proc/locks info. Add
some seq_list_*_percpu helpers to handle that.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Acked-by: J. Bruce Fields <bfields@fieldses.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-07-08 13:36:41 +04:00
Al Viro
2043f495c7 new helper: single_open_size()
Same as single_open(), but preallocates the buffer of given size.
Doesn't make any sense for sizes up to PAGE_SIZE and doesn't make
sense if output of show() exceeds PAGE_SIZE only rarely - seq_read()
will take care of growing the buffer and redoing show().  If you
_know_ that it will be large, it might make more sense to look into
saner iterator, rather than go with single-shot one.  If that's
impossible, single_open_size() might be for you.

Again, don't use that without a good reason; occasionally that's really
the best way to go, but very often there are better solutions.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-04-09 14:13:29 -04:00
Eric W. Biederman
adb37c4c67 userns: Make seq_file's user namespace accessible
struct file already has a user namespace associated with it
in file->f_cred->user_ns, unfortunately because struct
seq_file has no struct file backpointer associated with
it, it is difficult to get at the user namespace in seq_file
context.  Therefore add a helper function seq_user_ns to return
the associated user namespace and a user_ns field to struct
seq_file to be used in implementing seq_user_ns.

Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Acked-by: David S. Miller <davem@davemloft.net>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
2012-08-14 21:47:55 -07:00
Steven Whitehouse
a4808147dc seq_file: Add seq_vprintf function and export it
The existing seq_printf function is rewritten in terms of the new
seq_vprintf which is also exported to modules. This allows GFS2
(and potentially other seq_file users) to have a vprintf based
interface and to avoid an extra copy into a temporary buffer in
some cases.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Al Viro <viro@ZenIV.linux.org.uk>
2012-06-11 13:16:35 +01:00
Linus Torvalds
ed2d265d12 Merge tag 'bug-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
Pull <linux/bug.h> cleanup from Paul Gortmaker:
 "The changes shown here are to unify linux's BUG support under the one
  <linux/bug.h> file.  Due to historical reasons, we have some BUG code
  in bug.h and some in kernel.h -- i.e.  the support for BUILD_BUG in
  linux/kernel.h predates the addition of linux/bug.h, but old code in
  kernel.h wasn't moved to bug.h at that time.  As a band-aid, kernel.h
  was including <asm/bug.h> to pseudo link them.

  This has caused confusion[1] and general yuck/WTF[2] reactions.  Here
  is an example that violates the principle of least surprise:

      CC      lib/string.o
      lib/string.c: In function 'strlcat':
      lib/string.c:225:2: error: implicit declaration of function 'BUILD_BUG_ON'
      make[2]: *** [lib/string.o] Error 1
      $
      $ grep linux/bug.h lib/string.c
      #include <linux/bug.h>
      $

  We've included <linux/bug.h> for the BUG infrastructure and yet we
  still get a compile fail! [We've not kernel.h for BUILD_BUG_ON.] Ugh -
  very confusing for someone who is new to kernel development.

  With the above in mind, the goals of this changeset are:

  1) find and fix any include/*.h files that were relying on the
     implicit presence of BUG code.
  2) find and fix any C files that were consuming kernel.h and hence
     relying on implicitly getting some/all BUG code.
  3) Move the BUG related code living in kernel.h to <linux/bug.h>
  4) remove the asm/bug.h from kernel.h to finally break the chain.

  During development, the order was more like 3-4, build-test, 1-2.  But
  to ensure that git history for bisect doesn't get needless build
  failures introduced, the commits have been reorderd to fix the problem
  areas in advance.

	[1]  https://lkml.org/lkml/2012/1/3/90
	[2]  https://lkml.org/lkml/2012/1/17/414"

Fix up conflicts (new radeon file, reiserfs header cleanups) as per Paul
and linux-next.

* tag 'bug-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux:
  kernel.h: doesn't explicitly use bug.h, so don't include it.
  bug: consolidate BUILD_BUG_ON with other bug code
  BUG: headers with BUG/BUG_ON etc. need linux/bug.h
  bug.h: add include of it to various implicit C users
  lib: fix implicit users of kernel.h for TAINT_WARN
  spinlock: macroize assert_spin_locked to avoid bug.h dependency
  x86: relocate get/set debugreg fcns to include/asm/debugreg.
2012-03-24 10:08:39 -07:00
KAMEZAWA Hiroyuki
bda7bad62b procfs: speed up /proc/pid/stat, statm
Process accounting applications as top, ps visit some files under
/proc/<pid>.  With seq_put_decimal_ull(), we can optimize /proc/<pid>/stat
and /proc/<pid>/statm files.

This patch adds
  - seq_put_decimal_ll() for signed values.
  - allow delimiter == 0.
  - convert seq_printf() to seq_put_decimal_ull/ll in /proc/stat, statm.

Test result on a system with 2000+ procs.

Before patch:
  [kamezawa@bluextal test]$ top -b -n 1 | wc -l
  2223
  [kamezawa@bluextal test]$ time top -b -n 1 > /dev/null

  real    0m0.675s
  user    0m0.044s
  sys     0m0.121s

  [kamezawa@bluextal test]$ time ps -elf > /dev/null

  real    0m0.236s
  user    0m0.056s
  sys     0m0.176s

After patch:
  kamezawa@bluextal ~]$ time top -b -n 1 > /dev/null

  real    0m0.657s
  user    0m0.052s
  sys     0m0.100s

  [kamezawa@bluextal ~]$ time ps -elf > /dev/null

  real    0m0.198s
  user    0m0.050s
  sys     0m0.145s

Considering top, ps tend to scan /proc periodically, this will reduce cpu
consumption by top/ps to some extent.

[akpm@linux-foundation.org: checkpatch fixes]
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-03-23 16:58:42 -07:00
KAMEZAWA Hiroyuki
1ac101a5d6 procfs: add num_to_str() to speed up /proc/stat
== stat_check.py
num = 0
with open("/proc/stat") as f:
        while num < 1000 :
                data = f.read()
                f.seek(0, 0)
                num = num + 1
==

perf shows

    20.39%  stat_check.py  [kernel.kallsyms]    [k] format_decode
    13.41%  stat_check.py  [kernel.kallsyms]    [k] number
    12.61%  stat_check.py  [kernel.kallsyms]    [k] vsnprintf
    10.85%  stat_check.py  [kernel.kallsyms]    [k] memcpy
     4.85%  stat_check.py  [kernel.kallsyms]    [k] radix_tree_lookup
     4.43%  stat_check.py  [kernel.kallsyms]    [k] seq_printf

This patch removes most of calls to vsnprintf() by adding num_to_str()
and seq_print_decimal_ull(), which prints decimal numbers without rich
functions provided by printf().

On my 8cpu box.
== Before patch ==
[root@bluextal test]# time ./stat_check.py

real    0m0.150s
user    0m0.026s
sys     0m0.121s

== After patch ==
[root@bluextal test]# time ./stat_check.py

real    0m0.055s
user    0m0.022s
sys     0m0.030s

[akpm@linux-foundation.org: remove incorrect comment, use less statck in num_to_str(), move comment from .h to .c, simplify seq_put_decimal_ull()]
[andrea@betterlinux.com: avoid breaking the ABI in /proc/stat]
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrea Righi <andrea@betterlinux.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Glauber Costa <glommer@parallels.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Turner <pjt@google.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-03-23 16:58:42 -07:00
Paul Gortmaker
187f1882b5 BUG: headers with BUG/BUG_ON etc. need linux/bug.h
If a header file is making use of BUG, BUG_ON, BUILD_BUG_ON, or any
other BUG variant in a static inline (i.e. not in a #define) then
that header really should be including <linux/bug.h> and not just
expecting it to be implicitly present.

We can make this change risk-free, since if the files using these
headers didn't have exposure to linux/bug.h already, they would have
been causing compile failures/warnings.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2012-03-04 17:54:34 -05:00
Al Viro
8c9379e972 constify seq_file stuff
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-01-03 22:52:40 -05:00
Joe Perches
b9075fa968 treewide: use __printf not __attribute__((format(printf,...)))
Standardize the style for compiler based printf format verification.
Standardized the location of __printf too.

Done via script and a little typing.

$ grep -rPl --include=*.[ch] -w "__attribute__" * | \
  grep -vP "^(tools|scripts|include/linux/compiler-gcc.h)" | \
  xargs perl -n -i -e 'local $/; while (<>) { s/\b__attribute__\s*\(\s*\(\s*format\s*\(\s*printf\s*,\s*(.+)\s*,\s*(.+)\s*\)\s*\)\s*\)/__printf($1, $2)/g ; print; }'

[akpm@linux-foundation.org: revert arch bits]
Signed-off-by: Joe Perches <joe@perches.com>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-10-31 17:30:54 -07:00
Kay Sievers
f15146380d fs: seq_file - add event counter to simplify poll() support
Moving the event counter into the dynamically allocated 'struc seq_file'
allows poll() support without the need to allocate its own tracking
structure.

All current users are switched over to use the new counter.

Requested-by: Andrew Morton akpm@linux-foundation.org
Acked-by: NeilBrown <neilb@suse.de>
Tested-by: Lucas De Marchi lucas.demarchi@profusion.mobi
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2011-07-20 20:47:50 -04:00
stephen hemminger
1cc523271e seq_file: add RCU versions of new hlist/list iterators (v3)
Many usages of seq_file use RCU protected lists, so non RCU
iterators will not work safely.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-22 15:45:54 -08:00
Li Zefan
66655de6d1 seq_file: Add helpers for iteration over a hlist
Some places in kernel need to iterate over a hlist in seq_file,
so provide some common helpers.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-02-10 11:12:06 -08:00
Miklos Szeredi
f84398068d vfs: seq_file: add helpers for data filling
Add two helpers that allow access to the seq_file's own buffer, but
hide the internal details of seq_files.

This allows easier implementation of special purpose filling
functions.  It also cleans up some existing functions which duplicated
the seq_file logic.

Make these inline functions in seq_file.h, as suggested by Al.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Acked-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2009-09-24 07:47:35 -04:00
Peter Oberparleiter
0b923606e7 seq_file: add function to write binary data
seq_write() can be used to construct seq_files containing arbitrary data.
Required by the gcov-profiling interface to synthesize binary profiling
data files.

Signed-off-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Huang Ying <ying.huang@intel.com>
Cc: Li Wei <W.Li@Sun.COM>
Cc: Michael Ellerman <michaele@au1.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Heiko Carstens <heicars2@linux.vnet.ibm.com>
Cc: Martin Schwidefsky <mschwid2@linux.vnet.ibm.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-06-18 13:03:57 -07:00
Rusty Russell
af76aba00f cpumask: fix seq_bitmap_*() functions.
1) seq_bitmap_list() should take a const.
2) All the seq_bitmap should use cpumask_bits().

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-03-30 22:05:11 +10:30
Eric Biederman
8f19d47293 seq_file: properly cope with pread
Currently seq_read assumes that the offset passed to it is always the
offset it passed to user space.  In the case pread this assumption is
broken and we do the wrong thing when presented with pread.

To solve this I introduce an offset cache inside of struct seq_file so we
know where our logical file position is.  Then in seq_read if we try to
read from another offset we reset our data structures and attempt to go to
the offset user space wanted.

[akpm@linux-foundation.org: restore FMODE_PWRITE]
[pjt@google.com: seq_open needs its fmode opened up to take advantage of this]
Signed-off-by: Eric Biederman <ebiederm@xmission.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Paul Turner <pjt@google.com>
Cc: <stable@kernel.org>		[2.6.25.x, 2.6.26.x, 2.6.27.x, 2.6.28.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-02-18 15:37:53 -08:00
Rusty Russell
e12f0102ac cpumask: Use nr_cpu_ids in seq_cpumask
Impact: cleanup, futureproof

nr_cpu_ids is the (badly named) runtime limit on possible CPU numbers;
ie. the variable version of NR_CPUS.

With the new cpumask operators, only bits less than this are defined.
So we should use it everywhere, rather than NR_CPUS.  Eventually this
will make it possible to allocate cpumasks of the minimal length at runtime.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Mike Travis <travis@sgi.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
2008-12-30 09:05:19 +10:30
Rusty Russell
cb78a0ce69 bitmap: fix seq_bitmap and seq_cpumask to take const pointer
Impact: cleanup

seq_bitmap just calls bitmap_scnprintf on the bits: that arg can be const.
Similarly, seq_cpumask just calls seq_bitmap.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2008-12-30 09:05:14 +10:30
Török Edwin
74e2f334f4 vfs, seqfile: make mangle_path() global
Impact: expose new VFS API

make mangle_path() available, as per the suggestions of Christoph Hellwig
and Al Viro:

  http://lkml.org/lkml/2008/11/4/338

Signed-off-by: Török Edwin <edwintorok@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-11-23 09:45:39 +01:00
Lai Jiangshan
3eda201180 seq_file: add seq_cpumask_list(), seq_nodemask_list()
seq_cpumask_list(), seq_nodemask_list() are very like seq_cpumask(),
seq_nodemask(), but they print human readable string.

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Paul Menage <menage@google.com>
Cc: Paul Jackson <pj@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-20 08:52:39 -07:00
Alexey Dobriyan
50ac2d694f seq_file: add seq_cpumask(), seq_nodemask()
Short enough reads from /proc/irq/*/smp_affinity return -EINVAL for no
good reason.

This became noticed with NR_CPUS=4096 patches, when length of printed
representation of cpumask becase 1152, but cat(1) continued to read with
1024-byte chunks.  bitmap_scnprintf() in good faith fills buffer, returns
1023, check returns -EINVAL.

Fix it by switching to seq_file, so handler will just fill buffer and
doesn't care about offsets, length, filling EOF and all this crap.

For that add seq_bitmap(), and wrappers around it -- seq_cpumask() and
seq_nodemask().

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Reviewed-by: Paul Jackson <pj@sgi.com>
Cc: Mike Travis <travis@sgi.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-08-12 16:07:30 -07:00
Robert P. J. Day
735643ee6c Remove "#ifdef __KERNEL__" checks from unexported headers
Remove the "#ifdef __KERNEL__" tests from unexported header files in
linux/include whose entire contents are wrapped in that preprocessor
test.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-30 08:29:54 -07:00
Miklos Szeredi
9d1bc60138 [patch 2/7] vfs: mountinfo: add seq_file_root()
Add a new function:

  seq_file_root()

This is similar to seq_path(), but calculates the path relative to the
given root, instead of current->fs->root.  If the path was unreachable
from root, then modify the root parameter to reflect this.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2008-04-23 00:04:38 -04:00
Ram Pai
6092d04818 [patch 1/7] vfs: mountinfo: add dentry_path()
[mszeredi@suse.cz] split big patch into managable chunks

Add the following functions:

  dentry_path()
  seq_dentry()

These are similar to d_path() and seq_path().  But instead of
calculating the path within a mount namespace, they calculate the path
from the root of the filesystem to a given dentry, ignoring mounts
completely.

Signed-off-by: Ram Pai <linuxram@us.ibm.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2008-04-23 00:04:32 -04:00
Al Viro
521b5d0c40 [PATCH] teach seq_file to discard entries
Allow ->show() return SEQ_SKIP; that will discard all
output from that element and move on.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2008-04-21 23:14:02 -04:00
Denis V. Lunev
c0f39322c3 [NETNS]: Do not include net/net_namespace.h from seq_file.h
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-04-02 00:10:28 -07:00
Denis V. Lunev
0e5f8be138 [NETNS]: Compile NET /proc support only if CONFIG_NET is set.
This fix broken compilation for 'allnoconfig'. This was introduced by
Introduced by commit 1218854afa ("[NET]
NETNS: Omit seq_net_private->net without CONFIG_NET_NS.")

Signed-off-by: Denis V. Lunev <den@openvz.org>
Acked-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-03-27 14:25:53 -07:00
YOSHIFUJI Hideaki
1218854afa [NET] NETNS: Omit seq_net_private->net without CONFIG_NET_NS.
Without CONFIG_NET_NS, no namespace other than &init_net exists,
no need to store net in seq_net_private.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
2008-03-26 04:39:56 +09:00
Jan Blunck
c32c2f63a9 d_path: Make seq_path() use a struct path argument
seq_path() is always called with a dentry and a vfsmount from a struct path.
Make seq_path() take it directly as an argument.

Signed-off-by: Jan Blunck <jblunck@suse.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-02-14 21:17:08 -08:00
Denis V. Lunev
e372c41401 [NET]: Consolidate net namespace related proc files creation.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2008-01-28 14:54:28 -08:00
Mathieu Desnoyers
2b47c3611d Fix f_version type: should be u64 instead of unsigned long
Fix f_version type: should be u64 instead of long

There is a type inconsistency between struct inode i_version and struct file
f_version.

fs.h:

struct inode
  u64                     i_version;

and

struct file
  unsigned long           f_version;

Users do:

fs/ext3/dir.c:

if (filp->f_version != inode->i_version) {

So why isn't f_version a u64 ? It becomes a problem if versions gets
higher than 2^32 and we are on an architecture where longs are 32 bits.

This patch changes the f_version type to u64, and updates the users accordingly.

It applies to 2.6.23-rc2-mm2.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Martin Bligh <mbligh@google.com>
Cc: "Randy.Dunlap" <rdunlap@xenotime.net>
Cc: Al Viro <viro@ftp.linux.org.uk>
Cc: <linux-ext4@vger.kernel.org>
Cc: Mark Fasheh <mark.fasheh@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-17 08:42:53 -07:00
Pavel Emelyanov
39699037a5 [FS] seq_file: Introduce the seq_open_private()
This function allocates the zeroed chunk of memory and
call seq_open(). The __seq_open_private() helper returns
the allocated memory to make it possible for the caller
to initialize it.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2007-10-10 16:55:33 -07:00
Pavel Emelianov
bcf67e1625 Make common helpers for seq_files that work with list_heads
Many places in kernel use seq_file API to iterate over a regular list_head.
The code for such iteration is identical in all the places, so it's worth
introducing a common helpers.

This makes code about 300 lines smaller:

The first version of this patch made the helper functions static inline
in the seq_file.h header. This patch moves them to the fs/seq_file.c as
Andrew proposed. The vmlinux .text section sizes are as follows:

2.6.22-rc1-mm1:              0x001794d5
with the previous version:   0x00179505
with this patch:             0x00179135

The config file used was make allnoconfig with the "y" inclusion of all
the possible options to make the files modified by the patch compile plus
drivers I have on the test node.

This patch:

Many places in kernel use seq_file API to iterate over a regular list_head.
The code for such iteration is identical in all the places, so it's worth
introducing a common helpers.

Signed-off-by: Pavel Emelianov <xemul@openvz.org>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-10 17:51:13 -07:00
Helge Deller
15ad7cdcfd [PATCH] struct seq_operations and struct file_operations constification
- move some file_operations structs into the .rodata section

 - move static strings from policy_types[] array into the .rodata section

 - fix generic seq_operations usages, so that those structs may be defined
   as "const" as well

[akpm@osdl.org: couple of fixes]
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-07 08:39:46 -08:00
Ingo Molnar
0ac1759abc [PATCH] sem2mutex: fs/seq_file.c
Semaphore to mutex conversion.

The conversion was generated via scripts, and the result was validated
automatically via a script as well.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-03-23 07:38:12 -08:00