mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
Merge tag 'v4.9.137' into odroidn2-4.9.y
This is the 4.9.137 stable release
This commit is contained in:
2
Makefile
2
Makefile
@@ -1,6 +1,6 @@
|
||||
VERSION = 4
|
||||
PATCHLEVEL = 9
|
||||
SUBLEVEL = 136
|
||||
SUBLEVEL = 137
|
||||
EXTRAVERSION =
|
||||
NAME = Roaring Lionus
|
||||
|
||||
|
||||
@@ -80,6 +80,22 @@
|
||||
compatible = "arm,cortex-a7";
|
||||
reg = <1>;
|
||||
clock-frequency = <1000000000>;
|
||||
clocks = <&cmu CLK_ARM_CLK>;
|
||||
clock-names = "cpu";
|
||||
#cooling-cells = <2>;
|
||||
|
||||
operating-points = <
|
||||
1000000 1150000
|
||||
900000 1112500
|
||||
800000 1075000
|
||||
700000 1037500
|
||||
600000 1000000
|
||||
500000 962500
|
||||
400000 925000
|
||||
300000 887500
|
||||
200000 850000
|
||||
100000 850000
|
||||
>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -52,8 +52,6 @@
|
||||
400000 975000
|
||||
200000 950000
|
||||
>;
|
||||
cooling-min-level = <4>;
|
||||
cooling-max-level = <2>;
|
||||
#cooling-cells = <2>; /* min followed by max */
|
||||
};
|
||||
|
||||
@@ -61,6 +59,19 @@
|
||||
device_type = "cpu";
|
||||
compatible = "arm,cortex-a9";
|
||||
reg = <0x901>;
|
||||
clocks = <&clock CLK_ARM_CLK>;
|
||||
clock-names = "cpu";
|
||||
clock-latency = <160000>;
|
||||
|
||||
operating-points = <
|
||||
1200000 1250000
|
||||
1000000 1150000
|
||||
800000 1075000
|
||||
500000 975000
|
||||
400000 975000
|
||||
200000 950000
|
||||
>;
|
||||
#cooling-cells = <2>; /* min followed by max */
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -33,8 +33,6 @@
|
||||
clocks = <&clock CLK_ARM_CLK>;
|
||||
clock-names = "cpu";
|
||||
operating-points-v2 = <&cpu0_opp_table>;
|
||||
cooling-min-level = <13>;
|
||||
cooling-max-level = <7>;
|
||||
#cooling-cells = <2>; /* min followed by max */
|
||||
};
|
||||
|
||||
|
||||
@@ -57,38 +57,106 @@
|
||||
device_type = "cpu";
|
||||
compatible = "arm,cortex-a15";
|
||||
reg = <0>;
|
||||
clock-frequency = <1700000000>;
|
||||
clocks = <&clock CLK_ARM_CLK>;
|
||||
clock-names = "cpu";
|
||||
clock-latency = <140000>;
|
||||
|
||||
operating-points = <
|
||||
1700000 1300000
|
||||
1600000 1250000
|
||||
1500000 1225000
|
||||
1400000 1200000
|
||||
1300000 1150000
|
||||
1200000 1125000
|
||||
1100000 1100000
|
||||
1000000 1075000
|
||||
900000 1050000
|
||||
800000 1025000
|
||||
700000 1012500
|
||||
600000 1000000
|
||||
500000 975000
|
||||
400000 950000
|
||||
300000 937500
|
||||
200000 925000
|
||||
>;
|
||||
cooling-min-level = <15>;
|
||||
cooling-max-level = <9>;
|
||||
operating-points-v2 = <&cpu0_opp_table>;
|
||||
#cooling-cells = <2>; /* min followed by max */
|
||||
};
|
||||
cpu@1 {
|
||||
device_type = "cpu";
|
||||
compatible = "arm,cortex-a15";
|
||||
reg = <1>;
|
||||
clock-frequency = <1700000000>;
|
||||
clocks = <&clock CLK_ARM_CLK>;
|
||||
clock-names = "cpu";
|
||||
operating-points-v2 = <&cpu0_opp_table>;
|
||||
#cooling-cells = <2>; /* min followed by max */
|
||||
};
|
||||
};
|
||||
|
||||
cpu0_opp_table: opp_table0 {
|
||||
compatible = "operating-points-v2";
|
||||
opp-shared;
|
||||
|
||||
opp-200000000 {
|
||||
opp-hz = /bits/ 64 <200000000>;
|
||||
opp-microvolt = <925000>;
|
||||
clock-latency-ns = <140000>;
|
||||
};
|
||||
opp-300000000 {
|
||||
opp-hz = /bits/ 64 <300000000>;
|
||||
opp-microvolt = <937500>;
|
||||
clock-latency-ns = <140000>;
|
||||
};
|
||||
opp-400000000 {
|
||||
opp-hz = /bits/ 64 <400000000>;
|
||||
opp-microvolt = <950000>;
|
||||
clock-latency-ns = <140000>;
|
||||
};
|
||||
opp-500000000 {
|
||||
opp-hz = /bits/ 64 <500000000>;
|
||||
opp-microvolt = <975000>;
|
||||
clock-latency-ns = <140000>;
|
||||
};
|
||||
opp-600000000 {
|
||||
opp-hz = /bits/ 64 <600000000>;
|
||||
opp-microvolt = <1000000>;
|
||||
clock-latency-ns = <140000>;
|
||||
};
|
||||
opp-700000000 {
|
||||
opp-hz = /bits/ 64 <700000000>;
|
||||
opp-microvolt = <1012500>;
|
||||
clock-latency-ns = <140000>;
|
||||
};
|
||||
opp-800000000 {
|
||||
opp-hz = /bits/ 64 <800000000>;
|
||||
opp-microvolt = <1025000>;
|
||||
clock-latency-ns = <140000>;
|
||||
};
|
||||
opp-900000000 {
|
||||
opp-hz = /bits/ 64 <900000000>;
|
||||
opp-microvolt = <1050000>;
|
||||
clock-latency-ns = <140000>;
|
||||
};
|
||||
opp-1000000000 {
|
||||
opp-hz = /bits/ 64 <1000000000>;
|
||||
opp-microvolt = <1075000>;
|
||||
clock-latency-ns = <140000>;
|
||||
opp-suspend;
|
||||
};
|
||||
opp-1100000000 {
|
||||
opp-hz = /bits/ 64 <1100000000>;
|
||||
opp-microvolt = <1100000>;
|
||||
clock-latency-ns = <140000>;
|
||||
};
|
||||
opp-1200000000 {
|
||||
opp-hz = /bits/ 64 <1200000000>;
|
||||
opp-microvolt = <1125000>;
|
||||
clock-latency-ns = <140000>;
|
||||
};
|
||||
opp-1300000000 {
|
||||
opp-hz = /bits/ 64 <1300000000>;
|
||||
opp-microvolt = <1150000>;
|
||||
clock-latency-ns = <140000>;
|
||||
};
|
||||
opp-1400000000 {
|
||||
opp-hz = /bits/ 64 <1400000000>;
|
||||
opp-microvolt = <1200000>;
|
||||
clock-latency-ns = <140000>;
|
||||
};
|
||||
opp-1500000000 {
|
||||
opp-hz = /bits/ 64 <1500000000>;
|
||||
opp-microvolt = <1225000>;
|
||||
clock-latency-ns = <140000>;
|
||||
};
|
||||
opp-1600000000 {
|
||||
opp-hz = /bits/ 64 <1600000000>;
|
||||
opp-microvolt = <1250000>;
|
||||
clock-latency-ns = <140000>;
|
||||
};
|
||||
opp-1700000000 {
|
||||
opp-hz = /bits/ 64 <1700000000>;
|
||||
opp-microvolt = <1300000>;
|
||||
clock-latency-ns = <140000>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -33,8 +33,6 @@
|
||||
clock-frequency = <1800000000>;
|
||||
cci-control-port = <&cci_control1>;
|
||||
operating-points-v2 = <&cluster_a15_opp_table>;
|
||||
cooling-min-level = <0>;
|
||||
cooling-max-level = <11>;
|
||||
#cooling-cells = <2>; /* min followed by max */
|
||||
};
|
||||
|
||||
@@ -45,8 +43,6 @@
|
||||
clock-frequency = <1800000000>;
|
||||
cci-control-port = <&cci_control1>;
|
||||
operating-points-v2 = <&cluster_a15_opp_table>;
|
||||
cooling-min-level = <0>;
|
||||
cooling-max-level = <11>;
|
||||
#cooling-cells = <2>; /* min followed by max */
|
||||
};
|
||||
|
||||
@@ -57,8 +53,6 @@
|
||||
clock-frequency = <1800000000>;
|
||||
cci-control-port = <&cci_control1>;
|
||||
operating-points-v2 = <&cluster_a15_opp_table>;
|
||||
cooling-min-level = <0>;
|
||||
cooling-max-level = <11>;
|
||||
#cooling-cells = <2>; /* min followed by max */
|
||||
};
|
||||
|
||||
@@ -69,8 +63,6 @@
|
||||
clock-frequency = <1800000000>;
|
||||
cci-control-port = <&cci_control1>;
|
||||
operating-points-v2 = <&cluster_a15_opp_table>;
|
||||
cooling-min-level = <0>;
|
||||
cooling-max-level = <11>;
|
||||
#cooling-cells = <2>; /* min followed by max */
|
||||
};
|
||||
|
||||
@@ -82,8 +74,6 @@
|
||||
clock-frequency = <1000000000>;
|
||||
cci-control-port = <&cci_control0>;
|
||||
operating-points-v2 = <&cluster_a7_opp_table>;
|
||||
cooling-min-level = <0>;
|
||||
cooling-max-level = <7>;
|
||||
#cooling-cells = <2>; /* min followed by max */
|
||||
};
|
||||
|
||||
@@ -94,8 +84,6 @@
|
||||
clock-frequency = <1000000000>;
|
||||
cci-control-port = <&cci_control0>;
|
||||
operating-points-v2 = <&cluster_a7_opp_table>;
|
||||
cooling-min-level = <0>;
|
||||
cooling-max-level = <7>;
|
||||
#cooling-cells = <2>; /* min followed by max */
|
||||
};
|
||||
|
||||
@@ -106,8 +94,6 @@
|
||||
clock-frequency = <1000000000>;
|
||||
cci-control-port = <&cci_control0>;
|
||||
operating-points-v2 = <&cluster_a7_opp_table>;
|
||||
cooling-min-level = <0>;
|
||||
cooling-max-level = <7>;
|
||||
#cooling-cells = <2>; /* min followed by max */
|
||||
};
|
||||
|
||||
@@ -118,8 +104,6 @@
|
||||
clock-frequency = <1000000000>;
|
||||
cci-control-port = <&cci_control0>;
|
||||
operating-points-v2 = <&cluster_a7_opp_table>;
|
||||
cooling-min-level = <0>;
|
||||
cooling-max-level = <7>;
|
||||
#cooling-cells = <2>; /* min followed by max */
|
||||
};
|
||||
};
|
||||
|
||||
@@ -32,8 +32,6 @@
|
||||
clock-frequency = <1000000000>;
|
||||
cci-control-port = <&cci_control0>;
|
||||
operating-points-v2 = <&cluster_a7_opp_table>;
|
||||
cooling-min-level = <0>;
|
||||
cooling-max-level = <11>;
|
||||
#cooling-cells = <2>; /* min followed by max */
|
||||
};
|
||||
|
||||
@@ -44,8 +42,6 @@
|
||||
clock-frequency = <1000000000>;
|
||||
cci-control-port = <&cci_control0>;
|
||||
operating-points-v2 = <&cluster_a7_opp_table>;
|
||||
cooling-min-level = <0>;
|
||||
cooling-max-level = <11>;
|
||||
#cooling-cells = <2>; /* min followed by max */
|
||||
};
|
||||
|
||||
@@ -56,8 +52,6 @@
|
||||
clock-frequency = <1000000000>;
|
||||
cci-control-port = <&cci_control0>;
|
||||
operating-points-v2 = <&cluster_a7_opp_table>;
|
||||
cooling-min-level = <0>;
|
||||
cooling-max-level = <11>;
|
||||
#cooling-cells = <2>; /* min followed by max */
|
||||
};
|
||||
|
||||
@@ -68,8 +62,6 @@
|
||||
clock-frequency = <1000000000>;
|
||||
cci-control-port = <&cci_control0>;
|
||||
operating-points-v2 = <&cluster_a7_opp_table>;
|
||||
cooling-min-level = <0>;
|
||||
cooling-max-level = <11>;
|
||||
#cooling-cells = <2>; /* min followed by max */
|
||||
};
|
||||
|
||||
@@ -81,8 +73,6 @@
|
||||
clock-frequency = <1800000000>;
|
||||
cci-control-port = <&cci_control1>;
|
||||
operating-points-v2 = <&cluster_a15_opp_table>;
|
||||
cooling-min-level = <0>;
|
||||
cooling-max-level = <15>;
|
||||
#cooling-cells = <2>; /* min followed by max */
|
||||
};
|
||||
|
||||
@@ -93,8 +83,6 @@
|
||||
clock-frequency = <1800000000>;
|
||||
cci-control-port = <&cci_control1>;
|
||||
operating-points-v2 = <&cluster_a15_opp_table>;
|
||||
cooling-min-level = <0>;
|
||||
cooling-max-level = <15>;
|
||||
#cooling-cells = <2>; /* min followed by max */
|
||||
};
|
||||
|
||||
@@ -105,8 +93,6 @@
|
||||
clock-frequency = <1800000000>;
|
||||
cci-control-port = <&cci_control1>;
|
||||
operating-points-v2 = <&cluster_a15_opp_table>;
|
||||
cooling-min-level = <0>;
|
||||
cooling-max-level = <15>;
|
||||
#cooling-cells = <2>; /* min followed by max */
|
||||
};
|
||||
|
||||
@@ -117,8 +103,6 @@
|
||||
clock-frequency = <1800000000>;
|
||||
cci-control-port = <&cci_control1>;
|
||||
operating-points-v2 = <&cluster_a15_opp_table>;
|
||||
cooling-min-level = <0>;
|
||||
cooling-max-level = <15>;
|
||||
#cooling-cells = <2>; /* min followed by max */
|
||||
};
|
||||
};
|
||||
|
||||
@@ -249,7 +249,7 @@
|
||||
|
||||
sysmgr: sysmgr@ffd12000 {
|
||||
compatible = "altr,sys-mgr", "syscon";
|
||||
reg = <0xffd12000 0x1000>;
|
||||
reg = <0xffd12000 0x228>;
|
||||
};
|
||||
|
||||
/* Local timer */
|
||||
|
||||
@@ -11,7 +11,7 @@ lib-y := bitops.o clear_user.o delay.o copy_from_user.o \
|
||||
# when supported by the CPU. Result and argument registers are handled
|
||||
# correctly, based on the function prototype.
|
||||
lib-$(CONFIG_ARM64_LSE_ATOMICS) += atomic_ll_sc.o
|
||||
CFLAGS_atomic_ll_sc.o := -fcall-used-x0 -ffixed-x1 -ffixed-x2 \
|
||||
CFLAGS_atomic_ll_sc.o := -ffixed-x1 -ffixed-x2 \
|
||||
-ffixed-x3 -ffixed-x4 -ffixed-x5 -ffixed-x6 \
|
||||
-ffixed-x7 -fcall-saved-x8 -fcall-saved-x9 \
|
||||
-fcall-saved-x10 -fcall-saved-x11 -fcall-saved-x12 \
|
||||
|
||||
@@ -67,7 +67,7 @@ void (*cvmx_override_pko_queue_priority) (int pko_port,
|
||||
void (*cvmx_override_ipd_port_setup) (int ipd_port);
|
||||
|
||||
/* Port count per interface */
|
||||
static int interface_port_count[5];
|
||||
static int interface_port_count[9];
|
||||
|
||||
/* Port last configured link info index by IPD/PKO port */
|
||||
static cvmx_helper_link_info_t
|
||||
|
||||
@@ -185,7 +185,7 @@
|
||||
bv,n 0(%r3)
|
||||
nop
|
||||
.word 0 /* checksum (will be patched) */
|
||||
.word PA(os_hpmc) /* address of handler */
|
||||
.word 0 /* address of handler */
|
||||
.word 0 /* length of handler */
|
||||
.endm
|
||||
|
||||
|
||||
@@ -826,7 +826,8 @@ void __init initialize_ivt(const void *iva)
|
||||
for (i = 0; i < 8; i++)
|
||||
*ivap++ = 0;
|
||||
|
||||
/* Compute Checksum for HPMC handler */
|
||||
/* Setup IVA and compute checksum for HPMC handler */
|
||||
ivap[6] = (u32)__pa(os_hpmc);
|
||||
length = os_hpmc_size;
|
||||
ivap[7] = length;
|
||||
|
||||
|
||||
@@ -491,12 +491,8 @@ static void __init map_pages(unsigned long start_vaddr,
|
||||
pte = pte_mkhuge(pte);
|
||||
}
|
||||
|
||||
if (address >= end_paddr) {
|
||||
if (force)
|
||||
break;
|
||||
else
|
||||
pte_val(pte) = 0;
|
||||
}
|
||||
if (address >= end_paddr)
|
||||
break;
|
||||
|
||||
set_pte(pg_table, pte);
|
||||
|
||||
|
||||
@@ -392,7 +392,14 @@ extern struct bus_type mpic_subsys;
|
||||
#define MPIC_REGSET_TSI108 MPIC_REGSET(1) /* Tsi108/109 PIC */
|
||||
|
||||
/* Get the version of primary MPIC */
|
||||
#ifdef CONFIG_MPIC
|
||||
extern u32 fsl_mpic_primary_get_version(void);
|
||||
#else
|
||||
static inline u32 fsl_mpic_primary_get_version(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Allocate the controller structure and setup the linux irq descs
|
||||
* for the range if interrupts passed in. No HW initialization is
|
||||
|
||||
@@ -174,17 +174,19 @@ static void fill_hdr(struct sthyi_sctns *sctns)
|
||||
static void fill_stsi_mac(struct sthyi_sctns *sctns,
|
||||
struct sysinfo_1_1_1 *sysinfo)
|
||||
{
|
||||
sclp_ocf_cpc_name_copy(sctns->mac.infmname);
|
||||
if (*(u64 *)sctns->mac.infmname != 0)
|
||||
sctns->mac.infmval1 |= MAC_NAME_VLD;
|
||||
|
||||
if (stsi(sysinfo, 1, 1, 1))
|
||||
return;
|
||||
|
||||
sclp_ocf_cpc_name_copy(sctns->mac.infmname);
|
||||
|
||||
memcpy(sctns->mac.infmtype, sysinfo->type, sizeof(sctns->mac.infmtype));
|
||||
memcpy(sctns->mac.infmmanu, sysinfo->manufacturer, sizeof(sctns->mac.infmmanu));
|
||||
memcpy(sctns->mac.infmpman, sysinfo->plant, sizeof(sctns->mac.infmpman));
|
||||
memcpy(sctns->mac.infmseq, sysinfo->sequence, sizeof(sctns->mac.infmseq));
|
||||
|
||||
sctns->mac.infmval1 |= MAC_ID_VLD | MAC_NAME_VLD;
|
||||
sctns->mac.infmval1 |= MAC_ID_VLD;
|
||||
}
|
||||
|
||||
static void fill_stsi_par(struct sthyi_sctns *sctns,
|
||||
|
||||
@@ -27,7 +27,7 @@ typedef struct {
|
||||
unsigned short sock_id; /* physical package */
|
||||
unsigned short core_id;
|
||||
unsigned short max_cache_id; /* groupings of highest shared cache */
|
||||
unsigned short proc_id; /* strand (aka HW thread) id */
|
||||
signed short proc_id; /* strand (aka HW thread) id */
|
||||
} cpuinfo_sparc;
|
||||
|
||||
DECLARE_PER_CPU(cpuinfo_sparc, __cpu_data);
|
||||
|
||||
@@ -926,6 +926,8 @@ static void read_in_all_counters(struct cpu_hw_events *cpuc)
|
||||
sparc_perf_event_update(cp, &cp->hw,
|
||||
cpuc->current_idx[i]);
|
||||
cpuc->current_idx[i] = PIC_NO_INDEX;
|
||||
if (cp->hw.state & PERF_HES_STOPPED)
|
||||
cp->hw.state |= PERF_HES_ARCH;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -958,10 +960,12 @@ static void calculate_single_pcr(struct cpu_hw_events *cpuc)
|
||||
|
||||
enc = perf_event_get_enc(cpuc->events[i]);
|
||||
cpuc->pcr[0] &= ~mask_for_index(idx);
|
||||
if (hwc->state & PERF_HES_STOPPED)
|
||||
if (hwc->state & PERF_HES_ARCH) {
|
||||
cpuc->pcr[0] |= nop_for_index(idx);
|
||||
else
|
||||
} else {
|
||||
cpuc->pcr[0] |= event_encoding(enc, idx);
|
||||
hwc->state = 0;
|
||||
}
|
||||
}
|
||||
out:
|
||||
cpuc->pcr[0] |= cpuc->event[0]->hw.config_base;
|
||||
@@ -987,6 +991,9 @@ static void calculate_multiple_pcrs(struct cpu_hw_events *cpuc)
|
||||
|
||||
cpuc->current_idx[i] = idx;
|
||||
|
||||
if (cp->hw.state & PERF_HES_ARCH)
|
||||
continue;
|
||||
|
||||
sparc_pmu_start(cp, PERF_EF_RELOAD);
|
||||
}
|
||||
out:
|
||||
@@ -1078,6 +1085,8 @@ static void sparc_pmu_start(struct perf_event *event, int flags)
|
||||
event->hw.state = 0;
|
||||
|
||||
sparc_pmu_enable_event(cpuc, &event->hw, idx);
|
||||
|
||||
perf_event_update_userpage(event);
|
||||
}
|
||||
|
||||
static void sparc_pmu_stop(struct perf_event *event, int flags)
|
||||
@@ -1370,9 +1379,9 @@ static int sparc_pmu_add(struct perf_event *event, int ef_flags)
|
||||
cpuc->events[n0] = event->hw.event_base;
|
||||
cpuc->current_idx[n0] = PIC_NO_INDEX;
|
||||
|
||||
event->hw.state = PERF_HES_UPTODATE;
|
||||
event->hw.state = PERF_HES_UPTODATE | PERF_HES_STOPPED;
|
||||
if (!(ef_flags & PERF_EF_START))
|
||||
event->hw.state |= PERF_HES_STOPPED;
|
||||
event->hw.state |= PERF_HES_ARCH;
|
||||
|
||||
/*
|
||||
* If group events scheduling transaction was started,
|
||||
|
||||
@@ -390,6 +390,13 @@ int main(int argc, char ** argv)
|
||||
die("Unable to mmap '%s': %m", argv[2]);
|
||||
/* Number of 16-byte paragraphs, including space for a 4-byte CRC */
|
||||
sys_size = (sz + 15 + 4) / 16;
|
||||
#ifdef CONFIG_EFI_STUB
|
||||
/*
|
||||
* COFF requires minimum 32-byte alignment of sections, and
|
||||
* adding a signature is problematic without that alignment.
|
||||
*/
|
||||
sys_size = (sys_size + 1) & ~1;
|
||||
#endif
|
||||
|
||||
/* Patch the setup code with the appropriate size parameters */
|
||||
buf[0x1f1] = setup_sectors-1;
|
||||
|
||||
@@ -213,6 +213,7 @@
|
||||
#define X86_FEATURE_STIBP ( 7*32+27) /* Single Thread Indirect Branch Predictors */
|
||||
#define X86_FEATURE_ZEN ( 7*32+28) /* "" CPU is AMD family 0x17 (Zen) */
|
||||
#define X86_FEATURE_L1TF_PTEINV ( 7*32+29) /* "" L1TF workaround PTE inversion */
|
||||
#define X86_FEATURE_IBRS_ENHANCED ( 7*32+30) /* Enhanced IBRS */
|
||||
|
||||
/* Virtualization flags: Linux defined, word 8 */
|
||||
#define X86_FEATURE_TPR_SHADOW ( 8*32+ 0) /* Intel TPR Shadow */
|
||||
|
||||
@@ -215,6 +215,7 @@ enum spectre_v2_mitigation {
|
||||
SPECTRE_V2_RETPOLINE_GENERIC,
|
||||
SPECTRE_V2_RETPOLINE_AMD,
|
||||
SPECTRE_V2_IBRS,
|
||||
SPECTRE_V2_IBRS_ENHANCED,
|
||||
};
|
||||
|
||||
/* The Speculative Store Bypass disable variants */
|
||||
|
||||
@@ -30,6 +30,11 @@ static __init int set_corruption_check(char *arg)
|
||||
ssize_t ret;
|
||||
unsigned long val;
|
||||
|
||||
if (!arg) {
|
||||
pr_err("memory_corruption_check config string not provided\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = kstrtoul(arg, 10, &val);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -44,6 +49,11 @@ static __init int set_corruption_check_period(char *arg)
|
||||
ssize_t ret;
|
||||
unsigned long val;
|
||||
|
||||
if (!arg) {
|
||||
pr_err("memory_corruption_check_period config string not provided\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = kstrtoul(arg, 10, &val);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -58,6 +68,11 @@ static __init int set_corruption_check_size(char *arg)
|
||||
char *end;
|
||||
unsigned size;
|
||||
|
||||
if (!arg) {
|
||||
pr_err("memory_corruption_check_size config string not provided\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
size = memparse(arg, &end);
|
||||
|
||||
if (*end == '\0')
|
||||
|
||||
@@ -33,12 +33,10 @@ static void __init spectre_v2_select_mitigation(void);
|
||||
static void __init ssb_select_mitigation(void);
|
||||
static void __init l1tf_select_mitigation(void);
|
||||
|
||||
/*
|
||||
* Our boot-time value of the SPEC_CTRL MSR. We read it once so that any
|
||||
* writes to SPEC_CTRL contain whatever reserved bits have been set.
|
||||
*/
|
||||
u64 __ro_after_init x86_spec_ctrl_base;
|
||||
/* The base value of the SPEC_CTRL MSR that always has to be preserved. */
|
||||
u64 x86_spec_ctrl_base;
|
||||
EXPORT_SYMBOL_GPL(x86_spec_ctrl_base);
|
||||
static DEFINE_MUTEX(spec_ctrl_mutex);
|
||||
|
||||
/*
|
||||
* The vendor and possibly platform specific bits which can be modified in
|
||||
@@ -139,6 +137,7 @@ static const char *spectre_v2_strings[] = {
|
||||
[SPECTRE_V2_RETPOLINE_MINIMAL_AMD] = "Vulnerable: Minimal AMD ASM retpoline",
|
||||
[SPECTRE_V2_RETPOLINE_GENERIC] = "Mitigation: Full generic retpoline",
|
||||
[SPECTRE_V2_RETPOLINE_AMD] = "Mitigation: Full AMD retpoline",
|
||||
[SPECTRE_V2_IBRS_ENHANCED] = "Mitigation: Enhanced IBRS",
|
||||
};
|
||||
|
||||
#undef pr_fmt
|
||||
@@ -321,6 +320,46 @@ static enum spectre_v2_mitigation_cmd __init spectre_v2_parse_cmdline(void)
|
||||
return cmd;
|
||||
}
|
||||
|
||||
static bool stibp_needed(void)
|
||||
{
|
||||
if (spectre_v2_enabled == SPECTRE_V2_NONE)
|
||||
return false;
|
||||
|
||||
if (!boot_cpu_has(X86_FEATURE_STIBP))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void update_stibp_msr(void *info)
|
||||
{
|
||||
wrmsrl(MSR_IA32_SPEC_CTRL, x86_spec_ctrl_base);
|
||||
}
|
||||
|
||||
void arch_smt_update(void)
|
||||
{
|
||||
u64 mask;
|
||||
|
||||
if (!stibp_needed())
|
||||
return;
|
||||
|
||||
mutex_lock(&spec_ctrl_mutex);
|
||||
mask = x86_spec_ctrl_base;
|
||||
if (cpu_smt_control == CPU_SMT_ENABLED)
|
||||
mask |= SPEC_CTRL_STIBP;
|
||||
else
|
||||
mask &= ~SPEC_CTRL_STIBP;
|
||||
|
||||
if (mask != x86_spec_ctrl_base) {
|
||||
pr_info("Spectre v2 cross-process SMT mitigation: %s STIBP\n",
|
||||
cpu_smt_control == CPU_SMT_ENABLED ?
|
||||
"Enabling" : "Disabling");
|
||||
x86_spec_ctrl_base = mask;
|
||||
on_each_cpu(update_stibp_msr, NULL, 1);
|
||||
}
|
||||
mutex_unlock(&spec_ctrl_mutex);
|
||||
}
|
||||
|
||||
static void __init spectre_v2_select_mitigation(void)
|
||||
{
|
||||
enum spectre_v2_mitigation_cmd cmd = spectre_v2_parse_cmdline();
|
||||
@@ -340,6 +379,13 @@ static void __init spectre_v2_select_mitigation(void)
|
||||
|
||||
case SPECTRE_V2_CMD_FORCE:
|
||||
case SPECTRE_V2_CMD_AUTO:
|
||||
if (boot_cpu_has(X86_FEATURE_IBRS_ENHANCED)) {
|
||||
mode = SPECTRE_V2_IBRS_ENHANCED;
|
||||
/* Force it so VMEXIT will restore correctly */
|
||||
x86_spec_ctrl_base |= SPEC_CTRL_IBRS;
|
||||
wrmsrl(MSR_IA32_SPEC_CTRL, x86_spec_ctrl_base);
|
||||
goto specv2_set_mode;
|
||||
}
|
||||
if (IS_ENABLED(CONFIG_RETPOLINE))
|
||||
goto retpoline_auto;
|
||||
break;
|
||||
@@ -377,6 +423,7 @@ retpoline_auto:
|
||||
setup_force_cpu_cap(X86_FEATURE_RETPOLINE);
|
||||
}
|
||||
|
||||
specv2_set_mode:
|
||||
spectre_v2_enabled = mode;
|
||||
pr_info("%s\n", spectre_v2_strings[mode]);
|
||||
|
||||
@@ -399,12 +446,22 @@ retpoline_auto:
|
||||
|
||||
/*
|
||||
* Retpoline means the kernel is safe because it has no indirect
|
||||
* branches. But firmware isn't, so use IBRS to protect that.
|
||||
* branches. Enhanced IBRS protects firmware too, so, enable restricted
|
||||
* speculation around firmware calls only when Enhanced IBRS isn't
|
||||
* supported.
|
||||
*
|
||||
* Use "mode" to check Enhanced IBRS instead of boot_cpu_has(), because
|
||||
* the user might select retpoline on the kernel command line and if
|
||||
* the CPU supports Enhanced IBRS, kernel might un-intentionally not
|
||||
* enable IBRS around firmware calls.
|
||||
*/
|
||||
if (boot_cpu_has(X86_FEATURE_IBRS)) {
|
||||
if (boot_cpu_has(X86_FEATURE_IBRS) && mode != SPECTRE_V2_IBRS_ENHANCED) {
|
||||
setup_force_cpu_cap(X86_FEATURE_USE_IBRS_FW);
|
||||
pr_info("Enabling Restricted Speculation for firmware calls\n");
|
||||
}
|
||||
|
||||
/* Enable STIBP if appropriate */
|
||||
arch_smt_update();
|
||||
}
|
||||
|
||||
#undef pr_fmt
|
||||
@@ -797,6 +854,8 @@ static ssize_t l1tf_show_state(char *buf)
|
||||
static ssize_t cpu_show_common(struct device *dev, struct device_attribute *attr,
|
||||
char *buf, unsigned int bug)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (!boot_cpu_has_bug(bug))
|
||||
return sprintf(buf, "Not affected\n");
|
||||
|
||||
@@ -811,10 +870,12 @@ static ssize_t cpu_show_common(struct device *dev, struct device_attribute *attr
|
||||
return sprintf(buf, "Mitigation: __user pointer sanitization\n");
|
||||
|
||||
case X86_BUG_SPECTRE_V2:
|
||||
return sprintf(buf, "%s%s%s%s\n", spectre_v2_strings[spectre_v2_enabled],
|
||||
ret = sprintf(buf, "%s%s%s%s%s\n", spectre_v2_strings[spectre_v2_enabled],
|
||||
boot_cpu_has(X86_FEATURE_USE_IBPB) ? ", IBPB" : "",
|
||||
boot_cpu_has(X86_FEATURE_USE_IBRS_FW) ? ", IBRS_FW" : "",
|
||||
(x86_spec_ctrl_base & SPEC_CTRL_STIBP) ? ", STIBP" : "",
|
||||
spectre_v2_module_string());
|
||||
return ret;
|
||||
|
||||
case X86_BUG_SPEC_STORE_BYPASS:
|
||||
return sprintf(buf, "%s\n", ssb_strings[ssb_mode]);
|
||||
|
||||
@@ -959,6 +959,9 @@ static void __init cpu_set_bug_bits(struct cpuinfo_x86 *c)
|
||||
setup_force_cpu_bug(X86_BUG_SPECTRE_V1);
|
||||
setup_force_cpu_bug(X86_BUG_SPECTRE_V2);
|
||||
|
||||
if (ia32_cap & ARCH_CAP_IBRS_ALL)
|
||||
setup_force_cpu_cap(X86_FEATURE_IBRS_ENHANCED);
|
||||
|
||||
if (x86_match_cpu(cpu_no_meltdown))
|
||||
return;
|
||||
|
||||
|
||||
@@ -309,7 +309,6 @@ static int __fpu__restore_sig(void __user *buf, void __user *buf_fx, int size)
|
||||
* thread's fpu state, reconstruct fxstate from the fsave
|
||||
* header. Sanitize the copied state etc.
|
||||
*/
|
||||
struct fpu *fpu = &tsk->thread.fpu;
|
||||
struct user_i387_ia32_struct env;
|
||||
int err = 0;
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
#include <asm/msr.h>
|
||||
#include <asm/olpc.h>
|
||||
#include <asm/x86_init.h>
|
||||
|
||||
static void rtc_wake_on(struct device *dev)
|
||||
{
|
||||
@@ -75,6 +76,8 @@ static int __init xo1_rtc_init(void)
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
x86_platform.legacy.rtc = 0;
|
||||
|
||||
device_init_wakeup(&xo1_rtc_device.dev, 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <linux/log2.h>
|
||||
#include <linux/gfp.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/atomic.h>
|
||||
|
||||
#include <asm/paravirt.h>
|
||||
|
||||
@@ -19,6 +20,7 @@
|
||||
|
||||
static DEFINE_PER_CPU(int, lock_kicker_irq) = -1;
|
||||
static DEFINE_PER_CPU(char *, irq_name);
|
||||
static DEFINE_PER_CPU(atomic_t, xen_qlock_wait_nest);
|
||||
static bool xen_pvspin = true;
|
||||
|
||||
#include <asm/qspinlock.h>
|
||||
@@ -40,33 +42,24 @@ static void xen_qlock_kick(int cpu)
|
||||
static void xen_qlock_wait(u8 *byte, u8 val)
|
||||
{
|
||||
int irq = __this_cpu_read(lock_kicker_irq);
|
||||
atomic_t *nest_cnt = this_cpu_ptr(&xen_qlock_wait_nest);
|
||||
|
||||
/* If kicker interrupts not initialized yet, just spin */
|
||||
if (irq == -1)
|
||||
if (irq == -1 || in_nmi())
|
||||
return;
|
||||
|
||||
/* clear pending */
|
||||
xen_clear_irq_pending(irq);
|
||||
barrier();
|
||||
/* Detect reentry. */
|
||||
atomic_inc(nest_cnt);
|
||||
|
||||
/*
|
||||
* We check the byte value after clearing pending IRQ to make sure
|
||||
* that we won't miss a wakeup event because of the clearing.
|
||||
*
|
||||
* The sync_clear_bit() call in xen_clear_irq_pending() is atomic.
|
||||
* So it is effectively a memory barrier for x86.
|
||||
*/
|
||||
if (READ_ONCE(*byte) != val)
|
||||
return;
|
||||
/* If irq pending already and no nested call clear it. */
|
||||
if (atomic_read(nest_cnt) == 1 && xen_test_irq_pending(irq)) {
|
||||
xen_clear_irq_pending(irq);
|
||||
} else if (READ_ONCE(*byte) == val) {
|
||||
/* Block until irq becomes pending (or a spurious wakeup) */
|
||||
xen_poll_irq(irq);
|
||||
}
|
||||
|
||||
/*
|
||||
* If an interrupt happens here, it will leave the wakeup irq
|
||||
* pending, which will cause xen_poll_irq() to return
|
||||
* immediately.
|
||||
*/
|
||||
|
||||
/* Block until irq becomes pending (or perhaps a spurious wakeup) */
|
||||
xen_poll_irq(irq);
|
||||
atomic_dec(nest_cnt);
|
||||
}
|
||||
|
||||
static irqreturn_t dummy_handler(int irq, void *dev_id)
|
||||
|
||||
@@ -132,7 +132,12 @@ static inline int get_index128(be128 *block)
|
||||
return x + ffz(val);
|
||||
}
|
||||
|
||||
return x;
|
||||
/*
|
||||
* If we get here, then x == 128 and we are incrementing the counter
|
||||
* from all ones to all zeros. This means we must return index 127, i.e.
|
||||
* the one corresponding to key2*{ 1,...,1 }.
|
||||
*/
|
||||
return 127;
|
||||
}
|
||||
|
||||
static int crypt(struct blkcipher_desc *d,
|
||||
|
||||
@@ -729,6 +729,9 @@ static void test_ahash_speed_common(const char *algo, unsigned int secs,
|
||||
break;
|
||||
}
|
||||
|
||||
if (speed[i].klen)
|
||||
crypto_ahash_setkey(tfm, tvmem[0], speed[i].klen);
|
||||
|
||||
pr_info("test%3u "
|
||||
"(%5u byte blocks,%5u bytes per update,%4u updates): ",
|
||||
i, speed[i].blen, speed[i].plen, speed[i].blen / speed[i].plen);
|
||||
|
||||
@@ -278,9 +278,11 @@ static const struct acpi_device_id acpi_lpss_device_ids[] = {
|
||||
{ "INT33FC", },
|
||||
|
||||
/* Braswell LPSS devices */
|
||||
{ "80862286", LPSS_ADDR(lpss_dma_desc) },
|
||||
{ "80862288", LPSS_ADDR(bsw_pwm_dev_desc) },
|
||||
{ "8086228A", LPSS_ADDR(bsw_uart_dev_desc) },
|
||||
{ "8086228E", LPSS_ADDR(bsw_spi_dev_desc) },
|
||||
{ "808622C0", LPSS_ADDR(lpss_dma_desc) },
|
||||
{ "808622C1", LPSS_ADDR(bsw_i2c_dev_desc) },
|
||||
|
||||
/* Broadwell LPSS devices */
|
||||
|
||||
@@ -1933,6 +1933,11 @@ static int __init atari_floppy_init (void)
|
||||
unit[i].disk = alloc_disk(1);
|
||||
if (!unit[i].disk)
|
||||
goto Enomem;
|
||||
|
||||
unit[i].disk->queue = blk_init_queue(do_fd_request,
|
||||
&ataflop_lock);
|
||||
if (!unit[i].disk->queue)
|
||||
goto Enomem;
|
||||
}
|
||||
|
||||
if (UseTrackbuffer < 0)
|
||||
@@ -1964,10 +1969,6 @@ static int __init atari_floppy_init (void)
|
||||
sprintf(unit[i].disk->disk_name, "fd%d", i);
|
||||
unit[i].disk->fops = &floppy_fops;
|
||||
unit[i].disk->private_data = &unit[i];
|
||||
unit[i].disk->queue = blk_init_queue(do_fd_request,
|
||||
&ataflop_lock);
|
||||
if (!unit[i].disk->queue)
|
||||
goto Enomem;
|
||||
set_capacity(unit[i].disk, MAX_DISK_SIZE * 2);
|
||||
add_disk(unit[i].disk);
|
||||
}
|
||||
@@ -1982,13 +1983,17 @@ static int __init atari_floppy_init (void)
|
||||
|
||||
return 0;
|
||||
Enomem:
|
||||
while (i--) {
|
||||
struct request_queue *q = unit[i].disk->queue;
|
||||
do {
|
||||
struct gendisk *disk = unit[i].disk;
|
||||
|
||||
put_disk(unit[i].disk);
|
||||
if (q)
|
||||
blk_cleanup_queue(q);
|
||||
}
|
||||
if (disk) {
|
||||
if (disk->queue) {
|
||||
blk_cleanup_queue(disk->queue);
|
||||
disk->queue = NULL;
|
||||
}
|
||||
put_disk(unit[i].disk);
|
||||
}
|
||||
} while (i--);
|
||||
|
||||
unregister_blkdev(FLOPPY_MAJOR, "fd");
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -868,8 +868,17 @@ static int swim_floppy_init(struct swim_priv *swd)
|
||||
|
||||
exit_put_disks:
|
||||
unregister_blkdev(FLOPPY_MAJOR, "fd");
|
||||
while (drive--)
|
||||
put_disk(swd->unit[drive].disk);
|
||||
do {
|
||||
struct gendisk *disk = swd->unit[drive].disk;
|
||||
|
||||
if (disk) {
|
||||
if (disk->queue) {
|
||||
blk_cleanup_queue(disk->queue);
|
||||
disk->queue = NULL;
|
||||
}
|
||||
put_disk(disk);
|
||||
}
|
||||
} while (drive--);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
@@ -2524,6 +2524,9 @@ static int blkfront_remove(struct xenbus_device *xbdev)
|
||||
|
||||
dev_dbg(&xbdev->dev, "%s removed", xbdev->nodename);
|
||||
|
||||
if (!info)
|
||||
return 0;
|
||||
|
||||
blkif_free(info, 0);
|
||||
|
||||
mutex_lock(&info->mutex);
|
||||
|
||||
@@ -270,6 +270,7 @@ static const struct {
|
||||
{ 0x4103, "BCM4330B1" }, /* 002.001.003 */
|
||||
{ 0x410e, "BCM43341B0" }, /* 002.001.014 */
|
||||
{ 0x4406, "BCM4324B3" }, /* 002.004.006 */
|
||||
{ 0x6109, "BCM4335C0" }, /* 003.001.009 */
|
||||
{ 0x610c, "BCM4354" }, /* 003.001.012 */
|
||||
{ }
|
||||
};
|
||||
|
||||
@@ -617,8 +617,9 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result,
|
||||
flags = ipmi_ssif_lock_cond(ssif_info, &oflags);
|
||||
ssif_info->waiting_alert = true;
|
||||
ssif_info->rtc_us_timer = SSIF_MSG_USEC;
|
||||
mod_timer(&ssif_info->retry_timer,
|
||||
jiffies + SSIF_MSG_JIFFIES);
|
||||
if (!ssif_info->stopping)
|
||||
mod_timer(&ssif_info->retry_timer,
|
||||
jiffies + SSIF_MSG_JIFFIES);
|
||||
ipmi_ssif_unlock_cond(ssif_info, flags);
|
||||
return;
|
||||
}
|
||||
@@ -950,8 +951,9 @@ static void msg_written_handler(struct ssif_info *ssif_info, int result,
|
||||
ssif_info->waiting_alert = true;
|
||||
ssif_info->retries_left = SSIF_RECV_RETRIES;
|
||||
ssif_info->rtc_us_timer = SSIF_MSG_PART_USEC;
|
||||
mod_timer(&ssif_info->retry_timer,
|
||||
jiffies + SSIF_MSG_PART_JIFFIES);
|
||||
if (!ssif_info->stopping)
|
||||
mod_timer(&ssif_info->retry_timer,
|
||||
jiffies + SSIF_MSG_PART_JIFFIES);
|
||||
ipmi_ssif_unlock_cond(ssif_info, flags);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -420,7 +420,8 @@ ssize_t tpm_transmit_cmd(struct tpm_chip *chip, const void *cmd,
|
||||
header = cmd;
|
||||
|
||||
err = be32_to_cpu(header->return_code);
|
||||
if (err != 0 && desc)
|
||||
if (err != 0 && err != TPM_ERR_DISABLED && err != TPM_ERR_DEACTIVATED
|
||||
&& desc)
|
||||
dev_err(&chip->dev, "A TPM error (%d) occurred %s\n", err,
|
||||
desc);
|
||||
|
||||
|
||||
@@ -203,7 +203,7 @@ static int setup_ring(struct xenbus_device *dev, struct tpm_private *priv)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
rv = xenbus_grant_ring(dev, &priv->shr, 1, &gref);
|
||||
rv = xenbus_grant_ring(dev, priv->shr, 1, &gref);
|
||||
if (rv < 0)
|
||||
return rv;
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ struct private_data {
|
||||
struct device *cpu_dev;
|
||||
struct thermal_cooling_device *cdev;
|
||||
const char *reg_name;
|
||||
bool have_static_opps;
|
||||
};
|
||||
|
||||
static struct freq_attr *cpufreq_dt_attr[] = {
|
||||
@@ -197,6 +198,15 @@ static int cpufreq_init(struct cpufreq_policy *policy)
|
||||
}
|
||||
}
|
||||
|
||||
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
|
||||
if (!priv) {
|
||||
ret = -ENOMEM;
|
||||
goto out_put_regulator;
|
||||
}
|
||||
|
||||
priv->reg_name = name;
|
||||
priv->opp_table = opp_table;
|
||||
|
||||
/*
|
||||
* Initialize OPP tables for all policy->cpus. They will be shared by
|
||||
* all CPUs which have marked their CPUs shared with OPP bindings.
|
||||
@@ -207,7 +217,8 @@ static int cpufreq_init(struct cpufreq_policy *policy)
|
||||
*
|
||||
* OPPs might be populated at runtime, don't check for error here
|
||||
*/
|
||||
dev_pm_opp_of_cpumask_add_table(policy->cpus);
|
||||
if (!dev_pm_opp_of_cpumask_add_table(policy->cpus))
|
||||
priv->have_static_opps = true;
|
||||
|
||||
/*
|
||||
* But we need OPP table to function so if it is not there let's
|
||||
@@ -233,19 +244,10 @@ static int cpufreq_init(struct cpufreq_policy *policy)
|
||||
__func__, ret);
|
||||
}
|
||||
|
||||
priv = kzalloc(sizeof(*priv), GFP_KERNEL);
|
||||
if (!priv) {
|
||||
ret = -ENOMEM;
|
||||
goto out_free_opp;
|
||||
}
|
||||
|
||||
priv->reg_name = name;
|
||||
priv->opp_table = opp_table;
|
||||
|
||||
ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table);
|
||||
if (ret) {
|
||||
dev_err(cpu_dev, "failed to init cpufreq table: %d\n", ret);
|
||||
goto out_free_priv;
|
||||
goto out_free_opp;
|
||||
}
|
||||
|
||||
priv->cpu_dev = cpu_dev;
|
||||
@@ -291,10 +293,11 @@ static int cpufreq_init(struct cpufreq_policy *policy)
|
||||
|
||||
out_free_cpufreq_table:
|
||||
dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table);
|
||||
out_free_priv:
|
||||
kfree(priv);
|
||||
out_free_opp:
|
||||
dev_pm_opp_of_cpumask_remove_table(policy->cpus);
|
||||
if (priv->have_static_opps)
|
||||
dev_pm_opp_of_cpumask_remove_table(policy->cpus);
|
||||
kfree(priv);
|
||||
out_put_regulator:
|
||||
if (name)
|
||||
dev_pm_opp_put_regulator(opp_table);
|
||||
out_put_clk:
|
||||
@@ -309,7 +312,8 @@ static int cpufreq_exit(struct cpufreq_policy *policy)
|
||||
|
||||
cpufreq_cooling_unregister(priv->cdev);
|
||||
dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table);
|
||||
dev_pm_opp_of_cpumask_remove_table(policy->related_cpus);
|
||||
if (priv->have_static_opps)
|
||||
dev_pm_opp_of_cpumask_remove_table(policy->related_cpus);
|
||||
if (priv->reg_name)
|
||||
dev_pm_opp_put_regulator(priv->opp_table);
|
||||
|
||||
|
||||
@@ -68,22 +68,22 @@
|
||||
|
||||
extern bool caam_little_end;
|
||||
|
||||
#define caam_to_cpu(len) \
|
||||
static inline u##len caam##len ## _to_cpu(u##len val) \
|
||||
{ \
|
||||
if (caam_little_end) \
|
||||
return le##len ## _to_cpu(val); \
|
||||
else \
|
||||
return be##len ## _to_cpu(val); \
|
||||
#define caam_to_cpu(len) \
|
||||
static inline u##len caam##len ## _to_cpu(u##len val) \
|
||||
{ \
|
||||
if (caam_little_end) \
|
||||
return le##len ## _to_cpu((__force __le##len)val); \
|
||||
else \
|
||||
return be##len ## _to_cpu((__force __be##len)val); \
|
||||
}
|
||||
|
||||
#define cpu_to_caam(len) \
|
||||
static inline u##len cpu_to_caam##len(u##len val) \
|
||||
{ \
|
||||
if (caam_little_end) \
|
||||
return cpu_to_le##len(val); \
|
||||
else \
|
||||
return cpu_to_be##len(val); \
|
||||
#define cpu_to_caam(len) \
|
||||
static inline u##len cpu_to_caam##len(u##len val) \
|
||||
{ \
|
||||
if (caam_little_end) \
|
||||
return (__force u##len)cpu_to_le##len(val); \
|
||||
else \
|
||||
return (__force u##len)cpu_to_be##len(val); \
|
||||
}
|
||||
|
||||
caam_to_cpu(16)
|
||||
|
||||
@@ -754,6 +754,11 @@ static int jz4780_dma_probe(struct platform_device *pdev)
|
||||
struct resource *res;
|
||||
int i, ret;
|
||||
|
||||
if (!dev->of_node) {
|
||||
dev_err(dev, "This driver must be probed from devicetree\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
jzdma = devm_kzalloc(dev, sizeof(*jzdma), GFP_KERNEL);
|
||||
if (!jzdma)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -1210,8 +1210,15 @@ static void ioat_shutdown(struct pci_dev *pdev)
|
||||
|
||||
spin_lock_bh(&ioat_chan->prep_lock);
|
||||
set_bit(IOAT_CHAN_DOWN, &ioat_chan->state);
|
||||
del_timer_sync(&ioat_chan->timer);
|
||||
spin_unlock_bh(&ioat_chan->prep_lock);
|
||||
/*
|
||||
* Synchronization rule for del_timer_sync():
|
||||
* - The caller must not hold locks which would prevent
|
||||
* completion of the timer's handler.
|
||||
* So prep_lock cannot be held before calling it.
|
||||
*/
|
||||
del_timer_sync(&ioat_chan->timer);
|
||||
|
||||
/* this should quiesce then reset */
|
||||
ioat_reset_hw(ioat_chan);
|
||||
}
|
||||
|
||||
@@ -1711,6 +1711,7 @@ static void i7core_mce_output_error(struct mem_ctl_info *mci,
|
||||
u32 errnum = find_first_bit(&error, 32);
|
||||
|
||||
if (uncorrected_error) {
|
||||
core_err_cnt = 1;
|
||||
if (ripv)
|
||||
tp_event = HW_EVENT_ERR_FATAL;
|
||||
else
|
||||
|
||||
@@ -2934,6 +2934,7 @@ static void sbridge_mce_output_error(struct mem_ctl_info *mci,
|
||||
recoverable = GET_BITFIELD(m->status, 56, 56);
|
||||
|
||||
if (uncorrected_error) {
|
||||
core_err_cnt = 1;
|
||||
if (ripv) {
|
||||
type = "FATAL";
|
||||
tp_event = HW_EVENT_ERR_FATAL;
|
||||
|
||||
@@ -606,7 +606,7 @@ sad_found:
|
||||
break;
|
||||
case 2:
|
||||
lchan = (addr >> shift) % 2;
|
||||
lchan = (lchan << 1) | ~lchan;
|
||||
lchan = (lchan << 1) | !lchan;
|
||||
break;
|
||||
case 3:
|
||||
lchan = ((addr >> shift) % 2) << 1;
|
||||
@@ -897,6 +897,7 @@ static void skx_mce_output_error(struct mem_ctl_info *mci,
|
||||
recoverable = GET_BITFIELD(m->status, 56, 56);
|
||||
|
||||
if (uncorrected_error) {
|
||||
core_err_cnt = 1;
|
||||
if (ripv) {
|
||||
type = "FATAL";
|
||||
tp_event = HW_EVENT_ERR_FATAL;
|
||||
|
||||
@@ -521,14 +521,24 @@ static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd,
|
||||
if (cmd == HIDIOCGCOLLECTIONINDEX) {
|
||||
if (uref->usage_index >= field->maxusage)
|
||||
goto inval;
|
||||
uref->usage_index =
|
||||
array_index_nospec(uref->usage_index,
|
||||
field->maxusage);
|
||||
} else if (uref->usage_index >= field->report_count)
|
||||
goto inval;
|
||||
}
|
||||
|
||||
if ((cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) &&
|
||||
(uref_multi->num_values > HID_MAX_MULTI_USAGES ||
|
||||
uref->usage_index + uref_multi->num_values > field->report_count))
|
||||
goto inval;
|
||||
if (cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) {
|
||||
if (uref_multi->num_values > HID_MAX_MULTI_USAGES ||
|
||||
uref->usage_index + uref_multi->num_values >
|
||||
field->report_count)
|
||||
goto inval;
|
||||
|
||||
uref->usage_index =
|
||||
array_index_nospec(uref->usage_index,
|
||||
field->report_count -
|
||||
uref_multi->num_values);
|
||||
}
|
||||
|
||||
switch (cmd) {
|
||||
case HIDIOCGUSAGE:
|
||||
|
||||
@@ -118,6 +118,8 @@ static int pmbus_identify(struct i2c_client *client,
|
||||
} else {
|
||||
info->pages = 1;
|
||||
}
|
||||
|
||||
pmbus_clear_faults(client);
|
||||
}
|
||||
|
||||
if (pmbus_check_byte_register(client, 0, PMBUS_VOUT_MODE)) {
|
||||
|
||||
@@ -1759,7 +1759,10 @@ static int pmbus_init_common(struct i2c_client *client, struct pmbus_data *data,
|
||||
if (ret >= 0 && (ret & PB_CAPABILITY_ERROR_CHECK))
|
||||
client->flags |= I2C_CLIENT_PEC;
|
||||
|
||||
pmbus_clear_faults(client);
|
||||
if (data->info->pages)
|
||||
pmbus_clear_faults(client);
|
||||
else
|
||||
pmbus_clear_fault_page(client, -1);
|
||||
|
||||
if (info->identify) {
|
||||
ret = (*info->identify)(client, info);
|
||||
|
||||
@@ -306,9 +306,19 @@ static int pwm_fan_remove(struct platform_device *pdev)
|
||||
static int pwm_fan_suspend(struct device *dev)
|
||||
{
|
||||
struct pwm_fan_ctx *ctx = dev_get_drvdata(dev);
|
||||
struct pwm_args args;
|
||||
int ret;
|
||||
|
||||
pwm_get_args(ctx->pwm, &args);
|
||||
|
||||
if (ctx->pwm_value) {
|
||||
ret = pwm_config(ctx->pwm, 0, args.period);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (ctx->pwm_value)
|
||||
pwm_disable(ctx->pwm);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -155,6 +155,10 @@ static int etb_enable(struct coresight_device *csdev, u32 mode)
|
||||
if (val == CS_MODE_PERF)
|
||||
return -EBUSY;
|
||||
|
||||
/* Don't let perf disturb sysFS sessions */
|
||||
if (val == CS_MODE_SYSFS && mode == CS_MODE_PERF)
|
||||
return -EBUSY;
|
||||
|
||||
/* Nothing to do, the tracer is already enabled. */
|
||||
if (val == CS_MODE_SYSFS)
|
||||
goto out;
|
||||
|
||||
@@ -723,8 +723,12 @@ static int rcar_i2c_master_xfer(struct i2c_adapter *adap,
|
||||
|
||||
time_left = wait_event_timeout(priv->wait, priv->flags & ID_DONE,
|
||||
num * adap->timeout);
|
||||
if (!time_left) {
|
||||
|
||||
/* cleanup DMA if it couldn't complete properly due to an error */
|
||||
if (priv->dma_direction != DMA_NONE)
|
||||
rcar_i2c_cleanup_dma(priv);
|
||||
|
||||
if (!time_left) {
|
||||
rcar_i2c_init(priv);
|
||||
ret = -ETIMEDOUT;
|
||||
} else if (priv->flags & ID_NACK) {
|
||||
|
||||
@@ -247,12 +247,14 @@ static irqreturn_t at91_adc_trigger_handler(int irq, void *p)
|
||||
struct iio_poll_func *pf = p;
|
||||
struct iio_dev *idev = pf->indio_dev;
|
||||
struct at91_adc_state *st = iio_priv(idev);
|
||||
struct iio_chan_spec const *chan;
|
||||
int i, j = 0;
|
||||
|
||||
for (i = 0; i < idev->masklength; i++) {
|
||||
if (!test_bit(i, idev->active_scan_mask))
|
||||
continue;
|
||||
st->buffer[j] = at91_adc_readl(st, AT91_ADC_CHAN(st, i));
|
||||
chan = idev->channels + i;
|
||||
st->buffer[j] = at91_adc_readl(st, AT91_ADC_CHAN(st, chan->channel));
|
||||
j++;
|
||||
}
|
||||
|
||||
@@ -278,6 +280,8 @@ static void handle_adc_eoc_trigger(int irq, struct iio_dev *idev)
|
||||
iio_trigger_poll(idev->trig);
|
||||
} else {
|
||||
st->last_value = at91_adc_readl(st, AT91_ADC_CHAN(st, st->chnb));
|
||||
/* Needed to ACK the DRDY interruption */
|
||||
at91_adc_readl(st, AT91_ADC_LCDR);
|
||||
st->done = true;
|
||||
wake_up_interruptible(&st->wq_data_avail);
|
||||
}
|
||||
|
||||
@@ -209,12 +209,14 @@ static int mx25_gcq_setup_cfgs(struct platform_device *pdev,
|
||||
ret = of_property_read_u32(child, "reg", ®);
|
||||
if (ret) {
|
||||
dev_err(dev, "Failed to get reg property\n");
|
||||
of_node_put(child);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (reg >= MX25_NUM_CFGS) {
|
||||
dev_err(dev,
|
||||
"reg value is greater than the number of available configuration registers\n");
|
||||
of_node_put(child);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -228,6 +230,7 @@ static int mx25_gcq_setup_cfgs(struct platform_device *pdev,
|
||||
if (IS_ERR(priv->vref[refp])) {
|
||||
dev_err(dev, "Error, trying to use external voltage reference without a vref-%s regulator.",
|
||||
mx25_gcq_refp_names[refp]);
|
||||
of_node_put(child);
|
||||
return PTR_ERR(priv->vref[refp]);
|
||||
}
|
||||
priv->channel_vref_mv[reg] =
|
||||
@@ -240,6 +243,7 @@ static int mx25_gcq_setup_cfgs(struct platform_device *pdev,
|
||||
break;
|
||||
default:
|
||||
dev_err(dev, "Invalid positive reference %d\n", refp);
|
||||
of_node_put(child);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -254,10 +258,12 @@ static int mx25_gcq_setup_cfgs(struct platform_device *pdev,
|
||||
|
||||
if ((refp & MX25_ADCQ_CFG_REFP_MASK) != refp) {
|
||||
dev_err(dev, "Invalid fsl,adc-refp property value\n");
|
||||
of_node_put(child);
|
||||
return -EINVAL;
|
||||
}
|
||||
if ((refn & MX25_ADCQ_CFG_REFN_MASK) != refn) {
|
||||
dev_err(dev, "Invalid fsl,adc-refn property value\n");
|
||||
of_node_put(child);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
@@ -760,6 +760,40 @@ static int ad5064_set_config(struct ad5064_state *st, unsigned int val)
|
||||
return ad5064_write(st, cmd, 0, val, 0);
|
||||
}
|
||||
|
||||
static int ad5064_request_vref(struct ad5064_state *st, struct device *dev)
|
||||
{
|
||||
unsigned int i;
|
||||
int ret;
|
||||
|
||||
for (i = 0; i < ad5064_num_vref(st); ++i)
|
||||
st->vref_reg[i].supply = ad5064_vref_name(st, i);
|
||||
|
||||
if (!st->chip_info->internal_vref)
|
||||
return devm_regulator_bulk_get(dev, ad5064_num_vref(st),
|
||||
st->vref_reg);
|
||||
|
||||
/*
|
||||
* This assumes that when the regulator has an internal VREF
|
||||
* there is only one external VREF connection, which is
|
||||
* currently the case for all supported devices.
|
||||
*/
|
||||
st->vref_reg[0].consumer = devm_regulator_get_optional(dev, "vref");
|
||||
if (!IS_ERR(st->vref_reg[0].consumer))
|
||||
return 0;
|
||||
|
||||
ret = PTR_ERR(st->vref_reg[0].consumer);
|
||||
if (ret != -ENODEV)
|
||||
return ret;
|
||||
|
||||
/* If no external regulator was supplied use the internal VREF */
|
||||
st->use_internal_vref = true;
|
||||
ret = ad5064_set_config(st, AD5064_CONFIG_INT_VREF_ENABLE);
|
||||
if (ret)
|
||||
dev_err(dev, "Failed to enable internal vref: %d\n", ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ad5064_probe(struct device *dev, enum ad5064_type type,
|
||||
const char *name, ad5064_write_func write)
|
||||
{
|
||||
@@ -780,22 +814,11 @@ static int ad5064_probe(struct device *dev, enum ad5064_type type,
|
||||
st->dev = dev;
|
||||
st->write = write;
|
||||
|
||||
for (i = 0; i < ad5064_num_vref(st); ++i)
|
||||
st->vref_reg[i].supply = ad5064_vref_name(st, i);
|
||||
ret = ad5064_request_vref(st, dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
ret = devm_regulator_bulk_get(dev, ad5064_num_vref(st),
|
||||
st->vref_reg);
|
||||
if (ret) {
|
||||
if (!st->chip_info->internal_vref)
|
||||
return ret;
|
||||
st->use_internal_vref = true;
|
||||
ret = ad5064_set_config(st, AD5064_CONFIG_INT_VREF_ENABLE);
|
||||
if (ret) {
|
||||
dev_err(dev, "Failed to enable internal vref: %d\n",
|
||||
ret);
|
||||
return ret;
|
||||
}
|
||||
} else {
|
||||
if (!st->use_internal_vref) {
|
||||
ret = regulator_bulk_enable(ad5064_num_vref(st), st->vref_reg);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -485,7 +485,7 @@ static ssize_t show_pma_counter(struct ib_port *p, struct port_attribute *attr,
|
||||
ret = get_perf_mad(p->ibdev, p->port_num, tab_attr->attr_id, &data,
|
||||
40 + offset / 8, sizeof(data));
|
||||
if (ret < 0)
|
||||
return sprintf(buf, "N/A (no PMA)\n");
|
||||
return ret;
|
||||
|
||||
switch (width) {
|
||||
case 4:
|
||||
@@ -1008,10 +1008,12 @@ static int add_port(struct ib_device *device, int port_num,
|
||||
goto err_put;
|
||||
}
|
||||
|
||||
p->pma_table = get_counter_table(device, port_num);
|
||||
ret = sysfs_create_group(&p->kobj, p->pma_table);
|
||||
if (ret)
|
||||
goto err_put_gid_attrs;
|
||||
if (device->process_mad) {
|
||||
p->pma_table = get_counter_table(device, port_num);
|
||||
ret = sysfs_create_group(&p->kobj, p->pma_table);
|
||||
if (ret)
|
||||
goto err_put_gid_attrs;
|
||||
}
|
||||
|
||||
p->gid_group.name = "gids";
|
||||
p->gid_group.attrs = alloc_group_attrs(show_port_gid, attr.gid_tbl_len);
|
||||
@@ -1124,7 +1126,8 @@ err_free_gid:
|
||||
p->gid_group.attrs = NULL;
|
||||
|
||||
err_remove_pma:
|
||||
sysfs_remove_group(&p->kobj, p->pma_table);
|
||||
if (p->pma_table)
|
||||
sysfs_remove_group(&p->kobj, p->pma_table);
|
||||
|
||||
err_put_gid_attrs:
|
||||
kobject_put(&p->gid_attr_group->kobj);
|
||||
@@ -1236,7 +1239,9 @@ static void free_port_list_attributes(struct ib_device *device)
|
||||
kfree(port->hw_stats);
|
||||
free_hsag(&port->kobj, port->hw_stats_ag);
|
||||
}
|
||||
sysfs_remove_group(p, port->pma_table);
|
||||
|
||||
if (port->pma_table)
|
||||
sysfs_remove_group(p, port->pma_table);
|
||||
sysfs_remove_group(p, &port->pkey_group);
|
||||
sysfs_remove_group(p, &port->gid_group);
|
||||
sysfs_remove_group(&port->gid_attr_group->kobj,
|
||||
|
||||
@@ -1422,11 +1422,15 @@ static void ipoib_cm_skb_reap(struct work_struct *work)
|
||||
spin_unlock_irqrestore(&priv->lock, flags);
|
||||
netif_tx_unlock_bh(dev);
|
||||
|
||||
if (skb->protocol == htons(ETH_P_IP))
|
||||
if (skb->protocol == htons(ETH_P_IP)) {
|
||||
memset(IPCB(skb), 0, sizeof(*IPCB(skb)));
|
||||
icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu));
|
||||
}
|
||||
#if IS_ENABLED(CONFIG_IPV6)
|
||||
else if (skb->protocol == htons(ETH_P_IPV6))
|
||||
else if (skb->protocol == htons(ETH_P_IPV6)) {
|
||||
memset(IP6CB(skb), 0, sizeof(*IP6CB(skb)));
|
||||
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
|
||||
}
|
||||
#endif
|
||||
dev_kfree_skb_any(skb);
|
||||
|
||||
|
||||
@@ -2367,7 +2367,7 @@ static int refill_keybuf_fn(struct btree_op *op, struct btree *b,
|
||||
struct keybuf *buf = refill->buf;
|
||||
int ret = MAP_CONTINUE;
|
||||
|
||||
if (bkey_cmp(k, refill->end) >= 0) {
|
||||
if (bkey_cmp(k, refill->end) > 0) {
|
||||
ret = MAP_DONE;
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -1692,8 +1692,7 @@ static void free_params(struct dm_ioctl *param, size_t param_size, int param_fla
|
||||
}
|
||||
|
||||
static int copy_params(struct dm_ioctl __user *user, struct dm_ioctl *param_kernel,
|
||||
int ioctl_flags,
|
||||
struct dm_ioctl **param, int *param_flags)
|
||||
int ioctl_flags, struct dm_ioctl **param, int *param_flags)
|
||||
{
|
||||
struct dm_ioctl *dmi;
|
||||
int secure_data;
|
||||
@@ -1738,18 +1737,13 @@ static int copy_params(struct dm_ioctl __user *user, struct dm_ioctl *param_kern
|
||||
|
||||
*param_flags |= DM_PARAMS_MALLOC;
|
||||
|
||||
if (copy_from_user(dmi, user, param_kernel->data_size))
|
||||
goto bad;
|
||||
/* Copy from param_kernel (which was already copied from user) */
|
||||
memcpy(dmi, param_kernel, minimum_data_size);
|
||||
|
||||
if (copy_from_user(&dmi->data, (char __user *)user + minimum_data_size,
|
||||
param_kernel->data_size - minimum_data_size))
|
||||
goto bad;
|
||||
data_copied:
|
||||
/*
|
||||
* Abort if something changed the ioctl data while it was being copied.
|
||||
*/
|
||||
if (dmi->data_size != param_kernel->data_size) {
|
||||
DMERR("rejecting ioctl: data size modified while processing parameters");
|
||||
goto bad;
|
||||
}
|
||||
|
||||
/* Wipe the user buffer so we do not return it to userspace */
|
||||
if (secure_data && clear_user(user, param_kernel->data_size))
|
||||
goto bad;
|
||||
|
||||
@@ -1589,6 +1589,7 @@ static int raid1_add_disk(struct mddev *mddev, struct md_rdev *rdev)
|
||||
*/
|
||||
if (rdev->saved_raid_disk >= 0 &&
|
||||
rdev->saved_raid_disk >= first &&
|
||||
rdev->saved_raid_disk < conf->raid_disks &&
|
||||
conf->mirrors[rdev->saved_raid_disk].rdev == NULL)
|
||||
first = last = rdev->saved_raid_disk;
|
||||
|
||||
|
||||
@@ -1734,6 +1734,7 @@ static int raid10_add_disk(struct mddev *mddev, struct md_rdev *rdev)
|
||||
first = last = rdev->raid_disk;
|
||||
|
||||
if (rdev->saved_raid_disk >= first &&
|
||||
rdev->saved_raid_disk < conf->geo.raid_disks &&
|
||||
conf->mirrors[rdev->saved_raid_disk].rdev == NULL)
|
||||
mirror = rdev->saved_raid_disk;
|
||||
else
|
||||
|
||||
@@ -1650,7 +1650,7 @@ typedef struct { u16 __; u8 _; } __packed x24;
|
||||
pos[7] = (chr & (0x01 << 0) ? fg : bg); \
|
||||
} \
|
||||
\
|
||||
pos += (tpg->hflip ? -8 : 8) / hdiv; \
|
||||
pos += (tpg->hflip ? -8 : 8) / (int)hdiv; \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
@@ -1527,7 +1527,7 @@ static int tvp5150_probe(struct i2c_client *c,
|
||||
27000000, 1, 27000000);
|
||||
v4l2_ctrl_new_std_menu_items(&core->hdl, &tvp5150_ctrl_ops,
|
||||
V4L2_CID_TEST_PATTERN,
|
||||
ARRAY_SIZE(tvp5150_test_patterns),
|
||||
ARRAY_SIZE(tvp5150_test_patterns) - 1,
|
||||
0, 0, tvp5150_test_patterns);
|
||||
sd->ctrl_handler = &core->hdl;
|
||||
if (core->hdl.error) {
|
||||
|
||||
@@ -2093,13 +2093,13 @@ struct em28xx_board em28xx_boards[] = {
|
||||
.input = { {
|
||||
.type = EM28XX_VMUX_COMPOSITE,
|
||||
.vmux = TVP5150_COMPOSITE1,
|
||||
.amux = EM28XX_AUDIO_SRC_LINE,
|
||||
.amux = EM28XX_AMUX_LINE_IN,
|
||||
.gpio = terratec_av350_unmute_gpio,
|
||||
|
||||
}, {
|
||||
.type = EM28XX_VMUX_SVIDEO,
|
||||
.vmux = TVP5150_SVIDEO,
|
||||
.amux = EM28XX_AUDIO_SRC_LINE,
|
||||
.amux = EM28XX_AMUX_LINE_IN,
|
||||
.gpio = terratec_av350_unmute_gpio,
|
||||
} },
|
||||
},
|
||||
|
||||
@@ -1290,6 +1290,8 @@ static void em28xx_ctrl_notify(struct v4l2_ctrl *ctrl, void *priv)
|
||||
{
|
||||
struct em28xx *dev = priv;
|
||||
|
||||
dev->v4l2->field_count = 0;
|
||||
|
||||
/*
|
||||
* In the case of non-AC97 volume controls, we still need
|
||||
* to do some setups at em28xx, in order to mute/unmute
|
||||
@@ -1435,9 +1437,9 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
|
||||
|
||||
fmt = format_by_fourcc(f->fmt.pix.pixelformat);
|
||||
if (!fmt) {
|
||||
em28xx_videodbg("Fourcc format (%08x) invalid.\n",
|
||||
f->fmt.pix.pixelformat);
|
||||
return -EINVAL;
|
||||
fmt = &format[0];
|
||||
em28xx_videodbg("Fourcc format (%08x) invalid. Using default (%08x).\n",
|
||||
f->fmt.pix.pixelformat, fmt->fourcc);
|
||||
}
|
||||
|
||||
if (dev->board.is_em2800) {
|
||||
|
||||
@@ -404,7 +404,7 @@ struct genwqe_file {
|
||||
struct file *filp;
|
||||
|
||||
struct fasync_struct *async_queue;
|
||||
struct task_struct *owner;
|
||||
struct pid *opener;
|
||||
struct list_head list; /* entry in list of open files */
|
||||
|
||||
spinlock_t map_lock; /* lock for dma_mappings */
|
||||
|
||||
@@ -52,7 +52,7 @@ static void genwqe_add_file(struct genwqe_dev *cd, struct genwqe_file *cfile)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
cfile->owner = current;
|
||||
cfile->opener = get_pid(task_tgid(current));
|
||||
spin_lock_irqsave(&cd->file_lock, flags);
|
||||
list_add(&cfile->list, &cd->file_list);
|
||||
spin_unlock_irqrestore(&cd->file_lock, flags);
|
||||
@@ -65,6 +65,7 @@ static int genwqe_del_file(struct genwqe_dev *cd, struct genwqe_file *cfile)
|
||||
spin_lock_irqsave(&cd->file_lock, flags);
|
||||
list_del(&cfile->list);
|
||||
spin_unlock_irqrestore(&cd->file_lock, flags);
|
||||
put_pid(cfile->opener);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -275,7 +276,7 @@ static int genwqe_kill_fasync(struct genwqe_dev *cd, int sig)
|
||||
return files;
|
||||
}
|
||||
|
||||
static int genwqe_force_sig(struct genwqe_dev *cd, int sig)
|
||||
static int genwqe_terminate(struct genwqe_dev *cd)
|
||||
{
|
||||
unsigned int files = 0;
|
||||
unsigned long flags;
|
||||
@@ -283,7 +284,7 @@ static int genwqe_force_sig(struct genwqe_dev *cd, int sig)
|
||||
|
||||
spin_lock_irqsave(&cd->file_lock, flags);
|
||||
list_for_each_entry(cfile, &cd->file_list, list) {
|
||||
force_sig(sig, cfile->owner);
|
||||
kill_pid(cfile->opener, SIGKILL, 1);
|
||||
files++;
|
||||
}
|
||||
spin_unlock_irqrestore(&cd->file_lock, flags);
|
||||
@@ -1356,7 +1357,7 @@ static int genwqe_inform_and_stop_processes(struct genwqe_dev *cd)
|
||||
dev_warn(&pci_dev->dev,
|
||||
"[%s] send SIGKILL and wait ...\n", __func__);
|
||||
|
||||
rc = genwqe_force_sig(cd, SIGKILL); /* force terminate */
|
||||
rc = genwqe_terminate(cd);
|
||||
if (rc) {
|
||||
/* Give kill_timout more seconds to end processes */
|
||||
for (i = 0; (i < genwqe_kill_timeout) &&
|
||||
|
||||
@@ -113,5 +113,5 @@ module_exit(vmci_drv_exit);
|
||||
|
||||
MODULE_AUTHOR("VMware, Inc.");
|
||||
MODULE_DESCRIPTION("VMware Virtual Machine Communication Interface.");
|
||||
MODULE_VERSION("1.1.5.0-k");
|
||||
MODULE_VERSION("1.1.6.0-k");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
||||
@@ -56,7 +56,8 @@ static struct vmci_resource *vmci_resource_lookup(struct vmci_handle handle,
|
||||
|
||||
if (r->type == type &&
|
||||
rid == handle.resource &&
|
||||
(cid == handle.context || cid == VMCI_INVALID_ID)) {
|
||||
(cid == handle.context || cid == VMCI_INVALID_ID ||
|
||||
handle.context == VMCI_INVALID_ID)) {
|
||||
resource = r;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -334,6 +334,9 @@ int sdhci_pci_o2_probe(struct sdhci_pci_chip *chip)
|
||||
pci_write_config_byte(chip->pdev, O2_SD_LOCK_WP, scratch);
|
||||
break;
|
||||
case PCI_DEVICE_ID_O2_SEABIRD0:
|
||||
if (chip->pdev->revision == 0x01)
|
||||
chip->quirks |= SDHCI_QUIRK_DELAY_AFTER_POWER;
|
||||
/* fall through */
|
||||
case PCI_DEVICE_ID_O2_SEABIRD1:
|
||||
/* UnLock WP */
|
||||
ret = pci_read_config_byte(chip->pdev,
|
||||
|
||||
@@ -3419,6 +3419,10 @@ static void ixgbevf_tx_csum(struct ixgbevf_ring *tx_ring,
|
||||
skb_checksum_help(skb);
|
||||
goto no_csum;
|
||||
}
|
||||
|
||||
if (first->protocol == htons(ETH_P_IP))
|
||||
type_tucmd |= IXGBE_ADVTXD_TUCMD_IPV4;
|
||||
|
||||
/* update TX checksum flag */
|
||||
first->tx_flags |= IXGBE_TX_FLAGS_CSUM;
|
||||
vlan_macip_lens = skb_checksum_start_offset(skb) -
|
||||
|
||||
@@ -380,8 +380,6 @@ static void fm93c56a_select(struct ql3_adapter *qdev)
|
||||
|
||||
qdev->eeprom_cmd_data = AUBURN_EEPROM_CS_1;
|
||||
ql_write_nvram_reg(qdev, spir, ISP_NVRAM_MASK | qdev->eeprom_cmd_data);
|
||||
ql_write_nvram_reg(qdev, spir,
|
||||
((ISP_NVRAM_MASK << 16) | qdev->eeprom_cmd_data));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -1570,6 +1570,8 @@ static void tun_setup(struct net_device *dev)
|
||||
*/
|
||||
static int tun_validate(struct nlattr *tb[], struct nlattr *data[])
|
||||
{
|
||||
if (!data)
|
||||
return 0;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
@@ -1822,6 +1822,12 @@ int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id)
|
||||
if (ret)
|
||||
dev_kfree_skb_any(skb);
|
||||
|
||||
if (ret == -EAGAIN) {
|
||||
ath10k_warn(ar, "wmi command %d timeout, restarting hardware\n",
|
||||
cmd_id);
|
||||
queue_work(ar->workqueue, &ar->restart_work);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -77,6 +77,8 @@ static u16 d11ac_bw(enum brcmu_chan_bw bw)
|
||||
return BRCMU_CHSPEC_D11AC_BW_40;
|
||||
case BRCMU_CHAN_BW_80:
|
||||
return BRCMU_CHSPEC_D11AC_BW_80;
|
||||
case BRCMU_CHAN_BW_160:
|
||||
return BRCMU_CHSPEC_D11AC_BW_160;
|
||||
default:
|
||||
WARN_ON(1);
|
||||
}
|
||||
@@ -190,8 +192,38 @@ static void brcmu_d11ac_decchspec(struct brcmu_chan *ch)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case BRCMU_CHSPEC_D11AC_BW_8080:
|
||||
case BRCMU_CHSPEC_D11AC_BW_160:
|
||||
switch (ch->sb) {
|
||||
case BRCMU_CHAN_SB_LLL:
|
||||
ch->control_ch_num -= CH_70MHZ_APART;
|
||||
break;
|
||||
case BRCMU_CHAN_SB_LLU:
|
||||
ch->control_ch_num -= CH_50MHZ_APART;
|
||||
break;
|
||||
case BRCMU_CHAN_SB_LUL:
|
||||
ch->control_ch_num -= CH_30MHZ_APART;
|
||||
break;
|
||||
case BRCMU_CHAN_SB_LUU:
|
||||
ch->control_ch_num -= CH_10MHZ_APART;
|
||||
break;
|
||||
case BRCMU_CHAN_SB_ULL:
|
||||
ch->control_ch_num += CH_10MHZ_APART;
|
||||
break;
|
||||
case BRCMU_CHAN_SB_ULU:
|
||||
ch->control_ch_num += CH_30MHZ_APART;
|
||||
break;
|
||||
case BRCMU_CHAN_SB_UUL:
|
||||
ch->control_ch_num += CH_50MHZ_APART;
|
||||
break;
|
||||
case BRCMU_CHAN_SB_UUU:
|
||||
ch->control_ch_num += CH_70MHZ_APART;
|
||||
break;
|
||||
default:
|
||||
WARN_ON_ONCE(1);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case BRCMU_CHSPEC_D11AC_BW_8080:
|
||||
default:
|
||||
WARN_ON_ONCE(1);
|
||||
break;
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
#define CH_UPPER_SB 0x01
|
||||
#define CH_LOWER_SB 0x02
|
||||
#define CH_EWA_VALID 0x04
|
||||
#define CH_70MHZ_APART 14
|
||||
#define CH_50MHZ_APART 10
|
||||
#define CH_30MHZ_APART 6
|
||||
#define CH_20MHZ_APART 4
|
||||
#define CH_10MHZ_APART 2
|
||||
|
||||
@@ -1207,7 +1207,11 @@ void iwl_mvm_rs_tx_status(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
|
||||
!(info->flags & IEEE80211_TX_STAT_AMPDU))
|
||||
return;
|
||||
|
||||
rs_rate_from_ucode_rate(tx_resp_hwrate, info->band, &tx_resp_rate);
|
||||
if (rs_rate_from_ucode_rate(tx_resp_hwrate, info->band,
|
||||
&tx_resp_rate)) {
|
||||
WARN_ON_ONCE(1);
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MAC80211_DEBUGFS
|
||||
/* Disable last tx check if we are debugging with fixed rate but
|
||||
@@ -1263,7 +1267,10 @@ void iwl_mvm_rs_tx_status(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
|
||||
*/
|
||||
table = &lq_sta->lq;
|
||||
lq_hwrate = le32_to_cpu(table->rs_table[0]);
|
||||
rs_rate_from_ucode_rate(lq_hwrate, info->band, &lq_rate);
|
||||
if (rs_rate_from_ucode_rate(lq_hwrate, info->band, &lq_rate)) {
|
||||
WARN_ON_ONCE(1);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Here we actually compare this rate to the latest LQ command */
|
||||
if (!rs_rate_equal(&tx_resp_rate, &lq_rate, allow_ant_mismatch)) {
|
||||
@@ -1365,8 +1372,12 @@ void iwl_mvm_rs_tx_status(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
|
||||
/* Collect data for each rate used during failed TX attempts */
|
||||
for (i = 0; i <= retries; ++i) {
|
||||
lq_hwrate = le32_to_cpu(table->rs_table[i]);
|
||||
rs_rate_from_ucode_rate(lq_hwrate, info->band,
|
||||
&lq_rate);
|
||||
if (rs_rate_from_ucode_rate(lq_hwrate, info->band,
|
||||
&lq_rate)) {
|
||||
WARN_ON_ONCE(1);
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Only collect stats if retried rate is in the same RS
|
||||
* table as active/search.
|
||||
@@ -3261,7 +3272,10 @@ static void rs_build_rates_table_from_fixed(struct iwl_mvm *mvm,
|
||||
for (i = 0; i < num_rates; i++)
|
||||
lq_cmd->rs_table[i] = ucode_rate_le32;
|
||||
|
||||
rs_rate_from_ucode_rate(ucode_rate, band, &rate);
|
||||
if (rs_rate_from_ucode_rate(ucode_rate, band, &rate)) {
|
||||
WARN_ON_ONCE(1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_mimo(&rate))
|
||||
lq_cmd->mimo_delim = num_rates - 1;
|
||||
|
||||
@@ -1030,6 +1030,14 @@ void iwl_pcie_rx_free(struct iwl_trans *trans)
|
||||
kfree(trans_pcie->rxq);
|
||||
}
|
||||
|
||||
static void iwl_pcie_rx_move_to_allocator(struct iwl_rxq *rxq,
|
||||
struct iwl_rb_allocator *rba)
|
||||
{
|
||||
spin_lock(&rba->lock);
|
||||
list_splice_tail_init(&rxq->rx_used, &rba->rbd_empty);
|
||||
spin_unlock(&rba->lock);
|
||||
}
|
||||
|
||||
/*
|
||||
* iwl_pcie_rx_reuse_rbd - Recycle used RBDs
|
||||
*
|
||||
@@ -1061,9 +1069,7 @@ static void iwl_pcie_rx_reuse_rbd(struct iwl_trans *trans,
|
||||
if ((rxq->used_count % RX_CLAIM_REQ_ALLOC) == RX_POST_REQ_ALLOC) {
|
||||
/* Move the 2 RBDs to the allocator ownership.
|
||||
Allocator has another 6 from pool for the request completion*/
|
||||
spin_lock(&rba->lock);
|
||||
list_splice_tail_init(&rxq->rx_used, &rba->rbd_empty);
|
||||
spin_unlock(&rba->lock);
|
||||
iwl_pcie_rx_move_to_allocator(rxq, rba);
|
||||
|
||||
atomic_inc(&rba->req_pending);
|
||||
queue_work(rba->alloc_wq, &rba->rx_alloc);
|
||||
@@ -1233,10 +1239,18 @@ restart:
|
||||
IWL_DEBUG_RX(trans, "Q %d: HW = SW = %d\n", rxq->id, r);
|
||||
|
||||
while (i != r) {
|
||||
struct iwl_rb_allocator *rba = &trans_pcie->rba;
|
||||
struct iwl_rx_mem_buffer *rxb;
|
||||
/* number of RBDs still waiting for page allocation */
|
||||
u32 rb_pending_alloc =
|
||||
atomic_read(&trans_pcie->rba.req_pending) *
|
||||
RX_CLAIM_REQ_ALLOC;
|
||||
|
||||
if (unlikely(rxq->used_count == rxq->queue_size / 2))
|
||||
if (unlikely(rb_pending_alloc >= rxq->queue_size / 2 &&
|
||||
!emergency)) {
|
||||
iwl_pcie_rx_move_to_allocator(rxq, rba);
|
||||
emergency = true;
|
||||
}
|
||||
|
||||
if (trans->cfg->mq_rx_supported) {
|
||||
/*
|
||||
@@ -1279,17 +1293,13 @@ restart:
|
||||
iwl_pcie_rx_allocator_get(trans, rxq);
|
||||
|
||||
if (rxq->used_count % RX_CLAIM_REQ_ALLOC == 0 && !emergency) {
|
||||
struct iwl_rb_allocator *rba = &trans_pcie->rba;
|
||||
|
||||
/* Add the remaining empty RBDs for allocator use */
|
||||
spin_lock(&rba->lock);
|
||||
list_splice_tail_init(&rxq->rx_used, &rba->rbd_empty);
|
||||
spin_unlock(&rba->lock);
|
||||
iwl_pcie_rx_move_to_allocator(rxq, rba);
|
||||
} else if (emergency) {
|
||||
count++;
|
||||
if (count == 8) {
|
||||
count = 0;
|
||||
if (rxq->used_count < rxq->queue_size / 3)
|
||||
if (rb_pending_alloc < rxq->queue_size / 3)
|
||||
emergency = false;
|
||||
|
||||
rxq->read = i;
|
||||
|
||||
@@ -468,8 +468,6 @@ static int __if_usb_submit_rx_urb(struct if_usb_card *cardp,
|
||||
MRVDRV_ETH_RX_PACKET_BUFFER_SIZE, callbackfn,
|
||||
cardp);
|
||||
|
||||
cardp->rx_urb->transfer_flags |= URB_ZERO_PACKET;
|
||||
|
||||
lbs_deb_usb2(&cardp->udev->dev, "Pointer for rx_urb %p\n", cardp->rx_urb);
|
||||
if ((ret = usb_submit_urb(cardp->rx_urb, GFP_ATOMIC))) {
|
||||
lbs_deb_usbd(&cardp->udev->dev, "Submit Rx URB failed: %d\n", ret);
|
||||
|
||||
@@ -424,6 +424,8 @@ static void nd_async_device_register(void *d, async_cookie_t cookie)
|
||||
put_device(dev);
|
||||
}
|
||||
put_device(dev);
|
||||
if (dev->parent)
|
||||
put_device(dev->parent);
|
||||
}
|
||||
|
||||
static void nd_async_device_unregister(void *d, async_cookie_t cookie)
|
||||
@@ -443,6 +445,8 @@ void __nd_device_register(struct device *dev)
|
||||
if (!dev)
|
||||
return;
|
||||
dev->bus = &nvdimm_bus_type;
|
||||
if (dev->parent)
|
||||
get_device(dev->parent);
|
||||
get_device(dev);
|
||||
async_schedule_domain(nd_async_device_register, dev,
|
||||
&nd_async_domain);
|
||||
|
||||
@@ -981,7 +981,6 @@ static int __pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries,
|
||||
}
|
||||
}
|
||||
}
|
||||
WARN_ON(!!dev->msix_enabled);
|
||||
|
||||
/* Check whether driver already requested for MSI irq */
|
||||
if (dev->msi_enabled) {
|
||||
@@ -1068,8 +1067,6 @@ static int __pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec,
|
||||
if (!pci_msi_supported(dev, minvec))
|
||||
return -EINVAL;
|
||||
|
||||
WARN_ON(!!dev->msi_enabled);
|
||||
|
||||
/* Check whether driver already requested MSI-X irqs */
|
||||
if (dev->msix_enabled) {
|
||||
dev_info(&dev->dev,
|
||||
@@ -1080,6 +1077,9 @@ static int __pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec,
|
||||
if (maxvec < minvec)
|
||||
return -ERANGE;
|
||||
|
||||
if (WARN_ON_ONCE(dev->msi_enabled))
|
||||
return -EINVAL;
|
||||
|
||||
nvec = pci_msi_vec_count(dev);
|
||||
if (nvec < 0)
|
||||
return nvec;
|
||||
@@ -1138,6 +1138,9 @@ static int __pci_enable_msix_range(struct pci_dev *dev,
|
||||
if (maxvec < minvec)
|
||||
return -ERANGE;
|
||||
|
||||
if (WARN_ON_ONCE(dev->msix_enabled))
|
||||
return -EINVAL;
|
||||
|
||||
for (;;) {
|
||||
if (affinity) {
|
||||
nvec = irq_calc_affinity_vectors(dev->irq_affinity,
|
||||
|
||||
@@ -3141,7 +3141,11 @@ static void disable_igfx_irq(struct pci_dev *dev)
|
||||
|
||||
pci_iounmap(dev, regs);
|
||||
}
|
||||
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0042, disable_igfx_irq);
|
||||
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0046, disable_igfx_irq);
|
||||
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x004a, disable_igfx_irq);
|
||||
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0102, disable_igfx_irq);
|
||||
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0106, disable_igfx_irq);
|
||||
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq);
|
||||
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0152, disable_igfx_irq);
|
||||
|
||||
|
||||
@@ -119,6 +119,10 @@
|
||||
#define RL5C4XX_MISC_CONTROL 0x2F /* 8 bit */
|
||||
#define RL5C4XX_ZV_ENABLE 0x08
|
||||
|
||||
/* Misc Control 3 Register */
|
||||
#define RL5C4XX_MISC3 0x00A2 /* 16 bit */
|
||||
#define RL5C47X_MISC3_CB_CLKRUN_DIS BIT(1)
|
||||
|
||||
#ifdef __YENTA_H
|
||||
|
||||
#define rl_misc(socket) ((socket)->private[0])
|
||||
@@ -156,6 +160,35 @@ static void ricoh_set_zv(struct yenta_socket *socket)
|
||||
}
|
||||
}
|
||||
|
||||
static void ricoh_set_clkrun(struct yenta_socket *socket, bool quiet)
|
||||
{
|
||||
u16 misc3;
|
||||
|
||||
/*
|
||||
* RL5C475II likely has this setting, too, however no datasheet
|
||||
* is publicly available for this chip
|
||||
*/
|
||||
if (socket->dev->device != PCI_DEVICE_ID_RICOH_RL5C476 &&
|
||||
socket->dev->device != PCI_DEVICE_ID_RICOH_RL5C478)
|
||||
return;
|
||||
|
||||
if (socket->dev->revision < 0x80)
|
||||
return;
|
||||
|
||||
misc3 = config_readw(socket, RL5C4XX_MISC3);
|
||||
if (misc3 & RL5C47X_MISC3_CB_CLKRUN_DIS) {
|
||||
if (!quiet)
|
||||
dev_dbg(&socket->dev->dev,
|
||||
"CLKRUN feature already disabled\n");
|
||||
} else if (disable_clkrun) {
|
||||
if (!quiet)
|
||||
dev_info(&socket->dev->dev,
|
||||
"Disabling CLKRUN feature\n");
|
||||
misc3 |= RL5C47X_MISC3_CB_CLKRUN_DIS;
|
||||
config_writew(socket, RL5C4XX_MISC3, misc3);
|
||||
}
|
||||
}
|
||||
|
||||
static void ricoh_save_state(struct yenta_socket *socket)
|
||||
{
|
||||
rl_misc(socket) = config_readw(socket, RL5C4XX_MISC);
|
||||
@@ -172,6 +205,7 @@ static void ricoh_restore_state(struct yenta_socket *socket)
|
||||
config_writew(socket, RL5C4XX_16BIT_IO_0, rl_io(socket));
|
||||
config_writew(socket, RL5C4XX_16BIT_MEM_0, rl_mem(socket));
|
||||
config_writew(socket, RL5C4XX_CONFIG, rl_config(socket));
|
||||
ricoh_set_clkrun(socket, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -197,6 +231,7 @@ static int ricoh_override(struct yenta_socket *socket)
|
||||
config_writew(socket, RL5C4XX_CONFIG, config);
|
||||
|
||||
ricoh_set_zv(socket);
|
||||
ricoh_set_clkrun(socket, false);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,8 @@
|
||||
|
||||
static bool disable_clkrun;
|
||||
module_param(disable_clkrun, bool, 0444);
|
||||
MODULE_PARM_DESC(disable_clkrun, "If PC card doesn't function properly, please try this option");
|
||||
MODULE_PARM_DESC(disable_clkrun,
|
||||
"If PC card doesn't function properly, please try this option (TI and Ricoh bridges only)");
|
||||
|
||||
static bool isa_probe = 1;
|
||||
module_param(isa_probe, bool, 0444);
|
||||
|
||||
@@ -319,6 +319,8 @@ static int pmic_mpp_set_mux(struct pinctrl_dev *pctldev, unsigned function,
|
||||
pad->function = function;
|
||||
|
||||
ret = pmic_mpp_write_mode_ctl(state, pad);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
val = pad->is_enabled << PMIC_MPP_REG_MASTER_EN_SHIFT;
|
||||
|
||||
@@ -343,13 +345,12 @@ static int pmic_mpp_config_get(struct pinctrl_dev *pctldev,
|
||||
|
||||
switch (param) {
|
||||
case PIN_CONFIG_BIAS_DISABLE:
|
||||
arg = pad->pullup == PMIC_MPP_PULL_UP_OPEN;
|
||||
if (pad->pullup != PMIC_MPP_PULL_UP_OPEN)
|
||||
return -EINVAL;
|
||||
arg = 1;
|
||||
break;
|
||||
case PIN_CONFIG_BIAS_PULL_UP:
|
||||
switch (pad->pullup) {
|
||||
case PMIC_MPP_PULL_UP_OPEN:
|
||||
arg = 0;
|
||||
break;
|
||||
case PMIC_MPP_PULL_UP_0P6KOHM:
|
||||
arg = 600;
|
||||
break;
|
||||
@@ -364,13 +365,17 @@ static int pmic_mpp_config_get(struct pinctrl_dev *pctldev,
|
||||
}
|
||||
break;
|
||||
case PIN_CONFIG_BIAS_HIGH_IMPEDANCE:
|
||||
arg = !pad->is_enabled;
|
||||
if (pad->is_enabled)
|
||||
return -EINVAL;
|
||||
arg = 1;
|
||||
break;
|
||||
case PIN_CONFIG_POWER_SOURCE:
|
||||
arg = pad->power_source;
|
||||
break;
|
||||
case PIN_CONFIG_INPUT_ENABLE:
|
||||
arg = pad->input_enabled;
|
||||
if (!pad->input_enabled)
|
||||
return -EINVAL;
|
||||
arg = 1;
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
arg = pad->out_value;
|
||||
@@ -382,7 +387,9 @@ static int pmic_mpp_config_get(struct pinctrl_dev *pctldev,
|
||||
arg = pad->amux_input;
|
||||
break;
|
||||
case PMIC_MPP_CONF_PAIRED:
|
||||
arg = pad->paired;
|
||||
if (!pad->paired)
|
||||
return -EINVAL;
|
||||
arg = 1;
|
||||
break;
|
||||
case PIN_CONFIG_DRIVE_STRENGTH:
|
||||
arg = pad->drive_strength;
|
||||
@@ -455,7 +462,7 @@ static int pmic_mpp_config_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
||||
pad->dtest = arg;
|
||||
break;
|
||||
case PIN_CONFIG_DRIVE_STRENGTH:
|
||||
arg = pad->drive_strength;
|
||||
pad->drive_strength = arg;
|
||||
break;
|
||||
case PMIC_MPP_CONF_AMUX_ROUTE:
|
||||
if (arg >= PMIC_MPP_AMUX_ROUTE_ABUS4)
|
||||
@@ -502,6 +509,10 @@ static int pmic_mpp_config_set(struct pinctrl_dev *pctldev, unsigned int pin,
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = pmic_mpp_write(state, pad, PMIC_MPP_REG_SINK_CTL, pad->drive_strength);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
val = pad->is_enabled << PMIC_MPP_REG_MASTER_EN_SHIFT;
|
||||
|
||||
return pmic_mpp_write(state, pad, PMIC_MPP_REG_EN_CTL, val);
|
||||
|
||||
@@ -260,22 +260,32 @@ static int pm8xxx_pin_config_get(struct pinctrl_dev *pctldev,
|
||||
|
||||
switch (param) {
|
||||
case PIN_CONFIG_BIAS_DISABLE:
|
||||
arg = pin->bias == PM8XXX_GPIO_BIAS_NP;
|
||||
if (pin->bias != PM8XXX_GPIO_BIAS_NP)
|
||||
return -EINVAL;
|
||||
arg = 1;
|
||||
break;
|
||||
case PIN_CONFIG_BIAS_PULL_DOWN:
|
||||
arg = pin->bias == PM8XXX_GPIO_BIAS_PD;
|
||||
if (pin->bias != PM8XXX_GPIO_BIAS_PD)
|
||||
return -EINVAL;
|
||||
arg = 1;
|
||||
break;
|
||||
case PIN_CONFIG_BIAS_PULL_UP:
|
||||
arg = pin->bias <= PM8XXX_GPIO_BIAS_PU_1P5_30;
|
||||
if (pin->bias > PM8XXX_GPIO_BIAS_PU_1P5_30)
|
||||
return -EINVAL;
|
||||
arg = 1;
|
||||
break;
|
||||
case PM8XXX_QCOM_PULL_UP_STRENGTH:
|
||||
arg = pin->pull_up_strength;
|
||||
break;
|
||||
case PIN_CONFIG_BIAS_HIGH_IMPEDANCE:
|
||||
arg = pin->disable;
|
||||
if (!pin->disable)
|
||||
return -EINVAL;
|
||||
arg = 1;
|
||||
break;
|
||||
case PIN_CONFIG_INPUT_ENABLE:
|
||||
arg = pin->mode == PM8XXX_GPIO_MODE_INPUT;
|
||||
if (pin->mode != PM8XXX_GPIO_MODE_INPUT)
|
||||
return -EINVAL;
|
||||
arg = 1;
|
||||
break;
|
||||
case PIN_CONFIG_OUTPUT:
|
||||
if (pin->mode & PM8XXX_GPIO_MODE_OUTPUT)
|
||||
@@ -290,10 +300,14 @@ static int pm8xxx_pin_config_get(struct pinctrl_dev *pctldev,
|
||||
arg = pin->output_strength;
|
||||
break;
|
||||
case PIN_CONFIG_DRIVE_PUSH_PULL:
|
||||
arg = !pin->open_drain;
|
||||
if (pin->open_drain)
|
||||
return -EINVAL;
|
||||
arg = 1;
|
||||
break;
|
||||
case PIN_CONFIG_DRIVE_OPEN_DRAIN:
|
||||
arg = pin->open_drain;
|
||||
if (!pin->open_drain)
|
||||
return -EINVAL;
|
||||
arg = 1;
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
|
||||
@@ -1012,8 +1012,10 @@ static struct qcom_smd_channel *qcom_smd_create_channel(struct qcom_smd_edge *ed
|
||||
|
||||
channel->edge = edge;
|
||||
channel->name = kstrdup(name, GFP_KERNEL);
|
||||
if (!channel->name)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
if (!channel->name) {
|
||||
ret = -ENOMEM;
|
||||
goto free_channel;
|
||||
}
|
||||
|
||||
mutex_init(&channel->tx_lock);
|
||||
spin_lock_init(&channel->recv_lock);
|
||||
@@ -1062,6 +1064,7 @@ static struct qcom_smd_channel *qcom_smd_create_channel(struct qcom_smd_edge *ed
|
||||
|
||||
free_name_and_channel:
|
||||
kfree(channel->name);
|
||||
free_channel:
|
||||
kfree(channel);
|
||||
|
||||
return ERR_PTR(ret);
|
||||
|
||||
@@ -1349,6 +1349,7 @@ static int esp_data_bytes_sent(struct esp *esp, struct esp_cmd_entry *ent,
|
||||
|
||||
bytes_sent = esp->data_dma_len;
|
||||
bytes_sent -= ecount;
|
||||
bytes_sent -= esp->send_cmd_residual;
|
||||
|
||||
/*
|
||||
* The am53c974 has a DMA 'pecularity'. The doc states:
|
||||
|
||||
@@ -540,6 +540,8 @@ struct esp {
|
||||
|
||||
void *dma;
|
||||
int dmarev;
|
||||
|
||||
u32 send_cmd_residual;
|
||||
};
|
||||
|
||||
/* A front-end driver for the ESP chip should do the following in
|
||||
|
||||
@@ -3512,6 +3512,7 @@ lpfc_sli_handle_slow_ring_event_s4(struct lpfc_hba *phba,
|
||||
struct hbq_dmabuf *dmabuf;
|
||||
struct lpfc_cq_event *cq_event;
|
||||
unsigned long iflag;
|
||||
int count = 0;
|
||||
|
||||
spin_lock_irqsave(&phba->hbalock, iflag);
|
||||
phba->hba_flag &= ~HBA_SP_QUEUE_EVT;
|
||||
@@ -3533,16 +3534,22 @@ lpfc_sli_handle_slow_ring_event_s4(struct lpfc_hba *phba,
|
||||
if (irspiocbq)
|
||||
lpfc_sli_sp_handle_rspiocb(phba, pring,
|
||||
irspiocbq);
|
||||
count++;
|
||||
break;
|
||||
case CQE_CODE_RECEIVE:
|
||||
case CQE_CODE_RECEIVE_V1:
|
||||
dmabuf = container_of(cq_event, struct hbq_dmabuf,
|
||||
cq_event);
|
||||
lpfc_sli4_handle_received_buffer(phba, dmabuf);
|
||||
count++;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* Limit the number of events to 64 to avoid soft lockups */
|
||||
if (count == 64)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -426,6 +426,8 @@ static void mac_esp_send_pio_cmd(struct esp *esp, u32 addr, u32 esp_count,
|
||||
scsi_esp_cmd(esp, ESP_CMD_TI);
|
||||
}
|
||||
}
|
||||
|
||||
esp->send_cmd_residual = esp_count;
|
||||
}
|
||||
|
||||
static int mac_esp_irq_pending(struct esp *esp)
|
||||
|
||||
@@ -6901,6 +6901,9 @@ static int megasas_mgmt_compat_ioctl_fw(struct file *file, unsigned long arg)
|
||||
get_user(user_sense_off, &cioc->sense_off))
|
||||
return -EFAULT;
|
||||
|
||||
if (local_sense_off != user_sense_off)
|
||||
return -EINVAL;
|
||||
|
||||
if (local_sense_len) {
|
||||
void __user **sense_ioc_ptr =
|
||||
(void __user **)((u8 *)((unsigned long)&ioc->frame.raw) + local_sense_off);
|
||||
|
||||
@@ -1189,7 +1189,7 @@ static void tegra_pmc_init_tsense_reset(struct tegra_pmc *pmc)
|
||||
if (!pmc->soc->has_tsense_reset)
|
||||
return;
|
||||
|
||||
np = of_find_node_by_name(pmc->dev->of_node, "i2c-thermtrip");
|
||||
np = of_get_child_by_name(pmc->dev->of_node, "i2c-thermtrip");
|
||||
if (!np) {
|
||||
dev_warn(dev, "i2c-thermtrip node not found, %s.\n", disabled);
|
||||
return;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* TURBOchannel bus services.
|
||||
*
|
||||
* Copyright (c) Harald Koerfgen, 1998
|
||||
* Copyright (c) 2001, 2003, 2005, 2006 Maciej W. Rozycki
|
||||
* Copyright (c) 2001, 2003, 2005, 2006, 2018 Maciej W. Rozycki
|
||||
* Copyright (c) 2005 James Simmons
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU
|
||||
@@ -10,6 +10,7 @@
|
||||
* directory of this archive for more details.
|
||||
*/
|
||||
#include <linux/compiler.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/ioport.h>
|
||||
@@ -92,6 +93,11 @@ static void __init tc_bus_add_devices(struct tc_bus *tbus)
|
||||
tdev->dev.bus = &tc_bus_type;
|
||||
tdev->slot = slot;
|
||||
|
||||
/* TURBOchannel has 34-bit DMA addressing (16GiB space). */
|
||||
tdev->dma_mask = DMA_BIT_MASK(34);
|
||||
tdev->dev.dma_mask = &tdev->dma_mask;
|
||||
tdev->dev.coherent_dma_mask = DMA_BIT_MASK(34);
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
tdev->firmware[i] =
|
||||
readb(module + offset + TC_FIRM_VER + 4 * i);
|
||||
|
||||
@@ -133,6 +133,11 @@ static void kgdboc_unregister_kbd(void)
|
||||
|
||||
static int kgdboc_option_setup(char *opt)
|
||||
{
|
||||
if (!opt) {
|
||||
pr_err("kgdboc: config string not provided\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (strlen(opt) >= MAX_CONFIG_LEN) {
|
||||
printk(KERN_ERR "kgdboc: config string too long\n");
|
||||
return -ENOSPC;
|
||||
|
||||
@@ -249,6 +249,8 @@ static struct class uio_class = {
|
||||
.dev_groups = uio_groups,
|
||||
};
|
||||
|
||||
bool uio_class_registered;
|
||||
|
||||
/*
|
||||
* device functions
|
||||
*/
|
||||
@@ -780,6 +782,9 @@ static int init_uio_class(void)
|
||||
printk(KERN_ERR "class_register failed for uio\n");
|
||||
goto err_class_register;
|
||||
}
|
||||
|
||||
uio_class_registered = true;
|
||||
|
||||
return 0;
|
||||
|
||||
err_class_register:
|
||||
@@ -790,6 +795,7 @@ exit:
|
||||
|
||||
static void release_uio_class(void)
|
||||
{
|
||||
uio_class_registered = false;
|
||||
class_unregister(&uio_class);
|
||||
uio_major_cleanup();
|
||||
}
|
||||
@@ -809,6 +815,9 @@ int __uio_register_device(struct module *owner,
|
||||
struct uio_device *idev;
|
||||
int ret = 0;
|
||||
|
||||
if (!uio_class_registered)
|
||||
return -EPROBE_DEFER;
|
||||
|
||||
if (!parent || !info || !info->name || !info->version)
|
||||
return -EINVAL;
|
||||
|
||||
|
||||
@@ -20,7 +20,8 @@ void ci_handle_vbus_change(struct ci_hdrc *ci);
|
||||
static inline void ci_otg_queue_work(struct ci_hdrc *ci)
|
||||
{
|
||||
disable_irq_nosync(ci->irq);
|
||||
queue_work(ci->wq, &ci->work);
|
||||
if (queue_work(ci->wq, &ci->work) == false)
|
||||
enable_irq(ci->irq);
|
||||
}
|
||||
|
||||
#endif /* __DRIVERS_USB_CHIPIDEA_OTG_H */
|
||||
|
||||
@@ -1922,6 +1922,8 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev,
|
||||
|
||||
udc->errata = match->data;
|
||||
udc->pmc = syscon_regmap_lookup_by_compatible("atmel,at91sam9g45-pmc");
|
||||
if (IS_ERR(udc->pmc))
|
||||
udc->pmc = syscon_regmap_lookup_by_compatible("atmel,at91sam9rl-pmc");
|
||||
if (IS_ERR(udc->pmc))
|
||||
udc->pmc = syscon_regmap_lookup_by_compatible("atmel,at91sam9x5-pmc");
|
||||
if (udc->errata && IS_ERR(udc->pmc))
|
||||
|
||||
@@ -85,6 +85,10 @@ static int __init init(void)
|
||||
cleanup:
|
||||
list_for_each_entry_safe(udc_dev, udc_dev2, &vudc_devices, dev_entry) {
|
||||
list_del(&udc_dev->dev_entry);
|
||||
/*
|
||||
* Just do platform_device_del() here, put_vudc_device()
|
||||
* calls the platform_device_put()
|
||||
*/
|
||||
platform_device_del(udc_dev->pdev);
|
||||
put_vudc_device(udc_dev);
|
||||
}
|
||||
@@ -101,7 +105,11 @@ static void __exit cleanup(void)
|
||||
|
||||
list_for_each_entry_safe(udc_dev, udc_dev2, &vudc_devices, dev_entry) {
|
||||
list_del(&udc_dev->dev_entry);
|
||||
platform_device_unregister(udc_dev->pdev);
|
||||
/*
|
||||
* Just do platform_device_del() here, put_vudc_device()
|
||||
* calls the platform_device_put()
|
||||
*/
|
||||
platform_device_del(udc_dev->pdev);
|
||||
put_vudc_device(udc_dev);
|
||||
}
|
||||
platform_driver_unregister(&vudc_driver);
|
||||
|
||||
@@ -784,6 +784,8 @@ static int omap_hdq_remove(struct platform_device *pdev)
|
||||
/* remove module dependency */
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
|
||||
w1_remove_master_device(&omap_w1_master);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -310,6 +310,9 @@ xen_swiotlb_alloc_coherent(struct device *hwdev, size_t size,
|
||||
*/
|
||||
flags &= ~(__GFP_DMA | __GFP_HIGHMEM);
|
||||
|
||||
/* Convert the size to actually allocated. */
|
||||
size = 1UL << (order + XEN_PAGE_SHIFT);
|
||||
|
||||
/* On ARM this function returns an ioremap'ped virtual address for
|
||||
* which virt_to_phys doesn't return the corresponding physical
|
||||
* address. In fact on ARM virt_to_phys only works for kernel direct
|
||||
@@ -359,6 +362,9 @@ xen_swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr,
|
||||
* physical address */
|
||||
phys = xen_bus_to_phys(dev_addr);
|
||||
|
||||
/* Convert the size to actually allocated. */
|
||||
size = 1UL << (order + XEN_PAGE_SHIFT);
|
||||
|
||||
if (((dev_addr + size - 1 <= dma_mask)) ||
|
||||
range_straddles_page_boundary(phys, size))
|
||||
xen_destroy_contiguous_region(phys, order);
|
||||
|
||||
@@ -8263,6 +8263,19 @@ btrfs_init_new_buffer(struct btrfs_trans_handle *trans, struct btrfs_root *root,
|
||||
if (IS_ERR(buf))
|
||||
return buf;
|
||||
|
||||
/*
|
||||
* Extra safety check in case the extent tree is corrupted and extent
|
||||
* allocator chooses to use a tree block which is already used and
|
||||
* locked.
|
||||
*/
|
||||
if (buf->lock_owner == current->pid) {
|
||||
btrfs_err_rl(root->fs_info,
|
||||
"tree block %llu owner %llu already locked by pid=%d, extent tree corruption detected",
|
||||
buf->start, btrfs_header_owner(buf), current->pid);
|
||||
free_extent_buffer(buf);
|
||||
return ERR_PTR(-EUCLEAN);
|
||||
}
|
||||
|
||||
btrfs_set_header_generation(buf, trans->transid);
|
||||
btrfs_set_buffer_lockdep_class(root->root_key.objectid, buf, level);
|
||||
btrfs_tree_lock(buf);
|
||||
@@ -9100,15 +9113,14 @@ static noinline int walk_up_proc(struct btrfs_trans_handle *trans,
|
||||
if (eb == root->node) {
|
||||
if (wc->flags[level] & BTRFS_BLOCK_FLAG_FULL_BACKREF)
|
||||
parent = eb->start;
|
||||
else
|
||||
BUG_ON(root->root_key.objectid !=
|
||||
btrfs_header_owner(eb));
|
||||
else if (root->root_key.objectid != btrfs_header_owner(eb))
|
||||
goto owner_mismatch;
|
||||
} else {
|
||||
if (wc->flags[level + 1] & BTRFS_BLOCK_FLAG_FULL_BACKREF)
|
||||
parent = path->nodes[level + 1]->start;
|
||||
else
|
||||
BUG_ON(root->root_key.objectid !=
|
||||
btrfs_header_owner(path->nodes[level + 1]));
|
||||
else if (root->root_key.objectid !=
|
||||
btrfs_header_owner(path->nodes[level + 1]))
|
||||
goto owner_mismatch;
|
||||
}
|
||||
|
||||
btrfs_free_tree_block(trans, root, eb, parent, wc->refs[level] == 1);
|
||||
@@ -9116,6 +9128,11 @@ out:
|
||||
wc->refs[level] = 0;
|
||||
wc->flags[level] = 0;
|
||||
return 0;
|
||||
|
||||
owner_mismatch:
|
||||
btrfs_err_rl(root->fs_info, "unexpected tree owner, have %llu expect %llu",
|
||||
btrfs_header_owner(eb), root->root_key.objectid);
|
||||
return -EUCLEAN;
|
||||
}
|
||||
|
||||
static noinline int walk_down_tree(struct btrfs_trans_handle *trans,
|
||||
@@ -9169,6 +9186,8 @@ static noinline int walk_up_tree(struct btrfs_trans_handle *trans,
|
||||
ret = walk_up_proc(trans, root, path, wc);
|
||||
if (ret > 0)
|
||||
return 0;
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (path->locks[level]) {
|
||||
btrfs_tree_unlock_rw(path->nodes[level],
|
||||
@@ -9933,6 +9952,7 @@ void btrfs_put_block_group_cache(struct btrfs_fs_info *info)
|
||||
|
||||
block_group = btrfs_lookup_first_block_group(info, last);
|
||||
while (block_group) {
|
||||
wait_block_group_cache_done(block_group);
|
||||
spin_lock(&block_group->lock);
|
||||
if (block_group->iref)
|
||||
break;
|
||||
@@ -10332,7 +10352,7 @@ error:
|
||||
void btrfs_create_pending_block_groups(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_root *root)
|
||||
{
|
||||
struct btrfs_block_group_cache *block_group, *tmp;
|
||||
struct btrfs_block_group_cache *block_group;
|
||||
struct btrfs_root *extent_root = root->fs_info->extent_root;
|
||||
struct btrfs_block_group_item item;
|
||||
struct btrfs_key key;
|
||||
@@ -10340,7 +10360,10 @@ void btrfs_create_pending_block_groups(struct btrfs_trans_handle *trans,
|
||||
bool can_flush_pending_bgs = trans->can_flush_pending_bgs;
|
||||
|
||||
trans->can_flush_pending_bgs = false;
|
||||
list_for_each_entry_safe(block_group, tmp, &trans->new_bgs, bg_list) {
|
||||
while (!list_empty(&trans->new_bgs)) {
|
||||
block_group = list_first_entry(&trans->new_bgs,
|
||||
struct btrfs_block_group_cache,
|
||||
bg_list);
|
||||
if (ret)
|
||||
goto next;
|
||||
|
||||
@@ -11052,6 +11075,10 @@ static int btrfs_trim_free_extents(struct btrfs_device *device,
|
||||
|
||||
*trimmed = 0;
|
||||
|
||||
/* Discard not supported = nothing to do. */
|
||||
if (!blk_queue_discard(bdev_get_queue(device->bdev)))
|
||||
return 0;
|
||||
|
||||
/* Not writeable = nothing to do. */
|
||||
if (!device->writeable)
|
||||
return 0;
|
||||
@@ -11174,8 +11201,8 @@ int btrfs_trim_fs(struct btrfs_root *root, struct fstrim_range *range)
|
||||
}
|
||||
|
||||
mutex_lock(&root->fs_info->fs_devices->device_list_mutex);
|
||||
devices = &root->fs_info->fs_devices->alloc_list;
|
||||
list_for_each_entry(device, devices, dev_alloc_list) {
|
||||
devices = &root->fs_info->fs_devices->devices;
|
||||
list_for_each_entry(device, devices, dev_list) {
|
||||
ret = btrfs_trim_free_extents(device, range->minlen,
|
||||
&group_trimmed);
|
||||
if (ret)
|
||||
|
||||
@@ -1693,6 +1693,8 @@ static inline void __bitmap_clear_bits(struct btrfs_free_space_ctl *ctl,
|
||||
bitmap_clear(info->bitmap, start, count);
|
||||
|
||||
info->bytes -= bytes;
|
||||
if (info->max_extent_size > ctl->unit)
|
||||
info->max_extent_size = 0;
|
||||
}
|
||||
|
||||
static void bitmap_clear_bits(struct btrfs_free_space_ctl *ctl,
|
||||
@@ -1776,6 +1778,13 @@ static int search_bitmap(struct btrfs_free_space_ctl *ctl,
|
||||
return -1;
|
||||
}
|
||||
|
||||
static inline u64 get_max_extent_size(struct btrfs_free_space *entry)
|
||||
{
|
||||
if (entry->bitmap)
|
||||
return entry->max_extent_size;
|
||||
return entry->bytes;
|
||||
}
|
||||
|
||||
/* Cache the size of the max extent in bytes */
|
||||
static struct btrfs_free_space *
|
||||
find_free_space(struct btrfs_free_space_ctl *ctl, u64 *offset, u64 *bytes,
|
||||
@@ -1797,8 +1806,8 @@ find_free_space(struct btrfs_free_space_ctl *ctl, u64 *offset, u64 *bytes,
|
||||
for (node = &entry->offset_index; node; node = rb_next(node)) {
|
||||
entry = rb_entry(node, struct btrfs_free_space, offset_index);
|
||||
if (entry->bytes < *bytes) {
|
||||
if (entry->bytes > *max_extent_size)
|
||||
*max_extent_size = entry->bytes;
|
||||
*max_extent_size = max(get_max_extent_size(entry),
|
||||
*max_extent_size);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1816,8 +1825,8 @@ find_free_space(struct btrfs_free_space_ctl *ctl, u64 *offset, u64 *bytes,
|
||||
}
|
||||
|
||||
if (entry->bytes < *bytes + align_off) {
|
||||
if (entry->bytes > *max_extent_size)
|
||||
*max_extent_size = entry->bytes;
|
||||
*max_extent_size = max(get_max_extent_size(entry),
|
||||
*max_extent_size);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1829,8 +1838,10 @@ find_free_space(struct btrfs_free_space_ctl *ctl, u64 *offset, u64 *bytes,
|
||||
*offset = tmp;
|
||||
*bytes = size;
|
||||
return entry;
|
||||
} else if (size > *max_extent_size) {
|
||||
*max_extent_size = size;
|
||||
} else {
|
||||
*max_extent_size =
|
||||
max(get_max_extent_size(entry),
|
||||
*max_extent_size);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@@ -2689,8 +2700,8 @@ static u64 btrfs_alloc_from_bitmap(struct btrfs_block_group_cache *block_group,
|
||||
|
||||
err = search_bitmap(ctl, entry, &search_start, &search_bytes, true);
|
||||
if (err) {
|
||||
if (search_bytes > *max_extent_size)
|
||||
*max_extent_size = search_bytes;
|
||||
*max_extent_size = max(get_max_extent_size(entry),
|
||||
*max_extent_size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2727,8 +2738,9 @@ u64 btrfs_alloc_from_cluster(struct btrfs_block_group_cache *block_group,
|
||||
|
||||
entry = rb_entry(node, struct btrfs_free_space, offset_index);
|
||||
while (1) {
|
||||
if (entry->bytes < bytes && entry->bytes > *max_extent_size)
|
||||
*max_extent_size = entry->bytes;
|
||||
if (entry->bytes < bytes)
|
||||
*max_extent_size = max(get_max_extent_size(entry),
|
||||
*max_extent_size);
|
||||
|
||||
if (entry->bytes < bytes ||
|
||||
(!entry->bitmap && entry->offset < min_start)) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user