Re: [PATCH 1/2] staging: android: ashmem: Remove use of unlikely()

2018-06-19 Thread Joel Fernandes
On Tue, Jun 19, 2018 at 05:57:34PM -0700, Alistair Strachan wrote: > There is no speed difference, and it makes the code harder to read. > > Cc: Greg Kroah-Hartman > Cc: Arve Hjønnevåg > Cc: Todd Kjos > Cc: Martijn Coenen > Cc: de...@driverdev.osuosl.org > Cc: linux-ker...@vger.kernel.org >

Re: [PATCH 2/2 v2] staging: android: ashmem: Fix mmap size validation

2018-06-19 Thread Joel Fernandes
On Tue, Jun 19, 2018 at 05:57:35PM -0700, Alistair Strachan wrote: > The ashmem driver did not check that the size/offset of the vma passed > to its .mmap() function was not larger than the ashmem object being > mapped. This could cause mmap() to succeed, even though accessing parts > of the

[PATCH] staging: rtlwifi: Fix a possible sleep-in-atomic-context bug in _is_fw_read_cmd_down()

2018-06-19 Thread Jia-Ju Bai
The driver may sleep with holding a spinlock. The function call path (from bottom to top) in Linux-4.16.7 is: [FUNC] schedule drivers/staging/rtlwifi/halmac/rtl_halmac.c, 884: schedule in _is_fw_read_cmd_down drivers/staging/rtlwifi/halmac/rtl_halmac.c, 912:

[PATCH v2] staging: pi433: fix race condition in pi433_open

2018-06-19 Thread Hugo Lefeuvre
The device structure contains a useless non-atomic users counter which is subject to race conditions. It has probably been created to handle the case where remove is executed while operations are still executing on open fds but this will never happen because of reference counts. Drop the users

[PATCH 2/2 v2] staging: android: ashmem: Fix mmap size validation

2018-06-19 Thread Alistair Strachan
The ashmem driver did not check that the size/offset of the vma passed to its .mmap() function was not larger than the ashmem object being mapped. This could cause mmap() to succeed, even though accessing parts of the mapping would later fail with a segmentation fault. Ensure an error is returned

[PATCH 1/2] staging: android: ashmem: Remove use of unlikely()

2018-06-19 Thread Alistair Strachan
There is no speed difference, and it makes the code harder to read. Cc: Greg Kroah-Hartman Cc: Arve Hjønnevåg Cc: Todd Kjos Cc: Martijn Coenen Cc: de...@driverdev.osuosl.org Cc: linux-ker...@vger.kernel.org Cc: kernel-t...@android.com Cc: Joel Fernandes Suggested-by: Greg Kroah-Hartman

Re: [PATCH] staging: android: ashmem: Fix mmap size validation

2018-06-19 Thread Alistair Strachan
HI Greg, On Tue, Jun 19, 2018 at 4:01 PM Greg Kroah-Hartman wrote: > > On Tue, Jun 19, 2018 at 03:24:44PM -0700, Alistair Strachan wrote: > > The ashmem driver did not check that the size/offset of the vma passed > > to its .mmap() function was not larger than the ashmem object being > > mapped.

Re: Incomplete fix for be9c798 / 7b2ee50 hv_netvsc: common detach logic?

2018-06-19 Thread Stephen Hemminger
On Wed, 20 Jun 2018 08:01:50 +0900 Greg KH wrote: > On Tue, Jun 19, 2018 at 03:19:41PM -0400, Thomas Walker wrote: > > Upon updating some internal kernels from 4.14.18 to 4.14.49, our hyper-v > > guests failed to bring up network interfaces on boot, logging "A link > > change request failed

Re: Incomplete fix for be9c798 / 7b2ee50 hv_netvsc: common detach logic?

