Linux 5.11.5
[email protected]
maintainerFrom: Greg Kroah-Hartman <[email protected]>
I'm announcing the release of the 5.11.5 kernel.
All users of the 5.11 kernel series must upgrade.
The updated 5.11.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-5.11.y
and can be browsed at the normal kernel.org git web browser:
https://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
thanks,
greg k-h
------------
Makefile | 2 arch/ia64/kernel/signal.c | 3 - drivers/base/power/runtime.c | 62 ++++++++++++--------- drivers/block/rsxx/core.c | 8 +- drivers/char/tpm/tpm_tis_core.c | 30 ++++++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 3 - drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 4 - drivers/gpu/drm/amd/amdgpu/nv.c | 6 +- drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 15 ++++- drivers/infiniband/core/cm.c | 5 + drivers/infiniband/hw/mlx5/devx.c | 4 + drivers/infiniband/sw/rxe/Kconfig | 1 drivers/iommu/dma-iommu.c | 15 ++--- drivers/iommu/intel/pasid.h | 4 - drivers/iommu/tegra-smmu.c | 72 ++++++++++++++++++++++++- drivers/md/dm-bufio.c | 4 + drivers/md/dm-verity-fec.c | 23 ++++--- drivers/net/ethernet/realtek/r8169_main.c | 2 fs/btrfs/block-group.c | 33 +++++++++++ fs/btrfs/block-group.h | 9 +++ fs/btrfs/ctree.h | 5 + fs/btrfs/delayed-inode.c | 2 fs/btrfs/file.c | 5 + fs/btrfs/free-space-cache.c | 14 ++-- fs/btrfs/inode.c | 40 ++++++++++++- fs/btrfs/ioctl.c | 19 ++++++ fs/btrfs/raid56.c | 21 +++---- fs/btrfs/reflink.c | 18 ++++++ fs/btrfs/scrub.c | 9 ++- fs/btrfs/super.c | 4 - fs/btrfs/tree-checker.c | 16 +---- fs/btrfs/xattr.c | 31 +++++++++- fs/btrfs/zoned.c | 4 - fs/io_uring.c | 3 + include/crypto/hash.h | 8 +- include/linux/crypto.h | 9 ++- include/sound/intel-nhlt.h | 5 + kernel/trace/ring_buffer.c | 11 +++ scripts/recordmcount.c | 2 security/tomoyo/network.c | 2 sound/hda/intel-nhlt.c | 54 +++++++++++++++--- sound/pci/ctxfi/cthw20k2.c | 2 sound/pci/hda/patch_realtek.c | 13 ++++ sound/usb/clock.c | 8 +- sound/usb/mixer.c | 11 +++ sound/usb/mixer_maps.c | 10 +++ sound/usb/pcm.c | 12 +++- sound/usb/quirks.c | 2 48 files changed, 506 insertions(+), 139 deletions(-)
Alex Deucher (1):
drm/amdgpu: Only check for S0ix if AMD_PMC is configured
Andrea Fagiani (1):
ALSA: usb-audio: use Corsair Virtuoso mapping for Corsair Virtuoso SE
Ard Biesheuvel (1):
crypto - shash: reduce minimum alignment of shash_desc structure
Asher.Song (1):
drm/amdgpu:disable VCN for Navi12 SKU
Boris Burkov (1):
btrfs: fix spurious free_space_tree remount warning
Chen Jun (1):
ftrace: Have recordmcount use w8 to read relp->r_info in arm64_is_fake_mcount
Chris Chiu (1):
ALSA: hda/realtek: Enable headset mic of Acer SWIFT with ALC256
Colin Ian King (1):
ALSA: ctxfi: cthw20k2: fix mask on conf to allow 4 bits
Dan Carpenter (2):
btrfs: validate qgroup inherit for SNAP_CREATE_V2 ioctl
rsxx: Return -EFAULT if copy_to_user() fails
Evan Quan (1):
drm/amd/pm: correct Arcturus mmTHM_BACO_CNTL register address
Filipe Manana (4):
btrfs: fix race between writes to swap files and scrub
btrfs: fix race between swap file activation and snapshot creation
btrfs: fix stale data exposure after cloning a hole with NO_HOLES enabled
btrfs: fix warning when creating a directory with smack enabled
Greg Kroah-Hartman (1):
Linux 5.11.5
Heiner Kallweit (1):
r8169: fix resuming from suspend on RTL8105e if machine runs on battery
Ira Weiny (1):
btrfs: fix raid6 qstripe kmap
Jarkko Sakkinen (1):
tpm, tpm_tis: Decorate tpm_get_timeouts() with request_locality()
Jens Axboe (2):
io_uring: ignore double poll add on the same waitqueue head
ia64: don't call handle_signal() unless there's actually a signal queued
Josef Bacik (2):
btrfs: avoid double put of block group when emptying cluster
btrfs: tree-checker: do not error out if extent ref hash doesn't match
Julian Braha (1):
RDMA/rxe: Fix missing kconfig dependency on CRYPTO
Kevin Wang (1):
drm/amdgpu: fix parameter error of RREG32_PCIE() in amdgpu_regs_pcie
Lu Baolu (1):
iommu: Don't use lazy flush for untrusted device
Lukasz Majczak (1):
tpm, tpm_tis: Decorate tpm_tis_gen_interrupt() with request_locality()
Mikulas Patocka (1):
dm bufio: subtract the number of initial sectors in dm_bufio_get_device_size
Milan Broz (1):
dm verity: fix FEC for RS roots unaligned to block size
Naohiro Aota (1):
btrfs: zoned: use sector_t for zone sectors
Nicolas MURE (1):
ALSA: usb-audio: Fix Pioneer DJM devices URB_CONTROL request direction to set samplerate
Nicolin Chen (1):
iommu/tegra-smmu: Fix mc errors on tegra124-nyan
Nikolay Borisov (3):
btrfs: fix race between extent freeing/allocation when using bitmaps
btrfs: free correct amount of space in btrfs_delayed_inode_reserve_metadata
btrfs: unlock extents in btrfs_zero_range in case of quota reservation errors
Pierre-Louis Bossart (1):
ALSA: hda: intel-nhlt: verify config type
Rafael J. Wysocki (1):
PM: runtime: Update device status before letting suppliers suspend
Saeed Mahameed (1):
RDMA/cm: Fix IRQ restore in ib_send_cm_sidr_rep
Steven Rostedt (VMware) (1):
ring-buffer: Force before_stamp and write_stamp to be different on discard
Takashi Iwai (3):
ALSA: usb-audio: Don't abort even if the clock rate differs
ALSA: usb-audio: Drop bogus dB range in too low level
ALSA: usb-audio: Allow modifying parameters with succeeding hw_params calls
Tetsuo Handa (1):
tomoyo: recognize kernel threads correctly
YueHaibing (1):
IB/mlx5: Add missing error code
Zenghui Yu (1):
iommu/vt-d: Fix status code for Allocate/Free PASID command
[email protected]
maintainerFrom: Greg Kroah-Hartman <[email protected]>
Makefile +1 -1
@@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 VERSION = 5 PATCHLEVEL = 11 -SUBLEVEL = 4 +SUBLEVEL = 5 EXTRAVERSION = NAME = 💕 Valentine's Day Edition 💕
arch/ia64/kernel/signal.c +2 -1
@@ -341,7 +341,8 @@ ia64_do_signal (struct sigscratch *scr, long in_syscall)* need to push through a forced SIGSEGV. */ while (1 ) { -get_signal (&ksig); +if (!get_signal (&ksig)) +break ;/* * get_signal() may have run a debugger (via notify_parent())
drivers/base/power/runtime.c +37 -25
83 lines not on this page · raw message
drivers/block/rsxx/core.c +5 -3
@@ -165,15 +165,17 @@ static ssize_t rsxx_cram_read(struct file *fp, char __user *ubuf, {struct rsxx_cardinfo *card =file_inode (fp)->i_private;char *buf; -ssize_t st; +int st; buf =kzalloc (cnt,GFP_KERNEL );if (!buf)return -ENOMEM ; st =rsxx_creg_read (card,CREG_ADD_CRAM + (u32)*ppos, cnt, buf,1 ); -if (!st) - st =copy_to_user (ubuf, buf, cnt); +if (!st) { +if (copy_to_user (ubuf, buf, cnt)) + st = -EFAULT ; + }kfree (buf);if (st)return st;
drivers/char/tpm/tpm_tis_core.c +25 -5
@@ -707,12 +707,22 @@ static int tpm_tis_gen_interrupt(struct tpm_chip *chip)const char *desc ="attempting to generate an interrupt" ;u32 cap2;cap_t cap; +int ret; +/* TPM 2.0 */ if (chip->flags &TPM_CHIP_FLAG_TPM2 )return tpm2_get_tpm_pt (chip,0x100 , &cap2, desc); -else -return tpm1_getcap (chip,TPM_CAP_PROP_TIS_TIMEOUT , &cap, desc, -0 ); + +/* TPM 1.2 */ + ret =request_locality (chip,0 ); +if (ret <0 ) +return ret; + + ret =tpm1_getcap (chip,TPM_CAP_PROP_TIS_TIMEOUT , &cap, desc,0 ); + +release_locality (chip,0 ); + +return ret; }/* Register the IRQ and issue a command that will cause an interrupt. If an
@@ -1019,11 +1029,21 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,init_waitqueue_head (&priv->read_queue);init_waitqueue_head (&priv->int_queue);if (irq !=-1 ) { -/* Before doing irq testing issue a command to the TPM in polling mode +/* +* Before doing irq testing issue a command to the TPM in polling mode * to make sure it works. May as well use that command to set the * proper timeouts for the driver. */ -if (tpm_get_timeouts (chip)) { + + rc =request_locality (chip,0 ); +if (rc <0 ) + goto out_err; + + rc =tpm_get_timeouts (chip); + +release_locality (chip,0 ); + +if (rc) {dev_err (dev,"Could not get TPM timeouts and durations\n" ); rc = -ENODEV ; goto out_err;
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +2 -1
@@ -903,10 +903,11 @@ void amdgpu_acpi_fini(struct amdgpu_device *adev)*/ bool amdgpu_acpi_is_s0ix_supported (struct amdgpu_device *adev) { +#if defined(CONFIG_AMD_PMC )if (acpi_gbl_FADT.flags &ACPI_FADT_LOW_POWER_S0 ) {if (adev->flags &AMD_IS_APU )return true; } - +#endif return false; }
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +2 -2
@@ -356,7 +356,7 @@ static ssize_t amdgpu_debugfs_regs_pcie_read(struct file *f, char __user *buf,while (size) {uint32_t value; - value =RREG32_PCIE (*pos >>2 ); + value =RREG32_PCIE (*pos); r =put_user (value, (uint32_t *)buf);if (r) {pm_runtime_mark_last_busy (adev_to_drm (adev)->dev);
@@ -423,7 +423,7 @@ static ssize_t amdgpu_debugfs_regs_pcie_write(struct file *f, const char __userreturn r; } -WREG32_PCIE (*pos >>2 , value); +WREG32_PCIE (*pos, value); result +=4 ; buf +=4 ;
drivers/gpu/drm/amd/amdgpu/nv.c +4 -2
@@ -498,7 +498,8 @@ static bool nv_is_headless_sku(struct pci_dev *pdev) {if ((pdev->device ==0x731E && (pdev->revision ==0xC6 || pdev->revision ==0xC7 )) || - (pdev->device ==0x7340 && pdev->revision ==0xC9 )) + (pdev->device ==0x7340 && pdev->revision ==0xC9 ) || + (pdev->device ==0x7360 && pdev->revision ==0xC7 ))return true;return false; }
@@ -568,7 +569,8 @@ int nv_set_ip_blocks(struct amdgpu_device *adev)if (adev->firmware.load_type ==AMDGPU_FW_LOAD_DIRECT && !amdgpu_sriov_vf (adev))amdgpu_device_ip_block_add (adev, &smu_v11_0_ip_block); -amdgpu_device_ip_block_add (adev, &vcn_v2_0_ip_block); +if (!nv_is_headless_sku (adev->pdev)) +amdgpu_device_ip_block_add (adev, &vcn_v2_0_ip_block);if (!amdgpu_sriov_vf (adev))amdgpu_device_ip_block_add (adev, &jpeg_v2_0_ip_block);break ;
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +12 -3
@@ -78,6 +78,9 @@ MODULE_FIRMWARE("amdgpu/dimgrey_cavefish_smc.bin");#define PCIE_LC_SPEED_CNTL__LC_CURRENT_DATA_RATE_MASK 0xC000#define PCIE_LC_SPEED_CNTL__LC_CURRENT_DATA_RATE__SHIFT 0xE +#define mmTHM_BACO_CNTL_ARCT 0xA7 +#define mmTHM_BACO_CNTL_ARCT_BASE_IDX 0 +static int link_width[] = {0 ,1 ,2 ,4 ,8 ,12 ,16 };static int link_speed[] = {25 ,50 ,80 ,160 };
@@ -1581,9 +1584,15 @@ int smu_v11_0_baco_set_state(struct smu_context *smu, enum smu_baco_state state)break ;default :if (!ras || !ras->supported) { - data =RREG32_SOC15 (THM ,0 , mmTHM_BACO_CNTL); - data |=0x80000000 ; -WREG32_SOC15 (THM ,0 , mmTHM_BACO_CNTL, data); +if (adev->asic_type ==CHIP_ARCTURUS ) { + data =RREG32_SOC15 (THM ,0 , mmTHM_BACO_CNTL_ARCT); + data |=0x80000000 ; +WREG32_SOC15 (THM ,0 , mmTHM_BACO_CNTL_ARCT, data); + }else { + data =RREG32_SOC15 (THM ,0 , mmTHM_BACO_CNTL); + data |=0x80000000 ; +WREG32_SOC15 (THM ,0 , mmTHM_BACO_CNTL, data); + } ret =smu_cmn_send_smc_msg_with_param (smu, SMU_MSG_EnterBaco,0 ,NULL ); }else {
drivers/infiniband/core/cm.c +3 -2
@@ -3651,6 +3651,7 @@ static int cm_send_sidr_rep_locked(struct cm_id_private *cm_id_priv, struct ib_cm_sidr_rep_param *param) {struct ib_mad_send_buf *msg; +unsigned long flags;int ret;lockdep_assert_held (&cm_id_priv->lock);
@@ -3676,12 +3677,12 @@ static int cm_send_sidr_rep_locked(struct cm_id_private *cm_id_priv,return ret; } cm_id_priv->id.state =IB_CM_IDLE ; -spin_lock_irq (&cm.lock); +spin_lock_irqsave (&cm.lock, flags);if (!RB_EMPTY_NODE (&cm_id_priv->sidr_id_node)) {rb_erase (&cm_id_priv->sidr_id_node, &cm.remote_sidr_table);RB_CLEAR_NODE (&cm_id_priv->sidr_id_node); } -spin_unlock_irq (&cm.lock); +spin_unlock_irqrestore (&cm.lock, flags);return 0 ; }
drivers/infiniband/hw/mlx5/devx.c +3 -1
@@ -1970,8 +1970,10 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_DEVX_SUBSCRIBE_EVENT)( num_alloc_xa_entries++; event_sub =kzalloc (sizeof (*event_sub),GFP_KERNEL ); -if (!event_sub) +if (!event_sub) { + err = -ENOMEM ; goto err; + }list_add_tail (&event_sub->event_list, &sub_list);uverbs_uobject_get (&ev_file->uobj);
drivers/infiniband/sw/rxe/Kconfig +1 -0
@@ -4,6 +4,7 @@ config RDMA_RXE depends on INET && PCI && INFINIBAND depends on INFINIBAND_VIRT_DMA select NET_UDP_TUNNEL + select CRYPTO select CRYPTO_CRC32 help This driver implements the InfiniBand RDMA transport over
drivers/iommu/dma-iommu.c +8 -7
@@ -309,6 +309,11 @@ static void iommu_dma_flush_iotlb_all(struct iova_domain *iovad) domain->ops->flush_iotlb_all (domain); } +static bool dev_is_untrusted (struct device *dev) +{ +return dev_is_pci (dev) &&to_pci_dev (dev)->untrusted; +} +/** * iommu_dma_init_domain - Initialise a DMA mapping domain * @domain: IOMMU domain previously prepared by iommu_get_dma_cookie()
@@ -363,8 +368,9 @@ static int iommu_dma_init_domain(struct iommu_domain *domain, dma_addr_t base,init_iova_domain (iovad,1UL << order, base_pfn); -if (!cookie->fq_domain && !iommu_domain_get_attr (domain, -DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE , &attr) && attr) { +if (!cookie->fq_domain && (!dev || !dev_is_untrusted (dev)) && + !iommu_domain_get_attr (domain,DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE , &attr) && + attr) {if (init_iova_flush_queue (iovad, iommu_dma_flush_iotlb_all, iommu_dma_entry_dtor))pr_warn ("iova flush queue initialization failed\n" );
@@ -521,11 +527,6 @@ static void __iommu_dma_unmap_swiotlb(struct device *dev, dma_addr_t dma_addr, iova_align(iovad, size), dir, attrs); } -static bool dev_is_untrusted (struct device *dev) -{ -return dev_is_pci (dev) &&to_pci_dev (dev)->untrusted; -} -static dma_addr_t __iommu_dma_map (struct device *dev,phys_addr_t phys,size_t size,int prot,u64 dma_mask) {
drivers/iommu/intel/pasid.h +2 -2
@@ -30,8 +30,8 @@#define VCMD_VRSP_IP 0x1#define VCMD_VRSP_SC (e) (((e) >> 1) & 0x3)#define VCMD_VRSP_SC_SUCCESS 0 -#define VCMD_VRSP_SC_NO_PASID_AVAIL 1 -#define VCMD_VRSP_SC_INVALID_PASID 1 +#define VCMD_VRSP_SC_NO_PASID_AVAIL 2 +#define VCMD_VRSP_SC_INVALID_PASID 2#define VCMD_VRSP_RESULT_PASID (e) (((e) >> 8) & 0xfffff)#define VCMD_CMD_OPERAND (e) ((e) << 8)/*
drivers/iommu/tegra-smmu.c +71 -1
87 lines not on this page · raw message
drivers/md/dm-bufio.c +4 -0
@@ -1526,6 +1526,10 @@ EXPORT_SYMBOL_GPL(dm_bufio_get_block_size);sector_t dm_bufio_get_device_size (struct dm_bufio_client *c) {sector_t s =i_size_read (c->bdev->bd_inode) >>SECTOR_SHIFT ; +if (s >= c->start) + s -= c->start; +else + s =0 ;if (likely (c->sectors_per_block_bits >=0 )) s >>= c->sectors_per_block_bits;else
drivers/md/dm-verity-fec.c +12 -11
@@ -61,19 +61,18 @@ static int fec_decode_rs8(struct dm_verity *v, struct dm_verity_fec_io *fio,static u8 *fec_read_parity (struct dm_verity *v,u64 rsb,int index,unsigned *offset,struct dm_buffer **buf) { -u64 position, block; +u64 position, block, rem;u8 *res; position = (index + rsb) * v->fec->roots; - block = position >> v->data_dev_block_bits; - *offset = (unsigned )(position - (block << v->data_dev_block_bits)); + block =div64_u64_rem (position, v->fec->roots <<SECTOR_SHIFT , &rem); + *offset = (unsigned )rem; - res =dm_bufio_read (v->fec->bufio, v->fec->start + block, buf); + res =dm_bufio_read (v->fec->bufio, block, buf);if (IS_ERR (res)) {DMERR ("%s: FEC %llu: parity read failed (block %llu): %ld" , v->data_dev->name, (unsigned long long )rsb, - (unsigned long long )(v->fec->start + block), -PTR_ERR (res)); + (unsigned long long )block,PTR_ERR (res)); *buf =NULL ; }
@@ -155,7 +154,7 @@ static int fec_decode_bufs(struct dm_verity *v, struct dm_verity_fec_io *fio,/* read the next block when we run out of parity bytes */ offset += v->fec->roots; -if (offset >=1 << v->data_dev_block_bits) { +if (offset >= v->fec->roots <<SECTOR_SHIFT ) {dm_bufio_release (buf); par =fec_read_parity (v, rsb, block_offset, &offset, &buf);
@@ -674,7 +673,7 @@ int verity_fec_ctr(struct dm_verity *v) {struct dm_verity_fec *f = v->fec;struct dm_target *ti = v->ti; -u64 hash_blocks; +u64 hash_blocks, fec_blocks;int ret;if (!verity_fec_is_enabled (v)) {
@@ -744,15 +743,17 @@ int verity_fec_ctr(struct dm_verity *v) } f->bufio =dm_bufio_client_create (f->dev->bdev, -1 << v->data_dev_block_bits, + f->roots <<SECTOR_SHIFT ,1 ,0 ,NULL ,NULL );if (IS_ERR (f->bufio)) { ti->error ="Cannot initialize FEC bufio client" ;return PTR_ERR (f->bufio); } -if (dm_bufio_get_device_size (f->bufio) < - ((f->start + f->rounds * f->roots) >> v->data_dev_block_bits)) { +dm_bufio_set_sector_offset (f->bufio, f->start << (v->data_dev_block_bits -SECTOR_SHIFT )); + + fec_blocks =div64_u64 (f->rounds * f->roots, v->fec->roots <<SECTOR_SHIFT ); +if (dm_bufio_get_device_size (f->bufio) < fec_blocks) { ti->error ="FEC device is too small" ;return -E2BIG ; }
drivers/net/ethernet/realtek/r8169_main.c +2 -0
@@ -2208,6 +2208,7 @@ static void rtl_pll_power_down(struct rtl8169_private *tp)switch (tp->mac_version) { case RTL_GIGA_MAC_VER_25 ... RTL_GIGA_MAC_VER_26: + case RTL_GIGA_MAC_VER_29 ... RTL_GIGA_MAC_VER_30: case RTL_GIGA_MAC_VER_32 ... RTL_GIGA_MAC_VER_33:case RTL_GIGA_MAC_VER_37 :case RTL_GIGA_MAC_VER_39 :
@@ -2235,6 +2236,7 @@ static void rtl_pll_power_up(struct rtl8169_private *tp) {switch (tp->mac_version) { case RTL_GIGA_MAC_VER_25 ... RTL_GIGA_MAC_VER_26: + case RTL_GIGA_MAC_VER_29 ... RTL_GIGA_MAC_VER_30: case RTL_GIGA_MAC_VER_32 ... RTL_GIGA_MAC_VER_33:case RTL_GIGA_MAC_VER_37 :case RTL_GIGA_MAC_VER_39 :
fs/btrfs/block-group.c +32 -1
@@ -1150,6 +1150,11 @@ static int inc_block_group_ro(struct btrfs_block_group *cache, int force)spin_lock (&sinfo->lock);spin_lock (&cache->lock); +if (cache->swap_extents) { + ret = -ETXTBSY ; + goto out; + } +if (cache->ro) { cache->ro++; ret =0 ;
@@ -2253,7 +2258,7 @@ int btrfs_inc_block_group_ro(struct btrfs_block_group *cache, } ret =inc_block_group_ro (cache,0 ); -if (!do_chunk_alloc) +if (!do_chunk_alloc || ret == -ETXTBSY ) goto unlock_out;if (!ret) goto out;
@@ -2262,6 +2267,8 @@ int btrfs_inc_block_group_ro(struct btrfs_block_group *cache,if (ret <0 ) goto out; ret =inc_block_group_ro (cache,0 ); +if (ret == -ETXTBSY ) + goto unlock_out; out:if (cache->flags &BTRFS_BLOCK_GROUP_SYSTEM ) { alloc_flags =btrfs_get_alloc_profile (fs_info, cache->flags);
@@ -3345,6 +3352,7 @@ int btrfs_free_block_groups(struct btrfs_fs_info *info)ASSERT (list_empty (&block_group->io_list));ASSERT (list_empty (&block_group->bg_list));ASSERT (refcount_read (&block_group->refs) ==1 ); +ASSERT (block_group->swap_extents ==0 );btrfs_put_block_group (block_group);spin_lock (&info->block_group_cache_lock);
@@ -3411,3 +3419,26 @@ void btrfs_unfreeze_block_group(struct btrfs_block_group *block_group)__btrfs_remove_free_space_cache (block_group->free_space_ctl); } } + +bool btrfs_inc_block_group_swap_extents (struct btrfs_block_group *bg) +{ +bool ret = true; + +spin_lock (&bg->lock); +if (bg->ro) + ret = false; +else + bg->swap_extents++; +spin_unlock (&bg->lock); + +return ret; +} + +void btrfs_dec_block_group_swap_extents (struct btrfs_block_group *bg,int amount) +{ +spin_lock (&bg->lock); +ASSERT (!bg->ro); +ASSERT (bg->swap_extents >= amount); + bg->swap_extents -= amount; +spin_unlock (&bg->lock); +}
fs/btrfs/block-group.h +9 -0
@@ -181,6 +181,12 @@ struct btrfs_block_group {*/ int needs_free_space; +/* +* Number of extents in this block group used for swap files. +* All accesses protected by the spinlock 'lock'. +*/ +int swap_extents; +/* Record locked full stripes for RAID5/6 block group */ struct btrfs_full_stripe_locks_tree full_stripe_locks_root; };
@@ -301,4 +307,7 @@ int btrfs_rmap_block(struct btrfs_fs_info *fs_info, u64 chunk_start, u64 physical, u64 **logical, int *naddrs, int *stripe_len);#endif +bool btrfs_inc_block_group_swap_extents (struct btrfs_block_group *bg); +void btrfs_dec_block_group_swap_extents (struct btrfs_block_group *bg,int amount); +#endif /* BTRFS_BLOCK_GROUP_H */
fs/btrfs/ctree.h +5 -0
@@ -523,6 +523,11 @@ struct btrfs_swapfile_pin {* points to a struct btrfs_device. */ bool is_block_group; +/* +* Only used when 'is_block_group' is true and it is the number of +* extents used by a swapfile for this block group ('ptr' field). +*/ +int bg_extent_count; };bool btrfs_pinned_by_swapfile (struct btrfs_fs_info *fs_info,void *ptr);
fs/btrfs/delayed-inode.c +1 -1
@@ -649,7 +649,7 @@ static int btrfs_delayed_inode_reserve_metadata(btrfs_ino (inode), num_bytes, 1); }else { -btrfs_qgroup_free_meta_prealloc (root, fs_info->nodesize); +btrfs_qgroup_free_meta_prealloc (root, num_bytes); }return ret; }
fs/btrfs/file.c +4 -1
@@ -3264,8 +3264,11 @@ static int btrfs_zero_range(struct inode *inode, goto out; ret =btrfs_qgroup_reserve_data (BTRFS_I (inode), &data_reserved, alloc_start, bytes_to_reserve); -if (ret) +if (ret) { +unlock_extent_cached (&BTRFS_I (inode)->io_tree, lockstart, + lockend, &cached_state); goto out; + } ret = btrfs_prealloc_file_range(inode, mode, alloc_start, alloc_end - alloc_start, i_blocksize(inode),
fs/btrfs/free-space-cache.c +8 -6
@@ -2708,8 +2708,10 @@ static void __btrfs_return_cluster_to_free_space(struct rb_node *node;spin_lock (&cluster->lock); -if (cluster->block_group != block_group) - goto out; +if (cluster->block_group != block_group) { +spin_unlock (&cluster->lock); +return ; + } cluster->block_group =NULL ; cluster->window_start =0 ;
@@ -2747,8 +2749,6 @@ static void __btrfs_return_cluster_to_free_space( entry->offset, &entry->offset_index, bitmap); } cluster->root =RB_ROOT ; - -out:spin_unlock (&cluster->lock);btrfs_put_block_group (block_group); }
@@ -3028,8 +3028,6 @@ u64 btrfs_alloc_from_cluster(struct btrfs_block_group *block_group, entry->bytes -= bytes; } -if (entry->bytes ==0 ) -rb_erase (&entry->offset_index, &cluster->root);break ; } out:
@@ -3046,7 +3044,10 @@ u64 btrfs_alloc_from_cluster(struct btrfs_block_group *block_group, ctl->free_space -= bytes;if (!entry->bitmap && !btrfs_free_space_trimmed (entry)) ctl->discardable_bytes[BTRFS_STAT_CURR ] -= bytes; + +spin_lock (&cluster->lock);if (entry->bytes ==0 ) { +rb_erase (&entry->offset_index, &cluster->root); ctl->free_extents--;if (entry->bitmap) { kmem_cache_free(btrfs_free_space_bitmap_cachep,
@@ -3059,6 +3060,7 @@ u64 btrfs_alloc_from_cluster(struct btrfs_block_group *block_group,kmem_cache_free (btrfs_free_space_cachep, entry); } +spin_unlock (&cluster->lock);spin_unlock (&ctl->tree_lock);return ret;
fs/btrfs/inode.c +37 -3
@@ -9993,6 +9993,7 @@ static int btrfs_add_swapfile_pin(struct inode *inode, void *ptr, sp->ptr = ptr; sp->inode = inode; sp->is_block_group = is_block_group; + sp->bg_extent_count =1 ;spin_lock (&fs_info->swapfile_pins_lock); p = &fs_info->swapfile_pins.rb_node;
@@ -10006,6 +10007,8 @@ static int btrfs_add_swapfile_pin(struct inode *inode, void *ptr, (sp->ptr == entry->ptr && sp->inode > entry->inode)) { p = &(*p)->rb_right; } else { +if (is_block_group) + entry->bg_extent_count++;spin_unlock (&fs_info->swapfile_pins_lock);kfree (sp);return 1 ;
@@ -10031,8 +10034,11 @@ static void btrfs_free_swapfile_pins(struct inode *inode) sp = rb_entry(node, struct btrfs_swapfile_pin, node);if (sp->inode == inode) {rb_erase (&sp->node, &fs_info->swapfile_pins); -if (sp->is_block_group) +if (sp->is_block_group) { +btrfs_dec_block_group_swap_extents (sp->ptr, + sp->bg_extent_count);btrfs_put_block_group (sp->ptr); + }kfree (sp); } node = next;
@@ -10093,7 +10099,8 @@ static int btrfs_swap_activate(struct swap_info_struct *sis, struct file *file, sector_t *span) {struct inode *inode =file_inode (file); -struct btrfs_fs_info *fs_info =BTRFS_I (inode)->root->fs_info; +struct btrfs_root *root =BTRFS_I (inode)->root; +struct btrfs_fs_info *fs_info = root->fs_info;struct extent_io_tree *io_tree = &BTRFS_I (inode)->io_tree;struct extent_state *cached_state =NULL ;struct extent_map *em =NULL ;
@@ -10144,13 +10151,27 @@ static int btrfs_swap_activate(struct swap_info_struct *sis, struct file *file, "cannot activate swapfile while exclusive operation is running");return -EBUSY ; } + +/* +* Prevent snapshot creation while we are activating the swap file. +* We do not want to race with snapshot creation. If snapshot creation +* already started before we bumped nr_swapfiles from 0 to 1 and +* completes before the first write into the swap file after it is +* activated, than that write would fallback to COW. +*/ +if (!btrfs_drew_try_write_lock (&root->snapshot_lock)) { +btrfs_exclop_finish (fs_info); +btrfs_warn (fs_info, +"cannot activate swapfile because snapshot creation is in progress" ); +return -EINVAL ; + }/* * Snapshots can create extents which require COW even if NODATACOW is * set. We use this counter to prevent snapshots. We must increment it * before walking the extents because we don't want a concurrent * snapshot to run after we've already checked the extents. */ -atomic_inc (&BTRFS_I (inode)->root->nr_swapfiles); +atomic_inc (&root->nr_swapfiles); isize =ALIGN_DOWN (inode->i_size, fs_info->sectorsize);
@@ -10247,6 +10268,17 @@ static int btrfs_swap_activate(struct swap_info_struct *sis, struct file *file, goto out; } +if (!btrfs_inc_block_group_swap_extents (bg)) { +btrfs_warn (fs_info, +"block group for swapfile at %llu is read-only%s" , + bg->start, +atomic_read (&fs_info->scrubs_running) ? +" (scrub running)" :"" ); +btrfs_put_block_group (bg); + ret = -EINVAL ; + goto out; + } + ret =btrfs_add_swapfile_pin (inode, bg, true);if (ret) {btrfs_put_block_group (bg);
@@ -10285,6 +10317,8 @@ static int btrfs_swap_activate(struct swap_info_struct *sis, struct file *file,if (ret)btrfs_swap_deactivate (file); +btrfs_drew_write_unlock (&root->snapshot_lock); +btrfs_exclop_finish (fs_info);if (ret)
fs/btrfs/ioctl.c +18 -1
@@ -1926,7 +1926,10 @@ static noinline int btrfs_ioctl_snap_create_v2(struct file *file,if (vol_args->flags &BTRFS_SUBVOL_RDONLY ) readonly = true;if (vol_args->flags &BTRFS_SUBVOL_QGROUP_INHERIT ) { -if (vol_args->size >PAGE_SIZE ) { +u64 nums; + +if (vol_args->size <sizeof (*inherit) || + vol_args->size >PAGE_SIZE ) { ret = -EINVAL ; goto free_args; }
@@ -1935,6 +1938,20 @@ static noinline int btrfs_ioctl_snap_create_v2(struct file *file, ret =PTR_ERR (inherit); goto free_args; } + +if (inherit->num_qgroups >PAGE_SIZE || + inherit->num_ref_copies >PAGE_SIZE || + inherit->num_excl_copies >PAGE_SIZE ) { + ret = -EINVAL ; + goto free_inherit; + } + + nums = inherit->num_qgroups +2 * inherit->num_ref_copies + +2 * inherit->num_excl_copies; +if (vol_args->size !=struct_size (inherit, qgroups, nums)) { + ret = -EINVAL ; + goto free_inherit; + } } ret = __btrfs_ioctl_snap_create(file, vol_args->name, vol_args->fd,
fs/btrfs/raid56.c +10 -11
@@ -2363,16 +2363,21 @@ static noinline void finish_parity_scrub(struct btrfs_raid_bio *rbio,SetPageUptodate (p_page);if (has_qstripe) { +/* RAID6, allocate and map temp space for the Q stripe */ q_page =alloc_page (GFP_NOFS | __GFP_HIGHMEM);if (!q_page) {__free_page (p_page); goto cleanup; }SetPageUptodate (q_page); + pointers[rbio->real_stripes -1 ] =kmap (q_page); }atomic_set (&rbio->error,0 ); +/* Map the parity stripe just once */ + pointers[nr_data] =kmap (p_page); +for_each_set_bit (pagenr, rbio->dbitmap, rbio->stripe_npages) {struct page *p;void *parity;
@@ -2382,16 +2387,8 @@ static noinline void finish_parity_scrub(struct btrfs_raid_bio *rbio, pointers[stripe] =kmap (p); } -/* then add the parity stripe */ - pointers[stripe++] =kmap (p_page); -if (has_qstripe) { -/* -* raid6, add the qstripe and call the -* library function to fill in our p/q -*/ - pointers[stripe++] =kmap (q_page); - +/* RAID6, call the library function to fill in our P/Q */ raid6_call.gen_syndrome (rbio->real_stripes,PAGE_SIZE , pointers); }else {
@@ -2412,12 +2409,14 @@ static noinline void finish_parity_scrub(struct btrfs_raid_bio *rbio,for (stripe =0 ; stripe < nr_data; stripe++)kunmap (page_in_rbio (rbio, stripe, pagenr,0 )); -kunmap (p_page); } +kunmap (p_page);__free_page (p_page); -if (q_page) +if (q_page) { +kunmap (q_page);__free_page (q_page); + } writeback:/*
fs/btrfs/reflink.c +18 -0
@@ -550,6 +550,24 @@ static int btrfs_clone(struct inode *src, struct inode *inode,*/ btrfs_release_path (path); +/* +* When using NO_HOLES and we are cloning a range that covers +* only a hole (no extents) into a range beyond the current +* i_size, punching a hole in the target range will not create +* an extent map defining a hole, because the range starts at or +* beyond current i_size. If the file previously had an i_size +* greater than the new i_size set by this clone operation, we +* need to make sure the next fsync is a full fsync, so that it +* detects and logs a hole covering a range from the current +* i_size to the new i_size. If the clone range covers extents, +* besides a hole, then we know the full sync flag was already +* set by previous calls to btrfs_replace_file_extents() that +* replaced file extent items. +*/ +if (last_dest_end >=i_size_read (inode)) +set_bit (BTRFS_INODE_NEEDS_FULL_SYNC , + &BTRFS_I (inode)->runtime_flags); + ret =btrfs_replace_file_extents (inode, path, last_dest_end, destoff + len -1 ,NULL , &trans);if (ret)
fs/btrfs/scrub.c +8 -1
@@ -3630,6 +3630,13 @@ int scrub_enumerate_chunks(struct scrub_ctx *sctx,* commit_transactions. */ ro_set =0 ; + }else if (ret == -ETXTBSY ) { +btrfs_warn (fs_info, +"skipping scrub of block group %llu due to active swapfile" , + cache->start); +scrub_pause_off (fs_info); + ret =0 ; + goto skip_unfreeze; }else {btrfs_warn (fs_info,"failed setting block group ro: %d" , ret);
@@ -3719,7 +3726,7 @@ int scrub_enumerate_chunks(struct scrub_ctx *sctx, }else {spin_unlock (&cache->lock); } - +skip_unfreeze:btrfs_unfreeze_block_group (cache);btrfs_put_block_group (cache);if (ret)
fs/btrfs/super.c +2 -2
@@ -1919,8 +1919,8 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)btrfs_resize_thread_pool (fs_info, fs_info->thread_pool_size, old_thread_pool_size); -if (btrfs_test_opt (fs_info,FREE_SPACE_TREE ) != -btrfs_fs_compat_ro (fs_info,FREE_SPACE_TREE ) && +if ((bool )btrfs_test_opt (fs_info,FREE_SPACE_TREE ) != + (bool )btrfs_fs_compat_ro (fs_info,FREE_SPACE_TREE ) && (!sb_rdonly (sb) || (*flags &SB_RDONLY ))) {btrfs_warn (fs_info,"remount supports changing free space tree only from ro to rw" );
fs/btrfs/tree-checker.c +4 -12
@@ -1453,22 +1453,14 @@ static int check_extent_data_ref(struct extent_buffer *leaf,return -EUCLEAN ; }for (; ptr < end; ptr +=sizeof (*dref)) { -u64 root_objectid; -u64 owner;u64 offset; -u64 hash; +/* +* We cannot check the extent_data_ref hash due to possible +* overflow from the leaf due to hash collisions. +*/ dref = (struct btrfs_extent_data_ref *)ptr; - root_objectid =btrfs_extent_data_ref_root (leaf, dref); - owner =btrfs_extent_data_ref_objectid (leaf, dref); offset =btrfs_extent_data_ref_offset (leaf, dref); - hash =hash_extent_data_ref (root_objectid, owner, offset); -if (unlikely (hash != key->offset)) { -extent_err (leaf, slot, -"invalid extent data ref hash, item has 0x%016llx key has 0x%016llx" , - hash, key->offset); -return -EUCLEAN ; - }if (unlikely (!IS_ALIGNED (offset, leaf->fs_info->sectorsize))) { extent_err(leaf, slot, "invalid extent data backref offset, have %llu expect aligned to %u",
fs/btrfs/xattr.c +27 -4
@@ -229,11 +229,33 @@ int btrfs_setxattr_trans(struct inode *inode, const char *name, {struct btrfs_root *root =BTRFS_I (inode)->root;struct btrfs_trans_handle *trans; +const bool start_trans = (current->journal_info ==NULL );int ret; - trans =btrfs_start_transaction (root,2 ); -if (IS_ERR (trans)) -return PTR_ERR (trans); +if (start_trans) { +/* +* 1 unit for inserting/updating/deleting the xattr +* 1 unit for the inode item update +*/ + trans =btrfs_start_transaction (root,2 ); +if (IS_ERR (trans)) +return PTR_ERR (trans); + }else { +/* +* This can happen when smack is enabled and a directory is being +* created. It happens through d_instantiate_new(), which calls +* smack_d_instantiate(), which in turn calls __vfs_setxattr() to +* set the transmute xattr (XATTR_NAME_SMACKTRANSMUTE) on the +* inode. We have already reserved space for the xattr and inode +* update at btrfs_mkdir(), so just use the transaction handle. +* We don't join or start a transaction, as that will reset the +* block_rsv of the handle and trigger a warning for the start +* case. +*/ +ASSERT (strncmp (name,XATTR_SECURITY_PREFIX , +XATTR_SECURITY_PREFIX_LEN ) ==0 ); + trans = current->journal_info; + } ret =btrfs_setxattr (trans, inode, name, value, size, flags);if (ret)
@@ -244,7 +266,8 @@ int btrfs_setxattr_trans(struct inode *inode, const char *name, ret =btrfs_update_inode (trans, root,BTRFS_I (inode));BUG_ON (ret); out: -btrfs_end_transaction (trans); +if (start_trans) +btrfs_end_transaction (trans);return ret; }
fs/btrfs/zoned.c +2 -2
@@ -152,7 +152,7 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device)sector_t sector =0 ;struct blk_zone *zones =NULL ;unsigned int i, nreported =0 , nr_zones; -unsigned int zone_sectors; +sector_t zone_sectors;int ret;if (!bdev_is_zoned (bdev))
@@ -485,7 +485,7 @@ int btrfs_sb_log_location_bdev(struct block_device *bdev, int mirror, int rw, u64 *bytenr_ret) {struct blk_zone zones[BTRFS_NR_SB_LOG_ZONES ]; -unsigned int zone_sectors; +sector_t zone_sectors;u32 sb_zone;int ret;u64 zone_size;
fs/io_uring.c +3 -0
@@ -5316,6 +5316,9 @@ static void __io_queue_proc(struct io_poll_iocb *poll, struct io_poll_table *pt, pt->error = -EINVAL ;return ; } +/* double add on the same waitqueue head, ignore */ +if (poll->head == head) +return ; poll =kmalloc (sizeof (*poll),GFP_ATOMIC );if (!poll) { pt->error = -ENOMEM ;
include/crypto/hash.h +4 -4
@@ -149,7 +149,7 @@ struct ahash_alg {struct shash_desc {struct crypto_shash *tfm; - void *__ctx[] CRYPTO_MINALIGN_ATTR; +void *__ctx[]__aligned(ARCH_SLAB_MINALIGN) ; };#define HASH_MAX_DIGESTSIZE 64
@@ -162,9 +162,9 @@ struct shash_desc {#define HASH_MAX_STATESIZE 512 -#define SHASH_DESC_ON_STACK (shash, ctx) \ - char __##shash##_desc[sizeof(struct shash_desc) + \ - HASH_MAX_DESCSIZE] CRYPTO_MINALIGN_ATTR; \ +#define SHASH_DESC_ON_STACK (shash, ctx) \ + char __##shash##_desc[sizeof(struct shash_desc) + HASH_MAX_DESCSIZE] \ + __aligned(__alignof__(struct shash_desc)); \ struct shash_desc *shash = (struct shash_desc *)__##shash##_desc/**
include/linux/crypto.h +6 -3
@@ -151,9 +151,12 @@* The macro CRYPTO_MINALIGN_ATTR (along with the void * type in the actual * declaration) is used to ensure that the crypto_tfm context structure is * aligned correctly for the given architecture so that there are no alignment -* faults for C data types. In particular, this is required on platforms such -* as arm where pointers are 32-bit aligned but there are data types such as -* u64 which require 64-bit alignment. +* faults for C data types. On architectures that support non-cache coherent +* DMA, such as ARM or arm64, it also takes into account the minimal alignment +* that is required to ensure that the context struct member does not share any +* cachelines with the rest of the struct. This is needed to ensure that cache +* maintenance for non-coherent DMA (cache invalidation in particular) does not +* affect data that may be accessed by the CPU concurrently. */ #define CRYPTO_MINALIGN ARCH_KMALLOC_MINALIGN
include/sound/intel-nhlt.h +5 -0
@@ -112,6 +112,11 @@ struct nhlt_vendor_dmic_array_config {/* TODO add vendor mic config */ } __packed; +enum { +NHLT_CONFIG_TYPE_GENERIC =0 , +NHLT_CONFIG_TYPE_MIC_ARRAY =1 +}; +enum {NHLT_MIC_ARRAY_2CH_SMALL =0xa ,NHLT_MIC_ARRAY_2CH_BIG =0xb ,
kernel/trace/ring_buffer.c +11 -0
@@ -2821,6 +2821,17 @@ rb_try_to_discard(struct ring_buffer_per_cpu *cpu_buffer, write_stamp, write_stamp - delta))return 0 ; +/* +* It's possible that the event time delta is zero +* (has the same time stamp as the previous event) +* in which case write_stamp and before_stamp could +* be the same. In such a case, force before_stamp +* to be different than write_stamp. It doesn't +* matter what it is, as long as its different. +*/ +if (!delta) +rb_time_set (&cpu_buffer->before_stamp,0 ); +/* * If an event were to come in now, it would see that the * write_stamp and the before_stamp are different, and assume
scripts/recordmcount.c +1 -1
@@ -438,7 +438,7 @@ static int arm_is_fake_mcount(Elf32_Rel const *rp)static int arm64_is_fake_mcount (Elf64_Rel const *rp) { -return ELF64_R_TYPE (w (rp->r_info)) !=R_AARCH64_CALL26 ; +return ELF64_R_TYPE (w8 (rp->r_info)) !=R_AARCH64_CALL26 ; }/* 64-bit EM_MIPS has weird ELF64_Rela.r_info.
security/tomoyo/network.c +1 -1
@@ -613,7 +613,7 @@ static int tomoyo_check_unix_address(struct sockaddr *addr,static bool tomoyo_kernel_service (void ) {/* Nothing to do if I am a kernel service. */ -return uaccess_kernel (); +return (current->flags & (PF_KTHREAD |PF_IO_WORKER )) ==PF_KTHREAD ; }/**
sound/hda/intel-nhlt.c +45 -9
76 lines not on this page · raw message
sound/pci/ctxfi/cthw20k2.c +1 -1
@@ -991,7 +991,7 @@ static int daio_mgr_dao_init(void *blk, unsigned int idx, unsigned int conf)if (idx <4 ) {/* S/PDIF output */ -switch ((conf &0x7 )) { +switch ((conf &0xf )) {case 1 :set_field (&ctl->txctl[idx],ATXCTL_NUC ,0 );break ;
sound/pci/hda/patch_realtek.c +13 -0
@@ -6408,6 +6408,7 @@ enum {ALC236_FIXUP_DELL_AIO_HEADSET_MIC ,ALC282_FIXUP_ACER_DISABLE_LINEOUT ,ALC255_FIXUP_ACER_LIMIT_INT_MIC_BOOST , + ALC256_FIXUP_ACER_HEADSET_MIC, }; static const struct hda_fixup alc269_fixups[] = {
@@ -7864,6 +7865,16 @@ static const struct hda_fixup alc269_fixups[] = { .chained = true, .chain_id = ALC255_FIXUP_ACER_MIC_NO_PRESENCE, }, + [ALC256_FIXUP_ACER_HEADSET_MIC] = { + .type = HDA_FIXUP_PINS, + .v.pins = (const struct hda_pintbl []) { + {0x19 ,0x02a1113c },/* use as headset mic, without its own jack detect */ + {0x1a ,0x90a1092f },/* use as internal mic */ + { } + }, + .chained = true, + .chain_id =ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC + }, };static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -7890,9 +7901,11 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x1025 ,0x1246 ,"Acer Predator Helios 500" ,ALC299_FIXUP_PREDATOR_SPK ),SND_PCI_QUIRK (0x1025 ,0x1247 ,"Acer vCopperbox" ,ALC269VC_FIXUP_ACER_VCOPPERBOX_PINS ),SND_PCI_QUIRK (0x1025 ,0x1248 ,"Acer Veriton N4660G" ,ALC269VC_FIXUP_ACER_MIC_NO_PRESENCE ), +SND_PCI_QUIRK (0x1025 ,0x1269 ,"Acer SWIFT SF314-54" ,ALC256_FIXUP_ACER_HEADSET_MIC ),SND_PCI_QUIRK (0x1025 ,0x128f ,"Acer Veriton Z6860G" ,ALC286_FIXUP_ACER_AIO_HEADSET_MIC ),SND_PCI_QUIRK (0x1025 ,0x1290 ,"Acer Veriton Z4860G" ,ALC286_FIXUP_ACER_AIO_HEADSET_MIC ),SND_PCI_QUIRK (0x1025 ,0x1291 ,"Acer Veriton Z4660G" ,ALC286_FIXUP_ACER_AIO_HEADSET_MIC ), +SND_PCI_QUIRK (0x1025 ,0x129c ,"Acer SWIFT SF314-55" ,ALC256_FIXUP_ACER_HEADSET_MIC ),SND_PCI_QUIRK (0x1025 ,0x1308 ,"Acer Aspire Z24-890" ,ALC286_FIXUP_ACER_AIO_HEADSET_MIC ),SND_PCI_QUIRK (0x1025 ,0x132a ,"Acer TravelMate B114-21" ,ALC233_FIXUP_ACER_HEADSET_MIC ), SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC),
sound/usb/clock.c +4 -4
@@ -646,10 +646,10 @@ static int set_sample_rate_v2v3(struct snd_usb_audio *chip, cur_rate = prev_rate;if (cur_rate != rate) { -usb_audio_warn (chip, -"%d:%d: freq mismatch (RO clock): req %d, clock runs @%d\n" , - fmt->iface, fmt->altsetting, rate, cur_rate); -return -ENXIO ; +usb_audio_dbg (chip, +"%d:%d: freq mismatch: req %d, clock runs @%d\n" , + fmt->iface, fmt->altsetting, rate, cur_rate); +/* continue processing */ } validation:
sound/usb/mixer.c +11 -0
@@ -1301,6 +1301,17 @@ static int get_min_max_with_quirks(struct usb_mixer_elem_info *cval,/* totally crap, return an error */ return -EINVAL ; } + }else { +/* if the max volume is too low, it's likely a bogus range; +* here we use -96dB as the threshold +*/ +if (cval->dBmax <=-9600 ) { +usb_audio_info (cval->head.mixer->chip, +"%d:%d: bogus dB values (%d/%d), disabling dB reporting\n" , + cval->head.id,mixer_ctrl_intf (cval->head.mixer), + cval->dBmin, cval->dBmax); + cval->dBmin = cval->dBmax =0 ; + } }return 0 ;
sound/usb/mixer_maps.c +10 -0
@@ -536,6 +536,16 @@ static const struct usbmix_ctl_map usbmix_ctl_maps[] = { .id = USB_ID(0x05a7, 0x1020), .map = bose_companion5_map, }, + { + /* Corsair Virtuoso SE (wired mode) */ + .id = USB_ID(0x1b1c, 0x0a3d), + .map = corsair_virtuoso_map, + }, + { + /* Corsair Virtuoso SE (wireless mode) */ + .id = USB_ID(0x1b1c, 0x0a3e), + .map = corsair_virtuoso_map, + }, { /* Corsair Virtuoso (wired mode) */ .id = USB_ID(0x1b1c, 0x0a41),
sound/usb/pcm.c +9 -3
@@ -845,13 +845,19 @@ get_sync_ep_from_substream(struct snd_usb_substream *subs)list_for_each_entry (fp, &subs->fmt_list, list) { ep =snd_usb_get_endpoint (chip, fp->endpoint); -if (ep && ep->cur_rate) -return ep; +if (ep && ep->cur_audiofmt) { +/* if EP is already opened solely for this substream, +* we still allow us to change the parameter; otherwise +* this substream has to follow the existing parameter +*/ +if (ep->cur_audiofmt != subs->cur_audiofmt || ep->opened >1 ) +return ep; + }if (!fp->implicit_fb)continue ;/* for the implicit fb, check the sync ep as well */ ep =snd_usb_get_endpoint (chip, fp->sync_ep); -if (ep && ep->cur_rate) +if (ep && ep->cur_audiofmt)return ep; }return NULL ;
sound/usb/quirks.c +1 -1
@@ -1482,7 +1482,7 @@ static int pioneer_djm_set_format_quirk(struct snd_usb_substream *subs,usb_set_interface (subs->dev,0 ,1 );// we should derive windex from fmt-sync_ep but it's not set snd_usb_ctl_msg (subs->stream->chip->dev, -usb_rcvctrlpipe (subs->stream->chip->dev,0 ), +usb_sndctrlpipe (subs->stream->chip->dev,0 ),0x01 ,0x22 ,0x0100 , windex, &sr,0x0003 );return 0 ; }