[PATCH] usb: hub: Fix unbalanced reference count and memory leak

2016-07-27 Thread Viresh Kumar
nding work. CC: #4.4+ Fixes: e50293ef9775 ("USB: fix invalid memory access in hub_activate()") Signed-off-by: Viresh Kumar --- Greg, This is tested over 3.10 with backported patches only, sorry didn't had a mainline setup to test this out. :( drivers/usb/core/hub.c | 3 ++- 1 fi

Re: [PATCH] usb: hub: Fix unbalanced reference count and memory leak

2016-07-28 Thread Viresh Kumar
On 28-07-16, 10:13, Alan Stern wrote: > On Wed, 27 Jul 2016, Viresh Kumar wrote: > > > If the hub gets disconnected while the core is still activating it, this > > can result in leaking memory of few USB structures. > > > > This will happen if we have done a kref

Re: pwc over musb: 100% frame drop (lost) on high resolution stream

2016-08-01 Thread Viresh Kumar
On 01-08-16, 20:01, Matwey V. Kornilov wrote: > With this patch, there is no cpufreq directory here. > > Without this patch, the output is the following: > > nohostname:~ # uname -a > Linux nohostname 4.6.4-3.gecd9058-default #1 SMP PREEMPT Fri Jul 15 > 08:08:50 UTC 2016 (ecd9058) armv7l armv7l a

Re: pwc over musb: 100% frame drop (lost) on high resolution stream

2016-08-01 Thread Viresh Kumar
hz by cpufreq driver > (as it did whet there was cpufreq driver). > > 2016-07-29 21:01 GMT+03:00 Matwey V. Kornilov : > > Hello, > > > > I've found that the following commit fixes the issue: > > > > commit 7694ca6e1d6f01122f05039b81f70f64b1ec406

Re: [PATCH] USB: fix invalid memory access in hub_activate()