2018-06-19 Thread Stephen Hemminger
On Wed, 20 Jun 2018 08:01:50 +0900 Greg KH wrote: > On Tue, Jun 19, 2018 at 03:19:41PM -0400, Thomas Walker wrote: > > Upon updating some internal kernels from 4.14.18 to 4.14.49, our hyper-v > > guests failed to bring up network interfaces on boot, logging "A link > > change request failed

Re: Incomplete fix for be9c798 / 7b2ee50 hv_netvsc: common detach logic?

2018-06-19 Thread Greg KH
On Tue, Jun 19, 2018 at 03:19:41PM -0400, Thomas Walker wrote: > Upon updating some internal kernels from 4.14.18 to 4.14.49, our hyper-v > guests failed to bring up network interfaces on boot, logging "A link change > request failed with some changes committed already. Interface eth0 may have

Re: [PATCH] staging: android: ashmem: Fix mmap size validation

2018-06-19 Thread Greg Kroah-Hartman
On Tue, Jun 19, 2018 at 03:24:44PM -0700, Alistair Strachan wrote: > The ashmem driver did not check that the size/offset of the vma passed > to its .mmap() function was not larger than the ashmem object being > mapped. This could cause mmap() to succeed, even though accessing parts > of the

[PATCH] staging: android: ashmem: Fix mmap size validation

2018-06-19 Thread Alistair Strachan
The ashmem driver did not check that the size/offset of the vma passed to its .mmap() function was not larger than the ashmem object being mapped. This could cause mmap() to succeed, even though accessing parts of the mapping would later fail with a segmentation fault. Ensure an error is returned

very urgent

2018-06-19 Thread Helen galloway
Hello My Dear Friend... I sincerely apologize for intruding into your privacy, especially by contacting you through these means for a business proposal of this magnitude. I am Dr Helen Galloway,a medical doctor currently serving on a special peacekeeping Mission in Syria.. I have summed up

[PATCH 3/5] arm64: hyperv: Add support for Hyper-V as a hypervisor

2018-06-19 Thread Michael Kelley
Add ARM64-specific code to enable Hyper-V. This code includes: * Detecting Hyper-V and initializing the guest/Hyper-V interface * Setting up Hyper-V's synthetic clocks * Making hypercalls using the HVC instruction * Setting up VMbus and stimer0 interrupts * Setting up kexec and crash handlers This

[PATCH 1/5] arm64: mm: Add slow_virt_to_phys()

2018-06-19 Thread Michael Kelley
Add slow_virt_to_phys() function for ARM64 that parallels the same function on x86/x64. This is needed by the architecture independent Hyper-V VMbus driver at drivers/hv/channel.c. The implementation directly translates the virtual address using the ARM64 'at' instruction. Signed-off-by: Michael

[PATCH 0/5] Enable Linux guests on Hyper-V on ARM64

2018-06-19 Thread Michael Kelley
This patch series enables Linux guests running on Hyper-V on ARM64 hardware. New ARM64-specific code in arch/arm64/hyperv initializes Hyper-V, including its synthetic clocks and hypercall mechanism. Existing architecture independent drivers for Hyper-V's VMbus and synthetic devices just work when

[PATCH 2/5] arm64: hyperv: Add core Hyper-V include files

2018-06-19 Thread Michael Kelley
hyperv-tlfs.h defines Hyper-V interfaces from the Hyper-V Top Level Functional Spec (TLFS). The TLFS is distinctly oriented to x86/x64, and Hyper-V has not separated out the architecture-dependent parts into x86/x64 vs. ARM64. So hyperv-tlfs.h includes information for ARM64 that is not yet

[PATCH 4/5] Drivers: hv: vmbus: Add hooks for per-CPU IRQ

2018-06-19 Thread Michael Kelley
Add hooks to enable/disable a per-CPU IRQ for VMbus. These hooks are in the architecture independent setup and shutdown paths for Hyper-V, and are needed by Linux guests on Hyper-V on ARM64. The x86/x64 implementation is null because VMbus interrupts on x86/x64 don't use an IRQ. Signed-off-by:

[PATCH 5/5] Drivers: hv: Enable CONFIG_HYPERV on ARM64

2018-06-19 Thread Michael Kelley
Update drivers/hv/Kconfig so CONFIG_HYPERV can be selected on ARM64, causing the Hyper-V specific code to be built. Signed-off-by: Michael Kelley Reviewed-by: James Morris --- drivers/hv/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hv/Kconfig

Re: [PATCH 5/9] staging: rtl8192u: Use %s and __func__ instead of hardcoded string - Style

2018-06-19 Thread Andy Shevchenko
On Tue, Jun 19, 2018 at 10:56 PM, John Whitmore wrote: > Changed a number of hard coded function names to use %s and __func__ Oh. Looking at the code, much better fix would be... Move IEEE80211_DEBUG() to use netdev_dbg() [dev_dbg() or pr_dbg() as last resort) and actually drop it completely

Re: [PATCH 3/9] staging: rtl8192u: Truncate block comments to 80 character length - Style

2018-06-19 Thread Andy Shevchenko
On Tue, Jun 19, 2018 at 10:55 PM, John Whitmore wrote: > Where possible truncation of block comments to the 80 character length > prefered by the coding style. Is it somehow automated?! > /* > -* 8190 only, Realtek proprietary aggregation mode > -* Set MPDUDensity=2,

Re: [PATCH 2/9] staging: rtl8192u: Correct indentation of switch statement - Coding Style

2018-06-19 Thread Andy Shevchenko
On Tue, Jun 19, 2018 at 10:55 PM, John Whitmore wrote: > Removed an extra indentation from the code of the various case options in a > switch statement. > + //no MCS rate > + for (i = 0; i <= 15; i++) > + pOperateMCS[i] = 0; This would be just

[PATCH 9/9] staging: rtl8192u: Correction of spelling mistake in comment.

2018-06-19 Thread John Whitmore
Simple spelling correction. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c index

[PATCH 2/9] staging: rtl8192u: Correct indentation of switch statement - Coding Style

2018-06-19 Thread John Whitmore
Removed an extra indentation from the code of the various case options in a switch statement. Signed-off-by: John Whitmore --- .../rtl8192u/ieee80211/rtl819x_HTProc.c | 30 +-- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git

[PATCH 5/9] staging: rtl8192u: Use %s and __func__ instead of hardcoded string - Style

2018-06-19 Thread John Whitmore
Changed a number of hard coded function names to use %s and __func__ Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c

[PATCH 6/9] staging: rtl8192u: Remove braces from single statement blocks - Style

2018-06-19 Thread John Whitmore
Removed the unrequired braces from single statement blocks - Coding Style. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c

v1 Coding style changes

2018-06-19 Thread John Whitmore
Simple coding style changes to single file drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

[PATCH 7/9] staging: rtl8192u: Correciton of block comments - Coding Style

2018-06-19 Thread John Whitmore
Correcton of a few block comments to comply with Coding Style. Signed-off-by: John Whitmore --- .../staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c

[PATCH 1/9] staging: rtl8192u: change block comments to prefered style - Coding Style

2018-06-19 Thread John Whitmore
Some of the comment blocks are commening out code so have been left for the moment. Signed-off-by: John Whitmore --- .../rtl8192u/ieee80211/rtl819x_HTProc.c | 366 ++ 1 file changed, 195 insertions(+), 171 deletions(-) diff --git

[PATCH 3/9] staging: rtl8192u: Truncate block comments to 80 character length - Style

2018-06-19 Thread John Whitmore
Where possible truncation of block comments to the 80 character length prefered by the coding style. Signed-off-by: John Whitmore --- .../rtl8192u/ieee80211/rtl819x_HTProc.c | 157 +++--- 1 file changed, 98 insertions(+), 59 deletions(-) diff --git

[PATCH 8/9] staging: rtl8192u: Correct if statement - Coding Style

2018-06-19 Thread John Whitmore
Corrected the coding style of if statement. Signed-off-by: John Whitmore --- drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c

[PATCH 4/9] staging: rtl8192u: Removal of white space from end of lines - Coding Style

2018-06-19 Thread John Whitmore
Previous truncation of comment blocks to 80 character line length resulted in some white space at endof line. Signed-off-by: John Whitmore --- .../rtl8192u/ieee80211/rtl819x_HTProc.c | 26 +-- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git

Incomplete fix for be9c798 / 7b2ee50 hv_netvsc: common detach logic?

2018-06-19 Thread Thomas Walker
Upon updating some internal kernels from 4.14.18 to 4.14.49, our hyper-v guests failed to bring up network interfaces on boot, logging "A link change request failed with some changes committed already. Interface eth0 may have been left with an inconsistent configuration, please check." Running

[PATCH v2] staging: wilc1000: Use common structs to parse ip packets

2018-06-19 Thread Thibaut Robert
Use structs ethhdr, iphdr and tcphdr instead of manual parsing in tcp_process. This commit fix handling of ip packets containing options. It also fixes the following sparse warning: drivers/staging/wilc1000//wilc_wlan.c:201:19: warning: cast to restricted __be16 Signed-off-by: Thibaut Robert

RE: [PATCH] x86/hyper-v: use cheaper HVCALL_FLUSH_VIRTUAL_ADDRESS_{LIST,SPACE} hypercalls when possible

2018-06-19 Thread KY Srinivasan
> -Original Message- > From: Michael Kelley (EOSG) > Sent: Tuesday, June 19, 2018 10:57 AM > To: Vitaly Kuznetsov ; x...@kernel.org > Cc: de...@linuxdriverproject.org; linux-ker...@vger.kernel.org; KY > Srinivasan ; Haiyang Zhang > ; Stephen Hemminger > ; Thomas Gleixner ; Ingo > Molnar

RE: [PATCH] x86/hyper-v: use cheaper HVCALL_FLUSH_VIRTUAL_ADDRESS_{LIST,SPACE} hypercalls when possible

2018-06-19 Thread Michael Kelley (EOSG)
> -Original Message- > From: linux-kernel-ow...@vger.kernel.org > On Behalf > Of Vitaly Kuznetsov > Sent: Friday, June 15, 2018 9:30 AM > To: x...@kernel.org > Cc: de...@linuxdriverproject.org; linux-ker...@vger.kernel.org; KY Srinivasan > ; Haiyang Zhang ; Stephen > Hemminger > ;

Re: [PATCH v4] staging: rts5208: add error handling into rtsx_probe

2018-06-19 Thread Andy Shevchenko
On Tue, Jun 19, 2018 at 6:25 PM, Anton Vasilyev wrote: > If rtsx_probe() fails to allocate dev->chip, then release_everything() > will crash on uninitialized dev->cmnd_ready complete Period is missed at the end. > > Patch adds error handling into rtsx_probe. an error > > Found by Linux Driver

[PATCH V3] staging: mt7621-eth: Fix memory leak in mtk_add_mac() error path

2018-06-19 Thread Kamal Heib
Fix memory leak in error path of mtk_add_mac() by make sure to free the allocated netdev. Fixes: e3cbf478f846 ('staging: mt7621-eth: add the drivers core files') Signed-off-by: Kamal Heib --- Changes from v2: No need to print error when allocation failed. Changes from v1: No need

Re: [PATCH V2] staging: mt7621-eth: Fix memory leak in mtk_add_mac() error path

2018-06-19 Thread Kamal Heib
On Mon, Jun 18, 2018 at 10:52:01AM +0200, Greg Kroah-Hartman wrote: > On Sat, Jun 16, 2018 at 01:01:27PM +0300, Kamal Heib wrote: > > Fix memory leak in error path of mtk_add_mac() by make sure to free > > the allocated netdev. > > > > Fixes: e3cbf478f846 ('staging: mt7621-eth: add the drivers

[PATCH] Staging: comedi: fix operator '=' coding style issue

2018-06-19 Thread Vitor Fernandes Ferreira
Signed-off-by: Vitor Fernandes Ferreira --- drivers/staging/comedi/comedi_fops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 1f3b1106f478..e18b61cdbdeb 100644 ---

[PATCH v4] staging: rts5208: add error handling into rtsx_probe

2018-06-19 Thread Anton Vasilyev
If rtsx_probe() fails to allocate dev->chip, then release_everything() will crash on uninitialized dev->cmnd_ready complete Patch adds error handling into rtsx_probe. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev --- v4: rename labels baced on Dan

Re: [PATCH] staging: pi433: fix race condition in pi433_open

2018-06-19 Thread Dan Carpenter
On Tue, Jun 19, 2018 at 09:42:20AM -0400, Hugo Lefeuvre wrote: > This TODO seems to be related to this misunderstanding too: > > 890 /* TODO? guard against device removal before, or while, > 891 * we issue this ioctl. --> device_get() > 892 */ > > Device removal

