| 1 |
diff --git a/Documentation/stable_kernel_rules.txt b/Documentation/stable_kernel_rules.txt
|
| 2 |
index e1f856b..22bf11b 100644
|
| 3 |
--- a/Documentation/stable_kernel_rules.txt
|
| 4 |
+++ b/Documentation/stable_kernel_rules.txt
|
| 5 |
@@ -1,4 +1,4 @@
|
| 6 |
-Everything you ever wanted to know about Linux 2.6 -stable releases.
|
| 7 |
+Everything you ever wanted to know about Linux -stable releases.
|
| 8 |
|
| 9 |
Rules on what kind of patches are accepted, and which ones are not, into the
|
| 10 |
"-stable" tree:
|
| 11 |
@@ -41,10 +41,10 @@ Procedure for submitting patches to the -stable tree:
|
| 12 |
cherry-picked than this can be specified in the following format in
|
| 13 |
the sign-off area:
|
| 14 |
|
| 15 |
- Cc: <stable@vger.kernel.org> # .32.x: a1f84a3: sched: Check for idle
|
| 16 |
- Cc: <stable@vger.kernel.org> # .32.x: 1b9508f: sched: Rate-limit newidle
|
| 17 |
- Cc: <stable@vger.kernel.org> # .32.x: fd21073: sched: Fix affinity logic
|
| 18 |
- Cc: <stable@vger.kernel.org> # .32.x
|
| 19 |
+ Cc: <stable@vger.kernel.org> # 3.3.x: a1f84a3: sched: Check for idle
|
| 20 |
+ Cc: <stable@vger.kernel.org> # 3.3.x: 1b9508f: sched: Rate-limit newidle
|
| 21 |
+ Cc: <stable@vger.kernel.org> # 3.3.x: fd21073: sched: Fix affinity logic
|
| 22 |
+ Cc: <stable@vger.kernel.org> # 3.3.x
|
| 23 |
Signed-off-by: Ingo Molnar <mingo@elte.hu>
|
| 24 |
|
| 25 |
The tag sequence has the meaning of:
|
| 26 |
@@ -78,6 +78,15 @@ Review cycle:
|
| 27 |
security kernel team, and not go through the normal review cycle.
|
| 28 |
Contact the kernel security team for more details on this procedure.
|
| 29 |
|
| 30 |
+Trees:
|
| 31 |
+
|
| 32 |
+ - The queues of patches, for both completed versions and in progress
|
| 33 |
+ versions can be found at:
|
| 34 |
+ http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git
|
| 35 |
+ - The finalized and tagged releases of all stable kernels can be found
|
| 36 |
+ in separate branches per version at:
|
| 37 |
+ http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git
|
| 38 |
+
|
| 39 |
|
| 40 |
Review committee:
|
| 41 |
|
| 42 |
diff --git a/Makefile b/Makefile
|
| 43 |
index 3ec1722..ec4fee5 100644
|
| 44 |
--- a/Makefile
|
| 45 |
+++ b/Makefile
|
| 46 |
@@ -1,6 +1,6 @@
|
| 47 |
VERSION = 3
|
| 48 |
PATCHLEVEL = 0
|
| 49 |
-SUBLEVEL = 39
|
| 50 |
+SUBLEVEL = 40
|
| 51 |
EXTRAVERSION =
|
| 52 |
NAME = Sneaky Weasel
|
| 53 |
|
| 54 |
diff --git a/arch/arm/mach-omap2/opp.c b/arch/arm/mach-omap2/opp.c
|
| 55 |
index ab8b35b..0627494 100644
|
| 56 |
--- a/arch/arm/mach-omap2/opp.c
|
| 57 |
+++ b/arch/arm/mach-omap2/opp.c
|
| 58 |
@@ -53,7 +53,7 @@ int __init omap_init_opp_table(struct omap_opp_def *opp_def,
|
| 59 |
omap_table_init = 1;
|
| 60 |
|
| 61 |
/* Lets now register with OPP library */
|
| 62 |
- for (i = 0; i < opp_def_size; i++) {
|
| 63 |
+ for (i = 0; i < opp_def_size; i++, opp_def++) {
|
| 64 |
struct omap_hwmod *oh;
|
| 65 |
struct device *dev;
|
| 66 |
|
| 67 |
@@ -86,7 +86,6 @@ int __init omap_init_opp_table(struct omap_opp_def *opp_def,
|
| 68 |
__func__, opp_def->freq,
|
| 69 |
opp_def->hwmod_name, i, r);
|
| 70 |
}
|
| 71 |
- opp_def++;
|
| 72 |
}
|
| 73 |
|
| 74 |
return 0;
|
| 75 |
diff --git a/arch/m68k/include/asm/entry_mm.h b/arch/m68k/include/asm/entry_mm.h
|
| 76 |
index 73b8c8f..bdace4b 100644
|
| 77 |
--- a/arch/m68k/include/asm/entry_mm.h
|
| 78 |
+++ b/arch/m68k/include/asm/entry_mm.h
|
| 79 |
@@ -35,8 +35,8 @@
|
| 80 |
|
| 81 |
/* the following macro is used when enabling interrupts */
|
| 82 |
#if defined(MACH_ATARI_ONLY)
|
| 83 |
- /* block out HSYNC on the atari */
|
| 84 |
-#define ALLOWINT (~0x400)
|
| 85 |
+ /* block out HSYNC = ipl 2 on the atari */
|
| 86 |
+#define ALLOWINT (~0x500)
|
| 87 |
#define MAX_NOINT_IPL 3
|
| 88 |
#else
|
| 89 |
/* portable version */
|
| 90 |
diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c
|
| 91 |
index 8623f8d..9a5932e 100644
|
| 92 |
--- a/arch/m68k/kernel/sys_m68k.c
|
| 93 |
+++ b/arch/m68k/kernel/sys_m68k.c
|
| 94 |
@@ -479,9 +479,13 @@ sys_atomic_cmpxchg_32(unsigned long newval, int oldval, int d3, int d4, int d5,
|
| 95 |
goto bad_access;
|
| 96 |
}
|
| 97 |
|
| 98 |
- mem_value = *mem;
|
| 99 |
+ /*
|
| 100 |
+ * No need to check for EFAULT; we know that the page is
|
| 101 |
+ * present and writable.
|
| 102 |
+ */
|
| 103 |
+ __get_user(mem_value, mem);
|
| 104 |
if (mem_value == oldval)
|
| 105 |
- *mem = newval;
|
| 106 |
+ __put_user(newval, mem);
|
| 107 |
|
| 108 |
pte_unmap_unlock(pte, ptl);
|
| 109 |
up_read(&mm->mmap_sem);
|
| 110 |
diff --git a/arch/powerpc/include/asm/cputime.h b/arch/powerpc/include/asm/cputime.h
|
| 111 |
index 1cf20bd..33a3580 100644
|
| 112 |
--- a/arch/powerpc/include/asm/cputime.h
|
| 113 |
+++ b/arch/powerpc/include/asm/cputime.h
|
| 114 |
@@ -126,11 +126,11 @@ static inline u64 cputime64_to_jiffies64(const cputime_t ct)
|
| 115 |
/*
|
| 116 |
* Convert cputime <-> microseconds
|
| 117 |
*/
|
| 118 |
-extern u64 __cputime_msec_factor;
|
| 119 |
+extern u64 __cputime_usec_factor;
|
| 120 |
|
| 121 |
static inline unsigned long cputime_to_usecs(const cputime_t ct)
|
| 122 |
{
|
| 123 |
- return mulhdu(ct, __cputime_msec_factor) * USEC_PER_MSEC;
|
| 124 |
+ return mulhdu(ct, __cputime_usec_factor);
|
| 125 |
}
|
| 126 |
|
| 127 |
static inline cputime_t usecs_to_cputime(const unsigned long us)
|
| 128 |
@@ -143,7 +143,7 @@ static inline cputime_t usecs_to_cputime(const unsigned long us)
|
| 129 |
sec = us / 1000000;
|
| 130 |
if (ct) {
|
| 131 |
ct *= tb_ticks_per_sec;
|
| 132 |
- do_div(ct, 1000);
|
| 133 |
+ do_div(ct, 1000000);
|
| 134 |
}
|
| 135 |
if (sec)
|
| 136 |
ct += (cputime_t) sec * tb_ticks_per_sec;
|
| 137 |
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
|
| 138 |
index c5cae0d..764e99c 100644
|
| 139 |
--- a/arch/powerpc/include/asm/reg.h
|
| 140 |
+++ b/arch/powerpc/include/asm/reg.h
|
| 141 |
@@ -1000,7 +1000,8 @@
|
| 142 |
/* Macros for setting and retrieving special purpose registers */
|
| 143 |
#ifndef __ASSEMBLY__
|
| 144 |
#define mfmsr() ({unsigned long rval; \
|
| 145 |
- asm volatile("mfmsr %0" : "=r" (rval)); rval;})
|
| 146 |
+ asm volatile("mfmsr %0" : "=r" (rval) : \
|
| 147 |
+ : "memory"); rval;})
|
| 148 |
#ifdef CONFIG_PPC_BOOK3S_64
|
| 149 |
#define __mtmsrd(v, l) asm volatile("mtmsrd %0," __stringify(l) \
|
| 150 |
: : "r" (v) : "memory")
|
| 151 |
diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c
|
| 152 |
index bf99cfa..6324008 100644
|
| 153 |
--- a/arch/powerpc/kernel/ftrace.c
|
| 154 |
+++ b/arch/powerpc/kernel/ftrace.c
|
| 155 |
@@ -245,9 +245,9 @@ __ftrace_make_nop(struct module *mod,
|
| 156 |
|
| 157 |
/*
|
| 158 |
* On PPC32 the trampoline looks like:
|
| 159 |
- * 0x3d, 0x60, 0x00, 0x00 lis r11,sym@ha
|
| 160 |
- * 0x39, 0x6b, 0x00, 0x00 addi r11,r11,sym@l
|
| 161 |
- * 0x7d, 0x69, 0x03, 0xa6 mtctr r11
|
| 162 |
+ * 0x3d, 0x80, 0x00, 0x00 lis r12,sym@ha
|
| 163 |
+ * 0x39, 0x8c, 0x00, 0x00 addi r12,r12,sym@l
|
| 164 |
+ * 0x7d, 0x89, 0x03, 0xa6 mtctr r12
|
| 165 |
* 0x4e, 0x80, 0x04, 0x20 bctr
|
| 166 |
*/
|
| 167 |
|
| 168 |
@@ -262,9 +262,9 @@ __ftrace_make_nop(struct module *mod,
|
| 169 |
pr_devel(" %08x %08x ", jmp[0], jmp[1]);
|
| 170 |
|
| 171 |
/* verify that this is what we expect it to be */
|
| 172 |
- if (((jmp[0] & 0xffff0000) != 0x3d600000) ||
|
| 173 |
- ((jmp[1] & 0xffff0000) != 0x396b0000) ||
|
| 174 |
- (jmp[2] != 0x7d6903a6) ||
|
| 175 |
+ if (((jmp[0] & 0xffff0000) != 0x3d800000) ||
|
| 176 |
+ ((jmp[1] & 0xffff0000) != 0x398c0000) ||
|
| 177 |
+ (jmp[2] != 0x7d8903a6) ||
|
| 178 |
(jmp[3] != 0x4e800420)) {
|
| 179 |
printk(KERN_ERR "Not a trampoline\n");
|
| 180 |
return -EINVAL;
|
| 181 |
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
|
| 182 |
index 2de304a..1becd7b 100644
|
| 183 |
--- a/arch/powerpc/kernel/time.c
|
| 184 |
+++ b/arch/powerpc/kernel/time.c
|
| 185 |
@@ -168,13 +168,13 @@ EXPORT_SYMBOL_GPL(ppc_tb_freq);
|
| 186 |
#ifdef CONFIG_VIRT_CPU_ACCOUNTING
|
| 187 |
/*
|
| 188 |
* Factors for converting from cputime_t (timebase ticks) to
|
| 189 |
- * jiffies, milliseconds, seconds, and clock_t (1/USER_HZ seconds).
|
| 190 |
+ * jiffies, microseconds, seconds, and clock_t (1/USER_HZ seconds).
|
| 191 |
* These are all stored as 0.64 fixed-point binary fractions.
|
| 192 |
*/
|
| 193 |
u64 __cputime_jiffies_factor;
|
| 194 |
EXPORT_SYMBOL(__cputime_jiffies_factor);
|
| 195 |
-u64 __cputime_msec_factor;
|
| 196 |
-EXPORT_SYMBOL(__cputime_msec_factor);
|
| 197 |
+u64 __cputime_usec_factor;
|
| 198 |
+EXPORT_SYMBOL(__cputime_usec_factor);
|
| 199 |
u64 __cputime_sec_factor;
|
| 200 |
EXPORT_SYMBOL(__cputime_sec_factor);
|
| 201 |
u64 __cputime_clockt_factor;
|
| 202 |
@@ -192,8 +192,8 @@ static void calc_cputime_factors(void)
|
| 203 |
|
| 204 |
div128_by_32(HZ, 0, tb_ticks_per_sec, &res);
|
| 205 |
__cputime_jiffies_factor = res.result_low;
|
| 206 |
- div128_by_32(1000, 0, tb_ticks_per_sec, &res);
|
| 207 |
- __cputime_msec_factor = res.result_low;
|
| 208 |
+ div128_by_32(1000000, 0, tb_ticks_per_sec, &res);
|
| 209 |
+ __cputime_usec_factor = res.result_low;
|
| 210 |
div128_by_32(1, 0, tb_ticks_per_sec, &res);
|
| 211 |
__cputime_sec_factor = res.result_low;
|
| 212 |
div128_by_32(USER_HZ, 0, tb_ticks_per_sec, &res);
|
| 213 |
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c
|
| 214 |
index 58c3f74..9582050 100644
|
| 215 |
--- a/drivers/acpi/ac.c
|
| 216 |
+++ b/drivers/acpi/ac.c
|
| 217 |
@@ -292,7 +292,9 @@ static int acpi_ac_add(struct acpi_device *device)
|
| 218 |
ac->charger.properties = ac_props;
|
| 219 |
ac->charger.num_properties = ARRAY_SIZE(ac_props);
|
| 220 |
ac->charger.get_property = get_ac_property;
|
| 221 |
- power_supply_register(&ac->device->dev, &ac->charger);
|
| 222 |
+ result = power_supply_register(&ac->device->dev, &ac->charger);
|
| 223 |
+ if (result)
|
| 224 |
+ goto end;
|
| 225 |
|
| 226 |
printk(KERN_INFO PREFIX "%s [%s] (%s)\n",
|
| 227 |
acpi_device_name(device), acpi_device_bid(device),
|
| 228 |
diff --git a/drivers/gpu/drm/radeon/atombios_dp.c b/drivers/gpu/drm/radeon/atombios_dp.c
|
| 229 |
index 3b77ad6..efc2b21 100644
|
| 230 |
--- a/drivers/gpu/drm/radeon/atombios_dp.c
|
| 231 |
+++ b/drivers/gpu/drm/radeon/atombios_dp.c
|
| 232 |
@@ -22,6 +22,7 @@
|
| 233 |
*
|
| 234 |
* Authors: Dave Airlie
|
| 235 |
* Alex Deucher
|
| 236 |
+ * Jerome Glisse
|
| 237 |
*/
|
| 238 |
#include "drmP.h"
|
| 239 |
#include "radeon_drm.h"
|
| 240 |
@@ -624,7 +625,6 @@ static bool radeon_dp_get_link_status(struct radeon_connector *radeon_connector,
|
| 241 |
ret = radeon_dp_aux_native_read(radeon_connector, DP_LANE0_1_STATUS,
|
| 242 |
link_status, DP_LINK_STATUS_SIZE, 100);
|
| 243 |
if (ret <= 0) {
|
| 244 |
- DRM_ERROR("displayport link status failed\n");
|
| 245 |
return false;
|
| 246 |
}
|
| 247 |
|
| 248 |
@@ -797,8 +797,10 @@ static int radeon_dp_link_train_cr(struct radeon_dp_link_train_info *dp_info)
|
| 249 |
else
|
| 250 |
mdelay(dp_info->rd_interval * 4);
|
| 251 |
|
| 252 |
- if (!radeon_dp_get_link_status(dp_info->radeon_connector, dp_info->link_status))
|
| 253 |
+ if (!radeon_dp_get_link_status(dp_info->radeon_connector, dp_info->link_status)) {
|
| 254 |
+ DRM_ERROR("displayport link status failed\n");
|
| 255 |
break;
|
| 256 |
+ }
|
| 257 |
|
| 258 |
if (dp_clock_recovery_ok(dp_info->link_status, dp_info->dp_lane_count)) {
|
| 259 |
clock_recovery = true;
|
| 260 |
@@ -860,8 +862,10 @@ static int radeon_dp_link_train_ce(struct radeon_dp_link_train_info *dp_info)
|
| 261 |
else
|
| 262 |
mdelay(dp_info->rd_interval * 4);
|
| 263 |
|
| 264 |
- if (!radeon_dp_get_link_status(dp_info->radeon_connector, dp_info->link_status))
|
| 265 |
+ if (!radeon_dp_get_link_status(dp_info->radeon_connector, dp_info->link_status)) {
|
| 266 |
+ DRM_ERROR("displayport link status failed\n");
|
| 267 |
break;
|
| 268 |
+ }
|
| 269 |
|
| 270 |
if (dp_channel_eq_ok(dp_info->link_status, dp_info->dp_lane_count)) {
|
| 271 |
channel_eq = true;
|
| 272 |
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
|
| 273 |
index 1f6a0f5..f1a1e8a 100644
|
| 274 |
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
|
| 275 |
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
|
| 276 |
@@ -66,14 +66,33 @@ void radeon_connector_hotplug(struct drm_connector *connector)
|
| 277 |
|
| 278 |
/* just deal with DP (not eDP) here. */
|
| 279 |
if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort) {
|
| 280 |
- int saved_dpms = connector->dpms;
|
| 281 |
-
|
| 282 |
- /* Only turn off the display it it's physically disconnected */
|
| 283 |
- if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd))
|
| 284 |
- drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF);
|
| 285 |
- else if (radeon_dp_needs_link_train(radeon_connector))
|
| 286 |
- drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
|
| 287 |
- connector->dpms = saved_dpms;
|
| 288 |
+ struct radeon_connector_atom_dig *dig_connector =
|
| 289 |
+ radeon_connector->con_priv;
|
| 290 |
+
|
| 291 |
+ /* if existing sink type was not DP no need to retrain */
|
| 292 |
+ if (dig_connector->dp_sink_type != CONNECTOR_OBJECT_ID_DISPLAYPORT)
|
| 293 |
+ return;
|
| 294 |
+
|
| 295 |
+ /* first get sink type as it may be reset after (un)plug */
|
| 296 |
+ dig_connector->dp_sink_type = radeon_dp_getsinktype(radeon_connector);
|
| 297 |
+ /* don't do anything if sink is not display port, i.e.,
|
| 298 |
+ * passive dp->(dvi|hdmi) adaptor
|
| 299 |
+ */
|
| 300 |
+ if (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) {
|
| 301 |
+ int saved_dpms = connector->dpms;
|
| 302 |
+ /* Only turn off the display if it's physically disconnected */
|
| 303 |
+ if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) {
|
| 304 |
+ drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF);
|
| 305 |
+ } else if (radeon_dp_needs_link_train(radeon_connector)) {
|
| 306 |
+ /* set it to OFF so that drm_helper_connector_dpms()
|
| 307 |
+ * won't return immediately since the current state
|
| 308 |
+ * is ON at this point.
|
| 309 |
+ */
|
| 310 |
+ connector->dpms = DRM_MODE_DPMS_OFF;
|
| 311 |
+ drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
|
| 312 |
+ }
|
| 313 |
+ connector->dpms = saved_dpms;
|
| 314 |
+ }
|
| 315 |
}
|
| 316 |
}
|
| 317 |
|
| 318 |
diff --git a/drivers/gpu/drm/radeon/radeon_cursor.c b/drivers/gpu/drm/radeon/radeon_cursor.c
|
| 319 |
index 3fb2226..72f749d 100644
|
| 320 |
--- a/drivers/gpu/drm/radeon/radeon_cursor.c
|
| 321 |
+++ b/drivers/gpu/drm/radeon/radeon_cursor.c
|
| 322 |
@@ -257,8 +257,14 @@ int radeon_crtc_cursor_move(struct drm_crtc *crtc,
|
| 323 |
if (!(cursor_end & 0x7f))
|
| 324 |
w--;
|
| 325 |
}
|
| 326 |
- if (w <= 0)
|
| 327 |
+ if (w <= 0) {
|
| 328 |
w = 1;
|
| 329 |
+ cursor_end = x - xorigin + w;
|
| 330 |
+ if (!(cursor_end & 0x7f)) {
|
| 331 |
+ x--;
|
| 332 |
+ WARN_ON_ONCE(x < 0);
|
| 333 |
+ }
|
| 334 |
+ }
|
| 335 |
}
|
| 336 |
}
|
| 337 |
|
| 338 |
diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c
|
| 339 |
index 936bbca..d3b3115 100644
|
| 340 |
--- a/drivers/mmc/host/sdhci-pci.c
|
| 341 |
+++ b/drivers/mmc/host/sdhci-pci.c
|
| 342 |
@@ -140,6 +140,7 @@ static const struct sdhci_pci_fixes sdhci_ene_714 = {
|
| 343 |
static const struct sdhci_pci_fixes sdhci_cafe = {
|
| 344 |
.quirks = SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER |
|
| 345 |
SDHCI_QUIRK_NO_BUSY_IRQ |
|
| 346 |
+ SDHCI_QUIRK_BROKEN_CARD_DETECTION |
|
| 347 |
SDHCI_QUIRK_BROKEN_TIMEOUT_VAL,
|
| 348 |
};
|
| 349 |
|
| 350 |
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
|
| 351 |
index 74580bb..c9b123c 100644
|
| 352 |
--- a/drivers/net/bnx2.c
|
| 353 |
+++ b/drivers/net/bnx2.c
|
| 354 |
@@ -5310,7 +5310,7 @@ bnx2_free_tx_skbs(struct bnx2 *bp)
|
| 355 |
int k, last;
|
| 356 |
|
| 357 |
if (skb == NULL) {
|
| 358 |
- j++;
|
| 359 |
+ j = NEXT_TX_BD(j);
|
| 360 |
continue;
|
| 361 |
}
|
| 362 |
|
| 363 |
@@ -5322,8 +5322,8 @@ bnx2_free_tx_skbs(struct bnx2 *bp)
|
| 364 |
tx_buf->skb = NULL;
|
| 365 |
|
| 366 |
last = tx_buf->nr_frags;
|
| 367 |
- j++;
|
| 368 |
- for (k = 0; k < last; k++, j++) {
|
| 369 |
+ j = NEXT_TX_BD(j);
|
| 370 |
+ for (k = 0; k < last; k++, j = NEXT_TX_BD(j)) {
|
| 371 |
tx_buf = &txr->tx_buf_ring[TX_RING_IDX(j)];
|
| 372 |
dma_unmap_page(&bp->pdev->dev,
|
| 373 |
dma_unmap_addr(tx_buf, mapping),
|
| 374 |
diff --git a/drivers/net/caif/caif_serial.c b/drivers/net/caif/caif_serial.c
|
| 375 |
index 3df0c0f..82b1802 100644
|
| 376 |
--- a/drivers/net/caif/caif_serial.c
|
| 377 |
+++ b/drivers/net/caif/caif_serial.c
|
| 378 |
@@ -325,6 +325,9 @@ static int ldisc_open(struct tty_struct *tty)
|
| 379 |
|
| 380 |
sprintf(name, "cf%s", tty->name);
|
| 381 |
dev = alloc_netdev(sizeof(*ser), name, caifdev_setup);
|
| 382 |
+ if (!dev)
|
| 383 |
+ return -ENOMEM;
|
| 384 |
+
|
| 385 |
ser = netdev_priv(dev);
|
| 386 |
ser->tty = tty_kref_get(tty);
|
| 387 |
ser->dev = dev;
|
| 388 |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
|
| 389 |
index fb50e5a..a631bf7 100644
|
| 390 |
--- a/drivers/net/tun.c
|
| 391 |
+++ b/drivers/net/tun.c
|
| 392 |
@@ -1239,10 +1239,12 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
|
| 393 |
int vnet_hdr_sz;
|
| 394 |
int ret;
|
| 395 |
|
| 396 |
- if (cmd == TUNSETIFF || _IOC_TYPE(cmd) == 0x89)
|
| 397 |
+ if (cmd == TUNSETIFF || _IOC_TYPE(cmd) == 0x89) {
|
| 398 |
if (copy_from_user(&ifr, argp, ifreq_len))
|
| 399 |
return -EFAULT;
|
| 400 |
-
|
| 401 |
+ } else {
|
| 402 |
+ memset(&ifr, 0, sizeof(ifr));
|
| 403 |
+ }
|
| 404 |
if (cmd == TUNGETFEATURES) {
|
| 405 |
/* Currently this just means: "what IFF flags are valid?".
|
| 406 |
* This is needed because we never checked for invalid flags on
|
| 407 |
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
|
| 408 |
index ad0298f..3362449 100644
|
| 409 |
--- a/drivers/net/usb/kaweth.c
|
| 410 |
+++ b/drivers/net/usb/kaweth.c
|
| 411 |
@@ -1308,7 +1308,7 @@ static int kaweth_internal_control_msg(struct usb_device *usb_dev,
|
| 412 |
int retv;
|
| 413 |
int length = 0; /* shut up GCC */
|
| 414 |
|
| 415 |
- urb = usb_alloc_urb(0, GFP_NOIO);
|
| 416 |
+ urb = usb_alloc_urb(0, GFP_ATOMIC);
|
| 417 |
if (!urb)
|
| 418 |
return -ENOMEM;
|
| 419 |
|
| 420 |
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
|
| 421 |
index e68fac6..d2f9576 100644
|
| 422 |
--- a/drivers/scsi/libsas/sas_expander.c
|
| 423 |
+++ b/drivers/scsi/libsas/sas_expander.c
|
| 424 |
@@ -770,7 +770,7 @@ static struct domain_device *sas_ex_discover_end_dev(
|
| 425 |
}
|
| 426 |
|
| 427 |
/* See if this phy is part of a wide port */
|
| 428 |
-static int sas_ex_join_wide_port(struct domain_device *parent, int phy_id)
|
| 429 |
+static bool sas_ex_join_wide_port(struct domain_device *parent, int phy_id)
|
| 430 |
{
|
| 431 |
struct ex_phy *phy = &parent->ex_dev.ex_phy[phy_id];
|
| 432 |
int i;
|
| 433 |
@@ -786,11 +786,11 @@ static int sas_ex_join_wide_port(struct domain_device *parent, int phy_id)
|
| 434 |
sas_port_add_phy(ephy->port, phy->phy);
|
| 435 |
phy->port = ephy->port;
|
| 436 |
phy->phy_state = PHY_DEVICE_DISCOVERED;
|
| 437 |
- return 0;
|
| 438 |
+ return true;
|
| 439 |
}
|
| 440 |
}
|
| 441 |
|
| 442 |
- return -ENODEV;
|
| 443 |
+ return false;
|
| 444 |
}
|
| 445 |
|
| 446 |
static struct domain_device *sas_ex_discover_expander(
|
| 447 |
@@ -928,8 +928,7 @@ static int sas_ex_discover_dev(struct domain_device *dev, int phy_id)
|
| 448 |
return res;
|
| 449 |
}
|
| 450 |
|
| 451 |
- res = sas_ex_join_wide_port(dev, phy_id);
|
| 452 |
- if (!res) {
|
| 453 |
+ if (sas_ex_join_wide_port(dev, phy_id)) {
|
| 454 |
SAS_DPRINTK("Attaching ex phy%d to wide port %016llx\n",
|
| 455 |
phy_id, SAS_ADDR(ex_phy->attached_sas_addr));
|
| 456 |
return res;
|
| 457 |
@@ -974,8 +973,7 @@ static int sas_ex_discover_dev(struct domain_device *dev, int phy_id)
|
| 458 |
if (SAS_ADDR(ex->ex_phy[i].attached_sas_addr) ==
|
| 459 |
SAS_ADDR(child->sas_addr)) {
|
| 460 |
ex->ex_phy[i].phy_state= PHY_DEVICE_DISCOVERED;
|
| 461 |
- res = sas_ex_join_wide_port(dev, i);
|
| 462 |
- if (!res)
|
| 463 |
+ if (sas_ex_join_wide_port(dev, i))
|
| 464 |
SAS_DPRINTK("Attaching ex phy%d to wide port %016llx\n",
|
| 465 |
i, SAS_ADDR(ex->ex_phy[i].attached_sas_addr));
|
| 466 |
|
| 467 |
@@ -1838,32 +1836,20 @@ static int sas_discover_new(struct domain_device *dev, int phy_id)
|
| 468 |
{
|
| 469 |
struct ex_phy *ex_phy = &dev->ex_dev.ex_phy[phy_id];
|
| 470 |
struct domain_device *child;
|
| 471 |
- bool found = false;
|
| 472 |
- int res, i;
|
| 473 |
+ int res;
|
| 474 |
|
| 475 |
SAS_DPRINTK("ex %016llx phy%d new device attached\n",
|
| 476 |
SAS_ADDR(dev->sas_addr), phy_id);
|
| 477 |
res = sas_ex_phy_discover(dev, phy_id);
|
| 478 |
if (res)
|
| 479 |
- goto out;
|
| 480 |
- /* to support the wide port inserted */
|
| 481 |
- for (i = 0; i < dev->ex_dev.num_phys; i++) {
|
| 482 |
- struct ex_phy *ex_phy_temp = &dev->ex_dev.ex_phy[i];
|
| 483 |
- if (i == phy_id)
|
| 484 |
- continue;
|
| 485 |
- if (SAS_ADDR(ex_phy_temp->attached_sas_addr) ==
|
| 486 |
- SAS_ADDR(ex_phy->attached_sas_addr)) {
|
| 487 |
- found = true;
|
| 488 |
- break;
|
| 489 |
- }
|
| 490 |
- }
|
| 491 |
- if (found) {
|
| 492 |
- sas_ex_join_wide_port(dev, phy_id);
|
| 493 |
+ return res;
|
| 494 |
+
|
| 495 |
+ if (sas_ex_join_wide_port(dev, phy_id))
|
| 496 |
return 0;
|
| 497 |
- }
|
| 498 |
+
|
| 499 |
res = sas_ex_discover_devices(dev, phy_id);
|
| 500 |
- if (!res)
|
| 501 |
- goto out;
|
| 502 |
+ if (res)
|
| 503 |
+ return res;
|
| 504 |
list_for_each_entry(child, &dev->ex_dev.children, siblings) {
|
| 505 |
if (SAS_ADDR(child->sas_addr) ==
|
| 506 |
SAS_ADDR(ex_phy->attached_sas_addr)) {
|
| 507 |
@@ -1873,7 +1859,6 @@ static int sas_discover_new(struct domain_device *dev, int phy_id)
|
| 508 |
break;
|
| 509 |
}
|
| 510 |
}
|
| 511 |
-out:
|
| 512 |
return res;
|
| 513 |
}
|
| 514 |
|
| 515 |
@@ -1972,9 +1957,7 @@ int sas_ex_revalidate_domain(struct domain_device *port_dev)
|
| 516 |
struct domain_device *dev = NULL;
|
| 517 |
|
| 518 |
res = sas_find_bcast_dev(port_dev, &dev);
|
| 519 |
- if (res)
|
| 520 |
- goto out;
|
| 521 |
- if (dev) {
|
| 522 |
+ while (res == 0 && dev) {
|
| 523 |
struct expander_device *ex = &dev->ex_dev;
|
| 524 |
int i = 0, phy_id;
|
| 525 |
|
| 526 |
@@ -1986,8 +1969,10 @@ int sas_ex_revalidate_domain(struct domain_device *port_dev)
|
| 527 |
res = sas_rediscover(dev, phy_id);
|
| 528 |
i = phy_id + 1;
|
| 529 |
} while (i < ex->num_phys);
|
| 530 |
+
|
| 531 |
+ dev = NULL;
|
| 532 |
+ res = sas_find_bcast_dev(port_dev, &dev);
|
| 533 |
}
|
| 534 |
-out:
|
| 535 |
return res;
|
| 536 |
}
|
| 537 |
|
| 538 |
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
|
| 539 |
index a4b9cdb..7f1afde 100644
|
| 540 |
--- a/drivers/scsi/scsi_error.c
|
| 541 |
+++ b/drivers/scsi/scsi_error.c
|
| 542 |
@@ -1665,6 +1665,20 @@ static void scsi_restart_operations(struct Scsi_Host *shost)
|
| 543 |
* requests are started.
|
| 544 |
*/
|
| 545 |
scsi_run_host_queues(shost);
|
| 546 |
+
|
| 547 |
+ /*
|
| 548 |
+ * if eh is active and host_eh_scheduled is pending we need to re-run
|
| 549 |
+ * recovery. we do this check after scsi_run_host_queues() to allow
|
| 550 |
+ * everything pent up since the last eh run a chance to make forward
|
| 551 |
+ * progress before we sync again. Either we'll immediately re-run
|
| 552 |
+ * recovery or scsi_device_unbusy() will wake us again when these
|
| 553 |
+ * pending commands complete.
|
| 554 |
+ */
|
| 555 |
+ spin_lock_irqsave(shost->host_lock, flags);
|
| 556 |
+ if (shost->host_eh_scheduled)
|
| 557 |
+ if (scsi_host_set_state(shost, SHOST_RECOVERY))
|
| 558 |
+ WARN_ON(scsi_host_set_state(shost, SHOST_CANCEL_RECOVERY));
|
| 559 |
+ spin_unlock_irqrestore(shost->host_lock, flags);
|
| 560 |
}
|
| 561 |
|
| 562 |
/**
|
| 563 |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
|
| 564 |
index 99fc45b..dd454c4 100644
|
| 565 |
--- a/drivers/scsi/scsi_lib.c
|
| 566 |
+++ b/drivers/scsi/scsi_lib.c
|
| 567 |
@@ -481,15 +481,26 @@ void scsi_requeue_run_queue(struct work_struct *work)
|
| 568 |
*/
|
| 569 |
static void scsi_requeue_command(struct request_queue *q, struct scsi_cmnd *cmd)
|
| 570 |
{
|
| 571 |
+ struct scsi_device *sdev = cmd->device;
|
| 572 |
struct request *req = cmd->request;
|
| 573 |
unsigned long flags;
|
| 574 |
|
| 575 |
+ /*
|
| 576 |
+ * We need to hold a reference on the device to avoid the queue being
|
| 577 |
+ * killed after the unlock and before scsi_run_queue is invoked which
|
| 578 |
+ * may happen because scsi_unprep_request() puts the command which
|
| 579 |
+ * releases its reference on the device.
|
| 580 |
+ */
|
| 581 |
+ get_device(&sdev->sdev_gendev);
|
| 582 |
+
|
| 583 |
spin_lock_irqsave(q->queue_lock, flags);
|
| 584 |
scsi_unprep_request(req);
|
| 585 |
blk_requeue_request(q, req);
|
| 586 |
spin_unlock_irqrestore(q->queue_lock, flags);
|
| 587 |
|
| 588 |
scsi_run_queue(q);
|
| 589 |
+
|
| 590 |
+ put_device(&sdev->sdev_gendev);
|
| 591 |
}
|
| 592 |
|
| 593 |
void scsi_next_command(struct scsi_cmnd *cmd)
|
| 594 |
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
|
| 595 |
index 6e7ea4a..a48b59c 100644
|
| 596 |
--- a/drivers/scsi/scsi_scan.c
|
| 597 |
+++ b/drivers/scsi/scsi_scan.c
|
| 598 |
@@ -1710,6 +1710,9 @@ static void scsi_sysfs_add_devices(struct Scsi_Host *shost)
|
| 599 |
{
|
| 600 |
struct scsi_device *sdev;
|
| 601 |
shost_for_each_device(sdev, shost) {
|
| 602 |
+ /* target removed before the device could be added */
|
| 603 |
+ if (sdev->sdev_state == SDEV_DEL)
|
| 604 |
+ continue;
|
| 605 |
if (!scsi_host_scan_allowed(shost) ||
|
| 606 |
scsi_sysfs_add_sdev(sdev) != 0)
|
| 607 |
__scsi_remove_device(sdev);
|
| 608 |
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
|
| 609 |
index e0bd3f7..de21547 100644
|
| 610 |
--- a/drivers/scsi/scsi_sysfs.c
|
| 611 |
+++ b/drivers/scsi/scsi_sysfs.c
|
| 612 |
@@ -962,7 +962,6 @@ static void __scsi_remove_target(struct scsi_target *starget)
|
| 613 |
struct scsi_device *sdev;
|
| 614 |
|
| 615 |
spin_lock_irqsave(shost->host_lock, flags);
|
| 616 |
- starget->reap_ref++;
|
| 617 |
restart:
|
| 618 |
list_for_each_entry(sdev, &shost->__devices, siblings) {
|
| 619 |
if (sdev->channel != starget->channel ||
|
| 620 |
@@ -976,14 +975,6 @@ static void __scsi_remove_target(struct scsi_target *starget)
|
| 621 |
goto restart;
|
| 622 |
}
|
| 623 |
spin_unlock_irqrestore(shost->host_lock, flags);
|
| 624 |
- scsi_target_reap(starget);
|
| 625 |
-}
|
| 626 |
-
|
| 627 |
-static int __remove_child (struct device * dev, void * data)
|
| 628 |
-{
|
| 629 |
- if (scsi_is_target_device(dev))
|
| 630 |
- __scsi_remove_target(to_scsi_target(dev));
|
| 631 |
- return 0;
|
| 632 |
}
|
| 633 |
|
| 634 |
/**
|
| 635 |
@@ -996,14 +987,34 @@ static int __remove_child (struct device * dev, void * data)
|
| 636 |
*/
|
| 637 |
void scsi_remove_target(struct device *dev)
|
| 638 |
{
|
| 639 |
- if (scsi_is_target_device(dev)) {
|
| 640 |
- __scsi_remove_target(to_scsi_target(dev));
|
| 641 |
- return;
|
| 642 |
+ struct Scsi_Host *shost = dev_to_shost(dev->parent);
|
| 643 |
+ struct scsi_target *starget, *found;
|
| 644 |
+ unsigned long flags;
|
| 645 |
+
|
| 646 |
+ restart:
|
| 647 |
+ found = NULL;
|
| 648 |
+ spin_lock_irqsave(shost->host_lock, flags);
|
| 649 |
+ list_for_each_entry(starget, &shost->__targets, siblings) {
|
| 650 |
+ if (starget->state == STARGET_DEL)
|
| 651 |
+ continue;
|
| 652 |
+ if (starget->dev.parent == dev || &starget->dev == dev) {
|
| 653 |
+ found = starget;
|
| 654 |
+ found->reap_ref++;
|
| 655 |
+ break;
|
| 656 |
+ }
|
| 657 |
}
|
| 658 |
+ spin_unlock_irqrestore(shost->host_lock, flags);
|
| 659 |
|
| 660 |
- get_device(dev);
|
| 661 |
- device_for_each_child(dev, NULL, __remove_child);
|
| 662 |
- put_device(dev);
|
| 663 |
+ if (found) {
|
| 664 |
+ __scsi_remove_target(found);
|
| 665 |
+ scsi_target_reap(found);
|
| 666 |
+ /* in the case where @dev has multiple starget children,
|
| 667 |
+ * continue removing.
|
| 668 |
+ *
|
| 669 |
+ * FIXME: does such a case exist?
|
| 670 |
+ */
|
| 671 |
+ goto restart;
|
| 672 |
+ }
|
| 673 |
}
|
| 674 |
EXPORT_SYMBOL(scsi_remove_target);
|
| 675 |
|
| 676 |
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
|
| 677 |
index ca3c303..4d1f996 100644
|
| 678 |
--- a/drivers/usb/core/devio.c
|
| 679 |
+++ b/drivers/usb/core/devio.c
|
| 680 |
@@ -1557,10 +1557,14 @@ static int processcompl_compat(struct async *as, void __user * __user *arg)
|
| 681 |
void __user *addr = as->userurb;
|
| 682 |
unsigned int i;
|
| 683 |
|
| 684 |
- if (as->userbuffer && urb->actual_length)
|
| 685 |
- if (copy_to_user(as->userbuffer, urb->transfer_buffer,
|
| 686 |
- urb->actual_length))
|
| 687 |
+ if (as->userbuffer && urb->actual_length) {
|
| 688 |
+ if (urb->number_of_packets > 0) /* Isochronous */
|
| 689 |
+ i = urb->transfer_buffer_length;
|
| 690 |
+ else /* Non-Isoc */
|
| 691 |
+ i = urb->actual_length;
|
| 692 |
+ if (copy_to_user(as->userbuffer, urb->transfer_buffer, i))
|
| 693 |
return -EFAULT;
|
| 694 |
+ }
|
| 695 |
if (put_user(as->status, &userurb->status))
|
| 696 |
return -EFAULT;
|
| 697 |
if (put_user(urb->actual_length, &userurb->actual_length))
|
| 698 |
diff --git a/drivers/usb/early/ehci-dbgp.c b/drivers/usb/early/ehci-dbgp.c
|
| 699 |
index 1fc8f12..347bb05 100644
|
| 700 |
--- a/drivers/usb/early/ehci-dbgp.c
|
| 701 |
+++ b/drivers/usb/early/ehci-dbgp.c
|
| 702 |
@@ -450,7 +450,7 @@ static int dbgp_ehci_startup(void)
|
| 703 |
writel(FLAG_CF, &ehci_regs->configured_flag);
|
| 704 |
|
| 705 |
/* Wait until the controller is no longer halted */
|
| 706 |
- loop = 10;
|
| 707 |
+ loop = 1000;
|
| 708 |
do {
|
| 709 |
status = readl(&ehci_regs->status);
|
| 710 |
if (!(status & STS_HALT))
|
| 711 |
diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
|
| 712 |
index 2ac1d21..a52404a 100644
|
| 713 |
--- a/drivers/usb/gadget/u_ether.c
|
| 714 |
+++ b/drivers/usb/gadget/u_ether.c
|
| 715 |
@@ -803,12 +803,6 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
|
| 716 |
|
| 717 |
SET_ETHTOOL_OPS(net, &ops);
|
| 718 |
|
| 719 |
- /* two kinds of host-initiated state changes:
|
| 720 |
- * - iff DATA transfer is active, carrier is "on"
|
| 721 |
- * - tx queueing enabled if open *and* carrier is "on"
|
| 722 |
- */
|
| 723 |
- netif_carrier_off(net);
|
| 724 |
-
|
| 725 |
dev->gadget = g;
|
| 726 |
SET_NETDEV_DEV(net, &g->dev);
|
| 727 |
SET_NETDEV_DEVTYPE(net, &gadget_type);
|
| 728 |
@@ -822,6 +816,12 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
|
| 729 |
INFO(dev, "HOST MAC %pM\n", dev->host_mac);
|
| 730 |
|
| 731 |
the_dev = dev;
|
| 732 |
+
|
| 733 |
+ /* two kinds of host-initiated state changes:
|
| 734 |
+ * - iff DATA transfer is active, carrier is "on"
|
| 735 |
+ * - tx queueing enabled if open *and* carrier is "on"
|
| 736 |
+ */
|
| 737 |
+ netif_carrier_off(net);
|
| 738 |
}
|
| 739 |
|
| 740 |
return status;
|
| 741 |
diff --git a/fs/btrfs/async-thread.c b/fs/btrfs/async-thread.c
|
| 742 |
index 7ec1409..8006a28 100644
|
| 743 |
--- a/fs/btrfs/async-thread.c
|
| 744 |
+++ b/fs/btrfs/async-thread.c
|
| 745 |
@@ -212,10 +212,17 @@ static noinline int run_ordered_completions(struct btrfs_workers *workers,
|
| 746 |
|
| 747 |
work->ordered_func(work);
|
| 748 |
|
| 749 |
- /* now take the lock again and call the freeing code */
|
| 750 |
+ /* now take the lock again and drop our item from the list */
|
| 751 |
spin_lock(&workers->order_lock);
|
| 752 |
list_del(&work->order_list);
|
| 753 |
+ spin_unlock(&workers->order_lock);
|
| 754 |
+
|
| 755 |
+ /*
|
| 756 |
+ * we don't want to call the ordered free functions
|
| 757 |
+ * with the lock held though
|
| 758 |
+ */
|
| 759 |
work->ordered_free(work);
|
| 760 |
+ spin_lock(&workers->order_lock);
|
| 761 |
}
|
| 762 |
|
| 763 |
spin_unlock(&workers->order_lock);
|
| 764 |
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
|
| 765 |
index 264f694..ebe95f5 100644
|
| 766 |
--- a/fs/ext4/balloc.c
|
| 767 |
+++ b/fs/ext4/balloc.c
|
| 768 |
@@ -514,7 +514,8 @@ ext4_fsblk_t ext4_count_free_blocks(struct super_block *sb)
|
| 769 |
if (bitmap_bh == NULL)
|
| 770 |
continue;
|
| 771 |
|
| 772 |
- x = ext4_count_free(bitmap_bh, sb->s_blocksize);
|
| 773 |
+ x = ext4_count_free(bitmap_bh->b_data,
|
| 774 |
+ EXT4_BLOCKS_PER_GROUP(sb) / 8);
|
| 775 |
printk(KERN_DEBUG "group %u: stored = %d, counted = %u\n",
|
| 776 |
i, ext4_free_blks_count(sb, gdp), x);
|
| 777 |
bitmap_count += x;
|
| 778 |
diff --git a/fs/ext4/bitmap.c b/fs/ext4/bitmap.c
|
| 779 |
index fa3af81..012faaa 100644
|
| 780 |
--- a/fs/ext4/bitmap.c
|
| 781 |
+++ b/fs/ext4/bitmap.c
|
| 782 |
@@ -15,15 +15,13 @@
|
| 783 |
|
| 784 |
static const int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0};
|
| 785 |
|
| 786 |
-unsigned int ext4_count_free(struct buffer_head *map, unsigned int numchars)
|
| 787 |
+unsigned int ext4_count_free(char *bitmap, unsigned int numchars)
|
| 788 |
{
|
| 789 |
unsigned int i, sum = 0;
|
| 790 |
|
| 791 |
- if (!map)
|
| 792 |
- return 0;
|
| 793 |
for (i = 0; i < numchars; i++)
|
| 794 |
- sum += nibblemap[map->b_data[i] & 0xf] +
|
| 795 |
- nibblemap[(map->b_data[i] >> 4) & 0xf];
|
| 796 |
+ sum += nibblemap[bitmap[i] & 0xf] +
|
| 797 |
+ nibblemap[(bitmap[i] >> 4) & 0xf];
|
| 798 |
return sum;
|
| 799 |
}
|
| 800 |
|
| 801 |
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
|
| 802 |
index 1a34c1c..e0113aa 100644
|
| 803 |
--- a/fs/ext4/ext4.h
|
| 804 |
+++ b/fs/ext4/ext4.h
|
| 805 |
@@ -1713,7 +1713,7 @@ struct mmpd_data {
|
| 806 |
# define NORET_AND noreturn,
|
| 807 |
|
| 808 |
/* bitmap.c */
|
| 809 |
-extern unsigned int ext4_count_free(struct buffer_head *, unsigned);
|
| 810 |
+extern unsigned int ext4_count_free(char *bitmap, unsigned numchars);
|
| 811 |
|
| 812 |
/* balloc.c */
|
| 813 |
extern unsigned int ext4_block_group(struct super_block *sb,
|
| 814 |
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
|
| 815 |
index 412469b..29272de 100644
|
| 816 |
--- a/fs/ext4/ialloc.c
|
| 817 |
+++ b/fs/ext4/ialloc.c
|
| 818 |
@@ -1193,7 +1193,8 @@ unsigned long ext4_count_free_inodes(struct super_block *sb)
|
| 819 |
if (!bitmap_bh)
|
| 820 |
continue;
|
| 821 |
|
| 822 |
- x = ext4_count_free(bitmap_bh, EXT4_INODES_PER_GROUP(sb) / 8);
|
| 823 |
+ x = ext4_count_free(bitmap_bh->b_data,
|
| 824 |
+ EXT4_INODES_PER_GROUP(sb) / 8);
|
| 825 |
printk(KERN_DEBUG "group %lu: stored = %d, counted = %lu\n",
|
| 826 |
(unsigned long) i, ext4_free_inodes_count(sb, gdp), x);
|
| 827 |
bitmap_count += x;
|
| 828 |
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
|
| 829 |
index c1e6a72..18fee6d 100644
|
| 830 |
--- a/fs/ext4/inode.c
|
| 831 |
+++ b/fs/ext4/inode.c
|
| 832 |
@@ -1134,6 +1134,15 @@ void ext4_da_update_reserve_space(struct inode *inode,
|
| 833 |
used = ei->i_reserved_data_blocks;
|
| 834 |
}
|
| 835 |
|
| 836 |
+ if (unlikely(ei->i_allocated_meta_blocks > ei->i_reserved_meta_blocks)) {
|
| 837 |
+ ext4_msg(inode->i_sb, KERN_NOTICE, "%s: ino %lu, allocated %d "
|
| 838 |
+ "with only %d reserved metadata blocks\n", __func__,
|
| 839 |
+ inode->i_ino, ei->i_allocated_meta_blocks,
|
| 840 |
+ ei->i_reserved_meta_blocks);
|
| 841 |
+ WARN_ON(1);
|
| 842 |
+ ei->i_allocated_meta_blocks = ei->i_reserved_meta_blocks;
|
| 843 |
+ }
|
| 844 |
+
|
| 845 |
/* Update per-inode reservations */
|
| 846 |
ei->i_reserved_data_blocks -= used;
|
| 847 |
ei->i_reserved_meta_blocks -= ei->i_allocated_meta_blocks;
|
| 848 |
diff --git a/fs/locks.c b/fs/locks.c
|
| 849 |
index b286539..35388d5 100644
|
| 850 |
--- a/fs/locks.c
|
| 851 |
+++ b/fs/locks.c
|
| 852 |
@@ -315,7 +315,7 @@ static int flock_make_lock(struct file *filp, struct file_lock **lock,
|
| 853 |
return 0;
|
| 854 |
}
|
| 855 |
|
| 856 |
-static int assign_type(struct file_lock *fl, int type)
|
| 857 |
+static int assign_type(struct file_lock *fl, long type)
|
| 858 |
{
|
| 859 |
switch (type) {
|
| 860 |
case F_RDLCK:
|
| 861 |
@@ -452,7 +452,7 @@ static const struct lock_manager_operations lease_manager_ops = {
|
| 862 |
/*
|
| 863 |
* Initialize a lease, use the default lock manager operations
|
| 864 |
*/
|
| 865 |
-static int lease_init(struct file *filp, int type, struct file_lock *fl)
|
| 866 |
+static int lease_init(struct file *filp, long type, struct file_lock *fl)
|
| 867 |
{
|
| 868 |
if (assign_type(fl, type) != 0)
|
| 869 |
return -EINVAL;
|
| 870 |
@@ -470,7 +470,7 @@ static int lease_init(struct file *filp, int type, struct file_lock *fl)
|
| 871 |
}
|
| 872 |
|
| 873 |
/* Allocate a file_lock initialised to this type of lease */
|
| 874 |
-static struct file_lock *lease_alloc(struct file *filp, int type)
|
| 875 |
+static struct file_lock *lease_alloc(struct file *filp, long type)
|
| 876 |
{
|
| 877 |
struct file_lock *fl = locks_alloc_lock();
|
| 878 |
int error = -ENOMEM;
|
| 879 |
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
|
| 880 |
index dd2f130..6c6e2c4 100644
|
| 881 |
--- a/fs/nfs/file.c
|
| 882 |
+++ b/fs/nfs/file.c
|
| 883 |
@@ -493,8 +493,11 @@ static int nfs_release_page(struct page *page, gfp_t gfp)
|
| 884 |
|
| 885 |
dfprintk(PAGECACHE, "NFS: release_page(%p)\n", page);
|
| 886 |
|
| 887 |
- /* Only do I/O if gfp is a superset of GFP_KERNEL */
|
| 888 |
- if (mapping && (gfp & GFP_KERNEL) == GFP_KERNEL) {
|
| 889 |
+ /* Only do I/O if gfp is a superset of GFP_KERNEL, and we're not
|
| 890 |
+ * doing this memory reclaim for a fs-related allocation.
|
| 891 |
+ */
|
| 892 |
+ if (mapping && (gfp & GFP_KERNEL) == GFP_KERNEL &&
|
| 893 |
+ !(current->flags & PF_FSTRANS)) {
|
| 894 |
int how = FLUSH_SYNC;
|
| 895 |
|
| 896 |
/* Don't let kswapd deadlock waiting for OOM RPC calls */
|
| 897 |
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
|
| 898 |
index 6c74097..f91d589 100644
|
| 899 |
--- a/fs/nfsd/nfs4xdr.c
|
| 900 |
+++ b/fs/nfsd/nfs4xdr.c
|
| 901 |
@@ -2010,7 +2010,7 @@ out_acl:
|
| 902 |
if (bmval0 & FATTR4_WORD0_CASE_INSENSITIVE) {
|
| 903 |
if ((buflen -= 4) < 0)
|
| 904 |
goto out_resource;
|
| 905 |
- WRITE32(1);
|
| 906 |
+ WRITE32(0);
|
| 907 |
}
|
| 908 |
if (bmval0 & FATTR4_WORD0_CASE_PRESERVING) {
|
| 909 |
if ((buflen -= 4) < 0)
|
| 910 |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
|
| 911 |
index 5f09323..42af2ea 100644
|
| 912 |
--- a/include/linux/cpu.h
|
| 913 |
+++ b/include/linux/cpu.h
|
| 914 |
@@ -66,8 +66,9 @@ enum {
|
| 915 |
/* migration should happen before other stuff but after perf */
|
| 916 |
CPU_PRI_PERF = 20,
|
| 917 |
CPU_PRI_MIGRATION = 10,
|
| 918 |
- /* prepare workqueues for other notifiers */
|
| 919 |
- CPU_PRI_WORKQUEUE = 5,
|
| 920 |
+ /* bring up workqueues before normal notifiers and down after */
|
| 921 |
+ CPU_PRI_WORKQUEUE_UP = 5,
|
| 922 |
+ CPU_PRI_WORKQUEUE_DOWN = -5,
|
| 923 |
};
|
| 924 |
|
| 925 |
#ifdef CONFIG_SMP
|
| 926 |
diff --git a/kernel/futex.c b/kernel/futex.c
|
| 927 |
index 11e8924..24bc59c 100644
|
| 928 |
--- a/kernel/futex.c
|
| 929 |
+++ b/kernel/futex.c
|
| 930 |
@@ -2231,11 +2231,11 @@ int handle_early_requeue_pi_wakeup(struct futex_hash_bucket *hb,
|
| 931 |
* @uaddr2: the pi futex we will take prior to returning to user-space
|
| 932 |
*
|
| 933 |
* The caller will wait on uaddr and will be requeued by futex_requeue() to
|
| 934 |
- * uaddr2 which must be PI aware. Normal wakeup will wake on uaddr2 and
|
| 935 |
- * complete the acquisition of the rt_mutex prior to returning to userspace.
|
| 936 |
- * This ensures the rt_mutex maintains an owner when it has waiters; without
|
| 937 |
- * one, the pi logic wouldn't know which task to boost/deboost, if there was a
|
| 938 |
- * need to.
|
| 939 |
+ * uaddr2 which must be PI aware and unique from uaddr. Normal wakeup will wake
|
| 940 |
+ * on uaddr2 and complete the acquisition of the rt_mutex prior to returning to
|
| 941 |
+ * userspace. This ensures the rt_mutex maintains an owner when it has waiters;
|
| 942 |
+ * without one, the pi logic would not know which task to boost/deboost, if
|
| 943 |
+ * there was a need to.
|
| 944 |
*
|
| 945 |
* We call schedule in futex_wait_queue_me() when we enqueue and return there
|
| 946 |
* via the following:
|
| 947 |
@@ -2272,6 +2272,9 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
|
| 948 |
struct futex_q q = futex_q_init;
|
| 949 |
int res, ret;
|
| 950 |
|
| 951 |
+ if (uaddr == uaddr2)
|
| 952 |
+ return -EINVAL;
|
| 953 |
+
|
| 954 |
if (!bitset)
|
| 955 |
return -EINVAL;
|
| 956 |
|
| 957 |
@@ -2343,7 +2346,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
|
| 958 |
* signal. futex_unlock_pi() will not destroy the lock_ptr nor
|
| 959 |
* the pi_state.
|
| 960 |
*/
|
| 961 |
- WARN_ON(!&q.pi_state);
|
| 962 |
+ WARN_ON(!q.pi_state);
|
| 963 |
pi_mutex = &q.pi_state->pi_mutex;
|
| 964 |
ret = rt_mutex_finish_proxy_lock(pi_mutex, to, &rt_waiter, 1);
|
| 965 |
debug_rt_mutex_free_waiter(&rt_waiter);
|
| 966 |
@@ -2370,7 +2373,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
|
| 967 |
* fault, unlock the rt_mutex and return the fault to userspace.
|
| 968 |
*/
|
| 969 |
if (ret == -EFAULT) {
|
| 970 |
- if (rt_mutex_owner(pi_mutex) == current)
|
| 971 |
+ if (pi_mutex && rt_mutex_owner(pi_mutex) == current)
|
| 972 |
rt_mutex_unlock(pi_mutex);
|
| 973 |
} else if (ret == -EINTR) {
|
| 974 |
/*
|
| 975 |
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
|
| 976 |
index 8884c27..32f1590 100644
|
| 977 |
--- a/kernel/power/hibernate.c
|
| 978 |
+++ b/kernel/power/hibernate.c
|
| 979 |
@@ -344,6 +344,7 @@ int hibernation_snapshot(int platform_mode)
|
| 980 |
goto Complete_devices;
|
| 981 |
|
| 982 |
suspend_console();
|
| 983 |
+ ftrace_stop();
|
| 984 |
pm_restrict_gfp_mask();
|
| 985 |
error = dpm_suspend(PMSG_FREEZE);
|
| 986 |
if (error)
|
| 987 |
@@ -369,6 +370,7 @@ int hibernation_snapshot(int platform_mode)
|
| 988 |
if (error || !in_suspend)
|
| 989 |
pm_restore_gfp_mask();
|
| 990 |
|
| 991 |
+ ftrace_start();
|
| 992 |
resume_console();
|
| 993 |
|
| 994 |
Complete_devices:
|
| 995 |
@@ -471,6 +473,7 @@ int hibernation_restore(int platform_mode)
|
| 996 |
|
| 997 |
pm_prepare_console();
|
| 998 |
suspend_console();
|
| 999 |
+ ftrace_stop();
|
| 1000 |
pm_restrict_gfp_mask();
|
| 1001 |
error = dpm_suspend_start(PMSG_QUIESCE);
|
| 1002 |
if (!error) {
|
| 1003 |
@@ -478,6 +481,7 @@ int hibernation_restore(int platform_mode)
|
| 1004 |
dpm_resume_end(PMSG_RECOVER);
|
| 1005 |
}
|
| 1006 |
pm_restore_gfp_mask();
|
| 1007 |
+ ftrace_start();
|
| 1008 |
resume_console();
|
| 1009 |
pm_restore_console();
|
| 1010 |
return error;
|
| 1011 |
@@ -504,6 +508,7 @@ int hibernation_platform_enter(void)
|
| 1012 |
|
| 1013 |
entering_platform_hibernation = true;
|
| 1014 |
suspend_console();
|
| 1015 |
+ ftrace_stop();
|
| 1016 |
error = dpm_suspend_start(PMSG_HIBERNATE);
|
| 1017 |
if (error) {
|
| 1018 |
if (hibernation_ops->recover)
|
| 1019 |
@@ -547,6 +552,7 @@ int hibernation_platform_enter(void)
|
| 1020 |
Resume_devices:
|
| 1021 |
entering_platform_hibernation = false;
|
| 1022 |
dpm_resume_end(PMSG_RESTORE);
|
| 1023 |
+ ftrace_start();
|
| 1024 |
resume_console();
|
| 1025 |
|
| 1026 |
Close:
|
| 1027 |
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
|
| 1028 |
index 449ccc9..e40d205 100644
|
| 1029 |
--- a/kernel/power/suspend.c
|
| 1030 |
+++ b/kernel/power/suspend.c
|
| 1031 |
@@ -23,6 +23,7 @@
|
| 1032 |
#include <linux/slab.h>
|
| 1033 |
#include <linux/suspend.h>
|
| 1034 |
#include <linux/syscore_ops.h>
|
| 1035 |
+#include <linux/ftrace.h>
|
| 1036 |
#include <trace/events/power.h>
|
| 1037 |
|
| 1038 |
#include "power.h"
|
| 1039 |
@@ -210,6 +211,7 @@ int suspend_devices_and_enter(suspend_state_t state)
|
| 1040 |
goto Close;
|
| 1041 |
}
|
| 1042 |
suspend_console();
|
| 1043 |
+ ftrace_stop();
|
| 1044 |
suspend_test_start();
|
| 1045 |
error = dpm_suspend_start(PMSG_SUSPEND);
|
| 1046 |
if (error) {
|
| 1047 |
@@ -226,6 +228,7 @@ int suspend_devices_and_enter(suspend_state_t state)
|
| 1048 |
suspend_test_start();
|
| 1049 |
dpm_resume_end(PMSG_RESUME);
|
| 1050 |
suspend_test_finish("resume devices");
|
| 1051 |
+ ftrace_start();
|
| 1052 |
resume_console();
|
| 1053 |
Close:
|
| 1054 |
if (suspend_ops->end)
|
| 1055 |
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
|
| 1056 |
index ee1845b..e88c924 100644
|
| 1057 |
--- a/kernel/workqueue.c
|
| 1058 |
+++ b/kernel/workqueue.c
|
| 1059 |
@@ -3561,6 +3561,41 @@ static int __devinit workqueue_cpu_callback(struct notifier_block *nfb,
|
| 1060 |
return notifier_from_errno(0);
|
| 1061 |
}
|
| 1062 |
|
| 1063 |
+/*
|
| 1064 |
+ * Workqueues should be brought up before normal priority CPU notifiers.
|
| 1065 |
+ * This will be registered high priority CPU notifier.
|
| 1066 |
+ */
|
| 1067 |
+static int __devinit workqueue_cpu_up_callback(struct notifier_block *nfb,
|
| 1068 |
+ unsigned long action,
|
| 1069 |
+ void *hcpu)
|
| 1070 |
+{
|
| 1071 |
+ switch (action & ~CPU_TASKS_FROZEN) {
|
| 1072 |
+ case CPU_UP_PREPARE:
|
| 1073 |
+ case CPU_UP_CANCELED:
|
| 1074 |
+ case CPU_DOWN_FAILED:
|
| 1075 |
+ case CPU_ONLINE:
|
| 1076 |
+ return workqueue_cpu_callback(nfb, action, hcpu);
|
| 1077 |
+ }
|
| 1078 |
+ return NOTIFY_OK;
|
| 1079 |
+}
|
| 1080 |
+
|
| 1081 |
+/*
|
| 1082 |
+ * Workqueues should be brought down after normal priority CPU notifiers.
|
| 1083 |
+ * This will be registered as low priority CPU notifier.
|
| 1084 |
+ */
|
| 1085 |
+static int __devinit workqueue_cpu_down_callback(struct notifier_block *nfb,
|
| 1086 |
+ unsigned long action,
|
| 1087 |
+ void *hcpu)
|
| 1088 |
+{
|
| 1089 |
+ switch (action & ~CPU_TASKS_FROZEN) {
|
| 1090 |
+ case CPU_DOWN_PREPARE:
|
| 1091 |
+ case CPU_DYING:
|
| 1092 |
+ case CPU_POST_DEAD:
|
| 1093 |
+ return workqueue_cpu_callback(nfb, action, hcpu);
|
| 1094 |
+ }
|
| 1095 |
+ return NOTIFY_OK;
|
| 1096 |
+}
|
| 1097 |
+
|
| 1098 |
#ifdef CONFIG_SMP
|
| 1099 |
|
| 1100 |
struct work_for_cpu {
|
| 1101 |
@@ -3754,7 +3789,8 @@ static int __init init_workqueues(void)
|
| 1102 |
unsigned int cpu;
|
| 1103 |
int i;
|
| 1104 |
|
| 1105 |
- cpu_notifier(workqueue_cpu_callback, CPU_PRI_WORKQUEUE);
|
| 1106 |
+ cpu_notifier(workqueue_cpu_up_callback, CPU_PRI_WORKQUEUE_UP);
|
| 1107 |
+ cpu_notifier(workqueue_cpu_down_callback, CPU_PRI_WORKQUEUE_DOWN);
|
| 1108 |
|
| 1109 |
/* initialize gcwqs */
|
| 1110 |
for_each_gcwq_cpu(cpu) {
|
| 1111 |
diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c
|
| 1112 |
index 5ba4366..804e50f 100644
|
| 1113 |
--- a/net/caif/caif_dev.c
|
| 1114 |
+++ b/net/caif/caif_dev.c
|
| 1115 |
@@ -424,9 +424,9 @@ static int __init caif_device_init(void)
|
| 1116 |
|
| 1117 |
static void __exit caif_device_exit(void)
|
| 1118 |
{
|
| 1119 |
- unregister_pernet_subsys(&caif_net_ops);
|
| 1120 |
unregister_netdevice_notifier(&caif_device_notifier);
|
| 1121 |
dev_remove_pack(&caif_packet_type);
|
| 1122 |
+ unregister_pernet_subsys(&caif_net_ops);
|
| 1123 |
}
|
| 1124 |
|
| 1125 |
module_init(caif_device_init);
|
| 1126 |
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
|
| 1127 |
index abd936d..861d53f 100644
|
| 1128 |
--- a/net/core/rtnetlink.c
|
| 1129 |
+++ b/net/core/rtnetlink.c
|
| 1130 |
@@ -647,6 +647,12 @@ static void set_operstate(struct net_device *dev, unsigned char transition)
|
| 1131 |
}
|
| 1132 |
}
|
| 1133 |
|
| 1134 |
+static unsigned int rtnl_dev_get_flags(const struct net_device *dev)
|
| 1135 |
+{
|
| 1136 |
+ return (dev->flags & ~(IFF_PROMISC | IFF_ALLMULTI)) |
|
| 1137 |
+ (dev->gflags & (IFF_PROMISC | IFF_ALLMULTI));
|
| 1138 |
+}
|
| 1139 |
+
|
| 1140 |
static unsigned int rtnl_dev_combine_flags(const struct net_device *dev,
|
| 1141 |
const struct ifinfomsg *ifm)
|
| 1142 |
{
|
| 1143 |
@@ -655,7 +661,7 @@ static unsigned int rtnl_dev_combine_flags(const struct net_device *dev,
|
| 1144 |
/* bugwards compatibility: ifi_change == 0 is treated as ~0 */
|
| 1145 |
if (ifm->ifi_change)
|
| 1146 |
flags = (flags & ifm->ifi_change) |
|
| 1147 |
- (dev->flags & ~ifm->ifi_change);
|
| 1148 |
+ (rtnl_dev_get_flags(dev) & ~ifm->ifi_change);
|
| 1149 |
|
| 1150 |
return flags;
|
| 1151 |
}
|
| 1152 |
diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c
|
| 1153 |
index 2b3c23c..062876b 100644
|
| 1154 |
--- a/net/ipv4/cipso_ipv4.c
|
| 1155 |
+++ b/net/ipv4/cipso_ipv4.c
|
| 1156 |
@@ -1725,8 +1725,10 @@ int cipso_v4_validate(const struct sk_buff *skb, unsigned char **option)
|
| 1157 |
case CIPSO_V4_TAG_LOCAL:
|
| 1158 |
/* This is a non-standard tag that we only allow for
|
| 1159 |
* local connections, so if the incoming interface is
|
| 1160 |
- * not the loopback device drop the packet. */
|
| 1161 |
- if (!(skb->dev->flags & IFF_LOOPBACK)) {
|
| 1162 |
+ * not the loopback device drop the packet. Further,
|
| 1163 |
+ * there is no legitimate reason for setting this from
|
| 1164 |
+ * userspace so reject it if skb is NULL. */
|
| 1165 |
+ if (skb == NULL || !(skb->dev->flags & IFF_LOOPBACK)) {
|
| 1166 |
err_offset = opt_iter;
|
| 1167 |
goto validate_return_locked;
|
| 1168 |
}
|
| 1169 |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
|
| 1170 |
index 6db041d..b6ec23c 100644
|
| 1171 |
--- a/net/ipv4/tcp.c
|
| 1172 |
+++ b/net/ipv4/tcp.c
|
| 1173 |
@@ -2394,7 +2394,10 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
|
| 1174 |
/* Cap the max timeout in ms TCP will retry/retrans
|
| 1175 |
* before giving up and aborting (ETIMEDOUT) a connection.
|
| 1176 |
*/
|
| 1177 |
- icsk->icsk_user_timeout = msecs_to_jiffies(val);
|
| 1178 |
+ if (val < 0)
|
| 1179 |
+ err = -EINVAL;
|
| 1180 |
+ else
|
| 1181 |
+ icsk->icsk_user_timeout = msecs_to_jiffies(val);
|
| 1182 |
break;
|
| 1183 |
default:
|
| 1184 |
err = -ENOPROTOOPT;
|
| 1185 |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
|
| 1186 |
index 6e33b79c..b76aa2d 100644
|
| 1187 |
--- a/net/ipv4/tcp_input.c
|
| 1188 |
+++ b/net/ipv4/tcp_input.c
|
| 1189 |
@@ -5340,7 +5340,9 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
|
| 1190 |
if (tp->copied_seq == tp->rcv_nxt &&
|
| 1191 |
len - tcp_header_len <= tp->ucopy.len) {
|
| 1192 |
#ifdef CONFIG_NET_DMA
|
| 1193 |
- if (tcp_dma_try_early_copy(sk, skb, tcp_header_len)) {
|
| 1194 |
+ if (tp->ucopy.task == current &&
|
| 1195 |
+ sock_owned_by_user(sk) &&
|
| 1196 |
+ tcp_dma_try_early_copy(sk, skb, tcp_header_len)) {
|
| 1197 |
copied_early = 1;
|
| 1198 |
eaten = 1;
|
| 1199 |
}
|
| 1200 |
diff --git a/net/sched/sch_sfb.c b/net/sched/sch_sfb.c
|
| 1201 |
index 47ee29f..e85b2487 100644
|
| 1202 |
--- a/net/sched/sch_sfb.c
|
| 1203 |
+++ b/net/sched/sch_sfb.c
|
| 1204 |
@@ -556,6 +556,8 @@ static int sfb_dump(struct Qdisc *sch, struct sk_buff *skb)
|
| 1205 |
|
| 1206 |
sch->qstats.backlog = q->qdisc->qstats.backlog;
|
| 1207 |
opts = nla_nest_start(skb, TCA_OPTIONS);
|
| 1208 |
+ if (opts == NULL)
|
| 1209 |
+ goto nla_put_failure;
|
| 1210 |
NLA_PUT(skb, TCA_SFB_PARMS, sizeof(opt), &opt);
|
| 1211 |
return nla_nest_end(skb, opts);
|
| 1212 |
|
| 1213 |
diff --git a/net/sctp/input.c b/net/sctp/input.c
|
| 1214 |
index 741ed16..cd9eded 100644
|
| 1215 |
--- a/net/sctp/input.c
|
| 1216 |
+++ b/net/sctp/input.c
|
| 1217 |
@@ -737,15 +737,12 @@ static void __sctp_unhash_endpoint(struct sctp_endpoint *ep)
|
| 1218 |
|
| 1219 |
epb = &ep->base;
|
| 1220 |
|
| 1221 |
- if (hlist_unhashed(&epb->node))
|
| 1222 |
- return;
|
| 1223 |
-
|
| 1224 |
epb->hashent = sctp_ep_hashfn(epb->bind_addr.port);
|
| 1225 |
|
| 1226 |
head = &sctp_ep_hashtable[epb->hashent];
|
| 1227 |
|
| 1228 |
sctp_write_lock(&head->lock);
|
| 1229 |
- __hlist_del(&epb->node);
|
| 1230 |
+ hlist_del_init(&epb->node);
|
| 1231 |
sctp_write_unlock(&head->lock);
|
| 1232 |
}
|
| 1233 |
|
| 1234 |
@@ -826,7 +823,7 @@ static void __sctp_unhash_established(struct sctp_association *asoc)
|
| 1235 |
head = &sctp_assoc_hashtable[epb->hashent];
|
| 1236 |
|
| 1237 |
sctp_write_lock(&head->lock);
|
| 1238 |
- __hlist_del(&epb->node);
|
| 1239 |
+ hlist_del_init(&epb->node);
|
| 1240 |
sctp_write_unlock(&head->lock);
|
| 1241 |
}
|
| 1242 |
|
| 1243 |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
|
| 1244 |
index 4434853..b70a3ee 100644
|
| 1245 |
--- a/net/sctp/socket.c
|
| 1246 |
+++ b/net/sctp/socket.c
|
| 1247 |
@@ -1160,8 +1160,14 @@ out_free:
|
| 1248 |
SCTP_DEBUG_PRINTK("About to exit __sctp_connect() free asoc: %p"
|
| 1249 |
" kaddrs: %p err: %d\n",
|
| 1250 |
asoc, kaddrs, err);
|
| 1251 |
- if (asoc)
|
| 1252 |
+ if (asoc) {
|
| 1253 |
+ /* sctp_primitive_ASSOCIATE may have added this association
|
| 1254 |
+ * To the hash table, try to unhash it, just in case, its a noop
|
| 1255 |
+ * if it wasn't hashed so we're safe
|
| 1256 |
+ */
|
| 1257 |
+ sctp_unhash_established(asoc);
|
| 1258 |
sctp_association_free(asoc);
|
| 1259 |
+ }
|
| 1260 |
return err;
|
| 1261 |
}
|
| 1262 |
|
| 1263 |
@@ -1871,8 +1877,10 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
|
| 1264 |
goto out_unlock;
|
| 1265 |
|
| 1266 |
out_free:
|
| 1267 |
- if (new_asoc)
|
| 1268 |
+ if (new_asoc) {
|
| 1269 |
+ sctp_unhash_established(asoc);
|
| 1270 |
sctp_association_free(asoc);
|
| 1271 |
+ }
|
| 1272 |
out_unlock:
|
| 1273 |
sctp_release_sock(sk);
|
| 1274 |
|
| 1275 |
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
|
| 1276 |
index b6bb225..c57f97f 100644
|
| 1277 |
--- a/net/sunrpc/sched.c
|
| 1278 |
+++ b/net/sunrpc/sched.c
|
| 1279 |
@@ -713,7 +713,9 @@ void rpc_execute(struct rpc_task *task)
|
| 1280 |
|
| 1281 |
static void rpc_async_schedule(struct work_struct *work)
|
| 1282 |
{
|
| 1283 |
+ current->flags |= PF_FSTRANS;
|
| 1284 |
__rpc_execute(container_of(work, struct rpc_task, u.tk_work));
|
| 1285 |
+ current->flags &= ~PF_FSTRANS;
|
| 1286 |
}
|
| 1287 |
|
| 1288 |
/**
|
| 1289 |
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
|
| 1290 |
index 0867070..d0b5210 100644
|
| 1291 |
--- a/net/sunrpc/xprtrdma/transport.c
|
| 1292 |
+++ b/net/sunrpc/xprtrdma/transport.c
|
| 1293 |
@@ -200,6 +200,7 @@ xprt_rdma_connect_worker(struct work_struct *work)
|
| 1294 |
int rc = 0;
|
| 1295 |
|
| 1296 |
if (!xprt->shutdown) {
|
| 1297 |
+ current->flags |= PF_FSTRANS;
|
| 1298 |
xprt_clear_connected(xprt);
|
| 1299 |
|
| 1300 |
dprintk("RPC: %s: %sconnect\n", __func__,
|
| 1301 |
@@ -212,10 +213,10 @@ xprt_rdma_connect_worker(struct work_struct *work)
|
| 1302 |
|
| 1303 |
out:
|
| 1304 |
xprt_wake_pending_tasks(xprt, rc);
|
| 1305 |
-
|
| 1306 |
out_clear:
|
| 1307 |
dprintk("RPC: %s: exit\n", __func__);
|
| 1308 |
xprt_clear_connecting(xprt);
|
| 1309 |
+ current->flags &= ~PF_FSTRANS;
|
| 1310 |
}
|
| 1311 |
|
| 1312 |
/*
|
| 1313 |
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
|
| 1314 |
index ea75079..554111f 100644
|
| 1315 |
--- a/net/sunrpc/xprtsock.c
|
| 1316 |
+++ b/net/sunrpc/xprtsock.c
|
| 1317 |
@@ -1882,6 +1882,8 @@ static void xs_local_setup_socket(struct work_struct *work)
|
| 1318 |
if (xprt->shutdown)
|
| 1319 |
goto out;
|
| 1320 |
|
| 1321 |
+ current->flags |= PF_FSTRANS;
|
| 1322 |
+
|
| 1323 |
clear_bit(XPRT_CONNECTION_ABORT, &xprt->state);
|
| 1324 |
status = __sock_create(xprt->xprt_net, AF_LOCAL,
|
| 1325 |
SOCK_STREAM, 0, &sock, 1);
|
| 1326 |
@@ -1915,6 +1917,7 @@ static void xs_local_setup_socket(struct work_struct *work)
|
| 1327 |
out:
|
| 1328 |
xprt_clear_connecting(xprt);
|
| 1329 |
xprt_wake_pending_tasks(xprt, status);
|
| 1330 |
+ current->flags &= ~PF_FSTRANS;
|
| 1331 |
}
|
| 1332 |
|
| 1333 |
static void xs_udp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock)
|
| 1334 |
@@ -1957,6 +1960,8 @@ static void xs_udp_setup_socket(struct work_struct *work)
|
| 1335 |
if (xprt->shutdown)
|
| 1336 |
goto out;
|
| 1337 |
|
| 1338 |
+ current->flags |= PF_FSTRANS;
|
| 1339 |
+
|
| 1340 |
/* Start by resetting any existing state */
|
| 1341 |
xs_reset_transport(transport);
|
| 1342 |
sock = xs_create_sock(xprt, transport,
|
| 1343 |
@@ -1975,6 +1980,7 @@ static void xs_udp_setup_socket(struct work_struct *work)
|
| 1344 |
out:
|
| 1345 |
xprt_clear_connecting(xprt);
|
| 1346 |
xprt_wake_pending_tasks(xprt, status);
|
| 1347 |
+ current->flags &= ~PF_FSTRANS;
|
| 1348 |
}
|
| 1349 |
|
| 1350 |
/*
|
| 1351 |
@@ -2100,6 +2106,8 @@ static void xs_tcp_setup_socket(struct work_struct *work)
|
| 1352 |
if (xprt->shutdown)
|
| 1353 |
goto out;
|
| 1354 |
|
| 1355 |
+ current->flags |= PF_FSTRANS;
|
| 1356 |
+
|
| 1357 |
if (!sock) {
|
| 1358 |
clear_bit(XPRT_CONNECTION_ABORT, &xprt->state);
|
| 1359 |
sock = xs_create_sock(xprt, transport,
|
| 1360 |
@@ -2149,6 +2157,7 @@ static void xs_tcp_setup_socket(struct work_struct *work)
|
| 1361 |
case -EINPROGRESS:
|
| 1362 |
case -EALREADY:
|
| 1363 |
xprt_clear_connecting(xprt);
|
| 1364 |
+ current->flags &= ~PF_FSTRANS;
|
| 1365 |
return;
|
| 1366 |
case -EINVAL:
|
| 1367 |
/* Happens, for instance, if the user specified a link
|
| 1368 |
@@ -2161,6 +2170,7 @@ out_eagain:
|
| 1369 |
out:
|
| 1370 |
xprt_clear_connecting(xprt);
|
| 1371 |
xprt_wake_pending_tasks(xprt, status);
|
| 1372 |
+ current->flags &= ~PF_FSTRANS;
|
| 1373 |
}
|
| 1374 |
|
| 1375 |
/**
|
| 1376 |
diff --git a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c
|
| 1377 |
index 788a12c..2ab7850 100644
|
| 1378 |
--- a/net/wanrouter/wanmain.c
|
| 1379 |
+++ b/net/wanrouter/wanmain.c
|
| 1380 |
@@ -602,36 +602,31 @@ static int wanrouter_device_new_if(struct wan_device *wandev,
|
| 1381 |
* successfully, add it to the interface list.
|
| 1382 |
*/
|
| 1383 |
|
| 1384 |
- if (dev->name == NULL) {
|
| 1385 |
- err = -EINVAL;
|
| 1386 |
- } else {
|
| 1387 |
+#ifdef WANDEBUG
|
| 1388 |
+ printk(KERN_INFO "%s: registering interface %s...\n",
|
| 1389 |
+ wanrouter_modname, dev->name);
|
| 1390 |
+#endif
|
| 1391 |
|
| 1392 |
- #ifdef WANDEBUG
|
| 1393 |
- printk(KERN_INFO "%s: registering interface %s...\n",
|
| 1394 |
- wanrouter_modname, dev->name);
|
| 1395 |
- #endif
|
| 1396 |
-
|
| 1397 |
- err = register_netdev(dev);
|
| 1398 |
- if (!err) {
|
| 1399 |
- struct net_device *slave = NULL;
|
| 1400 |
- unsigned long smp_flags=0;
|
| 1401 |
-
|
| 1402 |
- lock_adapter_irq(&wandev->lock, &smp_flags);
|
| 1403 |
-
|
| 1404 |
- if (wandev->dev == NULL) {
|
| 1405 |
- wandev->dev = dev;
|
| 1406 |
- } else {
|
| 1407 |
- for (slave=wandev->dev;
|
| 1408 |
- DEV_TO_SLAVE(slave);
|
| 1409 |
- slave = DEV_TO_SLAVE(slave))
|
| 1410 |
- DEV_TO_SLAVE(slave) = dev;
|
| 1411 |
- }
|
| 1412 |
- ++wandev->ndev;
|
| 1413 |
-
|
| 1414 |
- unlock_adapter_irq(&wandev->lock, &smp_flags);
|
| 1415 |
- err = 0; /* done !!! */
|
| 1416 |
- goto out;
|
| 1417 |
+ err = register_netdev(dev);
|
| 1418 |
+ if (!err) {
|
| 1419 |
+ struct net_device *slave = NULL;
|
| 1420 |
+ unsigned long smp_flags=0;
|
| 1421 |
+
|
| 1422 |
+ lock_adapter_irq(&wandev->lock, &smp_flags);
|
| 1423 |
+
|
| 1424 |
+ if (wandev->dev == NULL) {
|
| 1425 |
+ wandev->dev = dev;
|
| 1426 |
+ } else {
|
| 1427 |
+ for (slave=wandev->dev;
|
| 1428 |
+ DEV_TO_SLAVE(slave);
|
| 1429 |
+ slave = DEV_TO_SLAVE(slave))
|
| 1430 |
+ DEV_TO_SLAVE(slave) = dev;
|
| 1431 |
}
|
| 1432 |
+ ++wandev->ndev;
|
| 1433 |
+
|
| 1434 |
+ unlock_adapter_irq(&wandev->lock, &smp_flags);
|
| 1435 |
+ err = 0; /* done !!! */
|
| 1436 |
+ goto out;
|
| 1437 |
}
|
| 1438 |
if (wandev->del_if)
|
| 1439 |
wandev->del_if(wandev, dev);
|
| 1440 |
diff --git a/sound/drivers/mpu401/mpu401_uart.c b/sound/drivers/mpu401/mpu401_uart.c
|
| 1441 |
index 2af0999..74f5a3d 100644
|
| 1442 |
--- a/sound/drivers/mpu401/mpu401_uart.c
|
| 1443 |
+++ b/sound/drivers/mpu401/mpu401_uart.c
|
| 1444 |
@@ -554,6 +554,7 @@ int snd_mpu401_uart_new(struct snd_card *card, int device,
|
| 1445 |
spin_lock_init(&mpu->output_lock);
|
| 1446 |
spin_lock_init(&mpu->timer_lock);
|
| 1447 |
mpu->hardware = hardware;
|
| 1448 |
+ mpu->irq = -1;
|
| 1449 |
if (! (info_flags & MPU401_INFO_INTEGRATED)) {
|
| 1450 |
int res_size = hardware == MPU401_HW_PC98II ? 4 : 2;
|
| 1451 |
mpu->res = request_region(port, res_size, "MPU401 UART");
|
| 1452 |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
|
| 1453 |
index baa7a49..8d288a7 100644
|
| 1454 |
--- a/sound/pci/hda/patch_realtek.c
|
| 1455 |
+++ b/sound/pci/hda/patch_realtek.c
|
| 1456 |
@@ -20133,6 +20133,7 @@ static const struct hda_codec_preset snd_hda_preset_realtek[] = {
|
| 1457 |
{ .id = 0x10ec0275, .name = "ALC275", .patch = patch_alc269 },
|
| 1458 |
{ .id = 0x10ec0276, .name = "ALC276", .patch = patch_alc269 },
|
| 1459 |
{ .id = 0x10ec0280, .name = "ALC280", .patch = patch_alc269 },
|
| 1460 |
+ { .id = 0x10ec0282, .name = "ALC282", .patch = patch_alc269 },
|
| 1461 |
{ .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660",
|
| 1462 |
.patch = patch_alc861 },
|
| 1463 |
{ .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd },
|
| 1464 |
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
|
| 1465 |
index c850e3d..f16f587 100644
|
| 1466 |
--- a/sound/soc/codecs/wm8962.c
|
| 1467 |
+++ b/sound/soc/codecs/wm8962.c
|
| 1468 |
@@ -2890,6 +2890,9 @@ static int wm8962_set_bias_level(struct snd_soc_codec *codec,
|
| 1469 |
/* VMID 2*250k */
|
| 1470 |
snd_soc_update_bits(codec, WM8962_PWR_MGMT_1,
|
| 1471 |
WM8962_VMID_SEL_MASK, 0x100);
|
| 1472 |
+
|
| 1473 |
+ if (codec->dapm.bias_level == SND_SOC_BIAS_OFF)
|
| 1474 |
+ msleep(100);
|
| 1475 |
break;
|
| 1476 |
|
| 1477 |
case SND_SOC_BIAS_OFF:
|
| 1478 |
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
|
| 1479 |
index 2194912..1f7616d 100644
|
| 1480 |
--- a/sound/soc/codecs/wm8994.c
|
| 1481 |
+++ b/sound/soc/codecs/wm8994.c
|
| 1482 |
@@ -2127,7 +2127,7 @@ static int wm8994_hw_params(struct snd_pcm_substream *substream,
|
| 1483 |
return -EINVAL;
|
| 1484 |
}
|
| 1485 |
|
| 1486 |
- bclk_rate = params_rate(params) * 2;
|
| 1487 |
+ bclk_rate = params_rate(params) * 4;
|
| 1488 |
switch (params_format(params)) {
|
| 1489 |
case SNDRV_PCM_FORMAT_S16_LE:
|
| 1490 |
bclk_rate *= 16;
|
| 1491 |
diff --git a/sound/usb/clock.c b/sound/usb/clock.c
|
| 1492 |
index 075195e..f0ff776 100644
|
| 1493 |
--- a/sound/usb/clock.c
|
| 1494 |
+++ b/sound/usb/clock.c
|
| 1495 |
@@ -111,7 +111,8 @@ static bool uac_clock_source_is_valid(struct snd_usb_audio *chip, int source_id)
|
| 1496 |
return 0;
|
| 1497 |
|
| 1498 |
/* If a clock source can't tell us whether it's valid, we assume it is */
|
| 1499 |
- if (!uac2_control_is_readable(cs_desc->bmControls, UAC2_CS_CONTROL_CLOCK_VALID))
|
| 1500 |
+ if (!uac2_control_is_readable(cs_desc->bmControls,
|
| 1501 |
+ UAC2_CS_CONTROL_CLOCK_VALID - 1))
|
| 1502 |
return 1;
|
| 1503 |
|
| 1504 |
err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC2_CS_CUR,
|