Merge android-4.4.153 (5e24b4e
) into msm-4.4
* refs/heads/tmp-5e24b4e Linux 4.4.153 ovl: warn instead of error if d_type is not supported ovl: Do d_type check only if work dir creation was successful ovl: Ensure upper filesystem supports d_type x86/mm: Fix use-after-free of ldt_struct x86/mm/pat: Fix L1TF stable backport for CPA ANDROID: x86_64_cuttlefish_defconfig: Enable lz4 compression for zram UPSTREAM: drivers/block/zram/zram_drv.c: fix bug storing backing_dev BACKPORT: zram: introduce zram memory tracking BACKPORT: zram: record accessed second BACKPORT: zram: mark incompressible page as ZRAM_HUGE UPSTREAM: zram: correct flag name of ZRAM_ACCESS UPSTREAM: zram: Delete gendisk before cleaning up the request queue UPSTREAM: drivers/block/zram/zram_drv.c: make zram_page_end_io() static BACKPORT: zram: set BDI_CAP_STABLE_WRITES once UPSTREAM: zram: fix null dereference of handle UPSTREAM: zram: add config and doc file for writeback feature BACKPORT: zram: read page from backing device BACKPORT: zram: write incompressible pages to backing device BACKPORT: zram: identify asynchronous IO's return value BACKPORT: zram: add free space management in backing device UPSTREAM: zram: add interface to specif backing device UPSTREAM: zram: rename zram_decompress_page to __zram_bvec_read UPSTREAM: zram: inline zram_compress UPSTREAM: zram: clean up duplicated codes in __zram_bvec_write Linux 4.4.152 reiserfs: fix broken xattr handling (heap corruption, bad retval) i2c: imx: Fix race condition in dma read PCI: pciehp: Fix use-after-free on unplug PCI: Skip MPS logic for Virtual Functions (VFs) PCI: hotplug: Don't leak pci_slot on registration failure parisc: Remove unnecessary barriers from spinlock.h bridge: Propagate vlan add failure to user packet: refine ring v3 block size test to hold one frame netfilter: conntrack: dccp: treat SYNC/SYNCACK as invalid if no prior state xfrm_user: prevent leaking 2 bytes of kernel memory parisc: Remove ordered stores from syscall.S ext4: fix spectre gadget in ext4_mb_regular_allocator() KVM: irqfd: fix race between EPOLLHUP and irq_bypass_register_consumer staging: android: ion: check for kref overflow tcp: identify cryptic messages as TCP seq # bugs net: qca_spi: Fix log level if probe fails net: qca_spi: Make sure the QCA7000 reset is triggered net: qca_spi: Avoid packet drop during initial sync net: usb: rtl8150: demote allmulti message to dev_dbg() net/ethernet/freescale/fman: fix cross-build error drm/nouveau/gem: off by one bugs in nouveau_gem_pushbuf_reloc_apply() tcp: remove DELAYED ACK events in DCTCP qlogic: check kstrtoul() for errors packet: reset network header if packet shorter than ll reserved space ixgbe: Be more careful when modifying MAC filters ARM: dts: am3517.dtsi: Disable reference to OMAP3 OTG controller ARM: 8780/1: ftrace: Only set kernel memory back to read-only after boot perf llvm-utils: Remove bashism from kernel include fetch script bnxt_en: Fix for system hang if request_irq fails drm/armada: fix colorkey mode property ieee802154: fakelb: switch from BUG_ON() to WARN_ON() on problem ieee802154: at86rf230: use __func__ macro for debug messages ieee802154: at86rf230: switch from BUG_ON() to WARN_ON() on problem ARM: pxa: irq: fix handling of ICMR registers in suspend/resume netfilter: x_tables: set module owner for icmp(6) matches smsc75xx: Add workaround for gigabit link up hardware errata. kasan: fix shadow_size calculation error in kasan_module_alloc tracing: Use __printf markup to silence compiler ARM: imx_v4_v5_defconfig: Select ULPI support ARM: imx_v6_v7_defconfig: Select ULPI support HID: wacom: Correct touch maximum XY of 2nd-gen Intuos m68k: fix "bad page state" oops on ColdFire boot bnx2x: Fix receiving tx-timeout in error or recovery state. drm/exynos: decon5433: Fix WINCONx reset value drm/exynos: decon5433: Fix per-plane global alpha for XRGB modes drm/exynos: gsc: Fix support for NV16/61, YUV420/YVU420 and YUV422 modes md/raid10: fix that replacement cannot complete recovery after reassemble dmaengine: k3dma: Off by one in k3_of_dma_simple_xlate() ARM: dts: da850: Fix interrups property for gpio selftests/x86/sigreturn/64: Fix spurious failures on AMD CPUs perf report powerpc: Fix crash if callchain is empty perf test session topology: Fix test on s390 usb: xhci: increase CRS timeout value ARM: dts: am437x: make edt-ft5x06 a wakeup source brcmfmac: stop watchdog before detach and free everything cxgb4: when disabling dcb set txq dcb priority to 0 Smack: Mark inode instant in smack_task_to_inode ipv6: mcast: fix unsolicited report interval after receiving querys locking/lockdep: Do not record IRQ state within lockdep code net: davinci_emac: match the mdio device against its compatible if possible ARC: Enable machine_desc->init_per_cpu for !CONFIG_SMP net: propagate dev_get_valid_name return code net: hamradio: use eth_broadcast_addr enic: initialize enic->rfs_h.lock in enic_probe qed: Add sanity check for SIMD fastpath handler. arm64: make secondary_start_kernel() notrace scsi: xen-scsifront: add error handling for xenbus_printf usb: gadget: dwc2: fix memory leak in gadget_init() usb: gadget: composite: fix delayed_status race condition when set_interface usb: dwc2: fix isoc split in transfer with no data ARM: dts: Cygnus: Fix I2C controller interrupt type selftests: sync: add config fragment for testing sync framework selftests: zram: return Kselftest Skip code for skipped tests selftests: user: return Kselftest Skip code for skipped tests selftests: static_keys: return Kselftest Skip code for skipped tests selftests: pstore: return Kselftest Skip code for skipped tests netfilter: ipv6: nf_defrag: reduce struct net memory waste ARC: Explicitly add -mmedium-calls to CFLAGS ANDROID: x86_64_cuttlefish_defconfig: Enable zram and zstd BACKPORT: crypto: zstd - Add zstd support UPSTREAM: zram: add zstd to the supported algorithms list UPSTREAM: lib: Add zstd modules UPSTREAM: lib: Add xxhash module UPSTREAM: zram: rework copy of compressor name in comp_algorithm_store() UPSTREAM: zram: constify attribute_group structures. UPSTREAM: zram: count same page write as page_stored UPSTREAM: zram: reduce load operation in page_same_filled UPSTREAM: zram: use zram_free_page instead of open-coded UPSTREAM: zram: introduce zram data accessor UPSTREAM: zram: remove zram_meta structure UPSTREAM: zram: use zram_slot_lock instead of raw bit_spin_lock op BACKPORT: zram: partial IO refactoring BACKPORT: zram: handle multiple pages attached bio's bvec UPSTREAM: zram: fix operator precedence to get offset BACKPORT: zram: extend zero pages to same element pages BACKPORT: zram: remove waitqueue for IO done UPSTREAM: zram: remove obsolete sysfs attrs UPSTREAM: zram: support BDI_CAP_STABLE_WRITES UPSTREAM: zram: revalidate disk under init_lock BACKPORT: mm: support anonymous stable page UPSTREAM: zram: use __GFP_MOVABLE for memory allocation UPSTREAM: zram: drop gfp_t from zcomp_strm_alloc() UPSTREAM: zram: add more compression algorithms UPSTREAM: zram: delete custom lzo/lz4 UPSTREAM: zram: cosmetic: cleanup documentation UPSTREAM: zram: use crypto api to check alg availability BACKPORT: zram: switch to crypto compress API UPSTREAM: zram: rename zstrm find-release functions UPSTREAM: zram: introduce per-device debug_stat sysfs node UPSTREAM: zram: remove max_comp_streams internals UPSTREAM: zram: user per-cpu compression streams BACKPORT: zsmalloc: require GFP in zs_malloc() UPSTREAM: zram/zcomp: do not zero out zcomp private pages UPSTREAM: zram: pass gfp from zcomp frontend to backend UPSTREAM: socket: close race condition between sock_close() and sockfs_setattr() ANDROID: Refresh x86_64_cuttlefish_defconfig Linux 4.4.151 isdn: Disable IIOCDBGVAR Bluetooth: avoid killing an already killed socket x86/mm: Simplify p[g4um]d_page() macros serial: 8250_dw: always set baud rate in dw8250_set_termios ACPI / PM: save NVS memory for ASUS 1025C laptop ACPI: save NVS memory for Lenovo G50-45 USB: option: add support for DW5821e USB: serial: sierra: fix potential deadlock at close ALSA: vxpocket: Fix invalid endian conversions ALSA: memalloc: Don't exceed over the requested size ALSA: hda: Correct Asrock B85M-ITX power_save blacklist entry ALSA: cs5535audio: Fix invalid endian conversion ALSA: virmidi: Fix too long output trigger loop ALSA: vx222: Fix invalid endian conversions ALSA: hda - Turn CX8200 into D3 as well upon reboot ALSA: hda - Sleep for 10ms after entering D3 on Conexant codecs net_sched: fix NULL pointer dereference when delete tcindex filter vsock: split dwork to avoid reinitializations net_sched: Fix missing res info when create new tc_index filter llc: use refcount_inc_not_zero() for llc_sap_find() l2tp: use sk_dst_check() to avoid race on sk->sk_dst_cache dccp: fix undefined behavior with 'cwnd' shift in ccid2_cwnd_restart() Conflicts: drivers/block/zram/zram_drv.c drivers/staging/android/ion/ion.c include/linux/swap.h mm/zsmalloc.c Change-Id: I1c437ac5133503a939d06d51ec778b65371df6d1 Signed-off-by: Srinivasarao P <spathi@codeaurora.org>
This commit is contained in:
commit
b87d31674a
159 changed files with 16025 additions and 1568 deletions
|
@ -1,119 +0,0 @@
|
||||||
What: /sys/block/zram<id>/num_reads
|
|
||||||
Date: August 2015
|
|
||||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
|
||||||
Description:
|
|
||||||
The num_reads file is read-only and specifies the number of
|
|
||||||
reads (failed or successful) done on this device.
|
|
||||||
Now accessible via zram<id>/stat node.
|
|
||||||
|
|
||||||
What: /sys/block/zram<id>/num_writes
|
|
||||||
Date: August 2015
|
|
||||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
|
||||||
Description:
|
|
||||||
The num_writes file is read-only and specifies the number of
|
|
||||||
writes (failed or successful) done on this device.
|
|
||||||
Now accessible via zram<id>/stat node.
|
|
||||||
|
|
||||||
What: /sys/block/zram<id>/invalid_io
|
|
||||||
Date: August 2015
|
|
||||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
|
||||||
Description:
|
|
||||||
The invalid_io file is read-only and specifies the number of
|
|
||||||
non-page-size-aligned I/O requests issued to this device.
|
|
||||||
Now accessible via zram<id>/io_stat node.
|
|
||||||
|
|
||||||
What: /sys/block/zram<id>/failed_reads
|
|
||||||
Date: August 2015
|
|
||||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
|
||||||
Description:
|
|
||||||
The failed_reads file is read-only and specifies the number of
|
|
||||||
failed reads happened on this device.
|
|
||||||
Now accessible via zram<id>/io_stat node.
|
|
||||||
|
|
||||||
What: /sys/block/zram<id>/failed_writes
|
|
||||||
Date: August 2015
|
|
||||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
|
||||||
Description:
|
|
||||||
The failed_writes file is read-only and specifies the number of
|
|
||||||
failed writes happened on this device.
|
|
||||||
Now accessible via zram<id>/io_stat node.
|
|
||||||
|
|
||||||
What: /sys/block/zram<id>/notify_free
|
|
||||||
Date: August 2015
|
|
||||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
|
||||||
Description:
|
|
||||||
The notify_free file is read-only. Depending on device usage
|
|
||||||
scenario it may account a) the number of pages freed because
|
|
||||||
of swap slot free notifications or b) the number of pages freed
|
|
||||||
because of REQ_DISCARD requests sent by bio. The former ones
|
|
||||||
are sent to a swap block device when a swap slot is freed, which
|
|
||||||
implies that this disk is being used as a swap disk. The latter
|
|
||||||
ones are sent by filesystem mounted with discard option,
|
|
||||||
whenever some data blocks are getting discarded.
|
|
||||||
Now accessible via zram<id>/io_stat node.
|
|
||||||
|
|
||||||
What: /sys/block/zram<id>/zero_pages
|
|
||||||
Date: August 2015
|
|
||||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
|
||||||
Description:
|
|
||||||
The zero_pages file is read-only and specifies number of zero
|
|
||||||
filled pages written to this disk. No memory is allocated for
|
|
||||||
such pages.
|
|
||||||
Now accessible via zram<id>/mm_stat node.
|
|
||||||
|
|
||||||
What: /sys/block/zram<id>/orig_data_size
|
|
||||||
Date: August 2015
|
|
||||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
|
||||||
Description:
|
|
||||||
The orig_data_size file is read-only and specifies uncompressed
|
|
||||||
size of data stored in this disk. This excludes zero-filled
|
|
||||||
pages (zero_pages) since no memory is allocated for them.
|
|
||||||
Unit: bytes
|
|
||||||
Now accessible via zram<id>/mm_stat node.
|
|
||||||
|
|
||||||
What: /sys/block/zram<id>/compr_data_size
|
|
||||||
Date: August 2015
|
|
||||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
|
||||||
Description:
|
|
||||||
The compr_data_size file is read-only and specifies compressed
|
|
||||||
size of data stored in this disk. So, compression ratio can be
|
|
||||||
calculated using orig_data_size and this statistic.
|
|
||||||
Unit: bytes
|
|
||||||
Now accessible via zram<id>/mm_stat node.
|
|
||||||
|
|
||||||
What: /sys/block/zram<id>/mem_used_total
|
|
||||||
Date: August 2015
|
|
||||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
|
||||||
Description:
|
|
||||||
The mem_used_total file is read-only and specifies the amount
|
|
||||||
of memory, including allocator fragmentation and metadata
|
|
||||||
overhead, allocated for this disk. So, allocator space
|
|
||||||
efficiency can be calculated using compr_data_size and this
|
|
||||||
statistic.
|
|
||||||
Unit: bytes
|
|
||||||
Now accessible via zram<id>/mm_stat node.
|
|
||||||
|
|
||||||
What: /sys/block/zram<id>/mem_used_max
|
|
||||||
Date: August 2015
|
|
||||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
|
||||||
Description:
|
|
||||||
The mem_used_max file is read/write and specifies the amount
|
|
||||||
of maximum memory zram have consumed to store compressed data.
|
|
||||||
For resetting the value, you should write "0". Otherwise,
|
|
||||||
you could see -EINVAL.
|
|
||||||
Unit: bytes
|
|
||||||
Downgraded to write-only node: so it's possible to set new
|
|
||||||
value only; its current value is stored in zram<id>/mm_stat
|
|
||||||
node.
|
|
||||||
|
|
||||||
What: /sys/block/zram<id>/mem_limit
|
|
||||||
Date: August 2015
|
|
||||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
|
||||||
Description:
|
|
||||||
The mem_limit file is read/write and specifies the maximum
|
|
||||||
amount of memory ZRAM can use to store the compressed data.
|
|
||||||
The limit could be changed in run time and "0" means disable
|
|
||||||
the limit. No limit is the initial state. Unit: bytes
|
|
||||||
Downgraded to write-only node: so it's possible to set new
|
|
||||||
value only; its current value is stored in zram<id>/mm_stat
|
|
||||||
node.
|
|
|
@ -22,41 +22,6 @@ Description:
|
||||||
device. The reset operation frees all the memory associated
|
device. The reset operation frees all the memory associated
|
||||||
with this device.
|
with this device.
|
||||||
|
|
||||||
What: /sys/block/zram<id>/num_reads
|
|
||||||
Date: August 2010
|
|
||||||
Contact: Nitin Gupta <ngupta@vflare.org>
|
|
||||||
Description:
|
|
||||||
The num_reads file is read-only and specifies the number of
|
|
||||||
reads (failed or successful) done on this device.
|
|
||||||
|
|
||||||
What: /sys/block/zram<id>/num_writes
|
|
||||||
Date: August 2010
|
|
||||||
Contact: Nitin Gupta <ngupta@vflare.org>
|
|
||||||
Description:
|
|
||||||
The num_writes file is read-only and specifies the number of
|
|
||||||
writes (failed or successful) done on this device.
|
|
||||||
|
|
||||||
What: /sys/block/zram<id>/invalid_io
|
|
||||||
Date: August 2010
|
|
||||||
Contact: Nitin Gupta <ngupta@vflare.org>
|
|
||||||
Description:
|
|
||||||
The invalid_io file is read-only and specifies the number of
|
|
||||||
non-page-size-aligned I/O requests issued to this device.
|
|
||||||
|
|
||||||
What: /sys/block/zram<id>/failed_reads
|
|
||||||
Date: February 2014
|
|
||||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
|
||||||
Description:
|
|
||||||
The failed_reads file is read-only and specifies the number of
|
|
||||||
failed reads happened on this device.
|
|
||||||
|
|
||||||
What: /sys/block/zram<id>/failed_writes
|
|
||||||
Date: February 2014
|
|
||||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
|
||||||
Description:
|
|
||||||
The failed_writes file is read-only and specifies the number of
|
|
||||||
failed writes happened on this device.
|
|
||||||
|
|
||||||
What: /sys/block/zram<id>/max_comp_streams
|
What: /sys/block/zram<id>/max_comp_streams
|
||||||
Date: February 2014
|
Date: February 2014
|
||||||
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
||||||
|
@ -73,74 +38,24 @@ Description:
|
||||||
available and selected compression algorithms, change
|
available and selected compression algorithms, change
|
||||||
compression algorithm selection.
|
compression algorithm selection.
|
||||||
|
|
||||||
What: /sys/block/zram<id>/notify_free
|
|
||||||
Date: August 2010
|
|
||||||
Contact: Nitin Gupta <ngupta@vflare.org>
|
|
||||||
Description:
|
|
||||||
The notify_free file is read-only. Depending on device usage
|
|
||||||
scenario it may account a) the number of pages freed because
|
|
||||||
of swap slot free notifications or b) the number of pages freed
|
|
||||||
because of REQ_DISCARD requests sent by bio. The former ones
|
|
||||||
are sent to a swap block device when a swap slot is freed, which
|
|
||||||
implies that this disk is being used as a swap disk. The latter
|
|
||||||
ones are sent by filesystem mounted with discard option,
|
|
||||||
whenever some data blocks are getting discarded.
|
|
||||||
|
|
||||||
What: /sys/block/zram<id>/zero_pages
|
|
||||||
Date: August 2010
|
|
||||||
Contact: Nitin Gupta <ngupta@vflare.org>
|
|
||||||
Description:
|
|
||||||
The zero_pages file is read-only and specifies number of zero
|
|
||||||
filled pages written to this disk. No memory is allocated for
|
|
||||||
such pages.
|
|
||||||
|
|
||||||
What: /sys/block/zram<id>/orig_data_size
|
|
||||||
Date: August 2010
|
|
||||||
Contact: Nitin Gupta <ngupta@vflare.org>
|
|
||||||
Description:
|
|
||||||
The orig_data_size file is read-only and specifies uncompressed
|
|
||||||
size of data stored in this disk. This excludes zero-filled
|
|
||||||
pages (zero_pages) since no memory is allocated for them.
|
|
||||||
Unit: bytes
|
|
||||||
|
|
||||||
What: /sys/block/zram<id>/compr_data_size
|
|
||||||
Date: August 2010
|
|
||||||
Contact: Nitin Gupta <ngupta@vflare.org>
|
|
||||||
Description:
|
|
||||||
The compr_data_size file is read-only and specifies compressed
|
|
||||||
size of data stored in this disk. So, compression ratio can be
|
|
||||||
calculated using orig_data_size and this statistic.
|
|
||||||
Unit: bytes
|
|
||||||
|
|
||||||
What: /sys/block/zram<id>/mem_used_total
|
|
||||||
Date: August 2010
|
|
||||||
Contact: Nitin Gupta <ngupta@vflare.org>
|
|
||||||
Description:
|
|
||||||
The mem_used_total file is read-only and specifies the amount
|
|
||||||
of memory, including allocator fragmentation and metadata
|
|
||||||
overhead, allocated for this disk. So, allocator space
|
|
||||||
efficiency can be calculated using compr_data_size and this
|
|
||||||
statistic.
|
|
||||||
Unit: bytes
|
|
||||||
|
|
||||||
What: /sys/block/zram<id>/mem_used_max
|
What: /sys/block/zram<id>/mem_used_max
|
||||||
Date: August 2014
|
Date: August 2014
|
||||||
Contact: Minchan Kim <minchan@kernel.org>
|
Contact: Minchan Kim <minchan@kernel.org>
|
||||||
Description:
|
Description:
|
||||||
The mem_used_max file is read/write and specifies the amount
|
The mem_used_max file is write-only and is used to reset
|
||||||
of maximum memory zram have consumed to store compressed data.
|
the counter of maximum memory zram have consumed to store
|
||||||
For resetting the value, you should write "0". Otherwise,
|
compressed data. For resetting the value, you should write
|
||||||
you could see -EINVAL.
|
"0". Otherwise, you could see -EINVAL.
|
||||||
Unit: bytes
|
Unit: bytes
|
||||||
|
|
||||||
What: /sys/block/zram<id>/mem_limit
|
What: /sys/block/zram<id>/mem_limit
|
||||||
Date: August 2014
|
Date: August 2014
|
||||||
Contact: Minchan Kim <minchan@kernel.org>
|
Contact: Minchan Kim <minchan@kernel.org>
|
||||||
Description:
|
Description:
|
||||||
The mem_limit file is read/write and specifies the maximum
|
The mem_limit file is write-only and specifies the maximum
|
||||||
amount of memory ZRAM can use to store the compressed data. The
|
amount of memory ZRAM can use to store the compressed data.
|
||||||
limit could be changed in run time and "0" means disable the
|
The limit could be changed in run time and "0" means disable
|
||||||
limit. No limit is the initial state. Unit: bytes
|
the limit. No limit is the initial state. Unit: bytes
|
||||||
|
|
||||||
What: /sys/block/zram<id>/compact
|
What: /sys/block/zram<id>/compact
|
||||||
Date: August 2015
|
Date: August 2015
|
||||||
|
@ -166,3 +81,20 @@ Description:
|
||||||
The mm_stat file is read-only and represents device's mm
|
The mm_stat file is read-only and represents device's mm
|
||||||
statistics (orig_data_size, compr_data_size, etc.) in a format
|
statistics (orig_data_size, compr_data_size, etc.) in a format
|
||||||
similar to block layer statistics file format.
|
similar to block layer statistics file format.
|
||||||
|
|
||||||
|
What: /sys/block/zram<id>/debug_stat
|
||||||
|
Date: July 2016
|
||||||
|
Contact: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
|
||||||
|
Description:
|
||||||
|
The debug_stat file is read-only and represents various
|
||||||
|
device's debugging info useful for kernel developers. Its
|
||||||
|
format is not documented intentionally and may change
|
||||||
|
anytime without any notice.
|
||||||
|
|
||||||
|
What: /sys/block/zram<id>/backing_dev
|
||||||
|
Date: June 2017
|
||||||
|
Contact: Minchan Kim <minchan@kernel.org>
|
||||||
|
Description:
|
||||||
|
The backing_dev file is read-write and set up backing
|
||||||
|
device for zram to write incompressible pages.
|
||||||
|
For using, user should enable CONFIG_ZRAM_WRITEBACK.
|
||||||
|
|
|
@ -59,34 +59,23 @@ num_devices parameter is optional and tells zram how many devices should be
|
||||||
pre-created. Default: 1.
|
pre-created. Default: 1.
|
||||||
|
|
||||||
2) Set max number of compression streams
|
2) Set max number of compression streams
|
||||||
Compression backend may use up to max_comp_streams compression streams,
|
Regardless the value passed to this attribute, ZRAM will always
|
||||||
thus allowing up to max_comp_streams concurrent compression operations.
|
allocate multiple compression streams - one per online CPUs - thus
|
||||||
By default, compression backend uses single compression stream.
|
allowing several concurrent compression operations. The number of
|
||||||
|
allocated compression streams goes down when some of the CPUs
|
||||||
|
become offline. There is no single-compression-stream mode anymore,
|
||||||
|
unless you are running a UP system or has only 1 CPU online.
|
||||||
|
|
||||||
Examples:
|
To find out how many streams are currently available:
|
||||||
#show max compression streams number
|
|
||||||
cat /sys/block/zram0/max_comp_streams
|
cat /sys/block/zram0/max_comp_streams
|
||||||
|
|
||||||
#set max compression streams number to 3
|
|
||||||
echo 3 > /sys/block/zram0/max_comp_streams
|
|
||||||
|
|
||||||
Note:
|
|
||||||
In order to enable compression backend's multi stream support max_comp_streams
|
|
||||||
must be initially set to desired concurrency level before ZRAM device
|
|
||||||
initialisation. Once the device initialised as a single stream compression
|
|
||||||
backend (max_comp_streams equals to 1), you will see error if you try to change
|
|
||||||
the value of max_comp_streams because single stream compression backend
|
|
||||||
implemented as a special case by lock overhead issue and does not support
|
|
||||||
dynamic max_comp_streams. Only multi stream backend supports dynamic
|
|
||||||
max_comp_streams adjustment.
|
|
||||||
|
|
||||||
3) Select compression algorithm
|
3) Select compression algorithm
|
||||||
Using comp_algorithm device attribute one can see available and
|
Using comp_algorithm device attribute one can see available and
|
||||||
currently selected (shown in square brackets) compression algorithms,
|
currently selected (shown in square brackets) compression algorithms,
|
||||||
change selected compression algorithm (once the device is initialised
|
change selected compression algorithm (once the device is initialised
|
||||||
there is no way to change compression algorithm).
|
there is no way to change compression algorithm).
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
#show supported compression algorithms
|
#show supported compression algorithms
|
||||||
cat /sys/block/zram0/comp_algorithm
|
cat /sys/block/zram0/comp_algorithm
|
||||||
lzo [lz4]
|
lzo [lz4]
|
||||||
|
@ -94,17 +83,27 @@ max_comp_streams adjustment.
|
||||||
#select lzo compression algorithm
|
#select lzo compression algorithm
|
||||||
echo lzo > /sys/block/zram0/comp_algorithm
|
echo lzo > /sys/block/zram0/comp_algorithm
|
||||||
|
|
||||||
4) Set Disksize
|
For the time being, the `comp_algorithm' content does not necessarily
|
||||||
Set disk size by writing the value to sysfs node 'disksize'.
|
show every compression algorithm supported by the kernel. We keep this
|
||||||
The value can be either in bytes or you can use mem suffixes.
|
list primarily to simplify device configuration and one can configure
|
||||||
Examples:
|
a new device with a compression algorithm that is not listed in
|
||||||
# Initialize /dev/zram0 with 50MB disksize
|
`comp_algorithm'. The thing is that, internally, ZRAM uses Crypto API
|
||||||
echo $((50*1024*1024)) > /sys/block/zram0/disksize
|
and, if some of the algorithms were built as modules, it's impossible
|
||||||
|
to list all of them using, for instance, /proc/crypto or any other
|
||||||
|
method. This, however, has an advantage of permitting the usage of
|
||||||
|
custom crypto compression modules (implementing S/W or H/W compression).
|
||||||
|
|
||||||
# Using mem suffixes
|
4) Set Disksize
|
||||||
echo 256K > /sys/block/zram0/disksize
|
Set disk size by writing the value to sysfs node 'disksize'.
|
||||||
echo 512M > /sys/block/zram0/disksize
|
The value can be either in bytes or you can use mem suffixes.
|
||||||
echo 1G > /sys/block/zram0/disksize
|
Examples:
|
||||||
|
# Initialize /dev/zram0 with 50MB disksize
|
||||||
|
echo $((50*1024*1024)) > /sys/block/zram0/disksize
|
||||||
|
|
||||||
|
# Using mem suffixes
|
||||||
|
echo 256K > /sys/block/zram0/disksize
|
||||||
|
echo 512M > /sys/block/zram0/disksize
|
||||||
|
echo 1G > /sys/block/zram0/disksize
|
||||||
|
|
||||||
Note:
|
Note:
|
||||||
There is little point creating a zram of greater than twice the size of memory
|
There is little point creating a zram of greater than twice the size of memory
|
||||||
|
@ -112,20 +111,20 @@ since we expect a 2:1 compression ratio. Note that zram uses about 0.1% of the
|
||||||
size of the disk when not in use so a huge zram is wasteful.
|
size of the disk when not in use so a huge zram is wasteful.
|
||||||
|
|
||||||
5) Set memory limit: Optional
|
5) Set memory limit: Optional
|
||||||
Set memory limit by writing the value to sysfs node 'mem_limit'.
|
Set memory limit by writing the value to sysfs node 'mem_limit'.
|
||||||
The value can be either in bytes or you can use mem suffixes.
|
The value can be either in bytes or you can use mem suffixes.
|
||||||
In addition, you could change the value in runtime.
|
In addition, you could change the value in runtime.
|
||||||
Examples:
|
Examples:
|
||||||
# limit /dev/zram0 with 50MB memory
|
# limit /dev/zram0 with 50MB memory
|
||||||
echo $((50*1024*1024)) > /sys/block/zram0/mem_limit
|
echo $((50*1024*1024)) > /sys/block/zram0/mem_limit
|
||||||
|
|
||||||
# Using mem suffixes
|
# Using mem suffixes
|
||||||
echo 256K > /sys/block/zram0/mem_limit
|
echo 256K > /sys/block/zram0/mem_limit
|
||||||
echo 512M > /sys/block/zram0/mem_limit
|
echo 512M > /sys/block/zram0/mem_limit
|
||||||
echo 1G > /sys/block/zram0/mem_limit
|
echo 1G > /sys/block/zram0/mem_limit
|
||||||
|
|
||||||
# To disable memory limit
|
# To disable memory limit
|
||||||
echo 0 > /sys/block/zram0/mem_limit
|
echo 0 > /sys/block/zram0/mem_limit
|
||||||
|
|
||||||
6) Activate:
|
6) Activate:
|
||||||
mkswap /dev/zram0
|
mkswap /dev/zram0
|
||||||
|
@ -162,41 +161,15 @@ Name access description
|
||||||
disksize RW show and set the device's disk size
|
disksize RW show and set the device's disk size
|
||||||
initstate RO shows the initialization state of the device
|
initstate RO shows the initialization state of the device
|
||||||
reset WO trigger device reset
|
reset WO trigger device reset
|
||||||
num_reads RO the number of reads
|
mem_used_max WO reset the `mem_used_max' counter (see later)
|
||||||
failed_reads RO the number of failed reads
|
mem_limit WO specifies the maximum amount of memory ZRAM can use
|
||||||
num_write RO the number of writes
|
to store the compressed data
|
||||||
failed_writes RO the number of failed writes
|
|
||||||
invalid_io RO the number of non-page-size-aligned I/O requests
|
|
||||||
max_comp_streams RW the number of possible concurrent compress operations
|
max_comp_streams RW the number of possible concurrent compress operations
|
||||||
comp_algorithm RW show and change the compression algorithm
|
comp_algorithm RW show and change the compression algorithm
|
||||||
notify_free RO the number of notifications to free pages (either
|
|
||||||
slot free notifications or REQ_DISCARD requests)
|
|
||||||
zero_pages RO the number of zero filled pages written to this disk
|
|
||||||
orig_data_size RO uncompressed size of data stored in this disk
|
|
||||||
compr_data_size RO compressed size of data stored in this disk
|
|
||||||
mem_used_total RO the amount of memory allocated for this disk
|
|
||||||
mem_used_max RW the maximum amount of memory zram have consumed to
|
|
||||||
store the data (to reset this counter to the actual
|
|
||||||
current value, write 1 to this attribute)
|
|
||||||
mem_limit RW the maximum amount of memory ZRAM can use to store
|
|
||||||
the compressed data
|
|
||||||
pages_compacted RO the number of pages freed during compaction
|
|
||||||
(available only via zram<id>/mm_stat node)
|
|
||||||
compact WO trigger memory compaction
|
compact WO trigger memory compaction
|
||||||
|
debug_stat RO this file is used for zram debugging purposes
|
||||||
|
backing_dev RW set up backend storage for zram to write out
|
||||||
|
|
||||||
WARNING
|
|
||||||
=======
|
|
||||||
per-stat sysfs attributes are considered to be deprecated.
|
|
||||||
The basic strategy is:
|
|
||||||
-- the existing RW nodes will be downgraded to WO nodes (in linux 4.11)
|
|
||||||
-- deprecated RO sysfs nodes will eventually be removed (in linux 4.11)
|
|
||||||
|
|
||||||
The list of deprecated attributes can be found here:
|
|
||||||
Documentation/ABI/obsolete/sysfs-block-zram
|
|
||||||
|
|
||||||
Basically, every attribute that has its own read accessible sysfs node
|
|
||||||
(e.g. num_reads) *AND* is accessible via one of the stat files (zram<id>/stat
|
|
||||||
or zram<id>/io_stat or zram<id>/mm_stat) is considered to be deprecated.
|
|
||||||
|
|
||||||
User space is advised to use the following files to read the device statistics.
|
User space is advised to use the following files to read the device statistics.
|
||||||
|
|
||||||
|
@ -211,22 +184,41 @@ The stat file represents device's I/O statistics not accounted by block
|
||||||
layer and, thus, not available in zram<id>/stat file. It consists of a
|
layer and, thus, not available in zram<id>/stat file. It consists of a
|
||||||
single line of text and contains the following stats separated by
|
single line of text and contains the following stats separated by
|
||||||
whitespace:
|
whitespace:
|
||||||
failed_reads
|
failed_reads the number of failed reads
|
||||||
failed_writes
|
failed_writes the number of failed writes
|
||||||
invalid_io
|
invalid_io the number of non-page-size-aligned I/O requests
|
||||||
notify_free
|
notify_free Depending on device usage scenario it may account
|
||||||
|
a) the number of pages freed because of swap slot free
|
||||||
|
notifications or b) the number of pages freed because of
|
||||||
|
REQ_DISCARD requests sent by bio. The former ones are
|
||||||
|
sent to a swap block device when a swap slot is freed,
|
||||||
|
which implies that this disk is being used as a swap disk.
|
||||||
|
The latter ones are sent by filesystem mounted with
|
||||||
|
discard option, whenever some data blocks are getting
|
||||||
|
discarded.
|
||||||
|
|
||||||
File /sys/block/zram<id>/mm_stat
|
File /sys/block/zram<id>/mm_stat
|
||||||
|
|
||||||
The stat file represents device's mm statistics. It consists of a single
|
The stat file represents device's mm statistics. It consists of a single
|
||||||
line of text and contains the following stats separated by whitespace:
|
line of text and contains the following stats separated by whitespace:
|
||||||
orig_data_size
|
orig_data_size uncompressed size of data stored in this disk.
|
||||||
compr_data_size
|
This excludes same-element-filled pages (same_pages) since
|
||||||
mem_used_total
|
no memory is allocated for them.
|
||||||
mem_limit
|
Unit: bytes
|
||||||
mem_used_max
|
compr_data_size compressed size of data stored in this disk
|
||||||
zero_pages
|
mem_used_total the amount of memory allocated for this disk. This
|
||||||
num_migrated
|
includes allocator fragmentation and metadata overhead,
|
||||||
|
allocated for this disk. So, allocator space efficiency
|
||||||
|
can be calculated using compr_data_size and this statistic.
|
||||||
|
Unit: bytes
|
||||||
|
mem_limit the maximum amount of memory ZRAM can use to store
|
||||||
|
the compressed data
|
||||||
|
mem_used_max the maximum amount of memory zram have consumed to
|
||||||
|
store the data
|
||||||
|
same_pages the number of same element filled pages written to this disk.
|
||||||
|
No memory is allocated for such pages.
|
||||||
|
pages_compacted the number of pages freed during compaction
|
||||||
|
huge_pages the number of incompressible pages
|
||||||
|
|
||||||
9) Deactivate:
|
9) Deactivate:
|
||||||
swapoff /dev/zram0
|
swapoff /dev/zram0
|
||||||
|
@ -241,5 +233,39 @@ line of text and contains the following stats separated by whitespace:
|
||||||
resets the disksize to zero. You must set the disksize again
|
resets the disksize to zero. You must set the disksize again
|
||||||
before reusing the device.
|
before reusing the device.
|
||||||
|
|
||||||
|
* Optional Feature
|
||||||
|
|
||||||
|
= writeback
|
||||||
|
|
||||||
|
With incompressible pages, there is no memory saving with zram.
|
||||||
|
Instead, with CONFIG_ZRAM_WRITEBACK, zram can write incompressible page
|
||||||
|
to backing storage rather than keeping it in memory.
|
||||||
|
User should set up backing device via /sys/block/zramX/backing_dev
|
||||||
|
before disksize setting.
|
||||||
|
|
||||||
|
= memory tracking
|
||||||
|
|
||||||
|
With CONFIG_ZRAM_MEMORY_TRACKING, user can know information of the
|
||||||
|
zram block. It could be useful to catch cold or incompressible
|
||||||
|
pages of the process with*pagemap.
|
||||||
|
If you enable the feature, you could see block state via
|
||||||
|
/sys/kernel/debug/zram/zram0/block_state". The output is as follows,
|
||||||
|
|
||||||
|
300 75.033841 .wh
|
||||||
|
301 63.806904 s..
|
||||||
|
302 63.806919 ..h
|
||||||
|
|
||||||
|
First column is zram's block index.
|
||||||
|
Second column is access time since the system was booted
|
||||||
|
Third column is state of the block.
|
||||||
|
(s: same page
|
||||||
|
w: written page to backing store
|
||||||
|
h: huge page)
|
||||||
|
|
||||||
|
First line of above example says 300th block is accessed at 75.033841sec
|
||||||
|
and the block's state is huge so it is written back to the backing
|
||||||
|
storage. It's a debugging feature so anyone shouldn't rely on it to work
|
||||||
|
properly.
|
||||||
|
|
||||||
Nitin Gupta
|
Nitin Gupta
|
||||||
ngupta@vflare.org
|
ngupta@vflare.org
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -1,6 +1,6 @@
|
||||||
VERSION = 4
|
VERSION = 4
|
||||||
PATCHLEVEL = 4
|
PATCHLEVEL = 4
|
||||||
SUBLEVEL = 150
|
SUBLEVEL = 153
|
||||||
EXTRAVERSION =
|
EXTRAVERSION =
|
||||||
NAME = Blurry Fish Butt
|
NAME = Blurry Fish Butt
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ endif
|
||||||
|
|
||||||
KBUILD_DEFCONFIG := nsim_700_defconfig
|
KBUILD_DEFCONFIG := nsim_700_defconfig
|
||||||
|
|
||||||
cflags-y += -fno-common -pipe -fno-builtin -D__linux__
|
cflags-y += -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__
|
||||||
cflags-$(CONFIG_ISA_ARCOMPACT) += -mA7
|
cflags-$(CONFIG_ISA_ARCOMPACT) += -mA7
|
||||||
cflags-$(CONFIG_ISA_ARCV2) += -mcpu=archs
|
cflags-$(CONFIG_ISA_ARCV2) += -mcpu=archs
|
||||||
|
|
||||||
|
@ -137,16 +137,3 @@ dtbs: scripts
|
||||||
|
|
||||||
archclean:
|
archclean:
|
||||||
$(Q)$(MAKE) $(clean)=$(boot)
|
$(Q)$(MAKE) $(clean)=$(boot)
|
||||||
|
|
||||||
# Hacks to enable final link due to absence of link-time branch relexation
|
|
||||||
# and gcc choosing optimal(shorter) branches at -O3
|
|
||||||
#
|
|
||||||
# vineetg Feb 2010: -mlong-calls switched off for overall kernel build
|
|
||||||
# However lib/decompress_inflate.o (.init.text) calls
|
|
||||||
# zlib_inflate_workspacesize (.text) causing relocation errors.
|
|
||||||
# Thus forcing all exten calls in this file to be long calls
|
|
||||||
export CFLAGS_decompress_inflate.o = -mmedium-calls
|
|
||||||
export CFLAGS_initramfs.o = -mmedium-calls
|
|
||||||
ifdef CONFIG_SMP
|
|
||||||
export CFLAGS_core.o = -mmedium-calls
|
|
||||||
endif
|
|
||||||
|
|
|
@ -34,9 +34,7 @@ struct machine_desc {
|
||||||
const char *name;
|
const char *name;
|
||||||
const char **dt_compat;
|
const char **dt_compat;
|
||||||
void (*init_early)(void);
|
void (*init_early)(void);
|
||||||
#ifdef CONFIG_SMP
|
|
||||||
void (*init_per_cpu)(unsigned int);
|
void (*init_per_cpu)(unsigned int);
|
||||||
#endif
|
|
||||||
void (*init_machine)(void);
|
void (*init_machine)(void);
|
||||||
void (*init_late)(void);
|
void (*init_late)(void);
|
||||||
|
|
||||||
|
|
|
@ -31,10 +31,10 @@ void __init init_IRQ(void)
|
||||||
/* a SMP H/w block could do IPI IRQ request here */
|
/* a SMP H/w block could do IPI IRQ request here */
|
||||||
if (plat_smp_ops.init_per_cpu)
|
if (plat_smp_ops.init_per_cpu)
|
||||||
plat_smp_ops.init_per_cpu(smp_processor_id());
|
plat_smp_ops.init_per_cpu(smp_processor_id());
|
||||||
|
#endif
|
||||||
|
|
||||||
if (machine_desc->init_per_cpu)
|
if (machine_desc->init_per_cpu)
|
||||||
machine_desc->init_per_cpu(smp_processor_id());
|
machine_desc->init_per_cpu(smp_processor_id());
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -74,6 +74,11 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Table Table 5-79 of the TRM shows 480ab000 is reserved */
|
||||||
|
&usb_otg_hs {
|
||||||
|
status = "disabled";
|
||||||
|
};
|
||||||
|
|
||||||
&iva {
|
&iva {
|
||||||
status = "disabled";
|
status = "disabled";
|
||||||
};
|
};
|
||||||
|
|
|
@ -508,6 +508,8 @@
|
||||||
|
|
||||||
touchscreen-size-x = <480>;
|
touchscreen-size-x = <480>;
|
||||||
touchscreen-size-y = <272>;
|
touchscreen-size-y = <272>;
|
||||||
|
|
||||||
|
wakeup-source;
|
||||||
};
|
};
|
||||||
|
|
||||||
tlv320aic3106: tlv320aic3106@1b {
|
tlv320aic3106: tlv320aic3106@1b {
|
||||||
|
|
|
@ -110,7 +110,7 @@
|
||||||
reg = <0x18008000 0x100>;
|
reg = <0x18008000 0x100>;
|
||||||
#address-cells = <1>;
|
#address-cells = <1>;
|
||||||
#size-cells = <0>;
|
#size-cells = <0>;
|
||||||
interrupts = <GIC_SPI 85 IRQ_TYPE_NONE>;
|
interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
|
||||||
clock-frequency = <100000>;
|
clock-frequency = <100000>;
|
||||||
status = "disabled";
|
status = "disabled";
|
||||||
};
|
};
|
||||||
|
@ -138,7 +138,7 @@
|
||||||
reg = <0x1800b000 0x100>;
|
reg = <0x1800b000 0x100>;
|
||||||
#address-cells = <1>;
|
#address-cells = <1>;
|
||||||
#size-cells = <0>;
|
#size-cells = <0>;
|
||||||
interrupts = <GIC_SPI 86 IRQ_TYPE_NONE>;
|
interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
|
||||||
clock-frequency = <100000>;
|
clock-frequency = <100000>;
|
||||||
status = "disabled";
|
status = "disabled";
|
||||||
};
|
};
|
||||||
|
|
|
@ -267,11 +267,7 @@
|
||||||
compatible = "ti,dm6441-gpio";
|
compatible = "ti,dm6441-gpio";
|
||||||
gpio-controller;
|
gpio-controller;
|
||||||
reg = <0x226000 0x1000>;
|
reg = <0x226000 0x1000>;
|
||||||
interrupts = <42 IRQ_TYPE_EDGE_BOTH
|
interrupts = <42 43 44 45 46 47 48 49 50>;
|
||||||
43 IRQ_TYPE_EDGE_BOTH 44 IRQ_TYPE_EDGE_BOTH
|
|
||||||
45 IRQ_TYPE_EDGE_BOTH 46 IRQ_TYPE_EDGE_BOTH
|
|
||||||
47 IRQ_TYPE_EDGE_BOTH 48 IRQ_TYPE_EDGE_BOTH
|
|
||||||
49 IRQ_TYPE_EDGE_BOTH 50 IRQ_TYPE_EDGE_BOTH>;
|
|
||||||
ti,ngpio = <144>;
|
ti,ngpio = <144>;
|
||||||
ti,davinci-gpio-unbanked = <0>;
|
ti,davinci-gpio-unbanked = <0>;
|
||||||
status = "disabled";
|
status = "disabled";
|
||||||
|
|
|
@ -145,9 +145,11 @@ CONFIG_USB_STORAGE=y
|
||||||
CONFIG_USB_CHIPIDEA=y
|
CONFIG_USB_CHIPIDEA=y
|
||||||
CONFIG_USB_CHIPIDEA_UDC=y
|
CONFIG_USB_CHIPIDEA_UDC=y
|
||||||
CONFIG_USB_CHIPIDEA_HOST=y
|
CONFIG_USB_CHIPIDEA_HOST=y
|
||||||
|
CONFIG_USB_CHIPIDEA_ULPI=y
|
||||||
CONFIG_NOP_USB_XCEIV=y
|
CONFIG_NOP_USB_XCEIV=y
|
||||||
CONFIG_USB_GADGET=y
|
CONFIG_USB_GADGET=y
|
||||||
CONFIG_USB_ETH=m
|
CONFIG_USB_ETH=m
|
||||||
|
CONFIG_USB_ULPI_BUS=y
|
||||||
CONFIG_MMC=y
|
CONFIG_MMC=y
|
||||||
CONFIG_MMC_SDHCI=y
|
CONFIG_MMC_SDHCI=y
|
||||||
CONFIG_MMC_SDHCI_PLTFM=y
|
CONFIG_MMC_SDHCI_PLTFM=y
|
||||||
|
|
|
@ -261,6 +261,7 @@ CONFIG_USB_STORAGE=y
|
||||||
CONFIG_USB_CHIPIDEA=y
|
CONFIG_USB_CHIPIDEA=y
|
||||||
CONFIG_USB_CHIPIDEA_UDC=y
|
CONFIG_USB_CHIPIDEA_UDC=y
|
||||||
CONFIG_USB_CHIPIDEA_HOST=y
|
CONFIG_USB_CHIPIDEA_HOST=y
|
||||||
|
CONFIG_USB_CHIPIDEA_ULPI=y
|
||||||
CONFIG_USB_SERIAL=m
|
CONFIG_USB_SERIAL=m
|
||||||
CONFIG_USB_SERIAL_GENERIC=y
|
CONFIG_USB_SERIAL_GENERIC=y
|
||||||
CONFIG_USB_SERIAL_FTDI_SIO=m
|
CONFIG_USB_SERIAL_FTDI_SIO=m
|
||||||
|
@ -287,6 +288,7 @@ CONFIG_USB_G_NCM=m
|
||||||
CONFIG_USB_GADGETFS=m
|
CONFIG_USB_GADGETFS=m
|
||||||
CONFIG_USB_MASS_STORAGE=m
|
CONFIG_USB_MASS_STORAGE=m
|
||||||
CONFIG_USB_G_SERIAL=m
|
CONFIG_USB_G_SERIAL=m
|
||||||
|
CONFIG_USB_ULPI_BUS=y
|
||||||
CONFIG_MMC=y
|
CONFIG_MMC=y
|
||||||
CONFIG_MMC_SDHCI=y
|
CONFIG_MMC_SDHCI=y
|
||||||
CONFIG_MMC_SDHCI_PLTFM=y
|
CONFIG_MMC_SDHCI_PLTFM=y
|
||||||
|
|
|
@ -185,7 +185,7 @@ static int pxa_irq_suspend(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < pxa_internal_irq_nr / 32; i++) {
|
for (i = 0; i < DIV_ROUND_UP(pxa_internal_irq_nr, 32); i++) {
|
||||||
void __iomem *base = irq_base(i);
|
void __iomem *base = irq_base(i);
|
||||||
|
|
||||||
saved_icmr[i] = __raw_readl(base + ICMR);
|
saved_icmr[i] = __raw_readl(base + ICMR);
|
||||||
|
@ -204,7 +204,7 @@ static void pxa_irq_resume(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < pxa_internal_irq_nr / 32; i++) {
|
for (i = 0; i < DIV_ROUND_UP(pxa_internal_irq_nr, 32); i++) {
|
||||||
void __iomem *base = irq_base(i);
|
void __iomem *base = irq_base(i);
|
||||||
|
|
||||||
__raw_writel(saved_icmr[i], base + ICMR);
|
__raw_writel(saved_icmr[i], base + ICMR);
|
||||||
|
|
|
@ -815,19 +815,28 @@ int __mark_rodata_ro(void *unused)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int kernel_set_to_readonly __read_mostly;
|
||||||
|
|
||||||
void mark_rodata_ro(void)
|
void mark_rodata_ro(void)
|
||||||
{
|
{
|
||||||
|
kernel_set_to_readonly = 1;
|
||||||
stop_machine(__mark_rodata_ro, NULL, NULL);
|
stop_machine(__mark_rodata_ro, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_kernel_text_rw(void)
|
void set_kernel_text_rw(void)
|
||||||
{
|
{
|
||||||
|
if (!kernel_set_to_readonly)
|
||||||
|
return;
|
||||||
|
|
||||||
set_section_perms(ro_perms, ARRAY_SIZE(ro_perms), false,
|
set_section_perms(ro_perms, ARRAY_SIZE(ro_perms), false,
|
||||||
current->active_mm);
|
current->active_mm);
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_kernel_text_ro(void)
|
void set_kernel_text_ro(void)
|
||||||
{
|
{
|
||||||
|
if (!kernel_set_to_readonly)
|
||||||
|
return;
|
||||||
|
|
||||||
set_section_perms(ro_perms, ARRAY_SIZE(ro_perms), true,
|
set_section_perms(ro_perms, ARRAY_SIZE(ro_perms), true,
|
||||||
current->active_mm);
|
current->active_mm);
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,7 +144,7 @@ static void smp_store_cpu_info(unsigned int cpuid)
|
||||||
* This is the secondary CPU boot entry. We're using this CPUs
|
* This is the secondary CPU boot entry. We're using this CPUs
|
||||||
* idle thread stack, but a set of temporary page tables.
|
* idle thread stack, but a set of temporary page tables.
|
||||||
*/
|
*/
|
||||||
asmlinkage void secondary_start_kernel(void)
|
asmlinkage notrace void secondary_start_kernel(void)
|
||||||
{
|
{
|
||||||
struct mm_struct *mm = &init_mm;
|
struct mm_struct *mm = &init_mm;
|
||||||
unsigned int cpu;
|
unsigned int cpu;
|
||||||
|
|
|
@ -43,6 +43,7 @@ extern inline pmd_t *pmd_alloc_kernel(pgd_t *pgd, unsigned long address)
|
||||||
static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t page,
|
static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t page,
|
||||||
unsigned long address)
|
unsigned long address)
|
||||||
{
|
{
|
||||||
|
pgtable_page_dtor(page);
|
||||||
__free_page(page);
|
__free_page(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,8 +74,9 @@ static inline struct page *pte_alloc_one(struct mm_struct *mm,
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern inline void pte_free(struct mm_struct *mm, struct page *page)
|
static inline void pte_free(struct mm_struct *mm, struct page *page)
|
||||||
{
|
{
|
||||||
|
pgtable_page_dtor(page);
|
||||||
__free_page(page);
|
__free_page(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,6 @@ static inline void arch_spin_lock_flags(arch_spinlock_t *x,
|
||||||
{
|
{
|
||||||
volatile unsigned int *a;
|
volatile unsigned int *a;
|
||||||
|
|
||||||
mb();
|
|
||||||
a = __ldcw_align(x);
|
a = __ldcw_align(x);
|
||||||
while (__ldcw(a) == 0)
|
while (__ldcw(a) == 0)
|
||||||
while (*a == 0)
|
while (*a == 0)
|
||||||
|
@ -31,16 +30,15 @@ static inline void arch_spin_lock_flags(arch_spinlock_t *x,
|
||||||
local_irq_disable();
|
local_irq_disable();
|
||||||
} else
|
} else
|
||||||
cpu_relax();
|
cpu_relax();
|
||||||
mb();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void arch_spin_unlock(arch_spinlock_t *x)
|
static inline void arch_spin_unlock(arch_spinlock_t *x)
|
||||||
{
|
{
|
||||||
volatile unsigned int *a;
|
volatile unsigned int *a;
|
||||||
mb();
|
|
||||||
a = __ldcw_align(x);
|
a = __ldcw_align(x);
|
||||||
*a = 1;
|
|
||||||
mb();
|
mb();
|
||||||
|
*a = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int arch_spin_trylock(arch_spinlock_t *x)
|
static inline int arch_spin_trylock(arch_spinlock_t *x)
|
||||||
|
@ -48,10 +46,8 @@ static inline int arch_spin_trylock(arch_spinlock_t *x)
|
||||||
volatile unsigned int *a;
|
volatile unsigned int *a;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
mb();
|
|
||||||
a = __ldcw_align(x);
|
a = __ldcw_align(x);
|
||||||
ret = __ldcw(a) != 0;
|
ret = __ldcw(a) != 0;
|
||||||
mb();
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -627,12 +627,12 @@ cas_action:
|
||||||
stw %r1, 4(%sr2,%r20)
|
stw %r1, 4(%sr2,%r20)
|
||||||
#endif
|
#endif
|
||||||
/* The load and store could fail */
|
/* The load and store could fail */
|
||||||
1: ldw,ma 0(%r26), %r28
|
1: ldw 0(%r26), %r28
|
||||||
sub,<> %r28, %r25, %r0
|
sub,<> %r28, %r25, %r0
|
||||||
2: stw,ma %r24, 0(%r26)
|
2: stw %r24, 0(%r26)
|
||||||
/* Free lock */
|
/* Free lock */
|
||||||
sync
|
sync
|
||||||
stw,ma %r20, 0(%sr2,%r20)
|
stw %r20, 0(%sr2,%r20)
|
||||||
#if ENABLE_LWS_DEBUG
|
#if ENABLE_LWS_DEBUG
|
||||||
/* Clear thread register indicator */
|
/* Clear thread register indicator */
|
||||||
stw %r0, 4(%sr2,%r20)
|
stw %r0, 4(%sr2,%r20)
|
||||||
|
@ -796,30 +796,30 @@ cas2_action:
|
||||||
ldo 1(%r0),%r28
|
ldo 1(%r0),%r28
|
||||||
|
|
||||||
/* 8bit CAS */
|
/* 8bit CAS */
|
||||||
13: ldb,ma 0(%r26), %r29
|
13: ldb 0(%r26), %r29
|
||||||
sub,= %r29, %r25, %r0
|
sub,= %r29, %r25, %r0
|
||||||
b,n cas2_end
|
b,n cas2_end
|
||||||
14: stb,ma %r24, 0(%r26)
|
14: stb %r24, 0(%r26)
|
||||||
b cas2_end
|
b cas2_end
|
||||||
copy %r0, %r28
|
copy %r0, %r28
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
|
|
||||||
/* 16bit CAS */
|
/* 16bit CAS */
|
||||||
15: ldh,ma 0(%r26), %r29
|
15: ldh 0(%r26), %r29
|
||||||
sub,= %r29, %r25, %r0
|
sub,= %r29, %r25, %r0
|
||||||
b,n cas2_end
|
b,n cas2_end
|
||||||
16: sth,ma %r24, 0(%r26)
|
16: sth %r24, 0(%r26)
|
||||||
b cas2_end
|
b cas2_end
|
||||||
copy %r0, %r28
|
copy %r0, %r28
|
||||||
nop
|
nop
|
||||||
nop
|
nop
|
||||||
|
|
||||||
/* 32bit CAS */
|
/* 32bit CAS */
|
||||||
17: ldw,ma 0(%r26), %r29
|
17: ldw 0(%r26), %r29
|
||||||
sub,= %r29, %r25, %r0
|
sub,= %r29, %r25, %r0
|
||||||
b,n cas2_end
|
b,n cas2_end
|
||||||
18: stw,ma %r24, 0(%r26)
|
18: stw %r24, 0(%r26)
|
||||||
b cas2_end
|
b cas2_end
|
||||||
copy %r0, %r28
|
copy %r0, %r28
|
||||||
nop
|
nop
|
||||||
|
@ -827,10 +827,10 @@ cas2_action:
|
||||||
|
|
||||||
/* 64bit CAS */
|
/* 64bit CAS */
|
||||||
#ifdef CONFIG_64BIT
|
#ifdef CONFIG_64BIT
|
||||||
19: ldd,ma 0(%r26), %r29
|
19: ldd 0(%r26), %r29
|
||||||
sub,*= %r29, %r25, %r0
|
sub,*= %r29, %r25, %r0
|
||||||
b,n cas2_end
|
b,n cas2_end
|
||||||
20: std,ma %r24, 0(%r26)
|
20: std %r24, 0(%r26)
|
||||||
copy %r0, %r28
|
copy %r0, %r28
|
||||||
#else
|
#else
|
||||||
/* Compare first word */
|
/* Compare first word */
|
||||||
|
@ -849,7 +849,7 @@ cas2_action:
|
||||||
cas2_end:
|
cas2_end:
|
||||||
/* Free lock */
|
/* Free lock */
|
||||||
sync
|
sync
|
||||||
stw,ma %r20, 0(%sr2,%r20)
|
stw %r20, 0(%sr2,%r20)
|
||||||
/* Enable interrupts */
|
/* Enable interrupts */
|
||||||
ssm PSW_SM_I, %r0
|
ssm PSW_SM_I, %r0
|
||||||
/* Return to userspace, set no error */
|
/* Return to userspace, set no error */
|
||||||
|
|
|
@ -48,6 +48,7 @@ CONFIG_X86_CPUID=y
|
||||||
CONFIG_KSM=y
|
CONFIG_KSM=y
|
||||||
CONFIG_DEFAULT_MMAP_MIN_ADDR=65536
|
CONFIG_DEFAULT_MMAP_MIN_ADDR=65536
|
||||||
CONFIG_TRANSPARENT_HUGEPAGE=y
|
CONFIG_TRANSPARENT_HUGEPAGE=y
|
||||||
|
CONFIG_ZSMALLOC=y
|
||||||
# CONFIG_MTRR is not set
|
# CONFIG_MTRR is not set
|
||||||
CONFIG_HZ_100=y
|
CONFIG_HZ_100=y
|
||||||
CONFIG_KEXEC=y
|
CONFIG_KEXEC=y
|
||||||
|
@ -199,6 +200,7 @@ CONFIG_DEBUG_DEVRES=y
|
||||||
CONFIG_OF=y
|
CONFIG_OF=y
|
||||||
CONFIG_OF_UNITTEST=y
|
CONFIG_OF_UNITTEST=y
|
||||||
# CONFIG_PNP_DEBUG_MESSAGES is not set
|
# CONFIG_PNP_DEBUG_MESSAGES is not set
|
||||||
|
CONFIG_ZRAM=y
|
||||||
CONFIG_BLK_DEV_LOOP=y
|
CONFIG_BLK_DEV_LOOP=y
|
||||||
CONFIG_BLK_DEV_RAM=y
|
CONFIG_BLK_DEV_RAM=y
|
||||||
CONFIG_BLK_DEV_RAM_SIZE=8192
|
CONFIG_BLK_DEV_RAM_SIZE=8192
|
||||||
|
@ -449,8 +451,9 @@ CONFIG_HARDENED_USERCOPY=y
|
||||||
CONFIG_SECURITY_SELINUX=y
|
CONFIG_SECURITY_SELINUX=y
|
||||||
CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
|
CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE=1
|
||||||
# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
|
# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
|
||||||
CONFIG_CRYPTO_ECHAINIV=y
|
|
||||||
CONFIG_CRYPTO_SHA512=y
|
CONFIG_CRYPTO_SHA512=y
|
||||||
|
CONFIG_CRYPTO_LZ4=y
|
||||||
|
CONFIG_CRYPTO_ZSTD=y
|
||||||
CONFIG_ASYMMETRIC_KEY_TYPE=y
|
CONFIG_ASYMMETRIC_KEY_TYPE=y
|
||||||
CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
|
CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=y
|
||||||
CONFIG_X509_CERTIFICATE_PARSER=y
|
CONFIG_X509_CERTIFICATE_PARSER=y
|
||||||
|
|
|
@ -109,8 +109,7 @@ static inline int init_new_context(struct task_struct *tsk,
|
||||||
struct mm_struct *mm)
|
struct mm_struct *mm)
|
||||||
{
|
{
|
||||||
mm->context.ctx_id = atomic64_inc_return(&last_mm_ctx_id);
|
mm->context.ctx_id = atomic64_inc_return(&last_mm_ctx_id);
|
||||||
init_new_context_ldt(tsk, mm);
|
return init_new_context_ldt(tsk, mm);
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
static inline void destroy_context(struct mm_struct *mm)
|
static inline void destroy_context(struct mm_struct *mm)
|
||||||
{
|
{
|
||||||
|
|
|
@ -173,6 +173,11 @@ static inline unsigned long pud_pfn(pud_t pud)
|
||||||
return (pfn & pud_pfn_mask(pud)) >> PAGE_SHIFT;
|
return (pfn & pud_pfn_mask(pud)) >> PAGE_SHIFT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline unsigned long pgd_pfn(pgd_t pgd)
|
||||||
|
{
|
||||||
|
return (pgd_val(pgd) & PTE_PFN_MASK) >> PAGE_SHIFT;
|
||||||
|
}
|
||||||
|
|
||||||
#define pte_page(pte) pfn_to_page(pte_pfn(pte))
|
#define pte_page(pte) pfn_to_page(pte_pfn(pte))
|
||||||
|
|
||||||
static inline int pmd_large(pmd_t pte)
|
static inline int pmd_large(pmd_t pte)
|
||||||
|
@ -578,8 +583,7 @@ static inline unsigned long pmd_page_vaddr(pmd_t pmd)
|
||||||
* Currently stuck as a macro due to indirect forward reference to
|
* Currently stuck as a macro due to indirect forward reference to
|
||||||
* linux/mmzone.h's __section_mem_map_addr() definition:
|
* linux/mmzone.h's __section_mem_map_addr() definition:
|
||||||
*/
|
*/
|
||||||
#define pmd_page(pmd) \
|
#define pmd_page(pmd) pfn_to_page(pmd_pfn(pmd))
|
||||||
pfn_to_page((pmd_val(pmd) & pmd_pfn_mask(pmd)) >> PAGE_SHIFT)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* the pmd page can be thought of an array like this: pmd_t[PTRS_PER_PMD]
|
* the pmd page can be thought of an array like this: pmd_t[PTRS_PER_PMD]
|
||||||
|
@ -647,8 +651,7 @@ static inline unsigned long pud_page_vaddr(pud_t pud)
|
||||||
* Currently stuck as a macro due to indirect forward reference to
|
* Currently stuck as a macro due to indirect forward reference to
|
||||||
* linux/mmzone.h's __section_mem_map_addr() definition:
|
* linux/mmzone.h's __section_mem_map_addr() definition:
|
||||||
*/
|
*/
|
||||||
#define pud_page(pud) \
|
#define pud_page(pud) pfn_to_page(pud_pfn(pud))
|
||||||
pfn_to_page((pud_val(pud) & pud_pfn_mask(pud)) >> PAGE_SHIFT)
|
|
||||||
|
|
||||||
/* Find an entry in the second-level page table.. */
|
/* Find an entry in the second-level page table.. */
|
||||||
static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
|
static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
|
||||||
|
@ -688,7 +691,7 @@ static inline unsigned long pgd_page_vaddr(pgd_t pgd)
|
||||||
* Currently stuck as a macro due to indirect forward reference to
|
* Currently stuck as a macro due to indirect forward reference to
|
||||||
* linux/mmzone.h's __section_mem_map_addr() definition:
|
* linux/mmzone.h's __section_mem_map_addr() definition:
|
||||||
*/
|
*/
|
||||||
#define pgd_page(pgd) pfn_to_page(pgd_val(pgd) >> PAGE_SHIFT)
|
#define pgd_page(pgd) pfn_to_page(pgd_pfn(pgd))
|
||||||
|
|
||||||
/* to find an entry in a page-table-directory. */
|
/* to find an entry in a page-table-directory. */
|
||||||
static inline unsigned long pud_index(unsigned long address)
|
static inline unsigned long pud_index(unsigned long address)
|
||||||
|
|
|
@ -1006,7 +1006,7 @@ static int populate_pmd(struct cpa_data *cpa,
|
||||||
|
|
||||||
pmd = pmd_offset(pud, start);
|
pmd = pmd_offset(pud, start);
|
||||||
|
|
||||||
set_pmd(pmd, pmd_mkhuge(pfn_pmd(cpa->pfn,
|
set_pmd(pmd, pmd_mkhuge(pfn_pmd(cpa->pfn >> PAGE_SHIFT,
|
||||||
canon_pgprot(pmd_pgprot))));
|
canon_pgprot(pmd_pgprot))));
|
||||||
|
|
||||||
start += PMD_SIZE;
|
start += PMD_SIZE;
|
||||||
|
|
|
@ -1577,6 +1577,15 @@ config CRYPTO_LZ4HC
|
||||||
help
|
help
|
||||||
This is the LZ4 high compression mode algorithm.
|
This is the LZ4 high compression mode algorithm.
|
||||||
|
|
||||||
|
config CRYPTO_ZSTD
|
||||||
|
tristate "Zstd compression algorithm"
|
||||||
|
select CRYPTO_ALGAPI
|
||||||
|
select CRYPTO_ACOMP2
|
||||||
|
select ZSTD_COMPRESS
|
||||||
|
select ZSTD_DECOMPRESS
|
||||||
|
help
|
||||||
|
This is the zstd algorithm.
|
||||||
|
|
||||||
comment "Random Number Generation"
|
comment "Random Number Generation"
|
||||||
|
|
||||||
config CRYPTO_ANSI_CPRNG
|
config CRYPTO_ANSI_CPRNG
|
||||||
|
|
|
@ -126,6 +126,7 @@ obj-$(CONFIG_CRYPTO_USER_API_HASH) += algif_hash.o
|
||||||
obj-$(CONFIG_CRYPTO_USER_API_SKCIPHER) += algif_skcipher.o
|
obj-$(CONFIG_CRYPTO_USER_API_SKCIPHER) += algif_skcipher.o
|
||||||
obj-$(CONFIG_CRYPTO_USER_API_RNG) += algif_rng.o
|
obj-$(CONFIG_CRYPTO_USER_API_RNG) += algif_rng.o
|
||||||
obj-$(CONFIG_CRYPTO_USER_API_AEAD) += algif_aead.o
|
obj-$(CONFIG_CRYPTO_USER_API_AEAD) += algif_aead.o
|
||||||
|
obj-$(CONFIG_CRYPTO_ZSTD) += zstd.o
|
||||||
|
|
||||||
#
|
#
|
||||||
# generic algorithms and the async_tx api
|
# generic algorithms and the async_tx api
|
||||||
|
|
|
@ -3949,6 +3949,22 @@ static const struct alg_test_desc alg_test_descs[] = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
.alg = "zstd",
|
||||||
|
.test = alg_test_comp,
|
||||||
|
.fips_allowed = 1,
|
||||||
|
.suite = {
|
||||||
|
.comp = {
|
||||||
|
.comp = {
|
||||||
|
.vecs = zstd_comp_tv_template,
|
||||||
|
.count = ZSTD_COMP_TEST_VECTORS
|
||||||
|
},
|
||||||
|
.decomp = {
|
||||||
|
.vecs = zstd_decomp_tv_template,
|
||||||
|
.count = ZSTD_DECOMP_TEST_VECTORS
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -35331,4 +35331,78 @@ static struct comp_testvec lz4hc_decomp_tv_template[] = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define ZSTD_COMP_TEST_VECTORS 2
|
||||||
|
#define ZSTD_DECOMP_TEST_VECTORS 2
|
||||||
|
|
||||||
|
static struct comp_testvec zstd_comp_tv_template[] = {
|
||||||
|
{
|
||||||
|
.inlen = 68,
|
||||||
|
.outlen = 39,
|
||||||
|
.input = "The algorithm is zstd. "
|
||||||
|
"The algorithm is zstd. "
|
||||||
|
"The algorithm is zstd.",
|
||||||
|
.output = "\x28\xb5\x2f\xfd\x00\x50\xf5\x00\x00\xb8\x54\x68\x65"
|
||||||
|
"\x20\x61\x6c\x67\x6f\x72\x69\x74\x68\x6d\x20\x69\x73"
|
||||||
|
"\x20\x7a\x73\x74\x64\x2e\x20\x01\x00\x55\x73\x36\x01"
|
||||||
|
,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.inlen = 244,
|
||||||
|
.outlen = 151,
|
||||||
|
.input = "zstd, short for Zstandard, is a fast lossless "
|
||||||
|
"compression algorithm, targeting real-time "
|
||||||
|
"compression scenarios at zlib-level and better "
|
||||||
|
"compression ratios. The zstd compression library "
|
||||||
|
"provides in-memory compression and decompression "
|
||||||
|
"functions.",
|
||||||
|
.output = "\x28\xb5\x2f\xfd\x00\x50\x75\x04\x00\x42\x4b\x1e\x17"
|
||||||
|
"\x90\x81\x31\x00\xf2\x2f\xe4\x36\xc9\xef\x92\x88\x32"
|
||||||
|
"\xc9\xf2\x24\x94\xd8\x68\x9a\x0f\x00\x0c\xc4\x31\x6f"
|
||||||
|
"\x0d\x0c\x38\xac\x5c\x48\x03\xcd\x63\x67\xc0\xf3\xad"
|
||||||
|
"\x4e\x90\xaa\x78\xa0\xa4\xc5\x99\xda\x2f\xb6\x24\x60"
|
||||||
|
"\xe2\x79\x4b\xaa\xb6\x6b\x85\x0b\xc9\xc6\x04\x66\x86"
|
||||||
|
"\xe2\xcc\xe2\x25\x3f\x4f\x09\xcd\xb8\x9d\xdb\xc1\x90"
|
||||||
|
"\xa9\x11\xbc\x35\x44\x69\x2d\x9c\x64\x4f\x13\x31\x64"
|
||||||
|
"\xcc\xfb\x4d\x95\x93\x86\x7f\x33\x7f\x1a\xef\xe9\x30"
|
||||||
|
"\xf9\x67\xa1\x94\x0a\x69\x0f\x60\xcd\xc3\xab\x99\xdc"
|
||||||
|
"\x42\xed\x97\x05\x00\x33\xc3\x15\x95\x3a\x06\xa0\x0e"
|
||||||
|
"\x20\xa9\x0e\x82\xb9\x43\x45\x01",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct comp_testvec zstd_decomp_tv_template[] = {
|
||||||
|
{
|
||||||
|
.inlen = 43,
|
||||||
|
.outlen = 68,
|
||||||
|
.input = "\x28\xb5\x2f\xfd\x04\x50\xf5\x00\x00\xb8\x54\x68\x65"
|
||||||
|
"\x20\x61\x6c\x67\x6f\x72\x69\x74\x68\x6d\x20\x69\x73"
|
||||||
|
"\x20\x7a\x73\x74\x64\x2e\x20\x01\x00\x55\x73\x36\x01"
|
||||||
|
"\x6b\xf4\x13\x35",
|
||||||
|
.output = "The algorithm is zstd. "
|
||||||
|
"The algorithm is zstd. "
|
||||||
|
"The algorithm is zstd.",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.inlen = 155,
|
||||||
|
.outlen = 244,
|
||||||
|
.input = "\x28\xb5\x2f\xfd\x04\x50\x75\x04\x00\x42\x4b\x1e\x17"
|
||||||
|
"\x90\x81\x31\x00\xf2\x2f\xe4\x36\xc9\xef\x92\x88\x32"
|
||||||
|
"\xc9\xf2\x24\x94\xd8\x68\x9a\x0f\x00\x0c\xc4\x31\x6f"
|
||||||
|
"\x0d\x0c\x38\xac\x5c\x48\x03\xcd\x63\x67\xc0\xf3\xad"
|
||||||
|
"\x4e\x90\xaa\x78\xa0\xa4\xc5\x99\xda\x2f\xb6\x24\x60"
|
||||||
|
"\xe2\x79\x4b\xaa\xb6\x6b\x85\x0b\xc9\xc6\x04\x66\x86"
|
||||||
|
"\xe2\xcc\xe2\x25\x3f\x4f\x09\xcd\xb8\x9d\xdb\xc1\x90"
|
||||||
|
"\xa9\x11\xbc\x35\x44\x69\x2d\x9c\x64\x4f\x13\x31\x64"
|
||||||
|
"\xcc\xfb\x4d\x95\x93\x86\x7f\x33\x7f\x1a\xef\xe9\x30"
|
||||||
|
"\xf9\x67\xa1\x94\x0a\x69\x0f\x60\xcd\xc3\xab\x99\xdc"
|
||||||
|
"\x42\xed\x97\x05\x00\x33\xc3\x15\x95\x3a\x06\xa0\x0e"
|
||||||
|
"\x20\xa9\x0e\x82\xb9\x43\x45\x01\xaa\x6d\xda\x0d",
|
||||||
|
.output = "zstd, short for Zstandard, is a fast lossless "
|
||||||
|
"compression algorithm, targeting real-time "
|
||||||
|
"compression scenarios at zlib-level and better "
|
||||||
|
"compression ratios. The zstd compression library "
|
||||||
|
"provides in-memory compression and decompression "
|
||||||
|
"functions.",
|
||||||
|
},
|
||||||
|
};
|
||||||
#endif /* _CRYPTO_TESTMGR_H */
|
#endif /* _CRYPTO_TESTMGR_H */
|
||||||
|
|
209
crypto/zstd.c
Normal file
209
crypto/zstd.c
Normal file
|
@ -0,0 +1,209 @@
|
||||||
|
/*
|
||||||
|
* Cryptographic API.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2017-present, Facebook, Inc.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 as published by
|
||||||
|
* the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||||
|
* more details.
|
||||||
|
*/
|
||||||
|
#include <linux/crypto.h>
|
||||||
|
#include <linux/init.h>
|
||||||
|
#include <linux/interrupt.h>
|
||||||
|
#include <linux/mm.h>
|
||||||
|
#include <linux/module.h>
|
||||||
|
#include <linux/net.h>
|
||||||
|
#include <linux/vmalloc.h>
|
||||||
|
#include <linux/zstd.h>
|
||||||
|
|
||||||
|
|
||||||
|
#define ZSTD_DEF_LEVEL 3
|
||||||
|
|
||||||
|
struct zstd_ctx {
|
||||||
|
ZSTD_CCtx *cctx;
|
||||||
|
ZSTD_DCtx *dctx;
|
||||||
|
void *cwksp;
|
||||||
|
void *dwksp;
|
||||||
|
};
|
||||||
|
|
||||||
|
static ZSTD_parameters zstd_params(void)
|
||||||
|
{
|
||||||
|
return ZSTD_getParams(ZSTD_DEF_LEVEL, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int zstd_comp_init(struct zstd_ctx *ctx)
|
||||||
|
{
|
||||||
|
int ret = 0;
|
||||||
|
const ZSTD_parameters params = zstd_params();
|
||||||
|
const size_t wksp_size = ZSTD_CCtxWorkspaceBound(params.cParams);
|
||||||
|
|
||||||
|
ctx->cwksp = vzalloc(wksp_size);
|
||||||
|
if (!ctx->cwksp) {
|
||||||
|
ret = -ENOMEM;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx->cctx = ZSTD_initCCtx(ctx->cwksp, wksp_size);
|
||||||
|
if (!ctx->cctx) {
|
||||||
|
ret = -EINVAL;
|
||||||
|
goto out_free;
|
||||||
|
}
|
||||||
|
out:
|
||||||
|
return ret;
|
||||||
|
out_free:
|
||||||
|
vfree(ctx->cwksp);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int zstd_decomp_init(struct zstd_ctx *ctx)
|
||||||
|
{
|
||||||
|
int ret = 0;
|
||||||
|
const size_t wksp_size = ZSTD_DCtxWorkspaceBound();
|
||||||
|
|
||||||
|
ctx->dwksp = vzalloc(wksp_size);
|
||||||
|
if (!ctx->dwksp) {
|
||||||
|
ret = -ENOMEM;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx->dctx = ZSTD_initDCtx(ctx->dwksp, wksp_size);
|
||||||
|
if (!ctx->dctx) {
|
||||||
|
ret = -EINVAL;
|
||||||
|
goto out_free;
|
||||||
|
}
|
||||||
|
out:
|
||||||
|
return ret;
|
||||||
|
out_free:
|
||||||
|
vfree(ctx->dwksp);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void zstd_comp_exit(struct zstd_ctx *ctx)
|
||||||
|
{
|
||||||
|
vfree(ctx->cwksp);
|
||||||
|
ctx->cwksp = NULL;
|
||||||
|
ctx->cctx = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void zstd_decomp_exit(struct zstd_ctx *ctx)
|
||||||
|
{
|
||||||
|
vfree(ctx->dwksp);
|
||||||
|
ctx->dwksp = NULL;
|
||||||
|
ctx->dctx = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int __zstd_init(void *ctx)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = zstd_comp_init(ctx);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
ret = zstd_decomp_init(ctx);
|
||||||
|
if (ret)
|
||||||
|
zstd_comp_exit(ctx);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int zstd_init(struct crypto_tfm *tfm)
|
||||||
|
{
|
||||||
|
struct zstd_ctx *ctx = crypto_tfm_ctx(tfm);
|
||||||
|
|
||||||
|
return __zstd_init(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void __zstd_exit(void *ctx)
|
||||||
|
{
|
||||||
|
zstd_comp_exit(ctx);
|
||||||
|
zstd_decomp_exit(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void zstd_exit(struct crypto_tfm *tfm)
|
||||||
|
{
|
||||||
|
struct zstd_ctx *ctx = crypto_tfm_ctx(tfm);
|
||||||
|
|
||||||
|
__zstd_exit(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int __zstd_compress(const u8 *src, unsigned int slen,
|
||||||
|
u8 *dst, unsigned int *dlen, void *ctx)
|
||||||
|
{
|
||||||
|
size_t out_len;
|
||||||
|
struct zstd_ctx *zctx = ctx;
|
||||||
|
const ZSTD_parameters params = zstd_params();
|
||||||
|
|
||||||
|
out_len = ZSTD_compressCCtx(zctx->cctx, dst, *dlen, src, slen, params);
|
||||||
|
if (ZSTD_isError(out_len))
|
||||||
|
return -EINVAL;
|
||||||
|
*dlen = out_len;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int zstd_compress(struct crypto_tfm *tfm, const u8 *src,
|
||||||
|
unsigned int slen, u8 *dst, unsigned int *dlen)
|
||||||
|
{
|
||||||
|
struct zstd_ctx *ctx = crypto_tfm_ctx(tfm);
|
||||||
|
|
||||||
|
return __zstd_compress(src, slen, dst, dlen, ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int __zstd_decompress(const u8 *src, unsigned int slen,
|
||||||
|
u8 *dst, unsigned int *dlen, void *ctx)
|
||||||
|
{
|
||||||
|
size_t out_len;
|
||||||
|
struct zstd_ctx *zctx = ctx;
|
||||||
|
|
||||||
|
out_len = ZSTD_decompressDCtx(zctx->dctx, dst, *dlen, src, slen);
|
||||||
|
if (ZSTD_isError(out_len))
|
||||||
|
return -EINVAL;
|
||||||
|
*dlen = out_len;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int zstd_decompress(struct crypto_tfm *tfm, const u8 *src,
|
||||||
|
unsigned int slen, u8 *dst, unsigned int *dlen)
|
||||||
|
{
|
||||||
|
struct zstd_ctx *ctx = crypto_tfm_ctx(tfm);
|
||||||
|
|
||||||
|
return __zstd_decompress(src, slen, dst, dlen, ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct crypto_alg alg = {
|
||||||
|
.cra_name = "zstd",
|
||||||
|
.cra_flags = CRYPTO_ALG_TYPE_COMPRESS,
|
||||||
|
.cra_ctxsize = sizeof(struct zstd_ctx),
|
||||||
|
.cra_module = THIS_MODULE,
|
||||||
|
.cra_init = zstd_init,
|
||||||
|
.cra_exit = zstd_exit,
|
||||||
|
.cra_u = { .compress = {
|
||||||
|
.coa_compress = zstd_compress,
|
||||||
|
.coa_decompress = zstd_decompress } }
|
||||||
|
};
|
||||||
|
|
||||||
|
static int __init zstd_mod_init(void)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = crypto_register_alg(&alg);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void __exit zstd_mod_fini(void)
|
||||||
|
{
|
||||||
|
crypto_unregister_alg(&alg);
|
||||||
|
}
|
||||||
|
|
||||||
|
module_init(zstd_mod_init);
|
||||||
|
module_exit(zstd_mod_fini);
|
||||||
|
|
||||||
|
MODULE_LICENSE("GPL");
|
||||||
|
MODULE_DESCRIPTION("Zstd Compression Algorithm");
|
||||||
|
MODULE_ALIAS_CRYPTO("zstd");
|
|
@ -124,6 +124,12 @@ void __init acpi_nvs_nosave_s3(void)
|
||||||
nvs_nosave_s3 = true;
|
nvs_nosave_s3 = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int __init init_nvs_save_s3(const struct dmi_system_id *d)
|
||||||
|
{
|
||||||
|
nvs_nosave_s3 = false;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ACPI 1.0 wants us to execute _PTS before suspending devices, so we allow the
|
* ACPI 1.0 wants us to execute _PTS before suspending devices, so we allow the
|
||||||
* user to request that behavior by using the 'acpi_old_suspend_ordering'
|
* user to request that behavior by using the 'acpi_old_suspend_ordering'
|
||||||
|
@ -318,6 +324,27 @@ static struct dmi_system_id acpisleep_dmi_table[] __initdata = {
|
||||||
DMI_MATCH(DMI_PRODUCT_NAME, "K54HR"),
|
DMI_MATCH(DMI_PRODUCT_NAME, "K54HR"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.callback = init_nvs_save_s3,
|
||||||
|
.ident = "Asus 1025C",
|
||||||
|
.matches = {
|
||||||
|
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
|
||||||
|
DMI_MATCH(DMI_PRODUCT_NAME, "1025C"),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
/*
|
||||||
|
* https://bugzilla.kernel.org/show_bug.cgi?id=189431
|
||||||
|
* Lenovo G50-45 is a platform later than 2012, but needs nvs memory
|
||||||
|
* saving during S3.
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
.callback = init_nvs_save_s3,
|
||||||
|
.ident = "Lenovo G50-45",
|
||||||
|
.matches = {
|
||||||
|
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
|
||||||
|
DMI_MATCH(DMI_PRODUCT_NAME, "80E3"),
|
||||||
|
},
|
||||||
|
},
|
||||||
{},
|
{},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
config ZRAM
|
config ZRAM
|
||||||
tristate "Compressed RAM block device support"
|
tristate "Compressed RAM block device support"
|
||||||
depends on BLOCK && SYSFS && ZSMALLOC
|
depends on BLOCK && SYSFS && ZSMALLOC && CRYPTO
|
||||||
select LZO_COMPRESS
|
select CRYPTO_LZO
|
||||||
select LZO_DECOMPRESS
|
|
||||||
default n
|
default n
|
||||||
help
|
help
|
||||||
Creates virtual block devices called /dev/zramX (X = 0, 1, ...).
|
Creates virtual block devices called /dev/zramX (X = 0, 1, ...).
|
||||||
|
@ -13,14 +12,26 @@ config ZRAM
|
||||||
It has several use cases, for example: /tmp storage, use as swap
|
It has several use cases, for example: /tmp storage, use as swap
|
||||||
disks and maybe many more.
|
disks and maybe many more.
|
||||||
|
|
||||||
See zram.txt for more information.
|
See Documentation/blockdev/zram.txt for more information.
|
||||||
|
|
||||||
config ZRAM_LZ4_COMPRESS
|
config ZRAM_WRITEBACK
|
||||||
bool "Enable LZ4 algorithm support"
|
bool "Write back incompressible page to backing device"
|
||||||
depends on ZRAM
|
depends on ZRAM
|
||||||
select LZ4_COMPRESS
|
default n
|
||||||
select LZ4_DECOMPRESS
|
help
|
||||||
default n
|
With incompressible page, there is no memory saving to keep it
|
||||||
|
in memory. Instead, write it out to backing device.
|
||||||
|
For this feature, admin should set up backing device via
|
||||||
|
/sys/block/zramX/backing_dev.
|
||||||
|
|
||||||
|
See Documentation/blockdev/zram.txt for more information.
|
||||||
|
|
||||||
|
config ZRAM_MEMORY_TRACKING
|
||||||
|
bool "Track zRam block status"
|
||||||
|
depends on ZRAM && DEBUG_FS
|
||||||
help
|
help
|
||||||
This option enables LZ4 compression algorithm support. Compression
|
With this feature, admin can track the state of allocated blocks
|
||||||
algorithm can be changed using `comp_algorithm' device attribute.
|
of zRAM. Admin could see the information via
|
||||||
|
/sys/kernel/debug/zram/zramX/block_state.
|
||||||
|
|
||||||
|
See Documentation/blockdev/zram.txt for more information.
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
zram-y := zcomp_lzo.o zcomp.o zram_drv.o
|
zram-y := zcomp.o zram_drv.o
|
||||||
|
|
||||||
zram-$(CONFIG_ZRAM_LZ4_COMPRESS) += zcomp_lz4.o
|
|
||||||
|
|
||||||
obj-$(CONFIG_ZRAM) += zram.o
|
obj-$(CONFIG_ZRAM) += zram.o
|
||||||
|
|
|
@ -13,315 +13,233 @@
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/wait.h>
|
#include <linux/wait.h>
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
|
#include <linux/cpu.h>
|
||||||
|
#include <linux/crypto.h>
|
||||||
|
|
||||||
#include "zcomp.h"
|
#include "zcomp.h"
|
||||||
#include "zcomp_lzo.h"
|
|
||||||
#ifdef CONFIG_ZRAM_LZ4_COMPRESS
|
static const char * const backends[] = {
|
||||||
#include "zcomp_lz4.h"
|
"lzo",
|
||||||
|
#if IS_ENABLED(CONFIG_CRYPTO_LZ4)
|
||||||
|
"lz4",
|
||||||
#endif
|
#endif
|
||||||
|
#if IS_ENABLED(CONFIG_CRYPTO_DEFLATE)
|
||||||
/*
|
"deflate",
|
||||||
* single zcomp_strm backend
|
#endif
|
||||||
*/
|
#if IS_ENABLED(CONFIG_CRYPTO_LZ4HC)
|
||||||
struct zcomp_strm_single {
|
"lz4hc",
|
||||||
struct mutex strm_lock;
|
#endif
|
||||||
struct zcomp_strm *zstrm;
|
#if IS_ENABLED(CONFIG_CRYPTO_842)
|
||||||
};
|
"842",
|
||||||
|
#endif
|
||||||
/*
|
#if IS_ENABLED(CONFIG_CRYPTO_ZSTD)
|
||||||
* multi zcomp_strm backend
|
"zstd",
|
||||||
*/
|
|
||||||
struct zcomp_strm_multi {
|
|
||||||
/* protect strm list */
|
|
||||||
spinlock_t strm_lock;
|
|
||||||
/* max possible number of zstrm streams */
|
|
||||||
int max_strm;
|
|
||||||
/* number of available zstrm streams */
|
|
||||||
int avail_strm;
|
|
||||||
/* list of available strms */
|
|
||||||
struct list_head idle_strm;
|
|
||||||
wait_queue_head_t strm_wait;
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct zcomp_backend *backends[] = {
|
|
||||||
&zcomp_lzo,
|
|
||||||
#ifdef CONFIG_ZRAM_LZ4_COMPRESS
|
|
||||||
&zcomp_lz4,
|
|
||||||
#endif
|
#endif
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct zcomp_backend *find_backend(const char *compress)
|
static void zcomp_strm_free(struct zcomp_strm *zstrm)
|
||||||
{
|
{
|
||||||
int i = 0;
|
if (!IS_ERR_OR_NULL(zstrm->tfm))
|
||||||
while (backends[i]) {
|
crypto_free_comp(zstrm->tfm);
|
||||||
if (sysfs_streq(compress, backends[i]->name))
|
|
||||||
break;
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
return backends[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
static void zcomp_strm_free(struct zcomp *comp, struct zcomp_strm *zstrm)
|
|
||||||
{
|
|
||||||
if (zstrm->private)
|
|
||||||
comp->backend->destroy(zstrm->private);
|
|
||||||
free_pages((unsigned long)zstrm->buffer, 1);
|
free_pages((unsigned long)zstrm->buffer, 1);
|
||||||
kfree(zstrm);
|
kfree(zstrm);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* allocate new zcomp_strm structure with ->private initialized by
|
* allocate new zcomp_strm structure with ->tfm initialized by
|
||||||
* backend, return NULL on error
|
* backend, return NULL on error
|
||||||
*/
|
*/
|
||||||
static struct zcomp_strm *zcomp_strm_alloc(struct zcomp *comp)
|
static struct zcomp_strm *zcomp_strm_alloc(struct zcomp *comp)
|
||||||
{
|
{
|
||||||
struct zcomp_strm *zstrm = kmalloc(sizeof(*zstrm), GFP_NOIO);
|
struct zcomp_strm *zstrm = kmalloc(sizeof(*zstrm), GFP_KERNEL);
|
||||||
if (!zstrm)
|
if (!zstrm)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
zstrm->private = comp->backend->create();
|
zstrm->tfm = crypto_alloc_comp(comp->name, 0, 0);
|
||||||
/*
|
/*
|
||||||
* allocate 2 pages. 1 for compressed data, plus 1 extra for the
|
* allocate 2 pages. 1 for compressed data, plus 1 extra for the
|
||||||
* case when compressed size is larger than the original one
|
* case when compressed size is larger than the original one
|
||||||
*/
|
*/
|
||||||
zstrm->buffer = (void *)__get_free_pages(GFP_NOIO | __GFP_ZERO, 1);
|
zstrm->buffer = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, 1);
|
||||||
if (!zstrm->private || !zstrm->buffer) {
|
if (IS_ERR_OR_NULL(zstrm->tfm) || !zstrm->buffer) {
|
||||||
zcomp_strm_free(comp, zstrm);
|
zcomp_strm_free(zstrm);
|
||||||
zstrm = NULL;
|
zstrm = NULL;
|
||||||
}
|
}
|
||||||
return zstrm;
|
return zstrm;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
bool zcomp_available_algorithm(const char *comp)
|
||||||
* get idle zcomp_strm or wait until other process release
|
|
||||||
* (zcomp_strm_release()) one for us
|
|
||||||
*/
|
|
||||||
static struct zcomp_strm *zcomp_strm_multi_find(struct zcomp *comp)
|
|
||||||
{
|
{
|
||||||
struct zcomp_strm_multi *zs = comp->stream;
|
int i = 0;
|
||||||
struct zcomp_strm *zstrm;
|
|
||||||
|
|
||||||
while (1) {
|
while (backends[i]) {
|
||||||
spin_lock(&zs->strm_lock);
|
if (sysfs_streq(comp, backends[i]))
|
||||||
if (!list_empty(&zs->idle_strm)) {
|
return true;
|
||||||
zstrm = list_entry(zs->idle_strm.next,
|
i++;
|
||||||
struct zcomp_strm, list);
|
|
||||||
list_del(&zstrm->list);
|
|
||||||
spin_unlock(&zs->strm_lock);
|
|
||||||
return zstrm;
|
|
||||||
}
|
|
||||||
/* zstrm streams limit reached, wait for idle stream */
|
|
||||||
if (zs->avail_strm >= zs->max_strm) {
|
|
||||||
spin_unlock(&zs->strm_lock);
|
|
||||||
wait_event(zs->strm_wait, !list_empty(&zs->idle_strm));
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
/* allocate new zstrm stream */
|
|
||||||
zs->avail_strm++;
|
|
||||||
spin_unlock(&zs->strm_lock);
|
|
||||||
|
|
||||||
zstrm = zcomp_strm_alloc(comp);
|
|
||||||
if (!zstrm) {
|
|
||||||
spin_lock(&zs->strm_lock);
|
|
||||||
zs->avail_strm--;
|
|
||||||
spin_unlock(&zs->strm_lock);
|
|
||||||
wait_event(zs->strm_wait, !list_empty(&zs->idle_strm));
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return zstrm;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* add stream back to idle list and wake up waiter or free the stream */
|
|
||||||
static void zcomp_strm_multi_release(struct zcomp *comp, struct zcomp_strm *zstrm)
|
|
||||||
{
|
|
||||||
struct zcomp_strm_multi *zs = comp->stream;
|
|
||||||
|
|
||||||
spin_lock(&zs->strm_lock);
|
|
||||||
if (zs->avail_strm <= zs->max_strm) {
|
|
||||||
list_add(&zstrm->list, &zs->idle_strm);
|
|
||||||
spin_unlock(&zs->strm_lock);
|
|
||||||
wake_up(&zs->strm_wait);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
zs->avail_strm--;
|
|
||||||
spin_unlock(&zs->strm_lock);
|
|
||||||
zcomp_strm_free(comp, zstrm);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* change max_strm limit */
|
|
||||||
static bool zcomp_strm_multi_set_max_streams(struct zcomp *comp, int num_strm)
|
|
||||||
{
|
|
||||||
struct zcomp_strm_multi *zs = comp->stream;
|
|
||||||
struct zcomp_strm *zstrm;
|
|
||||||
|
|
||||||
spin_lock(&zs->strm_lock);
|
|
||||||
zs->max_strm = num_strm;
|
|
||||||
/*
|
/*
|
||||||
* if user has lowered the limit and there are idle streams,
|
* Crypto does not ignore a trailing new line symbol,
|
||||||
* immediately free as much streams (and memory) as we can.
|
* so make sure you don't supply a string containing
|
||||||
|
* one.
|
||||||
|
* This also means that we permit zcomp initialisation
|
||||||
|
* with any compressing algorithm known to crypto api.
|
||||||
*/
|
*/
|
||||||
while (zs->avail_strm > num_strm && !list_empty(&zs->idle_strm)) {
|
return crypto_has_comp(comp, 0, 0) == 1;
|
||||||
zstrm = list_entry(zs->idle_strm.next,
|
|
||||||
struct zcomp_strm, list);
|
|
||||||
list_del(&zstrm->list);
|
|
||||||
zcomp_strm_free(comp, zstrm);
|
|
||||||
zs->avail_strm--;
|
|
||||||
}
|
|
||||||
spin_unlock(&zs->strm_lock);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void zcomp_strm_multi_destroy(struct zcomp *comp)
|
|
||||||
{
|
|
||||||
struct zcomp_strm_multi *zs = comp->stream;
|
|
||||||
struct zcomp_strm *zstrm;
|
|
||||||
|
|
||||||
while (!list_empty(&zs->idle_strm)) {
|
|
||||||
zstrm = list_entry(zs->idle_strm.next,
|
|
||||||
struct zcomp_strm, list);
|
|
||||||
list_del(&zstrm->list);
|
|
||||||
zcomp_strm_free(comp, zstrm);
|
|
||||||
}
|
|
||||||
kfree(zs);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int zcomp_strm_multi_create(struct zcomp *comp, int max_strm)
|
|
||||||
{
|
|
||||||
struct zcomp_strm *zstrm;
|
|
||||||
struct zcomp_strm_multi *zs;
|
|
||||||
|
|
||||||
comp->destroy = zcomp_strm_multi_destroy;
|
|
||||||
comp->strm_find = zcomp_strm_multi_find;
|
|
||||||
comp->strm_release = zcomp_strm_multi_release;
|
|
||||||
comp->set_max_streams = zcomp_strm_multi_set_max_streams;
|
|
||||||
zs = kmalloc(sizeof(struct zcomp_strm_multi), GFP_KERNEL);
|
|
||||||
if (!zs)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
comp->stream = zs;
|
|
||||||
spin_lock_init(&zs->strm_lock);
|
|
||||||
INIT_LIST_HEAD(&zs->idle_strm);
|
|
||||||
init_waitqueue_head(&zs->strm_wait);
|
|
||||||
zs->max_strm = max_strm;
|
|
||||||
zs->avail_strm = 1;
|
|
||||||
|
|
||||||
zstrm = zcomp_strm_alloc(comp);
|
|
||||||
if (!zstrm) {
|
|
||||||
kfree(zs);
|
|
||||||
return -ENOMEM;
|
|
||||||
}
|
|
||||||
list_add(&zstrm->list, &zs->idle_strm);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct zcomp_strm *zcomp_strm_single_find(struct zcomp *comp)
|
|
||||||
{
|
|
||||||
struct zcomp_strm_single *zs = comp->stream;
|
|
||||||
mutex_lock(&zs->strm_lock);
|
|
||||||
return zs->zstrm;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void zcomp_strm_single_release(struct zcomp *comp,
|
|
||||||
struct zcomp_strm *zstrm)
|
|
||||||
{
|
|
||||||
struct zcomp_strm_single *zs = comp->stream;
|
|
||||||
mutex_unlock(&zs->strm_lock);
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool zcomp_strm_single_set_max_streams(struct zcomp *comp, int num_strm)
|
|
||||||
{
|
|
||||||
/* zcomp_strm_single support only max_comp_streams == 1 */
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void zcomp_strm_single_destroy(struct zcomp *comp)
|
|
||||||
{
|
|
||||||
struct zcomp_strm_single *zs = comp->stream;
|
|
||||||
zcomp_strm_free(comp, zs->zstrm);
|
|
||||||
kfree(zs);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int zcomp_strm_single_create(struct zcomp *comp)
|
|
||||||
{
|
|
||||||
struct zcomp_strm_single *zs;
|
|
||||||
|
|
||||||
comp->destroy = zcomp_strm_single_destroy;
|
|
||||||
comp->strm_find = zcomp_strm_single_find;
|
|
||||||
comp->strm_release = zcomp_strm_single_release;
|
|
||||||
comp->set_max_streams = zcomp_strm_single_set_max_streams;
|
|
||||||
zs = kmalloc(sizeof(struct zcomp_strm_single), GFP_KERNEL);
|
|
||||||
if (!zs)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
comp->stream = zs;
|
|
||||||
mutex_init(&zs->strm_lock);
|
|
||||||
zs->zstrm = zcomp_strm_alloc(comp);
|
|
||||||
if (!zs->zstrm) {
|
|
||||||
kfree(zs);
|
|
||||||
return -ENOMEM;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* show available compressors */
|
/* show available compressors */
|
||||||
ssize_t zcomp_available_show(const char *comp, char *buf)
|
ssize_t zcomp_available_show(const char *comp, char *buf)
|
||||||
{
|
{
|
||||||
|
bool known_algorithm = false;
|
||||||
ssize_t sz = 0;
|
ssize_t sz = 0;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
while (backends[i]) {
|
for (; backends[i]; i++) {
|
||||||
if (!strcmp(comp, backends[i]->name))
|
if (!strcmp(comp, backends[i])) {
|
||||||
|
known_algorithm = true;
|
||||||
sz += scnprintf(buf + sz, PAGE_SIZE - sz - 2,
|
sz += scnprintf(buf + sz, PAGE_SIZE - sz - 2,
|
||||||
"[%s] ", backends[i]->name);
|
"[%s] ", backends[i]);
|
||||||
else
|
} else {
|
||||||
sz += scnprintf(buf + sz, PAGE_SIZE - sz - 2,
|
sz += scnprintf(buf + sz, PAGE_SIZE - sz - 2,
|
||||||
"%s ", backends[i]->name);
|
"%s ", backends[i]);
|
||||||
i++;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Out-of-tree module known to crypto api or a missing
|
||||||
|
* entry in `backends'.
|
||||||
|
*/
|
||||||
|
if (!known_algorithm && crypto_has_comp(comp, 0, 0) == 1)
|
||||||
|
sz += scnprintf(buf + sz, PAGE_SIZE - sz - 2,
|
||||||
|
"[%s] ", comp);
|
||||||
|
|
||||||
sz += scnprintf(buf + sz, PAGE_SIZE - sz, "\n");
|
sz += scnprintf(buf + sz, PAGE_SIZE - sz, "\n");
|
||||||
return sz;
|
return sz;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool zcomp_available_algorithm(const char *comp)
|
struct zcomp_strm *zcomp_stream_get(struct zcomp *comp)
|
||||||
{
|
{
|
||||||
return find_backend(comp) != NULL;
|
return *get_cpu_ptr(comp->stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool zcomp_set_max_streams(struct zcomp *comp, int num_strm)
|
void zcomp_stream_put(struct zcomp *comp)
|
||||||
{
|
{
|
||||||
return comp->set_max_streams(comp, num_strm);
|
put_cpu_ptr(comp->stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct zcomp_strm *zcomp_strm_find(struct zcomp *comp)
|
int zcomp_compress(struct zcomp_strm *zstrm,
|
||||||
|
const void *src, unsigned int *dst_len)
|
||||||
{
|
{
|
||||||
return comp->strm_find(comp);
|
/*
|
||||||
|
* Our dst memory (zstrm->buffer) is always `2 * PAGE_SIZE' sized
|
||||||
|
* because sometimes we can endup having a bigger compressed data
|
||||||
|
* due to various reasons: for example compression algorithms tend
|
||||||
|
* to add some padding to the compressed buffer. Speaking of padding,
|
||||||
|
* comp algorithm `842' pads the compressed length to multiple of 8
|
||||||
|
* and returns -ENOSP when the dst memory is not big enough, which
|
||||||
|
* is not something that ZRAM wants to see. We can handle the
|
||||||
|
* `compressed_size > PAGE_SIZE' case easily in ZRAM, but when we
|
||||||
|
* receive -ERRNO from the compressing backend we can't help it
|
||||||
|
* anymore. To make `842' happy we need to tell the exact size of
|
||||||
|
* the dst buffer, zram_drv will take care of the fact that
|
||||||
|
* compressed buffer is too big.
|
||||||
|
*/
|
||||||
|
*dst_len = PAGE_SIZE * 2;
|
||||||
|
|
||||||
|
return crypto_comp_compress(zstrm->tfm,
|
||||||
|
src, PAGE_SIZE,
|
||||||
|
zstrm->buffer, dst_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
void zcomp_strm_release(struct zcomp *comp, struct zcomp_strm *zstrm)
|
int zcomp_decompress(struct zcomp_strm *zstrm,
|
||||||
|
const void *src, unsigned int src_len, void *dst)
|
||||||
{
|
{
|
||||||
comp->strm_release(comp, zstrm);
|
unsigned int dst_len = PAGE_SIZE;
|
||||||
|
|
||||||
|
return crypto_comp_decompress(zstrm->tfm,
|
||||||
|
src, src_len,
|
||||||
|
dst, &dst_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
int zcomp_compress(struct zcomp *comp, struct zcomp_strm *zstrm,
|
static int __zcomp_cpu_notifier(struct zcomp *comp,
|
||||||
const unsigned char *src, size_t *dst_len)
|
unsigned long action, unsigned long cpu)
|
||||||
{
|
{
|
||||||
return comp->backend->compress(src, zstrm->buffer, dst_len,
|
struct zcomp_strm *zstrm;
|
||||||
zstrm->private);
|
|
||||||
|
switch (action) {
|
||||||
|
case CPU_UP_PREPARE:
|
||||||
|
if (WARN_ON(*per_cpu_ptr(comp->stream, cpu)))
|
||||||
|
break;
|
||||||
|
zstrm = zcomp_strm_alloc(comp);
|
||||||
|
if (IS_ERR_OR_NULL(zstrm)) {
|
||||||
|
pr_err("Can't allocate a compression stream\n");
|
||||||
|
return NOTIFY_BAD;
|
||||||
|
}
|
||||||
|
*per_cpu_ptr(comp->stream, cpu) = zstrm;
|
||||||
|
break;
|
||||||
|
case CPU_DEAD:
|
||||||
|
case CPU_UP_CANCELED:
|
||||||
|
zstrm = *per_cpu_ptr(comp->stream, cpu);
|
||||||
|
if (!IS_ERR_OR_NULL(zstrm))
|
||||||
|
zcomp_strm_free(zstrm);
|
||||||
|
*per_cpu_ptr(comp->stream, cpu) = NULL;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return NOTIFY_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int zcomp_decompress(struct zcomp *comp, const unsigned char *src,
|
static int zcomp_cpu_notifier(struct notifier_block *nb,
|
||||||
size_t src_len, unsigned char *dst)
|
unsigned long action, void *pcpu)
|
||||||
{
|
{
|
||||||
return comp->backend->decompress(src, src_len, dst);
|
unsigned long cpu = (unsigned long)pcpu;
|
||||||
|
struct zcomp *comp = container_of(nb, typeof(*comp), notifier);
|
||||||
|
|
||||||
|
return __zcomp_cpu_notifier(comp, action, cpu);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int zcomp_init(struct zcomp *comp)
|
||||||
|
{
|
||||||
|
unsigned long cpu;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
comp->notifier.notifier_call = zcomp_cpu_notifier;
|
||||||
|
|
||||||
|
comp->stream = alloc_percpu(struct zcomp_strm *);
|
||||||
|
if (!comp->stream)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
|
cpu_notifier_register_begin();
|
||||||
|
for_each_online_cpu(cpu) {
|
||||||
|
ret = __zcomp_cpu_notifier(comp, CPU_UP_PREPARE, cpu);
|
||||||
|
if (ret == NOTIFY_BAD)
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
__register_cpu_notifier(&comp->notifier);
|
||||||
|
cpu_notifier_register_done();
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
for_each_online_cpu(cpu)
|
||||||
|
__zcomp_cpu_notifier(comp, CPU_UP_CANCELED, cpu);
|
||||||
|
cpu_notifier_register_done();
|
||||||
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
void zcomp_destroy(struct zcomp *comp)
|
void zcomp_destroy(struct zcomp *comp)
|
||||||
{
|
{
|
||||||
comp->destroy(comp);
|
unsigned long cpu;
|
||||||
|
|
||||||
|
cpu_notifier_register_begin();
|
||||||
|
for_each_online_cpu(cpu)
|
||||||
|
__zcomp_cpu_notifier(comp, CPU_UP_CANCELED, cpu);
|
||||||
|
__unregister_cpu_notifier(&comp->notifier);
|
||||||
|
cpu_notifier_register_done();
|
||||||
|
|
||||||
|
free_percpu(comp->stream);
|
||||||
kfree(comp);
|
kfree(comp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -331,27 +249,22 @@ void zcomp_destroy(struct zcomp *comp)
|
||||||
* backend pointer or ERR_PTR if things went bad. ERR_PTR(-EINVAL)
|
* backend pointer or ERR_PTR if things went bad. ERR_PTR(-EINVAL)
|
||||||
* if requested algorithm is not supported, ERR_PTR(-ENOMEM) in
|
* if requested algorithm is not supported, ERR_PTR(-ENOMEM) in
|
||||||
* case of allocation error, or any other error potentially
|
* case of allocation error, or any other error potentially
|
||||||
* returned by functions zcomp_strm_{multi,single}_create.
|
* returned by zcomp_init().
|
||||||
*/
|
*/
|
||||||
struct zcomp *zcomp_create(const char *compress, int max_strm)
|
struct zcomp *zcomp_create(const char *compress)
|
||||||
{
|
{
|
||||||
struct zcomp *comp;
|
struct zcomp *comp;
|
||||||
struct zcomp_backend *backend;
|
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
backend = find_backend(compress);
|
if (!zcomp_available_algorithm(compress))
|
||||||
if (!backend)
|
|
||||||
return ERR_PTR(-EINVAL);
|
return ERR_PTR(-EINVAL);
|
||||||
|
|
||||||
comp = kzalloc(sizeof(struct zcomp), GFP_KERNEL);
|
comp = kzalloc(sizeof(struct zcomp), GFP_KERNEL);
|
||||||
if (!comp)
|
if (!comp)
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
|
|
||||||
comp->backend = backend;
|
comp->name = compress;
|
||||||
if (max_strm > 1)
|
error = zcomp_init(comp);
|
||||||
error = zcomp_strm_multi_create(comp, max_strm);
|
|
||||||
else
|
|
||||||
error = zcomp_strm_single_create(comp);
|
|
||||||
if (error) {
|
if (error) {
|
||||||
kfree(comp);
|
kfree(comp);
|
||||||
return ERR_PTR(error);
|
return ERR_PTR(error);
|
||||||
|
|
|
@ -10,60 +10,34 @@
|
||||||
#ifndef _ZCOMP_H_
|
#ifndef _ZCOMP_H_
|
||||||
#define _ZCOMP_H_
|
#define _ZCOMP_H_
|
||||||
|
|
||||||
#include <linux/mutex.h>
|
|
||||||
|
|
||||||
struct zcomp_strm {
|
struct zcomp_strm {
|
||||||
/* compression/decompression buffer */
|
/* compression/decompression buffer */
|
||||||
void *buffer;
|
void *buffer;
|
||||||
/*
|
struct crypto_comp *tfm;
|
||||||
* The private data of the compression stream, only compression
|
|
||||||
* stream backend can touch this (e.g. compression algorithm
|
|
||||||
* working memory)
|
|
||||||
*/
|
|
||||||
void *private;
|
|
||||||
/* used in multi stream backend, protected by backend strm_lock */
|
|
||||||
struct list_head list;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* static compression backend */
|
|
||||||
struct zcomp_backend {
|
|
||||||
int (*compress)(const unsigned char *src, unsigned char *dst,
|
|
||||||
size_t *dst_len, void *private);
|
|
||||||
|
|
||||||
int (*decompress)(const unsigned char *src, size_t src_len,
|
|
||||||
unsigned char *dst);
|
|
||||||
|
|
||||||
void *(*create)(void);
|
|
||||||
void (*destroy)(void *private);
|
|
||||||
|
|
||||||
const char *name;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* dynamic per-device compression frontend */
|
/* dynamic per-device compression frontend */
|
||||||
struct zcomp {
|
struct zcomp {
|
||||||
void *stream;
|
struct zcomp_strm * __percpu *stream;
|
||||||
struct zcomp_backend *backend;
|
struct notifier_block notifier;
|
||||||
|
|
||||||
struct zcomp_strm *(*strm_find)(struct zcomp *comp);
|
const char *name;
|
||||||
void (*strm_release)(struct zcomp *comp, struct zcomp_strm *zstrm);
|
|
||||||
bool (*set_max_streams)(struct zcomp *comp, int num_strm);
|
|
||||||
void (*destroy)(struct zcomp *comp);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ssize_t zcomp_available_show(const char *comp, char *buf);
|
ssize_t zcomp_available_show(const char *comp, char *buf);
|
||||||
bool zcomp_available_algorithm(const char *comp);
|
bool zcomp_available_algorithm(const char *comp);
|
||||||
|
|
||||||
struct zcomp *zcomp_create(const char *comp, int max_strm);
|
struct zcomp *zcomp_create(const char *comp);
|
||||||
void zcomp_destroy(struct zcomp *comp);
|
void zcomp_destroy(struct zcomp *comp);
|
||||||
|
|
||||||
struct zcomp_strm *zcomp_strm_find(struct zcomp *comp);
|
struct zcomp_strm *zcomp_stream_get(struct zcomp *comp);
|
||||||
void zcomp_strm_release(struct zcomp *comp, struct zcomp_strm *zstrm);
|
void zcomp_stream_put(struct zcomp *comp);
|
||||||
|
|
||||||
int zcomp_compress(struct zcomp *comp, struct zcomp_strm *zstrm,
|
int zcomp_compress(struct zcomp_strm *zstrm,
|
||||||
const unsigned char *src, size_t *dst_len);
|
const void *src, unsigned int *dst_len);
|
||||||
|
|
||||||
int zcomp_decompress(struct zcomp *comp, const unsigned char *src,
|
int zcomp_decompress(struct zcomp_strm *zstrm,
|
||||||
size_t src_len, unsigned char *dst);
|
const void *src, unsigned int src_len, void *dst);
|
||||||
|
|
||||||
bool zcomp_set_max_streams(struct zcomp *comp, int num_strm);
|
bool zcomp_set_max_streams(struct zcomp *comp, int num_strm);
|
||||||
#endif /* _ZCOMP_H_ */
|
#endif /* _ZCOMP_H_ */
|
||||||
|
|
|
@ -1,66 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2014 Sergey Senozhatsky.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation; either version
|
|
||||||
* 2 of the License, or (at your option) any later version.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <linux/kernel.h>
|
|
||||||
#include <linux/slab.h>
|
|
||||||
#include <linux/lz4.h>
|
|
||||||
#include <linux/vmalloc.h>
|
|
||||||
#include <linux/mm.h>
|
|
||||||
|
|
||||||
#include "zcomp_lz4.h"
|
|
||||||
|
|
||||||
static void *zcomp_lz4_create(void)
|
|
||||||
{
|
|
||||||
void *ret;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This function can be called in swapout/fs write path
|
|
||||||
* so we can't use GFP_FS|IO. And it assumes we already
|
|
||||||
* have at least one stream in zram initialization so we
|
|
||||||
* don't do best effort to allocate more stream in here.
|
|
||||||
* A default stream will work well without further multiple
|
|
||||||
* streams. That's why we use NORETRY | NOWARN.
|
|
||||||
*/
|
|
||||||
ret = kzalloc(LZ4_MEM_COMPRESS, GFP_NOIO | __GFP_NORETRY |
|
|
||||||
__GFP_NOWARN);
|
|
||||||
if (!ret)
|
|
||||||
ret = __vmalloc(LZ4_MEM_COMPRESS,
|
|
||||||
GFP_NOIO | __GFP_NORETRY | __GFP_NOWARN |
|
|
||||||
__GFP_ZERO | __GFP_HIGHMEM,
|
|
||||||
PAGE_KERNEL);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void zcomp_lz4_destroy(void *private)
|
|
||||||
{
|
|
||||||
kvfree(private);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int zcomp_lz4_compress(const unsigned char *src, unsigned char *dst,
|
|
||||||
size_t *dst_len, void *private)
|
|
||||||
{
|
|
||||||
/* return : Success if return 0 */
|
|
||||||
return lz4_compress(src, PAGE_SIZE, dst, dst_len, private);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int zcomp_lz4_decompress(const unsigned char *src, size_t src_len,
|
|
||||||
unsigned char *dst)
|
|
||||||
{
|
|
||||||
size_t dst_len = PAGE_SIZE;
|
|
||||||
/* return : Success if return 0 */
|
|
||||||
return lz4_decompress_unknownoutputsize(src, src_len, dst, &dst_len);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct zcomp_backend zcomp_lz4 = {
|
|
||||||
.compress = zcomp_lz4_compress,
|
|
||||||
.decompress = zcomp_lz4_decompress,
|
|
||||||
.create = zcomp_lz4_create,
|
|
||||||
.destroy = zcomp_lz4_destroy,
|
|
||||||
.name = "lz4",
|
|
||||||
};
|
|
|
@ -1,17 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2014 Sergey Senozhatsky.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation; either version
|
|
||||||
* 2 of the License, or (at your option) any later version.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _ZCOMP_LZ4_H_
|
|
||||||
#define _ZCOMP_LZ4_H_
|
|
||||||
|
|
||||||
#include "zcomp.h"
|
|
||||||
|
|
||||||
extern struct zcomp_backend zcomp_lz4;
|
|
||||||
|
|
||||||
#endif /* _ZCOMP_LZ4_H_ */
|
|
|
@ -1,66 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2014 Sergey Senozhatsky.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation; either version
|
|
||||||
* 2 of the License, or (at your option) any later version.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <linux/kernel.h>
|
|
||||||
#include <linux/slab.h>
|
|
||||||
#include <linux/lzo.h>
|
|
||||||
#include <linux/vmalloc.h>
|
|
||||||
#include <linux/mm.h>
|
|
||||||
|
|
||||||
#include "zcomp_lzo.h"
|
|
||||||
|
|
||||||
static void *lzo_create(void)
|
|
||||||
{
|
|
||||||
void *ret;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This function can be called in swapout/fs write path
|
|
||||||
* so we can't use GFP_FS|IO. And it assumes we already
|
|
||||||
* have at least one stream in zram initialization so we
|
|
||||||
* don't do best effort to allocate more stream in here.
|
|
||||||
* A default stream will work well without further multiple
|
|
||||||
* streams. That's why we use NORETRY | NOWARN.
|
|
||||||
*/
|
|
||||||
ret = kzalloc(LZO1X_MEM_COMPRESS, GFP_NOIO | __GFP_NORETRY |
|
|
||||||
__GFP_NOWARN);
|
|
||||||
if (!ret)
|
|
||||||
ret = __vmalloc(LZO1X_MEM_COMPRESS,
|
|
||||||
GFP_NOIO | __GFP_NORETRY | __GFP_NOWARN |
|
|
||||||
__GFP_ZERO | __GFP_HIGHMEM,
|
|
||||||
PAGE_KERNEL);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void lzo_destroy(void *private)
|
|
||||||
{
|
|
||||||
kvfree(private);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int lzo_compress(const unsigned char *src, unsigned char *dst,
|
|
||||||
size_t *dst_len, void *private)
|
|
||||||
{
|
|
||||||
int ret = lzo1x_1_compress(src, PAGE_SIZE, dst, dst_len, private);
|
|
||||||
return ret == LZO_E_OK ? 0 : ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int lzo_decompress(const unsigned char *src, size_t src_len,
|
|
||||||
unsigned char *dst)
|
|
||||||
{
|
|
||||||
size_t dst_len = PAGE_SIZE;
|
|
||||||
int ret = lzo1x_decompress_safe(src, src_len, dst, &dst_len);
|
|
||||||
return ret == LZO_E_OK ? 0 : ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct zcomp_backend zcomp_lzo = {
|
|
||||||
.compress = lzo_compress,
|
|
||||||
.decompress = lzo_decompress,
|
|
||||||
.create = lzo_create,
|
|
||||||
.destroy = lzo_destroy,
|
|
||||||
.name = "lzo",
|
|
||||||
};
|
|
|
@ -1,17 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2014 Sergey Senozhatsky.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation; either version
|
|
||||||
* 2 of the License, or (at your option) any later version.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _ZCOMP_LZO_H_
|
|
||||||
#define _ZCOMP_LZO_H_
|
|
||||||
|
|
||||||
#include "zcomp.h"
|
|
||||||
|
|
||||||
extern struct zcomp_backend zcomp_lzo;
|
|
||||||
|
|
||||||
#endif /* _ZCOMP_LZO_H_ */
|
|
File diff suppressed because it is too large
Load diff
|
@ -15,8 +15,9 @@
|
||||||
#ifndef _ZRAM_DRV_H_
|
#ifndef _ZRAM_DRV_H_
|
||||||
#define _ZRAM_DRV_H_
|
#define _ZRAM_DRV_H_
|
||||||
|
|
||||||
#include <linux/spinlock.h>
|
#include <linux/rwsem.h>
|
||||||
#include <linux/zsmalloc.h>
|
#include <linux/zsmalloc.h>
|
||||||
|
#include <linux/crypto.h>
|
||||||
|
|
||||||
#include "zcomp.h"
|
#include "zcomp.h"
|
||||||
|
|
||||||
|
@ -59,9 +60,11 @@ static const size_t max_zpage_size = PAGE_SIZE / 4 * 3;
|
||||||
|
|
||||||
/* Flags for zram pages (table[page_no].value) */
|
/* Flags for zram pages (table[page_no].value) */
|
||||||
enum zram_pageflags {
|
enum zram_pageflags {
|
||||||
/* Page consists entirely of zeros */
|
/* zram slot is locked */
|
||||||
ZRAM_ZERO = ZRAM_FLAG_SHIFT,
|
ZRAM_LOCK = ZRAM_FLAG_SHIFT,
|
||||||
ZRAM_ACCESS, /* page is now accessed */
|
ZRAM_SAME, /* Page consists the same element */
|
||||||
|
ZRAM_WB, /* page is stored on backing_device */
|
||||||
|
ZRAM_HUGE, /* Incompressible page */
|
||||||
|
|
||||||
__NR_ZRAM_PAGEFLAGS,
|
__NR_ZRAM_PAGEFLAGS,
|
||||||
};
|
};
|
||||||
|
@ -70,8 +73,14 @@ enum zram_pageflags {
|
||||||
|
|
||||||
/* Allocated for each disk page */
|
/* Allocated for each disk page */
|
||||||
struct zram_table_entry {
|
struct zram_table_entry {
|
||||||
unsigned long handle;
|
union {
|
||||||
|
unsigned long handle;
|
||||||
|
unsigned long element;
|
||||||
|
};
|
||||||
unsigned long value;
|
unsigned long value;
|
||||||
|
#ifdef CONFIG_ZRAM_MEMORY_TRACKING
|
||||||
|
ktime_t ac_time;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct zram_stats {
|
struct zram_stats {
|
||||||
|
@ -82,18 +91,16 @@ struct zram_stats {
|
||||||
atomic64_t failed_writes; /* can happen when memory is too low */
|
atomic64_t failed_writes; /* can happen when memory is too low */
|
||||||
atomic64_t invalid_io; /* non-page-aligned I/O requests */
|
atomic64_t invalid_io; /* non-page-aligned I/O requests */
|
||||||
atomic64_t notify_free; /* no. of swap slot free notifications */
|
atomic64_t notify_free; /* no. of swap slot free notifications */
|
||||||
atomic64_t zero_pages; /* no. of zero filled pages */
|
atomic64_t same_pages; /* no. of same element filled pages */
|
||||||
|
atomic64_t huge_pages; /* no. of huge pages */
|
||||||
atomic64_t pages_stored; /* no. of pages currently stored */
|
atomic64_t pages_stored; /* no. of pages currently stored */
|
||||||
atomic_long_t max_used_pages; /* no. of maximum pages stored */
|
atomic_long_t max_used_pages; /* no. of maximum pages stored */
|
||||||
};
|
atomic64_t writestall; /* no. of write slow paths */
|
||||||
|
|
||||||
struct zram_meta {
|
|
||||||
struct zram_table_entry *table;
|
|
||||||
struct zs_pool *mem_pool;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct zram {
|
struct zram {
|
||||||
struct zram_meta *meta;
|
struct zram_table_entry *table;
|
||||||
|
struct zs_pool *mem_pool;
|
||||||
struct zcomp *comp;
|
struct zcomp *comp;
|
||||||
struct gendisk *disk;
|
struct gendisk *disk;
|
||||||
/* Prevent concurrent execution of device init */
|
/* Prevent concurrent execution of device init */
|
||||||
|
@ -102,21 +109,28 @@ struct zram {
|
||||||
* the number of pages zram can consume for storing compressed data
|
* the number of pages zram can consume for storing compressed data
|
||||||
*/
|
*/
|
||||||
unsigned long limit_pages;
|
unsigned long limit_pages;
|
||||||
int max_comp_streams;
|
|
||||||
|
|
||||||
struct zram_stats stats;
|
struct zram_stats stats;
|
||||||
atomic_t refcount; /* refcount for zram_meta */
|
|
||||||
/* wait all IO under all of cpu are done */
|
|
||||||
wait_queue_head_t io_done;
|
|
||||||
/*
|
/*
|
||||||
* This is the limit on amount of *uncompressed* worth of data
|
* This is the limit on amount of *uncompressed* worth of data
|
||||||
* we can store in a disk.
|
* we can store in a disk.
|
||||||
*/
|
*/
|
||||||
u64 disksize; /* bytes */
|
u64 disksize; /* bytes */
|
||||||
char compressor[10];
|
char compressor[CRYPTO_MAX_ALG_NAME];
|
||||||
/*
|
/*
|
||||||
* zram is claimed so open request will be failed
|
* zram is claimed so open request will be failed
|
||||||
*/
|
*/
|
||||||
bool claim; /* Protected by bdev->bd_mutex */
|
bool claim; /* Protected by bdev->bd_mutex */
|
||||||
|
#ifdef CONFIG_ZRAM_WRITEBACK
|
||||||
|
struct file *backing_dev;
|
||||||
|
struct block_device *bdev;
|
||||||
|
unsigned int old_block_size;
|
||||||
|
unsigned long *bitmap;
|
||||||
|
unsigned long nr_pages;
|
||||||
|
spinlock_t bitmap_lock;
|
||||||
|
#endif
|
||||||
|
#ifdef CONFIG_ZRAM_MEMORY_TRACKING
|
||||||
|
struct dentry *debugfs_dir;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -660,7 +660,7 @@ static struct dma_chan *k3_of_dma_simple_xlate(struct of_phandle_args *dma_spec,
|
||||||
struct k3_dma_dev *d = ofdma->of_dma_data;
|
struct k3_dma_dev *d = ofdma->of_dma_data;
|
||||||
unsigned int request = dma_spec->args[0];
|
unsigned int request = dma_spec->args[0];
|
||||||
|
|
||||||
if (request > d->dma_requests)
|
if (request >= d->dma_requests)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return dma_get_slave_channel(&(d->chans[request].vc.chan));
|
return dma_get_slave_channel(&(d->chans[request].vc.chan));
|
||||||
|
|
|
@ -160,6 +160,7 @@ enum {
|
||||||
CFG_ALPHAM_GRA = 0x1 << 16,
|
CFG_ALPHAM_GRA = 0x1 << 16,
|
||||||
CFG_ALPHAM_CFG = 0x2 << 16,
|
CFG_ALPHAM_CFG = 0x2 << 16,
|
||||||
CFG_ALPHA_MASK = 0xff << 8,
|
CFG_ALPHA_MASK = 0xff << 8,
|
||||||
|
#define CFG_ALPHA(x) ((x) << 8)
|
||||||
CFG_PIXCMD_MASK = 0xff,
|
CFG_PIXCMD_MASK = 0xff,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ struct armada_ovl_plane_properties {
|
||||||
uint16_t contrast;
|
uint16_t contrast;
|
||||||
uint16_t saturation;
|
uint16_t saturation;
|
||||||
uint32_t colorkey_mode;
|
uint32_t colorkey_mode;
|
||||||
|
uint32_t colorkey_enable;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct armada_ovl_plane {
|
struct armada_ovl_plane {
|
||||||
|
@ -62,11 +63,13 @@ armada_ovl_update_attr(struct armada_ovl_plane_properties *prop,
|
||||||
writel_relaxed(0x00002000, dcrtc->base + LCD_SPU_CBSH_HUE);
|
writel_relaxed(0x00002000, dcrtc->base + LCD_SPU_CBSH_HUE);
|
||||||
|
|
||||||
spin_lock_irq(&dcrtc->irq_lock);
|
spin_lock_irq(&dcrtc->irq_lock);
|
||||||
armada_updatel(prop->colorkey_mode | CFG_ALPHAM_GRA,
|
armada_updatel(prop->colorkey_mode,
|
||||||
CFG_CKMODE_MASK | CFG_ALPHAM_MASK | CFG_ALPHA_MASK,
|
CFG_CKMODE_MASK | CFG_ALPHAM_MASK | CFG_ALPHA_MASK,
|
||||||
dcrtc->base + LCD_SPU_DMA_CTRL1);
|
dcrtc->base + LCD_SPU_DMA_CTRL1);
|
||||||
|
if (dcrtc->variant->has_spu_adv_reg)
|
||||||
armada_updatel(ADV_GRACOLORKEY, 0, dcrtc->base + LCD_SPU_ADV_REG);
|
armada_updatel(prop->colorkey_enable,
|
||||||
|
ADV_GRACOLORKEY | ADV_VIDCOLORKEY,
|
||||||
|
dcrtc->base + LCD_SPU_ADV_REG);
|
||||||
spin_unlock_irq(&dcrtc->irq_lock);
|
spin_unlock_irq(&dcrtc->irq_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,8 +342,17 @@ static int armada_ovl_plane_set_property(struct drm_plane *plane,
|
||||||
dplane->prop.colorkey_vb |= K2B(val);
|
dplane->prop.colorkey_vb |= K2B(val);
|
||||||
update_attr = true;
|
update_attr = true;
|
||||||
} else if (property == priv->colorkey_mode_prop) {
|
} else if (property == priv->colorkey_mode_prop) {
|
||||||
dplane->prop.colorkey_mode &= ~CFG_CKMODE_MASK;
|
if (val == CKMODE_DISABLE) {
|
||||||
dplane->prop.colorkey_mode |= CFG_CKMODE(val);
|
dplane->prop.colorkey_mode =
|
||||||
|
CFG_CKMODE(CKMODE_DISABLE) |
|
||||||
|
CFG_ALPHAM_CFG | CFG_ALPHA(255);
|
||||||
|
dplane->prop.colorkey_enable = 0;
|
||||||
|
} else {
|
||||||
|
dplane->prop.colorkey_mode =
|
||||||
|
CFG_CKMODE(val) |
|
||||||
|
CFG_ALPHAM_GRA | CFG_ALPHA(0);
|
||||||
|
dplane->prop.colorkey_enable = ADV_GRACOLORKEY;
|
||||||
|
}
|
||||||
update_attr = true;
|
update_attr = true;
|
||||||
} else if (property == priv->brightness_prop) {
|
} else if (property == priv->brightness_prop) {
|
||||||
dplane->prop.brightness = val - 256;
|
dplane->prop.brightness = val - 256;
|
||||||
|
@ -469,7 +481,9 @@ int armada_overlay_plane_create(struct drm_device *dev, unsigned long crtcs)
|
||||||
dplane->prop.colorkey_yr = 0xfefefe00;
|
dplane->prop.colorkey_yr = 0xfefefe00;
|
||||||
dplane->prop.colorkey_ug = 0x01010100;
|
dplane->prop.colorkey_ug = 0x01010100;
|
||||||
dplane->prop.colorkey_vb = 0x01010100;
|
dplane->prop.colorkey_vb = 0x01010100;
|
||||||
dplane->prop.colorkey_mode = CFG_CKMODE(CKMODE_RGB);
|
dplane->prop.colorkey_mode = CFG_CKMODE(CKMODE_RGB) |
|
||||||
|
CFG_ALPHAM_GRA | CFG_ALPHA(0);
|
||||||
|
dplane->prop.colorkey_enable = ADV_GRACOLORKEY;
|
||||||
dplane->prop.brightness = 0;
|
dplane->prop.brightness = 0;
|
||||||
dplane->prop.contrast = 0x4000;
|
dplane->prop.contrast = 0x4000;
|
||||||
dplane->prop.saturation = 0x4000;
|
dplane->prop.saturation = 0x4000;
|
||||||
|
|
|
@ -190,7 +190,7 @@ static void decon_win_set_pixfmt(struct decon_context *ctx, unsigned int win,
|
||||||
unsigned long val;
|
unsigned long val;
|
||||||
|
|
||||||
val = readl(ctx->addr + DECON_WINCONx(win));
|
val = readl(ctx->addr + DECON_WINCONx(win));
|
||||||
val &= ~WINCONx_BPPMODE_MASK;
|
val &= WINCONx_ENWIN_F;
|
||||||
|
|
||||||
switch (fb->pixel_format) {
|
switch (fb->pixel_format) {
|
||||||
case DRM_FORMAT_XRGB1555:
|
case DRM_FORMAT_XRGB1555:
|
||||||
|
@ -278,8 +278,8 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc,
|
||||||
COORDINATE_Y(plane->crtc_y + plane->crtc_h - 1);
|
COORDINATE_Y(plane->crtc_y + plane->crtc_h - 1);
|
||||||
writel(val, ctx->addr + DECON_VIDOSDxB(win));
|
writel(val, ctx->addr + DECON_VIDOSDxB(win));
|
||||||
|
|
||||||
val = VIDOSD_Wx_ALPHA_R_F(0x0) | VIDOSD_Wx_ALPHA_G_F(0x0) |
|
val = VIDOSD_Wx_ALPHA_R_F(0xff) | VIDOSD_Wx_ALPHA_G_F(0xff) |
|
||||||
VIDOSD_Wx_ALPHA_B_F(0x0);
|
VIDOSD_Wx_ALPHA_B_F(0xff);
|
||||||
writel(val, ctx->addr + DECON_VIDOSDxC(win));
|
writel(val, ctx->addr + DECON_VIDOSDxC(win));
|
||||||
|
|
||||||
val = VIDOSD_Wx_ALPHA_R_F(0x0) | VIDOSD_Wx_ALPHA_G_F(0x0) |
|
val = VIDOSD_Wx_ALPHA_R_F(0x0) | VIDOSD_Wx_ALPHA_G_F(0x0) |
|
||||||
|
|
|
@ -526,21 +526,25 @@ static int gsc_src_set_fmt(struct device *dev, u32 fmt)
|
||||||
GSC_IN_CHROMA_ORDER_CRCB);
|
GSC_IN_CHROMA_ORDER_CRCB);
|
||||||
break;
|
break;
|
||||||
case DRM_FORMAT_NV21:
|
case DRM_FORMAT_NV21:
|
||||||
|
cfg |= (GSC_IN_CHROMA_ORDER_CRCB | GSC_IN_YUV420_2P);
|
||||||
|
break;
|
||||||
case DRM_FORMAT_NV61:
|
case DRM_FORMAT_NV61:
|
||||||
cfg |= (GSC_IN_CHROMA_ORDER_CRCB |
|
cfg |= (GSC_IN_CHROMA_ORDER_CRCB | GSC_IN_YUV422_2P);
|
||||||
GSC_IN_YUV420_2P);
|
|
||||||
break;
|
break;
|
||||||
case DRM_FORMAT_YUV422:
|
case DRM_FORMAT_YUV422:
|
||||||
cfg |= GSC_IN_YUV422_3P;
|
cfg |= GSC_IN_YUV422_3P;
|
||||||
break;
|
break;
|
||||||
case DRM_FORMAT_YUV420:
|
case DRM_FORMAT_YUV420:
|
||||||
|
cfg |= (GSC_IN_CHROMA_ORDER_CBCR | GSC_IN_YUV420_3P);
|
||||||
|
break;
|
||||||
case DRM_FORMAT_YVU420:
|
case DRM_FORMAT_YVU420:
|
||||||
cfg |= GSC_IN_YUV420_3P;
|
cfg |= (GSC_IN_CHROMA_ORDER_CRCB | GSC_IN_YUV420_3P);
|
||||||
break;
|
break;
|
||||||
case DRM_FORMAT_NV12:
|
case DRM_FORMAT_NV12:
|
||||||
|
cfg |= (GSC_IN_CHROMA_ORDER_CBCR | GSC_IN_YUV420_2P);
|
||||||
|
break;
|
||||||
case DRM_FORMAT_NV16:
|
case DRM_FORMAT_NV16:
|
||||||
cfg |= (GSC_IN_CHROMA_ORDER_CBCR |
|
cfg |= (GSC_IN_CHROMA_ORDER_CBCR | GSC_IN_YUV422_2P);
|
||||||
GSC_IN_YUV420_2P);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dev_err(ippdrv->dev, "invalid target yuv order 0x%x.\n", fmt);
|
dev_err(ippdrv->dev, "invalid target yuv order 0x%x.\n", fmt);
|
||||||
|
@ -800,18 +804,25 @@ static int gsc_dst_set_fmt(struct device *dev, u32 fmt)
|
||||||
GSC_OUT_CHROMA_ORDER_CRCB);
|
GSC_OUT_CHROMA_ORDER_CRCB);
|
||||||
break;
|
break;
|
||||||
case DRM_FORMAT_NV21:
|
case DRM_FORMAT_NV21:
|
||||||
case DRM_FORMAT_NV61:
|
|
||||||
cfg |= (GSC_OUT_CHROMA_ORDER_CRCB | GSC_OUT_YUV420_2P);
|
cfg |= (GSC_OUT_CHROMA_ORDER_CRCB | GSC_OUT_YUV420_2P);
|
||||||
break;
|
break;
|
||||||
|
case DRM_FORMAT_NV61:
|
||||||
|
cfg |= (GSC_OUT_CHROMA_ORDER_CRCB | GSC_OUT_YUV422_2P);
|
||||||
|
break;
|
||||||
case DRM_FORMAT_YUV422:
|
case DRM_FORMAT_YUV422:
|
||||||
|
cfg |= GSC_OUT_YUV422_3P;
|
||||||
|
break;
|
||||||
case DRM_FORMAT_YUV420:
|
case DRM_FORMAT_YUV420:
|
||||||
|
cfg |= (GSC_OUT_CHROMA_ORDER_CBCR | GSC_OUT_YUV420_3P);
|
||||||
|
break;
|
||||||
case DRM_FORMAT_YVU420:
|
case DRM_FORMAT_YVU420:
|
||||||
cfg |= GSC_OUT_YUV420_3P;
|
cfg |= (GSC_OUT_CHROMA_ORDER_CRCB | GSC_OUT_YUV420_3P);
|
||||||
break;
|
break;
|
||||||
case DRM_FORMAT_NV12:
|
case DRM_FORMAT_NV12:
|
||||||
|
cfg |= (GSC_OUT_CHROMA_ORDER_CBCR | GSC_OUT_YUV420_2P);
|
||||||
|
break;
|
||||||
case DRM_FORMAT_NV16:
|
case DRM_FORMAT_NV16:
|
||||||
cfg |= (GSC_OUT_CHROMA_ORDER_CBCR |
|
cfg |= (GSC_OUT_CHROMA_ORDER_CBCR | GSC_OUT_YUV422_2P);
|
||||||
GSC_OUT_YUV420_2P);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dev_err(ippdrv->dev, "invalid target yuv order 0x%x.\n", fmt);
|
dev_err(ippdrv->dev, "invalid target yuv order 0x%x.\n", fmt);
|
||||||
|
|
|
@ -138,6 +138,7 @@
|
||||||
#define GSC_OUT_YUV420_3P (3 << 4)
|
#define GSC_OUT_YUV420_3P (3 << 4)
|
||||||
#define GSC_OUT_YUV422_1P (4 << 4)
|
#define GSC_OUT_YUV422_1P (4 << 4)
|
||||||
#define GSC_OUT_YUV422_2P (5 << 4)
|
#define GSC_OUT_YUV422_2P (5 << 4)
|
||||||
|
#define GSC_OUT_YUV422_3P (6 << 4)
|
||||||
#define GSC_OUT_YUV444 (7 << 4)
|
#define GSC_OUT_YUV444 (7 << 4)
|
||||||
#define GSC_OUT_TILE_TYPE_MASK (1 << 2)
|
#define GSC_OUT_TILE_TYPE_MASK (1 << 2)
|
||||||
#define GSC_OUT_TILE_C_16x8 (0 << 2)
|
#define GSC_OUT_TILE_C_16x8 (0 << 2)
|
||||||
|
|
|
@ -602,7 +602,7 @@ nouveau_gem_pushbuf_reloc_apply(struct nouveau_cli *cli,
|
||||||
struct nouveau_bo *nvbo;
|
struct nouveau_bo *nvbo;
|
||||||
uint32_t data;
|
uint32_t data;
|
||||||
|
|
||||||
if (unlikely(r->bo_index > req->nr_buffers)) {
|
if (unlikely(r->bo_index >= req->nr_buffers)) {
|
||||||
NV_PRINTK(err, cli, "reloc bo index invalid\n");
|
NV_PRINTK(err, cli, "reloc bo index invalid\n");
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
break;
|
break;
|
||||||
|
@ -612,7 +612,7 @@ nouveau_gem_pushbuf_reloc_apply(struct nouveau_cli *cli,
|
||||||
if (b->presumed.valid)
|
if (b->presumed.valid)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (unlikely(r->reloc_bo_index > req->nr_buffers)) {
|
if (unlikely(r->reloc_bo_index >= req->nr_buffers)) {
|
||||||
NV_PRINTK(err, cli, "reloc container bo index invalid\n");
|
NV_PRINTK(err, cli, "reloc container bo index invalid\n");
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -2487,8 +2487,14 @@ void wacom_setup_device_quirks(struct wacom *wacom)
|
||||||
if (features->type >= INTUOSHT && features->type <= BAMBOO_PT)
|
if (features->type >= INTUOSHT && features->type <= BAMBOO_PT)
|
||||||
features->device_type |= WACOM_DEVICETYPE_PAD;
|
features->device_type |= WACOM_DEVICETYPE_PAD;
|
||||||
|
|
||||||
features->x_max = 4096;
|
if (features->type == INTUOSHT2) {
|
||||||
features->y_max = 4096;
|
features->x_max = features->x_max / 10;
|
||||||
|
features->y_max = features->y_max / 10;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
features->x_max = 4096;
|
||||||
|
features->y_max = 4096;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (features->pktlen == WACOM_PKGLEN_BBTOUCH) {
|
else if (features->pktlen == WACOM_PKGLEN_BBTOUCH) {
|
||||||
features->device_type |= WACOM_DEVICETYPE_PAD;
|
features->device_type |= WACOM_DEVICETYPE_PAD;
|
||||||
|
|
|
@ -677,9 +677,6 @@ static int i2c_imx_dma_read(struct imx_i2c_struct *i2c_imx,
|
||||||
struct imx_i2c_dma *dma = i2c_imx->dma;
|
struct imx_i2c_dma *dma = i2c_imx->dma;
|
||||||
struct device *dev = &i2c_imx->adapter.dev;
|
struct device *dev = &i2c_imx->adapter.dev;
|
||||||
|
|
||||||
temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2CR);
|
|
||||||
temp |= I2CR_DMAEN;
|
|
||||||
imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2CR);
|
|
||||||
|
|
||||||
dma->chan_using = dma->chan_rx;
|
dma->chan_using = dma->chan_rx;
|
||||||
dma->dma_transfer_dir = DMA_DEV_TO_MEM;
|
dma->dma_transfer_dir = DMA_DEV_TO_MEM;
|
||||||
|
@ -792,6 +789,7 @@ static int i2c_imx_read(struct imx_i2c_struct *i2c_imx, struct i2c_msg *msgs, bo
|
||||||
int i, result;
|
int i, result;
|
||||||
unsigned int temp;
|
unsigned int temp;
|
||||||
int block_data = msgs->flags & I2C_M_RECV_LEN;
|
int block_data = msgs->flags & I2C_M_RECV_LEN;
|
||||||
|
int use_dma = i2c_imx->dma && msgs->len >= DMA_THRESHOLD && !block_data;
|
||||||
|
|
||||||
dev_dbg(&i2c_imx->adapter.dev,
|
dev_dbg(&i2c_imx->adapter.dev,
|
||||||
"<%s> write slave address: addr=0x%x\n",
|
"<%s> write slave address: addr=0x%x\n",
|
||||||
|
@ -818,12 +816,14 @@ static int i2c_imx_read(struct imx_i2c_struct *i2c_imx, struct i2c_msg *msgs, bo
|
||||||
*/
|
*/
|
||||||
if ((msgs->len - 1) || block_data)
|
if ((msgs->len - 1) || block_data)
|
||||||
temp &= ~I2CR_TXAK;
|
temp &= ~I2CR_TXAK;
|
||||||
|
if (use_dma)
|
||||||
|
temp |= I2CR_DMAEN;
|
||||||
imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2CR);
|
imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2CR);
|
||||||
imx_i2c_read_reg(i2c_imx, IMX_I2C_I2DR); /* dummy read */
|
imx_i2c_read_reg(i2c_imx, IMX_I2C_I2DR); /* dummy read */
|
||||||
|
|
||||||
dev_dbg(&i2c_imx->adapter.dev, "<%s> read data\n", __func__);
|
dev_dbg(&i2c_imx->adapter.dev, "<%s> read data\n", __func__);
|
||||||
|
|
||||||
if (i2c_imx->dma && msgs->len >= DMA_THRESHOLD && !block_data)
|
if (use_dma)
|
||||||
return i2c_imx_dma_read(i2c_imx, msgs, is_lastmsg);
|
return i2c_imx_dma_read(i2c_imx, msgs, is_lastmsg);
|
||||||
|
|
||||||
/* read data */
|
/* read data */
|
||||||
|
|
|
@ -1655,13 +1655,7 @@ isdn_ioctl(struct file *file, uint cmd, ulong arg)
|
||||||
} else
|
} else
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
case IIOCDBGVAR:
|
case IIOCDBGVAR:
|
||||||
if (arg) {
|
return -EINVAL;
|
||||||
if (copy_to_user(argp, &dev, sizeof(ulong)))
|
|
||||||
return -EFAULT;
|
|
||||||
return 0;
|
|
||||||
} else
|
|
||||||
return -EINVAL;
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
if ((cmd & IIOCDRVCTL) == IIOCDRVCTL)
|
if ((cmd & IIOCDRVCTL) == IIOCDRVCTL)
|
||||||
cmd = ((cmd >> _IOC_NRSHIFT) & _IOC_NRMASK) & ISDN_DRVIOCTL_MASK;
|
cmd = ((cmd >> _IOC_NRSHIFT) & _IOC_NRMASK) & ISDN_DRVIOCTL_MASK;
|
||||||
|
|
|
@ -3691,6 +3691,13 @@ static int run(struct mddev *mddev)
|
||||||
disk->rdev->saved_raid_disk < 0)
|
disk->rdev->saved_raid_disk < 0)
|
||||||
conf->fullsync = 1;
|
conf->fullsync = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (disk->replacement &&
|
||||||
|
!test_bit(In_sync, &disk->replacement->flags) &&
|
||||||
|
disk->replacement->saved_raid_disk < 0) {
|
||||||
|
conf->fullsync = 1;
|
||||||
|
}
|
||||||
|
|
||||||
disk->recovery_disabled = mddev->recovery_disabled - 1;
|
disk->recovery_disabled = mddev->recovery_disabled - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1634,6 +1634,7 @@ struct bnx2x {
|
||||||
struct link_vars link_vars;
|
struct link_vars link_vars;
|
||||||
u32 link_cnt;
|
u32 link_cnt;
|
||||||
struct bnx2x_link_report_data last_reported_link;
|
struct bnx2x_link_report_data last_reported_link;
|
||||||
|
bool force_link_down;
|
||||||
|
|
||||||
struct mdio_if_info mdio;
|
struct mdio_if_info mdio;
|
||||||
|
|
||||||
|
|
|
@ -1277,6 +1277,11 @@ void __bnx2x_link_report(struct bnx2x *bp)
|
||||||
{
|
{
|
||||||
struct bnx2x_link_report_data cur_data;
|
struct bnx2x_link_report_data cur_data;
|
||||||
|
|
||||||
|
if (bp->force_link_down) {
|
||||||
|
bp->link_vars.link_up = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* reread mf_cfg */
|
/* reread mf_cfg */
|
||||||
if (IS_PF(bp) && !CHIP_IS_E1(bp))
|
if (IS_PF(bp) && !CHIP_IS_E1(bp))
|
||||||
bnx2x_read_mf_cfg(bp);
|
bnx2x_read_mf_cfg(bp);
|
||||||
|
@ -2840,6 +2845,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
|
||||||
bp->pending_max = 0;
|
bp->pending_max = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bp->force_link_down = false;
|
||||||
if (bp->port.pmf) {
|
if (bp->port.pmf) {
|
||||||
rc = bnx2x_initial_phy_init(bp, load_mode);
|
rc = bnx2x_initial_phy_init(bp, load_mode);
|
||||||
if (rc)
|
if (rc)
|
||||||
|
|
|
@ -10222,6 +10222,12 @@ static void bnx2x_sp_rtnl_task(struct work_struct *work)
|
||||||
bp->sp_rtnl_state = 0;
|
bp->sp_rtnl_state = 0;
|
||||||
smp_mb();
|
smp_mb();
|
||||||
|
|
||||||
|
/* Immediately indicate link as down */
|
||||||
|
bp->link_vars.link_up = 0;
|
||||||
|
bp->force_link_down = true;
|
||||||
|
netif_carrier_off(bp->dev);
|
||||||
|
BNX2X_ERR("Indicating link is down due to Tx-timeout\n");
|
||||||
|
|
||||||
bnx2x_nic_unload(bp, UNLOAD_NORMAL, true);
|
bnx2x_nic_unload(bp, UNLOAD_NORMAL, true);
|
||||||
bnx2x_nic_load(bp, LOAD_NORMAL);
|
bnx2x_nic_load(bp, LOAD_NORMAL);
|
||||||
|
|
||||||
|
|
|
@ -4591,7 +4591,7 @@ static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)
|
||||||
rc = bnxt_request_irq(bp);
|
rc = bnxt_request_irq(bp);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
netdev_err(bp->dev, "bnxt_request_irq err: %x\n", rc);
|
netdev_err(bp->dev, "bnxt_request_irq err: %x\n", rc);
|
||||||
goto open_err;
|
goto open_err_irq;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4629,6 +4629,8 @@ static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)
|
||||||
|
|
||||||
open_err:
|
open_err:
|
||||||
bnxt_disable_napi(bp);
|
bnxt_disable_napi(bp);
|
||||||
|
|
||||||
|
open_err_irq:
|
||||||
bnxt_del_napi(bp);
|
bnxt_del_napi(bp);
|
||||||
|
|
||||||
open_err_free_mem:
|
open_err_free_mem:
|
||||||
|
|
|
@ -338,7 +338,7 @@ static void dcb_tx_queue_prio_enable(struct net_device *dev, int enable)
|
||||||
"Can't %s DCB Priority on port %d, TX Queue %d: err=%d\n",
|
"Can't %s DCB Priority on port %d, TX Queue %d: err=%d\n",
|
||||||
enable ? "set" : "unset", pi->port_id, i, -err);
|
enable ? "set" : "unset", pi->port_id, i, -err);
|
||||||
else
|
else
|
||||||
txq->dcb_prio = value;
|
txq->dcb_prio = enable ? value : 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_CHELSIO_T4_DCB */
|
#endif /* CONFIG_CHELSIO_T4_DCB */
|
||||||
|
|
|
@ -78,7 +78,6 @@ void enic_rfs_flw_tbl_init(struct enic *enic)
|
||||||
enic->rfs_h.max = enic->config.num_arfs;
|
enic->rfs_h.max = enic->config.num_arfs;
|
||||||
enic->rfs_h.free = enic->rfs_h.max;
|
enic->rfs_h.free = enic->rfs_h.max;
|
||||||
enic->rfs_h.toclean = 0;
|
enic->rfs_h.toclean = 0;
|
||||||
enic_rfs_timer_start(enic);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void enic_rfs_flw_tbl_free(struct enic *enic)
|
void enic_rfs_flw_tbl_free(struct enic *enic)
|
||||||
|
@ -87,7 +86,6 @@ void enic_rfs_flw_tbl_free(struct enic *enic)
|
||||||
|
|
||||||
enic_rfs_timer_stop(enic);
|
enic_rfs_timer_stop(enic);
|
||||||
spin_lock_bh(&enic->rfs_h.lock);
|
spin_lock_bh(&enic->rfs_h.lock);
|
||||||
enic->rfs_h.free = 0;
|
|
||||||
for (i = 0; i < (1 << ENIC_RFS_FLW_BITSHIFT); i++) {
|
for (i = 0; i < (1 << ENIC_RFS_FLW_BITSHIFT); i++) {
|
||||||
struct hlist_head *hhead;
|
struct hlist_head *hhead;
|
||||||
struct hlist_node *tmp;
|
struct hlist_node *tmp;
|
||||||
|
@ -98,6 +96,7 @@ void enic_rfs_flw_tbl_free(struct enic *enic)
|
||||||
enic_delfltr(enic, n->fltr_id);
|
enic_delfltr(enic, n->fltr_id);
|
||||||
hlist_del(&n->node);
|
hlist_del(&n->node);
|
||||||
kfree(n);
|
kfree(n);
|
||||||
|
enic->rfs_h.free++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
spin_unlock_bh(&enic->rfs_h.lock);
|
spin_unlock_bh(&enic->rfs_h.lock);
|
||||||
|
|
|
@ -1760,7 +1760,7 @@ static int enic_open(struct net_device *netdev)
|
||||||
vnic_intr_unmask(&enic->intr[i]);
|
vnic_intr_unmask(&enic->intr[i]);
|
||||||
|
|
||||||
enic_notify_timer_start(enic);
|
enic_notify_timer_start(enic);
|
||||||
enic_rfs_flw_tbl_init(enic);
|
enic_rfs_timer_start(enic);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
@ -2694,6 +2694,7 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||||
enic->notify_timer.function = enic_notify_timer;
|
enic->notify_timer.function = enic_notify_timer;
|
||||||
enic->notify_timer.data = (unsigned long)enic;
|
enic->notify_timer.data = (unsigned long)enic;
|
||||||
|
|
||||||
|
enic_rfs_flw_tbl_init(enic);
|
||||||
enic_set_rx_coal_setting(enic);
|
enic_set_rx_coal_setting(enic);
|
||||||
INIT_WORK(&enic->reset, enic_reset);
|
INIT_WORK(&enic->reset, enic_reset);
|
||||||
INIT_WORK(&enic->tx_hang_reset, enic_tx_hang_reset);
|
INIT_WORK(&enic->tx_hang_reset, enic_tx_hang_reset);
|
||||||
|
|
|
@ -1814,7 +1814,12 @@ s32 ixgbe_set_rar_generic(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq,
|
||||||
if (enable_addr != 0)
|
if (enable_addr != 0)
|
||||||
rar_high |= IXGBE_RAH_AV;
|
rar_high |= IXGBE_RAH_AV;
|
||||||
|
|
||||||
|
/* Record lower 32 bits of MAC address and then make
|
||||||
|
* sure that write is flushed to hardware before writing
|
||||||
|
* the upper 16 bits and setting the valid bit.
|
||||||
|
*/
|
||||||
IXGBE_WRITE_REG(hw, IXGBE_RAL(index), rar_low);
|
IXGBE_WRITE_REG(hw, IXGBE_RAL(index), rar_low);
|
||||||
|
IXGBE_WRITE_FLUSH(hw);
|
||||||
IXGBE_WRITE_REG(hw, IXGBE_RAH(index), rar_high);
|
IXGBE_WRITE_REG(hw, IXGBE_RAH(index), rar_high);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1846,8 +1851,13 @@ s32 ixgbe_clear_rar_generic(struct ixgbe_hw *hw, u32 index)
|
||||||
rar_high = IXGBE_READ_REG(hw, IXGBE_RAH(index));
|
rar_high = IXGBE_READ_REG(hw, IXGBE_RAH(index));
|
||||||
rar_high &= ~(0x0000FFFF | IXGBE_RAH_AV);
|
rar_high &= ~(0x0000FFFF | IXGBE_RAH_AV);
|
||||||
|
|
||||||
IXGBE_WRITE_REG(hw, IXGBE_RAL(index), 0);
|
/* Clear the address valid bit and upper 16 bits of the address
|
||||||
|
* before clearing the lower bits. This way we aren't updating
|
||||||
|
* a live filter.
|
||||||
|
*/
|
||||||
IXGBE_WRITE_REG(hw, IXGBE_RAH(index), rar_high);
|
IXGBE_WRITE_REG(hw, IXGBE_RAH(index), rar_high);
|
||||||
|
IXGBE_WRITE_FLUSH(hw);
|
||||||
|
IXGBE_WRITE_REG(hw, IXGBE_RAL(index), 0);
|
||||||
|
|
||||||
/* clear VMDq pool/queue selection for this RAR */
|
/* clear VMDq pool/queue selection for this RAR */
|
||||||
hw->mac.ops.clear_vmdq(hw, index, IXGBE_CLEAR_VMDQ_ALL);
|
hw->mac.ops.clear_vmdq(hw, index, IXGBE_CLEAR_VMDQ_ALL);
|
||||||
|
|
|
@ -461,8 +461,16 @@ static irqreturn_t qed_single_int(int irq, void *dev_instance)
|
||||||
/* Fastpath interrupts */
|
/* Fastpath interrupts */
|
||||||
for (j = 0; j < 64; j++) {
|
for (j = 0; j < 64; j++) {
|
||||||
if ((0x2ULL << j) & status) {
|
if ((0x2ULL << j) & status) {
|
||||||
hwfn->simd_proto_handler[j].func(
|
struct qed_simd_fp_handler *p_handler =
|
||||||
hwfn->simd_proto_handler[j].token);
|
&hwfn->simd_proto_handler[j];
|
||||||
|
|
||||||
|
if (p_handler->func)
|
||||||
|
p_handler->func(p_handler->token);
|
||||||
|
else
|
||||||
|
DP_NOTICE(hwfn,
|
||||||
|
"Not calling fastpath handler as it is NULL [handler #%d, status 0x%llx]\n",
|
||||||
|
j, status);
|
||||||
|
|
||||||
status &= ~(0x2ULL << j);
|
status &= ~(0x2ULL << j);
|
||||||
rc = IRQ_HANDLED;
|
rc = IRQ_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1128,6 +1128,8 @@ static ssize_t qlcnic_83xx_sysfs_flash_write_handler(struct file *filp,
|
||||||
struct qlcnic_adapter *adapter = dev_get_drvdata(dev);
|
struct qlcnic_adapter *adapter = dev_get_drvdata(dev);
|
||||||
|
|
||||||
ret = kstrtoul(buf, 16, &data);
|
ret = kstrtoul(buf, 16, &data);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
switch (data) {
|
switch (data) {
|
||||||
case QLC_83XX_FLASH_SECTOR_ERASE_CMD:
|
case QLC_83XX_FLASH_SECTOR_ERASE_CMD:
|
||||||
|
|
|
@ -635,7 +635,7 @@ qcaspi_netdev_open(struct net_device *dev)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
netif_start_queue(qca->net_dev);
|
/* SPI thread takes care of TX queue */
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -739,6 +739,9 @@ qcaspi_netdev_tx_timeout(struct net_device *dev)
|
||||||
qca->net_dev->stats.tx_errors++;
|
qca->net_dev->stats.tx_errors++;
|
||||||
/* Trigger tx queue flush and QCA7000 reset */
|
/* Trigger tx queue flush and QCA7000 reset */
|
||||||
qca->sync = QCASPI_SYNC_UNKNOWN;
|
qca->sync = QCASPI_SYNC_UNKNOWN;
|
||||||
|
|
||||||
|
if (qca->spi_thread)
|
||||||
|
wake_up_process(qca->spi_thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -865,22 +868,22 @@ qca_spi_probe(struct spi_device *spi)
|
||||||
|
|
||||||
if ((qcaspi_clkspeed < QCASPI_CLK_SPEED_MIN) ||
|
if ((qcaspi_clkspeed < QCASPI_CLK_SPEED_MIN) ||
|
||||||
(qcaspi_clkspeed > QCASPI_CLK_SPEED_MAX)) {
|
(qcaspi_clkspeed > QCASPI_CLK_SPEED_MAX)) {
|
||||||
dev_info(&spi->dev, "Invalid clkspeed: %d\n",
|
dev_err(&spi->dev, "Invalid clkspeed: %d\n",
|
||||||
qcaspi_clkspeed);
|
qcaspi_clkspeed);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((qcaspi_burst_len < QCASPI_BURST_LEN_MIN) ||
|
if ((qcaspi_burst_len < QCASPI_BURST_LEN_MIN) ||
|
||||||
(qcaspi_burst_len > QCASPI_BURST_LEN_MAX)) {
|
(qcaspi_burst_len > QCASPI_BURST_LEN_MAX)) {
|
||||||
dev_info(&spi->dev, "Invalid burst len: %d\n",
|
dev_err(&spi->dev, "Invalid burst len: %d\n",
|
||||||
qcaspi_burst_len);
|
qcaspi_burst_len);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((qcaspi_pluggable < QCASPI_PLUGGABLE_MIN) ||
|
if ((qcaspi_pluggable < QCASPI_PLUGGABLE_MIN) ||
|
||||||
(qcaspi_pluggable > QCASPI_PLUGGABLE_MAX)) {
|
(qcaspi_pluggable > QCASPI_PLUGGABLE_MAX)) {
|
||||||
dev_info(&spi->dev, "Invalid pluggable: %d\n",
|
dev_err(&spi->dev, "Invalid pluggable: %d\n",
|
||||||
qcaspi_pluggable);
|
qcaspi_pluggable);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -941,8 +944,8 @@ qca_spi_probe(struct spi_device *spi)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (register_netdev(qcaspi_devs)) {
|
if (register_netdev(qcaspi_devs)) {
|
||||||
dev_info(&spi->dev, "Unable to register net device %s\n",
|
dev_err(&spi->dev, "Unable to register net device %s\n",
|
||||||
qcaspi_devs->name);
|
qcaspi_devs->name);
|
||||||
free_netdev(qcaspi_devs);
|
free_netdev(qcaspi_devs);
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1517,6 +1517,10 @@ static int emac_devioctl(struct net_device *ndev, struct ifreq *ifrq, int cmd)
|
||||||
|
|
||||||
static int match_first_device(struct device *dev, void *data)
|
static int match_first_device(struct device *dev, void *data)
|
||||||
{
|
{
|
||||||
|
if (dev->parent && dev->parent->of_node)
|
||||||
|
return of_device_is_compatible(dev->parent->of_node,
|
||||||
|
"ti,davinci_mdio");
|
||||||
|
|
||||||
return !strncmp(dev_name(dev), "davinci_mdio", 12);
|
return !strncmp(dev_name(dev), "davinci_mdio", 12);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,10 +89,6 @@
|
||||||
static const char banner[] __initconst = KERN_INFO \
|
static const char banner[] __initconst = KERN_INFO \
|
||||||
"AX.25: bpqether driver version 004\n";
|
"AX.25: bpqether driver version 004\n";
|
||||||
|
|
||||||
static char bcast_addr[6]={0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
|
|
||||||
|
|
||||||
static char bpq_eth_addr[6];
|
|
||||||
|
|
||||||
static int bpq_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *);
|
static int bpq_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *);
|
||||||
static int bpq_device_event(struct notifier_block *, unsigned long, void *);
|
static int bpq_device_event(struct notifier_block *, unsigned long, void *);
|
||||||
|
|
||||||
|
@ -515,8 +511,8 @@ static int bpq_new_device(struct net_device *edev)
|
||||||
bpq->ethdev = edev;
|
bpq->ethdev = edev;
|
||||||
bpq->axdev = ndev;
|
bpq->axdev = ndev;
|
||||||
|
|
||||||
memcpy(bpq->dest_addr, bcast_addr, sizeof(bpq_eth_addr));
|
eth_broadcast_addr(bpq->dest_addr);
|
||||||
memcpy(bpq->acpt_addr, bcast_addr, sizeof(bpq_eth_addr));
|
eth_broadcast_addr(bpq->acpt_addr);
|
||||||
|
|
||||||
err = register_netdevice(ndev);
|
err = register_netdevice(ndev);
|
||||||
if (err)
|
if (err)
|
||||||
|
|
|
@ -932,7 +932,7 @@ at86rf230_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
|
||||||
static int
|
static int
|
||||||
at86rf230_ed(struct ieee802154_hw *hw, u8 *level)
|
at86rf230_ed(struct ieee802154_hw *hw, u8 *level)
|
||||||
{
|
{
|
||||||
BUG_ON(!level);
|
WARN_ON(!level);
|
||||||
*level = 0xbe;
|
*level = 0xbe;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1108,8 +1108,7 @@ at86rf230_set_hw_addr_filt(struct ieee802154_hw *hw,
|
||||||
if (changed & IEEE802154_AFILT_SADDR_CHANGED) {
|
if (changed & IEEE802154_AFILT_SADDR_CHANGED) {
|
||||||
u16 addr = le16_to_cpu(filt->short_addr);
|
u16 addr = le16_to_cpu(filt->short_addr);
|
||||||
|
|
||||||
dev_vdbg(&lp->spi->dev,
|
dev_vdbg(&lp->spi->dev, "%s called for saddr\n", __func__);
|
||||||
"at86rf230_set_hw_addr_filt called for saddr\n");
|
|
||||||
__at86rf230_write(lp, RG_SHORT_ADDR_0, addr);
|
__at86rf230_write(lp, RG_SHORT_ADDR_0, addr);
|
||||||
__at86rf230_write(lp, RG_SHORT_ADDR_1, addr >> 8);
|
__at86rf230_write(lp, RG_SHORT_ADDR_1, addr >> 8);
|
||||||
}
|
}
|
||||||
|
@ -1117,8 +1116,7 @@ at86rf230_set_hw_addr_filt(struct ieee802154_hw *hw,
|
||||||
if (changed & IEEE802154_AFILT_PANID_CHANGED) {
|
if (changed & IEEE802154_AFILT_PANID_CHANGED) {
|
||||||
u16 pan = le16_to_cpu(filt->pan_id);
|
u16 pan = le16_to_cpu(filt->pan_id);
|
||||||
|
|
||||||
dev_vdbg(&lp->spi->dev,
|
dev_vdbg(&lp->spi->dev, "%s called for pan id\n", __func__);
|
||||||
"at86rf230_set_hw_addr_filt called for pan id\n");
|
|
||||||
__at86rf230_write(lp, RG_PAN_ID_0, pan);
|
__at86rf230_write(lp, RG_PAN_ID_0, pan);
|
||||||
__at86rf230_write(lp, RG_PAN_ID_1, pan >> 8);
|
__at86rf230_write(lp, RG_PAN_ID_1, pan >> 8);
|
||||||
}
|
}
|
||||||
|
@ -1127,15 +1125,13 @@ at86rf230_set_hw_addr_filt(struct ieee802154_hw *hw,
|
||||||
u8 i, addr[8];
|
u8 i, addr[8];
|
||||||
|
|
||||||
memcpy(addr, &filt->ieee_addr, 8);
|
memcpy(addr, &filt->ieee_addr, 8);
|
||||||
dev_vdbg(&lp->spi->dev,
|
dev_vdbg(&lp->spi->dev, "%s called for IEEE addr\n", __func__);
|
||||||
"at86rf230_set_hw_addr_filt called for IEEE addr\n");
|
|
||||||
for (i = 0; i < 8; i++)
|
for (i = 0; i < 8; i++)
|
||||||
__at86rf230_write(lp, RG_IEEE_ADDR_0 + i, addr[i]);
|
__at86rf230_write(lp, RG_IEEE_ADDR_0 + i, addr[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changed & IEEE802154_AFILT_PANC_CHANGED) {
|
if (changed & IEEE802154_AFILT_PANC_CHANGED) {
|
||||||
dev_vdbg(&lp->spi->dev,
|
dev_vdbg(&lp->spi->dev, "%s called for panc change\n", __func__);
|
||||||
"at86rf230_set_hw_addr_filt called for panc change\n");
|
|
||||||
if (filt->pan_coord)
|
if (filt->pan_coord)
|
||||||
at86rf230_write_subreg(lp, SR_AACK_I_AM_COORD, 1);
|
at86rf230_write_subreg(lp, SR_AACK_I_AM_COORD, 1);
|
||||||
else
|
else
|
||||||
|
@ -1239,7 +1235,6 @@ at86rf230_set_cca_mode(struct ieee802154_hw *hw,
|
||||||
return at86rf230_write_subreg(lp, SR_CCA_MODE, val);
|
return at86rf230_write_subreg(lp, SR_CCA_MODE, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
at86rf230_set_cca_ed_level(struct ieee802154_hw *hw, s32 mbm)
|
at86rf230_set_cca_ed_level(struct ieee802154_hw *hw, s32 mbm)
|
||||||
{
|
{
|
||||||
|
|
|
@ -49,7 +49,7 @@ struct fakelb_phy {
|
||||||
|
|
||||||
static int fakelb_hw_ed(struct ieee802154_hw *hw, u8 *level)
|
static int fakelb_hw_ed(struct ieee802154_hw *hw, u8 *level)
|
||||||
{
|
{
|
||||||
BUG_ON(!level);
|
WARN_ON(!level);
|
||||||
*level = 0xbe;
|
*level = 0xbe;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -681,7 +681,7 @@ static void rtl8150_set_multicast(struct net_device *netdev)
|
||||||
(netdev->flags & IFF_ALLMULTI)) {
|
(netdev->flags & IFF_ALLMULTI)) {
|
||||||
rx_creg &= 0xfffe;
|
rx_creg &= 0xfffe;
|
||||||
rx_creg |= 0x0002;
|
rx_creg |= 0x0002;
|
||||||
dev_info(&netdev->dev, "%s: allmulti set\n", netdev->name);
|
dev_dbg(&netdev->dev, "%s: allmulti set\n", netdev->name);
|
||||||
} else {
|
} else {
|
||||||
/* ~RX_MULTICAST, ~RX_PROMISCUOUS */
|
/* ~RX_MULTICAST, ~RX_PROMISCUOUS */
|
||||||
rx_creg &= 0x00fc;
|
rx_creg &= 0x00fc;
|
||||||
|
|
|
@ -81,6 +81,9 @@ static bool turbo_mode = true;
|
||||||
module_param(turbo_mode, bool, 0644);
|
module_param(turbo_mode, bool, 0644);
|
||||||
MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction");
|
MODULE_PARM_DESC(turbo_mode, "Enable multiple frames per Rx transaction");
|
||||||
|
|
||||||
|
static int smsc75xx_link_ok_nopm(struct usbnet *dev);
|
||||||
|
static int smsc75xx_phy_gig_workaround(struct usbnet *dev);
|
||||||
|
|
||||||
static int __must_check __smsc75xx_read_reg(struct usbnet *dev, u32 index,
|
static int __must_check __smsc75xx_read_reg(struct usbnet *dev, u32 index,
|
||||||
u32 *data, int in_pm)
|
u32 *data, int in_pm)
|
||||||
{
|
{
|
||||||
|
@ -840,6 +843,9 @@ static int smsc75xx_phy_initialize(struct usbnet *dev)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* phy workaround for gig link */
|
||||||
|
smsc75xx_phy_gig_workaround(dev);
|
||||||
|
|
||||||
smsc75xx_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE,
|
smsc75xx_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE,
|
||||||
ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP |
|
ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP |
|
||||||
ADVERTISE_PAUSE_ASYM);
|
ADVERTISE_PAUSE_ASYM);
|
||||||
|
@ -978,6 +984,62 @@ static int smsc75xx_wait_ready(struct usbnet *dev, int in_pm)
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int smsc75xx_phy_gig_workaround(struct usbnet *dev)
|
||||||
|
{
|
||||||
|
struct mii_if_info *mii = &dev->mii;
|
||||||
|
int ret = 0, timeout = 0;
|
||||||
|
u32 buf, link_up = 0;
|
||||||
|
|
||||||
|
/* Set the phy in Gig loopback */
|
||||||
|
smsc75xx_mdio_write(dev->net, mii->phy_id, MII_BMCR, 0x4040);
|
||||||
|
|
||||||
|
/* Wait for the link up */
|
||||||
|
do {
|
||||||
|
link_up = smsc75xx_link_ok_nopm(dev);
|
||||||
|
usleep_range(10000, 20000);
|
||||||
|
timeout++;
|
||||||
|
} while ((!link_up) && (timeout < 1000));
|
||||||
|
|
||||||
|
if (timeout >= 1000) {
|
||||||
|
netdev_warn(dev->net, "Timeout waiting for PHY link up\n");
|
||||||
|
return -EIO;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* phy reset */
|
||||||
|
ret = smsc75xx_read_reg(dev, PMT_CTL, &buf);
|
||||||
|
if (ret < 0) {
|
||||||
|
netdev_warn(dev->net, "Failed to read PMT_CTL: %d\n", ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
buf |= PMT_CTL_PHY_RST;
|
||||||
|
|
||||||
|
ret = smsc75xx_write_reg(dev, PMT_CTL, buf);
|
||||||
|
if (ret < 0) {
|
||||||
|
netdev_warn(dev->net, "Failed to write PMT_CTL: %d\n", ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
timeout = 0;
|
||||||
|
do {
|
||||||
|
usleep_range(10000, 20000);
|
||||||
|
ret = smsc75xx_read_reg(dev, PMT_CTL, &buf);
|
||||||
|
if (ret < 0) {
|
||||||
|
netdev_warn(dev->net, "Failed to read PMT_CTL: %d\n",
|
||||||
|
ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
timeout++;
|
||||||
|
} while ((buf & PMT_CTL_PHY_RST) && (timeout < 100));
|
||||||
|
|
||||||
|
if (timeout >= 100) {
|
||||||
|
netdev_warn(dev->net, "timeout waiting for PHY Reset\n");
|
||||||
|
return -EIO;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int smsc75xx_reset(struct usbnet *dev)
|
static int smsc75xx_reset(struct usbnet *dev)
|
||||||
{
|
{
|
||||||
struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]);
|
struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]);
|
||||||
|
|
|
@ -4290,6 +4290,13 @@ void brcmf_sdio_remove(struct brcmf_sdio *bus)
|
||||||
brcmf_dbg(TRACE, "Enter\n");
|
brcmf_dbg(TRACE, "Enter\n");
|
||||||
|
|
||||||
if (bus) {
|
if (bus) {
|
||||||
|
/* Stop watchdog task */
|
||||||
|
if (bus->watchdog_tsk) {
|
||||||
|
send_sig(SIGTERM, bus->watchdog_tsk, 1);
|
||||||
|
kthread_stop(bus->watchdog_tsk);
|
||||||
|
bus->watchdog_tsk = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* De-register interrupt handler */
|
/* De-register interrupt handler */
|
||||||
brcmf_sdiod_intr_unregister(bus->sdiodev);
|
brcmf_sdiod_intr_unregister(bus->sdiodev);
|
||||||
|
|
||||||
|
|
|
@ -457,8 +457,17 @@ int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *bus,
|
||||||
list_add(&slot->slot_list, &pci_hotplug_slot_list);
|
list_add(&slot->slot_list, &pci_hotplug_slot_list);
|
||||||
|
|
||||||
result = fs_add_slot(pci_slot);
|
result = fs_add_slot(pci_slot);
|
||||||
|
if (result)
|
||||||
|
goto err_list_del;
|
||||||
|
|
||||||
kobject_uevent(&pci_slot->kobj, KOBJ_ADD);
|
kobject_uevent(&pci_slot->kobj, KOBJ_ADD);
|
||||||
dbg("Added slot %s to the list\n", name);
|
dbg("Added slot %s to the list\n", name);
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
err_list_del:
|
||||||
|
list_del(&slot->slot_list);
|
||||||
|
pci_slot->hotplug = NULL;
|
||||||
|
pci_destroy_slot(pci_slot);
|
||||||
out:
|
out:
|
||||||
mutex_unlock(&pci_hp_mutex);
|
mutex_unlock(&pci_hp_mutex);
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -132,6 +132,7 @@ int pciehp_unconfigure_device(struct slot *p_slot);
|
||||||
void pciehp_queue_pushbutton_work(struct work_struct *work);
|
void pciehp_queue_pushbutton_work(struct work_struct *work);
|
||||||
struct controller *pcie_init(struct pcie_device *dev);
|
struct controller *pcie_init(struct pcie_device *dev);
|
||||||
int pcie_init_notification(struct controller *ctrl);
|
int pcie_init_notification(struct controller *ctrl);
|
||||||
|
void pcie_shutdown_notification(struct controller *ctrl);
|
||||||
int pciehp_enable_slot(struct slot *p_slot);
|
int pciehp_enable_slot(struct slot *p_slot);
|
||||||
int pciehp_disable_slot(struct slot *p_slot);
|
int pciehp_disable_slot(struct slot *p_slot);
|
||||||
void pcie_reenable_notification(struct controller *ctrl);
|
void pcie_reenable_notification(struct controller *ctrl);
|
||||||
|
|
|
@ -77,6 +77,12 @@ static int reset_slot (struct hotplug_slot *slot, int probe);
|
||||||
*/
|
*/
|
||||||
static void release_slot(struct hotplug_slot *hotplug_slot)
|
static void release_slot(struct hotplug_slot *hotplug_slot)
|
||||||
{
|
{
|
||||||
|
struct slot *slot = hotplug_slot->private;
|
||||||
|
|
||||||
|
/* queued work needs hotplug_slot name */
|
||||||
|
cancel_delayed_work(&slot->work);
|
||||||
|
drain_workqueue(slot->wq);
|
||||||
|
|
||||||
kfree(hotplug_slot->ops);
|
kfree(hotplug_slot->ops);
|
||||||
kfree(hotplug_slot->info);
|
kfree(hotplug_slot->info);
|
||||||
kfree(hotplug_slot);
|
kfree(hotplug_slot);
|
||||||
|
@ -276,6 +282,7 @@ static void pciehp_remove(struct pcie_device *dev)
|
||||||
{
|
{
|
||||||
struct controller *ctrl = get_service_data(dev);
|
struct controller *ctrl = get_service_data(dev);
|
||||||
|
|
||||||
|
pcie_shutdown_notification(ctrl);
|
||||||
cleanup_slot(ctrl);
|
cleanup_slot(ctrl);
|
||||||
pciehp_release_ctrl(ctrl);
|
pciehp_release_ctrl(ctrl);
|
||||||
}
|
}
|
||||||
|
|
|
@ -741,7 +741,7 @@ int pcie_init_notification(struct controller *ctrl)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pcie_shutdown_notification(struct controller *ctrl)
|
void pcie_shutdown_notification(struct controller *ctrl)
|
||||||
{
|
{
|
||||||
if (ctrl->notification_enabled) {
|
if (ctrl->notification_enabled) {
|
||||||
pcie_disable_notification(ctrl);
|
pcie_disable_notification(ctrl);
|
||||||
|
@ -776,7 +776,7 @@ abort:
|
||||||
static void pcie_cleanup_slot(struct controller *ctrl)
|
static void pcie_cleanup_slot(struct controller *ctrl)
|
||||||
{
|
{
|
||||||
struct slot *slot = ctrl->slot;
|
struct slot *slot = ctrl->slot;
|
||||||
cancel_delayed_work(&slot->work);
|
|
||||||
destroy_workqueue(slot->wq);
|
destroy_workqueue(slot->wq);
|
||||||
kfree(slot);
|
kfree(slot);
|
||||||
}
|
}
|
||||||
|
@ -853,7 +853,6 @@ abort:
|
||||||
|
|
||||||
void pciehp_release_ctrl(struct controller *ctrl)
|
void pciehp_release_ctrl(struct controller *ctrl)
|
||||||
{
|
{
|
||||||
pcie_shutdown_notification(ctrl);
|
|
||||||
pcie_cleanup_slot(ctrl);
|
pcie_cleanup_slot(ctrl);
|
||||||
kfree(ctrl);
|
kfree(ctrl);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1338,6 +1338,10 @@ static void pci_configure_mps(struct pci_dev *dev)
|
||||||
if (!pci_is_pcie(dev) || !bridge || !pci_is_pcie(bridge))
|
if (!pci_is_pcie(dev) || !bridge || !pci_is_pcie(bridge))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* MPS and MRRS fields are of type 'RsvdP' for VFs, short-circuit out */
|
||||||
|
if (dev->is_virtfn)
|
||||||
|
return;
|
||||||
|
|
||||||
mps = pcie_get_mps(dev);
|
mps = pcie_get_mps(dev);
|
||||||
p_mps = pcie_get_mps(bridge);
|
p_mps = pcie_get_mps(bridge);
|
||||||
|
|
||||||
|
|
|
@ -676,10 +676,17 @@ static int scsifront_dev_reset_handler(struct scsi_cmnd *sc)
|
||||||
static int scsifront_sdev_configure(struct scsi_device *sdev)
|
static int scsifront_sdev_configure(struct scsi_device *sdev)
|
||||||
{
|
{
|
||||||
struct vscsifrnt_info *info = shost_priv(sdev->host);
|
struct vscsifrnt_info *info = shost_priv(sdev->host);
|
||||||
|
int err;
|
||||||
|
|
||||||
if (info && current == info->curr)
|
if (info && current == info->curr) {
|
||||||
xenbus_printf(XBT_NIL, info->dev->nodename,
|
err = xenbus_printf(XBT_NIL, info->dev->nodename,
|
||||||
info->dev_state_path, "%d", XenbusStateConnected);
|
info->dev_state_path, "%d", XenbusStateConnected);
|
||||||
|
if (err) {
|
||||||
|
xenbus_dev_error(info->dev, err,
|
||||||
|
"%s: writing dev_state_path", __func__);
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -687,10 +694,15 @@ static int scsifront_sdev_configure(struct scsi_device *sdev)
|
||||||
static void scsifront_sdev_destroy(struct scsi_device *sdev)
|
static void scsifront_sdev_destroy(struct scsi_device *sdev)
|
||||||
{
|
{
|
||||||
struct vscsifrnt_info *info = shost_priv(sdev->host);
|
struct vscsifrnt_info *info = shost_priv(sdev->host);
|
||||||
|
int err;
|
||||||
|
|
||||||
if (info && current == info->curr)
|
if (info && current == info->curr) {
|
||||||
xenbus_printf(XBT_NIL, info->dev->nodename,
|
err = xenbus_printf(XBT_NIL, info->dev->nodename,
|
||||||
info->dev_state_path, "%d", XenbusStateClosed);
|
info->dev_state_path, "%d", XenbusStateClosed);
|
||||||
|
if (err)
|
||||||
|
xenbus_dev_error(info->dev, err,
|
||||||
|
"%s: writing dev_state_path", __func__);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct scsi_host_template scsifront_sht = {
|
static struct scsi_host_template scsifront_sht = {
|
||||||
|
@ -1025,9 +1037,12 @@ static void scsifront_do_lun_hotplug(struct vscsifrnt_info *info, int op)
|
||||||
|
|
||||||
if (scsi_add_device(info->host, chn, tgt, lun)) {
|
if (scsi_add_device(info->host, chn, tgt, lun)) {
|
||||||
dev_err(&dev->dev, "scsi_add_device\n");
|
dev_err(&dev->dev, "scsi_add_device\n");
|
||||||
xenbus_printf(XBT_NIL, dev->nodename,
|
err = xenbus_printf(XBT_NIL, dev->nodename,
|
||||||
info->dev_state_path,
|
info->dev_state_path,
|
||||||
"%d", XenbusStateClosed);
|
"%d", XenbusStateClosed);
|
||||||
|
if (err)
|
||||||
|
xenbus_dev_error(dev, err,
|
||||||
|
"%s: writing dev_state_path", __func__);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VSCSIFRONT_OP_DEL_LUN:
|
case VSCSIFRONT_OP_DEL_LUN:
|
||||||
|
@ -1041,10 +1056,14 @@ static void scsifront_do_lun_hotplug(struct vscsifrnt_info *info, int op)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VSCSIFRONT_OP_READD_LUN:
|
case VSCSIFRONT_OP_READD_LUN:
|
||||||
if (device_state == XenbusStateConnected)
|
if (device_state == XenbusStateConnected) {
|
||||||
xenbus_printf(XBT_NIL, dev->nodename,
|
err = xenbus_printf(XBT_NIL, dev->nodename,
|
||||||
info->dev_state_path,
|
info->dev_state_path,
|
||||||
"%d", XenbusStateConnected);
|
"%d", XenbusStateConnected);
|
||||||
|
if (err)
|
||||||
|
xenbus_dev_error(dev, err,
|
||||||
|
"%s: writing dev_state_path", __func__);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -403,7 +403,8 @@ static void ion_handle_get(struct ion_handle *handle)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Must hold the client lock */
|
/* Must hold the client lock */
|
||||||
static struct ion_handle* ion_handle_get_check_overflow(struct ion_handle *handle)
|
static struct ion_handle *ion_handle_get_check_overflow(
|
||||||
|
struct ion_handle *handle)
|
||||||
{
|
{
|
||||||
if (atomic_read(&handle->ref.refcount) + 1 == 0)
|
if (atomic_read(&handle->ref.refcount) + 1 == 0)
|
||||||
return ERR_PTR(-EOVERFLOW);
|
return ERR_PTR(-EOVERFLOW);
|
||||||
|
|
|
@ -224,7 +224,7 @@ static void dw8250_set_termios(struct uart_port *p, struct ktermios *termios,
|
||||||
unsigned int rate;
|
unsigned int rate;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (IS_ERR(d->clk) || !old)
|
if (IS_ERR(d->clk))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
clk_disable_unprepare(d->clk);
|
clk_disable_unprepare(d->clk);
|
||||||
|
|
|
@ -3657,9 +3657,11 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg, int irq)
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = usb_add_gadget_udc(dev, &hsotg->gadget);
|
ret = usb_add_gadget_udc(dev, &hsotg->gadget);
|
||||||
if (ret)
|
if (ret) {
|
||||||
|
dwc2_hsotg_ep_free_request(&hsotg->eps_out[0]->ep,
|
||||||
|
hsotg->ctrl_req);
|
||||||
return ret;
|
return ret;
|
||||||
|
}
|
||||||
dwc2_hsotg_dump(hsotg);
|
dwc2_hsotg_dump(hsotg);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -3672,6 +3674,7 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg, int irq)
|
||||||
int dwc2_hsotg_remove(struct dwc2_hsotg *hsotg)
|
int dwc2_hsotg_remove(struct dwc2_hsotg *hsotg)
|
||||||
{
|
{
|
||||||
usb_del_gadget_udc(&hsotg->gadget);
|
usb_del_gadget_udc(&hsotg->gadget);
|
||||||
|
dwc2_hsotg_ep_free_request(&hsotg->eps_out[0]->ep, hsotg->ctrl_req);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -931,9 +931,8 @@ static int dwc2_xfercomp_isoc_split_in(struct dwc2_hsotg *hsotg,
|
||||||
frame_desc = &qtd->urb->iso_descs[qtd->isoc_frame_index];
|
frame_desc = &qtd->urb->iso_descs[qtd->isoc_frame_index];
|
||||||
len = dwc2_get_actual_xfer_length(hsotg, chan, chnum, qtd,
|
len = dwc2_get_actual_xfer_length(hsotg, chan, chnum, qtd,
|
||||||
DWC2_HC_XFER_COMPLETE, NULL);
|
DWC2_HC_XFER_COMPLETE, NULL);
|
||||||
if (!len) {
|
if (!len && !qtd->isoc_split_offset) {
|
||||||
qtd->complete_split = 0;
|
qtd->complete_split = 0;
|
||||||
qtd->isoc_split_offset = 0;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1771,6 +1771,8 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
|
||||||
*/
|
*/
|
||||||
if (w_value && !f->get_alt)
|
if (w_value && !f->get_alt)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
spin_lock(&cdev->lock);
|
||||||
value = f->set_alt(f, w_index, w_value);
|
value = f->set_alt(f, w_index, w_value);
|
||||||
if (value == USB_GADGET_DELAYED_STATUS) {
|
if (value == USB_GADGET_DELAYED_STATUS) {
|
||||||
DBG(cdev,
|
DBG(cdev,
|
||||||
|
@ -1780,6 +1782,7 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
|
||||||
DBG(cdev, "delayed_status count %d\n",
|
DBG(cdev, "delayed_status count %d\n",
|
||||||
cdev->delayed_status);
|
cdev->delayed_status);
|
||||||
}
|
}
|
||||||
|
spin_unlock(&cdev->lock);
|
||||||
break;
|
break;
|
||||||
case USB_REQ_GET_INTERFACE:
|
case USB_REQ_GET_INTERFACE:
|
||||||
if (ctrl->bRequestType != (USB_DIR_IN|USB_RECIP_INTERFACE))
|
if (ctrl->bRequestType != (USB_DIR_IN|USB_RECIP_INTERFACE))
|
||||||
|
|
|
@ -1075,8 +1075,13 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
|
||||||
command = readl(&xhci->op_regs->command);
|
command = readl(&xhci->op_regs->command);
|
||||||
command |= CMD_CRS;
|
command |= CMD_CRS;
|
||||||
writel(command, &xhci->op_regs->command);
|
writel(command, &xhci->op_regs->command);
|
||||||
|
/*
|
||||||
|
* Some controllers take up to 55+ ms to complete the controller
|
||||||
|
* restore so setting the timeout to 100ms. Xhci specification
|
||||||
|
* doesn't mention any timeout value.
|
||||||
|
*/
|
||||||
if (xhci_handshake(&xhci->op_regs->status,
|
if (xhci_handshake(&xhci->op_regs->status,
|
||||||
STS_RESTORE, 0, 10 * 1000)) {
|
STS_RESTORE, 0, 100 * 1000)) {
|
||||||
xhci_warn(xhci, "WARN: xHC restore state timeout\n");
|
xhci_warn(xhci, "WARN: xHC restore state timeout\n");
|
||||||
spin_unlock_irq(&xhci->lock);
|
spin_unlock_irq(&xhci->lock);
|
||||||
return -ETIMEDOUT;
|
return -ETIMEDOUT;
|
||||||
|
|
|
@ -199,6 +199,8 @@ static void option_instat_callback(struct urb *urb);
|
||||||
#define DELL_PRODUCT_5800_V2_MINICARD_VZW 0x8196 /* Novatel E362 */
|
#define DELL_PRODUCT_5800_V2_MINICARD_VZW 0x8196 /* Novatel E362 */
|
||||||
#define DELL_PRODUCT_5804_MINICARD_ATT 0x819b /* Novatel E371 */
|
#define DELL_PRODUCT_5804_MINICARD_ATT 0x819b /* Novatel E371 */
|
||||||
|
|
||||||
|
#define DELL_PRODUCT_5821E 0x81d7
|
||||||
|
|
||||||
#define KYOCERA_VENDOR_ID 0x0c88
|
#define KYOCERA_VENDOR_ID 0x0c88
|
||||||
#define KYOCERA_PRODUCT_KPC650 0x17da
|
#define KYOCERA_PRODUCT_KPC650 0x17da
|
||||||
#define KYOCERA_PRODUCT_KPC680 0x180a
|
#define KYOCERA_PRODUCT_KPC680 0x180a
|
||||||
|
@ -1033,6 +1035,8 @@ static const struct usb_device_id option_ids[] = {
|
||||||
{ USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, DELL_PRODUCT_5800_MINICARD_VZW, 0xff, 0xff, 0xff) },
|
{ USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, DELL_PRODUCT_5800_MINICARD_VZW, 0xff, 0xff, 0xff) },
|
||||||
{ USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, DELL_PRODUCT_5800_V2_MINICARD_VZW, 0xff, 0xff, 0xff) },
|
{ USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, DELL_PRODUCT_5800_V2_MINICARD_VZW, 0xff, 0xff, 0xff) },
|
||||||
{ USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, DELL_PRODUCT_5804_MINICARD_ATT, 0xff, 0xff, 0xff) },
|
{ USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, DELL_PRODUCT_5804_MINICARD_ATT, 0xff, 0xff, 0xff) },
|
||||||
|
{ USB_DEVICE(DELL_VENDOR_ID, DELL_PRODUCT_5821E),
|
||||||
|
.driver_info = RSVD(0) | RSVD(1) | RSVD(6) },
|
||||||
{ USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, /* ADU-E100, ADU-310 */
|
{ USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, /* ADU-E100, ADU-310 */
|
||||||
{ USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) },
|
{ USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) },
|
||||||
{ USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) },
|
{ USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) },
|
||||||
|
|
|
@ -790,9 +790,9 @@ static void sierra_close(struct usb_serial_port *port)
|
||||||
kfree(urb->transfer_buffer);
|
kfree(urb->transfer_buffer);
|
||||||
usb_free_urb(urb);
|
usb_free_urb(urb);
|
||||||
usb_autopm_put_interface_async(serial->interface);
|
usb_autopm_put_interface_async(serial->interface);
|
||||||
spin_lock(&portdata->lock);
|
spin_lock_irq(&portdata->lock);
|
||||||
portdata->outstanding_urbs--;
|
portdata->outstanding_urbs--;
|
||||||
spin_unlock(&portdata->lock);
|
spin_unlock_irq(&portdata->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
sierra_stop_rx_urbs(port);
|
sierra_stop_rx_urbs(port);
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#include <linux/log2.h>
|
#include <linux/log2.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
|
#include <linux/nospec.h>
|
||||||
#include <linux/backing-dev.h>
|
#include <linux/backing-dev.h>
|
||||||
#include <trace/events/ext4.h>
|
#include <trace/events/ext4.h>
|
||||||
|
|
||||||
|
@ -2144,7 +2145,8 @@ ext4_mb_regular_allocator(struct ext4_allocation_context *ac)
|
||||||
* This should tell if fe_len is exactly power of 2
|
* This should tell if fe_len is exactly power of 2
|
||||||
*/
|
*/
|
||||||
if ((ac->ac_g_ex.fe_len & (~(1 << (i - 1)))) == 0)
|
if ((ac->ac_g_ex.fe_len & (~(1 << (i - 1)))) == 0)
|
||||||
ac->ac_2order = i - 1;
|
ac->ac_2order = array_index_nospec(i - 1,
|
||||||
|
sb->s_blocksize_bits + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if stream allocation is enabled, use global goal */
|
/* if stream allocation is enabled, use global goal */
|
||||||
|
|
|
@ -163,6 +163,7 @@ extern const struct file_operations ovl_dir_operations;
|
||||||
int ovl_check_empty_dir(struct dentry *dentry, struct list_head *list);
|
int ovl_check_empty_dir(struct dentry *dentry, struct list_head *list);
|
||||||
void ovl_cleanup_whiteouts(struct dentry *upper, struct list_head *list);
|
void ovl_cleanup_whiteouts(struct dentry *upper, struct list_head *list);
|
||||||
void ovl_cache_free(struct list_head *list);
|
void ovl_cache_free(struct list_head *list);
|
||||||
|
int ovl_check_d_type_supported(struct path *realpath);
|
||||||
|
|
||||||
/* inode.c */
|
/* inode.c */
|
||||||
int ovl_setattr(struct dentry *dentry, struct iattr *attr);
|
int ovl_setattr(struct dentry *dentry, struct iattr *attr);
|
||||||
|
|
|
@ -43,6 +43,7 @@ struct ovl_readdir_data {
|
||||||
struct ovl_cache_entry *first_maybe_whiteout;
|
struct ovl_cache_entry *first_maybe_whiteout;
|
||||||
int count;
|
int count;
|
||||||
int err;
|
int err;
|
||||||
|
bool d_type_supported;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ovl_dir_file {
|
struct ovl_dir_file {
|
||||||
|
@ -581,3 +582,39 @@ void ovl_cleanup_whiteouts(struct dentry *upper, struct list_head *list)
|
||||||
}
|
}
|
||||||
mutex_unlock(&upper->d_inode->i_mutex);
|
mutex_unlock(&upper->d_inode->i_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int ovl_check_d_type(struct dir_context *ctx, const char *name,
|
||||||
|
int namelen, loff_t offset, u64 ino,
|
||||||
|
unsigned int d_type)
|
||||||
|
{
|
||||||
|
struct ovl_readdir_data *rdd =
|
||||||
|
container_of(ctx, struct ovl_readdir_data, ctx);
|
||||||
|
|
||||||
|
/* Even if d_type is not supported, DT_DIR is returned for . and .. */
|
||||||
|
if (!strncmp(name, ".", namelen) || !strncmp(name, "..", namelen))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (d_type != DT_UNKNOWN)
|
||||||
|
rdd->d_type_supported = true;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns 1 if d_type is supported, 0 not supported/unknown. Negative values
|
||||||
|
* if error is encountered.
|
||||||
|
*/
|
||||||
|
int ovl_check_d_type_supported(struct path *realpath)
|
||||||
|
{
|
||||||
|
int err;
|
||||||
|
struct ovl_readdir_data rdd = {
|
||||||
|
.ctx.actor = ovl_check_d_type,
|
||||||
|
.d_type_supported = false,
|
||||||
|
};
|
||||||
|
|
||||||
|
err = ovl_dir_read(realpath, &rdd);
|
||||||
|
if (err)
|
||||||
|
return err;
|
||||||
|
|
||||||
|
return rdd.d_type_supported;
|
||||||
|
}
|
||||||
|
|
|
@ -1054,6 +1054,26 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
sb->s_flags |= MS_RDONLY;
|
sb->s_flags |= MS_RDONLY;
|
||||||
ufs->workdir = NULL;
|
ufs->workdir = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Upper should support d_type, else whiteouts are visible.
|
||||||
|
* Given workdir and upper are on same fs, we can do
|
||||||
|
* iterate_dir() on workdir. This check requires successful
|
||||||
|
* creation of workdir in previous step.
|
||||||
|
*/
|
||||||
|
if (ufs->workdir) {
|
||||||
|
err = ovl_check_d_type_supported(&workpath);
|
||||||
|
if (err < 0)
|
||||||
|
goto out_put_workdir;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* We allowed this configuration and don't want to
|
||||||
|
* break users over kernel upgrade. So warn instead
|
||||||
|
* of erroring out.
|
||||||
|
*/
|
||||||
|
if (!err)
|
||||||
|
pr_warn("overlayfs: upper fs needs to support d_type.\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
|
|
|
@ -791,8 +791,10 @@ static int listxattr_filler(struct dir_context *ctx, const char *name,
|
||||||
size = handler->list(handler, b->dentry,
|
size = handler->list(handler, b->dentry,
|
||||||
b->buf + b->pos, b->size, name,
|
b->buf + b->pos, b->size, name,
|
||||||
namelen);
|
namelen);
|
||||||
if (size > b->size)
|
if (b->pos + size > b->size) {
|
||||||
|
b->pos = -ERANGE;
|
||||||
return -ERANGE;
|
return -ERANGE;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
size = handler->list(handler, b->dentry,
|
size = handler->list(handler, b->dentry,
|
||||||
NULL, 0, name, namelen);
|
NULL, 0, name, namelen);
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#define __FSL_GUTS_H__
|
#define __FSL_GUTS_H__
|
||||||
|
|
||||||
#include <linux/types.h>
|
#include <linux/types.h>
|
||||||
|
#include <linux/io.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Global Utility Registers.
|
* Global Utility Registers.
|
||||||
|
|
|
@ -150,9 +150,10 @@ enum {
|
||||||
SWP_FILE = (1 << 7), /* set after swap_activate success */
|
SWP_FILE = (1 << 7), /* set after swap_activate success */
|
||||||
SWP_AREA_DISCARD = (1 << 8), /* single-time swap area discards */
|
SWP_AREA_DISCARD = (1 << 8), /* single-time swap area discards */
|
||||||
SWP_PAGE_DISCARD = (1 << 9), /* freed swap page-cluster discards */
|
SWP_PAGE_DISCARD = (1 << 9), /* freed swap page-cluster discards */
|
||||||
|
SWP_STABLE_WRITES = (1 << 10), /* no overwrite PG_writeback pages */
|
||||||
/* add others here before... */
|
/* add others here before... */
|
||||||
SWP_FAST = (1 << 10), /* blkdev access is fast and cheap */
|
SWP_FAST = (1 << 11), /* blkdev access is fast and cheap */
|
||||||
SWP_SCANNING = (1 << 11), /* refcount in scan_swap_map */
|
SWP_SCANNING = (1 << 12), /* refcount in scan_swap_map */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define SWAP_CLUSTER_MAX 32UL
|
#define SWAP_CLUSTER_MAX 32UL
|
||||||
|
|
236
include/linux/xxhash.h
Normal file
236
include/linux/xxhash.h
Normal file
|
@ -0,0 +1,236 @@
|
||||||
|
/*
|
||||||
|
* xxHash - Extremely Fast Hash algorithm
|
||||||
|
* Copyright (C) 2012-2016, Yann Collet.
|
||||||
|
*
|
||||||
|
* BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are
|
||||||
|
* met:
|
||||||
|
*
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above
|
||||||
|
* copyright notice, this list of conditions and the following disclaimer
|
||||||
|
* in the documentation and/or other materials provided with the
|
||||||
|
* distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify it under
|
||||||
|
* the terms of the GNU General Public License version 2 as published by the
|
||||||
|
* Free Software Foundation. This program is dual-licensed; you may select
|
||||||
|
* either version 2 of the GNU General Public License ("GPL") or BSD license
|
||||||
|
* ("BSD").
|
||||||
|
*
|
||||||
|
* You can contact the author at:
|
||||||
|
* - xxHash homepage: http://cyan4973.github.io/xxHash/
|
||||||
|
* - xxHash source repository: https://github.com/Cyan4973/xxHash
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Notice extracted from xxHash homepage:
|
||||||
|
*
|
||||||
|
* xxHash is an extremely fast Hash algorithm, running at RAM speed limits.
|
||||||
|
* It also successfully passes all tests from the SMHasher suite.
|
||||||
|
*
|
||||||
|
* Comparison (single thread, Windows Seven 32 bits, using SMHasher on a Core 2
|
||||||
|
* Duo @3GHz)
|
||||||
|
*
|
||||||
|
* Name Speed Q.Score Author
|
||||||
|
* xxHash 5.4 GB/s 10
|
||||||
|
* CrapWow 3.2 GB/s 2 Andrew
|
||||||
|
* MumurHash 3a 2.7 GB/s 10 Austin Appleby
|
||||||
|
* SpookyHash 2.0 GB/s 10 Bob Jenkins
|
||||||
|
* SBox 1.4 GB/s 9 Bret Mulvey
|
||||||
|
* Lookup3 1.2 GB/s 9 Bob Jenkins
|
||||||
|
* SuperFastHash 1.2 GB/s 1 Paul Hsieh
|
||||||
|
* CityHash64 1.05 GB/s 10 Pike & Alakuijala
|
||||||
|
* FNV 0.55 GB/s 5 Fowler, Noll, Vo
|
||||||
|
* CRC32 0.43 GB/s 9
|
||||||
|
* MD5-32 0.33 GB/s 10 Ronald L. Rivest
|
||||||
|
* SHA1-32 0.28 GB/s 10
|
||||||
|
*
|
||||||
|
* Q.Score is a measure of quality of the hash function.
|
||||||
|
* It depends on successfully passing SMHasher test set.
|
||||||
|
* 10 is a perfect score.
|
||||||
|
*
|
||||||
|
* A 64-bits version, named xxh64 offers much better speed,
|
||||||
|
* but for 64-bits applications only.
|
||||||
|
* Name Speed on 64 bits Speed on 32 bits
|
||||||
|
* xxh64 13.8 GB/s 1.9 GB/s
|
||||||
|
* xxh32 6.8 GB/s 6.0 GB/s
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef XXHASH_H
|
||||||
|
#define XXHASH_H
|
||||||
|
|
||||||
|
#include <linux/types.h>
|
||||||
|
|
||||||
|
/*-****************************
|
||||||
|
* Simple Hash Functions
|
||||||
|
*****************************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xxh32() - calculate the 32-bit hash of the input with a given seed.
|
||||||
|
*
|
||||||
|
* @input: The data to hash.
|
||||||
|
* @length: The length of the data to hash.
|
||||||
|
* @seed: The seed can be used to alter the result predictably.
|
||||||
|
*
|
||||||
|
* Speed on Core 2 Duo @ 3 GHz (single thread, SMHasher benchmark) : 5.4 GB/s
|
||||||
|
*
|
||||||
|
* Return: The 32-bit hash of the data.
|
||||||
|
*/
|
||||||
|
uint32_t xxh32(const void *input, size_t length, uint32_t seed);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xxh64() - calculate the 64-bit hash of the input with a given seed.
|
||||||
|
*
|
||||||
|
* @input: The data to hash.
|
||||||
|
* @length: The length of the data to hash.
|
||||||
|
* @seed: The seed can be used to alter the result predictably.
|
||||||
|
*
|
||||||
|
* This function runs 2x faster on 64-bit systems, but slower on 32-bit systems.
|
||||||
|
*
|
||||||
|
* Return: The 64-bit hash of the data.
|
||||||
|
*/
|
||||||
|
uint64_t xxh64(const void *input, size_t length, uint64_t seed);
|
||||||
|
|
||||||
|
/*-****************************
|
||||||
|
* Streaming Hash Functions
|
||||||
|
*****************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* These definitions are only meant to allow allocation of XXH state
|
||||||
|
* statically, on stack, or in a struct for example.
|
||||||
|
* Do not use members directly.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct xxh32_state - private xxh32 state, do not use members directly
|
||||||
|
*/
|
||||||
|
struct xxh32_state {
|
||||||
|
uint32_t total_len_32;
|
||||||
|
uint32_t large_len;
|
||||||
|
uint32_t v1;
|
||||||
|
uint32_t v2;
|
||||||
|
uint32_t v3;
|
||||||
|
uint32_t v4;
|
||||||
|
uint32_t mem32[4];
|
||||||
|
uint32_t memsize;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct xxh32_state - private xxh64 state, do not use members directly
|
||||||
|
*/
|
||||||
|
struct xxh64_state {
|
||||||
|
uint64_t total_len;
|
||||||
|
uint64_t v1;
|
||||||
|
uint64_t v2;
|
||||||
|
uint64_t v3;
|
||||||
|
uint64_t v4;
|
||||||
|
uint64_t mem64[4];
|
||||||
|
uint32_t memsize;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xxh32_reset() - reset the xxh32 state to start a new hashing operation
|
||||||
|
*
|
||||||
|
* @state: The xxh32 state to reset.
|
||||||
|
* @seed: Initialize the hash state with this seed.
|
||||||
|
*
|
||||||
|
* Call this function on any xxh32_state to prepare for a new hashing operation.
|
||||||
|
*/
|
||||||
|
void xxh32_reset(struct xxh32_state *state, uint32_t seed);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xxh32_update() - hash the data given and update the xxh32 state
|
||||||
|
*
|
||||||
|
* @state: The xxh32 state to update.
|
||||||
|
* @input: The data to hash.
|
||||||
|
* @length: The length of the data to hash.
|
||||||
|
*
|
||||||
|
* After calling xxh32_reset() call xxh32_update() as many times as necessary.
|
||||||
|
*
|
||||||
|
* Return: Zero on success, otherwise an error code.
|
||||||
|
*/
|
||||||
|
int xxh32_update(struct xxh32_state *state, const void *input, size_t length);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xxh32_digest() - produce the current xxh32 hash
|
||||||
|
*
|
||||||
|
* @state: Produce the current xxh32 hash of this state.
|
||||||
|
*
|
||||||
|
* A hash value can be produced at any time. It is still possible to continue
|
||||||
|
* inserting input into the hash state after a call to xxh32_digest(), and
|
||||||
|
* generate new hashes later on, by calling xxh32_digest() again.
|
||||||
|
*
|
||||||
|
* Return: The xxh32 hash stored in the state.
|
||||||
|
*/
|
||||||
|
uint32_t xxh32_digest(const struct xxh32_state *state);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xxh64_reset() - reset the xxh64 state to start a new hashing operation
|
||||||
|
*
|
||||||
|
* @state: The xxh64 state to reset.
|
||||||
|
* @seed: Initialize the hash state with this seed.
|
||||||
|
*/
|
||||||
|
void xxh64_reset(struct xxh64_state *state, uint64_t seed);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xxh64_update() - hash the data given and update the xxh64 state
|
||||||
|
* @state: The xxh64 state to update.
|
||||||
|
* @input: The data to hash.
|
||||||
|
* @length: The length of the data to hash.
|
||||||
|
*
|
||||||
|
* After calling xxh64_reset() call xxh64_update() as many times as necessary.
|
||||||
|
*
|
||||||
|
* Return: Zero on success, otherwise an error code.
|
||||||
|
*/
|
||||||
|
int xxh64_update(struct xxh64_state *state, const void *input, size_t length);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xxh64_digest() - produce the current xxh64 hash
|
||||||
|
*
|
||||||
|
* @state: Produce the current xxh64 hash of this state.
|
||||||
|
*
|
||||||
|
* A hash value can be produced at any time. It is still possible to continue
|
||||||
|
* inserting input into the hash state after a call to xxh64_digest(), and
|
||||||
|
* generate new hashes later on, by calling xxh64_digest() again.
|
||||||
|
*
|
||||||
|
* Return: The xxh64 hash stored in the state.
|
||||||
|
*/
|
||||||
|
uint64_t xxh64_digest(const struct xxh64_state *state);
|
||||||
|
|
||||||
|
/*-**************************
|
||||||
|
* Utils
|
||||||
|
***************************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xxh32_copy_state() - copy the source state into the destination state
|
||||||
|
*
|
||||||
|
* @src: The source xxh32 state.
|
||||||
|
* @dst: The destination xxh32 state.
|
||||||
|
*/
|
||||||
|
void xxh32_copy_state(struct xxh32_state *dst, const struct xxh32_state *src);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xxh64_copy_state() - copy the source state into the destination state
|
||||||
|
*
|
||||||
|
* @src: The source xxh64 state.
|
||||||
|
* @dst: The destination xxh64 state.
|
||||||
|
*/
|
||||||
|
void xxh64_copy_state(struct xxh64_state *dst, const struct xxh64_state *src);
|
||||||
|
|
||||||
|
#endif /* XXHASH_H */
|
1157
include/linux/zstd.h
Normal file
1157
include/linux/zstd.h
Normal file
File diff suppressed because it is too large
Load diff
|
@ -62,7 +62,8 @@ struct vsock_sock {
|
||||||
struct list_head pending_links;
|
struct list_head pending_links;
|
||||||
struct list_head accept_queue;
|
struct list_head accept_queue;
|
||||||
bool rejected;
|
bool rejected;
|
||||||
struct delayed_work dwork;
|
struct delayed_work connect_work;
|
||||||
|
struct delayed_work pending_work;
|
||||||
u32 peer_shutdown;
|
u32 peer_shutdown;
|
||||||
bool sent_request;
|
bool sent_request;
|
||||||
bool ignore_connecting_rst;
|
bool ignore_connecting_rst;
|
||||||
|
@ -73,7 +74,6 @@ struct vsock_sock {
|
||||||
|
|
||||||
s64 vsock_stream_has_data(struct vsock_sock *vsk);
|
s64 vsock_stream_has_data(struct vsock_sock *vsk);
|
||||||
s64 vsock_stream_has_space(struct vsock_sock *vsk);
|
s64 vsock_stream_has_space(struct vsock_sock *vsk);
|
||||||
void vsock_pending_work(struct work_struct *work);
|
|
||||||
struct sock *__vsock_create(struct net *net,
|
struct sock *__vsock_create(struct net *net,
|
||||||
struct socket *sock,
|
struct socket *sock,
|
||||||
struct sock *parent,
|
struct sock *parent,
|
||||||
|
|
|
@ -116,6 +116,11 @@ static inline void llc_sap_hold(struct llc_sap *sap)
|
||||||
atomic_inc(&sap->refcnt);
|
atomic_inc(&sap->refcnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bool llc_sap_hold_safe(struct llc_sap *sap)
|
||||||
|
{
|
||||||
|
return atomic_inc_not_zero(&sap->refcnt);
|
||||||
|
}
|
||||||
|
|
||||||
void llc_sap_close(struct llc_sap *sap);
|
void llc_sap_close(struct llc_sap *sap);
|
||||||
|
|
||||||
static inline void llc_sap_put(struct llc_sap *sap)
|
static inline void llc_sap_put(struct llc_sap *sap)
|
||||||
|
|
|
@ -115,6 +115,7 @@ struct net {
|
||||||
#endif
|
#endif
|
||||||
#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
|
#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
|
||||||
struct netns_nf_frag nf_frag;
|
struct netns_nf_frag nf_frag;
|
||||||
|
struct ctl_table_header *nf_frag_frags_hdr;
|
||||||
#endif
|
#endif
|
||||||
struct sock *nfnl;
|
struct sock *nfnl;
|
||||||
struct sock *nfnl_stash;
|
struct sock *nfnl_stash;
|
||||||
|
|
|
@ -86,7 +86,6 @@ struct netns_ipv6 {
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
|
#if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
|
||||||
struct netns_nf_frag {
|
struct netns_nf_frag {
|
||||||
struct netns_sysctl_ipv6 sysctl;
|
|
||||||
struct netns_frags frags;
|
struct netns_frags frags;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -837,8 +837,6 @@ enum tcp_ca_event {
|
||||||
CA_EVENT_LOSS, /* loss timeout */
|
CA_EVENT_LOSS, /* loss timeout */
|
||||||
CA_EVENT_ECN_NO_CE, /* ECT set, but not CE marked */
|
CA_EVENT_ECN_NO_CE, /* ECT set, but not CE marked */
|
||||||
CA_EVENT_ECN_IS_CE, /* received CE marked IP packet */
|
CA_EVENT_ECN_IS_CE, /* received CE marked IP packet */
|
||||||
CA_EVENT_DELAYED_ACK, /* Delayed ack is sent */
|
|
||||||
CA_EVENT_NON_DELAYED_ACK,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Information about inbound ACK, passed to cong_ops->in_ack_event() */
|
/* Information about inbound ACK, passed to cong_ops->in_ack_event() */
|
||||||
|
|
|
@ -1264,11 +1264,11 @@ unsigned long lockdep_count_forward_deps(struct lock_class *class)
|
||||||
this.parent = NULL;
|
this.parent = NULL;
|
||||||
this.class = class;
|
this.class = class;
|
||||||
|
|
||||||
local_irq_save(flags);
|
raw_local_irq_save(flags);
|
||||||
arch_spin_lock(&lockdep_lock);
|
arch_spin_lock(&lockdep_lock);
|
||||||
ret = __lockdep_count_forward_deps(&this);
|
ret = __lockdep_count_forward_deps(&this);
|
||||||
arch_spin_unlock(&lockdep_lock);
|
arch_spin_unlock(&lockdep_lock);
|
||||||
local_irq_restore(flags);
|
raw_local_irq_restore(flags);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1291,11 +1291,11 @@ unsigned long lockdep_count_backward_deps(struct lock_class *class)
|
||||||
this.parent = NULL;
|
this.parent = NULL;
|
||||||
this.class = class;
|
this.class = class;
|
||||||
|
|
||||||
local_irq_save(flags);
|
raw_local_irq_save(flags);
|
||||||
arch_spin_lock(&lockdep_lock);
|
arch_spin_lock(&lockdep_lock);
|
||||||
ret = __lockdep_count_backward_deps(&this);
|
ret = __lockdep_count_backward_deps(&this);
|
||||||
arch_spin_unlock(&lockdep_lock);
|
arch_spin_unlock(&lockdep_lock);
|
||||||
local_irq_restore(flags);
|
raw_local_irq_restore(flags);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -4123,7 +4123,7 @@ void debug_check_no_locks_freed(const void *mem_from, unsigned long mem_len)
|
||||||
if (unlikely(!debug_locks))
|
if (unlikely(!debug_locks))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
local_irq_save(flags);
|
raw_local_irq_save(flags);
|
||||||
for (i = 0; i < curr->lockdep_depth; i++) {
|
for (i = 0; i < curr->lockdep_depth; i++) {
|
||||||
hlock = curr->held_locks + i;
|
hlock = curr->held_locks + i;
|
||||||
|
|
||||||
|
@ -4134,7 +4134,7 @@ void debug_check_no_locks_freed(const void *mem_from, unsigned long mem_len)
|
||||||
print_freed_lock_bug(curr, mem_from, mem_from + mem_len, hlock);
|
print_freed_lock_bug(curr, mem_from, mem_from + mem_len, hlock);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
local_irq_restore(flags);
|
raw_local_irq_restore(flags);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(debug_check_no_locks_freed);
|
EXPORT_SYMBOL_GPL(debug_check_no_locks_freed);
|
||||||
|
|
||||||
|
|
|
@ -2237,6 +2237,7 @@ out:
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(trace_vbprintk);
|
EXPORT_SYMBOL_GPL(trace_vbprintk);
|
||||||
|
|
||||||
|
__printf(3, 0)
|
||||||
static int
|
static int
|
||||||
__trace_array_vprintk(struct ring_buffer *buffer,
|
__trace_array_vprintk(struct ring_buffer *buffer,
|
||||||
unsigned long ip, const char *fmt, va_list args)
|
unsigned long ip, const char *fmt, va_list args)
|
||||||
|
@ -2288,12 +2289,14 @@ __trace_array_vprintk(struct ring_buffer *buffer,
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__printf(3, 0)
|
||||||
int trace_array_vprintk(struct trace_array *tr,
|
int trace_array_vprintk(struct trace_array *tr,
|
||||||
unsigned long ip, const char *fmt, va_list args)
|
unsigned long ip, const char *fmt, va_list args)
|
||||||
{
|
{
|
||||||
return __trace_array_vprintk(tr->trace_buffer.buffer, ip, fmt, args);
|
return __trace_array_vprintk(tr->trace_buffer.buffer, ip, fmt, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__printf(3, 0)
|
||||||
int trace_array_printk(struct trace_array *tr,
|
int trace_array_printk(struct trace_array *tr,
|
||||||
unsigned long ip, const char *fmt, ...)
|
unsigned long ip, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
|
@ -2309,6 +2312,7 @@ int trace_array_printk(struct trace_array *tr,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__printf(3, 4)
|
||||||
int trace_array_printk_buf(struct ring_buffer *buffer,
|
int trace_array_printk_buf(struct ring_buffer *buffer,
|
||||||
unsigned long ip, const char *fmt, ...)
|
unsigned long ip, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
|
@ -2324,6 +2328,7 @@ int trace_array_printk_buf(struct ring_buffer *buffer,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__printf(2, 0)
|
||||||
int trace_vprintk(unsigned long ip, const char *fmt, va_list args)
|
int trace_vprintk(unsigned long ip, const char *fmt, va_list args)
|
||||||
{
|
{
|
||||||
return trace_array_vprintk(&global_trace, ip, fmt, args);
|
return trace_array_vprintk(&global_trace, ip, fmt, args);
|
||||||
|
|
11
lib/Kconfig
11
lib/Kconfig
|
@ -185,6 +185,9 @@ config CRC8
|
||||||
when they need to do cyclic redundancy check according CRC8
|
when they need to do cyclic redundancy check according CRC8
|
||||||
algorithm. Module will be called crc8.
|
algorithm. Module will be called crc8.
|
||||||
|
|
||||||
|
config XXHASH
|
||||||
|
tristate
|
||||||
|
|
||||||
config AUDIT_GENERIC
|
config AUDIT_GENERIC
|
||||||
bool
|
bool
|
||||||
depends on AUDIT && !AUDIT_ARCH
|
depends on AUDIT && !AUDIT_ARCH
|
||||||
|
@ -239,6 +242,14 @@ config LZ4HC_COMPRESS
|
||||||
config LZ4_DECOMPRESS
|
config LZ4_DECOMPRESS
|
||||||
tristate
|
tristate
|
||||||
|
|
||||||
|
config ZSTD_COMPRESS
|
||||||
|
select XXHASH
|
||||||
|
tristate
|
||||||
|
|
||||||
|
config ZSTD_DECOMPRESS
|
||||||
|
select XXHASH
|
||||||
|
tristate
|
||||||
|
|
||||||
source "lib/xz/Kconfig"
|
source "lib/xz/Kconfig"
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -95,6 +95,7 @@ obj-$(CONFIG_CRC32) += crc32.o
|
||||||
obj-$(CONFIG_CRC7) += crc7.o
|
obj-$(CONFIG_CRC7) += crc7.o
|
||||||
obj-$(CONFIG_LIBCRC32C) += libcrc32c.o
|
obj-$(CONFIG_LIBCRC32C) += libcrc32c.o
|
||||||
obj-$(CONFIG_CRC8) += crc8.o
|
obj-$(CONFIG_CRC8) += crc8.o
|
||||||
|
obj-$(CONFIG_XXHASH) += xxhash.o
|
||||||
obj-$(CONFIG_GENERIC_ALLOCATOR) += genalloc.o
|
obj-$(CONFIG_GENERIC_ALLOCATOR) += genalloc.o
|
||||||
|
|
||||||
obj-$(CONFIG_842_COMPRESS) += 842/
|
obj-$(CONFIG_842_COMPRESS) += 842/
|
||||||
|
@ -108,6 +109,8 @@ obj-$(CONFIG_LZO_DECOMPRESS) += lzo/
|
||||||
obj-$(CONFIG_LZ4_COMPRESS) += lz4/
|
obj-$(CONFIG_LZ4_COMPRESS) += lz4/
|
||||||
obj-$(CONFIG_LZ4HC_COMPRESS) += lz4/
|
obj-$(CONFIG_LZ4HC_COMPRESS) += lz4/
|
||||||
obj-$(CONFIG_LZ4_DECOMPRESS) += lz4/
|
obj-$(CONFIG_LZ4_DECOMPRESS) += lz4/
|
||||||
|
obj-$(CONFIG_ZSTD_COMPRESS) += zstd/
|
||||||
|
obj-$(CONFIG_ZSTD_DECOMPRESS) += zstd/
|
||||||
obj-$(CONFIG_XZ_DEC) += xz/
|
obj-$(CONFIG_XZ_DEC) += xz/
|
||||||
obj-$(CONFIG_RAID6_PQ) += raid6/
|
obj-$(CONFIG_RAID6_PQ) += raid6/
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue