power: qpnp-charger: distinguish charger subtypes

There are three different types of charger peripheral
the qpnp-charger driver supports: SMBB, SMBBP, SMBCL

Add a new parameter which helps control workarounds
by distinguishing between charger types.

CRs-Fixed: 470841
Change-Id: If6218e1076818d635ccd8c27ae97216eab23c3d0
Signed-off-by: David Keitel <bd5c00b7233f7e9d1df99d90a21c081aa6291657@codeaurora.org>

--- drivers/power/qpnp-charger.c
+++ drivers/power/qpnp-charger.c
@@ -157,6 +157,11 @@
 /* smbb_misc_interrupts */
 #define TFTWDOG_IRQ			BIT(0)

+/* SMBB types */
+#define SMBB				BIT(1)
+#define SMBBP				BIT(2)
+#define SMBCL				BIT(3)
+
 /* Workaround flags */
 #define CHG_FLAGS_VCP_WA		BIT(0)

@@ -194,6 +199,8 @@
  * @warm_bat_decidegc		Warm battery temperature in degree Celsius
  * @cool_bat_decidegc		Cool battery temperature in degree Celsius
  * @revision:			PMIC revision
+ * @type:			SMBB type
+ * @tchg_mins			maximum allowed software initiated charge time
  * @thermal_levels		amount of thermal mitigation levels
  * @thermal_mitigation		thermal mitigation level values
  * @therm_lvl_sel		thermal mitigation level selection
@@ -247,6 +254,8 @@
 	unsigned int			cool_bat_decidegc;
 	unsigned int			safe_current;
 	unsigned int			revision;
+	unsigned int			type;
+	unsigned int			tchg_mins;
 	unsigned int			thermal_levels;
 	unsigned int			therm_lvl_sel;
 	unsigned int			*thermal_mitigation;
@@ -813,16 +822,16 @@
 	int rc = 0;
 	struct qpnp_vadc_result results;

-	if (chip->revision > 0) {
+	if (chip->revision == 0 && chip->type == SMBB) {
+		pr_err("vbat reading not supported for 1.0 rc=%d\n", rc);
+		return 0;
+	} else {
 		rc = qpnp_vadc_read(VBAT_SNS, &results);
 		if (rc) {
 			pr_err("Unable to read vbat rc=%d\n", rc);
 			return 0;
 		}
 		return results.physical;
-	} else {
-		pr_err("vbat reading not supported for 1.0 rc=%d\n", rc);
-		return 0;
 	}
 }

@@ -1421,7 +1430,7 @@
 static void
 qpnp_chg_setup_flags(struct qpnp_chg_chip *chip)
 {
-	if (chip->revision > 0)
+	if (chip->revision > 0 && chip->type == SMBB)
 		chip->flags |= CHG_FLAGS_VCP_WA;
 }

@@ -1651,7 +1660,9 @@
 	case SMBBP_BOOST_SUBTYPE:
 		break;
 	case SMBB_MISC_SUBTYPE:
+		chip->type = SMBB;
 	case SMBBP_MISC_SUBTYPE:
+		chip->type = SMBBP;
 		pr_debug("Setting BOOT_DONE\n");
 		rc = qpnp_chg_masked_write(chip,
 			chip->misc_base + CHGR_MISC_BOOT_DONE,


[S390] blacklist.c: removed duplicated include

Removed duplicated include <asm/cio.h>
in drivers/s390/cio/blacklist.c.

Signed-off-by: Huang Weiyi <3747a8217f9c255c8b609f0f2e71d2a8804c1b96@gmail.com>
Signed-off-by: Martin Schwidefsky <52616596d8f5df0d597e85ab515377f92f939c68@de.ibm.com>

--- drivers/s390/cio/blacklist.c
+++ drivers/s390/cio/blacklist.c
@@ -19,7 +19,6 @@

 #include <asm/cio.h>
 #include <asm/uaccess.h>
-#include <asm/cio.h>

 #include "blacklist.h"
 #include "cio.h"


s390/ap_bus: use and-mask instead of a cast

Let's get rid of another sparse false positive:

drivers/s390/crypto/ap_bus.c:416:64: warning:
  cast truncates bits from constant value (102030405060708 becomes 5060708)

So instead of using a cast let's use an and-mask.
That way sparse remains silent and one doesn't always have to check
if this is a valid warning/bug or just a false positive.

Signed-off-by: Heiko Carstens <8dcf0f69152f32f23184f83357a3731522e56b9c@de.ibm.com>

--- drivers/s390/crypto/ap_bus.c
+++ drivers/s390/crypto/ap_bus.c
@@ -413,7 +413,7 @@
 	register unsigned long reg2 asm ("2") = (unsigned long) msg;
 	register unsigned long reg3 asm ("3") = (unsigned long) length;
 	register unsigned long reg4 asm ("4") = (unsigned int) (psmid >> 32);
-	register unsigned long reg5 asm ("5") = (unsigned int) psmid;
+	register unsigned long reg5 asm ("5") = psmid & 0xffffffff;

 	if (special == 1)
 		reg0 |= 0x400000UL;


[PATCH] s390: make qeth buildable

[PATCH] s390: make qeth buildable

Signed-off-by: Bastian Blank <b2825b28ff8355ee4bdcf5e1f47256ef35d0ee2d@waldi.eu.org>
Cc: Martin Schwidefsky <52616596d8f5df0d597e85ab515377f92f939c68@de.ibm.com>
Cc: Heiko Carstens <8dcf0f69152f32f23184f83357a3731522e56b9c@de.ibm.com>
Cc: "David S. Miller" <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>
Acked-by: Jeff Garzik <f3e731dfa293c7a83119d8aacfa41b5d2d780be9@garzik.org>
Acked-by: Frank Pavlic <9b7819e1633a3ed18c64224bafc86a2a5c641023@de.ibm.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@osdl.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@osdl.org>

--- drivers/s390/net/qeth_main.c
+++ drivers/s390/net/qeth_main.c
@@ -8014,7 +8014,6 @@

 static struct neigh_ops arp_direct_ops_template = {
 	.family = AF_INET,
-	.destructor = NULL,
 	.solicit = NULL,
 	.error_report = NULL,
 	.output = dev_queue_xmit,


This should (finally) fix the 64-bit build. <sigh>

--- lib/libarchive/archive_read_support_format_zip.c
+++ lib/libarchive/archive_read_support_format_zip.c
@@ -370,7 +370,7 @@
     size_t *size, off_t *offset)
 {
 	struct zip *zip;
-	size_t bytes_read;
+	ssize_t bytes_read;
 	const void *compressed_buff;
 	int r;


Fix typo

Fix typo

git-svn-id: 12692bf5fc2024d371e0c35b324993c653e304d8@51103 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

--- src/lib/Eet.h
+++ src/lib/Eet.h
@@ -1779,7 +1779,7 @@
       const char *(*type_get)(const void *data, Eina_Bool *unknow);    /**< convert any kind of data type to a name that define an Eet_Data_Element. */
       Eina_Bool   (*type_set)(const char *type, void *data, Eina_Bool unknow);    /**< set the type at a particular adress */
       void      * (*array_alloc)(size_t size); /**< how to allocate memory for array (usually malloc()) */
-      void        (*array_free)(void *mem); /**< how to free memory for array (usually malloc()) */
+      void        (*array_free)(void *mem); /**< how to free memory for array (usually free()) */
    } func;
 };


Changes in stack.c

Changes in stack.c

--- c/stack.c
+++ c/stack.c
@@ -6,6 +6,15 @@
 int arr[10];
 int top = -1;

