All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Qemu-devel] [PATCH] ceph/rbd block driver for qemu-kvm (v4)
From: Yehuda Sadeh Weinraub @ 2010-10-07 18:41 UTC (permalink / raw)
  To: Anthony Liguori
  Cc: Kevin Wolf, kvm, qemu-devel, ceph-devel, Christian Brunner
In-Reply-To: <4CAE13BA.70707@codemonkey.ws>

On Thu, Oct 7, 2010 at 11:38 AM, Anthony Liguori <anthony@codemonkey.ws> wrote:
> On 10/07/2010 01:08 PM, Yehuda Sadeh Weinraub wrote:
>>
>> On Thu, Oct 7, 2010 at 7:12 AM, Anthony Liguori<anthony@codemonkey.ws>
>>  wrote:
>>
>>>
>>> On 08/03/2010 03:14 PM, Christian Brunner wrote:
>>>
>>>>
>>>> +#include "qemu-common.h"
>>>> +#include "qemu-error.h"
>>>> +#include<sys/types.h>
>>>> +#include<stdbool.h>
>>>> +
>>>> +#include<qemu-common.h>
>>>>
>>>>
>>>
>>> This looks to be unnecessary.  Generally, system includes shouldn't be
>>> required so all of these should go away except rado/librados.h
>>>
>>
>> Removed.
>>
>>
>>>
>>>
>>>>
>>>> +
>>>> +#include "rbd_types.h"
>>>> +#include "module.h"
>>>> +#include "block_int.h"
>>>> +
>>>> +#include<stdio.h>
>>>> +#include<stdlib.h>
>>>> +#include<rados/librados.h>
>>>> +
>>>> +#include<signal.h>
>>>> +
>>>> +
>>>> +int eventfd(unsigned int initval, int flags);
>>>>
>>>>
>>>
>>> This is not quite right.  Depending on eventfd is curious but in the very
>>> least, you need to detect the presence of eventfd in configure and
>>> provide a
>>> wrapper that redefines it as necessary.
>>>
>>
>> Can fix that, though please see my later remarks.
>>
>>>>
>>>> +static int create_tmap_op(uint8_t op, const char *name, char
>>>> **tmap_desc)
>>>> +{
>>>> +    uint32_t len = strlen(name);
>>>> +    /* total_len = encoding op + name + empty buffer */
>>>> +    uint32_t total_len = 1 + (sizeof(uint32_t) + len) +
>>>> sizeof(uint32_t);
>>>> +    char *desc = NULL;
>>>>
>>>>
>>>
>>> char is the wrong type to use here as it may be signed or unsigned.  That
>>> can have weird effects with binary data when you're directly manipulating
>>> it.
>>>
>>
>> Well, I can change it to uint8_t, so that it matches the op type, but
>> that'll require adding some other castings. In any case, you usually
>> get such a weird behavior when you cast to types of different sizes
>> and have the sign bit padded which is not the case in here.
>>
>>
>>>
>>>
>>>>
>>>> +
>>>> +    desc = qemu_malloc(total_len);
>>>> +
>>>> +    *tmap_desc = desc;
>>>> +
>>>> +    *desc = op;
>>>> +    desc++;
>>>> +    memcpy(desc,&len, sizeof(len));
>>>> +    desc += sizeof(len);
>>>> +    memcpy(desc, name, len);
>>>> +    desc += len;
>>>> +    len = 0;
>>>> +    memcpy(desc,&len, sizeof(len));
>>>> +    desc += sizeof(len);
>>>>
>>>>
>>>
>>> Shouldn't endianness be a concern?
>>>
>>
>> Right. Fixed that.
>>
>>
>>>
>>>
>>>>
>>>> +
>>>> +    return desc - *tmap_desc;
>>>> +}
>>>> +
>>>> +static void free_tmap_op(char *tmap_desc)
>>>> +{
>>>> +    qemu_free(tmap_desc);
>>>> +}
>>>> +
>>>> +static int rbd_register_image(rados_pool_t pool, const char *name)
>>>> +{
>>>> +    char *tmap_desc;
>>>> +    const char *dir = RBD_DIRECTORY;
>>>> +    int ret;
>>>> +
>>>> +    ret = create_tmap_op(CEPH_OSD_TMAP_SET, name,&tmap_desc);
>>>> +    if (ret<    0) {
>>>> +        return ret;
>>>> +    }
>>>> +
>>>> +    ret = rados_tmap_update(pool, dir, tmap_desc, ret);
>>>> +    free_tmap_op(tmap_desc);
>>>> +
>>>> +    return ret;
>>>> +}
>>>>
>>>>
>>>
>>> This ops are all synchronous?  IOW, rados_tmap_update() call blocks until
>>> the operation is completed?
>>>
>>
>> Yeah. And this is only called from the rbd_create() callback.
>>
>>
>>>>
>>>> +            header_snap += strlen(header_snap) + 1;
>>>> +            if (header_snap>    end)
>>>> +                error_report("bad header, snapshot list broken");
>>>>
>>>>
>>>
>>> Missing curly braces here.
>>>
>>
>> Fixed.
>>
>>
>>>>
>>>> +    if (strncmp(hbuf + 68, RBD_HEADER_VERSION, 8)) {
>>>> +        error_report("Unknown image version %s", hbuf + 68);
>>>> +        r = -EMEDIUMTYPE;
>>>> +        goto failed;
>>>> +    }
>>>> +
>>>> +    RbdHeader1 *header;
>>>>
>>>>
>>>>
>>>
>>> Don't mix variable definitions with code.
>>>
>>
>> Fixed.
>>
>>
>>>>
>>>> +    s->efd = eventfd(0, 0);
>>>> +    if (s->efd<    0) {
>>>> +        error_report("error opening eventfd");
>>>> +        goto failed;
>>>> +    }
>>>> +    fcntl(s->efd, F_SETFL, O_NONBLOCK);
>>>> +    qemu_aio_set_fd_handler(s->efd, rbd_aio_completion_cb, NULL,
>>>> +        rbd_aio_flush_cb, NULL, s);
>>>>
>>>>
>>>
>>> It looks like you just use the eventfd to signal aio completion
>>> callbacks.
>>>  A better way to do this would be to schedule a bottom half.  eventfds
>>> are
>>> Linux specific and specific to recent kernels.
>>>
>>
>> Digging back why we introduced the eventfd, it was due to some issues
>> seen with do_savevm() hangs on qemu_aio_flush(). The reason seemed
>> that we had no fd associated with the block device, which seemed to
>> not work well with the qemu aio model. If that assumption is wrong,
>> we'd be happy to change it. In any case, there are other more portable
>> ways to generate fds, so if it's needed we can do that.
>>
>
> There's no fd at all?   How do you get notifications about an asynchronous
> event completion?
>
> Regards,
>
> Anthony Liguori
>
(resending to list, sorry)

The fd is hidden deep under in librados. We get callback notifications
for events completion.

Thanks,
Yehuda

^ permalink raw reply

* [Qemu-devel] [STATUS] static instrumentation
From: Lluís @ 2010-10-07 18:40 UTC (permalink / raw)
  To: qemu-devel

All virtual memory accesses should now be instrumented on all
architectures.

Next steps (in order):

  * Separately instrument physical memory addresses for executed
    instructions, regular memory accesses and memory accesses to I/O
    space (if possible). This will need to add an extra field on
    CPUTLBEntry with the physical address of the page.

  * Instrument memory accesses performed by DMA operations.

  * See how it plays with KVM. The objective is to make it switch from
    KVM to emulation (and the other way around) when a backdoor
    instruction is found.

  * Finish implementation of used/defined register usage in x86.

As always:
   git clone https://code.gso.ac.upc.edu/git/qemu-instrument
   https://projects.gso.ac.upc.edu/projects/qemu-instrument

Lluis

-- 
 "And it's much the same thing with knowledge, for whenever you learn
 something new, the whole world becomes that much richer."
 -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
 Tollbooth

^ permalink raw reply

* Re: [Qemu-devel] [PATCH 3/5] spice: add config options for channel security.
From: Stefan Weil @ 2010-10-07 18:43 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel
In-Reply-To: <1286438126-11250-4-git-send-email-kraxel@redhat.com>

