···6677config ARM_VIC_NR88 int99+ default 4 if ARCH_S5PV2101010+ default 3 if ARCH_S5P6442 || ARCH_S5PC100911 default 21012 depends on ARM_VIC1113 help
-4
arch/arm/include/asm/mach/arch.h
···1515struct sys_timer;16161717struct machine_desc {1818- /*1919- * Note! The first two elements are used2020- * by assembler code in head.S, head-common.S2121- */2218 unsigned int nr; /* architecture number */2319 const char *name; /* architecture name */2420 unsigned long boot_params; /* tagged list */
···9999 select POWER_SUPPLY100100 select MACH_NEO1973101101 select S3C2410_PWM102102+ select S3C_DEV_USB_HOST102103 help103104 Say Y here if you are using the Openmoko GTA02 / Freerunner GSM Phone104105
···1717void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols)1818{1919 /* Set all the necessary GPK pins to special-function 3: KP_ROW[x] */2020- s3c_gpio_cfgrange_nopull(S3C64XX_GPK(8), 8 + rows, S3C_GPIO_SFN(3));2020+ s3c_gpio_cfgrange_nopull(S3C64XX_GPK(8), rows, S3C_GPIO_SFN(3));21212222 /* Set all the necessary GPL pins to special-function 3: KP_COL[x] */2323 s3c_gpio_cfgrange_nopull(S3C64XX_GPL(0), cols, S3C_GPIO_SFN(3));
···3333//3434//----------------------------------------------------------------------------3535#include <linux/cache.h>3636+#include <linux/threads.h>3637#include <asm/types.h>3738#include <asm/mmu.h>3939+4040+/*4141+ * We only have to have statically allocated lppaca structs on4242+ * legacy iSeries, which supports at most 64 cpus.4343+ */4444+#ifdef CONFIG_PPC_ISERIES4545+#if NR_CPUS < 644646+#define NR_LPPACAS NR_CPUS4747+#else4848+#define NR_LPPACAS 644949+#endif5050+#else /* not iSeries */5151+#define NR_LPPACAS 15252+#endif5353+38543955/* The Hypervisor barfs if the lppaca crosses a page boundary. A 1k4056 * alignment is sufficient to prevent this */
-14
arch/powerpc/kernel/paca.c
···2727#ifdef CONFIG_PPC_BOOK3S28282929/*3030- * We only have to have statically allocated lppaca structs on3131- * legacy iSeries, which supports at most 64 cpus.3232- */3333-#ifdef CONFIG_PPC_ISERIES3434-#if NR_CPUS < 643535-#define NR_LPPACAS NR_CPUS3636-#else3737-#define NR_LPPACAS 643838-#endif3939-#else /* not iSeries */4040-#define NR_LPPACAS 14141-#endif4242-4343-/*4430 * The structure which the hypervisor knows about - this structure4531 * should not cross a page boundary. The vpa_init/register_vpa call4632 * is now known to fail if the lppaca structure crosses a page
+2-1
arch/powerpc/mm/numa.c
···15161516{15171517 int rc = 0;1518151815191519- if (firmware_has_feature(FW_FEATURE_VPHN) &&15191519+ /* Disabled until races with load balancing are fixed */15201520+ if (0 && firmware_has_feature(FW_FEATURE_VPHN) &&15201521 get_lppaca()->shared_proc) {15211522 vphn_enabled = 1;15221523 setup_cpu_associativity_change_counters();
+3-3
arch/powerpc/platforms/iseries/dt.c
···242242 pft_size[0] = 0; /* NUMA CEC cookie, 0 for non NUMA */243243 pft_size[1] = __ilog2(HvCallHpt_getHptPages() * HW_PAGE_SIZE);244244245245- for (i = 0; i < NR_CPUS; i++) {246246- if (lppaca_of(i).dyn_proc_status >= 2)245245+ for (i = 0; i < NR_LPPACAS; i++) {246246+ if (lppaca[i].dyn_proc_status >= 2)247247 continue;248248249249 snprintf(p, 32 - (p - buf), "@%d", i);···251251252252 dt_prop_str(dt, "device_type", device_type_cpu);253253254254- index = lppaca_of(i).dyn_hv_phys_proc_index;254254+ index = lppaca[i].dyn_hv_phys_proc_index;255255 d = &xIoHriProcessorVpd[index];256256257257 dt_prop_u32(dt, "i-cache-size", d->xInstCacheSize * 1024);
+1
arch/powerpc/platforms/iseries/setup.c
···680680 * on but calling this function multiple times is fine.681681 */682682 identify_cpu(0, mfspr(SPRN_PVR));683683+ initialise_paca(&boot_paca, 0);683684684685 powerpc_firmware_features |= FW_FEATURE_ISERIES;685686 powerpc_firmware_features |= FW_FEATURE_LPAR;
+1-1
arch/sh/include/asm/sections.h
···3344#include <asm-generic/sections.h>5566-extern void __nosave_begin, __nosave_end;66+extern long __nosave_begin, __nosave_end;77extern long __machvec_start, __machvec_end;88extern char __uncached_start, __uncached_end;99extern char _ebss[];
···1010void __delay(unsigned long loops)1111{1212 __asm__ __volatile__(1313+ /*1414+ * ST40-300 appears to have an issue with this code,1515+ * normally taking two cycles each loop, as with all1616+ * other SH variants. If however the branch and the1717+ * delay slot straddle an 8 byte boundary, this increases1818+ * to 3 cycles.1919+ * This align directive ensures this doesn't occur.2020+ */2121+ ".balign 8\n\t"2222+1323 "tst %0, %0\n\t"1424 "1:\t"1525 "bf/s 1b\n\t"
···176176struct bau_msg_header {177177 unsigned int dest_subnodeid:6; /* must be 0x10, for the LB */178178 /* bits 5:0 */179179- unsigned int base_dest_nodeid:15; /* nasid (pnode<<1) of */179179+ unsigned int base_dest_nodeid:15; /* nasid of the */180180 /* bits 20:6 */ /* first bit in uvhub map */181181 unsigned int command:8; /* message type */182182 /* bits 28:21 */
···780780 int physnid;781781 int nid = NUMA_NO_NODE;782782783783- apicid = early_per_cpu(x86_cpu_to_apicid, cpu);784784- if (apicid != BAD_APICID)785785- nid = apicid_to_node[apicid];786786- if (nid == NUMA_NO_NODE)787787- nid = early_cpu_to_node(cpu);783783+ nid = early_cpu_to_node(cpu);788784 BUG_ON(nid == NUMA_NO_NODE || !node_online(nid));789785790786 /*
+2-2
arch/x86/platform/uv/tlb_uv.c
···13641364 memset(bd2, 0, sizeof(struct bau_desc));13651365 bd2->header.sw_ack_flag = 1;13661366 /*13671367- * base_dest_nodeid is the nasid (pnode<<1) of the first uvhub13671367+ * base_dest_nodeid is the nasid of the first uvhub13681368 * in the partition. The bit map will indicate uvhub numbers,13691369 * which are 0-N in a partition. Pnodes are unique system-wide.13701370 */13711371- bd2->header.base_dest_nodeid = uv_partition_base_pnode << 1;13711371+ bd2->header.base_dest_nodeid = UV_PNODE_TO_NASID(uv_partition_base_pnode);13721372 bd2->header.dest_subnodeid = 0x10; /* the LB */13731373 bd2->header.command = UV_NET_ENDPOINT_INTD;13741374 bd2->header.int_both = 1;
+8
drivers/char/ipmi/ipmi_si_intf.c
···900900 printk("**Enqueue: %d.%9.9d\n", t.tv_sec, t.tv_usec);901901#endif902902903903+ /*904904+ * last_timeout_jiffies is updated here to avoid905905+ * smi_timeout() handler passing very large time_diff906906+ * value to smi_event_handler() that causes907907+ * the send command to abort.908908+ */909909+ smi_info->last_timeout_jiffies = jiffies;910910+903911 mod_timer(&smi_info->si_timer, jiffies + SI_TIMEOUT_JIFFIES);904912905913 if (smi_info->thread)
+8
drivers/char/virtio_console.c
···388388 unsigned int len;389389 int ret;390390391391+ if (!port->portdev) {392392+ /* Device has been unplugged. vqs are already gone. */393393+ return;394394+ }391395 vq = port->in_vq;392396 if (port->inbuf)393397 buf = port->inbuf;···474470 void *buf;475471 unsigned int len;476472473473+ if (!port->portdev) {474474+ /* Device has been unplugged. vqs are already gone. */475475+ return;476476+ }477477 while ((buf = virtqueue_get_buf(port->out_vq, &len))) {478478 kfree(buf);479479 port->outvq_full = false;
+2-2
drivers/gpu/drm/drm_fb_helper.c
···672672 struct drm_crtc_helper_funcs *crtc_funcs;673673 u16 *red, *green, *blue, *transp;674674 struct drm_crtc *crtc;675675- int i, rc = 0;675675+ int i, j, rc = 0;676676 int start;677677678678 for (i = 0; i < fb_helper->crtc_count; i++) {···685685 transp = cmap->transp;686686 start = cmap->start;687687688688- for (i = 0; i < cmap->len; i++) {688688+ for (j = 0; j < cmap->len; j++) {689689 u16 hred, hgreen, hblue, htransp = 0xffff;690690691691 hred = *red++;
+2-2
drivers/gpu/drm/i915/i915_debugfs.c
···865865 int max_freq;866866867867 /* RPSTAT1 is in the GT power well */868868- __gen6_force_wake_get(dev_priv);868868+ __gen6_gt_force_wake_get(dev_priv);869869870870 seq_printf(m, "GT_PERF_STATUS: 0x%08x\n", gt_perf_status);871871 seq_printf(m, "RPSTAT1: 0x%08x\n", I915_READ(GEN6_RPSTAT1));···888888 seq_printf(m, "Max non-overclocked (RP0) frequency: %dMHz\n",889889 max_freq * 100);890890891891- __gen6_force_wake_put(dev_priv);891891+ __gen6_gt_force_wake_put(dev_priv);892892 } else {893893 seq_printf(m, "no P-state info available\n");894894 }
+15-2
drivers/gpu/drm/i915/i915_drv.c
···4646unsigned int i915_powersave = 1;4747module_param_named(powersave, i915_powersave, int, 0600);48484949+unsigned int i915_semaphores = 0;5050+module_param_named(semaphores, i915_semaphores, int, 0600);5151+4952unsigned int i915_enable_rc6 = 0;5053module_param_named(i915_enable_rc6, i915_enable_rc6, int, 0600);5154···257254 }258255}259256260260-void __gen6_force_wake_get(struct drm_i915_private *dev_priv)257257+void __gen6_gt_force_wake_get(struct drm_i915_private *dev_priv)261258{262259 int count;263260···273270 udelay(10);274271}275272276276-void __gen6_force_wake_put(struct drm_i915_private *dev_priv)273273+void __gen6_gt_force_wake_put(struct drm_i915_private *dev_priv)277274{278275 I915_WRITE_NOTRACE(FORCEWAKE, 0);279276 POSTING_READ(FORCEWAKE);277277+}278278+279279+void __gen6_gt_wait_for_fifo(struct drm_i915_private *dev_priv)280280+{281281+ int loop = 500;282282+ u32 fifo = I915_READ_NOTRACE(GT_FIFO_FREE_ENTRIES);283283+ while (fifo < 20 && loop--) {284284+ udelay(10);285285+ fifo = I915_READ_NOTRACE(GT_FIFO_FREE_ENTRIES);286286+ }280287}281288282289static int i915_drm_freeze(struct drm_device *dev)
+19-5
drivers/gpu/drm/i915/i915_drv.h
···956956extern int i915_max_ioctl;957957extern unsigned int i915_fbpercrtc;958958extern unsigned int i915_powersave;959959+extern unsigned int i915_semaphores;959960extern unsigned int i915_lvds_downclock;960961extern unsigned int i915_panel_use_ssc;961962extern unsigned int i915_enable_rc6;···11781177void i915_gem_free_all_phys_object(struct drm_device *dev);11791178void i915_gem_release(struct drm_device *dev, struct drm_file *file);1180117911801180+uint32_t11811181+i915_gem_get_unfenced_gtt_alignment(struct drm_i915_gem_object *obj);11821182+11811183/* i915_gem_gtt.c */11821184void i915_gem_restore_gtt_mappings(struct drm_device *dev);11831185int __must_check i915_gem_gtt_bind_object(struct drm_i915_gem_object *obj);···13571353 * must be set to prevent GT core from power down and stale values being13581354 * returned.13591355 */13601360-void __gen6_force_wake_get(struct drm_i915_private *dev_priv);13611361-void __gen6_force_wake_put (struct drm_i915_private *dev_priv);13621362-static inline u32 i915_safe_read(struct drm_i915_private *dev_priv, u32 reg)13561356+void __gen6_gt_force_wake_get(struct drm_i915_private *dev_priv);13571357+void __gen6_gt_force_wake_put(struct drm_i915_private *dev_priv);13581358+void __gen6_gt_wait_for_fifo(struct drm_i915_private *dev_priv);13591359+13601360+static inline u32 i915_gt_read(struct drm_i915_private *dev_priv, u32 reg)13631361{13641362 u32 val;1365136313661364 if (dev_priv->info->gen >= 6) {13671367- __gen6_force_wake_get(dev_priv);13651365+ __gen6_gt_force_wake_get(dev_priv);13681366 val = I915_READ(reg);13691369- __gen6_force_wake_put(dev_priv);13671367+ __gen6_gt_force_wake_put(dev_priv);13701368 } else13711369 val = I915_READ(reg);1372137013731371 return val;13721372+}13731373+13741374+static inline void i915_gt_write(struct drm_i915_private *dev_priv,13751375+ u32 reg, u32 val)13761376+{13771377+ if (dev_priv->info->gen >= 6)13781378+ __gen6_gt_wait_for_fifo(dev_priv);13791379+ I915_WRITE(reg, val);13741380}1375138113761382static inline void
+1-1
drivers/gpu/drm/i915/i915_gem.c
···13981398 * Return the required GTT alignment for an object, only taking into account13991399 * unfenced tiled surface requirements.14001400 */14011401-static uint32_t14011401+uint32_t14021402i915_gem_get_unfenced_gtt_alignment(struct drm_i915_gem_object *obj)14031403{14041404 struct drm_device *dev = obj->base.dev;
+2-2
drivers/gpu/drm/i915/i915_gem_execbuffer.c
···772772 if (from == NULL || to == from)773773 return 0;774774775775- /* XXX gpu semaphores are currently causing hard hangs on SNB mobile */776776- if (INTEL_INFO(obj->base.dev)->gen < 6 || IS_MOBILE(obj->base.dev))775775+ /* XXX gpu semaphores are implicated in various hard hangs on SNB */776776+ if (INTEL_INFO(obj->base.dev)->gen < 6 || !i915_semaphores)777777 return i915_gem_object_wait_rendering(obj, true);778778779779 idx = intel_ring_sync_index(from, to);
+18-19
drivers/gpu/drm/i915/i915_gem_tiling.c
···184184static bool185185i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode)186186{187187- int tile_width, tile_height;187187+ int tile_width;188188189189 /* Linear is always fine */190190 if (tiling_mode == I915_TILING_NONE)···214214 return false;215215 }216216 }217217-218218- if (IS_GEN2(dev) ||219219- (tiling_mode == I915_TILING_Y && HAS_128_BYTE_Y_TILING(dev)))220220- tile_height = 32;221221- else222222- tile_height = 8;223223- /* i8xx is strange: It has 2 interleaved rows of tiles, so needs an even224224- * number of tile rows. */225225- if (IS_GEN2(dev))226226- tile_height *= 2;227227-228228- /* Size needs to be aligned to a full tile row */229229- if (size & (tile_height * stride - 1))230230- return false;231217232218 /* 965+ just needs multiples of tile width */233219 if (INTEL_INFO(dev)->gen >= 4) {···349363 (obj->gtt_offset + obj->base.size <= dev_priv->mm.gtt_mappable_end &&350364 i915_gem_object_fence_ok(obj, args->tiling_mode));351365352352- obj->tiling_changed = true;353353- obj->tiling_mode = args->tiling_mode;354354- obj->stride = args->stride;366366+ /* Rebind if we need a change of alignment */367367+ if (!obj->map_and_fenceable) {368368+ u32 unfenced_alignment =369369+ i915_gem_get_unfenced_gtt_alignment(obj);370370+ if (obj->gtt_offset & (unfenced_alignment - 1))371371+ ret = i915_gem_object_unbind(obj);372372+ }373373+374374+ if (ret == 0) {375375+ obj->tiling_changed = true;376376+ obj->tiling_mode = args->tiling_mode;377377+ obj->stride = args->stride;378378+ }355379 }380380+ /* we have to maintain this existing ABI... */381381+ args->stride = obj->stride;382382+ args->tiling_mode = obj->tiling_mode;356383 drm_gem_object_unreference(&obj->base);357384 mutex_unlock(&dev->struct_mutex);358385359359- return 0;386386+ return ret;360387}361388362389/**
+12
drivers/gpu/drm/i915/i915_reg.h
···1553155315541554/* Backlight control */15551555#define BLC_PWM_CTL 0x6125415561556+#define BACKLIGHT_MODULATION_FREQ_SHIFT (17)15561557#define BLC_PWM_CTL2 0x61250 /* 965+ only */15581558+#define BLM_COMBINATION_MODE (1 << 30)15591559+/*15601560+ * This is the most significant 15 bits of the number of backlight cycles in a15611561+ * complete cycle of the modulated backlight control.15621562+ *15631563+ * The actual value is this field multiplied by two.15641564+ */15651565+#define BACKLIGHT_MODULATION_FREQ_MASK (0x7fff << 17)15661566+#define BLM_LEGACY_MODE (1 << 16)15571567/*15581568 * This is the number of cycles out of the backlight modulation cycle for which15591569 * the backlight is on.···3270326032713261#define FORCEWAKE 0xA18C32723262#define FORCEWAKE_ACK 0x13009032633263+32643264+#define GT_FIFO_FREE_ENTRIES 0x1200083273326532743266#define GEN6_RPNSWREQ 0xA00832753267#define GEN6_TURBO_DISABLE (1<<31)
+4-4
drivers/gpu/drm/i915/intel_display.c
···12191219 u32 blt_ecoskpd;1220122012211221 /* Make sure blitter notifies FBC of writes */12221222- __gen6_force_wake_get(dev_priv);12221222+ __gen6_gt_force_wake_get(dev_priv);12231223 blt_ecoskpd = I915_READ(GEN6_BLITTER_ECOSKPD);12241224 blt_ecoskpd |= GEN6_BLITTER_FBC_NOTIFY <<12251225 GEN6_BLITTER_LOCK_SHIFT;···12301230 GEN6_BLITTER_LOCK_SHIFT);12311231 I915_WRITE(GEN6_BLITTER_ECOSKPD, blt_ecoskpd);12321232 POSTING_READ(GEN6_BLITTER_ECOSKPD);12331233- __gen6_force_wake_put(dev_priv);12331233+ __gen6_gt_force_wake_put(dev_priv);12341234}1235123512361236static void ironlake_enable_fbc(struct drm_crtc *crtc, unsigned long interval)···62826282 * userspace...62836283 */62846284 I915_WRITE(GEN6_RC_STATE, 0);62856285- __gen6_force_wake_get(dev_priv);62856285+ __gen6_gt_force_wake_get(dev_priv);6286628662876287 /* disable the counters and set deterministic thresholds */62886288 I915_WRITE(GEN6_RC_CONTROL, 0);···63806380 /* enable all PM interrupts */63816381 I915_WRITE(GEN6_PMINTRMSK, 0);6382638263836383- __gen6_force_wake_put(dev_priv);63836383+ __gen6_gt_force_wake_put(dev_priv);63846384}6385638563866386void intel_enable_clock_gating(struct drm_device *dev)
+36
drivers/gpu/drm/i915/intel_panel.c
···30303131#include "intel_drv.h"32323333+#define PCI_LBPC 0xf4 /* legacy/combination backlight modes */3434+3335void3436intel_fixed_panel_mode(struct drm_display_mode *fixed_mode,3537 struct drm_display_mode *adjusted_mode)···112110 dev_priv->pch_pf_size = (width << 16) | height;113111}114112113113+static int is_backlight_combination_mode(struct drm_device *dev)114114+{115115+ struct drm_i915_private *dev_priv = dev->dev_private;116116+117117+ if (INTEL_INFO(dev)->gen >= 4)118118+ return I915_READ(BLC_PWM_CTL2) & BLM_COMBINATION_MODE;119119+120120+ if (IS_GEN2(dev))121121+ return I915_READ(BLC_PWM_CTL) & BLM_LEGACY_MODE;122122+123123+ return 0;124124+}125125+115126static u32 i915_read_blc_pwm_ctl(struct drm_i915_private *dev_priv)116127{117128 u32 val;···181166 if (INTEL_INFO(dev)->gen < 4)182167 max &= ~1;183168 }169169+170170+ if (is_backlight_combination_mode(dev))171171+ max *= 0xff;184172 }185173186174 DRM_DEBUG_DRIVER("max backlight PWM = %d\n", max);···201183 val = I915_READ(BLC_PWM_CTL) & BACKLIGHT_DUTY_CYCLE_MASK;202184 if (IS_PINEVIEW(dev))203185 val >>= 1;186186+187187+ if (is_backlight_combination_mode(dev)){188188+ u8 lbpc;189189+190190+ val &= ~1;191191+ pci_read_config_byte(dev->pdev, PCI_LBPC, &lbpc);192192+ val *= lbpc;193193+ }204194 }205195206196 DRM_DEBUG_DRIVER("get backlight PWM = %d\n", val);···231205232206 if (HAS_PCH_SPLIT(dev))233207 return intel_pch_panel_set_backlight(dev, level);208208+209209+ if (is_backlight_combination_mode(dev)){210210+ u32 max = intel_panel_get_max_backlight(dev);211211+ u8 lbpc;212212+213213+ lbpc = level * 0xfe / max + 1;214214+ level /= lbpc;215215+ pci_write_config_byte(dev->pdev, PCI_LBPC, lbpc);216216+ }217217+234218 tmp = I915_READ(BLC_PWM_CTL);235219 if (IS_PINEVIEW(dev)) {236220 tmp &= ~(BACKLIGHT_DUTY_CYCLE_MASK - 1);
···112112{113113 ktime_t now;114114 s64 delta; /* ns */115115- struct ir_raw_event ev;115115+ DEFINE_IR_RAW_EVENT(ev);116116 int rc = 0;117117118118 if (!dev->raw)···125125 * being called for the first time, note that delta can't126126 * possibly be negative.127127 */128128- ev.duration = 0;129128 if (delta > IR_MAX_DURATION || !dev->raw->last_type)130129 type |= IR_START_EVENT;131130 else
+15-12
drivers/media/rc/mceusb.c
···148148 MCE_GEN2_TX_INV,149149 POLARIS_EVK,150150 CX_HYBRID_TV,151151+ MULTIFUNCTION,151152};152153153154struct mceusb_model {···156155 u32 mce_gen2:1;157156 u32 mce_gen3:1;158157 u32 tx_mask_normal:1;159159- u32 is_polaris:1;160158 u32 no_tx:1;159159+160160+ int ir_intfnum;161161162162 const char *rc_map; /* Allow specify a per-board map */163163 const char *name; /* per-board name */···181179 .tx_mask_normal = 1,182180 },183181 [POLARIS_EVK] = {184184- .is_polaris = 1,185182 /*186183 * In fact, the EVK is shipped without187184 * remotes, but we should have something handy,···190189 .name = "Conexant Hybrid TV (cx231xx) MCE IR",191190 },192191 [CX_HYBRID_TV] = {193193- .is_polaris = 1,194192 .no_tx = 1, /* tx isn't wired up at all */195193 .name = "Conexant Hybrid TV (cx231xx) MCE IR",194194+ },195195+ [MULTIFUNCTION] = {196196+ .mce_gen2 = 1,197197+ .ir_intfnum = 2,196198 },197199};198200···220216 { USB_DEVICE(VENDOR_PHILIPS, 0x206c) },221217 /* Philips/Spinel plus IR transceiver for ASUS */222218 { USB_DEVICE(VENDOR_PHILIPS, 0x2088) },223223- /* Realtek MCE IR Receiver */224224- { USB_DEVICE(VENDOR_REALTEK, 0x0161) },219219+ /* Realtek MCE IR Receiver and card reader */220220+ { USB_DEVICE(VENDOR_REALTEK, 0x0161),221221+ .driver_info = MULTIFUNCTION },225222 /* SMK/Toshiba G83C0004D410 */226223 { USB_DEVICE(VENDOR_SMK, 0x031d),227224 .driver_info = MCE_GEN2_TX_INV },···11061101 bool is_gen3;11071102 bool is_microsoft_gen1;11081103 bool tx_mask_normal;11091109- bool is_polaris;11041104+ int ir_intfnum;1110110511111106 dev_dbg(&intf->dev, "%s called\n", __func__);11121107···11151110 is_gen3 = mceusb_model[model].mce_gen3;11161111 is_microsoft_gen1 = mceusb_model[model].mce_gen1;11171112 tx_mask_normal = mceusb_model[model].tx_mask_normal;11181118- is_polaris = mceusb_model[model].is_polaris;11131113+ ir_intfnum = mceusb_model[model].ir_intfnum;1119111411201120- if (is_polaris) {11211121- /* Interface 0 is IR */11221122- if (idesc->desc.bInterfaceNumber)11231123- return -ENODEV;11241124- }11151115+ /* There are multi-function devices with non-IR interfaces */11161116+ if (idesc->desc.bInterfaceNumber != ir_intfnum)11171117+ return -ENODEV;1125111811261119 /* step through the endpoints to find first bulk in and out endpoint */11271120 for (i = 0; i < idesc->desc.bNumEndpoints; ++i) {
+3-2
drivers/media/rc/nuvoton-cir.c
···385385386386static void nvt_cir_wake_regs_init(struct nvt_dev *nvt)387387{388388- /* set number of bytes needed for wake key comparison (default 67) */389389- nvt_cir_wake_reg_write(nvt, CIR_WAKE_FIFO_LEN, CIR_WAKE_FIFO_CMP_DEEP);388388+ /* set number of bytes needed for wake from s3 (default 65) */389389+ nvt_cir_wake_reg_write(nvt, CIR_WAKE_FIFO_CMP_BYTES,390390+ CIR_WAKE_FIFO_CMP_DEEP);390391391392 /* set tolerance/variance allowed per byte during wake compare */392393 nvt_cir_wake_reg_write(nvt, CIR_WAKE_CMP_TOLERANCE,
+5-2
drivers/media/rc/nuvoton-cir.h
···305305#define CIR_WAKE_IRFIFOSTS_RX_EMPTY 0x20306306#define CIR_WAKE_IRFIFOSTS_RX_FULL 0x10307307308308-/* CIR Wake FIFO buffer is 67 bytes long */309309-#define CIR_WAKE_FIFO_LEN 67308308+/*309309+ * The CIR Wake FIFO buffer is 67 bytes long, but the stock remote wakes310310+ * the system comparing only 65 bytes (fails with this set to 67)311311+ */312312+#define CIR_WAKE_FIFO_CMP_BYTES 65310313/* CIR Wake byte comparison tolerance */311314#define CIR_WAKE_CMP_TOLERANCE 5312315
+1-1
drivers/media/rc/rc-main.c
···850850 count++;851851 } else {852852 for (i = 0; i < ARRAY_SIZE(proto_names); i++) {853853- if (!strncasecmp(tmp, proto_names[i].name, strlen(proto_names[i].name))) {853853+ if (!strcasecmp(tmp, proto_names[i].name)) {854854 tmp += strlen(proto_names[i].name);855855 mask = proto_names[i].type;856856 break;
···157157 "\t\t\t 7 = Leadtek WinFast PVR2100\n"158158 "\t\t\t 8 = Leadtek WinFast DVR3100 H\n"159159 "\t\t\t 9 = GoTView PCI DVD3 Hybrid\n"160160+ "\t\t\t 10 = Hauppauge HVR 1600 (S5H1411)\n"160161 "\t\t\t 0 = Autodetect (default)\n"161162 "\t\t\t-1 = Ignore this card\n\t\t");162163MODULE_PARM_DESC(pal, "Set PAL standard: B, G, H, D, K, I, M, N, Nc, 60");···338337 switch (cx->card->type) {339338 case CX18_CARD_HVR_1600_ESMT:340339 case CX18_CARD_HVR_1600_SAMSUNG:340340+ case CX18_CARD_HVR_1600_S5H1411:341341 tveeprom_hauppauge_analog(&c, tv, eedata);342342 break;343343 case CX18_CARD_YUAN_MPC718:···367365 from the model number. Use the cardtype module option if you368366 have one of these preproduction models. */369367 switch (tv.model) {370370- case 74000 ... 74999:368368+ case 74301: /* Retail models */369369+ case 74321:370370+ case 74351: /* OEM models */371371+ case 74361:372372+ /* Digital side is s5h1411/tda18271 */373373+ cx->card = cx18_get_card(CX18_CARD_HVR_1600_S5H1411);374374+ break;375375+ case 74021: /* Retail models */376376+ case 74031:377377+ case 74041:378378+ case 74141:379379+ case 74541: /* OEM models */380380+ case 74551:381381+ case 74591:382382+ case 74651:383383+ case 74691:384384+ case 74751:385385+ case 74891:386386+ /* Digital side is s5h1409/mxl5005s */371387 cx->card = cx18_get_card(CX18_CARD_HVR_1600_ESMT);372388 break;373389 case 0x718:···397377 CX18_ERR("Invalid EEPROM\n");398378 return;399379 default:400400- CX18_ERR("Unknown model %d, defaulting to HVR-1600\n", tv.model);380380+ CX18_ERR("Unknown model %d, defaulting to original HVR-1600 "381381+ "(cardtype=1)\n", tv.model);401382 cx->card = cx18_get_card(CX18_CARD_HVR_1600_ESMT);402383 break;403384 }
···122122123123 if (!i2c_wait_done(i2c_adap))124124 goto eio;125125- if (!i2c_slave_did_ack(i2c_adap)) {126126- retval = -ENXIO;127127- goto err;128128- }129125 if (i2c_debug) {130126 printk(" <W %02x %02x", msg->addr << 1, msg->buf[0]);131127 if (!(ctrl & I2C_NOSTOP))···154158155159 eio:156160 retval = -EIO;157157- err:158161 if (i2c_debug)159162 printk(KERN_ERR " ERR: %d\n", retval);160163 return retval;···204209205210 if (!i2c_wait_done(i2c_adap))206211 goto eio;207207- if (cnt == 0 && !i2c_slave_did_ack(i2c_adap)) {208208- retval = -ENXIO;209209- goto err;210210- }211212 msg->buf[cnt] = cx_read(bus->reg_rdata) & 0xff;212213 if (i2c_debug) {213214 dprintk(1, " %02x", msg->buf[cnt]);···215224216225 eio:217226 retval = -EIO;218218- err:219227 if (i2c_debug)220228 printk(KERN_ERR " ERR: %d\n", retval);221229 return retval;
+2-1
drivers/media/video/cx25840/cx25840-core.c
···20152015 kfree(state);20162016 return err;20172017 }20182018- v4l2_ctrl_cluster(2, &state->volume);20182018+ if (!is_cx2583x(state))20192019+ v4l2_ctrl_cluster(2, &state->volume);20192020 v4l2_ctrl_handler_setup(&state->hdl);2020202120212022 if (client->dev.platform_data) {
+51-7
drivers/media/video/ivtv/ivtv-irq.c
···628628static void ivtv_irq_dma_err(struct ivtv *itv)629629{630630 u32 data[CX2341X_MBOX_MAX_DATA];631631+ u32 status;631632632633 del_timer(&itv->dma_timer);634634+633635 ivtv_api_get_data(&itv->enc_mbox, IVTV_MBOX_DMA_END, 2, data);636636+ status = read_reg(IVTV_REG_DMASTATUS);634637 IVTV_DEBUG_WARN("DMA ERROR %08x %08x %08x %d\n", data[0], data[1],635635- read_reg(IVTV_REG_DMASTATUS), itv->cur_dma_stream);636636- write_reg(read_reg(IVTV_REG_DMASTATUS) & 3, IVTV_REG_DMASTATUS);638638+ status, itv->cur_dma_stream);639639+ /*640640+ * We do *not* write back to the IVTV_REG_DMASTATUS register to641641+ * clear the error status, if either the encoder write (0x02) or642642+ * decoder read (0x01) bus master DMA operation do not indicate643643+ * completed. We can race with the DMA engine, which may have644644+ * transitioned to completed status *after* we read the register.645645+ * Setting a IVTV_REG_DMASTATUS flag back to "busy" status, after the646646+ * DMA engine has completed, will cause the DMA engine to stop working.647647+ */648648+ status &= 0x3;649649+ if (status == 0x3)650650+ write_reg(status, IVTV_REG_DMASTATUS);651651+637652 if (!test_bit(IVTV_F_I_UDMA, &itv->i_flags) &&638653 itv->cur_dma_stream >= 0 && itv->cur_dma_stream < IVTV_MAX_STREAMS) {639654 struct ivtv_stream *s = &itv->streams[itv->cur_dma_stream];640655641641- /* retry */642642- if (s->type >= IVTV_DEC_STREAM_TYPE_MPG)656656+ if (s->type >= IVTV_DEC_STREAM_TYPE_MPG) {657657+ /* retry */658658+ /*659659+ * FIXME - handle cases of DMA error similar to660660+ * encoder below, except conditioned on status & 0x1661661+ */643662 ivtv_dma_dec_start(s);644644- else645645- ivtv_dma_enc_start(s);646646- return;663663+ return;664664+ } else {665665+ if ((status & 0x2) == 0) {666666+ /*667667+ * CX2341x Bus Master DMA write is ongoing.668668+ * Reset the timer and let it complete.669669+ */670670+ itv->dma_timer.expires =671671+ jiffies + msecs_to_jiffies(600);672672+ add_timer(&itv->dma_timer);673673+ return;674674+ }675675+676676+ if (itv->dma_retries < 3) {677677+ /*678678+ * CX2341x Bus Master DMA write has ended.679679+ * Retry the write, starting with the first680680+ * xfer segment. Just retrying the current681681+ * segment is not sufficient.682682+ */683683+ s->sg_processed = 0;684684+ itv->dma_retries++;685685+ ivtv_dma_enc_start_xfer(s);686686+ return;687687+ }688688+ /* Too many retries, give up on this one */689689+ }690690+647691 }648692 if (test_bit(IVTV_F_I_UDMA, &itv->i_flags)) {649693 ivtv_udma_start(itv);
···12231223 /* DCBX Negotation results */12241224 struct dcbx_features dcbx_local_feat;12251225 u32 dcbx_error;12261226+ u32 pending_max;12261227};1227122812281229/**···16351634/* CMNG constants, as derived from system spec calculations */16361635/* default MIN rate in case VNIC min rate is configured to zero - 100Mbps */16371636#define DEF_MIN_RATE 10016381638-/* resolution of the rate shaping timer - 100 usec */16391639-#define RS_PERIODIC_TIMEOUT_USEC 10016371637+/* resolution of the rate shaping timer - 400 usec */16381638+#define RS_PERIODIC_TIMEOUT_USEC 40016401639/* number of bytes in single QM arbitration cycle -16411640 * coefficient for calculating the fairness timer */16421641#define QM_ARB_BYTES 160000
+22
drivers/net/bnx2x/bnx2x_cmn.c
···993993 bnx2x_free_rx_skbs(bp);994994}995995996996+void bnx2x_update_max_mf_config(struct bnx2x *bp, u32 value)997997+{998998+ /* load old values */999999+ u32 mf_cfg = bp->mf_config[BP_VN(bp)];10001000+10011001+ if (value != bnx2x_extract_max_cfg(bp, mf_cfg)) {10021002+ /* leave all but MAX value */10031003+ mf_cfg &= ~FUNC_MF_CFG_MAX_BW_MASK;10041004+10051005+ /* set new MAX value */10061006+ mf_cfg |= (value << FUNC_MF_CFG_MAX_BW_SHIFT)10071007+ & FUNC_MF_CFG_MAX_BW_MASK;10081008+10091009+ bnx2x_fw_command(bp, DRV_MSG_CODE_SET_MF_BW, mf_cfg);10101010+ }10111011+}10121012+9961013static void bnx2x_free_msix_irqs(struct bnx2x *bp)9971014{9981015 int i, offset = 1;···1514149715151498 /* Clear UC lists configuration */15161499 bnx2x_invalidate_uc_list(bp);15001500+15011501+ if (bp->pending_max) {15021502+ bnx2x_update_max_mf_config(bp, bp->pending_max);15031503+ bp->pending_max = 0;15041504+ }1517150515181506 if (bp->port.pmf)15191507 bnx2x_initial_phy_init(bp, load_mode);
+9
drivers/net/bnx2x/bnx2x_cmn.h
···341341 */342342int bnx2x_set_power_state(struct bnx2x *bp, pci_power_t state);343343344344+/**345345+ * Updates MAX part of MF configuration in HW346346+ * (if required)347347+ *348348+ * @param bp349349+ * @param value350350+ */351351+void bnx2x_update_max_mf_config(struct bnx2x *bp, u32 value);352352+344353/* dev_close main block */345354int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode);346355
+8-10
drivers/net/bnx2x/bnx2x_ethtool.c
···238238 speed |= (cmd->speed_hi << 16);239239240240 if (IS_MF_SI(bp)) {241241- u32 param = 0, part;241241+ u32 part;242242 u32 line_speed = bp->link_vars.line_speed;243243244244 /* use 10G if no link detected */···251251 REQ_BC_VER_4_SET_MF_BW);252252 return -EINVAL;253253 }254254+254255 part = (speed * 100) / line_speed;256256+255257 if (line_speed < speed || !part) {256258 BNX2X_DEV_INFO("Speed setting should be in a range "257259 "from 1%% to 100%% "258260 "of actual line speed\n");259261 return -EINVAL;260262 }261261- /* load old values */262262- param = bp->mf_config[BP_VN(bp)];263263264264- /* leave only MIN value */265265- param &= FUNC_MF_CFG_MIN_BW_MASK;264264+ if (bp->state != BNX2X_STATE_OPEN)265265+ /* store value for following "load" */266266+ bp->pending_max = part;267267+ else268268+ bnx2x_update_max_mf_config(bp, part);266269267267- /* set new MAX value */268268- param |= (part << FUNC_MF_CFG_MAX_BW_SHIFT)269269- & FUNC_MF_CFG_MAX_BW_MASK;270270-271271- bnx2x_fw_command(bp, DRV_MSG_CODE_SET_MF_BW, param);272270 return 0;273271 }274272
+10-9
drivers/net/bnx2x/bnx2x_main.c
···20922092 bnx2x_calc_vn_weight_sum(bp);2093209320942094 /* calculate and set min-max rate for each vn */20952095- for (vn = VN_0; vn < E1HVN_MAX; vn++)20962096- bnx2x_init_vn_minmax(bp, vn);20952095+ if (bp->port.pmf)20962096+ for (vn = VN_0; vn < E1HVN_MAX; vn++)20972097+ bnx2x_init_vn_minmax(bp, vn);2097209820982099 /* always enable rate shaping and fairness */20992100 bp->cmng.flags.cmng_enables |=···21632162 bnx2x_stats_handle(bp, STATS_EVENT_LINK_UP);21642163 }2165216421662166- /* indicate link status only if link status actually changed */21672167- if (prev_link_status != bp->link_vars.link_status)21682168- bnx2x_link_report(bp);21692169-21702170- if (IS_MF(bp))21712171- bnx2x_link_sync_notify(bp);21722172-21732165 if (bp->link_vars.link_up && bp->link_vars.line_speed) {21742166 int cmng_fns = bnx2x_get_cmng_fns_mode(bp);21752167···21742180 DP(NETIF_MSG_IFUP,21752181 "single function mode without fairness\n");21762182 }21832183+21842184+ if (IS_MF(bp))21852185+ bnx2x_link_sync_notify(bp);21862186+21872187+ /* indicate link status only if link status actually changed */21882188+ if (prev_link_status != bp->link_vars.link_status)21892189+ bnx2x_link_report(bp);21772190}2178219121792192void bnx2x__link_status_update(struct bnx2x *bp)
+19-13
drivers/net/bonding/bond_3ad.c
···281281}282282283283/**284284- * __get_rx_machine_lock - lock the port's RX machine284284+ * __get_state_machine_lock - lock the port's state machines285285 * @port: the port we're looking at286286 *287287 */288288-static inline void __get_rx_machine_lock(struct port *port)288288+static inline void __get_state_machine_lock(struct port *port)289289{290290- spin_lock_bh(&(SLAVE_AD_INFO(port->slave).rx_machine_lock));290290+ spin_lock_bh(&(SLAVE_AD_INFO(port->slave).state_machine_lock));291291}292292293293/**294294- * __release_rx_machine_lock - unlock the port's RX machine294294+ * __release_state_machine_lock - unlock the port's state machines295295 * @port: the port we're looking at296296 *297297 */298298-static inline void __release_rx_machine_lock(struct port *port)298298+static inline void __release_state_machine_lock(struct port *port)299299{300300- spin_unlock_bh(&(SLAVE_AD_INFO(port->slave).rx_machine_lock));300300+ spin_unlock_bh(&(SLAVE_AD_INFO(port->slave).state_machine_lock));301301}302302303303/**···388388}389389390390/**391391- * __initialize_port_locks - initialize a port's RX machine spinlock391391+ * __initialize_port_locks - initialize a port's STATE machine spinlock392392 * @port: the port we're looking at393393 *394394 */395395static inline void __initialize_port_locks(struct port *port)396396{397397 // make sure it isn't called twice398398- spin_lock_init(&(SLAVE_AD_INFO(port->slave).rx_machine_lock));398398+ spin_lock_init(&(SLAVE_AD_INFO(port->slave).state_machine_lock));399399}400400401401//conversions···10251025{10261026 rx_states_t last_state;1027102710281028- // Lock to prevent 2 instances of this function to run simultaneously(rx interrupt and periodic machine callback)10291029- __get_rx_machine_lock(port);10301030-10311028 // keep current State Machine state to compare later if it was changed10321029 last_state = port->sm_rx_state;10331030···11301133 pr_err("%s: An illegal loopback occurred on adapter (%s).\n"11311134 "Check the configuration to verify that all adapters are connected to 802.3ad compliant switch ports\n",11321135 port->slave->dev->master->name, port->slave->dev->name);11331133- __release_rx_machine_lock(port);11341136 return;11351137 }11361138 __update_selected(lacpdu, port);···11491153 break;11501154 }11511155 }11521152- __release_rx_machine_lock(port);11531156}1154115711551158/**···21502155 goto re_arm;21512156 }2152215721582158+ /* Lock around state machines to protect data accessed21592159+ * by all (e.g., port->sm_vars). ad_rx_machine may run21602160+ * concurrently due to incoming LACPDU.21612161+ */21622162+ __get_state_machine_lock(port);21632163+21532164 ad_rx_machine(NULL, port);21542165 ad_periodic_machine(port);21552166 ad_port_selection_logic(port);···21652164 // turn off the BEGIN bit, since we already handled it21662165 if (port->sm_vars & AD_PORT_BEGIN)21672166 port->sm_vars &= ~AD_PORT_BEGIN;21672167+21682168+ __release_state_machine_lock(port);21682169 }2169217021702171re_arm:···22032200 case AD_TYPE_LACPDU:22042201 pr_debug("Received LACPDU on port %d\n",22052202 port->actor_port_number);22032203+ /* Protect against concurrent state machines */22042204+ __get_state_machine_lock(port);22062205 ad_rx_machine(lacpdu, port);22062206+ __release_state_machine_lock(port);22072207 break;2208220822092209 case AD_TYPE_MARKER:
+2-1
drivers/net/bonding/bond_3ad.h
···264264struct ad_slave_info {265265 struct aggregator aggregator; // 802.3ad aggregator structure266266 struct port port; // 802.3ad port structure267267- spinlock_t rx_machine_lock; // To avoid race condition between callback and receive interrupt267267+ spinlock_t state_machine_lock; /* mutex state machines vs.268268+ incoming LACPDU */268269 u16 id;269270};270271
+2-1
drivers/net/macvtap.c
···530530 vnet_hdr_len = q->vnet_hdr_sz;531531532532 err = -EINVAL;533533- if ((len -= vnet_hdr_len) < 0)533533+ if (len < vnet_hdr_len)534534 goto err;535535+ len -= vnet_hdr_len;535536536537 err = memcpy_fromiovecend((void *)&vnet_hdr, iv, 0,537538 sizeof(vnet_hdr));
+5
drivers/net/smsc911x.c
···11781178 smsc911x_reg_write(pdata, HW_CFG, 0x00050000);11791179 smsc911x_reg_write(pdata, AFC_CFG, 0x006E3740);1180118011811181+ /* Increase the legal frame size of VLAN tagged frames to 1522 bytes */11821182+ spin_lock_irq(&pdata->mac_lock);11831183+ smsc911x_mac_write(pdata, VLAN1, ETH_P_8021Q);11841184+ spin_unlock_irq(&pdata->mac_lock);11851185+11811186 /* Make sure EEPROM has finished loading before setting GPIO_CFG */11821187 timeout = 50;11831188 while ((smsc911x_reg_read(pdata, E2P_CMD) & E2P_CMD_EPC_BUSY_) &&
+3
drivers/pcmcia/pxa2xx_colibri.c
···181181{182182 int ret;183183184184+ if (!machine_is_colibri() && !machine_is_colibri320())185185+ return -ENODEV;186186+184187 colibri_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1);185188 if (!colibri_pcmcia_device)186189 return -ENOMEM;
+1-1
drivers/pps/generators/Kconfig
···6677config PPS_GENERATOR_PARPORT88 tristate "Parallel port PPS signal generator"99- depends on PARPORT99+ depends on PARPORT && BROKEN1010 help1111 If you say yes here you get support for a PPS signal generator which1212 utilizes STROBE pin of a parallel port to send PPS signals. It uses
+7-5
drivers/rtc/rtc-s3c.c
···7777}78787979/* Update control registers */8080-static void s3c_rtc_setaie(int to)8080+static int s3c_rtc_setaie(struct device *dev, unsigned int enabled)8181{8282 unsigned int tmp;83838484- pr_debug("%s: aie=%d\n", __func__, to);8484+ pr_debug("%s: aie=%d\n", __func__, enabled);85858686 tmp = readb(s3c_rtc_base + S3C2410_RTCALM) & ~S3C2410_RTCALM_ALMEN;87878888- if (to)8888+ if (enabled)8989 tmp |= S3C2410_RTCALM_ALMEN;90909191 writeb(tmp, s3c_rtc_base + S3C2410_RTCALM);9292+9393+ return 0;9294}93959496static int s3c_rtc_setpie(struct device *dev, int enabled)···310308311309 writeb(alrm_en, base + S3C2410_RTCALM);312310313313- s3c_rtc_setaie(alrm->enabled);311311+ s3c_rtc_setaie(dev, alrm->enabled);314312315313 return 0;316314}···442440 rtc_device_unregister(rtc);443441444442 s3c_rtc_setpie(&dev->dev, 0);445445- s3c_rtc_setaie(0);443443+ s3c_rtc_setaie(&dev->dev, 0);446444447445 clk_disable(rtc_clk);448446 clk_put(rtc_clk);
···460460 unsigned int cmd, unsigned long arg)461461{462462 void __user *argp;463463- int ct, perm;463463+ unsigned int ct;464464+ int perm;464465465466 argp = (void __user *)arg;466467
+8
drivers/s390/char/tape.h
···280280 return rc;281281}282282283283+static inline void284284+tape_do_io_async_free(struct tape_device *device, struct tape_request *request)285285+{286286+ request->callback = (void *) tape_free_request;287287+ request->callback_data = NULL;288288+ tape_do_io_async(device, request);289289+}290290+283291extern int tape_oper_handler(int irq, int status);284292extern void tape_noper_handler(int irq, int status);285293extern int tape_open(struct tape_device *);
+41-18
drivers/s390/char/tape_34xx.c
···5353 * Medium sense for 34xx tapes. There is no 'real' medium sense call.5454 * So we just do a normal sense.5555 */5656-static int5757-tape_34xx_medium_sense(struct tape_device *device)5656+static void __tape_34xx_medium_sense(struct tape_request *request)5857{5959- struct tape_request *request;6060- unsigned char *sense;6161- int rc;5858+ struct tape_device *device = request->device;5959+ unsigned char *sense;62606363- request = tape_alloc_request(1, 32);6464- if (IS_ERR(request)) {6565- DBF_EXCEPTION(6, "MSEN fail\n");6666- return PTR_ERR(request);6767- }6868-6969- request->op = TO_MSEN;7070- tape_ccw_end(request->cpaddr, SENSE, 32, request->cpdata);7171-7272- rc = tape_do_io_interruptible(device, request);7361 if (request->rc == 0) {7462 sense = request->cpdata;7563···7688 device->tape_generic_status |= GMT_WR_PROT(~0);7789 else7890 device->tape_generic_status &= ~GMT_WR_PROT(~0);7979- } else {9191+ } else8092 DBF_EVENT(4, "tape_34xx: medium sense failed with rc=%d\n",8193 request->rc);8282- }8394 tape_free_request(request);9595+}84969797+static int tape_34xx_medium_sense(struct tape_device *device)9898+{9999+ struct tape_request *request;100100+ int rc;101101+102102+ request = tape_alloc_request(1, 32);103103+ if (IS_ERR(request)) {104104+ DBF_EXCEPTION(6, "MSEN fail\n");105105+ return PTR_ERR(request);106106+ }107107+108108+ request->op = TO_MSEN;109109+ tape_ccw_end(request->cpaddr, SENSE, 32, request->cpdata);110110+ rc = tape_do_io_interruptible(device, request);111111+ __tape_34xx_medium_sense(request);85112 return rc;113113+}114114+115115+static void tape_34xx_medium_sense_async(struct tape_device *device)116116+{117117+ struct tape_request *request;118118+119119+ request = tape_alloc_request(1, 32);120120+ if (IS_ERR(request)) {121121+ DBF_EXCEPTION(6, "MSEN fail\n");122122+ return;123123+ }124124+125125+ request->op = TO_MSEN;126126+ tape_ccw_end(request->cpaddr, SENSE, 32, request->cpdata);127127+ request->callback = (void *) __tape_34xx_medium_sense;128128+ request->callback_data = NULL;129129+ tape_do_io_async(device, request);86130}8713188132struct tape_34xx_work {···129109 * is inserted but cannot call tape_do_io* from an interrupt context.130110 * Maybe that's useful for other actions we want to start from the131111 * interrupt handler.112112+ * Note: the work handler is called by the system work queue. The tape113113+ * commands started by the handler need to be asynchrounous, otherwise114114+ * a deadlock can occur e.g. in case of a deferred cc=1 (see __tape_do_irq).132115 */133116static void134117tape_34xx_work_handler(struct work_struct *work)···142119143120 switch(p->op) {144121 case TO_MSEN:145145- tape_34xx_medium_sense(device);122122+ tape_34xx_medium_sense_async(device);146123 break;147124 default:148125 DBF_EVENT(3, "T34XX: internal error: unknown work\n");
+67-16
drivers/s390/char/tape_3590.c
···329329/*330330 * Enable encryption331331 */332332-static int tape_3592_enable_crypt(struct tape_device *device)332332+static struct tape_request *__tape_3592_enable_crypt(struct tape_device *device)333333{334334 struct tape_request *request;335335 char *data;336336337337 DBF_EVENT(6, "tape_3592_enable_crypt\n");338338 if (!crypt_supported(device))339339- return -ENOSYS;339339+ return ERR_PTR(-ENOSYS);340340 request = tape_alloc_request(2, 72);341341 if (IS_ERR(request))342342- return PTR_ERR(request);342342+ return request;343343 data = request->cpdata;344344 memset(data,0,72);345345···354354 request->op = TO_CRYPT_ON;355355 tape_ccw_cc(request->cpaddr, MODE_SET_CB, 36, data);356356 tape_ccw_end(request->cpaddr + 1, MODE_SET_CB, 36, data + 36);357357+ return request;358358+}359359+360360+static int tape_3592_enable_crypt(struct tape_device *device)361361+{362362+ struct tape_request *request;363363+364364+ request = __tape_3592_enable_crypt(device);365365+ if (IS_ERR(request))366366+ return PTR_ERR(request);357367 return tape_do_io_free(device, request);368368+}369369+370370+static void tape_3592_enable_crypt_async(struct tape_device *device)371371+{372372+ struct tape_request *request;373373+374374+ request = __tape_3592_enable_crypt(device);375375+ if (!IS_ERR(request))376376+ tape_do_io_async_free(device, request);358377}359378360379/*361380 * Disable encryption362381 */363363-static int tape_3592_disable_crypt(struct tape_device *device)382382+static struct tape_request *__tape_3592_disable_crypt(struct tape_device *device)364383{365384 struct tape_request *request;366385 char *data;367386368387 DBF_EVENT(6, "tape_3592_disable_crypt\n");369388 if (!crypt_supported(device))370370- return -ENOSYS;389389+ return ERR_PTR(-ENOSYS);371390 request = tape_alloc_request(2, 72);372391 if (IS_ERR(request))373373- return PTR_ERR(request);392392+ return request;374393 data = request->cpdata;375394 memset(data,0,72);376395···402383 tape_ccw_cc(request->cpaddr, MODE_SET_CB, 36, data);403384 tape_ccw_end(request->cpaddr + 1, MODE_SET_CB, 36, data + 36);404385386386+ return request;387387+}388388+389389+static int tape_3592_disable_crypt(struct tape_device *device)390390+{391391+ struct tape_request *request;392392+393393+ request = __tape_3592_disable_crypt(device);394394+ if (IS_ERR(request))395395+ return PTR_ERR(request);405396 return tape_do_io_free(device, request);397397+}398398+399399+static void tape_3592_disable_crypt_async(struct tape_device *device)400400+{401401+ struct tape_request *request;402402+403403+ request = __tape_3592_disable_crypt(device);404404+ if (!IS_ERR(request))405405+ tape_do_io_async_free(device, request);406406}407407408408/*···495457/*496458 * SENSE Medium: Get Sense data about medium state497459 */498498-static int499499-tape_3590_sense_medium(struct tape_device *device)460460+static int tape_3590_sense_medium(struct tape_device *device)500461{501462 struct tape_request *request;502463···505468 request->op = TO_MSEN;506469 tape_ccw_end(request->cpaddr, MEDIUM_SENSE, 128, request->cpdata);507470 return tape_do_io_free(device, request);471471+}472472+473473+static void tape_3590_sense_medium_async(struct tape_device *device)474474+{475475+ struct tape_request *request;476476+477477+ request = tape_alloc_request(1, 128);478478+ if (IS_ERR(request))479479+ return;480480+ request->op = TO_MSEN;481481+ tape_ccw_end(request->cpaddr, MEDIUM_SENSE, 128, request->cpdata);482482+ tape_do_io_async_free(device, request);508483}509484510485/*···595546 * 2. The attention msg is written to the "read subsystem data" buffer.596547 * In this case we probably should print it to the console.597548 */598598-static int599599-tape_3590_read_attmsg(struct tape_device *device)549549+static void tape_3590_read_attmsg_async(struct tape_device *device)600550{601551 struct tape_request *request;602552 char *buf;603553604554 request = tape_alloc_request(3, 4096);605555 if (IS_ERR(request))606606- return PTR_ERR(request);556556+ return;607557 request->op = TO_READ_ATTMSG;608558 buf = request->cpdata;609559 buf[0] = PREP_RD_SS_DATA;···610562 tape_ccw_cc(request->cpaddr, PERFORM_SS_FUNC, 12, buf);611563 tape_ccw_cc(request->cpaddr + 1, READ_SS_DATA, 4096 - 12, buf + 12);612564 tape_ccw_end(request->cpaddr + 2, NOP, 0, NULL);613613- return tape_do_io_free(device, request);565565+ tape_do_io_async_free(device, request);614566}615567616568/*617569 * These functions are used to schedule follow-up actions from within an618570 * interrupt context (like unsolicited interrupts).571571+ * Note: the work handler is called by the system work queue. The tape572572+ * commands started by the handler need to be asynchrounous, otherwise573573+ * a deadlock can occur e.g. in case of a deferred cc=1 (see __tape_do_irq).619574 */620575struct work_handler_data {621576 struct tape_device *device;···634583635584 switch (p->op) {636585 case TO_MSEN:637637- tape_3590_sense_medium(p->device);586586+ tape_3590_sense_medium_async(p->device);638587 break;639588 case TO_READ_ATTMSG:640640- tape_3590_read_attmsg(p->device);589589+ tape_3590_read_attmsg_async(p->device);641590 break;642591 case TO_CRYPT_ON:643643- tape_3592_enable_crypt(p->device);592592+ tape_3592_enable_crypt_async(p->device);644593 break;645594 case TO_CRYPT_OFF:646646- tape_3592_disable_crypt(p->device);595595+ tape_3592_disable_crypt_async(p->device);647596 break;648597 default:649598 DBF_EVENT(3, "T3590: work handler undefined for "
···15231523}15241524EXPORT_SYMBOL(d_alloc_root);1525152515261526+static struct dentry * __d_find_any_alias(struct inode *inode)15271527+{15281528+ struct dentry *alias;15291529+15301530+ if (list_empty(&inode->i_dentry))15311531+ return NULL;15321532+ alias = list_first_entry(&inode->i_dentry, struct dentry, d_alias);15331533+ __dget(alias);15341534+ return alias;15351535+}15361536+15371537+static struct dentry * d_find_any_alias(struct inode *inode)15381538+{15391539+ struct dentry *de;15401540+15411541+ spin_lock(&inode->i_lock);15421542+ de = __d_find_any_alias(inode);15431543+ spin_unlock(&inode->i_lock);15441544+ return de;15451545+}15461546+15471547+15261548/**15271549 * d_obtain_alias - find or allocate a dentry for a given inode15281550 * @inode: inode to allocate the dentry for···15741552 if (IS_ERR(inode))15751553 return ERR_CAST(inode);1576155415771577- res = d_find_alias(inode);15551555+ res = d_find_any_alias(inode);15781556 if (res)15791557 goto out_iput;15801558···158715651588156615891567 spin_lock(&inode->i_lock);15901590- res = __d_find_alias(inode, 0);15681568+ res = __d_find_any_alias(inode);15911569 if (res) {15921570 spin_unlock(&inode->i_lock);15931571 dput(tmp);
+2-2
fs/fat/namei_vfat.c
···43434444static int vfat_revalidate(struct dentry *dentry, struct nameidata *nd)4545{4646- if (nd->flags & LOOKUP_RCU)4646+ if (nd && nd->flags & LOOKUP_RCU)4747 return -ECHILD;48484949 /* This is not negative dentry. Always valid. */···54545555static int vfat_revalidate_ci(struct dentry *dentry, struct nameidata *nd)5656{5757- if (nd->flags & LOOKUP_RCU)5757+ if (nd && nd->flags & LOOKUP_RCU)5858 return -ECHILD;59596060 /*
+1-1
fs/fuse/dir.c
···158158{159159 struct inode *inode;160160161161- if (nd->flags & LOOKUP_RCU)161161+ if (nd && nd->flags & LOOKUP_RCU)162162 return -ECHILD;163163164164 inode = entry->d_inode;
+1-1
fs/gfs2/dentry.c
···4444 int error;4545 int had_lock = 0;46464747- if (nd->flags & LOOKUP_RCU)4747+ if (nd && nd->flags & LOOKUP_RCU)4848 return -ECHILD;49495050 parent = dget_parent(dentry);
+1-1
fs/jfs/namei.c
···1600160016011601static int jfs_ci_revalidate(struct dentry *dentry, struct nameidata *nd)16021602{16031603- if (nd->flags & LOOKUP_RCU)16031603+ if (nd && nd->flags & LOOKUP_RCU)16041604 return -ECHILD;16051605 /*16061606 * This is not negative dentry. Always valid.
+11-3
fs/namei.c
···15461546 /* nd->path had been dropped */15471547 current->total_link_count = 0;15481548 nd->path = save;15491549+ nd->inode = save.dentry->d_inode;15491550 path_get(&nd->path);15501551 nd->flags |= LOOKUP_REVAL;15511552 result = link_path_walk(name, nd);···24562455 /* !O_CREAT, simple open */24572456 error = do_path_lookup(dfd, pathname, flags, &nd);24582457 if (unlikely(error))24592459- goto out_filp;24582458+ goto out_filp2;24602459 error = -ELOOP;24612460 if (!(nd.flags & LOOKUP_FOLLOW)) {24622461 if (nd.inode->i_op->follow_link)24632463- goto out_path;24622462+ goto out_path2;24642463 }24652464 error = -ENOTDIR;24662465 if (nd.flags & LOOKUP_DIRECTORY) {24672466 if (!nd.inode->i_op->lookup)24682468- goto out_path;24672467+ goto out_path2;24692468 }24702469 audit_inode(pathname, nd.path.dentry);24712470 filp = finish_open(&nd, open_flag, acc_mode);24712471+out2:24722472 release_open_intent(&nd);24732473 return filp;24742474+24752475+out_path2:24762476+ path_put(&nd.path);24772477+out_filp2:24782478+ filp = ERR_PTR(error);24792479+ goto out2;2474248024752481creat:24762482 /* OK, have to create the file. Find the parent. */
+42-2
fs/nfs/nfs4proc.c
···5151#include <linux/sunrpc/bc_xprt.h>5252#include <linux/xattr.h>5353#include <linux/utsname.h>5454+#include <linux/mm.h>54555556#include "nfs4_fs.h"5657#include "delegation.h"···32533252 }32543253}3255325432553255+static int buf_to_pages_noslab(const void *buf, size_t buflen,32563256+ struct page **pages, unsigned int *pgbase)32573257+{32583258+ struct page *newpage, **spages;32593259+ int rc = 0;32603260+ size_t len;32613261+ spages = pages;32623262+32633263+ do {32643264+ len = min(PAGE_CACHE_SIZE, buflen);32653265+ newpage = alloc_page(GFP_KERNEL);32663266+32673267+ if (newpage == NULL)32683268+ goto unwind;32693269+ memcpy(page_address(newpage), buf, len);32703270+ buf += len;32713271+ buflen -= len;32723272+ *pages++ = newpage;32733273+ rc++;32743274+ } while (buflen != 0);32753275+32763276+ return rc;32773277+32783278+unwind:32793279+ for(; rc > 0; rc--)32803280+ __free_page(spages[rc-1]);32813281+ return -ENOMEM;32823282+}32833283+32563284struct nfs4_cached_acl {32573285 int cached;32583286 size_t len;···34503420 .rpc_argp = &arg,34513421 .rpc_resp = &res,34523422 };34533453- int ret;34233423+ int ret, i;3454342434553425 if (!nfs4_server_supports_acls(server))34563426 return -EOPNOTSUPP;34273427+ i = buf_to_pages_noslab(buf, buflen, arg.acl_pages, &arg.acl_pgbase);34283428+ if (i < 0)34293429+ return i;34573430 nfs_inode_return_delegation(inode);34583458- buf_to_pages(buf, buflen, arg.acl_pages, &arg.acl_pgbase);34593431 ret = nfs4_call_sync(server, &msg, &arg, &res, 1);34323432+34333433+ /*34343434+ * Free each page after tx, so the only ref left is34353435+ * held by the network stack34363436+ */34373437+ for (; i > 0; i--)34383438+ put_page(pages[i-1]);34393439+34603440 /*34613441 * Acl update can result in inode attribute update.34623442 * so mark the attribute cache invalid.
+1-1
fs/nfsd/nfs4callback.c
···432432 * If the server returns different values for sessionID, slotID or433433 * sequence number, the server is looney tunes.434434 */435435- p = xdr_inline_decode(xdr, NFS4_MAX_SESSIONID_LEN + 4 + 4);435435+ p = xdr_inline_decode(xdr, NFS4_MAX_SESSIONID_LEN + 4 + 4 + 4 + 4);436436 if (unlikely(p == NULL))437437 goto out_overflow;438438 memcpy(id.data, p, NFS4_MAX_SESSIONID_LEN);
···5656 int ret = 0; /* if all else fails, just return false */5757 struct ocfs2_super *osb;58585959- if (nd->flags & LOOKUP_RCU)5959+ if (nd && nd->flags & LOOKUP_RCU)6060 return -ECHILD;61616262 inode = dentry->d_inode;
+8
fs/open.c
···233233234234 if (!(file->f_mode & FMODE_WRITE))235235 return -EBADF;236236+237237+ /* It's not possible punch hole on append only file */238238+ if (mode & FALLOC_FL_PUNCH_HOLE && IS_APPEND(inode))239239+ return -EPERM;240240+241241+ if (IS_IMMUTABLE(inode))242242+ return -EPERM;243243+236244 /*237245 * Revalidate the write permissions, in case security policy has238246 * changed since the files were opened.
-30
fs/proc/base.c
···26202620 &proc_self_inode_operations, NULL, {}),26212621};2622262226232623-/*26242624- * Exceptional case: normally we are not allowed to unhash a busy26252625- * directory. In this case, however, we can do it - no aliasing problems26262626- * due to the way we treat inodes.26272627- */26282628-static int proc_base_revalidate(struct dentry *dentry, struct nameidata *nd)26292629-{26302630- struct inode *inode;26312631- struct task_struct *task;26322632-26332633- if (nd->flags & LOOKUP_RCU)26342634- return -ECHILD;26352635-26362636- inode = dentry->d_inode;26372637- task = get_proc_task(inode);26382638- if (task) {26392639- put_task_struct(task);26402640- return 1;26412641- }26422642- d_drop(dentry);26432643- return 0;26442644-}26452645-26462646-static const struct dentry_operations proc_base_dentry_operations =26472647-{26482648- .d_revalidate = proc_base_revalidate,26492649- .d_delete = pid_delete_dentry,26502650-};26512651-26522623static struct dentry *proc_base_instantiate(struct inode *dir,26532624 struct dentry *dentry, struct task_struct *task, const void *ptr)26542625{···26562685 if (p->fop)26572686 inode->i_fop = p->fop;26582687 ei->op = p->op;26592659- d_set_d_op(dentry, &proc_base_dentry_operations);26602688 d_add(dentry, inode);26612689 error = NULL;26622690out:
+6-2
fs/proc/inode.c
···2727static void proc_evict_inode(struct inode *inode)2828{2929 struct proc_dir_entry *de;3030+ struct ctl_table_header *head;30313132 truncate_inode_pages(&inode->i_data, 0);3233 end_writeback(inode);···3938 de = PROC_I(inode)->pde;4039 if (de)4140 pde_put(de);4242- if (PROC_I(inode)->sysctl)4343- sysctl_head_put(PROC_I(inode)->sysctl);4141+ head = PROC_I(inode)->sysctl;4242+ if (head) {4343+ rcu_assign_pointer(PROC_I(inode)->sysctl, NULL);4444+ sysctl_head_put(head);4545+ }4446}45474648struct vfsmount *proc_mnt;
+5-2
fs/proc/proc_sysctl.c
···408408 const struct dentry *dentry, const struct inode *inode,409409 unsigned int len, const char *str, const struct qstr *name)410410{411411+ struct ctl_table_header *head;411412 /* Although proc doesn't have negative dentries, rcu-walk means412413 * that inode here can be NULL */414414+ /* AV: can it, indeed? */413415 if (!inode)414414- return 0;416416+ return 1;415417 if (name->len != len)416418 return 1;417419 if (memcmp(name->name, str, len))418420 return 1;419419- return !sysctl_is_seen(PROC_I(inode)->sysctl);421421+ head = rcu_dereference(PROC_I(inode)->sysctl);422422+ return !head || !sysctl_is_seen(head);420423}421424422425static const struct dentry_operations proc_sys_dentry_operations = {
-2
fs/reiserfs/xattr.c
···978978979979static int xattr_hide_revalidate(struct dentry *dentry, struct nameidata *nd)980980{981981- if (nd->flags & LOOKUP_RCU)982982- return -ECHILD;983981 return -EPERM;984982}985983
+1-1
include/linux/ceph/messenger.h
···123123#define SOCK_CLOSED 11 /* socket state changed to closed */124124#define OPENING 13 /* open connection w/ (possibly new) peer */125125#define DEAD 14 /* dead, about to kfree */126126+#define BACKOFF 15126127127128/*128129 * A single connection with another host.···161160 struct list_head out_queue;162161 struct list_head out_sent; /* sending or sent but unacked */163162 u64 out_seq; /* last message queued for send */164164- bool out_keepalive_pending;165163166164 u64 in_seq, in_seq_acked; /* last message received, acked */167165
···25572557extern int netdev_info(const struct net_device *dev, const char *format, ...)25582558 __attribute__ ((format (printf, 2, 3)));2559255925602560+#define MODULE_ALIAS_NETDEV(device) \25612561+ MODULE_ALIAS("netdev-" device)25622562+25602563#if defined(DEBUG)25612564#define netdev_dbg(__dev, format, args...) \25622565 netdev_printk(KERN_DEBUG, __dev, format, ##args)
-3
include/linux/ptrace.h
···102102103103extern long arch_ptrace(struct task_struct *child, long request,104104 unsigned long addr, unsigned long data);105105-extern int ptrace_traceme(void);106105extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len);107106extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len);108108-extern int ptrace_attach(struct task_struct *tsk);109109-extern int ptrace_detach(struct task_struct *, unsigned int);110107extern void ptrace_disable(struct task_struct *);111108extern int ptrace_check_attach(struct task_struct *task, int kill);112109extern int ptrace_request(struct task_struct *child, long request,
+10-4
include/linux/sysctl.h
···930930931931#ifdef __KERNEL__932932#include <linux/list.h>933933+#include <linux/rcupdate.h>933934934935/* For the /proc/sys support */935936struct ctl_table;···10381037 struct ctl_table trees. */10391038struct ctl_table_header10401039{10411041- struct ctl_table *ctl_table;10421042- struct list_head ctl_entry;10431043- int used;10441044- int count;10401040+ union {10411041+ struct {10421042+ struct ctl_table *ctl_table;10431043+ struct list_head ctl_entry;10441044+ int used;10451045+ int count;10461046+ };10471047+ struct rcu_head rcu;10481048+ };10451049 struct completion *unregistering;10461050 struct ctl_table *ctl_table_arg;10471051 struct ctl_table_root *root;
···163163 return !err;164164}165165166166-int ptrace_attach(struct task_struct *task)166166+static int ptrace_attach(struct task_struct *task)167167{168168 int retval;169169···219219 * Performs checks and sets PT_PTRACED.220220 * Should be used by all ptrace implementations for PTRACE_TRACEME.221221 */222222-int ptrace_traceme(void)222222+static int ptrace_traceme(void)223223{224224 int ret = -EPERM;225225···293293 return false;294294}295295296296-int ptrace_detach(struct task_struct *child, unsigned int data)296296+static int ptrace_detach(struct task_struct *child, unsigned int data)297297{298298 bool dead = false;299299
+9-5
kernel/sched_rt.c
···210210211211static void sched_rt_rq_enqueue(struct rt_rq *rt_rq)212212{213213- int this_cpu = smp_processor_id();214213 struct task_struct *curr = rq_of_rt_rq(rt_rq)->curr;215214 struct sched_rt_entity *rt_se;216215217217- rt_se = rt_rq->tg->rt_se[this_cpu];216216+ int cpu = cpu_of(rq_of_rt_rq(rt_rq));217217+218218+ rt_se = rt_rq->tg->rt_se[cpu];218219219220 if (rt_rq->rt_nr_running) {220221 if (rt_se && !on_rt_rq(rt_se))···227226228227static void sched_rt_rq_dequeue(struct rt_rq *rt_rq)229228{230230- int this_cpu = smp_processor_id();231229 struct sched_rt_entity *rt_se;230230+ int cpu = cpu_of(rq_of_rt_rq(rt_rq));232231233233- rt_se = rt_rq->tg->rt_se[this_cpu];232232+ rt_se = rt_rq->tg->rt_se[cpu];234233235234 if (rt_se && on_rt_rq(rt_se))236235 dequeue_rt_entity(rt_se);···566565 if (rt_rq->rt_time || rt_rq->rt_nr_running)567566 idle = 0;568567 raw_spin_unlock(&rt_rq->rt_runtime_lock);569569- } else if (rt_rq->rt_nr_running)568568+ } else if (rt_rq->rt_nr_running) {570569 idle = 0;570570+ if (!rt_rq_throttled(rt_rq))571571+ enqueue = 1;572572+ }571573572574 if (enqueue)573575 sched_rt_rq_enqueue(rt_rq);
···66 tristate "802.1d Ethernet Bridging"77 select LLC88 select STP99+ depends on IPV6 || IPV6=n910 ---help---1011 If you say Y here, then your Linux box will be able to act as an1112 Ethernet bridge, which means that the different Ethernet segments it
+54-17
net/ceph/messenger.c
···336336 ceph_msg_put(con->out_msg);337337 con->out_msg = NULL;338338 }339339- con->out_keepalive_pending = false;340339 con->in_seq = 0;341340 con->in_seq_acked = 0;342341}···12471248 con->auth_retry);12481249 if (con->auth_retry == 2) {12491250 con->error_msg = "connect authorization failure";12501250- reset_connection(con);12511251- set_bit(CLOSED, &con->state);12521251 return -1;12531252 }12541253 con->auth_retry = 1;···1712171517131716 /* open the socket first? */17141717 if (con->sock == NULL) {17151715- /*17161716- * if we were STANDBY and are reconnecting _this_17171717- * connection, bump connect_seq now. Always bump17181718- * global_seq.17191719- */17201720- if (test_and_clear_bit(STANDBY, &con->state))17211721- con->connect_seq++;17221722-17231718 prepare_write_banner(msgr, con);17241719 prepare_write_connect(msgr, con, 1);17251720 prepare_read_banner(con);···19401951 work.work);1941195219421953 mutex_lock(&con->mutex);19541954+ if (test_and_clear_bit(BACKOFF, &con->state)) {19551955+ dout("con_work %p backing off\n", con);19561956+ if (queue_delayed_work(ceph_msgr_wq, &con->work,19571957+ round_jiffies_relative(con->delay))) {19581958+ dout("con_work %p backoff %lu\n", con, con->delay);19591959+ mutex_unlock(&con->mutex);19601960+ return;19611961+ } else {19621962+ con->ops->put(con);19631963+ dout("con_work %p FAILED to back off %lu\n", con,19641964+ con->delay);19651965+ }19661966+ }1943196719681968+ if (test_bit(STANDBY, &con->state)) {19691969+ dout("con_work %p STANDBY\n", con);19701970+ goto done;19711971+ }19441972 if (test_bit(CLOSED, &con->state)) { /* e.g. if we are replaced */19451973 dout("con_work CLOSED\n");19461974 con_close_socket(con);···20142008 /* Requeue anything that hasn't been acked */20152009 list_splice_init(&con->out_sent, &con->out_queue);2016201020172017- /* If there are no messages in the queue, place the connection20182018- * in a STANDBY state (i.e., don't try to reconnect just yet). */20192019- if (list_empty(&con->out_queue) && !con->out_keepalive_pending) {20202020- dout("fault setting STANDBY\n");20112011+ /* If there are no messages queued or keepalive pending, place20122012+ * the connection in a STANDBY state */20132013+ if (list_empty(&con->out_queue) &&20142014+ !test_bit(KEEPALIVE_PENDING, &con->state)) {20152015+ dout("fault %p setting STANDBY clearing WRITE_PENDING\n", con);20162016+ clear_bit(WRITE_PENDING, &con->state);20212017 set_bit(STANDBY, &con->state);20222018 } else {20232019 /* retry after a delay. */···20272019 con->delay = BASE_DELAY_INTERVAL;20282020 else if (con->delay < MAX_DELAY_INTERVAL)20292021 con->delay *= 2;20302030- dout("fault queueing %p delay %lu\n", con, con->delay);20312022 con->ops->get(con);20322023 if (queue_delayed_work(ceph_msgr_wq, &con->work,20332033- round_jiffies_relative(con->delay)) == 0)20242024+ round_jiffies_relative(con->delay))) {20252025+ dout("fault queued %p delay %lu\n", con, con->delay);20262026+ } else {20342027 con->ops->put(con);20282028+ dout("fault failed to queue %p delay %lu, backoff\n",20292029+ con, con->delay);20302030+ /*20312031+ * In many cases we see a socket state change20322032+ * while con_work is running and end up20332033+ * queuing (non-delayed) work, such that we20342034+ * can't backoff with a delay. Set a flag so20352035+ * that when con_work restarts we schedule the20362036+ * delay then.20372037+ */20382038+ set_bit(BACKOFF, &con->state);20392039+ }20352040 }2036204120372042out_unlock:···21152094}21162095EXPORT_SYMBOL(ceph_messenger_destroy);2117209620972097+static void clear_standby(struct ceph_connection *con)20982098+{20992099+ /* come back from STANDBY? */21002100+ if (test_and_clear_bit(STANDBY, &con->state)) {21012101+ mutex_lock(&con->mutex);21022102+ dout("clear_standby %p and ++connect_seq\n", con);21032103+ con->connect_seq++;21042104+ WARN_ON(test_bit(WRITE_PENDING, &con->state));21052105+ WARN_ON(test_bit(KEEPALIVE_PENDING, &con->state));21062106+ mutex_unlock(&con->mutex);21072107+ }21082108+}21092109+21182110/*21192111 * Queue up an outgoing message on the given connection.21202112 */···2160212621612127 /* if there wasn't anything waiting to send before, queue21622128 * new work */21292129+ clear_standby(con);21632130 if (test_and_set_bit(WRITE_PENDING, &con->state) == 0)21642131 queue_con(con);21652132}···22262191 */22272192void ceph_con_keepalive(struct ceph_connection *con)22282193{21942194+ dout("con_keepalive %p\n", con);21952195+ clear_standby(con);22292196 if (test_and_set_bit(KEEPALIVE_PENDING, &con->state) == 0 &&22302197 test_and_set_bit(WRITE_PENDING, &con->state) == 0)22312198 queue_con(con);