+void menu();
+void push(int x);
+void showStack();
+void pop();
+
+int main() {
+	menu();
+	return 0;
+}

 void menu() {

@@ -15,7 +24,7 @@
 	scanf("%d", &option);

 	switch (option) {
-		case 1: printf("Input: ");
+		case 1: printf("\n\nInput: ");
 			scanf("%d", &input);
 			push(input);
 			break;
@@ -32,14 +41,14 @@

-int push(int x) {
+void push(int x) {
 	top++;
 	if (top>=10) printf("\n\nStack Overflow!!!");
 	else arr[top]=x;
 	menu();
 }

-int showStack() {
+void showStack() {
 	int a = top;
 	if (a==-1) printf("\n\nError: Stack Underflow");
 	else
@@ -47,22 +56,14 @@
 		printf("\n\nStack Is:\n");
 		for (a; a>=0; a--)
 		  printf("%d\n",arr[a]);
-		printf("\n");
 		menu();
 	}
 }

-int pop() {
-	printf("\n\nPopped: %d",arr[top]);
+void pop() {
+	printf("\n\nPopped: %d\n",arr[top]);
 	top--;
 	menu();
 }

-
-int main() {
-	menu();
-	return 0;
-}
-
-


ARM: cleanup gate_vma initialization

ARM: cleanup gate_vma initialization

Three's no need to have code initializing this by hand; it's more
efficient to initialize the constant structure members directly.

Signed-off-by: Russell King <f6aa0246ff943bfa8602cdf60d40c481b38ed232@arm.linux.org.uk>

--- arch/arm/kernel/process.c
+++ arch/arm/kernel/process.c
@@ -464,15 +464,16 @@
  * atomic helpers and the signal restart code. Insert it into the
  * gate_vma so that it is visible through ptrace and /proc/<pid>/mem.
  */
-static struct vm_area_struct gate_vma;
+static struct vm_area_struct gate_vma = {
+	.vm_start	= 0xffff0000,
+	.vm_end		= 0xffff0000 + PAGE_SIZE,
+	.vm_flags	= VM_READ | VM_EXEC | VM_MAYREAD | VM_MAYEXEC,
+	.vm_mm		= &init_mm,
+};

 static int __init gate_vma_init(void)
 {
-	gate_vma.vm_start	= 0xffff0000;
-	gate_vma.vm_end		= 0xffff0000 + PAGE_SIZE;
-	gate_vma.vm_page_prot	= PAGE_READONLY_EXEC;
-	gate_vma.vm_flags	= VM_READ | VM_EXEC |
-				  VM_MAYREAD | VM_MAYEXEC;
+	gate_vma.vm_page_prot = PAGE_READONLY_EXEC;
 	return 0;
 }
 arch_initcall(gate_vma_init);


[SCSI] zfcp: Fix handling for boxed port after physical close

When a FSF physical close returns the status boxed, this means that
another system already closed the port. For our system this is the
same status as in the good path, we have to send the normal close. So,
set the status for the boxed response to the same as for the good
status.

Signed-off-by: Christof Schmitt <afe27fc9cc8724d5819dd86aabfb0a732dbdb77b@de.ibm.com>
Signed-off-by: Martin Peschke <1bc0264d5bf8869899640171b693092d8c4899f8@de.ibm.com>
Signed-off-by: James Bottomley <407b36959ca09543ccda8f8e06721c791bc53435@HansenPartnership.com>

--- drivers/s390/scsi/zfcp_fsf.c
+++ drivers/s390/scsi/zfcp_fsf.c
@@ -2968,6 +2968,13 @@
 		zfcp_erp_port_boxed(port);
 		fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR |
 			ZFCP_STATUS_FSFREQ_RETRY;
+
+		/* can't use generic zfcp_erp_modify_port_status because
+		 * ZFCP_STATUS_COMMON_OPEN must not be reset for the port */
+		atomic_clear_mask(ZFCP_STATUS_PORT_PHYS_OPEN, &port->status);
+		list_for_each_entry(unit, &port->unit_list_head, list)
+			atomic_clear_mask(ZFCP_STATUS_COMMON_OPEN,
+					  &unit->status);
 		break;

 	case FSF_ADAPTER_STATUS_AVAILABLE:


Add support for getting the local Bluetooth clock

--- tools/bccmd.c
+++ tools/bccmd.c
@@ -79,6 +79,22 @@
 	return 0;
 }

+static int cmd_clock(int dd, int argc, char *argv[])
+{
+	uint32_t clock = 0;
+	int err;
+
+	err = csr_read_varid_uint32(dd, 0x4711, CSR_VARID_BT_CLOCK, &clock);
+	if (err < 0) {
+		errno = -err;
+		return -1;
+	}
+
+	printf("Bluetooth clock: 0x%04x (%d)\n", clock, clock);
+
+	return 0;
+}
+
 static struct {
 	char *str;
 	int (*func)(int dd, int argc, char **argv);
@@ -86,6 +102,7 @@
 	char *doc;
 } commands[] = {
 	{ "keylen", cmd_keylen, "<handle>", "Get current crypt key length" },
+	{ "clock",  cmd_clock,  "",         "Get local Bluetooth clock"    },
 	{ NULL },
 };

@@ -99,7 +116,7 @@

 	printf("Commands:\n");
 		for (i = 0; commands[i].str; i++)
-			printf("\t%s\t%s\t%s\n", commands[i].str,
+			printf("\t%s\t%-8s\t%s\n", commands[i].str,
 				commands[i].arg, commands[i].doc);
 }


Fix typo

Fix typo

SVN revision: 51103


ARM: twd: register clockevents device before enabling PPI

The smp_twd clockevents driver currently enables the local timer PPI
before the clockevents device is registered. This can lead to a kernel
panic if a spurious timer interrupt is generated before registration
has completed since the kernel will treat it as an IPI timer.

This patch moves the clockevents device registration before the IRQ
unmasking so that we can always handle timer interrupts once they can
occur.

Acked-by: Marc Zyngier <a16cc0c82647c52d401177f8e50567df5499e36c@arm.com>
Signed-off-by: Will Deacon <b913f13ef92ac157955c954ccaaff7be065faba4@arm.com>

--- arch/arm/kernel/smp_twd.c
+++ arch/arm/kernel/smp_twd.c
@@ -137,8 +137,8 @@
 	clk->max_delta_ns = clockevent_delta2ns(0xffffffff, clk);
 	clk->min_delta_ns = clockevent_delta2ns(0xf, clk);

+	clockevents_register_device(clk);
+
 	/* Make sure our local interrupt controller has this enabled */
 	gic_enable_ppi(clk->irq);
-
-	clockevents_register_device(clk);
 }


Fix a focus issue (no need to keep the mouse cursor in text entries to be able to type...)

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

--- graf2d/win32gdk/gdk/src/gdk/win32/gdkevents-win32.c
+++ graf2d/win32gdk/gdk/src/gdk/win32/gdkevents-win32.c
@@ -5332,7 +5332,7 @@
          GetCursorPos(&pt);
          chw = WindowFromPoint(pt);
          other_window = gdk_window_lookup(chw);
-         if (other_window) { // && IsChild(xevent->hwnd, chw)) {
+         if (other_window && IsChild(xevent->hwnd, chw)) {
             gdk_window_unref (window);
             gdk_window_ref (other_window);
             window = other_window;
@@ -5423,7 +5423,7 @@
          GetCursorPos(&pt);
          chw = WindowFromPoint(pt);
          other_window = gdk_window_lookup(chw);
-         if (other_window) { // && IsChild(xevent->hwnd, chw)) {
+         if (other_window && IsChild(xevent->hwnd, chw)) {
             gdk_window_unref (window);
             gdk_window_ref (other_window);
             window = other_window;


cxlflash: Remove unnecessary scsi_block_requests

The host reset handler is called with I/O already blocked, thus
there is no need to explicitly block and unblock I/O in the handler.

Signed-off-by: Matthew R. Ochs <5279806d22638a7ca4d6f7841541587adc5832b0@linux.vnet.ibm.com>
Signed-off-by: Manoj N. Kumar <e5bed78df35c9a68cd0ebc89592def76df34c305@linux.vnet.ibm.com>
Reviewed-by: Brian King <bf668d4b220231d97fe248d4ae0ba63a1d887e4c@linux.vnet.ibm.com>
Reviewed-by: Tomas Henzl <ed03cdd404c1c501a81ee6cc756c3c81b1d33f83@redhat.com>
Signed-off-by: James Bottomley <1acebbdca565c7b6b638bdc23b58b5610d1a56b8@Odin.com>


ktool.c: Register or authenticates when using connect arg

--- tools/ktool.c
+++ tools/ktool.c
@@ -864,7 +864,27 @@

 static int cmd_connect(void)
 {
-	return -ENOSYS;
+	int err;
+
+	/* If uuid and token are given, register. Otherwise, authenticates */
+	if (opt_uuid && opt_token) {
+		err = authenticate(opt_uuid, opt_token);
+		if (err) {
+			printf("Error authenticating\n");
+			return -EINVAL;
+		}
+	} else {
+		err = cmd_register();
+		if (err) {
+			printf("Error registering\n");
+			return -EINVAL;
+		}
+	}
+
+	/* TODO: Send schema */
+	/* TODO: Listen for messages from GW */
+
+	return 0;
 }

 /*


msm: clock: Fix clk_set_parent()

msm: clock: Fix clk_set_parent()

- Update the clk->parent field when the operation succeeds.
- Grab the prepare lock when changing the parent. This is necessary to
  avoid race conditions between clk_set_parent() and clk_prepare(),
  clk_unprepare() and clk_set_rate(). Luckily, as of now, only the measure
  clock supports clk_set_parent(). So, this is not a real issue in a
  production device. Each set_parent op still needs to deal with
  grabbing/releasing the enable lock at the right time.
- If a clock doesn't support clk_set_parent() return an error instead of
  silently failing.

Change-Id: I5fdd6a7bb44bb924dc9aabd7119a03520617e3d1
Signed-off-by: Saravana Kannan <ce25c3cee4cc6c4c8acfc1680b3ed89cf644dba3@codeaurora.org>

--- arch/arm/mach-msm/clock.c
+++ arch/arm/mach-msm/clock.c
@@ -419,10 +419,21 @@

 int clk_set_parent(struct clk *clk, struct clk *parent)
 {
+	int rc = 0;
+
 	if (!clk->ops->set_parent)
-		return 0;
-
-	return clk->ops->set_parent(clk, parent);
+		return -ENOSYS;
+
+	mutex_lock(&clk->prepare_lock);
+	if (clk->parent == parent)
+		goto out;
+	rc = clk->ops->set_parent(clk, parent);
+	if (!rc)
+		clk->parent = parent;
+out:
+	mutex_unlock(&clk->prepare_lock);
+
+	return rc;
 }
 EXPORT_SYMBOL(clk_set_parent);


max32660: make methods static in UART code

Also removed a couple of unused methods and replaced `unsigned` with
`unsigned int` in a couple of places pointed out by the presubmit check.

BUG=none
TEST=Board using MAX32660 builds successfully, has functioning console
BRANCH=none

Change-Id: I596410e5fb8b78e5325bbe726a710ae476968a71
Signed-off-by: Harry Cutts <1d9acf085666736c25fb5139ba37ad9d917ae7f5@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2095847
Reviewed-by: Tai-Hsu Lin <483869e623dfa258e94647e9ded365825b6eb117@chromium.org>
Commit-Queue: Tai-Hsu Lin <483869e623dfa258e94647e9ded365825b6eb117@chromium.org>

--- chip/max32660/uart_chip.c
+++ chip/max32660/uart_chip.c
@@ -61,7 +61,7 @@
 #define UART_ALTERNATE_CLOCK_HZ 7372800

 /* ************************************************************************* */
-unsigned uart_number_write_available(mxc_uart_regs_t *uart)
+static unsigned int uart_number_write_available(mxc_uart_regs_t *uart)
 {
 	return MXC_UART_FIFO_DEPTH -
 	       ((uart->status & MXC_F_UART_STATUS_TX_FIFO_CNT) >>
@@ -69,49 +69,37 @@
 }

 /* ************************************************************************* */
-unsigned uart_number_read_available(mxc_uart_regs_t *uart)
+static unsigned int uart_number_read_available(mxc_uart_regs_t *uart)
 {
 	return ((uart->status & MXC_F_UART_STATUS_RX_FIFO_CNT) >>
 		MXC_F_UART_STATUS_RX_FIFO_CNT_POS);
 }

-void uartn_enable_tx_interrupt(int uart_num)
+static void uartn_enable_tx_interrupt(int uart_num)
 {
 	// Enable the interrupts
 	MXC_UART_GET_UART(uart_num)->int_en |= UART_TX_IE;
 }

-void uartn_disable_tx_interrupt(int uart_num)
+static void uartn_disable_tx_interrupt(int uart_num)
 {
 	// Disable the interrupts
 	MXC_UART_GET_UART(uart_num)->int_en &= ~UART_TX_IE;
 }

-void uartn_enable_rx_interrupt(int uart_num)
-{
-	// Enable the interrupts
-	MXC_UART_GET_UART(uart_num)->int_en |= UART_RX_IE;
-}
-
-void uartn_disable_rx_interrupt(int uart_num)
-{
-	// Enable the interrupts
-	MXC_UART_GET_UART(uart_num)->int_en &= ~UART_RX_IE;
-}
-
-int uartn_tx_in_progress(int uart_num)
+static int uartn_tx_in_progress(int uart_num)
 {
 	return ((MXC_UART_GET_UART(uart_num)->status &
 		 (MXC_F_UART_STATUS_TX_BUSY)) != 0);
 }

-void uartn_tx_flush(int uart_num)
+static void uartn_tx_flush(int uart_num)
 {
 	while (uartn_tx_in_progress(uart_num)) {
 	}
 }

-int uartn_tx_ready(int uart_num)
+static int uartn_tx_ready(int uart_num)
 {
 	int avail;
 	avail = uart_number_write_available(MXC_UART_GET_UART(uart_num));
@@ -119,7 +107,7 @@
 	return (avail != 0);
 }

-int uartn_rx_available(int uart_num)
+static int uartn_rx_available(int uart_num)
 {
 	int avail;
 	/* True if the RX buffer is not completely empty. */
@@ -127,7 +115,7 @@
 	return (avail != 0);
 }

-void uartn_write_char(int uart_num, char c)
+static void uartn_write_char(int uart_num, char c)
 {
 	int avail;
 	mxc_uart_regs_t *uart;
@@ -145,14 +133,14 @@
 	uart->fifo = c;
 }

-int uartn_read_char(int uart_num)
+static int uartn_read_char(int uart_num)
 {
 	int c;
 	c = MXC_UART_GET_UART(uart_num)->fifo;
 	return c;
 }

-void uartn_clear_interrupt_flags(int uart_num)
+static void uartn_clear_interrupt_flags(int uart_num)
 {
 	uint32_t flags;
 	// Read and clear interrupts


drivers/sds011: Fix SAUL read error return

--- drivers/sds011/sds011_saul.c
+++ drivers/sds011/sds011_saul.c
@@ -36,7 +36,7 @@
        res->scale = -7;
        return 2;
     }
-    return ECANCELED;
+    return -ECANCELED;
 }

 const saul_driver_t sds011_saul_driver = {


ARM: OMAP3: Warn about spurious interrupts

In the case of spurious interrupt, the handler for previous interrupt
handler needs to flush posted writes with a read back of the interrupt
ack register. Warn about handlers that need to flush posted writes.

Signed-off-by: Tony Lindgren <1001e8702733cced254345e193c88aaa47a4f5de@atomide.com>

--- arch/arm/mach-omap2/irq.c
+++ arch/arm/mach-omap2/irq.c
@@ -23,6 +23,7 @@
 #define INTC_REVISION		0x0000
 #define INTC_SYSCONFIG		0x0010
 #define INTC_SYSSTATUS		0x0014
+#define INTC_SIR		0x0040
 #define INTC_CONTROL		0x0048
 #define INTC_MIR_CLEAR0		0x0088
 #define INTC_MIR_SET0		0x008c
@@ -60,6 +61,30 @@
 	return __raw_readl(bank->base_reg + reg);
 }

+static int previous_irq;
+
+/*
+ * On 34xx we can get occasional spurious interrupts if the ack from
+ * an interrupt handler does not get posted before we unmask. Warn about
+ * the interrupt handlers that need to flush posted writes.
+ */
+static int omap_check_spurious(unsigned int irq)
+{
+	u32 sir, spurious;
+
+	sir = intc_bank_read_reg(&irq_banks[0], INTC_SIR);
+	spurious = sir >> 6;
+
+	if (spurious > 1) {
+		printk(KERN_WARNING "Spurious irq %i: 0x%08x, please flush "
+					"posted write for irq %i\n",
+					irq, sir, previous_irq);
+		return spurious;
+	}
+
+	return 0;
+}
+
 /* XXX: FIQ and additional INTC support (only MPU at the moment) */
 static void omap_ack_irq(unsigned int irq)
 {
@@ -69,6 +94,20 @@
 static void omap_mask_irq(unsigned int irq)
 {
 	int offset = irq & (~(IRQ_BITS_PER_REG - 1));
+
+	if (cpu_is_omap34xx()) {
+		int spurious = 0;
+
+		/*
+		 * INT_34XX_GPT12_IRQ is also the spurious irq. Maybe because
+		 * it is the highest irq number?
+		 */
+		if (irq == INT_34XX_GPT12_IRQ)
+			spurious = omap_check_spurious(irq);
+
+		if (!spurious)
+			previous_irq = irq;
+	}

 	irq &= (IRQ_BITS_PER_REG - 1);


spmi: pmic-arb: Don't byte swap when reading/writing FIFO

We don't want to swap bytes that we're reading and writing to the
FIFOs when we're running on a big-endian CPU. Doing so causes
problems like where the qcom-spmi-iadc driver can't detect the
type of device because the bytes are all mixed up. Use the raw IO
accessors for these API instead, and collapse pmic_arb_base_read()
into the byte reading API so that we aren't tempted to read non-FIFO
data like commands with that function.

Cc: Andy Gross <3e259a9c7ec8261c71cce57b93152e64c5e60da4@codeaurora.org>
Signed-off-by: Stephen Boyd <010521127f513270fe503d86ab8316ac5147f4b7@codeaurora.org>
Acked-by: Bjorn Andersson <6e6fda072d932515099508d6d220572c68e9add5@sonymobile.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>


ARM: OMAP3+: do not register non-dt OPP tables for device tree boot

OMAP3+ supports both device tree and non-device tree boot.
Device tree bindings for OMAP3+ is supposed to be added via dts following:
Documentation/devicetree/bindings/power/opp.txt

Since we now have device tree entries for OMAP3+ cpu OPPs,
The current code wrongly adds duplicate OPPs. So, dont register OPPs
when booting using device tree.

Signed-off-by: Nishanth Menon <50c3c575ce2bb12c45e20736ce59e86fe81915b4@ti.com>
Signed-off-by: Tony Lindgren <1001e8702733cced254345e193c88aaa47a4f5de@atomide.com>

--- arch/arm/mach-omap2/opp.c
+++ arch/arm/mach-omap2/opp.c
@@ -17,6 +17,7 @@
  * GNU General Public License for more details.
  */
 #include <linux/module.h>
+#include <linux/of.h>
 #include <linux/opp.h>
 #include <linux/cpu.h>

@@ -39,6 +40,9 @@
 		u32 opp_def_size)
 {
 	int i, r;
+
+	if (of_have_populated_dt())
+		return -EINVAL;

 	if (!opp_def || !opp_def_size) {
 		pr_err("%s: invalid params!\n", __func__);


Staging: comedi: remove usb wrappers

Staging: comedi: remove usb wrappers

The usb wrapper macros are no longer needed, as all of
the comedi drivers using them have been converted to
use the "native" USB core calls.

Cc: Anders Blomdell <d1ca5bbec0d2b2387abc3206c33a347d56d05afc@control.lth.se>
Cc: David Schleef <ba4868b3f277c8e387b55d9e3d0be7c045cdd89e@schleef.org>
Cc: Frank Mori Hess <298b610a35dd7dda4ea5d33c28e8a7d9dff2b9bf@users.sourceforge.net>
Cc: Ian Abbott <9e6ba6483b6a3e14d61f7c987e72ecb5b46122d6@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>

--- drivers/staging/comedi/usb.h
+++ drivers/staging/comedi/usb.h
@@ -1,75 +0,0 @@
-/*
-
-    linux/usb.h compatibility header
-
-    Copyright (C) 2003 Bernd Porr, Bernd.Porr@cn.stir.ac.uk
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef __COMPAT_LINUX_USB_H_
-#define __COMPAT_LINUX_USB_H_
-
-#include <linux/version.h>
-#include <linux/time.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-#include <linux/kernel.h>
-
-#define USB_ALLOC_URB(x) usb_alloc_urb(x)
-#define USB_SUBMIT_URB(x) usb_submit_urb(x)
-#define URB_ISO_ASAP USB_ISO_ASAP
-#define PROBE_ERR_RETURN(x) NULL
-#define usb_get_dev(x) (x)
-#define usb_put_dev(x)
-#define interface_to_usbdev(intf) NULL
-#else
-#define USB_ALLOC_URB(x) usb_alloc_urb(x,GFP_KERNEL)
-#define USB_SUBMIT_URB(x) usb_submit_urb(x,GFP_ATOMIC)
-#define PROBE_ERR_RETURN(x) (x)
-#endif
-
-#include <linux/usb.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12)
-static inline int USB_CONTROL_MSG(struct usb_device *dev, unsigned int pipe,
-	__u8 request, __u8 requesttype, __u16 value, __u16 index,
-	void *data, __u16 size, int millisec_timeout)
-{
-	return usb_control_msg(dev, pipe, request, requesttype, value, index,
-		data, size, msecs_to_jiffies(millisec_timeout));
-}
-static inline int USB_BULK_MSG(struct usb_device *usb_dev, unsigned int pipe,
-	void *data, int len, int *actual_length, int millisec_timeout)
-{
-	return usb_bulk_msg(usb_dev, pipe, data, len, actual_length,
-		msecs_to_jiffies(millisec_timeout));
-}
-#else
-#define USB_CONTROL_MSG usb_control_msg
-#define USB_BULK_MSG usb_bulk_msg
-#endif
-
-/*
- * Determine whether we need the "owner" member of struct usb_driver and
- * define COMEDI_HAVE_USB_DRIVER_OWNER if we need it.
- */
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,19) \
-       && LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
-#define COMEDI_HAVE_USB_DRIVER_OWNER
-#endif
-
-#endif


frv: Remove the BKL from sys_execve

frv: Remove the BKL from sys_execve

sys_execve for frv seems to be a copy-and-paste of sys_execve that no
longer requires the bkl. Just remove it.

Signed-off-by: John Kacur <dae4bd386fd4c6474c13eecbb94aa6e9e7589534@redhat.com>
Reviewed-by: Frederic Weisbecker <e8a1bf9163cb25e93cfd6540f223b3872ea7ee55@gmail.com>
Acked-by: David Howells <ebac1d06c1688626821bb0e574a037a7a5354e49@redhat.com>
LKML-Reference: <999d96fd40cdc77abc3edc15fee78c1f76ff156d@localhost.localdomain>
Signed-off-by: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>

--- arch/frv/kernel/process.c
+++ arch/frv/kernel/process.c
@@ -255,15 +255,12 @@
 	int error;
 	char * filename;

-	lock_kernel();
 	filename = getname(name);
 	error = PTR_ERR(filename);
 	if (IS_ERR(filename))
-		goto out;
+		return error;
 	error = do_execve(filename, argv, envp, __frame);
 	putname(filename);
- out:
-	unlock_kernel();
 	return error;
 }


Staging: hv: vmbus: Use the newly introduced state in closing the channel

Now, use the newly introduced state in closing the channel and eliminate a
potential failure condition (that currently was not being handled correctly).

Signed-off-by: K. Y. Srinivasan <bcbf172338421f26297a2592698edf8cc84ecbef@microsoft.com>
Signed-off-by: Haiyang Zhang <6c26c5044f1d67d9ed5db6596adb36d25510e216@microsoft.com>
Signed-off-by: Abhishek Kane <a6f940ddb8198bd6787d8a32aef6daff28b15d2f@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>

--- drivers/staging/hv/channel.c
+++ drivers/staging/hv/channel.c
@@ -549,22 +549,15 @@
 void vmbus_close(struct vmbus_channel *channel)
 {
 	struct vmbus_channel_close_channel *msg;
-	struct vmbus_channel_msginfo *info;
 	int ret;

 	/* Stop callback and cancel the timer asap */
 	channel->onchannel_callback = NULL;

 	/* Send a closing message */
-	info = kmalloc(sizeof(*info) +
-		       sizeof(struct vmbus_channel_close_channel), GFP_KERNEL);
-        /* FIXME: can't do anything other than return here because the
-	 *        function is void */
-	if (!info)
-		return;
-
-
-	msg = (struct vmbus_channel_close_channel *)info->msg;
+
+	msg = &channel->close_msg.msg;
+
 	msg->header.msgtype = CHANNELMSG_CLOSECHANNEL;
 	msg->child_relid = channel->offermsg.child_relid;

@@ -583,7 +576,6 @@
 	free_pages((unsigned long)channel->ringbuffer_pages,
 		get_order(channel->ringbuffer_pagecount * PAGE_SIZE));

-	kfree(info);

 }
 EXPORT_SYMBOL_GPL(vmbus_close);


remove dead stuff

remove dead stuff

--- arch/hppa/gsc/gscbusvar.h
+++ arch/hppa/gsc/gscbusvar.h
@@ -1,7 +1,7 @@
-/*	$OpenBSD: gscbusvar.h,v 1.9 2002/12/18 23:52:45 mickey Exp $	*/
+/*	$OpenBSD: gscbusvar.h,v 1.10 2003/04/07 17:38:51 mickey Exp $	*/

 /*
- * Copyright (c) 1998-2002 Michael Shalayeff
+ * Copyright (c) 1998-2003 Michael Shalayeff
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -50,15 +50,6 @@
 	struct gscbus_ic *ga_ic;	/* IC pointer */
 };

-struct gscbus_intr {
-	int pri;
-	int (*handler)(void *);
-	void *arg;
-	void *softc;
-	void *cpuiv;
-	struct evcnt evcnt;
-};
-
 struct gsc_softc {
 	struct  device sc_dev;
 	void *sc_ih;
@@ -66,17 +57,11 @@
 	bus_space_tag_t sc_iot;
 	struct gscbus_ic *sc_ic;
 	struct hppa_bus_dma_tag sc_dmatag;
-
-	/* interrupt vectors */
-	struct gscbus_intr sc_intrvs[32];
-	u_int32_t sc_intrmask;
 };

 void *gsc_intr_establish(struct gsc_softc *sc, int pri, int irq,
-			 int (*handler)(void *v), void *arg,
-			 struct device *name);
+    int (*handler)(void *v), void *arg, struct device *name);
 void gsc_intr_disestablish(struct gsc_softc *sc, void *v);
 int gsc_intr(void *);

 int gscprint(void *, const char *);
-


driver: arcv2_timer: remove sys_clock_disable

sys_clock_disable now is only called in sys_reboot.
This API is outdated, no need to implement it and
there is a weak version.

Signed-off-by: Wayne Ren <d5c6d7c4aa45e53f819f17870783d153a32ba7d0@synopsys.com>

--- drivers/timer/arcv2_timer0.c
+++ drivers/timer/arcv2_timer0.c
@@ -340,35 +340,6 @@
 #endif
 }

-/**
- *
- * @brief Stop announcing ticks into the kernel
- *
- * This routine disables timer interrupt generation and delivery.
- * Note that the timer's counting cannot be stopped by software.
- *
- * @return N/A
- */
-void sys_clock_disable(void)
-{
-	unsigned int key;  /* interrupt lock level */
-	u32_t control; /* timer control register value */
-
-	key = irq_lock();
-
-	/* disable interrupt generation */
-
-	control = timer0_control_register_get();
-	timer0_control_register_set(control & ~_ARC_V2_TMR_CTRL_IE);
-
-	irq_unlock(key);
-
-	/* disable interrupt in the interrupt controller */
-
-	irq_disable(IRQ_TIMER0);
-}
-
-
 #if SMP_TIMER_DRIVER
 void smp_timer_init(void)
 {


cleanup leftovers

cleanup leftovers

--- arch/hppa/hppa/disksubr.c
+++ arch/hppa/hppa/disksubr.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: disksubr.c,v 1.2 1999/06/12 17:51:31 mickey Exp $	*/
+/*	$OpenBSD: disksubr.c,v 1.3 1999/06/12 17:52:29 mickey Exp $	*/

 /*
  * Copyright (c) 1999 Michael Shalayeff
@@ -595,7 +595,6 @@
 	int *cylp;
 	int spoofonly;
 {
-	struct lifdir *p;
 	int fsoff;

 	/* read LIF volume header */


serial:ifx6x60: Remove memset for SPI frame

There is no need to memset 0 to SPI frame memory before preparing
transfer frame bits, because SPI frame header are encoded with valid
data size, so don't need to worry about adopting dirty bits, more,
memset zero for each SPI frame may impact the spi throughput efficiency.

Signed-off-by: Chen Jun <7b19fc921a6b4726a29be822d20b234d974dbb6b@intel.com>
Signed-off-by: channing <5ff1e791b534cb2bff48df645f55908995b541f1@intel.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/tty/serial/ifx6x60.c
+++ drivers/tty/serial/ifx6x60.c
@@ -481,7 +481,6 @@
 	unsigned char *tx_buffer;

 	tx_buffer = ifx_dev->tx_buffer;
-	memset(tx_buffer, 0, IFX_SPI_TRANSFER_SIZE);

 	/* make room for required SPI header */
 	tx_buffer += IFX_SPI_HEADER_OVERHEAD;


fd moves, acd gets added

fd moves, acd gets added

--- arch/i386/i386/autoconf.c
+++ arch/i386/i386/autoconf.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: autoconf.c,v 1.16 1996/11/06 01:37:23 deraadt Exp $	*/
+/*	$OpenBSD: autoconf.c,v 1.17 1996/11/06 02:09:39 deraadt Exp $	*/
 /*	$NetBSD: autoconf.c,v 1.20 1996/05/03 19:41:56 christos Exp $	*/

 /*-
@@ -222,6 +222,10 @@
 #if NMCD > 0
 extern	struct cfdriver mcd_cd;
 #endif
+#include "acd.h"
+#if NACD > 0
+extern	struct cfdriver acd_cd;
+#endif

 struct	genericconf {
 	struct cfdriver *gc_driver;
@@ -241,7 +245,10 @@
 	{ &mcd_cd, "mcd", 7 },
 #endif
 #if NFDC > 0
-	{ &fd_cd,  "fd",  2 },
+	{ &fd_cd,  "fd",  20 },
+#endif
+#if NACD > 0
+	{ &acd_cd,  "acd",  18 },
 #endif
 	{ 0 }
 };


usb: dwc3: omap: improve error handling of dwc3_omap_probe

Improved the error handling of dwc3_omap_probe so that on error
conditions dwc3_omap is left in the original state.

Signed-off-by: Kishon Vijay Abraham I <c224db9378a929ae8338a052bbb1b30fb46cdd39@ti.com>
Signed-off-by: Felipe Balbi <94dddeeef08b001e003cce128ddc162a4e2c6cd2@ti.com>

--- drivers/usb/dwc3/dwc3-omap.c
+++ drivers/usb/dwc3/dwc3-omap.c
@@ -347,7 +347,7 @@
 	ret = pm_runtime_get_sync(dev);
 	if (ret < 0) {
 		dev_err(dev, "get_sync failed with err %d\n", ret);
-		return ret;
+		goto err0;
 	}

 	reg = dwc3_omap_readl(omap->base, USBOTGSS_UTMI_OTG_STATUS);
@@ -376,7 +376,7 @@
 	if (ret) {
 		dev_err(dev, "failed to request IRQ #%d --> %d\n",
 				omap->irq, ret);
-		return ret;
+		goto err1;
 	}

 	dwc3_omap_enable_irqs(omap);
@@ -384,10 +384,21 @@
 	ret = of_platform_populate(node, NULL, NULL, dev);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to create dwc3 core\n");
-		return ret;
-	}
-
-	return 0;
+		goto err2;
+	}
+
+	return 0;
+
+err2:
+	dwc3_omap_disable_irqs(omap);
+
+err1:
+	pm_runtime_put_sync(dev);
+
+err0:
+	pm_runtime_disable(dev);
+
+	return ret;
 }

 static int dwc3_omap_remove(struct platform_device *pdev)


ditch a few prototypes for non-existant functions


usb: gadget: net2280: Use module_pci_driver macro

Signed-off-by: Ricardo Ribalda Delgado <39bb74b16720293e1449e36465485b27216fbd6d@gmail.com>
Signed-off-by: Felipe Balbi <94dddeeef08b001e003cce128ddc162a4e2c6cd2@ti.com>

--- drivers/usb/gadget/net2280.c
+++ drivers/usb/gadget/net2280.c
@@ -3588,6 +3588,9 @@
 	void			__iomem *base = NULL;
 	int			retval, i;

+	if (!use_dma)
+		use_dma_chaining = 0;
+
 	/* alloc, and start init */
 	dev = kzalloc (sizeof *dev, GFP_KERNEL);
 	if (dev == NULL){
@@ -3833,20 +3836,8 @@
 	/* FIXME add power management support */
 };

+module_pci_driver(net2280_pci_driver);
+
 MODULE_DESCRIPTION (DRIVER_DESC);
 MODULE_AUTHOR ("David Brownell");
 MODULE_LICENSE ("GPL");
-
-static int __init init (void)
-{
-	if (!use_dma)
-		use_dma_chaining = 0;
-	return pci_register_driver (&net2280_pci_driver);
-}
-module_init (init);
-
-static void __exit cleanup (void)
-{
-	pci_unregister_driver (&net2280_pci_driver);
-}
-module_exit (cleanup);


m68k/amiga: Chip RAM - Use lookup_resource()

Replace a custom implementation (which doesn't lock the resource tree) by a
call to lookup_resource()

Signed-off-by: Geert Uytterhoeven <0da414d9d963da4039c2a0525b1844228075aa58@linux-m68k.org>

--- arch/m68k/amiga/chipram.c
+++ arch/m68k/amiga/chipram.c
@@ -93,21 +93,21 @@
 void amiga_chip_free(void *ptr)
 {
 	unsigned long start = ZTWO_PADDR(ptr);
-	struct resource **p, *res;
+	struct resource *res;
 	unsigned long size;

-	for (p = &chipram_res.child; (res = *p); p = &res->sibling) {
-		if (res->start != start)
-			continue;
-		*p = res->sibling;
-		size = resource_size(res);
-		pr_debug("amiga_chip_free: free %lu bytes at %p\n", size, ptr);
-		atomic_add(size, &chipavail);
-		kfree(res);
+	res = lookup_resource(&chipram_res, start);
+	if (!res) {
+		pr_err("amiga_chip_free: trying to free nonexistent region at "
+		       "%p\n", ptr);
 		return;
 	}
-	pr_err("amiga_chip_free: trying to free nonexistent region at %p\n",
-	       ptr);
+
+	size = resource_size(res);
+	pr_debug("amiga_chip_free: free %lu bytes at %p\n", size, ptr);
+	atomic_add(size, &chipavail);
+	release_resource(res);
+	kfree(res);
 }
 EXPORT_SYMBOL(amiga_chip_free);


usb: ehci_msm2: Resume root hub on receiving ASYNC interrupt

An ASYNC interrupt is an indication by hardware that some
activity has happended on USB lines in LPM (low power mode),
and USB software should now bring it out of LPM.
Ideally, hardware should give one more interrupt after coming
out of LPM so that USB driver can process that accordingly.
But, sometimes this interrupt is not generated from h/w for
remote wakeup event in host mode. Hence, resume root hub on
receiving the ASYNC interrupt from hardware in Host mode.

CRs-Fixed: 369298
CRs-Fixed: 368948
Change-Id: Ifb166c1f3c749ab8c615308ab52d85ccdc666733
Signed-off-by: Chiranjeevi Velempati <692a45b26f75473403cc09fb298f4dc2e885a389@codeaurora.org>

--- drivers/usb/host/ehci-msm2.c
+++ drivers/usb/host/ehci-msm2.c
@@ -670,6 +670,7 @@

 skip_phy_resume:

+	usb_hcd_resume_root_hub(hcd);
 	atomic_set(&mhcd->in_lpm, 0);

 	if (mhcd->async_int) {


Set the shared priority entry to the value of the current maxipl entry, not the index. ok kettenis@

--- arch/macppc/dev/macintr.c
+++ arch/macppc/dev/macintr.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: macintr.c,v 1.43 2011/08/29 20:21:44 drahn Exp $	*/
+/*	$OpenBSD: macintr.c,v 1.44 2011/09/16 17:56:52 drahn Exp $	*/

 /*-
  * Copyright (c) 2008 Dale Rahn <drahn@openbsd.org>
@@ -404,8 +404,9 @@
 		if (maxipl == IPL_NONE) {
 			minipl = IPL_NONE; /* Interrupt not enabled */
 		} else {
-			for (i = minipl; i <= maxipl; i++)
-				macintr_pri_share[i] = i;
+			for (i = minipl; i < maxipl; i++)
+				macintr_pri_share[i] =
+				    macintr_pri_share[maxipl];
 		}

 		/* Enable interrupts at lower levels */


ohci-at91: use HUB_CHAR_*

ohci-at91: use HUB_CHAR_*

Fix  using the  bare numbers to set the 'wHubCharacteristics' field of the Hub
Descriptor while the values are #define'd in <linux/usb/ch11.h>.

While at it, stop setting already set HUB_CHAR_INDV_PORT_LPSM once again.

Signed-off-by: Sergei Shtylyov <d8c69075be49b0738b690ec4af0e9025b8c97c9e@cogentembedded.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>

--- drivers/usb/host/ohci-at91.c
+++ drivers/usb/host/ohci-at91.c
@@ -347,11 +347,13 @@
 		 */

 		desc->wHubCharacteristics &= ~cpu_to_le16(HUB_CHAR_LPSM);
-		desc->wHubCharacteristics |= cpu_to_le16(0x0001);
+		desc->wHubCharacteristics |=
+			cpu_to_le16(HUB_CHAR_INDV_PORT_LPSM);

 		if (pdata->overcurrent_supported) {
 			desc->wHubCharacteristics &= ~cpu_to_le16(HUB_CHAR_OCPM);
-			desc->wHubCharacteristics |=  cpu_to_le16(0x0008|0x0001);
+			desc->wHubCharacteristics |=
+				cpu_to_le16(HUB_CHAR_INDV_PORT_OCPM);
 		}

 		dev_dbg(hcd->self.controller, "wHubCharacteristics after 0x%04x\n",


MIPS: ralink: Fix usb issue during frequency scaling

If the USB HCD is running and the cpu is scaled too low, then the USB
stops working. Increase the idle speed of the core to fix this if the
kernel is built with USB support.

The "magic" values are taken from the Ralink SDK Kernel.

Signed-off-by: John Crispin <be6487f9df4dce44a640672d6c07330104d43593@openwrt.org>
Cc: 562397917b9a8bf316569a848858b12fb417723f@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/11441/
Signed-off-by: Ralf Baechle <92f48d309cda194c8eda36aa8f9ae28c488fa208@linux-mips.org>


xHCI: remove redundant parameter in giveback_first_trb()

Parameter *td is not used in giveback_first_trb(). Remove it.

Signed-off-by: Andiry Xu <33c0087e6b124dbcc99bb85f96fa8b5593d5e576@amd.com>
Signed-off-by: Sarah Sharp <d4c4fc5069677be84f589aa6e14eedffef9ba12f@linux.intel.com>

--- drivers/usb/host/xhci-ring.c
+++ drivers/usb/host/xhci-ring.c
@@ -2414,7 +2414,7 @@

 static void giveback_first_trb(struct xhci_hcd *xhci, int slot_id,
 		unsigned int ep_index, unsigned int stream_id, int start_cycle,
-		struct xhci_generic_trb *start_trb, struct xhci_td *td)
+		struct xhci_generic_trb *start_trb)
 {
 	/*
 	 * Pass all the TRBs to the hardware at once and make sure this write
@@ -2625,7 +2625,7 @@

 	check_trb_math(urb, num_trbs, running_total);
 	giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id,
-			start_cycle, start_trb, td);
+			start_cycle, start_trb);
 	return 0;
 }

@@ -2757,7 +2757,7 @@

 	check_trb_math(urb, num_trbs, running_total);
 	giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id,
-			start_cycle, start_trb, td);
+			start_cycle, start_trb);
 	return 0;
 }

@@ -2859,7 +2859,7 @@
 			field | TRB_IOC | TRB_TYPE(TRB_STATUS) | ep_ring->cycle_state);

 	giveback_first_trb(xhci, slot_id, ep_index, 0,
-			start_cycle, start_trb, td);
+			start_cycle, start_trb);
 	return 0;
 }

@@ -3006,10 +3006,8 @@
 		}
 	}

-	wmb();
-	start_trb->field[3] |= start_cycle;
-
-	xhci_ring_ep_doorbell(xhci, slot_id, ep_index, urb->stream_id);
+	giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id,
+			start_cycle, start_trb);
 	return 0;
 }


openrisc: delay: fix handling of counter overflow

If the counter overflows during a __delay operation, we will exit the
loop prematurely. For example, calling __delay(0x100) with the counter
at 0xffffff00 gives us a target of 0x0. The unsigned comparison in the
while loop will likely be false on the first iteration (if the counter
is now anything other than 0) and we will return early.

This patch fixes the problem by comparing deltas in the loop rather than
absolute values.

Cc: Jon Masters <352b80a23cd10e6eeb706dfacb6e4021473932fe@redhat.com>
Signed-off-by: Will Deacon <b913f13ef92ac157955c954ccaaff7be065faba4@arm.com>
Signed-off-by: Jonas Bonn <35a2c6fae61f8077aab61faa4019722abf05093c@southpole.se>

--- arch/openrisc/lib/delay.c
+++ arch/openrisc/lib/delay.c
@@ -30,9 +30,9 @@

 void __delay(unsigned long cycles)
 {
-	cycles_t target = get_cycles() + cycles;
+	cycles_t start = get_cycles();

-	while (get_cycles() < target)
+	while ((get_cycles() - start) < cycles)
 		cpu_relax();
 }
 EXPORT_SYMBOL(__delay);


USB: iowarrior: Push down BKL

USB: iowarrior: Push down BKL

I'm pretty sure the mutex is sufficient for all locking but will come
back to that later if the USB folks don't beat me to it. For now get rid
of the old BKL ioctl method and wrap the ioctl handler

Signed-off-by: Alan Cox <91e38e63b890fbb214c8914809fde03c73e7f24d@redhat.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>

--- drivers/usb/misc/iowarrior.c
+++ drivers/usb/misc/iowarrior.c
@@ -474,8 +474,8 @@
 /**
  *	iowarrior_ioctl
  */
-static int iowarrior_ioctl(struct inode *inode, struct file *file,
-			   unsigned int cmd, unsigned long arg)
+static long iowarrior_ioctl(struct file *file, unsigned int cmd,
+							unsigned long arg)
 {
 	struct iowarrior *dev = NULL;
 	__u8 *buffer;
@@ -493,6 +493,7 @@
 		return -ENOMEM;

 	/* lock this object */
+	lock_kernel();
 	mutex_lock(&dev->mutex);

 	/* verify that the device wasn't unplugged */
@@ -584,6 +585,7 @@
 error_out:
 	/* unlock the device */
 	mutex_unlock(&dev->mutex);
+	unlock_kernel();
 	kfree(buffer);
 	return retval;
 }
@@ -719,7 +721,7 @@
 	.owner = THIS_MODULE,
 	.write = iowarrior_write,
 	.read = iowarrior_read,
-	.ioctl = iowarrior_ioctl,
+	.unlocked_ioctl = iowarrior_ioctl,
 	.open = iowarrior_open,
 	.release = iowarrior_release,
 	.poll = iowarrior_poll,


s390/modules: add relocation overflow checking

Given enough debug options some modules can grow large enough
that the GOT table gets bigger than 4K. On s390 the modules
are compiled with -fpic which limits the GOT to 4K. The end
result is a module that is loaded but won't work.

Add a sanity check to apply_rela and return with an error if
a relocation error is detected for a module.

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

--- arch/s390/kernel/module.c
+++ arch/s390/kernel/module.c
@@ -65,8 +65,7 @@
 	vfree(module_region);
 }

-static void
-check_rela(Elf_Rela *rela, struct module *me)
+static void check_rela(Elf_Rela *rela, struct module *me)
 {
 	struct mod_arch_syminfo *info;

@@ -115,9 +114,8 @@
  * Account for GOT and PLT relocations. We can't add sections for
  * got and plt but we can increase the core module size.
  */
-int
-module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
-			  char *secstrings, struct module *me)
+int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
+			      char *secstrings, struct module *me)
 {
 	Elf_Shdr *symtab;
 	Elf_Sym *symbols;
@@ -179,13 +177,52 @@
 	return 0;
 }

-static int
-apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
-	   struct module *me)
+static int apply_rela_bits(Elf_Addr loc, Elf_Addr val,
+			   int sign, int bits, int shift)
+{
+	unsigned long umax;
+	long min, max;
+
+	if (val & ((1UL << shift) - 1))
+		return -ENOEXEC;
+	if (sign) {
+		val = (Elf_Addr)(((long) val) >> shift);
+		min = -(1L << (bits - 1));
+		max = (1L << (bits - 1)) - 1;
+		if ((long) val < min || (long) val > max)
+			return -ENOEXEC;
+	} else {
+		val >>= shift;
+		umax = ((1UL << (bits - 1)) << 1) - 1;
+		if ((unsigned long) val > umax)
+			return -ENOEXEC;
+	}
+
+	if (bits == 8)
+		*(unsigned char *) loc = val;
+	else if (bits == 12)
+		*(unsigned short *) loc = (val & 0xfff) |
+			(*(unsigned short *) loc & 0xf000);
+	else if (bits == 16)
+		*(unsigned short *) loc = val;
+	else if (bits == 20)
+		*(unsigned int *) loc = (val & 0xfff) << 16 |
+			(val & 0xff000) >> 4 |
+			(*(unsigned int *) loc & 0xf00000ff);
+	else if (bits == 32)
+		*(unsigned int *) loc = val;
+	else if (bits == 64)
+		*(unsigned long *) loc = val;
+	return 0;
+}
+
+static int apply_rela(Elf_Rela *rela, Elf_Addr base, Elf_Sym *symtab,
+		      const char *strtab, struct module *me)
 {
 	struct mod_arch_syminfo *info;
 	Elf_Addr loc, val;
 	int r_type, r_sym;
+	int rc;

 	/* This is where to make the change */
 	loc = base + rela->r_offset;
@@ -205,20 +242,17 @@
 	case R_390_64:		/* Direct 64 bit.  */
 		val += rela->r_addend;
 		if (r_type == R_390_8)
-			*(unsigned char *) loc = val;
+			rc = apply_rela_bits(loc, val, 0, 8, 0);
 		else if (r_type == R_390_12)
-			*(unsigned short *) loc = (val & 0xfff) |
-				(*(unsigned short *) loc & 0xf000);
+			rc = apply_rela_bits(loc, val, 0, 12, 0);
 		else if (r_type == R_390_16)
-			*(unsigned short *) loc = val;
+			rc = apply_rela_bits(loc, val, 0, 16, 0);
 		else if (r_type == R_390_20)
-			*(unsigned int *) loc =
-				(*(unsigned int *) loc & 0xf00000ff) |
-				(val & 0xfff) << 16 | (val & 0xff000) >> 4;
+			rc = apply_rela_bits(loc, val, 1, 20, 0);
 		else if (r_type == R_390_32)
-			*(unsigned int *) loc = val;
+			rc = apply_rela_bits(loc, val, 0, 32, 0);
 		else if (r_type == R_390_64)
-			*(unsigned long *) loc = val;
+			rc = apply_rela_bits(loc, val, 0, 64, 0);
 		break;
 	case R_390_PC16:	/* PC relative 16 bit.  */
 	case R_390_PC16DBL:	/* PC relative 16 bit shifted by 1.  */
@@ -227,15 +261,15 @@
 	case R_390_PC64:	/* PC relative 64 bit.	*/
 		val += rela->r_addend - loc;
 		if (r_type == R_390_PC16)
-			*(unsigned short *) loc = val;
+			rc = apply_rela_bits(loc, val, 1, 16, 0);
 		else if (r_type == R_390_PC16DBL)
-			*(unsigned short *) loc = val >> 1;
+			rc = apply_rela_bits(loc, val, 1, 16, 1);
 		else if (r_type == R_390_PC32DBL)
-			*(unsigned int *) loc = val >> 1;
+			rc = apply_rela_bits(loc, val, 1, 32, 1);
 		else if (r_type == R_390_PC32)
-			*(unsigned int *) loc = val;
+			rc = apply_rela_bits(loc, val, 1, 32, 0);
 		else if (r_type == R_390_PC64)
-			*(unsigned long *) loc = val;
+			rc = apply_rela_bits(loc, val, 1, 64, 0);
 		break;
 	case R_390_GOT12:	/* 12 bit GOT offset.  */
 	case R_390_GOT16:	/* 16 bit GOT offset.  */
@@ -260,26 +294,24 @@
 		val = info->got_offset + rela->r_addend;
 		if (r_type == R_390_GOT12 ||
 		    r_type == R_390_GOTPLT12)
-			*(unsigned short *) loc = (val & 0xfff) |
-				(*(unsigned short *) loc & 0xf000);
+			rc = apply_rela_bits(loc, val, 0, 12, 0);
 		else if (r_type == R_390_GOT16 ||
 			 r_type == R_390_GOTPLT16)
-			*(unsigned short *) loc = val;
+			rc = apply_rela_bits(loc, val, 0, 16, 0);
 		else if (r_type == R_390_GOT20 ||
 			 r_type == R_390_GOTPLT20)
-			*(unsigned int *) loc =
-				(*(unsigned int *) loc & 0xf00000ff) |
-				(val & 0xfff) << 16 | (val & 0xff000) >> 4;
+			rc = apply_rela_bits(loc, val, 1, 20, 0);
 		else if (r_type == R_390_GOT32 ||
 			 r_type == R_390_GOTPLT32)
-			*(unsigned int *) loc = val;
-		else if (r_type == R_390_GOTENT ||
-			 r_type == R_390_GOTPLTENT)
-			*(unsigned int *) loc =
-				(val + (Elf_Addr) me->module_core - loc) >> 1;
+			rc = apply_rela_bits(loc, val, 0, 32, 0);
 		else if (r_type == R_390_GOT64 ||
 			 r_type == R_390_GOTPLT64)
-			*(unsigned long *) loc = val;
+			rc = apply_rela_bits(loc, val, 0, 64, 0);
+		else if (r_type == R_390_GOTENT ||
+			 r_type == R_390_GOTPLTENT) {
+			val += (Elf_Addr) me->module_core - loc;
+			rc = apply_rela_bits(loc, val, 1, 32, 1);
+		}
 		break;
 	case R_390_PLT16DBL:	/* 16 bit PC rel. PLT shifted by 1.  */
 	case R_390_PLT32DBL:	/* 32 bit PC rel. PLT shifted by 1.  */
@@ -321,17 +353,17 @@
 			val += rela->r_addend - loc;
 		}
 		if (r_type == R_390_PLT16DBL)
-			*(unsigned short *) loc = val >> 1;
+			rc = apply_rela_bits(loc, val, 1, 16, 1);
 		else if (r_type == R_390_PLTOFF16)
-			*(unsigned short *) loc = val;
+			rc = apply_rela_bits(loc, val, 0, 16, 0);
 		else if (r_type == R_390_PLT32DBL)
-			*(unsigned int *) loc = val >> 1;
+			rc = apply_rela_bits(loc, val, 1, 32, 1);
 		else if (r_type == R_390_PLT32 ||
 			 r_type == R_390_PLTOFF32)
-			*(unsigned int *) loc = val;
+			rc = apply_rela_bits(loc, val, 0, 32, 0);
 		else if (r_type == R_390_PLT64 ||
 			 r_type == R_390_PLTOFF64)
-			*(unsigned long *) loc = val;
+			rc = apply_rela_bits(loc, val, 0, 64, 0);
 		break;
 	case R_390_GOTOFF16:	/* 16 bit offset to GOT.  */
 	case R_390_GOTOFF32:	/* 32 bit offset to GOT.  */
@@ -339,20 +371,20 @@
 		val = val + rela->r_addend -
 			((Elf_Addr) me->module_core + me->arch.got_offset);
 		if (r_type == R_390_GOTOFF16)
-			*(unsigned short *) loc = val;
+			rc = apply_rela_bits(loc, val, 0, 16, 0);
 		else if (r_type == R_390_GOTOFF32)
-			*(unsigned int *) loc = val;
+			rc = apply_rela_bits(loc, val, 0, 32, 0);
 		else if (r_type == R_390_GOTOFF64)
-			*(unsigned long *) loc = val;
+			rc = apply_rela_bits(loc, val, 0, 64, 0);
 		break;
 	case R_390_GOTPC:	/* 32 bit PC relative offset to GOT. */
 	case R_390_GOTPCDBL:	/* 32 bit PC rel. off. to GOT shifted by 1. */
 		val = (Elf_Addr) me->module_core + me->arch.got_offset +
 			rela->r_addend - loc;
 		if (r_type == R_390_GOTPC)
-			*(unsigned int *) loc = val;
+			rc = apply_rela_bits(loc, val, 1, 32, 0);
 		else if (r_type == R_390_GOTPCDBL)
-			*(unsigned int *) loc = val >> 1;
+			rc = apply_rela_bits(loc, val, 1, 32, 1);
 		break;
 	case R_390_COPY:
 	case R_390_GLOB_DAT:	/* Create GOT entry.  */
@@ -360,19 +392,25 @@
 	case R_390_RELATIVE:	/* Adjust by program base.  */
 		/* Only needed if we want to support loading of
 		   modules linked with -shared. */
-		break;
+		return -ENOEXEC;
 	default:
-		printk(KERN_ERR "module %s: Unknown relocation: %u\n",
+		printk(KERN_ERR "module %s: unknown relocation: %u\n",
 		       me->name, r_type);
 		return -ENOEXEC;
 	}
+	if (rc) {
+		printk(KERN_ERR "module %s: relocation error for symbol %s "
+		       "(r_type %i, value 0x%lx)\n",
+		       me->name, strtab + symtab[r_sym].st_name,
+		       r_type, (unsigned long) val);
+		return rc;
+	}
 	return 0;
 }

-int
-apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
-		   unsigned int symindex, unsigned int relsec,
-		   struct module *me)
+int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
+		       unsigned int symindex, unsigned int relsec,
+		       struct module *me)
 {
 	Elf_Addr base;
 	Elf_Sym *symtab;
@@ -388,7 +426,7 @@
 	n = sechdrs[relsec].sh_size / sizeof(Elf_Rela);

 	for (i = 0; i < n; i++, rela++) {
-		rc = apply_rela(rela, base, symtab, me);
+		rc = apply_rela(rela, base, symtab, strtab, me);
 		if (rc)
 			return rc;
 	}


MOS7720 has no tiocmget method

MOS7720 has no tiocmget method

Fix the tiocmget/mset handling on the mos7720 USB serial port.

[Minor space reformatting for coding style - Alan]

Signed-off-by: Kees Schoenmakers <8a9a794aaac0da3bff97b422766505ed7f8190a8@sigmae.nl>
Signed-off-by: Alan Cox <91e38e63b890fbb214c8914809fde03c73e7f24d@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>

--- drivers/usb/serial/mos7720.c
+++ drivers/usb/serial/mos7720.c
@@ -85,7 +85,7 @@
 #define MOSCHIP_DEVICE_ID_7720		0x7720
 #define MOSCHIP_DEVICE_ID_7715		0x7715

-static struct usb_device_id moschip_port_id_table [] = {
+static struct usb_device_id moschip_port_id_table[] = {
 	{ USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7720) },
 	{ } /* terminating entry */
 };
@@ -1264,6 +1264,67 @@
 	return 0;
 }

+static int mos7720_tiocmget(struct tty_struct *tty, struct file *file)
+{
+	struct usb_serial_port *port = tty->driver_data;
+	struct moschip_port *mos7720_port = usb_get_serial_port_data(port);
+	unsigned int result = 0;
+	unsigned int mcr ;
+	unsigned int msr ;
+
+	dbg("%s - port %d", __func__, port->number);
+
+	mcr = mos7720_port->shadowMCR;
+	msr = mos7720_port->shadowMSR;
+
+	result = ((mcr & UART_MCR_DTR)  ? TIOCM_DTR : 0)   /* 0x002 */
+	  | ((mcr & UART_MCR_RTS)   ? TIOCM_RTS : 0)   /* 0x004 */
+	  | ((msr & UART_MSR_CTS)   ? TIOCM_CTS : 0)   /* 0x020 */
+	  | ((msr & UART_MSR_DCD)   ? TIOCM_CAR : 0)   /* 0x040 */
+	  | ((msr & UART_MSR_RI)    ? TIOCM_RI :  0)   /* 0x080 */
+	  | ((msr & UART_MSR_DSR)   ? TIOCM_DSR : 0);  /* 0x100 */
+
+	dbg("%s -- %x", __func__, result);
+
+	return result;
+}
+
+static int mos7720_tiocmset(struct tty_struct *tty, struct file *file,
+					unsigned int set, unsigned int clear)
+{
+	struct usb_serial_port *port = tty->driver_data;
+	struct moschip_port *mos7720_port = usb_get_serial_port_data(port);
+	unsigned int mcr ;
+	unsigned char lmcr;
+
+	dbg("%s - port %d", __func__, port->number);
+	dbg("he was at tiocmget");
+
+	mcr = mos7720_port->shadowMCR;
+
+	if (set & TIOCM_RTS)
+		mcr |= UART_MCR_RTS;
+	if (set & TIOCM_DTR)
+		mcr |= UART_MCR_DTR;
+	if (set & TIOCM_LOOP)
+		mcr |= UART_MCR_LOOP;
+
+	if (clear & TIOCM_RTS)
+		mcr &= ~UART_MCR_RTS;
+	if (clear & TIOCM_DTR)
+		mcr &= ~UART_MCR_DTR;
+	if (clear & TIOCM_LOOP)
+		mcr &= ~UART_MCR_LOOP;
+
+	mos7720_port->shadowMCR = mcr;
+	lmcr = mos7720_port->shadowMCR;
+
+	send_mos_cmd(port->serial, MOS_WRITE,
+		port->number - port->serial->minor, UART_MCR, &lmcr);
+
+	return 0;
+}
+
 static int set_modem_info(struct moschip_port *mos7720_port, unsigned int cmd,
 			  unsigned int __user *value)
 {
@@ -1301,14 +1362,6 @@
 			mcr &= ~UART_MCR_LOOP;
 		break;

-	case TIOCMSET:
-		/* turn off the RTS and DTR and LOOPBACK
-		 * and then only turn on what was asked to */
-		mcr &=  ~(UART_MCR_RTS | UART_MCR_DTR | UART_MCR_LOOP);
-		mcr |= ((arg & TIOCM_RTS) ? UART_MCR_RTS : 0);
-		mcr |= ((arg & TIOCM_DTR) ? UART_MCR_DTR : 0);
-		mcr |= ((arg & TIOCM_LOOP) ? UART_MCR_LOOP : 0);
-		break;
 	}

 	mos7720_port->shadowMCR = mcr;
@@ -1317,28 +1370,6 @@
 	send_mos_cmd(port->serial, MOS_WRITE,
 		     port->number - port->serial->minor, UART_MCR, &data);

-	return 0;
-}
-
-static int get_modem_info(struct moschip_port *mos7720_port,
-			  unsigned int __user *value)
-{
-	unsigned int result = 0;
-	unsigned int msr = mos7720_port->shadowMSR;
-	unsigned int mcr = mos7720_port->shadowMCR;
-
-	result = ((mcr & UART_MCR_DTR)	? TIOCM_DTR: 0)	  /* 0x002 */
-		  | ((mcr & UART_MCR_RTS)	? TIOCM_RTS: 0)   /* 0x004 */
-		  | ((msr & UART_MSR_CTS)	? TIOCM_CTS: 0)   /* 0x020 */
-		  | ((msr & UART_MSR_DCD)	? TIOCM_CAR: 0)   /* 0x040 */
-		  | ((msr & UART_MSR_RI)	? TIOCM_RI:  0)   /* 0x080 */
-		  | ((msr & UART_MSR_DSR)	? TIOCM_DSR: 0);  /* 0x100 */
-
-
-	dbg("%s -- %x", __func__, result);
-
-	if (copy_to_user(value, &result, sizeof(int)))
-		return -EFAULT;
 	return 0;
 }

@@ -1392,15 +1423,9 @@
 	/* FIXME: These should be using the mode methods */
 	case TIOCMBIS:
 	case TIOCMBIC:
-	case TIOCMSET:
 		dbg("%s (%d) TIOCMSET/TIOCMBIC/TIOCMSET",
 					__func__, port->number);
 		return set_modem_info(mos7720_port, cmd,
-				      (unsigned int __user *)arg);
-
-	case TIOCMGET:
-		dbg("%s (%d) TIOCMGET", __func__,  port->number);
-		return get_modem_info(mos7720_port,
 				      (unsigned int __user *)arg);

 	case TIOCGSERIAL:
@@ -1557,6 +1582,8 @@
 	.attach			= mos7720_startup,
 	.release		= mos7720_release,
 	.ioctl			= mos7720_ioctl,
+	.tiocmget		= mos7720_tiocmget,
+	.tiocmset		= mos7720_tiocmset,
 	.set_termios		= mos7720_set_termios,
 	.write			= mos7720_write,
 	.write_room		= mos7720_write_room,


[S390] remove reset of system call restart on psw changes

git commit 20b40a794baf3b4b "signal race with restarting system calls"
added code to the poke_user/poke_user_compat to reset the system call
restart information in the thread-info if the PSW address is changed.
The purpose of that change has been to workaround old gdbs that do
not know about the REGSET_SYSTEM_CALL. It turned out that this is not
a good idea, it makes the behaviour of the debuggee dependent on the
order of specific ptrace call, e.g. the REGSET_SYSTEM_CALL register
set needs to be written last. And the workaround does not really fix
old gdbs, inferior calls on interrupted restarting system calls do not
work either way.

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

--- arch/s390/kernel/ptrace.c
+++ arch/s390/kernel/ptrace.c
@@ -296,13 +296,6 @@
 		     ((data & PSW_MASK_EA) && !(data & PSW_MASK_BA))))
 			/* Invalid psw mask. */
 			return -EINVAL;
