Re: [PATCH v2 1/2] usb: ohci: Default to per-port over-current protection

2021-01-18 Thread Hamish Martin
nks for your thorough report on the issue my changes caused and pass on my apologies to your Mom! > > > On Fri 11 Sep 20, 09:25, Hamish Martin wrote: > > > Some integrated OHCI controller hubs do not expose all ports of > > > the hub > > > to pins on the SoC. In

[PATCH v2 2/2] usb: ohci: Make distrust_firmware param default to false

2020-09-10 Thread Hamish Martin
The 'distrust_firmware' module parameter dates from 2004 and the USB subsystem is a lot more mature and reliable now than it was then. Alter the default to false now. Suggested-by: Alan Stern Signed-off-by: Hamish Martin --- drivers/usb/host/ohci-hcd.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v2 1/2] usb: ohci: Default to per-port over-current protection

2020-09-10 Thread Hamish Martin
set to per-port rather than the previous behaviour where it was either none or global over-current protection depending on the value at function entry. Suggested-by: Alan Stern Signed-off-by: Hamish Martin --- Notes: Changes in v2: - remove clearing of RH_A_PSM in OHCI_QUIRK_HUB_P

Re: [PATCH] usb: ohci: Default to per-port over-current protection

2020-09-10 Thread Hamish Martin
On Wed, 2020-09-09 at 10:05 -0400, Alan Stern wrote: > On Wed, Sep 09, 2020 at 03:57:34PM +1200, Hamish Martin wrote: > > Some integrated OHCI controller hubs do not expose all ports of the > > hub > > to pins on the SoC. In some cases the unconnected ports generate >

[PATCH] usb: ohci: Default to per-port over-current protection

2020-09-08 Thread Hamish Martin
set to per-port rather than the previous behaviour where it was either none or global over-current protection depending on the value at function entry. Suggested-by: Alan Stern Signed-off-by: Hamish Martin --- drivers/usb/host/ohci-hcd.c | 17 +++-- 1 file changed, 11 insert

Re: [PATCH 1/2] usb: ohci: Add per-port overcurrent quirk

2020-09-07 Thread Hamish Martin
On Mon, 2020-09-07 at 10:59 -0400, st...@rowland.harvard.edu wrote: > On Mon, Sep 07, 2020 at 01:50:10AM +0000, Hamish Martin wrote: > > Hi Alan, > > > > Thanks for your quick feedback. My replies are inline below. > > > > On Fri, 2020-09-04 at 11:45 -0400, Alan

Re: [PATCH 1/2] usb: ohci: Add per-port overcurrent quirk

2020-09-06 Thread Hamish Martin
Hi Alan, Thanks for your quick feedback. My replies are inline below. On Fri, 2020-09-04 at 11:45 -0400, Alan Stern wrote: > On Fri, Sep 04, 2020 at 03:22:46PM +1200, Hamish Martin wrote: > > Some integrated OHCI controller hubs do not expose all ports of the > > hub > &g

[PATCH 2/2] dt-bindings: usb: generic-ohci: Document per-port-overcurrent property

2020-09-03 Thread Hamish Martin
OHCI overcurrent protection defaults to Global or "ganged" overcurrent protection mode. This new property allows for the Individual Port Over-current Protection to be selected when required. Signed-off-by: Hamish Martin --- Documentation/devicetree/bindings/usb/generic-ohci.yaml |

[PATCH 0/2] usb: ohci: Per-port overcurrent protection

2020-09-03 Thread Hamish Martin
Add a dt-binding to select per-port overcurrent protection mode so handle spurious overcurrent events from unconnected ports. Hamish Martin (2): usb: ohci: Add per-port overcurrent quirk dt-bindings: usb: generic-ohci: Document per-port-overcurrent property Documentation/devicetree/bindings

[PATCH 1/2] usb: ohci: Add per-port overcurrent quirk

2020-09-03 Thread Hamish Martin
for ohci-platform driver is to use "ganged" overcurrent protection mode. This leads to the spurious overcurrent events affecting all ports in the hub. Allow this to be rectified by specifying per-port overcurrent protection mode via the device tree. Signed-off-by: Hamish Martin --- driver

Re: [PATCH v2] driver: uio: fix possible memory leak and use-after-free in __uio_register_device

2019-01-06 Thread Hamish Martin
>  err_request_irq: >   uio_dev_del_attributes(idev); >  err_uio_dev_add_attributes: > - device_unregister(>dev); > + device_del(>dev); >  err_device_create: >   uio_free_minor(idev); > + put_device(>dev); >   return ret; >  } >  EXPORT_SYMBOL_GPL(__uio_register_device); Looks good to me. Thanks for dealing with those issues. Reviewed-by: Hamish Martin

Re: [PATCH v4 0/3] uio: fix potential crash bug

2018-07-12 Thread Hamish Martin
Hi Xiubo, Tested-by: Hamish Martin I see these were already merged into Linus' tree but I wanted to let you know that I tested v4.18-rc4 (which contains these three patches) and the issue which led to my original series is still fixed and this patch series of yours has caused no regression

Re: [PATCH v4 0/3] uio: fix potential crash bug

2018-07-12 Thread Hamish Martin
Hi Xiubo, Tested-by: Hamish Martin I see these were already merged into Linus' tree but I wanted to let you know that I tested v4.18-rc4 (which contains these three patches) and the issue which led to my original series is still fixed and this patch series of yours has caused no regression

Re: [PATCH v3 3/3] uio: fix crash after the device is unregistered

2018-07-05 Thread Hamish Martin
Looks ok to me. Reviewed-by: Hamish Martin On 07/06/2018 02:57 PM, xiu...@redhat.com wrote: > From: Xiubo Li > > For the target_core_user use case, after the device is unregistered > it maybe still opened in user space, then the kernel will crash, like: > > [ 251.163692] BUG

Re: [PATCH v3 3/3] uio: fix crash after the device is unregistered

2018-07-05 Thread Hamish Martin
Looks ok to me. Reviewed-by: Hamish Martin On 07/06/2018 02:57 PM, xiu...@redhat.com wrote: > From: Xiubo Li > > For the target_core_user use case, after the device is unregistered > it maybe still opened in user space, then the kernel will crash, like: > > [ 251.163692] BUG

Re: [PATCH v3 2/3] uio: change to use the mutex lock instead of the spin lock

2018-07-05 Thread Hamish Martin
Looks ok to me. Reviewed-by: Hamish Martin On 07/06/2018 02:57 PM, xiu...@redhat.com wrote: > From: Xiubo Li > > We are hitting a regression with the following commit: > > commit a93e7b331568227500186a465fee3c2cb5dffd1f > Author: Hamish Martin > Date: Mon May 1

Re: [PATCH v3 2/3] uio: change to use the mutex lock instead of the spin lock

2018-07-05 Thread Hamish Martin
Looks ok to me. Reviewed-by: Hamish Martin On 07/06/2018 02:57 PM, xiu...@redhat.com wrote: > From: Xiubo Li > > We are hitting a regression with the following commit: > > commit a93e7b331568227500186a465fee3c2cb5dffd1f > Author: Hamish Martin > Date: Mon May 1

Re: [PATCH v3 0/3] uio: fix potential crash bug

2018-07-05 Thread Hamish Martin
Hi Xiubo, Thanks for your patch that addresses the regression found with my earlier commit. I will take your code and run it in our scenario that showed the bug that led to my commit. Unfortunately I won't be able to get that done until mid-next week. I intend to report back to you by July

Re: [PATCH v3 0/3] uio: fix potential crash bug

2018-07-05 Thread Hamish Martin
Hi Xiubo, Thanks for your patch that addresses the regression found with my earlier commit. I will take your code and run it in our scenario that showed the bug that led to my commit. Unfortunately I won't be able to get that done until mid-next week. I intend to report back to you by July

Re: uio regression in 4.18-rc1 due to "uio: Prevent device destruction while fds are open"

2018-06-20 Thread Hamish Martin
. On 06/21/2018 04:06 AM, Mike Christie wrote: > Hi Hamish, > > I am hitting a regression with your patch: > > commit a93e7b331568227500186a465fee3c2cb5dffd1f > Author: Hamish Martin > Date: Mon May 14 13:32:23 2018 +1200 > > uio: Prevent device destruction while f

Re: uio regression in 4.18-rc1 due to "uio: Prevent device destruction while fds are open"

2018-06-20 Thread Hamish Martin
. On 06/21/2018 04:06 AM, Mike Christie wrote: > Hi Hamish, > > I am hitting a regression with your patch: > > commit a93e7b331568227500186a465fee3c2cb5dffd1f > Author: Hamish Martin > Date: Mon May 14 13:32:23 2018 +1200 > > uio: Prevent device destruction while f

[PATCH v2 2/2] uio: Prevent device destruction while fds are open

2018-05-13 Thread Hamish Martin
-off-by: Hamish Martin <hamish.mar...@alliedtelesis.co.nz> Reviewed-by: Chris Packham <chris.pack...@alliedtelesis.co.nz> --- v2: Resolve compiler error detected by kbuild test robot due to missing include of device.h in uio_driver.h drivers/uio/uio.c

