Merge 5.4.178 into android11-5.4-lts
Changes in 5.4.178 audit: improve audit queue handling when "audit=1" on cmdline ASoC: ops: Reject out of bounds values in snd_soc_put_volsw() ASoC: ops: Reject out of bounds values in snd_soc_put_volsw_sx() ASoC: ops: Reject out of bounds values in snd_soc_put_xr_sx() ALSA: usb-audio: Simplify quirk entries with a macro ALSA: hda/realtek: Add quirk for ASUS GU603 ALSA: hda/realtek: Add missing fixup-model entry for Gigabyte X570 ALC1220 quirks ALSA: hda/realtek: Fix silent output on Gigabyte X570S Aorus Master (newer chipset) ALSA: hda/realtek: Fix silent output on Gigabyte X570 Aorus Xtreme after reboot from Windows btrfs: fix deadlock between quota disable and qgroup rescan worker drm/nouveau: fix off by one in BIOS boundary checking mm/kmemleak: avoid scanning potential huge holes block: bio-integrity: Advance seed correctly for larger interval sizes Revert "ASoC: mediatek: Check for error clk pointer" memcg: charge fs_context and legacy_fs_context IB/rdmavt: Validate remote_addr during loopback atomic tests RDMA/siw: Fix broken RDMA Read Fence/Resume logic. RDMA/mlx4: Don't continue event handler after memory allocation failure iommu/vt-d: Fix potential memory leak in intel_setup_irq_remapping() iommu/amd: Fix loop timeout issue in iommu_ga_log_enable() spi: bcm-qspi: check for valid cs before applying chip select spi: mediatek: Avoid NULL pointer crash in interrupt spi: meson-spicc: add IRQ check in meson_spicc_probe net: ieee802154: hwsim: Ensure proper channel selection at probe time net: ieee802154: mcr20a: Fix lifs/sifs periods net: ieee802154: ca8210: Stop leaking skb's net: ieee802154: Return meaningful error codes from the netlink helpers net: macsec: Verify that send_sci is on when setting Tx sci explicitly net: stmmac: dump gmac4 DMA registers correctly net: stmmac: ensure PTP time register reads are consistent drm/i915/overlay: Prevent divide by zero bugs in scaling ASoC: fsl: Add missing error handling in pcm030_fabric_probe ASoC: xilinx: xlnx_formatter_pcm: Make buffer bytes multiple of period bytes ASoC: cpcap: Check for NULL pointer after calling of_get_child_by_name ASoC: max9759: fix underflow in speaker_gain_control_put() pinctrl: bcm2835: Fix a few error paths scsi: bnx2fc: Make bnx2fc_recv_frame() mp safe nfsd: nfsd4_setclientid_confirm mistakenly expires confirmed client. selftests: futex: Use variable MAKE instead of make rtc: cmos: Evaluate century appropriate EDAC/altera: Fix deferred probing EDAC/xgene: Fix deferred probing ext4: fix error handling in ext4_restore_inline_data() cgroup/cpuset: Fix "suspicious RCU usage" lockdep warning Linux 5.4.178 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Ic5bc9b2941b9932cfd3c98c8af8593196bb15245
This commit is contained in:
2
Makefile
2
Makefile
@@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 4
|
||||
SUBLEVEL = 177
|
||||
SUBLEVEL = 178
|
||||
EXTRAVERSION =
|
||||
NAME = Kleptomaniac Octopus
|
||||
|
||||
|
||||
@@ -380,7 +380,7 @@ void bio_integrity_advance(struct bio *bio, unsigned int bytes_done)
|
||||
struct blk_integrity *bi = blk_get_integrity(bio->bi_disk);
|
||||
unsigned bytes = bio_integrity_bytes(bi, bytes_done >> 9);
|
||||
|
||||
bip->bip_iter.bi_sector += bytes_done >> 9;
|
||||
bip->bip_iter.bi_sector += bio_integrity_intervals(bi, bytes_done >> 9);
|
||||
bvec_iter_advance(bip->bip_vec, &bip->bip_iter, bytes);
|
||||
}
|
||||
|
||||
|
||||
@@ -349,7 +349,7 @@ static int altr_sdram_probe(struct platform_device *pdev)
|
||||
if (irq < 0) {
|
||||
edac_printk(KERN_ERR, EDAC_MC,
|
||||
"No irq %d in DT\n", irq);
|
||||
return -ENODEV;
|
||||
return irq;
|
||||
}
|
||||
|
||||
/* Arria10 has a 2nd IRQ */
|
||||
|
||||
@@ -1922,7 +1922,7 @@ static int xgene_edac_probe(struct platform_device *pdev)
|
||||
irq = platform_get_irq(pdev, i);
|
||||
if (irq < 0) {
|
||||
dev_err(&pdev->dev, "No IRQ resource\n");
|
||||
rc = -EINVAL;
|
||||
rc = irq;
|
||||
goto out_err;
|
||||
}
|
||||
rc = devm_request_irq(&pdev->dev, irq,
|
||||
|
||||
@@ -913,6 +913,9 @@ static int check_overlay_dst(struct intel_overlay *overlay,
|
||||
const struct intel_crtc_state *pipe_config =
|
||||
overlay->crtc->config;
|
||||
|
||||
if (rec->dst_height == 0 || rec->dst_width == 0)
|
||||
return -EINVAL;
|
||||
|
||||
if (rec->dst_x < pipe_config->pipe_src_w &&
|
||||
rec->dst_x + rec->dst_width <= pipe_config->pipe_src_w &&
|
||||
rec->dst_y < pipe_config->pipe_src_h &&
|
||||
|
||||
@@ -38,7 +38,7 @@ nvbios_addr(struct nvkm_bios *bios, u32 *addr, u8 size)
|
||||
*addr += bios->imaged_addr;
|
||||
}
|
||||
|
||||
if (unlikely(*addr + size >= bios->size)) {
|
||||
if (unlikely(*addr + size > bios->size)) {
|
||||
nvkm_error(&bios->subdev, "OOB %d %08x %08x\n", size, p, *addr);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -3291,7 +3291,7 @@ static void mlx4_ib_event(struct mlx4_dev *dev, void *ibdev_ptr,
|
||||
case MLX4_DEV_EVENT_PORT_MGMT_CHANGE:
|
||||
ew = kmalloc(sizeof *ew, GFP_ATOMIC);
|
||||
if (!ew)
|
||||
break;
|
||||
return;
|
||||
|
||||
INIT_WORK(&ew->work, handle_port_mgmt_change_event);
|
||||
memcpy(&ew->ib_eqe, eqe, sizeof *eqe);
|
||||
|
||||
@@ -3110,6 +3110,8 @@ do_write:
|
||||
case IB_WR_ATOMIC_FETCH_AND_ADD:
|
||||
if (unlikely(!(qp->qp_access_flags & IB_ACCESS_REMOTE_ATOMIC)))
|
||||
goto inv_err;
|
||||
if (unlikely(wqe->atomic_wr.remote_addr & (sizeof(u64) - 1)))
|
||||
goto inv_err;
|
||||
if (unlikely(!rvt_rkey_ok(qp, &qp->r_sge.sge, sizeof(u64),
|
||||
wqe->atomic_wr.remote_addr,
|
||||
wqe->atomic_wr.rkey,
|
||||
|
||||
@@ -658,14 +658,9 @@ static inline struct siw_sqe *orq_get_current(struct siw_qp *qp)
|
||||
return &qp->orq[qp->orq_get % qp->attrs.orq_size];
|
||||
}
|
||||
|
||||
static inline struct siw_sqe *orq_get_tail(struct siw_qp *qp)
|
||||
{
|
||||
return &qp->orq[qp->orq_put % qp->attrs.orq_size];
|
||||
}
|
||||
|
||||
static inline struct siw_sqe *orq_get_free(struct siw_qp *qp)
|
||||
{
|
||||
struct siw_sqe *orq_e = orq_get_tail(qp);
|
||||
struct siw_sqe *orq_e = &qp->orq[qp->orq_put % qp->attrs.orq_size];
|
||||
|
||||
if (READ_ONCE(orq_e->flags) == 0)
|
||||
return orq_e;
|
||||
|
||||
@@ -1153,11 +1153,12 @@ static int siw_check_tx_fence(struct siw_qp *qp)
|
||||
|
||||
spin_lock_irqsave(&qp->orq_lock, flags);
|
||||
|
||||
rreq = orq_get_current(qp);
|
||||
|
||||
/* free current orq entry */
|
||||
rreq = orq_get_current(qp);
|
||||
WRITE_ONCE(rreq->flags, 0);
|
||||
|
||||
qp->orq_get++;
|
||||
|
||||
if (qp->tx_ctx.orq_fence) {
|
||||
if (unlikely(tx_waiting->wr_status != SIW_WR_QUEUED)) {
|
||||
pr_warn("siw: [QP %u]: fence resume: bad status %d\n",
|
||||
@@ -1165,10 +1166,12 @@ static int siw_check_tx_fence(struct siw_qp *qp)
|
||||
rv = -EPROTO;
|
||||
goto out;
|
||||
}
|
||||
/* resume SQ processing */
|
||||
/* resume SQ processing, if possible */
|
||||
if (tx_waiting->sqe.opcode == SIW_OP_READ ||
|
||||
tx_waiting->sqe.opcode == SIW_OP_READ_LOCAL_INV) {
|
||||
rreq = orq_get_tail(qp);
|
||||
|
||||
/* SQ processing was stopped because of a full ORQ */
|
||||
rreq = orq_get_free(qp);
|
||||
if (unlikely(!rreq)) {
|
||||
pr_warn("siw: [QP %u]: no ORQE\n", qp_id(qp));
|
||||
rv = -EPROTO;
|
||||
@@ -1181,15 +1184,14 @@ static int siw_check_tx_fence(struct siw_qp *qp)
|
||||
resume_tx = 1;
|
||||
|
||||
} else if (siw_orq_empty(qp)) {
|
||||
/*
|
||||
* SQ processing was stopped by fenced work request.
|
||||
* Resume since all previous Read's are now completed.
|
||||
*/
|
||||
qp->tx_ctx.orq_fence = 0;
|
||||
resume_tx = 1;
|
||||
} else {
|
||||
pr_warn("siw: [QP %u]: fence resume: orq idx: %d:%d\n",
|
||||
qp_id(qp), qp->orq_get, qp->orq_put);
|
||||
rv = -EPROTO;
|
||||
}
|
||||
}
|
||||
qp->orq_get++;
|
||||
out:
|
||||
spin_unlock_irqrestore(&qp->orq_lock, flags);
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <linux/iommu.h>
|
||||
#include <linux/kmemleak.h>
|
||||
#include <linux/mem_encrypt.h>
|
||||
#include <linux/iopoll.h>
|
||||
#include <asm/pci-direct.h>
|
||||
#include <asm/iommu.h>
|
||||
#include <asm/apic.h>
|
||||
@@ -759,6 +760,7 @@ static int iommu_ga_log_enable(struct amd_iommu *iommu)
|
||||
status = readl(iommu->mmio_base + MMIO_STATUS_OFFSET);
|
||||
if (status & (MMIO_STATUS_GALOG_RUN_MASK))
|
||||
break;
|
||||
udelay(10);
|
||||
}
|
||||
|
||||
if (i >= LOOP_TIMEOUT)
|
||||
|
||||
@@ -570,9 +570,8 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu)
|
||||
fn, &intel_ir_domain_ops,
|
||||
iommu);
|
||||
if (!iommu->ir_domain) {
|
||||
irq_domain_free_fwnode(fn);
|
||||
pr_err("IR%d: failed to allocate irqdomain\n", iommu->seq_id);
|
||||
goto out_free_bitmap;
|
||||
goto out_free_fwnode;
|
||||
}
|
||||
iommu->ir_msi_domain =
|
||||
arch_create_remap_msi_irq_domain(iommu->ir_domain,
|
||||
@@ -596,7 +595,7 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu)
|
||||
|
||||
if (dmar_enable_qi(iommu)) {
|
||||
pr_err("Failed to enable queued invalidation\n");
|
||||
goto out_free_bitmap;
|
||||
goto out_free_ir_domain;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -620,6 +619,14 @@ static int intel_setup_irq_remapping(struct intel_iommu *iommu)
|
||||
|
||||
return 0;
|
||||
|
||||
out_free_ir_domain:
|
||||
if (iommu->ir_msi_domain)
|
||||
irq_domain_remove(iommu->ir_msi_domain);
|
||||
iommu->ir_msi_domain = NULL;
|
||||
irq_domain_remove(iommu->ir_domain);
|
||||
iommu->ir_domain = NULL;
|
||||
out_free_fwnode:
|
||||
irq_domain_free_fwnode(fn);
|
||||
out_free_bitmap:
|
||||
bitmap_free(bitmap);
|
||||
out_free_pages:
|
||||
|
||||
@@ -128,6 +128,7 @@
|
||||
|
||||
#define NUM_DWMAC100_DMA_REGS 9
|
||||
#define NUM_DWMAC1000_DMA_REGS 23
|
||||
#define NUM_DWMAC4_DMA_REGS 27
|
||||
|
||||
void dwmac_enable_dma_transmission(void __iomem *ioaddr);
|
||||
void dwmac_enable_dma_irq(void __iomem *ioaddr, u32 chan);
|
||||
|
||||
@@ -21,10 +21,18 @@
|
||||
#include "dwxgmac2.h"
|
||||
|
||||
#define REG_SPACE_SIZE 0x1060
|
||||
#define GMAC4_REG_SPACE_SIZE 0x116C
|
||||
#define MAC100_ETHTOOL_NAME "st_mac100"
|
||||
#define GMAC_ETHTOOL_NAME "st_gmac"
|
||||
#define XGMAC_ETHTOOL_NAME "st_xgmac"
|
||||
|
||||
/* Same as DMA_CHAN_BASE_ADDR defined in dwmac4_dma.h
|
||||
*
|
||||
* It is here because dwmac_dma.h and dwmac4_dam.h can not be included at the
|
||||
* same time due to the conflicting macro names.
|
||||
*/
|
||||
#define GMAC4_DMA_CHAN_BASE_ADDR 0x00001100
|
||||
|
||||
#define ETHTOOL_DMA_OFFSET 55
|
||||
|
||||
struct stmmac_stats {
|
||||
@@ -413,6 +421,8 @@ static int stmmac_ethtool_get_regs_len(struct net_device *dev)
|
||||
|
||||
if (priv->plat->has_xgmac)
|
||||
return XGMAC_REGSIZE * 4;
|
||||
else if (priv->plat->has_gmac4)
|
||||
return GMAC4_REG_SPACE_SIZE;
|
||||
return REG_SPACE_SIZE;
|
||||
}
|
||||
|
||||
@@ -425,8 +435,13 @@ static void stmmac_ethtool_gregs(struct net_device *dev,
|
||||
stmmac_dump_mac_regs(priv, priv->hw, reg_space);
|
||||
stmmac_dump_dma_regs(priv, priv->ioaddr, reg_space);
|
||||
|
||||
if (!priv->plat->has_xgmac) {
|
||||
/* Copy DMA registers to where ethtool expects them */
|
||||
/* Copy DMA registers to where ethtool expects them */
|
||||
if (priv->plat->has_gmac4) {
|
||||
/* GMAC4 dumps its DMA registers at its DMA_CHAN_BASE_ADDR */
|
||||
memcpy(®_space[ETHTOOL_DMA_OFFSET],
|
||||
®_space[GMAC4_DMA_CHAN_BASE_ADDR / 4],
|
||||
NUM_DWMAC4_DMA_REGS * 4);
|
||||
} else if (!priv->plat->has_xgmac) {
|
||||
memcpy(®_space[ETHTOOL_DMA_OFFSET],
|
||||
®_space[DMA_BUS_MODE / 4],
|
||||
NUM_DWMAC1000_DMA_REGS * 4);
|
||||
|
||||
@@ -149,15 +149,20 @@ static int adjust_systime(void __iomem *ioaddr, u32 sec, u32 nsec,
|
||||
|
||||
static void get_systime(void __iomem *ioaddr, u64 *systime)
|
||||
{
|
||||
u64 ns;
|
||||
u64 ns, sec0, sec1;
|
||||
|
||||
/* Get the TSSS value */
|
||||
ns = readl(ioaddr + PTP_STNSR);
|
||||
/* Get the TSS and convert sec time value to nanosecond */
|
||||
ns += readl(ioaddr + PTP_STSR) * 1000000000ULL;
|
||||
/* Get the TSS value */
|
||||
sec1 = readl_relaxed(ioaddr + PTP_STSR);
|
||||
do {
|
||||
sec0 = sec1;
|
||||
/* Get the TSSS value */
|
||||
ns = readl_relaxed(ioaddr + PTP_STNSR);
|
||||
/* Get the TSS value */
|
||||
sec1 = readl_relaxed(ioaddr + PTP_STSR);
|
||||
} while (sec0 != sec1);
|
||||
|
||||
if (systime)
|
||||
*systime = ns;
|
||||
*systime = ns + (sec1 * 1000000000ULL);
|
||||
}
|
||||
|
||||
const struct stmmac_hwtimestamp stmmac_ptp = {
|
||||
|
||||
@@ -1770,6 +1770,7 @@ static int ca8210_async_xmit_complete(
|
||||
status
|
||||
);
|
||||
if (status != MAC_TRANSACTION_OVERFLOW) {
|
||||
dev_kfree_skb_any(priv->tx_skb);
|
||||
ieee802154_wake_queue(priv->hw);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -786,6 +786,7 @@ static int hwsim_add_one(struct genl_info *info, struct device *dev,
|
||||
goto err_pib;
|
||||
}
|
||||
|
||||
pib->channel = 13;
|
||||
rcu_assign_pointer(phy->pib, pib);
|
||||
phy->idx = idx;
|
||||
INIT_LIST_HEAD(&phy->edges);
|
||||
|
||||
@@ -976,8 +976,8 @@ static void mcr20a_hw_setup(struct mcr20a_local *lp)
|
||||
dev_dbg(printdev(lp), "%s\n", __func__);
|
||||
|
||||
phy->symbol_duration = 16;
|
||||
phy->lifs_period = 40;
|
||||
phy->sifs_period = 12;
|
||||
phy->lifs_period = 40 * phy->symbol_duration;
|
||||
phy->sifs_period = 12 * phy->symbol_duration;
|
||||
|
||||
hw->flags = IEEE802154_HW_TX_OMIT_CKSUM |
|
||||
IEEE802154_HW_AFILT |
|
||||
|
||||
@@ -3247,6 +3247,15 @@ static int macsec_newlink(struct net *net, struct net_device *dev,
|
||||
|
||||
macsec->real_dev = real_dev;
|
||||
|
||||
/* send_sci must be set to true when transmit sci explicitly is set */
|
||||
if ((data && data[IFLA_MACSEC_SCI]) &&
|
||||
(data && data[IFLA_MACSEC_INC_SCI])) {
|
||||
u8 send_sci = !!nla_get_u8(data[IFLA_MACSEC_INC_SCI]);
|
||||
|
||||
if (!send_sci)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (data && data[IFLA_MACSEC_ICV_LEN])
|
||||
icv_len = nla_get_u8(data[IFLA_MACSEC_ICV_LEN]);
|
||||
mtu = real_dev->mtu - icv_len - macsec_extra_len(true);
|
||||
|
||||
@@ -1261,16 +1261,18 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
|
||||
sizeof(*girq->parents),
|
||||
GFP_KERNEL);
|
||||
if (!girq->parents) {
|
||||
pinctrl_remove_gpio_range(pc->pctl_dev, &pc->gpio_range);
|
||||
return -ENOMEM;
|
||||
err = -ENOMEM;
|
||||
goto out_remove;
|
||||
}
|
||||
|
||||
if (is_7211) {
|
||||
pc->wake_irq = devm_kcalloc(dev, BCM2835_NUM_IRQS,
|
||||
sizeof(*pc->wake_irq),
|
||||
GFP_KERNEL);
|
||||
if (!pc->wake_irq)
|
||||
return -ENOMEM;
|
||||
if (!pc->wake_irq) {
|
||||
err = -ENOMEM;
|
||||
goto out_remove;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1294,8 +1296,10 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
|
||||
|
||||
len = strlen(dev_name(pc->dev)) + 16;
|
||||
name = devm_kzalloc(pc->dev, len, GFP_KERNEL);
|
||||
if (!name)
|
||||
return -ENOMEM;
|
||||
if (!name) {
|
||||
err = -ENOMEM;
|
||||
goto out_remove;
|
||||
}
|
||||
|
||||
snprintf(name, len, "%s:bank%d", dev_name(pc->dev), i);
|
||||
|
||||
@@ -1314,11 +1318,14 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
|
||||
err = gpiochip_add_data(&pc->gpio_chip, pc);
|
||||
if (err) {
|
||||
dev_err(dev, "could not add GPIO chip\n");
|
||||
pinctrl_remove_gpio_range(pc->pctl_dev, &pc->gpio_range);
|
||||
return err;
|
||||
goto out_remove;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
out_remove:
|
||||
pinctrl_remove_gpio_range(pc->pctl_dev, &pc->gpio_range);
|
||||
return err;
|
||||
}
|
||||
|
||||
static struct platform_driver bcm2835_pinctrl_driver = {
|
||||
|
||||
@@ -83,7 +83,7 @@ unsigned int mc146818_get_time(struct rtc_time *time)
|
||||
time->tm_year += real_year - 72;
|
||||
#endif
|
||||
|
||||
if (century > 20)
|
||||
if (century > 19)
|
||||
time->tm_year += (century - 19) * 100;
|
||||
|
||||
/*
|
||||
|
||||
@@ -506,7 +506,8 @@ static int bnx2fc_l2_rcv_thread(void *arg)
|
||||
|
||||
static void bnx2fc_recv_frame(struct sk_buff *skb)
|
||||
{
|
||||
u32 fr_len;
|
||||
u64 crc_err;
|
||||
u32 fr_len, fr_crc;
|
||||
struct fc_lport *lport;
|
||||
struct fcoe_rcv_info *fr;
|
||||
struct fc_stats *stats;
|
||||
@@ -540,6 +541,11 @@ static void bnx2fc_recv_frame(struct sk_buff *skb)
|
||||
skb_pull(skb, sizeof(struct fcoe_hdr));
|
||||
fr_len = skb->len - sizeof(struct fcoe_crc_eof);
|
||||
|
||||
stats = per_cpu_ptr(lport->stats, get_cpu());
|
||||
stats->RxFrames++;
|
||||
stats->RxWords += fr_len / FCOE_WORD_TO_BYTE;
|
||||
put_cpu();
|
||||
|
||||
fp = (struct fc_frame *)skb;
|
||||
fc_frame_init(fp);
|
||||
fr_dev(fp) = lport;
|
||||
@@ -622,16 +628,15 @@ static void bnx2fc_recv_frame(struct sk_buff *skb)
|
||||
return;
|
||||
}
|
||||
|
||||
stats = per_cpu_ptr(lport->stats, smp_processor_id());
|
||||
stats->RxFrames++;
|
||||
stats->RxWords += fr_len / FCOE_WORD_TO_BYTE;
|
||||
fr_crc = le32_to_cpu(fr_crc(fp));
|
||||
|
||||
if (le32_to_cpu(fr_crc(fp)) !=
|
||||
~crc32(~0, skb->data, fr_len)) {
|
||||
if (stats->InvalidCRCCount < 5)
|
||||
if (unlikely(fr_crc != ~crc32(~0, skb->data, fr_len))) {
|
||||
stats = per_cpu_ptr(lport->stats, get_cpu());
|
||||
crc_err = (stats->InvalidCRCCount++);
|
||||
put_cpu();
|
||||
if (crc_err < 5)
|
||||
printk(KERN_WARNING PFX "dropping frame with "
|
||||
"CRC error\n");
|
||||
stats->InvalidCRCCount++;
|
||||
kfree_skb(skb);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -333,17 +333,12 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int init_clks(struct platform_device *pdev, struct clk **clk)
|
||||
static void init_clks(struct platform_device *pdev, struct clk **clk)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = CLK_NONE + 1; i < CLK_MAX; i++) {
|
||||
for (i = CLK_NONE + 1; i < CLK_MAX; i++)
|
||||
clk[i] = devm_clk_get(&pdev->dev, clk_names[i]);
|
||||
if (IS_ERR(clk[i]))
|
||||
return PTR_ERR(clk[i]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct scp *init_scp(struct platform_device *pdev,
|
||||
@@ -353,7 +348,7 @@ static struct scp *init_scp(struct platform_device *pdev,
|
||||
{
|
||||
struct genpd_onecell_data *pd_data;
|
||||
struct resource *res;
|
||||
int i, j, ret;
|
||||
int i, j;
|
||||
struct scp *scp;
|
||||
struct clk *clk[CLK_MAX];
|
||||
|
||||
@@ -408,9 +403,7 @@ static struct scp *init_scp(struct platform_device *pdev,
|
||||
|
||||
pd_data->num_domains = num;
|
||||
|
||||
ret = init_clks(pdev, clk);
|
||||
if (ret)
|
||||
return ERR_PTR(ret);
|
||||
init_clks(pdev, clk);
|
||||
|
||||
for (i = 0; i < num; i++) {
|
||||
struct scp_domain *scpd = &scp->domains[i];
|
||||
|
||||
@@ -509,7 +509,7 @@ static void bcm_qspi_chip_select(struct bcm_qspi *qspi, int cs)
|
||||
u32 rd = 0;
|
||||
u32 wr = 0;
|
||||
|
||||
if (qspi->base[CHIP_SELECT]) {
|
||||
if (cs >= 0 && qspi->base[CHIP_SELECT]) {
|
||||
rd = bcm_qspi_read(qspi, CHIP_SELECT, 0);
|
||||
wr = (rd & ~0xff) | (1 << cs);
|
||||
if (rd == wr)
|
||||
|
||||
@@ -527,6 +527,11 @@ static int meson_spicc_probe(struct platform_device *pdev)
|
||||
writel_relaxed(0, spicc->base + SPICC_INTREG);
|
||||
|
||||
irq = platform_get_irq(pdev, 0);
|
||||
if (irq < 0) {
|
||||
ret = irq;
|
||||
goto out_master;
|
||||
}
|
||||
|
||||
ret = devm_request_irq(&pdev->dev, irq, meson_spicc_irq,
|
||||
0, NULL, spicc);
|
||||
if (ret) {
|
||||
|
||||
@@ -533,7 +533,7 @@ static irqreturn_t mtk_spi_interrupt(int irq, void *dev_id)
|
||||
else
|
||||
mdata->state = MTK_SPI_IDLE;
|
||||
|
||||
if (!master->can_dma(master, master->cur_msg->spi, trans)) {
|
||||
if (!master->can_dma(master, NULL, trans)) {
|
||||
if (trans->rx_buf) {
|
||||
cnt = mdata->xfer_len / 4;
|
||||
ioread32_rep(mdata->base + SPI_RX_DATA_REG,
|
||||
|
||||
@@ -1105,9 +1105,24 @@ int btrfs_quota_disable(struct btrfs_fs_info *fs_info)
|
||||
struct btrfs_trans_handle *trans = NULL;
|
||||
int ret = 0;
|
||||
|
||||
/*
|
||||
* We need to have subvol_sem write locked, to prevent races between
|
||||
* concurrent tasks trying to disable quotas, because we will unlock
|
||||
* and relock qgroup_ioctl_lock across BTRFS_FS_QUOTA_ENABLED changes.
|
||||
*/
|
||||
lockdep_assert_held_write(&fs_info->subvol_sem);
|
||||
|
||||
mutex_lock(&fs_info->qgroup_ioctl_lock);
|
||||
if (!fs_info->quota_root)
|
||||
goto out;
|
||||
|
||||
/*
|
||||
* Request qgroup rescan worker to complete and wait for it. This wait
|
||||
* must be done before transaction start for quota disable since it may
|
||||
* deadlock with transaction by the qgroup rescan worker.
|
||||
*/
|
||||
clear_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags);
|
||||
btrfs_qgroup_wait_for_completion(fs_info, false);
|
||||
mutex_unlock(&fs_info->qgroup_ioctl_lock);
|
||||
|
||||
/*
|
||||
@@ -1125,14 +1140,13 @@ int btrfs_quota_disable(struct btrfs_fs_info *fs_info)
|
||||
if (IS_ERR(trans)) {
|
||||
ret = PTR_ERR(trans);
|
||||
trans = NULL;
|
||||
set_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!fs_info->quota_root)
|
||||
goto out;
|
||||
|
||||
clear_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags);
|
||||
btrfs_qgroup_wait_for_completion(fs_info, false);
|
||||
spin_lock(&fs_info->qgroup_lock);
|
||||
quota_root = fs_info->quota_root;
|
||||
fs_info->quota_root = NULL;
|
||||
@@ -3304,6 +3318,9 @@ qgroup_rescan_init(struct btrfs_fs_info *fs_info, u64 progress_objectid,
|
||||
btrfs_warn(fs_info,
|
||||
"qgroup rescan init failed, qgroup is not enabled");
|
||||
ret = -EINVAL;
|
||||
} else if (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags)) {
|
||||
/* Quota disable is in progress */
|
||||
ret = -EBUSY;
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
|
||||
@@ -1134,7 +1134,15 @@ static void ext4_restore_inline_data(handle_t *handle, struct inode *inode,
|
||||
struct ext4_iloc *iloc,
|
||||
void *buf, int inline_size)
|
||||
{
|
||||
ext4_create_inline_data(handle, inode, inline_size);
|
||||
int ret;
|
||||
|
||||
ret = ext4_create_inline_data(handle, inode, inline_size);
|
||||
if (ret) {
|
||||
ext4_msg(inode->i_sb, KERN_EMERG,
|
||||
"error restoring inline_data for inode -- potential data loss! (inode %lu, error %d)",
|
||||
inode->i_ino, ret);
|
||||
return;
|
||||
}
|
||||
ext4_write_inline_data(inode, iloc, buf, 0, inline_size);
|
||||
ext4_set_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA);
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ static struct fs_context *alloc_fs_context(struct file_system_type *fs_type,
|
||||
struct fs_context *fc;
|
||||
int ret = -ENOMEM;
|
||||
|
||||
fc = kzalloc(sizeof(struct fs_context), GFP_KERNEL);
|
||||
fc = kzalloc(sizeof(struct fs_context), GFP_KERNEL_ACCOUNT);
|
||||
if (!fc)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
@@ -686,7 +686,7 @@ const struct fs_context_operations legacy_fs_context_ops = {
|
||||
*/
|
||||
static int legacy_init_fs_context(struct fs_context *fc)
|
||||
{
|
||||
fc->fs_private = kzalloc(sizeof(struct legacy_fs_context), GFP_KERNEL);
|
||||
fc->fs_private = kzalloc(sizeof(struct legacy_fs_context), GFP_KERNEL_ACCOUNT);
|
||||
if (!fc->fs_private)
|
||||
return -ENOMEM;
|
||||
fc->ops = &legacy_fs_context_ops;
|
||||
|
||||
@@ -3941,8 +3941,10 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
|
||||
status = nfserr_clid_inuse;
|
||||
if (client_has_state(old)
|
||||
&& !same_creds(&unconf->cl_cred,
|
||||
&old->cl_cred))
|
||||
&old->cl_cred)) {
|
||||
old = NULL;
|
||||
goto out;
|
||||
}
|
||||
status = mark_client_expired_locked(old);
|
||||
if (status) {
|
||||
old = NULL;
|
||||
|
||||
@@ -535,20 +535,22 @@ static void kauditd_printk_skb(struct sk_buff *skb)
|
||||
/**
|
||||
* kauditd_rehold_skb - Handle a audit record send failure in the hold queue
|
||||
* @skb: audit record
|
||||
* @error: error code (unused)
|
||||
*
|
||||
* Description:
|
||||
* This should only be used by the kauditd_thread when it fails to flush the
|
||||
* hold queue.
|
||||
*/
|
||||
static void kauditd_rehold_skb(struct sk_buff *skb)
|
||||
static void kauditd_rehold_skb(struct sk_buff *skb, __always_unused int error)
|
||||
{
|
||||
/* put the record back in the queue at the same place */
|
||||
skb_queue_head(&audit_hold_queue, skb);
|
||||
/* put the record back in the queue */
|
||||
skb_queue_tail(&audit_hold_queue, skb);
|
||||
}
|
||||
|
||||
/**
|
||||
* kauditd_hold_skb - Queue an audit record, waiting for auditd
|
||||
* @skb: audit record
|
||||
* @error: error code
|
||||
*
|
||||
* Description:
|
||||
* Queue the audit record, waiting for an instance of auditd. When this
|
||||
@@ -558,19 +560,31 @@ static void kauditd_rehold_skb(struct sk_buff *skb)
|
||||
* and queue it, if we have room. If we want to hold on to the record, but we
|
||||
* don't have room, record a record lost message.
|
||||
*/
|
||||
static void kauditd_hold_skb(struct sk_buff *skb)
|
||||
static void kauditd_hold_skb(struct sk_buff *skb, int error)
|
||||
{
|
||||
/* at this point it is uncertain if we will ever send this to auditd so
|
||||
* try to send the message via printk before we go any further */
|
||||
kauditd_printk_skb(skb);
|
||||
|
||||
/* can we just silently drop the message? */
|
||||
if (!audit_default) {
|
||||
kfree_skb(skb);
|
||||
return;
|
||||
if (!audit_default)
|
||||
goto drop;
|
||||
|
||||
/* the hold queue is only for when the daemon goes away completely,
|
||||
* not -EAGAIN failures; if we are in a -EAGAIN state requeue the
|
||||
* record on the retry queue unless it's full, in which case drop it
|
||||
*/
|
||||
if (error == -EAGAIN) {
|
||||
if (!audit_backlog_limit ||
|
||||
skb_queue_len(&audit_retry_queue) < audit_backlog_limit) {
|
||||
skb_queue_tail(&audit_retry_queue, skb);
|
||||
return;
|
||||
}
|
||||
audit_log_lost("kauditd retry queue overflow");
|
||||
goto drop;
|
||||
}
|
||||
|
||||
/* if we have room, queue the message */
|
||||
/* if we have room in the hold queue, queue the message */
|
||||
if (!audit_backlog_limit ||
|
||||
skb_queue_len(&audit_hold_queue) < audit_backlog_limit) {
|
||||
skb_queue_tail(&audit_hold_queue, skb);
|
||||
@@ -579,24 +593,32 @@ static void kauditd_hold_skb(struct sk_buff *skb)
|
||||
|
||||
/* we have no other options - drop the message */
|
||||
audit_log_lost("kauditd hold queue overflow");
|
||||
drop:
|
||||
kfree_skb(skb);
|
||||
}
|
||||
|
||||
/**
|
||||
* kauditd_retry_skb - Queue an audit record, attempt to send again to auditd
|
||||
* @skb: audit record
|
||||
* @error: error code (unused)
|
||||
*
|
||||
* Description:
|
||||
* Not as serious as kauditd_hold_skb() as we still have a connected auditd,
|
||||
* but for some reason we are having problems sending it audit records so
|
||||
* queue the given record and attempt to resend.
|
||||
*/
|
||||
static void kauditd_retry_skb(struct sk_buff *skb)
|
||||
static void kauditd_retry_skb(struct sk_buff *skb, __always_unused int error)
|
||||
{
|
||||
/* NOTE: because records should only live in the retry queue for a
|
||||
* short period of time, before either being sent or moved to the hold
|
||||
* queue, we don't currently enforce a limit on this queue */
|
||||
skb_queue_tail(&audit_retry_queue, skb);
|
||||
if (!audit_backlog_limit ||
|
||||
skb_queue_len(&audit_retry_queue) < audit_backlog_limit) {
|
||||
skb_queue_tail(&audit_retry_queue, skb);
|
||||
return;
|
||||
}
|
||||
|
||||
/* we have to drop the record, send it via printk as a last effort */
|
||||
kauditd_printk_skb(skb);
|
||||
audit_log_lost("kauditd retry queue overflow");
|
||||
kfree_skb(skb);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -634,7 +656,7 @@ static void auditd_reset(const struct auditd_connection *ac)
|
||||
/* flush the retry queue to the hold queue, but don't touch the main
|
||||
* queue since we need to process that normally for multicast */
|
||||
while ((skb = skb_dequeue(&audit_retry_queue)))
|
||||
kauditd_hold_skb(skb);
|
||||
kauditd_hold_skb(skb, -ECONNREFUSED);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -708,16 +730,18 @@ static int kauditd_send_queue(struct sock *sk, u32 portid,
|
||||
struct sk_buff_head *queue,
|
||||
unsigned int retry_limit,
|
||||
void (*skb_hook)(struct sk_buff *skb),
|
||||
void (*err_hook)(struct sk_buff *skb))
|
||||
void (*err_hook)(struct sk_buff *skb, int error))
|
||||
{
|
||||
int rc = 0;
|
||||
struct sk_buff *skb;
|
||||
struct sk_buff *skb = NULL;
|
||||
struct sk_buff *skb_tail;
|
||||
unsigned int failed = 0;
|
||||
|
||||
/* NOTE: kauditd_thread takes care of all our locking, we just use
|
||||
* the netlink info passed to us (e.g. sk and portid) */
|
||||
|
||||
while ((skb = skb_dequeue(queue))) {
|
||||
skb_tail = skb_peek_tail(queue);
|
||||
while ((skb != skb_tail) && (skb = skb_dequeue(queue))) {
|
||||
/* call the skb_hook for each skb we touch */
|
||||
if (skb_hook)
|
||||
(*skb_hook)(skb);
|
||||
@@ -725,7 +749,7 @@ static int kauditd_send_queue(struct sock *sk, u32 portid,
|
||||
/* can we send to anyone via unicast? */
|
||||
if (!sk) {
|
||||
if (err_hook)
|
||||
(*err_hook)(skb);
|
||||
(*err_hook)(skb, -ECONNREFUSED);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -739,7 +763,7 @@ retry:
|
||||
rc == -ECONNREFUSED || rc == -EPERM) {
|
||||
sk = NULL;
|
||||
if (err_hook)
|
||||
(*err_hook)(skb);
|
||||
(*err_hook)(skb, rc);
|
||||
if (rc == -EAGAIN)
|
||||
rc = 0;
|
||||
/* continue to drain the queue */
|
||||
|
||||
@@ -1462,10 +1462,15 @@ static void update_sibling_cpumasks(struct cpuset *parent, struct cpuset *cs,
|
||||
struct cpuset *sibling;
|
||||
struct cgroup_subsys_state *pos_css;
|
||||
|
||||
percpu_rwsem_assert_held(&cpuset_rwsem);
|
||||
|
||||
/*
|
||||
* Check all its siblings and call update_cpumasks_hier()
|
||||
* if their use_parent_ecpus flag is set in order for them
|
||||
* to use the right effective_cpus value.
|
||||
*
|
||||
* The update_cpumasks_hier() function may sleep. So we have to
|
||||
* release the RCU read lock before calling it.
|
||||
*/
|
||||
rcu_read_lock();
|
||||
cpuset_for_each_child(sibling, pos_css, parent) {
|
||||
@@ -1473,8 +1478,13 @@ static void update_sibling_cpumasks(struct cpuset *parent, struct cpuset *cs,
|
||||
continue;
|
||||
if (!sibling->use_parent_ecpus)
|
||||
continue;
|
||||
if (!css_tryget_online(&sibling->css))
|
||||
continue;
|
||||
|
||||
rcu_read_unlock();
|
||||
update_cpumasks_hier(sibling, tmp);
|
||||
rcu_read_lock();
|
||||
css_put(&sibling->css);
|
||||
}
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
||||
@@ -1399,7 +1399,8 @@ static void kmemleak_scan(void)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct kmemleak_object *object;
|
||||
int i;
|
||||
struct zone *zone;
|
||||
int __maybe_unused i;
|
||||
int new_leaks = 0;
|
||||
|
||||
jiffies_last_scan = jiffies;
|
||||
@@ -1439,9 +1440,9 @@ static void kmemleak_scan(void)
|
||||
* Struct page scanning for each node.
|
||||
*/
|
||||
get_online_mems();
|
||||
for_each_online_node(i) {
|
||||
unsigned long start_pfn = node_start_pfn(i);
|
||||
unsigned long end_pfn = node_end_pfn(i);
|
||||
for_each_populated_zone(zone) {
|
||||
unsigned long start_pfn = zone->zone_start_pfn;
|
||||
unsigned long end_pfn = zone_end_pfn(zone);
|
||||
unsigned long pfn;
|
||||
|
||||
for (pfn = start_pfn; pfn < end_pfn; pfn++) {
|
||||
@@ -1450,8 +1451,8 @@ static void kmemleak_scan(void)
|
||||
if (!page)
|
||||
continue;
|
||||
|
||||
/* only scan pages belonging to this node */
|
||||
if (page_to_nid(page) != i)
|
||||
/* only scan pages belonging to this zone */
|
||||
if (page_zone(page) != zone)
|
||||
continue;
|
||||
/* only scan if page is in use */
|
||||
if (page_count(page) == 0)
|
||||
|
||||
@@ -1457,7 +1457,7 @@ static int nl802154_send_key(struct sk_buff *msg, u32 cmd, u32 portid,
|
||||
|
||||
hdr = nl802154hdr_put(msg, portid, seq, flags, cmd);
|
||||
if (!hdr)
|
||||
return -1;
|
||||
return -ENOBUFS;
|
||||
|
||||
if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex))
|
||||
goto nla_put_failure;
|
||||
@@ -1650,7 +1650,7 @@ static int nl802154_send_device(struct sk_buff *msg, u32 cmd, u32 portid,
|
||||
|
||||
hdr = nl802154hdr_put(msg, portid, seq, flags, cmd);
|
||||
if (!hdr)
|
||||
return -1;
|
||||
return -ENOBUFS;
|
||||
|
||||
if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex))
|
||||
goto nla_put_failure;
|
||||
@@ -1828,7 +1828,7 @@ static int nl802154_send_devkey(struct sk_buff *msg, u32 cmd, u32 portid,
|
||||
|
||||
hdr = nl802154hdr_put(msg, portid, seq, flags, cmd);
|
||||
if (!hdr)
|
||||
return -1;
|
||||
return -ENOBUFS;
|
||||
|
||||
if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex))
|
||||
goto nla_put_failure;
|
||||
@@ -2004,7 +2004,7 @@ static int nl802154_send_seclevel(struct sk_buff *msg, u32 cmd, u32 portid,
|
||||
|
||||
hdr = nl802154hdr_put(msg, portid, seq, flags, cmd);
|
||||
if (!hdr)
|
||||
return -1;
|
||||
return -ENOBUFS;
|
||||
|
||||
if (nla_put_u32(msg, NL802154_ATTR_IFINDEX, dev->ifindex))
|
||||
goto nla_put_failure;
|
||||
|
||||
@@ -2122,6 +2122,7 @@ static void alc1220_fixup_gb_x570(struct hda_codec *codec,
|
||||
{
|
||||
static const hda_nid_t conn1[] = { 0x0c };
|
||||
static const struct coef_fw gb_x570_coefs[] = {
|
||||
WRITE_COEF(0x07, 0x03c0),
|
||||
WRITE_COEF(0x1a, 0x01c1),
|
||||
WRITE_COEF(0x1b, 0x0202),
|
||||
WRITE_COEF(0x43, 0x3005),
|
||||
@@ -2548,7 +2549,8 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
|
||||
SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
|
||||
SND_PCI_QUIRK(0x1458, 0xa0b8, "Gigabyte AZ370-Gaming", ALC1220_FIXUP_GB_DUAL_CODECS),
|
||||
SND_PCI_QUIRK(0x1458, 0xa0cd, "Gigabyte X570 Aorus Master", ALC1220_FIXUP_GB_X570),
|
||||
SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_CLEVO_P950),
|
||||
SND_PCI_QUIRK(0x1458, 0xa0ce, "Gigabyte X570 Aorus Xtreme", ALC1220_FIXUP_GB_X570),
|
||||
SND_PCI_QUIRK(0x1458, 0xa0d5, "Gigabyte X570S Aorus Master", ALC1220_FIXUP_GB_X570),
|
||||
SND_PCI_QUIRK(0x1462, 0x11f7, "MSI-GE63", ALC1220_FIXUP_CLEVO_P950),
|
||||
SND_PCI_QUIRK(0x1462, 0x1228, "MSI-GP63", ALC1220_FIXUP_CLEVO_P950),
|
||||
SND_PCI_QUIRK(0x1462, 0x1229, "MSI-GP73", ALC1220_FIXUP_CLEVO_P950),
|
||||
@@ -2623,6 +2625,7 @@ static const struct hda_model_fixup alc882_fixup_models[] = {
|
||||
{.id = ALC882_FIXUP_NO_PRIMARY_HP, .name = "no-primary-hp"},
|
||||
{.id = ALC887_FIXUP_ASUS_BASS, .name = "asus-bass"},
|
||||
{.id = ALC1220_FIXUP_GB_DUAL_CODECS, .name = "dual-codecs"},
|
||||
{.id = ALC1220_FIXUP_GB_X570, .name = "gb-x570"},
|
||||
{.id = ALC1220_FIXUP_CLEVO_P950, .name = "clevo-p950"},
|
||||
{}
|
||||
};
|
||||
@@ -8180,6 +8183,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
|
||||
SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS),
|
||||
SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401),
|
||||
SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401),
|
||||
SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401),
|
||||
SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2),
|
||||
SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC),
|
||||
SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC),
|
||||
|
||||
@@ -1541,6 +1541,8 @@ static int cpcap_codec_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct device_node *codec_node =
|
||||
of_get_child_by_name(pdev->dev.parent->of_node, "audio-codec");
|
||||
if (!codec_node)
|
||||
return -ENODEV;
|
||||
|
||||
pdev->dev.of_node = codec_node;
|
||||
|
||||
|
||||
@@ -64,7 +64,8 @@ static int speaker_gain_control_put(struct snd_kcontrol *kcontrol,
|
||||
struct snd_soc_component *c = snd_soc_kcontrol_component(kcontrol);
|
||||
struct max9759 *priv = snd_soc_component_get_drvdata(c);
|
||||
|
||||
if (ucontrol->value.integer.value[0] > 3)
|
||||
if (ucontrol->value.integer.value[0] < 0 ||
|
||||
ucontrol->value.integer.value[0] > 3)
|
||||
return -EINVAL;
|
||||
|
||||
priv->gain = ucontrol->value.integer.value[0];
|
||||
|
||||
@@ -93,16 +93,21 @@ static int pcm030_fabric_probe(struct platform_device *op)
|
||||
dev_err(&op->dev, "platform_device_alloc() failed\n");
|
||||
|
||||
ret = platform_device_add(pdata->codec_device);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
dev_err(&op->dev, "platform_device_add() failed: %d\n", ret);
|
||||
platform_device_put(pdata->codec_device);
|
||||
}
|
||||
|
||||
ret = snd_soc_register_card(card);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
dev_err(&op->dev, "snd_soc_register_card() failed: %d\n", ret);
|
||||
platform_device_del(pdata->codec_device);
|
||||
platform_device_put(pdata->codec_device);
|
||||
}
|
||||
|
||||
platform_set_drvdata(op, pdata);
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
static int pcm030_fabric_remove(struct platform_device *op)
|
||||
|
||||
@@ -322,13 +322,27 @@ int snd_soc_put_volsw(struct snd_kcontrol *kcontrol,
|
||||
if (sign_bit)
|
||||
mask = BIT(sign_bit + 1) - 1;
|
||||
|
||||
val = ((ucontrol->value.integer.value[0] + min) & mask);
|
||||
val = ucontrol->value.integer.value[0];
|
||||
if (mc->platform_max && val > mc->platform_max)
|
||||
return -EINVAL;
|
||||
if (val > max - min)
|
||||
return -EINVAL;
|
||||
if (val < 0)
|
||||
return -EINVAL;
|
||||
val = (val + min) & mask;
|
||||
if (invert)
|
||||
val = max - val;
|
||||
val_mask = mask << shift;
|
||||
val = val << shift;
|
||||
if (snd_soc_volsw_is_stereo(mc)) {
|
||||
val2 = ((ucontrol->value.integer.value[1] + min) & mask);
|
||||
val2 = ucontrol->value.integer.value[1];
|
||||
if (mc->platform_max && val2 > mc->platform_max)
|
||||
return -EINVAL;
|
||||
if (val2 > max - min)
|
||||
return -EINVAL;
|
||||
if (val2 < 0)
|
||||
return -EINVAL;
|
||||
val2 = (val2 + min) & mask;
|
||||
if (invert)
|
||||
val2 = max - val2;
|
||||
if (reg == reg2) {
|
||||
@@ -422,8 +436,15 @@ int snd_soc_put_volsw_sx(struct snd_kcontrol *kcontrol,
|
||||
int err = 0;
|
||||
unsigned int val, val_mask, val2 = 0;
|
||||
|
||||
val = ucontrol->value.integer.value[0];
|
||||
if (mc->platform_max && val > mc->platform_max)
|
||||
return -EINVAL;
|
||||
if (val > max - min)
|
||||
return -EINVAL;
|
||||
if (val < 0)
|
||||
return -EINVAL;
|
||||
val_mask = mask << shift;
|
||||
val = (ucontrol->value.integer.value[0] + min) & mask;
|
||||
val = (val + min) & mask;
|
||||
val = val << shift;
|
||||
|
||||
err = snd_soc_component_update_bits(component, reg, val_mask, val);
|
||||
@@ -889,6 +910,8 @@ int snd_soc_put_xr_sx(struct snd_kcontrol *kcontrol,
|
||||
unsigned int i, regval, regmask;
|
||||
int err;
|
||||
|
||||
if (val < mc->min || val > mc->max)
|
||||
return -EINVAL;
|
||||
if (invert)
|
||||
val = max - val;
|
||||
val &= mask;
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#define XLNX_AUD_XFER_COUNT 0x28
|
||||
#define XLNX_AUD_CH_STS_START 0x2C
|
||||
#define XLNX_BYTES_PER_CH 0x44
|
||||
#define XLNX_AUD_ALIGN_BYTES 64
|
||||
|
||||
#define AUD_STS_IOC_IRQ_MASK BIT(31)
|
||||
#define AUD_STS_CH_STS_MASK BIT(29)
|
||||
@@ -370,12 +371,32 @@ static int xlnx_formatter_pcm_open(struct snd_pcm_substream *substream)
|
||||
snd_soc_set_runtime_hwparams(substream, &xlnx_pcm_hardware);
|
||||
runtime->private_data = stream_data;
|
||||
|
||||
/* Resize the period size divisible by 64 */
|
||||
/* Resize the period bytes as divisible by 64 */
|
||||
err = snd_pcm_hw_constraint_step(runtime, 0,
|
||||
SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64);
|
||||
SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
|
||||
XLNX_AUD_ALIGN_BYTES);
|
||||
if (err) {
|
||||
dev_err(component->dev,
|
||||
"unable to set constraint on period bytes\n");
|
||||
"Unable to set constraint on period bytes\n");
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Resize the buffer bytes as divisible by 64 */
|
||||
err = snd_pcm_hw_constraint_step(runtime, 0,
|
||||
SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
|
||||
XLNX_AUD_ALIGN_BYTES);
|
||||
if (err) {
|
||||
dev_err(component->dev,
|
||||
"Unable to set constraint on buffer bytes\n");
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Set periods as integer multiple */
|
||||
err = snd_pcm_hw_constraint_integer(runtime,
|
||||
SNDRV_PCM_HW_PARAM_PERIODS);
|
||||
if (err < 0) {
|
||||
dev_err(component->dev,
|
||||
"Unable to set constraint on periods to be integer\n");
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,16 @@
|
||||
.idProduct = prod, \
|
||||
.bInterfaceClass = USB_CLASS_VENDOR_SPEC
|
||||
|
||||
/* A standard entry matching with vid/pid and the audio class/subclass */
|
||||
#define USB_AUDIO_DEVICE(vend, prod) \
|
||||
.match_flags = USB_DEVICE_ID_MATCH_DEVICE | \
|
||||
USB_DEVICE_ID_MATCH_INT_CLASS | \
|
||||
USB_DEVICE_ID_MATCH_INT_SUBCLASS, \
|
||||
.idVendor = vend, \
|
||||
.idProduct = prod, \
|
||||
.bInterfaceClass = USB_CLASS_AUDIO, \
|
||||
.bInterfaceSubClass = USB_SUBCLASS_AUDIOCONTROL
|
||||
|
||||
/* HP Thunderbolt Dock Audio Headset */
|
||||
{
|
||||
USB_DEVICE(0x03f0, 0x0269),
|
||||
|
||||
@@ -11,7 +11,7 @@ all:
|
||||
@for DIR in $(SUBDIRS); do \
|
||||
BUILD_TARGET=$(OUTPUT)/$$DIR; \
|
||||
mkdir $$BUILD_TARGET -p; \
|
||||
make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
|
||||
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
|
||||
if [ -e $$DIR/$(TEST_PROGS) ]; then \
|
||||
rsync -a $$DIR/$(TEST_PROGS) $$BUILD_TARGET/; \
|
||||
fi \
|
||||
@@ -32,6 +32,6 @@ override define CLEAN
|
||||
@for DIR in $(SUBDIRS); do \
|
||||
BUILD_TARGET=$(OUTPUT)/$$DIR; \
|
||||
mkdir $$BUILD_TARGET -p; \
|
||||
make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
|
||||
$(MAKE) OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
|
||||
done
|
||||
endef
|
||||
|
||||
Reference in New Issue
Block a user