Am 07.10.2010 09:55, schrieb Gerd Hoffmann:
> This allows to enforce tls or plaintext usage for certain spice
> channels.
> ---
>   qemu-config.c   |    6 ++++++
>   qemu-options.hx |    8 ++++++++
>   ui/spice-core.c |   25 +++++++++++++++++++++++++
>   3 files changed, 39 insertions(+), 0 deletions(-)
>
> diff --git a/qemu-config.c b/qemu-config.c
> index 8b545b1..f52e50c 100644
> --- a/qemu-config.c
> +++ b/qemu-config.c
> @@ -392,6 +392,12 @@ QemuOptsList qemu_spice_opts = {
>               .name = "tls-ciphers",
>               .type = QEMU_OPT_STRING,
>           },{
> +            .name = "tls-channel",
> +            .type = QEMU_OPT_STRING,
> +        },{
> +            .name = "plaintext-channel",
> +            .type = QEMU_OPT_STRING,
> +        },{
>               .name = "image-compression",
>               .type = QEMU_OPT_STRING,
>           },{
> diff --git a/qemu-options.hx b/qemu-options.hx
> index 59db632..bb45b67 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -704,6 +704,14 @@ The x509 file names can also be configured individually.
>   @item tls-ciphers=<list>
>   Specify which ciphers to use.
>
> +@item tls-channel=[main|display|inputs|record|playback|tunnel]
> +@item plaintext-channel=[main|display|inputs|record|playback|tunnel]
> +Force specific channel to be used with or without TLS encryption.  The
> +options can be specified multiple times to configure multiple
> +channels.  The special name "default" can be used to set the default
> +mode.  For channels which are not explicitly forced into one mode the
> +spice client is allowed to pick tls/plaintext as he pleases.
> +
>   @item image-compression=[auto_glz|auto_lz|quic|glz|lz|off]
>   Configure image compression (lossless).
>   Default is auto_glz.
> diff --git a/ui/spice-core.c b/ui/spice-core.c
> index 1567046..8f73848 100644
> --- a/ui/spice-core.c
> +++ b/ui/spice-core.c
> @@ -192,6 +192,29 @@ static const char *wan_compression_names[] = {
>
>   /* functions for the rest of qemu */
>
> +static int add_channel(const char *name, const char *value, void *opaque)
> +{
> +    int security = 0;
> +    int rc;
> +
> +    if (strcmp(name, "tls-channel") == 0)
> +        security = SPICE_CHANNEL_SECURITY_SSL;
>    

CODING_STYLE (if (...) { ... })? Same in next lines.

> +    if (strcmp(name, "plaintext-channel") == 0)
> +        security = SPICE_CHANNEL_SECURITY_NONE;
> +    if (security == 0)
> +        return 0;
> +    if (strcmp(value, "default") == 0) {
> +        rc = spice_server_set_channel_security(spice_server, NULL, security);
> +    } else {
> +        rc = spice_server_set_channel_security(spice_server, value, security);
> +    }
> +    if (rc != 0) {
> +        fprintf(stderr, "spice: failed to set channel security for %s\n", value);
> +        exit(1);
> +    }
> +    return 0;
> +}
> +
>   void qemu_spice_init(void)
>   {
>       QemuOpts *opts = QTAILQ_FIRST(&qemu_spice_opts.head);
> @@ -293,6 +316,8 @@ void qemu_spice_init(void)
>       }
>       spice_server_set_zlib_glz_compression(spice_server, wan_compr);
>
> +    qemu_opt_foreach(opts, add_channel, NULL, 0);
> +
>       spice_server_init(spice_server,&core_interface);
>       using_spice = 1;
>
>    

^ permalink raw reply

* Re: [PATCH 2/2] drivers:bluetooth: Kconfig & Makefile for TI BT
From: Gustavo F. Padovan @ 2010-10-07 18:47 UTC (permalink / raw)
  To: pavan_savoy; +Cc: linux-bluetooth, marcel, greg, linux-kernel
In-Reply-To: <1286477237-7526-3-git-send-email-pavan_savoy@ti.com>

* pavan_savoy@ti.com <pavan_savoy@ti.com> [2010-10-07 14:47:17 -0400]:

> From: Pavan Savoy <pavan_savoy@ti.com>
> 
> Kconfig and Makefile modifications to enable the Bluetooth
> driver for Texas Instrument's WiLink 7 chipset.
> 
> Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
> ---
>  drivers/bluetooth/Kconfig  |   10 ++++++++++
>  drivers/bluetooth/Makefile |    1 +
>  2 files changed, 11 insertions(+), 0 deletions(-)

Just merge this patch in the firt one. No need to keep this separated.

-- 
Gustavo F. Padovan
ProFUSION embedded systems - http://profusion.mobi

^ permalink raw reply

* Re: GeForce FX5200 dual DVI & Samsung 204b
From: Grzesiek Sójka @ 2010-10-07 18:47 UTC (permalink / raw)
  To: Francisco Jerez; +Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
In-Reply-To: <87fwwkhk8h.fsf-sGOZH3hwPm2sTnJN9+BGXg@public.gmane.org>

On 10/05/10 14:55, Francisco Jerez wrote:
> Grzesiek Sójka<pld-t9zbU3WrWHI@public.gmane.org>  writes:
>
>> On 10/02/10 15:31, Francisco Jerez wrote:
>>> Ah, I think you're hitting the bandwidth limitation of the nv34
>>> integrated TMDS transmitter. The attached patch should help with the
>>> console modesetting problem, but you'll still need to set the modelines
>>> manually (and force panel rescaling) if you want to go up to 1600x1200,
>>> because your GPU *cannot* handle the video mode your monitor is asking
>>> for.
>>
>> Your patch works fine. Now I have clear image at both displays. Only
>> disadvantage is that the resolution is 1280x1024 (PixClk 135MHz). So I
>> was wondering if it is possible to force particular modeline (by
>> editing the kernel source tree??). The mode:
>>
>> Modeline "1600x1200_def" 144  1600 1628 1788 1920  1200 1201 1204 1250
>>
>> works fine with the XServer. Is it possible to force it at the console??
>>
> You could try to force a reduced blanking mode in the kernel command
> line like: "video=DVI-I-1:1600x1200RM". But it isn't going to work with
> GPU rescaling, the attached patch (on top of the previous one) will make
> the kernel detect that, and automatically fall back to panel rescaling.
Your patch works grate, again. Thanks

^ permalink raw reply

* [PATCH 2/2] drivers:bluetooth: Kconfig & Makefile for TI BT
From: pavan_savoy @ 2010-10-07 18:47 UTC (permalink / raw)
  To: linux-bluetooth, marcel; +Cc: greg, linux-kernel, Pavan Savoy
In-Reply-To: <1286477237-7526-2-git-send-email-pavan_savoy@ti.com>

From: Pavan Savoy <pavan_savoy@ti.com>

Kconfig and Makefile modifications to enable the Bluetooth
driver for Texas Instrument's WiLink 7 chipset.

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
---
 drivers/bluetooth/Kconfig  |   10 ++++++++++
 drivers/bluetooth/Makefile |    1 +
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig
index 02deef4..936d8ce 100644
--- a/drivers/bluetooth/Kconfig
+++ b/drivers/bluetooth/Kconfig
@@ -219,4 +219,14 @@ config BT_ATH3K
 	  Say Y here to compile support for "Atheros firmware download driver"
 	  into the kernel or say M to compile it as module (ath3k).
 
+config BT_TI
+	tristate "BlueZ bluetooth driver for TI ST"
+	depends on TI_ST
+	help
+	  This enables the Bluetooth driver for Texas Instrument's BT/FM/GPS
+	  combo devices. This makes use of shared transport line discipline
+	  core driver to communicate with the BT core of the combo chip.
+
+	  Say Y here to compile support for Texas Instrument's WiLink7 driver
+	  into the kernel or say M to compile it as module.
 endmenu
diff --git a/drivers/bluetooth/Makefile b/drivers/bluetooth/Makefile
index 71bdf13..63156da 100644
--- a/drivers/bluetooth/Makefile
+++ b/drivers/bluetooth/Makefile
@@ -28,3 +28,4 @@ hci_uart-$(CONFIG_BT_HCIUART_BCSP)	+= hci_bcsp.o
 hci_uart-$(CONFIG_BT_HCIUART_LL)	+= hci_ll.o
 hci_uart-$(CONFIG_BT_HCIUART_ATH3K)	+= hci_ath.o
 hci_uart-objs				:= $(hci_uart-y)
+obj-$(CONFIG_BT_TI)			:= bt_ti.o
-- 
1.6.5

^ permalink raw reply related

* [PATCH 1/2] drivers:bluetooth: TI_ST bluetooth driver
From: pavan_savoy @ 2010-10-07 18:47 UTC (permalink / raw)
  To: linux-bluetooth, marcel; +Cc: greg, linux-kernel, Pavan Savoy
In-Reply-To: <1286477237-7526-1-git-send-email-pavan_savoy@ti.com>

From: Pavan Savoy <pavan_savoy@ti.com>

This is the bluetooth protocol driver for the TI WiLink7 chipsets.
Texas Instrument's WiLink chipsets combine wireless technologies
like BT, FM, GPS and WLAN onto a single chip.

This Bluetooth driver works on top of the TI_ST shared transport
line discipline driver which also allows other drivers like
FM V4L2 and GPS character driver to make use of the same UART interface.

Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
---
 drivers/bluetooth/bt_ti.c |  489 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 489 insertions(+), 0 deletions(-)
 create mode 100644 drivers/bluetooth/bt_ti.c

diff --git a/drivers/bluetooth/bt_ti.c b/drivers/bluetooth/bt_ti.c
new file mode 100644
index 0000000..dffbb56
--- /dev/null
+++ b/drivers/bluetooth/bt_ti.c
@@ -0,0 +1,489 @@
+/*
+ *  Texas Instrument's Bluetooth Driver For Shared Transport.
+ *
+ *  Bluetooth Driver acts as interface between HCI CORE and
+ *  TI Shared Transport Layer.
+ *
+ *  Copyright (C) 2009-2010 Texas Instruments
+ *  Author: Raja Mani <raja_mani@ti.com>
+ *	Pavan Savoy <pavan_savoy@ti.com>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License version 2 as
+ *  published by the Free Software Foundation.
+ *
+ *  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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#include <linux/platform_device.h>
+#include <net/bluetooth/bluetooth.h>
+#include <net/bluetooth/hci_core.h>
+
+#include <linux/ti_wilink_st.h>
+
+/* Bluetooth Driver Version */
+#define VERSION               "1.0"
+
+/* Defines number of seconds to wait for reg completion
+ * callback getting called from ST (in case,registration
+ * with ST returns PENDING status)
+ */
+#define BT_REGISTER_TIMEOUT   6000	/* 6 sec */
+
+/* BT driver's local status */
+#define BT_DRV_RUNNING        0
+#define BT_ST_REGISTERED      1
+
+/**
+ * struct hci_st - BT driver operation structure
+ * @hdev: hci device pointer which binds to bt driver
+ * @flags: used locally,to maintain various BT driver status
+ * @streg_cbdata: to hold ST registration callback status
+ * @st_write: write function pointer of ST driver
+ * @wait_for_btdrv_reg_completion - completion sync between hci_st_open
+ *	and hci_st_registration_completion_cb.
+ */
+struct hci_st {
+	struct hci_dev *hdev;
+	unsigned long flags;
+	char streg_cbdata;
+	long (*st_write) (struct sk_buff *);
+	struct completion wait_for_btdrv_reg_completion;
+};
+
+static int reset;
+
+/* Increments HCI counters based on pocket ID (cmd,acl,sco) */
+static inline void hci_st_tx_complete(struct hci_st *hst, int pkt_type)
+{
+	struct hci_dev *hdev;
+	hdev = hst->hdev;
+
+	/* Update HCI stat counters */
+	switch (pkt_type) {
+	case HCI_COMMAND_PKT:
+		hdev->stat.cmd_tx++;
+		break;
+
+	case HCI_ACLDATA_PKT:
+		hdev->stat.acl_tx++;
+		break;
+
+	case HCI_SCODATA_PKT:
+		hdev->stat.cmd_tx++;
+		break;
+	}
+}
+
+/* ------- Interfaces to Shared Transport ------ */
+
+/* Called by ST layer to indicate protocol registration completion
+ * status.hci_st_open() function will wait for signal from this
+ * API when st_register() function returns ST_PENDING.
+ */
+static void hci_st_registration_completion_cb(void *priv_data, char data)
+{
+	struct hci_st *lhst = (struct hci_st *)priv_data;
+	/* hci_st_open() function needs value of 'data' to know
+	 * the registration status(success/fail),So have a back
+	 * up of it.
+	 */
+	lhst->streg_cbdata = data;
+
+	/* Got a feedback from ST for BT driver registration
+	 * request.Wackup hci_st_open() function to continue
+	 * it's open operation.
+	 */
+	complete(&lhst->wait_for_btdrv_reg_completion);
+}
+
+/* Called by Shared Transport layer when receive data is
+ * available */
+static long hci_st_receive(void *priv_data, struct sk_buff *skb)
+{
+	int err;
+	int len;
+	struct hci_st *lhst = (struct hci_st *)priv_data;
+
+	err = 0;
+	len = 0;
+
+	if (skb == NULL) {
+		BT_ERR("Invalid SKB received from ST");
+		return -EFAULT;
+	}
+	if (!lhst) {
+		kfree_skb(skb);
+		BT_ERR("Invalid hci_st memory,freeing SKB");
+		return -EFAULT;
+	}
+	if (!test_bit(BT_DRV_RUNNING, &lhst->flags)) {
+		kfree_skb(skb);
+		BT_ERR("Device is not running,freeing SKB");
+		return -EINVAL;
+	}
+
+	len = skb->len;
+	skb->dev = (struct net_device *)lhst->hdev;
+
+	/* Forward skb to HCI CORE layer */
+	err = hci_recv_frame(skb);
+	if (err) {
+		kfree_skb(skb);
+		BT_ERR("Unable to push skb to HCI CORE(%d),freeing SKB",
+				err);
+		return err;
+	}
+	lhst->hdev->stat.byte_rx += len;
+
+	return 0;
+}
+
+/* ------- Interfaces to HCI layer ------ */
+
+/* Called from HCI core to initialize the device */
+static int hci_st_open(struct hci_dev *hdev)
+{
+	static struct st_proto_s hci_st_proto;
+	unsigned long timeleft;
+	struct hci_st *hst;
+	int err;
+	err = 0;
+
+	BT_DBG("%s %p", hdev->name, hdev);
+	hst = hdev->driver_data;
+
+	/* Populate BT driver info required by ST */
+	memset(&hci_st_proto, 0, sizeof(hci_st_proto));
+
+	/* BT driver ID */
+	hci_st_proto.type = ST_BT;
+
+	/* Receive function which called from ST */
+	hci_st_proto.recv = hci_st_receive;
+
+	/* Packet match function may used in future */
+	hci_st_proto.match_packet = NULL;
+
+	/* Callback to be called when registration is pending */
+	hci_st_proto.reg_complete_cb = hci_st_registration_completion_cb;
+
+	/* This is write function pointer of ST. BT driver will make use of this
+	 * for sending any packets to chip. ST will assign and give to us, so
+	 * make it as NULL */
+	hci_st_proto.write = NULL;
+
+	/* send in the hst to be received at registration complete callback
+	 * and during st's receive
+	 */
+	hci_st_proto.priv_data = hst;
+
+	/* Register with ST layer */
+	err = st_register(&hci_st_proto);
+	if (err == -EINPROGRESS) {
+		/* Prepare wait-for-completion handler data structures.
+		 * Needed to syncronize this and st_registration_completion_cb()
+		 * functions.
+		 */
+		init_completion(&hst->wait_for_btdrv_reg_completion);
+
+		/* Reset ST registration callback status flag , this value
+		 * will be updated in hci_st_registration_completion_cb()
+		 * function whenever it called from ST driver.
+		 */
+		hst->streg_cbdata = -EINPROGRESS;
+
+		/* ST is busy with other protocol registration(may be busy with
+		 * firmware download).So,Wait till the registration callback
+		 * (passed as a argument to st_register() function) getting
+		 * called from ST.
+		 */
+		BT_DBG(" %s waiting for reg completion signal from ST",
+				__func__);
+
+		timeleft =
+			wait_for_completion_timeout
+			(&hst->wait_for_btdrv_reg_completion,
+			 msecs_to_jiffies(BT_REGISTER_TIMEOUT));
+		if (!timeleft) {
+			BT_ERR("Timeout(%d sec),didn't get reg"
+					"completion signal from ST",
+					BT_REGISTER_TIMEOUT / 1000);
+			return -ETIMEDOUT;
+		}
+
+		/* Is ST registration callback called with ERROR value? */
+		if (hst->streg_cbdata != 0) {
+			BT_ERR("ST reg completion CB called with invalid"
+					"status %d", hst->streg_cbdata);
+			return -EAGAIN;
+		}
+		err = 0;
+	} else if (err == -1) {
+		BT_ERR("st_register failed %d", err);
+		return -EAGAIN;
+	}
+
+	/* Do we have proper ST write function? */
+	if (hci_st_proto.write != NULL) {
+		/* We need this pointer for sending any Bluetooth pkts */
+		hst->st_write = hci_st_proto.write;
+	} else {
+		BT_ERR("failed to get ST write func pointer");
+
+		/* Undo registration with ST */
+		err = st_unregister(ST_BT);
+		if (err < 0)
+			BT_ERR("st_unregister failed %d", err);
+
+		hst->st_write = NULL;
+		return -EAGAIN;
+	}
+
+	/* Registration with ST layer is completed successfully,
+	 * now chip is ready to accept commands from HCI CORE.
+	 * Mark HCI Device flag as RUNNING
+	 */
+	set_bit(HCI_RUNNING, &hdev->flags);
+
+	/* Registration with ST successful */
+	set_bit(BT_ST_REGISTERED, &hst->flags);
+
+	return err;
+}
+
+/* Close device */
+static int hci_st_close(struct hci_dev *hdev)
+{
+	int err;
+	struct hci_st *hst;
+	err = 0;
+
+	hst = hdev->driver_data;
+	/* Unregister from ST layer */
+	if (test_and_clear_bit(BT_ST_REGISTERED, &hst->flags)) {
+		err = st_unregister(ST_BT);
+		if (err != 0) {
+			BT_ERR("st_unregister failed %d", err);
+			return -EBUSY;
+		}
+	}
+
+	hst->st_write = NULL;
+
+	/* ST layer would have moved chip to inactive state.
+	 * So,clear HCI device RUNNING flag.
+	 */
+	if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags))
+		return 0;
+
+	return err;
+}
+
+/* Called from HCI CORE , Sends frames to Shared Transport */
+static int hci_st_send_frame(struct sk_buff *skb)
+{
+	struct hci_dev *hdev;
+	struct hci_st *hst;
+	long len;
+
+	if (skb == NULL) {
+		BT_ERR("Invalid skb received from HCI CORE");
+		return -ENOMEM;
+	}
+	hdev = (struct hci_dev *)skb->dev;
+	if (!hdev) {
+		BT_ERR("SKB received for invalid HCI Device (hdev=NULL)");
+		return -ENODEV;
+	}
+	if (!test_bit(HCI_RUNNING, &hdev->flags)) {
+		BT_ERR("Device is not running");
+		return -EBUSY;
+	}
+
+	hst = (struct hci_st *)hdev->driver_data;
+
+	/* Prepend skb with frame type */
+	memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1);
+
+	BT_DBG(" %s: type %d len %d", hdev->name, bt_cb(skb)->pkt_type,
+			skb->len);
+
+	/* Insert skb to shared transport layer's transmit queue.
+	 * Freeing skb memory is taken care in shared transport layer,
+	 * so don't free skb memory here.
+	 */
+	if (!hst->st_write) {
+		kfree_skb(skb);
+		BT_ERR(" Can't write to ST, st_write null?");
+		return -EAGAIN;
+	}
+	len = hst->st_write(skb);
+	if (len < 0) {
+		/* Something went wrong in st write , free skb memory */
+		kfree_skb(skb);
+		BT_ERR(" ST write failed (%ld)", len);
+		return -EAGAIN;
+	}
+
+	/* ST accepted our skb. So, Go ahead and do rest */
+	hdev->stat.byte_tx += len;
+	hci_st_tx_complete(hst, bt_cb(skb)->pkt_type);
+
+	return 0;
+}
+
+static void hci_st_destruct(struct hci_dev *hdev)
+{
+	if (!hdev) {
+		BT_ERR("Destruct called with invalid HCI Device"
+				"(hdev=NULL)");
+		return;
+	}
+
+	BT_DBG("%s", hdev->name);
+
+	/* free hci_st memory */
+	if (hdev->driver_data != NULL)
+		kfree(hdev->driver_data);
+
+	return;
+}
+
+/* Creates new HCI device */
+static int hci_st_register_dev(struct hci_st *hst)
+{
+	struct hci_dev *hdev;
+
+	/* Initialize and register HCI device */
+	hdev = hci_alloc_dev();
+	if (!hdev) {
+		BT_ERR("Can't allocate HCI device");
+		return -ENOMEM;
+	}
+	BT_DBG(" HCI device allocated. hdev= %p", hdev);
+
+	hst->hdev = hdev;
+	hdev->bus = HCI_UART;
+	hdev->driver_data = hst;
+	hdev->open = hci_st_open;
+	hdev->close = hci_st_close;
+	hdev->flush = NULL;
+	hdev->send = hci_st_send_frame;
+	hdev->destruct = hci_st_destruct;
+	hdev->owner = THIS_MODULE;
+
+	if (reset)
+		set_bit(HCI_QUIRK_NO_RESET, &hdev->quirks);
+
+	if (hci_register_dev(hdev) < 0) {
+		BT_ERR("Can't register HCI device");
+		hci_free_dev(hdev);
+		return -ENODEV;
+	}
+
+	BT_DBG(" HCI device registered. hdev= %p", hdev);
+	return 0;
+}
+
+
+static int bt_ti_probe(struct platform_device *pdev)
+{
+	int err;
+	static struct hci_st *hst;
+	err = 0;
+
+	BT_DBG(" Bluetooth Driver Version %s", VERSION);
+
+	/* Allocate local resource memory */
+	hst = kzalloc(sizeof(struct hci_st), GFP_KERNEL);
+	if (!hst) {
+		BT_ERR("Can't allocate control structure");
+		return -ENFILE;
+	}
+
+	/* Expose "hciX" device to user space */
+	err = hci_st_register_dev(hst);
+	if (err) {
+		/* Release local resource memory */
+		kfree(hst);
+
+		BT_ERR("Unable to expose hci0 device(%d)", err);
+		return err;
+	}
+	set_bit(BT_DRV_RUNNING, &hst->flags);
+	dev_set_drvdata(&pdev->dev, hst);
+	return err;
+}
+
+static int bt_ti_remove(struct platform_device *pdev)
+{
+	struct hci_st *hst;
+
+	hst = dev_get_drvdata(&pdev->dev);
+	/* Deallocate local resource's memory  */
+	if (hst) {
+		struct hci_dev *hdev = hst->hdev;
+		if (hdev == NULL) {
+			BT_ERR("Invalid hdev memory");
+			kfree(hst);
+		} else {
+			hci_st_close(hdev);
+			if (test_and_clear_bit(BT_DRV_RUNNING, &hst->flags)) {
+				/* Remove HCI device (hciX) created
+				 * in module init.
+				 */
+				hci_unregister_dev(hdev);
+				/* Free HCI device memory */
+				hci_free_dev(hdev);
+			}
+		}
+	}
+	return 0;
+}
+
+static struct platform_driver bt_ti_driver = {
+	.probe = bt_ti_probe,
+	.remove = bt_ti_remove,
+	.driver = {
+		.name = "ti_st_bluetooth",
+		.owner = THIS_MODULE,
+	},
+};
+
+/* ------- Module Init/Exit interfaces ------ */
+static int __init bt_drv_init(void)
+{
+	long ret = 0;
+	ret = platform_driver_register(&bt_ti_driver);
+	if (ret != 0) {
+		BT_ERR("bt_ti platform drv registration failed");
+		return -1;
+	}
+	return 0;
+}
+
+static void __exit bt_drv_exit(void)
+{
+	platform_driver_unregister(&bt_ti_driver);
+}
+
+module_init(bt_drv_init);
+module_exit(bt_drv_exit);
+
+/* ------ Module Info ------ */
+
+module_param(reset, bool, 0644);
+MODULE_PARM_DESC(reset, "Send HCI reset command on initialization");
+MODULE_AUTHOR("Raja Mani <raja_mani@ti.com>");
+MODULE_DESCRIPTION("Bluetooth Driver for TI Shared Transport" VERSION);
+MODULE_VERSION(VERSION);
+MODULE_LICENSE("GPL");
-- 
1.6.5

^ permalink raw reply related

* [PATCH 0/2] v2: Bluetooth driver for TI_ST
From: pavan_savoy @ 2010-10-07 18:47 UTC (permalink / raw)
  To: linux-bluetooth, marcel; +Cc: greg, linux-kernel, Pavan Savoy

From: Pavan Savoy <pavan_savoy@ti.com>

Marcel,

I have taken care of the changes you've mentioned, Now the
bluetooth driver is also a platform driver and it requires a
platform device and this platform driver's probe will do the
registration to HCI.

other changes include the usage of BT_DBG instead of pr_*
and removal of piece of code which was redundant.

Please review and comment...

Pavan Savoy (2):
  drivers:bluetooth: TI_ST bluetooth driver
  drivers:bluetooth: Kconfig & Makefile for TI BT

 drivers/bluetooth/Kconfig  |   10 +
 drivers/bluetooth/Makefile |    1 +
 drivers/bluetooth/bt_ti.c  |  489 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 500 insertions(+), 0 deletions(-)
 create mode 100644 drivers/bluetooth/bt_ti.c

^ permalink raw reply

* [PATCH] cifs: on multiuser mount, set ownership to current_fsuid/current_fsgid (try #5)
From: Jeff Layton @ 2010-10-07 18:46 UTC (permalink / raw)
  To: smfrench-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA

...when unix extensions aren't enabled. This makes everything on the
mount appear to be owned by the current user.

This version of the patch differs from previous versions however in that
the admin can still force the ownership of all files to appear as a
single user via the uid=/gid= options.

Signed-off-by: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 fs/cifs/inode.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index dcd0886..7cf3d93 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1761,11 +1761,21 @@ check_inval:
 int cifs_getattr(struct vfsmount *mnt, struct dentry *dentry,
 	struct kstat *stat)
 {
+	struct cifs_sb_info *cifs_sb = CIFS_SB(dentry->d_sb);
+	struct cifsTconInfo *tcon = cifs_sb_master_tcon(cifs_sb);
 	int err = cifs_revalidate_dentry(dentry);
+
 	if (!err) {
 		generic_fillattr(dentry->d_inode, stat);
 		stat->blksize = CIFS_MAX_MSGSIZE;
 		stat->ino = CIFS_I(dentry->d_inode)->uniqueid;
+		if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MULTIUSER) &&
+		    !tcon->unix_ext) {
+			if (!cifs_sb->mnt_uid)
+				stat->uid = current_fsuid();
+			if (!cifs_sb->mnt_uid)
+				stat->gid = current_fsgid();
+		}
 	}
 	return err;
 }
-- 
1.7.2.3

^ permalink raw reply related

* Re: [lm-sensors] [PATCH] coretemp: fix reading of microcode revision
From: Fenghua Yu @ 2010-10-07 18:46 UTC (permalink / raw)
  To: lm-sensors
In-Reply-To: <4CADB0A1020000780001B335@vpn.id2.novell.com>

