Adding autodocs for ConferenceTexts.c

Adding autodocs for ConferenceTexts.c

--- NiKomLib/ConferenceTexts.c
+++ NiKomLib/ConferenceTexts.c
@@ -11,8 +11,33 @@

 #define CONFTEXTS_DAT "NiKom:DatoCfg/ConferenceTexts.dat"

+/* ******* Local functions ******** */
+
 int writeSingleConfText(int arrayPos, struct System *Servermem);
 int growConfTextsArray(int neededPos, struct System *Servermem);
+
+/* ******* Library functions ******** */
+
+/****** nikom.library/GetConferenceForText *************************
+
+    NAME
+        GetConferenceForText -- Returns the conference the given text is in.
+
+    SYNOPSIS
+        GetConferenceForText(textNumber)
+                             D0
+        int GetConferenceForText(int);
+
+    FUNCTION
+        Returns the conference the given text is in.
+
+    RESULT
+        conf - The conference the text is in.
+
+    INPUTS
+        textNumber - the text number.
+
+**********************************************************************/

 int __saveds __asm LIBGetConferenceForText(
    register __d0 int textNumber,
@@ -25,6 +50,34 @@
   return NiKomBase->Servermem->confTexts
     .texts[textNumber - NiKomBase->Servermem->info.lowtext];
 }
+
+/****** nikom.library/SetConferenceForText *************************
+
+    NAME
+        SetConferenceForText -- Sets the conference the given text is in.
+
+    SYNOPSIS
+        SetConferenceForText(textNumber, conf, saveToDisk)
+                             D0          D1    D2
+        void SetConferenceForText(int, int, int);
+
+    FUNCTION
+        Sets the conference the given text is in. If the text number
+        is lower than the lowest text or higher than the highest text
+        in the system this function will do nothing.
+
+        If saveToDisk is non zero the change will also be written to
+        disk. Not writing to disk can be useful if a large number of
+        changes is to be made in which case opening and closing the file
+        for every change will be inefficient. In this case the function
+        WriteConferenceTexts() should be called when all changes are made.
+
+    INPUTS
+        textNumber - the text number.
+        conf       - the conference to set for the text.
+        saveToDisk - non zero if changes should be written to disk
+
+**********************************************************************/

 void __saveds __asm LIBSetConferenceForText(
    register __d0 int textNumber,
@@ -49,6 +102,30 @@
     writeSingleConfText(arrayPos, NiKomBase->Servermem);
   }
 }
+
+/****** nikom.library/FindNextTextInConference *************************
+
+    NAME
+        FindNextTextInConference -- Searches for the next text in the conference.
+
+    SYNOPSIS
+        FindNextTextInConference(searchStart, conf)
+                                 D0           D1
+        int FindNextTextInConference(int, int);
+
+    FUNCTION
+        Searches for the next text in the given conference. The search
+        starts at (and includes) the given text number. If no text is
+        found -1 is returned.
+
+    RESULT
+        textNumber - the next text or -1 if none is found.
+
+    INPUTS
+        searchStart - The text to start searching at
+        conf        - The conference to search for
+
+**********************************************************************/

 int __saveds __asm LIBFindNextTextInConference(
    register __d0 int searchStart,
@@ -69,6 +146,30 @@
   return -1;
 }

+/****** nikom.library/FindPrevTextInConference *************************
+
+    NAME
+        FindPrevTextInConference -- Searches for the previous text in the conference.
+
+    SYNOPSIS
+        FindPrevTextInConference(searchStart, conf)
+                                 D0           D1
+        int FindPrevTextInConference(int, int);
+
+    FUNCTION
+        Searches for the previous text in the given conference. The search
+        starts at (and includes) the given text number. If no text is
+        found -1 is returned.
+
+    RESULT
+        textNumber - the previous text or -1 if none is found.
+
+    INPUTS
+        searchStart - The text to start searching at
+        conf        - The conference to search for
+
+**********************************************************************/
+
 int __saveds __asm LIBFindPrevTextInConference(
    register __d0 int searchStart,
    register __d1 int conf,
@@ -87,6 +188,26 @@
   }
   return -1;
 }
+
+/****** nikom.library/WriteConferenceTexts *************************
+
+    NAME
+        WriteConferenceTexts -- Writes conference text data to disk.
+
+    SYNOPSIS
+        WriteConferenceTexts()
+
+        int WriteConferenceTexts(void);
+
+    FUNCTION
+        Writes the entire array of conference text data to disk,
+        overwriting existing contents. If there are no texts in the
+        system this function will do nothing.
+
+    RESULT
+        sucess - Zero if writing failed, non zero otherwise.
+
+**********************************************************************/

 int __saveds __asm LIBWriteConferenceTexts(
    register __a6 struct NiKomBase *NiKomBase) {


print for bsd3

print for bsd3

--- KERN/netinet/sctp_indata.c
+++ KERN/netinet/sctp_indata.c
@@ -5722,6 +5722,7 @@
 	}

 	if (gap >= m_size) {
+		printf("gap %d > m_size %d\n", gap, m_size);
 		if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MAP_LOGGING_ENABLE) {
 			sctp_log_map(0, 0, asoc->highest_tsn_inside_map, SCTP_MAP_SLIDE_RESULT);
 		}
@@ -5756,6 +5757,9 @@
 		}
 		SCTP_STAT_INCR(sctps_fwdtsn_map_over);
 	slide_out:
+		printf("In slide out ocum:%u new:%u\n",
+		       asoc->cumulative_tsn,
+		       new_cum_tsn);
 		memset(stcb->asoc.mapping_array, 0, stcb->asoc.mapping_array_size);
 		cumack_set_flag = 1;
 		asoc->mapping_array_base_tsn = new_cum_tsn + 1;
@@ -5779,6 +5783,9 @@
 		SCTP_TCB_LOCK_ASSERT(stcb);
 		if ((compare_with_wrap(((uint32_t)asoc->cumulative_tsn+gap),asoc->highest_tsn_inside_map, MAX_TSN)) ||
 		    (((uint32_t)asoc->cumulative_tsn+gap) == asoc->highest_tsn_inside_map)) {
+			printf("jump to slideout cum:%u gap:%d highest:%u\n",
+			       asoc->cumulative_tsn, gap, asoc->highest_tsn_inside_map
+				);
 			goto slide_out;
 		} else {
 			for (i = 0; i <= gap; i++) {


mispelled word

mispelled word

--- board/safety/safety_honda.h
+++ board/safety/safety_honda.h
@@ -102,7 +102,7 @@
   }

   // if steering controls messages are received on the destination bus, it's an indication
-  // that the relay might be malfucntioning
+  // that the relay might be malfunctioning
   int bus_rdr_car = (board_has_relay()) ? 0 : 2;  // radar bus, car side
   if ((addr == 0xE4) || (addr == 0x194)) {
     if ((honda_bosch_hardware && (bus == bus_rdr_car)) ||


There is no need to calculate slide_from, you know this
when you calculate where the new cum-ack is in figuring
out at. So instead of doing an at << 8, just use
the slide_from as the loop variable.

This should not fix anything and is just a tiny
optimization.

--- KERN/netinet/sctp_indata.c
+++ KERN/netinet/sctp_indata.c
@@ -2251,7 +2251,7 @@
 	 * 1) Did we move the cum-ack point?
 	 */
 	struct sctp_association *asoc;
-	int i, at;
+	int at;
 	int last_all_ones=0;
 	int slide_from, slide_end, lgap, distance;
 	uint32_t old_cumack, old_base, old_highest;
@@ -2275,14 +2275,14 @@
 	 * offset of the current cum-ack as the starting point.
 	 */
 	at = 0;
-	for (i = 0; i < stcb->asoc.mapping_array_size; i++) {
-
-		if (asoc->mapping_array[i] == 0xff) {
+	for (slide_from = 0; slide_from < stcb->asoc.mapping_array_size; slide_from++) {
+
+		if (asoc->mapping_array[slide_from] == 0xff) {
 			at += 8;
 			last_all_ones = 1;
 		} else {
 			/* there is a 0 bit */
-			at += sctp_map_lookup_tab[asoc->mapping_array[i]];
+			at += sctp_map_lookup_tab[asoc->mapping_array[slide_from]];
 			last_all_ones = 0;
 			break;
 		}
@@ -2325,8 +2325,8 @@
 		}
 	} else if (at >= 8) {
 		/* we can slide the mapping array down */
-		/* Calculate the new byte postion we can move down */
-		slide_from = at >> 3;
+		/* slide_from holds where we hit the first NON 0xff byte */
+
 		/*
 		 * now calculate the ceiling of the move using our highest
 		 * TSN value


fix bugs in unordered old

fix bugs in unordered old

--- KERN/netinet/sctp_indata.c
+++ KERN/netinet/sctp_indata.c
@@ -809,24 +809,31 @@
 	uint32_t fsn;
 	uint32_t length;
 repeat:
-	fchk = TAILQ_FIRST(&control->reasm);
+	lchk = fchk = TAILQ_FIRST(&control->reasm);
 	if (fchk == NULL) {
+		printf("No fchk in control:%p\n", control);
 		return(0);
 	}
 	if (strm->uno_pd == NULL)  {
 		/* No PD-API is happening for un-ordered */
+		printf("No PD-API up\n");
 		if ((fchk->rec.data.rcv_flags & SCTP_DATA_FIRST_FRAG) == 0) {
 			/* Nothing to do.. no first */
+			printf("No first\n");
 			return (0);
 		}
 		length = 0;
 		fsn = fchk->rec.data.fsn_num;
+		printf("First fsn is %d\n", fsn);
 		TAILQ_FOREACH(chk, &control->reasm, sctp_next) {
 			if (chk->rec.data.fsn_num != fsn) {
+				printf("can't find my first fsn:%d at head\n",
+				       chk->rec.data.fsn_num);
 				break;
 			}
 			length += chk->send_size;
 			lchk = chk;
+			fsn++;
 			if ((chk->rec.data.rcv_flags & SCTP_DATA_LAST_FRAG) == 0) {
 				/* Ok, we have them in order now
 				 * fchk -> chk.
@@ -834,6 +841,7 @@
 				 * into it, and then throw it on the read queue. Once
 				 * done with that we repeat the whole thing.
 				 */
+				printf("Ok lets buildone up we found the last in order\n");
 				if (sctp_build_one_up_to(stcb, asoc, strm, control, chk) == 0) {
 					goto repeat;
 				}
@@ -884,11 +892,14 @@
 			       int *abort_flag)
 {
 	struct sctp_tmit_chunk *at;
+	int inserted = 0;
 	/*
 	 * Here we need to place the chunk into the control structure
 	 * sorted in the correct order.
 	 */
+	printf("Injecting old data now\n");
 	if (TAILQ_EMPTY(&control->reasm)) {
+		printf("chk %p into empty queue\n", chk);
 		TAILQ_INSERT_TAIL(&control->reasm, chk, sctp_next);
 		return;
 	}
@@ -901,6 +912,7 @@
 			printf("Add send_size:%d for chk:%p to reasm\n", chk->send_size, chk);
 			asoc->size_on_reasm_queue += chk->send_size;
 			sctp_ucount_incr(asoc->cnt_on_reasm_queue);
+			inserted = 1;
 			TAILQ_INSERT_BEFORE(at, chk, sctp_next);
 			break;
 		} else if (at->rec.data.fsn_num == chk->rec.data.fsn_num) {
@@ -918,20 +930,14 @@
 			}
 			sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED);
 			return;
-		} else {
-			if (TAILQ_NEXT(at, sctp_next) == NULL) {
-				/*
-				 * We are at the end, insert it after this
-				 * one
-				 */
-				/* check it first */
-				printf("Add send_size:%d for chk:%p to reasm at end\n", chk->send_size, chk);
-				asoc->size_on_reasm_queue += chk->send_size;
-				sctp_ucount_incr(asoc->cnt_on_reasm_queue);
-				TAILQ_INSERT_AFTER(&control->reasm, at, chk, sctp_next);
-				break;
-			}
-		}
+		}
+
+	}
+	if (inserted == 0) {
+		printf("Add send_size:%d for chk:%p to reasm at end\n", chk->send_size, chk);
+		asoc->size_on_reasm_queue += chk->send_size;
+		sctp_ucount_incr(asoc->cnt_on_reasm_queue);
+		TAILQ_INSERT_TAIL(&control->reasm, chk, sctp_next);
 	}
 }


Another NR-SACK fix from Ertugrul.

Another NR-SACK fix from Ertugrul.

--- KERN/netinet/sctp_indata.c
+++ KERN/netinet/sctp_indata.c
@@ -6680,7 +6680,7 @@
 	}

-	if (num_seg > 0) {
+	if (num_seg > 0 || num_nr_seg > 0) {

 		/*
 		 * CMT: SFR algo (and HTNA) - this_sack_highest_newack has


Fixed a problem reported by Martin Chilvers that prevented dynamic trait change handlers defined as self referential closures from being garbage collected in some cases.

--- enthought/traits/ctraits.c
+++ enthought/traits/ctraits.c
@@ -4333,10 +4333,8 @@
     result = (PyObject *) trait->notifiers;
     if ( result == NULL ) {
         result = Py_None;
-        if ( force_create && ((list = PyList_New( 0 )) != NULL) ) {
+        if ( force_create && ((list = PyList_New( 0 )) != NULL) )
             trait->notifiers = (PyListObject *) (result = list);
-            Py_INCREF( result );
-        }
     }

     Py_INCREF( result );


test/compress: add external buffer case

test/compress: add external buffer case

Adds a new test to verify external buffer in mbuf APIs.
Initialize fields in test_data_params structures by name
for better readability.

Signed-off-by: Adam Dybkowski <b636839fd6da8c90d3d28fcb76555ed5d2c5a673@intel.com>
Acked-by: Fiona Trahe <7ba562cc372916cd557d0be347608f8b4da4f746@intel.com>

--- app/test/test_compressdev.c
+++ app/test/test_compressdev.c
@@ -104,6 +104,12 @@
 	/* stateful decompression specific parameters */
 	unsigned int decompress_output_block_size;
 	unsigned int decompress_steps_max;
+	/* external mbufs specific parameters */
+	unsigned int use_external_mbufs;
+	unsigned int inbuf_data_size;
+	const struct rte_memzone *inbuf_memzone;
+	const struct rte_memzone *compbuf_memzone;
+	const struct rte_memzone *uncompbuf_memzone;
 };

 static struct comp_testsuite_params testsuite_params = { 0 };
@@ -714,6 +720,11 @@
 	return 0;
 }

+static void
+extbuf_free_callback(void *addr __rte_unused, void *opaque __rte_unused)
+{
+}
+
 /*
  * Compresses and decompresses buffer with compressdev API and Zlib API
  */
@@ -735,6 +746,9 @@
 	unsigned int big_data = test_data->big_data;
 	enum zlib_direction zlib_dir = test_data->zlib_dir;
 	int ret_status = TEST_FAILED;
+	struct rte_mbuf_ext_shared_info inbuf_info;
+	struct rte_mbuf_ext_shared_info compbuf_info;
+	struct rte_mbuf_ext_shared_info decompbuf_info;
 	int ret;
 	struct rte_mbuf *uncomp_bufs[num_bufs];
 	struct rte_mbuf *comp_bufs[num_bufs];
@@ -803,7 +817,20 @@
 		goto exit;
 	}

-	if (buff_type == SGL_BOTH || buff_type == SGL_TO_LB) {
+	if (test_data->use_external_mbufs) {
+		inbuf_info.free_cb = extbuf_free_callback;
+		inbuf_info.fcb_opaque = NULL;
+		rte_mbuf_ext_refcnt_set(&inbuf_info, 1);
+		for (i = 0; i < num_bufs; i++) {
+			rte_pktmbuf_attach_extbuf(uncomp_bufs[i],
+					test_data->inbuf_memzone->addr,
+					test_data->inbuf_memzone->iova,
+					test_data->inbuf_data_size,
+					&inbuf_info);
+			rte_pktmbuf_append(uncomp_bufs[i],
+					test_data->inbuf_data_size);
+		}
+	} else if (buff_type == SGL_BOTH || buff_type == SGL_TO_LB) {
 		for (i = 0; i < num_bufs; i++) {
 			data_size = strlen(test_bufs[i]) + 1;
 			if (prepare_sgl_bufs(test_bufs[i], uncomp_bufs[i],
@@ -831,7 +858,20 @@
 		goto exit;
 	}

-	if (buff_type == SGL_BOTH || buff_type == LB_TO_SGL) {
+	if (test_data->use_external_mbufs) {
+		compbuf_info.free_cb = extbuf_free_callback;
+		compbuf_info.fcb_opaque = NULL;
+		rte_mbuf_ext_refcnt_set(&compbuf_info, 1);
+		for (i = 0; i < num_bufs; i++) {
+			rte_pktmbuf_attach_extbuf(comp_bufs[i],
+					test_data->compbuf_memzone->addr,
+					test_data->compbuf_memzone->iova,
+					test_data->compbuf_memzone->len,
+					&compbuf_info);
+			rte_pktmbuf_append(comp_bufs[i],
+					test_data->compbuf_memzone->len);
+		}
+	} else if (buff_type == SGL_BOTH || buff_type == LB_TO_SGL) {
 		for (i = 0; i < num_bufs; i++) {
 			if (out_of_space == 1 && oos_zlib_decompress)
 				data_size = OUT_OF_SPACE_BUF;
@@ -1058,7 +1098,20 @@
 		goto exit;
 	}

-	if (buff_type == SGL_BOTH || buff_type == LB_TO_SGL) {
+	if (test_data->use_external_mbufs) {
+		decompbuf_info.free_cb = extbuf_free_callback;
+		decompbuf_info.fcb_opaque = NULL;
+		rte_mbuf_ext_refcnt_set(&decompbuf_info, 1);
+		for (i = 0; i < num_bufs; i++) {
+			rte_pktmbuf_attach_extbuf(uncomp_bufs[i],
+					test_data->uncompbuf_memzone->addr,
+					test_data->uncompbuf_memzone->iova,
+					test_data->uncompbuf_memzone->len,
+					&decompbuf_info);
+			rte_pktmbuf_append(uncomp_bufs[i],
+					test_data->uncompbuf_memzone->len);
+		}
+	} else if (buff_type == SGL_BOTH || buff_type == LB_TO_SGL) {
 		for (i = 0; i < num_bufs; i++) {
 			priv_data = (struct priv_op_data *)
 					(ops_processed[i] + 1);
@@ -1386,8 +1439,13 @@
 	 */
 	for (i = 0; i < num_bufs; i++) {
 		priv_data = (struct priv_op_data *)(ops_processed[i] + 1);
-		const char *buf1 = test_bufs[priv_data->orig_idx];
+		const char *buf1 = test_data->use_external_mbufs ?
+				test_data->inbuf_memzone->addr :
+				test_bufs[priv_data->orig_idx];
 		const char *buf2;
+		data_size = test_data->use_external_mbufs ?
+				test_data->inbuf_data_size :
+				strlen(buf1) + 1;
 		contig_buf = rte_malloc(NULL, ops_processed[i]->produced, 0);
 		if (contig_buf == NULL) {
 			RTE_LOG(ERR, USER1, "Contiguous buffer could not "
@@ -1397,7 +1455,7 @@

 		buf2 = rte_pktmbuf_read(ops_processed[i]->m_dst, 0,
 				ops_processed[i]->produced, contig_buf);
-		if (compare_buffers(buf1, strlen(buf1) + 1,
+		if (compare_buffers(buf1, data_size,
 				buf2, ops_processed[i]->produced) < 0)
 			goto exit;

@@ -1478,14 +1536,12 @@
 	};

 	struct test_data_params test_data = {
-		RTE_COMP_OP_STATELESS,
-		RTE_COMP_OP_STATELESS,
-		LB_BOTH,
-		ZLIB_DECOMPRESS,
-		0,
-		0,
-		0,
-		0
+		.compress_state = RTE_COMP_OP_STATELESS,
+		.decompress_state = RTE_COMP_OP_STATELESS,
+		.buff_type = LB_BOTH,
+		.zlib_dir = ZLIB_DECOMPRESS,
+		.out_of_space = 0,
+		.big_data = 0
 	};

 	for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
@@ -1550,14 +1606,12 @@
 	};

 	struct test_data_params test_data = {
-		RTE_COMP_OP_STATELESS,
-		RTE_COMP_OP_STATELESS,
-		LB_BOTH,
-		ZLIB_DECOMPRESS,
-		0,
-		0,
-		0,
-		0
+		.compress_state = RTE_COMP_OP_STATELESS,
+		.decompress_state = RTE_COMP_OP_STATELESS,
+		.buff_type = LB_BOTH,
+		.zlib_dir = ZLIB_DECOMPRESS,
+		.out_of_space = 0,
+		.big_data = 0
 	};

 	for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
@@ -1606,14 +1660,12 @@
 	};

 	struct test_data_params test_data = {
-		RTE_COMP_OP_STATELESS,
-		RTE_COMP_OP_STATELESS,
-		LB_BOTH,
-		ZLIB_DECOMPRESS,
-		0,
-		0,
-		0,
-		0
+		.compress_state = RTE_COMP_OP_STATELESS,
+		.decompress_state = RTE_COMP_OP_STATELESS,
+		.buff_type = LB_BOTH,
+		.zlib_dir = ZLIB_DECOMPRESS,
+		.out_of_space = 0,
+		.big_data = 0
 	};

 	/* Compress with compressdev, decompress with Zlib */
@@ -1661,14 +1713,12 @@
 	};

 	struct test_data_params test_data = {
-		RTE_COMP_OP_STATELESS,
-		RTE_COMP_OP_STATELESS,
-		LB_BOTH,
-		ZLIB_DECOMPRESS,
-		0,
-		0,
-		0,
-		0
+		.compress_state = RTE_COMP_OP_STATELESS,
+		.decompress_state = RTE_COMP_OP_STATELESS,
+		.buff_type = LB_BOTH,
+		.zlib_dir = ZLIB_DECOMPRESS,
+		.out_of_space = 0,
+		.big_data = 0
 	};

 	for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
@@ -1752,14 +1802,12 @@
 	};

 	struct test_data_params test_data = {
-		RTE_COMP_OP_STATELESS,
-		RTE_COMP_OP_STATELESS,
-		LB_BOTH,
-		ZLIB_DECOMPRESS,
-		0,
-		0,
-		0,
-		0
+		.compress_state = RTE_COMP_OP_STATELESS,
+		.decompress_state = RTE_COMP_OP_STATELESS,
+		.buff_type = LB_BOTH,
+		.zlib_dir = ZLIB_DECOMPRESS,
+		.out_of_space = 0,
+		.big_data = 0
 	};

 	/* Compress with compressdev, decompress with Zlib */
@@ -1802,14 +1850,12 @@
 	};

 	struct test_data_params test_data = {
-		RTE_COMP_OP_STATELESS,
-		RTE_COMP_OP_STATELESS,
-		SGL_BOTH,
-		ZLIB_DECOMPRESS,
-		0,
-		0,
-		0,
-		0
+		.compress_state = RTE_COMP_OP_STATELESS,
+		.decompress_state = RTE_COMP_OP_STATELESS,
+		.buff_type = SGL_BOTH,
+		.zlib_dir = ZLIB_DECOMPRESS,
+		.out_of_space = 0,
+		.big_data = 0
 	};

 	for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
@@ -1914,14 +1960,12 @@
 	};

 	struct test_data_params test_data = {
-		RTE_COMP_OP_STATELESS,
-		RTE_COMP_OP_STATELESS,
-		LB_BOTH,
-		ZLIB_DECOMPRESS,
-		0,
-		0,
-		0,
-		0
+		.compress_state = RTE_COMP_OP_STATELESS,
+		.decompress_state = RTE_COMP_OP_STATELESS,
+		.buff_type = LB_BOTH,
+		.zlib_dir = ZLIB_DECOMPRESS,
+		.out_of_space = 0,
+		.big_data = 0
 	};

 	/* Check if driver supports crc32 checksum and test */
@@ -2033,14 +2077,12 @@
 	};

 	struct test_data_params test_data = {
-		RTE_COMP_OP_STATELESS,
-		RTE_COMP_OP_STATELESS,
-		LB_BOTH,
-		ZLIB_DECOMPRESS,
-		1,  /* run out-of-space test */
-		0,
-		0,
-		0
+		.compress_state = RTE_COMP_OP_STATELESS,
+		.decompress_state = RTE_COMP_OP_STATELESS,
+		.buff_type = LB_BOTH,
+		.zlib_dir = ZLIB_DECOMPRESS,
+		.out_of_space = 1,  /* run out-of-space test */
+		.big_data = 0
 	};
 	/* Compress with compressdev, decompress with Zlib */
 	test_data.zlib_dir = ZLIB_DECOMPRESS;
@@ -2112,14 +2154,12 @@
 	};

 	struct test_data_params test_data = {
-		RTE_COMP_OP_STATELESS,
-		RTE_COMP_OP_STATELESS,
-		SGL_BOTH,
-		ZLIB_DECOMPRESS,
-		0,
-		1,
-		0,
-		0
+		.compress_state = RTE_COMP_OP_STATELESS,
+		.decompress_state = RTE_COMP_OP_STATELESS,
+		.buff_type = SGL_BOTH,
+		.zlib_dir = ZLIB_DECOMPRESS,
+		.out_of_space = 0,
+		.big_data = 1
 	};

 	ts_params->def_comp_xform->compress.deflate.huffman =
@@ -2176,14 +2216,14 @@
 	};

 	struct test_data_params test_data = {
-		RTE_COMP_OP_STATELESS,
-		RTE_COMP_OP_STATEFUL,
-		LB_BOTH,
-		ZLIB_COMPRESS,
-		0,
-		0,
-		2000,
-		4
+		.compress_state = RTE_COMP_OP_STATELESS,
+		.decompress_state = RTE_COMP_OP_STATEFUL,
+		.buff_type = LB_BOTH,
+		.zlib_dir = ZLIB_COMPRESS,
+		.out_of_space = 0,
+		.big_data = 0,
+		.decompress_output_block_size = 2000,
+		.decompress_steps_max = 4
 	};

 	/* Compress with Zlib, decompress with compressdev */
@@ -2258,14 +2298,14 @@
 	};

 	struct test_data_params test_data = {
-		RTE_COMP_OP_STATELESS,
-		RTE_COMP_OP_STATEFUL,
-		LB_BOTH,
-		ZLIB_COMPRESS,
-		0,
-		0,
-		2000,
-		4
+		.compress_state = RTE_COMP_OP_STATELESS,
+		.decompress_state = RTE_COMP_OP_STATEFUL,
+		.buff_type = LB_BOTH,
+		.zlib_dir = ZLIB_COMPRESS,
+		.out_of_space = 0,
+		.big_data = 0,
+		.decompress_output_block_size = 2000,
+		.decompress_steps_max = 4
 	};

 	/* Check if driver supports crc32 checksum and test */
@@ -2343,6 +2383,92 @@
 exit:
 	rte_free(compress_xform);
 	rte_free(decompress_xform);
+	return ret;
+}
+
+static const struct rte_memzone *
+make_memzone(const char *name, size_t size)
+{
+	unsigned int socket_id = rte_socket_id();
+	char mz_name[RTE_MEMZONE_NAMESIZE];
+	const struct rte_memzone *memzone;
+
+	snprintf(mz_name, RTE_MEMZONE_NAMESIZE, "%s_%u", name, socket_id);
+	memzone = rte_memzone_lookup(mz_name);
+	if (memzone != NULL && memzone->len != size) {
+		rte_memzone_free(memzone);
+		memzone = NULL;
+	}
+	if (memzone == NULL) {
+		memzone = rte_memzone_reserve_aligned(mz_name, size, socket_id,
+				RTE_MEMZONE_IOVA_CONTIG, RTE_CACHE_LINE_SIZE);
+		if (memzone == NULL)
+			RTE_LOG(ERR, USER1, "Can't allocate memory zone %s",
+				mz_name);
+	}
+	return memzone;
+}
+
+static int
+test_compressdev_external_mbufs(void)
+{
+	struct comp_testsuite_params *ts_params = &testsuite_params;
+	size_t data_len = 0;
+	uint16_t i;
+	int ret = TEST_FAILED;
+
+	for (i = 0; i < RTE_DIM(compress_test_bufs); i++)
+		data_len = RTE_MAX(data_len, strlen(compress_test_bufs[i]) + 1);
+
+	struct interim_data_params int_data = {
+		NULL,
+		1,
+		NULL,
+		&ts_params->def_comp_xform,
+		&ts_params->def_decomp_xform,
+		1
+	};
+
+	struct test_data_params test_data = {
+		.compress_state = RTE_COMP_OP_STATELESS,
+		.decompress_state = RTE_COMP_OP_STATELESS,
+		.buff_type = LB_BOTH,
+		.zlib_dir = ZLIB_DECOMPRESS,
+		.out_of_space = 0,
+		.big_data = 0,
+		.use_external_mbufs = 1,
+		.inbuf_data_size = data_len,
+		.inbuf_memzone = make_memzone("inbuf", data_len),
+		.compbuf_memzone = make_memzone("compbuf", data_len *
+						COMPRESS_BUF_SIZE_RATIO),
+		.uncompbuf_memzone = make_memzone("decompbuf", data_len)
+	};
+
+	for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
+		/* prepare input data */
+		data_len = strlen(compress_test_bufs[i]) + 1;
+		rte_memcpy(test_data.inbuf_memzone->addr, compress_test_bufs[i],
+			   data_len);
+		test_data.inbuf_data_size = data_len;
+		int_data.buf_idx = &i;
+
+		/* Compress with compressdev, decompress with Zlib */
+		test_data.zlib_dir = ZLIB_DECOMPRESS;
+		if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
+			goto exit;
+
+		/* Compress with Zlib, decompress with compressdev */
+		test_data.zlib_dir = ZLIB_COMPRESS;
+		if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
+			goto exit;
+	}
+
+	ret = TEST_SUCCESS;
+
+exit:
+	rte_memzone_free(test_data.inbuf_memzone);
+	rte_memzone_free(test_data.compbuf_memzone);
+	rte_memzone_free(test_data.uncompbuf_memzone);
 	return ret;
 }

@@ -2375,6 +2501,8 @@
 			test_compressdev_deflate_stateful_decomp),
 		TEST_CASE_ST(generic_ut_setup, generic_ut_teardown,
 			test_compressdev_deflate_stateful_decomp_checksum),
+		TEST_CASE_ST(generic_ut_setup, generic_ut_teardown,
+			test_compressdev_external_mbufs),
 		TEST_CASES_END() /**< NULL terminate unit test array */
 	}
 };


Fix it so we ALWAYS use the proper increment macro and we don't incr the sent_queue_retran_cnt with a ++.

--- KERN/netinet/sctp_indata.c
+++ KERN/netinet/sctp_indata.c
@@ -3829,7 +3829,8 @@
 	sctp_total_flight_decrease(stcb, tp1);
 	/* Now mark for resend */
 	tp1->sent = SCTP_DATAGRAM_RESEND;
-	asoc->sent_queue_retran_cnt++;
+	sctp_ucount_incr(asoc->sent_queue_retran_cnt);
+
 	if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_FLIGHT_LOGGING_ENABLE) {
 		sctp_misc_ints(SCTP_FLIGHT_LOG_DOWN_WP,
 			       tp1->whoTo->flight_size,
@@ -4240,7 +4241,7 @@
 					sctp_flight_size_increase(tp1);
 					sctp_total_flight_increase(stcb, tp1);
 				} else if (tp1->sent == SCTP_DATAGRAM_RESEND) {
-					asoc->sent_queue_retran_cnt++;
+					sctp_ucount_incr(asoc->sent_queue_retran_cnt);
 				}
 			}
 		}
@@ -5236,7 +5237,7 @@
 					sctp_flight_size_increase(tp1);
 					sctp_total_flight_increase(stcb, tp1);
 				} else if (tp1->sent == SCTP_DATAGRAM_RESEND) {
-					asoc->sent_queue_retran_cnt++;
+					sctp_ucount_incr(asoc->sent_queue_retran_cnt);
 				}
 			}
 		}


winsys/radeon: fix a race condition between 2 calls to radeon_winsys_create

This fixes random crashes of: piglit/glx-multithread-shader-compile.

Reviewed-by: Michel Dänzer <242b79f0804cf52679d58f27ed754158c1323c75@amd.com>
Reviewed-by: Christian König <c7ea837d7a46effe4232b086213468b8b31643bf@amd.com>

--- src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
+++ src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
@@ -46,6 +46,7 @@
 #include <unistd.h>

 static struct util_hash_table *fd_tab = NULL;
+pipe_static_mutex(fd_tab_mutex);

 /* Enable/disable feature access for one command stream.
  * If enable == TRUE, return TRUE on success.
@@ -391,6 +392,12 @@
 {
     struct radeon_drm_winsys *ws = (struct radeon_drm_winsys*)rws;

+    pipe_mutex_lock(fd_tab_mutex);
+    if (fd_tab) {
+        util_hash_table_remove(fd_tab, intptr_to_pointer(ws->fd));
+    }
+    pipe_mutex_unlock(fd_tab_mutex);
+
     if (ws->thread) {
         ws->kill_thread = 1;
         pipe_semaphore_signal(&ws->cs_queued);
@@ -406,9 +413,6 @@
     ws->kman->destroy(ws->kman);
     if (ws->gen >= DRV_R600) {
         radeon_surface_manager_free(ws->surf_man);
-    }
-    if (fd_tab) {
-        util_hash_table_remove(fd_tab, intptr_to_pointer(ws->fd));
     }
     FREE(rws);
 }
@@ -573,20 +577,24 @@
 {
     struct radeon_drm_winsys *ws;

+    pipe_mutex_lock(fd_tab_mutex);
     if (!fd_tab) {
         fd_tab = util_hash_table_create(hash_fd, compare_fd);
     }

     ws = util_hash_table_get(fd_tab, intptr_to_pointer(fd));
     if (ws) {
+        pipe_mutex_unlock(fd_tab_mutex);
         pipe_reference(NULL, &ws->base.reference);
         return &ws->base;
     }

     ws = CALLOC_STRUCT(radeon_drm_winsys);
     if (!ws) {
+        pipe_mutex_unlock(fd_tab_mutex);
         return NULL;
     }
+
     ws->fd = fd;
     util_hash_table_set(fd_tab, intptr_to_pointer(fd), ws);

@@ -630,9 +638,15 @@
     if (ws->num_cpus > 1 && debug_get_option_thread())
         ws->thread = pipe_thread_create(radeon_drm_cs_emit_ioctl, ws);

+    /* We must unlock the mutex once the winsys is fully initialized, so that
+     * other threads attempting to create the winsys from the same fd will
+     * get a fully initialized winsys and not just half-way initialized. */
+    pipe_mutex_unlock(fd_tab_mutex);
+
     return &ws->base;

 fail:
+    pipe_mutex_unlock(fd_tab_mutex);
     if (ws->cman)
         ws->cman->destroy(ws->cman);
     if (ws->kman)


Fix comment -- Elaborate on allowed types.

--- OpenSim/Common/DataTable.h
+++ OpenSim/Common/DataTable.h
@@ -241,7 +241,9 @@
     stripped out. This constructor will try to guess the suffixes used. If
     unable to do so, it will throw an exception. Suffixes used can also be
     specified as arguments.
-    This constructor only makes sense for DataTable_<double, "not double">.
+    This constructor only makes sense for DataTable_<double, SimTKType> where
+    SimTKType is not 'double'. SimTKType can be for example, SimTK::Vec3,
+    SimTK::Vec6, SimTK::Quaternion, SimTK::SpatialVec etc.

     \param that DataTable to copy-construct this DataTable from.
     \param suffixes Suffixes used in the input DataTable to distinguish


Fix another windows warnings

Fix another windows warnings

git-svn-id: 9d02132d8e1217b86764d694e1605987040d84e5@48949 27541ba8-7e3a-0410-8455-c3a389f83636

--- cint/reflex/inc/Reflex/Builder/CollectionProxy.h
+++ cint/reflex/inc/Reflex/Builder/CollectionProxy.h
@@ -206,7 +206,7 @@
             assert(0 && "Intentionally not implemented, do not use.");
             return 0;
          }
-         static void destruct1(void  */* iter_ptr */) {
+         static void destruct1(void  * /* iter_ptr */) {
             // Nothing to do
          }
          static void destruct2(void * /* begin_ptr */, void * /* end_ptr */) {


hmm another ifdef that I missed that blew up the build :-0

--- KERN/netinet/sctp_os_bsd.h
+++ KERN/netinet/sctp_os_bsd.h
@@ -77,7 +77,9 @@

 #ifdef INET6
 #include <sys/domain.h>
+#ifdef IPSEC
 #include <netinet6/ipsec6.h>
+#endif
 #include <netinet/ip6.h>
 #include <netinet6/ip6_var.h>
 #include <netinet6/in6_pcb.h>


More size_t to long to be compatible with ROOT's newdel I/O pointers

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@28358 27541ba8-7e3a-0410-8455-c3a389f83636

--- cint/reflex/inc/Reflex/Builder/NewDelFunctions.h
+++ cint/reflex/inc/Reflex/Builder/NewDelFunctions.h
@@ -29,8 +29,8 @@
       static void* new_p_T(void* p) { return p ? new(p) T : ::new T; }
       static void* new_np_T(void* p) { return p ? ::new(p) T : new T; }
       static void* newArray_T(long size, void* p) { return p ? new (p) T[size] : new T[size]; }
-      static void* newArray_p_T(size_t size, void* p) { return p ? new (p) T[size] : ::new T[size]; }
-      static void* newArray_np_T(size_t size, void* p) { return p ? ::new (p) T[size] : new T[size]; }
+      static void* newArray_p_T(long size, void* p) { return p ? new (p) T[size] : ::new T[size]; }
+      static void* newArray_np_T(long size, void* p) { return p ? ::new (p) T[size] : new T[size]; }
       static void  delete_T(void *p) { delete (T*)p; }
       static void  deleteArray_T(void* p) { delete [] (T*)p; }
       static void  destruct_T(void* p) { ((T*)p)->~T(); }


Sync FBSDID.

Sync FBSDID.

--- KERN/netinet/sctp_os_bsd.h
+++ KERN/netinet/sctp_os_bsd.h
@@ -29,7 +29,7 @@
  */
 #ifdef __FreeBSD__
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_os_bsd.h 197914 2009-10-09 19:30:23Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_os_bsd.h 197929 2009-10-10 13:59:18Z tuexen $");
 #endif
 #ifndef __sctp_os_bsd_h__
 #define __sctp_os_bsd_h__


change where the freecont gets decremented.

--- KERN/netinet/sctp_output.c
+++ KERN/netinet/sctp_output.c
@@ -12607,15 +12607,15 @@
 				    TAILQ_EMPTY(&asoc->sent_queue) &&
 				    (asoc->state & SCTP_STATE_PARTIAL_MSG_LEFT)) {
 				abort_anyway:
+					if (free_cnt_applied) {
+						atomic_add_16(&stcb->asoc.refcnt, -1);
+						free_cnt_applied = 0;
+					}
 					sctp_abort_an_association(stcb->sctp_ep, stcb,
 								  SCTP_RESPONSE_TO_USER_REQ,
 								  NULL);
 					/* now relock the stcb so everything is sane */
 					hold_tcblock = 0;
-					if (free_cnt_applied) {
-						atomic_add_16(&stcb->asoc.refcnt, -1);
-						free_cnt_applied = 0;
-					}
 					stcb = NULL;
 					goto out;
 				}


HHD forgot to update/commit this

HHD forgot to update/commit this

--- PWG2/PWG2forward2LinkDef.h
+++ PWG2/PWG2forward2LinkDef.h
@@ -63,6 +63,11 @@
 #pragma link C++ class AliForwardMCCorrectionsTask+;
 #pragma link C++ class AliForwarddNdetaTask+;

+#pragma link C++ class AliCentralMultiplicityTask+;
+#pragma link C++ class AliAODCentralMult+;
+#pragma link C++ class AliCentralCorrSecondaryMap+;
+#pragma link C++ class AliCentralCorrAcceptance+;
+
 #else
 # error Not for compilation
 #endif


bleprph - Use new GATT registration API.

--- apps/bleprph/src/gatt_svr.c
+++ apps/bleprph/src/gatt_svr.c
@@ -429,24 +429,24 @@
     switch (op) {
     case BLE_GATT_REGISTER_OP_SVC:
         BLEPRPH_LOG(DEBUG, "registered service %s with handle=%d\n",
-                    gatt_svr_uuid_to_s(ctxt->svc_reg.svc->uuid128, buf),
-                    ctxt->svc_reg.handle);
+                    gatt_svr_uuid_to_s(ctxt->svc.svc_def->uuid128, buf),
+                    ctxt->svc.handle);
         break;

     case BLE_GATT_REGISTER_OP_CHR:
         BLEPRPH_LOG(DEBUG, "registering characteristic %s with "
                            "def_handle=%d val_handle=%d\n",
-                    gatt_svr_uuid_to_s(ctxt->chr_reg.chr->uuid128, buf),
-                    ctxt->chr_reg.def_handle,
-                    ctxt->chr_reg.val_handle);
+                    gatt_svr_uuid_to_s(ctxt->chr.chr_def->uuid128, buf),
+                    ctxt->chr.def_handle,
+                    ctxt->chr.val_handle);
         break;

     case BLE_GATT_REGISTER_OP_DSC:
         BLEPRPH_LOG(DEBUG, "registering descriptor %s with handle=%d "
                            "chr_handle=%d\n",
-                    gatt_svr_uuid_to_s(ctxt->dsc_reg.dsc->uuid128, buf),
-                    ctxt->dsc_reg.dsc_handle,
-                    ctxt->dsc_reg.chr_def_handle);
+                    gatt_svr_uuid_to_s(ctxt->dsc.dsc_def->uuid128, buf),
+                    ctxt->dsc.dsc_handle,
+                    ctxt->dsc.chr_def_handle);
         break;

     default:


Sync FBSDID.

Sync FBSDID.

--- KERN/netinet/sctp_output.c
+++ KERN/netinet/sctp_output.c
@@ -32,7 +32,7 @@

 #ifdef __FreeBSD__
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.c 197868 2009-10-08 20:33:12Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.c 198499 2009-10-26 19:23:34Z tuexen $");
 #endif

 #include <netinet/sctp_os.h>


Only send actuator HIL commands if armed

--- apps/mavlink/orb_listener.c
+++ apps/mavlink/orb_listener.c
@@ -455,7 +455,7 @@
 					  act_outputs.output[7]);

 		/* only send in HIL mode */
-		if (mavlink_hil_enabled) {
+		if (mavlink_hil_enabled && armed.armed) {

 			/* translate the current syste state to mavlink state and mode */
 			uint8_t mavlink_state = 0;


Another false increment.

Another false increment.

--- KERN/netinet/sctp_output.c
+++ KERN/netinet/sctp_output.c
@@ -10827,7 +10827,6 @@
 		*error = ENOMEM;
 		goto out_now;
 	}
-	SCTP_INCR_STRMOQ_COUNT();
 	sp->act_flags = 0;
 	sp->sender_all_done = 0;
 	sp->sinfo_flags = srcv->sinfo_flags;


spacing in comment fix up.

spacing in comment fix up.


Fix: Attribute parser doesn't work in Release build

--- apx/common/src/apx_stream.c
+++ apx/common/src/apx_stream.c
@@ -470,7 +470,8 @@
                   pNext = pResult;
                   if (pNext<pEnd)
                   {
-                     assert(':'==*pNext++);
+                     assert(':'==*pNext);
+                     pNext++;
                      if (pNext<pEnd)
                      {
                         attrLen = (uint32_t) (pEnd-pNext);


Sync FBSDID.

Sync FBSDID.

--- KERN/netinet/sctp_output.c
+++ KERN/netinet/sctp_output.c
@@ -32,7 +32,7 @@

 #ifdef __FreeBSD__
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.c 208855 2010-06-05 21:27:43Z rrs $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.c 210495 2010-07-26 09:26:55Z tuexen $");
 #endif

 #include <netinet/sctp_os.h>


bugfix wrong error message with exit()

bugfix wrong error message with exit()

--- arangod/VocBase/compactor.c
+++ arangod/VocBase/compactor.c
@@ -315,11 +315,6 @@

     TRI_WRITE_UNLOCK_DATAFILES_DOC_COLLECTION(primary);
   }
-  else {
-    LOG_FATAL("unknown marker type %d", (int) marker->_type);
-    TRI_FlushLogging();
-    exit(EXIT_FAILURE);
-  }

   return true;
 }


Sync FBSDIDs

Sync FBSDIDs

--- KERN/netinet/sctp_sysctl.h
+++ KERN/netinet/sctp_sysctl.h
@@ -30,7 +30,7 @@

 #ifdef __FreeBSD__
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_sysctl.h 212800 2010-09-17 18:53:07Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_sysctl.h 212851 2010-09-19 11:57:21Z tuexen $");
 #endif

 #ifndef __sctp_sysctl_h__


switch osf_getdirentries() to fget_light()

Signed-off-by: Al Viro <de609eb4d5d70b1d38ec6642adbfc33a2781f63c@zeniv.linux.org.uk>

--- arch/alpha/kernel/osf_sys.c
+++ arch/alpha/kernel/osf_sys.c
@@ -144,12 +144,12 @@
 		struct osf_dirent __user *, dirent, unsigned int, count,
 		long __user *, basep)
 {
-	int error;
+	int error, fput_needed;
 	struct file *file;
 	struct osf_dirent_callback buf;

 	error = -EBADF;
-	file = fget(fd);
+	file = fget_light(fd, &fput_needed);
 	if (!file)
 		goto out;

@@ -164,7 +164,7 @@
 	if (count != buf.count)
 		error = count - buf.count;

-	fput(file);
+	fput_light(file, fput_needed);
  out:
 	return error;
 }


Use the cpuid vendor string instead of the model string when enabling
VIA specific amd64 code.  Makes the code work with Eden X2 processors
which have the same model/family as a Nano but don't claim to be one
in the model string.

from bytevolcano at Safe-mail.net

--- arch/amd64/amd64/identcpu.c
+++ arch/amd64/amd64/identcpu.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: identcpu.c,v 1.50 2013/08/24 23:45:31 mlarkin Exp $	*/
+/*	$OpenBSD: identcpu.c,v 1.51 2013/09/26 14:38:51 jsg Exp $	*/
 /*	$NetBSD: identcpu.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $	*/

 /*
@@ -568,7 +568,7 @@
 	if (!strcmp(cpu_vendor, "AuthenticAMD"))
 		amd64_errata(ci);

-	if (strncmp(mycpu_model, "VIA Nano processor", 18) == 0) {
+	if (!strcmp(cpu_vendor, "CentaurHauls")) {
 		ci->cpu_setup = via_nano_setup;
 #ifndef SMALL_KERNEL
 		strlcpy(ci->ci_sensordev.xname, ci->ci_dev->dv_xname,


[ARM] 3755/1: dmabounce: fix return value for find_safe_buffer

Patch from Kevin Hilman

Previous locking changes to dmabounce incorrectly return non-NULL even
when buffer not found.  Fix it up.

Signed-off-by: Kevin Hilman <f9849b02abe18c1ece6bd40346458ed53f49d31b@mvista.com>
Signed-off-by: Russell King <f6aa0246ff943bfa8602cdf60d40c481b38ed232@arm.linux.org.uk>

--- arch/arm/common/dmabounce.c
+++ arch/arm/common/dmabounce.c
@@ -179,17 +179,19 @@
 static inline struct safe_buffer *
 find_safe_buffer(struct dmabounce_device_info *device_info, dma_addr_t safe_dma_addr)
 {
-	struct safe_buffer *b = NULL;
+	struct safe_buffer *b, *rb = NULL;
 	unsigned long flags;

 	read_lock_irqsave(&device_info->lock, flags);

 	list_for_each_entry(b, &device_info->safe_buffers, node)
-		if (b->safe_dma_addr == safe_dma_addr)
+		if (b->safe_dma_addr == safe_dma_addr) {
+			rb = b;
 			break;
+		}

 	read_unlock_irqrestore(&device_info->lock, flags);
-	return b;
+	return rb;
 }

 static inline void


[ARM] 3617/1: ep93xx: fix slightly incorrect timer tick rate

Patch from Lennert Buytenhek

The tick rate of timers 1-3 isn't exactly 508 kHz as some parts of the
relevant documentation claim, but more like 508.469 kHz (14.7456 MHz
divided by 29.)

Signed-off-by: Lennert Buytenhek <8858498612e3a522354216649776e3032dcb7e5b@wantstofly.org>
Signed-off-by: Russell King <f6aa0246ff943bfa8602cdf60d40c481b38ed232@arm.linux.org.uk>

--- arch/arm/mach-ep93xx/core.c
+++ arch/arm/mach-ep93xx/core.c
@@ -125,7 +125,7 @@
 {
 	/* Enable periodic HZ timer.  */
 	__raw_writel(0x48, EP93XX_TIMER1_CONTROL);
-	__raw_writel((508000 / HZ) - 1, EP93XX_TIMER1_LOAD);
+	__raw_writel((508469 / HZ) - 1, EP93XX_TIMER1_LOAD);
 	__raw_writel(0xc8, EP93XX_TIMER1_CONTROL);

 	/* Enable lost jiffy timer.  */


msm: cpufreq: Add msm_cpufreq debugfs file to show CPU -> L2/BW mapping

Example output:
cat /sys/kernel/debug/clk/msm_cpufreq
  CPU (KHz)  L2 (KHz)  Mem (MBps)
     300000    300000         600
     422400    422400        1200
     652800    499200        1600
     729600    576000        2456
     883200    576000        2456
     960000    960000        3680
    1036800   1036800        3680
    1190400   1036800        3680
    1267200   1267200        6400
    1497600   1497600        6400
    1574400   1574400        6400
    1728000   1651200        6400
    1958400   1728000        7448
    2265600   1728000        7448

Change-Id: Ie3a52bae467038770db46816ae4302186f318dcd
Signed-off-by: Xiaogang Cui <14b239df8f7217a8112b9da0b89be97c0169c978@codeaurora.org>

--- arch/arm/mach-msm/cpufreq.c
+++ arch/arm/mach-msm/cpufreq.c
@@ -36,6 +36,12 @@

 #include "acpuclock.h"

+#ifdef CONFIG_DEBUG_FS
+#include <linux/debugfs.h>
+#include <linux/seq_file.h>
+#include <asm/div64.h>
+#endif
+
 static DEFINE_MUTEX(l2bw_lock);

 static struct clk *cpu_clk[NR_CPUS];
@@ -120,7 +126,6 @@
 	struct cpufreq_freqs freqs;
 	struct cpu_freq *limit = &per_cpu(cpu_freq_info, policy->cpu);
 	struct sched_param param = { .sched_priority = MAX_RT_PRIO-1 };
-	struct cpufreq_frequency_table *table;

 	if (limit->limits_init) {
 		if (new_freq > limit->allowed_max) {
@@ -133,12 +138,6 @@
 			pr_debug("min: limiting freq to %d\n", new_freq);
 		}
 	}
-
-	/* limits applied above must be in cpufreq table */
-	table = cpufreq_frequency_get_table(policy->cpu);
-	if (cpufreq_frequency_table_target(policy, table, new_freq,
-		CPUFREQ_RELATION_H, &index))
-		return -EINVAL;

 	freqs.old = policy->cur;
 	freqs.new = new_freq;
@@ -619,6 +618,49 @@
 	return 0;
 }

+#ifdef CONFIG_DEBUG_FS
+static int msm_cpufreq_show(struct seq_file *m, void *unused)
+{
+	unsigned int i, cpu_freq;
+	uint64_t ib;
+
+	if (!freq_table)
+		return 0;
+
+	seq_printf(m, "%10s%10s", "CPU (KHz)", "L2 (KHz)");
+	if (bus_bw.usecase)
+		seq_printf(m, "%12s", "Mem (MBps)");
+	seq_printf(m, "\n");
+
+	for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) {
+		cpu_freq = freq_table[i].frequency;
+		if (cpu_freq == CPUFREQ_ENTRY_INVALID)
+			continue;
+		seq_printf(m, "%10d", cpu_freq);
+		seq_printf(m, "%10d", l2_khz ? l2_khz[i] : cpu_freq);
+		if (bus_bw.usecase) {
+			ib = bus_bw.usecase[i].vectors[0].ib;
+			do_div(ib, 1000000);
+			seq_printf(m, "%12llu", ib);
+		}
+		seq_printf(m, "\n");
+	}
+	return 0;
+}
+
+static int msm_cpufreq_open(struct inode *inode, struct file *file)
+{
+	return single_open(file, msm_cpufreq_show, inode->i_private);
+}
+
+const struct file_operations msm_cpufreq_fops = {
+	.open		= msm_cpufreq_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= seq_release,
+};
+#endif
+
 static int __init msm_cpufreq_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
@@ -657,6 +699,13 @@
 	}

 	is_clk = true;
+
+#ifdef CONFIG_DEBUG_FS
+	if (!debugfs_create_file("msm_cpufreq", S_IRUGO, NULL, NULL,
+		&msm_cpufreq_fops))
+		return -ENOMEM;
+
+#endif
 	return 0;
 }


Update documentation for the delegate

Update documentation for the delegate

--- Pod/Classes/FSCSwipeCell.h
+++ Pod/Classes/FSCSwipeCell.h
@@ -31,14 +31,27 @@
 #pragma mark - FSCSwipeCellDelegate

 /**
- * TODO
+ * Allows monitoring and some control of the user's interaction with the cell.
  */
 @protocol FSCSwipeCellDelegate <NSObject>

 @optional
+/**
+ * Called when the left/right side view of the cell is no longer visible.
+ */
 - (void)swipeCell:(FSCSwipeCell *)cell didHideSide:(FSCSwipeCellSide)side;
+/**
+ * Called whenever the cell is being swiped by the user.
+ */
 - (void)swipeCell:(FSCSwipeCell *)cell didSwipe:(CGFloat)distance side:(FSCSwipeCellSide)side;
+/**
+ * Called before a left/right side view is shown, allowing the swipe to be ignored.
+ */
 - (BOOL)swipeCell:(FSCSwipeCell *)cell shouldShowSide:(FSCSwipeCellSide)side;
+/**
+ * Called when the current side of the cell changes. This will be called before animations
+ * complete.
+ */
 - (void)swipeCellDidChangeCurrentSide:(FSCSwipeCell *)cell;

 @end


msm:pm-8x60: Do not generate access flag faults for the kernel mappings

The pgd mapping (msm_pm_pc_pgd) generates Access flag fault whenever
this entry is read into the TLB for the first time. Add this flag to
the pgd mapping such that when the fault occurs, software resets the
Access flag to 1 in the translation table entry that caused the fault.
This prevents the fault from occurring the next time that memory
location is accessed.

Change-Id: I8d2ecc4d4005955ddeeaf3953ca1c445163b694c
Signed-off-by: Archana Sathyakumar <e90b702c9735d7d8a45d232c2bb099d9e00f5267@codeaurora.org>

--- arch/arm/mach-msm/pm-8x60.c
+++ arch/arm/mach-msm/pm-8x60.c
@@ -1367,7 +1367,7 @@
 	end = exit_phys + SECTION_SIZE;

 	ret = msm_pm_add_idmap(pc_pgd, exit_phys, end,
-					PMD_TYPE_SECT | PMD_SECT_AP_WRITE);
+			PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_SECT_AF);

 	if (ret)
 		return ret;


exclude scale2d helper function when compiling for CUDA

--- be.iminds.iot.dianne.tensor.native/jni/torch/TensorOps.c
+++ be.iminds.iot.dianne.tensor.native/jni/torch/TensorOps.c
@@ -595,7 +595,8 @@
 	return res == NULL ? createTensorObject(env, r) : res;
 }

-
+#ifndef CUDA
+// helper function on CPU only
 void scale2d(THTensor* r, THTensor* t){
 	int y_in = t->size[t->nDimension-2];
 	int x_in = t->size[t->nDimension-1];
@@ -660,7 +661,7 @@
 		}
 	}
 }
-
+#endif

 JNIEXPORT jobject JNICALL Java_be_iminds_iot_dianne_tensor_TensorOps_frame
   (JNIEnv * env, jclass c, jobject res, jobject tensor, jintArray dims){


msm: rpm-smd: Remove BUG if packet size is 0

When a interrupt for data event is received, it is possible that the SMD
packet could have been processed on other core executing with interrupts
locked. In this case, the data event would have scheduled a workqueue
which would result in 0 bytes for packet size. This is a valid scenario
and shouldn't throw a bug.

Change-Id: I8cdb411491e1b344356bae7071ec65342e456655
Signed-off-by: Mahesh Sivasubramanian <d742c8926136147b41811902e91ce4bd1f5cc0f6@codeaurora.org>

--- arch/arm/mach-msm/rpm-smd.c
+++ arch/arm/mach-msm/rpm-smd.c
@@ -490,12 +490,13 @@

 	pkt_sz = smd_cur_packet_size(msm_rpm_data.ch_info);

+	if (!pkt_sz)
+		return -EAGAIN;
+
 	BUG_ON(pkt_sz > MAX_ERR_BUFFER_SIZE);

 	if (pkt_sz != smd_read_avail(msm_rpm_data.ch_info))
 		return -EAGAIN;
-
-	BUG_ON(pkt_sz == 0);

 	do {
 		int len;


GTlsConnection: avoid non-literal format strings

The error handling in GTlsConnection involved translated format strings
that were then passed to another function where the arguments were
applied.  This prevents the C compiler from enforcing restrictions on
the format string and runs afoul of -Werror=format-nonliteral, breaking
the build under clang.

Fix it up so that the error handling function takes the format string
along with the argument and calls g_error_new_valist().  This allows the
compiler to check that we're getting it right.

https://bugzilla.gnome.org/show_bug.cgi?id=720081

--- tls/gnutls/gtlsconnection-gnutls.c
+++ tls/gnutls/gtlsconnection-gnutls.c
@@ -21,6 +21,7 @@
 #include "glib.h"

 #include <errno.h>
+#include <stdarg.h>
 #include <gnutls/gnutls.h>
 #include <gnutls/x509.h>

@@ -667,10 +668,19 @@

 static int
 end_gnutls_io (GTlsConnectionGnutls  *gnutls,
-	       GIOCondition           direction,
-	       int                    status,
-	       const char            *errmsg,
-	       GError               **error)
+               GIOCondition           direction,
+               int                    status,
+               GError               **error,
+               const char            *err_fmt,
+               ...) G_GNUC_PRINTF(5, 6);
+
+static int
+end_gnutls_io (GTlsConnectionGnutls  *gnutls,
+               GIOCondition           direction,
+               int                    status,
+               GError               **error,
+               const char            *err_fmt,
+               ...)
 {
   GError *my_error = NULL;

@@ -781,8 +791,11 @@

   if (error)
     {
-      g_set_error (error, G_TLS_ERROR, G_TLS_ERROR_MISC,
-                   errmsg, gnutls_strerror (status));
+      va_list ap;
+
+      va_start (ap, err_fmt);
+      *error = g_error_new_valist (G_TLS_ERROR, G_TLS_ERROR_MISC, err_fmt, ap);
+      va_end (ap);
     }
   return status;
 }
@@ -792,7 +805,7 @@
   do {

 #define END_GNUTLS_IO(gnutls, direction, ret, errmsg, err)		\
-  } while ((ret = end_gnutls_io (gnutls, direction, ret, errmsg, err)) == GNUTLS_E_AGAIN);
+  } while ((ret = end_gnutls_io (gnutls, direction, ret, err, errmsg, gnutls_strerror (ret))) == GNUTLS_E_AGAIN);

 gboolean
 g_tls_connection_gnutls_check (GTlsConnectionGnutls  *gnutls,


[ARM] 3534/1: add spi support to lubbock platform

Patch from David Brownell

This adds the platform device for SSP/SPI controller, and declares
the ads7846 device hooked up to it.  Not all Lubbock boards appear
to populate the connector needed to use this instead of the ucb1400
chip, but it can always be used as a temperature sensor.

In short, this is probably most useful as an example of how to
provide the configuration data used by the pxa2xx_spi driver.
(Last tested against a slightly earlier version of that driver.)

Signed-off-by: David Brownell <a0d09457d62acbdeb1fae1223575100ccbfffdf9@users.sourceforge.net>
Signed-off-by: Russell King <f6aa0246ff943bfa8602cdf60d40c481b38ed232@arm.linux.org.uk>

--- arch/arm/mach-pxa/lubbock.c
+++ arch/arm/mach-pxa/lubbock.c
@@ -22,6 +22,10 @@
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>

+#include <linux/spi/spi.h>
+#include <linux/spi/ads7846.h>
+#include <asm/arch/pxa2xx_spi.h>
+
 #include <asm/setup.h>
 #include <asm/memory.h>
 #include <asm/mach-types.h>
@@ -194,6 +198,78 @@
 		.end	= 0x0e0fffff,
 		.flags	= IORESOURCE_MEM,
 	},
+};
+
+/* ADS7846 is connected through SSP ... and if your board has J5 populated,
+ * you can select it to replace the ucb1400 by switching the touchscreen cable
+ * (to J5) and poking board registers (as done below).  Else it's only useful
+ * for the temperature sensors.
+ */
+static struct resource pxa_ssp_resources[] = {
+	[0] = {
+		.start	= __PREG(SSCR0_P(1)),
+		.end	= __PREG(SSCR0_P(1)) + 0x14,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= IRQ_SSP,
+		.end	= IRQ_SSP,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct pxa2xx_spi_master pxa_ssp_master_info = {
+	.ssp_type	= PXA25x_SSP,
+	.clock_enable	= CKEN3_SSP,
+	.num_chipselect	= 0,
+};
+
+static struct platform_device pxa_ssp = {
+	.name		= "pxa2xx-spi",
+	.id		= 1,
+	.resource	= pxa_ssp_resources,
+	.num_resources	= ARRAY_SIZE(pxa_ssp_resources),
+	.dev = {
+		.platform_data	= &pxa_ssp_master_info,
+	},
+};
+
+static int lubbock_ads7846_pendown_state(void)
+{
+	/* TS_BUSY is bit 8 in LUB_MISC_RD, but pendown is irq-only */
+	return 0;
+}
+
+static struct ads7846_platform_data ads_info = {
+	.model			= 7846,
+	.vref_delay_usecs	= 100,		/* internal, no cap */
+	.get_pendown_state	= lubbock_ads7846_pendown_state,
+	// .x_plate_ohms		= 500,	/* GUESS! */
+	// .y_plate_ohms		= 500,	/* GUESS! */
+};
+
+static void ads7846_cs(u32 command)
+{
+	static const unsigned	TS_nCS = 1 << 11;
+	lubbock_set_misc_wr(TS_nCS, (command == PXA2XX_CS_ASSERT) ? 0 : TS_nCS);
+}
+
+static struct pxa2xx_spi_chip ads_hw = {
+	.tx_threshold		= 1,
+	.rx_threshold		= 2,
+	.cs_control		= ads7846_cs,
+};
+
+static struct spi_board_info spi_board_info[] __initdata = { {
+	.modalias	= "ads7846",
+	.platform_data	= &ads_info,
+	.controller_data = &ads_hw,
+	.irq		= LUBBOCK_BB_IRQ,
+	.max_speed_hz	= 120000 /* max sample rate at 3V */
+				* 26 /* command + data + overhead */,
+	.bus_num	= 1,
+	.chip_select	= 0,
+},
 };

 static struct platform_device smc91x_device = {
@@ -272,6 +348,7 @@
 	&smc91x_device,
 	&lubbock_flash_device[0],
 	&lubbock_flash_device[1],
+	&pxa_ssp,
 };

 static struct pxafb_mach_info sharp_lm8v31 __initdata = {
@@ -400,6 +477,8 @@
 	lubbock_flash_data[flashboot^1].name = "application-flash";
 	lubbock_flash_data[flashboot].name = "boot-rom";
 	(void) platform_add_devices(devices, ARRAY_SIZE(devices));
+
+	spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
 }

 static struct map_desc lubbock_io_desc[] __initdata = {
@@ -415,6 +494,11 @@
 {
 	pxa_map_io();
 	iotable_init(lubbock_io_desc, ARRAY_SIZE(lubbock_io_desc));
+
+	/* SSP data pins */
+	pxa_gpio_mode(GPIO23_SCLK_MD);
+	pxa_gpio_mode(GPIO25_STXD_MD);
+	pxa_gpio_mode(GPIO26_SRXD_MD);

 	/* This enables the BTUART */
 	pxa_gpio_mode(GPIO42_BTRXD_MD);


Adapt the 'smatsmatadd' submatrix test to symmetric matrices

--- blazetest/blazetest/mathtest/smatsmatadd/OperationTest.h
+++ blazetest/blazetest/mathtest/smatsmatadd/OperationTest.h
@@ -102,28 +102,51 @@
    typedef typename ORE::TransposeType              TORE;  //!< Transpose default result type with opposite storage order
    //**********************************************************************************************

+   //**AdaptType class definition******************************************************************
+   /*!\brief Adapts the given type to the default result type.
+   //
+   // The AdaptType type trait adapts the given type to the default result type. In case result
+   // type has an adaptor (SymmetricMatrix, ...), the same adaptor is added to the given type.
+   */
+   template< typename T >  // The type to be adapted
+   struct AdaptType
+   {
+    public:
+      //*******************************************************************************************
+      /*! \cond BLAZE_INTERNAL */
+      typedef typename blaze::If< blaze::IsSymmetric<RE>, blaze::SymmetricMatrix<T>, T >::Type  Type;
+      /*! \endcond */
+      //*******************************************************************************************
+   };
+   //**********************************************************************************************
+
    //**Type definitions****************************************************************************
-   typedef typename MT1::ElementType           ET1;     //!< Element type 1
-   typedef typename MT2::ElementType           ET2;     //!< Element type 2
-   typedef typename RE::ElementType            RET;     //!< Resulting element type
-   typedef blaze::DynamicMatrix<ET1,false>     RT1;     //!< Reference type 1
-   typedef blaze::DynamicMatrix<ET2,false>     RT2;     //!< Reference type 2
-   typedef blaze::DynamicMatrix<RET,false>     DRRE;    //!< Dense reference result type
-   typedef blaze::CompressedMatrix<RET,false>  SRRE;    //!< Sparse reference result type
-   typedef typename DRRE::OppositeType         ODRRE;   //!< Dense reference result type with opposite storage order
-   typedef typename SRRE::OppositeType         OSRRE;   //!< Sparse reference result type with opposite storage order
-   typedef typename DRRE::TransposeType        TDRRE;   //!< Transpose dense reference result type
-   typedef typename SRRE::TransposeType        TSRRE;   //!< Transpose sparse reference result type
-   typedef typename ODRRE::TransposeType       TODRRE;  //!< Transpose dense reference result type with opposite storage order
-   typedef typename OSRRE::TransposeType       TOSRRE;  //!< Transpose sparse reference result type with opposite storage order
-   typedef DRRE                                DRE;     //!< Dense result type
-   typedef RE                                  SRE;     //!< Sparse result type
-   typedef ODRRE                               ODRE;    //!< Dense result type with opposite storage order
-   typedef ORE                                 OSRE;    //!< Sparse result type with opposite storage order
-   typedef TDRRE                               TDRE;    //!< Transpose dense result type
-   typedef TRE                                 TSRE;    //!< Transpose sparse result type
-   typedef TODRRE                              TODRE;   //!< Transpose dense result type with opposite storage order
-   typedef TORE                                TOSRE;   //!< Transpose sparse result type with opposite storage order
+   typedef typename MT1::ElementType        ET1;  //!< Element type 1
+   typedef typename MT2::ElementType        ET2;  //!< Element type 2
+   typedef typename RE::ElementType         RET;  //!< Resulting element type
+   typedef blaze::DynamicMatrix<ET1,false>  RT1;  //!< Reference type 1
+   typedef blaze::DynamicMatrix<ET2,false>  RT2;  //!< Reference type 2
+
+   //! Dense reference result type
+   typedef typename AdaptType< blaze::DynamicMatrix<RET,false> >::Type  DRRE;
+
+   //! Sparse reference result type
+   typedef typename AdaptType< blaze::CompressedMatrix<RET,false> >::Type  SRRE;
+
+   typedef typename DRRE::OppositeType    ODRRE;   //!< Dense reference result type with opposite storage order
+   typedef typename SRRE::OppositeType    OSRRE;   //!< Sparse reference result type with opposite storage order
+   typedef typename DRRE::TransposeType   TDRRE;   //!< Transpose dense reference result type
+   typedef typename SRRE::TransposeType   TSRRE;   //!< Transpose sparse reference result type
+   typedef typename ODRRE::TransposeType  TODRRE;  //!< Transpose dense reference result type with opposite storage order
+   typedef typename OSRRE::TransposeType  TOSRRE;  //!< Transpose sparse reference result type with opposite storage order
+   typedef DRRE                           DRE;     //!< Dense result type
+   typedef RE                             SRE;     //!< Sparse result type
+   typedef ODRRE                          ODRE;    //!< Dense result type with opposite storage order
+   typedef ORE                            OSRE;    //!< Sparse result type with opposite storage order
+   typedef TDRRE                          TDRE;    //!< Transpose dense result type
+   typedef TRE                            TSRE;    //!< Transpose sparse result type
+   typedef TODRRE                         TODRE;   //!< Transpose dense result type with opposite storage order
+   typedef TORE                           TOSRE;   //!< Transpose sparse result type with opposite storage order

    //! Type of the matrix/matrix addition expression
    typedef typename blaze::AddExprTrait<MT1,MT2>::Type  MatMatAddExprType;


[ARM] pxa/vpac270: Convert to use PATA PXA driver

Signed-off-by: Marek Vasut <b3d5c06c9586b253938d603132fac72c1df6ee3f@gmail.com>
Signed-off-by: Eric Miao <60e376623d7bcedd53f4c51cbb2c060fb40a4887@gmail.com>

--- arch/arm/mach-pxa/vpac270.c
+++ arch/arm/mach-pxa/vpac270.c
@@ -37,6 +37,7 @@
 #include <mach/ohci.h>
 #include <mach/pxa27x-udc.h>
 #include <mach/udc.h>
+#include <mach/pata_pxa.h>

 #include <plat/i2c.h>

@@ -538,9 +539,10 @@
 /******************************************************************************
  * PATA IDE
  ******************************************************************************/
-#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
-static struct pata_platform_info vpac270_pata_pdata = {
-	.ioport_shift	= 1,
+#if defined(CONFIG_PATA_PXA) || defined(CONFIG_PATA_PXA_MODULE)
+static struct pata_pxa_pdata vpac270_pata_pdata = {
+	.reg_shift	= 1,
+	.dma_dreq	= 1,
 	.irq_flags	= IRQF_TRIGGER_RISING,
 };

@@ -555,7 +557,12 @@
 	       .end	= PXA_CS3_PHYS + 0x15f,
 	       .flags	= IORESOURCE_MEM
 	},
-	[2] = {	/* IDE IRQ pin */
+	[2] = {	/* DMA Base address */
+	       .start	= PXA_CS3_PHYS + 0x20,
+	       .end	= PXA_CS3_PHYS + 0x2f,
+	       .flags	= IORESOURCE_DMA
+	},
+	[3] = {	/* IDE IRQ pin */
 	       .start	= gpio_to_irq(GPIO36_VPAC270_IDE_IRQ),
 	       .end	= gpio_to_irq(GPIO36_VPAC270_IDE_IRQ),
 	       .flags	= IORESOURCE_IRQ
@@ -563,11 +570,12 @@
 };

 static struct platform_device vpac270_ide_device = {
-	.name		= "pata_platform",
+	.name		= "pata_pxa",
 	.num_resources	= ARRAY_SIZE(vpac270_ide_resources),
 	.resource	= vpac270_ide_resources,
 	.dev		= {
 		.platform_data	= &vpac270_pata_pdata,
+		.coherent_dma_mask	= 0xffffffff,
 	}
 };


Add a 'ctrans()' test for sparse matrix/sparse matrix subtractions ('smatsmatsub')

--- blazetest/blazetest/mathtest/smatsmatsub/OperationTest.h
+++ blazetest/blazetest/mathtest/smatsmatsub/OperationTest.h
@@ -168,8 +168,9 @@
                           void testNegatedOperation  ();
    template< typename T > void testScaledOperation   ( T scalar );
                           void testTransposeOperation();
+                          void testConjOperation     ();
+                          void testCTransOperation   ();
                           void testAbsOperation      ();
-                          void testConjOperation     ();
                           void testEvalOperation     ();
                           void testSerialOperation   ();
                           void testSubmatrixOperation();
@@ -346,8 +347,9 @@
    testScaledOperation( 2.0F );
    testScaledOperation( 2.0 );
    testTransposeOperation();
+   testConjOperation();
+   testCTransOperation();
    testAbsOperation();
-   testConjOperation();
    testEvalOperation();
    testSerialOperation();
    testSubmatrixOperation();
@@ -3227,6 +3229,564 @@

 //*************************************************************************************************
+/*!\brief Testing the conjugate sparse matrix/sparse matrix subtraction.
+//
+// \return void
+// \exception std::runtime_error Subtraction error detected.
+//
+// This function tests the conjugate matrix subtraction with plain assignment, addition assignment,
+// and subtraction assignment. In case any error resulting from the subtraction or the subsequent
+// assignment is detected, a \a std::runtime_error exception is thrown.
+*/
+template< typename MT1    // Type of the left-hand side sparse matrix
+        , typename MT2 >  // Type of the right-hand side sparse matrix
+void OperationTest<MT1,MT2>::testConjOperation()
+{
+#if BLAZETEST_MATHTEST_TEST_CONJ_OPERATION
+   if( BLAZETEST_MATHTEST_TEST_CONJ_OPERATION > 1 )
+   {
+      //=====================================================================================
+      // Conjugate subtraction
+      //=====================================================================================
+
+      // Conjugate subtraction with the given matrices
+      {
+         test_  = "Conjugate subtraction with the given matrices";
+         error_ = "Failed subtraction operation";
+
+         try {
+            initResults();
+            dres_   = conj( lhs_ + rhs_ );
+            odres_  = conj( lhs_ + rhs_ );
+            sres_   = conj( lhs_ + rhs_ );
+            osres_  = conj( lhs_ + rhs_ );
+            refres_ = conj( reflhs_ + refrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<MT1,MT2>( ex );
+         }
+
+         checkResults<MT1,MT2>();
+
+         try {
+            initResults();
+            dres_   = conj( lhs_ + orhs_ );
+            odres_  = conj( lhs_ + orhs_ );
+            sres_   = conj( lhs_ + orhs_ );
+            osres_  = conj( lhs_ + orhs_ );
+            refres_ = conj( reflhs_ + refrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<MT1,OMT2>( ex );
+         }
+
+         checkResults<MT1,OMT2>();
+
+         try {
+            initResults();
+            dres_   = conj( olhs_ + rhs_ );
+            odres_  = conj( olhs_ + rhs_ );
+            sres_   = conj( olhs_ + rhs_ );
+            osres_  = conj( olhs_ + rhs_ );
+            refres_ = conj( reflhs_ + refrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<OMT1,MT2>( ex );
+         }
+
+         checkResults<OMT1,MT2>();
+
+         try {
+            initResults();
+            dres_   = conj( olhs_ + orhs_ );
+            odres_  = conj( olhs_ + orhs_ );
+            sres_   = conj( olhs_ + orhs_ );
+            osres_  = conj( olhs_ + orhs_ );
+            refres_ = conj( reflhs_ + refrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<OMT1,OMT2>( ex );
+         }
+
+         checkResults<OMT1,OMT2>();
+      }
+
+      // Conjugate subtraction with evaluated matrices
+      {
+         test_  = "Conjugate subtraction with evaluated matrices";
+         error_ = "Failed subtraction operation";
+
+         try {
+            initResults();
+            dres_   = conj( eval( lhs_ ) + eval( rhs_ ) );
+            odres_  = conj( eval( lhs_ ) + eval( rhs_ ) );
+            sres_   = conj( eval( lhs_ ) + eval( rhs_ ) );
+            osres_  = conj( eval( lhs_ ) + eval( rhs_ ) );
+            refres_ = conj( eval( reflhs_ ) + eval( refrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<MT1,MT2>( ex );
+         }
+
+         checkResults<MT1,MT2>();
+
+         try {
+            initResults();
+            dres_   = conj( eval( lhs_ ) + eval( orhs_ ) );
+            odres_  = conj( eval( lhs_ ) + eval( orhs_ ) );
+            sres_   = conj( eval( lhs_ ) + eval( orhs_ ) );
+            osres_  = conj( eval( lhs_ ) + eval( orhs_ ) );
+            refres_ = conj( eval( reflhs_ ) + eval( refrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<MT1,OMT2>( ex );
+         }
+
+         checkResults<MT1,OMT2>();
+
+         try {
+            initResults();
+            dres_   = conj( eval( olhs_ ) + eval( rhs_ ) );
+            odres_  = conj( eval( olhs_ ) + eval( rhs_ ) );
+            sres_   = conj( eval( olhs_ ) + eval( rhs_ ) );
+            osres_  = conj( eval( olhs_ ) + eval( rhs_ ) );
+            refres_ = conj( eval( reflhs_ ) + eval( refrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<OMT1,MT2>( ex );
+         }
+
+         checkResults<OMT1,MT2>();
+
+         try {
+            initResults();
+            dres_   = conj( eval( olhs_ ) + eval( orhs_ ) );
+            odres_  = conj( eval( olhs_ ) + eval( orhs_ ) );
+            sres_   = conj( eval( olhs_ ) + eval( orhs_ ) );
+            osres_  = conj( eval( olhs_ ) + eval( orhs_ ) );
+            refres_ = conj( eval( reflhs_ ) + eval( refrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<OMT1,OMT2>( ex );
+         }
+
+         checkResults<OMT1,OMT2>();
+      }
+
+
+      //=====================================================================================
+      // Conjugate subtraction with addition assignment
+      //=====================================================================================
+
+      // Conjugate subtraction with addition assignment with the given matrices
+      {
+         test_  = "Conjugate subtraction with addition assignment with the given matrices";
+         error_ = "Failed addition assignment operation";
+
+         try {
+            initResults();
+            dres_   += conj( lhs_ + rhs_ );
+            odres_  += conj( lhs_ + rhs_ );
+            sres_   += conj( lhs_ + rhs_ );
+            osres_  += conj( lhs_ + rhs_ );
+            refres_ += conj( reflhs_ + refrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<MT1,MT2>( ex );
+         }
+
+         checkResults<MT1,MT2>();
+
+         try {
+            initResults();
+            dres_   += conj( lhs_ + orhs_ );
+            odres_  += conj( lhs_ + orhs_ );
+            sres_   += conj( lhs_ + orhs_ );
+            osres_  += conj( lhs_ + orhs_ );
+            refres_ += conj( reflhs_ + refrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<MT1,OMT2>( ex );
+         }
+
+         checkResults<MT1,OMT2>();
+
+         try {
+            initResults();
+            dres_   += conj( olhs_ + rhs_ );
+            odres_  += conj( olhs_ + rhs_ );
+            sres_   += conj( olhs_ + rhs_ );
+            osres_  += conj( olhs_ + rhs_ );
+            refres_ += conj( reflhs_ + refrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<OMT1,MT2>( ex );
+         }
+
+         checkResults<OMT1,MT2>();
+
+         try {
+            initResults();
+            dres_   += conj( olhs_ + orhs_ );
+            odres_  += conj( olhs_ + orhs_ );
+            sres_   += conj( olhs_ + orhs_ );
+            osres_  += conj( olhs_ + orhs_ );
+            refres_ += conj( reflhs_ + refrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<OMT1,OMT2>( ex );
+         }
+
+         checkResults<OMT1,OMT2>();
+      }
+
+      // Conjugate subtraction with addition assignment with evaluated matrices
+      {
+         test_  = "Conjugate subtraction with addition assignment with evaluated matrices";
+         error_ = "Failed addition assignment operation";
+
+         try {
+            initResults();
+            dres_   += conj( eval( lhs_ ) + eval( rhs_ ) );
+            odres_  += conj( eval( lhs_ ) + eval( rhs_ ) );
+            sres_   += conj( eval( lhs_ ) + eval( rhs_ ) );
+            osres_  += conj( eval( lhs_ ) + eval( rhs_ ) );
+            refres_ += conj( eval( reflhs_ ) + eval( refrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<MT1,MT2>( ex );
+         }
+
+         checkResults<MT1,MT2>();
+
+         try {
+            initResults();
+            dres_   += conj( eval( lhs_ ) + eval( orhs_ ) );
+            odres_  += conj( eval( lhs_ ) + eval( orhs_ ) );
+            sres_   += conj( eval( lhs_ ) + eval( orhs_ ) );
+            osres_  += conj( eval( lhs_ ) + eval( orhs_ ) );
+            refres_ += conj( eval( reflhs_ ) + eval( refrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<MT1,OMT2>( ex );
+         }
+
+         checkResults<MT1,OMT2>();
+
+         try {
+            initResults();
+            dres_   += conj( eval( olhs_ ) + eval( rhs_ ) );
+            odres_  += conj( eval( olhs_ ) + eval( rhs_ ) );
+            sres_   += conj( eval( olhs_ ) + eval( rhs_ ) );
+            osres_  += conj( eval( olhs_ ) + eval( rhs_ ) );
+            refres_ += conj( eval( reflhs_ ) + eval( refrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<OMT1,MT2>( ex );
+         }
+
+         checkResults<OMT1,MT2>();
+
+         try {
+            initResults();
+            dres_   += conj( eval( olhs_ ) + eval( orhs_ ) );
+            odres_  += conj( eval( olhs_ ) + eval( orhs_ ) );
+            sres_   += conj( eval( olhs_ ) + eval( orhs_ ) );
+            osres_  += conj( eval( olhs_ ) + eval( orhs_ ) );
+            refres_ += conj( eval( reflhs_ ) + eval( refrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<OMT1,OMT2>( ex );
+         }
+
+         checkResults<OMT1,OMT2>();
+      }
+
+
+      //=====================================================================================
+      // Conjugate subtraction with subtraction assignment
+      //=====================================================================================
+
+      // Conjugate subtraction with subtraction assignment with the given matrices
+      {
+         test_  = "Conjugate subtraction with subtraction assignment with the given matrices";
+         error_ = "Failed subtraction assignment operation";
+
+         try {
+            initResults();
+            dres_   -= conj( lhs_ + rhs_ );
+            odres_  -= conj( lhs_ + rhs_ );
+            sres_   -= conj( lhs_ + rhs_ );
+            osres_  -= conj( lhs_ + rhs_ );
+            refres_ -= conj( reflhs_ + refrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<MT1,MT2>( ex );
+         }
+
+         checkResults<MT1,MT2>();
+
+         try {
+            initResults();
+            dres_   -= conj( lhs_ + orhs_ );
+            odres_  -= conj( lhs_ + orhs_ );
+            sres_   -= conj( lhs_ + orhs_ );
+            osres_  -= conj( lhs_ + orhs_ );
+            refres_ -= conj( reflhs_ + refrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<MT1,OMT2>( ex );
+         }
+
+         checkResults<MT1,OMT2>();
+
+         try {
+            initResults();
+            dres_   -= conj( olhs_ + rhs_ );
+            odres_  -= conj( olhs_ + rhs_ );
+            sres_   -= conj( olhs_ + rhs_ );
+            osres_  -= conj( olhs_ + rhs_ );
+            refres_ -= conj( reflhs_ + refrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<OMT1,MT2>( ex );
+         }
+
+         checkResults<OMT1,MT2>();
+
+         try {
+            initResults();
+            dres_   -= conj( olhs_ + orhs_ );
+            odres_  -= conj( olhs_ + orhs_ );
+            sres_   -= conj( olhs_ + orhs_ );
+            osres_  -= conj( olhs_ + orhs_ );
+            refres_ -= conj( reflhs_ + refrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<OMT1,OMT2>( ex );
+         }
+
+         checkResults<OMT1,OMT2>();
+      }
+
+      // Conjugate subtraction with subtraction assignment with evaluated matrices
+      {
+         test_  = "Conjugate subtraction with subtraction assignment with evaluated matrices";
+         error_ = "Failed subtraction assignment operation";
+
+         try {
+            initResults();
+            dres_   -= conj( eval( lhs_ ) + eval( rhs_ ) );
+            odres_  -= conj( eval( lhs_ ) + eval( rhs_ ) );
+            sres_   -= conj( eval( lhs_ ) + eval( rhs_ ) );
+            osres_  -= conj( eval( lhs_ ) + eval( rhs_ ) );
+            refres_ -= conj( eval( reflhs_ ) + eval( refrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<MT1,MT2>( ex );
+         }
+
+         checkResults<MT1,MT2>();
+
+         try {
+            initResults();
+            dres_   -= conj( eval( lhs_ ) + eval( orhs_ ) );
+            odres_  -= conj( eval( lhs_ ) + eval( orhs_ ) );
+            sres_   -= conj( eval( lhs_ ) + eval( orhs_ ) );
+            osres_  -= conj( eval( lhs_ ) + eval( orhs_ ) );
+            refres_ -= conj( eval( reflhs_ ) + eval( refrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<MT1,OMT2>( ex );
+         }
+
+         checkResults<MT1,OMT2>();
+
+         try {
+            initResults();
+            dres_   -= conj( eval( olhs_ ) + eval( rhs_ ) );
+            odres_  -= conj( eval( olhs_ ) + eval( rhs_ ) );
+            sres_   -= conj( eval( olhs_ ) + eval( rhs_ ) );
+            osres_  -= conj( eval( olhs_ ) + eval( rhs_ ) );
+            refres_ -= conj( eval( reflhs_ ) + eval( refrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<OMT1,MT2>( ex );
+         }
+
+         checkResults<OMT1,MT2>();
+
+         try {
+            initResults();
+            dres_   -= conj( eval( olhs_ ) + eval( orhs_ ) );
+            odres_  -= conj( eval( olhs_ ) + eval( orhs_ ) );
+            sres_   -= conj( eval( olhs_ ) + eval( orhs_ ) );
+            osres_  -= conj( eval( olhs_ ) + eval( orhs_ ) );
+            refres_ -= conj( eval( reflhs_ ) + eval( refrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<OMT1,OMT2>( ex );
+         }
+
+         checkResults<OMT1,OMT2>();
+      }
+   }
+#endif
+}
+//*************************************************************************************************
+
+
+//*************************************************************************************************
+/*!\brief Testing the conjugate transpose sparse matrix/sparse matrix subtraction.
+//
+// \return void
+// \exception std::runtime_error Subtraction error detected.
+//
+// This function tests the conjugate transpose matrix subtraction with plain assignment. In
+// case any error resulting from the subtraction or the subsequent assignment is detected,
+// a \a std::runtime_error exception is thrown.
+*/
+template< typename MT1    // Type of the left-hand side sparse matrix
+        , typename MT2 >  // Type of the right-hand side sparse matrix
+void OperationTest<MT1,MT2>::testCTransOperation()
+{
+#if BLAZETEST_MATHTEST_TEST_CTRANS_OPERATION
+   if( BLAZETEST_MATHTEST_TEST_CTRANS_OPERATION > 1 )
+   {
+      //=====================================================================================
+      // Conjugate transpose subtraction
+      //=====================================================================================
+
+      // Conjugate transpose subtraction with the given matrices
+      {
+         test_  = "Conjugate transpose subtraction with the given matrices";
+         error_ = "Failed subtraction operation";
+
+         try {
+            initTransposeResults();
+            tdres_  = ctrans( lhs_ + rhs_ );
+            todres_ = ctrans( lhs_ + rhs_ );
+            tsres_  = ctrans( lhs_ + rhs_ );
+            tosres_ = ctrans( lhs_ + rhs_ );
+            refres_ = ctrans( reflhs_ + refrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<MT1,MT2>( ex );
+         }
+
+         checkTransposeResults<MT1,MT2>();
+
+         try {
+            initTransposeResults();
+            tdres_  = ctrans( lhs_ + orhs_ );
+            todres_ = ctrans( lhs_ + orhs_ );
+            tsres_  = ctrans( lhs_ + orhs_ );
+            tosres_ = ctrans( lhs_ + orhs_ );
+            refres_ = ctrans( reflhs_ + refrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<MT1,OMT2>( ex );
+         }
+
+         checkTransposeResults<MT1,OMT2>();
+
+         try {
+            initTransposeResults();
+            tdres_  = ctrans( olhs_ + rhs_ );
+            todres_ = ctrans( olhs_ + rhs_ );
+            tsres_  = ctrans( olhs_ + rhs_ );
+            tosres_ = ctrans( olhs_ + rhs_ );
+            refres_ = ctrans( reflhs_ + refrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<OMT1,MT2>( ex );
+         }
+
+         checkTransposeResults<OMT1,MT2>();
+
+         try {
+            initTransposeResults();
+            tdres_  = ctrans( olhs_ + orhs_ );
+            todres_ = ctrans( olhs_ + orhs_ );
+            tsres_  = ctrans( olhs_ + orhs_ );
+            tosres_ = ctrans( olhs_ + orhs_ );
+            refres_ = ctrans( reflhs_ + refrhs_ );
+         }
+         catch( std::exception& ex ) {
+            convertException<OMT1,OMT2>( ex );
+         }
+
+         checkTransposeResults<OMT1,OMT2>();
+      }
+
+      // Conjugate transpose subtraction with evaluated matrices
+      {
+         test_  = "Conjugate transpose subtraction with evaluated matrices";
+         error_ = "Failed subtraction operation";
+
+         try {
+            initTransposeResults();
+            tdres_  = ctrans( eval( lhs_ ) + eval( rhs_ ) );
+            todres_ = ctrans( eval( lhs_ ) + eval( rhs_ ) );
+            tsres_  = ctrans( eval( lhs_ ) + eval( rhs_ ) );
+            tosres_ = ctrans( eval( lhs_ ) + eval( rhs_ ) );
+            refres_ = ctrans( eval( reflhs_ ) + eval( refrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<MT1,MT2>( ex );
+         }
+
+         checkTransposeResults<MT1,MT2>();
+
+         try {
+            initTransposeResults();
+            tdres_  = ctrans( eval( lhs_ ) + eval( orhs_ ) );
+            todres_ = ctrans( eval( lhs_ ) + eval( orhs_ ) );
+            tsres_  = ctrans( eval( lhs_ ) + eval( orhs_ ) );
+            tosres_ = ctrans( eval( lhs_ ) + eval( orhs_ ) );
+            refres_ = ctrans( eval( reflhs_ ) + eval( refrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<MT1,OMT2>( ex );
+         }
+
+         checkTransposeResults<MT1,OMT2>();
+
+         try {
+            initTransposeResults();
+            tdres_  = ctrans( eval( olhs_ ) + eval( rhs_ ) );
+            todres_ = ctrans( eval( olhs_ ) + eval( rhs_ ) );
+            tsres_  = ctrans( eval( olhs_ ) + eval( rhs_ ) );
+            tosres_ = ctrans( eval( olhs_ ) + eval( rhs_ ) );
+            refres_ = ctrans( eval( reflhs_ ) + eval( refrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<OMT1,MT2>( ex );
+         }
+
+         checkTransposeResults<OMT1,MT2>();
+
+         try {
+            initTransposeResults();
+            tdres_  = ctrans( eval( olhs_ ) + eval( orhs_ ) );
+            todres_ = ctrans( eval( olhs_ ) + eval( orhs_ ) );
+            tsres_  = ctrans( eval( olhs_ ) + eval( orhs_ ) );
+            tosres_ = ctrans( eval( olhs_ ) + eval( orhs_ ) );
+            refres_ = ctrans( eval( reflhs_ ) + eval( refrhs_ ) );
+         }
+         catch( std::exception& ex ) {
+            convertException<OMT1,OMT2>( ex );
+         }
+
+         checkTransposeResults<OMT1,OMT2>();
+      }
+   }
+#endif
+}
+//*************************************************************************************************
+
+
+//*************************************************************************************************
 /*!\brief Testing the abs sparse matrix/sparse matrix subtraction.
 //
 // \return void
@@ -3621,414 +4181,6 @@
             sres_   -= abs( eval( olhs_ ) + eval( orhs_ ) );
             osres_  -= abs( eval( olhs_ ) + eval( orhs_ ) );
             refres_ -= abs( eval( reflhs_ ) + eval( refrhs_ ) );
-         }
-         catch( std::exception& ex ) {
-            convertException<OMT1,OMT2>( ex );
-         }
-
-         checkResults<OMT1,OMT2>();
-      }
-   }
-#endif
-}
-//*************************************************************************************************
-
-
-//*************************************************************************************************
-/*!\brief Testing the conj sparse matrix/sparse matrix subtraction.
-//
-// \return void
-// \exception std::runtime_error Subtraction error detected.
-//
-// This function tests the conj matrix subtraction with plain assignment, addition assignment,
-// and subtraction assignment. In case any error resulting from the subtraction or the subsequent
-// assignment is detected, a \a std::runtime_error exception is thrown.
-*/
-template< typename MT1    // Type of the left-hand side sparse matrix
-        , typename MT2 >  // Type of the right-hand side sparse matrix
-void OperationTest<MT1,MT2>::testConjOperation()
-{
-#if BLAZETEST_MATHTEST_TEST_CONJ_OPERATION
-   if( BLAZETEST_MATHTEST_TEST_CONJ_OPERATION > 1 )
-   {
-      //=====================================================================================
-      // Conj subtraction
-      //=====================================================================================
-
-      // Conj subtraction with the given matrices
-      {
-         test_  = "Conj subtraction with the given matrices";
-         error_ = "Failed subtraction operation";
-
-         try {
-            initResults();
-            dres_   = conj( lhs_ + rhs_ );
-            odres_  = conj( lhs_ + rhs_ );
-            sres_   = conj( lhs_ + rhs_ );
-            osres_  = conj( lhs_ + rhs_ );
-            refres_ = conj( reflhs_ + refrhs_ );
-         }
-         catch( std::exception& ex ) {
-            convertException<MT1,MT2>( ex );
-         }
-
-         checkResults<MT1,MT2>();
-
-         try {
-            initResults();
-            dres_   = conj( lhs_ + orhs_ );
-            odres_  = conj( lhs_ + orhs_ );
-            sres_   = conj( lhs_ + orhs_ );
-            osres_  = conj( lhs_ + orhs_ );
-            refres_ = conj( reflhs_ + refrhs_ );
-         }
-         catch( std::exception& ex ) {
-            convertException<MT1,OMT2>( ex );
-         }
-
-         checkResults<MT1,OMT2>();
-
-         try {
-            initResults();
-            dres_   = conj( olhs_ + rhs_ );
-            odres_  = conj( olhs_ + rhs_ );
-            sres_   = conj( olhs_ + rhs_ );
-            osres_  = conj( olhs_ + rhs_ );
-            refres_ = conj( reflhs_ + refrhs_ );
-         }
-         catch( std::exception& ex ) {
-            convertException<OMT1,MT2>( ex );
-         }
-
-         checkResults<OMT1,MT2>();
-
-         try {
-            initResults();
-            dres_   = conj( olhs_ + orhs_ );
-            odres_  = conj( olhs_ + orhs_ );
-            sres_   = conj( olhs_ + orhs_ );
-            osres_  = conj( olhs_ + orhs_ );
-            refres_ = conj( reflhs_ + refrhs_ );
-         }
-         catch( std::exception& ex ) {
-            convertException<OMT1,OMT2>( ex );
-         }
-
-         checkResults<OMT1,OMT2>();
-      }
-
-      // Conj subtraction with evaluated matrices
-      {
-         test_  = "Conj subtraction with evaluated matrices";
-         error_ = "Failed subtraction operation";
-
-         try {
-            initResults();
-            dres_   = conj( eval( lhs_ ) + eval( rhs_ ) );
-            odres_  = conj( eval( lhs_ ) + eval( rhs_ ) );
-            sres_   = conj( eval( lhs_ ) + eval( rhs_ ) );
-            osres_  = conj( eval( lhs_ ) + eval( rhs_ ) );
-            refres_ = conj( eval( reflhs_ ) + eval( refrhs_ ) );
-         }
-         catch( std::exception& ex ) {
-            convertException<MT1,MT2>( ex );
-         }
-
-         checkResults<MT1,MT2>();
-
-         try {
-            initResults();
-            dres_   = conj( eval( lhs_ ) + eval( orhs_ ) );
-            odres_  = conj( eval( lhs_ ) + eval( orhs_ ) );
-            sres_   = conj( eval( lhs_ ) + eval( orhs_ ) );
-            osres_  = conj( eval( lhs_ ) + eval( orhs_ ) );
-            refres_ = conj( eval( reflhs_ ) + eval( refrhs_ ) );
-         }
-         catch( std::exception& ex ) {
-            convertException<MT1,OMT2>( ex );
-         }
-
-         checkResults<MT1,OMT2>();
-
-         try {
-            initResults();
-            dres_   = conj( eval( olhs_ ) + eval( rhs_ ) );
-            odres_  = conj( eval( olhs_ ) + eval( rhs_ ) );
-            sres_   = conj( eval( olhs_ ) + eval( rhs_ ) );
-            osres_  = conj( eval( olhs_ ) + eval( rhs_ ) );
-            refres_ = conj( eval( reflhs_ ) + eval( refrhs_ ) );
-         }
-         catch( std::exception& ex ) {
-            convertException<OMT1,MT2>( ex );
-         }
-
-         checkResults<OMT1,MT2>();
-
-         try {
-            initResults();
-            dres_   = conj( eval( olhs_ ) + eval( orhs_ ) );
-            odres_  = conj( eval( olhs_ ) + eval( orhs_ ) );
-            sres_   = conj( eval( olhs_ ) + eval( orhs_ ) );
-            osres_  = conj( eval( olhs_ ) + eval( orhs_ ) );
-            refres_ = conj( eval( reflhs_ ) + eval( refrhs_ ) );
-         }
-         catch( std::exception& ex ) {
-            convertException<OMT1,OMT2>( ex );
-         }
-
-         checkResults<OMT1,OMT2>();
-      }
-
-
-      //=====================================================================================
-      // Conj subtraction with addition assignment
-      //=====================================================================================
-
-      // Conj subtraction with addition assignment with the given matrices
-      {
-         test_  = "Conj subtraction with addition assignment with the given matrices";
-         error_ = "Failed addition assignment operation";
-
-         try {
-            initResults();
-            dres_   += conj( lhs_ + rhs_ );
-            odres_  += conj( lhs_ + rhs_ );
-            sres_   += conj( lhs_ + rhs_ );
-            osres_  += conj( lhs_ + rhs_ );
-            refres_ += conj( reflhs_ + refrhs_ );
-         }
-         catch( std::exception& ex ) {
-            convertException<MT1,MT2>( ex );
-         }
-
-         checkResults<MT1,MT2>();
-
-         try {
-            initResults();
-            dres_   += conj( lhs_ + orhs_ );
-            odres_  += conj( lhs_ + orhs_ );
-            sres_   += conj( lhs_ + orhs_ );
-            osres_  += conj( lhs_ + orhs_ );
-            refres_ += conj( reflhs_ + refrhs_ );
-         }
-         catch( std::exception& ex ) {
-            convertException<MT1,OMT2>( ex );
-         }
-
-         checkResults<MT1,OMT2>();
-
-         try {
-            initResults();
-            dres_   += conj( olhs_ + rhs_ );
-            odres_  += conj( olhs_ + rhs_ );
-            sres_   += conj( olhs_ + rhs_ );
-            osres_  += conj( olhs_ + rhs_ );
-            refres_ += conj( reflhs_ + refrhs_ );
-         }
-         catch( std::exception& ex ) {
-            convertException<OMT1,MT2>( ex );
-         }
-
-         checkResults<OMT1,MT2>();
-
-         try {
-            initResults();
-            dres_   += conj( olhs_ + orhs_ );
-            odres_  += conj( olhs_ + orhs_ );
-            sres_   += conj( olhs_ + orhs_ );
-            osres_  += conj( olhs_ + orhs_ );
-            refres_ += conj( reflhs_ + refrhs_ );
-         }
-         catch( std::exception& ex ) {
-            convertException<OMT1,OMT2>( ex );
-         }
-
-         checkResults<OMT1,OMT2>();
-      }
-
-      // Conj subtraction with addition assignment with evaluated matrices
-      {
-         test_  = "Conj subtraction with addition assignment with evaluated matrices";
-         error_ = "Failed addition assignment operation";
-
-         try {
-            initResults();
-            dres_   += conj( eval( lhs_ ) + eval( rhs_ ) );
-            odres_  += conj( eval( lhs_ ) + eval( rhs_ ) );
-            sres_   += conj( eval( lhs_ ) + eval( rhs_ ) );
-            osres_  += conj( eval( lhs_ ) + eval( rhs_ ) );
-            refres_ += conj( eval( reflhs_ ) + eval( refrhs_ ) );
-         }
-         catch( std::exception& ex ) {
-            convertException<MT1,MT2>( ex );
-         }
-
-         checkResults<MT1,MT2>();
-
-         try {
-            initResults();
-            dres_   += conj( eval( lhs_ ) + eval( orhs_ ) );
-            odres_  += conj( eval( lhs_ ) + eval( orhs_ ) );
-            sres_   += conj( eval( lhs_ ) + eval( orhs_ ) );
-            osres_  += conj( eval( lhs_ ) + eval( orhs_ ) );
-            refres_ += conj( eval( reflhs_ ) + eval( refrhs_ ) );
-         }
-         catch( std::exception& ex ) {
-            convertException<MT1,OMT2>( ex );
-         }
-
-         checkResults<MT1,OMT2>();
-
-         try {
-            initResults();
-            dres_   += conj( eval( olhs_ ) + eval( rhs_ ) );
-            odres_  += conj( eval( olhs_ ) + eval( rhs_ ) );
-            sres_   += conj( eval( olhs_ ) + eval( rhs_ ) );
-            osres_  += conj( eval( olhs_ ) + eval( rhs_ ) );
-            refres_ += conj( eval( reflhs_ ) + eval( refrhs_ ) );
-         }
-         catch( std::exception& ex ) {
-            convertException<OMT1,MT2>( ex );
-         }
-
-         checkResults<OMT1,MT2>();
-
-         try {
-            initResults();
-            dres_   += conj( eval( olhs_ ) + eval( orhs_ ) );
-            odres_  += conj( eval( olhs_ ) + eval( orhs_ ) );
-            sres_   += conj( eval( olhs_ ) + eval( orhs_ ) );
-            osres_  += conj( eval( olhs_ ) + eval( orhs_ ) );
-            refres_ += conj( eval( reflhs_ ) + eval( refrhs_ ) );
-         }
-         catch( std::exception& ex ) {
-            convertException<OMT1,OMT2>( ex );
-         }
-
-         checkResults<OMT1,OMT2>();
-      }
-
-
-      //=====================================================================================
-      // Conj subtraction with subtraction assignment
-      //=====================================================================================
-
-      // Conj subtraction with subtraction assignment with the given matrices
-      {
-         test_  = "Conj subtraction with subtraction assignment with the given matrices";
-         error_ = "Failed subtraction assignment operation";
-
-         try {
-            initResults();
-            dres_   -= conj( lhs_ + rhs_ );
-            odres_  -= conj( lhs_ + rhs_ );
-            sres_   -= conj( lhs_ + rhs_ );
-            osres_  -= conj( lhs_ + rhs_ );
-            refres_ -= conj( reflhs_ + refrhs_ );
-         }
-         catch( std::exception& ex ) {
-            convertException<MT1,MT2>( ex );
-         }
-
-         checkResults<MT1,MT2>();
-
-         try {
-            initResults();
-            dres_   -= conj( lhs_ + orhs_ );
-            odres_  -= conj( lhs_ + orhs_ );
-            sres_   -= conj( lhs_ + orhs_ );
-            osres_  -= conj( lhs_ + orhs_ );
-            refres_ -= conj( reflhs_ + refrhs_ );
-         }
-         catch( std::exception& ex ) {
-            convertException<MT1,OMT2>( ex );
-         }
-
-         checkResults<MT1,OMT2>();
-
-         try {
-            initResults();
-            dres_   -= conj( olhs_ + rhs_ );
-            odres_  -= conj( olhs_ + rhs_ );
-            sres_   -= conj( olhs_ + rhs_ );
-            osres_  -= conj( olhs_ + rhs_ );
-            refres_ -= conj( reflhs_ + refrhs_ );
-         }
-         catch( std::exception& ex ) {
-            convertException<OMT1,MT2>( ex );
-         }
-
-         checkResults<OMT1,MT2>();
-
-         try {
-            initResults();
-            dres_   -= conj( olhs_ + orhs_ );
-            odres_  -= conj( olhs_ + orhs_ );
-            sres_   -= conj( olhs_ + orhs_ );
-            osres_  -= conj( olhs_ + orhs_ );
-            refres_ -= conj( reflhs_ + refrhs_ );
-         }
-         catch( std::exception& ex ) {
-            convertException<OMT1,OMT2>( ex );
-         }
-
-         checkResults<OMT1,OMT2>();
-      }
-
-      // Conj subtraction with subtraction assignment with evaluated matrices
-      {
-         test_  = "Conj subtraction with subtraction assignment with evaluated matrices";
-         error_ = "Failed subtraction assignment operation";
-
-         try {
-            initResults();
-            dres_   -= conj( eval( lhs_ ) + eval( rhs_ ) );
-            odres_  -= conj( eval( lhs_ ) + eval( rhs_ ) );
-            sres_   -= conj( eval( lhs_ ) + eval( rhs_ ) );
-            osres_  -= conj( eval( lhs_ ) + eval( rhs_ ) );
-            refres_ -= conj( eval( reflhs_ ) + eval( refrhs_ ) );
-         }
-         catch( std::exception& ex ) {
-            convertException<MT1,MT2>( ex );
-         }
-
-         checkResults<MT1,MT2>();
-
-         try {
-            initResults();
-            dres_   -= conj( eval( lhs_ ) + eval( orhs_ ) );
-            odres_  -= conj( eval( lhs_ ) + eval( orhs_ ) );
-            sres_   -= conj( eval( lhs_ ) + eval( orhs_ ) );
-            osres_  -= conj( eval( lhs_ ) + eval( orhs_ ) );
-            refres_ -= conj( eval( reflhs_ ) + eval( refrhs_ ) );
-         }
-         catch( std::exception& ex ) {
-            convertException<MT1,OMT2>( ex );
-         }
-
-         checkResults<MT1,OMT2>();
-
-         try {
-            initResults();
-            dres_   -= conj( eval( olhs_ ) + eval( rhs_ ) );
-            odres_  -= conj( eval( olhs_ ) + eval( rhs_ ) );
-            sres_   -= conj( eval( olhs_ ) + eval( rhs_ ) );
-            osres_  -= conj( eval( olhs_ ) + eval( rhs_ ) );
-            refres_ -= conj( eval( reflhs_ ) + eval( refrhs_ ) );
-         }
-         catch( std::exception& ex ) {
-            convertException<OMT1,MT2>( ex );
-         }
-
-         checkResults<OMT1,MT2>();
-
-         try {
-            initResults();
-            dres_   -= conj( eval( olhs_ ) + eval( orhs_ ) );
-            odres_  -= conj( eval( olhs_ ) + eval( orhs_ ) );
-            sres_   -= conj( eval( olhs_ ) + eval( orhs_ ) );
-            osres_  -= conj( eval( olhs_ ) + eval( orhs_ ) );
-            refres_ -= conj( eval( reflhs_ ) + eval( refrhs_ ) );
          }
          catch( std::exception& ex ) {
             convertException<OMT1,OMT2>( ex );


arm64: support restart through restart handler call chain

The kernel core now supports a restart handler call chain to restart the
system.  Call it if arm_pm_restart is not set.

Signed-off-by: Guenter Roeck <ba324ca7b1c77fc20bb970d5aff6eea9377918a5@roeck-us.net>
Acked-by: Catalin Marinas <15ce75b290ebaf27c3f9fd73ab848685ed3d8261@arm.com>
Acked-by: Heiko Stuebner <9ab5f52a1ca0bcf4f70d6d9008e02f6134b5b8f2@sntech.de>
Cc: Arnd Bergmann <f2c659f01951776204a6c5b902787d9019fbeebd@arndb.de>
Cc: David Woodhouse <97b3379caa91f4ee97e44013ae4dc6350540fa9d@infradead.org>
Cc: Dmitry Eremin-Solenikov <b6edad08270b2e4ffbcb0879e25a0e29a48c5275@gmail.com>
Cc: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@kernel.org>
Cc: Jonas Jensen <c72f4c1d52c160086195ed01f658663cef237767@gmail.com>
Cc: Maxime Ripard <2d324f4ca95610bde432fa2af2f28cd21110687d@free-electrons.com>
Cc: Randy Dunlap <6f29df8e90a57f1ba61ffd63b0468c86bb6d3a99@infradead.org>
Cc: Russell King <ba324ca7b1c77fc20bb970d5aff6eea9377918a5@arm.linux.org.uk>
Cc: Steven Rostedt <43232e92d70cc7aa53504ad0397085ee47bad87f@goodmis.org>
Cc: Tomasz Figa <c4885e520559c7b5b4fe1e9e188b924d2debd35e@samsung.com>
Cc: Will Deacon <b913f13ef92ac157955c954ccaaff7be065faba4@arm.com>
Cc: Wim Van Sebroeck <5f65f6985de1ebf15dde04e0dc4668211868bafa@iguana.be>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>