-		if (addr == (addr_t) &dummy->regs.psw.addr)
-			/*
-			 * The debugger changed the instruction address,
-			 * reset system call restart, see signal.c:do_signal
-			 */
-			task_thread_info(child)->system_call = 0;
-
 		*(addr_t *)((addr_t) &task_pt_regs(child)->psw + addr) = data;

 	} else if (addr < (addr_t) (&dummy->regs.orig_gpr2)) {
@@ -614,11 +607,6 @@
 			/* Transfer 31 bit amode bit to psw mask. */
 			regs->psw.mask = (regs->psw.mask & ~PSW_MASK_BA) |
 				(__u64)(tmp & PSW32_ADDR_AMODE);
-			/*
-			 * The debugger changed the instruction address,
-			 * reset system call restart, see signal.c:do_signal
-			 */
-			task_thread_info(child)->system_call = 0;
 		} else {
 			/* gpr 0-15 */
 			*(__u32*)((addr_t) &regs->psw + addr*2 + 4) = tmp;


USB: oti6858: fix DMA buffer on stack

USB: oti6858: fix DMA buffer on stack

Signed-off-by: Johan Hovold <6a430eed381e126d51a8cce8db662f765ce314bc@gmail.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>

--- drivers/usb/serial/oti6858.c
+++ drivers/usb/serial/oti6858.c
@@ -302,7 +302,7 @@
 	struct usb_serial_port *port = priv->port;
 	int count = 0, result;
 	unsigned long flags;
-	unsigned char allow;
+	u8 *allow;

 	dbg("%s(port = %d)", __func__, port->number);

@@ -321,13 +321,20 @@
 		count = port->bulk_out_size;

 	if (count != 0) {
+		allow = kmalloc(1, GFP_KERNEL);
+		if (!allow) {
+			dev_err(&port->dev, "%s(): kmalloc failed\n",
+					__func__);
+			return;
+		}
 		result = usb_control_msg(port->serial->dev,
 				usb_rcvctrlpipe(port->serial->dev, 0),
 				OTI6858_REQ_T_CHECK_TXBUFF,
 				OTI6858_REQ_CHECK_TXBUFF,
-				count, 0, &allow, 1, 100);
-		if (result != 1 || allow != 0)
+				count, 0, allow, 1, 100);
+		if (result != 1 || *allow != 0)
 			count = 0;
+		kfree(allow);
 	}

 	if (count == 0) {


Add Psycho variants found on the SPARC Enterprise M4000/M5000/M8000/M9000.

--- arch/sparc64/dev/psycho.c
+++ arch/sparc64/dev/psycho.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: psycho.c,v 1.56 2008/03/16 22:19:57 kettenis Exp $	*/
+/*	$OpenBSD: psycho.c,v 1.57 2008/05/24 20:57:46 kettenis Exp $	*/
 /*	$NetBSD: psycho.c,v 1.39 2001/10/07 20:30:41 eeh Exp $	*/

 /*
@@ -187,6 +187,8 @@
 	{ "SUNW,sabre",         PSYCHO_MODE_SABRE       },
 	{ "pci108e,a000",       PSYCHO_MODE_SABRE       },
 	{ "pci108e,a001",       PSYCHO_MODE_SABRE       },
+	{ "pci10cf,138f",	PSYCHO_MODE_PSYCHO	},
+	{ "pci10cf,1390",	PSYCHO_MODE_PSYCHO	},
 	{ NULL, 0 }
 };


[SPARC64]: Fix bugs in SMP TLB context version expiration handling.

1) We must flush the TLB, duh.

2) Even if the sw context was seen to be valid, the local cpu's
   hw context can be out of date, so reload it unconditionally.

Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- arch/sparc64/kernel/smp.c
+++ arch/sparc64/kernel/smp.c
@@ -909,14 +909,18 @@
 	 */
 	mm = current->active_mm;
 	if (likely(mm)) {
-		if (unlikely(!CTX_VALID(mm->context))) {
-			unsigned long flags;
-
-			spin_lock_irqsave(&mm->context.lock, flags);
+		unsigned long flags;
+
+		spin_lock_irqsave(&mm->context.lock, flags);
+
+		if (unlikely(!CTX_VALID(mm->context)))
 			get_new_mmu_context(mm);
-			load_secondary_context(mm);
-			spin_unlock_irqrestore(&mm->context.lock, flags);
-		}
+
+		load_secondary_context(mm);
+		__flush_tlb_mm(CTX_HWBITS(mm->context),
+			       SECONDARY_CONTEXT);
+
+		spin_unlock_irqrestore(&mm->context.lock, flags);
 	}
 }


sparc64: Add missing notify_cpu_starting() call.

Commit e545a6140b698b2494daf0b32107bdcc5e901390 ("kernel/cpu.c: create
a CPU_STARTING cpu_chain notifier") added a notify_cpu_starting()
notifier event, and hit every arch except sparc64.

Fix that missed case.

Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

--- arch/sparc64/kernel/smp.c
+++ arch/sparc64/kernel/smp.c
@@ -21,6 +21,7 @@
 #include <linux/jiffies.h>
 #include <linux/profile.h>
 #include <linux/lmb.h>
+#include <linux/cpu.h>

 #include <asm/head.h>
 #include <asm/ptrace.h>
@@ -114,6 +115,9 @@
 	/* Attach to the address space of init_task. */
 	atomic_inc(&init_mm.mm_count);
 	current->active_mm = &init_mm;
+
+	/* inform the notifiers about the new cpu */
+	notify_cpu_starting(cpuid);

 	while (!cpu_isset(cpuid, smp_commenced_mask))
 		rmb();


x86: clean up and simplify 64-bit split_large_page()

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

--- arch/x86/mm/pageattr_64.c
+++ arch/x86/mm/pageattr_64.c
@@ -46,7 +46,7 @@
 }

 static struct page *
-split_large_page(unsigned long address, pgprot_t prot, pgprot_t ref_prot)
+split_large_page(unsigned long address, pgprot_t ref_prot)
 {
 	unsigned long addr;
 	struct page *base;
@@ -60,10 +60,9 @@
 	address = __pa(address);
 	addr = address & LARGE_PAGE_MASK;
 	pbase = (pte_t *)page_address(base);
-	for (i = 0; i < PTRS_PER_PTE; i++, addr += PAGE_SIZE) {
-		pbase[i] = pfn_pte(addr >> PAGE_SHIFT,
-				   addr == address ? prot : ref_prot);
-	}
+	for (i = 0; i < PTRS_PER_PTE; i++, addr += PAGE_SIZE)
+		pbase[i] = pfn_pte(addr >> PAGE_SHIFT, ref_prot);
+
 	return base;
 }

@@ -76,6 +75,7 @@
 	pgprot_t ref_prot2, oldprot;
 	int level;

+repeat:
 	kpte = lookup_address(address, &level);
 	if (!kpte)
 		return 0;
@@ -98,12 +98,12 @@
 			struct page *split;

 			ref_prot2 = pte_pgprot(pte_clrhuge(*kpte));
-			split = split_large_page(address, prot, ref_prot2);
+			split = split_large_page(address, ref_prot2);
 			if (!split)
 				return -ENOMEM;
 			pgprot_val(ref_prot2) &= ~_PAGE_NX;
 			set_pte(kpte, mk_pte(split, ref_prot2));
-			kpte_page = split;
+			goto repeat;
 		}
 	} else {
 		if (level == 4) {


Explicit error message if cape/board not selected

--- arduino/OpenROV/AConfig.h
+++ arduino/OpenROV/AConfig.h
@@ -30,5 +30,8 @@
 #define HAS_MPU9150 (0)
 #define MPU9150_EEPROM_START 2

+#if !(HAS_OROV_CONTROLLERBOARD_25) && !(HAS_STD_CAPE)
+#  error "You must select either standard cape or controllerboard25 in the AConfig.h file as they have predefined pin values required by other libraries."
+#endif

 #endif


Let login process also know if verbose process titles are wanted..

--- src/master/login-process.c
+++ src/master/login-process.c
@@ -317,6 +317,8 @@

 	if (set_disable_plaintext_auth)
 		env_put("DISABLE_PLAINTEXT_AUTH=1");
+	if (set_verbose_proctitle)
+		env_put("VERBOSE_PROCTITLE=1");

 	if (set_login_process_per_connection) {
 		env_put("PROCESS_PER_CONNECTION=1");


query: Handle SQLITE_BUSY from sqlite3_prepare_v2()

- Return FAIL_TEMP from make_queries() (thus causing a retry) when
sqlite3_prepare_v2() returns SQLITE_BUSY.  This fixes the "database is
locked" errors which would occur when another process had an EXCLUSIVE lock
on the database.

- Add a comment noting that sqlite3_prepare_v2("ATTACH ...") apparently
never returns SQLITE_BUSY

--- tools/query.c
+++ tools/query.c
@@ -120,7 +120,9 @@
 		if (attached_names[i] == NULL)
 			break;
 		/* A successful ATTACH invalidates prepared statements, so we
-		   have to redo this every iteration */
+		   have to redo this every iteration.  This doesn't seem to
+		   return SQLITE_BUSY, probably because it doesn't look
+		   up any schema information. */
 		if (sqlite3_prepare_v2(db, "ATTACH ?1 as ?2", -1, &stmt,
 					NULL)) {
 			sqlerr("Preparing ATTACH statement");
@@ -254,13 +256,17 @@
 	const char *query;
 	sqlite3_stmt *stmt;
 	ret_t ret;
+	int sret;
 	int ctr;
 	unsigned changes=0;
 	int params=0;  /* Silence compiler warning */

 	used_params=0;
 	for (query=str; *query; ) {
-		if (sqlite3_prepare_v2(db, query, -1, &stmt, &query)) {
+		sret=sqlite3_prepare_v2(db, query, -1, &stmt, &query);
+		if (sret == SQLITE_BUSY) {
+			return FAIL_TEMP;
+		} else if (sret) {
 			sqlerr("Preparing query");
 			return FAIL;
 		}


spicy: implement preferred video codec type

Similar to preferred video compression, a radio button showing mjpeg,
vp8, vp9 and h264 in case server has the proper [0] capability

[0] SPICE_DISPLAY_CAP_PREF_VIDEO_CODEC_TYPE

Signed-off-by: Victor Toso <39b7599ff73bbf5db531748ba5250f21fa7120ff@redhat.com>
Acked-by: Pavel Grunt <fbda40b445316123f12a5a6bd7556918ea74f4bc@redhat.com>

--- tools/spicy.c
+++ tools/spicy.c
@@ -651,6 +651,9 @@
         .name        = "CompressionMenu",
         .label       = "_Preferred image compression",
     },{
+        .name        = "VideoCodecTypeMenu",
+        .label       = "_Preferred video codec type",
+    },{
         .name        = "HelpMenu",
         .label       = "_Help",
     },{
@@ -813,6 +816,26 @@
         .name  = "off",
         .label = "off",
         .value = SPICE_IMAGE_COMPRESSION_OFF,
+    }
+};
+
+static const GtkRadioActionEntry video_codec_type_entries[] = {
+    {
+        .name  = "mjpeg",
+        .label = "mjpeg",
+        .value = SPICE_VIDEO_CODEC_TYPE_MJPEG,
+    },{
+        .name  = "vp8",
+        .label = "vp8",
+        .value = SPICE_VIDEO_CODEC_TYPE_VP8,
+    },{
+        .name  = "vp9",
+        .label = "vp9",
+        .value = SPICE_VIDEO_CODEC_TYPE_VP9,
+    },{
+        .name  = "h264",
+        .label = "h264",
+        .value = SPICE_VIDEO_CODEC_TYPE_H264,
     }
 };

@@ -864,6 +887,12 @@
 #endif
 "        <menuitem action='off'/>\n"
 "      </menu>\n"
+"      <menu action='VideoCodecTypeMenu'>\n"
+"        <menuitem action='mjpeg'/>\n"
+"        <menuitem action='vp8'/>\n"
+"        <menuitem action='vp9'/>\n"
+"        <menuitem action='h264'/>\n"
+"      </menu>\n"
 "    </menu>\n"
 "    <menu action='HelpMenu'>\n"
 "      <menuitem action='About'/>\n"
@@ -916,6 +945,14 @@
                                                gtk_radio_action_get_current_value(current));
 }

+static void video_codec_type_cb(GtkRadioAction *action G_GNUC_UNUSED,
+                                GtkRadioAction *current,
+                                gpointer user_data)
+{
+    spice_display_change_preferred_video_codec_type(SPICE_CHANNEL(user_data),
+                                                    gtk_radio_action_get_current_value(current));
+}
+
 static void
 spice_window_class_init (SpiceWindowClass *klass)
 {
@@ -970,6 +1007,16 @@
         GtkAction *compression_menu_action = gtk_action_group_get_action(win->ag, "CompressionMenu");
         gtk_action_set_sensitive(compression_menu_action, FALSE);
     }
+    gtk_action_group_add_radio_actions(win->ag, video_codec_type_entries,
+                                       G_N_ELEMENTS(video_codec_type_entries), -1,
+                                       G_CALLBACK(video_codec_type_cb), win->display_channel);
+    if (!spice_channel_test_capability(win->display_channel,
+                                       SPICE_DISPLAY_CAP_PREF_VIDEO_CODEC_TYPE)) {
+        GtkAction *video_codec_type_menu_action =
+            gtk_action_group_get_action(win->ag, "VideoCodecTypeMenu");
+        gtk_action_set_sensitive(video_codec_type_menu_action, FALSE);
+    }
+
     gtk_ui_manager_insert_action_group(win->ui, win->ag, 0);
     gtk_window_add_accel_group(GTK_WINDOW(win->toplevel),
                                gtk_ui_manager_get_accel_group(win->ui));


Load embedded HRTF entries as-needed

Load embedded HRTF entries as-needed

--- Alc/hrtf.c
+++ Alc/hrtf.c
@@ -688,7 +688,7 @@
 /* Unfortunate that we have to duplicate AddFileEntry to take a memory buffer
  * for input instead of opening the given filename.
  */
-static void AddBuiltInEntry(vector_EnumeratedHrtf *list, const ALubyte *data, size_t datalen, const_al_string filename)
+static void AddBuiltInEntry(vector_EnumeratedHrtf *list, const_al_string filename, size_t residx)
 {
     EnumeratedHrtf entry = { AL_STRING_INIT_STATIC(), NULL };
     struct HrtfEntry *loaded_entry;
@@ -712,54 +712,27 @@
             }
 #undef MATCH_FNAME

-            TRACE("Skipping load of already-loaded file %s\n", alstr_get_cstr(filename));
-            goto skip_load;
+            break;
         }
         loaded_entry = loaded_entry->next;
     }