[PATCH v2 2/2] uio: Prevent device destruction while fds are open

2018-05-13 Thread Hamish Martin
-off-by: Hamish Martin Reviewed-by: Chris Packham --- v2: Resolve compiler error detected by kbuild test robot due to missing include of device.h in uio_driver.h drivers/uio/uio.c | 98 ++ include/linux/uio_driver.h | 4 +- 2 files

[PATCH v2 1/2] uio: Reduce return paths from uio_write()

2018-05-13 Thread Hamish Martin
Drive all return paths for uio_write() through a single block at the end of the function. Signed-off-by: Hamish Martin <hamish.mar...@alliedtelesis.co.nz> Reviewed-by: Chris Packham <chris.pack...@alliedtelesis.co.nz> --- v2: no changes drivers/uio/uio.c | 25 +

[PATCH v2 0/2] uio: Prevent kernel oops on UIO device remove with open fds

2018-05-13 Thread Hamish Martin
bfe e93f0038 2fa9 40de0030 3c60 ---[ end trace 8badf75b83f45856 ]--- Hamish Martin (2): uio: Reduce return paths from uio_write() uio: Prevent device destruction while fds are open drivers/uio/uio.c | 121 - include/linux/ui

[PATCH v2 1/2] uio: Reduce return paths from uio_write()

2018-05-13 Thread Hamish Martin
Drive all return paths for uio_write() through a single block at the end of the function. Signed-off-by: Hamish Martin Reviewed-by: Chris Packham --- v2: no changes drivers/uio/uio.c | 25 + 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/drivers/uio

[PATCH v2 0/2] uio: Prevent kernel oops on UIO device remove with open fds

2018-05-13 Thread Hamish Martin
2fa9 40de0030 3c60 ---[ end trace 8badf75b83f45856 ]--- Hamish Martin (2): uio: Reduce return paths from uio_write() uio: Prevent device destruction while fds are open drivers/uio/uio.c | 121 - include/linux/uio_driver.h | 4 +- 2 fil

[PATCH 2/2] uio: Prevent device destruction while fds are open

2018-05-10 Thread Hamish Martin
-off-by: Hamish Martin <hamish.mar...@alliedtelesis.co.nz> Reviewed-by: Chris Packham <chris.pack...@alliedtelesis.co.nz> --- drivers/uio/uio.c | 98 ++ include/linux/uio_driver.h | 3 +- 2 files changed, 74 insertions(+), 27 deleti

[PATCH 2/2] uio: Prevent device destruction while fds are open

2018-05-10 Thread Hamish Martin
-off-by: Hamish Martin Reviewed-by: Chris Packham --- drivers/uio/uio.c | 98 ++ include/linux/uio_driver.h | 3 +- 2 files changed, 74 insertions(+), 27 deletions(-) diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c index dd44df17004d

[PATCH 0/2] Prevent kernel oops on UIO device remove with open fds

2018-05-10 Thread Hamish Martin
bfe e93f0038 2fa9 40de0030 3c60 ---[ end trace 8badf75b83f45856 ]--- Hamish Martin (2): uio: Reduce return paths from uio_write() uio: Prevent device destruction while fds are open drivers/uio/uio.c | 121 - include/linux/ui

[PATCH 1/2] uio: Reduce return paths from uio_write()

2018-05-10 Thread Hamish Martin
Drive all return paths for uio_write() through a single block at the end of the function. Signed-off-by: Hamish Martin <hamish.mar...@alliedtelesis.co.nz> Reviewed-by: Chris Packham <chris.pack...@alliedtelesis.co.nz> --- drivers/uio/uio.c | 25 + 1 file

[PATCH 0/2] Prevent kernel oops on UIO device remove with open fds

2018-05-10 Thread Hamish Martin
2fa9 40de0030 3c60 ---[ end trace 8badf75b83f45856 ]--- Hamish Martin (2): uio: Reduce return paths from uio_write() uio: Prevent device destruction while fds are open drivers/uio/uio.c | 121 - include/linux/uio_driver.h | 3 +- 2 fil

[PATCH 1/2] uio: Reduce return paths from uio_write()

2018-05-10 Thread Hamish Martin
Drive all return paths for uio_write() through a single block at the end of the function. Signed-off-by: Hamish Martin Reviewed-by: Chris Packham --- drivers/uio/uio.c | 25 + 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/drivers/uio/uio.c b/drivers/uio