Re: [PATCH 00/18] staging/android: clean up SW_SYNC
On Wed, Jun 08, 2016 at 10:45:34PM -0700, Greg Kroah-Hartman wrote: > On Wed, Jun 08, 2016 at 04:07:59PM -0300, Gustavo Padovan wrote: > > Hi Greg, > > > > Any comment on this? > > I am just starting to catch up on patches, please give me some time, > staging patches are at the bottom of my priority list, sorry. fwiw on the patch series: Reviewed-by: Daniel Vetter -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [RFC][PATCH 6/6] staging: android: ion: Introduce new ioctls for dynamic heaps
Hi Laura, On Wed, Jun 08, 2016 at 12:14:12PM -0700, Laura Abbott wrote: For now I'm just going to focus on comments not about the heap ID mapping because I'm leaning towards dropping the heap ID mapping. Fair enough. Like you said, giving userspace enough information to just figure out the right heap IDs is already a big improvement. I'm not that familiar with the DRM ioctls but this sounds like a good suggestion. One less ioctl to worry about. Sorry, I probably should have pointed to an example: http://lxr.free-electrons.com/source/drivers/gpu/drm/drm_crtc.c#L2325 + */ +struct ion_heap_query { +__u32 cnt; /* Total number of heaps to be copied */ +__u64 heaps; /* buffer to be populated */ I guess this field needs explicit alignment to 64 bits Yes, I was going by the suggestion in botching-up-ioctls.txt https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/ioctl/botching-up-ioctls.txt#n42 The type is fine, but you should add a 32-bit padding field before heaps: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/ioctl/botching-up-ioctls.txt#n32 Cheers, -Brian ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH net-next v2] netvsc: get rid of completion timeouts
David Miller writes: > From: Vitaly Kuznetsov > Date: Wed, 8 Jun 2016 19:17:41 +0200 > >> I'm hitting 5 second timeout in rndis_filter_set_rss_param() while setting >> RSS parameters for the device. When this happens we end up returning >> -ETIMEDOUT from the function and rndis_filter_device_add() falls back to >> setting >> >> net_device->max_chn = 1; >> net_device->num_chn = 1; >> net_device->num_sc_offered = 0; >> >> but after a moment the rndis request succeeds and subchannels start to >> appear. netvsc_sc_open() does unconditional nvscdev->num_sc_offered-- and >> it becomes U32_MAX-1. Consequent rndis_filter_device_remove() will hang >> while waiting for all U32_MAX-1 subchannels to appear and this is not >> going to happen. >> >> The immediate issue could be solved by adding num_sc_offered > 0 check to >> netvsc_sc_open() but we're getting out of sync with the host and it's not >> easy to adjust things later, e.g. in this particular case we'll be creating >> queues without a user request for it and races are expected. Same applies >> to other parts of the driver which have the same completion timeout. >> >> Following the trend in drivers/hv/* code I suggest we remove all these >> timeouts completely. As a guest we can always trust the host we're running >> on and if the host screws things up there is no easy way to recover anyway. >> >> Signed-off-by: Vitaly Kuznetsov >> Acked-by: Haiyang Zhang > > This doesn't apply cleanly to net-next, I get rejects. Sorry for the screw up, apparently I forgot about my own cleanups I sent before. v3 is coming. -- Vitaly ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 0/6] staging: comedi: addi_apci_1564: cleanup driver
On 08/06/16 19:26, H Hartley Sweeten wrote: This driver still uses some of old broken code in hwdrv_apci1564.c for the timer and counter subdevices. This code does not follow the comedi API and does not work without additional patches to the core. Tidy up the change-of-state support so that the dev->read_subdev can be used to handle the interrupt events from the timer and counter subdevices. Rewrite the timer and counter subdevice support so that it follows the comedi API. NOTE: The datasheet I have from ADDI-DATA just describes the registers. It does not have any functional information on the operation of the timer or counter. The new code might not work _correctly_ but it at least makes the subdevices work with the comedi API so that additional testing can be done. v2: mask the change-of-state input status in patch 1/6 at the request of Ian Abbott H Hartley Sweeten (6): staging: comedi: addi_apci_1564: clarify change-of-state interrupt support staging: comedi: addi_apci_1564: use comedi_handle_event() for timer staging: comedi: addi_apci_1564: use comedi_handle_event() for counters staging: comedi: addi_apci_1564: rewrite the timer subdevice support staging: comedi: addi_apci_1564: rewrite the counter subdevice support staging: comedi: addi_apci_1564: remove unnecessary wdog register defines .../comedi/drivers/addi-data/hwdrv_apci1564.c | 187 - drivers/staging/comedi/drivers/addi_apci_1564.c| 305 ++--- 2 files changed, 264 insertions(+), 228 deletions(-) delete mode 100644 drivers/staging/comedi/drivers/addi-data/hwdrv_apci1564.c Thanks, Hartley! Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: lustre: llite: remove lloop device
On 2016/06/08, 16:50, "James Simmons" wrote: >The lloop device was original developed to work around >the lack of direct I/O for the default loop back device. >Also the lloop device greatly out performed the default >loop back device. The lloop hasn't been worked on for >some time and now it no longer out performs the loop >device and loop now supports direct I/O. Since this is >the case we can delete this device. > >Signed-off-by: James Simmons Reviewed-by: Andreas Dilger Cheers, Andreas >--- > drivers/staging/lustre/lustre/Kconfig|6 - > drivers/staging/lustre/lustre/llite/Makefile |3 - > drivers/staging/lustre/lustre/llite/lloop.c | 883 -- > 3 files changed, 0 insertions(+), 892 deletions(-) > delete mode 100644 drivers/staging/lustre/lustre/llite/lloop.c > >diff --git a/drivers/staging/lustre/lustre/Kconfig >b/drivers/staging/lustre/lustre/Kconfig >index 8ac7cd4..9f5d75f 100644 >--- a/drivers/staging/lustre/lustre/Kconfig >+++ b/drivers/staging/lustre/lustre/Kconfig >@@ -54,9 +54,3 @@ config LUSTRE_TRANSLATE_ERRNOS > bool > depends on LUSTRE_FS && !X86 > default y >- >-config LUSTRE_LLITE_LLOOP >- tristate "Lustre virtual block device" >- depends on LUSTRE_FS && BLOCK >- depends on !PPC_64K_PAGES && !ARM64_64K_PAGES && !MICROBLAZE_64K_PAGES >&& !PAGE_SIZE_64KB && !IA64_PAGE_SIZE_64KB && !PARISC_PAGE_SIZE_64KB >- default m >diff --git a/drivers/staging/lustre/lustre/llite/Makefile >b/drivers/staging/lustre/lustre/llite/Makefile >index 2ce10ff..19701e7 100644 >--- a/drivers/staging/lustre/lustre/llite/Makefile >+++ b/drivers/staging/lustre/lustre/llite/Makefile >@@ -1,5 +1,4 @@ > obj-$(CONFIG_LUSTRE_FS) += lustre.o >-obj-$(CONFIG_LUSTRE_LLITE_LLOOP) += llite_lloop.o > lustre-y := dcache.o dir.o file.o llite_close.o llite_lib.o llite_nfs.o \ > rw.o namei.o symlink.o llite_mmap.o \ > xattr.o xattr_cache.o remote_perm.o llite_rmtacl.o \ >@@ -7,5 +6,3 @@ lustre-y := dcache.o dir.o file.o llite_close.o llite_lib.o >llite_nfs.o \ > glimpse.o lcommon_cl.o lcommon_misc.o \ > vvp_dev.o vvp_page.o vvp_lock.o vvp_io.o vvp_object.o vvp_req.o \ > lproc_llite.o >- >-llite_lloop-y := lloop.o >diff --git a/drivers/staging/lustre/lustre/llite/lloop.c >b/drivers/staging/lustre/lustre/llite/lloop.c >deleted file mode 100644 >index 813a9a3..000 >--- a/drivers/staging/lustre/lustre/llite/lloop.c >+++ /dev/null >@@ -1,883 +0,0 @@ >-/* >- * GPL HEADER START >- * >- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. >- * >- * This program is free software; you can redistribute it and/or modify >- * it under the terms of the GNU General Public License version 2 only, >- * 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 version 2 for more details (a copy is included >- * in the LICENSE file that accompanied this code). >- * >- * You should have received a copy of the GNU General Public License >- * version 2 along with this program; If not, see >- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf >- * >- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, >- * CA 95054 USA or visit www.sun.com if you need additional information or >- * have any questions. >- * >- * GPL HEADER END >- */ >-/* >- * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights >reserved. >- * Use is subject to license terms. >- * >- * Copyright (c) 2011, 2012, Intel Corporation. >- */ >-/* >- * This file is part of Lustre, http://www.lustre.org/ >- * Lustre is a trademark of Sun Microsystems, Inc. >- */ >- >-/* >- * linux/drivers/block/loop.c >- * >- * Written by Theodore Ts'o, 3/29/93 >- * >- * Copyright 1993 by Theodore Ts'o. Redistribution of this file is >- * permitted under the GNU General Public License. >- * >- * Modularized and updated for 1.1.16 kernel - Mitch Dsouza 28th May 1994 >- * Adapted for 1.3.59 kernel - Andries Brouwer, 1 Feb 1996 >- * >- * Fixed do_loop_request() re-entrancy - vincent.renard...@waw.com Mar 20, >1997 >- * >- * Added devfs support - Richard Gooch 16-Jan-1998 >- * >- * Handle sparse backing files correctly - Kenn Humborg, Jun 28, 1998 >- * >- * Loadable modules and other fixes by AK, 1998 >- * >- * Maximum number of loop devices now dynamic via max_loop module parameter. >- * Russell Kroll 19990701 >- * >- * Maximum number of loop devices when compiled-in now selectable by passing >- * max_loop=<1-255> to the kernel on boot. >- * Erik I. Bols?, , Oct 31, 1999 >- * >- * Completely rewrite request handling to be make_request_fn style and >- * non blocking, pushing work to a helper thread. Lots of fixes from >- * Al Viro too. >- * Jens Axboe , Nov 2000 >- * >- * Support up to 256 loop
Re: [PATCH v4 09/29] staging: unisys: visorinput: remove unnecessary locking
On Wed, 8 Jun 2016, David Kershner wrote: > + /* > + * If we're not paused, really enable interrupts. > + * Regardless of whether we are paused, set a flag indicating > + * interrupts should be enabled so when we resume, interrupts > + * will really be enabled. > + */ > + down_write(&devdata->lock_visor_dev); I think I asked this before, but I might have missed the answer. Why is this a rw_sempahore? It's never taken with down_read and looking at the usage sites it's simply a mutex, right? Thanks, tglx ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: comedi: serial2002: bare unsigned and unneeded cast styling issues
On 08/06/16 20:59, Chris Cesare wrote: checkpatch.pl reported two warnings: A bare "unsigned" and an unnecessary cast. Fixed both. Signed-off-by: Chris Cesare --- drivers/staging/comedi/drivers/serial2002.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/serial2002.c b/drivers/staging/comedi/drivers/serial2002.c index 7a1defc..d3c2743 100644 --- a/drivers/staging/comedi/drivers/serial2002.c +++ b/drivers/staging/comedi/drivers/serial2002.c @@ -95,7 +95,7 @@ struct serial_data { #define S2002_CFG_SIGN(x) (((x) >> 13) & 0x1) #define S2002_CFG_BASE(x) (((x) >> 14) & 0xf) -static long serial2002_tty_ioctl(struct file *f, unsigned op, +static long serial2002_tty_ioctl(struct file *f, unsigned int op, unsigned long param) { if (f->f_op->unlocked_ioctl) @@ -379,7 +379,8 @@ static int serial2002_setup_subdevice(struct comedi_subdevice *s, range_table_list[chan] = (const struct comedi_lrange *)&range[j]; } - maxdata_list[chan] = ((long long)1 << cfg[j].bits) - 1; + maxdata_list[chan] = (1 << cfg[j].bits) - 1; + chan++; } } Logically, the cfg[j].bits value can range from 0 to 63. Practically, I guess it has some fixed set of non-zero values up to a maximum of 32. A shift value of 32 is too large for both a plain, signed int, and an unsigned int (assuming 32-bit int), so the change is a bit dodgy. I propose splitting the patch into 2, fixing the bare unsigned in patch 1, and fixing the cast styling issue in patch 2. Since maxdata_list[chan] is only 32 bits wide, the safest change would be something like this, clamping the value if cfg[j].bits happens to be larger than 32: if (cfg[j].bits < 32) maxdata_list[chan] = (1u << cfg[j].bits) - 1; else maxdata_list[chan] = 0x; -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH net-next v3] netvsc: get rid of completion timeouts
I'm hitting 5 second timeout in rndis_filter_set_rss_param() while setting RSS parameters for the device. When this happens we end up returning -ETIMEDOUT from the function and rndis_filter_device_add() falls back to setting net_device->max_chn = 1; net_device->num_chn = 1; net_device->num_sc_offered = 0; but after a moment the rndis request succeeds and subchannels start to appear. netvsc_sc_open() does unconditional nvscdev->num_sc_offered-- and it becomes U32_MAX-1. Consequent rndis_filter_device_remove() will hang while waiting for all U32_MAX-1 subchannels to appear and this is not going to happen. The immediate issue could be solved by adding num_sc_offered > 0 check to netvsc_sc_open() but we're getting out of sync with the host and it's not easy to adjust things later, e.g. in this particular case we'll be creating queues without a user request for it and races are expected. Same applies to other parts of the driver which have the same completion timeout. Following the trend in drivers/hv/* code I suggest we remove all these timeouts completely. As a guest we can always trust the host we're running on and if the host screws things up there is no easy way to recover anyway. Signed-off-by: Vitaly Kuznetsov Acked-by: Haiyang Zhang --- Changes since v2: - Rebase to current net-next [David Miller] Changes since v1 RFC: - Non-RFC - Restore (net_dev->num_sc_offered > 0) condition in rndis_filter_device_remove() as without it we may hang when there are no subchannels at all. - Remove now unused ndev in rndis_filter_set_packet_filter() to fix the build warning reported by kbuild robot. - Added Haiyang's ACK (hopefully it stands with the above mentioned changes). --- drivers/net/hyperv/netvsc.c | 14 + drivers/net/hyperv/rndis_filter.c | 117 +- 2 files changed, 31 insertions(+), 100 deletions(-) diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 96f00c0..6909c32 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -244,7 +244,6 @@ static int netvsc_destroy_buf(struct hv_device *device) static int netvsc_init_buf(struct hv_device *device) { int ret = 0; - unsigned long t; struct netvsc_device *net_device; struct nvsp_message *init_packet; struct net_device *ndev; @@ -305,9 +304,7 @@ static int netvsc_init_buf(struct hv_device *device) goto cleanup; } - t = wait_for_completion_timeout(&net_device->channel_init_wait, 5*HZ); - BUG_ON(t == 0); - + wait_for_completion(&net_device->channel_init_wait); /* Check the response */ if (init_packet->msg.v1_msg. @@ -390,8 +387,7 @@ static int netvsc_init_buf(struct hv_device *device) goto cleanup; } - t = wait_for_completion_timeout(&net_device->channel_init_wait, 5*HZ); - BUG_ON(t == 0); + wait_for_completion(&net_device->channel_init_wait); /* Check the response */ if (init_packet->msg.v1_msg. @@ -445,7 +441,6 @@ static int negotiate_nvsp_ver(struct hv_device *device, { struct net_device *ndev = hv_get_drvdata(device); int ret; - unsigned long t; memset(init_packet, 0, sizeof(struct nvsp_message)); init_packet->hdr.msg_type = NVSP_MSG_TYPE_INIT; @@ -462,10 +457,7 @@ static int negotiate_nvsp_ver(struct hv_device *device, if (ret != 0) return ret; - t = wait_for_completion_timeout(&net_device->channel_init_wait, 5*HZ); - - if (t == 0) - return -ETIMEDOUT; + wait_for_completion(&net_device->channel_init_wait); if (init_packet->msg.init_msg.init_complete.status != NVSP_STAT_SUCCESS) diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c index 979fa44..8e830f7 100644 --- a/drivers/net/hyperv/rndis_filter.c +++ b/drivers/net/hyperv/rndis_filter.c @@ -466,7 +466,6 @@ static int rndis_filter_query_device(struct rndis_device *dev, u32 oid, struct rndis_query_request *query; struct rndis_query_complete *query_complete; int ret = 0; - unsigned long t; if (!result) return -EINVAL; @@ -503,11 +502,7 @@ static int rndis_filter_query_device(struct rndis_device *dev, u32 oid, if (ret != 0) goto cleanup; - t = wait_for_completion_timeout(&request->wait_event, 5*HZ); - if (t == 0) { - ret = -ETIMEDOUT; - goto cleanup; - } + wait_for_completion(&request->wait_event); /* Copy the response back */ query_complete = &request->response_msg.msg.query_complete; @@ -556,7 +551,6 @@ int rndis_filter_set_device_mac(struct net_device *ndev, char *mac) u32 extlen = sizeof(struct rndis_config_parameter_info) + 2*NWADR_STRLEN + 4*ETH_ALEN; int ret; - unsigned long t;
RE: [PATCH v4 09/29] staging: unisys: visorinput: remove unnecessary locking
> -Original Message- > From: Thomas Gleixner [mailto:t...@linutronix.de] > Sent: Thursday, June 09, 2016 5:01 AM > To: Kershner, David A > Cc: cor...@lwn.net; mi...@redhat.com; h...@zytor.com; > gre...@linuxfoundation.org; Arfvidson, Erik; Sell, Timothy C; > hof...@osadl.org; dzic...@redhat.com; jes.soren...@redhat.com; Curtin, > Alexander Paul; janani.rvchn...@gmail.com; > sudipm.mukher...@gmail.com; pra...@redhat.com; Binder, David Anthony; > nhor...@redhat.com; dan.j.willi...@intel.com; linux- > ker...@vger.kernel.org; linux-...@vger.kernel.org; driverdev- > de...@linuxdriverproject.org; *S-Par-Maintainer > Subject: Re: [PATCH v4 09/29] staging: unisys: visorinput: remove > unnecessary locking > > On Wed, 8 Jun 2016, David Kershner wrote: > > + /* > > +* If we're not paused, really enable interrupts. > > +* Regardless of whether we are paused, set a flag indicating > > +* interrupts should be enabled so when we resume, interrupts > > +* will really be enabled. > > +*/ > > + down_write(&devdata->lock_visor_dev); > > I think I asked this before, but I might have missed the answer. > > Why is this a rw_sempahore? It's never taken with down_read and looking > at the > usage sites it's simply a mutex, right? > > Thanks, > > tglx (Yes, I attempted to address this question in a post I made 6/3/2016 4:30 UTC, which I have basically pasted below.) You are correct that this should be a mutex. We have a local patch that addresses this, but would like to submit this via a follow-on patchset if possible. I'll explain. Rationale: our intent for this patchset was to focus on the visorbus driver ONLY. The only reason visorinput got involved in the first place was due to the visorbus change that necessitated that we remove the locking from visorinput_channel_interrupt(), due to that now being called from atomic context. If the semaphore --> mutex change would have been as simple as it sounds, we would have had NO problem including it with the next version (v3) of this patchset. But unfortunately, this change uncovered a latent defect, which necessitated yet another patch. (I know... hard to believe that something this simple would do that, but it did.) Rather than further complicating this patchset, we thought it would be better to address the visorinput issues via a separate follow-on patchset. Is that acceptable for you? Tim Sell ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/1] Staging: comedi: dmm32at: fix BIT macro issue.
This Replace all occurences of (1< --- drivers/staging/comedi/drivers/dmm32at.c | 98 1 file changed, 50 insertions(+), 48 deletions(-) diff --git a/drivers/staging/comedi/drivers/dmm32at.c b/drivers/staging/comedi/drivers/dmm32at.c index 958c0d4..0d50105 100644 --- a/drivers/staging/comedi/drivers/dmm32at.c +++ b/drivers/staging/comedi/drivers/dmm32at.c @@ -46,73 +46,75 @@ #define DMM32AT_AI_START_CONV_REG 0x00 #define DMM32AT_AI_LSB_REG 0x00 #define DMM32AT_AUX_DOUT_REG 0x01 -#define DMM32AT_AUX_DOUT2 (1 << 2) /* J3.42 - OUT2 (OUT2EN) */ -#define DMM32AT_AUX_DOUT1 (1 << 1) /* J3.43 */ -#define DMM32AT_AUX_DOUT0 (1 << 0) /* J3.44 - OUT0 (OUT0EN) */ +#define DMM32AT_AUX_DOUT2 BIT(2) /* J3.42 - OUT2 (OUT2EN) */ +#define DMM32AT_AUX_DOUT1 BIT(1) /* J3.43 */ +#define DMM32AT_AUX_DOUT0 BIT(0) /* J3.44 - OUT0 (OUT0EN) */ #define DMM32AT_AI_MSB_REG 0x01 #define DMM32AT_AI_LO_CHAN_REG 0x02 #define DMM32AT_AI_HI_CHAN_REG 0x03 #define DMM32AT_AUX_DI_REG 0x04 -#define DMM32AT_AUX_DI_DACBUSY (1 << 7) -#define DMM32AT_AUX_DI_CALBUSY (1 << 6) -#define DMM32AT_AUX_DI3(1 << 3) /* J3.45 - ADCLK (CLKSEL) */ -#define DMM32AT_AUX_DI2(1 << 2) /* J3.46 - GATE12 (GT12EN) */ -#define DMM32AT_AUX_DI1(1 << 1) /* J3.47 - GATE0 (GT0EN) */ -#define DMM32AT_AUX_DI0(1 << 0) /* J3.48 - CLK0 (SRC0) */ +#define DMM32AT_AUX_DI_DACBUSY BIT(7) +#define DMM32AT_AUX_DI_CALBUSY BIT(6) +#define DMM32AT_AUX_DI3BIT(3) /* J3.45 - ADCLK (CLKSEL) */ +#define DMM32AT_AUX_DI2BIT(2) /* J3.46 - GATE12 (GT12EN) */ +#define DMM32AT_AUX_DI1BIT(1) /* J3.47 - GATE0 (GT0EN) */ +#define DMM32AT_AUX_DI0BIT(0) /* J3.48 - CLK0 (SRC0) */ #define DMM32AT_AO_LSB_REG 0x04 #define DMM32AT_AO_MSB_REG 0x05 #define DMM32AT_AO_MSB_DACH(x) ((x) << 6) #define DMM32AT_FIFO_DEPTH_REG 0x06 #define DMM32AT_FIFO_CTRL_REG 0x07 -#define DMM32AT_FIFO_CTRL_FIFOEN (1 << 3) -#define DMM32AT_FIFO_CTRL_SCANEN (1 << 2) -#define DMM32AT_FIFO_CTRL_FIFORST (1 << 1) +#define DMM32AT_FIFO_CTRL_FIFOEN BIT(3) +#define DMM32AT_FIFO_CTRL_SCANEN BIT(2) +#define DMM32AT_FIFO_CTRL_FIFORST BIT(1) #define DMM32AT_FIFO_STATUS_REG0x07 -#define DMM32AT_FIFO_STATUS_EF (1 << 7) -#define DMM32AT_FIFO_STATUS_HF (1 << 6) -#define DMM32AT_FIFO_STATUS_FF (1 << 5) -#define DMM32AT_FIFO_STATUS_OVF(1 << 4) -#define DMM32AT_FIFO_STATUS_FIFOEN (1 << 3) -#define DMM32AT_FIFO_STATUS_SCANEN (1 << 2) +#define DMM32AT_FIFO_STATUS_EF BIT(7) +#define DMM32AT_FIFO_STATUS_HF BIT(6) +#define DMM32AT_FIFO_STATUS_FF BIT(5) +#define DMM32AT_FIFO_STATUS_OVFBIT(4) +#define DMM32AT_FIFO_STATUS_FIFOEN BIT(3) +#define DMM32AT_FIFO_STATUS_SCANEN BIT(2) #define DMM32AT_FIFO_STATUS_PAGE_MASK (3 << 0) #define DMM32AT_CTRL_REG 0x08 -#define DMM32AT_CTRL_RESETA(1 << 5) -#define DMM32AT_CTRL_RESETD(1 << 4) -#define DMM32AT_CTRL_INTRST(1 << 3) -#define DMM32AT_CTRL_PAGE_8254 (0 << 0) -#define DMM32AT_CTRL_PAGE_8255 (1 << 0) -#define DMM32AT_CTRL_PAGE_CALIB(3 << 0) +#define DMM32AT_CTRL_RESETABIT(5) +#define DMM32AT_CTRL_RESETDBIT(4) +#define DMM32AT_CTRL_INTRSTBIT(3) +#define DMM32AT_CTRL(x)((x) << 0) +#define DMM32AT_CTRL_PAGE_8254 DMM32AT_CTRL(0) +#define DMM32AT_CTRL_PAGE_8255 DMM32AT_CTRL(1) +#define DMM32AT_CTRL_PAGE_CALIBDMM32AT_CTRL(3) #define DMM32AT_AI_STATUS_REG 0x08 -#define DMM32AT_AI_STATUS_STS (1 << 7) -#define DMM32AT_AI_STATUS_SD1 (1 << 6) -#define DMM32AT_AI_STATUS_SD0 (1 << 5) +#define DMM32AT_AI_STATUS_STS BIT(7) +#define DMM32AT_AI_STATUS_SD1 BIT(6) +#define DMM32AT_AI_STATUS_SD0 BIT(5) #define DMM32AT_AI_STATUS_ADCH_MASK(0x1f << 0) #define DMM32AT_INTCLK_REG 0x09 -#define DMM32AT_INTCLK_ADINT (1 << 7) -#define DMM32AT_INTCLK_DINT(1 << 6) -#define DMM32AT_INTCLK_TINT(1 << 5) -#define DMM32AT_INTCLK_CLKEN (1 << 1) /* 1=see below 0=software */ -#define DMM32AT_INTCLK_CLKSEL (1 << 0) /* 1=OUT2 0=EXTCLK */ +#define DMM32AT_INTCLK_ADINT BIT(7) +#define DMM32AT_INTCLK_DINTBIT(6) +#define DMM32AT_INTCLK_TINTBIT(5) +#define DMM32AT_INTCLK_CLKEN BIT(1) /* 1=see below 0=software */ +#define DMM32AT_INTCLK_CLKSEL BIT(0) /* 1=OUT2 0=EXTCLK */ #d
Re: [PATCH 00/18] staging/android: clean up SW_SYNC
On 9 June 2016 at 13:53, Daniel Vetter wrote: > On Wed, Jun 08, 2016 at 10:45:34PM -0700, Greg Kroah-Hartman wrote: >> On Wed, Jun 08, 2016 at 04:07:59PM -0300, Gustavo Padovan wrote: >> > Hi Greg, >> > >> > Any comment on this? >> >> I am just starting to catch up on patches, please give me some time, >> staging patches are at the bottom of my priority list, sorry. > > fwiw on the patch series: > > Reviewed-by: Daniel Vetter Likewise, fwiw for this series, Reviewed-by: Sumit Semwal > -- > Daniel Vetter > Software Engineer, Intel Corporation > http://blog.ffwll.ch -- Thanks and regards, Sumit Semwal Linaro Mobile Group - Kernel Team Lead Linaro.org │ Open source software for ARM SoCs ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: fbtft: do not allocate huge txbuf
txbuflen can be set to arbitrary value by user and it is also set automagically to the maximum transfer size of the SPI master controller. Do not allocate the buffer when larger than vmem. When my SPI master controller reports maximum transfer size 16M the probe of fbtft fails. Signed-off-by: Michal Suchanek --- drivers/staging/fbtft/fbtft-core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c index f3bdc8f..b95cf69 100644 --- a/drivers/staging/fbtft/fbtft-core.c +++ b/drivers/staging/fbtft/fbtft-core.c @@ -820,6 +820,8 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display, /* Transmit buffer */ if (txbuflen == -1) txbuflen = vmem_size + 2; /* add in case startbyte is used */ + if (txbuflen >= vmem_size + 2) + txbuflen = 0; #ifdef __LITTLE_ENDIAN if ((!txbuflen) && (bpp > 8)) -- 2.8.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: fbtft: do not allocate huge txbuf
Den 09.06.2016 17:08, skrev Michal Suchanek: txbuflen can be set to arbitrary value by user and it is also set automagically to the maximum transfer size of the SPI master controller. AFAICT this is a result of your previous patch. Please make a new version of your previous patch with this fix in it. Also make a note in that thread that a new version is made so Greg doesn't pull it when he sees my ack. He handles a large volume of patches so let's make it as easy as we can for him. Thanks, Noralf. Do not allocate the buffer when larger than vmem. When my SPI master controller reports maximum transfer size 16M the probe of fbtft fails. Signed-off-by: Michal Suchanek --- drivers/staging/fbtft/fbtft-core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c index f3bdc8f..b95cf69 100644 --- a/drivers/staging/fbtft/fbtft-core.c +++ b/drivers/staging/fbtft/fbtft-core.c @@ -820,6 +820,8 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display, /* Transmit buffer */ if (txbuflen == -1) txbuflen = vmem_size + 2; /* add in case startbyte is used */ + if (txbuflen >= vmem_size + 2) + txbuflen = 0; #ifdef __LITTLE_ENDIAN if ((!txbuflen) && (bpp > 8)) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3] storvsc: use small sg_tablesize on x86
Reducing the sg_tablesize allows booting of 32bit kernels in VMs, after commit be0cf6ca301c61458dc4aa1a37acf4f58d2ed3d6 ("scsi: storvsc: Set the tablesize based on the information given by the host") [5.567138] hv_storvsc vmbus_1: adjusting sg_tablesize 0x800 -> 0x20 Signed-off-by: Olaf Hering --- As requested, use CONFIG_. For some reason IS_ENABLED(64_BIT) does not work. drivers/scsi/storvsc_drv.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 3ddcabb..ae42324 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -1673,11 +1673,15 @@ static int storvsc_probe(struct hv_device *device, /* max cmd length */ host->max_cmd_len = STORVSC_MAX_CMD_LEN; +#ifdef CONFIG_64BIT /* * set the table size based on the info we got * from the host. */ host->sg_tablesize = (stor_device->max_transfer_bytes >> PAGE_SHIFT); +#else + host->sg_tablesize = MAX_MULTIPAGE_BUFFER_COUNT; +#endif /* Register the HBA and start the scsi bus scan */ ret = scsi_add_host(host, &device->device); ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: fbtft: do not allocate huge txbuf
Hello, On 9 June 2016 at 18:20, Noralf Trønnes wrote: > > Den 09.06.2016 17:08, skrev Michal Suchanek: >> >> txbuflen can be set to arbitrary value by user and it is also set >> automagically to the maximum transfer size of the SPI master controller. > > > AFAICT this is a result of your previous patch. Please make a new version of > your previous patch with this fix in it. Also make a note in that thread > that That patch is pretty much independent and just exposes this problem under different circumstances. The txbuflen can be also set by the user. > a new version is made so Greg doesn't pull it when he sees my ack. He > handles a large volume of patches so let's make it as easy as we can for > him. Which would be letting in the patches separately imho. Thanks Michal ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3] storvsc: use small sg_tablesize on x86
On Thu, 2016-06-09 at 18:25 +0200, Olaf Hering wrote: > Reducing the sg_tablesize allows booting of 32bit kernels in VMs, > after > commit be0cf6ca301c61458dc4aa1a37acf4f58d2ed3d6 ("scsi: storvsc: Set > the > tablesize based on the information given by the host") > > [5.567138] hv_storvsc vmbus_1: adjusting sg_tablesize 0x800 -> > 0x20 Are you really sure 32 is the correct size? That caps transfers at 128 k. Even in the dim, dark, pre-64bit (at least on x86) days, our static limit for sg tablesize was 128 (0.5M). I know 32 it what it had before, but the reason for the commit you quote was to improve performance ... James ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: fbtft: do not allocate huge txbuf
[resending got rejected on the list for html format] Den 09.06.2016 19:18, skrev Michal Suchanek: Hello, On 9 June 2016 at 18:20, Noralf Trønnes wrote: Den 09.06.2016 17:08, skrev Michal Suchanek: txbuflen can be set to arbitrary value by user and it is also set automagically to the maximum transfer size of the SPI master controller. AFAICT this is a result of your previous patch. Please make a new version of your previous patch with this fix in it. Also make a note in that thread that That patch is pretty much independent and just exposes this problem under different circumstances. The txbuflen can be also set by the user. a new version is made so Greg doesn't pull it when he sees my ack. He handles a large volume of patches so let's make it as easy as we can for him. Which would be letting in the patches separately imho. Ok, Acked-by: Noralf Trønnes Thanks Michal ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH net-next v3] netvsc: get rid of completion timeouts
From: Vitaly Kuznetsov Date: Thu, 9 Jun 2016 12:44:03 +0200 > I'm hitting 5 second timeout in rndis_filter_set_rss_param() while setting > RSS parameters for the device. When this happens we end up returning > -ETIMEDOUT from the function and rndis_filter_device_add() falls back to > setting > > net_device->max_chn = 1; > net_device->num_chn = 1; > net_device->num_sc_offered = 0; > > but after a moment the rndis request succeeds and subchannels start to > appear. netvsc_sc_open() does unconditional nvscdev->num_sc_offered-- and > it becomes U32_MAX-1. Consequent rndis_filter_device_remove() will hang > while waiting for all U32_MAX-1 subchannels to appear and this is not > going to happen. > > The immediate issue could be solved by adding num_sc_offered > 0 check to > netvsc_sc_open() but we're getting out of sync with the host and it's not > easy to adjust things later, e.g. in this particular case we'll be creating > queues without a user request for it and races are expected. Same applies > to other parts of the driver which have the same completion timeout. > > Following the trend in drivers/hv/* code I suggest we remove all these > timeouts completely. As a guest we can always trust the host we're running > on and if the host screws things up there is no easy way to recover anyway. > > Signed-off-by: Vitaly Kuznetsov > Acked-by: Haiyang Zhang Applied. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Hello
Hello I'm James R Walsh, a U.S Army general who currently serving as commanding general,Operation Syria freedom,global War on Terrorism,U.S Army Training and Doctrine Command.Separated and due to retire soon.i'm heading to the UNITED NATION peace keeping troop here in Syria. I am a kind and sincere man, open minded and honest, affectionate. I am also a simple, easy going and caring person. I am equally happy watching the rays of dawn seek out a waking world or enjoying a nice brandy,i like traveling, share ideas with friends. I love to joke and put smile to the face of people around me. I'm Looking for good and kind woman, loyal, caring,thoughtful, creative, compassionate, imaginative, serious, sensual and passionate who can love unconditionally..But dislike women who lie, cheat, dishonest, Disrespectful, and who just play,i have been depressed due to my ex-wife infidelity and cheat but now i feel better i and want to try again. If you don't mind you can contact me directly on my priva te email address{jamesrwa Regards James ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 0/2] staging: comedi: serial2002: Fix two styling issues
checkpatch.pl warns about a bare unsigned and an unnecessary cast. Patchset splits fixes for these into two separate patches. Chris Cesare (2): staging: comedi: serial2002: Fix bare unsigned styling issue staging: comedi: serial2002: Fix unnecessary cast styling issue drivers/staging/comedi/drivers/serial2002.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/2] staging: comedi: serial2002: Fix unnecessary cast styling issue
checkpatch.pl warns that a cast of 1 to (long long) is unnecessary. Remove the cast and also add code to check and make sure that maxdata_list[chan] is not shifted too far, as suggested by Ian Abbott. Signed-off-by Chris Cesare --- drivers/staging/comedi/drivers/serial2002.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/serial2002.c b/drivers/staging/comedi/drivers/serial2002.c index b777946..0d33e52 100644 --- a/drivers/staging/comedi/drivers/serial2002.c +++ b/drivers/staging/comedi/drivers/serial2002.c @@ -379,7 +379,10 @@ static int serial2002_setup_subdevice(struct comedi_subdevice *s, range_table_list[chan] = (const struct comedi_lrange *)&range[j]; } - maxdata_list[chan] = ((long long)1 << cfg[j].bits) - 1; + if (cfg[j].bits < 32) + maxdata_list[chan] = (1u << cfg[j].bits) - 1; + else + maxdata_list[chan] = 0x; chan++; } } -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/2] staging: comedi: serial2002: Fix bare unsigned styling issue
checkpatch.pl warns about a bare unsigned. Add type int to make explicit and suit the coding style. Signed-off-by Chris Cesare --- drivers/staging/comedi/drivers/serial2002.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/serial2002.c b/drivers/staging/comedi/drivers/serial2002.c index 7a1defc..b777946 100644 --- a/drivers/staging/comedi/drivers/serial2002.c +++ b/drivers/staging/comedi/drivers/serial2002.c @@ -95,7 +95,7 @@ struct serial_data { #define S2002_CFG_SIGN(x) (((x) >> 13) & 0x1) #define S2002_CFG_BASE(x) (((x) >> 14) & 0xf) -static long serial2002_tty_ioctl(struct file *f, unsigned op, +static long serial2002_tty_ioctl(struct file *f, unsigned int op, unsigned long param) { if (f->f_op->unlocked_ioctl) -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH v4 09/29] staging: unisys: visorinput: remove unnecessary locking
On Thu, 9 Jun 2016, Sell, Timothy C wrote: > > From: Thomas Gleixner [mailto:t...@linutronix.de] > > > > I think I asked this before, but I might have missed the answer. > > > > Why is this a rw_sempahore? It's never taken with down_read and looking > > at the usage sites it's simply a mutex, right? > > If the semaphore --> mutex change would have been as simple as it sounds, > we would have had NO problem including it with the next version (v3) of this > patchset. But unfortunately, this change uncovered a latent defect, which > necessitated yet another patch. (I know... hard to believe that something > this simple would do that, but it did.) Rather than further complicating this > patchset, we thought it would be better to address the visorinput issues via a > separate follow-on patchset. That makes me curious. What's the issue? Functional is the mutex the same thing as the r/w semaphore when the latter is only taken down_write and locked and released by the same thread, which is the case as far as I can tell. > Is that acceptable for you? Please fix it before moving the drivers out of staging. Thanks, tglx ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH v4 09/29] staging: unisys: visorinput: remove unnecessary locking
> -Original Message- > From: Thomas Gleixner [mailto:t...@linutronix.de] > Sent: Thursday, June 09, 2016 3:56 PM > To: Sell, Timothy C > Cc: cor...@lwn.net; mi...@redhat.com; h...@zytor.com; > gre...@linuxfoundation.org; Arfvidson, Erik; hof...@osadl.org; > dzic...@redhat.com; jes.soren...@redhat.com; Curtin, Alexander Paul; > janani.rvchn...@gmail.com; sudipm.mukher...@gmail.com; > pra...@redhat.com; Binder, David Anthony; nhor...@redhat.com; > dan.j.willi...@intel.com; linux-ker...@vger.kernel.org; linux- > d...@vger.kernel.org; driverdev-devel@linuxdriverproject.org; *S-Par- > Maintainer; Kershner, David A > Subject: RE: [PATCH v4 09/29] staging: unisys: visorinput: remove > unnecessary locking > > On Thu, 9 Jun 2016, Sell, Timothy C wrote: > > > From: Thomas Gleixner [mailto:t...@linutronix.de] > > > > > > I think I asked this before, but I might have missed the answer. > > > > > > Why is this a rw_sempahore? It's never taken with down_read and > looking > > > at the usage sites it's simply a mutex, right? > > > > If the semaphore --> mutex change would have been as simple as it > sounds, > > we would have had NO problem including it with the next version (v3) of > this > > patchset. But unfortunately, this change uncovered a latent defect, which > > necessitated yet another patch. (I know... hard to believe that something > > this simple would do that, but it did.) Rather than further complicating > this > > patchset, we thought it would be better to address the visorinput issues > via a > > separate follow-on patchset. > > That makes me curious. What's the issue? Functional is the mutex the same > thing as the r/w semaphore when the latter is only taken down_write and > locked > and released by the same thread, which is the case as far as I can tell. > The issue: using it uninitialized (). A semaphore appears to let you get away with it, but a mutex does NOT. We had to shuffle some things around to get this right. If you're interested in a preview, you can find a patch in github at https://github.com/davidker/unisys/commit/039e6e517b4a17e2d135a9df85cc1e24a39c2670. The second bullet in that commit comment describes the scenario where we were attempting to access the lock in visorinput_open() before we had actually initialized it: * we canNOT get into visorinput_open() until the device structure is totally initialized, by delaying the input_register_device() until the end of device initialization I.e., before this patch, we WERE getting into visorinput_open() during the call to input_register_device() that was done before device initialization was complete, which was BEFORE we initialized the semaphore. There is a 2nd follow-on patch that actually does the simple semaphore --> mutex conversion at https://github.com/davidker/unisys/commit/6f57ed62ae206c23c58ce4a016b08e15639ce9af. > > Is that acceptable for you? > > Please fix it before moving the drivers out of staging. Absolutely. We will probably push that patchset (containing the 2 github patches referenced above) within the next few days, even if this visorbus patchset hasn't moved. Thanks. Tim Sell > > Thanks, > > tglx ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3] storvsc: use small sg_tablesize on x86
On Thu, Jun 09, James Bottomley wrote: > On Thu, 2016-06-09 at 18:25 +0200, Olaf Hering wrote: > > Reducing the sg_tablesize allows booting of 32bit kernels in VMs, > > after > > commit be0cf6ca301c61458dc4aa1a37acf4f58d2ed3d6 ("scsi: storvsc: Set > > the > > tablesize based on the information given by the host") > > > > [5.567138] hv_storvsc vmbus_1: adjusting sg_tablesize 0x800 -> > > 0x20 > > Are you really sure 32 is the correct size? Its a size that works, while the current state does not work at all. > I know 32 it what it had before, but the reason for the commit you > quote was to improve performance ... The commit above broke 32bit. Whoever wants to improve performance on this dead horse can submit another patch. Olaf ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/2] Drivers: hv: Fix some issues in both vmbus as well as util drivers
Fix a race in the registration of user space daemons. Also get rid of timeout in vmbus_open() as timing out here would make it impossible to rollback correctly. Vitaly Kuznetsov (2): Drivers: hv: get rid of timeout in vmbus_open() Drivers: hv: utils: fix a race on userspace daemons registration drivers/hv/channel.c|7 +-- drivers/hv/hv_fcopy.c | 14 ++ drivers/hv/hv_kvp.c | 27 --- drivers/hv/hv_snapshot.c| 16 +++- drivers/hv/hv_utils_transport.c | 15 ++- drivers/hv/hv_utils_transport.h |4 +++- 6 files changed, 55 insertions(+), 28 deletions(-) -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] Drivers: hv: get rid of timeout in vmbus_open()
From: Vitaly Kuznetsov vmbus_teardown_gpadl() can result in infinite wait when it is called on 5 second timeout in vmbus_open(). The issue is caused by the fact that gpadl teardown operation won't ever succeed for an opened channel and the timeout isn't always enough. As a guest, we can always trust the host to respond to our request (and there is nothing we can do if it doesn't). Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan --- drivers/hv/channel.c |7 +-- 1 files changed, 1 insertions(+), 6 deletions(-) diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c index a68830c..9a88c63 100644 --- a/drivers/hv/channel.c +++ b/drivers/hv/channel.c @@ -73,7 +73,6 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size, void *in, *out; unsigned long flags; int ret, err = 0; - unsigned long t; struct page *page; spin_lock_irqsave(&newchannel->lock, flags); @@ -183,11 +182,7 @@ int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size, goto error1; } - t = wait_for_completion_timeout(&open_info->waitevent, 5*HZ); - if (t == 0) { - err = -ETIMEDOUT; - goto error1; - } + wait_for_completion(&open_info->waitevent); spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags); list_del(&open_info->msglistentry); -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] Drivers: hv: utils: fix a race on userspace daemons registration
From: Vitaly Kuznetsov Background: userspace daemons registration protocol for Hyper-V utilities drivers has two steps: 1) daemon writes its own version to kernel 2) kernel reads it and replies with module version at this point we consider the handshake procedure being completed and we do hv_poll_channel() transitioning the utility device to HVUTIL_READY state. At this point we're ready to handle messages from kernel. When hvutil_transport is in HVUTIL_TRANSPORT_CHARDEV mode we have a single buffer for outgoing message. hvutil_transport_send() puts to this buffer and till the buffer is cleared with hvt_op_read() returns -EFAULT to all consequent calls. Host<->guest protocol guarantees there is no more than one request at a time and we will not get new requests till we reply to the previous one so this single message buffer is enough. Now to the race. When we finish negotiation procedure and send kernel module version to userspace with hvutil_transport_send() it goes into the above mentioned buffer and if the daemon is slow enough to read it from there we can get a collision when a request from the host comes, we won't be able to put anything to the buffer so the request will be lost. To solve the issue we need to know when the negotiation is really done (when the version message is read by the daemon) and transition to HVUTIL_READY state after this happens. Implement a callback on read to support this. Old style netlink communication is not affected by the change, we don't really know when these messages are delivered but we don't have a single message buffer there. Reported-by: Barry Davis Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_fcopy.c | 14 ++ drivers/hv/hv_kvp.c | 27 --- drivers/hv/hv_snapshot.c| 16 +++- drivers/hv/hv_utils_transport.c | 15 ++- drivers/hv/hv_utils_transport.h |4 +++- 5 files changed, 54 insertions(+), 22 deletions(-) diff --git a/drivers/hv/hv_fcopy.c b/drivers/hv/hv_fcopy.c index 23c7079..8b2ba98 100644 --- a/drivers/hv/hv_fcopy.c +++ b/drivers/hv/hv_fcopy.c @@ -83,6 +83,12 @@ static void fcopy_timeout_func(struct work_struct *dummy) hv_poll_channel(fcopy_transaction.recv_channel, fcopy_poll_wrapper); } +static void fcopy_register_done(void) +{ + pr_debug("FCP: userspace daemon registered\n"); + hv_poll_channel(fcopy_transaction.recv_channel, fcopy_poll_wrapper); +} + static int fcopy_handle_handshake(u32 version) { u32 our_ver = FCOPY_CURRENT_VERSION; @@ -94,7 +100,8 @@ static int fcopy_handle_handshake(u32 version) break; case FCOPY_VERSION_1: /* Daemon expects us to reply with our own version */ - if (hvutil_transport_send(hvt, &our_ver, sizeof(our_ver))) + if (hvutil_transport_send(hvt, &our_ver, sizeof(our_ver), + fcopy_register_done)) return -EFAULT; dm_reg_value = version; break; @@ -107,8 +114,7 @@ static int fcopy_handle_handshake(u32 version) */ return -EINVAL; } - pr_debug("FCP: userspace daemon ver. %d registered\n", version); - hv_poll_channel(fcopy_transaction.recv_channel, fcopy_poll_wrapper); + pr_debug("FCP: userspace daemon ver. %d connected\n", version); return 0; } @@ -161,7 +167,7 @@ static void fcopy_send_data(struct work_struct *dummy) } fcopy_transaction.state = HVUTIL_USERSPACE_REQ; - rc = hvutil_transport_send(hvt, out_src, out_len); + rc = hvutil_transport_send(hvt, out_src, out_len, NULL); if (rc) { pr_debug("FCP: failed to communicate to the daemon: %d\n", rc); if (cancel_delayed_work_sync(&fcopy_timeout_work)) { diff --git a/drivers/hv/hv_kvp.c b/drivers/hv/hv_kvp.c index cb1a916..5e1fdc8 100644 --- a/drivers/hv/hv_kvp.c +++ b/drivers/hv/hv_kvp.c @@ -102,6 +102,17 @@ static void kvp_poll_wrapper(void *channel) hv_kvp_onchannelcallback(channel); } +static void kvp_register_done(void) +{ + /* +* If we're still negotiating with the host cancel the timeout +* work to not poll the channel twice. +*/ + pr_debug("KVP: userspace daemon registered\n"); + cancel_delayed_work_sync(&kvp_host_handshake_work); + hv_poll_channel(kvp_transaction.recv_channel, kvp_poll_wrapper); +} + static void kvp_register(int reg_value) { @@ -116,7 +127,8 @@ kvp_register(int reg_value) kvp_msg->kvp_hdr.operation = reg_value; strcpy(version, HV_DRV_VERSION); - hvutil_transport_send(hvt, kvp_msg, sizeof(*kvp_msg)); + hvutil_transport_send(hvt, kvp_msg, sizeof(*kvp_msg), + kvp_register_done); kfree(kvp_msg); } } @@ -158,17 +170,10 @@ static in
[PATCH 3/3] staging: lustre: lnet: optimize memory foot print for lnet_libmd
From: Bruno Faccini The lnet_libmd struct fields have been re-ordered to optimize its memory foot-print. Signed-off-by: Bruno Faccini Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4430 Reviewed-on: http://review.whamcloud.com/18586 Reviewed-by: Andreas Dilger Reviewed-by: Doug Oucharek Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/include/linux/lnet/lib-types.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h index 7967b01..79a4ecf 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-types.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h @@ -151,9 +151,9 @@ typedef struct lnet_libmd { int md_refcount; unsigned int md_options; unsigned int md_flags; + unsigned int md_niov; /* # frags at end of struct */ void*md_user_ptr; lnet_eq_t *md_eq; - unsigned int md_niov; /* # frags */ union { struct kvec iov[LNET_MAX_IOV]; lnet_kiov_t kiov[LNET_MAX_IOV]; -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/3] staging: lustre: lnet: Allocate MEs and small MDs in own kmem_caches
From: Bruno Faccini As part of LU-3848 and LU-4330, it has been discovered that LNET MEs and small MDs (<=128 Bytes) are allocated in kmem_cache and thus can suffer quite frequent corruptions, from other modules or Kernel parts, that occur there. To avoid this, MEs and small-MDs specific kmem_cache have been created. Signed-off-by: Bruno Faccini Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4430 Reviewed-on: http://review.whamcloud.com/18586 Reviewed-by: Andreas Dilger Reviewed-by: Doug Oucharek Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/include/linux/lnet/lib-lnet.h | 36 ++-- drivers/staging/lustre/lnet/lnet/api-ni.c | 45 2 files changed, 77 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index 513a822..51ad729 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -178,6 +178,11 @@ lnet_net_lock_current(void) #define MAX_PORTALS64 +#define LNET_SMALL_MD_SIZE offsetof(lnet_libmd_t, md_iov.iov[1]) +extern struct kmem_cache *lnet_mes_cachep; /* MEs kmem_cache */ +extern struct kmem_cache *lnet_small_mds_cachep;/* <= LNET_SMALL_MD_SIZE bytes +* MDs kmem_cache +*/ static inline lnet_eq_t * lnet_eq_alloc(void) { @@ -208,7 +213,19 @@ lnet_md_alloc(lnet_md_t *umd) size = offsetof(lnet_libmd_t, md_iov.iov[niov]); } - LIBCFS_ALLOC(md, size); + if (size <= LNET_SMALL_MD_SIZE) { + md = kmem_cache_alloc(lnet_small_mds_cachep, + GFP_NOFS | __GFP_ZERO); + if (md) { + CDEBUG(D_MALLOC, "slab-alloced 'md' of size %u at %p.\n", + size, md); + } else { + CDEBUG(D_MALLOC, "failed to allocate 'md' of size %u\n", + size); + } + } else { + LIBCFS_ALLOC(md, size); + } if (md) { /* Set here in case of early free */ @@ -230,7 +247,12 @@ lnet_md_free(lnet_libmd_t *md) else size = offsetof(lnet_libmd_t, md_iov.iov[md->md_niov]); - LIBCFS_FREE(md, size); + if (size <= LNET_SMALL_MD_SIZE) { + CDEBUG(D_MALLOC, "slab-freed 'md' at %p.\n", md); + kmem_cache_free(lnet_small_mds_cachep, md); + } else { + LIBCFS_FREE(md, size); + } } static inline lnet_me_t * @@ -238,14 +260,20 @@ lnet_me_alloc(void) { lnet_me_t *me; - LIBCFS_ALLOC(me, sizeof(*me)); + me = kmem_cache_alloc(lnet_mes_cachep, GFP_NOFS | __GFP_ZERO); + if (me) + CDEBUG(D_MALLOC, "slab-alloced 'me' at %p.\n", me); + else + CDEBUG(D_MALLOC, "failed to allocate 'me'\n"); + return me; } static inline void lnet_me_free(lnet_me_t *me) { - LIBCFS_FREE(me, sizeof(*me)); + CDEBUG(D_MALLOC, "slab-freed 'me' at %p.\n", me); + kmem_cache_free(lnet_mes_cachep, me); } static inline lnet_msg_t * diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index fe0dbe7..9db0ff1 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -103,6 +103,46 @@ lnet_init_locks(void) mutex_init(&the_lnet.ln_api_mutex); } +struct kmem_cache *lnet_mes_cachep;/* MEs kmem_cache */ +struct kmem_cache *lnet_small_mds_cachep; /* <= LNET_SMALL_MD_SIZE bytes +* MDs kmem_cache +*/ +static int +lnet_descriptor_setup(void) +{ + /* +* create specific kmem_cache for MEs and small MDs (i.e., originally +* allocated in kmem_cache). +*/ + lnet_mes_cachep = kmem_cache_create("lnet_MEs", sizeof(lnet_me_t), + 0, 0, NULL); + if (!lnet_mes_cachep) + return -ENOMEM; + + lnet_small_mds_cachep = kmem_cache_create("lnet_small_MDs", + LNET_SMALL_MD_SIZE, 0, 0, + NULL); + if (!lnet_small_mds_cachep) + return -ENOMEM; + + return 0; +} + +static void +lnet_descriptor_cleanup(void) +{ + + if (lnet_small_mds_cachep) { + kmem_cache_destroy(lnet_small_mds_cachep); + lnet_small_mds_cachep = NULL; + } + + if (lnet_mes_cachep) { + kmem_cache_destroy(lnet_mes_cachep); + lnet_mes_cachep = NULL; + } +} + static int lnet_create_remote_nets_table(void) { @@ -553,6 +5
[PATCH 0/3] staging: lustre: lnet: bug fixs for 4.7-rc2
Here are the latest fixes for LNet. One fix covers a bug for the infiniband driver that happens when the o2iblnd intereface is pinged before it is finishing setting up. The next patch set from Bruno adds kmem_caches for the LNet layer. Bruno Faccini (2): staging: lustre: lnet: Allocate MEs and small MDs in own kmem_caches staging: lustre: lnet: optimize memory foot print for lnet_libmd Doug Oucharek (1): staging: lustre: lnet: Don't access NULL NI on failure path .../staging/lustre/include/linux/lnet/lib-lnet.h | 36 ++-- .../staging/lustre/include/linux/lnet/lib-types.h |2 +- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c |7 ++- drivers/staging/lustre/lnet/lnet/api-ni.c | 45 4 files changed, 82 insertions(+), 8 deletions(-) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/3] staging: lustre: lnet: Don't access NULL NI on failure path
From: Doug Oucharek In kiblnd_passive_connect(), if we are failing the connection attempt because we cannot find a valid NI (we have a NULL NI), we were coring after the "goto fail" because the failure path was assuming non-NULL NI. This patch ensures we don't dereference a NULL NI on that failure path. Signed-off-by: Doug Oucharek Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8022 Reviewed-on: http://review.whamcloud.com/19614 Reviewed-by: Dmitry Eremin Reviewed-by: James Simmons Reviewed-by: Matt Ezell Reviewed-by: Oleg Drokin --- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c index 0f7e3a1..dbc26f1 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c @@ -2529,12 +2529,13 @@ kiblnd_passive_connect(struct rdma_cm_id *cmid, void *priv, int priv_nob) return 0; failed: - if (ni) + if (ni) { lnet_ni_decref(ni); + rej.ibr_cp.ibcp_queue_depth = kiblnd_msg_queue_size(version, ni); + rej.ibr_cp.ibcp_max_frags = kiblnd_rdma_frags(version, ni); + } rej.ibr_version = version; - rej.ibr_cp.ibcp_queue_depth = kiblnd_msg_queue_size(version, ni); - rej.ibr_cp.ibcp_max_frags = kiblnd_rdma_frags(version, ni); kiblnd_reject(cmid, &rej); return -ECONNREFUSED; -- 1.7.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH net-next] netvsc: Use the new in-place consumption APIs in the rx path
Use the new APIs for eliminating a copy on the receive path. These new APIs also help in minimizing the number of memory barriers we end up issuing (in the ringbuffer code) since we can better control when we want to expose the ring state to the host. Signed-off-by: K. Y. Srinivasan Reviewed-by: Haiyang Zhang Tested-by: Dexuan Cui Tested-by: Simon Xiao --- drivers/net/hyperv/netvsc.c | 88 +-- 1 files changed, 59 insertions(+), 29 deletions(-) diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c index 719cb35..8cd4c19 100644 --- a/drivers/net/hyperv/netvsc.c +++ b/drivers/net/hyperv/netvsc.c @@ -1141,6 +1141,39 @@ static inline void netvsc_receive_inband(struct hv_device *hdev, } } +static void netvsc_process_raw_pkt(struct hv_device *device, + struct vmbus_channel *channel, + struct netvsc_device *net_device, + struct net_device *ndev, + u64 request_id, + struct vmpacket_descriptor *desc) +{ + struct nvsp_message *nvmsg; + + nvmsg = (struct nvsp_message *)((unsigned long) + desc + (desc->offset8 << 3)); + + switch (desc->type) { + case VM_PKT_COMP: + netvsc_send_completion(net_device, channel, device, desc); + break; + + case VM_PKT_DATA_USING_XFER_PAGES: + netvsc_receive(net_device, channel, device, desc); + break; + + case VM_PKT_DATA_INBAND: + netvsc_receive_inband(device, net_device, nvmsg); + break; + + default: + netdev_err(ndev, "unhandled packet type %d, tid %llx\n", + desc->type, request_id); + break; + } +} + + void netvsc_channel_cb(void *context) { int ret; @@ -1153,7 +1186,7 @@ void netvsc_channel_cb(void *context) unsigned char *buffer; int bufferlen = NETVSC_PACKET_SIZE; struct net_device *ndev; - struct nvsp_message *nvmsg; + bool need_to_commit = false; if (channel->primary_channel != NULL) device = channel->primary_channel->device_obj; @@ -1167,39 +1200,36 @@ void netvsc_channel_cb(void *context) buffer = get_per_channel_state(channel); do { + desc = get_next_pkt_raw(channel); + if (desc != NULL) { + netvsc_process_raw_pkt(device, + channel, + net_device, + ndev, + desc->trans_id, + desc); + + put_pkt_raw(channel, desc); + need_to_commit = true; + continue; + } + if (need_to_commit) { + need_to_commit = false; + commit_rd_index(channel); + } + ret = vmbus_recvpacket_raw(channel, buffer, bufferlen, &bytes_recvd, &request_id); if (ret == 0) { if (bytes_recvd > 0) { desc = (struct vmpacket_descriptor *)buffer; - nvmsg = (struct nvsp_message *)((unsigned long) -desc + (desc->offset8 << 3)); - switch (desc->type) { - case VM_PKT_COMP: - netvsc_send_completion(net_device, - channel, - device, desc); - break; - - case VM_PKT_DATA_USING_XFER_PAGES: - netvsc_receive(net_device, channel, - device, desc); - break; - - case VM_PKT_DATA_INBAND: - netvsc_receive_inband(device, - net_device, - nvmsg); - break; - - default: - netdev_err(ndev, - "unhandled packet type %d, " - "tid %llx len %d\n", - desc->type, request_id, - bytes_recvd); -
[PATCH 1/1] Drivers: hv: vmbus: fix the race when querying & updating the percpu list
From: Dexuan Cui There is a rare race when we remove an entry from the global list hv_context.percpu_list[cpu] in hv_process_channel_removal() -> percpu_channel_deq() -> list_del(): at this time, if vmbus_on_event() -> process_chn_event() -> pcpu_relid2channel() is trying to query the list, we can get the kernel fault. Similarly, we also have the issue in the code path: vmbus_process_offer() -> percpu_channel_enq(). We can resolve the issue by disabling the tasklet when updating the list. The patch also moves vmbus_release_relid() to a later place where the channel has been removed from the per-cpu and the global lists. Reported-by: Rolf Neugebauer Signed-off-by: Dexuan Cui Signed-off-by: K. Y. Srinivasan --- drivers/hv/channel.c |6 ++ drivers/hv/channel_mgmt.c | 32 include/linux/hyperv.h|3 +++ 3 files changed, 33 insertions(+), 8 deletions(-) diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c index 9a88c63..e47d37d 100644 --- a/drivers/hv/channel.c +++ b/drivers/hv/channel.c @@ -505,7 +505,6 @@ static void reset_channel_cb(void *arg) static int vmbus_close_internal(struct vmbus_channel *channel) { struct vmbus_channel_close_channel *msg; - struct tasklet_struct *tasklet; int ret; /* @@ -517,8 +516,7 @@ static int vmbus_close_internal(struct vmbus_channel *channel) * To resolve the race, we can serialize them by disabling the * tasklet when the latter is running here. */ - tasklet = hv_context.event_dpc[channel->target_cpu]; - tasklet_disable(tasklet); + hv_event_tasklet_disable(channel); /* * In case a device driver's probe() fails (e.g., @@ -584,7 +582,7 @@ static int vmbus_close_internal(struct vmbus_channel *channel) get_order(channel->ringbuffer_pagecount * PAGE_SIZE)); out: - tasklet_enable(tasklet); + hv_event_tasklet_enable(channel); return ret; } diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index b6c1211..8818b92 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -21,6 +21,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include +#include #include #include #include @@ -303,16 +304,32 @@ static void vmbus_release_relid(u32 relid) vmbus_post_msg(&msg, sizeof(struct vmbus_channel_relid_released)); } +void hv_event_tasklet_disable(struct vmbus_channel *channel) +{ + struct tasklet_struct *tasklet; + tasklet = hv_context.event_dpc[channel->target_cpu]; + tasklet_disable(tasklet); +} + +void hv_event_tasklet_enable(struct vmbus_channel *channel) +{ + struct tasklet_struct *tasklet; + tasklet = hv_context.event_dpc[channel->target_cpu]; + tasklet_enable(tasklet); + + /* In case there is any pending event */ + tasklet_schedule(tasklet); +} + void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid) { unsigned long flags; struct vmbus_channel *primary_channel; - vmbus_release_relid(relid); - BUG_ON(!channel->rescind); BUG_ON(!mutex_is_locked(&vmbus_connection.channel_mutex)); + hv_event_tasklet_disable(channel); if (channel->target_cpu != get_cpu()) { put_cpu(); smp_call_function_single(channel->target_cpu, @@ -321,6 +338,7 @@ void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid) percpu_channel_deq(channel); put_cpu(); } + hv_event_tasklet_enable(channel); if (channel->primary_channel == NULL) { list_del(&channel->listentry); @@ -341,6 +359,8 @@ void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid) cpumask_clear_cpu(channel->target_cpu, &primary_channel->alloced_cpus_in_node); + vmbus_release_relid(relid); + free_channel(channel); } @@ -409,6 +429,7 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel) init_vp_index(newchannel, dev_type); + hv_event_tasklet_disable(newchannel); if (newchannel->target_cpu != get_cpu()) { put_cpu(); smp_call_function_single(newchannel->target_cpu, @@ -418,6 +439,7 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel) percpu_channel_enq(newchannel); put_cpu(); } + hv_event_tasklet_enable(newchannel); /* * This state is used to indicate a successful open @@ -463,12 +485,11 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel) return; err_deq_chan: - vmbus_release_relid(newchannel->offermsg.child_relid); - mutex_lock(&vmbus_connection.channel_mutex); list_del(&newchannel->listentry); mutex_unlock(&vmbus_connection.channel_mutex); + hv_event_tasklet_disable(newchanne
RE: [PATCH net-next] netvsc: Use the new in-place consumption APIs in the rx path
> -Original Message- > From: Linus Torvalds [mailto:torva...@linux-foundation.org] > Sent: Thursday, June 9, 2016 5:12 PM > To: KY Srinivasan > Cc: da...@davemloft.net; net...@vger.kernel.org; lkml ker...@vger.kernel.org>; de...@linuxdriverproject.org; o...@aepfle.de; > a...@canonical.com; jasow...@redhat.com; > leann.ogasaw...@canonical.com > Subject: Re: [PATCH net-next] netvsc: Use the new in-place consumption APIs in > the rx path > > Srinivasan, > > these are all sent through linuxonhyperv.com, and fail DMARC because > they have a microsoft.com address but no valid DKIM. > > Please fix your email setup. You need to go through the real > microsoft smtp servers if you use a microsoft.com address. Or you need > to get linuxonhyperv.com fixed as a smtp server with the proper MS > email signing. > >Linus Thanks Linus, we will fix our email setup. Regards, K. Y > > On Thu, Jun 9, 2016 at 6:34 PM, K. Y. Srinivasan wrote: > > Use the new APIs for eliminating a copy on the receive path. These new APIs > also > > help in minimizing the number of memory barriers we end up issuing (in the > > ringbuffer code) since we can better control when we want to expose the ring > > state to the host. > > > > Signed-off-by: K. Y. Srinivasan > > Reviewed-by: Haiyang Zhang > > Tested-by: Dexuan Cui > > Tested-by: Simon Xiao > > --- > > drivers/net/hyperv/netvsc.c | 88 +- > - > > 1 files changed, 59 insertions(+), 29 deletions(-) > > > > diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c > > index 719cb35..8cd4c19 100644 > > --- a/drivers/net/hyperv/netvsc.c > > +++ b/drivers/net/hyperv/netvsc.c > > @@ -1141,6 +1141,39 @@ static inline void netvsc_receive_inband(struct > hv_device *hdev, > > } > > } > > > > +static void netvsc_process_raw_pkt(struct hv_device *device, > > + struct vmbus_channel *channel, > > + struct netvsc_device *net_device, > > + struct net_device *ndev, > > + u64 request_id, > > + struct vmpacket_descriptor *desc) > > +{ > > + struct nvsp_message *nvmsg; > > + > > + nvmsg = (struct nvsp_message *)((unsigned long) > > + desc + (desc->offset8 << 3)); > > + > > + switch (desc->type) { > > + case VM_PKT_COMP: > > + netvsc_send_completion(net_device, channel, device, desc); > > + break; > > + > > + case VM_PKT_DATA_USING_XFER_PAGES: > > + netvsc_receive(net_device, channel, device, desc); > > + break; > > + > > + case VM_PKT_DATA_INBAND: > > + netvsc_receive_inband(device, net_device, nvmsg); > > + break; > > + > > + default: > > + netdev_err(ndev, "unhandled packet type %d, tid %llx\n", > > + desc->type, request_id); > > + break; > > + } > > +} > > + > > + > > void netvsc_channel_cb(void *context) > > { > > int ret; > > @@ -1153,7 +1186,7 @@ void netvsc_channel_cb(void *context) > > unsigned char *buffer; > > int bufferlen = NETVSC_PACKET_SIZE; > > struct net_device *ndev; > > - struct nvsp_message *nvmsg; > > + bool need_to_commit = false; > > > > if (channel->primary_channel != NULL) > > device = channel->primary_channel->device_obj; > > @@ -1167,39 +1200,36 @@ void netvsc_channel_cb(void *context) > > buffer = get_per_channel_state(channel); > > > > do { > > + desc = get_next_pkt_raw(channel); > > + if (desc != NULL) { > > + netvsc_process_raw_pkt(device, > > + channel, > > + net_device, > > + ndev, > > + desc->trans_id, > > + desc); > > + > > + put_pkt_raw(channel, desc); > > + need_to_commit = true; > > + continue; > > + } > > + if (need_to_commit) { > > + need_to_commit = false; > > + commit_rd_index(channel); > > + } > > + > > ret = vmbus_recvpacket_raw(channel, buffer, bufferlen, > >&bytes_recvd, &request_id); > > if (ret == 0) { > > if (bytes_recvd > 0) { > > desc = (struct vmpacket_descriptor *)buffer; > > - nvmsg = (struct nvsp_message *)((unsigned > > long) > > -desc + (desc->offset8 << 3)); > > -
Re: [PATCH net-next] netvsc: Use the new in-place consumption APIs in the rx path
Srinivasan, these are all sent through linuxonhyperv.com, and fail DMARC because they have a microsoft.com address but no valid DKIM. Please fix your email setup. You need to go through the real microsoft smtp servers if you use a microsoft.com address. Or you need to get linuxonhyperv.com fixed as a smtp server with the proper MS email signing. Linus On Thu, Jun 9, 2016 at 6:34 PM, K. Y. Srinivasan wrote: > Use the new APIs for eliminating a copy on the receive path. These new APIs > also > help in minimizing the number of memory barriers we end up issuing (in the > ringbuffer code) since we can better control when we want to expose the ring > state to the host. > > Signed-off-by: K. Y. Srinivasan > Reviewed-by: Haiyang Zhang > Tested-by: Dexuan Cui > Tested-by: Simon Xiao > --- > drivers/net/hyperv/netvsc.c | 88 > +-- > 1 files changed, 59 insertions(+), 29 deletions(-) > > diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c > index 719cb35..8cd4c19 100644 > --- a/drivers/net/hyperv/netvsc.c > +++ b/drivers/net/hyperv/netvsc.c > @@ -1141,6 +1141,39 @@ static inline void netvsc_receive_inband(struct > hv_device *hdev, > } > } > > +static void netvsc_process_raw_pkt(struct hv_device *device, > + struct vmbus_channel *channel, > + struct netvsc_device *net_device, > + struct net_device *ndev, > + u64 request_id, > + struct vmpacket_descriptor *desc) > +{ > + struct nvsp_message *nvmsg; > + > + nvmsg = (struct nvsp_message *)((unsigned long) > + desc + (desc->offset8 << 3)); > + > + switch (desc->type) { > + case VM_PKT_COMP: > + netvsc_send_completion(net_device, channel, device, desc); > + break; > + > + case VM_PKT_DATA_USING_XFER_PAGES: > + netvsc_receive(net_device, channel, device, desc); > + break; > + > + case VM_PKT_DATA_INBAND: > + netvsc_receive_inband(device, net_device, nvmsg); > + break; > + > + default: > + netdev_err(ndev, "unhandled packet type %d, tid %llx\n", > + desc->type, request_id); > + break; > + } > +} > + > + > void netvsc_channel_cb(void *context) > { > int ret; > @@ -1153,7 +1186,7 @@ void netvsc_channel_cb(void *context) > unsigned char *buffer; > int bufferlen = NETVSC_PACKET_SIZE; > struct net_device *ndev; > - struct nvsp_message *nvmsg; > + bool need_to_commit = false; > > if (channel->primary_channel != NULL) > device = channel->primary_channel->device_obj; > @@ -1167,39 +1200,36 @@ void netvsc_channel_cb(void *context) > buffer = get_per_channel_state(channel); > > do { > + desc = get_next_pkt_raw(channel); > + if (desc != NULL) { > + netvsc_process_raw_pkt(device, > + channel, > + net_device, > + ndev, > + desc->trans_id, > + desc); > + > + put_pkt_raw(channel, desc); > + need_to_commit = true; > + continue; > + } > + if (need_to_commit) { > + need_to_commit = false; > + commit_rd_index(channel); > + } > + > ret = vmbus_recvpacket_raw(channel, buffer, bufferlen, >&bytes_recvd, &request_id); > if (ret == 0) { > if (bytes_recvd > 0) { > desc = (struct vmpacket_descriptor *)buffer; > - nvmsg = (struct nvsp_message *)((unsigned > long) > -desc + (desc->offset8 << 3)); > - switch (desc->type) { > - case VM_PKT_COMP: > - netvsc_send_completion(net_device, > - channel, > - device, desc); > - break; > - > - case VM_PKT_DATA_USING_XFER_PAGES: > - netvsc_receive(net_device, channel, > - device, desc); > - break; > - > - case VM_PKT_DATA_INBAND: > -
Re: [PATCH 2/3] staging: lustre: lnet: Allocate MEs and small MDs in own kmem_caches
On Thu, Jun 09, 2016 at 06:45:46PM -0400, James Simmons wrote: > From: Bruno Faccini > > As part of LU-3848 and LU-4330, it has been discovered that LNET > MEs and small MDs (<=128 Bytes) are allocated in kmem_cache > and thus can suffer quite frequent corruptions, from other modules or > Kernel parts, that occur there. To avoid this, MEs and small-MDs > specific kmem_cache have been created. What? Who corrupts them? That shouldn't be possible, and on some systems, even if you do ask for a separate slab, it will be merged togther with others of the same size. So this patch doesn't do all that much. I think you are having some other problem here, changing to a separate memory cache shouldn't solve corruption issues. sorry, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/3] staging: lustre: lnet: optimize memory foot print for lnet_libmd
On Thu, Jun 09, 2016 at 06:45:47PM -0400, James Simmons wrote: > From: Bruno Faccini > > The lnet_libmd struct fields have been re-ordered to optimize its > memory foot-print. This isn't a regression, so isn't ok for 4.7-rc releases, sorry. greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: dt2811: Fixed commenting coding style issues.
Fixed all 4 commenting coding style warnings generated by checkpatch.pl on dt2811.c Signed-off-by: Akshay Shipurkar --- drivers/staging/comedi/drivers/dt2811.c | 248 1 file changed, 124 insertions(+), 124 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt2811.c b/drivers/staging/comedi/drivers/dt2811.c index a807732..a422c9b 100644 --- a/drivers/staging/comedi/drivers/dt2811.c +++ b/drivers/staging/comedi/drivers/dt2811.c @@ -1,45 +1,45 @@ /* - comedi/drivers/dt2811.c - Hardware driver for Data Translation DT2811 - - COMEDI - Linux Control and Measurement Device Interface - History: - Base Version - David A. Schleef - December 1998 - Updated to work. David does not have a DT2811 - board any longer so this was suffering from bitrot. - Updated performed by ... - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + * comedi/drivers/dt2811.c + * Hardware driver for Data Translation DT2811 + * + * COMEDI - Linux Control and Measurement Device Interface + * History: + * Base Version - David A. Schleef + * December 1998 - Updated to work. David does not have a DT2811 + * board any longer so this was suffering from bitrot. + * Updated performed by ... + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. */ /* -Driver: dt2811 -Description: Data Translation DT2811 -Author: ds -Devices: [Data Translation] DT2811-PGL (dt2811-pgl), DT2811-PGH (dt2811-pgh) -Status: works - -Configuration options: - [0] - I/O port base address - [1] - IRQ, although this is currently unused - [2] - A/D reference - 0 = signle-ended - 1 = differential - 2 = pseudo-differential (common reference) - [3] - A/D range - 0 = [-5, 5] - 1 = [-2.5, 2.5] - 2 = [0, 5] - [4] - D/A 0 range (same choices) - [4] - D/A 1 range (same choices) -*/ + * Driver: dt2811 + * Description: Data Translation DT2811 + * Author: ds + * Devices: [Data Translation] DT2811-PGL (dt2811-pgl), DT2811-PGH (dt2811-pgh) + * Status: works + * + * Configuration options: + * [0] - I/O port base address + * [1] - IRQ, although this is currently unused + * [2] - A/D reference + * 0 = signle-ended + * 1 = differential + * 2 = pseudo-differential (common reference) + * [3] - A/D range + * 0 = [-5, 5] + * 1 = [-2.5, 2.5] + * 2 = [0, 5] + * [4] - D/A 0 range (same choices) + * [4] - D/A 1 range (same choices) + */ #include #include "../comedidev.h" @@ -99,72 +99,72 @@ static const struct comedi_lrange range_dt2811_pgl_ai_5_bipolar = { }; /* - - 0x00ADCSR R/W A/D Control/Status Register - bit 7 - (R) 1 indicates A/D conversion done - reading ADDAT clears bit - (W) ignored - bit 6 - (R) 1 indicates A/D error - (W) ignored - bit 5 - (R) 1 indicates A/D busy, cleared at end - of conversion - (W) ignored - bit 4 - (R) 0 - (W) - bit 3 - (R) 0 - bit 2 - (R/W) 1 indicates interrupts enabled - bits 1,0 - (R/W) mode bits - 00 single conversion on ADGCR load - 01 continuous conversion, internal clock, - (clock enabled on ADGCR load) - 10 continuous conversion, internal clock, - external trigger - 11 continuous conversion, external clock, - external trigger - - 0x01ADGCR R/W A/D Gain/Channel Register - bit 6,7 - (R/W) gain select - 00 gain=1, both PGH, PGL models - 01 gain=2 PGH, 10 PGL - 10 gain=4 PGH, 100 PGL - 11 gain=8 PGH, 500 PGL - bit 4,5 - reserved - bit 3-0 - (R/W) channel select - channel number from 0-15 - - 0x02,0x03 (R) ADDAT A/D Data Register - (W) DADAT0 D/A Data Register 0 - 0x02 low byte - 0x03 high byte - - 0x04,0x05 (W) DADAT0 D/A Data Register 1 - - 0x06 (R) DIO0 Digital Input Port 0 - (W) DIO1 Digital Output Port 1 - - 0x07 TMRCTR (R/W) Timer/Counter Register - bits 6,7 - reserved - bits 5-3 - Timer frequency control (mantissa) - 543 divisor freqency (kHz) - 000 1600 - 001 10 60 - 010 2300 - 011 3200 - 100 4150 - 101 5120 - 110 6100 - 11
[PATCH 5/8] staging/lustre/lov: Fix Multiple Assignments
From: Nathaniel Clark Fix all multiple assignments on lustre/lov directory. Signed-off-by: Nathaniel Clark Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/lov/lov_obd.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c index e15ef2e..c179b31 100644 --- a/drivers/staging/lustre/lustre/lov/lov_obd.c +++ b/drivers/staging/lustre/lustre/lov/lov_obd.c @@ -1772,7 +1772,8 @@ static int lov_fiemap(struct lov_obd *lov, __u32 keylen, void *key, fm_start = fiemap->fm_start; fm_length = fiemap->fm_length; /* Calculate start stripe, last stripe and length of mapping */ - actual_start_stripe = start_stripe = lov_stripe_number(lsm, fm_start); + start_stripe = lov_stripe_number(lsm, fm_start); + actual_start_stripe = start_stripe; fm_end = (fm_length == ~0ULL ? fm_key->oa.o_size : fm_start + fm_length - 1); /* If fm_length != ~0ULL but fm_start+fm_length-1 exceeds file size */ @@ -2095,11 +2096,9 @@ static int lov_set_info_async(const struct lu_env *env, struct obd_export *exp, u32 count; int i, rc = 0, err; struct lov_tgt_desc *tgt; - unsigned incr, check_uuid, -do_inactive, no_set; - unsigned next_id = 0, mds_con = 0; + unsigned int incr = 0, check_uuid = 0, do_inactive = 0, no_set = 0; + unsigned int next_id = 0, mds_con = 0; - incr = check_uuid = do_inactive = no_set = 0; if (!set) { no_set = 1; set = ptlrpc_prep_set(); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/8] staging/lustre/osc: Fix Multiple Assignment Warnings
From: Nathaniel Clark Fix all multiple assignments on lustre/osc directory. Signed-off-by: Nathaniel Clark Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/osc/osc_cache.c | 6 -- drivers/staging/lustre/lustre/osc/osc_io.c | 12 drivers/staging/lustre/lustre/osc/osc_lock.c| 3 ++- drivers/staging/lustre/lustre/osc/osc_request.c | 6 -- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c b/drivers/staging/lustre/lustre/osc/osc_cache.c index 5a14bea..2ca5045 100644 --- a/drivers/staging/lustre/lustre/osc/osc_cache.c +++ b/drivers/staging/lustre/lustre/osc/osc_cache.c @@ -2773,7 +2773,8 @@ int osc_queue_sync_pages(const struct lu_env *env, struct osc_object *obj, ext->oe_sync = 1; ext->oe_urgent = 1; ext->oe_start = start; - ext->oe_end = ext->oe_max_end = end; + ext->oe_end = end; + ext->oe_max_end = end; ext->oe_obj = obj; ext->oe_srvlock = !!(brw_flags & OBD_BRW_SRVLOCK); ext->oe_nr_pages = page_count; @@ -3308,7 +3309,8 @@ int osc_lock_discard_pages(const struct lu_env *env, struct osc_object *osc, goto out; cb = mode == CLM_READ ? check_and_discard_cb : discard_cb; - info->oti_fn_index = info->oti_next_index = start; + info->oti_fn_index = start; + info->oti_next_index = start; do { res = osc_page_gang_lookup(env, io, osc, info->oti_next_index, end, cb, osc); diff --git a/drivers/staging/lustre/lustre/osc/osc_io.c b/drivers/staging/lustre/lustre/osc/osc_io.c index d534b0e..d3bce45 100644 --- a/drivers/staging/lustre/lustre/osc/osc_io.c +++ b/drivers/staging/lustre/lustre/osc/osc_io.c @@ -221,7 +221,8 @@ static void osc_page_touch_at(const struct lu_env *env, kms > loi->loi_kms ? "" : "not ", loi->loi_kms, kms, loi->loi_lvb.lvb_size); - attr->cat_mtime = attr->cat_ctime = LTIME_S(CURRENT_TIME); + attr->cat_ctime = LTIME_S(CURRENT_TIME); + attr->cat_mtime = attr->cat_ctime; valid = CAT_MTIME | CAT_CTIME; if (kms > loi->loi_kms) { attr->cat_kms = kms; @@ -458,7 +459,8 @@ static int osc_io_setattr_start(const struct lu_env *env, unsigned int cl_valid = 0; if (ia_valid & ATTR_SIZE) { - attr->cat_size = attr->cat_kms = size; + attr->cat_size = size; + attr->cat_kms = size; cl_valid = CAT_SIZE | CAT_KMS; } if (ia_valid & ATTR_MTIME_SET) { @@ -526,7 +528,8 @@ static void osc_io_setattr_end(const struct lu_env *env, if (cbargs->opc_rpc_sent) { wait_for_completion(&cbargs->opc_sync); - result = io->ci_result = cbargs->opc_rc; + result = cbargs->opc_rc; + io->ci_result = cbargs->opc_rc; } if (result == 0) { if (oio->oi_lockless) { @@ -575,7 +578,8 @@ static int osc_io_write_start(const struct lu_env *env, OBD_FAIL_TIMEOUT(OBD_FAIL_OSC_DELAY_SETTIME, 1); cl_object_attr_lock(obj); - attr->cat_mtime = attr->cat_ctime = ktime_get_real_seconds(); + attr->cat_ctime = ktime_get_real_seconds(); + attr->cat_mtime = attr->cat_ctime; rc = cl_object_attr_set(env, obj, attr, CAT_MTIME | CAT_CTIME); cl_object_attr_unlock(obj); diff --git a/drivers/staging/lustre/lustre/osc/osc_lock.c b/drivers/staging/lustre/lustre/osc/osc_lock.c index 16f9cd9..d30ed2f 100644 --- a/drivers/staging/lustre/lustre/osc/osc_lock.c +++ b/drivers/staging/lustre/lustre/osc/osc_lock.c @@ -1120,7 +1120,8 @@ static void osc_lock_set_writer(const struct lu_env *env, } } else { LASSERT(cl_io_is_mkwrite(io)); - io_start = io_end = io->u.ci_fault.ft_index; + io_start = io->u.ci_fault.ft_index; + io_end = io->u.ci_fault.ft_index; } if (descr->cld_mode >= CLM_WRITE && diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c index 47417f8..7b1fc7e 100644 --- a/drivers/staging/lustre/lustre/osc/osc_request.c +++ b/drivers/staging/lustre/lustre/osc/osc_request.c @@ -474,7 +474,8 @@ static int osc_real_create(struct obd_export *exp, struct obdo *oa, DEBUG_REQ(D_HA, req, "delorphan from OST integration"); /* Don't resend the delorphan req */ - req->rq_no_resend = req->rq_no_delay = 1; + req->rq_no_resend = 1; + req->rq_no_delay = 1; } rc = ptlrpc_queue_wait(req); @@ -2775,7 +2776,8 @@ static int osc_get_info(const struct lu_env *env, struct obd_export *exp,
[PATCH 4/8] staging/lustre/llite: Fix Multiple Assignments
From: Nathaniel Clark Fix all multiple assignments on lustre/llite directory. Signed-off-by: Nathaniel Clark Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/llite/llite_lib.c | 3 ++- drivers/staging/lustre/lustre/llite/namei.c | 3 ++- drivers/staging/lustre/lustre/llite/vvp_io.c| 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index 96c7e9f..b260f60 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -864,7 +864,8 @@ int ll_fill_super(struct super_block *sb, struct vfsmount *mnt) try_module_get(THIS_MODULE); /* client additional sb info */ - lsi->lsi_llsbi = sbi = ll_init_sbi(sb); + sbi = ll_init_sbi(sb); + lsi->lsi_llsbi = sbi; if (!sbi) { module_put(THIS_MODULE); kfree(cfg); diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index 5eba0eb..95643bc 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -318,7 +318,8 @@ static struct dentry *ll_find_alias(struct inode *inode, struct dentry *dentry) if (hlist_empty(&inode->i_dentry)) return NULL; - discon_alias = invalid_alias = NULL; + discon_alias = NULL; + invalid_alias = NULL; ll_lock_dcache(inode); hlist_for_each_entry(alias, &inode->i_dentry, d_u.d_alias) { diff --git a/drivers/staging/lustre/lustre/llite/vvp_io.c b/drivers/staging/lustre/lustre/llite/vvp_io.c index e26e0f8..763d336 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_io.c +++ b/drivers/staging/lustre/lustre/llite/vvp_io.c @@ -954,7 +954,8 @@ static int vvp_io_write_start(const struct lu_env *env, * out-of-order writes. */ ll_merge_attr(env, inode); - pos = io->u.ci_wr.wr.crw_pos = i_size_read(inode); + pos = i_size_read(inode); + io->u.ci_wr.wr.crw_pos = pos; vio->vui_iocb->ki_pos = pos; } else { LASSERT(vio->vui_iocb->ki_pos == pos); -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/8] staging/lustre/fid: Fix Multiple Assignments
From: Nathaniel Clark Fix all multiple assignments on lustre/fid directory. Signed-off-by: Nathaniel Clark Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/fid/fid_request.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/fid/fid_request.c b/drivers/staging/lustre/lustre/fid/fid_request.c index 3a4df62..9db21ba 100644 --- a/drivers/staging/lustre/lustre/fid/fid_request.c +++ b/drivers/staging/lustre/lustre/fid/fid_request.c @@ -98,8 +98,10 @@ static int seq_client_rpc(struct lu_client_seq *seq, * request here, otherwise if MDT0 is failed(umounted), * it can not release the export of MDT0 */ - if (seq->lcs_type == LUSTRE_SEQ_DATA) - req->rq_no_delay = req->rq_no_resend = 1; + if (seq->lcs_type == LUSTRE_SEQ_DATA) { + req->rq_no_delay = 1; + req->rq_no_resend = 1; + } debug_mask = D_CONSOLE; } else { if (seq->lcs_type == LUSTRE_SEQ_METADATA) { -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/8] staging/lustre/ldlm: Fix Multiple Assignments
From: Nathaniel Clark Fix all multiple assignments on lustre/ldlm directory. Signed-off-by: Nathaniel Clark Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/ldlm/ldlm_lib.c | 3 ++- drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 8 +--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c index b4ffbe2..b6a90b0 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c @@ -345,7 +345,8 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg) * Set cl_chksum* to CRC32 for now to avoid returning screwed info * through procfs. */ - cli->cl_cksum_type = cli->cl_supp_cksum_types = OBD_CKSUM_CRC32; + cli->cl_cksum_type = OBD_CKSUM_CRC32; + cli->cl_supp_cksum_types = OBD_CKSUM_CRC32; atomic_set(&cli->cl_resends, OSC_DEFAULT_RESENDS); /* This value may be reduced at connect time in diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c index ab739f0..3303ffa 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c @@ -1011,9 +1011,11 @@ static int ldlm_setup(void) blp->blp_min_threads = LDLM_NTHRS_INIT; blp->blp_max_threads = LDLM_NTHRS_MAX; } else { - blp->blp_min_threads = blp->blp_max_threads = - min_t(int, LDLM_NTHRS_MAX, max_t(int, LDLM_NTHRS_INIT, -ldlm_num_threads)); + blp->blp_min_threads = min_t(int, LDLM_NTHRS_MAX, +max_t(int, LDLM_NTHRS_INIT, + ldlm_num_threads)); + + blp->blp_max_threads = blp->blp_min_threads; } for (i = 0; i < blp->blp_min_threads; i++) { -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 6/8] staging/lustre/obdclass: Fix Multiple Assignments
From: Nathaniel Clark Fix all multiple assignments on lustre/obdclass directory. Signed-off-by: Nathaniel Clark Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/obdclass/llog.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/llog.c b/drivers/staging/lustre/lustre/obdclass/llog.c index 79194d8..55a9755 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog.c +++ b/drivers/staging/lustre/lustre/obdclass/llog.c @@ -123,8 +123,10 @@ static int llog_read_header(const struct lu_env *env, handle->lgh_last_idx = 0; /* header is record with index 0 */ llh->llh_count = 1; /* for the header record */ llh->llh_hdr.lrh_type = LLOG_HDR_MAGIC; - llh->llh_hdr.lrh_len = llh->llh_tail.lrt_len = LLOG_CHUNK_SIZE; - llh->llh_hdr.lrh_index = llh->llh_tail.lrt_index = 0; + llh->llh_hdr.lrh_len = LLOG_CHUNK_SIZE; + llh->llh_tail.lrt_len = LLOG_CHUNK_SIZE; + llh->llh_hdr.lrh_index = 0; + llh->llh_tail.lrt_index = 0; llh->llh_timestamp = ktime_get_real_seconds(); if (uuid) memcpy(&llh->llh_tgtuuid, uuid, -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/8] Lustre: Multiple assignments removal.
These patches remove multiple assignments in Lustre, that makes checkpatch (somewhat understandably) unhappy. Nathaniel Clark (8): staging/lustre/osc: Fix Multiple Assignment Warnings staging/lustre/fid: Fix Multiple Assignments staging/lustre/ldlm: Fix Multiple Assignments staging/lustre/llite: Fix Multiple Assignments staging/lustre/lov: Fix Multiple Assignments staging/lustre/obdclass: Fix Multiple Assignments staging/lustre/ptlrpc: Fix Multiple Assignments staging/lustre/lmv: Fix Multiple Assignments drivers/staging/lustre/lustre/fid/fid_request.c | 6 -- drivers/staging/lustre/lustre/ldlm/ldlm_lib.c | 3 ++- drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 8 +--- drivers/staging/lustre/lustre/llite/llite_lib.c | 3 ++- drivers/staging/lustre/lustre/llite/namei.c | 3 ++- drivers/staging/lustre/lustre/llite/vvp_io.c| 3 ++- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 3 +-- drivers/staging/lustre/lustre/lov/lov_obd.c | 9 - drivers/staging/lustre/lustre/obdclass/llog.c | 6 -- drivers/staging/lustre/lustre/osc/osc_cache.c | 6 -- drivers/staging/lustre/lustre/osc/osc_io.c | 12 drivers/staging/lustre/lustre/osc/osc_lock.c| 3 ++- drivers/staging/lustre/lustre/osc/osc_request.c | 6 -- drivers/staging/lustre/lustre/ptlrpc/client.c | 6 -- drivers/staging/lustre/lustre/ptlrpc/import.c | 3 ++- drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 3 ++- drivers/staging/lustre/lustre/ptlrpc/pinger.c | 3 ++- drivers/staging/lustre/lustre/ptlrpc/sec_null.c | 3 ++- 18 files changed, 56 insertions(+), 33 deletions(-) -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 7/8] staging/lustre/ptlrpc: Fix Multiple Assignments
From: Nathaniel Clark Fix all multiple assignments on lustre/ptlrpc directory. Signed-off-by: Nathaniel Clark Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/ptlrpc/client.c | 6 -- drivers/staging/lustre/lustre/ptlrpc/import.c | 3 ++- drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 3 ++- drivers/staging/lustre/lustre/ptlrpc/pinger.c | 3 ++- drivers/staging/lustre/lustre/ptlrpc/sec_null.c | 3 ++- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c b/drivers/staging/lustre/lustre/ptlrpc/client.c index 4b7912a..8336ed1 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/client.c +++ b/drivers/staging/lustre/lustre/ptlrpc/client.c @@ -3024,8 +3024,10 @@ void *ptlrpcd_alloc_work(struct obd_import *imp, req->rq_interpret_reply = work_interpreter; /* don't want reply */ req->rq_receiving_reply = 0; - req->rq_req_unlink = req->rq_reply_unlink = 0; - req->rq_no_delay = req->rq_no_resend = 1; + req->rq_req_unlink = 0; + req->rq_reply_unlink = 0; + req->rq_no_delay = 1; + req->rq_no_resend = 1; req->rq_pill.rc_fmt = (void *)&worker_format; spin_lock_init(&req->rq_lock); diff --git a/drivers/staging/lustre/lustre/ptlrpc/import.c b/drivers/staging/lustre/lustre/ptlrpc/import.c index a4f7544..a236e38 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/import.c +++ b/drivers/staging/lustre/lustre/ptlrpc/import.c @@ -698,7 +698,8 @@ int ptlrpc_connect_import(struct obd_import *imp) lustre_msg_add_op_flags(request->rq_reqmsg, MSG_CONNECT_NEXT_VER); - request->rq_no_resend = request->rq_no_delay = 1; + request->rq_no_resend = 1; + request->rq_no_delay = 1; request->rq_send_state = LUSTRE_IMP_CONNECTING; /* Allow a slightly larger reply for future growth compatibility */ req_capsule_set_size(&request->rq_pill, &RMF_CONNECT_DATA, RCL_SERVER, diff --git a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c index 64c0f1e..ff40be2 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +++ b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c @@ -872,7 +872,8 @@ ptlrpc_lprocfs_svc_req_history_next(struct seq_file *s, if (i > srhi->srhi_idx) { /* reset iterator for a new CPT */ srhi->srhi_req = NULL; - seq = srhi->srhi_seq = 0; + seq = 0; + srhi->srhi_seq = 0; } else { /* the next sequence */ seq = srhi->srhi_seq + (1 << svc->srv_cpt_bits); } diff --git a/drivers/staging/lustre/lustre/ptlrpc/pinger.c b/drivers/staging/lustre/lustre/ptlrpc/pinger.c index 8a86931..d9d4ca2 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pinger.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pinger.c @@ -57,7 +57,8 @@ ptlrpc_prep_ping(struct obd_import *imp) LUSTRE_OBD_VERSION, OBD_PING); if (req) { ptlrpc_request_set_replen(req); - req->rq_no_resend = req->rq_no_delay = 1; + req->rq_no_resend = 1; + req->rq_no_delay = 1; } return req; } diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_null.c b/drivers/staging/lustre/lustre/ptlrpc/sec_null.c index 40e5349..af92e9e 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_null.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_null.c @@ -265,7 +265,8 @@ int null_enlarge_reqbuf(struct ptlrpc_sec *sec, memcpy(newbuf, req->rq_reqbuf, req->rq_reqlen); kvfree(req->rq_reqbuf); - req->rq_reqbuf = req->rq_reqmsg = newbuf; + req->rq_reqbuf = newbuf; + req->rq_reqmsg = newbuf; req->rq_reqbuf_len = alloc_size; if (req->rq_import) -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 8/8] staging/lustre/lmv: Fix Multiple Assignments
From: Nathaniel Clark Fix all multiple assignments on lustre/lmv directory. Signed-off-by: Nathaniel Clark Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index 9e31f6b..1d9875e 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -2686,7 +2686,7 @@ static int lmv_quotactl(struct obd_device *unused, struct obd_export *exp, struct lmv_obd *lmv = &obd->u.lmv; struct lmv_tgt_desc *tgt = lmv->tgts[0]; int rc = 0, i; - __u64 curspace, curinodes; + __u64 curspace = 0, curinodes = 0; if (!tgt || !tgt->ltd_exp || !tgt->ltd_active || !lmv->desc.ld_tgt_count) { @@ -2699,7 +2699,6 @@ static int lmv_quotactl(struct obd_device *unused, struct obd_export *exp, return rc; } - curspace = curinodes = 0; for (i = 0; i < lmv->desc.ld_tgt_count; i++) { int err; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel