FIX: Use the NPY_TIME_T macro everywhere

Previously, two (critical) parts of the code used `time_t` instead of
`NPY_TIME_T`. Due to the fact, that most of the time `NPY_TIME_T` was equal to
`time_t`, this bug didn't show up. But in mingw, `NPY_TIME_T` is actually equal
to `__time64_t` and then this causes 64 bit integers to be cast into 32 bit
integers (thus becoming negative), which causes localtime() to fail in mingw.

Fixes gh-568.

--- numpy/core/src/multiarray/datetime_strings.c
+++ numpy/core/src/multiarray/datetime_strings.c
@@ -189,7 +189,7 @@
      * we drop the seconds value from the npy_datetimestruct, everything
      * is ok for this operation.
      */
-    rawtime = (time_t)get_datetimestruct_days(out_dts_local) * 24 * 60 * 60;
+    rawtime = (NPY_TIME_T)get_datetimestruct_days(out_dts_local) * 24 * 60 * 60;
     rawtime += dts_utc->hour * 60 * 60;
     rawtime += dts_utc->min * 60;

@@ -207,7 +207,7 @@

     /* Extract the timezone offset that was applied */
     rawtime /= 60;
-    localrawtime = (time_t)get_datetimestruct_days(out_dts_local) * 24 * 60;
+    localrawtime = (NPY_TIME_T)get_datetimestruct_days(out_dts_local) * 24 * 60;
     localrawtime += out_dts_local->hour * 60;
     localrawtime += out_dts_local->min;


fix argument type error on wcwidth function

since the correct declaration was not visible, and since the
representation of the types wchar_t and wint_t always match, a
compiler would have to go out of its way to make this bug manifest,
but better to fix it anyway.


drivers: bluetooth: rpmsg_nrf53: use new DT API

Use DT_CHOSEN() to access the chosen node.

Signed-off-by: Martí Bolívar <9d90ac4c7bf6a305f6bfd81a23c7859bc883380e@nordicsemi.no>

--- drivers/bluetooth/hci/rpmsg_nrf53.c
+++ drivers/bluetooth/hci/rpmsg_nrf53.c
@@ -29,7 +29,10 @@

 /* Configuration defines */

-#define SHM_START_ADDR      (DT_IPC_SHM_BASE_ADDRESS + 0x400)
+#define SHM_NODE            DT_CHOSEN(zephyr_ipc_shm)
+#define SHM_BASE_ADDRESS    DT_REG_ADDR(SHM_NODE)
+
+#define SHM_START_ADDR      (SHM_BASE_ADDRESS + 0x400)
 #define SHM_SIZE            0x7c00
 #define SHM_DEVICE_NAME     "sram0.shm"

@@ -39,7 +42,7 @@
 #define VRING_ALIGNMENT     4
 #define VRING_SIZE          16

-#define VDEV_STATUS_ADDR    DT_IPC_SHM_BASE_ADDRESS
+#define VDEV_STATUS_ADDR    SHM_BASE_ADDRESS

 /* End of configuration defines */


Unbreak the probing of some CDROM drives.


Towards :multi( [key] ) syntax - 2

Towards :multi( [key] ) syntax - 2

* build_key 'K' keys earlier during constant folding

git-svn-id: 6e74a02f85675cec270f5d931b0f6998666294a3@12858 d31e2699-5ff4-0310-a27c-f18f2fbe73fe

--- compilers/imcc/pbc.c
+++ compilers/imcc/pbc.c
@@ -642,8 +642,6 @@

     if (unit->namespace) {
         ns = unit->namespace->reg;
-        if (ns->set == 'K')
-            ns->color = build_key(interpreter, ns);
         IMCC_debug(interpreter, DEBUG_PBC_CONST,
                 "name space const = %d ns name '%s'\n",
                 ns->color, ns->name);
@@ -933,6 +931,7 @@
 static void
 add_1_const(Interp *interpreter, SymReg *r)
 {
+    SymReg *key;
     if (r->color >= 0)
         return;
     if (r->use_count <= 0)
@@ -950,9 +949,11 @@
             r->color = add_const_num(interpreter, r->name);
             break;
         case 'K':
+            key = r;
             for (r = r->nextkey; r; r = r->nextkey)
                 if (r->type & VTCONST)
                     add_1_const(interpreter, r);
+            build_key(interpreter, key);
             break;
         case 'P':
             make_pmc_const(interpreter, r);
@@ -1273,7 +1274,14 @@
                     IMCC_debug(interpreter, DEBUG_PBC," %d", r->color);
                     break;
                 case PARROT_ARG_KC:
-                    *pc++ = build_key(interpreter, ins->r[i]);
+                    r = ins->r[i];
+                    if (r->set == 'K') {
+                        assert(r->color >= 0);
+                        *pc++ = r->color;
+                    }
+                    else {
+                        *pc++ = build_key(interpreter, r);
+                    }
                     IMCC_debug(interpreter, DEBUG_PBC," %d", pc[-1]);
                     break;
                 default:


Fix range check in intc_intr_establish()

--- arch/beagle/dev/intc.c
+++ arch/beagle/dev/intc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intc.c,v 1.5 2011/04/23 03:54:42 drahn Exp $ */
+/* $OpenBSD: intc.c,v 1.6 2011/09/21 10:09:07 miod Exp $ */
 /*
  * Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org>
  *
@@ -423,7 +423,7 @@
 	int psw;
 	struct intrhand *ih;

-	if (irqno < 0 || irqno > NIRQ)
+	if (irqno < 0 || irqno >= NIRQ)
 		panic("intc_intr_establish: bogus irqnumber %d: %s",
 		     irqno, name);
 	psw = disable_interrupts(I32_bit);


watchdog: sp805: Flush posted writes in enable/disable.

There are no reads in these functions, so if MMIO writes are posted,
the writes in enable/disable may not have completed by the time these
functions return.  If the functions run from different CPUs, it's
in theory possible for the writes to be interleaved, which would be
disastrous for this driver.

At the very least, we need an mmiowb() before releasing the lock, but
since it seems desirable for the watchdog timer to be actually stopped
or reset when these functions return, read the lock register to force
the writes out.

Signed-off-by: Nick Bowler <b06e860ddd122affe35b756653dc7bda58c156fd@elliptictech.com>
Signed-off-by: Wim Van Sebroeck <5f65f6985de1ebf15dde04e0dc4668211868bafa@iguana.be>

--- drivers/watchdog/sp805_wdt.c
+++ drivers/watchdog/sp805_wdt.c
@@ -134,6 +134,8 @@
 	writel(INT_ENABLE | RESET_ENABLE, wdt->base + WDTCONTROL);
 	writel(LOCK, wdt->base + WDTLOCK);

+	/* Flush posted writes. */
+	readl(wdt->base + WDTLOCK);
 	spin_unlock(&wdt->lock);
 }

@@ -146,6 +148,8 @@
 	writel(0, wdt->base + WDTCONTROL);
 	writel(LOCK, wdt->base + WDTLOCK);

+	/* Flush posted writes. */
+	readl(wdt->base + WDTLOCK);
 	spin_unlock(&wdt->lock);
 }


Enable multithread support in TMM

Enable multithread support in TMM

--- include/AMultilayer.h
+++ include/AMultilayer.h
@@ -8,6 +8,7 @@
 #define A_MULTILAYER_H

 #include <memory>
+#include <thread>

 #include "ARefractiveIndex.h"

@@ -62,6 +63,93 @@
     reflectance = r / 2.;
     transmittance = t/ 2.;
   }
+  void CoherentTMMMixed(std::vector<std::complex<Double_t>>& th_0,
+                        Double_t lam_vac, std::vector<Double_t>& reflectance,
+                        std::vector<Double_t>& transmittance) const {
+    auto n = th_0.size();
+    reflectance.resize(n);
+    transmittance.resize(n);
+
+    const auto nthreads = std::thread::hardware_concurrency();
+    std::vector<std::thread> threads(nthreads);
+
+    auto th_0_cbegin = th_0.cbegin();
+    auto th_0_cend = th_0.end();
+    auto reflectance_begin = reflectance.begin();
+    auto transmittance_begin = transmittance.begin();
+
+    auto step = n/nthreads;
+
+    for (std::size_t i = 0; i < nthreads; ++i) {
+      if (i == nthreads - 1) {
+        threads[i] = std::thread(&AMultilayer::CoherentTMMMixedMultiAngle, *this, th_0_cbegin, th_0_cbegin + step, lam_vac, reflectance_begin, transmittance_begin);
+        th_0_cbegin += step;
+      } else {
+        threads[i] = std::thread(&AMultilayer::CoherentTMMMixedMultiAngle, *this, th_0_cbegin, th_0_cend, lam_vac, reflectance_begin, transmittance_begin);
+      }
+    }
+    for (std::size_t i = 0; i < nthreads; ++i) {
+      threads[i].join();
+    }
+  }
+  void CoherentTMMMixed(std::complex<Double_t> th_0,
+                        std::vector<Double_t>& lam_vac, std::vector<Double_t>& reflectance,
+                        std::vector<Double_t>& transmittance) const {
+    auto n = lam_vac.size();
+    reflectance.resize(n);
+    transmittance.resize(n);
+
+    const auto nthreads = std::thread::hardware_concurrency();
+    std::vector<std::thread> threads(nthreads);
+
+    auto lam_vac_cbegin = lam_vac.cbegin();
+    auto lam_vac_cend = lam_vac.end();
+    auto reflectance_begin = reflectance.begin();
+    auto transmittance_begin = transmittance.begin();
+
+    auto step = n/nthreads;
+
+    for (std::size_t i = 0; i < nthreads; ++i) {
+      if (i == nthreads - 1) {
+        threads[i] = std::thread(&AMultilayer::CoherentTMMMixedMultiWavelength, *this, th_0, lam_vac_cbegin, lam_vac_cbegin + step, reflectance_begin, transmittance_begin);
+        lam_vac_cbegin += step;
+      } else {
+        threads[i] = std::thread(&AMultilayer::CoherentTMMMixedMultiWavelength, *this, th_0, lam_vac_cbegin, lam_vac_cend, reflectance_begin, transmittance_begin);
+      }
+    }
+    for (std::size_t i = 0; i < nthreads; ++i) {
+      threads[i].join();
+    }
+  }
+  void CoherentTMMMixedMultiAngle(std::vector<std::complex<Double_t>>::const_iterator th_0_cbegin,
+                                  std::vector<std::complex<Double_t>>::const_iterator th_0_cend,
+                                  Double_t lam_vac, std::vector<Double_t>::iterator reflectance_it,
+                                  std::vector<Double_t>::iterator transmittance_it
+                                  ) {
+    for (auto cit = th_0_cbegin; cit != th_0_cend; ++cit) {
+      Double_t r, t;
+      CoherentTMMMixed(*cit, lam_vac, r, t);
+      *reflectance_it = r;
+      *transmittance_it = t;
+      ++reflectance_it;
+      ++transmittance_it;
+    }
+  }
+  void CoherentTMMMixedMultiWavelength(std::complex<Double_t> th_0,
+                                       std::vector<Double_t>::const_iterator lam_vac_cbegin,
+                                       std::vector<Double_t>::const_iterator lam_vac_cend,
+                                       std::vector<Double_t>::iterator reflectance_it,
+                                       std::vector<Double_t>::iterator transmittance_it
+                                       ) {
+    for (auto cit = lam_vac_cbegin; cit != lam_vac_cend; ++cit) {
+      Double_t r, t;
+      CoherentTMMMixed(th_0, *cit, r, t);
+      *reflectance_it = r;
+      *transmittance_it = t;
+      ++reflectance_it;
+      ++transmittance_it;
+    }
+  }
   void CoherentTMMP(std::complex<Double_t> th_0,
                     Double_t lam_vac, Double_t& reflectance,
                     Double_t& transmittance) const {


Add missing switch values although the code works this is cleaner. Give better error when trying to restore a particular type of acl on a filesystem without support for those types of acls.

--- bacula/src/filed/acl.c
+++ bacula/src/filed/acl.c
@@ -881,6 +881,8 @@
                jcr->last_fname, be.bstrerror());
          return bacl_exit_error;
       }
+   case 0:
+      break;
    default:
       acltype = BACL_TYPE_NFS4;
       break;
@@ -904,6 +906,8 @@
                   jcr->last_fname, be.bstrerror());
             return bacl_exit_error;
          }
+      case 0:
+         break;
       default:
          acltype = BACL_TYPE_ACCESS;
          break;
@@ -973,6 +977,7 @@
 static bacl_exit_code freebsd_parse_acl_streams(JCR *jcr, int stream)
 {
    int acl_enabled = 0;
+   char *acl_type_name;
    berrno be;

    /**
@@ -984,21 +989,20 @@
    case STREAM_UNIX_DEFAULT_ACL:
    case STREAM_ACL_FREEBSD_DEFAULT_ACL:
       acl_enabled = pathconf(jcr->last_fname, _PC_ACL_EXTENDED);
+      acl_type_name = "POSIX";
       break;
    case STREAM_ACL_FREEBSD_NFS4_ACL:
 #if defined(_PC_ACL_NFS4)
       acl_enabled = pathconf(jcr->last_fname, _PC_ACL_NFS4);
 #endif
+      acl_type_name = "NFS4";
       break;
    default:
+      acl_type_name = "unknown";
       break;
    }

    switch (acl_enabled) {
-   case 0:
-      Mmsg1(jcr->errmsg, _("Trying to restore acl on file \"%s\" on filesystem without acl support\n"),
-            jcr->last_fname);
-      return bacl_exit_error;
    case -1:
       switch (errno) {
       case ENOENT:
@@ -1010,6 +1014,12 @@
                jcr->acl_data->content, jcr->last_fname, be.bstrerror());
          return bacl_exit_error;
       }
+   case 0:
+      Mmsg1(jcr->errmsg, _("Trying to restore acl on file \"%s\" on filesystem without %s acl support\n"),
+            jcr->last_fname, acl_type_name);
+      return bacl_exit_error;
+   default:
+      break;
    }

    /**


BUG: Fixed memory leak in array_arange.

BUG: Fixed memory leak in array_arange.

--- numpy/core/src/multiarray/multiarraymodule.c
+++ numpy/core/src/multiarray/multiarraymodule.c
@@ -1566,6 +1566,7 @@
     PyObject *o_start = NULL, *o_stop = NULL, *o_step = NULL;
     static char *kwd[]= {"start", "stop", "step", "dtype", NULL};
     PyArray_Descr *typecode = NULL;
+    PyObject* result;

     if(!PyArg_ParseTupleAndKeywords(args, kws, "O|OOO&", kwd,
                 &o_start, &o_stop, &o_step,
@@ -1573,7 +1574,9 @@
         Py_XDECREF(typecode);
         return NULL;
     }
-    return PyArray_ArangeObj(o_start, o_stop, o_step, typecode);
+    result = PyArray_ArangeObj(o_start, o_stop, o_step, typecode);
+    Py_XDECREF(typecode);
+    return result;
 }

 /*NUMPY_API


clocksource: bcm2835: Switch to sched_clock_register()

The 32 bit sched_clock interface now supports 64 bits. Upgrade to
the 64 bit function to allow us to remove the 32 bit registration
interface.

Cc: Stephen Warren <5ef2a23ba3aff51d1cfc8c113c1ec34b608b3b13@wwwdotorg.org>
Acked-by: Stephen Warren <5ef2a23ba3aff51d1cfc8c113c1ec34b608b3b13@wwwdotorg.org>
Signed-off-by: Stephen Boyd <010521127f513270fe503d86ab8316ac5147f4b7@codeaurora.org>
Signed-off-by: John Stultz <33837adfb53316eae44aad04041e1240088d76fd@linaro.org>

--- drivers/clocksource/bcm2835_timer.c
+++ drivers/clocksource/bcm2835_timer.c
@@ -49,7 +49,7 @@

 static void __iomem *system_clock __read_mostly;

-static u32 notrace bcm2835_sched_read(void)
+static u64 notrace bcm2835_sched_read(void)
 {
 	return readl_relaxed(system_clock);
 }
@@ -110,7 +110,7 @@
 		panic("Can't read clock-frequency");

 	system_clock = base + REG_COUNTER_LO;
-	setup_sched_clock(bcm2835_sched_read, 32, freq);
+	sched_clock_register(bcm2835_sched_read, 32, freq);

 	clocksource_mmio_init(base + REG_COUNTER_LO, node->name,
 		freq, 300, 32, clocksource_mmio_readl_up);


call base if_qflush routine to flush if_snd


We make virtual the destructor to avoid problems.

--- include/FixpointSSI.h
+++ include/FixpointSSI.h
@@ -226,7 +226,7 @@
     FixpointSSI(Module *M, unsigned WidL, unsigned NarL, AliasAnalysis* AA);
     FixpointSSI(Module *M, unsigned WidL, unsigned NarL, AliasAnalysis* AA, bool isSigned);
     /// Destructor of the class
-    ~FixpointSSI();
+    virtual ~FixpointSSI();
     /// Methods for support type inquiry through isa, cast, and dyn_cast.
     static inline bool classof(const FixpointSSI *) { return true; }


3K: core: InternString conversion in multiarraymodule.c

git-svn-id: 77a43f9646713b91fea7788fad5dfbf67e151ece@7902 94b884b6-d6fd-0310-90d3-974f1d3f35e1

--- numpy/core/src/multiarray/multiarraymodule.c
+++ numpy/core/src/multiarray/multiarraymodule.c
@@ -3014,7 +3014,11 @@
     PyDict_SetItemString(d, "__version__", s);
     Py_DECREF(s);

+#if defined(NPY_PY3K)
+    s = PyUnicode_InternFromString(NPY_METADATA_DTSTR);
+#else
     s = PyString_InternFromString(NPY_METADATA_DTSTR);
+#endif
     PyDict_SetItemString(d, "METADATA_DTSTR", s);
     Py_DECREF(s);


firewire: core: fix topology map response handler

This register is 1 kBytes large.  Adjust topology_map.length to prevent
registration of other response handlers in this region and to make sure
that we respond to requests to the upper half of the register.

Signed-off-by: Stefan Richter <fbd796546fc801b34e01e453c6fd30283e012038@s5r6.in-berlin.de>

--- drivers/firewire/core-transaction.c
+++ drivers/firewire/core-transaction.c
@@ -834,7 +834,7 @@
 }

 static struct fw_address_handler topology_map = {
-	.length			= 0x200,
+	.length			= 0x400,
 	.address_callback	= handle_topology_map,
 };


Fix my previous commit. Remove ed_get_Linksys() function prototypes.

--- sys/dev/ed/if_edvar.h
+++ sys/dev/ed/if_edvar.h
@@ -197,8 +197,6 @@
 int	ed_probe_Novell_generic	__P((device_t, int));
 int	ed_probe_HP_pclanp	__P((device_t, int, int));

-int	ed_get_Linksys		__P((device_t));
-
 int	ed_attach		__P((struct ed_softc *, int, int));
 void	ed_stop			__P((struct ed_softc *));
 void	ed_pio_readmem		__P((struct ed_softc *, int, unsigned char *,


[IA64] MCA: update MCA comm field for user space tasks

Update the comm field on the MCA handler for user tasks as well as for
verified kernel tasks.  This helps to identify the task that was
running when the MCA occurred.

Signed-off-by: Keith Owens <ac0deeb8a1ce0892219186da4896ac373af5313a@sgi.com>
Signed-off-by: Tony Luck <e7984595ec0368ff920a7b3521dc7093683f6f26@intel.com>

--- arch/ia64/kernel/mca.c
+++ arch/ia64/kernel/mca.c
@@ -630,6 +630,32 @@
 	*tnat |= (nat << tslot);
 }

+/* Change the comm field on the MCA/INT task to include the pid that
+ * was interrupted, it makes for easier debugging.  If that pid was 0
+ * (swapper or nested MCA/INIT) then use the start of the previous comm
+ * field suffixed with its cpu.
+ */
+
+static void
+ia64_mca_modify_comm(const task_t *previous_current)
+{
+	char *p, comm[sizeof(current->comm)];
+	if (previous_current->pid)
+		snprintf(comm, sizeof(comm), "%s %d",
+			current->comm, previous_current->pid);
+	else {
+		int l;
+		if ((p = strchr(previous_current->comm, ' ')))
+			l = p - previous_current->comm;
+		else
+			l = strlen(previous_current->comm);
+		snprintf(comm, sizeof(comm), "%s %*s %d",
+			current->comm, l, previous_current->comm,
+			task_thread_info(previous_current)->cpu);
+	}
+	memcpy(current->comm, comm, sizeof(current->comm));
+}
+
 /* On entry to this routine, we are running on the per cpu stack, see
  * mca_asm.h.  The original stack has not been touched by this event.  Some of
  * the original stack's registers will be in the RBS on this stack.  This stack
@@ -648,7 +674,7 @@
 		struct ia64_sal_os_state *sos,
 		const char *type)
 {
-	char *p, comm[sizeof(current->comm)];
+	char *p;
 	ia64_va va;
 	extern char ia64_leave_kernel[];	/* Need asm address, not function descriptor */
 	const pal_min_state_area_t *ms = sos->pal_min_state;
@@ -721,6 +747,10 @@
 	/* Verify the previous stack state before we change it */
 	if (user_mode(regs)) {
 		msg = "occurred in user space";
+		/* previous_current is guaranteed to be valid when the task was
+		 * in user space, so ...
+		 */
+		ia64_mca_modify_comm(previous_current);
 		goto no_mod;
 	}
 	if (r13 != sos->prev_IA64_KR_CURRENT) {
@@ -750,25 +780,7 @@
 		goto no_mod;
 	}

-	/* Change the comm field on the MCA/INT task to include the pid that
-	 * was interrupted, it makes for easier debugging.  If that pid was 0
-	 * (swapper or nested MCA/INIT) then use the start of the previous comm
-	 * field suffixed with its cpu.
-	 */
-	if (previous_current->pid)
-		snprintf(comm, sizeof(comm), "%s %d",
-			current->comm, previous_current->pid);
-	else {
-		int l;
-		if ((p = strchr(previous_current->comm, ' ')))
-			l = p - previous_current->comm;
-		else
-			l = strlen(previous_current->comm);
-		snprintf(comm, sizeof(comm), "%s %*s %d",
-			current->comm, l, previous_current->comm,
-			task_thread_info(previous_current)->cpu);
-	}
-	memcpy(current->comm, comm, sizeof(current->comm));
+	ia64_mca_modify_comm(previous_current);

 	/* Make the original task look blocked.  First stack a struct pt_regs,
 	 * describing the state at the time of interrupt.  mca_asm.S built a


sysview: Fix build for c++

sysview: Fix build for c++

Initializing non-const char pointer with constant string literal
is an error in c++ according to g++ compiler.
error: ISO C++ forbids converting a string constant to 'char*' [-Werror=write-strings]

This assignment even for c build is not useful since
asprintf assigns new value (possible NULL) to desc anyway.

This change just drops meaningless initialization that makes g++ unhappy.

--- kernel/os/include/os/os_trace_api.h
+++ kernel/os/include/os/os_trace_api.h
@@ -68,7 +68,7 @@
 os_trace_module_register(os_trace_module_t *m, const char *name,
                          uint32_t num_events, void (* send_desc_func)(void))
 {
-    char *desc = "M=???";
+    char *desc;

     asprintf(&desc, "M=%s", name);


drm/i915: Fix printing proper min/min/rpe values in debugfs

This was fumbled while trying to use the cached min/min/rpe values in
the vlv debugfs code.

    This is a regression from

    commit 03af20458a57a50735b12c1e3c23abc7ff70c6fa
    Author: Ville Syrjälä <ville.syrjala@linux.intel.com>
    Date:   Sat Jun 28 02:03:53 2014 +0300

    drm/i915: Use the cached min/min/rpe values in the vlv debugfs code

Signed-off-by: Deepak S <b64e3b722d60644e9e2f2e15d0b99e87ffd5f23c@linux.intel.com>
Signed-off-by: Daniel Vetter <c1b6782c4af8f0673da8923a0702a1832e5940f4@ffwll.ch>


The poison pill of death: adding a target mode reply handler and target resources to a non-FC card killed us dead. Sorry for the breakage since last July 12.

--- sys/dev/mpt/mpt_cam.c
+++ sys/dev/mpt/mpt_cam.c
@@ -104,9 +104,9 @@
 #include "dev/mpt/mpilib/mpi_init.h"
 #include "dev/mpt/mpilib/mpi_targ.h"
 #include "dev/mpt/mpilib/mpi_fc.h"
-
+#if __FreeBSD_version >= 500000
 #include <sys/sysctl.h>
-
+#endif
 #include <sys/callout.h>
 #include <sys/kthread.h>

@@ -248,7 +248,7 @@
 	 * If we support target mode, we register a reply handler for it,
 	 * but don't add resources until we actually enable target mode.
 	 */
-	if ((mpt->role & MPT_ROLE_TARGET) != 0) {
+	if (mpt->is_fc && (mpt->role & MPT_ROLE_TARGET) != 0) {
 		handler.reply_handler = mpt_scsi_tgt_reply_handler;
 		error = mpt_register_handler(mpt, MPT_HANDLER_REPLY, handler,
 		    &mpt->scsi_tgt_handler_id);
@@ -816,7 +816,7 @@
 	 * If we're in target mode, hang out resources now
 	 * so we don't cause the world to hang talking to us.
 	 */
-	if (mpt->role & MPT_ROLE_TARGET) {
+	if (mpt->is_fc && (mpt->role & MPT_ROLE_TARGET)) {
 		/*
 		 * Try to add some target command resources
 		 */
@@ -3166,7 +3166,7 @@
 		if ((mpt->role & MPT_ROLE_INITIATOR) == 0) {
 			cpi->hba_misc |= PIM_NOINITIATOR;
 		}
-		if ((mpt->role & MPT_ROLE_TARGET) != 0) {
+		if (mpt->is_fc && (mpt->role & MPT_ROLE_TARGET)) {
 			cpi->target_sprt =
 			    PIT_PROCESSOR | PIT_DISCONNECT | PIT_TERM_IO;
 		} else {


tree/ev_listener_actor: destroy callback as early as possible

By explicitly destructing callback in `on_exit()` we get:
1. Deterministic behavior of predictable state destruction.
2. All Python callbacks are released after behavior stop for sure.

This fixes accidents when Python callbacks being destructed while ev
listener actors cleanup AFTER Python is already dead.

--- kernel/src/tree/ev_listener_actor.h
+++ kernel/src/tree/ev_listener_actor.h
@@ -16,6 +16,8 @@

 #include <caf/actor_config.hpp>
 #include <caf/event_based_actor.hpp>
+
+#include <optional>

 NAMESPACE_BEGIN(blue_sky::tree)

@@ -37,7 +39,8 @@

 	// safe callback wrapped into error::eval_safe()
 	using safe_callback_t = decltype(make_safe_callback(std::declval<callback_t>()));
-	const safe_callback_t f;
+	std::optional<safe_callback_t> f_;
+	const safe_callback_t& f;

 	// address of events source actor (engine)
 	const caf::actor_addr origin;
@@ -46,15 +49,14 @@
 		caf::actor_config& cfg, caf::actor_addr ev_src, callback_t cb,
 		std::function< caf::message_handler(ev_listener_actor*) > make_event_behavior
 	)
-		: super(cfg), f(make_safe_callback(std::move(cb))), origin(std::move(ev_src))
+		: super(cfg), f_(make_safe_callback(std::move(cb))), f(*f_), origin(std::move(ev_src))
 	{
 		// silently drop all other messages not in my character
 		set_default_handler([](auto*, auto&) -> caf::result<caf::message> {
 			return caf::none;
 		});

-		// put self into registry (to keep lifetime)
-		KRADIO.system().registry().put(id(), this);
+		// [NOTE] lifetime of actor is kept by group it joins on 'a_hi'
 		// exit after kernel
 		KRADIO.register_citizen(this);

@@ -78,6 +80,8 @@
 	}

 	auto on_exit() -> void override {
+		// destroy callback as early as possible
+		f_.reset();
 		KRADIO.release_citizen(this);
 	}


arch/powerpc/mm/numa.c: do not allocate bootmem memory for non existing nodes

With the setup_nr_nodes(), we have already initialized
node_possible_map.  So it is safe to use for_each_node here.

There are many places in the kernel that use hardcoded 'for' loop with
nr_node_ids, because all other architectures have numa nodes populated
serially.  That should be reason we had maintained the same for
powerpc.

But, since sparse numa node ids possible on powerpc, we unnecessarily
allocate memory for non existent numa nodes.

For e.g., on a system with 0,1,16,17 as numa nodes nr_node_ids=18 and
we allocate memory for nodes 2-14.  This patch we allocate memory for
only existing numa nodes.

The patch is boot tested on a 4 node tuleta, confirming with printks
that it works as expected.

Signed-off-by: Raghavendra K T <c41808f1f1b2f68f735a9a29ebf17ff9d0e25dc6@linux.vnet.ibm.com>
Cc: Vladimir Davydov <0d62248ee021b6e01c0ee596a62a5b145b996974@parallels.com>
Cc: Benjamin Herrenschmidt <a7089bb6e7e92505d88aaff006cbdd60cc9120b6@kernel.crashing.org>
Cc: Paul Mackerras <19a0ba370c443ba08d20b5061586430ab449ee8c@samba.org>
Cc: Michael Ellerman <864f124608374e06e4da1fa5d2e47ed839b95411@ellerman.id.au>
Cc: Anton Blanchard <14deb5e5e417133e888bf47bb6a3555c9bb7d81c@samba.org>
Cc: Nishanth Aravamudan <32d5d7104760c6969dbcc939b04e64f225673f91@linux.vnet.ibm.com>
Cc: Greg Kurz <21a0ac3a0184cbb5f322585bd41886b0e67aa0d7@linux.vnet.ibm.com>
Cc: Grant Likely <9069e6f5a2b566e2674a0ba1e2bf39c12c195fad@linaro.org>
Cc: Nikunj A Dadhania <e2f4a5db9b4735182a88051d1e7a3599f9eac9db@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

--- arch/powerpc/mm/numa.c
+++ arch/powerpc/mm/numa.c
@@ -80,7 +80,7 @@
 		setup_nr_node_ids();

 	/* allocate the map */
-	for (node = 0; node < nr_node_ids; node++)
+	for_each_node(node)
 		alloc_bootmem_cpumask_var(&node_to_cpumask_map[node]);

 	/* cpumask_of_node() will now work */


drm/i915/bdw: Don't write PDP in the legacy way when using LRCs

This is mostly for correctness so that we know we are running the LR
context correctly (this is, the PDPs are contained inside the context
object).

v2: Move the check to inside the enable PPGTT function. The switch
happens in two places: the legacy context switch (that we won't hit
when Execlists are enabled) and the PPGTT enable, which unfortunately
we need. This would look much nicer if the ppgtt->enable was part of
the ring init, where it logically belongs.

v3: Move the check to the start of the enable PPGTT function.  None
of the legacy PPGTT enabling is required when using LRCs as the
PPGTT is enabled in the context descriptor and the PDPs are written
in the LRC.

v4: Clarify comment based on review feedback.

Signed-off-by: Oscar Mateo <8d158a6e9567f59e489595fde938b03d223fe815@intel.com>
Signed-off-by: Thomas Daniel <f031fe87014890daf59987e03350331e134ad7c5@intel.com>
Reviewed-by: Damien Lespiau <64bd3cb94f359c1a3ce68dae5e26b40578526277@intel.com>
[danvet: Resolve conflicts with ppgtt_enable rework.]
Signed-off-by: Daniel Vetter <c1b6782c4af8f0673da8923a0702a1832e5940f4@ffwll.ch>


powerpc/pseries: Fix brace placement in numa.c

Fix brace placement in VPHN code.

Signed-off-by: Jesse Larrew <4eaba5b4ef29dbc031e26a8a053fe53adbfc10be@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <a7089bb6e7e92505d88aaff006cbdd60cc9120b6@kernel.crashing.org>

--- arch/powerpc/mm/numa.c
+++ arch/powerpc/mm/numa.c
@@ -1310,9 +1310,8 @@
 		u8 *counts = vphn_cpu_change_counts[cpu];
 		volatile u8 *hypervisor_counts = lppaca[cpu].vphn_assoc_counts;

-		for (i = 0; i < VPHN_NR_CHANGE_CTRS; i++) {
+		for (i = 0; i < VPHN_NR_CHANGE_CTRS; i++)
 			counts[i] = hypervisor_counts[i];
-		}
 	}
 }

@@ -1379,14 +1378,12 @@
 			 */
 			unpacked[i] = *((u32*)field);
 			field += 2;
-		}
-		else if (*field & VPHN_FIELD_MSB) {
+		} else if (*field & VPHN_FIELD_MSB) {
 			/* Data is in the lower 15 bits of this field */
 			unpacked[i] = *field & VPHN_FIELD_MASK;
 			field++;
 			nr_assoc_doms++;
-		}
-		else {
+		} else {
 			/* Data is in the lower 15 bits of this field
 			 * concatenated with the next 16 bit field
 			 */


drm/radeon/kms: Add ttm page pool debugfs file.

ttm_page_pool file is hooked ttm_page_alloc_debugfs for pool
allocator state.

Signed-off-by: Pauli Nieminen <ce89c68871fad9564c22852774cc328c5c04372c@gmail.com>
Signed-off-by: Dave Airlie <f2295d84e358395675bc8031be58672073ae065e@redhat.com>

--- drivers/gpu/drm/radeon/radeon_ttm.c
+++ drivers/gpu/drm/radeon/radeon_ttm.c
@@ -33,6 +33,7 @@
 #include <ttm/ttm_bo_driver.h>
 #include <ttm/ttm_placement.h>
 #include <ttm/ttm_module.h>
+#include <ttm/ttm_page_alloc.h>
 #include <drm/drmP.h>
 #include <drm/radeon_drm.h>
 #include <linux/seq_file.h>
@@ -744,8 +745,8 @@
 static int radeon_ttm_debugfs_init(struct radeon_device *rdev)
 {
 #if defined(CONFIG_DEBUG_FS)
-	static struct drm_info_list radeon_mem_types_list[RADEON_DEBUGFS_MEM_TYPES];
-	static char radeon_mem_types_names[RADEON_DEBUGFS_MEM_TYPES][32];
+	static struct drm_info_list radeon_mem_types_list[RADEON_DEBUGFS_MEM_TYPES+1];
+	static char radeon_mem_types_names[RADEON_DEBUGFS_MEM_TYPES+1][32];
 	unsigned i;

 	for (i = 0; i < RADEON_DEBUGFS_MEM_TYPES; i++) {
@@ -762,7 +763,13 @@
 			radeon_mem_types_list[i].data = &rdev->mman.bdev.man[TTM_PL_TT].manager;

 	}
-	return radeon_debugfs_add_files(rdev, radeon_mem_types_list, RADEON_DEBUGFS_MEM_TYPES);
+	/* Add ttm page pool to debugfs */
+	sprintf(radeon_mem_types_names[i], "ttm_page_pool");
+	radeon_mem_types_list[i].name = radeon_mem_types_names[i];
+	radeon_mem_types_list[i].show = &ttm_page_alloc_debugfs;
+	radeon_mem_types_list[i].driver_features = 0;
+	radeon_mem_types_list[i].data = NULL;
+	return radeon_debugfs_add_files(rdev, radeon_mem_types_list, RADEON_DEBUGFS_MEM_TYPES+1);

 #endif
 	return 0;


Refine r233827; as it turns out, controllers with a device ID of 0x0059
can be upgraded to MegaRAID mode, in which case mfi(4) should attach to
these based on the sub-vendor and -device ID instead (not currently done).
Therefore, let mpt_pci_probe() return BUS_PROBE_LOW_PRIORITY.
While it, let mpt_pci_probe() return BUS_PROBE_DEFAULT instead of 0 in
the default case.

MFC after:	3 days


Replace GtkTable with GtkGrid

Replace GtkTable with GtkGrid

--- camunits-gtk/unit_control_widget.c
+++ camunits-gtk/unit_control_widget.c
@@ -30,7 +30,7 @@
     GtkAlignment *alignment;
     GtkExpander *expander;
     GtkButton *close_button;
-    GtkTable *table;
+    GtkGrid *table;
     GtkWidget * arrow_bin;
     GtkWidget * exp_label;

@@ -138,7 +138,7 @@
     gtk_widget_show (GTK_WIDGET(priv->close_button));

     // table for all the widgets
-    priv->table = GTK_TABLE(gtk_table_new(1, 3, FALSE));
+    priv->table = GTK_GRID(gtk_grid_new());
     gtk_container_set_border_width(GTK_CONTAINER(vbox), 2);
     gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(priv->table),
             FALSE, FALSE, 0);
@@ -350,11 +350,9 @@
     GtkWidget *label = gtk_label_new(tmp);
     free(tmp);
     gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
-    gtk_table_attach (priv->table, label, 0, 1,
-            priv->trows, priv->trows+1,
-            GTK_FILL, 0, 0, 0);
+    gtk_grid_attach (priv->table, label, 0, priv->trows, 1, 1); // GTK_FILL
     gtk_widget_show (label);
-    GtkWidget *range = gtk_hscale_new_with_range(min, max, step);
+    GtkWidget *range = gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL, min, max, step);
     gtk_scale_set_draw_value(GTK_SCALE(range), FALSE);
     set_tooltip (self, range, ctl);

@@ -366,17 +364,15 @@
     if (use_int)
         gtk_range_set_round_digits (GTK_RANGE (range), 0);

-    gtk_table_attach (priv->table, range, 1, 2,
-            priv->trows, priv->trows+1,
-            GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0, 0);
+    gtk_widget_set_hexpand(range, TRUE);
+    gtk_grid_attach (priv->table, range, 1, priv->trows, 1, 1);
+    //        GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0, 0);
     gtk_widget_show (range);
     gtk_range_set_value (GTK_RANGE (range), initial_value);

     // numerical label
     GtkWidget *labelval = gtk_label_new (NULL);
-    gtk_table_attach (priv->table, labelval, 2, 3,
-            priv->trows, priv->trows+1,
-            GTK_FILL, 0, 0, 0);
+    gtk_grid_attach (priv->table, labelval, 2, priv->trows, 1, 1); // GTK_FILL
     PangoFontDescription * desc = pango_font_description_new ();
     pango_font_description_set_family_static (desc, "monospace");
     gtk_widget_modify_font (labelval, desc);
@@ -481,9 +477,7 @@
     GtkWidget *label = gtk_label_new(tmp);
     free(tmp);
     gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
-    gtk_table_attach (priv->table, label, 0, 1,
-            priv->trows, priv->trows+1,
-            GTK_FILL, 0, 0, 0);
+    gtk_grid_attach (priv->table, label, 0, priv->trows, 1, 1); // GTK_FILL
     gtk_widget_show (label);

     // spinbutton widget
@@ -491,9 +485,8 @@
     GtkWidget *spinb = gtk_spin_button_new_with_range (min, max, step);
     set_tooltip (self, spinb, ctl);

-    gtk_table_attach (priv->table, spinb, 1, 3,
-            priv->trows, priv->trows+1,
-            GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0, 0);
+    gtk_widget_set_hexpand(spinb, TRUE);
+    gtk_grid_attach (priv->table, spinb, 1, priv->trows, 2, 1); // GTK_EXPAND | GTK_SHRINK | GTK_FILL
     gtk_widget_show (spinb);
     gtk_spin_button_set_value (GTK_SPIN_BUTTON (spinb), initial_value);

@@ -609,9 +602,8 @@
     CamUnitControlWidgetPriv * priv = CAM_UNIT_CONTROL_WIDGET_GET_PRIVATE(self);
     gtk_widget_show (cb);

-    gtk_table_attach (GTK_TABLE (priv->table), cb, 1, 3,
-            priv->trows, priv->trows+1,
-            GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0, 0);
+    gtk_widget_set_hexpand(cb, TRUE);
+    gtk_grid_attach (priv->table, cb, 1, priv->trows, 2, 1); // GTK_EXPAND | GTK_SHRINK | GTK_FILL

     if (GTK_IS_TOGGLE_BUTTON (cb)) {
         int val = cam_unit_control_get_boolean(ctl);
@@ -731,9 +723,7 @@
     GtkWidget *label = gtk_label_new(tmp);
     free(tmp);
     gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
-    gtk_table_attach (priv->table, label, 0, 1,
-            priv->trows, priv->trows+1,
-            GTK_FILL, 0, 0, 0);
+    gtk_grid_attach (priv->table, label, 0, priv->trows, 1, 1); // GTK_FILL
     gtk_widget_show (label);

     int active_val = cam_unit_control_get_enum(ctl);
@@ -782,9 +772,8 @@
     }
 #endif

-    gtk_table_attach (priv->table, eb, 1, 3,
-            priv->trows, priv->trows+1,
-            GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0, 0);
+    gtk_widget_set_hexpand(eb, TRUE);
+    gtk_grid_attach (priv->table, eb, 1, priv->trows, 2, 1); // GTK_EXPAND | GTK_SHRINK | GTK_FILL
     gtk_widget_show (eb);
     gtk_widget_show (mb);

@@ -858,16 +847,13 @@
     GtkWidget *label = gtk_label_new(tmp);
     free(tmp);
     gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
-    gtk_table_attach (priv->table, label, 0, 1,
-            priv->trows, priv->trows+1,
-            GTK_FILL, 0, 0, 0);
+    gtk_grid_attach (priv->table, label, 0, priv->trows, 1, 1); // GTK_FILL
     gtk_widget_show (label);

     // hbox to contain the text entry and file chooser button
     GtkWidget *hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
-    gtk_table_attach(priv->table, hbox, 1, 3,
-            priv->trows, priv->trows+1,
-            GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0, 0);
+    gtk_widget_set_hexpand(hbox, TRUE);
+    gtk_grid_attach(priv->table, hbox, 1, priv->trows, 2, 1); // GTK_EXPAND | GTK_SHRINK | GTK_FILL
     gtk_widget_show(hbox);

     // text entry
@@ -954,9 +940,7 @@
     GtkWidget *label = gtk_label_new(tmp);
     free(tmp);
     gtk_misc_set_alignment (GTK_MISC (label), 1, 0.5);
-    gtk_table_attach (priv->table, label, 0, 1,
-            priv->trows, priv->trows+1,
-            GTK_FILL, 0, 0, 0);
+    gtk_grid_attach (priv->table, label, 0, priv->trows, 1, 1); // GTK_FILL
     gtk_widget_show (label);

     GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 1);
@@ -970,9 +954,8 @@
     GtkWidget *button = gtk_button_new_with_label ("Set");
     gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);

-    gtk_table_attach(priv->table, hbox, 1, 3,
-            priv->trows, priv->trows+1,
-            GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0, 0);
+    gtk_widget_set_hexpand(hbox, TRUE);
+    gtk_grid_attach(priv->table, hbox, 1, priv->trows, 2, 1); // GTK_EXPAND | GTK_SHRINK | GTK_FILL

     gtk_widget_show_all(hbox);


[S390] Load disabled wait psw instead of stopping cpu on halt.

Signed-off-by: Michael Holzheu <db4757c56f54651f568cc7cda79cd93c781b1605@de.ibm.com>
Signed-off-by: Martin Schwidefsky <52616596d8f5df0d597e85ab515377f92f939c68@de.ibm.com>

--- arch/s390/kernel/ipl.c
+++ arch/s390/kernel/ipl.c
@@ -1096,8 +1096,12 @@

 static void stop_run(struct shutdown_trigger *trigger)
 {
-	signal_processor(smp_processor_id(), sigp_stop_and_store_status);
-	for (;;);
+	if (strcmp(trigger->name, ON_PANIC_STR) == 0)
+		disabled_wait((unsigned long) __builtin_return_address(0));
+	else {
+		signal_processor(smp_processor_id(), sigp_stop);
+		for (;;);
+	}
 }

 static struct shutdown_action stop_action = {SHUTDOWN_ACTION_STOP_STR,


sh: add dynamic crash base address support

Add support for dynamic crash kernel base address.

Signed-off-by: Magnus Damm <2336f5729424d0c84d319e991b3648cafa2c3c5b@igel.co.jp>
Signed-off-by: Paul Mundt <38b52dbb5f0b63d149982b6c5de788ec93a89032@linux-sh.org>

--- arch/sh/kernel/setup.c
+++ arch/sh/kernel/setup.c
@@ -147,6 +147,7 @@
 {
 	unsigned long long free_mem;
 	unsigned long long crash_size, crash_base;
+	void *vp;
 	int ret;

 	free_mem = ((unsigned long long)max_low_pfn - min_low_pfn) << PAGE_SHIFT;
@@ -155,12 +156,14 @@
 			&crash_size, &crash_base);
 	if (ret == 0 && crash_size) {
 		if (crash_base <= 0) {
-			printk(KERN_INFO "crashkernel reservation failed - "
-					"you have to specify a base address\n");
-			return;
-		}
-
-		if (reserve_bootmem(crash_base, crash_size,
+			vp = alloc_bootmem_nopanic(crash_size);
+			if (!vp) {
+				printk(KERN_INFO "crashkernel allocation "
+				       "failed\n");
+				return;
+			}
+			crash_base = __pa(vp);
+		} else if (reserve_bootmem(crash_base, crash_size,
 					BOOTMEM_EXCLUSIVE) < 0) {
 			printk(KERN_INFO "crashkernel reservation failed - "
 					"memory is in use\n");


Method ChatMessagePart::slotToggleGraphicOverride does nothing so mark it as deprecated

See commit f6a8bb22dc19be2341daa8b0f053ae215be71ded

--- kopete/chatwindow/chatmessagepart.h
+++ kopete/chatwindow/chatmessagepart.h
@@ -149,9 +149,10 @@
 	void messageStateChanged( uint messageId, Kopete::Message::MessageState state );

 	/**
+	 * @deprecated
 	 * does nothing
 	 */
-	void slotToggleGraphicOverride(bool enable);
+	KDE_DEPRECATED void slotToggleGraphicOverride(bool enable);

 signals:
 	/**


Missing boolean tests from the ETL_LOG_ERRORS #define branch.


Experimental patch to try to properly clip the range of the memory
request to one that's supported by the bridge.  I'm not 100% sure this
is correct, but it makes it easier for the cardbus bridge to allocate
its memory.

Similar code is needed for the I/O range.  Also, I'm not sure if I
should be doing this based on memory or pmemory (but likely should do
it based on some flag that tells us to prefetch or not).

Talked about a long time ago with: msmith

--- sys/dev/pci/pci_pci.c
+++ sys/dev/pci/pci_pci.c
@@ -302,6 +302,10 @@
 	     *     flag as the request bubbles up?
 	     */
 	case SYS_RES_MEMORY:
+	    if (start < sc->membase && end > sc->membase)
+		start = sc->membase;
+	    if (end > sc->memlimit && start < end)
+		end = sc->memlimit;
 	    if (((start < sc->membase) || (end > sc->memlimit)) &&
 		((start < sc->pmembase) || (end > sc->pmemlimit))) {
 		device_printf(dev, "device %s%d requested unsupported memory range 0x%lx-0x%lx"


Fix silly typo

Fix silly typo

--- include/PLT/KeyCode.h
+++ include/PLT/KeyCode.h
@@ -79,7 +79,7 @@
 };

 //! Get key code for key when shift is pressed on a modern keyboard
-inline uint8_t getShiftedKey(uint8_t base_key, bool ansi = true)
+inline uint8_t shiftKeyCode(uint8_t base_key, bool ansi = true)
 {
    if ((base_key >= 'a') && (base_key <= 'z'))
    {


forward port 11580

forward port 11580

--- mozilla/vlcplugin.h
+++ mozilla/vlcplugin.h
@@ -107,4 +107,6 @@
     "video/x-ms-asf:asf,asx:Windows Media Video;" \
     "application/x-mplayer2::Windows Media;" \
     "video/x-ms-wmv:wmv:Windows Media" \
+    /* Google VLC mime */
+    "application/x-google-vlc-plugin::Google VLC plugin;" \


drm/radeon: fix UVD message buffer validation

commit 112a6d0c071808f6d48354fc8834a574e5dcefc0 upstream.

When the message buffer is currently moving block until it is idle again.

Signed-off-by: Christian König <c7ea837d7a46effe4232b086213468b8b31643bf@amd.com>
Signed-off-by: Alex Deucher <08dc22c6156113f2deff178e35e3ed9b24d6af9e@amd.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/gpu/drm/radeon/radeon_uvd.c
+++ drivers/gpu/drm/radeon/radeon_uvd.c
@@ -359,6 +359,14 @@
 		return -EINVAL;
 	}

+	if (bo->tbo.sync_obj) {
+		r = radeon_fence_wait(bo->tbo.sync_obj, false);
+		if (r) {
+			DRM_ERROR("Failed waiting for UVD message (%d)!\n", r);
+			return r;
+		}
+	}
+
 	r = radeon_bo_kmap(bo, &ptr);
 	if (r)
 		return r;


Only reconfigure LDC queues ipon reset instead of unconfiguring them first. This makes sure the other side correctly sees the channel being reset.

--- arch/sparc64/dev/ldc.c
+++ arch/sparc64/dev/ldc.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: ldc.c,v 1.11 2014/09/29 17:43:29 kettenis Exp $	*/
+/*	$OpenBSD: ldc.c,v 1.12 2015/03/21 18:02:58 kettenis Exp $	*/
 /*
  * Copyright (c) 2009 Mark Kettenis
  *
@@ -474,10 +474,6 @@
 	DPRINTF(("Resetting connection\n"));

 	mtx_enter(&lc->lc_txq->lq_mtx);
-	hv_ldc_tx_qconf(lc->lc_id, 0, 0);
-	hv_ldc_rx_qconf(lc->lc_id, 0, 0);
-	lc->lc_tx_state = lc->lc_rx_state = LDC_CHANNEL_DOWN;
-
 	err = hv_ldc_tx_qconf(lc->lc_id,
 	    lc->lc_txq->lq_map->dm_segs[0].ds_addr, lc->lc_txq->lq_nentries);
 	if (err != H_EOK)
@@ -490,6 +486,7 @@

 	lc->lc_tx_seqid = 0;
 	lc->lc_state = 0;
+	lc->lc_tx_state = lc->lc_rx_state = LDC_CHANNEL_DOWN;
 	mtx_leave(&lc->lc_txq->lq_mtx);

 	lc->lc_reset(lc);


Fix read/write to unallocated memory

Fix read/write to unallocated memory


Emit USB_EVENT_DRIVER_DETACH on detach.

Emit USB_EVENT_DRIVER_DETACH on detach.

PR:		83247
Submitted by:	Sangwoo Shim <ssw@neo.redjade.org>
MFC after:	2 weeks

--- sys/dev/usb/if_cdce.c
+++ sys/dev/usb/if_cdce.c
@@ -342,6 +342,9 @@
 	CDCE_UNLOCK(sc);
 	mtx_destroy(&sc->cdce_mtx);

+	usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->cdce_udev,
+		USBDEV(sc->cdce_dev));
+
 	return (0);
 }


Initial release

Initial release

error: pathspec 'include/System/file.h' did not match any file(s) known to git

--- include/System/file.h
+++ include/System/file.h
@@ -0,0 +1,21 @@
+/* $Id$ */
+/* Copyright (c) 2006 The DeforaOS Project */
+
+
+
+#ifndef LIBSYSTEM_FILE_H
+# define LIBSYSTEM_FILE_H
+
+
+/* types */
+typedef struct _File File;
+
+/* functions */
+File * file_new(char const * path, FileMode mode);
+void file_delete(File * file);
+
+/* useful */
+ssize_t file_read(File * file, void * buf, size_t size, ssize_t count);
+ssize_t file_write(File * file, void * buf, size_t size, ssize_t count);
+
+#endif /* !LIBSYSTEM_FILE_H */


i2c-designware: Enable RX_FULL interrupt

Enable RX_FULL interrupt mask by default, and hook it in the interrupt
handler.  If requested amount of rx data (defined by IC_RX_TL) is not
available, we don't have to process i2c_dw_read().

Signed-off-by: Shinya Kuribayashi <d2754d7ac0f98a027b401ab7a79478390ef3704b@necel.com>
Acked-by: Baruch Siach <53ccad33e0625915318fb3bc832e5c1c413d1294@tkos.co.il>
Signed-off-by: Ben Dooks <1177f64998f284a7348354b8e91cbbe575d9858a@fluff.org>

--- drivers/i2c/busses/i2c-designware.c
+++ drivers/i2c/busses/i2c-designware.c
@@ -342,7 +342,7 @@
 	u32 addr = msgs[dev->msg_write_idx].addr;
 	u32 buf_len = dev->tx_buf_len;

-	intr_mask = DW_IC_INTR_STOP_DET | DW_IC_INTR_TX_ABRT;
+	intr_mask = DW_IC_INTR_STOP_DET | DW_IC_INTR_TX_ABRT | DW_IC_INTR_RX_FULL;

 	if (!(dev->status & STATUS_WRITE_IN_PROGRESS)) {
 		/* Disable the adapter */
@@ -593,10 +593,11 @@
 		dev->status = STATUS_IDLE;
 	}

-	if (stat & DW_IC_INTR_TX_EMPTY) {
+	if (stat & DW_IC_INTR_RX_FULL)
 		i2c_dw_read(dev);
+
+	if (stat & DW_IC_INTR_TX_EMPTY)
 		i2c_dw_xfer_msg(dev);
-	}

 	/*
 	 * No need to modify or disable the interrupt mask here.


tile/PCI: use pci_scan_root_bus instead pci_scan_bus

It will update busn_res accordingly, so we get that for last_busno.

Acked-by: Chris Metcalf <074881f6f5da4d3b5278870ff234d1077ee622c0@tilera.com>
Signed-off-by: Yinghai Lu <0674548f4d596393408a51d6287a76ebba2f42aa@kernel.org>
Signed-off-by: Bjorn Helgaas <f10ec01be0c6b54271af5c550cd257810bdf3268@google.com>

--- arch/tile/kernel/pci.c
+++ arch/tile/kernel/pci.c
@@ -310,6 +310,7 @@
 		if (pci_scan_flags[i] == 0 && controllers[i].ops != NULL) {
 			struct pci_controller *controller = &controllers[i];
 			struct pci_bus *bus;
+			LIST_HEAD(resources);

 			if (tile_init_irqs(i, controller)) {
 				pr_err("PCI: Could not initialize IRQs\n");
@@ -327,7 +328,9 @@
 			 * This is inlined in linux/pci.h and calls into
 			 * pci_scan_bus_parented() in probe.c.
 			 */
-			bus = pci_scan_bus(0, controller->ops, controller);
+			pci_add_resource(&resources, &ioport_resource);
+			pci_add_resource(&resources, &iomem_resource);
+			bus = pci_scan_root_bus(NULL, 0, controller->ops, controller, &resources);
 			controller->root_bus = bus;
 			controller->last_busno = bus->busn_res.end;
 		}


Instead of just the data and stack segments, include all writable
segments (except memory-mapped devices) in the ELF core file.  This
is really nice.  You get access to the data areas of all shared
libraries, and even to files that are mapped read-write.

In the future, it might be good to add a new resource limit in the
spirit of RLIMIT_CORE.  It would specify the maximum sized writable
segment to include in core dumps.  Segments larger than that would
be omitted.  This would be useful for programs that map very large
files read/write but that still would like to get usable core dumps.

--- sys/kern/imgact_elf.c
+++ sys/kern/imgact_elf.c
@@ -26,7 +26,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- *	$Id: imgact_elf.c,v 1.30 1998/09/14 05:36:49 jdp Exp $
+ *	$Id: imgact_elf.c,v 1.31 1998/09/14 22:46:04 jdp Exp $
  */

 #include "opt_rlimit.h"
@@ -59,6 +59,7 @@
 #include <vm/pmap.h>
 #include <sys/lock.h>
 #include <vm/vm_map.h>
+#include <vm/vm_object.h>
 #include <vm/vm_prot.h>
 #include <vm/vm_extern.h>

@@ -684,13 +685,40 @@
  * Code for generating ELF core dumps.
  */

-static int elf_corehdr __P((struct proc *, struct vnode *, struct ucred *));
-static size_t elf_hdrsize(void);
-static void elf_puthdr(void *, size_t *, const prstatus_t *,
-    const prfpregset_t *, const prpsinfo_t *, const void *, size_t,
-    const void *, size_t);
-static void elf_putnote(void *, size_t *, const char *, int, const void *,
-    size_t);
+typedef void (*segment_callback) __P((vm_map_entry_t, void *));
+
+/* Closure for cb_put_phdr(). */
+struct phdr_closure {
+	Elf_Phdr *phdr;		/* Program header to fill in */
+	Elf_Off offset;		/* Offset of segment in core file */
+};
+
+/* Closure for cb_size_segment(). */
+struct sseg_closure {
+	int count;		/* Count of writable segments. */
+	size_t size;		/* Total size of all writable segments. */
+};
+
+/* Closure for cb_write_segment(). */
+struct wseg_closure {
+	struct proc *p;
+	struct vnode *vp;
+	struct ucred *cred;
+	off_t offset;		/* Position in file at which to write. */
+	int error;
+};
+
+static void cb_put_phdr __P((vm_map_entry_t, void *));
+static void cb_size_segment __P((vm_map_entry_t, void *));
+static void cb_write_segment __P((vm_map_entry_t, void *));
+static void each_writable_segment __P((struct proc *, segment_callback,
+    void *));
+static int elf_corehdr __P((struct proc *, struct vnode *, struct ucred *,
+    int, size_t));
+static void elf_puthdr __P((struct proc *, void *, size_t *,
+    const prstatus_t *, const prfpregset_t *, const prpsinfo_t *, int));
+static void elf_putnote __P((void *, size_t *, const char *, int,
+    const void *, size_t));

 extern int osreldate;

@@ -705,15 +733,30 @@
 	struct vattr vattr;
 	int error, error1;
 	char *name;			/* name of corefile */
+	struct sseg_closure seginfo;
 	size_t hdrsize;

 	STOPEVENT(p, S_CORE, 0);

 	if (sugid_coredump == 0 && p->p_flag & P_SUGID)
 		return (EFAULT);
-	hdrsize = elf_hdrsize();
-	if (hdrsize + ctob(vm->vm_dsize + vm->vm_ssize) >=
-	    p->p_rlimit[RLIMIT_CORE].rlim_cur)
+
+	/* Size the program segments. */
+	seginfo.count = 0;
+	seginfo.size = 0;
+	each_writable_segment(p, cb_size_segment, &seginfo);
+
+	/*
+	 * Calculate the size of the core file header area by making
+	 * a dry run of generating it.  Nothing is written, but the
+	 * size is calculated.
+	 */
+	hdrsize = 0;
+	elf_puthdr((struct proc *)NULL, (void *)NULL, &hdrsize,
+	    (const prstatus_t *)NULL, (const prfpregset_t *)NULL,
+	    (const prpsinfo_t *)NULL, seginfo.count);
+
+	if (hdrsize + seginfo.size >= p->p_rlimit[RLIMIT_CORE].rlim_cur)
 		return (EFAULT);
 	name = expand_name(p->p_comm, p->p_ucred->cr_uid, p->p_pid);
 	if (name == NULL)
@@ -737,17 +780,20 @@
 	VOP_LEASE(vp, p, cred, LEASE_WRITE);
 	VOP_SETATTR(vp, &vattr, cred, p);
 	p->p_acflag |= ACORE;
-	error = elf_corehdr(p, vp, cred);
-	if (error == 0)
-		error = vn_rdwr(UIO_WRITE, vp, vm->vm_daddr,
-		    (int)ctob(vm->vm_dsize), (off_t)hdrsize, UIO_USERSPACE,
-		    IO_NODELOCKED|IO_UNIT, cred, (int *) NULL, p);
-	if (error == 0)
-		error = vn_rdwr(UIO_WRITE, vp,
-		    (caddr_t) trunc_page(USRSTACK - ctob(vm->vm_ssize)),
-		    round_page(ctob(vm->vm_ssize)),
-		    (off_t)hdrsize + ctob(vm->vm_dsize), UIO_USERSPACE,
-		    IO_NODELOCKED|IO_UNIT, cred, (int *) NULL, p);
+	error = elf_corehdr(p, vp, cred, seginfo.count, hdrsize);
+	if (error == 0) {
+		struct wseg_closure wsc;
+
+		wsc.p = p;
+		wsc.vp = vp;
+		wsc.cred = cred;
+		wsc.offset = hdrsize;
+		wsc.error = 0;
+
+		each_writable_segment(p, cb_write_segment, &wsc);
+		error = wsc.error;
+	}
+
 out:
 	VOP_UNLOCK(vp, 0, p);
 	error1 = vn_close(vp, FWRITE, cred, p);
@@ -756,15 +802,131 @@
 	return (error);
 }

+/*
+ * A callback for each_writable_segment() to write out the segment's
+ * program header entry.
+ */
+static void
+cb_put_phdr(entry, closure)
+	vm_map_entry_t entry;
+	void *closure;
+{
+	struct phdr_closure *phc = (struct phdr_closure *)closure;
+	Elf_Phdr *phdr = phc->phdr;
+
+	phc->offset = round_page(phc->offset);
+
+	phdr->p_type = PT_LOAD;
+	phdr->p_offset = phc->offset;
+	phdr->p_vaddr = entry->start;
+	phdr->p_paddr = 0;
+	phdr->p_filesz = phdr->p_memsz = entry->end - entry->start;
+	phdr->p_align = PAGE_SIZE;
+	phdr->p_flags = 0;
+	if (entry->protection & VM_PROT_READ)
+		phdr->p_flags |= PF_R;
+	if (entry->protection & VM_PROT_WRITE)
+		phdr->p_flags |= PF_W;
+	if (entry->protection & VM_PROT_EXECUTE)
+		phdr->p_flags |= PF_X;
+
+	phc->offset += phdr->p_filesz;
+	phc->phdr++;
+}
+
+/*
+ * A callback for each_writable_segment() to gather information about
+ * the number of segments and their total size.
+ */
+static void
+cb_size_segment(entry, closure)
+	vm_map_entry_t entry;
+	void *closure;
+{
+	struct sseg_closure *ssc = (struct sseg_closure *)closure;
+
+	ssc->count++;
+	ssc->size += entry->end - entry->start;
+}
+
+/*
+ * A callback for each_writable_segment() to write out the segment contents.
+ */
+static void
+cb_write_segment(entry, closure)
+	vm_map_entry_t entry;
+	void *closure;
+{
+	struct wseg_closure *wsc = (struct wseg_closure *)closure;
+
+	if (wsc->error == 0) {
+		wsc->error = vn_rdwr(UIO_WRITE, wsc->vp, (caddr_t)entry->start,
+		    entry->end - entry->start, wsc->offset, UIO_USERSPACE,
+		    IO_NODELOCKED|IO_UNIT, wsc->cred, (int *)NULL, wsc->p);
+		if (wsc->error == 0)
+			wsc->offset += entry->end - entry->start;
+	}
+}
+
+/*
+ * For each writable segment in the process's memory map, call the given
+ * function with a pointer to the map entry and some arbitrary
+ * caller-supplied data.
+ */
+static void
+each_writable_segment(p, func, closure)
+	struct proc *p;
+	segment_callback func;
+	void *closure;
+{
+	vm_map_t map = &p->p_vmspace->vm_map;
+	vm_map_entry_t entry;
+
+	if (map != &curproc->p_vmspace->vm_map)
+		vm_map_lock_read(map);
+
+	for (entry = map->header.next;  entry != &map->header;
+	    entry = entry->next) {
+		vm_object_t obj;
+		vm_object_t backobj;
+
+		if (entry->eflags & (MAP_ENTRY_IS_A_MAP|MAP_ENTRY_IS_SUB_MAP) ||
+		    !(entry->protection & VM_PROT_WRITE))
+			continue;
+
+		/* Find the deepest backing object. */
+		backobj = obj = entry->object.vm_object;
+		if (backobj != NULL)
+			while (backobj->backing_object != NULL)
+				backobj = backobj->backing_object;
+
+		/* Ignore memory-mapped devices and such things. */
+		if (backobj->type != OBJT_DEFAULT &&
+		    backobj->type != OBJT_SWAP &&
+		    backobj->type != OBJT_VNODE)
+			continue;
+
+		(*func)(entry, closure);
+	}
+
+	if (map != &curproc->p_vmspace->vm_map)
+		vm_map_unlock_read(map);
+}
+
+/*
+ * Write the core file header to the file, including padding up to
+ * the page boundary.
+ */
 static int
-elf_corehdr(p, vp, cred)
+elf_corehdr(p, vp, cred, numsegs, hdrsize)
 	struct proc *p;
 	struct vnode *vp;
 	struct ucred *cred;
+	int numsegs;
+	size_t hdrsize;
 {
 	struct vmspace *vm = p->p_vmspace;
 	size_t off;
-	size_t hdrsize;
 	prstatus_t status;
 	prfpregset_t fpregset;
 	prpsinfo_t psinfo;
@@ -788,10 +950,10 @@
 	psinfo.pr_version = PRPSINFO_VERSION;
 	psinfo.pr_psinfosz = sizeof(prpsinfo_t);
 	strncpy(psinfo.pr_fname, p->p_comm, MAXCOMLEN);
-	psinfo.pr_psargs[0] = '\0';	/* XXX - args not implemented yet */
+	/* XXX - We don't fill in the command line arguments properly yet. */
+	strncpy(psinfo.pr_psargs, p->p_comm, PRARGSZ);

 	/* Allocate memory for building the header. */
-	hdrsize = elf_hdrsize();
 	hdr = malloc(hdrsize, M_TEMP, M_WAITOK);
 	if (hdr == NULL)
 		return EINVAL;
@@ -799,10 +961,7 @@

 	/* Fill in the header. */
 	off = 0;
-	elf_puthdr(hdr, &off, &status, &fpregset, &psinfo,
-	    vm->vm_daddr, ctob(vm->vm_dsize),
-	    (void *)trunc_page(USRSTACK - ctob(vm->vm_ssize)),
-	    ctob(vm->vm_ssize));
+	elf_puthdr(p, hdr, &off, &status, &fpregset, &psinfo, numsegs);

 	/* Write it to the core file. */
 	error = vn_rdwr(UIO_WRITE, vp, hdr, hdrsize, (off_t)0,
@@ -812,34 +971,20 @@
 	return error;
 }

-static size_t
-elf_hdrsize(void)
-{
-	size_t off;
-
-	off = 0;
-	elf_puthdr(NULL, &off, NULL, NULL, NULL, NULL, 0, NULL, 0);
-	return off;
-}
-
 static void
-elf_puthdr(void *dst, size_t *off, const prstatus_t *status,
-    const prfpregset_t *fpregset, const prpsinfo_t *psinfo,
-    const void *data, size_t datasz, const void *stack, size_t stacksz)
+elf_puthdr(struct proc *p, void *dst, size_t *off, const prstatus_t *status,
+    const prfpregset_t *fpregset, const prpsinfo_t *psinfo, int numsegs)
 {
 	size_t ehoff;
 	size_t phoff;
 	size_t noteoff;
 	size_t notesz;
-	size_t dataoff;
-	size_t stackoff;
-	int numsegs = 3;

 	ehoff = *off;
 	*off += sizeof(Elf_Ehdr);

 	phoff = *off;
-	*off += numsegs * sizeof(Elf_Phdr);
+	*off += (numsegs + 1) * sizeof(Elf_Phdr);

 	noteoff = *off;
 	elf_putnote(dst, off, "FreeBSD", NT_PRSTATUS, status,
@@ -850,12 +995,13 @@
 	    sizeof *psinfo);
 	notesz = *off - noteoff;

-	/* Align up to a page boundary for the data segment. */
+	/* Align up to a page boundary for the program segments. */
 	*off = round_page(*off);

 	if (dst != NULL) {
 		Elf_Ehdr *ehdr;
 		Elf_Phdr *phdr;
+		struct phdr_closure phc;

 		/*
 		 * Fill in the ELF header.
@@ -879,7 +1025,7 @@
 		ehdr->e_flags = 0;
 		ehdr->e_ehsize = sizeof(Elf_Ehdr);
 		ehdr->e_phentsize = sizeof(Elf_Phdr);
-		ehdr->e_phnum = numsegs;
+		ehdr->e_phnum = numsegs + 1;
 		ehdr->e_shentsize = sizeof(Elf_Shdr);
 		ehdr->e_shnum = 0;
 		ehdr->e_shstrndx = SHN_UNDEF;
@@ -900,25 +1046,10 @@
 		phdr->p_align = 0;
 		phdr++;

-		/* The data segment. */
-		phdr->p_type = PT_LOAD;
-		phdr->p_offset = *off;
-		phdr->p_vaddr = (Elf_Addr)data;
-		phdr->p_paddr = 0;
-		phdr->p_filesz = phdr->p_memsz = datasz;
-		phdr->p_align = PAGE_SIZE;
-		phdr->p_flags = PF_R | PF_W | PF_X;
-		phdr++;
-
-		/* The stack segment. */
-		phdr->p_type = PT_LOAD;
-		phdr->p_offset = *off + datasz;
-		phdr->p_vaddr = (Elf_Addr)stack;
-		phdr->p_paddr = 0;
-		phdr->p_filesz = phdr->p_memsz = stacksz;
-		phdr->p_align = PAGE_SIZE;
-		phdr->p_flags = PF_R | PF_W | PF_X;
-		phdr++;
+		/* All the writable segments from the program. */
+		phc.phdr = phdr;
+		phc.offset = *off;
+		each_writable_segment(p, cb_put_phdr, &phc);
 	}
 }


device/list - disable returning unmounted drives

--- core/system/fsys/device_manager_web.c
+++ core/system/fsys/device_manager_web.c
@@ -1691,7 +1691,8 @@
 				}

 				// now get all devices from database which are not mounted
-
+				//TODO we should get devices from DB assigned to user, to his groups and not mounted
+				/*
 				SQLLibrary *sqllib  = l->LibrarySQLGet( l );
 				if( sqllib != NULL )
 				{
@@ -1701,7 +1702,7 @@
 					char *query = FMalloc( querysize );
 					if( query != NULL )
 					{
-						sqllib->SNPrintF( sqllib, query, querysize, " ID NOT IN(%s)", bsMountedDrives->bs_Buffer );
+						sqllib->SNPrintF( sqllib, query, querysize, " ID NOT IN(%s) AND UserID", bsMountedDrives->bs_Buffer );
 						DEBUG("[DEVICE/LIST] sql: %s\n", query );

 						Filesystem *rootdev = sqllib->Load( sqllib, FilesystemDesc, query, &entries );
@@ -1710,9 +1711,22 @@
 							Filesystem *locdev = rootdev;
 							while( locdev != NULL )
 							{
-								FillDeviceInfo( devnr, tmp, TMP_SIZE_MIN1, locdev->fs_Mounted, locdev->fs_Name, locdev->fs_Type, locdev->fs_Path, NULL, NULL, 0, NULL, 0, locdev->fs_Server, locdev->fs_Port, locdev->fs_GroupID );
+								EscapeConfigFromString( locdev->fs_Config, &configEscaped, &executeCmd );
+
+								FillDeviceInfo( devnr, tmp, TMP_SIZE_MIN1, locdev->fs_Mounted, locdev->fs_Name, locdev->fs_Type, locdev->fs_Path, NULL, configEscaped, 0, executeCmd, 0, locdev->fs_Server, locdev->fs_Port, locdev->fs_GroupID );
 								//locdev->fs_Config
 								BufStringAdd( bs, tmp );
+
+								if( executeCmd )
+								{
+									FFree( executeCmd );
+									executeCmd = NULL;
+								}
+								if( configEscaped )
+								{
+									FFree( configEscaped );
+									configEscaped = NULL;
+								}

 								locdev = (Filesystem *)locdev->node.mln_Succ;
 							}
@@ -1725,6 +1739,7 @@
 					}
 					l->LibrarySQLDrop( l, sqllib );
 				}
+				*/

 				FFree( tmp );


ACPICA: Update version to 20140114.

ACPICA: Update version to 20140114.

Version 20140114.

Signed-off-by: Bob Moore <861d61e839a6c9cacf88c3a26b10371d2c9b211f@intel.com>
Signed-off-by: Lv Zheng <687b611ec106f085ac3db1fd0c8e91dc3509d58c@intel.com>
Signed-off-by: Rafael J. Wysocki <27ffc44a8ec6a212fba98cfc3246c6ce8ab131e0@intel.com>


IB/srp: Rearrange module description

IB/srp: Rearrange module description

Move the module version and release date into separate fields.
This makes the modinfo output easier to read.

Signed-off-by: Bart Van Assche <28563a2d387a4f8f033bf7abbf80937064dfbe0c@sandisk.com>
Reviewed-by: Sagi Grimberg <380ce2a82d3d08e67ab163b51dc6d30288ad3f13@mellanox.com>
Cc: Sebastian Parschauer <cefec785729e5544bb655781214fffa7fb6a10de@profitbricks.com>
Signed-off-by: Doug Ledford <f35204f44eabfe97bbcdd18aee9e9fffc59f29e1@redhat.com>


uml: aIO deadlock avoidance

uml: aIO deadlock avoidance

Allow deadlocks to be avoided in the AIO code by setting the pipe to the I/O
thread non-blocking.

Signed-off-by: Jeff Dike <f9b6309e85863eba5d28138b6a0f35841ce976d0@linux.intel.com>
Cc: Paolo 'Blaisorblade' Giarrusso <25fbe3e5acbb7edd90bb5fdeec999a792321fbc4@yahoo.it>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

--- arch/um/os-Linux/aio.c
+++ arch/um/os-Linux/aio.c
@@ -221,6 +221,11 @@

 	aio_req_fd_w = fds[0];
 	aio_req_fd_r = fds[1];
+
+	err = os_set_fd_block(aio_req_fd_w, 0);
+	if(err)
+		goto out_close_pipe;
+
 	err = run_helper_thread(not_aio_thread, NULL,
 				CLONE_FILES | CLONE_VM | SIGCHLD, &stack, 0);
 	if(err < 0)


mask out any action when copying the flags from the event to the knote..

Pointed out by:	Václav Haisman
Submitted by:	Dan Nelson (slightly modifed patch)
MFC after:	3 days


utime: add != operator

utime: add != operator


ACPICA: Add support for WDDT - Watchdog Descriptor Table

Header file support.

Signed-off-by: Bob Moore <861d61e839a6c9cacf88c3a26b10371d2c9b211f@intel.com>
Signed-off-by: Lin Ming <d6f051473f553588884d51874952f6fb19ae8261@intel.com>
Signed-off-by: Len Brown <b060cfa1096cc6e8be83699ddb4ed8a77dd63af5@intel.com>

--- include/acpi/actbl2.h
+++ include/acpi/actbl2.h
@@ -77,6 +77,7 @@
 #define ACPI_SIG_UEFI           "UEFI"	/* Uefi Boot Optimization Table */
 #define ACPI_SIG_WAET           "WAET"	/* Windows ACPI Emulated devices Table */
 #define ACPI_SIG_WDAT           "WDAT"	/* Watchdog Action Table */
+#define ACPI_SIG_WDDT           "WDDT"	/* Watchdog Timer Description Table */
 #define ACPI_SIG_WDRT           "WDRT"	/* Watchdog Resource Table */

 #ifdef ACPI_UNDEFINED_TABLES
@@ -918,6 +919,44 @@

 /*******************************************************************************
  *
+ * WDDT - Watchdog Descriptor Table
+ *        Version 1
+ *
+ * Conforms to "Using the Intel ICH Family Watchdog Timer (WDT)",
+ * Version 001, September 2002
+ *
+ ******************************************************************************/
+
+struct acpi_table_wddt {
+	struct acpi_table_header header;	/* Common ACPI table header */
+	u16 spec_version;
+	u16 table_version;
+	u16 pci_vendor_id;
+	struct acpi_generic_address address;
+	u16 max_count;		/* Maximum counter value supported */
+	u16 min_count;		/* Minimum counter value supported */
+	u16 period;
+	u16 status;
+	u16 capability;
+};
+
+/* Flags for Status field above */
+
+#define ACPI_WDDT_AVAILABLE     (1)
+#define ACPI_WDDT_ACTIVE        (1<<1)
+#define ACPI_WDDT_TCO_OS_OWNED  (1<<2)
+#define ACPI_WDDT_USER_RESET    (1<<11)
+#define ACPI_WDDT_WDT_RESET     (1<<12)
+#define ACPI_WDDT_POWER_FAIL    (1<<13)
+#define ACPI_WDDT_UNKNOWN_RESET (1<<14)
+
+/* Flags for Capability field above */
+
+#define ACPI_WDDT_AUTO_RESET    (1)
+#define ACPI_WDDT_ALERT_SUPPORT (1<<1)
+
+/*******************************************************************************
+ *
  * WDRT - Watchdog Resource Table
  *        Version 1
  *


sparc: i8042-sparcio.h: fix warning

sparc: i8042-sparcio.h: fix warning

drivers/input/serio/i8042-sparcio.h:95: warning: 'sparc_i8042_driver'
defined but not used

Signed-off-by: Alexander Beregalov <435b083b31024cbc6ffdb70c015fef51b502cce2@gmail.com>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- drivers/input/serio/i8042-sparcio.h
+++ drivers/input/serio/i8042-sparcio.h
@@ -40,6 +40,8 @@
 {
 	writeb(val, kbd_iobase + 0x64UL);
 }
+
+#ifdef CONFIG_PCI

 #define OBP_PS2KBD_NAME1	"kb_ps2"
 #define OBP_PS2KBD_NAME2	"keyboard"
@@ -101,9 +103,6 @@

 static int __init i8042_platform_init(void)
 {
-#ifndef CONFIG_PCI
-	return -ENODEV;
-#else
 	struct device_node *root = of_find_node_by_path("/");

 	if (!strcmp(root->name, "SUNW,JavaStation-1")) {
@@ -131,17 +130,25 @@
 	i8042_reset = 1;

 	return 0;
-#endif /* CONFIG_PCI */
 }

 static inline void i8042_platform_exit(void)
 {
-#ifdef CONFIG_PCI
 	struct device_node *root = of_find_node_by_path("/");

 	if (strcmp(root->name, "SUNW,JavaStation-1"))
 		of_unregister_driver(&sparc_i8042_driver);
-#endif
 }

+#else /* !CONFIG_PCI */
+static int __init i8042_platform_init(void)
+{
+	return -ENODEV;
+}
+
+static inline void i8042_platform_exit(void)
+{
+}
+#endif /* !CONFIG_PCI */
+
 #endif /* _I8042_SPARCIO_H */


Forgot to add this file, needing for KA60 support.

error: pathspec 'arch/vax/include/cca.h' did not match any file(s) known to git

--- arch/vax/include/cca.h
+++ arch/vax/include/cca.h
@@ -0,0 +1,127 @@
+/*	$OpenBSD: cca.h,v 1.1 2008/08/18 23:25:53 miod Exp $	*/
+/*	$NetBSD: cca.h,v 1.2 2008/03/11 05:34:02 matt Exp $	*/
+
+/*
+ * Copyright (c) 2008 Miodrag Vallat.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+/*
+ * Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *      This product includes software developed at Ludd, University of
+ *      Lule}, Sweden and its contributors.
+ * 4. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Console Communication Area (CCA) layout description.
+ *
+ * Based on NetBSD/vax <machine/cca.h>, further reconstructed from the
+ * description in VAX 6000 Model 600 System Technical User's Guide
+ * (660eatm1.pdf)
+ */
+
+struct cca {
+	struct cca *cca_base;	/* Physical base address of block */
+	uint16_t cca_size;	/* Size of this struct */
+	uint16_t cca_id;	/* 'CC' */
+	uint8_t  cca_nproc;	/* max number of CPUs */
+	uint8_t  cca_cksum;	/* Checksum of all earlier bytes */
+	uint8_t  cca_flags;
+#define	CCAF_BOOTIP		0x01	/* bootstrap in progress */
+#define	CCAF_REBOOT		0x10	/* reboot requested */
+#define	CCAF_REPROMPT		0x20	/* trigger the prom prompt */
+#define	CCAF_DISABLE_SECONDARY	0x40	/* ignore messages from secondaries */
+	uint8_t  cca_revision;
+
+	uint64_t cca_ready;	/* Data ready? */
+	uint64_t cca_console;	/* Processors in console mode */
+	uint64_t cca_enabled;	/* enabled/disabled */
+	uint32_t cca_bitmapsz;	/* Size of memory bitmap */
+	uint32_t cca_bitmap;	/* Address of memory bitmap */
+	uint32_t cca_bmcksum;	/* Bitmap checksum */
+	uint8_t	 cca_tknode;	/* TK nodes of boot device */
+#define	CCA_TKN_VAXBI_MASK	0x0f
+#define	CCA_TKN_VAXBI_SHIFT	0
+#define	CCA_TKN_XMI_MASK	0xf0
+#define	CCA_TKN_XMI_SHIFT	4
+	uint8_t	 cca_pad0[3];
+	uint64_t cca_starting;	/* Processors currently starting */
+	uint64_t cca_restart;	/* Processors currently restarting */
+	uint8_t	 cca_primary;	/* XMI node of boot processor */
+	uint8_t	 cca_power;
+	uint16_t cca_sernum_ext;
+	uint32_t cca_pad1[2];
+	uint64_t cca_halted;	/* Processors currently halted by user */
+	uint8_t  cca_sernum[8];	/* Serial number */
+/* CPU revisions */
+	struct {
+		uint8_t	 cr_compat;	/* cpu compatibility group */
+		uint8_t	 cr_pad0[3];
+		uint32_t cr_modulerev;	/* ascii module revision */
+	} cca_revs[16];
+	uint64_t cca_vecenab;	/* Processors with enabled vector processors */
+	uint64_t cca_vecwork;	/* Processors with working vector processors */
+	uint32_t cca_vecrevs[16];/* Vector processor revisions */
+	uint32_t cca_console_xpgr[16];
+	uint32_t cca_entry_xpgr[16];
+	uint8_t  cca_pad2[80];	/* pad to VAX_NBPG */
+/* Inter-CPU communication structs */
+	struct {
+		uint8_t	 cc_flags;	/* Status flags */
+#define CCACCF_RXRDY	0x01	/* has message in rxbuf */
+#define	CCACCF_DEST	0x02	/* currently sending to zdst */
+#define	CCACCF_SRC	0x04	/* currently receiving from zsrc */
+#define	CCACCF_ALT	0x08	/* unable to communicate through cca */
+		uint8_t	 cc_zdst;	/* Node sending to */
+		uint8_t	 cc_zsrc;	/* Node sending from */
+		uint8_t	 cc_znid;	/* Originating node if not zsrc */
+		uint8_t	 cc_txlen;	/* Length of transmit message */
+		uint8_t	 cc_rxlen;	/* Length of receive message */
+		uint16_t cc_rxcd;
+#define	CCACC_RX_DATA_MASK	0x00ff	/* character received */
+#define	CCACC_RX_DATA_SHIFT	0
+#define	CCACC_RX_NODE_MASK	0x0f00	/* originating node */
+#define	CCACC_RX_NODE_SHIFT	8
+#define	CCACC_RX_DATA_READY	0x8000	/* rxcd assembled */
+		char	 cc_txbuf[80];	/* Transmit buffer */
+		char	 cc_rxbuf[80];	/* Receive buffer */
+	} cca_cc[16];
+};
+
+#ifdef _KERNEL
+extern	struct cca *cca;
+#endif


Set TDF_NEEDRESCHED when a higher priority thread is scheduled in
sched_add() rather than just doing it in sched_wakeup().  The old
ithread preemption code used to set NEEDRESCHED unconditionally if it
didn't preempt which masked this bug in SCHED_4BSD.

Noticed by:	jake
Reported by:	kensmith, marcel


sh: Bump up ARCH_KMALLOC_MINALIGN for DMA cases.

Signed-off-by: Paul Mundt <38b52dbb5f0b63d149982b6c5de788ec93a89032@linux-sh.org>

--- include/asm-sh/page.h
+++ include/asm-sh/page.h
@@ -138,22 +138,18 @@
 #endif

 /*
- * Slub defaults to 8-byte alignment, we're only interested in 4.
- * Slab defaults to BYTES_PER_WORD, which ends up being the same anyways.
+ * Some drivers need to perform DMA into kmalloc'ed buffers
+ * and so we have to increase the kmalloc minalign for this.
  */
-#ifdef CONFIG_SUPERH32
-#define ARCH_KMALLOC_MINALIGN	4
-#define ARCH_SLAB_MINALIGN	4
-#else
-/* If gcc inlines memset, it will use st.q instructions.  Therefore, we need
-   kmalloc allocations to be 8-byte aligned.  Without this, the alignment
-   becomes BYTE_PER_WORD i.e. only 4 (since sizeof(long)==sizeof(void*)==4 on
-   sh64 at the moment). */
-#define ARCH_KMALLOC_MINALIGN	8
+#define ARCH_KMALLOC_MINALIGN	L1_CACHE_BYTES

+#ifdef CONFIG_SUPERH64
 /*
- * We want 8-byte alignment for the slab caches as well, otherwise we have
- * the same BYTES_PER_WORD (sizeof(void *)) min align in kmem_cache_create().
+ * While BYTES_PER_WORD == 4 on the current sh64 ABI, GCC will still
+ * happily generate {ld/st}.q pairs, requiring us to have 8-byte
+ * alignment to avoid traps. The kmalloc alignment is gauranteed by
+ * virtue of L1_CACHE_BYTES, requiring this to only be special cased
+ * for slab caches.
  */
 #define ARCH_SLAB_MINALIGN	8
 #endif


Removed redundant static method.

Removed redundant static method.


V4L/DVB (3199): Removed some unneeded #ifdef's

- Removed some unneeded #ifdef's

Signed-off-by: Michael Krufky <00524723a60798c74a43fcc620c25dd7b9ece078@m1k.net>
Signed-off-by: Mauro Carvalho Chehab <ad86ba2154032c9f55743a190faa2459a9d61d42@brturbo.com.br>

--- drivers/media/dvb/bt8xx/dvb-bt8xx.c
+++ drivers/media/dvb/bt8xx/dvb-bt8xx.c
@@ -600,7 +600,6 @@
 	struct dst_state* state = NULL;

 	switch(type) {
-#ifdef BTTV_BOARD_DVICO_DVBT_LITE
 	case BTTV_BOARD_DVICO_DVBT_LITE:
 		card->fe = mt352_attach(&thomson_dtt7579_config, card->i2c_adapter);
 		if (card->fe != NULL) {
@@ -608,16 +607,13 @@
 			card->fe->ops->info.frequency_max = 862000000;
 		}
 		break;
-#endif
-
-#ifdef BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE
+
 	case BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE:
 		lgdt330x_reset(card);
 		card->fe = lgdt330x_attach(&tdvs_tua6034_config, card->i2c_adapter);
 		if (card->fe != NULL)
 			dprintk ("dvb_bt8xx: lgdt330x detected\n");
 		break;
-#endif

 #ifdef BTTV_BOARD_TWINHAN_VP3021
 	case BTTV_BOARD_TWINHAN_VP3021:
@@ -812,9 +808,7 @@
 		card->irq_err_ignore = 0;
 		break;

-#ifdef BTTV_BOARD_DVICO_DVBT_LITE
 	case BTTV_BOARD_DVICO_DVBT_LITE:
-#endif
 		card->gpio_mode = 0x0400C060;
 		card->op_sync_orin = 0;
 		card->irq_err_ignore = 0;
@@ -823,9 +817,7 @@
 		 * DA_APP(parallel) */
 		break;

-#ifdef BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE
 	case BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE:
-#endif
 		card->gpio_mode = 0x0400c060;
 		card->op_sync_orin = BT878_RISC_SYNC_MASK;
 		card->irq_err_ignore = BT878_AFBUS | BT878_AFDSR;


Fix build.

Fix build.


x86, hpet: Fix bogus error check in hpet_assign_irq()

create_irq() returns -1 if the interrupt allocation failed, but the
code checks for irq == 0.

Use create_irq_nr() instead.

Signed-off-by: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>
Cc: Venkatesh Pallipadi <0192021264f7ae88e4662be72db68a0c93b1d052@google.com>
LKML-Reference: <d9046e93dd2b42c154d6c11839ab2fe118b3bce6@localhost6.localdomain6>
Cc: 4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@kernel.org
Signed-off-by: H. Peter Anvin <8a453bad9912ffe59bc0f0b8abe03df9be19379e@linux.intel.com>

--- arch/x86/kernel/hpet.c
+++ arch/x86/kernel/hpet.c
@@ -506,7 +506,7 @@
 {
 	unsigned int irq;

-	irq = create_irq();
+	irq = create_irq_nr(0, -1);
 	if (!irq)
 		return -EINVAL;


Allow spaces in matched square bracket tokens

GetPot was breaking "[tokens like this]" into "[tokens" "like"
"this]", which was fine for section names, but now in the near future
we can use square brackets for preprocessor-like directives too.

--- include/base/getpot.h
+++ include/base/getpot.h
@@ -414,6 +414,7 @@
     inline const std::string  _get_next_token(std::istream& istr);
     inline const std::string  _get_string(std::istream& istr);
     inline const std::string  _get_until_closing_bracket(std::istream& istr);
+    inline const std::string  _get_until_closing_square_bracket(std::istream& istr);

     inline STRING_VECTOR      _read_in_stream(std::istream& istr);
     inline STRING_VECTOR      _read_in_file(const std::string& FileName);
@@ -1010,6 +1011,10 @@
 	    token += '{' + _get_until_closing_bracket(istr);
 	    continue;
 	}
+	else if( tmp == '[') {
+	    token += '[' + _get_until_closing_square_bracket(istr);
+	    continue;
+	}
 	else if( tmp == '$' && last_letter == '\\') {
 	    token += tmp; tmp = 0;  //  so that last_letter will become = 0, not '$';
 	    continue;
@@ -1056,6 +1061,28 @@
 	    if( brackets == 0) return str + '}';
 	    else if( tmp == '\\' && last_letter != '\\')
 		continue;  // do not append an unbackslashed backslash
+	}
+	str += tmp;
+    }
+}
+
+
+inline const std::string
+GetPot::_get_until_closing_square_bracket(std::istream& istr)
+    // parse input until next matching ]
+{
+    std::string str = "";
+    int    tmp = 0;
+    int    brackets = 1;
+    while(1 + 1 == 2) {
+	tmp = istr.get();
+	if( tmp == EOF) return str;
+	else if( tmp == '[') {
+            brackets += 1;
+        }
+	else if( tmp == ']') {
+	    brackets -= 1;
+	    if( brackets == 0) return str + ']';
 	}
 	str += tmp;
     }


V4L/DVB: DVB: fix dvr node refcounting

V4L/DVB: DVB: fix dvr node refcounting

In dvb_dvr_release, there is a test dvbdev->users==-1, but users are
never negative. This error results in hung tasks:
  task                        PC stack   pid father
bash          D ffffffffa000c948     0  3264   3170 0x00000000
 ffff88003aec5ce8 0000000000000086 0000000000011f80 0000000000011f80
 ffff88003aec5fd8 ffff88003aec5fd8 ffff88003b848670 0000000000011f80
 ffff88003aec5fd8 0000000000011f80 ffff88003e02a030 ffff88003b848670
Call Trace:
 [<ffffffff813dd4a5>] dvb_dmxdev_release+0xc5/0x130
 [<ffffffff8107b750>] ? autoremove_wake_function+0x0/0x40
 [<ffffffffa00013a2>] dvb_usb_adapter_dvb_exit+0x42/0x70 [dvb_usb]
 [<ffffffffa0000525>] dvb_usb_exit+0x55/0xd0 [dvb_usb]
 [<ffffffffa00005ee>] dvb_usb_device_exit+0x4e/0x70 [dvb_usb]
 [<ffffffffa000a065>] af9015_usb_device_exit+0x55/0x60 [dvb_usb_af9015]
 [<ffffffff813a3f05>] usb_unbind_interface+0x55/0x1a0
 [<ffffffff81316000>] __device_release_driver+0x70/0xe0
...

So check against 1 there instead.

BTW why's the TODO there? Adding TODOs to the code without
descriptions is like adding nothing.

Signed-off-by: Jiri Slaby <dfbf39eb5bf303a3db5454d815cb8c8888cbadf9@suse.cz>
Signed-off-by: Mauro Carvalho Chehab <ad86ba2154032c9f55743a190faa2459a9d61d42@redhat.com>

--- drivers/media/dvb/dvb-core/dmxdev.c
+++ drivers/media/dvb/dvb-core/dmxdev.c
@@ -207,7 +207,7 @@
 	}
 	/* TODO */
 	dvbdev->users--;
-	if(dvbdev->users==-1 && dmxdev->exit==1) {
+	if (dvbdev->users == 1 && dmxdev->exit == 1) {
 		fops_put(file->f_op);
 		file->f_op = NULL;
 		mutex_unlock(&dmxdev->mutex);


lib: file_wait/try_lock() treats EINTR differently now for timeouts and for actual signals.


kern_execve.c hasn't been around in ages, so update the file(s) where
a_magic is used instead of the a_midmag....

# maybe we can retire this hack soon...

--- sys/sys/imgact_aout.h
+++ sys/sys/imgact_aout.h
@@ -119,7 +119,7 @@
      uint32_t	a_trsize;	/* text relocation size */
      uint32_t	a_drsize;	/* data relocation size */
 };
-#define a_magic a_midmag /* XXX Hack to work with current kern_execve.c */
+#define a_magic a_midmag /* XXX Hack to work with imgact_{aout,gzip}.c */

 /* a_magic */
 #define	OMAGIC		0407	/* old impure format */


KVM: x86 emulator: do not call writeback if msr access fails.

Signed-off-by: Gleb Natapov <03189597947f75187c4136ade35aec34feed9dc1@redhat.com>
Signed-off-by: Marcelo Tosatti <958bcd1f4a7a8c36dca09fe3fa9cb5f1483adf51@redhat.com>

--- arch/x86/kvm/emulate.c
+++ arch/x86/kvm/emulate.c
@@ -2563,7 +2563,7 @@
 			| ((u64)c->regs[VCPU_REGS_RDX] << 32);
 		if (kvm_set_msr(ctxt->vcpu, c->regs[VCPU_REGS_RCX], msr_data)) {
 			kvm_inject_gp(ctxt->vcpu, 0);
-			c->eip = ctxt->eip;
+			goto done;
 		}
 		rc = X86EMUL_CONTINUE;
 		c->dst.type = OP_NONE;
@@ -2572,7 +2572,7 @@
 		/* rdmsr */
 		if (kvm_get_msr(ctxt->vcpu, c->regs[VCPU_REGS_RCX], &msr_data)) {
 			kvm_inject_gp(ctxt->vcpu, 0);
-			c->eip = ctxt->eip;
+			goto done;
 		} else {
 			c->regs[VCPU_REGS_RAX] = (u32)msr_data;
 			c->regs[VCPU_REGS_RDX] = msr_data >> 32;


Add SK_API to path == decl.
Over-the-shoulder review from robertphillips@

git-svn-id: e8541e15acce502a64c929015570ad1648e548cd@5426 2bbb7eff-a529-9590-31e7-b0007b416f81

--- include/core/SkPath.h
+++ include/core/SkPath.h
@@ -42,7 +42,7 @@

     SkPath& operator=(const SkPath&);

-    friend bool operator==(const SkPath&, const SkPath&);
+    friend  SK_API bool operator==(const SkPath&, const SkPath&);
     friend bool operator!=(const SkPath& a, const SkPath& b) {
         return !(a == b);
     }


V4L/DVB (5635): Budget-av: convert philips sd1878 / tda8261 to use dvb-pll

removed philips_sd1878_tda8261_tuner_set_params, using dvb_pll_attach, instead.

Signed-off-by: Michael Krufky <00524723a60798c74a43fcc620c25dd7b9ece078@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <ad86ba2154032c9f55743a190faa2459a9d61d42@infradead.org>

--- drivers/media/dvb/ttpci/budget-av.c
+++ drivers/media/dvb/ttpci/budget-av.c
@@ -828,28 +828,6 @@
 	0xff, 0xff
 };

-static int philips_sd1878_tda8261_tuner_set_params(struct dvb_frontend *fe,
-						   struct dvb_frontend_parameters *params)
-{
-	u8              buf[4];
-	int             rc;
-	struct i2c_msg  tuner_msg = {.addr=0x60,.flags=0,.buf=buf,.len=sizeof(buf)};
-	struct budget *budget = (struct budget *) fe->dvb->priv;
-
-	if((params->frequency < 950000) || (params->frequency > 2150000))
-		return -EINVAL;
-
-	rc=dvb_pll_configure(&dvb_pll_philips_sd1878_tda8261, buf, params);
-	if(rc < 0) return rc;
-
-	if (fe->ops.i2c_gate_ctrl)
-		fe->ops.i2c_gate_ctrl(fe, 1);
-	if(i2c_transfer(&budget->i2c_adap, &tuner_msg, 1) != 1)
-		return -EIO;
-
-    return 0;
-}
-
 static int philips_sd1878_ci_set_symbol_rate(struct dvb_frontend *fe,
 		u32 srate, u32 ratio)
 {
@@ -984,7 +962,9 @@
 		fe = dvb_attach(stv0299_attach, &philips_sd1878_config,
 				&budget_av->budget.i2c_adap);
 		if (fe) {
-			fe->ops.tuner_ops.set_params = philips_sd1878_tda8261_tuner_set_params;
+			dvb_attach(dvb_pll_attach, fe, 0x60,
+				   &budget_av->budget.i2c_adap,
+				   &dvb_pll_philips_sd1878_tda8261);
 		}
 		break;


x86, PAT: Change order of cpa and free in set_memory_wb

To be free of aliasing due to races, set_memory_* interfaces should
follow ordering of reserving, changing memtype to UC/WC, changing
memtype back to WB followed by free.

Signed-off-by: Venkatesh Pallipadi <6b7ddbe82beec4500037cfc9bc14de0a76fca340@intel.com>
Signed-off-by: Suresh Siddha <a42fd12510d3895be740fb89f87586733ee62f57@intel.com>
LKML-Reference: <b96d2df82b115a765551264eab376ff4e47092aa@intel.com>
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>

--- arch/x86/mm/pageattr.c
+++ arch/x86/mm/pageattr.c
@@ -1021,15 +1021,19 @@

 int set_memory_wb(unsigned long addr, int numpages)
 {
+	int ret = _set_memory_wb(addr, numpages);
 	free_memtype(__pa(addr), __pa(addr) + numpages * PAGE_SIZE);
-
-	return _set_memory_wb(addr, numpages);
+	return ret;
 }
 EXPORT_SYMBOL(set_memory_wb);

 int set_memory_array_wb(unsigned long *addr, int addrinarray)
 {
 	int i;
+	int ret;
+
+	ret = change_page_attr_clear(addr, addrinarray,
+				      __pgprot(_PAGE_CACHE_MASK), 1);

 	for (i = 0; i < addrinarray; i++) {
 		unsigned long start = __pa(addr[i]);
@@ -1042,8 +1046,7 @@
 		}
 		free_memtype(start, end);
 	}
-	return change_page_attr_clear(addr, addrinarray,
-				      __pgprot(_PAGE_CACHE_MASK), 1);
+	return ret;
 }
 EXPORT_SYMBOL(set_memory_array_wb);


ec_commands: Add structs for host command protocol V4

This only adds the structs for V4 packets.  Host command support for
them is coming in a subsequent CL.  V3 packets will continue to be
supported for a while, until all sides support V4.

BUG=chromium:787159
BRANCH=none
TEST=make -j runtests

Change-Id: I7e188a063d8ed60c85f3b8359959c424e3ccd1d9
Signed-off-by: Randall Spangler <62698fdbb84d1779579ee80c3f39fac22017e5bc@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/780452
Reviewed-by: Nicolas Boichat <f3daba1cdc403799935674d3cd4b0e5bd1804232@chromium.org>

--- include/ec_commands.h
+++ include/ec_commands.h
@@ -502,7 +502,11 @@
 	EC_RES_REQUEST_TRUNCATED = 13,  /* Didn't get the entire request */
 	EC_RES_RESPONSE_TOO_BIG = 14,   /* Response was too big to handle */
 	EC_RES_BUS_ERROR = 15,		/* Communications bus error */
-	EC_RES_BUSY = 16		/* Up but too busy.  Should retry */
+	EC_RES_BUSY = 16,		/* Up but too busy.  Should retry */
+	EC_RES_INVALID_HEADER_VERSION = 17,  /* Header version invalid */
+	EC_RES_INVALID_HEADER_CRC = 18,      /* Header CRC invalid */
+	EC_RES_INVALID_DATA_CRC = 19,        /* Data CRC invalid */
+	EC_RES_DUP_UNAVAILABLE = 20,         /* Can't resend response */
 };

 /*
@@ -808,6 +812,136 @@
 	/* Unused bytes in current protocol version; set to 0 */
 	uint16_t reserved;
 };
+
+/*****************************************************************************/
+
+/*
+ * Host command protocol V4.
+ *
+ * Packets always start with a request or response header.  They are followed
+ * by data_len bytes of data.  If the data_crc_present flag is set, the data
+ * bytes are followed by a CRC-8 of that data, using using x^8 + x^2 + x + 1
+ * polynomial.
+ *
+ * Host algorithm when sending a request q:
+ *
+ * 101) tries_left=(some value, e.g. 3);
+ * 102) q.seq_num++
+ * 103) q.seq_dup=0
+ * 104) Calculate q.header_crc.
+ * 105) Send request q to EC.
+ * 106) Wait for response r.  Go to 201 if received or 301 if timeout.
+ *
+ * 201) If r.struct_version != 4, go to 301.
+ * 202) If r.header_crc mismatches calculated CRC for r header, go to 301.
+ * 203) If r.data_crc_present and r.data_crc mismatches, go to 301.
+ * 204) If r.seq_num != q.seq_num, go to 301.
+ * 205) If r.seq_dup == q.seq_dup, return success.
+ * 207) If r.seq_dup == 1, go to 301.
+ * 208) Return error.
+ *
+ * 301) If --tries_left <= 0, return error.
+ * 302) If q.seq_dup == 1, go to 105.
+ * 303) q.seq_dup = 1
+ * 304) Go to 104.
+ *
+ * EC algorithm when receiving a request q.
+ * EC has response buffer r, error buffer e.
+ *
+ * 101) If q.struct_version != 4, set e.result = EC_RES_INVALID_HEADER_VERSION
+ *      and go to 301
+ * 102) If q.header_crc mismatches calculated CRC, set e.result =
+ *      EC_RES_INVALID_HEADER_CRC and go to 301
+ * 103) If q.data_crc_present, calculate data CRC.  If that mismatches the CRC
+ *      byte at the end of the packet, set e.result = EC_RES_INVALID_DATA_CRC
+ *      and go to 301.
+ * 104) If q.seq_dup == 0, go to 201.
+ * 105) If q.seq_num != r.seq_num, go to 201.
+ * 106) If q.seq_dup == r.seq_dup, go to 205, else go to 203.
+ *
+ * 201) Process request q into response r.
+ * 202) r.seq_num = q.seq_num
+ * 203) r.seq_dup = q.seq_dup
+ * 204) Calculate r.header_crc
+ * 205) If r.data_len > 0 and data is no longer available, set e.result =
+ *      EC_RES_DUP_UNAVAILABLE and go to 301.
+ * 206) Send response r.
+ *
+ * 301) e.seq_num = q.seq_num
+ * 302) e.seq_dup = q.seq_dup
+ * 303) Calculate e.header_crc.
+ * 304) Send error response e.
+ */
+
+/* Version 4 request from host */
+struct __ec_align4 ec_host_request4 {
+	/*
+	 * bits 0-3: struct_version: Structure version (=4)
+	 * bit    4: is_response: Is response (=0)
+	 * bits 5-6: seq_num: Sequence number
+	 * bit    7: seq_dup: Sequence duplicate flag
+	 */
+	uint8_t fields0;
+
+	/*
+	 * bits 0-4: command_version: Command version
+	 * bits 5-6: Reserved (set 0, ignore on read)
+	 * bit    7: data_crc_present: Is data CRC present after data
+	 */
+	uint8_t fields1;
+
+	/* Command code (EC_CMD_*) */
+	uint16_t command;
+
+	/* Length of data which follows this header (not including data CRC) */
+	uint16_t data_len;
+
+	/* Reserved (set 0, ignore on read) */
+	uint8_t reserved;
+
+	/* CRC-8 of above fields, using x^8 + x^2 + x + 1 polynomial */
+	uint8_t header_crc;
+};
+
+/* Version 4 response from EC */
+struct __ec_align4 ec_host_response4 {
+	/*
+	 * bits 0-3: struct_version: Structure version (=4)
+	 * bit    4: is_response: Is response (=1)
+	 * bits 5-6: seq_num: Sequence number
+	 * bit    7: seq_dup: Sequence duplicate flag
+	 */
+	uint8_t fields0;
+
+	/*
+	 * bits 0-6: Reserved (set 0, ignore on read)
+	 * bit    7: data_crc_present: Is data CRC present after data
+	 */
+	uint8_t fields1;
+
+	/* Result code (EC_RES_*) */
+	uint16_t result;
+
+	/* Length of data which follows this header (not including data CRC) */
+	uint16_t data_len;
+
+	/* Reserved (set 0, ignore on read) */
+	uint8_t reserved;
+
+	/* CRC-8 of above fields, using x^8 + x^2 + x + 1 polynomial */
+	uint8_t header_crc;
+};
+
+/* Fields in fields0 byte */
+#define EC_PACKET4_0_STRUCT_VERSION_MASK	0x0f
+#define EC_PACKET4_0_IS_RESPONSE_MASK		0x10
+#define EC_PACKET4_0_SEQ_NUM_SHIFT		5
+#define EC_PACKET4_0_SEQ_NUM_MASK		0x60
+#define EC_PACKET4_0_SEQ_DUP_MASK		0x80
+
+/* Fields in fields1 byte */
+#define EC_PACKET4_1_COMMAND_VERSION_MASK	0x1f  /* (request only) */
+#define EC_PACKET4_1_DATA_CRC_PRESENT_MASK	0x80

 /*****************************************************************************/
 /*


V4L/DVB (4919): Budget-ci: Use SAA7146_IER_ENABLE/DISABLE to enable or disable a hardware interrupt

Use SAA7146_IER_ENABLE/DISABLE to enable or disable a hardware interrupt.

Signed-off-by: Hartmut Birr <2d9809bd736e768bda024ad7a54216e72981dbf3@gmail.com>
Signed-off-by: Oliver Endriss <9b3f86b56e4ec8d638cb909e38a925ff6631c42a@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <ad86ba2154032c9f55743a190faa2459a9d61d42@infradead.org>

--- drivers/media/dvb/ttpci/budget-ci.c
+++ drivers/media/dvb/ttpci/budget-ci.c
@@ -261,7 +261,7 @@
 	tasklet_init(&budget_ci->ir.msp430_irq_tasklet, msp430_ir_interrupt,
 		     (unsigned long) budget_ci);

-	saa7146_write(saa, IER, saa7146_read(saa, IER) | MASK_06);
+	SAA7146_IER_ENABLE(saa, MASK_06);
 	saa7146_setgpio(saa, 3, SAA7146_GPIO_IRQHI);

 	return 0;
@@ -277,7 +277,7 @@
 	struct saa7146_dev *saa = budget_ci->budget.dev;
 	struct input_dev *dev = budget_ci->ir.dev;

-	saa7146_write(saa, IER, saa7146_read(saa, IER) & ~MASK_06);
+	SAA7146_IER_DISABLE(saa, MASK_06);
 	saa7146_setgpio(saa, 3, SAA7146_GPIO_INPUT);
 	tasklet_kill(&budget_ci->ir.msp430_irq_tasklet);

@@ -537,7 +537,7 @@
 		} else {
 			saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQHI);
 		}
-		saa7146_write(saa, IER, saa7146_read(saa, IER) | MASK_03);
+		SAA7146_IER_ENABLE(saa, MASK_03);
 	}

 	// enable interface
@@ -569,7 +569,7 @@

 	// disable CI interrupts
 	if (budget_ci->ci_irq) {
-		saa7146_write(saa, IER, saa7146_read(saa, IER) & ~MASK_03);
+		SAA7146_IER_DISABLE(saa, MASK_03);
 		saa7146_setgpio(saa, 0, SAA7146_GPIO_INPUT);
 		tasklet_kill(&budget_ci->ciintf_irq_tasklet);
 	}


x86/mm/pageattr: Lookup address in an arbitrary PGD

This is preparatory work in order to be able to map pages into a
specified PGD and not implicitly and only into init_mm.

Signed-off-by: Borislav Petkov <0691a664b24b6f15b20cd5aee64b72271db08be1@suse.de>
Signed-off-by: Matt Fleming <b02f0790d66a0f0a6b369873bf6df37420fbe5dd@intel.com>


ec_commands: Fix C++ compilation

ec_commands: Fix C++ compilation

This union has non-zero size in C++.

BRANCH=none
BUG=b:234181908
TEST=make buildall

Signed-off-by: Tom Hughes <fc5c12f30a5ed2baa0581f44ee14ad1eb7b20d83@chromium.org>
Change-Id: Ibd1216ebdef1d94725e7b3de341f677ccd261823
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3872550
Reviewed-by: Yuval Peress <50dc11c009bd4d7e9d9d15a383c1743ce5ee82ef@google.com>

--- include/ec_commands.h
+++ include/ec_commands.h
@@ -1745,12 +1745,13 @@
 	uint32_t offset;
 	uint32_t size;
 	/* Followed by data to write. This union allows accessing an
-	 * underlying buffer as uint32s or uint8s for convenience. This does not
-	 * increase the size of the struct.
+	 * underlying buffer as uint32s or uint8s for convenience. Flexible
+	 * array members are not available in C++, so the size is 1 for C++
+	 * compatibility.
 	 */
 	union {
-		uint32_t words32[0];
-		uint8_t bytes[0];
+		uint32_t words32[1];
+		uint8_t bytes[1];
 	} data;
 } __ec_align4;


[media] msi2500: correct style issues

[media] msi2500: correct style issues

Correct some style issues, mostly reported by checkpatch.pl.

Signed-off-by: Antti Palosaari <293134fe763ce2d9d8609280ea107c73cbd2eb86@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <0cae1d1e981e84d16b82ca3d17be8a7f826608d3@samsung.com>


x86: cpa: clean up change_page_attr_set/clear()

Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>
Signed-off-by: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>

--- arch/x86/mm/pageattr.c
+++ arch/x86/mm/pageattr.c
@@ -312,10 +312,10 @@
 	for (i = 0; i < numpages ; i++) {

 		pte = lookup_address(addr, &level);
-		if (pte)
-			current_prot = pte_pgprot(*pte);
-		else
-			pgprot_val(current_prot) = 0;
+		if (!pte)
+			return -EINVAL;
+
+		current_prot = pte_pgprot(*pte);

 		pgprot_val(new_prot) =
 			pgprot_val(current_prot) | pgprot_val(prot);
@@ -356,11 +356,12 @@
 	int i, ret;

 	for (i = 0; i < numpages; i++) {
+
 		pte = lookup_address(addr, &level);
-		if (pte)
-			current_prot = pte_pgprot(*pte);
-		else
-			pgprot_val(current_prot) = 0;
+		if (!pte)
+			return -EINVAL;
+
+		current_prot = pte_pgprot(*pte);

 		pgprot_val(new_prot) =
 				pgprot_val(current_prot) & ~pgprot_val(prot);


Added a missing header file for the 3.02 release.

git-svn-id: 2d64e9b2809dd9ad19a6aecaa4a58f29b79a507a@659 d0cd1f9f-072b-0410-8dd7-cf729c803f20

error: pathspec 'ccstruct/params_training_featdef.h' did not match any file(s) known to git

--- ccstruct/params_training_featdef.h
+++ ccstruct/params_training_featdef.h
@@ -0,0 +1,118 @@
+///////////////////////////////////////////////////////////////////////
+// File:        params_training_featdef.h
+// Description: Feature definitions for params training.
+// Author:      Rika Antonova
+// Created:     Mon Nov 28 11:26:42 PDT 2011
+//
+// (C) Copyright 2011, Google Inc.
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+///////////////////////////////////////////////////////////////////////
+
+#ifndef TESSERACT_WORDREC_PARAMS_TRAINING_FEATDEF_H_
+#define TESSERACT_WORDREC_PARAMS_TRAINING_FEATDEF_H_
+
+#include "genericvector.h"
+#include "strngs.h"
+
+namespace tesseract {
+
+// Raw features extracted from a single OCR hypothesis.
+// The features are non-normalized real-valued quantities with
+// unbounded range and unknown distribution.
+// Normalization / binarization of these features is done at a later stage.
+// Note: when adding new fields to this enum make sure to modify
+// kParamsTrainingRawFeatureTypeName enum accordingly.
+enum ParamsTrainingRawFeatureType {
+  // What dictionary (if any) was this hypothesis found in.
+  // See PermuterType enum in ccstruct/ratngs.h for interpretation.
+  PTRAIN_RAW_FEATURE_DICT_MATCH_TYPE,     // 0
+  // Boolean indicator of whether this hypothesis is ambiguous to a known
+  // dictionary word (or a valid number pattern).
+  PTRAIN_RAW_FEATURE_UNAMBIG_DICT_MATCH,  // 1
+  // Shape cost of the segmentation path for this hypothesis.
+  PTRAIN_RAW_FEATURE_SHAPE_COST,          // 2
+  // Character ngram probability of the string of unichars of this hypothesis.
+  PTRAIN_RAW_FEATURE_NGRAM_PROB,          // 3
+  // Number of bad/inconsistent spots in this hypothesis.
+  PTRAIN_RAW_FEATURE_NUM_BAD_PUNC,        // 4
+  PTRAIN_RAW_FEATURE_NUM_BAD_CASE,        // 5
+  PTRAIN_RAW_FEATURE_NUM_BAD_CHAR_TYPE,   // 6
+  PTRAIN_RAW_FEATURE_NUM_BAD_SPACING,     // 7
+  PTRAIN_RAW_FEATURE_NUM_BAD_SCRIPT,      // 8
+  PTRAIN_RAW_FEATURE_NUM_BAD_FONT,        // 9
+  // Classifier-related features.
+  PTRAIN_RAW_FEATURE_WORST_CERT,          // 10
+  PTRAIN_RAW_FEATURE_RATING,              // 11
+  // Number of classifier results that came from adapted templates.
+  PTRAIN_RAW_FEATURE_ADAPTED,   // 12
+  // Features potentially useful for normalization.
+  PTRAIN_RAW_FEATURE_NUM_UNICHARS,        // 13
+  PTRAIN_RAW_FEATURE_OUTLINE_LEN,         // 14
+
+  PTRAIN_NUM_RAW_FEATURE_TYPES
+};
+
+static const char * const kParamsTrainingRawFeatureTypeName[] = {
+    "DICT_MATCH_TYPE",     // 0
+    "UNAMBIG_DICT_MATCH",  // 1
+    "SHAPE_COST",          // 2
+    "NGRAM_PROB",          // 3
+    "NUM_BAD_PUNC",        // 4
+    "NUM_BAD_CASE",        // 5
+    "NUM_BAD_CHAR_TYPE",   // 6
+    "NUM_BAD_SPACING",     // 7
+    "NUM_BAD_SCRIPT",      // 8
+    "NUM_BAD_FONT",        // 9
+    "WORST_CERT",          // 10
+    "RATING",              // 11
+    "ADAPTED",             // 12
+    "NUM_UNICHARS",        // 13
+    "OUTLINE_LEN",         // 14
+};
+
+// Entry with features extracted from a single OCR hypothesis for a word.
+struct ParamsTrainingHypothesis {
+  ParamsTrainingHypothesis() {
+    for (int i = 0; i < PTRAIN_NUM_RAW_FEATURE_TYPES; ++i) features[i] = 0.0;
+  }
+  float features[PTRAIN_NUM_RAW_FEATURE_TYPES];
+  STRING str;  // string corresponding to word hypothesis (for debugging)
+};
+
+// A list of hypotheses explored during one run of segmentation search.
+typedef GenericVector<ParamsTrainingHypothesis> ParamsTrainingHypothesisList;
+
+// A bundle that accumulates all of the hypothesis lists explored during all
+// of the runs of segmentation search on a word (e.g. a list of hypotheses
+// explored on PASS1, PASS2, fix xheight pass, etc).
+class ParamsTrainingBundle {
+ public:
+  ParamsTrainingBundle() {};
+  // Starts a new hypothesis list.
+  // Should be called at the beginning of a new run of the segmentation search.
+  void StartHypothesisList() {
+    hyp_list_vec.push_back(ParamsTrainingHypothesisList());
+  }
+  // Adds a new ParamsTrainingHypothesis to the current hypothesis list
+  // and returns the reference to the newly added entry.
+  ParamsTrainingHypothesis &AddHypothesis() {
+    if (hyp_list_vec.empty()) StartHypothesisList();
+    hyp_list_vec.back().push_back(ParamsTrainingHypothesis());
+    return hyp_list_vec.back().back();
+  }
+
+  GenericVector<ParamsTrainingHypothesisList> hyp_list_vec;
+};
+
+}  // namespace tesseract
+
+#endif  // TESSERACT_WORDREC_PARAMS_TRAINING_FEATDEF_H_


fbdev: Don't pan at all when it's not supported by the device

--- systems/fbdev/fbdev.c
+++ systems/fbdev/fbdev.c
@@ -1941,7 +1941,8 @@
           dfb_surfacemanager_adjust_heap_offset( dfb_fbdev->shared->manager,
                                                  var.yres_virtual * fix.line_length );

-          dfb_fbdev_pan( var.xoffset, var.yoffset, false );
+          if (shared->fix.xpanstep || shared->fix.ypanstep || shared->fix.ywrapstep)
+               dfb_fbdev_pan( var.xoffset, var.yoffset, false );

           dfb_gfxcard_after_set_var();


keystore: reset credentials when they are not valid


corrected type of *_EPSILON values

corrected type of *_EPSILON values

--- lang/cem/libcc.ansi/headers/float.h
+++ lang/cem/libcc.ansi/headers/float.h
@@ -8,7 +8,7 @@

 #if	defined(vax) || defined(pdp)
 #define	FLT_DIG			6
-#define	FLT_EPSILON		5.96046448e-08
+#define	FLT_EPSILON		5.96046448e-08F
 #define	FLT_MANT_DIG		8
 #define	FLT_MAX			1.70141173e+38F
 #define	FLT_MAX_10_EXP		38
@@ -28,7 +28,7 @@
 #define	DBL_MIN_EXP		(-127)

 #define	LDBL_DIG		16
-#define	LDBL_EPSILON		1.38777878078144568e-17
+#define	LDBL_EPSILON		1.38777878078144568e-17L
 #define	LDBL_MANT_DIG		8
 #define	LDBL_MAX		1.70141183460469229e+38L
 #define	LDBL_MAX_10_EXP		38
@@ -42,7 +42,7 @@

 #else		/* IEEE format */
 #define	FLT_DIG			6
-#define	FLT_EPSILON		1.19209290e-07
+#define	FLT_EPSILON		1.19209290e-07F
 #define	FLT_MANT_DIG		24
 #define	FLT_MAX			3.40282347e+38F
 #define	FLT_MAX_10_EXP		38
@@ -62,7 +62,7 @@
 #define	DBL_MIN_EXP		(-1021)

 #define	LDBL_DIG		15
-#define	LDBL_EPSILON		2.2204460492503131e-16
+#define	LDBL_EPSILON		2.2204460492503131e-16L
 #define	LDBL_MANT_DIG		53
 #define	LDBL_MAX		1.7976931348623157e+308L
 #define	LDBL_MAX_10_EXP		308