Commit Graph

1056302 Commits

Author SHA1 Message Date
Eric Biggers
1b1ffd6aa9 ANDROID: ABI: update fips140 symbol list
Recent LTS merges changed the set of symbols used by the fips140 module,
but the symbol list was not correctly updated, so update it now.

Done with:

    BUILD_CONFIG=common/build.config.gki.aarch64.fips140 build/build_abi.sh --update-symbol-list

... and then moving the list from abi_gki_aarch64 to
abi_gki_aarch64_fips140.

Bug: 188620248
Fixes: 48e30cf63b ("ANDROID: ABI: add another missing symbol to the fips140 symbol list")
Change-Id: I16b20db9b94aa575ee0a31ef114e38d6268892c9
Signed-off-by: Eric Biggers <ebiggers@google.com>
2022-07-09 20:05:17 +00:00
Greg Kroah-Hartman
437e10d79a ANDROID: ABI: add wait_on_page_bit to symbol list
The virtual build now wants the wait_on_page_bit symbol added to their
list to work properly, so add it.

Fixes: 207ca68816 ("Linux 5.15.45")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I529ffaefc2e55fb9372c95197418693e62f33ff8
2022-07-09 11:22:20 +02:00
Greg Kroah-Hartman
48e30cf63b ANDROID: ABI: add another missing symbol to the fips140 symbol list
For some reason rng_is_initialized was left off from commit 0ca9901b89
("ANDROID: ABI: add missing symbols to fips140 symbol list") which
breaks the fips140 build.  Fix that up by adding it to the list.

Bug: 188620248
Cc: Eric Biggers <ebiggers@google.com>
Fixes: 0ca9901b89 ("ANDROID: ABI: add missing symbols to fips140 symbol list")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: If778fb9a46a23a68d2c6206680b670d0ea58c6af
2022-07-09 11:22:14 +02:00
Greg Kroah-Hartman
13c4af06ad ANDROID: re-export [un]register_random_ready_notifier()
Commit e61717947a ("crypto: drbg - make reseeding from
get_random_bytes() synchronous") removed the export from
register_random_ready_notifier() and unregister_random_ready_notifier()
but we still have external modules using those functions at the moment
(fips, {sigh})  So export them again for now until that gets fixed up...

Fixes: e61717947a ("crypto: drbg - make reseeding from get_random_bytes() synchronous")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I682a4f2bfcee69f207644b7d23e0e4d9b60930f0
2022-07-09 11:22:14 +02:00
Greg Kroah-Hartman
b993001ba8 Merge 5.15.45 into android14-5.15
Changes in 5.15.45
	ALSA: usb-audio: Don't get sample rate for MCT Trigger 5 USB-to-HDMI
	pinctrl: sunxi: fix f1c100s uart2 function
	KVM: arm64: Don't hypercall before EL2 init
	percpu_ref_init(): clean ->percpu_count_ref on failure
	net: af_key: check encryption module availability consistency
	nfc: pn533: Fix buggy cleanup order
	net: ftgmac100: Disable hardware checksum on AST2600
	i2c: ismt: Provide a DMA buffer for Interrupt Cause Logging
	drivers: i2c: thunderx: Allow driver to work with ACPI defined TWSI controllers
	netfilter: nf_tables: disallow non-stateful expression in sets earlier
	i2c: ismt: prevent memory corruption in ismt_access()
	assoc_array: Fix BUG_ON during garbage collect
	pipe: make poll_usage boolean and annotate its access
	pipe: Fix missing lock in pipe_resize_ring()
	net: ipa: compute proper aggregation limit
	drm/i915: Fix -Wstringop-overflow warning in call to intel_read_wm_latency()
	exfat: check if cluster num is valid
	lib/crypto: add prompts back to crypto libraries
	crypto: drbg - prepare for more fine-grained tracking of seeding state
	crypto: drbg - track whether DRBG was seeded with !rng_is_initialized()
	crypto: drbg - move dynamic ->reseed_threshold adjustments to __drbg_seed()
	crypto: drbg - make reseeding from get_random_bytes() synchronous
	netfilter: nf_tables: sanitize nft_set_desc_concat_parse()
	netfilter: nf_tables: hold mutex on netns pre_exit path
	netfilter: nf_tables: double hook unregistration in netns path
	netfilter: conntrack: re-fetch conntrack after insertion
	KVM: PPC: Book3S HV: fix incorrect NULL check on list iterator
	x86/kvm: Alloc dummy async #PF token outside of raw spinlock
	x86, kvm: use correct GFP flags for preemption disabled
	KVM: x86: avoid calling x86 emulator without a decoded instruction
	KVM: x86: Drop WARNs that assert a triple fault never "escapes" from L2
	KVM: SVM: Use kzalloc for sev ioctl interfaces to prevent kernel data leak
	crypto: caam - fix i.MX6SX entropy delay value
	crypto: ecrdsa - Fix incorrect use of vli_cmp
	zsmalloc: fix races between asynchronous zspage free and page migration
	ALSA: usb-audio: Workaround for clock setup on TEAC devices
	ALSA: usb-audio: Add missing ep_idx in fixed EP quirks
	ALSA: usb-audio: Configure sync endpoints before data
	Bluetooth: hci_qca: Use del_timer_sync() before freeing
	ARM: dts: s5pv210: Correct interrupt name for bluetooth in Aries
	dm integrity: fix error code in dm_integrity_ctr()
	dm crypt: make printing of the key constant-time
	dm stats: add cond_resched when looping over entries
	dm verity: set DM_TARGET_IMMUTABLE feature flag
	raid5: introduce MD_BROKEN
	fs/ntfs3: validate BOOT sectors_per_clusters
	HID: multitouch: Add support for Google Whiskers Touchpad
	HID: multitouch: add quirks to enable Lenovo X12 trackpoint
	x86/sgx: Disconnect backing page references from dirty status
	x86/sgx: Mark PCMD page as dirty when modifying contents
	x86/sgx: Obtain backing storage page with enclave mutex held
	x86/sgx: Fix race between reclaimer and page fault handler
	x86/sgx: Ensure no data in PCMD page after truncate
	media: i2c: imx412: Fix reset GPIO polarity
	media: i2c: imx412: Fix power_off ordering
	tpm: Fix buffer access in tpm2_get_tpm_pt()
	tpm: ibmvtpm: Correct the return value in tpm_ibmvtpm_probe()
	docs: submitting-patches: Fix crossref to 'The canonical patch format'
	NFS: Memory allocation failures are not server fatal errors
	NFSD: Fix possible sleep during nfsd4_release_lockowner()
	bpf: Fix potential array overflow in bpf_trampoline_get_progs()
	bpf: Enlarge offset check value to INT_MAX in bpf_skb_{load,store}_bytes
	bpf: Fix excessive memory allocation in stack_map_alloc()
	bpf: Reject writes for PTR_TO_MAP_KEY in check_helper_mem_access
	bpf: Check PTR_TO_MEM | MEM_RDONLY in check_helper_mem_access
	ALSA: usb-audio: Optimize TEAC clock quirk
	Linux 5.15.45

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I26d013c1b2a65832c384539f07e56e07c51bf981
2022-07-09 11:22:04 +02:00
Yifan Hong
c0ef6692da ANDROID: kleaf: format BUILD.bazel.
Run buildifier to format BUILD.bazel file
to keep things sorted.

Bug: 188620248
Test: no lint errors
Change-Id: I2b5ff358e28580094b49550e1145961e9c76a430
Signed-off-by: Yifan Hong <elsk@google.com>
2022-07-08 11:21:00 -07:00
Jiyong Park
57be64ec57 ANDROID: remove unnecessary drivers for Microdroid
Microdroid doesn't have access to host-side devices, thus drivers for
them aren't necessary.

Bug: 237357377
Test: watch TH

Signed-off-by: Jiyong Park <jiyong@google.com>
Change-Id: Ib1be8da1f74f82882ab97fcef42447a3103b7d36
2022-07-07 00:04:18 +00:00
Jiyong Park
b2497fe1b9 ANDROID: Add CONFIG_KEXEC_FILE to Microdroid
... to enable kdump

Bug: 237380780
Test: run kexec on Microdroid
Signed-off-by: Jiyong Park <jiyong@google.com>
Change-Id: I526d831e10328d3c2543a1c2fbf44440deb6bc1e
2022-07-05 15:25:45 +09:00
Sumit Semwal
8ec5927c0a ANDROID: GKI: db845c: Update symbols list and ABI
android14-5.15 is broken on Dragonboard 845c becuase of recently added symbols.

So updated the symbols list by running:
  BUILD_CONFIG=common/build.config.db845c build/build_abi.sh -s

And updated the abi_gki_aarch64 ABI by running:
  "BUILD_CONFIG=common/build.config.gki.aarch64 \
    ABI_DEFINITION=abi_gki_aarch64.xml build/build_abi.sh \
      --update --print-report"

Due to an issue with android14-5.15, the leaf report is not printed; the symbol
causing the problem seems to be:

sdhci_msm: Unknown symbol __reset_control_get (err -2)

Fixes: 3c0a0a2710 ("mmc: sdhci-msm: Reset GCC_SDCC_BCR register for SDHC")

Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Change-Id: Iff4fe751f4e896c5b978e2d35cb7b0bcb4dd8a42
2022-06-30 15:31:55 +00:00
Bowgo Tsai
0082c521ea ANDROID: Adding Image.gz and boot-gz.img
This adds <10 seconds for a LTO=thin build, while the original
build time is about ~250 seconds on a build machine with 48 2.60 GHz
processors and 64GB RAM.

Within the 10 seconds, ~3 seconds spent on building Image.gz,
~5 seconds for packing Image.gz as boot-gz.img and <1 second for
including the boot-gz.img into the boot-img.tar.gz.

Bug: 233352819
Test: LTO=thin BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh
Signed-off-by: Bowgo Tsai <bowgotsai@google.com>
Change-Id: I283ef004d1233d2e175573b893379e0d68221353
(cherry picked from commit 2ad997b4d1)
(cherry picked from commit 933eddd126d18b45f5a693d695bc69a7a6770167)
2022-06-28 18:58:40 +00:00
Bowgo Tsai
f60f35c121 ANDROID: Creating boot-img.tar.gz for aarch64
The boot-img.tar.gz includes boot.img and boot-lz4.img,
with kernel image: Image and Image.lz4, respectively.

Bug: 222078981
Test: BUILD_CONFIG=common/build.config.gki.aarch64 build/build.sh
Signed-off-by: Bowgo Tsai <bowgotsai@google.com>
Change-Id: I7f929a73967ce87d0d653d0b9926198cfeedc973
(cherry picked from commit 3361d46a39)
(cherry picked from commit 841307cecccb131df86a09cefcf7e5ea6b329a35)
2022-06-28 18:58:18 +00:00
Jiyong Park
65aa3a9309 ANDROID: fix typo on microdroid config
Bug: 236442045
Test: N/A
Change-Id: I76892afa6a96d8d055d6589d614a28a8e47c7fd7
Signed-off-by: Jiyong Park <jiyong@google.com>
2022-06-23 16:13:29 +09:00
Jiyong Park
84509999da ANDROID: remove unnecessary filesystems from microdroid config
Bug: 227470702
Test: watch TH
Change-Id: I90a65ce40e4fe4e32da636f300ffacf1670c80ea
Signed-off-by: Jiyong Park <jiyong@google.com>
2022-06-23 16:10:28 +09:00
Jiyong Park
f923cf54fb ANDROID: remove GKI_HACKS for Microdroid
The meta config was to enable configs that are known to be depended on
by external vendor modules. Since we don't support vendor modules for
Microdroid, we don't need the meta config. Turning it off.

Bug: 236548131
Test: watch TH
Change-Id: Iaaeec2a3afb2863784be4a7e509b4b2ddcf6ee0b
Signed-off-by: Jiyong Park <jiyong@google.com>
2022-06-21 10:20:48 +09:00
Jiyong Park
eacd8e9b82 ANDROID: remove unnecessary serial devs from Microdroid
Bug: 236442045
Test: watch TH
Signed-off-by: Jiyong Park <jiyong@google.com>
Change-Id: Ie76bba2cf8c024585b3f634ee7f7ceac90dd0676
2022-06-20 08:58:12 +09:00
Eric Biggers
0ca9901b89 ANDROID: ABI: add missing symbols to fips140 symbol list
This fixes the following build error:

ERROR: Differences between ksymtab and symbol list detected!
Symbols missing from ksymtab:
Symbols missing from symbol list:
 - register_random_ready_notifier
 - unregister_random_ready_notifier

Bug: 188620248
Change-Id: Iada810172c1525b96557248889b69a4fb6e1a82e
Signed-off-by: Eric Biggers <ebiggers@google.com>
2022-06-14 22:03:48 +00:00
Jiyong Park
e52c2eee7d ANDROID: make virtio drivers needed for Microdroid built-in
Virtio drivers for Microdroid are now built in the kernel. This is to
unburden the GKI process; Microdroid kernel doesn't need to be updated
when the GKI prebuilts are updated. Before this change, Microdroid
kernel used the modules built for GKI. This in turn meant that
Microdroid kernel has to be updated everytime the GKI (and its modules)
are updated - because KMI is not stable until it gets frozen. By making
the drivers built-in, Microdroid doesn't need to modules from GKI and
can be completely decoupled from the GKI process.

Bug: 231117670
Test: run microdroid with this kernel
Signed-off-by: Jiyong Park <jiyong@google.com>
Change-Id: I337f27457f62032c80c3a6d36fe8ef9cf90294f7
2022-06-14 15:23:54 +00:00
Greg Kroah-Hartman
7a0de0211b ANDROID: FIPS: remove some random core symbols
The symbols add_random_ready_callback and del_random_ready_callback went
away in 5.15.44, so remove them from the list first so that the checker
doesn't get confused when it can no longer find them.

Fixes: 6da877d2d4 ("random: replace custom notifier chain with standard one")
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Id467254b0884cb2efe2e0d2acb334740fa6e6c07
2022-06-14 11:56:45 +02:00
Greg Kroah-Hartman
28f0c67d40 Merge 5.15.44 into android14-5.15
Changes in 5.15.44
	HID: amd_sfh: Add support for sensor discovery
	KVM: x86/mmu: fix NULL pointer dereference on guest INVPCID
	ice: fix crash at allocation failure
	ACPI: sysfs: Fix BERT error region memory mapping
	MAINTAINERS: co-maintain random.c
	MAINTAINERS: add git tree for random.c
	lib/crypto: blake2s: include as built-in
	lib/crypto: blake2s: move hmac construction into wireguard
	lib/crypto: sha1: re-roll loops to reduce code size
	lib/crypto: blake2s: avoid indirect calls to compression function for Clang CFI
	random: document add_hwgenerator_randomness() with other input functions
	random: remove unused irq_flags argument from add_interrupt_randomness()
	random: use BLAKE2s instead of SHA1 in extraction
	random: do not sign extend bytes for rotation when mixing
	random: do not re-init if crng_reseed completes before primary init
	random: mix bootloader randomness into pool
	random: harmonize "crng init done" messages
	random: use IS_ENABLED(CONFIG_NUMA) instead of ifdefs
	random: early initialization of ChaCha constants
	random: avoid superfluous call to RDRAND in CRNG extraction
	random: don't reset crng_init_cnt on urandom_read()
	random: fix typo in comments
	random: cleanup poolinfo abstraction
	random: cleanup integer types
	random: remove incomplete last_data logic
	random: remove unused extract_entropy() reserved argument
	random: rather than entropy_store abstraction, use global
	random: remove unused OUTPUT_POOL constants
	random: de-duplicate INPUT_POOL constants
	random: prepend remaining pool constants with POOL_
	random: cleanup fractional entropy shift constants
	random: access input_pool_data directly rather than through pointer
	random: selectively clang-format where it makes sense
	random: simplify arithmetic function flow in account()
	random: continually use hwgenerator randomness
	random: access primary_pool directly rather than through pointer
	random: only call crng_finalize_init() for primary_crng
	random: use computational hash for entropy extraction
	random: simplify entropy debiting
	random: use linear min-entropy accumulation crediting
	random: always wake up entropy writers after extraction
	random: make credit_entropy_bits() always safe
	random: remove use_input_pool parameter from crng_reseed()
	random: remove batched entropy locking
	random: fix locking in crng_fast_load()
	random: use RDSEED instead of RDRAND in entropy extraction
	random: get rid of secondary crngs
	random: inline leaves of rand_initialize()
	random: ensure early RDSEED goes through mixer on init
	random: do not xor RDRAND when writing into /dev/random
	random: absorb fast pool into input pool after fast load
	random: use simpler fast key erasure flow on per-cpu keys
	random: use hash function for crng_slow_load()
	random: make more consistent use of integer types
	random: remove outdated INT_MAX >> 6 check in urandom_read()
	random: zero buffer after reading entropy from userspace
	random: fix locking for crng_init in crng_reseed()
	random: tie batched entropy generation to base_crng generation
	random: remove ifdef'd out interrupt bench
	random: remove unused tracepoints
	random: add proper SPDX header
	random: deobfuscate irq u32/u64 contributions
	random: introduce drain_entropy() helper to declutter crng_reseed()
	random: remove useless header comment
	random: remove whitespace and reorder includes
	random: group initialization wait functions
	random: group crng functions
	random: group entropy extraction functions
	random: group entropy collection functions
	random: group userspace read/write functions
	random: group sysctl functions
	random: rewrite header introductory comment
	random: defer fast pool mixing to worker
	random: do not take pool spinlock at boot
	random: unify early init crng load accounting
	random: check for crng_init == 0 in add_device_randomness()
	random: pull add_hwgenerator_randomness() declaration into random.h
	random: clear fast pool, crng, and batches in cpuhp bring up
	random: round-robin registers as ulong, not u32
	random: only wake up writers after zap if threshold was passed
	random: cleanup UUID handling
	random: unify cycles_t and jiffies usage and types
	random: do crng pre-init loading in worker rather than irq
	random: give sysctl_random_min_urandom_seed a more sensible value
	random: don't let 644 read-only sysctls be written to
	random: replace custom notifier chain with standard one
	random: use SipHash as interrupt entropy accumulator
	random: make consistent usage of crng_ready()
	random: reseed more often immediately after booting
	random: check for signal and try earlier when generating entropy
	random: skip fast_init if hwrng provides large chunk of entropy
	random: treat bootloader trust toggle the same way as cpu trust toggle
	random: re-add removed comment about get_random_{u32,u64} reseeding
	random: mix build-time latent entropy into pool at init
	random: do not split fast init input in add_hwgenerator_randomness()
	random: do not allow user to keep crng key around on stack
	random: check for signal_pending() outside of need_resched() check
	random: check for signals every PAGE_SIZE chunk of /dev/[u]random
	random: allow partial reads if later user copies fail
	random: make random_get_entropy() return an unsigned long
	random: document crng_fast_key_erasure() destination possibility
	random: fix sysctl documentation nits
	init: call time_init() before rand_initialize()
	ia64: define get_cycles macro for arch-override
	s390: define get_cycles macro for arch-override
	parisc: define get_cycles macro for arch-override
	alpha: define get_cycles macro for arch-override
	powerpc: define get_cycles macro for arch-override
	timekeeping: Add raw clock fallback for random_get_entropy()
	m68k: use fallback for random_get_entropy() instead of zero
	riscv: use fallback for random_get_entropy() instead of zero
	mips: use fallback for random_get_entropy() instead of just c0 random
	arm: use fallback for random_get_entropy() instead of zero
	nios2: use fallback for random_get_entropy() instead of zero
	x86/tsc: Use fallback for random_get_entropy() instead of zero
	um: use fallback for random_get_entropy() instead of zero
	sparc: use fallback for random_get_entropy() instead of zero
	xtensa: use fallback for random_get_entropy() instead of zero
	random: insist on random_get_entropy() existing in order to simplify
	random: do not use batches when !crng_ready()
	random: use first 128 bits of input as fast init
	random: do not pretend to handle premature next security model
	random: order timer entropy functions below interrupt functions
	random: do not use input pool from hard IRQs
	random: help compiler out with fast_mix() by using simpler arguments
	siphash: use one source of truth for siphash permutations
	random: use symbolic constants for crng_init states
	random: avoid initializing twice in credit race
	random: move initialization out of reseeding hot path
	random: remove ratelimiting for in-kernel unseeded randomness
	random: use proper jiffies comparison macro
	random: handle latent entropy and command line from random_init()
	random: credit architectural init the exact amount
	random: use static branch for crng_ready()
	random: remove extern from functions in header
	random: use proper return types on get_random_{int,long}_wait()
	random: make consistent use of buf and len
	random: move initialization functions out of hot pages
	random: move randomize_page() into mm where it belongs
	random: unify batched entropy implementations
	random: convert to using fops->read_iter()
	random: convert to using fops->write_iter()
	random: wire up fops->splice_{read,write}_iter()
	random: check for signals after page of pool writes
	ALSA: ctxfi: Add SB046x PCI ID
	Linux 5.15.44

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I2d874cba14f13379fc5f874e72634c9179b28742
2022-06-14 11:49:05 +02:00
Ramji Jiyani
438c43687f ANDROID: GKI: remove info print for header generation
Script doesn't honor the Kernel's quiet command
mechanism with KBuild; so need to remove info
only echo. Added set -x in case make V=1 for keeping
debugging handy for script in the future.

Bug: 234116152
Test: TH
Signed-off-by: Ramji Jiyani <ramjiyani@google.com>
Change-Id: Iea881816b9bc8c47157a33da67d6cf5f8357a7be
(cherry picked from commit 08a1879c876258e1ad269ab3dc111ffc6750440a)
2022-06-10 18:21:21 +00:00
Greg Kroah-Hartman
e2b8796f6c Merge 5.15.43 into android14-5.15
Changes in 5.15.43
	mptcp: Do TCP fallback on early DSS checksum failure
	Linux 5.15.43

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I5536d79dc8ed2b566c4614cd9f7e10896abfc817
2022-06-10 07:30:10 +02:00
Greg Kroah-Hartman
30ae5b1d77 Merge 5.15.42 into android14-5.15
Changes in 5.15.42
	usb: gadget: fix race when gadget driver register via ioctl
	io_uring: arm poll for non-nowait files
	floppy: use a statically allocated error counter
	kernel/resource: Introduce request_mem_region_muxed()
	i2c: piix4: Replace hardcoded memory map size with a #define
	i2c: piix4: Move port I/O region request/release code into functions
	i2c: piix4: Move SMBus controller base address detect into function
	i2c: piix4: Move SMBus port selection into function
	i2c: piix4: Add EFCH MMIO support to region request and release
	i2c: piix4: Add EFCH MMIO support to SMBus base address detect
	i2c: piix4: Add EFCH MMIO support for SMBus port select
	i2c: piix4: Enable EFCH MMIO for Family 17h+
	Watchdog: sp5100_tco: Move timer initialization into function
	Watchdog: sp5100_tco: Refactor MMIO base address initialization
	Watchdog: sp5100_tco: Add initialization using EFCH MMIO
	Watchdog: sp5100_tco: Enable Family 17h+ CPUs
	mm/kfence: reset PG_slab and memcg_data before freeing __kfence_pool
	Revert "drm/i915/opregion: check port number bounds for SWSCI display power state"
	rtc: fix use-after-free on device removal
	rtc: pcf2127: fix bug when reading alarm registers
	um: Cleanup syscall_handler_t definition/cast, fix warning
	Input: add bounds checking to input_set_capability()
	Input: stmfts - fix reference leak in stmfts_input_open
	nvme-pci: add quirks for Samsung X5 SSDs
	gfs2: Disable page faults during lockless buffered reads
	rtc: sun6i: Fix time overflow handling
	crypto: stm32 - fix reference leak in stm32_crc_remove
	crypto: x86/chacha20 - Avoid spurious jumps to other functions
	ALSA: hda/realtek: Enable headset mic on Lenovo P360
	s390/traps: improve panic message for translation-specification exception
	s390/pci: improve zpci_dev reference counting
	vhost_vdpa: don't setup irq offloading when irq_num < 0
	tools/virtio: compile with -pthread
	nvmet: use a private workqueue instead of the system workqueue
	nvme-multipath: fix hang when disk goes live over reconnect
	rtc: mc146818-lib: Fix the AltCentury for AMD platforms
	fs: fix an infinite loop in iomap_fiemap
	MIPS: lantiq: check the return value of kzalloc()
	drbd: remove usage of list iterator variable after loop
	platform/chrome: cros_ec_debugfs: detach log reader wq from devm
	ARM: 9191/1: arm/stacktrace, kasan: Silence KASAN warnings in unwind_frame()
	nilfs2: fix lockdep warnings in page operations for btree nodes
	nilfs2: fix lockdep warnings during disk space reclamation
	ALSA: usb-audio: Restore Rane SL-1 quirk
	ALSA: wavefront: Proper check of get_user() error
	ALSA: hda/realtek: Add quirk for TongFang devices with pop noise
	perf: Fix sys_perf_event_open() race against self
	selinux: fix bad cleanup on error in hashtab_duplicate()
	Fix double fget() in vhost_net_set_backend()
	PCI/PM: Avoid putting Elo i2 PCIe Ports in D3cold
	Revert "can: m_can: pci: use custom bit timings for Elkhart Lake"
	KVM: x86/mmu: Update number of zapped pages even if page list is stable
	arm64: paravirt: Use RCU read locks to guard stolen_time
	arm64: mte: Ensure the cleared tags are visible before setting the PTE
	crypto: qcom-rng - fix infinite loop on requests not multiple of WORD_SZ
	libceph: fix potential use-after-free on linger ping and resends
	drm/amd: Don't reset dGPUs if the system is going to s2idle
	drm/i915/dmc: Add MMIO range restrictions
	drm/dp/mst: fix a possible memory leak in fetch_monitor_name()
	dma-buf: fix use of DMA_BUF_SET_NAME_{A,B} in userspace
	dma-buf: ensure unique directory name for dmabuf stats
	ARM: dts: aspeed-g6: remove FWQSPID group in pinctrl dtsi
	pinctrl: pinctrl-aspeed-g6: remove FWQSPID group in pinctrl
	ARM: dts: aspeed-g6: fix SPI1/SPI2 quad pin group
	ARM: dts: aspeed: Add ADC for AST2600 and enable for Rainier and Everest
	ARM: dts: aspeed: Add secure boot controller node
	ARM: dts: aspeed: Add video engine to g6
	pinctrl: mediatek: mt8365: fix IES control pins
	ALSA: hda - fix unused Realtek function when PM is not enabled
	net: ipa: record proper RX transaction count
	net: macb: Increment rx bd head after allocating skb and buffer
	xfrm: rework default policy structure
	xfrm: fix "disable_policy" flag use when arriving from different devices
	net/sched: act_pedit: sanitize shift argument before usage
	netfilter: flowtable: fix excessive hw offload attempts after failure
	netfilter: nft_flow_offload: skip dst neigh lookup for ppp devices
	net: fix dev_fill_forward_path with pppoe + bridge
	netfilter: nft_flow_offload: fix offload with pppoe + vlan
	Revert "PCI: aardvark: Rewrite IRQ code to chained IRQ handler"
	net: systemport: Fix an error handling path in bcm_sysport_probe()
	net: vmxnet3: fix possible use-after-free bugs in vmxnet3_rq_alloc_rx_buf()
	net: vmxnet3: fix possible NULL pointer dereference in vmxnet3_rq_cleanup()
	ice: fix crash when writing timestamp on RX rings
	ice: fix possible under reporting of ethtool Tx and Rx statistics
	ice: move ice_container_type onto ice_ring_container
	ice: Fix interrupt moderation settings getting cleared
	clk: at91: generated: consider range when calculating best rate
	net/qla3xxx: Fix a test in ql_reset_work()
	NFC: nci: fix sleep in atomic context bugs caused by nci_skb_alloc
	net/mlx5: DR, Fix missing flow_source when creating multi-destination FW table
	net/mlx5e: Properly block LRO when XDP is enabled
	net: af_key: add check for pfkey_broadcast in function pfkey_process
	ARM: 9196/1: spectre-bhb: enable for Cortex-A15
	ARM: 9197/1: spectre-bhb: fix loop8 sequence for Thumb2
	mptcp: change the parameter of __mptcp_make_csum
	mptcp: reuse __mptcp_make_csum in validate_data_csum
	mptcp: fix checksum byte order
	igb: skip phy status check where unavailable
	netfilter: flowtable: fix TCP flow teardown
	netfilter: flowtable: pass flowtable to nf_flow_table_iterate()
	netfilter: flowtable: move dst_check to packet path
	net: bridge: Clear offload_fwd_mark when passing frame up bridge interface.
	riscv: dts: sifive: fu540-c000: align dma node name with dtschema
	scsi: ufs: core: Fix referencing invalid rsp field
	perf build: Fix check for btf__load_from_kernel_by_id() in libbpf
	gpio: gpio-vf610: do not touch other bits when set the target bit
	gpio: mvebu/pwm: Refuse requests with inverted polarity
	perf regs x86: Fix arch__intr_reg_mask() for the hybrid platform
	perf bench numa: Address compiler error on s390
	scsi: scsi_dh_alua: Properly handle the ALUA transitioning state
	scsi: qla2xxx: Fix missed DMA unmap for aborted commands
	mac80211: fix rx reordering with non explicit / psmp ack policy
	nl80211: validate S1G channel width
	selftests: add ping test with ping_group_range tuned
	Revert "fbdev: Make fb_release() return -ENODEV if fbdev was unregistered"
	fbdev: Prevent possible use-after-free in fb_release()
	net: fix wrong network header length
	nl80211: fix locking in nl80211_set_tx_bitrate_mask()
	ethernet: tulip: fix missing pci_disable_device() on error in tulip_init_one()
	net: stmmac: fix missing pci_disable_device() on error in stmmac_pci_probe()
	net: atlantic: fix "frag[0] not initialized"
	net: atlantic: reduce scope of is_rsc_complete
	net: atlantic: add check for MAX_SKB_FRAGS
	net: atlantic: verify hw_head_ lies within TX buffer ring
	arm64: Enable repeat tlbi workaround on KRYO4XX gold CPUs
	Input: ili210x - fix reset timing
	dt-bindings: pinctrl: aspeed-g6: remove FWQSPID group
	mt76: mt7921e: fix possible probe failure after reboot
	lockdown: also lock down previous kgdb use
	i2c: mt7621: fix missing clk_disable_unprepare() on error in mtk_i2c_probe()
	afs: Fix afs_getattr() to refetch file status if callback break occurred
	Linux 5.15.42

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Id86177ba790bc19748595e22e6b9d3f95d7f00f6
2022-06-10 07:30:09 +02:00
Bart Van Assche
072afaa9bb ANDROID: kleaf: Update the location of the ufs_qcom driver
Patch "scsi: ufs: Split the drivers/scsi/ufs directory" moved the source
code of all UFS drivers. Hence this patch that updates the BUILD.bazel
file.

Bug: 234653003
Change-Id: Ia87a92064bf6d04c4fe49dfadbac9858d8d99def
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:30 -07:00
Dan Carpenter
b888195fee UPSTREAM: scsi: ufs: ufshcd: Delete unnecessary NULL check
The 'info' pointer points to somewhere in the middle of the 'hba' struct.
It can't possibly be NULL.  Delete the NULL check.

Link: https://lore.kernel.org/r/YotFotj43TkB8Rid@kili
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 476e45923b)
Change-Id: I4eb49e0cd3a3fa6c3e885324fc69ba8b2a04aba8
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:29 -07:00
Bart Van Assche
2d74ff4319 UPSTREAM: scsi: ufs: Split the drivers/scsi/ufs directory
Split the drivers/scsi/ufs directory into 'core' and 'host' directories
under the drivers/ufs/ directory. Move shared header files into the
include/ufs/ directory. This separation makes it clear which header files
UFS drivers are allowed to include (include/ufs/*.h) and which header files
UFS drivers are not allowed to include (drivers/ufs/core/*.h).

Update the MAINTAINERS file. Add myself as a UFS reviewer.

Link: https://lore.kernel.org/r/20220511212552.655341-1-bvanassche@acm.org
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Avri Altman <avri.altman@wdc.com>
Cc: Bean Huo <beanhuo@micron.com>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Keoseong Park <keosung.park@samsung.com>
Tested-by: Bean Huo <beanhuo@micron.com>
Tested-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Acked-by: Avri Altman <avri.altman@wdc.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit dd11376b9f)
Change-Id: I9b6a7aae90d1b9806d4bcc784627f22f14870a42
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:29 -07:00
Bean Huo
0dd3530434 UPSTREAM: scsi: ufs: ufshpb: Clean up ufshpb_suspend()/resume()
ufshpb_resume() is only called when the HPB state is HPB_SUSPEND, so the
check statement for "ufshpb_get_state(hpb) != HPB_PRESENT" is useless.

Link: https://lore.kernel.org/r/20220505134707.35929-7-huobean@gmail.com
Reviewed-by: Keoseong Park <keosung.park@samsung.com>
Signed-off-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 18ebe2390c)
Change-Id: Iccb0d148c593a3b40f2c744ea6617e7250ac9189
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:29 -07:00
Bean Huo
4119ade206 UPSTREAM: scsi: ufs: ufshpb: Add handing of device reset regions in HPB device mode
In UFS HPB Spec JESD220-3A,

"5.8. Active and inactive information upon power cycle
...
When the device is powered off by the host, the device may restore L2P map
data upon power up or build from the host's HPB READ command. In case
device powered up and lost HPB information, device can signal to the host
through HPB Sense data, by setting HPB Operation as '2' which will inform
the host that device reset HPB information."

Therefore, for HPB device control mode, if the UFS device is reset via the
RST_N pin, the active region information in the device will be reset. If
the host side receives this notification from the device side, it is
recommended to inactivate all active regions in the host's HPB cache.

Link: https://lore.kernel.org/r/20220505134707.35929-6-huobean@gmail.com
Reviewed-by: Keoseong Park <keosung.park@samsung.com>
Reviewed-by: Daejun Park <daejun7.park@samsung.com>
Signed-off-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 32d6eab31a)
Change-Id: I0cb5ced80121ccd3b0be130fe2906af5ea83068d
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:29 -07:00
Bean Huo
26307f0d97 UPSTREAM: scsi: ufs: ufshpb: Change sysfs node hpb_stats/rb_* prefix to start with rcmd_*
According to the documentation of the sysfs nodes rb_noti_cnt,
rb_active_cnt and rb_inactive_cnt, these are all related to HPB
recommendation in UPIU response packet. 'rcmd' (recommendation) should be
the correct abbreviation.

Change the sysfs documentation about these sysfs nodes to highlight what
they mean under different HPB control modes.

Link: https://lore.kernel.org/r/20220505134707.35929-5-huobean@gmail.com
Reviewed-by: Keoseong Park <keosung.park@samsung.com>
Signed-off-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit d4300c552b)
Change-Id: I236b6e4a6f85c436e3f4007d6ddd32d14a411539
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:29 -07:00
Bean Huo
ecde812431 UPSTREAM: scsi: ufs: ufshpb: Clean up the handler when device resets HPB information
"When the device is powered off by the host, the device may restore L2P map
data upon power up or build from the host's HPB READ command. In case
device powered up and lost HPB information, device can signal to the host
through HPB Sense data, by setting HPB Operation as '2' which will inform
the host that device reset HPB information."

Clean up the handler and make the intent of this handler more readable, no
functional change.

Link: https://lore.kernel.org/r/20220505134707.35929-4-huobean@gmail.com
Reviewed-by: Keoseong Park <keosung.park@samsung.com>
Reviewed-by: Daejun Park <daejun7.park@samsung.com>
Signed-off-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit a3f3c26d4d)
Change-Id: Ie4c769505707c35777d0d8fac089f29d448b5bce
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:29 -07:00
Bean Huo
96b7da9493 UPSTREAM: scsi: ufs: ufshpb: Remove enum initialization value
If the first enumerator has no initializer, the value of the corresponding
constant is zero.

Link: https://lore.kernel.org/r/20220505134707.35929-3-huobean@gmail.com
Reviewed-by: Keoseong Park <keosung.park@samsung.com>
Signed-off-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 6f341ed5e3)
Change-Id: I5e3df5f756c174d65f00272c3643e109e32e9987
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:28 -07:00
Bean Huo
50460bbd71 UPSTREAM: scsi: ufs: ufshpb: Merge ufshpb_reset() and ufshpb_reset_host()
There is no functional change in this patch, just merge ufshpb_reset() and
ufshpb_reset_host() into one function ufshpb_toggle_state().

Link: https://lore.kernel.org/r/20220505134707.35929-2-huobean@gmail.com
Reviewed-by: Keoseong Park <keosung.park@samsung.com>
Signed-off-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit facc239c87)
Change-Id: I88837545b7af1664c6accbec957b8dcaf4d23a3b
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:28 -07:00
Manivannan Sadhasivam
92cf8c285a UPSTREAM: scsi: ufs: qcom: Enable RPM_AUTOSUSPEND for runtime PM
In order to allow the block devices to enter autosuspend mode during
runtime, thereby allowing the ufshcd host driver to also runtime suspend,
let's make use of the RPM_AUTOSUSPEND flag.

Without this flag, userspace needs to enable the autosuspend feature of
the block devices through sysfs.

Link: https://lore.kernel.org/r/20220504084212.11605-6-manivannan.sadhasivam@linaro.org
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 6f21d9274c)
Change-Id: I5e8b343cbfacfbf9addd41b388a5af01c73b9b5c
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:28 -07:00
Manivannan Sadhasivam
ebebd5ef5f UPSTREAM: scsi: ufs: core: Remove redundant wmb() in ufshcd_send_command()
The wmb() inside ufshcd_send_command() is added to make sure that the
doorbell is committed immediately. This leads to couple of expectations:

 1. The doorbell write should complete before the function return.

 2. The doorbell write should not cross the function boundary.

2nd expectation is fullfilled by the Linux memory model as there is a
guarantee that the critical section won't cross the unlock (release)
operation.

1st expectation is not really needed here as there is no following read/
write that depends on the doorbell to be complete implicitly. Even if the
doorbell write is in a CPUs Write Buffer (WB), wmb() won't flush it. And
there is no real need of a WB flush here as well.

So let's get rid of the wmb() that seems redundant.

Link: https://lore.kernel.org/r/20220504084212.11605-5-manivannan.sadhasivam@linaro.org
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Acked-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 23803bacaa)
Change-Id: I237ad3fec8301aa9d17c508b1c50bff019eeae6d
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:28 -07:00
Manivannan Sadhasivam
327367068e UPSTREAM: scsi: ufs: qcom: Add a readl() to make sure ref_clk gets enabled
In ufs_qcom_dev_ref_clk_ctrl(), it was noted that the ref_clk needs to be
stable for at least 1us. Even though there is wmb() to make sure the write
gets "completed", there is no guarantee that the write actually reached the
UFS device. There is a good chance that the write could be stored in a
Write Buffer (WB). In that case, even though the CPU waits for 1us, the
ref_clk might not be stable for that period.

So lets do a readl() to make sure that the previous write has reached the
UFS device before udelay().

Also, the wmb() after writel_relaxed() is not really needed. Both writel()
and readl() are ordered on all architectures and the CPU won't speculate
instructions after readl() due to the in-built control dependency with read
value on weakly ordered architectures. So it can be safely removed.

Link: https://lore.kernel.org/r/20220504084212.11605-4-manivannan.sadhasivam@linaro.org
Fixes: f06fcc7155 ("scsi: ufs-qcom: add QUniPro hardware support and power optimizations")
Cc: stable@vger.kernel.org
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 8eecddfca3)
Change-Id: I3fda6b084b7fdd970c0e3f6fcf2fa771e4e286c1
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:28 -07:00
Manivannan Sadhasivam
a44188938c UPSTREAM: scsi: ufs: qcom: Simplify handling of devm_phy_get()
There is no need to call devm_phy_get() if ACPI is used, so skip it.  The
host->generic_phy pointer should already be NULL due to the kzalloc(), so
no need to set it NULL again.

While at it, also remove the comment that has no relationship with
devm_phy_get().

Link: https://lore.kernel.org/r/20220504084212.11605-3-manivannan.sadhasivam@linaro.org
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit c9ed9a6c56)
Change-Id: Id46d37ad06cd8789e1d60fc67d283fb883d556ae
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:28 -07:00
Manivannan Sadhasivam
74e83bcb8f UPSTREAM: scsi: ufs: qcom: Fix acquiring the optional reset control line
On Qcom UFS platforms, the reset control line seems to be optional (for
SoCs like MSM8996 and probably for others too). The current logic tries to
mimic the devm_reset_control_get_optional() API but it also continues the
probe if there is an error with the declared reset line in DT/ACPI.

In an ideal case, if the reset line is not declared in DT/ACPI, the probe
should continue. But if there is problem in acquiring the declared reset
line (like EPROBE_DEFER) it should fail and return the appropriate error
code.

Link: https://lore.kernel.org/r/20220504084212.11605-2-manivannan.sadhasivam@linaro.org
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Andrew Halaney <ahalaney@redhat.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 223b17ed76)
Change-Id: I90a155a1c8035e2c004753b3dc6c5514cd152739
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:28 -07:00
Minghao Chi
09550e3245 UPSTREAM: scsi: ufs: Use pm_runtime_resume_and_get() instead of pm_runtime_get_sync()
Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync() and
pm_runtime_put_noidle(). This change is just to simplify the code, no
actual functional changes.

Link: https://lore.kernel.org/r/20220420090353.2588804-1-chi.minghao@zte.com.cn
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 75b8715e20)
Change-Id: Ic004232bf568b1b5b54305f35eee2390b289d7d0
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:27 -07:00
Wan Jiabing
c01d31a66e UPSTREAM: scsi: ufs: core: Remove duplicate include in ufshcd
Fix following checkincludes warning:

drivers/scsi/ufs/ufshcd.c: linux/nls.h is included more than once.

The include is in line 14. Remove the duplicate.

Link: https://lore.kernel.org/r/20220426104509.621394-1-wanjiabing@vivo.com
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 8ad8edd2fb)
Change-Id: Ie0e0861555536195f93fe03759dd0453a818b0fe
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:27 -07:00
Bart Van Assche
19a65b5076 UPSTREAM: scsi: ufs: Move the ufs_is_valid_unit_desc_lun() definition
Move the definition of this function from a public into a private header
file since it is only used inside the UFS core.

Link: https://lore.kernel.org/r/20220419225811.4127248-29-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit a8b032b5b3)
Change-Id: Ic0839f99dd5a89a278e1f39550ffc4b73b6267fb
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:27 -07:00
Bart Van Assche
5d99de46b8 UPSTREAM: scsi: ufs: Move the struct ufs_ref_clk definition
Move the definition of this data structure since it is only used in a
single source file.

Link: https://lore.kernel.org/r/20220419225811.4127248-28-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 743b09d854)
Change-Id: Ifac169478b282b025f21ddcc05f50d7159f3ee06
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:27 -07:00
Bart Van Assche
c32bb82fd9 UPSTREAM: scsi: ufs: Split the ufshcd.h header file
Split the ufshcd.h header file into a header file that defines the
interface used by UFS drivers and another header file with declarations and
data structures only used by the UFS core.

Link: https://lore.kernel.org/r/20220419225811.4127248-27-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 4bc26113c6)
Change-Id: I3628a104f07e78da259db0f5c16d0c586db17ae5
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:27 -07:00
Bart Van Assche
de7478829f UPSTREAM: scsi: ufs: Minimize #include directives
Follow the convention that is used elsewhere in the Linux kernel source
code and only include those headers of which the declarations are used
directly.

Link: https://lore.kernel.org/r/20220419225811.4127248-26-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 3f06f7800b)
Change-Id: I7940c2fcced6a5bdff4f96a812670cc7ac432c67
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:27 -07:00
Bart Van Assche
ab2a9f61fd UPSTREAM: scsi: ufs: Fix kernel-doc syntax in ufshcd.h
This patch fixes all the warnings and errors reported by the following
command:

scripts/kernel-doc -none drivers/scsi/ufs/ufshcd.h

Link: https://lore.kernel.org/r/20220419225811.4127248-25-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit cff91daf52)
Change-Id: Iff495e4cf75c980bb5526e43b7f96745405dc0fe
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:26 -07:00
Bart Van Assche
dbb9373276 UPSTREAM: scsi: ufs: Remove unnecessary ufshcd-crypto.h include directives
ufshcd-crypto.h declares functions that must only be called by the UFS
core. Hence remove the #include "ufshcd-crypto.h" directive from UFS
drivers.

Link: https://lore.kernel.org/r/20220419225811.4127248-24-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit c10d52d73a)
Change-Id: Ic43e2bc475219ff58bde970da305791ff36620eb
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:26 -07:00
Bart Van Assche
e8d1bcb857 UPSTREAM: scsi: ufs: qcom: Fix ufs_qcom_resume()
Clearing hba->is_sys_suspended if ufs_qcom_resume() succeeds is wrong. That
variable must only be cleared if all actions involved in a resume succeed.
Hence remove the statement that clears hba->is_sys_suspended from
ufs_qcom_resume().

Link: https://lore.kernel.org/r/20220419225811.4127248-23-bvanassche@acm.org
Fixes: 81c0fc51b7 ("ufs-qcom: add support for Qualcomm Technologies Inc platforms")
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit bee40dc167)
Change-Id: I4ee687c2ef42ff7d13de76522c9944072b42dca4
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:26 -07:00
Bart Van Assche
d8d1d7ec78 UPSTREAM: scsi: ufs: Introduce ufshcd_clkgate_delay_set()
Since the code to modify delay_ms while holding the host lock occurs twice,
introduce a function that performs this action.

Link: https://lore.kernel.org/r/20220419225811.4127248-22-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit ad8a647e77)
Change-Id: I72c7cf385c041a7e1b073b25768a703df6d13eee
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:26 -07:00
Bart Van Assche
2d122e3802 UPSTREAM: scsi: ufs: Remove locking from around single register writes
Single register writes are atomic and hence do not need to be surrounded by
locking. Additionally, MMIO writes are typically posted asynchronously.
Hence, there is no guarantee that these have finished by the time the
spin_unlock*() call has finished. See also the nonposted-mmio property of
the Open Firmware tree. See also pci_iomap().

Link: https://lore.kernel.org/r/20220419225811.4127248-21-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 3fb20fcd93)
Change-Id: I50811ddab2c745ac1fe898e83bf7a0cd4e4ce7e4
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:26 -07:00
Bart Van Assche
97ce892ac4 UPSTREAM: scsi: ufs: Remove the TRUE and FALSE definitions
In the Linux kernel coding style document
(Documentation/process/coding-style.rst) it is recommended to use the type
'bool' and also the values 'true' and 'false'. Hence this patch that
removes the definitions and uses of TRUE and FALSE from the UFS driver.

Link: https://lore.kernel.org/r/20220419225811.4127248-20-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 21c2e3418d)
Change-Id: I57b30acc698d9f1f9afa7d3f0408d45c53637ca6
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:26 -07:00
Bart Van Assche
be4c229787 UPSTREAM: scsi: ufs: Remove paths from source code comments
Since specifying the path in a source file is redundant, remove the paths
from source code comments.

Link: https://lore.kernel.org/r/20220419225811.4127248-19-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit d0c1725b1e)
Change-Id: I42c454bfac9741b2a90c0c292ad5c8bd1b5ec471
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:25 -07:00
Bart Van Assche
bcbe10d414 UPSTREAM: scsi: ufs: Use an SPDX license identifier in the Kconfig file
As requested in Documentation/process/license-rules.rst, use an SPDX
license identifier.

Link: https://lore.kernel.org/r/20220419225811.4127248-18-bvanassche@acm.org
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Bug: 234653003
(cherry picked from commit 2b10863f71)
Change-Id: I4571f6bcc729085d2a43e0ab1102833c0f77878b
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2022-06-09 13:35:25 -07:00