Commit graph

201 commits

Author SHA1 Message Date
Ivaylo Georgiev
9459964334 Merge android-4.19-q.95 (138a4a6) into msm-4.19
* refs/heads/tmp-138a4a6:
  Linux 4.19.95
  usb: missing parentheses in USE_NEW_SCHEME
  USB: serial: option: add Telit ME910G1 0x110a composition
  USB: core: fix check for duplicate endpoints
  usb: dwc3: gadget: Fix request complete check
  net: sch_prio: When ungrafting, replace with FIFO
  mlxsw: spectrum_qdisc: Ignore grafting of invisible FIFO
  vlan: vlan_changelink() should propagate errors
  vlan: fix memory leak in vlan_dev_set_egress_priority
  vxlan: fix tos value before xmit
  tcp: fix "old stuff" D-SACK causing SACK to be treated as D-SACK
  sctp: free cmd->obj.chunk for the unprocessed SCTP_CMD_REPLY
  sch_cake: avoid possible divide by zero in cake_enqueue()
  pkt_sched: fq: do not accept silly TCA_FQ_QUANTUM
  net: usb: lan78xx: fix possible skb leak
  net: stmmac: dwmac-sunxi: Allow all RGMII modes
  net: stmmac: dwmac-sun8i: Allow all RGMII modes
  net: dsa: mv88e6xxx: Preserve priority when setting CPU port.
  macvlan: do not assume mac_header is set in macvlan_broadcast()
  gtp: fix bad unlock balance in gtp_encap_enable_socket
  PCI/switchtec: Read all 64 bits of part_event_bitmap
  ARM: dts: imx6ul: use nvmem-cells for cpu speed grading
  cpufreq: imx6q: read OCOTP through nvmem for imx6ul/imx6ull
  powerpc/spinlocks: Include correct header for static key
  powerpc/vcpu: Assume dedicated processors as non-preempt
  hv_netvsc: Fix unwanted rx_table reset
  llc2: Fix return statement of llc_stat_ev_rx_null_dsap_xid_c (and _test_c)
  parisc: Fix compiler warnings in debug_core.c
  block: fix memleak when __blk_rq_map_user_iov() is failed
  s390/dasd: fix memleak in path handling error case
  s390/dasd/cio: Interpret ccw_device_get_mdc return value correctly
  drm/exynos: gsc: add missed component_del
  s390/purgatory: do not build purgatory with kcov, kasan and friends
  net: stmmac: Always arm TX Timer at end of transmission start
  net: stmmac: RX buffer size must be 16 byte aligned
  net: stmmac: xgmac: Clear previous RX buffer size
  net: stmmac: Do not accept invalid MTU values
  fs: avoid softlockups in s_inodes iterators
  perf/x86/intel: Fix PT PMI handling
  kconfig: don't crash on NULL expressions in expr_eq()
  iommu/iova: Init the struct iova to fix the possible memleak
  regulator: rn5t618: fix module aliases
  ASoC: wm8962: fix lambda value
  rfkill: Fix incorrect check to avoid NULL pointer dereference
  parisc: add missing __init annotation
  net: usb: lan78xx: Fix error message format specifier
  cxgb4: Fix kernel panic while accessing sge_info
  bnx2x: Fix logic to get total no. of PFs per engine
  bnx2x: Do not handle requests from VFs after parity
  bpf: Clear skb->tstamp in bpf_redirect when necessary
  btrfs: Fix error messages in qgroup_rescan_init
  powerpc: Ensure that swiotlb buffer is allocated from low memory
  samples: bpf: fix syscall_tp due to unused syscall
  samples: bpf: Replace symbol compare of trace_event
  ARM: dts: am437x-gp/epos-evm: fix panel compatible
  spi: spi-ti-qspi: Fix a bug when accessing non default CS
  bpf, mips: Limit to 33 tail calls
  bnxt_en: Return error if FW returns more data than dump length
  ARM: dts: bcm283x: Fix critical trip point
  ASoC: topology: Check return value for soc_tplg_pcm_create()
  spi: spi-cavium-thunderx: Add missing pci_release_regions()
  ARM: dts: Cygnus: Fix MDIO node address/size cells
  selftests/ftrace: Fix multiple kprobe testcase
  ARM: dts: BCM5301X: Fix MDIO node address/size cells
  netfilter: nf_tables: validate NFT_DATA_VALUE after nft_data_init()
  netfilter: nf_tables: validate NFT_SET_ELEM_INTERVAL_END
  netfilter: nft_set_rbtree: bogus lookup/get on consecutive elements in named sets
  netfilter: uapi: Avoid undefined left-shift in xt_sctp.h
  ARM: vexpress: Set-up shared OPP table instead of individual for each CPU
  ARM: dts: imx6ul: imx6ul-14x14-evk.dtsi: Fix SPI NOR probing
  efi/gop: Fix memory leak in __gop_query32/64()
  efi/gop: Return EFI_SUCCESS if a usable GOP was found
  efi/gop: Return EFI_NOT_FOUND if there are no usable GOPs
  ASoC: Intel: bytcr_rt5640: Update quirk for Teclast X89
  x86/efi: Update e820 with reserved EFI boot services data to fix kexec breakage
  libtraceevent: Fix lib installation with O=
  mwifiex: Fix heap overflow in mmwifiex_process_tdls_action_frame()
  netfilter: ctnetlink: netns exit must wait for callbacks
  locking/spinlock/debug: Fix various data races
  ASoC: max98090: fix possible race conditions
  regulator: fix use after free issue
  bpf: Fix passing modified ctx to ld/abs/ind instruction
  USB: dummy-hcd: increase max number of devices to 32
  USB: dummy-hcd: use usb_urb_dir_in instead of usb_pipein

Conflicts:
	kernel/locking/spinlock_debug.c

1683149 ("usb: dwc3: gadget: Fix logical condition") was reverted
on importing android-4.19-q.90 into msm-4.19 as this change
prevented the adbd userspace daemon from ever receiving packets
from the kernel USB driver. android-4.19-q.95 introduced new
change ceaeb21b ("usb: dwc3: gadget: Fix request complete check")
that fixed the regression, hence it is safe to restore the revert.
It is done in this merge.

Change-Id: I5f839319ad7746728a98c01f8b5c3dab9c9f368a
Signed-off-by: Ivaylo Georgiev <irgeorgiev@codeaurora.org>
2020-02-03 21:43:57 -08:00
Ivaylo Georgiev
e56696c197 Merge android-4.19-q.92 (3e66813) into msm-4.19
* refs/heads/tmp-3e66813:
  Linux 4.19.92
  perf probe: Fix to show function entry line as probe-able
  nbd: fix shutdown and recv work deadlock v2
  mmc: sdhci: Add a quirk for broken command queuing
  mmc: sdhci: Workaround broken command queuing on Intel GLK
  mmc: sdhci-of-esdhc: fix P2020 errata handling
  mmc: sdhci: Update the tuning failed messages to pr_debug level
  mmc: sdhci-of-esdhc: Revert "mmc: sdhci-of-esdhc: add erratum A-009204 support"
  mmc: sdhci-msm: Correct the offset and value for DDR_CONFIG register
  powerpc/irq: fix stack overflow verification
  powerpc/vcpu: Assume dedicated processors as non-preempt
  x86/MCE/AMD: Allow Reserved types to be overwritten in smca_banks[]
  x86/MCE/AMD: Do not use rdmsr_safe_on_cpu() in smca_configure()
  KVM: arm64: Ensure 'params' is initialised when looking up sys register
  ext4: unlock on error in ext4_expand_extra_isize()
  ext4: check for directory entries too close to block end
  ext4: fix ext4_empty_dir() for directories with holes
  staging: comedi: gsc_hpdi: check dma_alloc_coherent() return value
  platform/x86: hp-wmi: Make buffer for HPWMI_FEATURE2_QUERY 128 bytes
  intel_th: pci: Add Elkhart Lake SOC support
  intel_th: pci: Add Comet Lake PCH-V support
  USB: EHCI: Do not return -EPIPE when hub is disconnected
  cpufreq: Avoid leaving stale IRQ work items during CPU offline
  usbip: Fix error path of vhci_recv_ret_submit()
  usbip: Fix receive error in vhci-hcd when using scatter-gather
  btrfs: return error pointer from alloc_test_extent_buffer
  s390/ftrace: fix endless recursion in function_graph tracer
  drm/amdgpu: fix uninitialized variable pasid_mapping_needed
  usb: xhci: Fix build warning seen with CONFIG_PM=n
  can: kvaser_usb: kvaser_usb_leaf: Fix some info-leaks to USB devices
  mmc: mediatek: fix CMD_TA to 2 for MT8173 HS200/HS400 mode
  Revert "mmc: sdhci: Fix incorrect switch to HS mode"
  btrfs: don't prematurely free work in scrub_missing_raid56_worker()
  btrfs: don't prematurely free work in reada_start_machine_worker()
  net: phy: initialise phydev speed and duplex sanely
  drm/amdgpu: fix bad DMA from INTERRUPT_CNTL2
  mips: fix build when "48 bits virtual memory" is enabled
  libtraceevent: Fix memory leakage in copy_filter_type
  crypto: vmx - Avoid weird build failures
  mac80211: consider QoS Null frames for STA_NULLFUNC_ACKED
  crypto: sun4i-ss - Fix 64-bit size_t warnings on sun4i-ss-hash.c
  crypto: sun4i-ss - Fix 64-bit size_t warnings
  net: ethernet: ti: ale: clean ale tbl on init and intf restart
  fbtft: Make sure string is NULL terminated
  iwlwifi: check kasprintf() return value
  brcmfmac: remove monitor interface when detaching
  x86/insn: Add some Intel instructions to the opcode map
  ASoC: Intel: bytcr_rt5640: Update quirk for Acer Switch 10 SW5-012 2-in-1
  ASoC: wm5100: add missed pm_runtime_disable
  spi: st-ssc4: add missed pm_runtime_disable
  ASoC: wm2200: add missed operations in remove and probe failure
  btrfs: don't prematurely free work in run_ordered_work()
  btrfs: don't prematurely free work in end_workqueue_fn()
  mmc: tmio: Add MMC_CAP_ERASE to allow erase/discard/trim requests
  crypto: virtio - deal with unsupported input sizes
  tun: fix data-race in gro_normal_list()
  spi: tegra20-slink: add missed clk_unprepare
  ASoC: wm8904: fix regcache handling
  iwlwifi: mvm: fix unaligned read of rx_pkt_status
  bcache: fix deadlock in bcache_allocator
  tracing/kprobe: Check whether the non-suffixed symbol is notrace
  tracing: use kvcalloc for tgid_map array allocation
  x86/crash: Add a forward declaration of struct kimage
  cpufreq: Register drivers only after CPU devices have been registered
  bcache: fix static checker warning in bcache_device_free()
  parport: load lowlevel driver if ports not found
  nvme: Discard workaround for non-conformant devices
  s390/disassembler: don't hide instruction addresses
  ASoC: Intel: kbl_rt5663_rt5514_max98927: Add dmic format constraint
  iio: dac: ad5446: Add support for new AD5600 DAC
  ASoC: rt5677: Mark reg RT5677_PWR_ANLG2 as volatile
  spi: pxa2xx: Add missed security checks
  EDAC/ghes: Fix grain calculation
  media: si470x-i2c: add missed operations in remove
  ice: delay less
  crypto: atmel - Fix authenc support when it is set to m
  soundwire: intel: fix PDI/stream mapping for Bulk
  media: pvrusb2: Fix oops on tear-down when radio support is not present
  fsi: core: Fix small accesses and unaligned offsets via sysfs
  ath10k: fix get invalid tx rate for Mesh metric
  perf probe: Filter out instances except for inlined subroutine and subprogram
  perf probe: Skip end-of-sequence and non statement lines
  perf probe: Fix to show calling lines of inlined functions
  perf probe: Return a better scope DIE if there is no best scope
  perf probe: Skip overlapped location on searching variables
  perf parse: If pmu configuration fails free terms
  xen/gntdev: Use select for DMA_SHARED_BUFFER
  drm/amdgpu: fix potential double drop fence reference
  drm/amdgpu: disallow direct upload save restore list from gfx driver
  perf tools: Splice events onto evlist even on error
  perf probe: Fix to probe a function which has no entry pc
  libsubcmd: Use -O0 with DEBUG=1
  perf probe: Fix to show inlined function callsite without entry_pc
  perf probe: Fix to show ranges of variables in functions without entry_pc
  perf probe: Fix to probe an inline function which has no entry pc
  perf probe: Walk function lines in lexical blocks
  perf jevents: Fix resource leak in process_mapfile() and main()
  perf probe: Fix to list probe event with correct line number
  perf probe: Fix to find range-only function instance
  rtlwifi: fix memory leak in rtl92c_set_fw_rsvdpagepkt()
  ALSA: timer: Limit max amount of slave instances
  spi: img-spfi: fix potential double release
  bnx2x: Fix PF-VF communication over multi-cos queues.
  rfkill: allocate static minor
  nvmem: imx-ocotp: reset error status on probe
  media: v4l2-core: fix touch support in v4l_g_fmt
  media: rcar_drif: fix a memory disclosure
  ixgbe: protect TX timestamping from API misuse
  pinctrl: amd: fix __iomem annotation in amd_gpio_irq_handler()
  Bluetooth: Fix advertising duplicated flags
  libbpf: Fix error handling in bpf_map__reuse_fd()
  iio: dln2-adc: fix iio_triggered_buffer_postenable() position
  pinctrl: sh-pfc: sh7734: Fix duplicate TCLK1_B
  loop: fix no-unmap write-zeroes request behavior
  libata: Ensure ata_port probe has completed before detach
  net: hns3: add struct netdev_queue debug info for TX timeout
  s390/mm: add mm_pxd_folded() checks to pxd_free()
  s390/time: ensure get_clock_monotonic() returns monotonic values
  phy: qcom-usb-hs: Fix extcon double register after power cycle
  net: dsa: LAN9303: select REGMAP when LAN9303 enable
  gpu: host1x: Allocate gather copy for host1x
  RDMA/qedr: Fix memory leak in user qp and mr
  ACPI: button: Add DMI quirk for Medion Akoya E2215T
  spi: sprd: adi: Add missing lock protection when rebooting
  drm/tegra: sor: Use correct SOR index on Tegra210
  net: phy: dp83867: enable robust auto-mdix
  i40e: initialize ITRN registers with correct values
  arm64: psci: Reduce the waiting time for cpu_psci_cpu_kill()
  md/bitmap: avoid race window between md_bitmap_resize and bitmap_file_clear_bit
  media: smiapp: Register sensor after enabling runtime PM on the device
  x86/ioapic: Prevent inconsistent state when moving an interrupt
  ipmi: Don't allow device module unload when in use
  rtl8xxxu: fix RTL8723BU connection failure issue after warm reboot
  drm/gma500: fix memory disclosures due to uninitialized bytes
  perf tests: Disable bp_signal testing for arm64
  x86/mce: Lower throttling MCE messages' priority to warning
  bpf/stackmap: Fix deadlock with rq_lock in bpf_get_stack()
  Bluetooth: hci_core: fix init for HCI_USER_CHANNEL
  Bluetooth: Workaround directed advertising bug in Broadcom controllers
  Bluetooth: missed cpu_to_le16 conversion in hci_init4_req
  iio: adc: max1027: Reset the device at probe time
  usb: usbfs: Suppress problematic bind and unbind uevents.
  perf report: Add warning when libunwind not compiled in
  perf test: Report failure for mmap events
  drm/bridge: dw-hdmi: Restore audio when setting a mode
  ath10k: Correct error handling of dma_map_single()
  x86/mm: Use the correct function type for native_set_fixmap()
  extcon: sm5502: Reset registers during initialization
  drm/amd/display: Fix dongle_caps containing stale information.
  syscalls/x86: Use the correct function type in SYSCALL_DEFINE0
  media: ti-vpe: vpe: fix a v4l2-compliance failure about invalid sizeimage
  media: ti-vpe: vpe: ensure buffers are cleaned up properly in abort cases
  media: ti-vpe: vpe: fix a v4l2-compliance failure causing a kernel panic
  media: ti-vpe: vpe: Make sure YUYV is set as default format
  media: ti-vpe: vpe: fix a v4l2-compliance failure about frame sequence number
  media: ti-vpe: vpe: fix a v4l2-compliance warning about invalid pixel format
  media: ti-vpe: vpe: Fix Motion Vector vpdma stride
  media: cx88: Fix some error handling path in 'cx8800_initdev()'
  drm/drm_vblank: Change EINVAL by the correct errno
  mwifiex: pcie: Fix memory leak in mwifiex_pcie_init_evt_ring
  block: Fix writeback throttling W=1 compiler warnings
  samples: pktgen: fix proc_cmd command result check logic
  drm/bridge: dw-hdmi: Refuse DDC/CI transfers on the internal I2C controller
  media: cec-funcs.h: add status_req checks
  media: flexcop-usb: fix NULL-ptr deref in flexcop_usb_transfer_init()
  regulator: max8907: Fix the usage of uninitialized variable in max8907_regulator_probe()
  hwrng: omap3-rom - Call clk_disable_unprepare() on exit only if not idled
  usb: renesas_usbhs: add suspend event support in gadget mode
  media: venus: Fix occasionally failures to suspend
  selftests/bpf: Correct path to include msg + path
  drm/amdkfd: fix a potential NULL pointer dereference (v2)
  pinctrl: devicetree: Avoid taking direct reference to device name string
  ath10k: fix offchannel tx failure when no ath10k_mac_tx_frm_has_freq
  media: venus: core: Fix msm8996 frequency table
  tools/power/cpupower: Fix initializer override in hsw_ext_cstates
  media: ov6650: Fix stored crop rectangle not in sync with hardware
  media: ov6650: Fix stored frame format not in sync with hardware
  media: i2c: ov2659: Fix missing 720p register config
  media: ov6650: Fix crop rectangle alignment not passed back
  media: i2c: ov2659: fix s_stream return value
  media: am437x-vpfe: Setting STD to current value is not an error
  IB/iser: bound protection_sg size by data_sg size
  ath10k: fix backtrace on coredump
  libertas: fix a potential NULL pointer dereference
  rtlwifi: prevent memory leak in rtl_usb_probe
  staging: rtl8188eu: fix possible null dereference
  staging: rtl8192u: fix multiple memory leaks on error path
  spi: Add call to spi_slave_abort() function when spidev driver is released
  drm/amdgpu: grab the id mgr lock while accessing passid_mapping
  iio: light: bh1750: Resolve compiler warning and make code more readable
  drm/bridge: analogix-anx78xx: silence -EPROBE_DEFER warnings
  drm/panel: Add missing drm_panel_init() in panel drivers
  drm: mst: Fix query_payload ack reply struct
  ALSA: hda/ca0132 - Fix work handling in delayed HP detection
  ALSA: hda/ca0132 - Avoid endless loop
  ALSA: hda/ca0132 - Keep power on during processing DSP response
  ALSA: pcm: Avoid possible info leaks from PCM stream buffers
  Btrfs: fix removal logic of the tree mod log that leads to use-after-free issues
  btrfs: handle ENOENT in btrfs_uuid_tree_iterate
  btrfs: do not leak reloc root if we fail to read the fs root
  btrfs: skip log replay on orphaned roots
  btrfs: abort transaction after failed inode updates in create_subvol
  btrfs: send: remove WARN_ON for readonly mount
  Btrfs: fix missing data checksums after replaying a log tree
  btrfs: do not call synchronize_srcu() in inode_tree_del
  btrfs: don't double lock the subvol_sem for rename exchange
  selftests: forwarding: Delete IPv6 address at the end
  sctp: fully initialize v4 addr in some functions
  qede: Fix multicast mac configuration
  qede: Disable hardware gro when xdp prog is installed
  net: usb: lan78xx: Fix suspend/resume PHY register access error
  net: qlogic: Fix error paths in ql_alloc_large_buffers()
  net: nfc: nci: fix a possible sleep-in-atomic-context bug in nci_uart_tty_receive()
  net: hisilicon: Fix a BUG trigered by wrong bytes_compl
  net: gemini: Fix memory leak in gmac_setup_txqs
  net: dst: Force 4-byte alignment of dst_metrics
  mod_devicetable: fix PHY module format
  fjes: fix missed check in fjes_acpi_add
  af_packet: set defaule value for tmo
  ANDROID: cuttlefish_defconfig: Disable TRANSPARENT_HUGEPAGE