On Thu, Oct 07, 2010 at 02:36:01AM -0700, Jan Beulich wrote:
> According to the documentation, simply reading the respective MSR
> isn't sufficient: It should be written with zeros, cpuid(1) be
> executed, and then read (see arch/x86/kernel/cpu/intel.c for an
> example).
> 
> Signed-off-by: Jan Beulich <jbeulich@novell.com>
> Cc: Fenghua Yu <fenghua.yu@intel.com>
> Cc: Chen Gong <gong.chen@linux.intel.com>
> 
> ---
>  drivers/hwmon/coretemp.c |   18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
> 
> --- linux-2.6.36-rc7/drivers/hwmon/coretemp.c
> +++ 2.6.36-rc7-coretemp-ucode/drivers/hwmon/coretemp.c
> @@ -292,6 +292,15 @@ static int __devinit get_tjmax(struct cp
>  	}
>  }
>  
> +static void __devinit get_ucode_rev_on_cpu(void *edx)
> +{
> +	u32 eax;
> +
> +	wrmsr(MSR_IA32_UCODE_REV, 0, 0);
> +	sync_core();
> +	rdmsr(MSR_IA32_UCODE_REV, eax, *(u32 *)edx);
> +}
> +
>  static int __devinit coretemp_probe(struct platform_device *pdev)
>  {
>  	struct coretemp_data *data;
> @@ -327,8 +336,13 @@ static int __devinit coretemp_probe(stru
>  
>  	if ((c->x86_model = 0xe) && (c->x86_mask < 0xc)) {
>  		/* check for microcode update */
> -		rdmsr_on_cpu(data->id, MSR_IA32_UCODE_REV, &eax, &edx);
> -		if (edx < 0x39) {
> +		err = smp_call_function_single(data->id, get_ucode_rev_on_cpu,
> +					       &edx, 1);
> +		if (err)
> +			dev_warn(&pdev->dev,
> +				 "Cannot determine microcode revision "
> +				 "of the CPU!\n");

When err, need to call dev_err and go to exit_free. This error handling should
be same as edx < 0x39 case.

> +		else if (edx < 0x39) {
>  			err = -ENODEV;
>  			dev_err(&pdev->dev,
>  				"Errata AE18 not fixed, update BIOS or "
> 


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply

* Re: [PATCH v6 03/12] Retry fault before vmentry
From: Gleb Natapov @ 2010-10-07 18:44 UTC (permalink / raw)
  To: Marcelo Tosatti
  Cc: kvm, linux-mm, linux-kernel, avi, mingo, a.p.zijlstra, tglx, hpa,
	riel, cl
In-Reply-To: <20101006142050.GA31423@amt.cnet>

On Wed, Oct 06, 2010 at 11:20:50AM -0300, Marcelo Tosatti wrote:
> On Wed, Oct 06, 2010 at 01:07:04PM +0200, Gleb Natapov wrote:
> > > Can't you set a bit in vcpu->requests instead, and handle it in "out:"
> > > at the end of vcpu_enter_guest? 
> > > 
> > > To have a single entry point for pagefaults, after vmexit handling.
> > Jumping to "out:" will skip vmexit handling anyway, so we will not reuse
> > same call site anyway. I don't see yet why the way you propose will have
> > an advantage.
> 
> What i meant was to call pagefault handler after vmexit handling.
> 
> Because the way it is in your patch now, with pre pagefault on entry,
> one has to make an effort to verify ordering wrt other events on entry
> processing.
> 
What events do you have in mind?

> With pre pagefault after vmexit, its more natural.
> 
I do not see non-ugly way to pass information that is needed to perform
the prefault to the place you want me to put it. We can skip guest entry
in case prefault was done which will have the same effect as your
proposal, but I want to have a good reason to do so since otherwise we
will just do more work for nothing on guest entry.

> Does that make sense?

--
			Gleb.

^ permalink raw reply

* [PATCH 15/15] Staging: comedi: file: Removed braces from some statement blocks
From: Maurice Dawson @ 2010-10-07 18:45 UTC (permalink / raw)
  To: gregkh, arun.thomas, tsanghan, u.kleine-koenig, devel,
	linux-kernel

Unnecessary braces in some statement blocks

Signed-off-by: Maurice Dawson <mauricedawson2699@gmail.com>
---
 drivers/staging/comedi/drivers/adl_pci9118.c |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adl_pci9118.c b/drivers/staging/comedi/drivers/adl_pci9118.c
index 7600431..81f1c87 100644
--- a/drivers/staging/comedi/drivers/adl_pci9118.c
+++ b/drivers/staging/comedi/drivers/adl_pci9118.c
@@ -1576,12 +1576,12 @@ static int pci9118_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 	}
 
 	/* use sample&hold signal? */
-	if (cmd->convert_src == TRIG_NOW) {
+	if (cmd->convert_src == TRIG_NOW)
 		devpriv->usessh = 1;
-	} /* yes */
-	else {
+	/* yes */
+	else
 		devpriv->usessh = 0;
-	}			/*  no */
+				/*  no */
 
 	DPRINTK("1 neverending=%d scans=%u usessh=%d ai_startstop=0x%2x\n",
 		devpriv->ai_neverending, devpriv->ai_scans, devpriv->usessh,
@@ -1598,9 +1598,8 @@ static int pci9118_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 		devpriv->usedma = 1;
 		if ((cmd->flags & TRIG_WAKE_EOS) &&
 		    (devpriv->ai_n_scanlen == 1)) {
-			if (cmd->convert_src == TRIG_NOW) {
+			if (cmd->convert_src == TRIG_NOW)
 				devpriv->ai_add_back = 1;
-			}
 			if (cmd->convert_src == TRIG_TIMER) {
 				devpriv->usedma = 0;
 					/*
@@ -1695,11 +1694,10 @@ static int pci9118_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 		(cmd->scan_begin_src == TRIG_INT)) &&
 		(cmd->convert_src == TRIG_TIMER)) {
 					/* both timer is used for one time */
-		if (cmd->scan_begin_src == TRIG_EXT) {
+		if (cmd->scan_begin_src == TRIG_EXT)
 			devpriv->ai_do = 4;
-		} else {
+		else
 			devpriv->ai_do = 1;
-		}
 		pci9118_calc_divisors(devpriv->ai_do, dev, s,
 				      &cmd->scan_begin_arg, &cmd->convert_arg,
 				      devpriv->ai_flags,
@@ -2213,11 +2211,10 @@ static int pci9118_attach(struct comedi_device *dev,
 
 	opt_bus = it->options[0];
 	opt_slot = it->options[1];
-	if (it->options[3] & 1) {
+	if (it->options[3] & 1)
 		master = 0;	/* user don't want use bus master */
-	} else {
+	else
 		master = 1;
-	}
 
 	ret = alloc_private(dev, sizeof(struct pci9118_private));
 	if (ret < 0) {
-- 
1.7.0.4


^ permalink raw reply related

* Re: memory clobber in rx path, maybe related to ath9k.
From: Ben Greear @ 2010-10-07 18:45 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: Johannes Berg, linux-wireless@vger.kernel.org
In-Reply-To: <AANLkTimEZ5GY7WFz-F4YyC+6MEwNn2Dki4tonp645XrS@mail.gmail.com>

On 10/07/2010 11:42 AM, Luis R. Rodriguez wrote:
> On Thu, Oct 7, 2010 at 11:39 AM, Ben Greear<greearb@candelatech.com>  wrote:
>> On 10/07/2010 11:29 AM, Luis R. Rodriguez wrote:
>>>
>>> On Thu, Oct 7, 2010 at 11:14 AM, Johannes Berg
>>> <johannes@sipsolutions.net>    wrote:
>>>>
>>>> On Thu, 2010-10-07 at 10:33 -0700, Ben Greear wrote:
>>>>>
>>>>> In case it helps, here is a dump of where the corrupted SKB was deleted.
>>>>
>>>> I wonder, do you have a machine with a decent IOMMU? Adding IOMMU
>>>> debugging into the mix could help you figure out if it's a DMA problem.
>>>
>>> Ben, how much traffic are you RX'ing on these virtual interfaces?
>>
>> I disabled my user-space application, and this script alone can reproduce
>> the problem fairly quickly on my system.  You will need to change some
>> of those first variables.  Just start it and wait a few minutes and
>> watch the splats show on the console :)
>>
>> Note that I am not generating any traffic, but the wpa_supplicants are
>> doing their thing of course...
>>
>> I'm using the kernel found here:
>> http://dmz2.candelatech.com/git/gitweb.cgi?p=linux.wireless-testing.ct/.git;a=summary
>>
>> It's latest wireless-testing with some of my own patches, and some
>> I've gathered from here an there.  I doubt I'm causing this problem,
>> but if you can't reproduce it with this script on your kernels,
>> I can try with base wireless-testing or whatever you are using.
>
> I'll run this now, but can you try a vanilla wireless-testing? I hear
> the latest wireless-testing is borked so maybe try (git reset --hard
> master-2010-09-29), its what I'm on.

You are liable to hit a bunch of those crashes I've been reporting
before you hit the DMA thing if you don't use latest (with Johanne's scan
locking patch).

I'm going to poke at IOMMU debugging and see what I find.

I'll start a compile of vanilla wireless-testing + scan fix as well.

Thanks,
Ben

>
>    Luis


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


^ permalink raw reply

* Re: [PATCH 1/2] drivers:bluetooth: TI_ST bluetooth driver
From: Gustavo F. Padovan @ 2010-10-07 18:45 UTC (permalink / raw)
  To: pavan_savoy; +Cc: linux-bluetooth, marcel, greg, linux-kernel
In-Reply-To: <1286477237-7526-2-git-send-email-pavan_savoy@ti.com>

Hi Pavan,

Change the commit subject to "Bluetooth: TI_ST bluetooth driver" 

* pavan_savoy@ti.com <pavan_savoy@ti.com> [2010-10-07 14:47:16 -0400]:

> From: Pavan Savoy <pavan_savoy@ti.com>
> 
> This is the bluetooth protocol driver for the TI WiLink7 chipsets.
> Texas Instrument's WiLink chipsets combine wireless technologies
> like BT, FM, GPS and WLAN onto a single chip.
> 
> This Bluetooth driver works on top of the TI_ST shared transport
> line discipline driver which also allows other drivers like
> FM V4L2 and GPS character driver to make use of the same UART interface.
> 
> Signed-off-by: Pavan Savoy <pavan_savoy@ti.com>
> ---
>  drivers/bluetooth/bt_ti.c |  489 +++++++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 489 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/bluetooth/bt_ti.c

We don't have filename with bt_.. in drivers/bluetooth/. Maybe ti_st.c
should be a better name, or something like that.

> 
> diff --git a/drivers/bluetooth/bt_ti.c b/drivers/bluetooth/bt_ti.c
> new file mode 100644
> index 0000000..dffbb56
> --- /dev/null
> +++ b/drivers/bluetooth/bt_ti.c
> @@ -0,0 +1,489 @@
> +/*
> + *  Texas Instrument's Bluetooth Driver For Shared Transport.
> + *
> + *  Bluetooth Driver acts as interface between HCI CORE and
> + *  TI Shared Transport Layer.
> + *
> + *  Copyright (C) 2009-2010 Texas Instruments
> + *  Author: Raja Mani <raja_mani@ti.com>
> + *	Pavan Savoy <pavan_savoy@ti.com>
> + *
> + *  This program is free software; you can redistribute it and/or modify
> + *  it under the terms of the GNU General Public License version 2 as
> + *  published by the Free Software Foundation.
> + *
> + *  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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
> + *
> + */
> +
> +#include <linux/platform_device.h>
> +#include <net/bluetooth/bluetooth.h>
> +#include <net/bluetooth/hci_core.h>
> +
> +#include <linux/ti_wilink_st.h>
> +
> +/* Bluetooth Driver Version */
> +#define VERSION               "1.0"
> +
> +/* Defines number of seconds to wait for reg completion
> + * callback getting called from ST (in case,registration
> + * with ST returns PENDING status)
> + */
> +#define BT_REGISTER_TIMEOUT   6000	/* 6 sec */
> +
> +/* BT driver's local status */
> +#define BT_DRV_RUNNING        0
> +#define BT_ST_REGISTERED      1
> +
> +/**
> + * struct hci_st - BT driver operation structure
> + * @hdev: hci device pointer which binds to bt driver
> + * @flags: used locally,to maintain various BT driver status
> + * @streg_cbdata: to hold ST registration callback status
> + * @st_write: write function pointer of ST driver
> + * @wait_for_btdrv_reg_completion - completion sync between hci_st_open
> + *	and hci_st_registration_completion_cb.
> + */
> +struct hci_st {
> +	struct hci_dev *hdev;
> +	unsigned long flags;
> +	char streg_cbdata;
> +	long (*st_write) (struct sk_buff *);
> +	struct completion wait_for_btdrv_reg_completion;
> +};
> +
> +static int reset;
> +
> +/* Increments HCI counters based on pocket ID (cmd,acl,sco) */
> +static inline void hci_st_tx_complete(struct hci_st *hst, int pkt_type)
> +{
> +	struct hci_dev *hdev;
> +	hdev = hst->hdev;
> +
> +	/* Update HCI stat counters */
> +	switch (pkt_type) {
> +	case HCI_COMMAND_PKT:
> +		hdev->stat.cmd_tx++;
> +		break;
> +
> +	case HCI_ACLDATA_PKT:
> +		hdev->stat.acl_tx++;
> +		break;
> +
> +	case HCI_SCODATA_PKT:
> +		hdev->stat.cmd_tx++;

it should be sco_tx here.

> +		break;
> +	}
> +}
> +
> +/* ------- Interfaces to Shared Transport ------ */
> +
> +/* Called by ST layer to indicate protocol registration completion
> + * status.hci_st_open() function will wait for signal from this
> + * API when st_register() function returns ST_PENDING.
> + */
> +static void hci_st_registration_completion_cb(void *priv_data, char data)

That is not the hci layer, so rename this function (and the others) to
something that reflect where they are really doing.

> +{
> +	struct hci_st *lhst = (struct hci_st *)priv_data;
> +	/* hci_st_open() function needs value of 'data' to know
> +	 * the registration status(success/fail),So have a back
> +	 * up of it.
> +	 */
> +	lhst->streg_cbdata = data;
> +
> +	/* Got a feedback from ST for BT driver registration
> +	 * request.Wackup hci_st_open() function to continue
> +	 * it's open operation.
> +	 */
> +	complete(&lhst->wait_for_btdrv_reg_completion);
> +}
> +
> +/* Called by Shared Transport layer when receive data is
> + * available */
> +static long hci_st_receive(void *priv_data, struct sk_buff *skb)
> +{
> +	int err;
> +	int len;

you can put err and len in the same line.

> +	struct hci_st *lhst = (struct hci_st *)priv_data;
> +
> +	err = 0;
> +	len = 0;

and no need to set them to 0 here.

> +
> +	if (skb == NULL) {
> +		BT_ERR("Invalid SKB received from ST");
> +		return -EFAULT;
> +	}

We need a empty line here.

> +	if (!lhst) {
> +		kfree_skb(skb);
> +		BT_ERR("Invalid hci_st memory,freeing SKB");
> +		return -EFAULT;
> +	}

And also here. Check the rest of the code for similar issues.

> +	if (!test_bit(BT_DRV_RUNNING, &lhst->flags)) {
> +		kfree_skb(skb);
> +		BT_ERR("Device is not running,freeing SKB");
> +		return -EINVAL;
> +	}

If you are here, your device is running, right? Or am I missing
something?

> +
> +	len = skb->len;
> +	skb->dev = (struct net_device *)lhst->hdev;
> +
> +	/* Forward skb to HCI CORE layer */
> +	err = hci_recv_frame(skb);
> +	if (err) {
> +		kfree_skb(skb);
> +		BT_ERR("Unable to push skb to HCI CORE(%d),freeing SKB",
> +				err);
> +		return err;
> +	}
> +	lhst->hdev->stat.byte_rx += len;

actually you even don't need len, just use skb->len

> +
> +	return 0;
> +}
> +
> +/* ------- Interfaces to HCI layer ------ */
> +
> +/* Called from HCI core to initialize the device */
> +static int hci_st_open(struct hci_dev *hdev)
> +{
> +	static struct st_proto_s hci_st_proto;
> +	unsigned long timeleft;
> +	struct hci_st *hst;
> +	int err;
> +	err = 0;
> +
> +	BT_DBG("%s %p", hdev->name, hdev);
> +	hst = hdev->driver_data;
> +
> +	/* Populate BT driver info required by ST */
> +	memset(&hci_st_proto, 0, sizeof(hci_st_proto));
> +
> +	/* BT driver ID */
> +	hci_st_proto.type = ST_BT;
> +
> +	/* Receive function which called from ST */
> +	hci_st_proto.recv = hci_st_receive;
> +
> +	/* Packet match function may used in future */
> +	hci_st_proto.match_packet = NULL;

It is already NULL, you dua a memset.

> +
> +	/* Callback to be called when registration is pending */
> +	hci_st_proto.reg_complete_cb = hci_st_registration_completion_cb;
> +
> +	/* This is write function pointer of ST. BT driver will make use of this
> +	 * for sending any packets to chip. ST will assign and give to us, so
> +	 * make it as NULL */
> +	hci_st_proto.write = NULL;

Same here.

> +
> +	/* send in the hst to be received at registration complete callback
> +	 * and during st's receive
> +	 */
> +	hci_st_proto.priv_data = hst;
> +
> +	/* Register with ST layer */
> +	err = st_register(&hci_st_proto);
> +	if (err == -EINPROGRESS) {
> +		/* Prepare wait-for-completion handler data structures.
> +		 * Needed to syncronize this and st_registration_completion_cb()
> +		 * functions.
> +		 */
> +		init_completion(&hst->wait_for_btdrv_reg_completion);

I'm not liking that, but I'll leave for Marcel and others comment.

> +
> +		/* Reset ST registration callback status flag , this value
> +		 * will be updated in hci_st_registration_completion_cb()
> +		 * function whenever it called from ST driver.
> +		 */
> +		hst->streg_cbdata = -EINPROGRESS;
> +
> +		/* ST is busy with other protocol registration(may be busy with
> +		 * firmware download).So,Wait till the registration callback
> +		 * (passed as a argument to st_register() function) getting
> +		 * called from ST.
> +		 */
> +		BT_DBG(" %s waiting for reg completion signal from ST",
> +				__func__);
> +
> +		timeleft =
> +			wait_for_completion_timeout
> +			(&hst->wait_for_btdrv_reg_completion,
> +			 msecs_to_jiffies(BT_REGISTER_TIMEOUT));
> +		if (!timeleft) {
> +			BT_ERR("Timeout(%d sec),didn't get reg"
> +					"completion signal from ST",
> +					BT_REGISTER_TIMEOUT / 1000);
> +			return -ETIMEDOUT;
> +		}
> +
> +		/* Is ST registration callback called with ERROR value? */
> +		if (hst->streg_cbdata != 0) {
> +			BT_ERR("ST reg completion CB called with invalid"
> +					"status %d", hst->streg_cbdata);
> +			return -EAGAIN;
> +		}
> +		err = 0;
> +	} else if (err == -1) {

Use the proper error macro instead "-1" 

> +		BT_ERR("st_register failed %d", err);
> +		return -EAGAIN;
> +	}
> +
> +	/* Do we have proper ST write function? */
> +	if (hci_st_proto.write != NULL) {
> +		/* We need this pointer for sending any Bluetooth pkts */
> +		hst->st_write = hci_st_proto.write;
> +	} else {
> +		BT_ERR("failed to get ST write func pointer");
> +
> +		/* Undo registration with ST */
> +		err = st_unregister(ST_BT);
> +		if (err < 0)
> +			BT_ERR("st_unregister failed %d", err);
> +
> +		hst->st_write = NULL;
> +		return -EAGAIN;
> +	}
> +
> +	/* Registration with ST layer is completed successfully,
> +	 * now chip is ready to accept commands from HCI CORE.
> +	 * Mark HCI Device flag as RUNNING
> +	 */
> +	set_bit(HCI_RUNNING, &hdev->flags);
> +
> +	/* Registration with ST successful */
> +	set_bit(BT_ST_REGISTERED, &hst->flags);
> +
> +	return err;
> +}
> +
> +/* Close device */
> +static int hci_st_close(struct hci_dev *hdev)
> +{
> +	int err;
> +	struct hci_st *hst;

Skip a line after declarations.

> +	err = 0;

you can set err to 0 in the declaration if you really need that.

> +
> +	hst = hdev->driver_data;
> +	/* Unregister from ST layer */
> +	if (test_and_clear_bit(BT_ST_REGISTERED, &hst->flags)) {
> +		err = st_unregister(ST_BT);
> +		if (err != 0) {
> +			BT_ERR("st_unregister failed %d", err);
> +			return -EBUSY;
> +		}
> +	}
> +
> +	hst->st_write = NULL;
> +
> +	/* ST layer would have moved chip to inactive state.
> +	 * So,clear HCI device RUNNING flag.
> +	 */
> +	if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags))
> +		return 0;

Looks you are screwing up the flags here, if it fails on st_unregister()
and returns HCI_RUNNING should keep set?

> +
> +	return err;

Rethink how you are doing error handling here, it should no be
complicated like that.

> +}
> +
> +/* Called from HCI CORE , Sends frames to Shared Transport */
> +static int hci_st_send_frame(struct sk_buff *skb)
> +{
> +	struct hci_dev *hdev;
> +	struct hci_st *hst;
> +	long len;
> +
> +	if (skb == NULL) {
> +		BT_ERR("Invalid skb received from HCI CORE");
> +		return -ENOMEM;
> +	}
> +	hdev = (struct hci_dev *)skb->dev;
> +	if (!hdev) {
> +		BT_ERR("SKB received for invalid HCI Device (hdev=NULL)");
> +		return -ENODEV;
> +	}
> +	if (!test_bit(HCI_RUNNING, &hdev->flags)) {
> +		BT_ERR("Device is not running");
> +		return -EBUSY;
> +	}
> +
> +	hst = (struct hci_st *)hdev->driver_data;
> +
> +	/* Prepend skb with frame type */
> +	memcpy(skb_push(skb, 1), &bt_cb(skb)->pkt_type, 1);
> +
> +	BT_DBG(" %s: type %d len %d", hdev->name, bt_cb(skb)->pkt_type,
> +			skb->len);
> +
> +	/* Insert skb to shared transport layer's transmit queue.
> +	 * Freeing skb memory is taken care in shared transport layer,
> +	 * so don't free skb memory here.
> +	 */
> +	if (!hst->st_write) {
> +		kfree_skb(skb);
> +		BT_ERR(" Can't write to ST, st_write null?");
> +		return -EAGAIN;
> +	}
> +	len = hst->st_write(skb);
> +	if (len < 0) {
> +		/* Something went wrong in st write , free skb memory */

IMHO we don't need comments like that, clearly we now that something
went wrong.

> +		kfree_skb(skb);
> +		BT_ERR(" ST write failed (%ld)", len);
> +		return -EAGAIN;
> +	}
> +
> +	/* ST accepted our skb. So, Go ahead and do rest */
> +	hdev->stat.byte_tx += len;
> +	hci_st_tx_complete(hst, bt_cb(skb)->pkt_type);
> +
> +	return 0;

goto might be better to handle error here.


-- 
Gustavo F. Padovan
ProFUSION embedded systems - http://profusion.mobi

^ permalink raw reply

* Re: [PATCH 3/4] mfd/mc13xxx: add support for mc13892
From: Uwe Kleine-König @ 2010-10-07 18:45 UTC (permalink / raw)
  To: Samuel Ortiz, David Jander; +Cc: linux-kernel
In-Reply-To: <1285777427-2887-3-git-send-email-u.kleine-koenig@pengutronix.de>

Hi Samuel,

On Wed, Sep 29, 2010 at 06:23:46PM +0200, Uwe Kleine-König wrote:
> mc13892 is the companion PMIC for Freescale's i.MX51.  It's similar enough
> to mc13782 to support it in a single driver.
> 
> This patch introduces enough compatibility cruft to keep all users of the
> superseded mc13783 driver unchanged.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/mfd/Kconfig         |    9 +-
>  drivers/mfd/Makefile        |    2 +-
>  drivers/mfd/mc13783-core.c  |  743 --------------------------------------
>  drivers/mfd/mc13xxx-core.c  |  840 +++++++++++++++++++++++++++++++++++++++++++
>  include/linux/mfd/mc13783.h |  247 ++++++-------
>  include/linux/mfd/mc13xxx.h |  154 ++++++++
>  6 files changed, 1113 insertions(+), 882 deletions(-)
>  delete mode 100644 drivers/mfd/mc13783-core.c
>  create mode 100644 drivers/mfd/mc13xxx-core.c
>  create mode 100644 include/linux/mfd/mc13xxx.h
> 
> [...]
> diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c
> new file mode 100644
> index 0000000..93258ad
> --- /dev/null
> +++ b/drivers/mfd/mc13xxx-core.c
> @@ -0,0 +1,840 @@
> +/*
> + * Copyright 2009-2010 Pengutronix
> + * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de>
> + *
> + * loosely based on an earlier driver that has
> + * Copyright 2009 Pengutronix, Sascha Hauer <s.hauer@pengutronix.de>
> + *
> + * This program is free software; you can redistribute it and/or modify it under
> + * the terms of the GNU General Public License version 2 as published by the
> + * Free Software Foundation.
> + */
> +#define DEBUG
> +#define VERBOSE_DEBUG
David Jander gave me a hint via private mail that I forgot to remove
these two #defines.
Would you care to remove these before Linus pulls?  Should I send a
patch or do you do it by hand?

Thanks to both of you,
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply

* Re: [PATCH v6 03/12] Retry fault before vmentry
From: Gleb Natapov @ 2010-10-07 18:44 UTC (permalink / raw)
  To: Marcelo Tosatti
  Cc: kvm, linux-mm, linux-kernel, avi, mingo, a.p.zijlstra, tglx, hpa,
	riel, cl
In-Reply-To: <20101006142050.GA31423@amt.cnet>

On Wed, Oct 06, 2010 at 11:20:50AM -0300, Marcelo Tosatti wrote:
> On Wed, Oct 06, 2010 at 01:07:04PM +0200, Gleb Natapov wrote:
> > > Can't you set a bit in vcpu->requests instead, and handle it in "out:"
> > > at the end of vcpu_enter_guest? 
> > > 
> > > To have a single entry point for pagefaults, after vmexit handling.
> > Jumping to "out:" will skip vmexit handling anyway, so we will not reuse
> > same call site anyway. I don't see yet why the way you propose will have
> > an advantage.
> 
> What i meant was to call pagefault handler after vmexit handling.
> 
> Because the way it is in your patch now, with pre pagefault on entry,
> one has to make an effort to verify ordering wrt other events on entry
> processing.
> 
What events do you have in mind?

> With pre pagefault after vmexit, its more natural.
> 
I do not see non-ugly way to pass information that is needed to perform
the prefault to the place you want me to put it. We can skip guest entry
in case prefault was done which will have the same effect as your
proposal, but I want to have a good reason to do so since otherwise we
will just do more work for nothing on guest entry.

> Does that make sense?

--
			Gleb.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply

* Re: [PATCH V2] Use firmware provided index to register a network
From: Narendra_K @ 2010-10-07 18:44 UTC (permalink / raw)
  To: kay.sievers
  Cc: greg, Matt_Domsch, netdev, linux-hotplug, linux-pci,
	Jordan_Hargrave, Vijay_Nijhawan, Charles_Rose
In-Reply-To: <AANLkTinP5WPDPvk+kq8vsyP=xC9qcoe+c=1EBp0XJNPk@mail.gmail.com>

On Thu, Oct 07, 2010 at 10:35:14PM +0530, Kay Sievers wrote:
>    On Thu, Oct 7, 2010 at 18:48, Greg KH <greg@kroah.com> wrote:
>    > On Thu, Oct 07, 2010 at 11:31:13AM -0500, Matt Domsch wrote:
>    >> 1) SMBIOS type 41 method.  Windows does not use this today, and I
>    >>    can't speak to their future plans.  Narendra's kernel patch does,
>    >>    as has biosdevname, the udev helper we first wrote for this
>    >>    purpose, for several years.
>    >
>    > Then stick with that udev helper please :)
> 
>    What about just exporting this information in sysfs, and not touch the
>    naming?
> 
>    Anyway, I'm pretty sure all of this naming of onboard devices should
>    happen only at install time, or from a system management tool and not
>    at hotplug time.
> 
>    We should not get confused by the way the (very simple)
>    automatic-rule-creater for persistent netdev naming in udev works.
>    This is really just a tool for the common case, and works fine for the
>    majority of people.

Right. It works as the automatic rule creator saves the snapshot of the
registered network interfaces at run time. 

> 
>    I'm not sure, if we should put all these special use cases in the
>    hotplug path. I mean it's not that people add and remove 4 port
>    network cards with special BIOS all the time, and expect proper naming
>    on the first bootup, right? The installer, or the system management
>    tool could just create/edit udev rules to provide proper device naming
>    on whatever property is available at a specific hardware, be it the
>    MAC address or some other persistent match?
> 

The proposal made is not expecting deterministic naming when an add-in
card with 'N' ports is plugged in/out. It is specific to onboard devices
only. Expectation is onboard devices have deterministic naming at first
bootup. And no special BIOS required as SMBIOS tables are in use for
sometime now.

I did explore using rules based on the exported attribute ATTRS{index}
on a system with 4 Onboard devices and two add-in devices.(where add-in
device becomes eth0 and eth1)

# PCI device 0x14e4:0x164c (bnx2) (custom name provided by external
# tool) SUBSYSTEM="net", ACTION="add", DRIVERS="?*",
# ATTRS{index}="1", ATTR{type}="1", KERNEL="eth*", NAME="eth0"

(and similary for eth1..eth3)

And for add-in devices.

# PCI device 0x8086:0x10c9 (igb) (custom name provided by external tool)
# SUBSYSTEM="net", ACTION="add", DRIVERS="?*",
# ATTR{address}="00:1b:21:54:33:3c", ATTR{type}="1", KERNEL="eth*",
# NAME="eth4" (and similar for eth5 as they do not have an index)

This works as i edited the file manually.

If this has to be done on a large number of systems where an image
based deployment is preferred, getting onboard device names as expected
is an issue and is important.

-- 
With regards,
Narendra K

^ permalink raw reply

* Re: [Qemu-devel] [PATCH] ceph/rbd block driver for qemu-kvm (v4)
From: Anthony Liguori @ 2010-10-07 18:38 UTC (permalink / raw)
  To: Yehuda Sadeh Weinraub
  Cc: Kevin Wolf, kvm, qemu-devel, ceph-devel, Christian Brunner
In-Reply-To: <AANLkTikuNq1ApT+2ML6s6NXXpTZaedgJDG1xq_=oBQPK@mail.gmail.com>

On 10/07/2010 01:08 PM, Yehuda Sadeh Weinraub wrote:
> On Thu, Oct 7, 2010 at 7:12 AM, Anthony Liguori<anthony@codemonkey.ws>  wrote:
>    
>> On 08/03/2010 03:14 PM, Christian Brunner wrote:
>>      
>>> +#include "qemu-common.h"
>>> +#include "qemu-error.h"
>>> +#include<sys/types.h>
>>> +#include<stdbool.h>
>>> +
>>> +#include<qemu-common.h>
>>>
>>>        
>> This looks to be unnecessary.  Generally, system includes shouldn't be
>> required so all of these should go away except rado/librados.h
>>      
> Removed.
>
>    
>>      
>>> +
>>> +#include "rbd_types.h"
>>> +#include "module.h"
>>> +#include "block_int.h"
>>> +
>>> +#include<stdio.h>
>>> +#include<stdlib.h>
>>> +#include<rados/librados.h>
>>> +
>>> +#include<signal.h>
>>> +
>>> +
>>> +int eventfd(unsigned int initval, int flags);
>>>
>>>        
>> This is not quite right.  Depending on eventfd is curious but in the very
>> least, you need to detect the presence of eventfd in configure and provide a
>> wrapper that redefines it as necessary.
>>      
> Can fix that, though please see my later remarks.
>    
>>> +static int create_tmap_op(uint8_t op, const char *name, char **tmap_desc)
>>> +{
>>> +    uint32_t len = strlen(name);
>>> +    /* total_len = encoding op + name + empty buffer */
>>> +    uint32_t total_len = 1 + (sizeof(uint32_t) + len) + sizeof(uint32_t);
>>> +    char *desc = NULL;
>>>
>>>        
>> char is the wrong type to use here as it may be signed or unsigned.  That
>> can have weird effects with binary data when you're directly manipulating
>> it.
>>      
> Well, I can change it to uint8_t, so that it matches the op type, but
> that'll require adding some other castings. In any case, you usually
> get such a weird behavior when you cast to types of different sizes
> and have the sign bit padded which is not the case in here.
>
>    
>>      
>>> +
>>> +    desc = qemu_malloc(total_len);
>>> +
>>> +    *tmap_desc = desc;
>>> +
>>> +    *desc = op;
>>> +    desc++;
>>> +    memcpy(desc,&len, sizeof(len));
>>> +    desc += sizeof(len);
>>> +    memcpy(desc, name, len);
>>> +    desc += len;
>>> +    len = 0;
>>> +    memcpy(desc,&len, sizeof(len));
>>> +    desc += sizeof(len);
>>>
>>>        
>> Shouldn't endianness be a concern?
>>      
> Right. Fixed that.
>
>    
>>      
>>> +
>>> +    return desc - *tmap_desc;
>>> +}
>>> +
>>> +static void free_tmap_op(char *tmap_desc)
>>> +{
>>> +    qemu_free(tmap_desc);
>>> +}
>>> +
>>> +static int rbd_register_image(rados_pool_t pool, const char *name)
>>> +{
>>> +    char *tmap_desc;
>>> +    const char *dir = RBD_DIRECTORY;
>>> +    int ret;
>>> +
>>> +    ret = create_tmap_op(CEPH_OSD_TMAP_SET, name,&tmap_desc);
>>> +    if (ret<    0) {
>>> +        return ret;
>>> +    }
>>> +
>>> +    ret = rados_tmap_update(pool, dir, tmap_desc, ret);
>>> +    free_tmap_op(tmap_desc);
>>> +
>>> +    return ret;
>>> +}
>>>
>>>        
>> This ops are all synchronous?  IOW, rados_tmap_update() call blocks until
>> the operation is completed?
>>      
> Yeah. And this is only called from the rbd_create() callback.
>
>    
>>> +            header_snap += strlen(header_snap) + 1;
>>> +            if (header_snap>    end)
>>> +                error_report("bad header, snapshot list broken");
>>>
>>>        
>> Missing curly braces here.
>>      
> Fixed.
>
>    
>>> +    if (strncmp(hbuf + 68, RBD_HEADER_VERSION, 8)) {
>>> +        error_report("Unknown image version %s", hbuf + 68);
>>> +        r = -EMEDIUMTYPE;
>>> +        goto failed;
>>> +    }
>>> +
>>> +    RbdHeader1 *header;
>>>
>>>
>>>        
>> Don't mix variable definitions with code.
>>      
> Fixed.
>
>    
>>> +    s->efd = eventfd(0, 0);
>>> +    if (s->efd<    0) {
>>> +        error_report("error opening eventfd");
>>> +        goto failed;
>>> +    }
>>> +    fcntl(s->efd, F_SETFL, O_NONBLOCK);
>>> +    qemu_aio_set_fd_handler(s->efd, rbd_aio_completion_cb, NULL,
>>> +        rbd_aio_flush_cb, NULL, s);
>>>
>>>        
>> It looks like you just use the eventfd to signal aio completion callbacks.
>>   A better way to do this would be to schedule a bottom half.  eventfds are
>> Linux specific and specific to recent kernels.
>>      
> Digging back why we introduced the eventfd, it was due to some issues
> seen with do_savevm() hangs on qemu_aio_flush(). The reason seemed
> that we had no fd associated with the block device, which seemed to
> not work well with the qemu aio model. If that assumption is wrong,
> we'd be happy to change it. In any case, there are other more portable
> ways to generate fds, so if it's needed we can do that.
>    

There's no fd at all?   How do you get notifications about an 
asynchronous event completion?

Regards,

Anthony Liguori

^ permalink raw reply

* [PATCH] iovmm: IVA2 MMU range is from 0x11000000 to 0xFFFFFFFF
From: Fernando Guzman Lugo @ 2010-10-07 18:43 UTC (permalink / raw)
  To: Hiroshi.DOYU
  Cc: felipe.contreras, ameya.palande, david.cohen, linux-kernel,
	andy.shevchenko, linux-omap, Fernando Guzman Lugo

IV2 MMU capable addresses start from 0x11000000

Signed-off-by: Fernando Guzman Lugo <x0095840@ti.com>
---
 arch/arm/plat-omap/iovmm.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/iovmm.c b/arch/arm/plat-omap/iovmm.c
index 75965a1..c0344f4 100644
--- a/arch/arm/plat-omap/iovmm.c
+++ b/arch/arm/plat-omap/iovmm.c
@@ -286,7 +286,12 @@ static struct iovm_struct *alloc_iovm_area(struct iommu *obj, u32 da,
 		/*
 		 * Reserve the first page for NULL
 		 */
-		start = PAGE_SIZE;
+		if (!strcmp(obj->name, "iva2"))
+			/* IVA2 MMU control starts from 0x11000000 */
+			start = 0x11000000;
+		else
+			start = PAGE_SIZE;
+
 		if (flags & IOVMF_LINEAR)
 			alignement = iopgsz_max(bytes);
 		start = roundup(start, alignement);
-- 
1.6.3.3

^ permalink raw reply related

* Re: memory clobber in rx path, maybe related to ath9k.
From: Luis R. Rodriguez @ 2010-10-07 18:42 UTC (permalink / raw)
  To: Ben Greear; +Cc: Johannes Berg, linux-wireless@vger.kernel.org
In-Reply-To: <4CAE13F6.2010003@candelatech.com>

On Thu, Oct 7, 2010 at 11:39 AM, Ben Greear <greearb@candelatech.com> wrote:
> On 10/07/2010 11:29 AM, Luis R. Rodriguez wrote:
>>
>> On Thu, Oct 7, 2010 at 11:14 AM, Johannes Berg
>> <johannes@sipsolutions.net>  wrote:
>>>
>>> On Thu, 2010-10-07 at 10:33 -0700, Ben Greear wrote:
>>>>
>>>> In case it helps, here is a dump of where the corrupted SKB was deleted.
>>>
>>> I wonder, do you have a machine with a decent IOMMU? Adding IOMMU
>>> debugging into the mix could help you figure out if it's a DMA problem.
>>
>> Ben, how much traffic are you RX'ing on these virtual interfaces?
>
> I disabled my user-space application, and this script alone can reproduce
> the problem fairly quickly on my system.  You will need to change some
> of those first variables.  Just start it and wait a few minutes and
> watch the splats show on the console :)
>
> Note that I am not generating any traffic, but the wpa_supplicants are
> doing their thing of course...
>
> I'm using the kernel found here:
> http://dmz2.candelatech.com/git/gitweb.cgi?p=linux.wireless-testing.ct/.git;a=summary
>
> It's latest wireless-testing with some of my own patches, and some
> I've gathered from here an there.  I doubt I'm causing this problem,
> but if you can't reproduce it with this script on your kernels,
> I can try with base wireless-testing or whatever you are using.

I'll run this now, but can you try a vanilla wireless-testing? I hear
the latest wireless-testing is borked so maybe try (git reset --hard
master-2010-09-29), its what I'm on.

  Luis

^ permalink raw reply

* Re: [PATCH 3/3] pnfs_submit: enforce requested DS only pNFS role
From: Benny Halevy @ 2010-10-07 18:41 UTC (permalink / raw)
  To: andros; +Cc: linux-nfs, Fred Isaman
In-Reply-To: <4CAE0C8B.5060204@panasas.com>

On 2010-10-07 14:08, Benny Halevy wrote:
> On 2010-10-07 13:06, Benny Halevy wrote:
>> On 2010-10-07 15:37, andros@netapp.com wrote:
>>> From: Andy Adamson <andros@netapp.com>
>>>
>>> Signed-off-by: Andy Adamson <andros@netapp.com>
>>> ---
>>>  fs/nfs/nfs4filelayoutdev.c |    5 -----
>>>  fs/nfs/nfs4state.c         |    5 +++++
>>>  2 files changed, 5 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/fs/nfs/nfs4filelayoutdev.c b/fs/nfs/nfs4filelayoutdev.c
>>> index e0edf93..1f0ab62 100644
>>> --- a/fs/nfs/nfs4filelayoutdev.c
>>> +++ b/fs/nfs/nfs4filelayoutdev.c
>>> @@ -183,11 +183,6 @@ nfs4_pnfs_ds_create(struct nfs_server *mds_srv, struct nfs4_pnfs_ds *ds)
>>>  		goto out_put;
>>>  	}
>>>  	/*
>>> -	 * Mask the (possibly) returned EXCHGID4_FLAG_USE_PNFS_MDS pNFS role
>>> -	 * The is_ds_only_session depends on this.
>>> -	 */
>>> -	clp->cl_exchange_flags &= ~EXCHGID4_FLAG_USE_PNFS_MDS;
>>> -	/*
>>>  	 * Set DS lease equal to the MDS lease, renewal is scheduled in
>>>  	 * create_session
>>>  	 */
>>> diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
>>> index 91584ad..e2fc175 100644
>>> --- a/fs/nfs/nfs4state.c
>>> +++ b/fs/nfs/nfs4state.c
>>> @@ -188,6 +188,7 @@ static int nfs4_begin_drain_session(struct nfs_client *clp)
>>>  int nfs41_init_clientid(struct nfs_client *clp, struct rpc_cred *cred)
>>>  {
>>>  	int status;
>>> +	u32 req_exchange_flags = clp->cl_exchange_flags;
>>>  
>>>  	nfs4_begin_drain_session(clp);
>>>  	status = nfs4_proc_exchange_id(clp, cred);
>>> @@ -196,6 +197,10 @@ int nfs41_init_clientid(struct nfs_client *clp, struct rpc_cred *cred)
>>>  	status = nfs4_proc_create_session(clp);
>>>  	if (status != 0)
>>>  		goto out;
>>> +	if (is_ds_only_session(req_exchange_flags))
>>> +		/* Mask the (possibly) returned MDS and non-pNFS roles */
>>
>> This comment does not really add anything substantial that the code doesn't tell you :)
>>
>>> +		clp->cl_exchange_flags &=
>>> +		     ~(EXCHGID4_FLAG_USE_PNFS_MDS | EXCHGID4_FLAG_USE_NON_PNFS);
>>
>> I'm not why you want to mask out EXCHGID4_FLAG_USE_NON_PNFS.
>> If the server is not a DS why not just return an error?
> 
> So Andy convinced me and the spec. says that USE_PNFS_DS | USE_NON_PNFS
> is a valid response.
> However, if USE_PNFS_DS is unset in the response in this case
> we need not create the client and better return an error.
> I'll send a patch that does that.

So this is what I have in mind:

diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index e2fc175..4723c41 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -197,10 +197,14 @@ int nfs41_init_clientid(struct nfs_client *clp, struct rpc_cred *cred)
 	status = nfs4_proc_create_session(clp);
 	if (status != 0)
 		goto out;
-	if (is_ds_only_session(req_exchange_flags))
-		/* Mask the (possibly) returned MDS and non-pNFS roles */
+	if (is_ds_only_session(req_exchange_flags)) {
 		clp->cl_exchange_flags &=
 		     ~(EXCHGID4_FLAG_USE_PNFS_MDS | EXCHGID4_FLAG_USE_NON_PNFS);
+		if (!is_ds_only_session(clp->cl_exchange_flags)) {
+			nfs4_proc_destroy_session(clp);
+			status = -ENOTSUPP;
+		}
+	}
 	nfs41_setup_state_renewal(clp);
 	nfs_mark_client_ready(clp, NFS_CS_READY);
 out:

> 
> Benny
> 
>>
>> Benny
>>
>>>  	nfs41_setup_state_renewal(clp);
>>>  	nfs_mark_client_ready(clp, NFS_CS_READY);
>>>  out:
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


-- 
Benny Halevy
Software Architect
Panasas, Inc.
bhalevy@panasas.com
Tel/Fax: +972-3-647-8340
Mobile: +972-54-802-8340

Panasas: The Leader in Parallel Storage
www.panasas.com

^ permalink raw reply related

* Re: [Qemu-devel] [PATCH] ceph/rbd block driver for qemu-kvm (v4)
From: Yehuda Sadeh Weinraub @ 2010-10-07 18:41 UTC (permalink / raw)
  To: Anthony Liguori
  Cc: Christian Brunner, malc, kvm, qemu-devel, Kevin Wolf, ceph-devel
In-Reply-To: <4CAE13BA.70707@codemonkey.ws>

On Thu, Oct 7, 2010 at 11:38 AM, Anthony Liguori <anthony@codemonkey.ws> wrote:
> On 10/07/2010 01:08 PM, Yehuda Sadeh Weinraub wrote:
>>
>> On Thu, Oct 7, 2010 at 7:12 AM, Anthony Liguori<anthony@codemonkey.ws>
>>  wrote:
>>
>>>
>>> On 08/03/2010 03:14 PM, Christian Brunner wrote:
>>>
>>>>
>>>> +#include "qemu-common.h"
>>>> +#include "qemu-error.h"
>>>> +#include<sys/types.h>
>>>> +#include<stdbool.h>
>>>> +
>>>> +#include<qemu-common.h>
>>>>
>>>>
>>>
>>> This looks to be unnecessary.  Generally, system includes shouldn't be
>>> required so all of these should go away except rado/librados.h
>>>
>>
>> Removed.
>>
>>
>>>
>>>
>>>>
>>>> +
>>>> +#include "rbd_types.h"
>>>> +#include "module.h"
>>>> +#include "block_int.h"
>>>> +
>>>> +#include<stdio.h>
>>>> +#include<stdlib.h>
>>>> +#include<rados/librados.h>
>>>> +
>>>> +#include<signal.h>
>>>> +
>>>> +
>>>> +int eventfd(unsigned int initval, int flags);
>>>>
>>>>
>>>
>>> This is not quite right.  Depending on eventfd is curious but in the very
>>> least, you need to detect the presence of eventfd in configure and
>>> provide a
>>> wrapper that redefines it as necessary.
>>>
>>
>> Can fix that, though please see my later remarks.
>>
>>>>
>>>> +static int create_tmap_op(uint8_t op, const char *name, char
>>>> **tmap_desc)
>>>> +{
>>>> +    uint32_t len = strlen(name);
>>>> +    /* total_len = encoding op + name + empty buffer */
>>>> +    uint32_t total_len = 1 + (sizeof(uint32_t) + len) +
>>>> sizeof(uint32_t);
>>>> +    char *desc = NULL;
>>>>
>>>>
>>>
>>> char is the wrong type to use here as it may be signed or unsigned.  That
>>> can have weird effects with binary data when you're directly manipulating
>>> it.
>>>
>>
>> Well, I can change it to uint8_t, so that it matches the op type, but
>> that'll require adding some other castings. In any case, you usually
>> get such a weird behavior when you cast to types of different sizes
>> and have the sign bit padded which is not the case in here.
>>
>>
>>>
>>>
>>>>
>>>> +
>>>> +    desc = qemu_malloc(total_len);
>>>> +
>>>> +    *tmap_desc = desc;
>>>> +
>>>> +    *desc = op;
>>>> +    desc++;
>>>> +    memcpy(desc,&len, sizeof(len));
>>>> +    desc += sizeof(len);
>>>> +    memcpy(desc, name, len);
>>>> +    desc += len;
>>>> +    len = 0;
>>>> +    memcpy(desc,&len, sizeof(len));
>>>> +    desc += sizeof(len);
>>>>
>>>>
>>>
>>> Shouldn't endianness be a concern?
>>>
>>
>> Right. Fixed that.
>>
>>
>>>
>>>
>>>>
>>>> +
>>>> +    return desc - *tmap_desc;
>>>> +}
>>>> +
>>>> +static void free_tmap_op(char *tmap_desc)
>>>> +{
>>>> +    qemu_free(tmap_desc);
>>>> +}
>>>> +
>>>> +static int rbd_register_image(rados_pool_t pool, const char *name)
>>>> +{
>>>> +    char *tmap_desc;
>>>> +    const char *dir = RBD_DIRECTORY;
>>>> +    int ret;
>>>> +
>>>> +    ret = create_tmap_op(CEPH_OSD_TMAP_SET, name,&tmap_desc);
>>>> +    if (ret<    0) {
>>>> +        return ret;
>>>> +    }
>>>> +
>>>> +    ret = rados_tmap_update(pool, dir, tmap_desc, ret);
>>>> +    free_tmap_op(tmap_desc);
>>>> +
>>>> +    return ret;
>>>> +}
>>>>
>>>>
>>>
>>> This ops are all synchronous?  IOW, rados_tmap_update() call blocks until
>>> the operation is completed?
>>>
>>
>> Yeah. And this is only called from the rbd_create() callback.
>>
>>
>>>>
>>>> +            header_snap += strlen(header_snap) + 1;
>>>> +            if (header_snap>    end)
>>>> +                error_report("bad header, snapshot list broken");
>>>>
>>>>
>>>
>>> Missing curly braces here.
>>>
>>
>> Fixed.
>>
>>
>>>>
>>>> +    if (strncmp(hbuf + 68, RBD_HEADER_VERSION, 8)) {
>>>> +        error_report("Unknown image version %s", hbuf + 68);
>>>> +        r = -EMEDIUMTYPE;
>>>> +        goto failed;
>>>> +    }
>>>> +
>>>> +    RbdHeader1 *header;
>>>>
>>>>
>>>>
>>>
>>> Don't mix variable definitions with code.
>>>
>>
>> Fixed.
>>
>>
>>>>
>>>> +    s->efd = eventfd(0, 0);
>>>> +    if (s->efd<    0) {
>>>> +        error_report("error opening eventfd");
>>>> +        goto failed;
>>>> +    }
>>>> +    fcntl(s->efd, F_SETFL, O_NONBLOCK);
>>>> +    qemu_aio_set_fd_handler(s->efd, rbd_aio_completion_cb, NULL,
>>>> +        rbd_aio_flush_cb, NULL, s);
>>>>
>>>>
>>>
>>> It looks like you just use the eventfd to signal aio completion
>>> callbacks.
>>>  A better way to do this would be to schedule a bottom half.  eventfds
>>> are
>>> Linux specific and specific to recent kernels.
>>>
>>
>> Digging back why we introduced the eventfd, it was due to some issues
>> seen with do_savevm() hangs on qemu_aio_flush(). The reason seemed
>> that we had no fd associated with the block device, which seemed to
>> not work well with the qemu aio model. If that assumption is wrong,
>> we'd be happy to change it. In any case, there are other more portable
>> ways to generate fds, so if it's needed we can do that.
>>
>
> There's no fd at all?   How do you get notifications about an asynchronous
> event completion?
>
> Regards,
>
> Anthony Liguori
>
(resending to list, sorry)

The fd is hidden deep under in librados. We get callback notifications
for events completion.

Thanks,
Yehuda
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* fallocate() on XFS clobbers S*ID-bits
From: Andreas Wiese @ 2010-10-07 18:34 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Ciaran McCreesh

Hello.

I (with support from Cc'ed Ciaran) just noticed some odd behaviour with
fallocate() on XFS.  After open()ing some file and setting it S*ID via
fchmod(), S*ID bits vanish after calling fallocate() — as supposed to
for non-root users, but it also happens for root.

Is this intended behaviour or did we spot a bug here?

At least on ext2 it works as expected, thus I guess it's the latter one.

I'm running v2.6.35.7 vanilla-kernel, but diffing fs/xfs to master
doesn't seem to address this issue.

HAND & LG -- aw
-- 
This signature is intentionally left blank.

^ permalink raw reply

* [PATCH 1/1] staging: hv: Rename camel cased functions in channel.c to lowercase
From: Hank Janssen @ 2010-10-07 18:40 UTC (permalink / raw)
  To: gregkh, hjanssen, Haiyang Zhang, devel, virtualization,
	linux-kernel

From: Haiyang Zhang <haiyangz@microsoft.com>

Rename camel cased functions in channel.c to lowercase

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Hank Janssen <hjanssen@microsoft.com>

---
 drivers/staging/hv/channel.c           |  102 ++++++++++++++++----------------
 drivers/staging/hv/channel.h           |   94 +++++++++++++++---------------
 drivers/staging/hv/channel_interface.c |   20 +++---
 drivers/staging/hv/channel_mgmt.c      |    8 +-
 drivers/staging/hv/connection.c        |    4 +-
 drivers/staging/hv/hv_utils.c          |   12 ++--
 6 files changed, 120 insertions(+), 120 deletions(-)

diff --git a/drivers/staging/hv/channel.c b/drivers/staging/hv/channel.c
index 1037488..39b8fd3 100644
--- a/drivers/staging/hv/channel.c
+++ b/drivers/staging/hv/channel.c
@@ -27,13 +27,13 @@
 #include "vmbus_private.h"
 
 /* Internal routines */
-static int VmbusChannelCreateGpadlHeader(
+static int create_gpadl_header(
 	void *kbuffer,	/* must be phys and virt contiguous */
 	u32 size,	/* page-size multiple */
 	struct vmbus_channel_msginfo **msginfo,
 	u32 *messagecount);
-static void DumpVmbusChannel(struct vmbus_channel *channel);
-static void VmbusChannelSetEvent(struct vmbus_channel *channel);
+static void dump_vmbus_channel(struct vmbus_channel *channel);
+static void vmbus_setevent(struct vmbus_channel *channel);
 
 
 #if 0
@@ -67,10 +67,10 @@ static void DumpMonitorPage(struct hv_monitor_page *MonitorPage)
 #endif
 
 /*
- * VmbusChannelSetEvent - Trigger an event notification on the specified
+ * vmbus_setevent- Trigger an event notification on the specified
  * channel.
  */
-static void VmbusChannelSetEvent(struct vmbus_channel *channel)
+static void vmbus_setevent(struct vmbus_channel *channel)
 {
 	struct hv_monitor_page *monitorpage;
 
@@ -115,9 +115,9 @@ static void VmbusChannelClearEvent(struct vmbus_channel *channel)
 
 #endif
 /*
- * VmbusChannelGetDebugInfo -Retrieve various channel debug info
+ * vmbus_get_debug_info -Retrieve various channel debug info
  */
-void VmbusChannelGetDebugInfo(struct vmbus_channel *channel,
+void vmbus_get_debug_info(struct vmbus_channel *channel,
 			      struct vmbus_channel_debug_info *debuginfo)
 {
 	struct hv_monitor_page *monitorpage;
@@ -160,9 +160,9 @@ void VmbusChannelGetDebugInfo(struct vmbus_channel *channel,
 }
 
 /*
- * VmbusChannelOpen - Open the specified channel.
+ * vmbus_open - Open the specified channel.
  */
-int VmbusChannelOpen(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
+int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
 		     u32 recv_ringbuffer_size, void *userdata, u32 userdatalen,
 		     void (*onchannelcallback)(void *context), void *context)
 {
@@ -212,7 +212,7 @@ int VmbusChannelOpen(struct vmbus_channel *newchannel, u32 send_ringbuffer_size,
 
 	newchannel->RingBufferGpadlHandle = 0;
 
-	ret = VmbusChannelEstablishGpadl(newchannel,
+	ret = vmbus_establish_gpadl(newchannel,
 					 newchannel->Outbound.RingBuffer,
 					 send_ringbuffer_size +
 					 recv_ringbuffer_size,
@@ -307,10 +307,10 @@ errorout:
 }
 
 /*
- * DumpGpadlBody - Dump the gpadl body message to the console for
+ * dump_gpadl_body - Dump the gpadl body message to the console for
  * debugging purposes.
  */
-static void DumpGpadlBody(struct vmbus_channel_gpadl_body *gpadl, u32 len)
+static void dump_gpadl_body(struct vmbus_channel_gpadl_body *gpadl, u32 len)
 {
 	int i;
 	int pfncount;
@@ -325,10 +325,10 @@ static void DumpGpadlBody(struct vmbus_channel_gpadl_body *gpadl, u32 len)
 }
 
 /*
- * DumpGpadlHeader - Dump the gpadl header message to the console for
+ * dump_gpadl_header - Dump the gpadl header message to the console for
  * debugging purposes.
  */
-static void DumpGpadlHeader(struct vmbus_channel_gpadl_header *gpadl)
+static void dump_gpadl_header(struct vmbus_channel_gpadl_header *gpadl)
 {
 	int i, j;
 	int pagecount;
@@ -351,9 +351,9 @@ static void DumpGpadlHeader(struct vmbus_channel_gpadl_header *gpadl)
 }
 
 /*
- * VmbusChannelCreateGpadlHeader - Creates a gpadl for the specified buffer
+ * create_gpadl_header - Creates a gpadl for the specified buffer
  */
-static int VmbusChannelCreateGpadlHeader(void *kbuffer, u32 size,
+static int create_gpadl_header(void *kbuffer, u32 size,
 					 struct vmbus_channel_msginfo **msginfo,
 					 u32 *messagecount)
 {
@@ -479,14 +479,14 @@ nomem:
 }
 
 /*
- * VmbusChannelEstablishGpadl - Estabish a GPADL for the specified buffer
+ * vmbus_establish_gpadl - Estabish a GPADL for the specified buffer
  *
  * @channel: a channel
  * @kbuffer: from kmalloc
  * @size: page-size multiple
  * @gpadl_handle: some funky thing
  */
-int VmbusChannelEstablishGpadl(struct vmbus_channel *channel, void *kbuffer,
+int vmbus_establish_gpadl(struct vmbus_channel *channel, void *kbuffer,
 			       u32 size, u32 *gpadl_handle)
 {
 	struct vmbus_channel_gpadl_header *gpadlmsg;
@@ -503,7 +503,7 @@ int VmbusChannelEstablishGpadl(struct vmbus_channel *channel, void *kbuffer,
 	next_gpadl_handle = atomic_read(&gVmbusConnection.NextGpadlHandle);
 	atomic_inc(&gVmbusConnection.NextGpadlHandle);
 
-	ret = VmbusChannelCreateGpadlHeader(kbuffer, size, &msginfo, &msgcount);
+	ret = create_gpadl_header(kbuffer, size, &msginfo, &msgcount);
 	if (ret)
 		return ret;
 
@@ -518,7 +518,7 @@ int VmbusChannelEstablishGpadl(struct vmbus_channel *channel, void *kbuffer,
 	gpadlmsg->ChildRelId = channel->OfferMsg.ChildRelId;
 	gpadlmsg->Gpadl = next_gpadl_handle;
 
-	DumpGpadlHeader(gpadlmsg);
+	dump_gpadl_header(gpadlmsg);
 
 	spin_lock_irqsave(&gVmbusConnection.channelmsg_lock, flags);
 	list_add_tail(&msginfo->MsgListEntry,
@@ -554,7 +554,7 @@ int VmbusChannelEstablishGpadl(struct vmbus_channel *channel, void *kbuffer,
 				   submsginfo->MessageSize -
 				   sizeof(*submsginfo));
 
-			DumpGpadlBody(gpadl_body, submsginfo->MessageSize -
+			dump_gpadl_body(gpadl_body, submsginfo->MessageSize -
 				      sizeof(*submsginfo));
 			ret = VmbusPostMessage(gpadl_body,
 					       submsginfo->MessageSize -
@@ -586,9 +586,9 @@ Cleanup:
 }
 
 /*
- * VmbusChannelTeardownGpadl -Teardown the specified GPADL handle
+ * vmbus_teardown_gpadl -Teardown the specified GPADL handle
  */
-int VmbusChannelTeardownGpadl(struct vmbus_channel *channel, u32 gpadl_handle)
+int vmbus_teardown_gpadl(struct vmbus_channel *channel, u32 gpadl_handle)
 {
 	struct vmbus_channel_gpadl_teardown *msg;
 	struct vmbus_channel_msginfo *info;
@@ -639,9 +639,9 @@ int VmbusChannelTeardownGpadl(struct vmbus_channel *channel, u32 gpadl_handle)
 }
 
 /*
- * VmbusChannelClose - Close the specified channel
+ * vmbus_close - Close the specified channel
  */
-void VmbusChannelClose(struct vmbus_channel *channel)
+void vmbus_close(struct vmbus_channel *channel)
 {
 	struct vmbus_channel_close_channel *msg;
 	struct vmbus_channel_msginfo *info;
@@ -674,7 +674,7 @@ void VmbusChannelClose(struct vmbus_channel *channel)
 
 	/* Tear down the gpadl for the channel's ring buffer */
 	if (channel->RingBufferGpadlHandle)
-		VmbusChannelTeardownGpadl(channel,
+		vmbus_teardown_gpadl(channel,
 					  channel->RingBufferGpadlHandle);
 
 	/* TODO: Send a msg to release the childRelId */
@@ -703,7 +703,7 @@ void VmbusChannelClose(struct vmbus_channel *channel)
 }
 
 /**
- * VmbusChannelSendPacket() - Send the specified buffer on the given channel
+ * vmbus_sendpacket() - Send the specified buffer on the given channel
  * @channel: Pointer to vmbus_channel structure.
  * @buffer: Pointer to the buffer you want to receive the data into.
  * @bufferlen: Maximum size of what the the buffer will hold
@@ -716,7 +716,7 @@ void VmbusChannelClose(struct vmbus_channel *channel)
  *
  * Mainly used by Hyper-V drivers.
  */
-int VmbusChannelSendPacket(struct vmbus_channel *channel, const void *buffer,
+int vmbus_sendpacket(struct vmbus_channel *channel, const void *buffer,
 			   u32 bufferlen, u64 requestid,
 			   enum vmbus_packet_type type, u32 flags)
 {
@@ -730,7 +730,7 @@ int VmbusChannelSendPacket(struct vmbus_channel *channel, const void *buffer,
 	DPRINT_DBG(VMBUS, "channel %p buffer %p len %d",
 		   channel, buffer, bufferlen);
 
-	DumpVmbusChannel(channel);
+	dump_vmbus_channel(channel);
 
 	/* ASSERT((packetLenAligned - packetLen) < sizeof(u64)); */
 
@@ -752,17 +752,17 @@ int VmbusChannelSendPacket(struct vmbus_channel *channel, const void *buffer,
 
 	/* TODO: We should determine if this is optional */
 	if (ret == 0 && !GetRingBufferInterruptMask(&channel->Outbound))
-		VmbusChannelSetEvent(channel);
+		vmbus_setevent(channel);
 
 	return ret;
 }
-EXPORT_SYMBOL(VmbusChannelSendPacket);
+EXPORT_SYMBOL(vmbus_sendpacket);
 
 /*
- * VmbusChannelSendPacketPageBuffer - Send a range of single-page buffer
+ * vmbus_sendpacket_pagebuffer - Send a range of single-page buffer
  * packets using a GPADL Direct packet type.
  */
-int VmbusChannelSendPacketPageBuffer(struct vmbus_channel *channel,
+int vmbus_sendpacket_pagebuffer(struct vmbus_channel *channel,
 				     struct hv_page_buffer pagebuffers[],
 				     u32 pagecount, void *buffer, u32 bufferlen,
 				     u64 requestid)
@@ -779,7 +779,7 @@ int VmbusChannelSendPacketPageBuffer(struct vmbus_channel *channel,
 	if (pagecount > MAX_PAGE_BUFFER_COUNT)
 		return -EINVAL;
 
-	DumpVmbusChannel(channel);
+	dump_vmbus_channel(channel);
 
 	/*
 	 * Adjust the size down since vmbus_channel_packet_page_buffer is the
@@ -817,16 +817,16 @@ int VmbusChannelSendPacketPageBuffer(struct vmbus_channel *channel,
 
 	/* TODO: We should determine if this is optional */
 	if (ret == 0 && !GetRingBufferInterruptMask(&channel->Outbound))
-		VmbusChannelSetEvent(channel);
+		vmbus_setevent(channel);
 
 	return ret;
 }
 
 /*
- * VmbusChannelSendPacketMultiPageBuffer - Send a multi-page buffer packet
+ * vmbus_sendpacket_multipagebuffer - Send a multi-page buffer packet
  * using a GPADL Direct packet type.
  */
-int VmbusChannelSendPacketMultiPageBuffer(struct vmbus_channel *channel,
+int vmbus_sendpacket_multipagebuffer(struct vmbus_channel *channel,
 				struct hv_multipage_buffer *multi_pagebuffer,
 				void *buffer, u32 bufferlen, u64 requestid)
 {
@@ -840,7 +840,7 @@ int VmbusChannelSendPacketMultiPageBuffer(struct vmbus_channel *channel,
 	u32 pfncount = NUM_PAGES_SPANNED(multi_pagebuffer->Offset,
 					 multi_pagebuffer->Length);
 
-	DumpVmbusChannel(channel);
+	dump_vmbus_channel(channel);
 
 	DPRINT_DBG(VMBUS, "data buffer - offset %u len %u pfn count %u",
 		multi_pagebuffer->Offset,
@@ -885,14 +885,14 @@ int VmbusChannelSendPacketMultiPageBuffer(struct vmbus_channel *channel,
 
 	/* TODO: We should determine if this is optional */
 	if (ret == 0 && !GetRingBufferInterruptMask(&channel->Outbound))
-		VmbusChannelSetEvent(channel);
+		vmbus_setevent(channel);
 
 	return ret;
 }
 
 
 /**
- * VmbusChannelRecvPacket() - Retrieve the user packet on the specified channel
+ * vmbus_recvpacket() - Retrieve the user packet on the specified channel
  * @channel: Pointer to vmbus_channel structure.
  * @buffer: Pointer to the buffer you want to receive the data into.
  * @bufferlen: Maximum size of what the the buffer will hold
@@ -904,7 +904,7 @@ int VmbusChannelSendPacketMultiPageBuffer(struct vmbus_channel *channel,
  *
  * Mainly used by Hyper-V drivers.
  */
-int VmbusChannelRecvPacket(struct vmbus_channel *channel, void *buffer,
+int vmbus_recvpacket(struct vmbus_channel *channel, void *buffer,
 			u32 bufferlen, u32 *buffer_actual_len, u64 *requestid)
 {
 	struct vmpacket_descriptor desc;
@@ -958,12 +958,12 @@ int VmbusChannelRecvPacket(struct vmbus_channel *channel, void *buffer,
 
 	return 0;
 }
-EXPORT_SYMBOL(VmbusChannelRecvPacket);
+EXPORT_SYMBOL(vmbus_recvpacket);
 
 /*
- * VmbusChannelRecvPacketRaw - Retrieve the raw packet on the specified channel
+ * vmbus_recvpacket_raw - Retrieve the raw packet on the specified channel
  */
-int VmbusChannelRecvPacketRaw(struct vmbus_channel *channel, void *buffer,
+int vmbus_recvpacket_raw(struct vmbus_channel *channel, void *buffer,
 			      u32 bufferlen, u32 *buffer_actual_len,
 			      u64 *requestid)
 {
@@ -1017,11 +1017,11 @@ int VmbusChannelRecvPacketRaw(struct vmbus_channel *channel, void *buffer,
 }
 
 /*
- * VmbusChannelOnChannelEvent - Channel event callback
+ * vmbus_onchannel_event - Channel event callback
  */
-void VmbusChannelOnChannelEvent(struct vmbus_channel *channel)
+void vmbus_onchannel_event(struct vmbus_channel *channel)
 {
-	DumpVmbusChannel(channel);
+	dump_vmbus_channel(channel);
 	/* ASSERT(Channel->OnChannelCallback); */
 
 	channel->OnChannelCallback(channel->ChannelCallbackContext);
@@ -1030,9 +1030,9 @@ void VmbusChannelOnChannelEvent(struct vmbus_channel *channel)
 }
 
 /*
- * VmbusChannelOnTimer - Timer event callback
+ * vmbus_ontimer - Timer event callback
  */
-void VmbusChannelOnTimer(unsigned long data)
+void vmbus_ontimer(unsigned long data)
 {
 	struct vmbus_channel *channel = (struct vmbus_channel *)data;
 
@@ -1041,9 +1041,9 @@ void VmbusChannelOnTimer(unsigned long data)
 }
 
 /*
- * DumpVmbusChannel - Dump vmbus channel info to the console
+ * dump_vmbus_channel- Dump vmbus channel info to the console
  */
-static void DumpVmbusChannel(struct vmbus_channel *channel)
+static void dump_vmbus_channel(struct vmbus_channel *channel)
 {
 	DPRINT_DBG(VMBUS, "Channel (%d)", channel->OfferMsg.ChildRelId);
 	DumpRingInfo(&channel->Outbound, "Outbound ");
diff --git a/drivers/staging/hv/channel.h b/drivers/staging/hv/channel.h
index 85c5079..7997056 100644
--- a/drivers/staging/hv/channel.h
+++ b/drivers/staging/hv/channel.h
@@ -52,61 +52,61 @@ struct vmbus_channel_packet_multipage_buffer {
 } __attribute__((packed));
 
 
-extern int VmbusChannelOpen(struct vmbus_channel *channel,
-			    u32 SendRingBufferSize,
-			    u32 RecvRingBufferSize,
-			    void *UserData,
-			    u32 UserDataLen,
-			    void(*OnChannelCallback)(void *context),
-			    void *Context);
-
-extern void VmbusChannelClose(struct vmbus_channel *channel);
-
-extern int VmbusChannelSendPacket(struct vmbus_channel *channel,
-				  const void *Buffer,
-				  u32 BufferLen,
-				  u64 RequestId,
-				  enum vmbus_packet_type Type,
-				  u32 Flags);
-
-extern int VmbusChannelSendPacketPageBuffer(struct vmbus_channel *channel,
-					    struct hv_page_buffer PageBuffers[],
-					    u32 PageCount,
-					    void *Buffer,
-					    u32 BufferLen,
-					    u64 RequestId);
-
-extern int VmbusChannelSendPacketMultiPageBuffer(struct vmbus_channel *channel,
+extern int vmbus_open(struct vmbus_channel *channel,
+			    u32 send_ringbuffersize,
+			    u32 recv_ringbuffersize,
+			    void *userdata,
+			    u32 userdatalen,
+			    void(*onchannel_callback)(void *context),
+			    void *context);
+
+extern void vmbus_close(struct vmbus_channel *channel);
+
+extern int vmbus_sendpacket(struct vmbus_channel *channel,
+				  const void *buffer,
+				  u32 bufferLen,
+				  u64 requestid,
+				  enum vmbus_packet_type type,
+				  u32 flags);
+
+extern int vmbus_sendpacket_pagebuffer(struct vmbus_channel *channel,
+					    struct hv_page_buffer pagebuffers[],
+					    u32 pagecount,
+					    void *buffer,
+					    u32 bufferlen,
+					    u64 requestid);
+
+extern int vmbus_sendpacket_multipagebuffer(struct vmbus_channel *channel,
 					struct hv_multipage_buffer *mpb,
-					void *Buffer,
-					u32 BufferLen,
-					u64 RequestId);
+					void *buffer,
+					u32 bufferlen,
+					u64 requestid);
 
-extern int VmbusChannelEstablishGpadl(struct vmbus_channel *channel,
-				      void *Kbuffer,
-				      u32 Size,
-				      u32 *GpadlHandle);
+extern int vmbus_establish_gpadl(struct vmbus_channel *channel,
+				      void *kbuffer,
+				      u32 size,
+				      u32 *gpadl_handle);
 
-extern int VmbusChannelTeardownGpadl(struct vmbus_channel *channel,
-				     u32 GpadlHandle);
+extern int vmbus_teardown_gpadl(struct vmbus_channel *channel,
+				     u32 gpadl_handle);
 
-extern int VmbusChannelRecvPacket(struct vmbus_channel *channel,
-				  void *Buffer,
-				  u32 BufferLen,
-				  u32 *BufferActualLen,
-				  u64 *RequestId);
+extern int vmbus_recvpacket(struct vmbus_channel *channel,
+				  void *buffer,
+				  u32 bufferlen,
+				  u32 *buffer_actual_len,
+				  u64 *requestid);
 
-extern int VmbusChannelRecvPacketRaw(struct vmbus_channel *channel,
-				     void *Buffer,
-				     u32 BufferLen,
-				     u32 *BufferActualLen,
-				     u64 *RequestId);
+extern int vmbus_recvpacket_raw(struct vmbus_channel *channel,
+				     void *buffer,
+				     u32 bufferlen,
+				     u32 *buffer_actual_len,
+				     u64 *requestid);
 
-extern void VmbusChannelOnChannelEvent(struct vmbus_channel *channel);
+extern void vmbus_onchannel_event(struct vmbus_channel *channel);
 
-extern void VmbusChannelGetDebugInfo(struct vmbus_channel *channel,
+extern void vmbus_get_debug_info(struct vmbus_channel *channel,
 				     struct vmbus_channel_debug_info *debug);
 
-extern void VmbusChannelOnTimer(unsigned long data);
+extern void vmbus_ontimer(unsigned long data);
 
 #endif /* _CHANNEL_H_ */
diff --git a/drivers/staging/hv/channel_interface.c b/drivers/staging/hv/channel_interface.c
index 3f6a1cb..4d35923 100644
--- a/drivers/staging/hv/channel_interface.c
+++ b/drivers/staging/hv/channel_interface.c
@@ -31,21 +31,21 @@ static int IVmbusChannelOpen(struct hv_device *device, u32 SendBufferSize,
 			     void (*ChannelCallback)(void *context),
 			     void *Context)
 {
-	return VmbusChannelOpen(device->context, SendBufferSize,
+	return vmbus_open(device->context, SendBufferSize,
 				RecvRingBufferSize, UserData, UserDataLen,
 				ChannelCallback, Context);
 }
 
 static void IVmbusChannelClose(struct hv_device *device)
 {
-	VmbusChannelClose(device->context);
+	vmbus_close(device->context);
 }
 
 static int IVmbusChannelSendPacket(struct hv_device *device, const void *Buffer,
 				   u32 BufferLen, u64 RequestId, u32 Type,
 				   u32 Flags)
 {
-	return VmbusChannelSendPacket(device->context, Buffer, BufferLen,
+	return vmbus_sendpacket(device->context, Buffer, BufferLen,
 				      RequestId, Type, Flags);
 }
 
@@ -54,7 +54,7 @@ static int IVmbusChannelSendPacketPageBuffer(struct hv_device *device,
 				u32 PageCount, void *Buffer,
 				u32 BufferLen, u64 RequestId)
 {
-	return VmbusChannelSendPacketPageBuffer(device->context, PageBuffers,
+	return vmbus_sendpacket_pagebuffer(device->context, PageBuffers,
 						PageCount, Buffer, BufferLen,
 						RequestId);
 }
@@ -63,7 +63,7 @@ static int IVmbusChannelSendPacketMultiPageBuffer(struct hv_device *device,
 				struct hv_multipage_buffer *MultiPageBuffer,
 				void *Buffer, u32 BufferLen, u64 RequestId)
 {
-	return VmbusChannelSendPacketMultiPageBuffer(device->context,
+	return vmbus_sendpacket_multipagebuffer(device->context,
 						     MultiPageBuffer, Buffer,
 						     BufferLen, RequestId);
 }
@@ -72,7 +72,7 @@ static int IVmbusChannelRecvPacket(struct hv_device *device, void *Buffer,
 				   u32 BufferLen, u32 *BufferActualLen,
 				   u64 *RequestId)
 {
-	return VmbusChannelRecvPacket(device->context, Buffer, BufferLen,
+	return vmbus_recvpacket(device->context, Buffer, BufferLen,
 				      BufferActualLen, RequestId);
 }
 
@@ -80,20 +80,20 @@ static int IVmbusChannelRecvPacketRaw(struct hv_device *device, void *Buffer,
 				      u32 BufferLen, u32 *BufferActualLen,
 				      u64 *RequestId)
 {
-	return VmbusChannelRecvPacketRaw(device->context, Buffer, BufferLen,
+	return vmbus_recvpacket_raw(device->context, Buffer, BufferLen,
 					 BufferActualLen, RequestId);
 }
 
 static int IVmbusChannelEstablishGpadl(struct hv_device *device, void *Buffer,
 				       u32 BufferLen, u32 *GpadlHandle)
 {
-	return VmbusChannelEstablishGpadl(device->context, Buffer, BufferLen,
+	return vmbus_establish_gpadl(device->context, Buffer, BufferLen,
 					  GpadlHandle);
 }
 
 static int IVmbusChannelTeardownGpadl(struct hv_device *device, u32 GpadlHandle)
 {
-	return VmbusChannelTeardownGpadl(device->context, GpadlHandle);
+	return vmbus_teardown_gpadl(device->context, GpadlHandle);
 
 }
 
@@ -105,7 +105,7 @@ void GetChannelInfo(struct hv_device *device, struct hv_device_info *info)
 	if (!device->context)
 		return;
 
-	VmbusChannelGetDebugInfo(device->context, &debugInfo);
+	vmbus_get_debug_info(device->context, &debugInfo);
 
 	info->ChannelId = debugInfo.RelId;
 	info->ChannelState = debugInfo.State;
diff --git a/drivers/staging/hv/channel_mgmt.c b/drivers/staging/hv/channel_mgmt.c
index 6ccf505..bdfd5af 100644
--- a/drivers/staging/hv/channel_mgmt.c
+++ b/drivers/staging/hv/channel_mgmt.c
@@ -172,7 +172,7 @@ void chn_cb_negotiate(void *context)
 	buflen = PAGE_SIZE;
 	buf = kmalloc(buflen, GFP_ATOMIC);
 
-	VmbusChannelRecvPacket(channel, buf, buflen, &recvlen, &requestid);
+	vmbus_recvpacket(channel, buf, buflen, &recvlen, &requestid);
 
 	if (recvlen > 0) {
 		icmsghdrp = (struct icmsg_hdr *)&buf[
@@ -183,7 +183,7 @@ void chn_cb_negotiate(void *context)
 		icmsghdrp->icflags = ICMSGHDRFLAG_TRANSACTION
 			| ICMSGHDRFLAG_RESPONSE;
 
-		VmbusChannelSendPacket(channel, buf,
+		vmbus_sendpacket(channel, buf,
 				       recvlen, requestid,
 				       VmbusPacketTypeDataInBand, 0);
 	}
@@ -249,7 +249,7 @@ struct vmbus_channel *AllocVmbusChannel(void)
 
 	init_timer(&channel->poll_timer);
 	channel->poll_timer.data = (unsigned long)channel;
-	channel->poll_timer.function = VmbusChannelOnTimer;
+	channel->poll_timer.function = vmbus_ontimer;
 
 	channel->ControlWQ = create_workqueue("hv_vmbus_ctl");
 	if (!channel->ControlWQ) {
@@ -392,7 +392,7 @@ static void VmbusChannelProcessOffer(void *context)
 			if (memcmp(&newChannel->OfferMsg.Offer.InterfaceType,
 				   &hv_cb_utils[cnt].data,
 				   sizeof(struct hv_guid)) == 0 &&
-				VmbusChannelOpen(newChannel, 2 * PAGE_SIZE,
+				vmbus_open(newChannel, 2 * PAGE_SIZE,
 						 2 * PAGE_SIZE, NULL, 0,
 						 hv_cb_utils[cnt].callback,
 						 newChannel) == 0) {
diff --git a/drivers/staging/hv/connection.c b/drivers/staging/hv/connection.c
index 1f4d668..f847707 100644
--- a/drivers/staging/hv/connection.c
+++ b/drivers/staging/hv/connection.c
@@ -254,10 +254,10 @@ static void VmbusProcessChannelEvent(void *context)
 	channel = GetChannelFromRelId(relId);
 
 	if (channel) {
-		VmbusChannelOnChannelEvent(channel);
+		vmbus_onchannel_event(channel);
 		/*
 		 * WorkQueueQueueWorkItem(channel->dataWorkQueue,
-		 *			  VmbusChannelOnChannelEvent,
+		 *			  vmbus_onchannel_event,
 		 *			  (void*)channel);
 		 */
 	} else {
diff --git a/drivers/staging/hv/hv_utils.c b/drivers/staging/hv/hv_utils.c
index 6eb79fe..702a478 100644
--- a/drivers/staging/hv/hv_utils.c
+++ b/drivers/staging/hv/hv_utils.c
@@ -55,7 +55,7 @@ static void shutdown_onchannelcallback(void *context)
 	buflen = PAGE_SIZE;
 	buf = kmalloc(buflen, GFP_ATOMIC);
 
-	VmbusChannelRecvPacket(channel, buf, buflen, &recvlen, &requestid);
+	vmbus_recvpacket(channel, buf, buflen, &recvlen, &requestid);
 
 	if (recvlen > 0) {
 		DPRINT_DBG(VMBUS, "shutdown packet: len=%d, requestid=%lld",
@@ -93,7 +93,7 @@ static void shutdown_onchannelcallback(void *context)
 		icmsghdrp->icflags = ICMSGHDRFLAG_TRANSACTION
 			| ICMSGHDRFLAG_RESPONSE;
 
-		VmbusChannelSendPacket(channel, buf,
+		vmbus_sendpacket(channel, buf,
 				       recvlen, requestid,
 				       VmbusPacketTypeDataInBand, 0);
 	}
@@ -159,7 +159,7 @@ static void timesync_onchannelcallback(void *context)
 	buflen = PAGE_SIZE;
 	buf = kmalloc(buflen, GFP_ATOMIC);
 
-	VmbusChannelRecvPacket(channel, buf, buflen, &recvlen, &requestid);
+	vmbus_recvpacket(channel, buf, buflen, &recvlen, &requestid);
 
 	if (recvlen > 0) {
 		DPRINT_DBG(VMBUS, "timesync packet: recvlen=%d, requestid=%lld",
@@ -180,7 +180,7 @@ static void timesync_onchannelcallback(void *context)
 		icmsghdrp->icflags = ICMSGHDRFLAG_TRANSACTION
 			| ICMSGHDRFLAG_RESPONSE;
 
-		VmbusChannelSendPacket(channel, buf,
+		vmbus_sendpacket(channel, buf,
 				recvlen, requestid,
 				VmbusPacketTypeDataInBand, 0);
 	}
@@ -205,7 +205,7 @@ static void heartbeat_onchannelcallback(void *context)
 	buflen = PAGE_SIZE;
 	buf = kmalloc(buflen, GFP_ATOMIC);
 
-	VmbusChannelRecvPacket(channel, buf, buflen, &recvlen, &requestid);
+	vmbus_recvpacket(channel, buf, buflen, &recvlen, &requestid);
 
 	if (recvlen > 0) {
 		DPRINT_DBG(VMBUS, "heartbeat packet: len=%d, requestid=%lld",
@@ -233,7 +233,7 @@ static void heartbeat_onchannelcallback(void *context)
 		icmsghdrp->icflags = ICMSGHDRFLAG_TRANSACTION
 			| ICMSGHDRFLAG_RESPONSE;
 
-		VmbusChannelSendPacket(channel, buf,
+		vmbus_sendpacket(channel, buf,
 				       recvlen, requestid,
 				       VmbusPacketTypeDataInBand, 0);
 	}
-- 
1.6.3.2

^ permalink raw reply related

* Re: memory clobber in rx path, maybe related to ath9k.
From: Ben Greear @ 2010-10-07 18:39 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: Johannes Berg, linux-wireless@vger.kernel.org
In-Reply-To: <AANLkTinbRSnPVgbBxvVpMdnP+K--bye=Q-miHf4X44kz@mail.gmail.com>

On 10/07/2010 11:29 AM, Luis R. Rodriguez wrote:
> On Thu, Oct 7, 2010 at 11:14 AM, Johannes Berg
> <johannes@sipsolutions.net>  wrote:
>> On Thu, 2010-10-07 at 10:33 -0700, Ben Greear wrote:
>>> In case it helps, here is a dump of where the corrupted SKB was deleted.
>>
>> I wonder, do you have a machine with a decent IOMMU? Adding IOMMU
>> debugging into the mix could help you figure out if it's a DMA problem.
>
> Ben, how much traffic are you RX'ing on these virtual interfaces?

I disabled my user-space application, and this script alone can reproduce
the problem fairly quickly on my system.  You will need to change some
of those first variables.  Just start it and wait a few minutes and
watch the splats show on the console :)

Note that I am not generating any traffic, but the wpa_supplicants are
doing their thing of course...

I'm using the kernel found here:
http://dmz2.candelatech.com/git/gitweb.cgi?p=linux.wireless-testing.ct/.git;a=summary

It's latest wireless-testing with some of my own patches, and some
I've gathered from here an there.  I doubt I'm causing this problem,
but if you can't reproduce it with this script on your kernels,
I can try with base wireless-testing or whatever you are using.


#!/usr/bin/perl

use strict;

my $iw = "./local/sbin/iw";
my $ip = "./local/sbin/ip";
my $wpa_s = "./local/bin/wpa_supplicant";
my $ssid = "candela-n";
my $key = "wpadmz123";

my $phy = "phy0";
my $max = 32;
my $i;
my $bmac = "00:01:02:03:04:";
my $cmd;

# Create stations
for ($i = 0; $i<$max; $i++) {
   runCmd("$iw phy $phy interface add sta$i type station");
   my $mc5 = "$i";
   if (length($mc5) == 1) {
     $mc5 = "0$mc5"; # pad mac octet
   }
   my $mac = "$bmac$mc5";
   runCmd("$ip link set sta$i address $mac");

   runCmd("$iw dev sta$i set power_save off");
}

# Bring them up with WPA
for ($i = 0; $i<$max; $i++) {
   open(FD, ">sta$i" . "_wpa.conf") || die("Couldn't open file: $!\n");
   print FD "
ctrl_interface=/var/run/wpa_supplicant
fast_reauth=1
#can_scan_one=1
network={
     ssid=\"$ssid\"
     proto=WPA
     key_mgmt=WPA-PSK
     psk=\"$key\"
     pairwise=TKIP CCMP
     group=TKIP CCMP
}
";
   runCmd("$wpa_s -B -i sta$i -c sta$i" . "_wpa.conf -P sta$i" . "_wpa.pid -t -f sta$i" . "_wpa.log");
}


sub runCmd {
   my $cmd = shift;
   print "$cmd\n";
   `$cmd`;
}


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


^ permalink raw reply


This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.