[PATCH 1/1] staging: rtl8723au: Remove unnecessary OOM message
This patch reduces the kernel size by removing error messages that duplicate the normal OOM message. A simplified version of the semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr) @@ identifier f,print,l; expression e; constant char[] c; @@ e = \(kzalloc\|kmalloc\|devm_kzalloc\|devm_kmalloc\)(...); if (e == NULL) { <+... - print(...,c,...); ... when any ( goto l; | return ...; ) ...+> } Signed-off-by: Quentin Lambert --- drivers/staging/rtl8723au/hal/rtl8723a_cmd.c | 8 ++-- drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 8 ++-- drivers/staging/rtl8723au/hal/usb_ops_linux.c | 6 +- drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 5 - 4 files changed, 5 insertions(+), 22 deletions(-) diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c index 7b56411..38f5b7f 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c @@ -462,10 +462,8 @@ static void SetFwRsvdPagePkt(struct rtw_adapter *padapter, bool bDLFinished) DBG_8723A("%s\n", __func__); ReservedPagePacket = kzalloc(1000, GFP_KERNEL); - if (ReservedPagePacket == NULL) { - DBG_8723A("%s: alloc ReservedPagePacket fail!\n", __func__); + if (ReservedPagePacket == NULL) return; - } pHalData = GET_HAL_DATA(padapter); pxmitpriv = &padapter->xmitpriv; @@ -669,10 +667,8 @@ static void SetFwRsvdPagePkt_BTCoex(struct rtw_adapter *padapter) DBG_8723A("+%s\n", __func__); ReservedPagePacket = kzalloc(1024, GFP_KERNEL); - if (ReservedPagePacket == NULL) { - DBG_8723A("%s: alloc ReservedPagePacket fail!\n", __func__); + if (ReservedPagePacket == NULL) return; - } pHalData = GET_HAL_DATA(padapter); pxmitpriv = &padapter->xmitpriv; diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c index a5eadd4..6d50b09 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c @@ -401,10 +401,8 @@ hal_ReadEFuse_WiFi(struct rtw_adapter *padapter, } efuseTbl = kmalloc(EFUSE_MAP_LEN_8723A, GFP_KERNEL); - if (efuseTbl == NULL) { - DBG_8723A("%s: alloc efuseTbl fail!\n", __func__); + if (efuseTbl == NULL) return; - } /* 0xff will be efuse default value instead of 0x00. */ memset(efuseTbl, 0xFF, EFUSE_MAP_LEN_8723A); @@ -494,10 +492,8 @@ hal_ReadEFuse_BT(struct rtw_adapter *padapter, } efuseTbl = kmalloc(EFUSE_BT_MAP_LEN, GFP_KERNEL); - if (efuseTbl == NULL) { - DBG_8723A("%s: efuseTbl malloc fail!\n", __func__); + if (efuseTbl == NULL) return; - } /* 0xff will be efuse default value instead of 0x00. */ memset(efuseTbl, 0xFF, EFUSE_BT_MAP_LEN); diff --git a/drivers/staging/rtl8723au/hal/usb_ops_linux.c b/drivers/staging/rtl8723au/hal/usb_ops_linux.c index a6d16ad..f1e9202 100644 --- a/drivers/staging/rtl8723au/hal/usb_ops_linux.c +++ b/drivers/staging/rtl8723au/hal/usb_ops_linux.c @@ -256,12 +256,8 @@ static void usb_read_interrupt_complete(struct urb *purb) c2w = kmalloc(sizeof(struct evt_work), GFP_ATOMIC); - if (!c2w) { - printk(KERN_WARNING "%s: unable to " - "allocate work buffer\n", - __func__); + if (!c2w) goto urb_submit; - } c2w->adapter = padapter; INIT_WORK(&c2w->work, rtw_evt_work); diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c index 537bd82..40bdf4b 100644 --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c @@ -1327,8 +1327,6 @@ static int rtw_cfg80211_set_probe_req_wpsp2pie(struct rtw_adapter *padapter, pmlmepriv->wps_probe_req_ie = kmemdup(wps_ie, wps_ie[1], GFP_KERNEL); if (pmlmepriv->wps_probe_req_ie == NULL) { - DBG_8723A("%s()-%d: kmalloc() ERROR!\n", - __func__, __LINE__); return -EINVAL; } pmlmepriv->wps_probe_req_ie_len = wps_ie[1]; @@ -2619,8 +2617,6 @@ static int rtw_cfg80211_add_monitor_if(struct rtw_adapter *padapter, char *name, /* wde
[PATCH v2] staging:lustre:libcfs: Merge linux-proc.c into module.c
module.c was previously the sole exporter of symbols from linux-proc.c This patch removes the global symbols by merging the two files Signed-off-by: Matthew Tyler --- drivers/staging/lustre/lustre/libcfs/Makefile | 2 +- .../lustre/lustre/libcfs/linux/linux-proc.c| 577 - drivers/staging/lustre/lustre/libcfs/module.c | 561 +++- 3 files changed, 548 insertions(+), 592 deletions(-) delete mode 100644 drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c diff --git a/drivers/staging/lustre/lustre/libcfs/Makefile b/drivers/staging/lustre/lustre/libcfs/Makefile index fcecbd2..2996a48 100644 --- a/drivers/staging/lustre/lustre/libcfs/Makefile +++ b/drivers/staging/lustre/lustre/libcfs/Makefile @@ -3,7 +3,7 @@ obj-$(CONFIG_LUSTRE_FS) += libcfs.o libcfs-linux-objs := linux-tracefile.o linux-debug.o libcfs-linux-objs += linux-prim.o linux-cpu.o libcfs-linux-objs += linux-tcpip.o -libcfs-linux-objs += linux-proc.o linux-curproc.o +libcfs-linux-objs += linux-curproc.o libcfs-linux-objs += linux-module.o libcfs-linux-objs += linux-crypto.o libcfs-linux-objs += linux-crypto-adler.o diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c deleted file mode 100644 index 3100cb1..000 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c +++ /dev/null @@ -1,577 +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) 2008, 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. - * - * libcfs/libcfs/linux/linux-proc.c - * - * Author: Zach Brown - * Author: Peter J. Braam - * Author: Phil Schwan - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include -#include - -# define DEBUG_SUBSYSTEM S_LNET - -#include "../../../include/linux/libcfs/libcfs.h" -#include -#include "../tracefile.h" - -static struct ctl_table_header *lnet_table_header = NULL; -extern char lnet_upcall[1024]; -/** - * The path of debug log dump upcall script. - */ -extern char lnet_debug_log_upcall[1024]; - -#define CTL_LNET (0x100) -enum { - PSDEV_DEBUG = 1, /* control debugging */ - PSDEV_SUBSYSTEM_DEBUG,/* control debugging */ - PSDEV_PRINTK, /* force all messages to console */ - PSDEV_CONSOLE_RATELIMIT, /* ratelimit console messages */ - PSDEV_CONSOLE_MAX_DELAY_CS, /* maximum delay over which we skip messages */ - PSDEV_CONSOLE_MIN_DELAY_CS, /* initial delay over which we skip messages */ - PSDEV_CONSOLE_BACKOFF,/* delay increase factor */ - PSDEV_DEBUG_PATH, /* crashdump log location */ - PSDEV_DEBUG_DUMP_PATH,/* crashdump tracelog location */ - PSDEV_CPT_TABLE, /* information about cpu partitions */ - PSDEV_LNET_UPCALL, /* User mode upcall script */ - PSDEV_LNET_MEMUSED, /* bytes currently PORTAL_ALLOCated */ - PSDEV_LNET_CATASTROPHE, /* if we have LBUGged or panic'd */ - PSDEV_LNET_PANIC_ON_LBUG, /* flag to panic on LBUG */ - PSDEV_LNET_DUMP_KERNEL, /* snapshot kernel debug buffer to file */ - PSDEV_LNET_DAEMON_FILE, /* spool kernel debug buffer to file */ - PSDEV_LNET_DEBUG_MB, /* size of debug buffer */ - PSDEV_LNET_DEBUG_LOG_UPCALL, /* debug log upcall script */ - PSDEV_LNET_WATCHDOG_RATELIMIT, /* ratelimit watchdog messages */ - PSDEV_LNET_FORCE_LBUG,/* hook to force an LBUG */ - PSDEV_LNET_FAIL_LOC, /* control test failures instrumentation */ - PSDEV_LNET_FAIL_VAL, /* userdata for fail loc */ -}; - -static int proc_call_handler(void *data, int write, loff_t *ppos, - void __user *buffer, size_t *lenp, - int (*handler)(void *data, int write, - loff_t pos, void __user *buffer, int len)) -{ - int rc = handler(data, write, *ppos, buffer, *lenp);
[PATCH v2] staging:lustre:libcfs: Merge linux-proc.c into module.c
module.c was previously the sole exporter of symbols from linux-proc.c This patch removes the global symbols by merging the two files Signed-off-by: Matthew Tyler --- drivers/staging/lustre/lustre/libcfs/Makefile | 2 +- .../lustre/lustre/libcfs/linux/linux-proc.c| 577 - drivers/staging/lustre/lustre/libcfs/module.c | 561 +++- 3 files changed, 548 insertions(+), 592 deletions(-) delete mode 100644 drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c diff --git a/drivers/staging/lustre/lustre/libcfs/Makefile b/drivers/staging/lustre/lustre/libcfs/Makefile index fcecbd2..2996a48 100644 --- a/drivers/staging/lustre/lustre/libcfs/Makefile +++ b/drivers/staging/lustre/lustre/libcfs/Makefile @@ -3,7 +3,7 @@ obj-$(CONFIG_LUSTRE_FS) += libcfs.o libcfs-linux-objs := linux-tracefile.o linux-debug.o libcfs-linux-objs += linux-prim.o linux-cpu.o libcfs-linux-objs += linux-tcpip.o -libcfs-linux-objs += linux-proc.o linux-curproc.o +libcfs-linux-objs += linux-curproc.o libcfs-linux-objs += linux-module.o libcfs-linux-objs += linux-crypto.o libcfs-linux-objs += linux-crypto-adler.o diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c deleted file mode 100644 index 3100cb1..000 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c +++ /dev/null @@ -1,577 +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) 2008, 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. - * - * libcfs/libcfs/linux/linux-proc.c - * - * Author: Zach Brown - * Author: Peter J. Braam - * Author: Phil Schwan - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include -#include - -# define DEBUG_SUBSYSTEM S_LNET - -#include "../../../include/linux/libcfs/libcfs.h" -#include -#include "../tracefile.h" - -static struct ctl_table_header *lnet_table_header = NULL; -extern char lnet_upcall[1024]; -/** - * The path of debug log dump upcall script. - */ -extern char lnet_debug_log_upcall[1024]; - -#define CTL_LNET (0x100) -enum { - PSDEV_DEBUG = 1, /* control debugging */ - PSDEV_SUBSYSTEM_DEBUG,/* control debugging */ - PSDEV_PRINTK,/* force all messages to console */ - PSDEV_CONSOLE_RATELIMIT, /* ratelimit console messages */ - PSDEV_CONSOLE_MAX_DELAY_CS, /* maximum delay over which we skip messages */ - PSDEV_CONSOLE_MIN_DELAY_CS, /* initial delay over which we skip messages */ - PSDEV_CONSOLE_BACKOFF,/* delay increase factor */ - PSDEV_DEBUG_PATH,/* crashdump log location */ - PSDEV_DEBUG_DUMP_PATH,/* crashdump tracelog location */ - PSDEV_CPT_TABLE, /* information about cpu partitions */ - PSDEV_LNET_UPCALL, /* User mode upcall script */ - PSDEV_LNET_MEMUSED, /* bytes currently PORTAL_ALLOCated */ - PSDEV_LNET_CATASTROPHE, /* if we have LBUGged or panic'd */ - PSDEV_LNET_PANIC_ON_LBUG, /* flag to panic on LBUG */ - PSDEV_LNET_DUMP_KERNEL, /* snapshot kernel debug buffer to file */ - PSDEV_LNET_DAEMON_FILE, /* spool kernel debug buffer to file */ - PSDEV_LNET_DEBUG_MB, /* size of debug buffer */ - PSDEV_LNET_DEBUG_LOG_UPCALL, /* debug log upcall script */ - PSDEV_LNET_WATCHDOG_RATELIMIT, /* ratelimit watchdog messages */ - PSDEV_LNET_FORCE_LBUG,/* hook to force an LBUG */ - PSDEV_LNET_FAIL_LOC, /* control test failures instrumentation */ - PSDEV_LNET_FAIL_VAL, /* userdata for fail loc */ -}; - -static int proc_call_handler(void *data, int write, loff_t *ppos, -
Re: [PATCH v3 0/1] drivers/bus: fsl-mc object allocator driver
On 06.03.15 02:35, J. German Rivera wrote: > This patch series introduces the object allocator driver for the > Freescale Management Complex (fsl-mc) of QorIQ Ls2 SoCs This patch > series is dependent on the patch series drivers/bus: "Freescale > Management Complex bus driver patch series Besides adding the object > allocator functionality". When your patch set only contains a single patch, it's pretty useless to bloat it by 100% to add a cover letter. Just send the patch as a single patch :). Alex ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v9 0/3] staging: fsl-mc: Freescale Management Complex bus driver patch series
On 06.03.15 02:29, J. German Rivera wrote: > This patch series introduces Linux support for the Freescale > Management Complex (fsl-mc) hardware. This patch series is dependent > on the patch series "ARM64: Add support for FSL's LS2085A SoC" > (http://thread.gmane.org/gmane.linux.ports.arm.kernel/351829) > > The fsl-mc is a hardware resource manager that manages specialized > hardware objects used in network-oriented packet processing > applications. After the fsl-mc block is enabled, pools of hardware > resources are available, such as queues, buffer pools, I/O > interfaces. These resources are building blocks that can be > used to create functional hardware objects such as network > interfaces, crypto accelerator instances, or L2 switches. > > All the fsl-mc managed hardware resources/objects are represented in > a physical grouping mechanism called a 'container' or DPRC (data > path resource container). > > From the point of view of an OS, a DPRC functions similar to a plug > and play bus. Using fsl-mc commands software can enumerate the > contents of the DPRC discovering the hardware objects present > and binding them to drivers. Hardware objects can be created > and removed dynamically, providing hot pluggability of the hardware > objects. > > Software contexts interact with the fsl-mc by sending commands through > a memory mapped hardware interface called an "MC portal". Every > fsl-mc object type has a command set to manage the objects. Key > DPRC commands include: >-create/destroy a DPRC >-enumerate objects and resource pools in the DPRC, including > identifying mappable regions and the number of IRQs an object > may have >-IRQ configuration >-move objects/resources between DPRCs >-connecting objects (e.g. connecting a network interface to > an L2 switch port) >-reset Acked-by: Alexander Graf Alex ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 1/1] staging: fsl-mc: fsl-mc object allocator driver
On 06.03.15 02:35, J. German Rivera wrote: > The fsl-mc object allocator driver manages "allocatable" fsl-mc > objects such as DPBPs, DPMCPs and DPCONs. It provides services to > other fsl-mc drivers to allocate/deallocate these types of objects. > > Signed-off-by: J. German Rivera > Signed-off-by: Stuart Yoder Acked-by: Alexander Graf Alex ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 00/15] staging: comedi: cleanup NULL pointer checks
On 04/03/15 19:15, H Hartley Sweeten wrote: For aesthetics, change all the NULL comparisons from (foo == NULL) to (!foo) and (foo != NULL) to simply (foo). In addition, remove the NULL pointer checks of the 'cmd' in the s626 driver. The 'cmd' is the address of a member variable in a struct. It will always be valid. H Hartley Sweeten (15): staging: comedi: comedi_fops: (!foo) preferred over (foo == NULL) staging: comedi: drivers: (!foo) preferred over (foo == NULL) staging: comedi: amplc_pci224: (!foo) preferred over (foo == NULL) staging: comedi: amplc_pci230: (!foo) preferred over (foo == NULL) staging: comedi: cb_pcidas64: (!foo) preferred over (foo == NULL) staging: comedi: mite: (!foo) preferred over (foo == NULL) staging: comedi: ni_660x: (!foo) preferred over (foo == NULL) staging: comedi: ni_atmio: (!foo) preferred over (foo == NULL) staging: comedi: ni_labpc_common: (!foo) preferred over (foo == NULL) staging: comedi: ni_pcidio: (!foo) preferred over (foo == NULL) staging: comedi: ni_pcimio: (!foo) preferred over (foo == NULL) staging: comedi: ni_tiocmd: (!foo) preferred over (foo == NULL) staging: comedi: ni_mio_common: (!foo) preferred over (foo == NULL) staging: comedi: kcomedilib_main: (!foo) preferred over (foo == NULL) staging: comedi: s626: remove unnecessary 'cmd' pointer checks drivers/staging/comedi/comedi_fops.c | 22 +++--- drivers/staging/comedi/drivers.c | 8 drivers/staging/comedi/drivers/amplc_pci224.c | 2 +- drivers/staging/comedi/drivers/amplc_pci230.c | 2 +- drivers/staging/comedi/drivers/cb_pcidas64.c | 10 +- drivers/staging/comedi/drivers/mite.c | 6 +++--- drivers/staging/comedi/drivers/ni_660x.c | 6 +++--- drivers/staging/comedi/drivers/ni_atmio.c | 2 +- drivers/staging/comedi/drivers/ni_labpc_common.c | 2 +- drivers/staging/comedi/drivers/ni_mio_common.c | 12 ++-- drivers/staging/comedi/drivers/ni_pcidio.c | 4 ++-- drivers/staging/comedi/drivers/ni_pcimio.c | 10 +- drivers/staging/comedi/drivers/ni_tiocmd.c | 6 +++--- drivers/staging/comedi/drivers/s626.c | 8 ++-- .../staging/comedi/kcomedilib/kcomedilib_main.c| 2 +- 15 files changed, 49 insertions(+), 53 deletions(-) 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 15/15] staging: comedi: s626: remove unnecessary 'cmd' pointer checks
On 04/03/15 19:15, H Hartley Sweeten wrote: The local variable 'cmd' is a pointer to the address of a member variable of a struct. It will always be valid. Remove the unnecessary checks. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/s626.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c index fc497dd..422ea9c 100644 --- a/drivers/staging/comedi/drivers/s626.c +++ b/drivers/staging/comedi/drivers/s626.c @@ -1576,7 +1576,7 @@ static void s626_reset_adc(struct comedi_device *dev, uint8_t *ppl) dev->mmio + S626_P_RPSADDR1); /* Construct RPS program in rps_buf DMA buffer */ - if (cmd != NULL && cmd->scan_begin_src != TRIG_FOLLOW) { + if (cmd->scan_begin_src != TRIG_FOLLOW) { /* Wait for Start trigger. */ *rps++ = S626_RPS_PAUSE | S626_RPS_SIGADC; *rps++ = S626_RPS_CLRSIGNAL | S626_RPS_SIGADC; @@ -1665,7 +1665,7 @@ static void s626_reset_adc(struct comedi_device *dev, uint8_t *ppl) *rps++ = jmp_adrs; } - if (cmd != NULL && cmd->convert_src != TRIG_NOW) { + if (cmd->convert_src != TRIG_NOW) { /* Wait for Start trigger. */ *rps++ = S626_RPS_PAUSE | S626_RPS_SIGADC; *rps++ = S626_RPS_CLRSIGNAL | S626_RPS_SIGADC; @@ -2034,10 +2034,6 @@ static int s626_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) /* reset ai_cmd_running flag */ devpriv->ai_cmd_running = 0; - /* test if cmd is valid */ - if (cmd == NULL) - return -EINVAL; - s626_ai_load_polllist(ppl, cmd); devpriv->ai_cmd_running = 1; devpriv->ai_convert_count = 0; Just a remark... s626_initialize() has some '#if 0'-disabled code that calls s626_reset_adc() before s->async (and its 'cmd' member) has been allocated, so that should really be removed! -- -=( 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 0/4] staging: comedi: miscellaneous cleanup
On 05/03/15 20:21, H Hartley Sweeten wrote: Following are some miscellaneous cleanup patches I have been sitting on. If necessary I can break them up but they are pretty straight forward. H Hartley Sweeten (4): staging: comedi: drivers/*.c: fix common misspellings staging: comedi: drivers/*.c: alignment should match open parenthesis staging: comedi: drivers/*.c: remove unnecessary blank lines staging: comedi: drivers/*.c: add missing braces {} to if/else branches drivers/staging/comedi/drivers/8255_pci.c | 2 +- drivers/staging/comedi/drivers/addi_apci_1032.c| 4 +-- drivers/staging/comedi/drivers/addi_apci_1500.c| 4 +-- drivers/staging/comedi/drivers/addi_apci_1564.c| 4 +-- drivers/staging/comedi/drivers/addi_apci_3501.c| 2 +- drivers/staging/comedi/drivers/addi_watchdog.c | 2 +- drivers/staging/comedi/drivers/adl_pci8164.c | 2 +- drivers/staging/comedi/drivers/adl_pci9111.c | 7 +++-- drivers/staging/comedi/drivers/adl_pci9118.c | 3 +-- drivers/staging/comedi/drivers/adq12b.c| 3 --- drivers/staging/comedi/drivers/adv_pci1710.c | 2 +- drivers/staging/comedi/drivers/adv_pci_dio.c | 1 - .../staging/comedi/drivers/amplc_pc236_common.c| 1 - drivers/staging/comedi/drivers/amplc_pci224.c | 3 --- drivers/staging/comedi/drivers/cb_das16_cs.c | 2 -- drivers/staging/comedi/drivers/cb_pcidas.c | 5 ++-- drivers/staging/comedi/drivers/cb_pcidas64.c | 25 + drivers/staging/comedi/drivers/cb_pcimdda.c| 2 +- drivers/staging/comedi/drivers/comedi_bond.c | 7 +++-- drivers/staging/comedi/drivers/comedi_isadma.c | 3 ++- drivers/staging/comedi/drivers/contec_pci_dio.c| 2 +- drivers/staging/comedi/drivers/daqboard2000.c | 2 +- drivers/staging/comedi/drivers/das08.c | 2 +- drivers/staging/comedi/drivers/das16.c | 2 +- drivers/staging/comedi/drivers/das16m1.c | 2 +- drivers/staging/comedi/drivers/das1800.c | 1 - drivers/staging/comedi/drivers/das800.c| 4 --- drivers/staging/comedi/drivers/dmm32at.c | 5 ++-- drivers/staging/comedi/drivers/dt2801.c| 1 - drivers/staging/comedi/drivers/dt2811.c| 1 - drivers/staging/comedi/drivers/dt2814.c| 2 -- drivers/staging/comedi/drivers/dt2815.c| 1 - drivers/staging/comedi/drivers/dt282x.c| 3 +-- drivers/staging/comedi/drivers/dyna_pci10xx.c | 17 +++- drivers/staging/comedi/drivers/gsc_hpdi.c | 1 - drivers/staging/comedi/drivers/icp_multi.c | 3 +-- drivers/staging/comedi/drivers/me4000.c| 31 -- drivers/staging/comedi/drivers/mf6x4.c | 1 - drivers/staging/comedi/drivers/mpc624.c| 1 - drivers/staging/comedi/drivers/ni_65xx.c | 4 +-- drivers/staging/comedi/drivers/ni_660x.c | 1 - drivers/staging/comedi/drivers/ni_670x.c | 2 +- drivers/staging/comedi/drivers/ni_atmio.c | 2 -- drivers/staging/comedi/drivers/ni_atmio16d.c | 1 - drivers/staging/comedi/drivers/ni_labpc_pci.c | 2 +- drivers/staging/comedi/drivers/ni_mio_common.c | 10 +++ drivers/staging/comedi/drivers/ni_pcidio.c | 3 ++- drivers/staging/comedi/drivers/ni_pcimio.c | 1 - drivers/staging/comedi/drivers/ni_tiocmd.c | 2 +- drivers/staging/comedi/drivers/pcl816.c| 3 --- drivers/staging/comedi/drivers/pcmuio.c| 4 +-- drivers/staging/comedi/drivers/quatech_daqp_cs.c | 1 - drivers/staging/comedi/drivers/rtd520.c| 5 ++-- drivers/staging/comedi/drivers/s626.c | 20 +++--- drivers/staging/comedi/drivers/serial2002.c| 3 --- drivers/staging/comedi/drivers/ssv_dnp.c | 1 - drivers/staging/comedi/drivers/unioxx5.c | 9 +++ drivers/staging/comedi/drivers/usbdux.c| 5 ++-- drivers/staging/comedi/drivers/usbduxfast.c| 1 - 59 files changed, 100 insertions(+), 146 deletions(-) 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 1/1] staging: rtl8723au: Remove unnecessary OOM message
Quentin Lambert writes: > This patch reduces the kernel size by removing error messages that duplicate > the normal OOM message. > > A simplified version of the semantic patch that finds this problem is as > follows: (http://coccinelle.lip6.fr) This patch removes useful warnings about what allocation failed. The messages removed are NOT duplicate! NACK Jes > > @@ > identifier f,print,l; > expression e; > constant char[] c; > @@ > > e = \(kzalloc\|kmalloc\|devm_kzalloc\|devm_kmalloc\)(...); > if (e == NULL) { > <+... > - print(...,c,...); > ... when any > ( > goto l; > | > return ...; > ) > ...+> } > > Signed-off-by: Quentin Lambert > --- > drivers/staging/rtl8723au/hal/rtl8723a_cmd.c | 8 ++-- > drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 8 ++-- > drivers/staging/rtl8723au/hal/usb_ops_linux.c | 6 +- > drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 5 - > 4 files changed, 5 insertions(+), 22 deletions(-) > > diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c > b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c > index 7b56411..38f5b7f 100644 > --- a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c > +++ b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c > @@ -462,10 +462,8 @@ static void SetFwRsvdPagePkt(struct rtw_adapter > *padapter, bool bDLFinished) > DBG_8723A("%s\n", __func__); > > ReservedPagePacket = kzalloc(1000, GFP_KERNEL); > - if (ReservedPagePacket == NULL) { > - DBG_8723A("%s: alloc ReservedPagePacket fail!\n", __func__); > + if (ReservedPagePacket == NULL) > return; > - } > > pHalData = GET_HAL_DATA(padapter); > pxmitpriv = &padapter->xmitpriv; > @@ -669,10 +667,8 @@ static void SetFwRsvdPagePkt_BTCoex(struct rtw_adapter > *padapter) > DBG_8723A("+%s\n", __func__); > > ReservedPagePacket = kzalloc(1024, GFP_KERNEL); > - if (ReservedPagePacket == NULL) { > - DBG_8723A("%s: alloc ReservedPagePacket fail!\n", __func__); > + if (ReservedPagePacket == NULL) > return; > - } > > pHalData = GET_HAL_DATA(padapter); > pxmitpriv = &padapter->xmitpriv; > diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c > b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c > index a5eadd4..6d50b09 100644 > --- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c > +++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c > @@ -401,10 +401,8 @@ hal_ReadEFuse_WiFi(struct rtw_adapter *padapter, > } > > efuseTbl = kmalloc(EFUSE_MAP_LEN_8723A, GFP_KERNEL); > - if (efuseTbl == NULL) { > - DBG_8723A("%s: alloc efuseTbl fail!\n", __func__); > + if (efuseTbl == NULL) > return; > - } > /* 0xff will be efuse default value instead of 0x00. */ > memset(efuseTbl, 0xFF, EFUSE_MAP_LEN_8723A); > > @@ -494,10 +492,8 @@ hal_ReadEFuse_BT(struct rtw_adapter *padapter, > } > > efuseTbl = kmalloc(EFUSE_BT_MAP_LEN, GFP_KERNEL); > - if (efuseTbl == NULL) { > - DBG_8723A("%s: efuseTbl malloc fail!\n", __func__); > + if (efuseTbl == NULL) > return; > - } > /* 0xff will be efuse default value instead of 0x00. */ > memset(efuseTbl, 0xFF, EFUSE_BT_MAP_LEN); > > diff --git a/drivers/staging/rtl8723au/hal/usb_ops_linux.c > b/drivers/staging/rtl8723au/hal/usb_ops_linux.c > index a6d16ad..f1e9202 100644 > --- a/drivers/staging/rtl8723au/hal/usb_ops_linux.c > +++ b/drivers/staging/rtl8723au/hal/usb_ops_linux.c > @@ -256,12 +256,8 @@ static void usb_read_interrupt_complete(struct urb *purb) > c2w = kmalloc(sizeof(struct evt_work), > GFP_ATOMIC); > > - if (!c2w) { > - printk(KERN_WARNING "%s: unable to " > -"allocate work buffer\n", > -__func__); > + if (!c2w) > goto urb_submit; > - } > > c2w->adapter = padapter; > INIT_WORK(&c2w->work, rtw_evt_work); > diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c > b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c > index 537bd82..40bdf4b 100644 > --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c > +++ b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c > @@ -1327,8 +1327,6 @@ static int rtw_cfg80211_set_probe_req_wpsp2pie(struct > rtw_adapter *padapter, > pmlmepriv->wps_probe_req_ie = kmemdup(wps_ie, wps_ie[1], > GFP_KERNEL); > if (pmlmepriv->wps_probe_req_ie == NULL) { > - DBG_8723A("%s()-%d: kmalloc() ERROR!\n", > - __f
Re: [PATCH 1/1] staging: rtl8723au: Remove unnecessary OOM message
On Fri, 6 Mar 2015, Jes Sorensen wrote: > Quentin Lambert writes: > > This patch reduces the kernel size by removing error messages that duplicate > > the normal OOM message. > > > > A simplified version of the semantic patch that finds this problem is as > > follows: (http://coccinelle.lip6.fr) > > This patch removes useful warnings about what allocation failed. The > messages removed are NOT duplicate! Is it really the case that the information can't be reconstructed from the information generated by kmalloc on failure? To my understanding there is a stack trace, and from scanning through the changes I see only one change per function, so perhaps the stack trace already makes it clear where the problem occurred? julia > > NACK > > Jes > > > > > @@ > > identifier f,print,l; > > expression e; > > constant char[] c; > > @@ > > > > e = \(kzalloc\|kmalloc\|devm_kzalloc\|devm_kmalloc\)(...); > > if (e == NULL) { > > <+... > > - print(...,c,...); > > ... when any > > ( > > goto l; > > | > > return ...; > > ) > > ...+> } > > > > Signed-off-by: Quentin Lambert > > --- > > drivers/staging/rtl8723au/hal/rtl8723a_cmd.c | 8 ++-- > > drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c | 8 ++-- > > drivers/staging/rtl8723au/hal/usb_ops_linux.c | 6 +- > > drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c | 5 - > > 4 files changed, 5 insertions(+), 22 deletions(-) > > > > diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c > > b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c > > index 7b56411..38f5b7f 100644 > > --- a/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c > > +++ b/drivers/staging/rtl8723au/hal/rtl8723a_cmd.c > > @@ -462,10 +462,8 @@ static void SetFwRsvdPagePkt(struct rtw_adapter > > *padapter, bool bDLFinished) > > DBG_8723A("%s\n", __func__); > > > > ReservedPagePacket = kzalloc(1000, GFP_KERNEL); > > - if (ReservedPagePacket == NULL) { > > - DBG_8723A("%s: alloc ReservedPagePacket fail!\n", __func__); > > + if (ReservedPagePacket == NULL) > > return; > > - } > > > > pHalData = GET_HAL_DATA(padapter); > > pxmitpriv = &padapter->xmitpriv; > > @@ -669,10 +667,8 @@ static void SetFwRsvdPagePkt_BTCoex(struct rtw_adapter > > *padapter) > > DBG_8723A("+%s\n", __func__); > > > > ReservedPagePacket = kzalloc(1024, GFP_KERNEL); > > - if (ReservedPagePacket == NULL) { > > - DBG_8723A("%s: alloc ReservedPagePacket fail!\n", __func__); > > + if (ReservedPagePacket == NULL) > > return; > > - } > > > > pHalData = GET_HAL_DATA(padapter); > > pxmitpriv = &padapter->xmitpriv; > > diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c > > b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c > > index a5eadd4..6d50b09 100644 > > --- a/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c > > +++ b/drivers/staging/rtl8723au/hal/rtl8723a_hal_init.c > > @@ -401,10 +401,8 @@ hal_ReadEFuse_WiFi(struct rtw_adapter *padapter, > > } > > > > efuseTbl = kmalloc(EFUSE_MAP_LEN_8723A, GFP_KERNEL); > > - if (efuseTbl == NULL) { > > - DBG_8723A("%s: alloc efuseTbl fail!\n", __func__); > > + if (efuseTbl == NULL) > > return; > > - } > > /* 0xff will be efuse default value instead of 0x00. */ > > memset(efuseTbl, 0xFF, EFUSE_MAP_LEN_8723A); > > > > @@ -494,10 +492,8 @@ hal_ReadEFuse_BT(struct rtw_adapter *padapter, > > } > > > > efuseTbl = kmalloc(EFUSE_BT_MAP_LEN, GFP_KERNEL); > > - if (efuseTbl == NULL) { > > - DBG_8723A("%s: efuseTbl malloc fail!\n", __func__); > > + if (efuseTbl == NULL) > > return; > > - } > > /* 0xff will be efuse default value instead of 0x00. */ > > memset(efuseTbl, 0xFF, EFUSE_BT_MAP_LEN); > > > > diff --git a/drivers/staging/rtl8723au/hal/usb_ops_linux.c > > b/drivers/staging/rtl8723au/hal/usb_ops_linux.c > > index a6d16ad..f1e9202 100644 > > --- a/drivers/staging/rtl8723au/hal/usb_ops_linux.c > > +++ b/drivers/staging/rtl8723au/hal/usb_ops_linux.c > > @@ -256,12 +256,8 @@ static void usb_read_interrupt_complete(struct urb > > *purb) > > c2w = kmalloc(sizeof(struct evt_work), > > GFP_ATOMIC); > > > > - if (!c2w) { > > - printk(KERN_WARNING "%s: unable to " > > - "allocate work buffer\n", > > - __func__); > > + if (!c2w) > > goto urb_submit; > > - } > > > > c2w->adapter = padapter; > > INIT_WORK(&c2w->work, rtw_evt_work); > > diff --git a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c > > b/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c > > index 537bd82..40bdf4b 100644 > > --- a/drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c
Re: [PATCH RESEND 0/3] memory_hotplug: hyperv: fix deadlock between memory adding and onlining
[Sorry for the late response] This is basically the same code posted by KY Srinivasan posted late last year (http://marc.info/?l=linux-mm&m=141782228129426&w=2). I had objections to the implementation http://marc.info/?l=linux-mm&m=141805109216700&w=2 On Thu 12-02-15 11:23:51, Vitaly Kuznetsov wrote: > RESEND (with no changes) because Rafael J. Wysocki was missing in recepients. > > If newly added memory is brought online with e.g. udev rule: > SUBSYSTEM=="memory", ACTION=="add", ATTR{state}="online" > the following deadlock is observed (and easily reproducable): > > First participant, worker thread doing add_memory(): > > [ 724.948846] kworker/0:1 D 88000412f9c8 1324827 2 > 0x > [ 724.973543] Workqueue: events hot_add_req [hv_balloon] > [ 724.991736] 88000412f9c8 88003fa1dc30 > 000151c0 > [ 725.019725] 0246 88000412ffd8 000151c0 > 88003a77a4e0 > [ 725.046486] 88003fa1dc30 0001032a6000 88003a7ca838 > 88003a7ca898 > [ 725.072969] Call Trace: > [ 725.082690] [] schedule_preempt_disabled+0x29/0x70 > [ 725.103799] [] mutex_lock_nested+0x14b/0x470 > [ 725.122367] [] ? device_attach+0x23/0xb0 > [ 725.140992] [] device_attach+0x23/0xb0 > [ 725.159131] [] bus_probe_device+0xb0/0xe0 > [ 725.177055] [] device_add+0x443/0x650 > [ 725.195558] [] device_register+0x1e/0x30 > [ 725.213133] [] init_memory_block+0xd0/0xf0 > [ 725.231533] [] register_new_memory+0xb1/0xd0 > [ 725.250769] [] __add_pages+0x13f/0x250 > [ 725.269642] [] ? arch_add_memory+0x70/0xf0 > [ 725.288764] [] arch_add_memory+0x70/0xf0 > [ 725.306117] [] add_memory+0xef/0x1f0 > [ 725.322466] [] hot_add_req+0x33f/0xf90 [hv_balloon] > [ 725.342777] [] process_one_work+0x1df/0x4e0 > [ 725.361459] [] ? process_one_work+0x16d/0x4e0 > [ 725.380390] [] worker_thread+0x11b/0x450 > [ 725.397684] [] ? process_one_work+0x4e0/0x4e0 > [ 725.416533] [] kthread+0xf3/0x110 > [ 725.433372] [] ? kthread_create_on_node+0x240/0x240 > [ 725.453749] [] ret_from_fork+0x7c/0xb0 > [ 725.470994] [] ? kthread_create_on_node+0x240/0x240 > [ 725.491469] 6 locks held by kworker/0:1/27: > [ 725.505037] #0: ("events"){..}, at: [] > process_one_work+0x16d/0x4e0 > [ 725.533370] #1: ((&dm_device.ha_wrk.wrk)){..}, at: > [] process_one_work+0x16d/0x4e0 > [ 725.565580] #2: (mem_hotplug.lock){..}, at: [] > mem_hotplug_begin+0x5/0x80 > [ 725.594369] #3: (mem_hotplug.lock#2){..}, at: [] > mem_hotplug_begin+0x4f/0x80 > [ 725.628554] #4: (mem_sysfs_mutex){..}, at: [] > register_new_memory+0x33/0xd0 > [ 725.658519] #5: (&dev->mutex){..}, at: [] > device_attach+0x23/0xb0 > > Second participant, udev: > > [ 725.750889] systemd-udevd D 88003b94fc68 14016 888530 > 0x0004 > [ 725.773767] 88003b94fc68 8800034949c0 > 000151c0 > [ 725.798332] 8210d980 88003b94ffd8 000151c0 > 880037a69270 > [ 725.822841] 8800034949c0 00010001 8800034949c0 > 81ff2b48 > [ 725.849184] Call Trace: > [ 725.858987] [] schedule_preempt_disabled+0x29/0x70 > [ 725.879231] [] mutex_lock_nested+0x14b/0x470 > [ 725.897860] [] ? mem_hotplug_begin+0x4f/0x80 > [ 725.916698] [] mem_hotplug_begin+0x4f/0x80 > [ 725.935064] [] ? mem_hotplug_begin+0x5/0x80 > [ 725.953464] [] online_pages+0x3b/0x520 > [ 725.971542] [] ? device_online+0x23/0xa0 > [ 725.989207] [] memory_subsys_online+0x64/0xc0 > [ 726.008513] [] device_online+0x6d/0xa0 > [ 726.025579] [] store_mem_state+0x5b/0xe0 > [ 726.043400] [] dev_attr_store+0x18/0x30 > [ 726.060506] [] sysfs_kf_write+0x48/0x60 > [ 726.077940] [] kernfs_fop_write+0x13b/0x1a0 > [ 726.099416] [] vfs_write+0xb7/0x1f0 > [ 726.115748] [] SyS_write+0x58/0xd0 > [ 726.131933] [] system_call_fastpath+0x12/0x17 > [ 726.150691] 7 locks held by systemd-udevd/888: > [ 726.165044] #0: (sb_writers#3){..}, at: [] > vfs_write+0x1b3/0x1f0 > [ 726.192422] #1: (&of->mutex){..}, at: [] > kernfs_fop_write+0x66/0x1a0 > [ 726.220289] #2: (s_active#60){..}, at: [] > kernfs_fop_write+0x6e/0x1a0 > [ 726.249382] #3: (device_hotplug_lock){..}, at: [] > lock_device_hotplug_sysfs+0x15/0x50 > [ 726.281901] #4: (&dev->mutex){..}, at: [] > device_online+0x23/0xa0 > [ 726.308619] #5: (mem_hotplug.lock){..}, at: [] > mem_hotplug_begin+0x5/0x80 > [ 726.337994] #6: (mem_hotplug.lock#2){..}, at: [] > mem_hotplug_begin+0x4f/0x80 > > In short: onlining grabs device lock and then tries to do mem_hotplug_begin() > while add_memory() is between mem_hotplug_begin() and mem_hotplug_done() and > it > tries grabbing device lock. > > To my understanding ACPI memory hotplug doesn't have the same issue as > device_hotplug_lock is being grabbed when the ACPI device is added. > > Solve the issue by grabbing device_hotplug_lock before doing add_memory(
Re: [PATCH 1/1] staging: rtl8723au: Remove unnecessary OOM message
Julia Lawall writes: > On Fri, 6 Mar 2015, Jes Sorensen wrote: > >> Quentin Lambert writes: >> > This patch reduces the kernel size by removing error messages that >> > duplicate >> > the normal OOM message. >> > >> > A simplified version of the semantic patch that finds this problem is as >> > follows: (http://coccinelle.lip6.fr) >> >> This patch removes useful warnings about what allocation failed. The >> messages removed are NOT duplicate! > > Is it really the case that the information can't be reconstructed from the > information generated by kmalloc on failure? To my understanding there is > a stack trace, and from scanning through the changes I see only one change > per function, so perhaps the stack trace already makes it clear where the > problem occurred? It may be possible to backtrack, but this change just makes it harder. There are tons of real issues to fix in this driver, this patch just increases the risk of patch conflicts for no real gain. Jes ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] staging: rtl8723au: Remove unnecessary OOM message
On Fri, 2015-03-06 at 11:08 -0500, Jes Sorensen wrote: > Julia Lawall writes: > > On Fri, 6 Mar 2015, Jes Sorensen wrote: > >> Quentin Lambert writes: > >> > This patch reduces the kernel size by removing error messages that > >> > duplicate > >> > the normal OOM message. > >> > A simplified version of the semantic patch that finds this problem is as > >> > follows: (http://coccinelle.lip6.fr) > >> This patch removes useful warnings about what allocation failed. The > >> messages removed are NOT duplicate! > > Is it really the case that the information can't be reconstructed from the > > information generated by kmalloc on failure? To my understanding there is > > a stack trace, and from scanning through the changes I see only one change > > per function, so perhaps the stack trace already makes it clear where the > > problem occurred? > It may be possible to backtrack, but this change just makes it harder. > There are tons of real issues to fix in this driver, this patch just > increases the risk of patch conflicts for no real gain. Making the allocation less likely to fail for low memory systems is a gain. The allocation failures themselves are low likelihood events. Determining which specific memory allocation failure occurred has near nil value. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] staging: rtl8723au: Remove unnecessary OOM message
Joe Perches writes: > On Fri, 2015-03-06 at 11:08 -0500, Jes Sorensen wrote: >> Julia Lawall writes: >> > On Fri, 6 Mar 2015, Jes Sorensen wrote: >> >> Quentin Lambert writes: >> >> > This patch reduces the kernel size by removing error messages >> >> > that duplicate >> >> > the normal OOM message. >> >> > A simplified version of the semantic patch that finds this problem is as >> >> > follows: (http://coccinelle.lip6.fr) >> >> This patch removes useful warnings about what allocation failed. The >> >> messages removed are NOT duplicate! >> > Is it really the case that the information can't be reconstructed from the >> > information generated by kmalloc on failure? To my understanding there is >> > a stack trace, and from scanning through the changes I see only one change >> > per function, so perhaps the stack trace already makes it clear where the >> > problem occurred? >> It may be possible to backtrack, but this change just makes it harder. >> There are tons of real issues to fix in this driver, this patch just >> increases the risk of patch conflicts for no real gain. > > Making the allocation less likely to fail for > low memory systems is a gain. > > The allocation failures themselves are low > likelihood events. Determining which specific > memory allocation failure occurred has near > nil value. Joe, That is bologna, knowing which allocation failed has a lot of value, it allows the developer to go back and look at the allocation sizes, parameters applied etc. This is a classic case of blindly applied script 'fixes' causing more harm than good. Jes ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] staging: rtl8723au: Remove unnecessary OOM message
On Fri, 2015-03-06 at 14:43 -0500, Jes Sorensen wrote: > Joe Perches writes: > > On Fri, 2015-03-06 at 11:08 -0500, Jes Sorensen wrote: > >> Julia Lawall writes: > >> > On Fri, 6 Mar 2015, Jes Sorensen wrote: > >> >> Quentin Lambert writes: > >> >> > This patch reduces the kernel size by removing error messages > >> >> > that duplicate > >> >> > the normal OOM message. > >> >> > A simplified version of the semantic patch that finds this problem is > >> >> > as > >> >> > follows: (http://coccinelle.lip6.fr) > >> >> This patch removes useful warnings about what allocation failed. The > >> >> messages removed are NOT duplicate! > >> > Is it really the case that the information can't be reconstructed from > >> > the > >> > information generated by kmalloc on failure? To my understanding there > >> > is > >> > a stack trace, and from scanning through the changes I see only one > >> > change > >> > per function, so perhaps the stack trace already makes it clear where the > >> > problem occurred? > >> It may be possible to backtrack, but this change just makes it harder. > >> There are tons of real issues to fix in this driver, this patch just > >> increases the risk of patch conflicts for no real gain. > > > > Making the allocation less likely to fail for > > low memory systems is a gain. > > > > The allocation failures themselves are low > > likelihood events. Determining which specific > > memory allocation failure occurred has near > > nil value. > > Joe, Jes, > That is bologna, We disagree, and I rather like minced meat sausages. > knowing which allocation failed has a lot of value, it > allows the developer to go back and look at the allocation sizes, > parameters applied etc. Likely enough of this is emitted by the generic OOM message and stack dump. > This is a classic case of blindly applied script 'fixes' causing more > harm than good. cheesy tomato/tomahto. Goes well with baloney. cheers, Joe ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] iee80211:Remove no longer required strutucre defintion, _STA_QOS in rtl819x_Qos.h
Removes the no longer required structure definition,_STA_QOS due to no functions using any structures of this type anymore. Signed-off-by: Nicholas Krause --- drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h | 48 1 file changed, 48 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h index 9fbce91..38ebdd5 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h @@ -480,54 +480,6 @@ typedef struct _OCTET_STRING{ // STA QoS data. // Ref: DOT11_QOS in 8185 code. [def. in QoS_mp.h] // -typedef struct _STA_QOS{ - //DECLARE_RT_OBJECT(STA_QOS); - u8 WMMIEBuf[MAX_WMMELE_LENGTH]; - u8 *WMMIE; - - // Part 1. Self QoS Mode. - QOS_MODEQosCapability; //QoS Capability, 2006-06-14 Isaiah - QOS_MODECurrentQosMode; - - // For WMM Power Save Mode : - // ACs are trigger/delivery enabled or legacy power save enabled. 2006-06-13 Isaiah - AC_UAPSDb4ac_Uapsd; //VoUapsd(bit0), ViUapsd(bit1), BkUapsd(bit2), BeUapsd(bit3), - AC_UAPSDCurr4acUapsd; - u8 bInServicePeriod; - u8 MaxSPLength; - int NumBcnBeforeTrigger; - - // Part 2. EDCA Parameter (perAC) - u8 *pWMMInfoEle; - u8 WMMParamEle[WMM_PARAM_ELEMENT_SIZE]; - u8 WMMPELength; - - // - //2 ToDo: remove the Qos Info Field and replace it by the above WMM Info element. - // By Bruce, 2008-01-30. - // Part 2. EDCA Parameter (perAC) - QOS_INFO_FIELD QosInfoField_STA; // Maintained by STA - QOS_INFO_FIELD QosInfoField_AP;// Retrieved from AP - - AC_PARAMCurAcParameters[4]; - - // Part 3. ACM - ACM acm[4]; - ACM_METHOD AcmMethod; - - // Part 4. Per TID (Part 5: TCLASS will be described by TStream) - QOS_TSTREAM TStream[16]; - WMM_TSPEC TSpec; - - u32 QBssWirelessMode; - - // No Ack Setting - u8 bNoAck; - - // Enable/Disable Rx immediate BA capability. - u8 bEnableRxImmBA; - -}STA_QOS, *PSTA_QOS; // // BSS QOS data. -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] iee80211:Remove no longer required strutucre defintion, _STA_QOS in rtl819x_Qos.h
On 2015.03.06 23:20, Nicholas Krause wrote: > Removes the no longer required structure definition,_STA_QOS due to > no functions using any structures of this type anymore. > > Signed-off-by: Nicholas Krause > --- > drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h | 48 > [...] Why not remove the remaining commented definitions of variables or struct members with that type in drivers/staging/rtl8192u/ie80211/ieee80211.h (lines 2080, 1845) and drivers/staging/rtl8192u/ie80211/r8192U_dm.c (line 2218) together with this patch? -- Thanks, Giedrius ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] iee80211:Remove no longer required strutucre defintion, _STA_QOS in rtl819x_Qos.h
# On March 6, 2015 5:13:09 PM EST, "Giedrius Statkevičius" wrote: >On 2015.03.06 23:20, Nicholas Krause wrote: >> Removes the no longer required structure definition,_STA_QOS due to >> no functions using any structures of this type anymore. >> >> Signed-off-by: Nicholas Krause >> --- >> drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h | 48 > >[...] > >Why not remove the remaining commented definitions of variables or >struct members with that type in >drivers/staging/rtl8192u/ie80211/ieee80211.h (lines 2080, 1845) and >drivers/staging/rtl8192u/ie80211/r8192U_dm.c (line 2218) together with >this patch? Sorry about missing those declarations, my source navigator tools didn't pick it up. I will send later today a v2 with your request. Sorry, Nick -- Sent from my Android device with K-9 Mail. Please excuse my brevity. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH] Drivers: hv: hv_balloon: keep locks balanced on add_memory() failure
> -Original Message- > From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] > Sent: Monday, March 2, 2015 2:34 AM > To: KY Srinivasan > Cc: de...@linuxdriverproject.org; Haiyang Zhang; linux- > ker...@vger.kernel.org; Dexuan Cui > Subject: Re: [PATCH] Drivers: hv: hv_balloon: keep locks balanced on > add_memory() failure > > Vitaly Kuznetsov writes: > > > When add_memory() fails the following BUG is observed: > > [ 743.646107] hv_balloon: hot_add memory failed error is -17 [ > > 743.679973] [ 743.680930] = > > [ 743.680930] [ BUG: bad unlock balance detected! ] [ 743.680930] > > 3.19.0-rc5_bug1131426+ #552 Not tainted [ 743.680930] > > - > > [ 743.680930] kworker/0:2/255 is trying to release lock > (&dm_device.ha_region_mutex) at: > > [ 743.680930] [] mutex_unlock+0xe/0x10 [ > > 743.680930] but there are no more locks to release! > > > > This happens as we don't acquire ha_region_mutex and hot_add_req() > > expects us to as it does unconditional mutex_unlock(). Acquire the lock on > the error path. > > > > Signed-off-by: Vitaly Kuznetsov > > --- > > This patch is dependent on the previously posted 'Drivers: hv: hv_balloon: > > eliminate the trylock path in acquire/release_region_mutex'. > > Hi K.Y., > > I don't see this patch in your '[PATCH 0/7] Drivers: hv: Collection fixes and > enhancements' sent to Greg. Please let me know if you see any issues with it > as it looks like a pretty important bugfix to me. Yes, I am sending this patch out soon. K. Y > > Thanks, > > > --- > > drivers/hv/hv_balloon.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c index > > 1283035..771bf84 100644 > > --- a/drivers/hv/hv_balloon.c > > +++ b/drivers/hv/hv_balloon.c > > @@ -654,6 +654,7 @@ static void hv_mem_hot_add(unsigned long start, > > unsigned long size, } has->ha_end_pfn -= HA_CHUNK; > > has->covered_end_pfn -= processed_pfn; > > +mutex_lock(&dm_device.ha_region_mutex); > > break; > > } > > -- > Vitaly ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3] Staging: dgnc: Remove sysfs file
This sysfs file is not useful for anything. Signed-off-by: Salah Triki --- drivers/staging/dgnc/dgnc_sysfs.c | 25 - 1 file changed, 25 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_sysfs.c b/drivers/staging/dgnc/dgnc_sysfs.c index a72e353..b5738dc 100644 --- a/drivers/staging/dgnc/dgnc_sysfs.c +++ b/drivers/staging/dgnc/dgnc_sysfs.c @@ -382,31 +382,6 @@ void dgnc_remove_ports_sysfiles(struct dgnc_board *bd) } -static ssize_t dgnc_tty_state_show(struct device *d, struct device_attribute *attr, char *buf) -{ - struct dgnc_board *bd; - struct channel_t *ch; - struct un_t *un; - - if (!d) - return 0; - un = dev_get_drvdata(d); - if (!un || un->magic != DGNC_UNIT_MAGIC) - return 0; - ch = un->un_ch; - if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) - return 0; - bd = ch->ch_bd; - if (!bd || bd->magic != DGNC_BOARD_MAGIC) - return 0; - if (bd->state != BOARD_READY) - return 0; - - return snprintf(buf, PAGE_SIZE, "%s", un->un_open_count ? "Open" : "Closed"); -} -static DEVICE_ATTR(state, S_IRUSR, dgnc_tty_state_show, NULL); - - static ssize_t dgnc_tty_baud_show(struct device *d, struct device_attribute *attr, char *buf) { struct dgnc_board *bd; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
CONGRATULATION YOUR EMAIL WON
CHEVROLET CAR COMPANY, 45 ,Manchester, Linc's, BE9 8WB, London United Kingdom. Tel: +447010032898 5th mar 2015 We wish to congratulate you once again on this note, for being one of the lucky winners selected on this year CHEVROLET MOTORS PROMOTION 2015. We felicitate with you and your family and especially for being a citizen of (INDIA). This promotion was set-up In United Kingdom CHEVROLET MOTORS COMPANY in order to encourage prospective Mobile users. Congratulations on behalf of the '"CHEVROLET MOTORS PROMOTION UNITED KINGDOM'' Our Screening Committee and National Advisory Board has completed all verification and screening by the Screening Committee of "UK's Overseas National Advisory Remittance Claims Unit. However you will have to fill and submit this form to the events manager for verification & direction on how you can claim your winning funds. Fill the Details Below: 1. Full name:. 2. Contact Address [Home Address]: 3. Age:.. 4. Mobile Number:.. 5. Marital Status:... 6. Sex:.. 7. Occupation:... 8. Company:. 9. State:... 10.Country:... Simply fill accordingly and submit your verification form to our events manager immediately , no file attachments please. Due to a mix up of some names and numbers of delivery, we strongly recommend that you keep this award a top secret from the public notice until your claims have been processed and the money remitted to your account. This is a part of our security protocol to avoid double claiming and unwanted scams of this program by other participants and also security protocol to avoid double claiming and unwarranted taking advantage of this program by non participant or unofficial personnel. for any assistance contact your claims director below, ONCE AGAIN CONGRATULATION. Event Manager YOURS SINCERELY, Brr EDWARD PHILLIP. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Attention: Claim Your USD$ 3,500,000.00 Million,
Attention:Claim Your USD$ 3,500,000.00 Million, RE-YOUR LONG OVER DUE PAYMENT APPROVED FOR PAYMENT IN YOUR FAVOR. This is to officially bring to your notice that you have been issued a payment notice of total sum of ( $3,500,000.00 Million ) Following the Board of Trustees and the Executive Council Members meeting of the Central Bank of Nigeria CBN / the World Bank representatives together with the United Nations representatives held today, I am delighted to bring to your knowledge that your payment has finally been approved by the Federal Ministry of Finance FMF of the Federal Republic of Nigeria. Kindly be notified also that before the announcement of your full payment to your bank account it was been established by the board that your payment has been delayed by some corrupt official of this nation and we have concluded that 12 dictated officer has to be released of their duties due to their non sincerity in their duty post. To forestall this payment transfer arrangement in your favor I personally as the Director of International Investigation of your payment has been mandated to monitor your payment transfer arrangement to you bank account and this is specifically for me to sanitize the entire payment transfer system here in my desk and on behalf of the Government of this Nation we are sorry for the delays in your payment to you. You are where by instructed to carefully reconfirm the following information's to us to avoid wrong payment transfer to another persons account.To claim your funds you are advice to reply with the below following information to us immediately to this E-mail Address: uuwi...@yahoo.co.jp Your Full names and Contact Address: Your Direct Telephone Mobile Line: Your current Banking Details Your Marital Status: Your total Payment Amount: Your current ID Card: Your Age/Sex: Your Country of Origin: Finally may I use this opportunity to warn you adequately that the Federal Government of Nigeria will not be held responsible for any wrong payment transfer caused by any beneficiary's mistake or negligence therefore your maximum cooperation is now required so as to enable us discharge this great task effectively to you. Your urgent response is highly required and you should call us immediately. Congratulations in advance Yours in active service, Best Regards, Mr.Aba Justice Director of International Investigation Address: 108 GARIK ROAD,Abuja Nigeria. Tel: +234-8020812790 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/6] Drivers: hv: Miscellaneous fixes
This patch-set has miscellaneous fixes for both the VMBUS as well as the balloon driver. Dan Carpenter (1): hv: vmbus: missing curly braces in vmbus_process_offer() K. Y. Srinivasan (2): Drivers: hv: vmbus: Export the vmbus_sendpacket_pagebuffer_ctl() Drivers: hv: vmbus: Perform device register in the per-channel work element Nick Meier (1): Correcting truncation error for constant HV_CRASH_CTL_CRASH_NOTIFY Vitaly Kuznetsov (2): Drivers: hv: hv_balloon: keep locks balanced on add_memory() failure Drivers: hv: hv_balloon: don't lose memory when onlining order is not natural drivers/hv/channel.c |1 + drivers/hv/channel_mgmt.c | 146 +++-- drivers/hv/connection.c |6 ++- drivers/hv/hv_balloon.c | 15 ++--- drivers/hv/hyperv_vmbus.h |4 +- 5 files changed, 115 insertions(+), 57 deletions(-) -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCHv2 1/2] iee80211:Remove no longer required strutucre defintion, _STA_QOS in rtl819x_Qos.h
Removes the no longer required structure definition,_STA_QOS due to no functions using any structures of this type anymore. Signed-off-by: Nicholas Krause --- drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h | 48 1 file changed, 48 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h index 9fbce91..38ebdd5 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_Qos.h @@ -480,54 +480,6 @@ typedef struct _OCTET_STRING{ // STA QoS data. // Ref: DOT11_QOS in 8185 code. [def. in QoS_mp.h] // -typedef struct _STA_QOS{ - //DECLARE_RT_OBJECT(STA_QOS); - u8 WMMIEBuf[MAX_WMMELE_LENGTH]; - u8 *WMMIE; - - // Part 1. Self QoS Mode. - QOS_MODEQosCapability; //QoS Capability, 2006-06-14 Isaiah - QOS_MODECurrentQosMode; - - // For WMM Power Save Mode : - // ACs are trigger/delivery enabled or legacy power save enabled. 2006-06-13 Isaiah - AC_UAPSDb4ac_Uapsd; //VoUapsd(bit0), ViUapsd(bit1), BkUapsd(bit2), BeUapsd(bit3), - AC_UAPSDCurr4acUapsd; - u8 bInServicePeriod; - u8 MaxSPLength; - int NumBcnBeforeTrigger; - - // Part 2. EDCA Parameter (perAC) - u8 *pWMMInfoEle; - u8 WMMParamEle[WMM_PARAM_ELEMENT_SIZE]; - u8 WMMPELength; - - // - //2 ToDo: remove the Qos Info Field and replace it by the above WMM Info element. - // By Bruce, 2008-01-30. - // Part 2. EDCA Parameter (perAC) - QOS_INFO_FIELD QosInfoField_STA; // Maintained by STA - QOS_INFO_FIELD QosInfoField_AP;// Retrieved from AP - - AC_PARAMCurAcParameters[4]; - - // Part 3. ACM - ACM acm[4]; - ACM_METHOD AcmMethod; - - // Part 4. Per TID (Part 5: TCLASS will be described by TStream) - QOS_TSTREAM TStream[16]; - WMM_TSPEC TSpec; - - u32 QBssWirelessMode; - - // No Ack Setting - u8 bNoAck; - - // Enable/Disable Rx immediate BA capability. - u8 bEnableRxImmBA; - -}STA_QOS, *PSTA_QOS; // // BSS QOS data. -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/6] Drivers: hv: vmbus: Perform device register in the per-channel work element
This patch is a continuation of the rescind handling cleanup work. We cannot block in the global message handling work context especially if we are blocking waiting for the host to wake us up. I would like to thank Dexuan Cui for observing this problem. Signed-off-by: K. Y. Srinivasan --- drivers/hv/channel_mgmt.c | 143 +++-- drivers/hv/connection.c |6 ++- drivers/hv/hyperv_vmbus.h |2 +- 3 files changed, 106 insertions(+), 45 deletions(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 6117891..681c806b 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -37,6 +38,10 @@ struct vmbus_channel_message_table_entry { void (*message_handler)(struct vmbus_channel_message_header *msg); }; +struct vmbus_rescind_work { + struct work_struct work; + struct vmbus_channel *channel; +}; /** * vmbus_prep_negotiate_resp() - Create default response for Hyper-V Negotiate message @@ -134,20 +139,6 @@ fw_error: EXPORT_SYMBOL_GPL(vmbus_prep_negotiate_resp); -static void vmbus_process_device_unregister(struct work_struct *work) -{ - struct device *dev; - struct vmbus_channel *channel = container_of(work, - struct vmbus_channel, - work); - - dev = get_device(&channel->device_obj->device); - if (dev) { - vmbus_device_unregister(channel->device_obj); - put_device(dev); - } -} - static void vmbus_sc_creation_cb(struct work_struct *work) { struct vmbus_channel *newchannel = container_of(work, @@ -201,7 +192,6 @@ static void release_channel(struct work_struct *work) work); destroy_workqueue(channel->controlwq); - kfree(channel); } @@ -220,6 +210,39 @@ static void free_channel(struct vmbus_channel *channel) queue_work(vmbus_connection.work_queue, &channel->work); } +static void process_rescind_fn(struct work_struct *work) +{ + struct vmbus_rescind_work *rc_work; + struct vmbus_channel *channel; + struct device *dev; + + rc_work = container_of(work, struct vmbus_rescind_work, work); + channel = rc_work->channel; + + /* +* We have already acquired a reference on the channel +* and so it cannot vanish underneath us. +* It is possible (while very unlikely) that we may +* get here while the processing of the initial offer +* is still not complete. Deal with this situation by +* just waiting until the channel is in the correct state. +*/ + + while (channel->work.func != release_channel) + msleep(1000); + + if (channel->device_obj) { + dev = get_device(&channel->device_obj->device); + if (dev) { + vmbus_device_unregister(channel->device_obj); + put_device(dev); + } + } else { + hv_process_channel_removal(channel, + channel->offermsg.child_relid); + } +} + static void percpu_channel_enq(void *arg) { struct vmbus_channel *channel = arg; @@ -282,6 +305,46 @@ void vmbus_free_channels(void) } } +static void vmbus_do_device_register(struct work_struct *work) +{ + struct hv_device *device_obj; + int ret; + unsigned long flags; + struct vmbus_channel *newchannel = container_of(work, +struct vmbus_channel, +work); + + ret = vmbus_device_register(newchannel->device_obj); + if (ret != 0) { + pr_err("unable to add child device object (relid %d)\n", + newchannel->offermsg.child_relid); + spin_lock_irqsave(&vmbus_connection.channel_lock, flags); + list_del(&newchannel->listentry); + device_obj = newchannel->device_obj; + newchannel->device_obj = NULL; + spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags); + + if (newchannel->target_cpu != get_cpu()) { + put_cpu(); + smp_call_function_single(newchannel->target_cpu, +percpu_channel_deq, newchannel, true); + } else { + percpu_channel_deq(newchannel); + put_cpu(); + } + + kfree(device_obj); + if (!newchannel->rescind) { + free_channel(newchannel); + return; + } + } + /* +* The next state for this channel is to be fr
[PATCH 6/6] hv: vmbus: missing curly braces in vmbus_process_offer()
From: Dan Carpenter The indenting makes it clear that there were curly braces intended here. Fixes: 2dd37cb81580 ('Drivers: hv: vmbus: Handle both rescind and offer messages in the same context') Signed-off-by: Dan Carpenter Signed-off-by: K. Y. Srinivasan --- drivers/hv/channel_mgmt.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 681c806b..1bc2378 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -413,7 +413,7 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel) newchannel->state = CHANNEL_OPEN_STATE; channel->num_sc++; - if (channel->sc_creation_callback != NULL) + if (channel->sc_creation_callback != NULL) { /* * We need to invoke the sub-channel creation * callback; invoke this in a seperate work @@ -425,6 +425,7 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel) vmbus_sc_creation_cb); queue_work(newchannel->controlwq, &newchannel->work); + } return; } -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/6] Drivers: hv: vmbus: Export the vmbus_sendpacket_pagebuffer_ctl()
Export the vmbus_sendpacket_pagebuffer_ctl() interface. Signed-off-by: K. Y. Srinivasan --- drivers/hv/channel.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c index da53180..e58cdb7 100644 --- a/drivers/hv/channel.c +++ b/drivers/hv/channel.c @@ -710,6 +710,7 @@ int vmbus_sendpacket_pagebuffer_ctl(struct vmbus_channel *channel, return ret; } +EXPORT_SYMBOL_GPL(vmbus_sendpacket_pagebuffer_ctl); /* * vmbus_sendpacket_pagebuffer - Send a range of single-page buffer -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCHv2 2/2] rtl8192u:Remove commented declartions of the structure type, _STA_QOS in ieee80211.h and r8192U_dm.c
This removes the commented declarations of the structure type, _STA_QOS due to us no longer having this structure declartion having now been removed from the header file,rtl819x_Qos.h due to no declartions of this type present anymore. Signed-off-by: Nicholas Krause --- drivers/staging/rtl8192u/ieee80211/ieee80211.h | 4 drivers/staging/rtl8192u/r8192U_dm.c | 1 - 2 files changed, 5 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h b/drivers/staging/rtl8192u/ieee80211/ieee80211.h index b44aa17..3ad7740 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h @@ -1841,8 +1841,6 @@ struct ieee80211_device { RX_REORDER_ENTRYRxReorderEntry[128]; struct list_headRxReorder_Unused_List; //#endif - // Qos related. Added by Annie, 2005-11-01. -// PSTA_QOSpStaQos; u8 ForcedPriority; // Force per-packet priority 1~7. (default: 0, not to force it.) @@ -2076,8 +2074,6 @@ struct ieee80211_device { struct delayed_work start_ibss_wq; struct work_struct wx_sync_scan_wq; struct workqueue_struct *wq; - // Qos related. Added by Annie, 2005-11-01. - //STA_QOS StaQos; //u32 STA_EDCA_PARAM[4]; //CHANNEL_ACCESS_SETTING ChannelAccessSetting; diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c index ee6b936..e1a9d13 100644 --- a/drivers/staging/rtl8192u/r8192U_dm.c +++ b/drivers/staging/rtl8192u/r8192U_dm.c @@ -2215,7 +2215,6 @@ static void dm_check_edca_turbo( { struct r8192_priv *priv = ieee80211_priv(dev); PRT_HIGH_THROUGHPUT pHTInfo = priv->ieee80211->pHTInfo; - /*PSTA_QOS pStaQos = pMgntInfo->pStaQos;*/ /* Keep past Tx/Rx packet count for RT-to-RT EDCA turbo. */ static unsigned longlastTxOkCnt; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/6] Drivers: hv: hv_balloon: don't lose memory when onlining order is not natural
From: Vitaly Kuznetsov Memory blocks can be onlined in random order. When this order is not natural some memory pages are not onlined because of the redundant check in hv_online_page(). Here is a real world scenario: 1) Host tries to hot-add the following (process_hot_add): pg_start=rg_start=0x48000, pfn_cnt=111616, rg_size=262144 2) This results in adding 4 memory blocks: [ 109.057866] init_memory_mapping: [mem 0x4800-0x4fff] [ 114.102698] init_memory_mapping: [mem 0x5000-0x57ff] [ 119.168039] init_memory_mapping: [mem 0x5800-0x5fff] [ 124.233053] init_memory_mapping: [mem 0x6000-0x67ff] The last one is incomplete but we have special has->covered_end_pfn counter to avoid onlining non-backed frames and hv_bring_pgs_online() function to bring them online later on. 3) Now we have 4 offline memory blocks: /sys/devices/system/memory/memory9-12 $ for f in /sys/devices/system/memory/memory*/state; do echo $f `cat $f`; done | grep -v onlin /sys/devices/system/memory/memory10/state offline /sys/devices/system/memory/memory11/state offline /sys/devices/system/memory/memory12/state offline /sys/devices/system/memory/memory9/state offline 4) We bring them online in non-natural order: $grep MemTotal /proc/meminfo MemTotal: 966348 kB $echo online > /sys/devices/system/memory/memory12/state && grep MemTotal /proc/meminfo MemTotal:1019596 kB $echo online > /sys/devices/system/memory/memory11/state && grep MemTotal /proc/meminfo MemTotal:1150668 kB $echo online > /sys/devices/system/memory/memory9/state && grep MemTotal /proc/meminfo MemTotal:1150668 kB As you can see memory9 block gives us zero additional memory. We can also observe a huge discrepancy between host- and guest-reported memory sizes. The root cause of the issue is the redundant pg >= covered_start_pfn check (and covered_start_pfn advancing) in hv_online_page(). When upper memory block in being onlined before the lower one (memory12 and memory11 in the above case) we advance the covered_start_pfn pointer and all memory9 pages do not pass the check. If the assumption that host always gives us requests in sequential order and pg_start always equals rg_start when the first request for the new HA region is received (that's the case in my testing) is correct than we can get rid of covered_start_pfn and pg >= start_pfn check in hv_online_page() is sufficient. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_balloon.c | 14 -- 1 files changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c index f1f17c5..014256a 100644 --- a/drivers/hv/hv_balloon.c +++ b/drivers/hv/hv_balloon.c @@ -428,14 +428,13 @@ struct dm_info_msg { * currently hot added. We hot add in multiples of 128M * chunks; it is possible that we may not be able to bring * online all the pages in the region. The range - * covered_start_pfn : covered_end_pfn defines the pages that can + * covered_end_pfn defines the pages that can * be brough online. */ struct hv_hotadd_state { struct list_head list; unsigned long start_pfn; - unsigned long covered_start_pfn; unsigned long covered_end_pfn; unsigned long ha_end_pfn; unsigned long end_pfn; @@ -679,8 +678,7 @@ static void hv_online_page(struct page *pg) list_for_each(cur, &dm_device.ha_region_list) { has = list_entry(cur, struct hv_hotadd_state, list); - cur_start_pgp = (unsigned long) - pfn_to_page(has->covered_start_pfn); + cur_start_pgp = (unsigned long)pfn_to_page(has->start_pfn); cur_end_pgp = (unsigned long)pfn_to_page(has->covered_end_pfn); if (((unsigned long)pg >= cur_start_pgp) && @@ -692,7 +690,6 @@ static void hv_online_page(struct page *pg) __online_page_set_limits(pg); __online_page_increment_counters(pg); __online_page_free(pg); - has->covered_start_pfn++; } } } @@ -736,10 +733,9 @@ static bool pfn_covered(unsigned long start_pfn, unsigned long pfn_cnt) * is, update it. */ - if (has->covered_end_pfn != start_pfn) { + if (has->covered_end_pfn != start_pfn) has->covered_end_pfn = start_pfn; - has->covered_start_pfn = start_pfn; - } + return true; } @@ -784,7 +780,6 @@ static unsigned long handle_pg_range(unsigned long pg_start, pgs_ol = pfn_cnt; hv_bring_pgs_online(start_pfn, pgs_ol); has->covered_end_pfn += pgs_ol; - has->covered_start_pfn += pgs_ol; pfn_cnt -= pgs_ol; } @@ -845,7 +84
[PATCH 3/6] Drivers: hv: hv_balloon: keep locks balanced on add_memory() failure
From: Vitaly Kuznetsov When add_memory() fails the following BUG is observed: [ 743.646107] hv_balloon: hot_add memory failed error is -17 [ 743.679973] [ 743.680930] = [ 743.680930] [ BUG: bad unlock balance detected! ] [ 743.680930] 3.19.0-rc5_bug1131426+ #552 Not tainted [ 743.680930] - [ 743.680930] kworker/0:2/255 is trying to release lock (&dm_device.ha_region_mutex) at: [ 743.680930] [] mutex_unlock+0xe/0x10 [ 743.680930] but there are no more locks to release! This happens as we don't acquire ha_region_mutex and hot_add_req() expects us to as it does unconditional mutex_unlock(). Acquire the lock on the error path. Signed-off-by: Vitaly Kuznetsov Acked-by: Jason Wang Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_balloon.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c index c5bb872..f1f17c5 100644 --- a/drivers/hv/hv_balloon.c +++ b/drivers/hv/hv_balloon.c @@ -652,6 +652,7 @@ static void hv_mem_hot_add(unsigned long start, unsigned long size, } has->ha_end_pfn -= HA_CHUNK; has->covered_end_pfn -= processed_pfn; + mutex_lock(&dm_device.ha_region_mutex); break; } -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/6] Correcting truncation error for constant HV_CRASH_CTL_CRASH_NOTIFY
From: Nick Meier HV_CRASH_CTL_CRASH_NOTIFY is a 64 bit number. Depending on the usage context, the value may be truncated. This patch is in response from the following email from Intel: [char-misc:char-misc-testing 25/45] drivers/hv/vmbus_drv.c:67:9: sparse: constant 0x8000 is so big it is unsigned long tree: git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git char-misc-testing head: b3de8e3719e582f3182bb504295e4a8e43c8c96f commit: 96c1d0581d00f7abe033350edb021a9d947d8d81 [25/45] Drivers: hv: vmbus: Add support for VMBus panic notifier handler reproduce: # apt-get install sparse git checkout 96c1d0581d00f7abe033350edb021a9d947d8d81 make ARCH=x86_64 allmodconfig make C=1 CF=-D__CHECK_ENDIAN__ sparse warnings: (new ones prefixed by >>) drivers/hv/vmbus_drv.c:67:9: sparse: constant 0x8000 is so big it is unsigned long ... Signed-off-by: Nick Meier Signed-off-by: K. Y. Srinivasan --- drivers/hv/hyperv_vmbus.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h index 6339589..c8e27e0 100644 --- a/drivers/hv/hyperv_vmbus.h +++ b/drivers/hv/hyperv_vmbus.h @@ -58,7 +58,7 @@ enum hv_cpuid_function { #define HV_X64_MSR_CRASH_P4 0x4104 #define HV_X64_MSR_CRASH_CTL 0x4105 -#define HV_CRASH_CTL_CRASH_NOTIFY 0x8000 +#define HV_CRASH_CTL_CRASH_NOTIFY (1ULL << 63) /* Define version of the synthetic interrupt controller. */ #define HV_SYNIC_VERSION (1) -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 0/6] Drivers: hv: Miscellaneous fixes
> -Original Message- > From: K. Y. Srinivasan [mailto:k...@microsoft.com] > Sent: Friday, March 6, 2015 9:10 PM > To: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org; > de...@linuxdriverproject.org; o...@aepfle.de; a...@canonical.com; > vkuzn...@redhat.com > Cc: KY Srinivasan > Subject: [PATCH 0/6] Drivers: hv: Miscellaneous fixes > > This patch-set has miscellaneous fixes for both the VMBUS as well as the > balloon driver. > > Dan Carpenter (1): > hv: vmbus: missing curly braces in vmbus_process_offer() > > K. Y. Srinivasan (2): > Drivers: hv: vmbus: Export the vmbus_sendpacket_pagebuffer_ctl() > Drivers: hv: vmbus: Perform device register in the per-channel work > element > > Nick Meier (1): > Correcting truncation error for constant HV_CRASH_CTL_CRASH_NOTIFY > > Vitaly Kuznetsov (2): > Drivers: hv: hv_balloon: keep locks balanced on add_memory() failure > Drivers: hv: hv_balloon: don't lose memory when onlining order is not > natural Greg, Please drop the patch-set; one of the patches I sent was incorrect. I will resend. K. Y > > drivers/hv/channel.c |1 + > drivers/hv/channel_mgmt.c | 146 +++- > - > drivers/hv/connection.c |6 ++- > drivers/hv/hv_balloon.c | 15 ++--- > drivers/hv/hyperv_vmbus.h |4 +- > 5 files changed, 115 insertions(+), 57 deletions(-) > > -- > 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: ft1000: remove code indention
modified the code to keep the logic same but removed some indention. Signed-off-by: Sudip Mukherjee --- this patch will generate checkpatch warning about line more than 80char, and too many use of tab. but unless the total function is rewrtten it will be difficult to fix that. drivers/staging/ft1000/ft1000-usb/ft1000_debug.c | 44 +++- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c index 86dd699..584c59a 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c @@ -587,32 +587,30 @@ static long ft1000_ioctl(struct file *file, unsigned int command, if (qtype) { } else { /* Put message into Slow Queue */ - /* Only put a message into the DPRAM if msg doorbell is available */ - ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); - /* pr_debug("READ REGISTER tempword=%x\n", tempword); */ - if (tempword & FT1000_DB_DPRAM_TX) { - /* Suspend for 2ms and try again due to DSP doorbell busy */ - mdelay(2); + u8 cnt = 0; + + do { + /* Only put a message into the DPRAM if msg doorbell is available */ ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); + /* pr_debug("READ REGISTER tempword=%x\n", tempword); */ if (tempword & FT1000_DB_DPRAM_TX) { + /* Suspend for 2ms and try again due to DSP doorbell busy */ + if (cnt == 0) + mdelay(2); /* Suspend for 1ms and try again due to DSP doorbell busy */ - mdelay(1); - ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); - if (tempword & FT1000_DB_DPRAM_TX) { - ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); - if (tempword & FT1000_DB_DPRAM_TX) { - /* Suspend for 3ms and try again due to DSP doorbell busy */ - mdelay(3); - ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); - if (tempword & FT1000_DB_DPRAM_TX) { - pr_debug("Doorbell not available\n"); - result = -ENOTTY; - kfree(dpram_data); - break; - } - } - } - } + else if (cnt == 1) + mdelay(1); + /* Suspend for 3ms and try again due to DSP doorbell busy */ + else + mdelay(3); + } else + break; + } while (++cnt < 3); + if (tempword & FT1000_DB_DPRAM_TX) { + pr_debug("Doorbell not available\n"); + result = -ENOTTY; + kfree(dpram_data); + break; }
[PATCH 1/2] staging: ft1000: remove unused variables
these variables were assigned some values but they were never being reused again. Signed-off-by: Sudip Mukherjee --- this patch will generate some checkpatch warning about line being above 80char, but the code is so much indented that it is difficult to break the line. drivers/staging/ft1000/ft1000-usb/ft1000_debug.c | 14 ++-- .../staging/ft1000/ft1000-usb/ft1000_download.c| 92 +++--- 2 files changed, 50 insertions(+), 56 deletions(-) diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c index 58ad946..86dd699 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c @@ -297,14 +297,13 @@ void ft1000_destroy_dev(struct net_device *netdev) */ static int ft1000_open(struct inode *inode, struct file *file) { - struct ft1000_info *info; struct ft1000_usb *dev = (struct ft1000_usb *)inode->i_private; int i, num; num = (MINOR(inode->i_rdev) & 0xf); pr_debug("minor number=%d\n", num); - info = file->private_data = netdev_priv(dev->net); + file->private_data = netdev_priv(dev->net); pr_debug("f_owner = %p number of application = %d\n", &file->f_owner, dev->appcnt); @@ -528,7 +527,6 @@ static long ft1000_ioctl(struct file *file, unsigned int command, u16 *pmsg; u16 total_len; u16 app_index; - u16 status; /* pr_debug("IOCTL_FT1000_SET_DPRAM called\n");*/ @@ -590,22 +588,22 @@ static long ft1000_ioctl(struct file *file, unsigned int command, } else { /* Put message into Slow Queue */ /* Only put a message into the DPRAM if msg doorbell is available */ - status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); + ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); /* pr_debug("READ REGISTER tempword=%x\n", tempword); */ if (tempword & FT1000_DB_DPRAM_TX) { /* Suspend for 2ms and try again due to DSP doorbell busy */ mdelay(2); - status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); + ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); if (tempword & FT1000_DB_DPRAM_TX) { /* Suspend for 1ms and try again due to DSP doorbell busy */ mdelay(1); - status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); + ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); if (tempword & FT1000_DB_DPRAM_TX) { - status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); + ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); if (tempword & FT1000_DB_DPRAM_TX) { /* Suspend for 3ms and try again due to DSP doorbell busy */ mdelay(3); - status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); + ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); if (tempword & FT1000_DB_DPRAM_TX) { pr_debug("Doorbell not available\n"); result = -ENOTTY; diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c index e8126325..9e1104b 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c @@ -113,22 +113,21 @@ static int check_usb_db(struct ft1000_usb *ft1000dev) { int loopcnt; u16 temp; - int status; loopcnt = 0; while (loopcnt < 10) { - stat
[PATCH V2 0/7] Drivers: hv: Miscellaneous fixes
This patch-set has miscellaneous fixes for both the VMBUS as well as the balloon driver. There is also a fix for the hv tools makefile. In this version of the patchset, I have included a patch from Dexuan. Furthermore, I have addressed a memory leak issue in the patch: Drivers: hv: vmbus: Perform device register in the per-channel work element. Dan Carpenter (1): hv: vmbus: missing curly braces in vmbus_process_offer() Dexuan Cui (1): tools: hv: fcopy_daemon: support >2GB files for x86_32 guest K. Y. Srinivasan (2): Drivers: hv: vmbus: Export the vmbus_sendpacket_pagebuffer_ctl() Drivers: hv: vmbus: Perform device register in the per-channel work element Nick Meier (1): Correcting truncation error for constant HV_CRASH_CTL_CRASH_NOTIFY Vitaly Kuznetsov (2): Drivers: hv: hv_balloon: keep locks balanced on add_memory() failure Drivers: hv: hv_balloon: don't lose memory when onlining order is not natural drivers/hv/channel.c |1 + drivers/hv/channel_mgmt.c | 146 +++- drivers/hv/connection.c |6 ++- drivers/hv/hv_balloon.c | 15 ++--- drivers/hv/hyperv_vmbus.h |4 +- tools/hv/Makefile |2 +- 6 files changed, 117 insertions(+), 57 deletions(-) -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH V2 4/7] Drivers: hv: hv_balloon: don't lose memory when onlining order is not natural
From: Vitaly Kuznetsov Memory blocks can be onlined in random order. When this order is not natural some memory pages are not onlined because of the redundant check in hv_online_page(). Here is a real world scenario: 1) Host tries to hot-add the following (process_hot_add): pg_start=rg_start=0x48000, pfn_cnt=111616, rg_size=262144 2) This results in adding 4 memory blocks: [ 109.057866] init_memory_mapping: [mem 0x4800-0x4fff] [ 114.102698] init_memory_mapping: [mem 0x5000-0x57ff] [ 119.168039] init_memory_mapping: [mem 0x5800-0x5fff] [ 124.233053] init_memory_mapping: [mem 0x6000-0x67ff] The last one is incomplete but we have special has->covered_end_pfn counter to avoid onlining non-backed frames and hv_bring_pgs_online() function to bring them online later on. 3) Now we have 4 offline memory blocks: /sys/devices/system/memory/memory9-12 $ for f in /sys/devices/system/memory/memory*/state; do echo $f `cat $f`; done | grep -v onlin /sys/devices/system/memory/memory10/state offline /sys/devices/system/memory/memory11/state offline /sys/devices/system/memory/memory12/state offline /sys/devices/system/memory/memory9/state offline 4) We bring them online in non-natural order: $grep MemTotal /proc/meminfo MemTotal: 966348 kB $echo online > /sys/devices/system/memory/memory12/state && grep MemTotal /proc/meminfo MemTotal:1019596 kB $echo online > /sys/devices/system/memory/memory11/state && grep MemTotal /proc/meminfo MemTotal:1150668 kB $echo online > /sys/devices/system/memory/memory9/state && grep MemTotal /proc/meminfo MemTotal:1150668 kB As you can see memory9 block gives us zero additional memory. We can also observe a huge discrepancy between host- and guest-reported memory sizes. The root cause of the issue is the redundant pg >= covered_start_pfn check (and covered_start_pfn advancing) in hv_online_page(). When upper memory block in being onlined before the lower one (memory12 and memory11 in the above case) we advance the covered_start_pfn pointer and all memory9 pages do not pass the check. If the assumption that host always gives us requests in sequential order and pg_start always equals rg_start when the first request for the new HA region is received (that's the case in my testing) is correct than we can get rid of covered_start_pfn and pg >= start_pfn check in hv_online_page() is sufficient. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_balloon.c | 14 -- 1 files changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c index f1f17c5..014256a 100644 --- a/drivers/hv/hv_balloon.c +++ b/drivers/hv/hv_balloon.c @@ -428,14 +428,13 @@ struct dm_info_msg { * currently hot added. We hot add in multiples of 128M * chunks; it is possible that we may not be able to bring * online all the pages in the region. The range - * covered_start_pfn : covered_end_pfn defines the pages that can + * covered_end_pfn defines the pages that can * be brough online. */ struct hv_hotadd_state { struct list_head list; unsigned long start_pfn; - unsigned long covered_start_pfn; unsigned long covered_end_pfn; unsigned long ha_end_pfn; unsigned long end_pfn; @@ -679,8 +678,7 @@ static void hv_online_page(struct page *pg) list_for_each(cur, &dm_device.ha_region_list) { has = list_entry(cur, struct hv_hotadd_state, list); - cur_start_pgp = (unsigned long) - pfn_to_page(has->covered_start_pfn); + cur_start_pgp = (unsigned long)pfn_to_page(has->start_pfn); cur_end_pgp = (unsigned long)pfn_to_page(has->covered_end_pfn); if (((unsigned long)pg >= cur_start_pgp) && @@ -692,7 +690,6 @@ static void hv_online_page(struct page *pg) __online_page_set_limits(pg); __online_page_increment_counters(pg); __online_page_free(pg); - has->covered_start_pfn++; } } } @@ -736,10 +733,9 @@ static bool pfn_covered(unsigned long start_pfn, unsigned long pfn_cnt) * is, update it. */ - if (has->covered_end_pfn != start_pfn) { + if (has->covered_end_pfn != start_pfn) has->covered_end_pfn = start_pfn; - has->covered_start_pfn = start_pfn; - } + return true; } @@ -784,7 +780,6 @@ static unsigned long handle_pg_range(unsigned long pg_start, pgs_ol = pfn_cnt; hv_bring_pgs_online(start_pfn, pgs_ol); has->covered_end_pfn += pgs_ol; - has->covered_start_pfn += pgs_ol; pfn_cnt -= pgs_ol; } @@ -845,7 +84
[PATCH V2 3/7] Drivers: hv: hv_balloon: keep locks balanced on add_memory() failure
From: Vitaly Kuznetsov When add_memory() fails the following BUG is observed: [ 743.646107] hv_balloon: hot_add memory failed error is -17 [ 743.679973] [ 743.680930] = [ 743.680930] [ BUG: bad unlock balance detected! ] [ 743.680930] 3.19.0-rc5_bug1131426+ #552 Not tainted [ 743.680930] - [ 743.680930] kworker/0:2/255 is trying to release lock (&dm_device.ha_region_mutex) at: [ 743.680930] [] mutex_unlock+0xe/0x10 [ 743.680930] but there are no more locks to release! This happens as we don't acquire ha_region_mutex and hot_add_req() expects us to as it does unconditional mutex_unlock(). Acquire the lock on the error path. Signed-off-by: Vitaly Kuznetsov Acked-by: Jason Wang Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_balloon.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c index c5bb872..f1f17c5 100644 --- a/drivers/hv/hv_balloon.c +++ b/drivers/hv/hv_balloon.c @@ -652,6 +652,7 @@ static void hv_mem_hot_add(unsigned long start, unsigned long size, } has->ha_end_pfn -= HA_CHUNK; has->covered_end_pfn -= processed_pfn; + mutex_lock(&dm_device.ha_region_mutex); break; } -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH V2 5/7] Correcting truncation error for constant HV_CRASH_CTL_CRASH_NOTIFY
From: Nick Meier HV_CRASH_CTL_CRASH_NOTIFY is a 64 bit number. Depending on the usage context, the value may be truncated. This patch is in response from the following email from Intel: [char-misc:char-misc-testing 25/45] drivers/hv/vmbus_drv.c:67:9: sparse: constant 0x8000 is so big it is unsigned long tree: git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git char-misc-testing head: b3de8e3719e582f3182bb504295e4a8e43c8c96f commit: 96c1d0581d00f7abe033350edb021a9d947d8d81 [25/45] Drivers: hv: vmbus: Add support for VMBus panic notifier handler reproduce: # apt-get install sparse git checkout 96c1d0581d00f7abe033350edb021a9d947d8d81 make ARCH=x86_64 allmodconfig make C=1 CF=-D__CHECK_ENDIAN__ sparse warnings: (new ones prefixed by >>) drivers/hv/vmbus_drv.c:67:9: sparse: constant 0x8000 is so big it is unsigned long ... Signed-off-by: Nick Meier Signed-off-by: K. Y. Srinivasan --- drivers/hv/hyperv_vmbus.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h index 6339589..c8e27e0 100644 --- a/drivers/hv/hyperv_vmbus.h +++ b/drivers/hv/hyperv_vmbus.h @@ -58,7 +58,7 @@ enum hv_cpuid_function { #define HV_X64_MSR_CRASH_P4 0x4104 #define HV_X64_MSR_CRASH_CTL 0x4105 -#define HV_CRASH_CTL_CRASH_NOTIFY 0x8000 +#define HV_CRASH_CTL_CRASH_NOTIFY (1ULL << 63) /* Define version of the synthetic interrupt controller. */ #define HV_SYNIC_VERSION (1) -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH V2 1/7] Drivers: hv: vmbus: Export the vmbus_sendpacket_pagebuffer_ctl()
Export the vmbus_sendpacket_pagebuffer_ctl() interface. Signed-off-by: K. Y. Srinivasan --- drivers/hv/channel.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/hv/channel.c b/drivers/hv/channel.c index da53180..e58cdb7 100644 --- a/drivers/hv/channel.c +++ b/drivers/hv/channel.c @@ -710,6 +710,7 @@ int vmbus_sendpacket_pagebuffer_ctl(struct vmbus_channel *channel, return ret; } +EXPORT_SYMBOL_GPL(vmbus_sendpacket_pagebuffer_ctl); /* * vmbus_sendpacket_pagebuffer - Send a range of single-page buffer -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH V2 6/7] hv: vmbus: missing curly braces in vmbus_process_offer()
From: Dan Carpenter The indenting makes it clear that there were curly braces intended here. Fixes: 2dd37cb81580 ('Drivers: hv: vmbus: Handle both rescind and offer messages in the same context') Signed-off-by: Dan Carpenter Signed-off-by: K. Y. Srinivasan --- drivers/hv/channel_mgmt.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 5f8e47b..25dbbaf 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -415,7 +415,7 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel) newchannel->state = CHANNEL_OPEN_STATE; channel->num_sc++; - if (channel->sc_creation_callback != NULL) + if (channel->sc_creation_callback != NULL) { /* * We need to invoke the sub-channel creation * callback; invoke this in a seperate work @@ -427,6 +427,7 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel) vmbus_sc_creation_cb); queue_work(newchannel->controlwq, &newchannel->work); + } return; } -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH V2 7/7] tools: hv: fcopy_daemon: support >2GB files for x86_32 guest
From: Dexuan Cui Without this patch, hv_fcopy_daemon's hv_copy_data() -> pwrite() will fail for >2GB file offset. Signed-off-by: Alex Ng Signed-off-by: Dexuan Cui Cc: K. Y. Srinivasan Signed-off-by: K. Y. Srinivasan --- tools/hv/Makefile |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/hv/Makefile b/tools/hv/Makefile index 99ffe61..a8ab795 100644 --- a/tools/hv/Makefile +++ b/tools/hv/Makefile @@ -3,7 +3,7 @@ CC = $(CROSS_COMPILE)gcc PTHREAD_LIBS = -lpthread WARNINGS = -Wall -Wextra -CFLAGS = $(WARNINGS) -g $(PTHREAD_LIBS) +CFLAGS = $(WARNINGS) -g $(PTHREAD_LIBS) $(shell getconf LFS_CFLAGS) all: hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon %: %.c -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH V2 2/7] Drivers: hv: vmbus: Perform device register in the per-channel work element
This patch is a continuation of the rescind handling cleanup work. We cannot block in the global message handling work context especially if we are blocking waiting for the host to wake us up. I would like to thank Dexuan Cui for observing this problem. Signed-off-by: K. Y. Srinivasan --- - Free up the work element after processing rescind. drivers/hv/channel_mgmt.c | 143 +++- drivers/hv/connection.c |6 ++- drivers/hv/hyperv_vmbus.h |2 +- 3 files changed, 107 insertions(+), 44 deletions(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 6117891..5f8e47b 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -37,6 +38,10 @@ struct vmbus_channel_message_table_entry { void (*message_handler)(struct vmbus_channel_message_header *msg); }; +struct vmbus_rescind_work { + struct work_struct work; + struct vmbus_channel *channel; +}; /** * vmbus_prep_negotiate_resp() - Create default response for Hyper-V Negotiate message @@ -134,20 +139,6 @@ fw_error: EXPORT_SYMBOL_GPL(vmbus_prep_negotiate_resp); -static void vmbus_process_device_unregister(struct work_struct *work) -{ - struct device *dev; - struct vmbus_channel *channel = container_of(work, - struct vmbus_channel, - work); - - dev = get_device(&channel->device_obj->device); - if (dev) { - vmbus_device_unregister(channel->device_obj); - put_device(dev); - } -} - static void vmbus_sc_creation_cb(struct work_struct *work) { struct vmbus_channel *newchannel = container_of(work, @@ -220,6 +211,40 @@ static void free_channel(struct vmbus_channel *channel) queue_work(vmbus_connection.work_queue, &channel->work); } +static void process_rescind_fn(struct work_struct *work) +{ + struct vmbus_rescind_work *rc_work; + struct vmbus_channel *channel; + struct device *dev; + + rc_work = container_of(work, struct vmbus_rescind_work, work); + channel = rc_work->channel; + + /* +* We have already acquired a reference on the channel +* and so it cannot vanish underneath us. +* It is possible (while very unlikely) that we may +* get here while the processing of the initial offer +* is still not complete. Deal with this situation by +* just waiting until the channel is in the correct state. +*/ + + while (channel->work.func != release_channel) + msleep(1000); + + if (channel->device_obj) { + dev = get_device(&channel->device_obj->device); + if (dev) { + vmbus_device_unregister(channel->device_obj); + put_device(dev); + } + } else { + hv_process_channel_removal(channel, + channel->offermsg.child_relid); + } + kfree(work); +} + static void percpu_channel_enq(void *arg) { struct vmbus_channel *channel = arg; @@ -282,6 +307,46 @@ void vmbus_free_channels(void) } } +static void vmbus_do_device_register(struct work_struct *work) +{ + struct hv_device *device_obj; + int ret; + unsigned long flags; + struct vmbus_channel *newchannel = container_of(work, +struct vmbus_channel, +work); + + ret = vmbus_device_register(newchannel->device_obj); + if (ret != 0) { + pr_err("unable to add child device object (relid %d)\n", + newchannel->offermsg.child_relid); + spin_lock_irqsave(&vmbus_connection.channel_lock, flags); + list_del(&newchannel->listentry); + device_obj = newchannel->device_obj; + newchannel->device_obj = NULL; + spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags); + + if (newchannel->target_cpu != get_cpu()) { + put_cpu(); + smp_call_function_single(newchannel->target_cpu, +percpu_channel_deq, newchannel, true); + } else { + percpu_channel_deq(newchannel); + put_cpu(); + } + + kfree(device_obj); + if (!newchannel->rescind) { + free_channel(newchannel); + return; + } + } + /* +* The next state for this channel is to be freed. +*/ + INIT_WORK(&newchannel->work, release_channel); +} + /* * vmbus_process_offer - Process the offer by creating a ch