Conflicts:
	drivers/mmc/host/sdhci-msm.c

Change-Id: Ic97e378f655dc8e07f5e5dd5b435ec37f60deac0
Signed-off-by: Ivaylo Georgiev <irgeorgiev@codeaurora.org>
2020-02-03 21:39:14 -08:00
Aditya Pakki
d8ec4cf103 rfkill: Fix incorrect check to avoid NULL pointer dereference
[ Upstream commit 6fc232db9e8cd50b9b83534de9cd91ace711b2d7 ]

In rfkill_register, the struct rfkill pointer is first derefernced
and then checked for NULL. This patch removes the BUG_ON and returns
an error to the caller in case rfkill is NULL.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
Link: https://lore.kernel.org/r/20191215153409.21696-1-pakki001@umn.edu
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-12 12:17:17 +01:00
Marcel Holtmann
b542133014 rfkill: allocate static minor
[ Upstream commit 8670b2b8b029a6650d133486be9d2ace146fd29a ]

udev has a feature of creating /dev/<node> device-nodes if it finds
a devnode:<node> modalias. This allows for auto-loading of modules that
provide the node. This requires to use a statically allocated minor
number for misc character devices.

However, rfkill uses dynamic minor numbers and prevents auto-loading
of the module. So allocate the next static misc minor number and use
it for rfkill.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Link: https://lore.kernel.org/r/20191024174042.19851-1-marcel@holtmann.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-12-31 16:35:38 +01:00
Rishabh Bhatnagar
bfee6d7f04 Merge remote-tracking branch 'origin/tmp-11da3a7' into msm-kona
* origin/tmp-11da3a7:
  Linux 4.19-rc3
  kbuild: modules_install: warn when missing System.map file
  x86/mm: Use WRITE_ONCE() when setting PTEs
  x86/apic/vector: Make error return value negative
  afs: Fix cell specification to permit an empty address list
  KVM: LAPIC: Fix pv ipis out-of-bounds access
  KVM: nVMX: Fix loss of pending IRQ/NMI before entering L2
  arm64: KVM: Remove pgd_lock
  KVM: Remove obsolete kvm_unmap_hva notifier backend
  arm64: KVM: Only force FPEXC32_EL2.EN if trapping FPSIMD
  KVM: arm/arm64: Clean dcache to PoC when changing PTE due to CoW
  i2c: xiic: Record xilinx i2c with Zynq fragment
  clocksource: Revert "Remove kthread"
  i2c: xiic: Make the start and the byte count write atomic
  irqchip/gic-v3-its: Cap lpi_id_bits to reduce memory footprint
  block: bfq: swap puts in bfqg_and_blkg_put
  memory: ti-aemif: fix a potential NULL-pointer dereference
  arm64: fix erroneous warnings in page freeing functions
  firmware: arm_scmi: fix divide by zero when sustained_perf_level is zero
  printk/tracing: Do not trace printk_nmi_enter()
  rbd: support cloning across namespaces
  rbd: factor out get_parent_info()
  ceph: avoid a use-after-free in ceph_destroy_options()
  cpu/hotplug: Prevent state corruption on error rollback
  cpu/hotplug: Adjust misplaced smb() in cpuhp_thread_fun()
  x86/process: Don't mix user/kernel regs in 64bit __show_regs()
  x86/tsc: Prevent result truncation on 32bit
  ACPI / LPSS: Force LPSS quirks on boot
  ACPI / bus: Only call dmi_check_system() on X86
  block: don't warn when doing fsync on read-only devices
  hwmon: rpi: add module alias to raspberrypi-hwmon
  tracing: Add back in rcu_irq_enter/exit_irqson() for rcuidle tracepoints
  nds32: linker script: GCOV kernel may refers data in __exit
  nilfs2: convert to SPDX license tags
  drivers/dax/device.c: convert variable to vm_fault_t type
  lib/Kconfig.debug: fix three typos in help text
  checkpatch: add __ro_after_init to known $Attribute
  mm: fix BUG_ON() in vmf_insert_pfn_pud() from VM_MIXEDMAP removal
  uapi/linux/keyctl.h: don't use C++ reserved keyword as a struct member name
  memory_hotplug: fix kernel_panic on offline page processing
  checkpatch: add optional static const to blank line declarations test
  ipc/shm: properly return EIDRM in shm_lock()
  mm/hugetlb: filter out hugetlb pages if HUGEPAGE migration is not supported.
  mm/util.c: improve kvfree() kerneldoc
  tools/vm/page-types.c: fix "defined but not used" warning
  tools/vm/slabinfo.c: fix sign-compare warning
  kmemleak: always register debugfs file
  mm: respect arch_dup_mmap() return value
  mm, oom: fix missing tlb_finish_mmu() in __oom_reap_task_mm().
  mm: memcontrol: print proper OOM header when no eligible victim left
  ARC: don't check for HIGHMEM pages in arch_dma_alloc
  ARC: IOC: panic if both IOC and ZONE_HIGHMEM enabled
  ARC: dma [IOC] Enable per device io coherency
  net: phy: sfp: Handle unimplemented hwmon limits and alarms
  net: sched: action_ife: take reference to meta module
  act_ife: fix a potential use-after-free
  net/mlx5: Fix SQ offset in QPs with small RQ
  nbd: don't allow invalid blocksize settings
  i2c: i801: fix DNV's SMBCTRL register offset
  KVM: s390: Properly lock mm context allow_gmap_hpage_1m setting
  KVM: s390: vsie: copy wrapping keys to right place
  KVM: s390: Fix pfmf and conditional skey emulation
  nds32: fix build error because of wrong semicolon
  nds32: Fix a kernel panic issue because of wrong frame pointer access.
  nds32: Only print one page of stack when die to prevent printing too much information.
  nds32: Add macro definition for offset of lp register on stack
  nds32: Remove the deprecated ABI implementation
  nds32/stack: Get real return address by using ftrace_graph_ret_addr
  nds32/ftrace: Support dynamic function graph tracer
  nds32/ftrace: Support dynamic function tracer
  nds32/ftrace: Add RECORD_MCOUNT support
  nds32/ftrace: Support static function graph tracer
  nds32/ftrace: Support static function tracer
  nds32: Extract the checking and getting pointer to a macro
  nds32: Clean up the coding style
  nds32: Fix get_user/put_user macro expand pointer problem
  nds32: Fix empty call trace
  nds32: add NULL entry to the end of_device_id array
  nds32: fix logic for module
  tipc: correct spelling errors for tipc_topsrv_queue_evt() comments
  tipc: correct spelling errors for struct tipc_bc_base's comment
  bnxt_en: Do not adjust max_cp_rings by the ones used by RDMA.
  bnxt_en: Clean up unused functions.
  bnxt_en: Fix firmware signaled resource change logic in open.
  sctp: not traverse asoc trans list if non-ipv6 trans exists for ipv6_flowlabel
  sctp: fix invalid reference to the index variable of the iterator
  net/ibm/emac: wrong emac_calc_base call was used by typo
  net: sched: null actions array pointer before releasing action
  drm/i915/dp_mst: Fix enabling pipe clock for all streams
  drm/i915/dsc: Fix PPS register definition macros for 2nd VDSC engine
  drm/i915: Re-apply "Perform link quality check, unconditionally during long pulse"
  vhost: fix VHOST_GET_BACKEND_FEATURES ioctl request definition
  r8169: add support for NCube 8168 network card
  ip6_tunnel: respect ttl inherit for ip6tnl
  ALSA: hda: Fix several mismatch for register mask and value
  apparmor: fix bad debug check in apparmor_secid_to_secctx()
  ALSA: rawmidi: Initialize allocated buffers
  fsnotify: fix ignore mask logic in fsnotify()
  timekeeping: Fix declaration of read_persistent_wall_and_boot_offset()
  x86: Fix kernel-doc atomic.h warnings
  mac80211: shorten the IBSS debug messages
  mac80211: don't Tx a deauth frame if the AP forbade Tx
  mac80211: Fix station bandwidth setting after channel switch
  mac80211: fix a race between restart and CSA flows
  mac80211: fix WMM TXOP calculation
  cfg80211: fix a type issue in ieee80211_chandef_to_operating_class()
  mac80211: fix an off-by-one issue in A-MSDU max_subframe computation
  drm/i915/gvt: Give new born vGPU higher scheduling chance
  cifs: connect to servername instead of IP for IPC$ share
  smb3: check for and properly advertise directory lease support
  smb3: minor debugging clarifications in rfc1001 len processing
  SMB3: Backup intent flag missing for directory opens with backupuid mounts
  fs/cifs: don't translate SFM_SLASH (U+F026) to backslash
  m68k: fix early memory reservation for ColdFire MMU systems
  uapi: Fix linux/rds.h userspace compilation errors.
  net: cadence: Fix a sleep-in-atomic-context bug in macb_halt_tx()
  i2c: imx-lpi2c: Remove mx8dv compatible entry
  dt-bindings: imx-lpi2c: Remove mx8dv compatible entry
  i2c: uniphier-f: issue STOP only for last message or I2C_M_STOP
  i2c: uniphier: issue STOP only for last message or I2C_M_STOP
  net/ipv6: Only update MTU metric if it set
  net: ethernet: cpsw-phy-sel: prefer phandle for phy sel
  dt-bindings: net: cpsw: Document cpsw-phy-sel usage but prefer phandle
  igmp: fix incorrect unsolicit report count after link down and up
  igmp: fix incorrect unsolicit report count when join group
  bpf: avoid misuse of psock when TCP_ULP_BPF collides with another ULP
  tools/bpf: bpftool, add xskmap in map types
  bpf: Fix bpf_msg_pull_data()
  kbuild: make missing $DEPMOD a Warning instead of an Error
  kconfig: do not require pkg-config on make {menu,n}config
  x86/microcode: Update the new microcode revision unconditionally
  x86/microcode: Make sure boot_cpu_data.microcode is up-to-date
  of/platform: initialise AMBA default DMA masks
  sparc: set a default 32-bit dma mask for OF devices
  ipv6: don't get lwtstate twice in ip6_rt_copy_init()
  random: make CPU trust a boot parameter
  kernel/dma/direct: take DMA offset into account in dma_direct_supported
  ibmvnic: Include missing return code checks in reset function
  selftests: pmtu: detect correct binary to ping ipv6 addresses
  selftests: pmtu: maximum MTU for vti4 is 2^16-1-20
  tcp: do not restart timewait timer on rst reception
  net/rds: RDS is not Radio Data System
  hv_netvsc: Fix a deadlock by getting rtnl lock earlier in netvsc_probe()
  nfp: wait for posted reconfigs when disabling the device
  Revert "packet: switch kvzalloc to allocate memory"
  md-cluster: release RESYNC lock after the last resync message
  RAID10 BUG_ON in raise_barrier when force is true and conf->barrier is 0
  md/raid5-cache: disable reshape completely
  blkcg: use tryget logic when associating a blkg with a bio
  blkcg: delay blkg destruction until after writeback has finished
  Revert "blk-throttle: fix race between blkcg_bio_issue_check() and cgroup_rmdir()"
  ARC: dma [IOC]: mark DMA devices connected as dma-coherent
  ARC: atomics: unbork atomic_fetch_##op()
  MIPS: VDSO: Match data page cache colouring when D$ aliases
  kconfig: remove a spurious self-assignment
  scripts/setlocalversion: git: Make -dirty check more robust
  gpio: Fix crash due to registration race
  arc: remove redundant GCC version checks
  tools/kvm_stat: re-animate display of dead guests
  tools/kvm_stat: indicate dead guests as such
  tools/kvm_stat: handle guest removals more gracefully
  tools/kvm_stat: don't reset stats when setting PID filter for debugfs
  tools/kvm_stat: fix updates for dead guests
  tools/kvm_stat: fix handling of invalid paths in debugfs provider
  tools/kvm_stat: fix python3 issues
  KVM: x86: Unexport x86_emulate_instruction()
  KVM: x86: Rename emulate_instruction() to kvm_emulate_instruction()
  KVM: x86: Do not re-{try,execute} after failed emulation in L2
  KVM: x86: Default to not allowing emulation retry in kvm_mmu_page_fault
  KVM: x86: Merge EMULTYPE_RETRY and EMULTYPE_ALLOW_REEXECUTE
  KVM: x86: Invert emulation re-execute behavior to make it opt-in
  KVM: x86: SVM: Set EMULTYPE_NO_REEXECUTE for RSM emulation
  KVM: VMX: Do not allow reexecute_instruction() when skipping MMIO instr
  KVM: SVM: remove unused variable dst_vaddr_end
  KVM: nVMX: avoid redundant double assignment of nested_run_pending
  ALSA: hda - Fix cancel_work_sync() stall from jackpoll work
  mac80211: always account for A-MSDU header changes
  mac80211: do not convert to A-MSDU if frag/subframe limited
  cfg80211: nl80211_update_ft_ies() to validate NL80211_ATTR_IE
  tc-testing: add test-cases for numeric and invalid control action
  net_sched: reject unknown tcfa_action values
  net: mvpp2: initialize port of_node pointer
  drm/i915/gvt: Fix drm_format_mod value for vGPU plane
  drm/i915/gvt: move intel_runtime_pm_get out of spin_lock in stop_schedule
  drm/i915/gvt: Handle GEN9_WM_CHICKEN3 with F_CMD_ACCESS.
  drm/i915/gvt: Make correct handling to vreg BXT_PHY_CTL_FAMILY
  drm/i915/gvt: emulate gen9 dbuf ctl register access
  net: bcmgenet: use MAC link status for fixed phy
  net: stmmac: build the dwmac-socfpga platform driver for Stratix10
  net: rtnl: return early from rtnl_unregister_all when protocol isn't registered
  ipv6: fix cleanup ordering for pingv6 registration
  ipv6: fix cleanup ordering for ip6_mr failure
  net/sched: act_pedit: fix dump of extended layered op
  sh_eth: Add R7S9210 support
  net: hns: add netif_carrier_off before change speed and duplex
  net: hns: add the code for cleaning pkt in chip
  r8169: set RxConfig after tx/rx is enabled for RTL8169sb/8110sb devices
  tipc: switch to rhashtable iterator
  Revert "net: stmmac: Do not keep rearming the coalesce timer in stmmac_xmit"
  tipc: fix a missing rhashtable_walk_exit()
  vti6: remove !skb->ignore_df check from vti6_xmit()
  bpf: fix sg shift repair start offset in bpf_msg_pull_data
  bpf: fix shift upon scatterlist ring wrap-around in bpf_msg_pull_data
  bpf: fix msg->data/data_end after sg shift repair in bpf_msg_pull_data
  gpio: dwapb: Fix error handling in dwapb_gpio_probe()
  gpiolib-acpi: Register GpioInt ACPI event handlers from a late_initcall
  gpiolib: acpi: Switch to cansleep version of GPIO library call
  mac80211: avoid kernel panic when building AMSDU from non-linear SKB
  mac80211: mesh: fix HWMP sequence numbering to follow standard
  gpio: adp5588: Fix sleep-in-atomic-context bug
  bpf: fix several offset tests in bpf_msg_pull_data
  nl80211: Pass center frequency in kHz instead of MHz
  nl80211: Fix nla_put_u8 to u16 for NL80211_WMMR_TXOP
  mac80211_hwsim: Fix possible Spectre-v1 for hwsim_world_regdom_custom
  mac80211: don't update the PM state of a peer upon a multicast frame
  cfg80211: make wmm_rule part of the reg_rule structure
  mac80211_hwsim: correct use of IEEE80211_VHT_CAP_RXSTBC_X
  mac80211: correct use of IEEE80211_VHT_CAP_RXSTBC_X
  bpf: sockmap, decrement copied count correctly in redirect error case
  bpf: fix build error with clang
  bpf, sockmap: fix psock refcount leak in bpf_tcp_recvmsg
  bpf, sockmap: fix potential use after free in bpf_tcp_close
  net/rds: Use rdma_read_gids to get connection SGID/DGID in IPv6
  net: dsa: Drop GPIO includes
  tipc: fix the big/little endian issue in tipc_dest
  net: sched: return -ENOENT when trying to remove filter from non-existent chain
  net: sched: fix extack error message when chain is failed to be created
  erspan: set erspan_ver to 1 by default when adding an erspan dev
  sctp: remove useless start_fail from sctp_ht_iter in proc
  sctp: hold transport before accessing its asoc in sctp_transport_get_next
  scsi: aacraid: fix a signedness bug
  Revert "scsi: core: avoid host-wide host_busy counter for scsi_mq"
  Revert "scsi: core: fix scsi_host_queue_ready"
  scsi: libata: Add missing newline at end of file
  scsi: target: iscsi: cxgbit: use pr_debug() instead of pr_info()
  scsi: hpsa: limit transfer length to 1MB, not 512kB
  scsi: lpfc: Correct MDS diag and nvmet configuration
  scsi: lpfc: Default fdmi_on to on
  scsi: csiostor: fix incorrect port capabilities
  scsi: csiostor: add a check for NULL pointer after kmalloc()
  scsi: documentation: add scsi_mod.use_blk_mq to scsi-parameters
  scsi: core: Update SCSI_MQ_DEFAULT help text to match default
  ARC: sort Kconfig
  ARC: cleanup show_faulting_vma()
  ARC: [plat-axs*]: Enable SWAP
  ARC: [plat-axs*/plat-hsdk]: Allow U-Boot to pass MAC-address to the kernel
  ARC: configs: cleanup
  arm64: allwinner: dts: h6: fix Pine H64 MMC bus width
  btrfs: Fix suspicious RCU usage warning in btrfs_debug_in_rcu
  btrfs: use after free in btrfs_quota_enable
  btrfs: btrfs_shrink_device should call commit transaction at the end
  btrfs: fix qgroup_free wrong num_bytes in btrfs_subvolume_reserve_metadata
  Btrfs: fix data corruption when deduplicating between different files
  Btrfs: sync log after logging new name
  cfg80211: remove division by size of sizeof(struct ieee80211_wmm_rule)
  KVM: PPC: Book3S HV: Don't truncate HPTE index in xlate function
  Btrfs: fix unexpected failure of nocow buffered writes after snapshotting when low on space
  mac80211_hwsim: require at least one channel
  KVM: PPC: Book3S HV: Use correct pagesize in kvm_unmap_radix()
  mac80211: Run TXQ teardown code before de-registering interfaces
  rfkill-gpio: include linux/mod_devicetable.h

Change-Id: Ic6d1654e67ece823a5fce6ae18d241ad350bfb08
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
2018-09-14 11:24:01 -07:00
David S. Miller
fc3e3bf55f Here are quite a large number of fixes, notably:
* various A-MSDU building fixes (currently only affects mt76)
  * syzkaller & spectre fixes in hwsim
  * TXQ vs. teardown fix that was causing crashes
  * embed WMM info in reg rule, bad code here had been causing crashes
  * one compilation issue with fix from Arnd (rfkill-gpio includes)
  * fixes for a race and bad data during/after channel switch
  * nl80211: a validation fix, attribute type & unit fixes
 along with other small fixes.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEH1e1rEeCd0AIMq6MB8qZga/fl8QFAluNJXcACgkQB8qZga/f
 l8Qvfw//dBwlhMII862Evk4M8OzhdHfkJ4Kp/d2C476whbEySU/jRIIeetmVpXYV
 5cfStTxBpGkwMj5PXy3DaA2PO++L5qaApDJfHc8DNWNmvt9rRRJul1zP05HjZRxW
 G7aFCFRWVK0dlmVP9GC/b20KyUvz4OpklBnxylkIrx0FCkw5bAHs1SsjGZCg/6Tm
 008DAhFz3Ds6hNLxwricvrk5oQ6eC1cDfDd4Rtk3jCYQ4t7KFn5gFoKzKldfLdWe
 TFTpVQ26XAGzn9QVXzAiXN4ZNpUpZrFXosC7cn5Ugiyic4YtnHxS2wVDuL3vs1cL
 J2hoW6wjEBg+U6vmHMcijo1lnQwW7ueYUDWLJPNIXHA6A7sGyA6z6D7vbbvHfoG6
 L681BrYmTmKkXXquu5+r85/9WgP2cmzbRpoIxTQl3sU2Liw2k5IJ9ryLLyul+8z7
 spnDPOY7h4c0JrAvhjHkrKIbbW4FKYunxZJ8dn9eyAzOd/58iKoXzu4yAggwm+0V
 DtZiu0gSr52sKrh1vqEyfhrPFCN1Mc19DRsJBtabUfVEveQTwToCkbZ5s1sLqSId
 m30XUjjYOiRk7MZnncar0lE4//eJ6bnL3Wie3UTmO3xsMwlgKQPqjI4TprNogUCk
 R2dVeGmhm3HSriRHKJL3/D8uzw5mMBI3Kicw9tFSSyVjtJgxvpg=
 =lLBA
 -----END PGP SIGNATURE-----