-    TRACE("Loading %s...\n", alstr_get_cstr(filename));
-    if(datalen < sizeof(magicMarker01))
-    {
-        ERR("%s data is too short ("SZFMT" bytes)\n", alstr_get_cstr(filename), datalen);
-        return;
-    }
-
-    if(memcmp(data, magicMarker01, sizeof(magicMarker01)) == 0)
-    {
-        TRACE("Detected data set format v1\n");
-        hrtf = LoadHrtf01((const ALubyte*)data+sizeof(magicMarker01),
-            datalen-sizeof(magicMarker01), alstr_get_cstr(filename)
+    if(!loaded_entry)
+    {
+        size_t namelen = alstr_length(filename)+32;
+
+        TRACE("Got new file \"%s\"\n", alstr_get_cstr(filename));
+
+        loaded_entry = al_calloc(DEF_ALIGN,
+            offsetof(struct HrtfEntry, filename[namelen])
         );
-    }
-    else if(memcmp(data, magicMarker00, sizeof(magicMarker00)) == 0)
-    {
-        TRACE("Detected data set format v0\n");
-        hrtf = LoadHrtf00((const ALubyte*)data+sizeof(magicMarker00),
-            datalen-sizeof(magicMarker00), alstr_get_cstr(filename)
-        );
-    }
-    else
-        ERR("Invalid header in %s: \"%.8s\"\n", alstr_get_cstr(filename), (const char*)data);
-
-    if(!hrtf)
-    {
-        ERR("Failed to load %s\n", alstr_get_cstr(filename));
-        return;
-    }
-
-    loaded_entry = al_calloc(DEF_ALIGN,
-        offsetof(struct HrtfEntry, filename[alstr_length(filename)+1])
-    );
-    loaded_entry->next = LoadedHrtfs;
-    loaded_entry->handle = hrtf;
-    strcpy(loaded_entry->filename, alstr_get_cstr(filename));
-    LoadedHrtfs = loaded_entry;
-
-    TRACE("Loaded HRTF support for format: %s %uhz\n",
-          DevFmtChannelsString(DevFmtStereo), hrtf->sampleRate);
-
-skip_load:
+        loaded_entry->next = LoadedHrtfs;
+        loaded_entry->handle = hrtf;
+        snprintf(loaded_entry->filename, namelen,  "!"SZFMT"_%s",
+                 residx, alstr_get_cstr(filename));
+        LoadedHrtfs = loaded_entry;
+    }
+
     /* TODO: Get a human-readable name from the HRTF data (possibly coming in a
      * format update). */
     name = strrchr(alstr_get_cstr(filename), '/');
@@ -957,14 +930,14 @@
         if(rdata != NULL && rsize > 0)
         {
             alstr_copy_cstr(&ename, "Built-In 44100hz");
-            AddBuiltInEntry(&list, rdata, rsize, ename);
+            AddBuiltInEntry(&list, ename, IDR_DEFAULT_44100_MHR);
         }

         rdata = GetResource(IDR_DEFAULT_48000_MHR, &rsize);
         if(rdata != NULL && rsize > 0)
         {
             alstr_copy_cstr(&ename, "Built-In 48000hz");
-            AddBuiltInEntry(&list, rdata, rsize, ename);
+            AddBuiltInEntry(&list, ename, IDR_DEFAULT_48000_MHR);
         }
         alstr_reset(&ename);
     }
@@ -1003,6 +976,11 @@
     static ATOMIC_FLAG LoadLock = ATOMIC_FLAG_INIT;
     struct Hrtf *hrtf = NULL;
     struct FileMapping fmap;
+    const ALubyte *rdata;
+    const char *name;
+    size_t residx;
+    size_t rsize;
+    char ch;

     while(ATOMIC_FLAG_TEST_AND_SET(&LoadLock, almemory_order_seq_cst))
         althrd_yield();
@@ -1013,37 +991,60 @@
         goto done;
     }

