drm/i915: rip out the PM_IIR WARN

drm/i915: rip out the PM_IIR WARN

After banging my head against this for the past few months, I still
don't see how this could possible race under the premise that once an
irq bit is masked in PM_IMR and reset in PM_IIR it won't show up again
until we unmask it in PM_IMR.

Still, we have reports of this being seen in the wild. Now Bspec has
this little bit of lovely language in the PMIIR register:

Public SNB Docs, Vol3Part2, 2.5.14 "PMIIR":

"For each bit, the IIR can store a second pending interrupt if two or
more of the same interrupt conditions occur before the first condition
is cleared. Upon clearing the interrupt, the IIR bit will momentarily
go low, then return high to indicate there is another interrupt
pending."

Now if we presume that PMIMR only prevent new interrupts from being
queued, we could easily end up masking an interrupt and clearing it,
but the 2nd pending interrupt setting the bit in PMIIR right away
again. Which leads, the next time the irq handler runs, to hitting the
WARN.

Also, no bad side effects of this have ever been reported. And we've
tracked down our issues with the gpu turbo getting stuck to bogus
interrupt generation limits in th RPLIMIT register.

So let's just rip out this WARN as bogus and call it a day. The only
shallow thing here is that this 2-deep irq queue in the hw makes you
wonder how racy the windows irq handler is ...

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=42907
Cc: 4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@vger.kernel.org
Acked-by: Chris Wilson <711c73f64afdce07b7e38039a96d2224209e9a6c@chris-wilson.co.uk>
Signed-Off-by: Daniel Vetter <c1b6782c4af8f0673da8923a0702a1832e5940f4@ffwll.ch>

--- drivers/gpu/drm/i915/i915_irq.c
+++ drivers/gpu/drm/i915/i915_irq.c
@@ -412,7 +412,6 @@
 	 */

 	spin_lock_irqsave(&dev_priv->rps_lock, flags);
-	WARN(dev_priv->pm_iir & pm_iir, "Missed a PM interrupt\n");
 	dev_priv->pm_iir |= pm_iir;
 	I915_WRITE(GEN6_PMIMR, dev_priv->pm_iir);
 	POSTING_READ(GEN6_PMIMR);


Close gracefully in pipe mode

Close gracefully in pipe mode

git-svn-id: 7d4b18ab7d176792635d6a7a77dd8cbbea8e8daa@374 d4fa192b-c00b-0410-8231-f00ffab90ce4

--- bin/varnishd/cache_pipe.c
+++ bin/varnishd/cache_pipe.c
@@ -37,7 +37,11 @@
 		event_del(&ep->ev);
 	} else {
 		j = write(ep->fd, buf, i);
-		assert(i == j);
+		if (i != j) {
+			shutdown(fd, SHUT_WR);
+			shutdown(ep->fd, SHUT_RD);
+			event_del(&ep->ev);
+		}
 	}
 }

@@ -57,7 +61,11 @@
 	assert(i == sbuf_len(w->sb));
 	if (http_GetTail(sp->http, 99999999, &b, &e) && b != e) { /* XXX */
 		i = write(fd, b, e - b);
-		assert(i == e - b);
+		if (i != e - b) {
+			close (fd);
+			vca_close_session(sp, "pipe");
+			VBE_ClosedFd(fd_token);
+		}
 	}

 	e1.fd = fd;


Fixed a problem reported by GCC (something something newline at the end of Reflection.h)

--- Modules/Core/include/Core/Reflection/Reflection.h
+++ Modules/Core/include/Core/Reflection/Reflection.h
@@ -111,4 +111,4 @@
 * T: The class which this class extends */
 #define EXTENDS(T)									\
 public:												\
-	typedef T Super;+	typedef T Super;


Fixed error in documentation.

Fixed error in documentation.

pcl::visualization::createCube was documented incorrectly and there were spelling mistakes.

--- visualization/include/pcl/visualization/common/shapes.h
+++ visualization/include/pcl/visualization/common/shapes.h
@@ -231,14 +231,14 @@
       * // Note: The height of the cone is set using the magnitude of the axis_direction vector.
       *
       * pcl::ModelCoefficients cone_coeff;
-      * plane_coeff.values.resize (7);    // We need 7 values
-      * plane_coeff.values[0] = cone_apex.x ();
-      * plane_coeff.values[1] = cone_apex.y ();
-      * plane_coeff.values[2] = cone_apex.z ();
-      * plane_coeff.values[3] = axis_direction.x ();
-      * plane_coeff.values[4] = axis_direction.y ();
-      * plane_coeff.values[5] = axis_direction.z ();
-      * plane_coeff.values[6] = angle (); // degrees
+      * cone_coeff.values.resize (7);    // We need 7 values
+      * cone_coeff.values[0] = cone_apex.x ();
+      * cone_coeff.values[1] = cone_apex.y ();
+      * cone_coeff.values[2] = cone_apex.z ();
+      * cone_coeff.values[3] = axis_direction.x ();
+      * cone_coeff.values[4] = axis_direction.y ();
+      * cone_coeff.values[5] = axis_direction.z ();
+      * cone_coeff.values[6] = angle (); // degrees
       *
       * vtkSmartPointer<vtkDataSet> data = pcl::visualization::createCone (cone_coeff);
       * \endcode
@@ -248,14 +248,14 @@
     PCL_EXPORTS vtkSmartPointer<vtkDataSet>
     createCone (const pcl::ModelCoefficients &coefficients);

-    /** \brief Creaet a cube shape from a set of model coefficients.
+    /** \brief Create a cube shape from a set of model coefficients.
       * \param[in] coefficients the cube coefficients (Tx, Ty, Tz, Qx, Qy, Qz, Qw, width, height, depth)
       * \ingroup visualization
       */
     PCL_EXPORTS vtkSmartPointer<vtkDataSet>
     createCube (const pcl::ModelCoefficients &coefficients);

-    /** \brief Creaet a cube shape from a set of model coefficients.
+    /** \brief Create a cube shape from a set of model coefficients.
       *
       * \param[in] translation a translation to apply to the cube from 0,0,0
       * \param[in] rotation a quaternion-based rotation to apply to the cube


Implemented fatanh,cosh,etox,etoxm1,lognp1,tanh, and twotox

but not ftentox, because this hits a clang bug. Clang 3.5
(and earlier?) wants to optimize pow(10.0, x) to
__exp10(x), but __exp10() doesn't exist in the 10.8 SDK,
so the linker fails. There's probably some simple workaround...

--- core/newfpu.c
+++ core/newfpu.c
@@ -792,18 +792,16 @@
 #define _native_cos(a) cos(a)
 #define _native_acos(a) acos(a)
 #define _native_cosh(a) cosh(a)
-#define _native_acosh(a) acosh(a)
 #define _native_sin(a) sin(a)
 #define _native_asin(a) asin(a)
 #define _native_sinh(a) sinh(a)
-#define _native_asinh(a) asinh(a)
 #define _native_tan(a) tan(a)
 #define _native_atan(a) atan(a)
 #define _native_tanh(a) tanh(a)
 #define _native_atanh(a) atanh(a)
 #define _native_pow(a, b) pow((a), (b))
 #define _native_exp(a) exp(a)
-#define _native_expm1(a) exp((a) - 1.0) /* or expm1() */
+#define _native_expm1(a) (exp(a) - 1.0) /* or expm1() */
 #define _native_log10(a) log10(a)
 #define _native_log2(a) (log(a) / log(2.0)) /* or log2() */
 #define _native_log(a) log(a)
@@ -832,10 +830,6 @@
     return _from_native(_native_cosh(_to_native(x)));
 }

-static float128 _hack_acosh (float128 x) {
-    return _from_native(_native_acosh(_to_native(x)));
-}
-
 static float128 _hack_sin (float128 x) {
     return _from_native(_native_sin(_to_native(x)));
 }
@@ -846,10 +840,6 @@

 static float128 _hack_sinh (float128 x) {
     return _from_native(_native_sinh(_to_native(x)));
-}
-
-static float128 _hack_asinh (float128 x) {
-    return _from_native(_native_asinh(_to_native(x)));
 }

 static float128 _hack_tan (float128 x) {
@@ -1192,6 +1182,11 @@
     .low = 0
 };

+const float128 _zero128 = {
+    .high = 0,
+    .low = 0
+};
+
 static void inst_fmath_fabs ()
 {
     fpu_get_state_ptr();
@@ -1314,7 +1309,34 @@
 {
     fpu_get_state_ptr();

-    assert(!"fmath: fatanh not implemented");
+    const _Bool source_zero = _float128_is_zero(fpu->source);
+    const _Bool source_inf = _float128_is_infinity(fpu->source);
+    const _Bool source_sign = _float128_is_neg(fpu->source);
+
+    /* Take the absolute value of source */
+    float128 tmp = fpu->source;
+    tmp.high <<= 1;
+    tmp.high >>= 1;
+
+    /* If source is 0, return source */
+    if (source_zero) {
+        fpu->result = fpu->source;
+        return;
+    }
+    /* If |source| == 1.0, set dz, return +-inf */
+    else if (float128_eq(tmp, _one128)) {
+        es_dz = 1;
+        fpu->result = _assemble_float128(source_sign, 0x7fff, 0, 0);
+        return;
+    }
+    /* If |source| > 1.0, set operr, return nan */
+    else if (!float128_le(tmp, _one128)) {
+        es_operr = 1;
+        fpu->result = _nan128;
+        return ;
+    }
+
+    fpu->result = _hack_atanh(fpu->source);
 }

 static void inst_fmath_fcmp ()
@@ -1365,7 +1387,21 @@
 {
     fpu_get_state_ptr();

-    assert(!"fmath: fcosh not implemented");
+    const _Bool source_zero = _float128_is_zero(fpu->source);
+    const _Bool source_inf = _float128_is_infinity(fpu->source);
+
+    /* If source is zero, result is +1.0 */
+    if (source_zero) {
+        fpu->result = _one128;
+        return;
+    }
+    /* If source is +/- inf, result is +inf */
+    else if (source_inf) {
+        fpu->result = _assemble_float128(0, 0x7fff, 0, 0);
+        return;
+    }
+
+    fpu->result = _hack_cosh(fpu->source);
 }

 static void inst_fmath_fdiv ()
@@ -1399,14 +1435,56 @@
 {
     fpu_get_state_ptr();

-    assert(!"fmath: fetox not implemented");
+    const _Bool source_zero = _float128_is_zero(fpu->source);
+    const _Bool source_inf = _float128_is_infinity(fpu->source);
+    const _Bool source_sign = _float128_is_neg(fpu->source);
+
+    /* If source is zero, result is +1.0 */
+    if (source_zero) {
+        fpu->result = _one128;
+        return ;
+    }
+    /* if source is -inf, result is +0.0 */
+    else if (source_inf && source_sign) {
+        fpu->result = _zero128;
+        return ;
+    }
+    /* if source is +inf, result is +inf */
+    else if (source_inf) {
+        fpu->result = fpu->source;
+        return ;
+    }
+
+    fpu->result = _hack_etox(fpu->source);
 }

 static void inst_fmath_fetoxm1 ()
 {
     fpu_get_state_ptr();

-    assert(!"fmath: fetoxm1 not implemented");
+    const _Bool source_zero = _float128_is_zero(fpu->source);
+    const _Bool source_inf = _float128_is_infinity(fpu->source);
+    const _Bool source_sign = _float128_is_neg(fpu->source);
+
+    const float128 negone = _assemble_float128(1, 0x3fff, 0, 0);
+
+    /* If source is zero, result is source */
+    if (source_zero) {
+        fpu->result = fpu->source;
+        return ;
+    }
+    /* if source is -inf, result is +0.0 */
+    else if (source_inf && source_sign) {
+        fpu->result = negone;
+        return ;
+    }
+    /* if source is +inf, result is +inf */
+    else if (source_inf) {
+        fpu->result = fpu->source;
+        return ;
+    }
+
+    fpu->result = _hack_etoxm1(fpu->source);
 }

 static void inst_fmath_fgetexp ()
@@ -1533,6 +1611,42 @@
     fpu->result = _hack_log2(fpu->source);
 }

+static void inst_fmath_flognp1 ()
+{
+    fpu_get_state_ptr();
+
+    const _Bool source_zero = _float128_is_zero(fpu->source);
+    const _Bool source_inf = _float128_is_infinity(fpu->source);
+    const _Bool source_sign = _float128_is_neg(fpu->source);
+
+    const float128 negone = _assemble_float128(1, 0x3fff, 0, 0);
+
+    /* If source is zero, result is source */
+    if (source_zero) {
+        fpu->result = fpu->source;
+        return;
+    }
+    /* If source is -1.0, set dz, result is -inf */
+    else if (float128_eq(negone, fpu->source)) {
+        es_dz = 1;
+        fpu->result = _assemble_float128(1, 0x7fff, 0, 0);
+        return;
+    }
+    /* If source < -1.0, set operr, result is nan */
+    else if (float128_lt(fpu->source, negone)) {
+        es_operr = 1;
+        fpu->result = _nan128;
+        return;
+    }
+    /* If source is +inf, result is +inf. */
+    else if (source_inf) {
+        fpu->result = fpu->source;
+        return;
+    }
+
+    fpu->result = _hack_lognp1(fpu->source);
+}
+
 static void inst_fmath_flogn ()
 {
     fpu_get_state_ptr();
@@ -1560,13 +1674,6 @@
     }

     fpu->result = _hack_logn(fpu->source);
-}
-
-static void inst_fmath_flognp1 ()
-{
-    fpu_get_state_ptr();
-
-    assert(!"fmath: flognp1 not implemented");
 }

 static void inst_fmath_fmove ()
@@ -1854,7 +1961,16 @@
 {
     fpu_get_state_ptr();

-    assert(!"fmath: fsinh not implemented");
+    const _Bool source_zero = _float128_is_zero(fpu->source);
+    const _Bool source_inf = _float128_is_infinity(fpu->source);
+
+    /* If source is zero or inf, return source */
+    if (source_zero || source_inf) {
+        fpu->result = fpu->source;
+        return;
+    }
+
+    fpu->result = _hack_sinh(fpu->source);
 }

 static void inst_fmath_fsqrt ()
@@ -1929,13 +2045,53 @@
 {
     fpu_get_state_ptr();

-    assert(!"fmath: ftanh not implemented");
+    const _Bool source_zero = _float128_is_zero(fpu->source);
+    const _Bool source_inf = _float128_is_infinity(fpu->source);
+    const _Bool source_sign = _float128_is_neg(fpu->source);
+
+    /* If source is zero, result is source */
+    if (source_zero) {
+        fpu->result = fpu->source;
+        return;
+    }
+    /* If source is +/- inf, result is +/- 1.0 */
+    else if (source_inf) {
+        fpu->result = _assemble_float128(source_sign, 0x3fff, 0, 0);
+        return;
+    }
+
+    fpu->result = _hack_tanh(fpu->source);
 }

 static void inst_fmath_ftentox ()
 {
     fpu_get_state_ptr();

+    // _hack_ftentox() is broken on clang 3.5 on osx 10.10
+    // (tries to optimize pow(10.0, x) to __exp10(x), and __exp10
+    //  isn't implemented in the 10.8 SDK)
+//    const _Bool source_zero = _float128_is_zero(fpu->source);
+//    const _Bool source_inf = _float128_is_infinity(fpu->source);
+//    const _Bool source_sign = _float128_is_neg(fpu->source);
+//
+//    /* If source is zero, result is +1.0 */
+//    if (source_zero) {
+//        fpu->result = _one128;
+//        return ;
+//    }
+//    /* if source is -inf, result is +0.0 */
+//    else if (source_inf && source_sign) {
+//        fpu->result = _zero128;
+//        return ;
+//    }
+//    /* if source is +inf, result is +inf */
+//    else if (source_inf) {
+//        fpu->result = fpu->source;
+//        return ;
+//    }
+//
+//    fpu->result = _hack_tentox(fpu->source);
+//
     assert(!"fmath: ftentox not implemented");
 }