Merge tag 'mac80211-for-davem-2018-09-03' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211

Johannes Berg says:

====================
Here are quite a large number of fixes, notably:
 * various A-MSDU building fixes (currently only affects mt76)
 * syzkaller & spectre fixes in hwsim
 * TXQ vs. teardown fix that was causing crashes
 * embed WMM info in reg rule, bad code here had been causing crashes
 * one compilation issue with fix from Arnd (rfkill-gpio includes)
 * fixes for a race and bad data during/after channel switch
 * nl80211: a validation fix, attribute type & unit fixes
along with other small fixes.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2018-09-03 22:12:02 -07:00
Nick Pelly
37de588f8f ANDROID: net: rfkill: Introduce CONFIG_RFKILL_PM and use instead of CONFIG_PM to power down
Some platforms do not want to power down rfkill devices on suspend.

Change-Id: I62a11630521c636d54a4a02ab9037a43435925f5
Signed-off-by: Nick Pelly <npelly@google.com>

[AmitP: Folded following android-4.9 commit changes into this patch
        faad2b874fea ("rfkill: fix unused function warning")]
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
2018-08-28 17:10:42 +05:30
Arnd Bergmann
f623f75ae4 rfkill-gpio: include linux/mod_devicetable.h
One more driver is apparently broken by the recent change
to linux/platform_device.h:

net/rfkill/rfkill-gpio.c: In function 'rfkill_gpio_acpi_probe':
net/rfkill/rfkill-gpio.c:82:29: error: dereferencing pointer to incomplete type 'const struct acpi_device_id'

Include linux/mod_devicetable.h to get the definition of the
acpi_device_id structure.

Fixes: ac3167257b ("headers: separate linux/mod_devicetable.h from linux/platform_device.h")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-08-14 13:59:28 +02:00
Uwe Kleine-König
2282e125a4 leds: triggers: let struct led_trigger::activate() return an error code
Given that activating a trigger can fail, let the callback return an
indication. This prevents to have a trigger active according to the
"trigger" sysfs attribute but not functional.

All users are changed accordingly to return 0 for now. There is no intended
change in behaviour.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
2018-07-05 23:21:10 +02:00
João Paulo Rechi Vita
232aa23ec3 rfkill: Create rfkill-none LED trigger
Creates a new trigger rfkill-none, as a complement to rfkill-any, which
drives LEDs when any radio is enabled. The new trigger is meant to turn
a LED ON whenever all radios are OFF, and turn it OFF otherwise.

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-05-23 11:26:45 +02:00
João Paulo Rechi Vita
d874cd7430 rfkill: Rename rfkill_any_led_trigger* functions
Rename these functions to rfkill_global_led_trigger*, as they are going
to be extended to handle another global rfkill led trigger.

This commit does not change any functionality.

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-05-23 11:25:05 +02:00
Johan Hovold
4bf01ca21e rfkill: gpio: fix memory leak in probe error path
Make sure to free the rfkill device in case registration fails during
probe.

Fixes: 5e7ca3937f ("net: rfkill: gpio: convert to resource managed allocation")
Cc: stable <stable@vger.kernel.org>	# 3.13
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2018-05-07 15:01:40 +02:00
Linus Torvalds
a9a08845e9 vfs: do bulk POLL* -> EPOLL* replacement
This is the mindless scripted replacement of kernel use of POLL*
variables as described by Al, done by this script:

    for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do
        L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'`
        for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done
    done

with de-mangling cleanups yet to come.

NOTE! On almost all architectures, the EPOLL* constants have the same
values as the POLL* constants do.  But they keyword here is "almost".
For various bad reasons they aren't the same, and epoll() doesn't
actually work quite correctly in some cases due to this on Sparc et al.

The next patch from Al will sort out the final differences, and we
should be all done.

Scripted-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-02-11 14:34:03 -08:00
Al Viro
ade994f4f6 net: annotate ->poll() instances
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2017-11-27 16:20:04 -05:00
Andy Shevchenko
4524667b1e net: rfkill: gpio: Switch to devm_acpi_dev_add_driver_gpios()
Switch to use managed variant of acpi_dev_add_driver_gpios() to simplify
error path and fix potentially wrong assingment if ->probe() fails.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2017-06-13 11:07:51 +02:00
Johannes Berg
1331b62c97 rfkill: remove rfkill-regulator
There are no users of this ("vrfkill") in the tree, so it's just
dead code - remove it.

This also isn't really how rfkill is supposed to be used - it's
intended as a signalling mechanism to/from the device, which the
driver (and partially cfg80211) will handle - having a separate
rfkill instance for a regulator is confusing, the driver should
use the regulator instead to turn off the device when requested.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2017-01-24 11:07:35 +01:00
Michał Kępień
9b8e34e211 rfkill: Add rfkill-any LED trigger
Add a new "global" (i.e. not per-rfkill device) LED trigger, rfkill-any,
which may be useful on laptops with a single "radio LED" and multiple
radio transmitters.  The trigger is meant to turn a LED on whenever
there is at least one radio transmitter active and turn it off
otherwise.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2017-01-09 11:40:33 +01:00
Johannes Berg
7b854982b2 Revert "rfkill: Add rfkill-any LED trigger"
This reverts commit 73f4f76a19.

As Mike reported, and I should've seen in review, we can't call
the new LED functions, which acquire the mutex, from places like
rfkill_set_sw_state() that are documented to be callable from
any context the user likes to use. For Mike's case it led to a
deadlock, but other scenarios are possible.

Reported-by: Михаил Кринкин <krinkin.m.u@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-12-20 08:45:54 +01:00
Arnd Bergmann
f6b4122c93 rfkill: hide unused goto label
A cleanup introduced a harmless warning in some configurations:

net/rfkill/core.c: In function 'rfkill_init':
net/rfkill/core.c:1350:1: warning: label 'error_input' defined but not used [-Wunused-label]

This adds another #ifdef around the label to match that around the
caller.