-    TRACE("Loading %s...\n", entry->filename);
-    fmap = MapFileToMem(entry->filename);
-    if(fmap.ptr == NULL)
-    {
-        ERR("Could not open %s\n", entry->filename);
-        goto done;
-    }
-
-    if(fmap.len < sizeof(magicMarker01))
-        ERR("%s data is too short ("SZFMT" bytes)\n", entry->filename, fmap.len);
-    else if(memcmp(fmap.ptr, magicMarker01, sizeof(magicMarker01)) == 0)
+    fmap.ptr = NULL;
+    fmap.len = 0;
+    if(sscanf(entry->filename, "!"SZFMT"%c", &residx, &ch) == 2 && ch == '_')
+    {
+        name = strchr(entry->filename, ch)+1;
+
+        TRACE("Loading %s...\n", name);
+        rdata = GetResource(residx, &rsize);
+        if(rdata == NULL || rsize == 0)
+        {
+            ERR("Could not get resource "SZFMT", %s\n", residx, name);
+            goto done;
+        }
+    }
+    else
+    {
+        name = entry->filename;
+
+        TRACE("Loading %s...\n", entry->filename);
+        fmap = MapFileToMem(entry->filename);
+        if(fmap.ptr == NULL)
+        {
+            ERR("Could not open %s\n", entry->filename);
+            goto done;
+        }
+
+        rdata = fmap.ptr;
+        rsize = fmap.len;
+    }
+
+    if(rsize < sizeof(magicMarker01))
+        ERR("%s data is too short ("SZFMT" bytes)\n", name, rsize);
+    else if(memcmp(rdata, magicMarker01, sizeof(magicMarker01)) == 0)
     {
         TRACE("Detected data set format v1\n");
-        hrtf = LoadHrtf01((const ALubyte*)fmap.ptr+sizeof(magicMarker01),
-            fmap.len-sizeof(magicMarker01), entry->filename
+        hrtf = LoadHrtf01(rdata+sizeof(magicMarker01),
+            rsize-sizeof(magicMarker01), name
         );
     }
-    else if(memcmp(fmap.ptr, magicMarker00, sizeof(magicMarker00)) == 0)
+    else if(memcmp(rdata, magicMarker00, sizeof(magicMarker00)) == 0)
     {
         TRACE("Detected data set format v0\n");
-        hrtf = LoadHrtf00((const ALubyte*)fmap.ptr+sizeof(magicMarker00),
-            fmap.len-sizeof(magicMarker00), entry->filename
+        hrtf = LoadHrtf00(rdata+sizeof(magicMarker00),
+            rsize-sizeof(magicMarker00), name
         );
     }
     else
-        ERR("Invalid header in %s: \"%.8s\"\n", entry->filename, (const char*)fmap.ptr);
-    UnmapFileMem(&fmap);
+        ERR("Invalid header in %s: \"%.8s\"\n", name, (const char*)rdata);
+    if(fmap.ptr)
+        UnmapFileMem(&fmap);

     if(!hrtf)
     {
-        ERR("Failed to load %s\n", entry->filename);
+        ERR("Failed to load %s\n", name);
         goto done;
     }


[mem]Implement memalign for heap_simple memory allocator

--- src/mem/heap/heap_simple.c
+++ src/mem/heap/heap_simple.c
@@ -22,6 +22,7 @@

 #define HEAP_SIZE OPTION_MODULE_GET(embox__mem__heap_api,NUMBER,heap_size)
 #define HEAP_ALIGN OPTION_MODULE_GET(embox__mem__heap_api,NUMBER,align)
+#define ALIGN_PADDING sizeof(size_t)

 #define MEM_POOL_SIZE  (HEAP_SIZE / PAGE_SIZE())
 static void *mem_pool;
@@ -84,8 +85,10 @@

 void free(void *ptr) {
 	struct mem_control_block *mcb;
+	size_t shift = *(int*)(ptr - ALIGN_PADDING);
+	ptr -= MCB_SZ + shift + ALIGN_PADDING;

-	mcb = (void *)((char *) ptr - MCB_SZ);
+	mcb = ptr;
 	mcb->is_available = 1;

 	 _mem_defrag();
@@ -93,10 +96,15 @@
 }

 void *malloc(size_t size) {
+	return memalign(sizeof(void*), size);
+}
+
+void *memalign(size_t boundary, size_t size) {
 	void *ptr;
 	struct mem_control_block *mcb, *next_mcb;
+	size_t shift, total_mem_size;

-	if (size == 0) {
+	if (size == 0 || (boundary & (boundary - 1)) != 0) {
 		return NULL;
 	}

@@ -112,20 +120,22 @@

 	while (ptr + MCB_SZ + size < heap_simple_end) {
 		mcb = ptr;
+		shift = (boundary - ((int)(ptr + MCB_SZ + ALIGN_PADDING) % boundary)) % boundary;
+		total_mem_size = size + ALIGN_PADDING + shift + MCB_SZ;

-		if (mcb->is_available && mcb->size >= size) {
+		if (mcb->is_available && mcb->size >= total_mem_size - MCB_SZ) {
 			mcb->is_available = 0;

-			if (mcb->size > size + MCB_SZ) {
-				next_mcb = ptr + size + MCB_SZ;
+			if (mcb->size > total_mem_size) {
+				next_mcb = ptr + total_mem_size;

-				next_mcb->size = mcb->size - size - MCB_SZ;
+				next_mcb->size = mcb->size - total_mem_size;
 				next_mcb->is_available = 1;

-				mcb->size = size;
+				mcb->size = total_mem_size - MCB_SZ;
 			}
-
-			return ptr + MCB_SZ;
+			*(int*)(ptr + MCB_SZ + shift) = shift;
+			return ptr + total_mem_size - size;
 		}

 		ptr += mcb->size + MCB_SZ;


program: add #ifndef SAMPLER_H wrapper

program: add #ifndef SAMPLER_H wrapper

Reviewed-by: Anuj Phogat <e2026475996c48f0b97fd37e84129b3912980428@gmail.com>
Reviewed-by: Jose Fonseca <61b5a29db2c0650f7c8510f93eece059c1b09320@vmware.com>

--- src/mesa/program/sampler.h
+++ src/mesa/program/sampler.h
@@ -23,6 +23,10 @@
  * DEALINGS IN THE SOFTWARE.
  */

+#ifndef SAMPLER_H
+#define SAMPLER_H
+
+
 int
 _mesa_get_sampler_uniform_value(class ir_dereference *sampler,
 				struct gl_shader_program *shader_program,
@@ -30,3 +34,6 @@

 class ir_rvalue *
 _mesa_get_sampler_array_nonconst_index(class ir_dereference *sampler);
+
+
+#endif /* SAMPLER_H */


use _swrast_span_default_color() in the disabled code too

--- src/mesa/swrast/s_bitmap.c
+++ src/mesa/swrast/s_bitmap.c
@@ -193,20 +193,8 @@
    span.x = px;
    span.y = py;
    /*span.end = width;*/
-   if (ctx->Visual.rgbMode) {
-      span.interpMask |= SPAN_RGBA;
-      span.red   = FloatToFixed(ctx->Current.RasterColor[0] * CHAN_MAXF);
-      span.green = FloatToFixed(ctx->Current.RasterColor[1] * CHAN_MAXF);
-      span.blue  = FloatToFixed(ctx->Current.RasterColor[2] * CHAN_MAXF);
-      span.alpha = FloatToFixed(ctx->Current.RasterColor[3] * CHAN_MAXF);
-      span.redStep = span.greenStep = span.blueStep = span.alphaStep = 0;
-   }
-   else {
-      span.interpMask |= SPAN_INDEX;
-      span.index = FloatToFixed(ctx->Current.RasterIndex);
-      span.indexStep = 0;
-   }
-
+
+   _swrast_span_default_color(ctx, &span);
    if (ctx->Depth.Test)
       _swrast_span_default_z(ctx, &span);
    if (swrast->_FogEnabled)


tweak pipeline flags for vertex programming

--- src/mesa/tnl/t_vb_vertex.c
+++ src/mesa/tnl/t_vb_vertex.c
@@ -1,8 +1,8 @@
-/* $Id: t_vb_vertex.c,v 1.16 2002/10/29 20:29:04 brianp Exp $ */
+/* $Id: t_vb_vertex.c,v 1.17 2002/10/31 17:14:37 brianp Exp $ */

 /*
  * Mesa 3-D graphics library
- * Version:  3.5
+ * Version:  5.0
  *
  * Copyright (C) 1999-2001  Brian Paul   All Rights Reserved.
  *
@@ -137,6 +137,8 @@
    TNLcontext *tnl = TNL_CONTEXT(ctx);
    struct vertex_buffer *VB = &tnl->vb;

+   ASSERT(!ctx->VertexProgram.Enabled);
+
    if (stage->changed_inputs) {

       if (ctx->_NeedEyeCoords) {
@@ -194,7 +196,6 @@
                                                store->clipmask,
                                                &store->ormask,
                                                &store->andmask );
-
       }
       else {
 	 VB->NdcPtr = 0;
@@ -305,11 +306,12 @@
 const struct gl_pipeline_stage _tnl_vertex_transform_stage =
 {
    "modelview/project/cliptest/divide",
-   0,				/* re-check -- always on */
-   _MESA_NEW_NEED_EYE_COORDS |
+   _NEW_PROGRAM,                /* check_state: only care about vertex prog */
+   _MESA_NEW_NEED_EYE_COORDS |  /* run_state: when to invalidate / re-run */
    _NEW_MODELVIEW|
    _NEW_PROJECTION|
-   _NEW_TRANSFORM,		/* re-run */
+   _NEW_PROGRAM|
+   _NEW_TRANSFORM,
    GL_TRUE,			/* active */
    VERT_BIT_POS,		/* inputs */
    VERT_BIT_EYE|VERT_BIT_CLIP,		/* outputs */


(BlockLevelBox::hasAnonymousBox) : Add const.

--- www/css/Box.h
+++ www/css/Box.h
@@ -673,8 +673,7 @@
     // Gets the last, anonymous child box. Creates one if there's none even
     // if there's no children; if so, the existing texts are moved to the
     // new anonymous box.
-    bool hasAnonymousBox()
-    {
+    bool hasAnonymousBox() const {
         return lastChild && lastChild->isAnonymous();
     }
     BlockLevelBox* getAnonymousBox();


[analyzer] Don't include Clang headers inside a namespace.

Found by Gabor Kozar!

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@189370 91177308-0d34-0410-b5e6-96231b3b80d8

--- include/clang/StaticAnalyzer/Core/CheckerRegistry.h
+++ include/clang/StaticAnalyzer/Core/CheckerRegistry.h
@@ -54,10 +54,6 @@
 //
 // For a complete working example, see examples/analyzer-plugin.

-
-namespace clang {
-namespace ento {
-
 #ifndef CLANG_ANALYZER_API_VERSION_STRING
 // FIXME: The Clang version string is not particularly granular;
 // the analyzer infrastructure can change a lot between releases.
@@ -66,6 +62,9 @@
 #include "clang/Basic/Version.h"
 #define CLANG_ANALYZER_API_VERSION_STRING CLANG_VERSION_STRING
 #endif
+
+namespace clang {
+namespace ento {

 class CheckerOptInfo;


bitstring: tighten constructor of value_repr

The constructor did not check whether it is possible to create this
value with the number of bits. This can lead to bugs that are very
hard to find.

Signed-off-by: Helge Bahmann <c5618920f622561f9c0ec5c42219c4c08180149f@chaoticmind.net>

--- include/jive/types/bitstring/value-representation.h
+++ include/jive/types/bitstring/value-representation.h
@@ -33,6 +33,9 @@
 	{
 		if (nbits == 0)
 			throw compiler_error("Number of bits is zero.");
+
+		if (nbits < 64 && (value >> nbits) != 0 && (value >> nbits != -1))
+			throw compiler_error("Value cannot be represented with the given number of bits.");

 		for (size_t n = 0; n < nbits; ++n) {
 			data_.push_back('0' + (value & 1));


[X86] Fix bad formatting. NFC

[X86] Fix bad formatting. NFC

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@348164 91177308-0d34-0410-b5e6-96231b3b80d8

--- include/llvm/Support/X86DisassemblerDecoderCommon.h
+++ include/llvm/Support/X86DisassemblerDecoderCommon.h
@@ -414,7 +414,7 @@
   ENUM_ENTRY(TYPE_R16,        "2-byte")                                        \
   ENUM_ENTRY(TYPE_R32,        "4-byte")                                        \
   ENUM_ENTRY(TYPE_R64,        "8-byte")                                        \
-  ENUM_ENTRY(TYPE_IMM,        "immediate operand")                      \
+  ENUM_ENTRY(TYPE_IMM,        "immediate operand")                             \
   ENUM_ENTRY(TYPE_IMM3,       "1-byte immediate operand between 0 and 7")      \
   ENUM_ENTRY(TYPE_IMM5,       "1-byte immediate operand between 0 and 31")     \
   ENUM_ENTRY(TYPE_AVX512ICC,  "1-byte immediate operand for AVX512 icmp")      \


fixed a syntax error

fixed a syntax error

--- src/mn-masterd/user-conn.c
+++ src/mn-masterd/user-conn.c
@@ -526,7 +526,7 @@
         return -1;
     }

-    while (isspace(pwd)) pwd ++;
+    while (isspace(*pwd)) pwd ++;
     user_id = atoi(buf);
     sz = size-(pwd-buf);
     while (isspace(pwd[sz-1])) sz--;


better stats formatting

better stats formatting


Version 0.6.2

Version 0.6.2

--- tpn/include.h
+++ tpn/include.h
@@ -24,7 +24,7 @@

 #define DEBUG
 #define APPNAME		"TeapotNet"
-#define APPVERSION	"0.6.1"
+#define APPVERSION	"0.6.2"
 #define APPAUTHOR	"Paul-Louis Ageneau"
 #define APPLINK		"http://teapotnet.org/"
 #define SOURCELINK	"http://teapotnet.org/source"


Refactorize model factories

Refactorize model factories

--- src/models/model_factory.h
+++ src/models/model_factory.h
@@ -12,18 +12,6 @@
 #ifdef CUDNN
 #include "examples/mnist/model_lenet.h"
 #endif
-
-#define REGISTER_ENCODER(name, className)\
-do {\
-if(options_->get<std::string>("type") == name)\
-  return New<className>(options_);\
-} while(0)
-
-#define REGISTER_DECODER(name, className)\
-do {\
-if(options_->get<std::string>("type") == name)\
-  return New<className>(options_);\
-} while(0)

 #define REGISTER_ENCODER_DECODER(name, className)\
 do {\
@@ -41,10 +29,12 @@
   EncoderFactory(Ptr<ExpressionGraph> graph = nullptr) : Factory(graph) {}

   virtual Ptr<EncoderBase> construct() {
-
-    REGISTER_ENCODER("s2s", EncoderS2S);
-    REGISTER_ENCODER("transformer", EncoderTransformer);
-    REGISTER_ENCODER("transformer_gru", EncoderTransformerGRU);
+    if(options_->get<std::string>("type") == "s2s")
+      return New<EncoderS2S>(options_);
+    if(options_->get<std::string>("type") == "transformer")
+      return New<EncoderTransformer>(options_);
+    if(options_->get<std::string>("type") == "transformer_gru")
+      return New<EncoderTransformerGRU>(options_);

     UTIL_THROW2("Unknown encoder type");
   }
@@ -58,9 +48,12 @@

   virtual Ptr<DecoderBase> construct() {

-    REGISTER_DECODER("s2s", DecoderS2S);
-    REGISTER_DECODER("transformer", DecoderTransformer);
-    REGISTER_DECODER("transformer_gru", DecoderTransformerGRU);
+    if(options_->get<std::string>("type") == "s2s")
+      return New<DecoderS2S>(options_);
+    if(options_->get<std::string>("type") == "transformer")
+      return New<DecoderTransformer>(options_);
+    if(options_->get<std::string>("type") == "transformer_gru")
+      return New<DecoderTransformerGRU>(options_);

     UTIL_THROW2("Unknown decoder type");
   }
@@ -89,8 +82,10 @@
   virtual Ptr<EncoderDecoder> construct() {
     Ptr<EncoderDecoder> encdec;

-    REGISTER_ENCODER_DECODER("amun", Amun);
-    REGISTER_ENCODER_DECODER("nematus", Nematus);
+    if(options_->get<std::string>("type") == "amun")
+      encdec = New<Amun>(options_);
+    if(options_->get<std::string>("type") == "nematus")
+      encdec = New<Nematus>(options_);

     if(!encdec)
       encdec = New<EncoderDecoder>(options_);
@@ -111,70 +106,50 @@
                        Ptr<Options> options) {

   if(type == "s2s" || type == "amun" || type == "nematus") {
-    return models::encoder_decoder()
-           (options)
-           .push_back(models::encoder()
-                      ("type", "s2s")
-                      ("original-type", type))
-           .push_back(models::decoder()
-                      ("type", "s2s")
-                      ("original-type", type))
-           .construct();
+    return models::encoder_decoder()(options)
+        .push_back(models::encoder()("type", "s2s")("original-type", type))
+        .push_back(models::decoder()("type", "s2s")("original-type", type))
+        .construct();
   }

   if(type == "transformer") {
-    return models::encoder_decoder()
-           (options)
-           .push_back(models::encoder()
-                      ("type", "transformer"))
-           .push_back(models::decoder()
-                      ("type", "transformer"))
-           .construct();
+    return models::encoder_decoder()(options)
+        .push_back(models::encoder()("type", "transformer"))
+        .push_back(models::decoder()("type", "transformer"))
+        .construct();
   }

   if(type == "transformer_gru") {
-    return models::encoder_decoder()
-           (options)
-           .push_back(models::encoder()
-                      ("type", "transformer_gru"))
-           .push_back(models::decoder()
-                      ("type", "transformer_gru"))
-           .construct();
+    return models::encoder_decoder()(options)
+        .push_back(models::encoder()("type", "transformer_gru"))
+        .push_back(models::decoder()("type", "transformer_gru"))
+        .construct();
   }

   if(type == "transformer_s2s") {
-    return models::encoder_decoder()
-           (options)
-           .push_back(models::encoder()
-                      ("type", "transformer"))
-           .push_back(models::decoder()
-                      ("type", "s2s"))
-           .construct();
+    return models::encoder_decoder()(options)
+        .push_back(models::encoder()("type", "transformer"))
+        .push_back(models::decoder()("type", "s2s"))
+        .construct();
   }

   if(type == "lm") {
-    return models::encoder_decoder()
-           (options)
-           ("type", "s2s")
-           .push_back(models::decoder()
-                      ("index", options->has("index") ?
-                                options->get<size_t>("index") : 0))
-           .construct();
+    auto idx = options->has("index") ? options->get<size_t>("index") : 0;
+    return models::encoder_decoder()(options)("type", "s2s")
+        .push_back(models::decoder()("index", idx))
+        .construct();
   }

   if(type == "multi-s2s") {
     size_t numEncoders = 2;
-    auto ms2sFactory = models::encoder_decoder()
-                       (options)
-                       ("type", "s2s");
+    auto ms2sFactory = models::encoder_decoder()(options)("type", "s2s");

-    for(size_t i = 0; i < numEncoders; ++i)
-      ms2sFactory.push_back(models::encoder()
-                            ("prefix", "encoder" + std::to_string(i + 1))
-                            ("index", i));
+    for(size_t i = 0; i < numEncoders; ++i) {
+      auto prefix = "encoder" + std::to_string(i + 1);
+      ms2sFactory.push_back(models::encoder()("prefix", prefix)("index", i));
+    }

-    ms2sFactory.push_back(models::decoder()
-                          ("index", numEncoders));
+    ms2sFactory.push_back(models::decoder()("index", numEncoders));

     return ms2sFactory.construct();
   }
@@ -204,5 +179,4 @@
 }

 }
-
 }


Update the copyright notice

Update the copyright notice

--- src/lib/vfs.c
+++ src/lib/vfs.c
@@ -1,5 +1,5 @@
 /* $Id$ */
-/* Copyright (c) 2012-2015 Pierre Pronchery <khorben@defora.org> */
+/* Copyright (c) 2012-2016 Pierre Pronchery <khorben@defora.org> */
 /* This file is part of DeforaOS Desktop Browser */
 /* Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are


small update

small update

svn path=/trunk/KDE/kdelibs/phonon/; revision=745935

--- audiooutputadaptor.h
+++ audiooutputadaptor.h
@@ -19,7 +19,6 @@
 class QVariant;
 #ifndef QT_NO_DBUS
 #include <QtDBus/QtDBus>
-#endif

 /*
  * Adaptor class for interface org.kde.Phonon.AudioOutput
@@ -57,5 +56,6 @@
     QString name();
 Q_SIGNALS: // SIGNALS
 };
+#endif

 #endif


dodany nowy rodzaj pakietu GG_DISCONNECTING == 0x0b, który serwer wysyła przed rozłączeniem. dodana komenta ,,_ping''. poprawka stylu.

--- src/libgadu.c
+++ src/libgadu.c
@@ -783,7 +783,8 @@
 	p = (void*) h + sizeof(struct gg_header);

 	switch (h->type) {
-		case GG_RECV_MSG: {
+		case GG_RECV_MSG:
+		{
 			struct gg_recv_msg *r = p;

 			gg_debug(GG_DEBUG_MISC, "-- received a message\n");
@@ -821,7 +822,8 @@
 			break;
 		}

-		case GG_NOTIFY_REPLY: {
+		case GG_NOTIFY_REPLY:
+		{
 			struct gg_notify_reply *n = p;
 			int count, i;

@@ -845,7 +847,8 @@
 			break;
 		}

-		case GG_STATUS: {
+		case GG_STATUS:
+		{
 			struct gg_status *s = p;

 			gg_debug(GG_DEBUG_MISC, "-- received a status change\n");
@@ -860,7 +863,8 @@
 			break;
 		}

-		case GG_SEND_MSG_ACK: {
+		case GG_SEND_MSG_ACK:
+		{
 			struct gg_send_msg_ack *s = p;

 			gg_debug(GG_DEBUG_MISC, "-- received a message ack\n");
@@ -875,7 +879,8 @@
 			break;
 		}

-		case GG_PONG: {
+		case GG_PONG:
+		{
 			gg_debug(GG_DEBUG_MISC, "-- received a pong\n");

 			e->type = GG_EVENT_PONG;
@@ -884,8 +889,14 @@
 			break;
 		}

+		case GG_DISCONNECTING:
+		{
+			gg_debug(GG_DEBUG_MISC, "-- received disconnection warning\n");
+			break;
+		}
+
 		default:
-			gg_debug(GG_DEBUG_MISC, "-- received unknown packet 0x%.2b\n", h->type);
+			gg_debug(GG_DEBUG_MISC, "-- received unknown packet 0x%.2x\n", h->type);
 	}

 	free(h);


docs: delete extra character

docs: delete extra character

delete extra character 'p' from the comment of virInterfaceCreate

Signed-off-by: Wang Yufei <29d8b7da2f1f99924c75ef99c490e51ba28217ef@huawei.com>

--- src/libvirt.c
+++ src/libvirt.c
@@ -12801,7 +12801,7 @@
  * interface was defined (that is, if virInterfaceChangeBegin() had
  * been called), the interface will be brought back down (and then
  * undefined) if virInterfaceChangeRollback() is called.
-p *
+ *
  * Returns 0 in case of success, -1 in case of error
  */
 int


return empty list when query is empty

return empty list when query is empty

--- autoload/fuzzycomt.c
+++ autoload/fuzzycomt.c
@@ -189,7 +189,6 @@
     return (score > seen_score) ? score : seen_score;
 }

-
 PyObject* fuzzycomt_match(PyObject* self, PyObject* args)
 {
     PyObject *paths, *abbrev, *returnlist;
@@ -213,10 +212,16 @@

     returnstruct matches[PyList_Size(paths)];

+
+    if ( (limit > PyList_Size(paths)) || (limit == 0) ) {
+        limit = PyList_Size(paths);
+    }
+
     if ( PyString_Size(abbrev) == 0)
     {
         // if string is empty - just return first (:param limit) lines
         PyObject *initlist;
+
         initlist = PyList_GetSlice(paths,0,limit);
         return initlist;
     }


Fix readint()

Fix readint()

C99 imposes crazy rules in integer constant expressions, which
are different for decimal constants.

--- cc1/lex.c
+++ cc1/lex.c
@@ -258,40 +258,44 @@
 }

 static Symbol *
-readint(char *s, int base, Symbol *sym)
+readint(char *s, int base, int sign, Symbol *sym)
 {
 	Type *tp = sym->type;
-	struct limits *lim = getlimits(tp);
+	struct limits *lim;
 	TUINT u, val, max;
 	int c;

+	lim = getlimits(tp);
 	max = (tp->sign) ? lim->max.u : lim->max.i;
+	if (*s == '0')
+		++s;
+	if (toupper(*s) == 'X')
+		++s;

 	for (u = 0; isxdigit(c = *s++); u = u*base + val) {
 		val = (c <= '9') ? c - '0' :  10 + c - 'A';
+	repeat:
 		if (u <= max/base && u*base <= max - val)
 			continue;
 		if (tp->sign) {
-			if (tp == inttype) {
-				tp = longtype;
-			} else if (tp == longtype) {
-				tp == llongtype;
-			} else {
-				errorp("overflow in integer constant");
-				break;
-			}
+			if (tp == inttype)
+				tp = (base==10) ? longtype : uinttype;
+			else if (tp == longtype)
+				tp = (base==10) ? llongtype : ulongtype;
+			else
+				goto overflow;
 		} else {
-			if (tp == uinttype) {
-				tp = ulongtype;
-			} else if (tp == ulongtype) {
-				tp == ullongtype;
-			} else {
-				errorp("overflow in integer constant");
-				break;
-			}
+			if (tp == uinttype)
+				tp = (sign==UNSIGNED) ? ulongtype : longtype;
+			else if (tp == ulongtype)
+				tp = (sign==UNSIGNED) ? ullongtype : llongtype;
+			else
+				goto overflow;
 		}
 		sym->type = tp;
+		lim = getlimits(tp);
 		max = (tp->sign) ? lim->max.u : lim->max.i;
+		goto repeat;
 	}

 	if (tp->sign)
@@ -299,6 +303,10 @@
 	else
 		sym->u.u = u;

+	return sym;
+
+overflow:
+	errorp("overflow in integer constant");
 	return sym;
 }

@@ -333,7 +341,7 @@
 	sym = newsym(NS_IDEN);
 	sym->type = tp;
 	sym->flags |= ISCONSTANT;
-	yylval.sym = readint(s, base, sym);
+	yylval.sym = readint(s, base, sign, sym);
 	return CONSTANT;
 }


Figure out branches :/

Figure out branches :/

--- AresBD/main.c
+++ AresBD/main.c
@@ -10,6 +10,6 @@

 int main(int argc, const char * argv[]) {
     // insert code here...
-    printf("Welcome to DESTINY!\n");
+    printf("Dev!\n");
     return 0;
 }


gobex: add unit test for GET request with SRM and SRMP wait

--- unit/test-gobex-transfer.c
+++ unit/test-gobex-transfer.c
@@ -91,6 +91,14 @@
 	0, 'f', 0, 'i', 0, 'l', 0, 'e', 0, '.', 0, 't', 0, 'x', 0, 't', 0, 0,
 	G_OBEX_HDR_SRM, 0x01 };

+static guint8 get_req_first_srm_wait[] = { G_OBEX_OP_GET | FINAL_BIT, 0x00, 0x27,
+	G_OBEX_HDR_TYPE, 0x00, 0x0b,
+	'f', 'o', 'o', '/', 'b', 'a', 'r', '\0',
+	G_OBEX_HDR_NAME, 0x00, 0x15,
+	0, 'f', 0, 'i', 0, 'l', 0, 'e', 0, '.', 0, 't', 0, 'x', 0, 't', 0, 0,
+	G_OBEX_HDR_SRM, 0x01,
+	G_OBEX_HDR_SRMP, 0x01 };
+
 static guint8 get_req_last[] = { G_OBEX_OP_GET | FINAL_BIT, 0x00, 0x03, };

 static guint8 get_rsp_first_app[] = { G_OBEX_RSP_CONTINUE | FINAL_BIT, 0x00, 0x0A,
@@ -747,6 +755,63 @@
 	test_get_req_random_srm(SOCK_SEQPACKET);
 }

+static void test_get_req_random_srm_wait(int sock_type)
+{
+	GIOChannel *io;
+	GIOCondition cond;
+	guint io_id, timer_id;
+	GObex *obex;
+	struct test_data d = { 0, NULL, {
+		{ get_req_first_srm_wait, sizeof(get_req_first_srm_wait) },
+		{ get_req_last, sizeof(get_req_last) },
+		{ NULL, -1 },
+		{ get_req_last, sizeof(get_req_last) } }, {
+		{ get_rsp_first_srm, sizeof(get_rsp_first_srm) },
+		{ get_rsp_zero, sizeof(get_rsp_zero) },
+		{ get_rsp_zero, sizeof(get_rsp_zero) },
+		{ get_rsp_last, sizeof(get_rsp_last) } } };
+
+	create_endpoints(&obex, &io, sock_type);
+
+	cond = G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL;
+	io_id = g_io_add_watch(io, cond, test_io_cb, &d);
+
+	d.mainloop = g_main_loop_new(NULL, FALSE);
+
+	timer_id = g_timeout_add_seconds(1, test_timeout, &d);
+
+	g_obex_get_req(obex, rcv_random, transfer_complete, &d, &d.err,
+				G_OBEX_HDR_TYPE, hdr_type, sizeof(hdr_type),
+				G_OBEX_HDR_NAME, "file.txt",
+				G_OBEX_HDR_SRM, G_OBEX_SRM_ENABLE,
+				G_OBEX_HDR_SRMP, G_OBEX_SRMP_WAIT,
+				G_OBEX_HDR_INVALID);
+	g_assert_no_error(d.err);
+
+	g_main_loop_run(d.mainloop);
+
+	g_assert_cmpuint(d.count, ==, RANDOM_PACKETS);
+
+	g_main_loop_unref(d.mainloop);
+
+	g_source_remove(timer_id);
+	g_io_channel_unref(io);
+	g_source_remove(io_id);
+	g_obex_unref(obex);
+
+	g_assert_no_error(d.err);
+}
+
+static void test_stream_get_req_random_srm_wait(void)
+{
+	test_get_req_random_srm_wait(SOCK_STREAM);
+}
+
+static void test_packet_get_req_random_srm_wait(void)
+{
+	test_get_req_random_srm_wait(SOCK_SEQPACKET);
+}
+
 static void test_get_req_app(void)
 {
 	GIOChannel *io;
@@ -2155,6 +2220,11 @@
 	g_test_add_func("/gobex/test_packet_get_req_random_srm",
 					test_packet_get_req_random_srm);

+	g_test_add_func("/gobex/test_stream_get_req_random_srm_wait",
+					test_stream_get_req_random_srm_wait);
+	g_test_add_func("/gobex/test_packet_get_req_random_srm_wait",
+					test_packet_get_req_random_srm_wait);
+
 	g_test_run();

 	return 0;