2016-08-04 Thread Viresh Kumar
On 04-08-16, 11:20, Alan Stern wrote: > Yes, it could lead to this deadlock. > > > Should we rather have device_trylock instead of device_lock > > No. > > > > @@ -1031,10 +1031,20 @@ static void hub_activate(struct usb_hub > > > unsigned delay; > > > > > > /* Continue a partial initializati

Re: [PATCH] USB: fix invalid memory access in hub_activate()

2016-08-04 Thread Viresh Kumar
On 04-08-16, 14:47, Alan Stern wrote: > On Thu, 4 Aug 2016, Viresh Kumar wrote: > > > On 04-08-16, 11:20, Alan Stern wrote: > > > Yes, it could lead to this deadlock. > > > > > > > Should we rather have device_trylock instead of device_lock > > &g

[PATCH V2] usb: hub: Fix unbalanced reference count/memory leak/deadlocks

2016-08-04 Thread Viresh Kumar
to acquire the same interface device lock and this may result in deadlock. Fix both the issues by removing the call to cancel_delayed_work_sync(). CC: #4.4+ Fixes: e50293ef9775 ("USB: fix invalid memory access in hub_activate()") Reported-by: Manu Gautam Signed-off-by: Viresh Ku

Re: [PATCH] USB: fix invalid memory access in hub_activate()

2016-08-04 Thread Viresh Kumar
On 04-08-16, 11:49, Viresh Kumar wrote: > On 04-08-16, 14:47, Alan Stern wrote: > > On Thu, 4 Aug 2016, Viresh Kumar wrote: > > > > > On 04-08-16, 11:20, Alan Stern wrote: > > > > Yes, it could lead to this deadlock. > > > > > > > > &

Re: [PATCH 1/2] USB: hub: fix up early-exit pathway in hub_activate

2016-08-05 Thread Viresh Kumar
> [as1807] > > > drivers/usb/core/hub.c | 15 ++- > 1 file changed, 6 insertions(+), 9 deletions(-) Reviewed-by: Viresh Kumar -- viresh -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 2/2] USB: hub: change the locking in hub_activate

2016-08-05 Thread Viresh Kumar
On 05-08-16, 11:51, Alan Stern wrote: > The locking in hub_activate() is not adequate to provide full mutual > exclusion with hub_quiesce(). The subroutine locks the hub's > usb_interface, but the callers of hub_quiesce() (such as > hub_pre_reset() and hub_event()) hold the lock to the hub's > usb

Re: [PATCH 2/2] USB: hub: change the locking in hub_activate

2016-08-31 Thread Viresh Kumar
On 31-08-16, 12:46, Alan Stern wrote: > On Wed, 31 Aug 2016, Viresh Kumar wrote: > > > On 05-08-16, 11:51, Alan Stern wrote: > > > +++ usb-4.x/drivers/usb/core/hub.c > > > @@ -1052,7 +1052,7 @@ static void hub_activate(struct usb_hub > > > >

Re: [PATCH 1/2] phy: Group vendor specific phy drivers

2016-04-01 Thread Viresh Kumar
; st}/phy-spear1340-miphy.c| 0 > rename drivers/phy/{ => st}/phy-spear1310-miphy.c (100%) > rename drivers/phy/{ => st}/phy-spear1340-miphy.c (100%) > Acked-by: Viresh Kumar -- viresh -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the

Re: [PATCH 2/2] arm: mach-spear: Enable PHY_PLAT to meet dependency

2016-04-01 Thread Viresh Kumar
device-tree > @@ -36,6 +37,7 @@ config MACH_SPEAR1310 > config MACH_SPEAR1340 > bool "SPEAr1340 Machine support with Device Tree" > select PINCTRL_SPEAR1340 > + select PHY_PLAT > select PHY_ST_SPEAR1340_MIPHY > help > Supports ST

Re: [PATCH 03/10] USB: EHCI: make ehci-spear a separate driver

2013-02-07 Thread Viresh Kumar
oudar > Signed-off-by: Deepak Saxena > Cc: Greg KH > Cc: Alan Stern > Cc: Viresh Kumar > Cc: Shiraz Hashim > Cc: linux-usb@vger.kernel.org > Cc: spear-de...@list.st.com > --- > drivers/usb/host/Kconfig |8 + > drivers/usb/host/Makefile |

Re: [PATCH 1/8] USB: EHCI: make ehci-spear a separate driver

2013-02-10 Thread Viresh Kumar
On Mon, Feb 11, 2013 at 12:28 AM, wrote: > From: Manjunath Goudar > > Separate the Spear host controller driver from ehci-hcd host code SPEAr > into its own driver module. > > Signed-off-by: Manjunath Goudar > Signed-off-by: Deepak Saxena > Cc: Greg KH > Cc: Ala

Re: [PATCH] USB: EHCI: make ehci-spear a separate driver

2013-02-12 Thread Viresh Kumar
On Tue, Feb 12, 2013 at 4:32 PM, wrote: > From: Manjunath Goudar > > Separate the SPEAr host controller driver from ehci-hcd host code > into its own driver module. > > Signed-off-by: Manjunath Goudar > Signed-off-by: Deepak Saxena > Cc: Greg KH > Cc: Alan Ster

Re: [RFC][PATCH 4/7] USB: OHCI: make ohci-spear a separate driver

2013-06-07 Thread Viresh Kumar
-platform kernels on ARM. > > Signed-off-by: Manjunath Goudar > Cc: Viresh Kumar > Cc: Arnd Bergmann > Cc: Greg KH > Cc: Alan Stern > Cc: linux-usb@vger.kernel.org > --- > drivers/usb/host/Kconfig |8 +++ > drivers/usb/host/Makefile |1 +

Re: [PATCH 10/10] USB: OHCI: Properly handle ohci-spear suspend

2013-06-13 Thread Viresh Kumar
On 13 June 2013 14:41, Manjunath Goudar wrote: > Suspend scenario in case of ohci-spear glue was not > properly handled as it was not suspending generic part > of ohci controller.Calling explicitly the ohci_suspend() Add space after full stop. > routine in spear_ohci_hcd_drv_suspend() will ensur

Re: [PATCH V2 01/10] USB: OHCI: Properly handle ohci-at91 suspend

2013-06-17 Thread Viresh Kumar
On 17 June 2013 14:52, Manjunath Goudar wrote: > when we are using tab characters before "do_wakeup" and "ret" variable,we > will be getting error below. > > WARNING: please, no space before tabs > #31: FILE: drivers/usb/host/ohci-at91.c:622: > +^Ibool ^I^Ido_wakeup = device_may_wakeup(&pdev->dev

Re: [PATCH V3 05/11] USB: OHCI: Properly handle ohci-ep93xx suspend

2013-06-19 Thread Viresh Kumar
On 19 June 2013 20:12, Manjunath Goudar wrote: > On 19 June 2013 18:13, Sergei Shtylyov >> On 19-06-2013 16:12, Manjunath Goudar wrote: >>> struct usb_hcd *hcd = platform_get_drvdata(pdev); >>> struct ohci_hcd *ohci = hcd_to_ohci(hcd); >>> + booldo_wakeup = device_may_w

Re: [PATCH V5 4/6] USB: OHCI: make ohci-spear a separate driver

2013-08-11 Thread Viresh Kumar
On 12 August 2013 12:16, Manjunath Goudar wrote: > This work is part of enabling multi-platform kernels on ARM; > it would be nice to have in 3.11. You really want it in 3.11, we are already at 3.11-rc5 :) Whatever you write here gets in git history with your patch and I am sure you never wanted

[PATCH 1/2] usb: spear-ehci/ohci: Do clk_get using dev-id

2012-11-08 Thread Viresh Kumar
From: Amardeep Rai We used to get clk using con-id, but now we have device struct available for these devices as they are probed using DT. And so must get clk using dev-id. Signed-off-by: Amardeep Rai Signed-off-by: Viresh Kumar --- drivers/usb/host/ehci-spear.c | 13 + drivers

[PATCH 2/2] usb: spear-ehci/ohci: Use devm_*() routines

2012-11-08 Thread Viresh Kumar
This patch frees SPEAr ehci/ohci drivers from tension of freeing resources :) devm_* derivatives of multiple routines are used while allocating resources, which would be freed automatically by kernel. Signed-off-by: Viresh Kumar --- drivers/usb/host/ehci-spear.c | 37

Re: [PATCH v3 2/7] USB: EHCI: make ehci-spear a separate driver

2013-03-28 Thread Viresh Kumar
t; In V2: > Replaced spear as SPEAr everywhere, leaving functions/variables/config > options. > > Signed-off-by: Deepak Saxena > Signed-off-by: Manjunath Goudar > Signed-off-by: Arnd Bergmann > Acked-by: Viresh Kumar This version has changed from what i Acked, but it still look

Re: [PATCH 10/11] USB: ohci-spear: remove unnecessary platform_set_drvdata()

2013-05-12 Thread Viresh Kumar
100644 > --- a/drivers/usb/host/ohci-spear.c > +++ b/drivers/usb/host/ohci-spear.c > @@ -179,8 +179,6 @@ static int spear_ohci_hcd_drv_remove(struct > platform_device *pdev) > spear_stop_ohci(ohci_p); > > usb_put_hcd(hcd); > - > - platform_

Re: [PATCH 02/19] drivers/usb/host: add missing platform_driver owner

2013-05-20 Thread Viresh Kumar
On Tue, May 21, 2013 at 8:12 AM, Libo Chen wrote: > set the owner of platform_driver, to ensure that the > caller of driver holds a module refernece > > Signed-off-by: Libo Chen > --- > drivers/usb/host/ehci-spear.c | 1 + Acked-by: Viresh Kumar -- To unsubscribe from t

Re: [PATCH 3/8] usb: host: ehci-spear: Remove redundant use of of_match_ptr

2013-05-21 Thread Viresh Kumar
On 21 May 2013 17:17, Sachin Kamat wrote: > 'spear_ehci_id_table' is always compiled in. Hence use of > of_match_ptr is unnecessary. > > Signed-off-by: Sachin Kamat > Cc: Viresh Kumar > --- > drivers/usb/host/ehci-spear.c |2 +- > 1 file changed, 1 in

Re: [PATCH 6/8] usb: host: ohci-spear: Remove redundant use of of_match_ptr

2013-05-21 Thread Viresh Kumar
On 21 May 2013 17:17, Sachin Kamat wrote: > 'spear_ohci_id_table' is always compiled in. Hence use of > of_match_ptr is unnecessary. > > Signed-off-by: Sachin Kamat > Cc: Viresh Kumar > --- > drivers/usb/host/ohci-spear.c |2 +- > 1 file changed, 1 in

Re: [PATCH 1/1] usb: host: ehci-spear: Fix potential NULL pointer dereferencing

2013-05-21 Thread Viresh Kumar
On 22 May 2013 09:05, Sachin Kamat wrote: > 'hcd' is dereferenced before NULL check. Move the assignment after > the check to avoid potential NULL pointer dereferencing error. > > Signed-off-by: Sachin Kamat > Cc: Viresh Kumar > --- > drivers/usb/host/ehci

Re: [RFC V7 PATCH 0/3] USB: OHCI: Start splitting up the driver

2013-05-27 Thread Viresh Kumar
On 27 May 2013 17:55, Manjunath Goudar wrote: > This series of patches begins the process of splitting ohci-hcd up into > a core library module and independent pci driver modules. > > Patch 1/3 prepares the way by exporting a few functions from ohci-hcd > and adding a new mechanism for platform-sp

Re: [PATCH 11/12] USB: ohci-spear: Use devm_ioremap_resource()

2013-12-16 Thread Viresh Kumar
On 11 December 2013 12:59, Jingoo Han wrote: > Use devm_ioremap_resource() to make cleanup paths simpler. > > Signed-off-by: Jingoo Han > --- > drivers/usb/host/ohci-spear.c | 13 +++-- > 1 file changed, 3 insertions(+), 10 deletions(-) Acked-by: Viresh Kumar -- T

Re: [PATCH 2/4] USB: ehci-spear: Make of_device_id array const

2014-06-18 Thread Viresh Kumar
eturn 0; > } > > -static struct of_device_id spear_ehci_id_table[] = { > +static const struct of_device_id spear_ehci_id_table[] = { > { .compatible = "st,spear600-ehci", }, > { }, > }; Acked-by: Viresh Kumar -- To unsubscribe from this list: send the line &

Re: [PATCH 4/4] USB: ohci-spear: Make of_device_id array const

2014-06-18 Thread Viresh Kumar
; > -static struct of_device_id spear_ohci_id_table[] = { > +static const struct of_device_id spear_ohci_id_table[] = { > { .compatible = "st,spear600-ohci", }, > { }, > }; Acked-by: Viresh Kumar -- To unsubscribe from this list: send the line "

[PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-25 Thread Viresh Kumar
debugfs_create_bool() and assigning its value to global_lock later. Signed-off-by: Viresh Kumar --- V3->V4: - Create a local variable instead of changing type of global_lock (Rafael) - Drop the stable tag - BCC'd a lot of people (rather than cc'ing them) to make sure - the series

[PATCH V4 2/2] debugfs: Pass bool pointer to debugfs_create_bool()

2015-09-25 Thread Viresh Kumar
byte (mostly). That required updates to all user sites as well, in the same commit updating the API. regmap core was also using debugfs_{read|write}_file_bool(), directly and variable types were updated for that to be bool as well. Signed-off-by: Viresh Kumar Acked-by: Mark Brown Acked-by: Ch

Re: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-25 Thread Viresh Kumar
On 25-09-15, 19:42, Johannes Berg wrote: > On Fri, 2015-09-25 at 09:41 -0700, Viresh Kumar wrote: > > > Signed-off-by: Viresh Kumar > > --- > > V3->V4: > > - Create a local variable instead of changing type of global_lock > > (Rafael) > > Err, sur

Re: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-25 Thread Viresh Kumar
On 25-09-15, 20:49, Johannes Berg wrote: > Ok, then, but that means Rafael is completely wrong ... > debugfs_create_bool() takes a *pointer* and it needs to be long-lived, > it can't be on the stack. You also don't get a call when it changes. Ahh, ofcourse. My bad as well... I think we can change

Re: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-25 Thread Viresh Kumar
On 25 September 2015 at 13:33, Rafael J. Wysocki wrote: > You're going to change that into bool in the next patch, right? Yeah. > So what if bool is a byte and the field is not word-aligned Its between two 'unsigned long' variables today, and the struct isn't packed. So, it will be aligned, isn

Re: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-25 Thread Viresh Kumar
On 25-09-15, 22:58, Rafael J. Wysocki wrote: > Say you have three adjacent fields in a structure, x, y, z, each one byte > long. > Initially, all of them are equal to 0. > > CPU A writes 1 to x and CPU B writes 2 to y at the same time. > > What's the result? But then two CPUs can update the sam

Re: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-26 Thread Viresh Kumar
On 25 September 2015 at 15:19, Rafael J. Wysocki wrote: > So if you allow something like debugfs to update your structure, how > do you make sure there is the proper locking? Not really sure at all.. Isn't there some debugfs locking that will jump in, to avoid updation of fields to the same devic

[PATCH V5 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-26 Thread Viresh Kumar
_lock' to u32. Signed-off-by: Viresh Kumar --- BCC'd a lot of people (rather than cc'ing them) to make sure - the series reaches them - mailing lists do not block the patchset due to long cc list - and we don't spam the BCC'd people for every reply V4->V5: - Switch

[PATCH V5 2/2] debugfs: Pass bool pointer to debugfs_create_bool()

2015-09-26 Thread Viresh Kumar
byte. That required updates to all user sites as well, in the same commit updating the API. regmap core was also using debugfs_{read|write}_file_bool(), directly and variable types were updated for that to be bool as well. Signed-off-by: Viresh Kumar Acked-by: Mark Brown Acked-by: Charles Keep

Re: [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'

2015-09-27 Thread Viresh Kumar
On 26 September 2015 at 22:31, Jiri Slaby wrote: > But this has to crash whenever the file is read as val's storage is gone at > that moment already, right? Yeah, its fixed now in the new version. This was a *really* bad idea :( -- To unsubscribe from this list: send the line "unsubscribe linux-u

[PATCH 1/2] USB: Use usb_disabled() consistently

2015-03-19 Thread Viresh Kumar
At few places we have used usb_disabled() and at other places used 'nousb' directly. Lets be consistent and use usb_disabled(); Signed-off-by: Viresh Kumar --- drivers/usb/core/usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/core/usb.c b/d

[PATCH 2/2] USB: Move usb_disabled() towards top of the file

2015-03-19 Thread Viresh Kumar
Move usb_disabled() and module_param()/core_param() towards the top of the file, where 'nousb' is defined, as they are all related. Signed-off-by: Viresh Kumar --- drivers/usb/core/usb.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) di

Re: [RFC 03/10] cpufreq: exynos: Remove support for Exynos5440

2018-04-24 Thread Viresh Kumar
ged, 495 deletions(-) > delete mode 100644 > Documentation/devicetree/bindings/cpufreq/cpufreq-exynos5440.txt > delete mode 100644 drivers/cpufreq/exynos5440-cpufreq.c Acked-by: Viresh Kumar -- viresh -- To unsubscribe from this list: send the line "unsubscribe linux-usb"

Re: [PATCH 1/1] usb: hub: check return value

2017-04-23 Thread Viresh Kumar
On Sun, Apr 23, 2017 at 4:52 PM, Pan Bian wrote: > From: Pan Bian > > Function usb_autopm_get_interface() will return a negative errno on > failure, and function usb_autopm_put_interface() should not be called if > it fails. However, in function usb_remove_device(), the return value of > function