Fixes: 6124c53ede ("rfkill: Cleanup error handling in rfkill_init()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-12-16 10:05:39 +01:00
Michał Kępień
73f4f76a19 rfkill: Add rfkill-any LED trigger
Add a new "global" (i.e. not per-rfkill device) LED trigger, rfkill-any,
which may be useful on laptops with a single "radio LED" and multiple
radio transmitters.  The trigger is meant to turn a LED on whenever
there is at least one radio transmitter active and turn it off
otherwise.

This requires taking rfkill_global_mutex before calling rfkill_set_block()
in rfkill_resume(): since __rfkill_any_led_trigger_event() is called from
rfkill_set_block() unconditionally, each caller of the latter needs to
take care of locking rfkill_global_mutex.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-12-13 16:20:29 +01:00
Michał Kępień
6124c53ede rfkill: Cleanup error handling in rfkill_init()
Use a separate label per error condition in rfkill_init() to make it a
bit cleaner and easier to extend.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-12-13 16:20:29 +01:00
Johannes Berg
74204f8fa1 rfkill: simplify rfkill_set_hw_state() slightly
Simplify the two conditions gating the schedule_work() into
a single one and get rid of the additional exit point from
the function in doing so.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-12-13 16:04:35 +01:00
João Paulo Rechi Vita
1948b2a2ec rfkill: Use switch to demux userspace operations
Using a switch to handle different ev.op values in rfkill_fop_write()
makes the code easier to extend, as out-of-range values can always be
handled by the default case.

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
[roll in fix for RFKILL_OP_CHANGE from Jouni]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-04-05 10:48:53 +02:00
David S. Miller
d67703fced Here's another round of updates for -next:
* big A-MSDU RX performance improvement (avoid linearize of paged RX)
  * rfkill changes: cleanups, documentation, platform properties
  * basic PBSS support in cfg80211
  * MU-MIMO action frame processing support
  * BlockAck reordering & duplicate detection offload support
  * various cleanups & little fixes
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABCgAGBQJW0LZ0AAoJEGt7eEactAAdde0P/2meIOehuHBuAtL7REVoNhri
 bz9eSHMTg+ozCspL7F6vW1ifDI9AaJEaqJccmriueE/UQVC3VXRPGRJ4SFCwZGo9
 Zrtys2v9wOq0+XhxyN65Ucf41O9F/5FFabR5OFbf/pZhW5b2cubEjD1P4BB76Iya
 8O6wf9oDDjt3zJgYK+sygm3k9wtDVrH3qEbj8IDnCy22P7010qCsfok9swfaq8OB
 DBgb6BVfDOFTNXvJGH5fRuUKZdtovzzxorXnoG+zjmKmFdMVdgIYj9+2QfnMjW03
 B4/W85svcLLH8V3lHZc4G8oKM4J4XtjH1PskKIMF7ThJsKGMf8tL2vpt9rr8iscd
 Y9SwTEGc9JmhL7n2FaQFlY6ScLcp4ML+2rXxDOMpBmgF3Ne3yfBsJhLKZEl8vSfI
 mKhzGXpUKjJxJWIxkR0ylJy4/zHeIXkgRlUEhb8t+jgAqvOBTwiVY+vljHCDUERa
 sH40r1OqnGJtOHkSRqXSpxwXW+eKgyDd7fnnRX/tyttp2Fuew27/fN63SjpsfN6O
 3lfSM5bl3FcCKx7vqTLuqzsoqGvDDYkSq6GDfKDqeZIk0vaXA3SJNEOKgymFWQfR
 rzsaXvTbBT34GYRg3xS2NCxlmcBPemei/q0x6ZOffxhF41Qpqjs1dPB1Yq3AW4jD
 HGF+NdRbWEqEFVIjQa8w
 =JHOe
 -----END PGP SIGNATURE-----

Merge tag 'mac80211-next-for-davem-2016-02-26' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next

Johannes Berg says:

====================
Here's another round of updates for -next:
 * big A-MSDU RX performance improvement (avoid linearize of paged RX)
 * rfkill changes: cleanups, documentation, platform properties
 * basic PBSS support in cfg80211
 * MU-MIMO action frame processing support
 * BlockAck reordering & duplicate detection offload support
 * various cleanups & little fixes
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2016-03-01 17:03:27 -05:00
João Paulo Rechi Vita
9487bd6b96 rfkill: Factor rfkill_global_states[].cur assignments
Factor all assignments to rfkill_global_states[].cur into a single
function rfkill_update_global_state().

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-02-24 09:13:11 +01:00
João Paulo Rechi Vita
1a1078901b rfkill: Remove extra blank line
Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-02-24 09:13:10 +01:00
João Paulo Rechi Vita
3ff707d668 rfkill: Improve documentation language
Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-02-24 09:13:09 +01:00
Heikki Krogerus
fb2e6b7b7b net: rfkill: gpio: remove rfkill_gpio_platform_data
No more users for it.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-02-24 09:13:09 +01:00
Heikki Krogerus
7d5e9737ef net: rfkill: gpio: get the name and type from device property
This prepares the driver for removal of platform data.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-02-24 09:13:08 +01:00
Heikki Krogerus
648b50dd6a net: rfkill: add rfkill_find_type function
Helper for finding the type based on name. Useful if the
type needs to be determined based on device property.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
[modify rfkill_types array and BUILD_BUG_ON to not cause errors]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-02-24 09:12:45 +01:00
João Paulo Rechi Vita
e2a35e8929 rfkill: Remove obsolete "claim" sysfs interface
This was scheduled to be removed in 2012 by:

 commit 69c86373c6
 Author: florian@mickler.org <florian@mickler.org>
 Date:   Wed Feb 24 12:05:16 2010 +0100

     Document the rfkill sysfs ABI

     This moves sysfs ABI info from Documentation/rfkill.txt to the
     ABI subfolder and reformats it.

     This also schedules the deprecated sysfs parts to be removed in
     2012 (claim file) and 2014 (state file).

     Signed-off-by: Florian Mickler <florian@mickler.org>
     Signed-off-by: John W. Linville <linville@tuxdriver.com>

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-02-24 09:04:24 +01:00
João Paulo Rechi Vita
1926e260d8 rfkill: remove/inline __rfkill_set_hw_state
__rfkill_set_hw_state() is only one used in rfkill_set_hw_state(), and
none of them are long or complicated, so merging the two makes the code
easier to read.

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-02-24 09:04:24 +01:00
João Paulo Rechi Vita
f3e7fae248 rfkill: use variable instead of duplicating the expression
RFKILL_BLOCK_SW value have just been saved to prev, no need to check it
again in the if expression. This makes code a little bit easier to read.

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-02-24 09:04:23 +01:00
Johannes Berg
dd21dfc645 rfkill: disentangle polling pause and suspend
When suspended while polling is paused, polling will erroneously
resume at resume time. Fix this by tracking pause and suspend in
separate state variable and adding the necessary checks.

Clarify the documentation on this as well.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-02-24 09:04:22 +01:00
Johannes Berg
6736fde967 rfkill: fix rfkill_fop_read wait_event usage
The code within wait_event_interruptible() is called with
!TASK_RUNNING, so mustn't call any functions that can sleep,
like mutex_lock().

Since we re-check the list_empty() in a loop after the wait,
it's safe to simply use list_empty() without locking.

This bug has existed forever, but was only discovered now
because all userspace implementations, including the default
'rfkill' tool, use poll() or select() to get a readable fd
before attempting to read.

Cc: stable@vger.kernel.org
Fixes: c64fb01627 ("rfkill: create useful userspace interface")
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-01-26 11:32:05 +01:00
Heikki Krogerus
d3d2072540 Bluetooth: hci_bcm: move all Broadcom ACPI IDs to BCM HCI driver
The IDs should all be for Broadcom BCM43241 module, and
hci_bcm is now the proper driver for them. This removes one
of two different ways of handling PM with the module.

Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2016-01-04 19:22:05 +01:00
Johannes Berg
b7bb110008 rfkill: copy the name into the rfkill struct
Some users of rfkill, like NFC and cfg80211, use a dynamic name when
allocating rfkill, in those cases dev_name(). Therefore, the pointer
passed to rfkill_alloc() might not be valid forever, I specifically
found the case that the rfkill name was quite obviously an invalid
pointer (or at least garbage) when the wiphy had been renamed.

Fix this by making a copy of the rfkill name in rfkill_alloc().

Cc: stable@vger.kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-12-10 10:37:51 +01:00
João Paulo Rechi Vita
4c0778933a rfkill: Copy "all" global state to other types
When switching the state of all RFKill switches of type all we need to
replicate the RFKILL_TYPE_ALL global state to all the other types global
state, so it is used to initialize persistent RFKill switches on
register.

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-09-04 14:26:56 +02:00
David S. Miller
0aa65cc0c2 Merge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next
Johan Hedberg says:

====================
pull request: bluetooth-next 2015-08-16

Here's what's likely the last bluetooth-next pull request for 4.3:

 - 6lowpan/802.15.4 refactoring, cleanups & fixes
 - Document 6lowpan netdev usage in Documentation/networking/6lowpan.txt
 - Support for UART based QCA Bluetooth controllers
 - Power management support for Broeadcom Bluetooth controllers
 - Change LE connection initiation to always use passive scanning first
 - Support for new Silicon Wave USB ID

Please let me know if there are any issues pulling. Thanks.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2015-08-17 15:41:21 -07:00
Geert Uytterhoeven
36890997b0 rfkill: Allow compile test of GPIO consumers if !GPIOLIB
The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is
not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer
functionality only, can still be compiled if GPIOLIB is not enabled.

Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where
appropriate.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-08-13 10:48:52 +02:00
Frederic Danis
9e6080936c net: rfkill: gpio: Remove BCM2E39 support
Power management support for BCM2E39 is now performed in Bluetooth
BCM UART driver.

Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2015-08-11 21:26:27 +02:00
Uwe Kleine-König
f7959e9c73 net: rfkill: gpio: make better use of gpiod API
Since 39b2bbe3d7 (gpio: add flags argument to gpiod_get*() functions)
which appeared in v3.17-rc1, the gpiod_get* functions take an additional
parameter that allows to specify direction and initial value for output.

Furthermore there is devm_gpiod_get_optional which is designed to get
optional gpios.

Simplify driver accordingly.

Note this makes error checking more strict because only -ENOENT is
ignored when searching for the GPIOs which is good.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-05-29 13:13:45 +02:00
Lars-Peter Clausen
28f297a7af net: rfkill: Switch to PM ops
Use dev_pm_ops instead of the legacy suspend/resume callbacks for the
rfkill class suspend and resume operations.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-05-20 15:00:00 +02:00
David S. Miller
940288b6a5 Last round of updates for net-next:
* revert a patch that caused a regression with mesh userspace (Bob)
  * fix a number of suspend/resume related races
    (from Emmanuel, Luca and myself - we'll look at backporting later)
  * add software implementations for new ciphers (Jouni)
  * add a new ACPI ID for Broadcom's rfkill (Mika)
  * allow using netns FD for wireless (Vadim)
  * some other cleanups (various)
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABCAAGBQJU0NEaAAoJEDBSmw7B7bqr2DAP/3nbk6WB2Lz4Vwi8fh9C4y6X
 4ZzN2v7NHaimC+Wpxg3wP2wCdX2VG3ZWwF3yLm6qgVHGnE35RFLxURen1eqNeW77
 Yf5gvZ066nCGEQ8l8J6YK9vrLX4qp5c4lyE00bbxpZTA4Qq71SgTg+rmGC1be8uX
 vacfaLwfDWffuOOnjBAPfanj7f4AQaUEY2uN1WkBFC7iEeOtPcWVkHAFVIeGjJfQ
 vfgQJcwOjgWjYbwZdQQi7Aj+k1Yzda4pg1yEWn3CkZ8zyeCYGs1gk2ovoBgPgXBP
 yT9ypIdFsN242VJvy7nkFnCKA8mhKyltMQ1Xjs0Q9lAxWdaq9U+iqt5cUn4jxVIG
 T9Vi3PCbx/nVOqcfR81dBTQ3uDU5AyosPsmh2YTxi5lpRBrsjNY2FtaKE0sm2Om3
 wRiSPOdPrXBeEnU0KssI9e6euXgS4JQV78Naq85OWZDd2yZ1fT5U2fi8y4drRGlz
 rucbbobdVhQch5L4FStPz1uW5pNuJrhekXeZIE8MruTNg2A2oBAK3ApO7hxn68sE
 RnbAnkxVLwgedC9042JF5eiS1PDIU46w4e782j/+XskVKMEakqd23iJycx3tmgHZ
 cxDi/qKZ2RCE74YsT61o/9ErSVPvCfNPL3+CVov918jidQQg2WHfKm/jFlIxHIxk
 4wBP7p2VGlENMgw/R8GJ
 =wOaR
 -----END PGP SIGNATURE-----

Merge tag 'mac80211-next-for-davem-2015-02-03' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next

Last round of updates for net-next:
 * revert a patch that caused a regression with mesh userspace (Bob)
 * fix a number of suspend/resume related races
   (from Emmanuel, Luca and myself - we'll look at backporting later)
 * add software implementations for new ciphers (Jouni)
 * add a new ACPI ID for Broadcom's rfkill (Mika)
 * allow using netns FD for wireless (Vadim)
 * some other cleanups (various)

Signed-off-by: David S. Miller <davem@davemloft.net>
2015-02-04 14:57:45 -08:00
Mika Westerberg
79044f60ca net: rfkill: Add Broadcom BCM2E40 bluetooth ACPI ID
This is yet another Broadcom bluetooth chip with ACPI ID BCM2E40.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-02-03 14:38:22 +01:00
Linus Torvalds
e6b5be2be4 Driver core patches for 3.19-rc1
Here's the set of driver core patches for 3.19-rc1.
 
 They are dominated by the removal of the .owner field in platform
 drivers.  They touch a lot of files, but they are "simple" changes, just
 removing a line in a structure.
 
 Other than that, a few minor driver core and debugfs changes.  There are
 some ath9k patches coming in through this tree that have been acked by
 the wireless maintainers as they relied on the debugfs changes.
 
 Everything has been in linux-next for a while.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlSOD20ACgkQMUfUDdst+ylLPACg2QrW1oHhdTMT9WI8jihlHVRM
 53kAoLeteByQ3iVwWurwwseRPiWa8+MI
 =OVRS
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core update from Greg KH:
 "Here's the set of driver core patches for 3.19-rc1.

  They are dominated by the removal of the .owner field in platform
  drivers.  They touch a lot of files, but they are "simple" changes,
  just removing a line in a structure.

  Other than that, a few minor driver core and debugfs changes.  There
  are some ath9k patches coming in through this tree that have been
  acked by the wireless maintainers as they relied on the debugfs
  changes.

  Everything has been in linux-next for a while"

* tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits)
  Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
  fs: debugfs: add forward declaration for struct device type
  firmware class: Deletion of an unnecessary check before the function call "vunmap"
  firmware loader: fix hung task warning dump
  devcoredump: provide a one-way disable function
  device: Add dev_<level>_once variants
  ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
  ath: use seq_file api for ath9k debugfs files
  debugfs: add helper function to create device related seq_file
  drivers/base: cacheinfo: remove noisy error boot message
  Revert "core: platform: add warning if driver has no owner"
  drivers: base: support cpu cache information interface to userspace via sysfs
  drivers: base: add cpu_device_create to support per-cpu devices
  topology: replace custom attribute macros with standard DEVICE_ATTR*
  cpumask: factor out show_cpumap into separate helper function
  driver core: Fix unbalanced device reference in drivers_probe
  driver core: fix race with userland in device_add()
  sysfs/kernfs: make read requests on pre-alloc files use the buffer.
  sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
  fs: sysfs: return EGBIG on write if offset is larger than file size
  ...
2014-12-14 16:10:09 -08:00
Mika Westerberg
72daceb9a1 net: rfkill: gpio: Add default GPIO driver mappings for ACPI
The driver uses devm_gpiod_get_index(..., index) so that the index refers
directly to the GpioIo resource under the ACPI device. The problem with
this is that if the ordering changes we get wrong GPIOs.

With ACPI 5.1 _DSD we can now use names instead to reference GPIOs
analogous to Device Tree. However, we still have systems out there that do
not provide _DSD at all. These systems must be supported as well.

Luckily we now have acpi_dev_add_driver_gpios() that can be used to provide
mappings for systems where _DSD is not provided and still take advantage of
_DSD if it exists.

This patch changes the driver to create default GPIO mappings if we are
running on ACPI system.

While there we can drop the indices completely and use devm_gpiod_get()
with name instead.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-11-04 21:58:24 +01:00
Wolfram Sang
140bbc4af0 net: rfkill: drop owner assignment from platform_drivers
A platform_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-10-20 16:21:58 +02:00
Fabian Frederick
2f29fed3f8 net: rfkill: kernel-doc warning fixes
s/state/blocked

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-08 15:24:15 -04:00
Loic Poulain
fa5c107cc8 net: rfkill: gpio: Fix clock status
Clock is disabled when the device is blocked.
So, clock_enabled is the logical negation of "blocked".

Signed-off-by: Loic Poulain <loic.poulain@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-09-22 16:02:15 -04:00