mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
This is the 4.14.331 stable release
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmVmGT0ACgkQONu9yGCS aT5ERQ//Tx5hvAL4WlnyNLMshNB5Ep8cuB1JryM1pi5BbtQxToDFZv3aJKkqj2K3 CRFq1x5hO9dli5MK5RTaO4JwCSwOphBDEqswOrtIdI7nHHzkMGBF7UUwezc6M5TZ 7cjs3LFnsVJJITBUAM/f33HyYXUPiMw/TEcWcFnJLJgWQafpOQ4kRH5k5UOL8Kgm LV+E9YhBikaRpPpsC6obxT7KnaSnOScdUjjD+DRBm+UNhx/F3HVSY2ZY/Mr1XTyJ v0QhzMAgWdBVGja8+9qU2e8pPw36NcEli539iU4HfrmCUry4J0Mh+XFYbpzvhQLC U72e0vIoievkxYM1krnI2+wIFh58qlFGwKEIYag+eg0DuJn4ttaTFG9+rkn2lcI9 +d6JqALAImPtd5ZdISj7mBI8mWoTl73Hl5RNnJQQBaBwdHZQc2IXXJQUSbfyDE8/ gor9eEls3E2FtucEtihbsCF/5M0IXs+tr4b67qo73HfS6lqGFGLAFQUlKvhPr0R/ baoEoIb6bsH9oTCLjNoH1vSRPM9VEj3+AFOzK4D3wlfEhDRYkNZDQ/MF3btv6HTp ifLXerLLxSK56OOqn3yyGOmUhtpR+sPLBrjhrALrcWOjESH9i7zvmHRLCow9qbmx bf6Qxz6L8/+JIkdDNCN/l7NuzNyCUj0U/ObR1WWXp/n8ZqUpGR0= =rkdh -----END PGP SIGNATURE----- Merge 4.14.331 into android-4.14-stable Changes in 4.14.331 locking/ww_mutex/test: Fix potential workqueue corruption clocksource/drivers/timer-imx-gpt: Fix potential memory leak clocksource/drivers/timer-atmel-tcb: Fix initialization on SAM9 hardware x86/mm: Drop the 4 MB restriction on minimal NUMA node memory size wifi: mac80211: don't return unset power in ieee80211_get_tx_power() wifi: ath9k: fix clang-specific fortify warnings wifi: ath10k: fix clang-specific fortify warning net: annotate data-races around sk->sk_dst_pending_confirm drm/amd: Fix UBSAN array-index-out-of-bounds for SMU7 drm/amd: Fix UBSAN array-index-out-of-bounds for Polaris and Tonga selftests/efivarfs: create-read: fix a resource leak crypto: pcrypt - Fix hungtask for PADATA_RESET RDMA/hfi1: Use FIELD_GET() to extract Link Width fs/jfs: Add check for negative db_l2nbperpage fs/jfs: Add validity check for db_maxag and db_agpref jfs: fix array-index-out-of-bounds in dbFindLeaf jfs: fix array-index-out-of-bounds in diAlloc ALSA: hda: Fix possible null-ptr-deref when assigning a stream atm: iphase: Do PCI error checks on own line scsi: libfc: Fix potential NULL pointer dereference in fc_lport_ptp_setup() tty: vcc: Add check for kstrdup() in vcc_probe() i2c: sun6i-p2wi: Prevent potential division by zero media: gspca: cpia1: shift-out-of-bounds in set_flicker media: vivid: avoid integer overflow gfs2: ignore negated quota changes pwm: Fix double shift bug media: venus: hfi: add checks to perform sanity on queue pointers randstruct: Fix gcc-plugin performance mode to stay in group KVM: x86: Ignore MSR_AMD64_TW_CFG access audit: don't take task_lock() in audit_exe_compare() code path audit: don't WARN_ON_ONCE(!current->mm) in audit_exe_compare() hvc/xen: fix error path in xen_hvc_init() to always register frontend driver PCI/sysfs: Protect driver's D3cold preference from user space mmc: vub300: fix an error code PM: hibernate: Use __get_safe_page() rather than touching the list PM: hibernate: Clean up sync_read handling in snapshot_write_next() mmc: meson-gx: Remove setting of CMD_CFG_ERROR genirq/generic_chip: Make irq_remove_generic_chip() irqdomain aware jbd2: fix potential data lost in recovering journal raced with synchronizing fs bdev mcb: fix error handling for different scenarios when parsing parisc: Prevent booting 64-bit kernels on PA1.x machines parisc/pgtable: Do not drop upper 5 address bits of physical address ALSA: info: Fix potential deadlock at disconnection net: dsa: lan9303: consequently nested-lock physical MDIO i2c: i801: fix potential race in i801_block_transaction_byte_by_byte media: sharp: fix sharp encoding media: venus: hfi: fix the check to handle session buffer requirement ext4: apply umask if ACL support is disabled ext4: correct offset of gdb backup in non meta_bg group to update_backups ext4: correct return value of ext4_convert_meta_bg ext4: remove gdb backup copy for meta bg in setup_new_flex_group_blocks scsi: virtio_scsi: limit number of hw queues by nr_cpu_ids net: sched: fix race condition in qdisc_graft() Linux 4.14.331 Change-Id: I1a1bce75363d3b2c731f3e947543c6506bed9817 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
commit
52d13de272
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 14
|
||||
SUBLEVEL = 330
|
||||
SUBLEVEL = 331
|
||||
EXTRAVERSION =
|
||||
NAME = Petit Gorille
|
||||
|
||||
|
@ -521,13 +521,13 @@
|
||||
* to a CPU TLB 4k PFN (4k => 12 bits to shift) */
|
||||
#define PAGE_ADD_SHIFT (PAGE_SHIFT-12)
|
||||
#define PAGE_ADD_HUGE_SHIFT (REAL_HPAGE_SHIFT-12)
|
||||
#define PFN_START_BIT (63-ASM_PFN_PTE_SHIFT+(63-58)-PAGE_ADD_SHIFT)
|
||||
|
||||
/* Drop prot bits and convert to page addr for iitlbt and idtlbt */
|
||||
.macro convert_for_tlb_insert20 pte,tmp
|
||||
#ifdef CONFIG_HUGETLB_PAGE
|
||||
copy \pte,\tmp
|
||||
extrd,u \tmp,(63-ASM_PFN_PTE_SHIFT)+(63-58)+PAGE_ADD_SHIFT,\
|
||||
64-PAGE_SHIFT-PAGE_ADD_SHIFT,\pte
|
||||
extrd,u \tmp,PFN_START_BIT,PFN_START_BIT+1,\pte
|
||||
|
||||
depdi _PAGE_SIZE_ENCODING_DEFAULT,63,\
|
||||
(63-58)+PAGE_ADD_SHIFT,\pte
|
||||
@ -535,8 +535,7 @@
|
||||
depdi _HUGE_PAGE_SIZE_ENCODING_DEFAULT,63,\
|
||||
(63-58)+PAGE_ADD_HUGE_SHIFT,\pte
|
||||
#else /* Huge pages disabled */
|
||||
extrd,u \pte,(63-ASM_PFN_PTE_SHIFT)+(63-58)+PAGE_ADD_SHIFT,\
|
||||
64-PAGE_SHIFT-PAGE_ADD_SHIFT,\pte
|
||||
extrd,u \pte,PFN_START_BIT,PFN_START_BIT+1,\pte
|
||||
depdi _PAGE_SIZE_ENCODING_DEFAULT,63,\
|
||||
(63-58)+PAGE_ADD_SHIFT,\pte
|
||||
#endif
|
||||
|
@ -69,9 +69,8 @@ $bss_loop:
|
||||
stw,ma %arg2,4(%r1)
|
||||
stw,ma %arg3,4(%r1)
|
||||
|
||||
#if !defined(CONFIG_64BIT) && defined(CONFIG_PA20)
|
||||
/* This 32-bit kernel was compiled for PA2.0 CPUs. Check current CPU
|
||||
* and halt kernel if we detect a PA1.x CPU. */
|
||||
#if defined(CONFIG_PA20)
|
||||
/* check for 64-bit capable CPU as required by current kernel */
|
||||
ldi 32,%r10
|
||||
mtctl %r10,%cr11
|
||||
.level 2.0
|
||||
@ -84,7 +83,7 @@ $bss_loop:
|
||||
$iodc_panic:
|
||||
copy %arg0, %r10
|
||||
copy %arg1, %r11
|
||||
load32 PA(init_stack),%sp
|
||||
load32 PA(__bss_stop),%sp
|
||||
#define MEM_CONS 0x3A0
|
||||
ldw MEM_CONS+32(%r0),%arg0 // HPA
|
||||
ldi ENTRY_IO_COUT,%arg1
|
||||
|
@ -414,6 +414,7 @@
|
||||
#define MSR_AMD64_OSVW_STATUS 0xc0010141
|
||||
#define MSR_AMD64_LS_CFG 0xc0011020
|
||||
#define MSR_AMD64_DC_CFG 0xc0011022
|
||||
#define MSR_AMD64_TW_CFG 0xc0011023
|
||||
|
||||
#define MSR_AMD64_DE_CFG 0xc0011029
|
||||
#define MSR_AMD64_DE_CFG_LFENCE_SERIALIZE_BIT 1
|
||||
|
@ -11,13 +11,6 @@
|
||||
|
||||
#define NR_NODE_MEMBLKS (MAX_NUMNODES*2)
|
||||
|
||||
/*
|
||||
* Too small node sizes may confuse the VM badly. Usually they
|
||||
* result from BIOS bugs. So dont recognize nodes as standalone
|
||||
* NUMA entities that have less than this amount of RAM listed:
|
||||
*/
|
||||
#define NODE_MIN_SIZE (4*1024*1024)
|
||||
|
||||
extern int numa_off;
|
||||
|
||||
/*
|
||||
|
@ -2304,6 +2304,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
|
||||
case MSR_AMD64_PATCH_LOADER:
|
||||
case MSR_AMD64_BU_CFG2:
|
||||
case MSR_AMD64_DC_CFG:
|
||||
case MSR_AMD64_TW_CFG:
|
||||
case MSR_F15H_EX_CFG:
|
||||
break;
|
||||
|
||||
@ -2598,6 +2599,7 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
|
||||
case MSR_AMD64_BU_CFG2:
|
||||
case MSR_IA32_PERF_CTL:
|
||||
case MSR_AMD64_DC_CFG:
|
||||
case MSR_AMD64_TW_CFG:
|
||||
case MSR_F15H_EX_CFG:
|
||||
msr_info->data = 0;
|
||||
break;
|
||||
|
@ -585,13 +585,6 @@ static int __init numa_register_memblks(struct numa_meminfo *mi)
|
||||
if (start >= end)
|
||||
continue;
|
||||
|
||||
/*
|
||||
* Don't confuse VM with a node that doesn't have the
|
||||
* minimum amount of memory:
|
||||
*/
|
||||
if (end && (end - start) < NODE_MIN_SIZE)
|
||||
continue;
|
||||
|
||||
alloc_node_data(nid);
|
||||
}
|
||||
|
||||
|
@ -174,6 +174,8 @@ static int pcrypt_aead_encrypt(struct aead_request *req)
|
||||
err = pcrypt_do_parallel(padata, &ctx->cb_cpu, &pencrypt);
|
||||
if (!err)
|
||||
return -EINPROGRESS;
|
||||
if (err == -EBUSY)
|
||||
return -EAGAIN;
|
||||
|
||||
return err;
|
||||
}
|
||||
@ -218,6 +220,8 @@ static int pcrypt_aead_decrypt(struct aead_request *req)
|
||||
err = pcrypt_do_parallel(padata, &ctx->cb_cpu, &pdecrypt);
|
||||
if (!err)
|
||||
return -EINPROGRESS;
|
||||
if (err == -EBUSY)
|
||||
return -EAGAIN;
|
||||
|
||||
return err;
|
||||
}
|
||||
|
@ -2290,19 +2290,21 @@ static int get_esi(struct atm_dev *dev)
|
||||
static int reset_sar(struct atm_dev *dev)
|
||||
{
|
||||
IADEV *iadev;
|
||||
int i, error = 1;
|
||||
int i, error;
|
||||
unsigned int pci[64];
|
||||
|
||||
iadev = INPH_IA_DEV(dev);
|
||||
for(i=0; i<64; i++)
|
||||
if ((error = pci_read_config_dword(iadev->pci,
|
||||
i*4, &pci[i])) != PCIBIOS_SUCCESSFUL)
|
||||
return error;
|
||||
for (i = 0; i < 64; i++) {
|
||||
error = pci_read_config_dword(iadev->pci, i * 4, &pci[i]);
|
||||
if (error != PCIBIOS_SUCCESSFUL)
|
||||
return error;
|
||||
}
|
||||
writel(0, iadev->reg+IPHASE5575_EXT_RESET);
|
||||
for(i=0; i<64; i++)
|
||||
if ((error = pci_write_config_dword(iadev->pci,
|
||||
i*4, pci[i])) != PCIBIOS_SUCCESSFUL)
|
||||
return error;
|
||||
for (i = 0; i < 64; i++) {
|
||||
error = pci_write_config_dword(iadev->pci, i * 4, pci[i]);
|
||||
if (error != PCIBIOS_SUCCESSFUL)
|
||||
return error;
|
||||
}
|
||||
udelay(5);
|
||||
return 0;
|
||||
}
|
||||
|
@ -294,6 +294,7 @@ static void __init tcb_setup_dual_chan(struct atmel_tc *tc, int mck_divisor_idx)
|
||||
writel(mck_divisor_idx /* likely divide-by-8 */
|
||||
| ATMEL_TC_WAVE
|
||||
| ATMEL_TC_WAVESEL_UP /* free-run */
|
||||
| ATMEL_TC_ASWTRG_SET /* TIOA0 rises at software trigger */
|
||||
| ATMEL_TC_ACPA_SET /* TIOA0 rises at 0 */
|
||||
| ATMEL_TC_ACPC_CLEAR, /* (duty cycle 50%) */
|
||||
tcaddr + ATMEL_TC_REG(0, CMR));
|
||||
|
@ -489,12 +489,16 @@ static int __init mxc_timer_init_dt(struct device_node *np, enum imx_gpt_type t
|
||||
return -ENOMEM;
|
||||
|
||||
imxtm->base = of_iomap(np, 0);
|
||||
if (!imxtm->base)
|
||||
return -ENXIO;
|
||||
if (!imxtm->base) {
|
||||
ret = -ENXIO;
|
||||
goto err_kfree;
|
||||
}
|
||||
|
||||
imxtm->irq = irq_of_parse_and_map(np, 0);
|
||||
if (imxtm->irq <= 0)
|
||||
return -EINVAL;
|
||||
if (imxtm->irq <= 0) {
|
||||
ret = -EINVAL;
|
||||
goto err_kfree;
|
||||
}
|
||||
|
||||
imxtm->clk_ipg = of_clk_get_by_name(np, "ipg");
|
||||
|
||||
@ -507,11 +511,15 @@ static int __init mxc_timer_init_dt(struct device_node *np, enum imx_gpt_type t
|
||||
|
||||
ret = _mxc_timer_init(imxtm);
|
||||
if (ret)
|
||||
return ret;
|
||||
goto err_kfree;
|
||||
|
||||
initialized = 1;
|
||||
|
||||
return 0;
|
||||
|
||||
err_kfree:
|
||||
kfree(imxtm);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int __init imx1_timer_init_dt(struct device_node *np)
|
||||
|
@ -78,7 +78,7 @@ typedef struct _ATOM_PPLIB_THERMALCONTROLLER
|
||||
typedef struct _ATOM_PPLIB_STATE
|
||||
{
|
||||
UCHAR ucNonClockStateIndex;
|
||||
UCHAR ucClockStateIndices[1]; // variable-sized
|
||||
UCHAR ucClockStateIndices[]; // variable-sized
|
||||
} ATOM_PPLIB_STATE;
|
||||
|
||||
|
||||
@ -473,7 +473,7 @@ typedef struct _ATOM_PPLIB_STATE_V2
|
||||
/**
|
||||
* Driver will read the first ucNumDPMLevels in this array
|
||||
*/
|
||||
UCHAR clockInfoIndex[1];
|
||||
UCHAR clockInfoIndex[];
|
||||
} ATOM_PPLIB_STATE_V2;
|
||||
|
||||
typedef struct _StateArray{
|
||||
|
@ -164,7 +164,7 @@ typedef struct _ATOM_Tonga_State {
|
||||
typedef struct _ATOM_Tonga_State_Array {
|
||||
UCHAR ucRevId;
|
||||
UCHAR ucNumEntries; /* Number of entries. */
|
||||
ATOM_Tonga_State entries[1]; /* Dynamically allocate entries. */
|
||||
ATOM_Tonga_State entries[]; /* Dynamically allocate entries. */
|
||||
} ATOM_Tonga_State_Array;
|
||||
|
||||
typedef struct _ATOM_Tonga_MCLK_Dependency_Record {
|
||||
@ -179,7 +179,7 @@ typedef struct _ATOM_Tonga_MCLK_Dependency_Record {
|
||||
typedef struct _ATOM_Tonga_MCLK_Dependency_Table {
|
||||
UCHAR ucRevId;
|
||||
UCHAR ucNumEntries; /* Number of entries. */
|
||||
ATOM_Tonga_MCLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */
|
||||
ATOM_Tonga_MCLK_Dependency_Record entries[]; /* Dynamically allocate entries. */
|
||||
} ATOM_Tonga_MCLK_Dependency_Table;
|
||||
|
||||
typedef struct _ATOM_Tonga_SCLK_Dependency_Record {
|
||||
@ -194,7 +194,7 @@ typedef struct _ATOM_Tonga_SCLK_Dependency_Record {
|
||||
typedef struct _ATOM_Tonga_SCLK_Dependency_Table {
|
||||
UCHAR ucRevId;
|
||||
UCHAR ucNumEntries; /* Number of entries. */
|
||||
ATOM_Tonga_SCLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */
|
||||
ATOM_Tonga_SCLK_Dependency_Record entries[]; /* Dynamically allocate entries. */
|
||||
} ATOM_Tonga_SCLK_Dependency_Table;
|
||||
|
||||
typedef struct _ATOM_Polaris_SCLK_Dependency_Record {
|
||||
@ -210,7 +210,7 @@ typedef struct _ATOM_Polaris_SCLK_Dependency_Record {
|
||||
typedef struct _ATOM_Polaris_SCLK_Dependency_Table {
|
||||
UCHAR ucRevId;
|
||||
UCHAR ucNumEntries; /* Number of entries. */
|
||||
ATOM_Polaris_SCLK_Dependency_Record entries[1]; /* Dynamically allocate entries. */
|
||||
ATOM_Polaris_SCLK_Dependency_Record entries[]; /* Dynamically allocate entries. */
|
||||
} ATOM_Polaris_SCLK_Dependency_Table;
|
||||
|
||||
typedef struct _ATOM_Tonga_PCIE_Record {
|
||||
@ -222,7 +222,7 @@ typedef struct _ATOM_Tonga_PCIE_Record {
|
||||
typedef struct _ATOM_Tonga_PCIE_Table {
|
||||
UCHAR ucRevId;
|
||||
UCHAR ucNumEntries; /* Number of entries. */
|
||||
ATOM_Tonga_PCIE_Record entries[1]; /* Dynamically allocate entries. */
|
||||
ATOM_Tonga_PCIE_Record entries[]; /* Dynamically allocate entries. */
|
||||
} ATOM_Tonga_PCIE_Table;
|
||||
|
||||
typedef struct _ATOM_Polaris10_PCIE_Record {
|
||||
@ -235,7 +235,7 @@ typedef struct _ATOM_Polaris10_PCIE_Record {
|
||||
typedef struct _ATOM_Polaris10_PCIE_Table {
|
||||
UCHAR ucRevId;
|
||||
UCHAR ucNumEntries; /* Number of entries. */
|
||||
ATOM_Polaris10_PCIE_Record entries[1]; /* Dynamically allocate entries. */
|
||||
ATOM_Polaris10_PCIE_Record entries[]; /* Dynamically allocate entries. */
|
||||
} ATOM_Polaris10_PCIE_Table;
|
||||
|
||||
|
||||
@ -252,7 +252,7 @@ typedef struct _ATOM_Tonga_MM_Dependency_Record {
|
||||
typedef struct _ATOM_Tonga_MM_Dependency_Table {
|
||||
UCHAR ucRevId;
|
||||
UCHAR ucNumEntries; /* Number of entries. */
|
||||
ATOM_Tonga_MM_Dependency_Record entries[1]; /* Dynamically allocate entries. */
|
||||
ATOM_Tonga_MM_Dependency_Record entries[]; /* Dynamically allocate entries. */
|
||||
} ATOM_Tonga_MM_Dependency_Table;
|
||||
|
||||
typedef struct _ATOM_Tonga_Voltage_Lookup_Record {
|
||||
@ -265,7 +265,7 @@ typedef struct _ATOM_Tonga_Voltage_Lookup_Record {
|
||||
typedef struct _ATOM_Tonga_Voltage_Lookup_Table {
|
||||
UCHAR ucRevId;
|
||||
UCHAR ucNumEntries; /* Number of entries. */
|
||||
ATOM_Tonga_Voltage_Lookup_Record entries[1]; /* Dynamically allocate entries. */
|
||||
ATOM_Tonga_Voltage_Lookup_Record entries[]; /* Dynamically allocate entries. */
|
||||
} ATOM_Tonga_Voltage_Lookup_Table;
|
||||
|
||||
typedef struct _ATOM_Tonga_Fan_Table {
|
||||
|
@ -707,15 +707,11 @@ static int i801_block_transaction_byte_by_byte(struct i801_priv *priv,
|
||||
return i801_check_post(priv, status);
|
||||
}
|
||||
|
||||
if (len == 1 && read_write == I2C_SMBUS_READ)
|
||||
smbcmd |= SMBHSTCNT_LAST_BYTE;
|
||||
outb_p(smbcmd | SMBHSTCNT_START, SMBHSTCNT(priv));
|
||||
|
||||
for (i = 1; i <= len; i++) {
|
||||
if (i == len && read_write == I2C_SMBUS_READ)
|
||||
smbcmd |= SMBHSTCNT_LAST_BYTE;
|
||||
outb_p(smbcmd, SMBHSTCNT(priv));
|
||||
|
||||
if (i == 1)
|
||||
outb_p(inb(SMBHSTCNT(priv)) | SMBHSTCNT_START,
|
||||
SMBHSTCNT(priv));
|
||||
|
||||
status = i801_wait_byte_done(priv);
|
||||
if (status)
|
||||
goto exit;
|
||||
@ -738,9 +734,12 @@ static int i801_block_transaction_byte_by_byte(struct i801_priv *priv,
|
||||
data->block[0] = len;
|
||||
}
|
||||
|
||||
/* Retrieve/store value in SMBBLKDAT */
|
||||
if (read_write == I2C_SMBUS_READ)
|
||||
if (read_write == I2C_SMBUS_READ) {
|
||||
data->block[i] = inb_p(SMBBLKDAT(priv));
|
||||
if (i == len - 1)
|
||||
outb_p(smbcmd | SMBHSTCNT_LAST_BYTE, SMBHSTCNT(priv));
|
||||
}
|
||||
|
||||
if (read_write == I2C_SMBUS_WRITE && i+1 <= len)
|
||||
outb_p(data->block[i+1], SMBBLKDAT(priv));
|
||||
|
||||
|
@ -202,6 +202,11 @@ static int p2wi_probe(struct platform_device *pdev)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (clk_freq == 0) {
|
||||
dev_err(dev, "clock-frequency is set to 0 in DT\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (of_get_child_count(np) > 1) {
|
||||
dev_err(dev, "P2WI only supports one slave device\n");
|
||||
return -EINVAL;
|
||||
|
@ -45,6 +45,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/bitfield.h>
|
||||
#include <linux/pci.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/delay.h>
|
||||
@ -269,12 +270,6 @@ static u32 extract_speed(u16 linkstat)
|
||||
return speed;
|
||||
}
|
||||
|
||||
/* return the PCIe link speed from the given link status */
|
||||
static u32 extract_width(u16 linkstat)
|
||||
{
|
||||
return (linkstat & PCI_EXP_LNKSTA_NLW) >> PCI_EXP_LNKSTA_NLW_SHIFT;
|
||||
}
|
||||
|
||||
/* read the link status and set dd->{lbus_width,lbus_speed,lbus_info} */
|
||||
static void update_lbus_info(struct hfi1_devdata *dd)
|
||||
{
|
||||
@ -287,7 +282,7 @@ static void update_lbus_info(struct hfi1_devdata *dd)
|
||||
return;
|
||||
}
|
||||
|
||||
dd->lbus_width = extract_width(linkstat);
|
||||
dd->lbus_width = FIELD_GET(PCI_EXP_LNKSTA_NLW, linkstat);
|
||||
dd->lbus_speed = extract_speed(linkstat);
|
||||
snprintf(dd->lbus_info, sizeof(dd->lbus_info),
|
||||
"PCIe,%uMHz,x%u", dd->lbus_speed, dd->lbus_width);
|
||||
|
@ -251,6 +251,7 @@ int mcb_device_register(struct mcb_bus *bus, struct mcb_device *dev)
|
||||
return 0;
|
||||
|
||||
out:
|
||||
put_device(&dev->dev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ static int chameleon_parse_gdd(struct mcb_bus *bus,
|
||||
return 0;
|
||||
|
||||
err:
|
||||
put_device(&mdev->dev);
|
||||
mcb_free_dev(mdev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -412,7 +412,7 @@ session_get_prop_buf_req(struct hfi_msg_session_property_info_pkt *pkt,
|
||||
memcpy(&bufreq[idx], buf_req, sizeof(*bufreq));
|
||||
idx++;
|
||||
|
||||
if (idx > HFI_BUFFER_TYPE_MAX)
|
||||
if (idx >= HFI_BUFFER_TYPE_MAX)
|
||||
return HFI_ERR_SESSION_INVALID_PARAMETER;
|
||||
|
||||
req_bytes -= sizeof(struct hfi_buffer_requirements);
|
||||
|
@ -220,6 +220,11 @@ static int venus_write_queue(struct venus_hfi_device *hdev,
|
||||
|
||||
new_wr_idx = wr_idx + dwords;
|
||||
wr_ptr = (u32 *)(queue->qmem.kva + (wr_idx << 2));
|
||||
|
||||
if (wr_ptr < (u32 *)queue->qmem.kva ||
|
||||
wr_ptr > (u32 *)(queue->qmem.kva + queue->qmem.size - sizeof(*wr_ptr)))
|
||||
return -EINVAL;
|
||||
|
||||
if (new_wr_idx < qsize) {
|
||||
memcpy(wr_ptr, packet, dwords << 2);
|
||||
} else {
|
||||
@ -287,6 +292,11 @@ static int venus_read_queue(struct venus_hfi_device *hdev,
|
||||
}
|
||||
|
||||
rd_ptr = (u32 *)(queue->qmem.kva + (rd_idx << 2));
|
||||
|
||||
if (rd_ptr < (u32 *)queue->qmem.kva ||
|
||||
rd_ptr > (u32 *)(queue->qmem.kva + queue->qmem.size - sizeof(*rd_ptr)))
|
||||
return -EINVAL;
|
||||
|
||||
dwords = *rd_ptr >> 2;
|
||||
if (!dwords)
|
||||
return -EINVAL;
|
||||
|
@ -157,7 +157,7 @@ void vivid_rds_gen_fill(struct vivid_rds_gen *rds, unsigned freq,
|
||||
rds->ta = alt;
|
||||
rds->ms = true;
|
||||
snprintf(rds->psname, sizeof(rds->psname), "%6d.%1d",
|
||||
freq / 16, ((freq & 0xf) * 10) / 16);
|
||||
(freq / 16) % 1000000, (((freq & 0xf) * 10) / 16) % 10);
|
||||
if (alt)
|
||||
strlcpy(rds->radiotext,
|
||||
" The Radio Data System can switch between different Radio Texts ",
|
||||
|
@ -23,7 +23,9 @@
|
||||
#define SHARP_UNIT 40000 /* ns */
|
||||
#define SHARP_BIT_PULSE (8 * SHARP_UNIT) /* 320us */
|
||||
#define SHARP_BIT_0_PERIOD (25 * SHARP_UNIT) /* 1ms (680us space) */
|
||||
#define SHARP_BIT_1_PERIOD (50 * SHARP_UNIT) /* 2ms (1680ms space) */
|
||||
#define SHARP_BIT_1_PERIOD (50 * SHARP_UNIT) /* 2ms (1680us space) */
|
||||
#define SHARP_BIT_0_SPACE (17 * SHARP_UNIT) /* 680us space */
|
||||
#define SHARP_BIT_1_SPACE (42 * SHARP_UNIT) /* 1680us space */
|
||||
#define SHARP_ECHO_SPACE (1000 * SHARP_UNIT) /* 40 ms */
|
||||
#define SHARP_TRAILER_SPACE (125 * SHARP_UNIT) /* 5 ms (even longer) */
|
||||
|
||||
@ -177,8 +179,8 @@ static const struct ir_raw_timings_pd ir_sharp_timings = {
|
||||
.header_pulse = 0,
|
||||
.header_space = 0,
|
||||
.bit_pulse = SHARP_BIT_PULSE,
|
||||
.bit_space[0] = SHARP_BIT_0_PERIOD,
|
||||
.bit_space[1] = SHARP_BIT_1_PERIOD,
|
||||
.bit_space[0] = SHARP_BIT_0_SPACE,
|
||||
.bit_space[1] = SHARP_BIT_1_SPACE,
|
||||
.trailer_pulse = SHARP_BIT_PULSE,
|
||||
.trailer_space = SHARP_ECHO_SPACE,
|
||||
.msb_first = 1,
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
#include <linux/input.h>
|
||||
#include <linux/sched/signal.h>
|
||||
#include <linux/bitops.h>
|
||||
|
||||
#include "gspca.h"
|
||||
|
||||
@ -1032,6 +1033,8 @@ static int set_flicker(struct gspca_dev *gspca_dev, int on, int apply)
|
||||
sd->params.exposure.expMode = 2;
|
||||
sd->exposure_status = EXPOSURE_NORMAL;
|
||||
}
|
||||
if (sd->params.exposure.gain >= BITS_PER_TYPE(currentexp))
|
||||
return -EINVAL;
|
||||
currentexp = currentexp << sd->params.exposure.gain;
|
||||
sd->params.exposure.gain = 0;
|
||||
/* round down current exposure to nearest value */
|
||||
|
@ -908,7 +908,6 @@ static void meson_mmc_start_cmd(struct mmc_host *mmc, struct mmc_command *cmd)
|
||||
|
||||
cmd_cfg |= FIELD_PREP(CMD_CFG_CMD_INDEX_MASK, cmd->opcode);
|
||||
cmd_cfg |= CMD_CFG_OWNER; /* owned by CPU */
|
||||
cmd_cfg |= CMD_CFG_ERROR; /* stop in case of error */
|
||||
|
||||
meson_mmc_set_response_bits(cmd, &cmd_cfg);
|
||||
|
||||
|
@ -2321,6 +2321,7 @@ static int vub300_probe(struct usb_interface *interface,
|
||||
vub300->read_only =
|
||||
(0x0010 & vub300->system_port_status.port_flags) ? 1 : 0;
|
||||
} else {
|
||||
retval = -EINVAL;
|
||||
goto error5;
|
||||
}
|
||||
usb_set_intfdata(interface, vub300);
|
||||
|
@ -41,7 +41,7 @@ static int lan9303_mdio_write(void *ctx, uint32_t reg, uint32_t val)
|
||||
struct lan9303_mdio *sw_dev = (struct lan9303_mdio *)ctx;
|
||||
|
||||
reg <<= 2; /* reg num to offset */
|
||||
mutex_lock(&sw_dev->device->bus->mdio_lock);
|
||||
mutex_lock_nested(&sw_dev->device->bus->mdio_lock, MDIO_MUTEX_NESTED);
|
||||
lan9303_mdio_real_write(sw_dev->device, reg, val & 0xffff);
|
||||
lan9303_mdio_real_write(sw_dev->device, reg + 2, (val >> 16) & 0xffff);
|
||||
mutex_unlock(&sw_dev->device->bus->mdio_lock);
|
||||
@ -59,7 +59,7 @@ static int lan9303_mdio_read(void *ctx, uint32_t reg, uint32_t *val)
|
||||
struct lan9303_mdio *sw_dev = (struct lan9303_mdio *)ctx;
|
||||
|
||||
reg <<= 2; /* reg num to offset */
|
||||
mutex_lock(&sw_dev->device->bus->mdio_lock);
|
||||
mutex_lock_nested(&sw_dev->device->bus->mdio_lock, MDIO_MUTEX_NESTED);
|
||||
*val = lan9303_mdio_real_read(sw_dev->device, reg);
|
||||
*val |= (lan9303_mdio_real_read(sw_dev->device, reg + 2) << 16);
|
||||
mutex_unlock(&sw_dev->device->bus->mdio_lock);
|
||||
|
@ -1411,7 +1411,7 @@ void ath10k_debug_get_et_strings(struct ieee80211_hw *hw,
|
||||
u32 sset, u8 *data)
|
||||
{
|
||||
if (sset == ETH_SS_STATS)
|
||||
memcpy(data, *ath10k_gstrings_stats,
|
||||
memcpy(data, ath10k_gstrings_stats,
|
||||
sizeof(ath10k_gstrings_stats));
|
||||
}
|
||||
|
||||
|
@ -1297,7 +1297,7 @@ void ath9k_get_et_strings(struct ieee80211_hw *hw,
|
||||
u32 sset, u8 *data)
|
||||
{
|
||||
if (sset == ETH_SS_STATS)
|
||||
memcpy(data, *ath9k_gstrings_stats,
|
||||
memcpy(data, ath9k_gstrings_stats,
|
||||
sizeof(ath9k_gstrings_stats));
|
||||
}
|
||||
|
||||
|
@ -428,7 +428,7 @@ void ath9k_htc_get_et_strings(struct ieee80211_hw *hw,
|
||||
u32 sset, u8 *data)
|
||||
{
|
||||
if (sset == ETH_SS_STATS)
|
||||
memcpy(data, *ath9k_htc_gstrings_stats,
|
||||
memcpy(data, ath9k_htc_gstrings_stats,
|
||||
sizeof(ath9k_htc_gstrings_stats));
|
||||
}
|
||||
|
||||
|
@ -482,7 +482,7 @@ static pci_power_t acpi_pci_choose_state(struct pci_dev *pdev)
|
||||
{
|
||||
int acpi_state, d_max;
|
||||
|
||||
if (pdev->no_d3cold)
|
||||
if (pdev->no_d3cold || !pdev->d3cold_allowed)
|
||||
d_max = ACPI_STATE_D3_HOT;
|
||||
else
|
||||
d_max = ACPI_STATE_D3_COLD;
|
||||
|
@ -534,10 +534,7 @@ static ssize_t d3cold_allowed_store(struct device *dev,
|
||||
return -EINVAL;
|
||||
|
||||
pdev->d3cold_allowed = !!val;
|
||||
if (pdev->d3cold_allowed)
|
||||
pci_d3cold_enable(pdev);
|
||||
else
|
||||
pci_d3cold_disable(pdev);
|
||||
pci_bridge_d3_update(pdev);
|
||||
|
||||
pm_runtime_resume(dev);
|
||||
|
||||
|
@ -251,6 +251,12 @@ static void fc_lport_ptp_setup(struct fc_lport *lport,
|
||||
}
|
||||
mutex_lock(&lport->disc.disc_mutex);
|
||||
lport->ptp_rdata = fc_rport_create(lport, remote_fid);
|
||||
if (!lport->ptp_rdata) {
|
||||
printk(KERN_WARNING "libfc: Failed to setup lport 0x%x\n",
|
||||
lport->port_id);
|
||||
mutex_unlock(&lport->disc.disc_mutex);
|
||||
return;
|
||||
}
|
||||
kref_get(&lport->ptp_rdata->kref);
|
||||
lport->ptp_rdata->ids.port_name = remote_wwpn;
|
||||
lport->ptp_rdata->ids.node_name = remote_wwnn;
|
||||
|
@ -891,6 +891,7 @@ static int virtscsi_probe(struct virtio_device *vdev)
|
||||
|
||||
/* We need to know how many queues before we allocate. */
|
||||
num_queues = virtscsi_config_get(vdev, num_queues) ? : 1;
|
||||
num_queues = min_t(unsigned int, nr_cpu_ids, num_queues);
|
||||
|
||||
num_targets = virtscsi_config_get(vdev, max_target) + 1;
|
||||
|
||||
|
@ -600,7 +600,7 @@ static int __init xen_hvc_init(void)
|
||||
ops = &dom0_hvc_ops;
|
||||
r = xen_initial_domain_console_init();
|
||||
if (r < 0)
|
||||
return r;
|
||||
goto register_fe;
|
||||
info = vtermno_to_xencons(HVC_COOKIE);
|
||||
} else {
|
||||
ops = &domU_hvc_ops;
|
||||
@ -609,7 +609,7 @@ static int __init xen_hvc_init(void)
|
||||
else
|
||||
r = xen_pv_console_init();
|
||||
if (r < 0)
|
||||
return r;
|
||||
goto register_fe;
|
||||
|
||||
info = vtermno_to_xencons(HVC_COOKIE);
|
||||
info->irq = bind_evtchn_to_irq_lateeoi(info->evtchn);
|
||||
@ -634,6 +634,7 @@ static int __init xen_hvc_init(void)
|
||||
}
|
||||
|
||||
r = 0;
|
||||
register_fe:
|
||||
#ifdef CONFIG_HVC_XEN_FRONTEND
|
||||
r = xenbus_register_frontend(&xencons_driver);
|
||||
#endif
|
||||
|
@ -594,18 +594,22 @@ static int vcc_probe(struct vio_dev *vdev, const struct vio_device_id *id)
|
||||
return -ENOMEM;
|
||||
|
||||
name = kstrdup(dev_name(&vdev->dev), GFP_KERNEL);
|
||||
if (!name) {
|
||||
rv = -ENOMEM;
|
||||
goto free_port;
|
||||
}
|
||||
|
||||
rv = vio_driver_init(&port->vio, vdev, VDEV_CONSOLE_CON, vcc_versions,
|
||||
ARRAY_SIZE(vcc_versions), NULL, name);
|
||||
if (rv)
|
||||
goto free_port;
|
||||
goto free_name;
|
||||
|
||||
port->vio.debug = vcc_dbg_vio;
|
||||
vcc_ldc_cfg.debug = vcc_dbg_ldc;
|
||||
|
||||
rv = vio_ldc_alloc(&port->vio, &vcc_ldc_cfg, port);
|
||||
if (rv)
|
||||
goto free_port;
|
||||
goto free_name;
|
||||
|
||||
spin_lock_init(&port->lock);
|
||||
|
||||
@ -639,6 +643,11 @@ static int vcc_probe(struct vio_dev *vdev, const struct vio_device_id *id)
|
||||
goto unreg_tty;
|
||||
}
|
||||
port->domain = kstrdup(domain, GFP_KERNEL);
|
||||
if (!port->domain) {
|
||||
rv = -ENOMEM;
|
||||
goto unreg_tty;
|
||||
}
|
||||
|
||||
|
||||
mdesc_release(hp);
|
||||
|
||||
@ -673,8 +682,9 @@ free_table:
|
||||
vcc_table_remove(port->index);
|
||||
free_ldc:
|
||||
vio_ldc_free(&port->vio);
|
||||
free_port:
|
||||
free_name:
|
||||
kfree(name);
|
||||
free_port:
|
||||
kfree(port);
|
||||
|
||||
return rv;
|
||||
|
@ -67,6 +67,11 @@ extern int ext4_init_acl(handle_t *, struct inode *, struct inode *);
|
||||
static inline int
|
||||
ext4_init_acl(handle_t *handle, struct inode *inode, struct inode *dir)
|
||||
{
|
||||
/* usually, the umask is applied by posix_acl_create(), but if
|
||||
ext4 ACL support is disabled at compile time, we need to do
|
||||
it here, because posix_acl_create() will never be called */
|
||||
inode->i_mode &= ~current_umask();
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_EXT4_FS_POSIX_ACL */
|
||||
|
@ -557,13 +557,8 @@ static int setup_new_flex_group_blocks(struct super_block *sb,
|
||||
if (meta_bg == 0 && !ext4_bg_has_super(sb, group))
|
||||
goto handle_itb;
|
||||
|
||||
if (meta_bg == 1) {
|
||||
ext4_group_t first_group;
|
||||
first_group = ext4_meta_bg_first_group(sb, group);
|
||||
if (first_group != group + 1 &&
|
||||
first_group != group + EXT4_DESC_PER_BLOCK(sb) - 1)
|
||||
goto handle_itb;
|
||||
}
|
||||
if (meta_bg == 1)
|
||||
goto handle_itb;
|
||||
|
||||
block = start + ext4_bg_has_super(sb, group);
|
||||
/* Copy all of the GDT blocks into the backup in this group */
|
||||
@ -1538,6 +1533,8 @@ exit_journal:
|
||||
int gdb_num_end = ((group + flex_gd->count - 1) /
|
||||
EXT4_DESC_PER_BLOCK(sb));
|
||||
int meta_bg = ext4_has_feature_meta_bg(sb);
|
||||
sector_t padding_blocks = meta_bg ? 0 : sbi->s_sbh->b_blocknr -
|
||||
ext4_group_first_block_no(sb, 0);
|
||||
sector_t old_gdb = 0;
|
||||
|
||||
update_backups(sb, sbi->s_sbh->b_blocknr, (char *)es,
|
||||
@ -1549,8 +1546,8 @@ exit_journal:
|
||||
gdb_num);
|
||||
if (old_gdb == gdb_bh->b_blocknr)
|
||||
continue;
|
||||
update_backups(sb, gdb_bh->b_blocknr, gdb_bh->b_data,
|
||||
gdb_bh->b_size, meta_bg);
|
||||
update_backups(sb, gdb_bh->b_blocknr - padding_blocks,
|
||||
gdb_bh->b_data, gdb_bh->b_size, meta_bg);
|
||||
old_gdb = gdb_bh->b_blocknr;
|
||||
}
|
||||
}
|
||||
@ -1910,9 +1907,7 @@ static int ext4_convert_meta_bg(struct super_block *sb, struct inode *inode)
|
||||
|
||||
errout:
|
||||
ret = ext4_journal_stop(handle);
|
||||
if (!err)
|
||||
err = ret;
|
||||
return ret;
|
||||
return err ? err : ret;
|
||||
|
||||
invalid_resize_inode:
|
||||
ext4_error(sb, "corrupted/inconsistent resize inode");
|
||||
|
@ -434,6 +434,17 @@ static int qd_check_sync(struct gfs2_sbd *sdp, struct gfs2_quota_data *qd,
|
||||
(sync_gen && (qd->qd_sync_gen >= *sync_gen)))
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* If qd_change is 0 it means a pending quota change was negated.
|
||||
* We should not sync it, but we still have a qd reference and slot
|
||||
* reference taken by gfs2_quota_change -> do_qc that need to be put.
|
||||
*/
|
||||
if (!qd->qd_change && test_and_clear_bit(QDF_CHANGE, &qd->qd_flags)) {
|
||||
slot_put(qd);
|
||||
qd_put(qd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!lockref_get_not_dead(&qd->qd_lockref))
|
||||
return 0;
|
||||
|
||||
|
@ -250,6 +250,8 @@ int jbd2_journal_recover(journal_t *journal)
|
||||
journal_superblock_t * sb;
|
||||
|
||||
struct recovery_info info;
|
||||
errseq_t wb_err;
|
||||
struct address_space *mapping;
|
||||
|
||||
memset(&info, 0, sizeof(info));
|
||||
sb = journal->j_superblock;
|
||||
@ -267,6 +269,9 @@ int jbd2_journal_recover(journal_t *journal)
|
||||
return 0;
|
||||
}
|
||||
|
||||
wb_err = 0;
|
||||
mapping = journal->j_fs_dev->bd_inode->i_mapping;
|
||||
errseq_check_and_advance(&mapping->wb_err, &wb_err);
|
||||
err = do_one_pass(journal, &info, PASS_SCAN);
|
||||
if (!err)
|
||||
err = do_one_pass(journal, &info, PASS_REVOKE);
|
||||
@ -285,6 +290,9 @@ int jbd2_journal_recover(journal_t *journal)
|
||||
|
||||
jbd2_journal_clear_revoke(journal);
|
||||
err2 = sync_blockdev(journal->j_fs_dev);
|
||||
if (!err)
|
||||
err = err2;
|
||||
err2 = errseq_check_and_advance(&mapping->wb_err, &wb_err);
|
||||
if (!err)
|
||||
err = err2;
|
||||
/* Make sure all replayed data is on permanent storage */
|
||||
|
@ -100,7 +100,7 @@ static int dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno,
|
||||
static int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks);
|
||||
static int dbFindBits(u32 word, int l2nb);
|
||||
static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno);
|
||||
static int dbFindLeaf(dmtree_t * tp, int l2nb, int *leafidx);
|
||||
static int dbFindLeaf(dmtree_t *tp, int l2nb, int *leafidx, bool is_ctl);
|
||||
static int dbFreeBits(struct bmap * bmp, struct dmap * dp, s64 blkno,
|
||||
int nblocks);
|
||||
static int dbFreeDmap(struct bmap * bmp, struct dmap * dp, s64 blkno,
|
||||
@ -193,7 +193,8 @@ int dbMount(struct inode *ipbmap)
|
||||
bmp->db_nfree = le64_to_cpu(dbmp_le->dn_nfree);
|
||||
|
||||
bmp->db_l2nbperpage = le32_to_cpu(dbmp_le->dn_l2nbperpage);
|
||||
if (bmp->db_l2nbperpage > L2PSIZE - L2MINBLOCKSIZE) {
|
||||
if (bmp->db_l2nbperpage > L2PSIZE - L2MINBLOCKSIZE ||
|
||||
bmp->db_l2nbperpage < 0) {
|
||||
err = -EINVAL;
|
||||
goto err_release_metapage;
|
||||
}
|
||||
@ -207,6 +208,12 @@ int dbMount(struct inode *ipbmap)
|
||||
bmp->db_maxlevel = le32_to_cpu(dbmp_le->dn_maxlevel);
|
||||
bmp->db_maxag = le32_to_cpu(dbmp_le->dn_maxag);
|
||||
bmp->db_agpref = le32_to_cpu(dbmp_le->dn_agpref);
|
||||
if (bmp->db_maxag >= MAXAG || bmp->db_maxag < 0 ||
|
||||
bmp->db_agpref >= MAXAG || bmp->db_agpref < 0) {
|
||||
err = -EINVAL;
|
||||
goto err_release_metapage;
|
||||
}
|
||||
|
||||
bmp->db_aglevel = le32_to_cpu(dbmp_le->dn_aglevel);
|
||||
bmp->db_agheight = le32_to_cpu(dbmp_le->dn_agheight);
|
||||
bmp->db_agwidth = le32_to_cpu(dbmp_le->dn_agwidth);
|
||||
@ -1791,7 +1798,7 @@ static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno)
|
||||
* dbFindLeaf() returns the index of the leaf at which
|
||||
* free space was found.
|
||||
*/
|
||||
rc = dbFindLeaf((dmtree_t *) dcp, l2nb, &leafidx);
|
||||
rc = dbFindLeaf((dmtree_t *) dcp, l2nb, &leafidx, true);
|
||||
|
||||
/* release the buffer.
|
||||
*/
|
||||
@ -2038,7 +2045,7 @@ dbAllocDmapLev(struct bmap * bmp,
|
||||
* free space. if sufficient free space is found, dbFindLeaf()
|
||||
* returns the index of the leaf at which free space was found.
|
||||
*/
|
||||
if (dbFindLeaf((dmtree_t *) & dp->tree, l2nb, &leafidx))
|
||||
if (dbFindLeaf((dmtree_t *) &dp->tree, l2nb, &leafidx, false))
|
||||
return -ENOSPC;
|
||||
|
||||
if (leafidx < 0)
|
||||
@ -2998,14 +3005,18 @@ static void dbAdjTree(dmtree_t * tp, int leafno, int newval)
|
||||
* leafidx - return pointer to be set to the index of the leaf
|
||||
* describing at least l2nb free blocks if sufficient
|
||||
* free blocks are found.
|
||||
* is_ctl - determines if the tree is of type ctl
|
||||
*
|
||||
* RETURN VALUES:
|
||||
* 0 - success
|
||||
* -ENOSPC - insufficient free blocks.
|
||||
*/
|
||||
static int dbFindLeaf(dmtree_t * tp, int l2nb, int *leafidx)
|
||||
static int dbFindLeaf(dmtree_t *tp, int l2nb, int *leafidx, bool is_ctl)
|
||||
{
|
||||
int ti, n = 0, k, x = 0;
|
||||
int max_size;
|
||||
|
||||
max_size = is_ctl ? CTLTREESIZE : TREESIZE;
|
||||
|
||||
/* first check the root of the tree to see if there is
|
||||
* sufficient free space.
|
||||
@ -3026,6 +3037,8 @@ static int dbFindLeaf(dmtree_t * tp, int l2nb, int *leafidx)
|
||||
/* sufficient free space found. move to the next
|
||||
* level (or quit if this is the last level).
|
||||
*/
|
||||
if (x + n > max_size)
|
||||
return -ENOSPC;
|
||||
if (l2nb <= tp->dmt_stree[x + n])
|
||||
break;
|
||||
}
|
||||
|
@ -1341,7 +1341,7 @@ diInitInode(struct inode *ip, int iagno, int ino, int extno, struct iag * iagp)
|
||||
int diAlloc(struct inode *pip, bool dir, struct inode *ip)
|
||||
{
|
||||
int rc, ino, iagno, addext, extno, bitno, sword;
|
||||
int nwords, rem, i, agno;
|
||||
int nwords, rem, i, agno, dn_numag;
|
||||
u32 mask, inosmap, extsmap;
|
||||
struct inode *ipimap;
|
||||
struct metapage *mp;
|
||||
@ -1377,6 +1377,9 @@ int diAlloc(struct inode *pip, bool dir, struct inode *ip)
|
||||
|
||||
/* get the ag number of this iag */
|
||||
agno = BLKTOAG(JFS_IP(pip)->agstart, JFS_SBI(pip->i_sb));
|
||||
dn_numag = JFS_SBI(pip->i_sb)->bmap->db_numag;
|
||||
if (agno < 0 || agno > dn_numag)
|
||||
return -EIO;
|
||||
|
||||
if (atomic_read(&JFS_SBI(pip->i_sb)->bmap->db_active[agno])) {
|
||||
/*
|
||||
|
@ -44,8 +44,8 @@ struct pwm_args {
|
||||
};
|
||||
|
||||
enum {
|
||||
PWMF_REQUESTED = 1 << 0,
|
||||
PWMF_EXPORTED = 1 << 1,
|
||||
PWMF_REQUESTED = 0,
|
||||
PWMF_EXPORTED = 1,
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -1804,7 +1804,7 @@ static inline void dst_negative_advice(struct sock *sk)
|
||||
if (ndst != dst) {
|
||||
rcu_assign_pointer(sk->sk_dst_cache, ndst);
|
||||
sk_tx_queue_clear(sk);
|
||||
sk->sk_dst_pending_confirm = 0;
|
||||
WRITE_ONCE(sk->sk_dst_pending_confirm, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1815,7 +1815,7 @@ __sk_dst_set(struct sock *sk, struct dst_entry *dst)
|
||||
struct dst_entry *old_dst;
|
||||
|
||||
sk_tx_queue_clear(sk);
|
||||
sk->sk_dst_pending_confirm = 0;
|
||||
WRITE_ONCE(sk->sk_dst_pending_confirm, 0);
|
||||
old_dst = rcu_dereference_protected(sk->sk_dst_cache,
|
||||
lockdep_sock_is_held(sk));
|
||||
rcu_assign_pointer(sk->sk_dst_cache, dst);
|
||||
@ -1828,7 +1828,7 @@ sk_dst_set(struct sock *sk, struct dst_entry *dst)
|
||||
struct dst_entry *old_dst;
|
||||
|
||||
sk_tx_queue_clear(sk);
|
||||
sk->sk_dst_pending_confirm = 0;
|
||||
WRITE_ONCE(sk->sk_dst_pending_confirm, 0);
|
||||
old_dst = xchg((__force struct dst_entry **)&sk->sk_dst_cache, dst);
|
||||
dst_release(old_dst);
|
||||
}
|
||||
|
@ -557,11 +557,18 @@ int audit_exe_compare(struct task_struct *tsk, struct audit_fsnotify_mark *mark)
|
||||
unsigned long ino;
|
||||
dev_t dev;
|
||||
|
||||
exe_file = get_task_exe_file(tsk);
|
||||
/* only do exe filtering if we are recording @current events/records */
|
||||
if (tsk != current)
|
||||
return 0;
|
||||
|
||||
if (!current->mm)
|
||||
return 0;
|
||||
exe_file = get_mm_exe_file(current->mm);
|
||||
if (!exe_file)
|
||||
return 0;
|
||||
ino = file_inode(exe_file)->i_ino;
|
||||
dev = file_inode(exe_file)->i_sb->s_dev;
|
||||
fput(exe_file);
|
||||
|
||||
return audit_mark_compare(mark, ino, dev);
|
||||
}
|
||||
|
@ -533,21 +533,34 @@ EXPORT_SYMBOL_GPL(irq_setup_alt_chip);
|
||||
void irq_remove_generic_chip(struct irq_chip_generic *gc, u32 msk,
|
||||
unsigned int clr, unsigned int set)
|
||||
{
|
||||
unsigned int i = gc->irq_base;
|
||||
unsigned int i, virq;
|
||||
|
||||
raw_spin_lock(&gc_lock);
|
||||
list_del(&gc->list);
|
||||
raw_spin_unlock(&gc_lock);
|
||||
|
||||
for (; msk; msk >>= 1, i++) {
|
||||
for (i = 0; msk; msk >>= 1, i++) {
|
||||
if (!(msk & 0x01))
|
||||
continue;
|
||||
|
||||
/*
|
||||
* Interrupt domain based chips store the base hardware
|
||||
* interrupt number in gc::irq_base. Otherwise gc::irq_base
|
||||
* contains the base Linux interrupt number.
|
||||
*/
|
||||
if (gc->domain) {
|
||||
virq = irq_find_mapping(gc->domain, gc->irq_base + i);
|
||||
if (!virq)
|
||||
continue;
|
||||
} else {
|
||||
virq = gc->irq_base + i;
|
||||
}
|
||||
|
||||
/* Remove handler first. That will mask the irq line */
|
||||
irq_set_handler(i, NULL);
|
||||
irq_set_chip(i, &no_irq_chip);
|
||||
irq_set_chip_data(i, NULL);
|
||||
irq_modify_status(i, clr, set);
|
||||
irq_set_handler(virq, NULL);
|
||||
irq_set_chip(virq, &no_irq_chip);
|
||||
irq_set_chip_data(virq, NULL);
|
||||
irq_modify_status(virq, clr, set);
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(irq_remove_generic_chip);
|
||||
|
@ -439,7 +439,6 @@ retry:
|
||||
} while (!time_after(jiffies, stress->timeout));
|
||||
|
||||
kfree(order);
|
||||
kfree(stress);
|
||||
}
|
||||
|
||||
struct reorder_lock {
|
||||
@ -504,7 +503,6 @@ out:
|
||||
list_for_each_entry_safe(ll, ln, &locks, link)
|
||||
kfree(ll);
|
||||
kfree(order);
|
||||
kfree(stress);
|
||||
}
|
||||
|
||||
static void stress_one_work(struct work_struct *work)
|
||||
@ -525,8 +523,6 @@ static void stress_one_work(struct work_struct *work)
|
||||
break;
|
||||
}
|
||||
} while (!time_after(jiffies, stress->timeout));
|
||||
|
||||
kfree(stress);
|
||||
}
|
||||
|
||||
#define STRESS_INORDER BIT(0)
|
||||
@ -537,15 +533,24 @@ static void stress_one_work(struct work_struct *work)
|
||||
static int stress(int nlocks, int nthreads, unsigned int flags)
|
||||
{
|
||||
struct ww_mutex *locks;
|
||||
int n;
|
||||
struct stress *stress_array;
|
||||
int n, count;
|
||||
|
||||
locks = kmalloc_array(nlocks, sizeof(*locks), GFP_KERNEL);
|
||||
if (!locks)
|
||||
return -ENOMEM;
|
||||
|
||||
stress_array = kmalloc_array(nthreads, sizeof(*stress_array),
|
||||
GFP_KERNEL);
|
||||
if (!stress_array) {
|
||||
kfree(locks);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
for (n = 0; n < nlocks; n++)
|
||||
ww_mutex_init(&locks[n], &ww_class);
|
||||
|
||||
count = 0;
|
||||
for (n = 0; nthreads; n++) {
|
||||
struct stress *stress;
|
||||
void (*fn)(struct work_struct *work);
|
||||
@ -569,9 +574,7 @@ static int stress(int nlocks, int nthreads, unsigned int flags)
|
||||
if (!fn)
|
||||
continue;
|
||||
|
||||
stress = kmalloc(sizeof(*stress), GFP_KERNEL);
|
||||
if (!stress)
|
||||
break;
|
||||
stress = &stress_array[count++];
|
||||
|
||||
INIT_WORK(&stress->work, fn);
|
||||
stress->locks = locks;
|
||||
@ -586,6 +589,7 @@ static int stress(int nlocks, int nthreads, unsigned int flags)
|
||||
|
||||
for (n = 0; n < nlocks; n++)
|
||||
ww_mutex_destroy(&locks[n]);
|
||||
kfree(stress_array);
|
||||
kfree(locks);
|
||||
|
||||
return 0;
|
||||
|
@ -120,7 +120,7 @@ int padata_do_parallel(struct padata_instance *pinst,
|
||||
if (!cpumask_test_cpu(cb_cpu, pd->cpumask.cbcpu))
|
||||
goto out;
|
||||
|
||||
err = -EBUSY;
|
||||
err = -EBUSY;
|
||||
if ((pinst->flags & PADATA_RESET))
|
||||
goto out;
|
||||
|
||||
|
@ -2377,8 +2377,9 @@ static void *get_highmem_page_buffer(struct page *page,
|
||||
pbe->copy_page = tmp;
|
||||
} else {
|
||||
/* Copy of the page will be stored in normal memory */
|
||||
kaddr = safe_pages_list;
|
||||
safe_pages_list = safe_pages_list->next;
|
||||
kaddr = __get_safe_page(ca->gfp_mask);
|
||||
if (!kaddr)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
pbe->copy_page = virt_to_page(kaddr);
|
||||
}
|
||||
pbe->next = highmem_pblist;
|
||||
@ -2558,8 +2559,9 @@ static void *get_buffer(struct memory_bitmap *bm, struct chain_allocator *ca)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
pbe->orig_address = page_address(page);
|
||||
pbe->address = safe_pages_list;
|
||||
safe_pages_list = safe_pages_list->next;
|
||||
pbe->address = __get_safe_page(ca->gfp_mask);
|
||||
if (!pbe->address)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
pbe->next = restore_pblist;
|
||||
restore_pblist = pbe;
|
||||
return pbe->address;
|
||||
@ -2590,8 +2592,6 @@ int snapshot_write_next(struct snapshot_handle *handle)
|
||||
if (handle->cur > 1 && handle->cur > nr_meta_pages + nr_copy_pages)
|
||||
return 0;
|
||||
|
||||
handle->sync_read = 1;
|
||||
|
||||
if (!handle->cur) {
|
||||
if (!buffer)
|
||||
/* This makes the buffer be freed by swsusp_free() */
|
||||
@ -2632,7 +2632,6 @@ int snapshot_write_next(struct snapshot_handle *handle)
|
||||
memory_bm_position_reset(&orig_bm);
|
||||
restore_pblist = NULL;
|
||||
handle->buffer = get_buffer(&orig_bm, &ca);
|
||||
handle->sync_read = 0;
|
||||
if (IS_ERR(handle->buffer))
|
||||
return PTR_ERR(handle->buffer);
|
||||
}
|
||||
@ -2644,9 +2643,8 @@ int snapshot_write_next(struct snapshot_handle *handle)
|
||||
handle->buffer = get_buffer(&orig_bm, &ca);
|
||||
if (IS_ERR(handle->buffer))
|
||||
return PTR_ERR(handle->buffer);
|
||||
if (handle->buffer != buffer)
|
||||
handle->sync_read = 0;
|
||||
}
|
||||
handle->sync_read = (handle->buffer == buffer);
|
||||
handle->cur++;
|
||||
return PAGE_SIZE;
|
||||
}
|
||||
|
@ -534,7 +534,7 @@ struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie)
|
||||
|
||||
if (dst && dst->obsolete && dst->ops->check(dst, cookie) == NULL) {
|
||||
sk_tx_queue_clear(sk);
|
||||
sk->sk_dst_pending_confirm = 0;
|
||||
WRITE_ONCE(sk->sk_dst_pending_confirm, 0);
|
||||
RCU_INIT_POINTER(sk->sk_dst_cache, NULL);
|
||||
dst_release(dst);
|
||||
return NULL;
|
||||
|
@ -1059,7 +1059,7 @@ static int __tcp_transmit_skb(struct sock *sk, struct sk_buff *skb,
|
||||
skb_set_hash_from_sk(skb, sk);
|
||||
refcount_add(skb->truesize, &sk->sk_wmem_alloc);
|
||||
|
||||
skb_set_dst_pending_confirm(skb, sk->sk_dst_pending_confirm);
|
||||
skb_set_dst_pending_confirm(skb, READ_ONCE(sk->sk_dst_pending_confirm));
|
||||
|
||||
/* Build TCP header and checksum it. */
|
||||
th = (struct tcphdr *)skb->data;
|
||||
|
@ -2428,6 +2428,10 @@ static int ieee80211_get_tx_power(struct wiphy *wiphy,
|
||||
else
|
||||
*dbm = sdata->vif.bss_conf.txpower;
|
||||
|
||||
/* INT_MIN indicates no power level was set yet */
|
||||
if (*dbm == INT_MIN)
|
||||
return -EINVAL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -938,12 +938,13 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent,
|
||||
|
||||
skip:
|
||||
if (!ingress) {
|
||||
notify_and_destroy(net, skb, n, classid,
|
||||
dev->qdisc, new);
|
||||
old = dev->qdisc;
|
||||
if (new && !new->ops->attach)
|
||||
qdisc_refcount_inc(new);
|
||||
dev->qdisc = new ? : &noop_qdisc;
|
||||
|
||||
notify_and_destroy(net, skb, n, classid, old, new);
|
||||
|
||||
if (new && new->ops->attach)
|
||||
new->ops->attach(new);
|
||||
} else {
|
||||
|
@ -209,12 +209,14 @@ static void partition_struct(tree *fields, unsigned long length, struct partitio
|
||||
|
||||
static void performance_shuffle(tree *newtree, unsigned long length, ranctx *prng_state)
|
||||
{
|
||||
unsigned long i, x;
|
||||
unsigned long i, x, index;
|
||||
struct partition_group size_group[length];
|
||||
unsigned long num_groups = 0;
|
||||
unsigned long randnum;
|
||||
|
||||
partition_struct(newtree, length, (struct partition_group *)&size_group, &num_groups);
|
||||
|
||||
/* FIXME: this group shuffle is currently a no-op. */
|
||||
for (i = num_groups - 1; i > 0; i--) {
|
||||
struct partition_group tmp;
|
||||
randnum = ranval(prng_state) % (i + 1);
|
||||
@ -224,11 +226,14 @@ static void performance_shuffle(tree *newtree, unsigned long length, ranctx *prn
|
||||
}
|
||||
|
||||
for (x = 0; x < num_groups; x++) {
|
||||
for (i = size_group[x].start + size_group[x].length - 1; i > size_group[x].start; i--) {
|
||||
for (index = size_group[x].length - 1; index > 0; index--) {
|
||||
tree tmp;
|
||||
|
||||
i = size_group[x].start + index;
|
||||
if (DECL_BIT_FIELD_TYPE(newtree[i]))
|
||||
continue;
|
||||
randnum = ranval(prng_state) % (i + 1);
|
||||
randnum = ranval(prng_state) % (index + 1);
|
||||
randnum += size_group[x].start;
|
||||
// we could handle this case differently if desired
|
||||
if (DECL_BIT_FIELD_TYPE(newtree[randnum]))
|
||||
continue;
|
||||
|
@ -72,7 +72,7 @@ struct snd_info_private_data {
|
||||
};
|
||||
|
||||
static int snd_info_version_init(void);
|
||||
static void snd_info_disconnect(struct snd_info_entry *entry);
|
||||
static void snd_info_clear_entries(struct snd_info_entry *entry);
|
||||
|
||||
/*
|
||||
|
||||
@ -598,11 +598,16 @@ void snd_info_card_disconnect(struct snd_card *card)
|
||||
{
|
||||
if (!card)
|
||||
return;
|
||||
mutex_lock(&info_mutex);
|
||||
|
||||
proc_remove(card->proc_root_link);
|
||||
card->proc_root_link = NULL;
|
||||
if (card->proc_root)
|
||||
snd_info_disconnect(card->proc_root);
|
||||
proc_remove(card->proc_root->p);
|
||||
|
||||
mutex_lock(&info_mutex);
|
||||
if (card->proc_root)
|
||||
snd_info_clear_entries(card->proc_root);
|
||||
card->proc_root_link = NULL;
|
||||
card->proc_root = NULL;
|
||||
mutex_unlock(&info_mutex);
|
||||
}
|
||||
|
||||
@ -776,15 +781,14 @@ struct snd_info_entry *snd_info_create_card_entry(struct snd_card *card,
|
||||
}
|
||||
EXPORT_SYMBOL(snd_info_create_card_entry);
|
||||
|
||||
static void snd_info_disconnect(struct snd_info_entry *entry)
|
||||
static void snd_info_clear_entries(struct snd_info_entry *entry)
|
||||
{
|
||||
struct snd_info_entry *p;
|
||||
|
||||
if (!entry->p)
|
||||
return;
|
||||
list_for_each_entry(p, &entry->children, list)
|
||||
snd_info_disconnect(p);
|
||||
proc_remove(entry->p);
|
||||
snd_info_clear_entries(p);
|
||||
entry->p = NULL;
|
||||
}
|
||||
|
||||
@ -801,8 +805,9 @@ void snd_info_free_entry(struct snd_info_entry * entry)
|
||||
if (!entry)
|
||||
return;
|
||||
if (entry->p) {
|
||||
proc_remove(entry->p);
|
||||
mutex_lock(&info_mutex);
|
||||
snd_info_disconnect(entry);
|
||||
snd_info_clear_entries(entry);
|
||||
mutex_unlock(&info_mutex);
|
||||
}
|
||||
|
||||
|
@ -241,8 +241,10 @@ struct hdac_stream *snd_hdac_stream_assign(struct hdac_bus *bus,
|
||||
struct hdac_stream *res = NULL;
|
||||
|
||||
/* make a non-zero unique key for the substream */
|
||||
int key = (substream->pcm->device << 16) | (substream->number << 2) |
|
||||
(substream->stream + 1);
|
||||
int key = (substream->number << 2) | (substream->stream + 1);
|
||||
|
||||
if (substream->pcm)
|
||||
key |= (substream->pcm->device << 16);
|
||||
|
||||
list_for_each_entry(azx_dev, &bus->stream_list, list) {
|
||||
if (azx_dev->direction != substream->stream)
|
||||
|
@ -32,8 +32,10 @@ int main(int argc, char **argv)
|
||||
rc = read(fd, buf, sizeof(buf));
|
||||
if (rc != 0) {
|
||||
fprintf(stderr, "Reading a new var should return EOF\n");
|
||||
close(fd);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
close(fd);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user