@@ -1954,7 +2110,27 @@
 {
     fpu_get_state_ptr();

-    assert(!"fmath: ftwotox not implemented");
+    const _Bool source_zero = _float128_is_zero(fpu->source);
+    const _Bool source_inf = _float128_is_infinity(fpu->source);
+    const _Bool source_sign = _float128_is_neg(fpu->source);
+
+    /* If source is zero, result is +1.0 */
+    if (source_zero) {
+        fpu->result = _one128;
+        return ;
+    }
+    /* if source is -inf, result is +0.0 */
+    else if (source_inf && source_sign) {
+        fpu->result = _zero128;
+        return ;
+    }
+    /* if source is +inf, result is +inf */
+    else if (source_inf) {
+        fpu->result = fpu->source;
+        return ;
+    }
+
+    fpu->result = _hack_twotox(fpu->source);
 }

 typedef void (fmath_impl_t)(void);


drm/i915: Clarify irq_lock locking, interrupt install/uninstall

All the interrupt setup/teardown hooks are always run from plain
process context. So again just the _irq variant is good enough.

Reviewed-by: Jesse Barnes <bc7add126c2dbb8382bf1c28ac262b9363a32706@virtuousgeek.org>
Signed-off-by: Daniel Vetter <c1b6782c4af8f0673da8923a0702a1832e5940f4@ffwll.ch>

--- drivers/gpu/drm/i915/i915_irq.c
+++ drivers/gpu/drm/i915/i915_irq.c
@@ -3603,7 +3603,6 @@

 static int ironlake_irq_postinstall(struct drm_device *dev)
 {
-	unsigned long irqflags;
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	u32 display_mask, extra_mask;

@@ -3642,9 +3641,9 @@
 		 * spinlocking not required here for correctness since interrupt
 		 * setup is guaranteed to run in single-threaded context. But we
 		 * need it to make the assert_spin_locked happy. */
-		spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
+		spin_lock_irq(&dev_priv->irq_lock);
 		ironlake_enable_display_irq(dev_priv, DE_PCU_EVENT);
-		spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
+		spin_unlock_irq(&dev_priv->irq_lock);
 	}

 	return 0;
@@ -3740,7 +3739,6 @@
 static int valleyview_irq_postinstall(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
-	unsigned long irqflags;

 	dev_priv->irq_mask = ~0;

@@ -3754,10 +3752,10 @@

 	/* Interrupt setup is already guaranteed to be single-threaded, this is
 	 * just to make the assert_spin_locked check happy. */
-	spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
+	spin_lock_irq(&dev_priv->irq_lock);
 	if (dev_priv->display_irqs_enabled)
 		valleyview_display_irqs_install(dev_priv);
-	spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
+	spin_unlock_irq(&dev_priv->irq_lock);

 	I915_WRITE(VLV_IIR, 0xffffffff);
 	I915_WRITE(VLV_IIR, 0xffffffff);
@@ -3848,7 +3846,6 @@
 		I915_DISPLAY_PIPE_C_EVENT_INTERRUPT;
 	u32 pipestat_enable = PLANE_FLIP_DONE_INT_STATUS_VLV |
 		PIPE_CRC_DONE_INTERRUPT_STATUS;
-	unsigned long irqflags;
 	int pipe;

 	/*
@@ -3860,11 +3857,11 @@
 	for_each_pipe(dev_priv, pipe)
 		I915_WRITE(PIPESTAT(pipe), 0xffff);

-	spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
+	spin_lock_irq(&dev_priv->irq_lock);
 	i915_enable_pipestat(dev_priv, PIPE_A, PIPE_GMBUS_INTERRUPT_STATUS);
 	for_each_pipe(dev_priv, pipe)
 		i915_enable_pipestat(dev_priv, pipe, pipestat_enable);
-	spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
+	spin_unlock_irq(&dev_priv->irq_lock);

 	I915_WRITE(VLV_IIR, 0xffffffff);
 	I915_WRITE(VLV_IMR, dev_priv->irq_mask);
@@ -3891,7 +3888,6 @@
 static void valleyview_irq_uninstall(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
-	unsigned long irqflags;
 	int pipe;

 	if (!dev_priv)
@@ -3906,10 +3902,12 @@
 	I915_WRITE(PORT_HOTPLUG_EN, 0);
 	I915_WRITE(PORT_HOTPLUG_STAT, I915_READ(PORT_HOTPLUG_STAT));

-	spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
+	/* Interrupt setup is already guaranteed to be single-threaded, this is
+	 * just to make the assert_spin_locked check happy. */
+	spin_lock_irq(&dev_priv->irq_lock);
 	if (dev_priv->display_irqs_enabled)
 		valleyview_display_irqs_uninstall(dev_priv);
-	spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
+	spin_unlock_irq(&dev_priv->irq_lock);

 	dev_priv->irq_mask = 0;

@@ -3995,7 +3993,6 @@
 static int i8xx_irq_postinstall(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
-	unsigned long irqflags;

 	I915_WRITE16(EMR,
 		     ~(I915_ERROR_PAGE_TABLE | I915_ERROR_MEMORY_REFRESH));
@@ -4018,10 +4015,10 @@

 	/* Interrupt setup is already guaranteed to be single-threaded, this is
 	 * just to make the assert_spin_locked check happy. */
-	spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
+	spin_lock_irq(&dev_priv->irq_lock);
 	i915_enable_pipestat(dev_priv, PIPE_A, PIPE_CRC_DONE_INTERRUPT_STATUS);
 	i915_enable_pipestat(dev_priv, PIPE_B, PIPE_CRC_DONE_INTERRUPT_STATUS);
-	spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
+	spin_unlock_irq(&dev_priv->irq_lock);

 	return 0;
 }
@@ -4168,7 +4165,6 @@
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	u32 enable_mask;
-	unsigned long irqflags;

 	I915_WRITE(EMR, ~(I915_ERROR_PAGE_TABLE | I915_ERROR_MEMORY_REFRESH));

@@ -4206,10 +4202,10 @@

 	/* Interrupt setup is already guaranteed to be single-threaded, this is
 	 * just to make the assert_spin_locked check happy. */
-	spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
+	spin_lock_irq(&dev_priv->irq_lock);
 	i915_enable_pipestat(dev_priv, PIPE_A, PIPE_CRC_DONE_INTERRUPT_STATUS);
 	i915_enable_pipestat(dev_priv, PIPE_B, PIPE_CRC_DONE_INTERRUPT_STATUS);
-	spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
+	spin_unlock_irq(&dev_priv->irq_lock);

 	return 0;
 }
@@ -4391,7 +4387,6 @@
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	u32 enable_mask;
 	u32 error_mask;
-	unsigned long irqflags;

 	/* Unmask the interrupts that we always want on. */
 	dev_priv->irq_mask = ~(I915_ASLE_INTERRUPT |
@@ -4412,11 +4407,11 @@

 	/* Interrupt setup is already guaranteed to be single-threaded, this is
 	 * just to make the assert_spin_locked check happy. */
-	spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
+	spin_lock_irq(&dev_priv->irq_lock);
 	i915_enable_pipestat(dev_priv, PIPE_A, PIPE_GMBUS_INTERRUPT_STATUS);
 	i915_enable_pipestat(dev_priv, PIPE_A, PIPE_CRC_DONE_INTERRUPT_STATUS);
 	i915_enable_pipestat(dev_priv, PIPE_B, PIPE_CRC_DONE_INTERRUPT_STATUS);
-	spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
+	spin_unlock_irq(&dev_priv->irq_lock);

 	/*
 	 * Enable some error detection, note the instruction error mask
@@ -4756,7 +4751,6 @@
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct drm_mode_config *mode_config = &dev->mode_config;
 	struct drm_connector *connector;
-	unsigned long irqflags;
 	int i;

 	for (i = 1; i < HPD_NUM_PINS; i++) {
@@ -4774,10 +4768,10 @@

 	/* Interrupt setup is already guaranteed to be single-threaded, this is
 	 * just to make the assert_spin_locked checks happy. */
-	spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
+	spin_lock_irq(&dev_priv->irq_lock);
 	if (dev_priv->display.hpd_irq_setup)
 		dev_priv->display.hpd_irq_setup(dev);
-	spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
+	spin_unlock_irq(&dev_priv->irq_lock);
 }

 /* Disable interrupts so we can allow runtime PM. */


zero means 'all' to http_GetTail()

zero means 'all' to http_GetTail()

git-svn-id: 7d4b18ab7d176792635d6a7a77dd8cbbea8e8daa@481 d4fa192b-c00b-0410-8231-f00ffab90ce4

--- bin/varnishd/cache_pipe.c
+++ bin/varnishd/cache_pipe.c
@@ -59,7 +59,7 @@
 	http_BuildSbuf(vc->fd, Build_Pipe, w->sb, sp->http);
 	i = write(vc->fd, sbuf_data(w->sb), sbuf_len(w->sb));
 	assert(i == sbuf_len(w->sb));
