Commit Graph

670 Commits

Author SHA1 Message Date
Linux Build Service Account
968cc16913 Merge "mmc: core: hibernation support for mmc cards" 2018-05-04 05:21:37 -07:00
Vijay Viswanath
ca899953d8 mmc: core: hibernation support for mmc cards
eMMC is the storage device for hibernation image. As such it needs
to be working when hibernation image is created and written. Also for
loading hibernation image after reboot, eMMC driver needs to be
probed and running.

During reboot,  kernel comes up and does its own eMMC probe and sets
speed for eMMC. A late system call then checks for hibernation image.
If there is a hibernation image, the current kernel will stay only
temporarily.
Once the hibernation image is found and loaded, the temporary kernel
suspends the eMMC device and then gives control to kernel in
hibernation image.
The hibernation image then restores the eMMC device based on the eMMC
driver state saved just before creating hibernation image.
This gives rise to a possible missmatch between the HW state of eMMC
(Specifically the bus speed) when temporary kernel suspends it and the
state driver restores after hibernation restore.
So a synchornization has been done by making the eMMC run in max speed
during:
	1. Just before hibernation image is created (So the driver state
	in hibernation image will be for max speed mode).
	2. After reboot, just before temporary kernel loads image and
	suspends (so the mmc driver in temporary kernel will put the
	eMMC in suspend while HW state is in highest speed mode.
This ensures that the HW state, mmc_resume post the hibernation
expects, will be same as the HW state actually present in the eMMC
at the point of hibernation restore.

This also ensures we save the hibernation image in max performance and
we restore the hibernation image also in max performance.

Change-Id: Ia9deceacade97ac89e4f25b40ce074d75bbb2bbc
Signed-off-by: Vijay Viswanath <vviswana@codeaurora.org>
2018-05-03 20:44:46 +05:30
gaolez
b9af81a3ef mmc: core: Add quirk for QCA9379
Add quirk for QCA9379 card to enable vendor specific settings.

Change-Id: Ib9a43f4506f56e0e59e5f2fc2274afcd29037a63
Signed-off-by: Gaole Zhang <gaolez@codeaurora.org>
2018-04-24 02:07:36 -07:00
Veerabhadrarao Badiganti
27c6c05ebc mmc: card: Service RPMB requests with priority over other requests
RPMB requests are initiated from TZ and TZ gets blocked from servicing
other tasks/requests till it completes RPMB request. Delays in
servicing RPMB request may result in system-level stability/performance
issues.

Below is the issue observed:
1. TZ rpmb API is called to update TA rollback information. TZ forwards
   the request to HLOS mmc driver via rpmb-service.
2. mmc driver services the rpmb requests only after finishing the
   outstanding IO requests.
3. As part of handling an IO requests, mmc driver makes ICE call
   for getting encryption keys, which in-turn makes call to TZ.
4. Since ICE driver finds TZ is busy/blocked it returns ice request
   with -EBUSY error.
5. The failed requests with -EBUSY error would re-queued back.
6. The IO requests keep getting failed and keep getting re-queued
   and mmc driver never gets a chance to service rpmb requests.
7. This results in a deadlock senario.

So RPMB requests need to be serviced immediately.
If there is any outstanding RPMB request, then mmc driver should stop
pulling any more new requests. The moment its done with serving
ongoing requests, It should start processing RPMB request.

Change-Id: I2d0f98a11716ef946551cc1a967e70a38e91d6ac
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
2018-03-27 19:57:31 +05:30
Blagovest Kolenichev
e06a1054bd Merge android-4.9.84 (a9d0273) into msm-4.9
* refs/heads/tmp-a9d0273:
  Linux 4.9.84
  crypto: s5p-sss - Fix kernel Oops in AES-ECB mode
  KVM: nVMX: invvpid handling improvements
  KVM: VMX: clean up declaration of VPID/EPT invalidation types
  KVM: async_pf: Fix #DF due to inject "Page not Present" and "Page Ready" exceptions simultaneously
  x86/microcode/AMD: Change load_microcode_amd()'s param to bool to fix preemptibility bug
  usb: phy: msm add regulator dependency
  arm64: fix warning about swapper_pg_dir overflow
  idle: i7300: add PCI dependency
  spi: bcm-qspi: shut up warning about cfi header inclusion
  binfmt_elf: compat: avoid unused function warning
  arm64: sunxi: always enable reset controller
  drm/i915: hide unused intel_panel_set_backlight function
  kasan: rework Kconfig settings
  clk: meson: gxbb: fix build error without RESET_CONTROLLER
  ISDN: eicon: reduce stack size of sig_ind function
  tw5864: use dev_warn instead of WARN to shut up warning
  em28xx: only use mt9v011 if camera support is enabled
  go7007: add MEDIA_CAMERA_SUPPORT dependency
  tc358743: fix register i2c_rd/wr functions
  shmem: fix compilation warnings on unused functions
  KVM: add X86_LOCAL_APIC dependency
  Input: tca8418_keypad - hide gcc-4.9 -Wmaybe-uninitialized warning
  drm/nouveau: hide gcc-4.9 -Wmaybe-uninitialized
  rbd: silence bogus -Wmaybe-uninitialized warning
  drm: exynos: mark pm functions as __maybe_unused
  security/keys: BIG_KEY requires CONFIG_CRYPTO
  cw1200: fix bogus maybe-uninitialized warning
  reiserfs: avoid a -Wmaybe-uninitialized warning
  ALSA: hda/ca0132 - fix possible NULL pointer use
  arm64: Kconfig: select COMPAT_BINFMT_ELF only when BINFMT_ELF is set
  scsi: advansys: fix uninitialized data access
  x86/vm86: Fix unused variable warning if THP is disabled
  x86/platform: Add PCI dependency for PUNIT_ATOM_DEBUG
  dmaengine: zx: fix build warning
  x86: add MULTIUSER dependency for KVM
  thermal: fix INTEL_SOC_DTS_IOSF_CORE dependencies
  x86/build: Silence the build with "make -s"
  tools build: Add tools tree support for 'make -s'
  x86/fpu/math-emu: Fix possible uninitialized variable use
  arm64: define BUG() instruction without CONFIG_BUG
  gpio: xgene: mark PM functions as __maybe_unused
  x86/ras/inject: Make it depend on X86_LOCAL_APIC=y
  scsi: advansys: fix build warning for PCI=n
  video: fbdev: via: remove possibly unused variables
  perf: xgene: Include module.h
  PCI: Change pci_host_common_probe() visibility
  usb: musb: fix compilation warning on unused function
  platform/x86: intel_mid_thermal: Fix suspend handlers unused warning
  gpio: intel-mid: Fix build warning when !CONFIG_PM
  PCI: vmd: Fix suspend handlers defined-but-not-used warning
  perf/x86: Shut up false-positive -Wmaybe-uninitialized warning
  vmxnet3: prevent building with 64K pages
  clk: sunxi-ng: fix build error without CONFIG_RESET_CONTROLLER
  shmem: avoid maybe-uninitialized warning
  drm/i915: fix intel_backlight_device_register declaration
  crypto: talitos - fix Kernel Oops on hashing an empty file
  powerpc/64s: Improve RFI L1-D cache flush fallback
  powerpc/64s: Simple RFI macro conversions
  powerpc/64s: Fix conversion of slb_miss_common to use RFI_TO_USER/KERNEL
  hippi: Fix a Fix a possible sleep-in-atomic bug in rr_close
  xen: XEN_ACPI_PROCESSOR is Dom0-only
  platform/x86: dell-laptop: Fix keyboard max lighting for Dell Latitude E6410
  x86/mm/kmmio: Fix mmiotrace for page unaligned addresses
  mm/early_ioremap: Fix boot hang with earlyprintk=efi,keep
  usb: dwc3: of-simple: fix missing clk_disable_unprepare
  usb: dwc3: gadget: Wait longer for controller to end command processing
  dmaengine: jz4740: disable/unprepare clk if probe fails
  drm/armada: fix leak of crtc structure
  xfrm: Fix stack-out-of-bounds with misconfigured transport mode policies.
  spi: sun4i: disable clocks in the remove function
  ASoC: rockchip: disable clock on error
  clk: fix a panic error caused by accessing NULL pointer
  dmaengine: at_hdmac: fix potential NULL pointer dereference in atc_prep_dma_interleaved
  dmaengine: ioat: Fix error handling path
  gianfar: Disable EEE autoneg by default
  509: fix printing uninitialized stack memory when OID is empty
  net: ethernet: arc: fix error handling in emac_rockchip_probe
  brcmfmac: Avoid build error with make W=1
  btrfs: Fix possible off-by-one in btrfs_search_path_in_tree
  net_sched: red: Avoid illegal values
  net_sched: red: Avoid devision by zero
  gianfar: fix a flooded alignment reports because of padding issue.
  ARM: dts: Fix elm interrupt compiler warning
  s390/dasd: prevent prefix I/O error
  powerpc/perf: Fix oops when grouping different pmu events
  m68k: add missing SOFTIRQENTRY_TEXT linker section
  ipvlan: Add the skb->mark as flow4's member to lookup route
  scripts/kernel-doc: Don't fail with status != 0 if error encountered with -none
  sctp: only update outstanding_bytes for transmitted queue when doing prsctp_prune
  RDMA/cma: Make sure that PSN is not over max allowed
  i40iw: Correct ARP index mask
  pinctrl: sunxi: Fix A64 UART mux value
  pinctrl: sunxi: Fix A80 interrupt pin bank
  media: s5k6aa: describe some function parameters
  perf bench numa: Fixup discontiguous/sparse numa nodes
  perf top: Fix window dimensions change handling
  ARM: dts: am437x-cm-t43: Correct the dmas property of spi0
  ARM: dts: am4372: Correct the interrupts_properties of McASP
  ARM: dts: logicpd-somlv: Fix wl127x pinmux
  ARM: dts: logicpd-som-lv: Fix gpmc addresses for NAND and enet
  ARM: dts: Fix omap4 hang with GPS connected to USB by using wakeupgen
  ARM: AM33xx: PRM: Remove am33xx_pwrdm_read_prev_pwrst function
  ARM: OMAP2+: Fix SRAM virt to phys translation for save_secure_ram_context
  usb: build drivers/usb/common/ when USB_SUPPORT is set
  usbip: keep usbip_device sockfd state in sync with tcp_socket
  staging: iio: ad5933: switch buffer mode to software
  staging: iio: adc: ad7192: fix external frequency setting
  binder: check for binder_thread allocation failure in binder_poll()
  staging: android: ashmem: Fix a race condition in pin ioctls
  dn_getsockoptdecnet: move nf_{get/set}sockopt outside sock lock
  arm64: dts: add #cooling-cells to CPU nodes
  ARM: 8743/1: bL_switcher: add MODULE_LICENSE tag
  video: fbdev/mmp: add MODULE_LICENSE
  ASoC: ux500: add MODULE_LICENSE tag
  crypto: hash - prevent using keyed hashes without setting key
  crypto: hash - annotate algorithms taking optional key
  net: avoid skb_warn_bad_offload on IS_ERR
  rds: tcp: atomically purge entries from rds_tcp_conn_list during netns delete
  netfilter: xt_RATEEST: acquire xt_rateest_mutex for hash insert
  netfilter: xt_cgroup: initialize info->priv in cgroup_mt_check_v1()
  netfilter: on sockopt() acquire sock lock only in the required scope
  netfilter: ipt_CLUSTERIP: fix out-of-bounds accesses in clusterip_tg_check()
  netfilter: x_tables: avoid out-of-bounds reads in xt_request_find_{match|target}
  netfilter: x_tables: fix int overflow in xt_alloc_table_info()
  kcov: detect double association with a single task
  KVM: x86: fix escape of guest dr6 to the host
  blk_rq_map_user_iov: fix error override
  staging: android: ion: Switch from WARN to pr_warn
  staging: android: ion: Add __GFP_NOWARN for system contig heap
  crypto: x86/twofish-3way - Fix %rbp usage
  selinux: skip bounded transition processing if the policy isn't loaded
  selinux: ensure the context is NUL terminated in security_context_to_sid_core()
  Provide a function to create a NUL-terminated string from unterminated data
  ptr_ring: fail early if queue occupies more than KMALLOC_MAX_SIZE
  drm: Require __GFP_NOFAIL for the legacy drm_modeset_lock_all
  blktrace: fix unlocked registration of tracepoints
  sctp: set frag_point in sctp_setsockopt_maxseg correctly
  xfrm: check id proto in validate_tmpl()
  xfrm: Fix stack-out-of-bounds read on socket policy lookup.
  mm,vmscan: Make unregister_shrinker() no-op if register_shrinker() failed.
  xfrm: skip policies marked as dead while rehashing
  cfg80211: check dev_set_name() return value
  kcm: Only allow TCP sockets to be attached to a KCM mux
  kcm: Check if sk_user_data already set in kcm_attach
  vhost: use mutex_lock_nested() in vhost_dev_lock_vqs()
  ANDROID: sdcardfs: Hold i_mutex for i_size_write
  UPSTREAM: ANDROID: binder: synchronize_rcu() when using POLLFREE.
  BACKPORT, FROMGIT: crypto: speck - add test vectors for Speck64-XTS
  BACKPORT, FROMGIT: crypto: speck - add test vectors for Speck128-XTS
  BACKPORT, FROMGIT: crypto: arm/speck - add NEON-accelerated implementation of Speck-XTS
  FROMGIT: crypto: speck - export common helpers
  BACKPORT, FROMGIT: crypto: speck - add support for the Speck block cipher
  f2fs: updates on v4.16-rc1
  Linux 4.9.83
  media: r820t: fix r820t_write_reg for KASAN
  ARM: dts: Delete bogus reference to the charlcd
  arm: dts: mt2701: Add reset-cells
  ARM: dts: s5pv210: add interrupt-parent for ohci
  arm64: dts: msm8916: Add missing #phy-cells
  ARM: pxa/tosa-bt: add MODULE_LICENSE tag
  ARM: dts: exynos: fix RTC interrupt for exynos5410
  vfs: don't do RCU lookup of empty pathnames
  x86: fix build warnign with 32-bit PAE
  x86/cpu: Change type of x86_cache_size variable to unsigned int
  x86/spectre: Fix an error message
  x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping
  selftests/x86/mpx: Fix incorrect bounds with old _sigfault
  x86/speculation: Add <asm/msr-index.h> dependency
  nospec: Move array_index_nospec() parameter checking into separate macro
  x86/speculation: Fix up array_index_nospec_mask() asm constraint
  selftests/x86: Do not rely on "int $0x80" in single_step_syscall.c
  selftests/x86: Do not rely on "int $0x80" in test_mremap_vdso.c
  selftests/x86/pkeys: Remove unused functions
  x86/speculation: Clean up various Spectre related details
  X86/nVMX: Properly set spec_ctrl and pred_cmd before merging MSRs
  KVM/x86: Reduce retpoline performance impact in slot_handle_level_range(), by always inlining iterator helper methods
  x86/speculation: Correct Speculation Control microcode blacklist again
  x86/speculation: Update Speculation Control microcode blacklist
  compiler-gcc.h: Introduce __optimize function attribute
  x86/entry/64/compat: Clear registers for compat syscalls, to reduce speculation attack surface
  arm: spear13xx: Fix spics gpio controller's warning
  arm: spear13xx: Fix dmas cells
  arm: spear600: Add missing interrupt-parent of rtc
  ARM: dts: nomadik: add interrupt-parent for clcd
  ARM: dts: STi: Add gpio polarity for "hdmi,hpd-gpio" property
  ARM: lpc3250: fix uda1380 gpio numbers
  arm64: dts: msm8916: Correct ipc references for smsm
  s390: fix handling of -1 in set{,fs}[gu]id16 syscalls
  ocfs2: try a blocking lock before return AOP_TRUNCATED_PAGE
  PM / devfreq: Propagate error from devfreq_add_device()
  cpufreq: powernv: Dont assume distinct pstate values for nominal and pmin
  RDMA/rxe: Fix a race condition related to the QP error state
  kselftest: fix OOM in memory compaction test
  IB/mlx4: Fix incorrectly releasing steerable UD QPs when have only ETH ports
  IB/qib: Fix comparison error with qperf compare/swap test
  powerpc: fix build errors in stable tree
  dm: correctly handle chained bios in dec_pending()
  usb: Move USB_UHCI_BIG_ENDIAN_* out of USB_SUPPORT
  mvpp2: fix multicast address filter
  ALSA: seq: Fix racy pool initializations
  ALSA: usb-audio: add implicit fb quirk for Behringer UFX1204
  ALSA: hda/realtek: PCI quirk for Fujitsu U7x7
  ALSA: hda/realtek - Enable Thinkpad Dock device for ALC298 platform
  ALSA: usb-audio: Fix UAC2 get_ctl request with a RANGE attribute
  ALSA: hda - Fix headset mic detection problem for two Dell machines
  mtd: nand: vf610: set correct ooblayout
  9p/trans_virtio: discard zero-length reply
  Btrfs: fix unexpected -EEXIST when creating new inode
  Btrfs: fix btrfs_evict_inode to handle abnormal inodes correctly
  Btrfs: fix extent state leak from tree log
  Btrfs: fix crash due to not cleaning up tree log block's dirty bits
  Btrfs: fix deadlock in run_delalloc_nocow
  target/iscsi: avoid NULL dereference in CHAP auth error path
  rtlwifi: rtl8821ae: Fix connection lost problem correctly
  console/dummy: leave .con_font_get set to NULL
  video: fbdev: atmel_lcdfb: fix display-timings lookup
  PCI: keystone: Fix interrupt-controller-node lookup
  MIPS: Fix typo BIG_ENDIAN to CPU_BIG_ENDIAN
  mm: Fix memory size alignment in devm_memremap_pages_release()
  mm: hide a #warning for COMPILE_TEST
  ext4: correct documentation for grpid mount option
  ext4: save error to disk in __ext4_grp_locked_error()
  ext4: fix a race in the ext4 shutdown path
  jbd2: fix sphinx kernel-doc build warnings
  mbcache: initialize entry->e_referenced in mb_cache_entry_create()
  rtc-opal: Fix handling of firmware error codes, prevent busy loops
  drm/radeon: adjust tested variable
  drm/radeon: Add dpm quirk for Jet PRO (v2)
  scsi: smartpqi: allow static build ("built-in")
  BACKPORT: tee: shm: Potential NULL dereference calling tee_shm_register()
  BACKPORT: tee: shm: don't put_page on null shm->pages
  BACKPORT: tee: shm: make function __tee_shm_alloc static
  BACKPORT: tee: optee: check type of registered shared memory
  BACKPORT: tee: add start argument to shm_register callback
  BACKPORT: tee: optee: fix header dependencies
  BACKPORT: tee: shm: inline tee_shm_get_id()
  BACKPORT: tee: use reference counting for tee_context
  BACKPORT: tee: optee: enable dynamic SHM support
  BACKPORT: tee: optee: add optee-specific shared pool implementation
  BACKPORT: tee: optee: store OP-TEE capabilities in private data
  BACKPORT: tee: optee: add registered buffers handling into RPC calls
  BACKPORT: tee: optee: add registered shared parameters handling
  BACKPORT: tee: optee: add shared buffer registration functions
  BACKPORT: tee: optee: add page list manipulation functions
  BACKPORT: tee: optee: Update protocol definitions
  BACKPORT: tee: shm: add page accessor functions
  BACKPORT: tee: shm: add accessors for buffer size and page offset
  BACKPORT: tee: add register user memory
  BACKPORT: tee: flexible shared memory pool creation
  BACKPORT: optee: support asynchronous supplicant requests
  BACKPORT: tee: add TEE_IOCTL_PARAM_ATTR_META
  BACKPORT: tee: add tee_param_is_memref() for driver use
  UPSTREAM: tcp: fix access to sk->sk_state in tcp_poll()
  BACKPORT: tcp: fix potential double free issue for fastopen_req
  BACKPORT: xfrm: Fix return value check of copy_sec_ctx.
  time: Fix ktime_get_raw() incorrect base accumulation
  FROMLIST: coresight: ETM: Add support for ARM Cortex-A73
  FROMLIST: coresight: tmc: implementing TMC-ETR AUX space API
  UPSTREAM: coresight: etm_perf: Fix using uninitialised work
  UPSTREAM: coresight: fix kernel panic caused by invalid CPU
  UPSTREAM: coresight: Fix disabling of CoreSight TPIU
  UPSTREAM: coresight: perf: Add a missing call to etm_free_aux
  UPSTREAM: coresight: tmc: Remove duplicate memset
  UPSTREAM: coresight: tmc: Get rid of mode parameter for helper routines
  UPSTREAM: coresight: tmc: Cleanup operation mode handling
  UPSTREAM: coresight: reset "enable_sink" flag when need be
  sched/fair: prevent possible infinite loop in sched_group_energy
  ANDROID: qtaguid: Fix the UAF probelm with tag_ref_tree
  UPSTREAM: ANDROID: binder: remove waitqueue when thread exits.
  ANDROID: sdcardfs: Protect set_top
  ANDROID: fsnotify: Notify lower fs of open
  Revert "ANDROID: sdcardfs: notify lower file of opens"
  ANDROID: sdcardfs: Use lower getattr times/size
  ANDROID: sched: EAS: check energy_aware() before calling select_energy_cpu_brute() in up-migrate path
  UPSTREAM: eventpoll.h: add missing epoll event masks
  BACKPORT: thermal/drivers/hisi: Add support for hi3660 SoC
  BACKPORT: thermal/drivers/hisi: Prepare to add support for other hisi platforms
  BACKPORT: thermal/drivers/hisi: Add platform prefix to function name
  BACKPORT: thermal/drivers/hisi: Put platform code together
  BACKPORT: thermal/drivers/hisi: Use round up step value
  BACKPORT: thermal/drivers/hisi: Move the clk setup in the corresponding functions
  BACKPORT: thermal/drivers/hisi: Remove mutex_lock in the code
  BACKPORT: thermal/drivers/hisi: Remove thermal data back pointer
  BACKPORT: thermal/drivers/hisi: Convert long to int
  BACKPORT: thermal/drivers/hisi: Rename and remove unused field
  BACKPORT: thermal/drivers/hisi: Remove costly sensor inspection
  BACKPORT: thermal/drivers/hisi: Fix configuration register setting
  BACKPORT: thermal/drivers/hisi: Encapsulate register writes into helpers
  BACKPORT: thermal/drivers/hisi: Remove pointless lock
  BACKPORT: thermal/drivers/hisi: Remove the multiple sensors support
  BACKPORT: thermal: hisilicon: constify thermal_zone_of_device_ops structures
  ANDROID: xattr: Pass EOPNOTSUPP to permission2
  ANDROID: sdcardfs: Move default_normal to superblock
  UPSTREAM: tcp: fix a request socket leak
  UPSTREAM: tcp: fix possible deadlock in TCP stack vs BPF filter
  UPSTREAM: tcp: Add a tcp_filter hook before handle ack packet
  FROMLIST: arm64: kpti: Fix the interaction between ASID switching and software PAN
  FROMLIST: arm64: Move post_ttbr_update_workaround to C code
  fscrypt: updates on 4.15-rc4
  ANDROID: uid_sys_stats: fix the comment
  BACKPORT: optee: fix invalid of_node_put() in optee_driver_init()
  BACKPORT: tee: optee: sync with new naming of interrupts
  BACKPORT: tee: indicate privileged dev in gen_caps
  BACKPORT: tee: optee: interruptible RPC sleep
  BACKPORT: tee: optee: add const to tee_driver_ops and tee_desc structures
  BACKPORT: tee: tee_shm: Constify dma_buf_ops structures.
  BACKPORT: tee: add forward declaration for struct device
  BACKPORT: tee: optee: fix uninitialized symbol 'parg'
  BACKPORT: tee.txt: standardize document format
  BACKPORT: tee: add ARM_SMCCC dependency
  clocksource: arch_timer: make virtual counter access configurable
  arm64: issue isb when trapping CNTVCT_EL0 access
  BACKPORT: arm64: Add CNTFRQ_EL0 trap handler
  BACKPORT: arm64: Add CNTVCT_EL0 trap handler
  ANDROID: sdcardfs: Fix missing break on default_normal
  ANDROID: arm64: kaslr: fixup Falkor workaround for 4.9
  ANDROID: usb: f_fs: Prevent gadget unbind if it is already unbound
  arm64: Kconfig: Reword UNMAP_KERNEL_AT_EL0 kconfig entry
  arm64: use RET instruction for exiting the trampoline
  UPSTREAM: arm64: kaslr: Put kernel vectors address in separate data page
  UPSTREAM: arm64: mm: Introduce TTBR_ASID_MASK for getting at the ASID in the TTBR
  UPSTREAM: arm64: Kconfig: Add CONFIG_UNMAP_KERNEL_AT_EL0
  UPSTREAM: arm64: entry: Add fake CPU feature for unmapping the kernel at EL0
  UPSTREAM: arm64: tls: Avoid unconditional zeroing of tpidrro_el0 for native tasks
  UPSTREAM: arm64: erratum: Work around Falkor erratum #E1003 in trampoline code
  UPSTREAM: arm64: entry: Hook up entry trampoline to exception vectors
  UPSTREAM: arm64: entry: Explicitly pass exception level to kernel_ventry macro
  UPSTREAM: arm64: mm: Map entry trampoline into trampoline and kernel page tables
  UPSTREAM: arm64: entry: Add exception trampoline page for exceptions from EL0
  UPSTREAM: arm64: mm: Invalidate both kernel and user ASIDs when performing TLBI
  UPSTREAM: arm64: mm: Add arm64_kernel_unmapped_at_el0 helper
  UPSTREAM: arm64: mm: Allocate ASIDs in pairs
  UPSTREAM: arm64: mm: Fix and re-enable ARM64_SW_TTBR0_PAN
  UPSTREAM: arm64: mm: Rename post_ttbr0_update_workaround
  UPSTREAM: arm64: mm: Move ASID from TTBR0 to TTBR1
  UPSTREAM: arm64: mm: Temporarily disable ARM64_SW_TTBR0_PAN
  UPSTREAM: arm64: mm: Use non-global mappings for kernel space
  UPSTREAM: arm64: factor out entry stack manipulation
  ANDROID: sdcardfs: Add default_normal option
  ANDROID: sdcardfs: notify lower file of opens
  blkdev: Refactoring block io latency histogram codes
  UPSTREAM: netfilter: conntrack: use power efficient workqueue
  ANDROID: binder: Remove obsolete proc waitqueue.
  UPSTREAM: arm64: setup: introduce kaslr_offset()
  UPSTREAM: kcov: fix comparison callback signature
  UPSTREAM: kcov: support comparison operands collection
  UPSTREAM: kcov: remove pointless current != NULL check
  UPSTREAM: kcov: support compat processes
  UPSTREAM: kcov: simplify interrupt check
  UPSTREAM: kcov: make kcov work properly with KASLR enabled
  UPSTREAM: kcov: add more missing includes
  BACKPORT: irq: Make the irqentry text section unconditional
  UPSTREAM: kasan: make get_wild_bug_type() static
  UPSTREAM: kasan: separate report parts by empty lines
  UPSTREAM: kasan: improve double-free report format
  UPSTREAM: kasan: print page description after stacks
  UPSTREAM: kasan: improve slab object description
  UPSTREAM: kasan: change report header
  UPSTREAM: kasan: simplify address description logic
  UPSTREAM: kasan: change allocation and freeing stack traces headers
  UPSTREAM: kasan: unify report headers
  UPSTREAM: kasan: introduce helper functions for determining bug type
  BACKPORT: kasan: report only the first error by default
  UPSTREAM: kasan: fix races in quarantine_remove_cache()
  UPSTREAM: kasan: resched in quarantine_remove_cache()
  UPSTREAM: kasan, sched/headers: Uninline kasan_enable/disable_current()
  UPSTREAM: kasan: drain quarantine of memcg slab objects
  UPSTREAM: kasan: eliminate long stalls during quarantine reduction
  UPSTREAM: kasan: support panic_on_warn
  ANDROID: dma-buf/sw_sync: Rename active_list to link
  ANDROID: initramfs: call free_initrd() when skipping init
  BACKPORT: Documentation: tee subsystem and op-tee driver
  BACKPORT: tee: add OP-TEE driver
  BACKPORT: tee: generic TEE subsystem
  BACKPORT: dt/bindings: add bindings for optee
  BACKPORT: schedutil: Reset cached freq if it is not in sync with next_freq
  sched: EAS/WALT: Don't take into account of running task's util
  sched: EAS/WALT: take into account of waking task's load
  sched: EAS: upmigrate misfit current task
  sched: avoid pushing tasks to an offline CPU
  sched: Extend active balance to accept 'push_task' argument
  sched: walt: Correct WALT window size initialization
  sched: WALT: account cumulative window demand
  sched: EAS/WALT: finish accounting prior to task_tick
  sched/fair: prevent meaningless active migration
  sched: walt: Leverage existing helper APIs to apply invariance
  UPSTREAM: net: xfrm: allow clearing socket xfrm policies.
  UPSTREAM: time: Clean up CLOCK_MONOTONIC_RAW time handling
  UPSTREAM: arm64: vdso: fix clock_getres for 4GiB-aligned res
  f2fs: updates on 4.15-rc1
  UPSTREAM: android: binder: fix type mismatch warning
  BACKPORT: arm64: Use __pa_symbol for empty_zero_page
  UPSTREAM: arm64: Use __pa_symbol for kernel symbols
  UPSTREAM: mm: Introduce lm_alias
  FROMLIST: binder: fix proc->files use-after-free
  BACKPORT: xfrm: Clear sk_dst_cache when applying per-socket policy.
  sched: WALT: fix potential overflow
  sched: Update task->on_rq when tasks are moving between runqueues
  sched: WALT: fix window mis-alignment
  sched: EAS: kill incorrect nohz idle cpu kick
  sched: EAS: fix incorrect energy delta calculation due to rounding error
  sched: EAS/WALT: use cr_avg instead of prev_runnable_sum
  sched: WALT: fix broken cumulative runnable average accounting
  sched: deadline: WALT: account cumulative runnable avg
  ANDROID: binder: clarify deferred thread work.
  BACKPORT: net/tcp-fastopen: Add new API support
  UPSTREAM: net: Remove __sk_dst_reset() in tcp_v6_connect()
  UPSTREAM: net/tcp-fastopen: refactor cookie check logic
  sched: compute task utilisation with WALT consistently
  FROMLIST: arm64: Avoid aligning normal memory pointers in __memcpy_{to,from}io
  UPSTREAM: security: bpf: replace include of linux/bpf.h with forward declarations
  UPSTREAM: selinux: bpf: Add addtional check for bpf object file receive
  UPSTREAM: selinux: bpf: Add selinux check for eBPF syscall operations
  BACKPORT: security: bpf: Add LSM hooks for bpf object related syscall
  BACKPORT: bpf: Add file mode configuration into bpf maps
  cpufreq: Drop schedfreq governor
  ANDROID: Revert "arm64: move ELF_ET_DYN_BASE to 4GB / 4MB"
  ANDROID: Revert "arm: move ELF_ET_DYN_BASE to 4MB"
  sched: EAS: Fix the condition to distinguish energy before/after
  sched: EAS: update trg_cpu to backup_cpu if no energy saving for target_cpu
  sched/fair: consider task utilization in group_max_util()
  sched/fair: consider task utilization in group_norm_util()
  sched/fair: enforce EAS mode
  sched/fair: ignore backup CPU when not valid
  sched/fair: trace energy_diff for non boosted tasks
  UPSTREAM: sched/fair: Sync task util before slow-path wakeup
  UPSTREAM: sched/core: Add missing update_rq_clock() call in set_user_nice()
  UPSTREAM: sched/core: Add missing update_rq_clock() call for task_hot()
  UPSTREAM: sched/core: Add missing update_rq_clock() in detach_task_cfs_rq()
  UPSTREAM: sched/core: Add missing update_rq_clock() in post_init_entity_util_avg()
  UPSTREAM: sched/fair: Fix task group initialization
  cpufreq/sched: Consider max cpu capacity when choosing frequencies
  cpufreq/sched: Use cpu max freq rather than policy max
  sched/fair: remove erroneous RCU_LOCKDEP_WARN from start_cpu()
  FROMLIST: ALSA: usx2y: Suppress kernel warning at page allocation failures
  FROMLIST: kbuild: clang: fix build failures with sparse check
  Revert "Revert "BACKPORT: efi/libstub/arm64: Set -fpie when building the EFI stub""
  BACKPORT: efi/libstub: Unify command line param parsing
  ANDROID: sched/walt: Fix divide by zero error in cpufreq notifier
  ANDROID: binder: show high watermark of alloc->pages.
  ANDROID: binder: Add thread->process_todo flag.
  ANDROID: sched/fair: Select correct capacity state for energy_diff
  ANDROID: cpufreq-dt: Set sane defaults for schedutil rate limits
  BACKPORT: cpufreq: schedutil: Use policy-dependent transition delays
  Revert "BACKPORT: efi/libstub/arm64: Set -fpie when building the EFI stub"
  FROMLIST: android: binder: Fix null ptr dereference in debug msg
  FROMLIST: android: binder: Change binder_shrinker to static
  UPSTREAM: arm64: compat: Remove leftover variable declaration
  ANDROID: HACK: arm64: use -mno-implicit-float instead of -mgeneral-regs-only
  ANDROID: Kbuild, LLVMLinux: allow overriding clang target triple
  CHROMIUM: arm64: Disable asm-operand-width warning for clang
  CHROMIUM: kbuild: clang: Disable the 'duplicate-decl-specifier' warning
  BACKPORT: x86/asm: Fix inline asm call constraints for Clang
  BACKPORT: efi/libstub/arm64: Set -fpie when building the EFI stub
  UPSTREAM: efi/libstub/arm64: Force 'hidden' visibility for section markers
  UPSTREAM: efi/libstub/arm64: Use hidden attribute for struct screen_info reference
  UPSTREAM: x86/build: Use cc-option to validate stack alignment parameter
  UPSTREAM: x86/build: Fix stack alignment for CLang
  UPSTREAM: compiler, clang: always inline when CONFIG_OPTIMIZE_INLINING is disabled
  UPSTREAM: x86/boot: #undef memcpy() et al in string.c
  UPSTREAM: llist: clang: introduce member_address_is_nonnull()
  UPSTREAM: crypto: arm64/sha - avoid non-standard inline asm tricks
  UPSTREAM: kbuild: clang: Disable 'address-of-packed-member' warning
  UPSTREAM: x86/build: Specify stack alignment for clang
  UPSTREAM: x86/build: Use __cc-option for boot code compiler options
  UPSTREAM: kbuild: Add __cc-option macro
  UPSTREAM: x86/mm/kaslr: Use the _ASM_MUL macro for multiplication to work around Clang incompatibility
  UPSTREAM: crypto, x86: aesni - fix token pasting for clang
  UPSTREAM: x86/kbuild: Use cc-option to enable -falign-{jumps/loops}
  UPSTREAM: compiler, clang: properly override 'inline' for clang
  UPSTREAM: compiler, clang: suppress warning for unused static inline functions
  UPSTREAM: modules: mark __inittest/__exittest as __maybe_unused
  UPSTREAM: kbuild: Add support to generate LLVM assembly files
  UPSTREAM: kbuild: use -Oz instead of -Os when using clang
  UPSTREAM: kbuild, LLVMLinux: Add -Werror to cc-option to support clang
  UPSTREAM: kbuild: drop -Wno-unknown-warning-option from clang options
  UPSTREAM: kbuild: fix asm-offset generation to work with clang
  UPSTREAM: kbuild: consolidate redundant sed script ASM offset generation
  UPSTREAM: kbuild: Consolidate header generation from ASM offset information
  UPSTREAM: kbuild: clang: add -no-integrated-as to KBUILD_[AC]FLAGS
  UPSTREAM: kbuild: Add better clang cross build support
  FROMLIST: f2fs: expose some sectors to user in inline data or dentry case
  UPSTREAM: sched/fair: Fix usage of find_idlest_group() when the local group is idlest
  UPSTREAM: sched/fair: Fix usage of find_idlest_group() when no groups are allowed
  UPSTREAM: sched/fair: Fix find_idlest_group() when local group is not allowed
  UPSTREAM: sched/fair: Remove unnecessary comparison with -1
  UPSTREAM: sched/fair: Move select_task_rq_fair() slow-path into its own function
  UPSTREAM: sched/fair: Force balancing on NOHZ balance if local group has capacity
  UPSTREAM: f2fs: fix potential panic during fstrim
  f2fs: catch up to v4.14-rc1
  UPSTREAM: sched: use load_avg for selecting idlest group
  UPSTREAM: sched: fix find_idlest_group for fork
  ANDROID: binder: fix node sched policy calculation
  ANDROID: binder: init desired_prio.sched_policy before use it
  BACKPORT: net: xfrm: support setting an output mark.
  FROMLIST: tracing: Add support for preempt and irq enable/disable events
  FROMLIST: tracing: Prepare to add preempt and irq trace events

Conflicts:
	arch/arm64/Kconfig
	arch/arm64/include/asm/assembler.h
	arch/arm64/include/asm/cpucaps.h
	arch/arm64/include/asm/efi.h
	arch/arm64/include/asm/memory.h
	arch/arm64/include/asm/mmu.h
	arch/arm64/include/asm/mmu_context.h
	arch/arm64/kernel/cpufeature.c
	arch/arm64/kernel/io.c
	arch/arm64/kernel/setup.c
	arch/arm64/kernel/vdso.c
	arch/arm64/mm/context.c
	arch/arm64/mm/mmu.c
	drivers/Kconfig
	drivers/Makefile
	drivers/cpufreq/Kconfig
	drivers/hwtracing/coresight/coresight-etm4x.c
	drivers/hwtracing/coresight/coresight-priv.h
	drivers/hwtracing/coresight/coresight-tmc-etr.c
	drivers/hwtracing/coresight/coresight.c
	drivers/scsi/ufs/ufshcd.h
	drivers/staging/android/ion/ion-ioctl.c
	drivers/staging/android/ion/ion_system_heap.c
	drivers/usb/dwc3/gadget.c
	include/linux/sched.h
	include/trace/events/sched.h
	kernel/kcov.c
	kernel/sched/core.c
	kernel/sched/cpufreq_sched.c
	kernel/sched/cpufreq_schedutil.c
	kernel/sched/fair.c
	kernel/sched/sched.h
	kernel/sched/walt.c
	kernel/sched/walt.h
	mm/kasan/report.c
	security/security.c
	security/selinux/hooks.c

Change-Id: I0ec8cbca6cb6384e22fbbe8def8a9d228229dc48
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
2018-03-19 04:18:31 -07:00
Hyojun Kim
11537d5ac9 blkdev: Refactoring block io latency histogram codes
The current io_latency_state structure includes entries for read
and write requests. There are special types of write commands
such as sync and discard (trim) commands, and the current
implementation is not general enough if we want to separate
latency histogram for such special commands.

This change makes io_latency_state structure request-type neutral.
It also changes to print the latency average.

Signed-off-by: Hyojun Kim <hyojun@google.com>
2018-01-03 21:16:40 +00:00
Wanhyeong Ryu
608a998e1a mmc: core: Return error if fallback to lower speed mode fails
If there are continuous data-CRC errors in higher speed modes (SDR104
mode), then driver fallbacks to lower speed mode. But if at all it
fails to fallback to lower speed mode, then that error should be
propagated to the caller so that caller will handle it appropriately.

Without this change, sometime while processing card removal event,
driver fails to detect card removal and treats card as present
eventhough its removed.

Change-Id: I89544d41c5b014eb9227ba33ef9ec1917b6793dc
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
2017-11-07 22:32:17 +05:30
Ankit Jain
0d55bf07c6 mmc: core: add mmc flush detect work.
Block device should be available before mounting of
root device. In some cases block device is not available
at the time of root device mounting because mmc detect
work is not completed by that time which is causing mount
failure. To fix this, flush mmc detect work after device
probe completion.

Change-Id: I785a1e01a691652cfdb5a82acee2475e23fe3766
Signed-off-by: Ankit Jain <jankit@codeaurora.org>
2017-11-01 02:37:15 -07:00
Linux Build Service Account
411a7a1188 Merge "Merge remote-tracking branch '4.9/tmp-05a906d' into msm-4.9" 2017-10-24 19:57:25 -07:00
Kyle Yan
1bca48ef39 Merge remote-tracking branch '4.9/tmp-05a906d' into msm-4.9
* 4.9/tmp-05a906d:
  Linux 4.9.56
  Revert "socket, bpf: fix possible use after free"
  Linux 4.9.55
  KVM: x86: fix singlestepping over syscall
  f2fs: don't allow encrypted operations without keys
  ext4: don't allow encrypted operations without keys
  ext4: Don't clear SGID when inheriting ACLs
  ext4: fix data corruption for mmap writes
  vfs: deny copy_file_range() for non regular files
  sched/cpuset/pm: Fix cpuset vs. suspend-resume bugs
  mmc: core: add driver strength selection when selecting hs400es
  nvme-pci: Use PCI bus address for data/queues in CMB
  drm/i915/bios: ignore HDMI on port A
  brcmfmac: setup passive scan if requested by user-space
  brcmfmac: add length check in brcmf_cfg80211_escan_handler()
  scsi: sd: Do not override max_sectors_kb sysfs setting
  iwlwifi: add workaround to disable wide channels in 5GHz
  iwlwifi: mvm: use IWL_HCMD_NOCOPY for MCAST_FILTER_CMD
  netlink: fix nla_put_{u8,u16,u32} for KASAN
  rocker: fix rocker_tlv_put_* functions for KASAN
  HID: wacom: bits shifted too much for 9th and 10th buttons
  HID: wacom: Always increment hdev refcount within wacom_get_hdev_data
  HID: wacom: leds: Don't try to control the EKR's read-only LEDs
  HID: i2c-hid: allocate hid buffers for real worst case
  ftrace: Fix kmemleak in unregister_ftrace_graph
  stm class: Fix a use-after-free
  Drivers: hv: fcopy: restore correct transfer length
  driver core: platform: Don't read past the end of "driver_override" buffer
  percpu: make this_cpu_generic_read() atomic w.r.t. interrupts
  powerpc/tm: Fix illegal TM state in signal handler
  powerpc/64s: Use emergency stack for kernel TM Bad Thing program checks
  socket, bpf: fix possible use after free
  net: rtnetlink: fix info leak in RTM_GETSTATS call
  tipc: use only positive error codes in messages
  ip6_tunnel: update mtu properly for ARPHRD_ETHER tunnel device in tx path
  ip6_gre: ip6gre_tap device should keep dst
  netlink: do not proceed if dump's start() errs
  net: Set sk_prot_creator when cloning sockets to the right proto
  packet: only test po->has_vnet_hdr once in packet_snd
  packet: in packet_do_bind, test fanout with bind_lock held
  net: dsa: Fix network device registration order
  tun: bail out from tun_get_user() if the skb is empty
  l2tp: fix race condition in l2tp_tunnel_delete
  l2tp: Avoid schedule while atomic in exit_net
  vti: fix use after free in vti_tunnel_xmit/vti6_tnl_xmit
  net: qcom/emac: specify the correct size when mapping a DMA buffer
  net_sched: always reset qdisc backlog in qdisc_reset()
  isdn/i4l: fetch the ppp_write buffer in one shot
  bpf: one perf event close won't free bpf program attached by another perf event
  packet: hold bind lock when rebinding to fanout hook
  net: emac: Fix napi poll list corruption
  tcp: fastopen: fix on syn-data transmit failure
  net/sched: cls_matchall: fix crash when used with classful qdisc
  ip6_tunnel: do not allow loading ip6_tunnel if ipv6 is disabled in cmdline
  net: phy: Fix mask value write on gmii2rgmii converter speed register
  ip6_gre: skb_push ipv6hdr before packing the header in ip6gre_header
  udpv6: Fix the checksum computation when HW checksum does not apply
  tcp: fix data delivery rate
  bpf/verifier: reject BPF_ALU64|BPF_END
  tcp: update skb->skb_mstamp more carefully
  sctp: potential read out of bounds in sctp_ulpevent_type_enabled()
  net: sched: fix use-after-free in tcf_action_destroy and tcf_del_walker
  mlxsw: spectrum: Prevent mirred-related crash on removal
  ALSA: usx2y: Suppress kernel warning at page allocation failures
  Revert "ALSA: echoaudio: purge contradictions between dimension matrix members and total number of members"
  ALSA: compress: Remove unused variable
  lsm: fix smack_inode_removexattr and xattr_getsecurity memleak
  lib/ratelimit.c: use deferred printk() version
  mm, oom_reaper: skip mm structs with mmu notifiers
  staging: vchiq_2835_arm: Fix NULL ptr dereference in free_pagelist
  uwb: ensure that endpoint is interrupt
  uwb: properly check kthread_run return value
  iio: adc: mcp320x: Fix oops on module unload
  iio: adc: mcp320x: Fix readout of negative voltages
  iio: ad7793: Fix the serial interface reset
  IIO: BME280: Updates to Humidity readings need ctrl_reg write!
  iio: core: Return error for failed read_reg
  staging: iio: ad7192: Fix - use the dedicated reset function avoiding dma from stack.
  iio: ad_sigma_delta: Implement a dedicated reset function
  iio: adc: twl4030: Disable the vusb3v1 rugulator in the error handling path of 'twl4030_madc_probe()'
  iio: adc: twl4030: Fix an error handling path in 'twl4030_madc_probe()'
  Revert "xhci: Limit USB2 port wake support for AMD Promontory hosts"
  xhci: set missing SuperSpeedPlus Link Protocol bit in roothub descriptor
  xhci: Fix sleeping with spin_lock_irq() held in ASmedia 1042A workaround
  xhci: fix finding correct bus_state structure for USB 3.1 hosts
  USB: fix out-of-bounds in usb_set_configuration
  usb: Increase quirk delay for USB devices
  USB: core: harden cdc_parse_cdc_header
  USB: uas: fix bug in handling of alternate settings
  USB: g_mass_storage: Fix deadlock when driver is unbound
  usb: gadget: mass_storage: set msg_registered after msg registered
  USB: devio: Don't corrupt user memory
  USB: dummy-hcd: Fix erroneous synchronization change
  USB: dummy-hcd: fix infinite-loop resubmission bug
  USB: dummy-hcd: fix connection failures (wrong speed)
  USB: cdc-wdm: ignore -EPIPE from GetEncapsulatedResponse
  usb: pci-quirks.c: Corrected timeout values used in handshake
  ALSA: usb-audio: Check out-of-bounds access by corrupted buffer descriptor
  usb: renesas_usbhs: fix usbhsf_fifo_clear() for RX direction
  usb: renesas_usbhs: fix the BCLR setting condition for non-DCP pipe
  usb-storage: fix bogus hardware error messages for ATA pass-thru devices
  usb-storage: unusual_devs entry to fix write-access regression for Seagate external drives
  usb: gadget: udc: renesas_usb3: Fix return value of usb3_write_pipe()
  usb: gadget: udc: renesas_usb3: fix Pn_RAMMAP.Pn_MPKT value
  usb: gadget: udc: renesas_usb3: fix for no-data control transfer
  usb: gadget: udc: atmel: set vbus irqflags explicitly
  USB: gadgetfs: fix copy_to_user while holding spinlock
  USB: gadgetfs: Fix crash caused by inadequate synchronization
  Linux 4.9.54
  s390/mm: make pmdp_invalidate() do invalidation only
  ttpci: address stringop overflow warning
  ALSA: au88x0: avoid theoretical uninitialized access
  ASoC: rt5660: remove double const
  ASoC: rt5659: drop double const
  ASoC: rt5514: fix gcc-7 warning
  ARM: remove duplicate 'const' annotations'
  IB/qib: fix false-postive maybe-uninitialized warning
  tools/power turbostat: bugfix: GFXMHz column not changing
  ARM: dts: BCM5301X: Fix memory start address
  libata: transport: Remove circular dependency at free time
  ASoC: wm_adsp: Return an error on write to a disabled volatile control
  xfs: remove kmem_zalloc_greedy
  i2c: meson: fix wrong variable usage in meson_i2c_put_data
  netfilter: nf_tables: set pktinfo->thoff at AH header if found
  md/raid10: submit bio directly to replacement disk
  rds: ib: add error handle
  mm/cgroup: avoid panic when init with low memory
  iommu/io-pgtable-arm: Check for leaf entry before dereferencing it
  x86/acpi: Restore the order of CPU IDs
  cpufreq: intel_pstate: Update pid_params.sample_rate_ns in pid_param_set()
  ibmvnic: Free tx/rx scrq pointer array when releasing sub-crqs
  nfs: make nfs4_cb_sv_ops static
  parisc: perf: Fix potential NULL pointer dereference
  netfilter: nfnl_cthelper: fix incorrect helper->expect_class_max
  nvme-rdma: handle cpu unplug when re-establishing the controller
  MIPS: smp-cps: Fix retrieval of VPE mask on big endian CPUs
  exynos-gsc: Do not swap cb/cr for semi planar formats
  iommu/exynos: Block SYSMMU while invalidating FLPD cache
  MIPS: IRQ Stack: Unwind IRQ stack onto task stack
  netfilter: invoke synchronize_rcu after set the _hook_ to NULL
  drivers/rapidio/devices/tsi721.c: make module parameter variable name unique
  kasan: do not sanitize kexec purgatory
  hugetlbfs: initialize shared policy as part of inode allocation
  sata_via: Enable hotplug only on VT6421
  Btrfs: fix potential use-after-free for cloned bio
  Btrfs: fix segmentation fault when doing dio read
  bridge: netlink: register netdevice before executing changelink
  mmc: sdio: fix alignment issue in struct sdio_func
  qed: Fix possible system hang in the dcbnl-getdcbx() path.
  net: dsa: b53: Include IMP/CPU port in dumb forwarding mode
  udp: disable inner UDP checksum offloads in IPsec case
  usb: plusb: Add support for PL-27A1
  team: fix memory leaks
  net/packet: check length in getsockopt() called with PACKET_HDRLEN
  net: core: Prevent from dereferencing null pointer when releasing SKB
  lkdtm: Fix Oops when unloading the module
  mips: ath79: clock:- Unmap region obtained by of_iomap
  MIPS: Lantiq: Fix another request_mem_region() return code check
  HID: wacom: release the resources before leaving despite devm
  drm: mali-dp: Fix transposed horizontal/vertical flip
  drm: mali-dp: Fix destination size handling when rotating
  ASoC: dapm: fix some pointer error handling
  rtl8xxxu: Add additional USB IDs for rtl8192eu devices
  usb: chipidea: vbus event may exist before starting gadget
  iommu/arm-smmu: Set privileged attribute to 'default' instead of 'unprivileged'
  spi: pxa2xx: Add support for Intel Gemini Lake
  ath10k: prevent sta pointer rcu violation
  audit: log 32-bit socketcalls
  ASoC: dapm: handle probe deferrals
  partitions/efi: Fix integer overflow in GPT size calculation
  sfc: get PIO buffer size from the NIC
  USB: serial: mos7840: fix control-message error handling
  USB: serial: mos7720: fix control-message error handling
  drm/amdkfd: fix improper return value on error
  arm: dts: mt2701: Add subsystem clock controller device nodes
  IB/ipoib: Replace list_del of the neigh->list with list_del_init
  IB/ipoib: rtnl_unlock can not come after free_netdev
  IB/ipoib: Fix deadlock over vlan_mutex
  serial: 8250_port: Remove dangerous pr_debug()
  tty: goldfish: Fix a parameter of a call to free_irq
  serial: 8250: moxa: Store num_ports in brd
  drm/i915/psr: disable psr2 for resolution greater than 32X20
  ARM: 8635/1: nommu: allow enabling REMAP_VECTORS_TO_RAM
  IB/rxe: Fix a MR reference leak in check_rkey()
  IB/rxe: Add a runtime check in alloc_index()
  iio: adc: hx711: Add DT binding for avia,hx711
  iio: adc: axp288: Drop bogus AXP288_ADC_TS_PIN_CTRL register modifications
  iio: adc: imx25-gcq: Fix module autoload
  hwmon: (gl520sm) Fix overflows and crash seen when writing into limit attributes
  usb: make the MTK XHCI driver compile for older MIPS SoCs
  clk/axs10x: Clear init field in driver probe
  sh_eth: use correct name for ECMR_MPDE bit
  reset: ti_syscon: fix a ti_syscon_reset_status issue
  extcon: axp288: Use vbus-valid instead of -present to determine cable presence
  igb: re-assign hw address pointer on reset after PCI error
  ARM: dts: am335x-chilisom: Wakeup from RTC-only state by power on event
  scsi: be2iscsi: Add checks to validate CID alloc/free
  power: supply: axp288_fuel_gauge: Fix fuel_gauge_reg_readb return on error
  MIPS: ralink: Fix incorrect assignment on ralink_soc
  MIPS: ralink: Fix a typo in the pinmux setup.
  MIPS: Ensure bss section ends on a long-aligned address
  ARM: dts: r8a7790: Use R-Car Gen 2 fallback binding for msiof nodes
  RDS: RDMA: Fix the composite message user notification
  clk: sunxi-ng: fix PLL_CPUX adjusting on H3
  ARM: dts: exynos: Add CPU OPPs for Exynos4412 Prime
  drm/i915: Fix the overlay frontbuffer tracking
  GFS2: Fix reference to ERR_PTR in gfs2_glock_iter_next
  drm: bridge: add DT bindings for TI ths8135
  drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define
  FROMLIST: binder: fix use-after-free in binder_transaction()
  FROMLIST: binder: fix an ret value override
  FROMLIST: binder: fix memory corruption in binder_transaction binder

Conflicts:
	mm/oom_kill.c
	sound/usb/card.c

Change-Id: I8b32fbdaa2be959a4149cf07d0bda16b75eeacbc
Signed-off-by: Kyle Yan <kyan@codeaurora.org>
2017-10-19 12:05:22 -07:00
Linux Build Service Account
cd598ee164 Merge "mmc: core: Remove unused variable cached_ext_csd" 2017-10-18 19:01:38 -07:00
Umang Agrawal
9fa6612f74 mmc: mmc-debugfs: add error statistics
This change adds support to allow user-space to query the number of
occurrence of the different type of errors that low-level mmc driver
has encountered. These stats can be read/cleared via debugfs.

Change-Id: I7625ff5145c542e05d2d3515a213512a5273e39c
Signed-off-by: Umang Agrawal <uagrawal@codeaurora.org>
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
2017-10-17 18:06:00 +05:30
Sayali Lokhande
a927374315 mmc: core: Remove unused variable cached_ext_csd
There is one variable defined in mmc_card, which
is not being used anywhere. Also it is wrongly
being freed from mmc_remove_card and causing
"double kfree" related issues.
To handle this, remove unused cached_ext_csd variable.

Change-Id: I75f376ec787a46a2a16c38f88f444bd8ff9c86c4
Signed-off-by: Sayali Lokhande <sayalil@codeaurora.org>
2017-10-09 15:58:09 +05:30
Greg Kroah-Hartman
012bc8b1d0 Merge 4.9.54 into android-4.9-o
Changes in 4.9.54
	drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define
	drm: bridge: add DT bindings for TI ths8135
	GFS2: Fix reference to ERR_PTR in gfs2_glock_iter_next
	drm/i915: Fix the overlay frontbuffer tracking
	ARM: dts: exynos: Add CPU OPPs for Exynos4412 Prime
	clk: sunxi-ng: fix PLL_CPUX adjusting on H3
	RDS: RDMA: Fix the composite message user notification
	ARM: dts: r8a7790: Use R-Car Gen 2 fallback binding for msiof nodes
	MIPS: Ensure bss section ends on a long-aligned address
	MIPS: ralink: Fix a typo in the pinmux setup.
	MIPS: ralink: Fix incorrect assignment on ralink_soc
	power: supply: axp288_fuel_gauge: Fix fuel_gauge_reg_readb return on error
	scsi: be2iscsi: Add checks to validate CID alloc/free
	ARM: dts: am335x-chilisom: Wakeup from RTC-only state by power on event
	igb: re-assign hw address pointer on reset after PCI error
	extcon: axp288: Use vbus-valid instead of -present to determine cable presence
	reset: ti_syscon: fix a ti_syscon_reset_status issue
	sh_eth: use correct name for ECMR_MPDE bit
	clk/axs10x: Clear init field in driver probe
	usb: make the MTK XHCI driver compile for older MIPS SoCs
	hwmon: (gl520sm) Fix overflows and crash seen when writing into limit attributes
	iio: adc: imx25-gcq: Fix module autoload
	iio: adc: axp288: Drop bogus AXP288_ADC_TS_PIN_CTRL register modifications
	iio: adc: hx711: Add DT binding for avia,hx711
	IB/rxe: Add a runtime check in alloc_index()
	IB/rxe: Fix a MR reference leak in check_rkey()
	ARM: 8635/1: nommu: allow enabling REMAP_VECTORS_TO_RAM
	drm/i915/psr: disable psr2 for resolution greater than 32X20
	serial: 8250: moxa: Store num_ports in brd
	tty: goldfish: Fix a parameter of a call to free_irq
	serial: 8250_port: Remove dangerous pr_debug()
	IB/ipoib: Fix deadlock over vlan_mutex
	IB/ipoib: rtnl_unlock can not come after free_netdev
	IB/ipoib: Replace list_del of the neigh->list with list_del_init
	arm: dts: mt2701: Add subsystem clock controller device nodes
	drm/amdkfd: fix improper return value on error
	USB: serial: mos7720: fix control-message error handling
	USB: serial: mos7840: fix control-message error handling
	sfc: get PIO buffer size from the NIC
	partitions/efi: Fix integer overflow in GPT size calculation
	ASoC: dapm: handle probe deferrals
	audit: log 32-bit socketcalls
	ath10k: prevent sta pointer rcu violation
	spi: pxa2xx: Add support for Intel Gemini Lake
	iommu/arm-smmu: Set privileged attribute to 'default' instead of 'unprivileged'
	usb: chipidea: vbus event may exist before starting gadget
	rtl8xxxu: Add additional USB IDs for rtl8192eu devices
	ASoC: dapm: fix some pointer error handling
	drm: mali-dp: Fix destination size handling when rotating
	drm: mali-dp: Fix transposed horizontal/vertical flip
	HID: wacom: release the resources before leaving despite devm
	MIPS: Lantiq: Fix another request_mem_region() return code check
	mips: ath79: clock:- Unmap region obtained by of_iomap
	lkdtm: Fix Oops when unloading the module
	net: core: Prevent from dereferencing null pointer when releasing SKB
	net/packet: check length in getsockopt() called with PACKET_HDRLEN
	team: fix memory leaks
	usb: plusb: Add support for PL-27A1
	udp: disable inner UDP checksum offloads in IPsec case
	net: dsa: b53: Include IMP/CPU port in dumb forwarding mode
	qed: Fix possible system hang in the dcbnl-getdcbx() path.
	mmc: sdio: fix alignment issue in struct sdio_func
	bridge: netlink: register netdevice before executing changelink
	Btrfs: fix segmentation fault when doing dio read
	Btrfs: fix potential use-after-free for cloned bio
	sata_via: Enable hotplug only on VT6421
	hugetlbfs: initialize shared policy as part of inode allocation
	kasan: do not sanitize kexec purgatory
	drivers/rapidio/devices/tsi721.c: make module parameter variable name unique
	netfilter: invoke synchronize_rcu after set the _hook_ to NULL
	MIPS: IRQ Stack: Unwind IRQ stack onto task stack
	iommu/exynos: Block SYSMMU while invalidating FLPD cache
	exynos-gsc: Do not swap cb/cr for semi planar formats
	MIPS: smp-cps: Fix retrieval of VPE mask on big endian CPUs
	nvme-rdma: handle cpu unplug when re-establishing the controller
	netfilter: nfnl_cthelper: fix incorrect helper->expect_class_max
	parisc: perf: Fix potential NULL pointer dereference
	nfs: make nfs4_cb_sv_ops static
	ibmvnic: Free tx/rx scrq pointer array when releasing sub-crqs
	cpufreq: intel_pstate: Update pid_params.sample_rate_ns in pid_param_set()
	x86/acpi: Restore the order of CPU IDs
	iommu/io-pgtable-arm: Check for leaf entry before dereferencing it
	mm/cgroup: avoid panic when init with low memory
	rds: ib: add error handle
	md/raid10: submit bio directly to replacement disk
	netfilter: nf_tables: set pktinfo->thoff at AH header if found
	i2c: meson: fix wrong variable usage in meson_i2c_put_data
	xfs: remove kmem_zalloc_greedy
	ASoC: wm_adsp: Return an error on write to a disabled volatile control
	libata: transport: Remove circular dependency at free time
	ARM: dts: BCM5301X: Fix memory start address
	tools/power turbostat: bugfix: GFXMHz column not changing
	IB/qib: fix false-postive maybe-uninitialized warning
	ARM: remove duplicate 'const' annotations'
	ASoC: rt5514: fix gcc-7 warning
	ASoC: rt5659: drop double const
	ASoC: rt5660: remove double const
	ALSA: au88x0: avoid theoretical uninitialized access
	ttpci: address stringop overflow warning
	s390/mm: make pmdp_invalidate() do invalidation only
	Linux 4.9.54

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2017-10-08 10:49:37 +02:00
Greg Kroah-Hartman
e5eba30388 Merge 4.9.54 into android-4.9
Changes in 4.9.54
	drm_fourcc: Fix DRM_FORMAT_MOD_LINEAR #define
	drm: bridge: add DT bindings for TI ths8135
	GFS2: Fix reference to ERR_PTR in gfs2_glock_iter_next
	drm/i915: Fix the overlay frontbuffer tracking
	ARM: dts: exynos: Add CPU OPPs for Exynos4412 Prime
	clk: sunxi-ng: fix PLL_CPUX adjusting on H3
	RDS: RDMA: Fix the composite message user notification
	ARM: dts: r8a7790: Use R-Car Gen 2 fallback binding for msiof nodes
	MIPS: Ensure bss section ends on a long-aligned address
	MIPS: ralink: Fix a typo in the pinmux setup.
	MIPS: ralink: Fix incorrect assignment on ralink_soc
	power: supply: axp288_fuel_gauge: Fix fuel_gauge_reg_readb return on error
	scsi: be2iscsi: Add checks to validate CID alloc/free
	ARM: dts: am335x-chilisom: Wakeup from RTC-only state by power on event
	igb: re-assign hw address pointer on reset after PCI error
	extcon: axp288: Use vbus-valid instead of -present to determine cable presence
	reset: ti_syscon: fix a ti_syscon_reset_status issue
	sh_eth: use correct name for ECMR_MPDE bit
	clk/axs10x: Clear init field in driver probe
	usb: make the MTK XHCI driver compile for older MIPS SoCs
	hwmon: (gl520sm) Fix overflows and crash seen when writing into limit attributes
	iio: adc: imx25-gcq: Fix module autoload
	iio: adc: axp288: Drop bogus AXP288_ADC_TS_PIN_CTRL register modifications
	iio: adc: hx711: Add DT binding for avia,hx711
	IB/rxe: Add a runtime check in alloc_index()
	IB/rxe: Fix a MR reference leak in check_rkey()
	ARM: 8635/1: nommu: allow enabling REMAP_VECTORS_TO_RAM
	drm/i915/psr: disable psr2 for resolution greater than 32X20
	serial: 8250: moxa: Store num_ports in brd
	tty: goldfish: Fix a parameter of a call to free_irq
	serial: 8250_port: Remove dangerous pr_debug()
	IB/ipoib: Fix deadlock over vlan_mutex
	IB/ipoib: rtnl_unlock can not come after free_netdev
	IB/ipoib: Replace list_del of the neigh->list with list_del_init
	arm: dts: mt2701: Add subsystem clock controller device nodes
	drm/amdkfd: fix improper return value on error
	USB: serial: mos7720: fix control-message error handling
	USB: serial: mos7840: fix control-message error handling
	sfc: get PIO buffer size from the NIC
	partitions/efi: Fix integer overflow in GPT size calculation
	ASoC: dapm: handle probe deferrals
	audit: log 32-bit socketcalls
	ath10k: prevent sta pointer rcu violation
	spi: pxa2xx: Add support for Intel Gemini Lake
	iommu/arm-smmu: Set privileged attribute to 'default' instead of 'unprivileged'
	usb: chipidea: vbus event may exist before starting gadget
	rtl8xxxu: Add additional USB IDs for rtl8192eu devices
	ASoC: dapm: fix some pointer error handling
	drm: mali-dp: Fix destination size handling when rotating
	drm: mali-dp: Fix transposed horizontal/vertical flip
	HID: wacom: release the resources before leaving despite devm
	MIPS: Lantiq: Fix another request_mem_region() return code check
	mips: ath79: clock:- Unmap region obtained by of_iomap
	lkdtm: Fix Oops when unloading the module
	net: core: Prevent from dereferencing null pointer when releasing SKB
	net/packet: check length in getsockopt() called with PACKET_HDRLEN
	team: fix memory leaks
	usb: plusb: Add support for PL-27A1
	udp: disable inner UDP checksum offloads in IPsec case
	net: dsa: b53: Include IMP/CPU port in dumb forwarding mode
	qed: Fix possible system hang in the dcbnl-getdcbx() path.
	mmc: sdio: fix alignment issue in struct sdio_func
	bridge: netlink: register netdevice before executing changelink
	Btrfs: fix segmentation fault when doing dio read
	Btrfs: fix potential use-after-free for cloned bio
	sata_via: Enable hotplug only on VT6421
	hugetlbfs: initialize shared policy as part of inode allocation
	kasan: do not sanitize kexec purgatory
	drivers/rapidio/devices/tsi721.c: make module parameter variable name unique
	netfilter: invoke synchronize_rcu after set the _hook_ to NULL
	MIPS: IRQ Stack: Unwind IRQ stack onto task stack
	iommu/exynos: Block SYSMMU while invalidating FLPD cache
	exynos-gsc: Do not swap cb/cr for semi planar formats
	MIPS: smp-cps: Fix retrieval of VPE mask on big endian CPUs
	nvme-rdma: handle cpu unplug when re-establishing the controller
	netfilter: nfnl_cthelper: fix incorrect helper->expect_class_max
	parisc: perf: Fix potential NULL pointer dereference
	nfs: make nfs4_cb_sv_ops static
	ibmvnic: Free tx/rx scrq pointer array when releasing sub-crqs
	cpufreq: intel_pstate: Update pid_params.sample_rate_ns in pid_param_set()
	x86/acpi: Restore the order of CPU IDs
	iommu/io-pgtable-arm: Check for leaf entry before dereferencing it
	mm/cgroup: avoid panic when init with low memory
	rds: ib: add error handle
	md/raid10: submit bio directly to replacement disk
	netfilter: nf_tables: set pktinfo->thoff at AH header if found
	i2c: meson: fix wrong variable usage in meson_i2c_put_data
	xfs: remove kmem_zalloc_greedy
	ASoC: wm_adsp: Return an error on write to a disabled volatile control
	libata: transport: Remove circular dependency at free time
	ARM: dts: BCM5301X: Fix memory start address
	tools/power turbostat: bugfix: GFXMHz column not changing
	IB/qib: fix false-postive maybe-uninitialized warning
	ARM: remove duplicate 'const' annotations'
	ASoC: rt5514: fix gcc-7 warning
	ASoC: rt5659: drop double const
	ASoC: rt5660: remove double const
	ALSA: au88x0: avoid theoretical uninitialized access
	ttpci: address stringop overflow warning
	s390/mm: make pmdp_invalidate() do invalidation only
	Linux 4.9.54

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2017-10-08 10:49:06 +02:00
Heiner Kallweit
727a153435 mmc: sdio: fix alignment issue in struct sdio_func
[ Upstream commit 5ef1ecf060f28ecef313b5723f1fd39bf5a35f56 ]

Certain 64-bit systems (e.g. Amlogic Meson GX) require buffers to be
used for DMA to be 8-byte-aligned. struct sdio_func has an embedded
small DMA buffer not meeting this requirement.
When testing switching to descriptor chain mode in meson-gx driver
SDIO is broken therefore. Fix this by allocating the small DMA buffer
separately as kmalloc ensures that the returned memory area is
properly aligned for every basic data type.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Tested-by: Helmut Klein <hgkr.klein@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-08 10:26:08 +02:00
Linux Build Service Account
9963aca5e3 Merge "mmc: cmdq_hci: ice: Handle ICE HCI errors in cmdq mode" 2017-09-20 17:51:40 -07:00
Veerabhadrarao Badiganti
b6782991b6 mmc: cmdq_hci: ice: Handle ICE HCI errors in cmdq mode
With ICE HCI addition in SDHC, couple of errors conditions
got introduced. These errors would be detected by ICE HCI and
triggers interrupt.

The two errors are:
1. Generic Crypto Error (GCE): This error is detected during the
transfer. Need to reset SDHC to recover.
2. Invalid Crypto Configuration Error (ICCE): The HW detects it
before the beginning of the transfer and terminates the transfer
before actual execution started.

Driver has to handle these error for recovering ICE-HCI from
these error conditions. This patch is for handling there errors
in cmdq mode.

Change-Id: Ia10075aca429cbc49ccccdae5c0499c7a176b8a2
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
2017-09-18 18:13:07 +05:30
Veerabhadrarao Badiganti
cdf0d578a6 mmc: core: Ignore bus resume flags when card removal event is detected
Ignore bus resume flags in the resume path if there is an outstanding card
removal event.

With deferred resume feature enabled, we don't check for card presence
(i.e., mmc_detect_change) in the resume path. This is to improve the resume
latency. If at all card is removed during suspend state, in some cases we
may not detect the card removal immediately but only when a request was
issued to it.

In some scenarios, card removal in suspend state leading to card suspend to
fail (since the card is removed) and which is causing system suspend to
fail. And we don't try to resume card because of deferred resume it
leading to system suspend to fail continuously.

To fix this scenario, ignore the bus resume flag in the resume path only if
there an outstanding card removal event. By doing so, we are ensuring that
the driver would check for card presence (mmc_detect_change) in the resume
path (mmc_pm_notify) and it will mark the card as removed if it finds the
card is no more present.

Change-Id: I7d075c2a5c2aaba1ff92f4072fdd2541bb98aa95
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
2017-09-18 10:12:13 +05:30
Linux Build Service Account
d5fc052fc9 Merge "mmc: host: create a specific workqueue for clk gate" 2017-07-09 06:49:46 -07:00
Can Guo
6514fbefbc mmc: core: extend SDR104 workaround for other paths
UHS-I SD cards support SDR104 mode which runs the SD card interface
clock upto 208 MHz. But we may see repeated CRC errors in SDR104
with some SDCC controllers. If this happens, commit <aafc430b36f3>
("mmc: sd: reduce the bus speed in case of multiple CRC errors") would
reinit the card to lower speed (SDR50) hoping that CRC error
rate would reduce at lower clock speed (100MHz for SDR50). As the error
may happen for any cmd, this change tries to fix several other paths -
clock scaling, mmc_rescan, non-data commands error path. This change
was backed out from msm-4.9 because SDM845 is unable to detect mmc card
remove by reading cd_gpio. Now it is safe to be merged in once again
because mmc card detect is fixed.

Change-Id: I87505cdc8614ff0c41ad345b2c181603d0235983
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
Signed-off-by: Can Guo <cang@codeaurora.org>
2017-07-04 13:13:25 +08:00
Linux Build Service Account
9efaf2ff9a Merge "mmc: mmc-debugfs: add error state" 2017-06-25 23:28:32 -07:00
Linux Build Service Account
e0680afcfe Merge "Revert "mmc: core: extend SDR104 workaround for other paths"" 2017-06-25 23:28:28 -07:00
Liangliang Lu
db362e6e22 mmc: mmc-debugfs: add error state
This change adds support to allow user space query if low level eMMC
driver has encountered any error or not, this state can be read/cleared
via debugfs.

CRs-Fixed: 1056483
Change-Id: Idc4ea375e9f308446dec04d443d062fe502658bd
Signed-off-by: Liangliang Lu <luliang@codeaurora.org>
Signed-off-by: Sayali Lokhande <sayalil@codeaurora.org>
2017-06-21 15:59:25 -07:00
Veerabhadrarao Badiganti
bf795c53a4 mmc: core: Retry claim host in mmc_sd_detect
Use mmc_try_claim_host with a timeout instead of mmc_claim_host in
mmc_sd_detect. This is to ensure that mmc rescan work item is doesn't
get blocked on claim_host for longer period.

In the pm_suspend path, we cancel the mmc_rescan work item.
If this work item is already scheduled, suspend would be blocked till
mmc_rescan gets finished. In case, mmc_rescan is blocked on claim_host
lock, pm_suspend could get blocked for longer period.  This can result
in momentary UI freeze since pm_suspend is blocked for longer duration.
This change is to prevent this scenario.

Change-Id: Ib93bae6745a153bad3579ae42f46c3c3a7c1b95a
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
2017-06-21 15:56:09 -07:00
Can Guo
85829ac72c Revert "mmc: core: extend SDR104 workaround for other paths"
Commit 8cd402a56c ("mmc: core: extend SDR104
workaround for other paths") would cause SD
card remove detect malfunction. This change
reverts it.

Change-Id: I2a5ecebc8c355ff2b12c72596cb96d0f4f4b819e
Signed-off-by: Can Guo <cang@codeaurora.org>
2017-06-21 08:59:00 +08:00
Can Guo
29db071fc4 mmc: host: create a specific workqueue for clk gate
mmc host clock gate work was scheduled on system_wq,
which is created without flag WQ_MEM_RECLAIM. Because
mmcqd thread was created with flag PF_MEMALLOC set, it
would break forward-progress guarantee leading to a
deadlock when clock gate work is cancelled. Fix it by
creating a specific work queue for clock gate work.

Change-Id: I4be5d629c712d8c48049f1e2df2c14ac6024b837
Signed-off-by: Can Guo <cang@codeaurora.org>
2017-06-20 18:27:43 +08:00
Veerabhadrarao Badiganti
773bf34c93 mmc: core: Ignore CRC errors with CMD13 while executing tuning
While executing tuning in case CMD19 fails, the driver sends CMD13
multiple times to ensure the card is ready to receive the next tuning
command. If this status command fails with CRC error, it will trigger
tuning. This will result in back to back tuning multiple times.

To avoid this situation, ignore CRCs error generated with CMD13 while
executing tuning.

Change-Id: Ife338768264ebebebc655fe11874e905abdf7482
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
2017-06-14 20:06:31 +05:30
Veerabhadrarao Badiganti
e5bab4614f mmc: sdhci-msm: Store clock scaling frequencies in a dedicated table
Use a separate table to store the platform specific clock-scaling
frequencies.

The generic table where these frequencies used to be stored, would
get updated (in some cases) during clock scaling initialization.
But when a new card is inserted (In the case of a removable card),
the frequencies supported by the card should be compared against the
platform specific frequencies.

By storing these values in a separate table, these values would
remain intact and this table can be used for initializing the
generic table during clock-scaling initialization.

Change-Id: I5729f18a975f849bc2965a946473a9cdbd81e94a
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
2017-06-09 16:48:36 +05:30
Sahitya Tummala
8cd402a56c mmc: core: extend SDR104 workaround for other paths
UHS-I SD cards support SDR104 mode which runs the SD card interface
clock upto 208 MHz. But we may see repeated CRC errors in SDR104
with some SDCC controllers. If this happens, commit <aafc430b36f3>
("mmc: sd: reduce the bus speed in case of multiple CRC errors") would
reinit the card to lower speed (SDR50) hoping that CRC error
rate would reduce at lower clock speed (100MHz for SDR50). As the error
may happen for any cmd, this change tries to fix several other paths -
clock scaling, mmc_rescan, non-data commands error path.

Change-Id: I8ccbbf7e330cde3862d9660d3be4d67fb00d97ca
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
2017-05-26 12:17:17 -07:00
Subhash Jadavani
083d5e2456 mmc: add hot plug support using extcon framework
We need to add the support for gpio based card insertion/removal event
detection support. But this is bit complicated as current platforms have
the combo card slot which can either take SD or UFS card at one time and
there is a single GPIO assigned for card detect event. This means we need
some module which takes the responsibility of controlling (configuration,
interrupt handling) this shared card detection GPIO and pass card detection
event to both MMC and UFS card drivers so they can probe to see what card
is inserted. Kernel already have the extcon-gpio module which can be used
a gpio control module and can pass the card detection event to both MMC &
UFS card drivers. So MMC driver registers the notification callback with
extcon driver and tries to detect/remove the SD card.

Change-Id: I860827272bfaa24116d9550a331657b99f53ec50
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2017-05-15 12:08:20 -07:00
Asutosh Das
af6a03e681 mmc: sd: reduce the bus speed in case of multiple CRC errors in SDR104
UHS-I SD cards support SDR104 mode which runs the SD card interface
clock upto 208 MHz. But we may see repeated CRC errors in SDR104
with some SDCC controllers. If this happens, this change would
reinit the card to lower speed (SDR50) hoping that CRC error
rate would reduce at lower clock speed (100MHz for SDR50).

Change-Id: I140d29fdf500bb89881a0f2c1f768fe0c5afa9d5
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2017-04-26 11:28:27 -07:00
Subhash Jadavani
7ae9c2c91a mmc: sdhci-msm: add SDR104 CRC workaround enablement control
On Certain chipsets, SDR104 mode might be unstable causing CRC error on
the interface. So we need a workaround which would skip printing register
dumps on CRC errors and also downgrade bus speed mode to SDR50/DDR50 in
case of continuous CRC errors. This patch adds "qcom,sdr104-wa" property
to enable this workaround if required.

Change-Id: I626d8ef45a97e8e6558e7f20be496de1f5a2a438
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[xiaonian@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Xiaonian Wang <xiaonian@codeaurora.org>
2017-04-26 11:28:13 -07:00
Sayali Lokhande
5bf4209686 mmc: host: Add Ring buffer logging for MMC.
Add ring buffer to enable tracing of significant events
of eMMC in both CQ and Legacy mode for debug purpose.

CONFIG_MMC_RING_BUFFER should be enabled to use ring
buffer logging.

Change-Id: Iceb404d77fca19e133c319bc66ec15b2d77c7c54
Signed-off-by: Sayali Lokhande <sayalil@codeaurora.org>
[xiaonian@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Xiaonian Wang <xiaonian@codeaurora.org>
2017-04-07 17:33:15 -07:00
Dmitry Shmidt
3ad1837d5d mmc: Fix pm_notifier obeying deferred resume
Do not resume if deferred resume is enabled.
Only resume when a request is received.

Change-Id: I1eae7dffec97d34b066bb5738c84a7e5a82f68d7
Git-commit: ac9ac6f26904c94e8aec47cab6936dd241c2eb66
Git-repo: git://git-android.quicinc.com/kernel/msm-3.10
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
[asutoshd@codeaurora.org: merge conflicts resolved]
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
2017-04-07 17:32:49 -07:00
San Mehat
faa9848834 mmc: core: Add deferred bus resume policy.
A card driver can now specify that the underlying bus should *not*
auto-resume with the rest of the system. This is useful for reducing resume
latency as well as saving power when the card driver is not using the
bus. In the future, we'll add support for manual suspend

Change-Id: I077d7dc9311ff12e6e16de631abeac965c8facd9
Signed-off-by: San Mehat <san@google.com>
Git-commit: b44e6c88fc57e08562ff6b4fd68ba89cc2aa21bc
Git-repo: git://git-android.quicinc.com/kernel/msm-3.10
[asutoshd@codeaurora.org: merge conflicts resolved and
similar changes were updated in a different file; due to
changes in kernel version]
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2017-04-07 17:32:48 -07:00
Asutosh Das
79ccfa561d mmc: core: fix reading the bkops status from card
The bkops status is indicated by the bit 0 and 1 of the
246th byte of the ext_csd register.
The current code doesn't ignore the rest of the byte.

Fix this by extracting the bit 0 and 1 only
for the current bkops urgency.

The exception level is defined by the least significant
nibble of 54th byte in the ext_csd register. The current
code doesn't ignore the rest of the byte.

Fix this by extracting the nibble(LSB) for exception status.

Change-Id: Ic90fe26a676ae7dd2063e17bc3771db83605f4dc
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2017-04-07 17:32:32 -07:00
Subhash Jadavani
0a3b83c6e2 mmc: auto bkops fixes
Change "man_bkops_en" to "bkops_en" to hold the status of
both manual and auto bkops.

Change-Id: I60029bae67cebb2c91147ad741b96f4caed9c1d9
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[xiaonian@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Xiaonian Wang <xiaonian@codeaurora.org>
2017-04-07 17:32:18 -07:00
Konstantin Dorfman
56380b1c71 mmc: core: postpone runtime suspend in case BKOPS is required
Some devices require long BKOPs time in order to provide high performance.
In the current solution, the host disables auto BKOPs or stops manual BKOPs
in runtime suspend, regardless of the device need for BKOPs.
This patch adds a check for device BKOPs status and defers suspend in case
when BKOPs need.

CRs-Fixed: 979630
Change-Id: Ib38d1ce58e4195d4969e9a367b5738c8e598d0ba
Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org>
[subhashj@codeaurora.org: fixed merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[xiaonian@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Xiaonian Wang <xiaonian@codeaurora.org>
2017-04-07 17:32:11 -07:00
Ritesh Harjani
d7e5be8b22 mmc: block: Error handling fixes and support of reset_all
This does following:

1. Adds support to handle multiple cmdq software requests timeout.
   Currently we schedule error handling work for the first timedout
   request. We requeue all pending tasks, knock off all tasks from
   device queue and reset card and controller as part of this, then
   for all other software requests timeout, if it comes while executing
   error work, we return BLK_EH_NOT_HANDLED.
   This fixes BUG_ON in case of multiple requests timesout together.

2. Current code resets CQE, power cycle the card and requeue all the
   requests in case of any error.

3. mmc_blk_cmdq_err work takes care freeing up all resource allocation
   like clk and rpm hold, in case of reset_all.

4. Currently we were never clearing error CMDQ_STATE_ERR in case of any
   error. This patch takes care of this bug.

Change-Id: I83d483c11fe2d7f2e462086cc3c0932057304c0d
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
[subhashj@codeaurora.org: fixed compilation error]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[xiaonian@codeaurora.org: fixed merge conflicts]
Signed-off-by: Xiaonian Wang <xiaonian@codeaurora.org>
2017-04-07 17:31:48 -07:00
Ritesh Harjani
c2f6cf0a21 mmc: core: cmdq helper for reset and claim host context
This patch does following-

This adds an API(mmc_cmdq_hw_reset), for RESET_ALL
of SDHCI, power cycle mmc card and
reintialize it, which enables cmdq as well(if supported).

This acquires claim_host before calling mmc_power_restore.
mmc_power_restore should be called with claim_host acquired,
since this function is required from non-claim-host context in
cmdq error handling.

Change-Id: I31c4449dead1d4ad4e10a4822cce2298ec5fb4b6
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
[subhashj@codeaurora.org: fixed merge conflicts, dropped some changes
related to mmc_do_hw_reset]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2017-04-07 17:31:47 -07:00
Ritesh Harjani
121cdecc66 mmc: core: Call cmdq_post_req with tag info instead of mrq
Call mmc_/cmdq_post_req with tag number instead of
mrq. This is needed in error handling as part of multiple
request error handling.

Change-Id: I175432639d28378ec74669e31deb4d1667c49bb8
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
2017-04-07 17:31:46 -07:00
Ritesh Harjani
b0280c20e0 mmc: cmdq_hci: Helper API/info in cmdq for halt
This patch adds following helper API/info -

1. cmdq_halt_poll to halt the controller using polling
method. This is to be mainly used in case of an error
from cmdq_irq context.

2. Adds num_cq_slots & dcmd_cq_slot info to
mmc_host structure. This can be useful info
for mmc host structure like in case of handling
of multiple error requests

3. Adds CMDQ_STATE_CQ_DISABLE for cmdq host.
In case of an error if halt also fails, CQE error handling
code will disable CQ. So block layer needs to know
- to not pull any requests in such case.

Change-Id: I8e9a8d5094db82336917fcca4361ce84316c34ef
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
[subhashj@codeaurora.org: fixed merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2017-04-07 17:31:39 -07:00
Sahitya Tummala
5e0f04af3c mmc: sdhci: revert MMC_PM_KEEP_POWER changes related to emmc
This change reverts the following gerrits as they cause the
timeout issues with Hynix cards. Also, the latest code supports
sleep/awake through CMD5 and hence MMC_PM_KEEP_POWER need not be
set for Hynix eMMC cards.

edcf5be "mmc: host: add detect vops chain"
09287cb "mmc: sdhci-msm: configure MMC_PM_KEEP_POWER for SDIO"
7cf603a "mmc: schci: add support for MMC_PM_KEEP_POWER in eMMC"
c085820 "mmc: core: set MMC_PM_KEEP_POWER for certain Hynix mmc cards"

CRs-Fixed: 947299
Change-Id: If863771191ee7c2b717d5817f4a88e4ad936653a
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
[subhashj@codeaurora.org: fixed merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[xiaonian@codeaurora.org: fixed trivial merge conflicts &
one compilation error]
Signed-off-by: Xiaonian Wang <xiaonian@codeaurora.org>
2017-04-07 17:31:36 -07:00
Asutosh Das
0fcc35f682 mmc: core: support DDR52 bus-speed during eMMC clock scaling
Add support for DDR52 bus-speed mode during clock scaling.
The reason for this change is DDR52 can be supported at SVS
mode.

Change-Id: I68e5fca57ae5cbc154f5dd7001df368900cb3f57
Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
2017-04-07 17:31:27 -07:00
Ritesh Harjani
ce4b8f8376 mmc: sdhci: Add asynchronous interrupt support for sdio cards
SD host controller have asynchronous interrupt support
capability to detect card(sdio) interrupt
even when clocks are gated(to save power).

This patch add support and enable this capability/feature to
of SD host controllers for sdio cards.

Change-Id: Ic1945355a19ebfdb3bd000bf8138d8001cea53f6
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
[subhashj@codeaurora.org: fixed merge conflicts & compilation error]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[xiaonian@codeaurora.org: fixed trivial merge conflicts &
compilation error, added caps array to sdhci_setup_host()
function as needed by this patch]
Signed-off-by: Xiaonian Wang <xiaonian@codeaurora.org>
2017-04-07 17:31:20 -07:00
Subhash Jadavani
ebbb90067e mmc: block: workaround for timeout issue with some vendor devices
Commit 66a7393a3ba9685d1eddfbce72e3ef8f4848f19f ("mmc: block: ensure CMDQ
is empty before queuing cache flush") added a workaround for particular
vendor's eMMC devices. Workaround was to wait for all the outstanding
requests to finish up before queuing the flush request. Now detailed
root cause analysis from vendor shows that original issue can happen only
if DCMD command is sent to device too quickly (within less than 6
microseconds) after completion of previous small sector (less than 8
sectors) read operations. Hence with this change, we are fine tuning the
previous workaround such that it would almost have no impact on the storage
benchmark performance numbers.

Change-Id: I1df1c5d7bbcd7b526236651077b7dade2626cb30
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[xiaonian@codeaurora.org: fixed trivial merge conflicts,
changed MMC_QUIRK_CMDQ_EMPTY_BEFORE_DCMD definition to
bit 18]
Signed-off-by: Xiaonian Wang <xiaonian@codeaurora.org>
2017-04-07 17:31:14 -07:00
Subhash Jadavani
b399440857 mmc: block: ensure CMDQ is empty before queuing cache flush
Some devices might stop responding to new commands if device cache flush
is queued to host controller while host controller is still processing
outstanding requests.

To workaround this issue, we are making the cmdq thread to wait for all
the oustanding requests to be finished before queuing cache flush command
on host controller.

Change-Id: I15387734f51ca4cadfc9e11270f14d8a0806a00f
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[xiaonian@codeaurora.org: fixed trivial merge conflicts,
changed MMC_QUIRK_CMDQ_EMPTY_BEFORE_FLUSH definition to
bit 18]
Signed-off-by: Xiaonian Wang <xiaonian@codeaurora.org>
2017-04-07 17:31:09 -07:00
Pavan Anamula
7d0bf3cf2c mmc: core: Card specific custom settings for SDIO
Add quirk to modify custom settings for QCA6574 and
QCA9377 cards.

Change-Id: I05e70efa71a8b8b931dfff758194af6220a8bc46
Signed-off-by: Pavan Anamula <pavana@codeaurora.org>
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
[subhashj@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
[xiaonian@codeaurora.org: fixed trivial merge conflicts]
Signed-off-by: Xiaonian Wang <xiaonian@codeaurora.org>
2017-04-07 17:31:03 -07:00
Venkat Gopalakrishnan
e77c64d000 mmc: cmdq_hci: Add cyclic buffer to keep history of last 32 tasks
Keep track of task history for the last 32 tasks and dump it
along with registers in case of any error for debugging.

The log is of the following format:
[index] <DATA|DCMD> Task: <lower 32bits> | Args: <upper 32bits>
of the task descriptor structure. The values need to be decoded
accordingly depending on the data or dcmd task descriptor.
The last entry index denotes the latest entry in this list.

---- Circular Task History ----
cmdq-host: Last entry index: 1
cmdq-host: [00]DATA Task: 0x0400002f | Args: 0x00d37d18
cmdq-host: [01]DATA Task: 0x0400002f | Args: 0x00d38118
cmdq-host: [02]DCMD Task: 0x0186402f | Args: 0x03200101

Add a debugfs entry to enable/disable this dynamically. It is
disabled by default. This applies only to eMMC devices.

Usage: echo Y > /sys/kernel/debug/mmcX/cmdq_task_history
X - denotes the slot id

Change-Id: I6abf29aa928d3d8270405cfc104241043dadfe45
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
[subhashj@codeaurora.org: fixed compilation error]
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2017-04-07 17:30:57 -07:00