Re: [PATCH] staging: pi433: fix race condition in pi433_open

2018-06-19 Thread Hugo Lefeuvre
> > It would be great to get rid of this counter, indeed. But how to do it > > properly without breaking things ? It seems to be useful to me... > > These things are refcounted so you can't unload the module while a file > is open. When we do an open it does a cdev_get(). When we call the >

Re: [PATCH] x86/hyper-v: use cheaper HVCALL_FLUSH_VIRTUAL_ADDRESS_{LIST, SPACE} hypercalls when possible

2018-06-19 Thread Vitaly Kuznetsov
Thomas Gleixner writes: > On Tue, 19 Jun 2018, Vitaly Kuznetsov wrote: >> Thomas Gleixner writes: >> >> > On Fri, 15 Jun 2018, Vitaly Kuznetsov wrote: >> >> * Fills in gva_list starting from offset. Returns the number of items >> >> added. >> >> @@ -93,10 +95,19 @@ static void

Re: [PATCH] x86/hyper-v: use cheaper HVCALL_FLUSH_VIRTUAL_ADDRESS_{LIST, SPACE} hypercalls when possible

2018-06-19 Thread Thomas Gleixner
On Tue, 19 Jun 2018, Vitaly Kuznetsov wrote: > Thomas Gleixner writes: > > > On Fri, 15 Jun 2018, Vitaly Kuznetsov wrote: > >> * Fills in gva_list starting from offset. Returns the number of items > >> added. > >> @@ -93,10 +95,19 @@ static void hyperv_flush_tlb_others(const struct > >>

Re: [PATCH] x86/hyper-v: use cheaper HVCALL_FLUSH_VIRTUAL_ADDRESS_{LIST, SPACE} hypercalls when possible

2018-06-19 Thread Vitaly Kuznetsov
Thomas Gleixner writes: > On Fri, 15 Jun 2018, Vitaly Kuznetsov wrote: >> * Fills in gva_list starting from offset. Returns the number of items >> added. >> @@ -93,10 +95,19 @@ static void hyperv_flush_tlb_others(const struct cpumask >> *cpus, >> if (cpumask_equal(cpus,

Re: [PATCH] x86/hyper-v: use cheaper HVCALL_FLUSH_VIRTUAL_ADDRESS_{LIST, SPACE} hypercalls when possible

2018-06-19 Thread Thomas Gleixner
On Fri, 15 Jun 2018, Vitaly Kuznetsov wrote: > * Fills in gva_list starting from offset. Returns the number of items added. > @@ -93,10 +95,19 @@ static void hyperv_flush_tlb_others(const struct cpumask > *cpus, > if (cpumask_equal(cpus, cpu_present_mask)) { > flush->flags

Re: [PATCH] staging: pi433: fix race condition in pi433_open

2018-06-19 Thread Dan Carpenter
On Mon, Jun 18, 2018 at 11:11:36PM -0400, Hugo Lefeuvre wrote: > Hi Dan, > > > We need to decrement device->users-- on the error paths as well. > > This function was already slightly broken with respect to counting the > > users, but let's not make it worse. > > > > I think it's still a tiny bit

Re: rf69_set_deviation in rf69.c (pi433 driver)

2018-06-19 Thread Marcus Wolf
Hi Hugo, sorry for the late response and thank you for all that deep investigation in the pi433 driver! > According to the datasheet[0], the deviation should always be smaller > than 300kHz, and the following equation should be respected: > > (1) FDA + BRF/2 =< 500 kHz > > Why did you choose

Re: [PATCH] staging: board: drop refcount in success case

2018-06-19 Thread Nicholas Mc Guire
On Tue, Jun 19, 2018 at 09:51:44AM +0200, Geert Uytterhoeven wrote: > On Tue, Jun 19, 2018 at 9:37 AM Dan Carpenter > wrote: > > On Mon, Jun 18, 2018 at 08:53:19PM +0200, Nicholas Mc Guire wrote: > > > The call to of_find_compatible_node() returns irqc_node with refcount > > > incremented thus

Re: [PATCH] staging: rtl8723bs: remove get_monotonic_boottime()

2018-06-19 Thread Arnd Bergmann
On Tue, Jun 19, 2018 at 9:18 AM, Quytelda Kahja wrote: > I'm fairly sure this doesn't matter functionally (yet), but perhaps > 'notify_timestamp' should be updated to an 's64' type since ktime_to_us() > returns a signed type? I think it's fine either way, ktime_t is only signed to deal with

Re: [PATCH] staging: board: drop refcount in success case

2018-06-19 Thread Geert Uytterhoeven
On Tue, Jun 19, 2018 at 9:37 AM Dan Carpenter wrote: > On Mon, Jun 18, 2018 at 08:53:19PM +0200, Nicholas Mc Guire wrote: > > The call to of_find_compatible_node() returns irqc_node with refcount > > incremented thus it must be explicitly decremented here after it was > > checked for non-NULL. >

Re: your mail

2018-06-19 Thread Dan Carpenter
Thanks for this. This is a lot of work. On Wed, Jun 13, 2018 at 08:31:28PM +0300, Anton Vasilyev wrote: > diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c > index 70e0b8623110..69e6abe14abf 100644 > --- a/drivers/staging/rts5208/rtsx.c > +++

Re: [PATCH] staging: board: drop refcount in success case

2018-06-19 Thread Dan Carpenter
On Mon, Jun 18, 2018 at 08:53:19PM +0200, Nicholas Mc Guire wrote: > The call to of_find_compatible_node() returns irqc_node with refcount > incremented thus it must be explicitly decremented here after it was > checked for non-NULL. > > Signed-off-by: Nicholas Mc Guire > Fixes: commit

Re: [PATCH] staging: rtl8723bs: remove get_monotonic_boottime()

2018-06-19 Thread Quytelda Kahja
I'm fairly sure this doesn't matter functionally (yet), but perhaps 'notify_timestamp' should be updated to an 's64' type since ktime_to_us() returns a signed type? That note aside, I think this is good. On Mon, Jun 18, 2018 at 05:06:50PM +0200, Arnd Bergmann wrote: > get_monotonic_boottime() is

Re: [PATCH] staging:iio:adc:ad7816: Backward resources cleanups in probe

2018-06-19 Thread Lars-Peter Clausen
On 06/19/2018 01:38 AM, Karim Eshapa wrote: > Backward cleanups for all resources allocated in probing > in case of failure at any regestering or allocation step. Hi, Thanks for the patch. Resources that are allocated with devm_ are freed automatically in case of an error, so this patch should