-	if (http_GetTail(sp->http, 99999999, &b, &e) && b != e) { /* XXX */
+	if (http_GetTail(sp->http, 0, &b, &e) && b != e) { /* XXX */
 		i = write(vc->fd, b, e - b);
 		if (i != e - b) {
 			close (vc->fd);


COMP: added vcl compiler detection for GCC 10.x

Change-Id: Ie2ad7c15a9166aa553c92a1075f7e6cc7aa05155

--- Modules/ThirdParty/VNL/src/vxl/vcl/vcl_compiler.h
+++ Modules/ThirdParty/VNL/src/vxl/vcl/vcl_compiler.h
@@ -107,6 +107,17 @@
 #   define VCL_GCC_91
 #  else
 #   define VCL_GCC_90
+#  endif
+# elif (__GNUC__==10)
+#  define VCL_GCC_10
+#  if (__GNUC_MINOR__ > 2 )
+#   define VCL_GCC_103
+#  elif (__GNUC_MINOR__ > 1 )
+#   define VCL_GCC_102
+#  elif (__GNUC_MINOR__ > 0 )
+#   define VCL_GCC_101
+#  else
+#   define VCL_GCC_100
 #  endif
 # else
 #  error "Dunno about this gcc"


ng_pktbuf_static: enhance _pktbuf_contains

--- sys/net/crosslayer/ng_pktbuf_static/ng_pktbuf_static.c
+++ sys/net/crosslayer/ng_pktbuf_static/ng_pktbuf_static.c
@@ -52,8 +52,7 @@

 static inline bool _pktbuf_contains(void *ptr)
 {
-    return (&_pktbuf[0] <= (uint8_t *)ptr) &&
-           ((uint8_t *)ptr <= &_pktbuf[NG_PKTBUF_SIZE - 1]);
+    return (unsigned)((uint8_t *)ptr - _pktbuf) < NG_PKTBUF_SIZE;
 }

 /* fits size to byte alignment */


add RISC-V ISA as a potential future target

--- core/rtarch.h
+++ core/rtarch.h
@@ -59,12 +59,20 @@
  *  - rtarch_m32_128.h     - 32-bit MIPS ISA, ?? SIMD registers
  *  - rtarch_p32.h         - 32-bit Power ISA, ?? core registers
  *  - rtarch_p32_128.h     - 32-bit Power ISA, ?? SIMD registers
+ *  - rtarch_r32.h         - 32-bit RISC-V ISA, 31 core registers
+ *  - rtarch_r32_128.h     - 32-bit RISC-V ISA, 31 SIMD registers, shakti/hwacha
+ *  - rtarch_r32_256.h     - 32-bit RISC-V ISA, 31 SIMD registers, shakti/hwacha
+ *  - rtarch_r32_512.h     - 32-bit RISC-V ISA, 31 SIMD registers, shakti/hwacha
  *
  * Reserved 64-bit targets:
  *  - rtarch_m64.h         - 64-bit MIPS ISA, ?? core registers
  *  - rtarch_m64_128.h     - 64-bit MIPS ISA, ?? SIMD registers
  *  - rtarch_p64.h         - 64-bit Power ISA, ?? core registers
  *  - rtarch_p64_128.h     - 64-bit Power ISA, ?? SIMD registers
+ *  - rtarch_r64.h         - 64-bit RISC-V ISA, 31 core registers
+ *  - rtarch_r64_128.h     - 64-bit RISC-V ISA, 31 SIMD registers, shakti/hwacha
+ *  - rtarch_r64_256.h     - 64-bit RISC-V ISA, 31 SIMD registers, shakti/hwacha
+ *  - rtarch_r64_512.h     - 64-bit RISC-V ISA, 31 SIMD registers, shakti/hwacha
  *
  * Preliminary naming scheme for extended core and SIMD register files.
  *
@@ -84,7 +92,7 @@
  * on the chosen target.
  * Core registers can be 32-bit/64-bit wide and their SIMD counterparts depend
  * on the architecture and the version of SIMD used in the target.
- * The fractional registers don't have names and are not architecturally
+ * The fractional sub-registers don't have names and are not architecturally
  * visible in the assembler as it would complicate SPMD programming model.
  */

@@ -210,7 +218,7 @@
  */
 #ifdef Q
 #undef Q
-#endif /* in case Q is defined outside of the engine */
+#endif /* in case Q is defined outside */
 #define Q                   RT_SIMD_QUADS

 /*
@@ -219,7 +227,7 @@
  */
 #ifdef S
 #undef S
-#endif /* in case S is defined outside of the engine */
+#endif /* in case S is defined outside */
 #define S                   RT_SIMD_WIDTH

 /*


drm/i915: fix psr match conditions screw ups.

Not enough brown paper bags, you'll have to share one.
(oops below).

The initial match condition code was racy (locking is coming I hear).

then along came:
cd234b0bfd5ab012e42274b24aae420fa1823d58
drm/i915: Do not dereference NULL crtc or fb until after checking

Chris made an attempt to fix it, Ben "reviewed" it.
Daniel merged it.

Then
drm/i915: Make use of intel_fb_obj() (v2)
2ff8fde1ea0992dfd735dce94f8cae2aacff8e5c

made it worse by removing the obj check later.

All in all, my laptop can't barely turn off the display
without hitting this.

Posted to #intel-gfx out of niceness, but I've merged
this already into drm-next.

Here's an oops.
[   11.528185] BUG: unable to handle kernel NULL pointer dereference at 00000000000000d0
[   11.528233] IP: [<ffffffffa0161fde>] intel_edp_psr_match_conditions+0x1e/0x2e0 [i915]
[   11.528294] PGD 35bc0067 PUD c997c067 PMD 0
[   11.528321] Oops: 0000 [#1] SMP
[   11.528916] CPU: 3 PID: 244 Comm: kworker/3:2 Not tainted 3.16.0-rc4+ #17
[   11.528949] Hardware name: LENOVO 20ARS25701/20ARS25701, BIOS GJET72WW (2.22 ) 02/21/2014
[   11.529004] Workqueue: events intel_edp_psr_work [i915]
[   11.529031] task: ffff8803079fdaa0 ti: ffff8803079c4000 task.ti: ffff8803079c4000
[   11.529067] RIP: 0010:[<ffffffffa0161fde>]  [<ffffffffa0161fde>] intel_edp_psr_match_conditions+0x1e/0x2e0 [i915]
[   11.529129] RSP: 0018:ffff8803079c7d40  EFLAGS: 00010246
[   11.529155] RAX: 0000000000000000 RBX: ffff88030c11c000 RCX: c000000000000000
[   11.529189] RDX: 0000000000000001 RSI: 1df0000000000000 RDI: ffff88030c1190d8
[   11.529222] RBP: ffff8803079c7d60 R08: ffffffff82691140 R09: 0000000000000000
[   11.529256] R10: ffff8803079fdaa0 R11: 3e00000000000000 R12: ffff88030c11c728
[   11.529290] R13: ffff88030c1190d8 R14: ffff88031e2d8e00 R15: 00000000000000c0
[   11.529324] FS:  0000000000000000(0000) GS:ffff88031e2c0000(0000) knlGS:0000000000000000
[   11.529361] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   11.529389] CR2: 00000000000000d0 CR3: 00000000c8d9d000 CR4: 00000000001407e0
[   11.529423] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[   11.529457] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[   11.529489] Stack:
[   11.529500]  ffff88030c119000 ffff88030c11c728 ffff88030c1190d8 ffff88031e2d8e00
[   11.529541]  ffff8803079c7d88 ffffffffa01679b2 ffff880035b29a80 ffff880307909f00
[   11.529583]  ffff88031e2d4740 ffff8803079c7df8 ffffffff810a78ab ffffffff810a7849
[   11.529624] Call Trace:
[   11.529654]  [<ffffffffa01679b2>] intel_edp_psr_work+0x52/0x90 [i915]
[   11.529689]  [<ffffffff810a78ab>] process_one_work+0x1db/0x540
[   11.529719]  [<ffffffff810a7849>] ? process_one_work+0x179/0x540
[   11.529750]  [<ffffffff810a81ed>] worker_thread+0x11d/0x520
[   11.529779]  [<ffffffff810a80d0>] ? create_and_start_worker+0x60/0x60
[   11.529810]  [<ffffffff810aeb04>] kthread+0xe4/0x100
[   11.529836]  [<ffffffff810aea20>] ? kthread_create_on_node+0x200/0x200
[   11.529870]  [<ffffffff81705ebc>] ret_from_fork+0x7c/0xb0
[   11.529896]  [<ffffffff810aea20>] ? kthread_create_on_node+0x200/0x200
[   11.529926] Code: ba 31 13 f0 c9 85 f6 75 84 eb d0 66 90 0f 1f 44 00 00 55 48 89 e5 41 56 41 55 41 54 53 48 8b 87 68 ff ff ff 48 8b 9f 28 ff ff ff <48> 8b 80 d0 00 00 00 4c 8b 63 28 48 8b 40 48 48 85 c0 0f 84 1a
[   11.530110] RIP  [<ffffffffa0161fde>] intel_edp_psr_match_conditions+0x1e/0x2e0 [i915]
[   11.530163]  RSP <ffff8803079c7d40>
[   11.530180] CR2: 00000000000000d0

Signed-off-by: Dave Airlie <f2295d84e358395675bc8031be58672073ae065e@redhat.com>

--- drivers/gpu/drm/i915/intel_dp.c
+++ drivers/gpu/drm/i915/intel_dp.c
@@ -1767,9 +1767,9 @@
 	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
 	struct drm_device *dev = dig_port->base.base.dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
-	struct drm_crtc *crtc = dig_port->base.base.crtc;
-	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
-	struct drm_i915_gem_object *obj = intel_fb_obj(crtc->primary->fb);
+	struct drm_crtc *crtc;
+	struct intel_crtc *intel_crtc;
+	struct drm_i915_gem_object *obj;
 	struct intel_encoder *intel_encoder = &dp_to_dig_port(intel_dp)->base;

 	dev_priv->psr.source_ok = false;
@@ -1802,6 +1802,7 @@
 		return false;
 	}

+	obj = intel_fb_obj(crtc->primary->fb);
 	if (obj->tiling_mode != I915_TILING_X ||
 	    obj->fence_reg == I915_FENCE_REG_NONE) {
 		DRM_DEBUG_KMS("PSR condition failed: fb not tiled or fenced\n");


rollback regrouping (swap C and D values back to original)

--- core/rtarch.h
+++ core/rtarch.h
@@ -147,8 +147,8 @@
 #define A   (RT_ADDRESS/32)         /* short name for RT_ADDRESS/32 */

 #define B   (RT_ENDIAN*(2-1)*4)     /* for cmdw*_** working on 64-bit field */
-#define C   (RT_ENDIAN*(P-1)*4)     /* for cmdw*_** working on P-size field */
-#define D   (RT_ENDIAN*(2-A)*4)     /* for cmdx*_** working on 64-bit field */
+#define C   (RT_ENDIAN*(2-A)*4)     /* for cmdx*_** working on 64-bit field */
+#define D   (RT_ENDIAN*(P-1)*4)     /* for cmdw*_** working on P-size field */
 #define E   (RT_ENDIAN*(P-A)*4)     /* for cmdx*_** working on P-size field */
 #define F   (RT_ENDIAN*(A-1)*4)     /* for cmdw*_**, cmdx*_** without C/C++ */


Revert "drm/i915/dp: use VBT provided eDP params if available"

This reverts commit 869184a675662bddcdf76c5b95665272facff2b8.

This is required for the Sony Vaio Jesse was working on at the time, but
breaks most other eDP machines - machines that were working in earlier
kernels.

Reported-and-tested-by: Dave Airlie <f2295d84e358395675bc8031be58672073ae065e@redhat.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31188
Tested-by: Zhao Jian <f74334fc7b2bf791c93d4d0bf54111c5ae91d42a@intel.com>
Signed-off-by: Chris Wilson <711c73f64afdce07b7e38039a96d2224209e9a6c@chris-wilson.co.uk>

--- drivers/gpu/drm/i915/intel_dp.c
+++ drivers/gpu/drm/i915/intel_dp.c
@@ -584,17 +584,6 @@
 		mode->clock = dev_priv->panel_fixed_mode->clock;
 	}

-	/* Just use VBT values for eDP */
-	if (is_edp(intel_dp)) {
-		intel_dp->lane_count = dev_priv->edp.lanes;
-		intel_dp->link_bw = dev_priv->edp.rate;
-		adjusted_mode->clock = intel_dp_link_clock(intel_dp->link_bw);
-		DRM_DEBUG_KMS("eDP link bw %02x lane count %d clock %d\n",
-			      intel_dp->link_bw, intel_dp->lane_count,
-			      adjusted_mode->clock);
-		return true;
-	}
-
 	for (lane_count = 1; lane_count <= max_lane_count; lane_count <<= 1) {
 		for (clock = 0; clock <= max_clock; clock++) {
 			int link_avail = intel_dp_max_data_rate(intel_dp_link_clock(bws[clock]), lane_count);
@@ -611,6 +600,19 @@
 				return true;
 			}
 		}
+	}
+
+	if (is_edp(intel_dp)) {
+		/* okay we failed just pick the highest */
+		intel_dp->lane_count = max_lane_count;
+		intel_dp->link_bw = bws[max_clock];
+		adjusted_mode->clock = intel_dp_link_clock(intel_dp->link_bw);
+		DRM_DEBUG_KMS("Force picking display port link bw %02x lane "
+			      "count %d clock %d\n",
+			      intel_dp->link_bw, intel_dp->lane_count,
+			      adjusted_mode->clock);
+
+		return true;
 	}

 	return false;
@@ -1087,21 +1089,11 @@
 }

 static uint32_t
-intel_dp_signal_levels(struct intel_dp *intel_dp)
-{
-	struct drm_device *dev = intel_dp->base.base.dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
-	uint32_t signal_levels = 0;
-	u8 train_set = intel_dp->train_set[0];
-	u32 vswing = train_set & DP_TRAIN_VOLTAGE_SWING_MASK;
-	u32 preemphasis = train_set & DP_TRAIN_PRE_EMPHASIS_MASK;
-
-	if (is_edp(intel_dp)) {
-		vswing = dev_priv->edp.vswing;
-		preemphasis = dev_priv->edp.preemphasis;
-	}
-
-	switch (vswing) {
+intel_dp_signal_levels(uint8_t train_set, int lane_count)
+{
+	uint32_t	signal_levels = 0;
+
+	switch (train_set & DP_TRAIN_VOLTAGE_SWING_MASK) {
 	case DP_TRAIN_VOLTAGE_SWING_400:
 	default:
 		signal_levels |= DP_VOLTAGE_0_4;
@@ -1116,7 +1108,7 @@
 		signal_levels |= DP_VOLTAGE_1_2;
 		break;
 	}
-	switch (preemphasis) {
+	switch (train_set & DP_TRAIN_PRE_EMPHASIS_MASK) {
 	case DP_TRAIN_PRE_EMPHASIS_0:
 	default:
 		signal_levels |= DP_PRE_EMPHASIS_0;
@@ -1203,18 +1195,6 @@
 }

 static bool
-intel_dp_aux_handshake_required(struct intel_dp *intel_dp)
-{
-	struct drm_device *dev = intel_dp->base.base.dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
-
-	if (is_edp(intel_dp) && dev_priv->no_aux_handshake)
-		return false;
-
-	return true;
-}
-
-static bool
 intel_dp_set_link_train(struct intel_dp *intel_dp,
 			uint32_t dp_reg_value,
 			uint8_t dp_train_pat)
@@ -1225,9 +1205,6 @@

 	I915_WRITE(intel_dp->output_reg, dp_reg_value);
 	POSTING_READ(intel_dp->output_reg);
-
-	if (!intel_dp_aux_handshake_required(intel_dp))
-		return true;

 	intel_dp_aux_native_write_1(intel_dp,
 				    DP_TRAINING_PATTERN_SET,
@@ -1261,11 +1238,10 @@
 	POSTING_READ(intel_dp->output_reg);
 	intel_wait_for_vblank(dev, intel_crtc->pipe);

-	if (intel_dp_aux_handshake_required(intel_dp))
-		/* Write the link configuration data */
-		intel_dp_aux_native_write(intel_dp, DP_LINK_BW_SET,
-					  intel_dp->link_configuration,
-					  DP_LINK_CONFIGURATION_SIZE);
+	/* Write the link configuration data */
+	intel_dp_aux_native_write(intel_dp, DP_LINK_BW_SET,
+				  intel_dp->link_configuration,
+				  DP_LINK_CONFIGURATION_SIZE);

 	DP |= DP_PORT_EN;
 	if (HAS_PCH_CPT(dev) && !is_edp(intel_dp))
@@ -1283,7 +1259,7 @@
 			signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]);
 			DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels;
 		} else {
-			signal_levels = intel_dp_signal_levels(intel_dp);
+			signal_levels = intel_dp_signal_levels(intel_dp->train_set[0], intel_dp->lane_count);
 			DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels;
 		}

@@ -1297,37 +1273,33 @@
 			break;
 		/* Set training pattern 1 */

-		udelay(500);
-		if (intel_dp_aux_handshake_required(intel_dp)) {
+		udelay(100);
+		if (!intel_dp_get_link_status(intel_dp))
 			break;
-		} else {
-			if (!intel_dp_get_link_status(intel_dp))
+
+		if (intel_clock_recovery_ok(intel_dp->link_status, intel_dp->lane_count)) {
+			clock_recovery = true;
+			break;
+		}
+
+		/* Check to see if we've tried the max voltage */
+		for (i = 0; i < intel_dp->lane_count; i++)
+			if ((intel_dp->train_set[i] & DP_TRAIN_MAX_SWING_REACHED) == 0)
 				break;
-
-			if (intel_clock_recovery_ok(intel_dp->link_status, intel_dp->lane_count)) {
-				clock_recovery = true;
+		if (i == intel_dp->lane_count)
+			break;
+
+		/* Check to see if we've tried the same voltage 5 times */
+		if ((intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK) == voltage) {
+			++tries;
+			if (tries == 5)
 				break;
-			}
-
-			/* Check to see if we've tried the max voltage */
-			for (i = 0; i < intel_dp->lane_count; i++)
-				if ((intel_dp->train_set[i] & DP_TRAIN_MAX_SWING_REACHED) == 0)
-					break;
-			if (i == intel_dp->lane_count)
-				break;
-
-			/* Check to see if we've tried the same voltage 5 times */
-			if ((intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK) == voltage) {
-				++tries;
-				if (tries == 5)
-					break;
-			} else
-				tries = 0;
-			voltage = intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK;
-
-			/* Compute new intel_dp->train_set as requested by target */
-			intel_get_adjust_train(intel_dp);
-		}
+		} else
+			tries = 0;
+		voltage = intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK;
+
+		/* Compute new intel_dp->train_set as requested by target */
+		intel_get_adjust_train(intel_dp);
 	}

 	intel_dp->DP = DP;
@@ -1354,7 +1326,7 @@
 			signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]);
 			DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels;
 		} else {
-			signal_levels = intel_dp_signal_levels(intel_dp);
+			signal_levels = intel_dp_signal_levels(intel_dp->train_set[0], intel_dp->lane_count);
 			DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels;
 		}

@@ -1368,28 +1340,24 @@
 					     DP_TRAINING_PATTERN_2))
 			break;

-		udelay(500);
-
-		if (!intel_dp_aux_handshake_required(intel_dp)) {
+		udelay(400);
+		if (!intel_dp_get_link_status(intel_dp))
 			break;
-		} else {
-			if (!intel_dp_get_link_status(intel_dp))
-				break;
-
-			if (intel_channel_eq_ok(intel_dp)) {
-				channel_eq = true;
-				break;
-			}
-
-			/* Try 5 times */
-			if (tries > 5)
-				break;
-
-			/* Compute new intel_dp->train_set as requested by target */
-			intel_get_adjust_train(intel_dp);
-			++tries;
+
+		if (intel_channel_eq_ok(intel_dp)) {
+			channel_eq = true;
+			break;
 		}
-	}
+
+		/* Try 5 times */
+		if (tries > 5)
+			break;
+
+		/* Compute new intel_dp->train_set as requested by target */
+		intel_get_adjust_train(intel_dp);
+		++tries;
+	}
+
 	if (HAS_PCH_CPT(dev) && !is_edp(intel_dp))
 		reg = DP | DP_LINK_TRAIN_OFF_CPT;
 	else


STYLE: Nightly Version update

STYLE: Nightly Version update

--- Common/vtkVersion.h
+++ Common/vtkVersion.h
@@ -28,7 +28,7 @@

 #include "vtkObject.h"

-#define VTK_SOURCE_VERSION "vtk version " VTK_VERSION ", vtk source $Revision: 1.2333 $, $Date: 2006-01-27 06:36:39 $ (GMT)"
+#define VTK_SOURCE_VERSION "vtk version " VTK_VERSION ", vtk source $Revision: 1.2334 $, $Date: 2006-01-28 06:38:25 $ (GMT)"

 class VTK_COMMON_EXPORT vtkVersion : public vtkObject


Don't include mntent when lxcmntent is used

Signed-off-by: Stéphane Graber <089afc6d81f66f1168a9849e15660feae286e024@ubuntu.com>

--- hooks/unmount-namespace.c
+++ hooks/unmount-namespace.c
@@ -35,7 +35,6 @@
 #include <sys/types.h> /* openat, open */
 #include <sys/stat.h>  /* openat, open */
 #include <fcntl.h>     /* openat, open */
-#include <mntent.h>    /* getmntent, endmntent */
 #include <errno.h>     /* errno */

 #include <../src/config.h>


Update CGSettings.h

Update CGSettings.h


[core] improved slab usage statistics

[core] improved slab usage statistics

--- core/salloc.c
+++ core/salloc.c
@@ -312,7 +312,7 @@
 {
 	struct slab *slab;
 	int slabs;
-	i64 items, used, free;
+	i64 items, used, free, total_used = 0;
 	tbuf_printf(t, "slab statistics:\n  classes:\n");
 	for (int i = 0; i < slab_active_classes; i++) {
 		slabs = items = used = free = 0;
@@ -320,7 +320,8 @@
 			if (slab->free != NULL)
 				free += SLAB_SIZE - slab->used - sizeof(struct slab);
 			items += slab->items;
-			used += slab->used;
+			used += sizeof(struct slab) + slab->used;
+			total_used += sizeof(struct slab) + slab->used;
 			slabs++;
 		}
 		if (used == 0)
@@ -329,6 +330,8 @@
 		tbuf_printf(t, "     - { item_size: %- 5i, slabs: %- 3i, items: %- 11"PRIi64", bytes_used: %- 12"PRIi64", bytes_free: %- 12"PRIi64" }\n",
 			    (int)slab_classes[i].item_size, slabs, items, used, free);
 	}
+	tbuf_printf(t, "  items_used: %.2f\n", (double)total_used / arena.size * 100);
+	tbuf_printf(t, "  arena_used: %.2f\n", (double)arena.used / arena.size * 100);
 }

 void


drm/i915/dp: wait for previous AUX channel activity to clear

Before initiating a new read or write on the DP AUX channel, wait for
any outstanding activity to complete.  This may happen during normal
retry behavior.  If the wait fails (i.e. after 1ms the AUX channel is
still busy) dump a backtrace to make the caller easier to spot.

v2: use msleep instead, and timeout after 3ms (only ever saw 1 retry
    with msleep in testing)
v3: fix backtrace check to trigger if the 3ms wait times out

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38136.

Signed-off-by: Jesse Barnes <bc7add126c2dbb8382bf1c28ac262b9363a32706@virtuousgeek.org>
Reviewed-by: Keith Packard <fd7f967895e9f35e58ec8a62a847a54d7fa7275f@keithp.com>
Signed-off-by: Keith Packard <fd7f967895e9f35e58ec8a62a847a54d7fa7275f@keithp.com>

--- drivers/gpu/drm/i915/intel_dp.c
+++ drivers/gpu/drm/i915/intel_dp.c
@@ -315,9 +315,17 @@
 	else
 		precharge = 5;

-	if (I915_READ(ch_ctl) & DP_AUX_CH_CTL_SEND_BUSY) {
-		DRM_ERROR("dp_aux_ch not started status 0x%08x\n",
-			  I915_READ(ch_ctl));
+	/* Try to wait for any previous AUX channel activity */
+	for (try = 0; try < 3; try++) {
+		status = I915_READ(ch_ctl);
+		if ((status & DP_AUX_CH_CTL_SEND_BUSY) == 0)
+			break;
+		msleep(1);
+	}
+
+	if (try == 3) {
+		WARN(1, "dp_aux_ch not started status 0x%08x\n",
+		     I915_READ(ch_ctl));
 		return -EBUSY;
 	}


vbp_update_backend: do not assume a director

To get out of a catch-22, see second next commit

--- bin/varnishd/cache/cache_backend_probe.c
+++ bin/varnishd/cache/cache_backend_probe.c
@@ -153,42 +153,50 @@
 static void
 vbp_update_backend(struct vbp_target *vt)
 {
-	unsigned i;
+	unsigned i = 0;
 	char bits[10];
 	const char *logmsg;

 	CHECK_OBJ_NOTNULL(vt, VBP_TARGET_MAGIC);

 	Lck_Lock(&vbp_mtx);
-	if (vt->backend != NULL) {
-		i = 0;
+	if (vt->backend == NULL) {
+		Lck_Unlock(&vbp_mtx);
+		return;
+	}
+
 #define BITMAP(n, c, t, b) \
-		bits[i++] = (vt->n & 1) ? c : '-';
+	bits[i++] = (vt->n & 1) ? c : '-';
 #include "tbl/backend_poll.h"
-		bits[i] = '\0';
-		assert(i < sizeof bits);
-
-		if (vt->good >= vt->threshold) {
-			if (vt->backend->director->sick) {
-				logmsg = "Back healthy";
-				VRT_SetHealth(vt->backend->director, 1);
-			} else {
-				logmsg = "Still healthy";
-			}
+	bits[i] = '\0';
+	assert(i < sizeof bits);
+
+	if (vt->backend->director == NULL) {
+		Lck_Unlock(&vbp_mtx);
+		return;
+	}
+
+	if (vt->good >= vt->threshold) {
+		if (vt->backend->director->sick) {
+			logmsg = "Back healthy";
+			VRT_SetHealth(vt->backend->director, 1);
 		} else {
-			if (vt->backend->director->sick) {
-				logmsg = "Still sick";
-			} else {
-				logmsg = "Went sick";
-				VRT_SetHealth(vt->backend->director, 0);
-			}
+			logmsg = "Still healthy";
 		}
-		VSL(SLT_Backend_health, 0, "%s %s %s %u %u %u %.6f %.6f %s",
-		    vt->backend->director->vcl_name, logmsg, bits,
-		    vt->good, vt->threshold, vt->window,
-		    vt->last, vt->avg, vt->resp_buf);
-		VBE_SetHappy(vt->backend, vt->happy);
-	}
+	} else {
+		if (vt->backend->director->sick) {
+			logmsg = "Still sick";
+		} else {
+			logmsg = "Went sick";
+			VRT_SetHealth(vt->backend->director, 0);
+		}
+	}
+	VSL(SLT_Backend_health, 0, "%s %s %s %u %u %u %.6f %.6f %s",
+	    vt->backend->director->vcl_name, logmsg, bits,
+	    vt->good, vt->threshold, vt->window,
+	    vt->last, vt->avg, vt->resp_buf);
+	VBE_SetHappy(vt->backend, vt->happy);
+
 	Lck_Unlock(&vbp_mtx);
 }


STYLE: Nightly Version update

STYLE: Nightly Version update

--- Common/vtkVersion.h
+++ Common/vtkVersion.h
@@ -28,7 +28,7 @@

 #include "vtkObject.h"

-#define VTK_SOURCE_VERSION "vtk version " VTK_VERSION ", vtk source $Revision: 1.3070 $, $Date: 2008-03-29 01:06:40 $ (GMT)"
+#define VTK_SOURCE_VERSION "vtk version " VTK_VERSION ", vtk source $Revision: 1.3071 $, $Date: 2008-03-30 00:59:46 $ (GMT)"

 class VTK_COMMON_EXPORT vtkVersion : public vtkObject


drm/i915/dp: use VBT provided eDP params if available

We can skip most of the link training step if we use the VBT provided
values.

Signed-off-by: Jesse Barnes <bc7add126c2dbb8382bf1c28ac262b9363a32706@virtuousgeek.org>
Signed-off-by: Chris Wilson <711c73f64afdce07b7e38039a96d2224209e9a6c@chris-wilson.co.uk>

--- drivers/gpu/drm/i915/intel_dp.c
+++ drivers/gpu/drm/i915/intel_dp.c
@@ -581,6 +581,17 @@
 		mode->clock = dev_priv->panel_fixed_mode->clock;
 	}

+	/* Just use VBT values for eDP */
+	if (is_edp(intel_dp)) {
+		intel_dp->lane_count = dev_priv->edp.lanes;
+		intel_dp->link_bw = dev_priv->edp.rate;
+		adjusted_mode->clock = intel_dp_link_clock(intel_dp->link_bw);
+		DRM_DEBUG_KMS("eDP link bw %02x lane count %d clock %d\n",
+			      intel_dp->link_bw, intel_dp->lane_count,
+			      adjusted_mode->clock);
+		return true;
+	}
+
 	for (lane_count = 1; lane_count <= max_lane_count; lane_count <<= 1) {
 		for (clock = 0; clock <= max_clock; clock++) {
 			int link_avail = intel_dp_max_data_rate(intel_dp_link_clock(bws[clock]), lane_count);
@@ -597,19 +608,6 @@
 				return true;
 			}
 		}
-	}
-
-	if (is_edp(intel_dp)) {
-		/* okay we failed just pick the highest */
-		intel_dp->lane_count = max_lane_count;
-		intel_dp->link_bw = bws[max_clock];
-		adjusted_mode->clock = intel_dp_link_clock(intel_dp->link_bw);
-		DRM_DEBUG_KMS("Force picking display port link bw %02x lane "
-			      "count %d clock %d\n",
-			      intel_dp->link_bw, intel_dp->lane_count,
-			      adjusted_mode->clock);
-
-		return true;
 	}

 	return false;
@@ -1088,11 +1086,21 @@
 }

 static uint32_t
-intel_dp_signal_levels(uint8_t train_set, int lane_count)
-{
-	uint32_t	signal_levels = 0;
-
-	switch (train_set & DP_TRAIN_VOLTAGE_SWING_MASK) {
+intel_dp_signal_levels(struct intel_dp *intel_dp)
+{
+	struct drm_device *dev = intel_dp->base.base.dev;
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	uint32_t signal_levels = 0;
+	u8 train_set = intel_dp->train_set[0];
+	u32 vswing = train_set & DP_TRAIN_VOLTAGE_SWING_MASK;
+	u32 preemphasis = train_set & DP_TRAIN_PRE_EMPHASIS_MASK;
+
+	if (is_edp(intel_dp)) {
+		vswing = dev_priv->edp.vswing;
+		preemphasis = dev_priv->edp.preemphasis;
+	}
+
+	switch (vswing) {
 	case DP_TRAIN_VOLTAGE_SWING_400:
 	default:
 		signal_levels |= DP_VOLTAGE_0_4;
@@ -1107,7 +1115,7 @@
 		signal_levels |= DP_VOLTAGE_1_2;
 		break;
 	}
-	switch (train_set & DP_TRAIN_PRE_EMPHASIS_MASK) {
+	switch (preemphasis) {
 	case DP_TRAIN_PRE_EMPHASIS_0:
 	default:
 		signal_levels |= DP_PRE_EMPHASIS_0;
@@ -1194,6 +1202,18 @@
 }

 static bool
+intel_dp_aux_handshake_required(struct intel_dp *intel_dp)
+{
+	struct drm_device *dev = intel_dp->base.base.dev;
+	struct drm_i915_private *dev_priv = dev->dev_private;
+
+	if (is_edp(intel_dp) && dev_priv->no_aux_handshake)
+		return false;
+
+	return true;
+}
+
+static bool
 intel_dp_set_link_train(struct intel_dp *intel_dp,
 			uint32_t dp_reg_value,
 			uint8_t dp_train_pat)
@@ -1204,6 +1224,9 @@

 	I915_WRITE(intel_dp->output_reg, dp_reg_value);
 	POSTING_READ(intel_dp->output_reg);
+
+	if (!intel_dp_aux_handshake_required(intel_dp))
+		return true;

 	intel_dp_aux_native_write_1(intel_dp,
 				    DP_TRAINING_PATTERN_SET,
@@ -1237,10 +1260,11 @@
 	POSTING_READ(intel_dp->output_reg);
 	intel_wait_for_vblank(dev, intel_crtc->pipe);

-	/* Write the link configuration data */
-	intel_dp_aux_native_write(intel_dp, DP_LINK_BW_SET,
-				  intel_dp->link_configuration,
-				  DP_LINK_CONFIGURATION_SIZE);
+	if (intel_dp_aux_handshake_required(intel_dp))
+		/* Write the link configuration data */
+		intel_dp_aux_native_write(intel_dp, DP_LINK_BW_SET,
+					  intel_dp->link_configuration,
+					  DP_LINK_CONFIGURATION_SIZE);

 	DP |= DP_PORT_EN;
 	if (HAS_PCH_CPT(dev) && !is_edp(intel_dp))
@@ -1258,7 +1282,7 @@
 			signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]);
 			DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels;
 		} else {
-			signal_levels = intel_dp_signal_levels(intel_dp->train_set[0], intel_dp->lane_count);
+			signal_levels = intel_dp_signal_levels(intel_dp);
 			DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels;
 		}

@@ -1272,33 +1296,37 @@
 			break;
 		/* Set training pattern 1 */

-		udelay(100);
-		if (!intel_dp_get_link_status(intel_dp))
+		udelay(500);
+		if (intel_dp_aux_handshake_required(intel_dp)) {
 			break;
-
-		if (intel_clock_recovery_ok(intel_dp->link_status, intel_dp->lane_count)) {
-			clock_recovery = true;
-			break;
+		} else {
+			if (!intel_dp_get_link_status(intel_dp))
+				break;
+
+			if (intel_clock_recovery_ok(intel_dp->link_status, intel_dp->lane_count)) {
+				clock_recovery = true;
+				break;
+			}
+
+			/* Check to see if we've tried the max voltage */
+			for (i = 0; i < intel_dp->lane_count; i++)
+				if ((intel_dp->train_set[i] & DP_TRAIN_MAX_SWING_REACHED) == 0)
+					break;
+			if (i == intel_dp->lane_count)
+				break;
+
+			/* Check to see if we've tried the same voltage 5 times */
+			if ((intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK) == voltage) {
+				++tries;
+				if (tries == 5)
+					break;
+			} else
+				tries = 0;
+			voltage = intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK;
+
+			/* Compute new intel_dp->train_set as requested by target */
+			intel_get_adjust_train(intel_dp);
 		}
-
-		/* Check to see if we've tried the max voltage */
-		for (i = 0; i < intel_dp->lane_count; i++)
-			if ((intel_dp->train_set[i] & DP_TRAIN_MAX_SWING_REACHED) == 0)
-				break;
-		if (i == intel_dp->lane_count)
-			break;
-
-		/* Check to see if we've tried the same voltage 5 times */
-		if ((intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK) == voltage) {
-			++tries;
-			if (tries == 5)
-				break;
-		} else
-			tries = 0;
-		voltage = intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK;
-
-		/* Compute new intel_dp->train_set as requested by target */
-		intel_get_adjust_train(intel_dp);
 	}

 	intel_dp->DP = DP;
@@ -1325,7 +1353,7 @@
 			signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]);
 			DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels;
 		} else {
-			signal_levels = intel_dp_signal_levels(intel_dp->train_set[0], intel_dp->lane_count);
+			signal_levels = intel_dp_signal_levels(intel_dp);
 			DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels;
 		}

@@ -1339,24 +1367,28 @@
 					     DP_TRAINING_PATTERN_2))
 			break;

-		udelay(400);
-		if (!intel_dp_get_link_status(intel_dp))
+		udelay(500);
+
+		if (!intel_dp_aux_handshake_required(intel_dp)) {
 			break;
-
-		if (intel_channel_eq_ok(intel_dp)) {
-			channel_eq = true;
-			break;
+		} else {
+			if (!intel_dp_get_link_status(intel_dp))
+				break;
+
+			if (intel_channel_eq_ok(intel_dp)) {
+				channel_eq = true;
+				break;
+			}
+
+			/* Try 5 times */
+			if (tries > 5)
+				break;
+
+			/* Compute new intel_dp->train_set as requested by target */
+			intel_get_adjust_train(intel_dp);
+			++tries;
 		}
-
-		/* Try 5 times */
-		if (tries > 5)
-			break;
-
-		/* Compute new intel_dp->train_set as requested by target */
-		intel_get_adjust_train(intel_dp);
-		++tries;
-	}
-
+	}
 	if (HAS_PCH_CPT(dev) && !is_edp(intel_dp))
 		reg = DP | DP_LINK_TRAIN_OFF_CPT;
 	else


Slight formatting fixups

Slight formatting fixups

--- CoreContext.h
+++ CoreContext.h
@@ -79,46 +79,10 @@
   virtual ~CoreContext(void);

   /// <summary>
-  /// Factory to create a new context
-  /// </summary>
-  /// <param name="T">The context sigil.</param>
-  template<class T>
-  std::shared_ptr<CoreContext> Create(void) {
-    return CreateInternal<T>(*new CoreContext(shared_from_this(), typeid(T)));
-  }
-
-  /// <summary>
-  /// Factory to create a peer context
-  /// </summary>
-  /// <remarks>
-  /// A peer context allows clients to create autowiring contexts which are in the same event
-  /// domain with respect to each other, but are not in the same autowiring domain.  This can
-  /// be useful where multiple instances of a particular object are desired, but inserting
-  /// such objects into a simple child context is cumbersome because the objects at parent
-  /// scope are listening to events originating from objects at child scope. Events can be fired,
-  /// but not received, from an unintiated context if its peer is initiated.
-  /// </remarks>
-  template<class T>
-  std::shared_ptr<CoreContext> CreatePeer(void) {
-    return m_pParent->CreateInternal<T>(*new CoreContext(m_pParent, typeid(T), shared_from_this()));
-  }
-
-  /// <summary>
-  /// Allows a specifically named class to be bolted
-  /// </summary>
-  /// <remarks>
-  /// If the specified type does not inherit from BoltTo, this method has no effect
-  /// </remarks>
-  template<class T>
-  void Enable(void) {
-    static_assert(!std::is_abstract<T>::value, "Cannot enable an abstract class for bolting");
-    EnableInternal((T*)nullptr, (T*)nullptr);
-  }
-
-  /// <summary>
   /// Convenience method to obtain a shared reference to the global context
   /// </summary>
   static std::shared_ptr<CoreContext> GetGlobal(void);
+
 protected:
   /// <summary>
   /// Register new context with parent and notify others of its creation.
@@ -462,6 +426,43 @@
   const std::type_info& GetSigilType(void) const { return m_sigil; }

   /// <summary>
+  /// Factory to create a new context
+  /// </summary>
+  /// <param name="T">The context sigil.</param>
+  template<class T>
+  std::shared_ptr<CoreContext> Create(void) {
+    return CreateInternal<T>(*new CoreContext(shared_from_this(), typeid(T)));
+  }
+
+  /// <summary>
+  /// Factory to create a peer context
+  /// </summary>
+  /// <remarks>
+  /// A peer context allows clients to create autowiring contexts which are in the same event
+  /// domain with respect to each other, but are not in the same autowiring domain.  This can
+  /// be useful where multiple instances of a particular object are desired, but inserting
+  /// such objects into a simple child context is cumbersome because the objects at parent
+  /// scope are listening to events originating from objects at child scope. Events can be fired,
+  /// but not received, from an unintiated context if its peer is initiated.
+  /// </remarks>
+  template<class T>
+  std::shared_ptr<CoreContext> CreatePeer(void) {
+    return m_pParent->CreateInternal<T>(*new CoreContext(m_pParent, typeid(T), shared_from_this()));
+  }
+
+  /// <summary>
+  /// Allows a specifically named class to be bolted
+  /// </summary>
+  /// <remarks>
+  /// If the specified type does not inherit from BoltTo, this method has no effect
+  /// </remarks>
+  template<class T>
+  void Enable(void) {
+    static_assert(!std::is_abstract<T>::value, "Cannot enable an abstract class for bolting");
+    EnableInternal((T*)nullptr, (T*)nullptr);
+  }
+
+  /// <summary>
   /// Check if parent context's have AutoAnchored the type in their sigil.
   /// </summary>
   template<typename Sigil>


STYLE: Nightly Version update

STYLE: Nightly Version update

--- Common/vtkVersion.h
+++ Common/vtkVersion.h
@@ -28,7 +28,7 @@

 #include "vtkObject.h"

-#define VTK_SOURCE_VERSION "vtk version " VTK_VERSION ", vtk source $Revision: 1.2931 $, $Date: 2007-11-08 04:08:49 $ (GMT)"
+#define VTK_SOURCE_VERSION "vtk version " VTK_VERSION ", vtk source $Revision: 1.2932 $, $Date: 2007-11-09 04:03:38 $ (GMT)"

 class VTK_COMMON_EXPORT vtkVersion : public vtkObject


drm/i915: Apply a workaround for transitioning from DP on pipe B to HDMI.

This workaround only applies to Ironlake.

Signed-off-by: Eric Anholt <96f164ad4d9b2b0dacf8ebee2bb1eeb3aa69adf1@anholt.net>
Signed-off-by: Chris Wilson <711c73f64afdce07b7e38039a96d2224209e9a6c@chris-wilson.co.uk>
Cc: 4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@kernel.org

--- drivers/gpu/drm/i915/intel_dp.c
+++ drivers/gpu/drm/i915/intel_dp.c
@@ -1374,6 +1374,7 @@
 {
 	struct drm_device *dev = intel_dp->base.base.dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
+	struct intel_crtc *intel_crtc = to_intel_crtc(intel_dp->base.base.crtc);
 	uint32_t DP = intel_dp->DP;

 	DRM_DEBUG_KMS("\n");
@@ -1398,6 +1399,26 @@

 	if (is_edp(intel_dp))
 		DP |= DP_LINK_TRAIN_OFF;
+
+	if (!HAS_PCH_CPT(dev) && (DP & DP_PIPEB_SELECT)) {
+		/* Hardware workaround: leaving our transcoder select
+		 * set to transcoder B while it's off will prevent the
+		 * corresponding HDMI output on transcoder A.
+		 *
+		 * Combine this with another hardware workaround:
+		 * transcoder select bit can only be cleared while the
+		 * port is enabled.
+		 */
+		DP &= ~DP_PIPEB_SELECT;
+		I915_WRITE(intel_dp->output_reg, DP);
+
+		/* Changes to enable or select take place the vblank
+		 * after being written.
+		 */
+		intel_wait_for_vblank(intel_dp->base.base.dev,
+				      intel_crtc->pipe);
+	}
+
 	I915_WRITE(intel_dp->output_reg, DP & ~DP_PORT_EN);
 	POSTING_READ(intel_dp->output_reg);
 }


Nightly Version

Nightly Version

--- Common/vtkVersion.h
+++ Common/vtkVersion.h
@@ -31,7 +31,7 @@

 #include "vtkObject.h"

-#define VTK_SOURCE_VERSION "vtk version " VTK_VERSION ", vtk source $Revision: 1.1569 $, $Date: 2003-05-13 01:45:06 $ (GMT)"
+#define VTK_SOURCE_VERSION "vtk version " VTK_VERSION ", vtk source $Revision: 1.1570 $, $Date: 2003-05-14 01:45:05 $ (GMT)"

 class VTK_COMMON_EXPORT vtkVersion : public vtkObject


drm/i915: Update DDL only for current CRTC

Instead of looping through all CRTCs, update DDL for current CRTC for which
watermark is being updated.
CHV is confirmed to have precision of 32/64 which is same as VLV.

Reviewed-by: Imre Deak <fbd5edba1988036c8923f0cca0cce6ac4811db29@intel.com>
Signed-off-by: Gajanan Bhat <7e8c1a2cb238d4102a7728cfb267441342b0859a@intel.com>
Signed-off-by: Daniel Vetter <c1b6782c4af8f0673da8923a0702a1832e5940f4@ffwll.ch>

--- drivers/gpu/drm/i915/intel_pm.c
+++ drivers/gpu/drm/i915/intel_pm.c
@@ -1310,24 +1310,17 @@
  * latency value.
  */

-static void vlv_update_drain_latency(struct drm_device *dev)
-{
-	struct drm_i915_private *dev_priv = dev->dev_private;
-	enum pipe pipe;
-
-	for_each_pipe(pipe) {
-		int plane_prec, plane_dl;
-		int cursor_prec, cursor_dl;
-		int plane_prec_mult, cursor_prec_mult;
-
-		if (!vlv_compute_drain_latency(dev, pipe, &plane_prec_mult, &plane_dl,
-					       &cursor_prec_mult, &cursor_dl))
-			continue;
-
-		/*
-		 * FIXME CHV spec still lists 16 and 32 as the precision
-		 * values. Need to figure out if spec is outdated or what.
-		 */
+static void vlv_update_drain_latency(struct drm_crtc *crtc)
+{
+	struct drm_device *dev = crtc->dev;
+	struct drm_i915_private *dev_priv = dev->dev_private;
+	enum pipe pipe = to_intel_crtc(crtc)->pipe;
+	int plane_prec, plane_dl;
+	int cursor_prec, cursor_dl;
+	int plane_prec_mult, cursor_prec_mult;
+
+	if (vlv_compute_drain_latency(dev, pipe, &plane_prec_mult, &plane_dl,
+				      &cursor_prec_mult, &cursor_dl)) {
 		cursor_prec = (cursor_prec_mult == DRAIN_LATENCY_PRECISION_64) ?
 			DDL_CURSOR_PRECISION_64 : DDL_CURSOR_PRECISION_32;
 		plane_prec = (plane_prec_mult == DRAIN_LATENCY_PRECISION_64) ?
@@ -1352,7 +1345,7 @@
 	unsigned int enabled = 0;
 	bool cxsr_enabled;

-	vlv_update_drain_latency(dev);
+	vlv_update_drain_latency(crtc);

 	if (g4x_compute_wm0(dev, PIPE_A,
 			    &valleyview_wm_info, latency_ns,


STYLE: Nightly Version update

STYLE: Nightly Version update

--- Common/vtkVersion.h
+++ Common/vtkVersion.h
@@ -28,7 +28,7 @@

 #include "vtkObject.h"

-#define VTK_SOURCE_VERSION "vtk version " VTK_VERSION ", vtk source $Revision: 1.2444 $, $Date: 2006-05-21 14:27:31 $ (GMT)"
+#define VTK_SOURCE_VERSION "vtk version " VTK_VERSION ", vtk source $Revision: 1.2445 $, $Date: 2006-05-23 11:40:58 $ (GMT)"

 class VTK_COMMON_EXPORT vtkVersion : public vtkObject


First version of SGA

First version of SGA

error: pathspec 'StudentAverage.c' did not match any file(s) known to git

--- StudentAverage.c
+++ StudentAverage.c
@@ -0,0 +1,128 @@
+/*
+*	@@@@@@@@  @@@@@@@@  @@@@@@@    @@@@@@              @@@@@@@
+*	@@@@@@@@  @@@@@@@@  @@@@@@@@  @@@@@@@@             @@@@@@@
+*	     @@!  @@!       @@!  @@@  @@!  @@@               @@!
+*	    !@!   !@!       !@!  @!@  !@!  @!@               !@!
+*	   @!!    @!!!:!    @!@!!@!   @!@  !@!  @!@!@!@!@    @!!
+*	  !!!     !!!!!:    !!@!@!    !@!  !!!  !!!@!@!!!    !!!
+*	 !!:      !!:       !!: :!!   !!:  !!!               !!:
+*	:!:       :!:       :!:  !:!  :!:  !:!               :!:
+*	 :: ::::   :: ::::  ::   :::  ::::: ::                ::
+*	: :: : :  : :: ::    :   : :   : :  :                 :
+*
+* File: StudentAverage.c
+*
+* Course:  Course name here
+* Project: Project name here
+*
+* Project Description: Students Grade Average with use Memory Allocation
+*
+* Author:  Zero-T
+* Number:  Your number.
+*
+* Created on August 31, 2013 | 12:07:04 pm EEST
+*/
+#include <stdio.h>
+#include <string.h> /* for strcmp, */
+#include <stdlib.h> /* dynamic memory allocation */
+
+void
+usage(void);
+
+void
+version(void);
+
+int
+calculateGradeAverage(int *, int);
+
+int
+main(int argc, char const *argv[])
+{
+	int i;
+	int *studentsGrade;
+
+	if (argc == 1)
+	{
+		/* bad usage */
+			usage();
+	}
+	else if (argc == 2 )
+	{
+		if(strcmp(argv[1],"-v") == 0)
+		{
+			/* Print Program version. */
+			version();
+		}
+		else if (strcmp(argv[1],"-d") == 0)
+		{
+			/* Print Author information. */
+			printf("Not supported yet.\n");
+			usage();
+		}
+		else /* bad usage */
+		{
+			usage();
+		}
+	}
+	else
+	{
+		if (strcmp(argv[1],"-s") != 0)
+		{
+			/* bad usage */
+			usage();
+		}
+		else
+		{
+			studentsGrade = (int *)calloc( (argc-2), sizeof(int) );
+			for ( i = 0; i < argc-2; ++i)
+			{
+				studentsGrade[i] = atoi(argv[i+2]);
+			}
+		}
+	}
+
+	printf("Students grade average is %d.\n",calculateGradeAverage(studentsGrade,argc-2));
+
+
+	free(studentsGrade);
+	return 0;
+}
+void
+usage(void)
+{
+	printf("Usage: ./StudentAverage [OPTION] [INPUT]\n"
+			"\n"
+			"\tOPTION: -v --- Show version.\n"
+					  "\t\t-d --- Show Author name and sirname.\n"
+					  "\t\t-s --- Calculate students average grade.\n"
+
+			"\tINPUT: Only accept when you use [-s] option.\n");
+	exit(0);
+}
+
+int
+calculateGradeAverage(int *studentsGrade, int numbOfStu)
+{
+	int i = 0;
+	int sum = 0;
+
+
+	while(i < numbOfStu)
+	{
+		sum += studentsGrade[i];
+		++i;
+	}
+
+	return sum/numbOfStu;
+}
+
+void
+version(void)
+{
+	printf("\n\n\t\t\tStudents Grade Average Program\n"
+			"\t\t\t\tVersion: 1.000\n"
+			"\t\t\t      Copyright (c) 2013\n"
+
+		);
+	exit(0);
+}


drm/i915: drop DPFLIPSTAT enables on VLV v3

We don't need this until we start using the wait event commands.

v2: move to i915_irq.c (Jesse)
    drop unneeded sprite flip done enables (Ville)
v3: drop the DPFLIPSTAT enables altogether (Ville)

Signed-off-by: Jesse Barnes <bc7add126c2dbb8382bf1c28ac262b9363a32706@virtuousgeek.org>
Signed-off-by: Daniel Vetter <c1b6782c4af8f0673da8923a0702a1832e5940f4@ffwll.ch>

--- drivers/gpu/drm/i915/intel_pm.c
+++ drivers/gpu/drm/i915/intel_pm.c
@@ -3986,19 +3986,6 @@
 		   _MASKED_BIT_ENABLE(PIXEL_SUBSPAN_COLLECT_OPT_DISABLE));

 	/*
-	 * On ValleyView, the GUnit needs to signal the GT
-	 * when flip and other events complete.  So enable
-	 * all the GUnit->GT interrupts here
-	 */
-	I915_WRITE(VLV_DPFLIPSTAT, PIPEB_LINE_COMPARE_INT_EN |
-		   PIPEB_HLINE_INT_EN | PIPEB_VBLANK_INT_EN |
-		   SPRITED_FLIPDONE_INT_EN | SPRITEC_FLIPDONE_INT_EN |
-		   PLANEB_FLIPDONE_INT_EN | PIPEA_LINE_COMPARE_INT_EN |
-		   PIPEA_HLINE_INT_EN | PIPEA_VBLANK_INT_EN |
-		   SPRITEB_FLIPDONE_INT_EN | SPRITEA_FLIPDONE_INT_EN |
-		   PLANEA_FLIPDONE_INT_EN);
-
-	/*
 	 * WaDisableVLVClockGating_VBIIssue
 	 * Disable clock gating on th GCFG unit to prevent a delay
 	 * in the reporting of vblank events.


STYLE: Nightly Version update

STYLE: Nightly Version update

--- Common/vtkVersion.h
+++ Common/vtkVersion.h
@@ -28,7 +28,7 @@

 #include "vtkObject.h"

-#define VTK_SOURCE_VERSION "vtk version " VTK_VERSION ", vtk source $Revision: 1.2640 $, $Date: 2006-12-30 08:24:27 $ (GMT)"
+#define VTK_SOURCE_VERSION "vtk version " VTK_VERSION ", vtk source $Revision: 1.2641 $, $Date: 2006-12-31 08:29:33 $ (GMT)"

 class VTK_COMMON_EXPORT vtkVersion : public vtkObject


drm/i915: Document that we are implementing WaDisableBackToBackFlipFix

For the next person that checks these kind of things, without having to
dig up the register definition.

Signed-off-by: Damien Lespiau <64bd3cb94f359c1a3ce68dae5e26b40578526277@intel.com>
Reviewed-by: Paulo Zanoni <cc0e04a2103c45cd195651d976f79813d0f66bdf@intel.com>
Signed-off-by: Daniel Vetter <c1b6782c4af8f0673da8923a0702a1832e5940f4@ffwll.ch>

--- drivers/gpu/drm/i915/intel_pm.c
+++ drivers/gpu/drm/i915/intel_pm.c
@@ -3536,6 +3536,7 @@
 	I915_WRITE(_3D_CHICKEN3,
 		   _MASKED_BIT_ENABLE(_3D_CHICKEN_SF_DISABLE_OBJEND_CULL));

+	/* WaDisableBackToBackFlipFix */
 	I915_WRITE(IVB_CHICKEN3,
 		   CHICKEN3_DGMG_REQ_OUT_FIX_DISABLE |
 		   CHICKEN3_DGMG_DONE_FIX_DISABLE);
@@ -3616,6 +3617,7 @@
 	I915_WRITE(_3D_CHICKEN3,
 		   _MASKED_BIT_ENABLE(_3D_CHICKEN_SF_DISABLE_OBJEND_CULL));

+	/* WaDisableBackToBackFlipFix */
 	I915_WRITE(IVB_CHICKEN3,
 		   CHICKEN3_DGMG_REQ_OUT_FIX_DISABLE |
 		   CHICKEN3_DGMG_DONE_FIX_DISABLE);


STYLE: Nightly Version update

STYLE: Nightly Version update

--- Common/vtkVersion.h
+++ Common/vtkVersion.h
@@ -28,7 +28,7 @@

 #include "vtkObject.h"

-#define VTK_SOURCE_VERSION "vtk version " VTK_VERSION ", vtk source $Revision: 1.2299 $, $Date: 2005-12-23 06:09:55 $ (GMT)"
+#define VTK_SOURCE_VERSION "vtk version " VTK_VERSION ", vtk source $Revision: 1.2300 $, $Date: 2005-12-24 06:03:59 $ (GMT)"

 class VTK_COMMON_EXPORT vtkVersion : public vtkObject


[SCSI] mptfusion: Proper error handling is added after mpt_config timeout

Added proper error handling after mpt_config.
Now check of MPI_IOCSTATUS_CONFIG_INVALID_PAGE is added.
If error is MPI_IOCSTATUS_CONFIG_INVALID_PAGE, driver will return -ENODEV.

Signed-off-by: Kashyap Desai <5c76991d5e6936969ae71bb8255acf4ae2e4f8da@lsi.com>
Signed-off-by: James Bottomley <407b36959ca09543ccda8f8e06721c791bc53435@suse.de>

--- drivers/message/fusion/mptsas.c
+++ drivers/message/fusion/mptsas.c
@@ -2523,6 +2523,12 @@
 	cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT;

 	error = mpt_config(ioc, &cfg);
+
+	if (error == MPI_IOCSTATUS_CONFIG_INVALID_PAGE) {
+		error = -ENODEV;
+		goto out_free_consistent;
+	}
+
 	if (error)
 		goto out_free_consistent;

@@ -2599,13 +2605,13 @@
 	cfg.action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT;

 	error = mpt_config(ioc, &cfg);
+	if (error == MPI_IOCSTATUS_CONFIG_INVALID_PAGE) {
+		error = -ENODEV;
+		goto out_free_consistent;
+	}
+
 	if (error)
 		goto out_free_consistent;
-
-	if (!buffer->NumPhys) {
-		error = -ENODEV;
-		goto out_free_consistent;
-	}

 	/* save config data */
 	port_info->num_phys = (buffer->NumPhys) ? buffer->NumPhys : 1;
@@ -2682,7 +2688,7 @@

 	if (error == MPI_IOCSTATUS_CONFIG_INVALID_PAGE) {
 		error = -ENODEV;
-		goto out;
+		goto out_free_consistent;
 	}

 	if (error)


Nightly Version

Nightly Version

--- Common/vtkVersion.h
+++ Common/vtkVersion.h
@@ -28,7 +28,7 @@

 #include "vtkObject.h"

-#define VTK_SOURCE_VERSION "vtk version " VTK_VERSION ", vtk source $Revision: 1.1878 $, $Date: 2004-05-30 01:46:22 $ (GMT)"
+#define VTK_SOURCE_VERSION "vtk version " VTK_VERSION ", vtk source $Revision: 1.1879 $, $Date: 2004-05-31 01:46:27 $ (GMT)"

 class VTK_COMMON_EXPORT vtkVersion : public vtkObject


fix integer overflow warning in i2o_block

drivers/message/i2o/i2o_block.c: In function 'i2o_block_transfer':
drivers/message/i2o/i2o_block.c:837: warning: integer overflow in expression

msg->u.head[1] = cpu_to_le32(I2O_CMD_PRIVATE << 24 | HOST_TID << 12 | tid);
and I2O_CMD_PRIVATE is defined as 0xFF.  This gets "0xFF0100 | tid" and fits
into 32-bit unsigned but not into 32-bit signed integer properly.  Target
value is defined as u32 so the claculation does not fit during computation.

Change local variable tid to u32 so the whole expression is of u32 type and
fits well into u32 result.

Signed-off-by: Meelis Roos <c1c0388d3cdd4295e8ad201acc4082e735b9ca96@linux.ee>
Cc: "Salyzyn, Mark" <f102f7c45a3b9883a55ddd80ccff5c31a6148896@adaptec.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

--- drivers/message/i2o/i2o_block.c
+++ drivers/message/i2o/i2o_block.c
@@ -744,7 +744,7 @@
 {
 	struct i2o_block_device *dev = req->rq_disk->private_data;
 	struct i2o_controller *c;
-	int tid = dev->i2o_dev->lct_data.tid;
+	u32 tid = dev->i2o_dev->lct_data.tid;
 	struct i2o_message *msg;
 	u32 *mptr;
 	struct i2o_block_request *ireq = req->special;


mtd: spear_smi: Add clk_{un}prepare() support

clk_{un}prepare is mandatory for platforms using common clock framework. Since
this driver is used by SPEAr platform, which supports common clock framework,
add clk_{un}prepare() support for it.

Signed-off-by: Viresh Kumar <5ff32272b3d9f86512eddc8e0af523fc6f7924e5@st.com>
Acked-by: Linus Walleij <9cd9d802d23c0ed5e224beabf4ae4a5c478746ef@linaro.org>
Signed-off-by: Artem Bityutskiy <2f96f8cd3e2780a209d0ab27d1b44624d0019d3f@linux.intel.com>
Signed-off-by: David Woodhouse <b460d66aaf00c296a3db1c1d9eeafc081d5f7d70@intel.com>

--- drivers/mtd/devices/spear_smi.c
+++ drivers/mtd/devices/spear_smi.c
@@ -990,9 +990,9 @@
 		goto err_clk;
 	}

-	ret = clk_enable(dev->clk);
+	ret = clk_prepare_enable(dev->clk);
 	if (ret)
-		goto err_clk_enable;
+		goto err_clk_prepare_enable;

 	ret = request_irq(irq, spear_smi_int_handler, 0, pdev->name, dev);
 	if (ret) {
@@ -1020,8 +1020,8 @@
 	free_irq(irq, dev);
 	platform_set_drvdata(pdev, NULL);
 err_irq:
-	clk_disable(dev->clk);
-err_clk_enable:
+	clk_disable_unprepare(dev->clk);
+err_clk_prepare_enable:
 	clk_put(dev->clk);
 err_clk:
 	iounmap(dev->io_base);
@@ -1074,7 +1074,7 @@
 	irq = platform_get_irq(pdev, 0);
 	free_irq(irq, dev);

-	clk_disable(dev->clk);
+	clk_disable_unprepare(dev->clk);
 	clk_put(dev->clk);
 	iounmap(dev->io_base);
 	kfree(dev);
@@ -1091,7 +1091,7 @@
 	struct spear_smi *dev = platform_get_drvdata(pdev);

 	if (dev && dev->clk)
-		clk_disable(dev->clk);
+		clk_disable_unprepare(dev->clk);

 	return 0;
 }
@@ -1102,7 +1102,7 @@
 	int ret = -EPERM;

 	if (dev && dev->clk)
-		ret = clk_enable(dev->clk);
+		ret = clk_prepare_enable(dev->clk);

 	if (!ret)
 		spear_smi_hw_init(dev);


bonding: allow all slave speeds

bonding: allow all slave speeds

No need to check for 10, 100, 1000, 10000 explicitly. Just make this
generic and check for invalid values only (similar check is in ethtool
userspace app). This enables correct speed handling for slave devices
with "nonstandard" speeds.

Signed-off-by: Jiri Pirko <fa978af6b66b63204eae0f383d59a9477a8acf5e@redhat.com>
Reviewed-by: Nicolas de Pesloüan <a3380c81fd3de0cead1f530bf66f35d8fd661ef2@free.fr>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- drivers/net/bonding/bond_main.c
+++ drivers/net/bonding/bond_main.c
@@ -629,15 +629,8 @@
 		return -1;

 	slave_speed = ethtool_cmd_speed(&etool);
-	switch (slave_speed) {
-	case SPEED_10:
-	case SPEED_100:
-	case SPEED_1000:
-	case SPEED_10000:
-		break;
-	default:
+	if (slave_speed == 0 || slave_speed == ((__u32) -1))
 		return -1;
-	}

 	switch (etool.duplex) {
 	case DUPLEX_FULL:


fix warnings in ddBotImageQueue

fix warnings in ddBotImageQueue

--- src/app/ddBotImageQueue.h
+++ src/app/ddBotImageQueue.h
@@ -235,12 +235,9 @@
         int px = static_cast<int>(pix[0]);
         int py = static_cast<int>(pix[1]);

-        if (px < 0 || px >= w || py < 0 || py >= h)
+        if (px >= 0 && px < w && py >= 0 && py < h)
         {
           printf("error, pixel index out of bounds: %d %d\n", px, py);
-        }
-        else
-        {
           size_t bufIndex = w*py*3 + px*3;
           rgb->SetComponent(i, 0, cameraData.mImageBuffer[bufIndex + 0]);
           rgb->SetComponent(i, 1, cameraData.mImageBuffer[bufIndex + 1]);
@@ -261,7 +258,7 @@
     mHeadLeft.mImageMessage = message.images[0];
     mHeadLeft.mImageBuffer.clear();
     this->getTransform("local", mHeadLeft.mCoordFrame, mHeadLeft.mLocalToCamera, mHeadLeft.mImageMessage.utime);
-    printf("got image %s: %d %d\n", mHeadLeft.mName.c_str(), mHeadLeft.mImageMessage.width, mHeadLeft.mImageMessage.height);
+    //printf("got image %s: %d %d\n", mHeadLeft.mName.c_str(), mHeadLeft.mImageMessage.width, mHeadLeft.mImageMessage.height);
   }

   void onChestLeft(const QByteArray& data)
@@ -269,7 +266,7 @@
     mChestLeft.mImageMessage.decode(data.data(), 0, data.size());
     mChestLeft.mImageBuffer.clear();
     this->getTransform("local", mChestLeft.mCoordFrame, mChestLeft.mLocalToCamera, mChestLeft.mImageMessage.utime);
-    printf("got image %s: %d %d\n", mChestLeft.mName.c_str(), mChestLeft.mImageMessage.width, mChestLeft.mImageMessage.height);
+    //printf("got image %s: %d %d\n", mChestLeft.mName.c_str(), mChestLeft.mImageMessage.width, mChestLeft.mImageMessage.height);
   }

   void onChestRight(const QByteArray& data)
@@ -277,7 +274,7 @@
     mChestRight.mImageMessage.decode(data.data(), 0, data.size());
     mChestRight.mImageBuffer.clear();
     this->getTransform("local", mChestRight.mCoordFrame, mChestRight.mLocalToCamera, mChestRight.mImageMessage.utime);
-    printf("got image %s: %d %d\n", mChestRight.mName.c_str(), mChestRight.mImageMessage.width, mChestRight.mImageMessage.height);
+    //printf("got image %s: %d %d\n", mChestRight.mName.c_str(), mChestRight.mImageMessage.width, mChestRight.mImageMessage.height);
   }

   vtkSmartPointer<vtkImageData> toVtkImage(CameraData& cameraData)
@@ -312,6 +309,8 @@
     unsigned char* outPtr = static_cast<unsigned char*>(image->GetScalarPointer(0, 0, 0));

     std::copy(cameraData.mImageBuffer.begin(), cameraData.mImageBuffer.end(), outPtr);
+
+    return image;
   }

 protected:


net/mlx5: allow copy from one tag to another

The modify field implementation in mlx5 driver has a check to
prevent a copy from a field to the same field. But the level
is not taken into account which prevents a copy from different
tags. Check the level and allow a copy from one tag to another.

Fixes: 641dbe4fb05 ("net/mlx5: support modify field flow action")
Cc: stable@dpdk.org

Signed-off-by: Alexander Kozyrev <a103889f73a7af0066377584f3d0eb32f9983c2e@nvidia.com>
Acked-by: Viacheslav Ovsiienko <5b8db9bb93a9a9aefc8828f79604d1fe963a53dd@nvidia.com>

--- drivers/net/mlx5/mlx5_flow_dv.c
+++ drivers/net/mlx5/mlx5_flow_dv.c
@@ -4788,8 +4788,10 @@
 					"inner header fields modification"
 					" is not supported");
 	}
-	if (action_modify_field->dst.field ==
-	    action_modify_field->src.field)
+	if ((action_modify_field->dst.field ==
+	     action_modify_field->src.field) &&
+	    (action_modify_field->dst.level ==
+	     action_modify_field->src.level))
 		return rte_flow_error_set(error, EINVAL,
 				RTE_FLOW_ERROR_TYPE_ACTION, action,
 				"source and destination fields"


Fix bigd

Fix bigd

--- core/lib/bigd/bigdtypes.h
+++ core/lib/bigd/bigdtypes.h
@@ -46,10 +46,11 @@
 	#include <stdint.h>
 #elif defined(HAVE_SYS_TYPES)
 	#include <sys/types.h>
-#else
-	#define uint32_t unsigned long
-	#define uint16_t unsigned short
-	#define uint8_t unsigned char
+#else
+#include <stdint.h>
+	//#define uint32_t unsigned long
+	//#define uint16_t unsigned short
+	//#define uint8_t unsigned char
 #endif	/* HAVE_C99INCLUDES */
 #endif	/* EXACT_INTS_DEFINED_ */


minor text fix

minor text fix

--- src/apps/uclient/mainuclient.c
+++ src/apps/uclient/mainuclient.c
@@ -119,7 +119,7 @@
   "		Without this option, by default, SHA1 is used.\n"
   "	-M	ICE Mobility engaged.\n"
   "	-I	Do not set permissions on TURN relay endpoints\n"
-  "     	(for testing the non-standard server relay functionality).\n"
+  "		(for testing the non-standard server relay functionality).\n"
   "	-G	Generate extra requests (create permissions, channel bind).\n"
   "Options:\n"
   "	-l	Message length (Default: 100 Bytes).\n"


myr10ge: again fix lro_gen_skb() alignment

Add LRO alignment initially committed in
621544eb8c3beaa859c75850f816dd9b056a00a3 ("[LRO]: fix lro_gen_skb()
alignment") and removed in 0dcffac1a329be69bab0ac604bf7283737108e68
("myri10ge: add multislices support") during conversion to
multi-slice.

Signed-off-by: Stanislaw Gruszka <1542dc81552e668e197a396f69e655c1621c300d@redhat.com>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- drivers/net/myri10ge/myri10ge.c
+++ drivers/net/myri10ge/myri10ge.c
@@ -2447,6 +2447,7 @@
 		lro_mgr->lro_arr = ss->rx_done.lro_desc;
 		lro_mgr->get_frag_header = myri10ge_get_frag_header;
 		lro_mgr->max_aggr = myri10ge_lro_max_pkts;
+		lro_mgr->frag_align_pad = 2;
 		if (lro_mgr->max_aggr > MAX_SKB_FRAGS)
 			lro_mgr->max_aggr = MAX_SKB_FRAGS;


added fix for edison Eigen compiler warnings

--- packages/nimble/inst/include/nimble/NimArrBase.h
+++ packages/nimble/inst/include/nimble/NimArrBase.h
@@ -1,5 +1,12 @@
 #ifndef __NIMARRBASE
 #define __NIMARRBASE
+
+/* fix to avoid warnings exemplified by edison.nersc.gov SUSE Linux - Github issue #214 */
+#if defined GNUC && GNUC>=6
+#pragma GCC diagnostic ignored "-Wignored-attributes"
+#endif
+
+
 #include <vector>
 #include <string>
 #include <cstring>


gcc-bug: Add more info about how overflow check works.

--- gcc-bug.c
+++ gcc-bug.c
@@ -28,6 +28,12 @@
 ...
 32-bit signed integer is promoted to signed long. Then overflow can happen.

+GCC: How it works:
+rsi register are multiplied by rax.
+Result are stored in rax. Then aritmethic right shift happen on rsi and we gain
+most significant bit. Then rsi are compared with rdx (which contain 0) and if result
+aren't equal then it call abort.
+
 clang on fedora 20:
 clang version 3.4 (tags/RELEASE_34/final)
 Target: x86_64-redhat-linux-gnu
@@ -47,7 +53,12 @@
    0x00000000004005bf <+63>:	lea    0x400690,%rdi
 ...

-Clang uses 32-bit signet arithmetics
+Clang uses 32-bit signet arithmetics.
+
+Clang: How it works.
+eax and ecx (both are 32 bit registers) are multiplied and 1 is set to dl if
+overflow flag are set.
+It's really better to understand than GCC code.

 NOTE (from wiki):
 UD2 Undefined Instruction


performance tool: change unit from 'ns' to 'unit of time'

Since the rohc_test_performance tool uses clock_gettime(), the measures are
not performed in seconds or nanoseconds anymore. The unit of time is arbitrary.


Add instructions for ARM Kernel modules.

--- src/arch/relic_arch_arm.c
+++ src/arch/relic_arch_arm.c
@@ -43,8 +43,17 @@

 void arch_init(void) {
 #if __ARM_ARCH_6J__ || __ARM_ARCH_6ZK__
+	/*
+	 * This relies on a Kernel module described in:
+	 * http://blog.regehr.org/archives/794
+	 */
 	asm("mcr p15, 0, %0, c15, c12, 0" : : "r" (1));
 #elif __ARM_ARCH_7A__
+	/*
+	 * This relies on a Kernel module described in:
+	 * http://stackoverflow.com/questions/3247373/
+	 * how-to-measure-program-execution-time-in-arm-cortex-a8-processor
+	 */
 	asm("mcr p15, 0, %0, c9, c12, 0" :: "r"(17));
 	asm("mcr p15, 0, %0, c9, c12, 1" :: "r"(0x8000000f));
 	asm("mcr p15, 0, %0, c9, c12, 3" :: "r"(0x8000000f));


myri10ge: Serverworks HT2100 provides aligned PCIe completion

[PATCH 1/4] myri10ge: Serverworks HT2100 provides aligned PCIe completion

Use the regular firmware on Serverworks HT2100 PCIe ports since this
chipset provides aligned PCIe completion.

Signed-off-by: Brice Goglin <a6504fc3011a6983be6bf4d915860368a7353a38@myri.com>
Signed-off-by: Jeff Garzik <f3e731dfa293c7a83119d8aacfa41b5d2d780be9@garzik.org>

--- drivers/net/myri10ge/myri10ge.c
+++ drivers/net/myri10ge/myri10ge.c
@@ -2483,6 +2483,8 @@

 #define PCI_DEVICE_ID_INTEL_E5000_PCIE23 0x25f7
 #define PCI_DEVICE_ID_INTEL_E5000_PCIE47 0x25fa
+#define PCI_DEVICE_ID_SERVERWORKS_HT2100_PCIE_FIRST 0x140
+#define PCI_DEVICE_ID_SERVERWORKS_HT2100_PCIE_LAST 0x142

 static void myri10ge_select_firmware(struct myri10ge_priv *mgp)
 {
@@ -2514,6 +2516,12 @@
 			   ((bridge->vendor == PCI_VENDOR_ID_SERVERWORKS
 			     && bridge->device ==
 			     PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE)
+			    /* ServerWorks HT2100 */
+			    || (bridge->vendor == PCI_VENDOR_ID_SERVERWORKS
+				&& bridge->device >=
+				PCI_DEVICE_ID_SERVERWORKS_HT2100_PCIE_FIRST
+				&& bridge->device <=
+				PCI_DEVICE_ID_SERVERWORKS_HT2100_PCIE_LAST)
 			    /* All Intel E5000 PCIE ports */
 			    || (bridge->vendor == PCI_VENDOR_ID_INTEL
 				&& bridge->device >=


Only some whitespace formatting to save precious screen space

--- general.c
+++ general.c
@@ -31,8 +31,7 @@
 	snprintf(p, PATHLEN_MAX, "%s%s", path, HIDETAG);

 	res = lstat(p, &stbuf);
-	if (res == 0)
-		return true;
+	if (res == 0) return true;

 	return false;
 }
@@ -47,30 +46,21 @@
 	char p[PATHLEN_MAX];
 	struct stat buf;
 	int res;
-
-	if (maxroot == -1)
-		maxroot = uopt.nroots;
-
+
+	if (maxroot == -1) maxroot = uopt.nroots;
+
 	for (i = 0; i <= maxroot; i++) {
-		snprintf(p, PATHLEN_MAX, "%s%s%s",
-		         uopt.roots[i].path, path, HIDETAG);
-
+		snprintf(p, PATHLEN_MAX, "%s%s%s", uopt.roots[i].path, path, HIDETAG);
+
 		res = lstat(p, &buf);
-		if (res == -1)
-			continue;
-
+		if (res == -1) continue;
+
 		switch (buf.st_mode & S_IFMT) {
-
-			case S_IFDIR:
-				rmdir(p);
-				break;
-
-			default:
-				unlink(p);
-				break;
+			case S_IFDIR: rmdir(p); break;
+			default: unlink(p); break;
 		}
 	}
-
+
 	return 0;
 }

@@ -102,10 +92,9 @@

 	res = open(p, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);

-	if (res == -1) {
-		return res;
-	} else
-		close(res);
+	if (res == -1) return res;
+
+	close(res);

 	return 0;
 }


[1] Added basic sanity unit tests to new Yodel format functions. [2] All format unit tests PASS.

--- Hazer/tst/unittest-format.c
+++ Hazer/tst/unittest-format.c
@@ -200,7 +200,7 @@
     }

     {
-        int degrees = 0;
+        int32_t degrees = 0;
         uint64_t billionths = 0;
         yodel_format_hppos2degrees(397942134, 61, &degrees, &billionths);
         assert(degrees == 39);
@@ -208,7 +208,7 @@
     }

     {
-        int degrees = 0;
+        int32_t degrees = 0;
         uint64_t billionths = 0;
         yodel_format_hppos2degrees(-1051533822, -87, &degrees, &billionths);
         assert(degrees == -105);
@@ -216,10 +216,10 @@
     }

     {
-        int degrees = ~0;
-        int minutes = ~0;
-        int seconds = ~0;
-        int onehundredthousandsth = ~0;
+        uint32_t degrees = ~0;
+        uint32_t minutes = ~0;
+        uint32_t seconds = ~0;
+        uint32_t onehundredthousandsth = ~0;
         int direction = 0;
         yodel_format_hppos2position(397942134, 61, &degrees, &minutes, &seconds, &onehundredthousandsth, &direction);
         assert(degrees == 39);
@@ -230,10 +230,10 @@
     }

     {
-        int degrees = ~0;
-        int minutes = ~0;
-        int seconds = ~0;
-        int onehundredthousandsth = ~0;
+    	uint32_t degrees = ~0;
+    	uint32_t minutes = ~0;
+    	uint32_t seconds = ~0;
+    	uint32_t onehundredthousandsth = ~0;
         int direction = 0;
         yodel_format_hppos2position(-1051533822, -87, &degrees, &minutes, &seconds, &onehundredthousandsth, &direction);
         assert(degrees == 105);
@@ -246,4 +246,37 @@
          */
     }

+    {
+    	int32_t meters = ~0;
+    	uint32_t tenthousandths = ~0;
+    	yodel_format_hpalt2aaltitude(2345, 6, &meters, &tenthousandths);
+    	assert(meters == 2);
+    	assert(tenthousandths == 3456);
+    }
+
+
+    {
+    	int32_t meters = ~0;
+    	uint32_t tenthousandths = ~0;
+    	yodel_format_hpalt2aaltitude(-2345, -6, &meters, &tenthousandths);
+    	assert(meters == -2);
+    	assert(tenthousandths == 3456);
+    }
+
+    {
+    	int32_t meters = ~0;
+    	uint32_t tenthousandths = ~0;
+    	yodel_format_hpacc2accuracy(23456, &meters, &tenthousandths);
+    	assert(meters == 2);
+    	assert(tenthousandths == 3456);
+    }
+
+
+    {
+    	int32_t meters = ~0;
+    	uint32_t tenthousandths = ~0;
+    	yodel_format_hpacc2accuracy(-23456, &meters, &tenthousandths);
+    	assert(meters == -2);
+    	assert(tenthousandths == 3456);
+    }
 }


null: add virtual RSS configuration

null: add virtual RSS configuration

This implementation allows to set and read RSS configuration for null
device, and is used to validate right values propagation over the slaves,
in test units for dynamic RSS configuration for bonding.

Signed-off-by: Tomasz Kulasek <2fc2c8542a2a68801ce1aaca56eae5adf14485ae@intel.com>
Acked-by: Tetsuya Mukawa <b347a9f5840345582b30d055e1e99ac6ac7bce3c@igel.co.jp>

--- drivers/net/null/rte_eth_null.c
+++ drivers/net/null/rte_eth_null.c
@@ -37,6 +37,7 @@
 #include <rte_memcpy.h>
 #include <rte_dev.h>
 #include <rte_kvargs.h>
+#include <rte_spinlock.h>

 #include "rte_eth_null.h"

@@ -75,6 +76,17 @@

 	struct null_queue rx_null_queues[RTE_MAX_QUEUES_PER_PORT];
 	struct null_queue tx_null_queues[RTE_MAX_QUEUES_PER_PORT];
+
+	/** Bit mask of RSS offloads, the bit offset also means flow type */
+	uint64_t flow_type_rss_offloads;
+
+	rte_spinlock_t rss_lock;
+
+	uint16_t reta_size;
+	struct rte_eth_rss_reta_entry64 reta_conf[ETH_RSS_RETA_SIZE_128 /
+			RTE_RETA_GROUP_SIZE];
+
+	uint8_t rss_key[40];                /**< 40-byte hash key. */
 };

@@ -295,6 +307,8 @@
 	dev_info->max_tx_queues = RTE_DIM(internals->tx_null_queues);
 	dev_info->min_rx_bufsize = 0;
 	dev_info->pci_dev = NULL;
+	dev_info->reta_size = internals->reta_size;
+	dev_info->flow_type_rss_offloads = internals->flow_type_rss_offloads;
 }

 static void
@@ -374,6 +388,91 @@
 static int
 eth_link_update(struct rte_eth_dev *dev __rte_unused,
 		int wait_to_complete __rte_unused) { return 0; }
+
+static int
+eth_rss_reta_update(struct rte_eth_dev *dev,
+		struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size)
+{
+	int i, j;
+	struct pmd_internals *internal = dev->data->dev_private;
+
+	if (reta_size != internal->reta_size)
+		return -EINVAL;
+
+	rte_spinlock_lock(&internal->rss_lock);
+
+	/* Copy RETA table */
+	for (i = 0; i < (internal->reta_size / RTE_RETA_GROUP_SIZE); i++) {
+		internal->reta_conf[i].mask = reta_conf[i].mask;
+		for (j = 0; j < RTE_RETA_GROUP_SIZE; j++)
+			if ((reta_conf[i].mask >> j) & 0x01)
+				internal->reta_conf[i].reta[j] = reta_conf[i].reta[j];
+	}
+
+	rte_spinlock_unlock(&internal->rss_lock);
+
+	return 0;
+}
+
+static int
+eth_rss_reta_query(struct rte_eth_dev *dev,
+		struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size)
+{
+	int i, j;
+	struct pmd_internals *internal = dev->data->dev_private;
+
+	if (reta_size != internal->reta_size)
+		return -EINVAL;
+
+	rte_spinlock_lock(&internal->rss_lock);
+
+	/* Copy RETA table */
+	for (i = 0; i < (internal->reta_size / RTE_RETA_GROUP_SIZE); i++) {
+		for (j = 0; j < RTE_RETA_GROUP_SIZE; j++)
+			if ((reta_conf[i].mask >> j) & 0x01)
+				reta_conf[i].reta[j] = internal->reta_conf[i].reta[j];
+	}
+
+	rte_spinlock_unlock(&internal->rss_lock);
+
+	return 0;
+}
+
+static int
+eth_rss_hash_update(struct rte_eth_dev *dev, struct rte_eth_rss_conf *rss_conf)
+{
+	struct pmd_internals *internal = dev->data->dev_private;
+
+	rte_spinlock_lock(&internal->rss_lock);
+
+	if ((rss_conf->rss_hf & internal->flow_type_rss_offloads) != 0)
+		dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf =
+				rss_conf->rss_hf & internal->flow_type_rss_offloads;
+
+	if (rss_conf->rss_key)
+		rte_memcpy(internal->rss_key, rss_conf->rss_key, 40);
+
+	rte_spinlock_unlock(&internal->rss_lock);
+
+	return 0;
+}
+
+static int
+eth_rss_hash_conf_get(struct rte_eth_dev *dev,
+		struct rte_eth_rss_conf *rss_conf)
+{
+	struct pmd_internals *internal = dev->data->dev_private;
+
+	rte_spinlock_lock(&internal->rss_lock);
+
+	rss_conf->rss_hf = dev->data->dev_conf.rx_adv_conf.rss_conf.rss_hf;
+	if (rss_conf->rss_key)
+		rte_memcpy(rss_conf->rss_key, internal->rss_key, 40);
+
+	rte_spinlock_unlock(&internal->rss_lock);
+
+	return 0;
+}

 static const struct eth_dev_ops ops = {
 	.dev_start = eth_dev_start,
@@ -387,6 +486,10 @@
 	.link_update = eth_link_update,
 	.stats_get = eth_stats_get,
 	.stats_reset = eth_stats_reset,
+	.reta_update = eth_rss_reta_update,
+	.reta_query = eth_rss_reta_query,
+	.rss_hash_update = eth_rss_hash_update,
+	.rss_hash_conf_get = eth_rss_hash_conf_get
 };

 int
@@ -401,6 +504,13 @@
 	struct rte_pci_device *pci_dev = NULL;
 	struct pmd_internals *internals = NULL;
 	struct rte_eth_dev *eth_dev = NULL;
+
+	static const uint8_t default_rss_key[40] = {
+		0x6D, 0x5A, 0x56, 0xDA, 0x25, 0x5B, 0x0E, 0xC2, 0x41, 0x67, 0x25, 0x3D,
+		0x43, 0xA3, 0x8F, 0xB0, 0xD0, 0xCA, 0x2B, 0xCB, 0xAE, 0x7B, 0x30, 0xB4,
+		0x77, 0xCB, 0x2D, 0xA3, 0x80, 0x30, 0xF2, 0x0C, 0x6A, 0x42, 0xB7, 0x3B,
+		0xBE, 0xAC, 0x01, 0xFA
+	};

 	if (name == NULL)
 		return -EINVAL;
@@ -443,6 +553,11 @@
 	internals->packet_copy = packet_copy;
 	internals->numa_node = numa_node;

+	internals->flow_type_rss_offloads =  ETH_RSS_PROTO_MASK;
+	internals->reta_size = RTE_DIM(internals->reta_conf) * RTE_RETA_GROUP_SIZE;
+
+	rte_memcpy(internals->rss_key, default_rss_key, 40);
+
 	pci_dev->numa_node = numa_node;
 	pci_dev->driver = &rte_null_pmd.pci_drv;


OS X: Provide an accessor to retrieve the NSOpenGLPixelFormat

--- RenderSystems/GL/include/OSX/OgreOSXCocoaWindow.h
+++ RenderSystems/GL/include/OSX/OgreOSXCocoaWindow.h
@@ -66,6 +66,7 @@
 		NSView* ogreView() const { return mView; };
 		NSWindow* ogreWindow() const { return mWindow; };
 		NSOpenGLContext* nsopenGLContext() const { return mGLContext; };
+		NSOpenGLPixelFormat* nsopenGLPixelFormat() const { return mGLPixelFormat; };
 		void createWithView(OgreView *view);

 		void create(const String& name, unsigned int width, unsigned int height,


NFC: st21nfca: Fix recursive fault when doing p2p in target mode.

This patch fix a previous patch introduce by commit	0a91e8ac240a12ac3a03581deb8cd531788c63d4

It is actually fixing a double free mistake in all st21nfca_tm_* function.
We decide to return directly in case of successful execution because skb
got already freed. In st21nfca_tm_recv_dep_req it got freed by nfc_tm_data_received.

Signed-off-by: Christophe Ricard <7fc2cd33e78f60c767c0b054f476a876f109b675@st.com>
Signed-off-by: Samuel Ortiz <0ba86cb3f08bbb861958e54bd3438887adb4263c@linux.intel.com>


NFC: st21nfca: Implement stop_poll HCI hook

Send DM_DISCONNECT command to disconnect Terminal Host from the HCI network.

- The persistent states of the terminal host pipes, including registry values,
are not modifies. Therefore, there is no NVRAM update to disconnect the
terminal host.
- The terminal host RF card gates are disabled which means that there will be no event
related to card RF gates until communication has been restored.
- The terminal host RF reader request is reset so the RF reader polling for terminal
host is disabled.

To restore the communication, the terminal host can send any HCI command or event.

Signed-off-by: Christophe Ricard <7fc2cd33e78f60c767c0b054f476a876f109b675@st.com>
Signed-off-by: Samuel Ortiz <0ba86cb3f08bbb861958e54bd3438887adb4263c@linux.intel.com>

--- drivers/nfc/st21nfca/st21nfca.c
+++ drivers/nfc/st21nfca/st21nfca.c
@@ -53,6 +53,7 @@
 #define ST21NFCA_DM_PIPE_CREATED        0x02
 #define ST21NFCA_DM_PIPE_OPEN           0x04
 #define ST21NFCA_DM_RF_ACTIVE           0x80
+#define ST21NFCA_DM_DISCONNECT		0x30

 #define ST21NFCA_DM_IS_PIPE_OPEN(p) \
 	((p & 0x0f) == (ST21NFCA_DM_PIPE_CREATED | ST21NFCA_DM_PIPE_OPEN))
@@ -356,6 +357,12 @@
 	return r;
 }

+static void st21nfca_hci_stop_poll(struct nfc_hci_dev *hdev)
+{
+	nfc_hci_send_cmd(hdev, ST21NFCA_DEVICE_MGNT_GATE,
+			ST21NFCA_DM_DISCONNECT, NULL, 0, NULL);
+}
+
 static int st21nfca_get_iso14443_3_atqa(struct nfc_hci_dev *hdev, u16 *atqa)
 {
 	int r;
@@ -601,6 +608,7 @@
 	.hci_ready = st21nfca_hci_ready,
 	.xmit = st21nfca_hci_xmit,
 	.start_poll = st21nfca_hci_start_poll,
+	.stop_poll = st21nfca_hci_stop_poll,
 	.target_from_gate = st21nfca_hci_target_from_gate,
 	.im_transceive = st21nfca_hci_im_transceive,
 	.check_presence = st21nfca_hci_check_presence,


fix trace value reporting

fix trace value reporting

--- drivers/pcieportal/pcieportal.c
+++ drivers/pcieportal/pcieportal.c
@@ -292,7 +292,7 @@
                          iowrite32(trace, this_board->bar0io + (775 << 2) + 0);
                          printk("new trace=%d old trace=%d tlpseqno=%d\n",
                                 trace, old_trace, tlpseqno);
-                         err = copy_to_user((void __user *) arg, &trace, sizeof(int));
+                         err = copy_to_user((void __user *) arg, &old_trace, sizeof(int));
                 }
                 }
                 break;


init wait_queue in xxx_open, not xxx_probe

--- drivers/pcieportal/pcieportal.c
+++ drivers/pcieportal/pcieportal.c
@@ -81,7 +81,7 @@
         tBoardInfo        info; /* board identification fields */
         unsigned int      uses_msix;
         unsigned int      irq_num;
-        wait_queue_head_t intr_wq; /* used for interrupt notifications */
+        wait_queue_head_t wait_queue; /* used for interrupt notifications */
         unsigned int      activation_level; /* activation status */
         unsigned int      open_count;
 } tBoard;
@@ -105,8 +105,9 @@
 {
         tBoard *this_board = brd;

-        //printk(KERN_INFO "%s_%d: interrupt!\n", DEV_NAME, this_board->board_number);
-        wake_up_interruptible(&(this_board->intr_wq));
+        //printk(KERN_INFO "%s_%d: interrupt!\n", DEV_NAME, this_board->info.board_number);
+        printk(KERN_INFO "%s_%d: interrupt!\n", DEV_NAME, this_board->info.board_number);
+        wake_up_interruptible(&(this_board->wait_queue));
         return IRQ_HANDLED;
 }

@@ -129,6 +130,7 @@
                 printk(KERN_ERR "%s_%d: Unable to locate board\n", DEV_NAME, this_board_number);
                 return -ENXIO;
         }
+        init_waitqueue_head(&(this_board->wait_queue));
         filp->private_data = (void *) &this_board->portal[this_portal_number];
         /* increment the open file count */
         this_board->open_count += 1;
@@ -143,25 +145,27 @@
 {
         tPortal *this_portal = (tPortal *) filp->private_data;
         /* decrement the open file count */
+        init_waitqueue_head(&(this_portal->board->wait_queue));
         this_portal->board->open_count -= 1;
         //printk(KERN_INFO "%s_%d: Closed device file\n", DEV_NAME, this_board_number);
         return 0;                /* success */
 }

 /* poll operation to predict blocking of reads & writes */
-static unsigned int pcieportal_poll(struct file *filp, poll_table * wait)
+static unsigned int pcieportal_poll(struct file *filp, poll_table *poll_table)
 {
         unsigned int mask = 0;
         tPortal *this_portal = (tPortal *) filp->private_data;
         tBoard *this_board = this_portal->board;

-        //printk(KERN_INFO "%s_%d: poll function called\n", DEV_NAME, this_board->board_number);
+        //printk(KERN_INFO "%s_%d: poll function called, active %d\n", DEV_NAME, this_board->info.board_number, this_board->activation_level == BLUENOC_ACTIVE);
         if (this_board->activation_level != BLUENOC_ACTIVE)
                 return 0;
-        poll_wait(filp, &this_board->intr_wq, wait);
+        poll_wait(filp, &this_board->wait_queue, poll_table);
 	mask |= POLLIN  | POLLRDNORM; /* readable */
         //mask |= POLLOUT | POLLWRNORM; /* writable */
-        //printk(KERN_INFO "%s_%d: poll return status is %x\n", DEV_NAME, this_board->board_number, mask);
+        //printk(KERN_INFO "%s_%d: poll return status is %x\n", DEV_NAME, this_board->info.board_number, mask);
+        printk(KERN_INFO "%s_%d: poll return status is %x\n", DEV_NAME, this_board->info.board_number, mask);
         return mask;
 }

@@ -382,7 +386,6 @@
         this_board = &board_map[board_number];
         printk(KERN_INFO "%s: board_number = %d\n", DEV_NAME, board_number);
         memset(this_board, 0, sizeof(tBoard));
-        init_waitqueue_head(&(this_board->intr_wq));
         this_board->info.board_number = board_number;
         this_board->pci_dev = dev;
         /* enable the PCI device */


pinctrl: sunxi: Fix incorrect NULL check

*map should be tested for NULL instead of map as kmalloc pointer
is assigned to it. This also fixes a potential null pointer dereference
bug later in the code.

Signed-off-by: Sachin Kamat <1c3b1584a6008857f36c03c58f657c0fc16fc09e@linaro.org>
Acked-by: Maxime Ripard <2d324f4ca95610bde432fa2af2f28cd21110687d@free-electrons.com>
Signed-off-by: Linus Walleij <9cd9d802d23c0ed5e224beabf4ae4a5c478746ef@linaro.org>

--- drivers/pinctrl/pinctrl-sunxi.c
+++ drivers/pinctrl/pinctrl-sunxi.c
@@ -175,7 +175,7 @@
 	}

 	*map = kmalloc(nmaps * sizeof(struct pinctrl_map), GFP_KERNEL);
-	if (!map)
+	if (!*map)
 		return -ENOMEM;

 	of_property_for_each_string(node, "allwinner,pins", prop, group) {


asus-wmi: fix section mismatch

asus-wmi: fix section mismatch

Signed-off-by: Corentin Chary <4153b5fcec9d8639b77e759711dc8338f0db8708@gmail.com>
Signed-off-by: Matthew Garrett <4cf8d479716eba9bc68e0146d95320fcb138b96b@redhat.com>

--- drivers/platform/x86/asus-wmi.c
+++ drivers/platform/x86/asus-wmi.c
@@ -1712,7 +1712,7 @@

 static bool used;

-int asus_wmi_register_driver(struct asus_wmi_driver *driver)
+int __init_or_module asus_wmi_register_driver(struct asus_wmi_driver *driver)
 {
 	struct platform_driver *platform_driver;
 	struct platform_device *platform_device;


Adds: LinearSearch.c

Adds: LinearSearch.c

error: pathspec 'Searching_Algorithms/Linear_Search/LinearSearch.c' did not match any file(s) known to git

--- Searching_Algorithms/Linear_Search/LinearSearch.c
+++ Searching_Algorithms/Linear_Search/LinearSearch.c
@@ -0,0 +1,48 @@
+/*
+To search for an item in an array using linear search
+Written by: Joshua D'Cunha
+Written on 25/10/2016
+*/
+
+main()
+{
+    int n; /*Number of elements in the array*/
+    int i; /*Looping variable*/
+    int item; /*Item to be searched*/
+
+    do /*Asks for input till input is correct*/
+    {
+        printf("Enter the number of elements\n");
+        scanf("%d",&n);
+    }
+    while (n<1);
+
+    int arr[n]; /*Array with 'n' elements*/
+
+    for (i=0;i<n;i++) /*Asks for input for each element of the array*/
+    {
+        printf("\nEnter the element\n");
+        scanf("%d",&arr[i]);
+    }
+
+    printf("\nArray is: {");
+    for (i=0;i<n;i++)
+        printf(" %d ",arr[i]);
+    printf("}\n");
+
+    printf("\nEnter the item to be searched\n");
+    scanf("%d",&item);
+
+    for (i=0;i<n;i++)
+    {
+        if (arr[i]==item)
+        {
+            printf("\n%d found at position %d\n",item,i+1);
+            break;
+        }
+    }
+
+    if (i==n)
+        printf("\n%d not found!\n",item);
+}
+