[PATCH 07/10] staging: gasket: fix gasket_free_coherent_memory metadata frees

2018-09-17 Thread Todd Poynor
From: Nick Ewalt Free gasket_coherent_page_entries metadata memory, update data structures accordingly. Signed-off-by: Nick Ewalt Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/staging/gasket

[PATCH 03/10] staging: gasket: page table: use GFP_KERNEL for dma_alloc_coherent

2018-09-17 Thread Todd Poynor
From: Todd Poynor Flags should be specified for dma_alloc_coherent() call. Use GFP_KERNEL, it's fine to sleep here. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/g

[PATCH 08/10] staging: gasket: cleanup if dma_map_page fails in gasket_perform_mapping

2018-09-17 Thread Todd Poynor
From: Nick Ewalt Previously pages would have never been unmapped in this case. Signed-off-by: Nick Ewalt Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 33 +- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/drivers/staging

[PATCH 02/10] staging: gasket: interrupt: remove PCI-MSIX-specific status check

2018-09-17 Thread Todd Poynor
From: Todd Poynor Devices not using MSIX don't use the msix_initialized field, so don't require it to be set in the interrupt system status check. The general check for interrupts configured that follows can cover both MSIX and device-managed interrupts. Signed-off-by: Todd Poynor --

[PATCH 00/10] staging: gasket: Apex uncloaks, plus fixes

2018-09-17 Thread Todd Poynor
From: Todd Poynor Add a description of the Gasket framework device Apex (it's a Google Edge TPU machine learning accelerator soon to be released), plus a handful of fixes. Nick Ewalt (7): staging: gasket: fix DMA direction for extended page tables staging: gasket: fix data page unma

[PATCH 10/10] staging: gasket: page_table: handle failed dma_map_page

2018-09-17 Thread Todd Poynor
From: Nick Ewalt Handle dma_map_page failing in gasket_alloc_extended_subtable: free memory, don't add invalid page table entry. Signed-off-by: Nick Ewalt Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 11 +++ 1 file changed, 11 insertions(+) diff

[PATCH 09/10] staging: gasket: page_table: use total_entries for max ext lvl0 page idx

2018-09-17 Thread Todd Poynor
From: Nick Ewalt The maximum number of entries in the page table is configurable at initialization time and should be used in gasket_extended_lvl0_page_idx. Signed-off-by: Nick Ewalt Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 2 +- 1 file changed, 1 insertion

[PATCH 01/10] staging: gasket: Kconfig: describe Apex as an Edge TPU device

2018-09-17 Thread Todd Poynor
From: Todd Poynor Add a brief description and URL for more information on the Apex device, an Edge TPU (Tensorflow Processing Unit) machine learning accelerator. Signed-off-by: Todd Poynor --- drivers/staging/gasket/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff

[PATCH 06/10] staging: gasket: page_table: don't unmap coherent pages

2018-09-17 Thread Todd Poynor
From: Nick Ewalt Only call dma_unmap_page if there was an associated dma_map_page call. Signed-off-by: Nick Ewalt Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gasket

[PATCH 05/10] staging: gasket: fix data page unmap DMA direction

2018-09-17 Thread Todd Poynor
From: Nick Ewalt The DMA direction supplied to dma_unmap_page should match the corresponding dma_map_page call, which is mapped bi-directional. Signed-off-by: Nick Ewalt Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 04/10] staging: gasket: fix DMA direction for extended page tables

2018-09-17 Thread Todd Poynor
From: Nick Ewalt Extended page tables should be mapped as DMA_TO_DEVICE, not bi-directional. Signed-off-by: Nick Ewalt Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/gasket

[PATCH 01/11] staging: gasket: core: debug log updates

2018-10-14 Thread Todd Poynor
From: Todd Poynor Add debug logs for device enable/disable events, remove logs for callbacks (the called functions can generate their own logs if needed). Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff

[PATCH 07/11] staging: gasket: page_table: fix comment in components_to_dev_address

2018-10-14 Thread Todd Poynor
From: Nick Ewalt Comments in components_to_dev_address() describing examples are inconsistent, fix these to be accurate. Signed-off-by: Nick Ewalt Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

[PATCH 00/11] staging: gasket: fixes

2018-10-14 Thread Todd Poynor
From: Todd Poynor Various fixes for gasket/apex drivers. Nick Ewalt (8): staging: gasket: page_table: remove unnecessary PTE status set to free staging: gasket: page_table: rearrange gasket_page_table_entry staging: gasket: page table: fixup error path allocating coherent mem staging

[PATCH 06/11] staging: gasket: page table: fixup error path allocating coherent mem

2018-10-14 Thread Todd Poynor
From: Nick Ewalt Correctly clean up data structure state in gasket_alloc_coherent_memory error path, to ensure no double free on the stale pointer value. Signed-off-by: Nick Ewalt Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 6 +- 1 file changed, 5

[PATCH 08/11] staging: gasket: page_table: simplify gasket_components_to_dev_address

2018-10-14 Thread Todd Poynor
-off-by: Nick Ewalt Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 21 ++--- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/drivers/staging/gasket/gasket_page_table.c b/drivers/staging/gasket/gasket_page_table.c index ec9359576ea7c

[PATCH 05/11] staging: gasket: page_table: rearrange gasket_page_table_entry

2018-10-14 Thread Todd Poynor
From: Nick Ewalt Rearrange gasket_page_table entry to reduce padding slop. Signed-off-by: Nick Ewalt Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/gasket

[PATCH 11/11] staging: gasket: Update device virtual address comment

2018-10-14 Thread Todd Poynor
From: Nick Ewalt Add that number of page table entries and extended address bit offset are configurable. Update example virtual address format to be more consistent with typical usage. Signed-off-by: Nick Ewalt Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 14

[PATCH 10/11] staging: gasket: sysfs: fix attribute release comment

2018-10-14 Thread Todd Poynor
From: Nick Ewalt Comments for gasket_sysfs_get_attr() incorrectly describe reference release procedure. Signed-off-by: Nick Ewalt Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_sysfs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging

[PATCH 02/11] staging: gasket: page table: return valid error code on map fail

2018-10-14 Thread Todd Poynor
From: Todd Poynor Return -EINVAL on mapping failures, instead of -1, which triggers a checkpatch error. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/gasket/gasket_page_table.c

[PATCH 09/11] staging: gasket: apex: fix sysfs_show

2018-10-14 Thread Todd Poynor
From: Nick Ewalt sysfs_show was incorrectly extracting the sysfs_attribute_type from the gasket_sysfs_attribute. This prevented dispatch from working properly. Signed-off-by: Nick Ewalt Signed-off-by: Todd Poynor --- drivers/staging/gasket/apex_driver.c | 2 +- 1 file changed, 1 insertion

[PATCH 04/11] staging: gasket: page_table: remove unnecessary PTE status set to free

2018-10-14 Thread Todd Poynor
From: Nick Ewalt Remove unnecessary ptes[i].status update in gasket_perform_unmapping. The vaaue will be cleared in the following memset. Signed-off-by: Nick Ewalt Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 1 - 1 file changed, 1 deletion(-) diff --git a

[PATCH 03/11] staging: gasket: page table: remove dead code in coherent mem alloc

2018-10-14 Thread Todd Poynor
From: Todd Poynor gasket_alloc_coherent_memory() has some unnecessary code related to out of memory checking that will never hit the condition checked, remove. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions

Re: [PATCH 00/11] staging: gasket: fixes

2018-10-15 Thread Todd Poynor
On Mon, Oct 15, 2018 at 12:33 AM Greg Kroah-Hartman wrote: > > On Sun, Oct 14, 2018 at 09:59:16PM -0700, Todd Poynor wrote: > > From: Todd Poynor > > > > Various fixes for gasket/apex drivers. > > For some reason you seem to have ignored/missed this patch: >

Re: [PATCH v3] staging: gasket: Fix sparse "incorrect type in assignment" warnings.

2018-10-15 Thread Todd Poynor
virt_base; > + u8 *virt_base; > > /* Physical base address. */ > ulong phys_base; > -- > 2.9.5 Reviewed-by: Todd Poynor Thanks! ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Re: [PATCH 01/11] staging: gasket: core: debug log updates

2018-10-15 Thread Todd Poynor
On Mon, Oct 15, 2018 at 12:34 AM Greg Kroah-Hartman wrote: > > On Sun, Oct 14, 2018 at 09:59:17PM -0700, Todd Poynor wrote: > > From: Todd Poynor > > > > Add debug logs for device enable/disable events, > > Why? > > What is going to need this? As one of th

[PATCH 1/3] staging: gasket: remove debug logs for callback invocation

2018-10-16 Thread Todd Poynor
From: Todd Poynor Debug logs for device-specific callback invocation aren't very useful, remove. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/gasket/gasket_core.c b/dr

[PATCH 2/3] staging: gasket: remove debug logs in page table mapping calls

2018-10-16 Thread Todd Poynor
From: Todd Poynor Remove very noisy debug logs that also contain typos and incorrect output formats. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 24 -- 1 file changed, 24 deletions(-) diff --git a/drivers/staging/gasket/gasket_page_table.c

[PATCH 0/3] staging: gasket: add DMA direction flags a.o.

2018-10-16 Thread Todd Poynor
From: Todd Poynor Add flags to page mapping ioctls that specify DMA directions other than bi-directional, avoiding unnecessary cache maintenance for read-only or write-only buffers. Remove some spammy / unhelpful / inaccurately formatted debug logs. Nick Ewalt (1): staging: gasket

[PATCH 3/3] staging: gasket: page_table: add mapping flags

2018-10-16 Thread Todd Poynor
From: Nick Ewalt This allows for more precise dma_direction in the dma_map_page requests. Also leaves room for adding more flags later. Signed-off-by: Nick Ewalt Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket.h| 33 drivers/staging/gasket/gasket_ioctl.c

[PATCH] drivers/staging/gasket: Use refcount_read()

2018-07-06 Thread Todd Poynor
From: Todd Poynor Use the refcount_read accessor function, avoid reaching into refcount and atomic struct fields. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gasket/gasket_sysfs.c b

[PATCH 02/18] MAINTAINERS: Add maintainer for drivers/staging/gasket

2018-07-13 Thread Todd Poynor
From: Todd Poynor Todd Poynor will be a maintainer of the Gasket and Apex drivers. Signed-off-by: Todd Poynor --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 562ee1e1cfd6..8f44e7bed49e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5968,6

[PATCH 11/18] staging: gasket: always allow root open for write

2018-07-13 Thread Todd Poynor
From: Todd Poynor Always allow root to open device for writing. Drop special-casing of ioctl permissions for root vs. owner. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/apex_driver.c | 9 +++-- drivers/staging/gasket

[PATCH 04/18] staging: gasket: device registration error and unregister fixups

2018-07-13 Thread Todd Poynor
From: Todd Poynor Remove device registration on class creation fail. Hold mutex around device removal updates for proper ordering of updates. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 8 +++- 1 file changed, 7 insertions(+), 1

[PATCH 18/18] staging: gasket: various cleanups

2018-07-13 Thread Todd Poynor
From: Todd Poynor Cleanups to error codes, code style, error conditions, etc. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/apex.h | 7 ++- drivers/staging/gasket/apex_driver.c | 50 - drivers

[PATCH 01/18] staging: gasket: remove X86 Kconfig restriction

2018-07-13 Thread Todd Poynor
From: Todd Poynor The gasket and apex drivers are to be used on other architectures besides X86. Signed-off-by: Todd Poynor --- drivers/staging/gasket/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gasket/Kconfig b/drivers/staging/gasket/Kconfig

[PATCH 10/18] staging: gasket: gasket_open use container_of()

2018-07-13 Thread Todd Poynor
From: Todd Poynor Use container_of(), drop unnecessary NULL check. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/staging/gasket

[PATCH 12/18] staging: gasket: annotate ioctl arg with __user

2018-07-13 Thread Todd Poynor
From: Todd Poynor For sparse checking. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/apex_driver.c | 12 ++--- drivers/staging/gasket/gasket_core.c | 6 ++- drivers/staging/gasket/gasket_core.h | 4 +- drivers/staging

[PATCH 14/18] staging: gasket: fix class create bug handling

2018-07-13 Thread Todd Poynor
From: Todd Poynor class_create() never returns NULL, and this driver should never return PTR_ERR(NULL) anyway. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH 13/18] staging: gasket: gasket_enable_dev fixups

2018-07-13 Thread Todd Poynor
From: Todd Poynor Remove unnecessary variable. Bail out if no physical device. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 19 ++- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging

[PATCH 03/18] staging: gasket: typo and whitespace cleanups

2018-07-13 Thread Todd Poynor
From: Todd Poynor Trivial typo and whitespace fixes. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/apex_driver.c | 2 +- drivers/staging/gasket/gasket_core.h | 2 +- drivers/staging/gasket/gasket_page_table.c | 2 +- 3 files changed, 3 insertions

[PATCH 17/18] staging: gasket: don't release coherent mappings

2018-07-13 Thread Todd Poynor
From: Todd Poynor coherent address mappings aren't backed by a struct page, don't need to be released, and don't count as an active page in the page table bookkeeping. Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 2 +- 1

[PATCH 05/18] staging: gasket: sysfs mapping creation fixups

2018-07-13 Thread Todd Poynor
From: Todd Poynor Return EBUSY for attempt to create a mapping already in use. Remove stale pointers on error allocating attr array. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_sysfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff

[PATCH 06/18] staging: gasket: fix deadlock in pci driver unregister path

2018-07-13 Thread Todd Poynor
From: Todd Poynor g_mutex held across pci_unregister_driver() call, also held in gasket_pci_remove(), which deadlocks. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 7 ++- 1 file changed, 2 insertions(+), 5

[PATCH 15/18] staging: gasket: remove unnecessary code in coherent allocator

2018-07-13 Thread Todd Poynor
From: Todd Poynor Remove extraneous statement in gasket_config_coherent_allocator() Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_ioctl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers

[PATCH 08/18] staging: gasket: gasket_wait_with_reschedule fixups

2018-07-13 Thread Todd Poynor
From: Todd Poynor Return -ETIMEDOUT on timeouts. Don't need 64-bit sized retry count. Use msleep(). Return immediately when condition hit. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/apex_driver.c | 8 dr

[PATCH 00/18] staging: gasket: sundry fixes and fixups

2018-07-13 Thread Todd Poynor
From: Todd Poynor Various fixes mainly from the chromium review of the gasket and apex drivers. More to come. Various (18): staging: gasket: remove X86 Kconfig restriction MAINTAINERS: Add maintainer for drivers/staging/gasket staging: gasket: typo and whitespace cleanups staging

[PATCH 16/18] staging: gasket: gasket core error handling fixups

2018-07-13 Thread Todd Poynor
From: Todd Poynor Minor fixups to error codes and error handling in gasket core. No device reset callback registered is not an error condition. Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 13 + 1 file changed, 5 insertions(+), 8

[PATCH 09/18] staging: gasket: bail out of reset sequence on device callback error

2018-07-13 Thread Todd Poynor
From: Todd Poynor If device reset callback returns an error, error out at the gasket level. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a

[PATCH 07/18] staging: gasket: convert gasket_mmap_has_permissions to bool return

2018-07-13 Thread Todd Poynor
From: Todd Poynor gasket_mmap_has_permissions() should return a boolean value. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/gasket/gasket_core.c

[PATCH 02/18 v2] MAINTAINERS: Add maintainer for drivers/staging/gasket

2018-07-13 Thread Todd Poynor
From: Todd Poynor Todd Poynor will be a maintainer of the Gasket and Apex drivers. Signed-off-by: Todd Poynor --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 562ee1e1cfd6..8f44e7bed49e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -5968,7

Re: [PATCH 12/18] staging: gasket: annotate ioctl arg with __user

2018-07-14 Thread Todd Poynor
>> I think I'm following >> http://www.kroah.com/log/linux/linux-staging-update.html, >> but if I'm off in the weeds do clue me in, thanks. > > That's something I wrote 9 years ago :) Still the top search result for how to work in staging, suggest an update. :) ___

Re: [PATCH 12/18] staging: gasket: annotate ioctl arg with __user

2018-07-15 Thread Todd Poynor
Yes you're right, I see the entry now. Thanks -- Todd On Sun, Jul 15, 2018 at 2:00 AM, Greg Kroah-Hartman wrote: > On Sat, Jul 14, 2018 at 12:20:51PM -0700, Todd Poynor wrote: >> >> I think I'm following >> >> http://www.kroah.com/log/linux/linux-staging

Re: [PATCH 11/18] staging: gasket: always allow root open for write

2018-07-15 Thread Todd Poynor
On Sun, Jul 15, 2018 at 3:03 AM, Greg Kroah-Hartman wrote: > On Sun, Jul 15, 2018 at 12:53:09PM +0300, Dmitry Torokhov wrote: >> > I can't wait for people to just realize this whole "new" subsystem can >> > be replaced with UIO, but that's a topic for a different thread... >> >> Yes, that is true

[PATCH resend] staging: gasket: don't release coherent mappings

2018-07-15 Thread Todd Poynor
From: Todd Poynor coherent address mappings aren't backed by a struct page, don't need to be released, and don't count as an active page in the page table bookkeeping. Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 2 +- 1

[PATCH resend] staging: gasket: remove X86 Kconfig restriction

2018-07-15 Thread Todd Poynor
From: Todd Poynor The gasket and apex drivers are to be used on other architectures besides X86. Signed-off-by: Todd Poynor --- drivers/staging/gasket/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gasket/Kconfig b/drivers/staging/gasket/Kconfig

[PATCH resend] staging: gasket: gasket_open use container_of()

2018-07-15 Thread Todd Poynor
From: Todd Poynor Use container_of(), drop unnecessary NULL check. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/staging/gasket

[PATCH resend] staging: gasket: fix class create bug handling

2018-07-15 Thread Todd Poynor
From: Todd Poynor class_create() never returns NULL, and this driver should never return PTR_ERR(NULL) anyway. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH resend] staging: gasket: remove unnecessary code in coherent allocator

2018-07-15 Thread Todd Poynor
From: Todd Poynor Remove extraneous statement in gasket_config_coherent_allocator() Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_ioctl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers

[PATCH resend] staging: gasket: convert gasket_mmap_has_permissions to bool return

2018-07-15 Thread Todd Poynor
From: Todd Poynor gasket_mmap_has_permissions() should return a boolean value. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/gasket/gasket_core.c

Re: [PATCH 05/18] staging: gasket: sysfs mapping creation fixups

2018-07-16 Thread Todd Poynor
On Fri, Jul 13, 2018 at 11:32 PM, Greg Kroah-Hartman wrote: > On Fri, Jul 13, 2018 at 10:58:03PM -0700, Todd Poynor wrote: >> From: Todd Poynor >> >> Return EBUSY for attempt to create a mapping already in use. > > Why? The existing code returns EINVAL which ofte

Re: [PATCH 04/18] staging: gasket: device registration error and unregister fixups

2018-07-16 Thread Todd Poynor
>> fail1: >> class_destroy(internal->class); >> >> +fail0: > > GW-BASIC sytle label names are an anti-pattern. It's better to name the > labels after what they do, just like function names describes what the > function does. Here it would be "goto clear_desc;" or something. It > doesn't h

Re: [PATCH 06/18] staging: gasket: fix deadlock in pci driver unregister path

2018-07-16 Thread Todd Poynor
On Sat, Jul 14, 2018 at 5:57 AM, Greg Kroah-Hartman wrote: > On Sat, Jul 14, 2018 at 11:07:21AM +0300, Dmitry Torokhov wrote: >> On Sat, Jul 14, 2018 at 8:58 AM Todd Poynor wrote: >> > >> > From: Todd Poynor >> > >> > g_mutex held acro

Re: [PATCH 10/18] staging: gasket: gasket_open use container_of()

2018-07-16 Thread Todd Poynor
On Sat, Jul 14, 2018 at 1:15 AM, Dmitry Torokhov wrote: > On Sat, Jul 14, 2018 at 8:58 AM Todd Poynor wrote: >> >> From: Todd Poynor >> >> Use container_of(), drop unnecessary NULL check. >> >> Reported-by: Dmitry Torokhov >> Signed-off-

Re: [PATCH 11/18] staging: gasket: always allow root open for write

2018-07-16 Thread Todd Poynor
On Sat, Jul 14, 2018 at 1:25 AM, Dmitry Torokhov wrote: > On Sat, Jul 14, 2018 at 8:58 AM Todd Poynor wrote: >> >> From: Todd Poynor >> >> Always allow root to open device for writing. >> >> Drop special-casing of ioctl permissions for root vs. ow

Re: [PATCH 11/18] staging: gasket: always allow root open for write

2018-07-16 Thread Todd Poynor
On Sun, Jul 15, 2018 at 12:41 PM, Greg Kroah-Hartman wrote: > On Sun, Jul 15, 2018 at 11:15:26AM -0700, Todd Poynor wrote: >> On Sun, Jul 15, 2018 at 3:03 AM, Greg Kroah-Hartman >... >> My own preference is to rewrite the apex driver entirely in-kernel and >> pull in its u

Re: [PATCH 13/18] staging: gasket: gasket_enable_dev fixups

2018-07-16 Thread Todd Poynor
On Fri, Jul 13, 2018 at 11:39 PM, Greg Kroah-Hartman wrote: > On Fri, Jul 13, 2018 at 10:58:11PM -0700, Todd Poynor wrote: >> From: Todd Poynor >> >> Remove unnecessary variable. >> >> Bail out if no physical device. >> >> Signed-off-by: T

[PATCH 09/32] staging: gasket: convert gasket_mmap_has_permissions to bool return

2018-07-16 Thread Todd Poynor
From: Todd Poynor gasket_mmap_has_permissions() should return a boolean value. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/gasket/gasket_core.c

[PATCH 05/32] staging: gasket: remove driver registration on class creation failure

2018-07-16 Thread Todd Poynor
From: Todd Poynor If class_create() fails, remove the gasket driver from the global registration table. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/gasket

[PATCH 06/32] staging: gasket: hold mutex on gasket driver unregistration

2018-07-16 Thread Todd Poynor
From: Todd Poynor Take the global mutex on driver unregistration updates for proper ordering of updates and consistent access procedures. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 4 1 file changed, 4 insertions(+) diff --git a

[PATCH 21/32] staging: gasket: remove unnecessary code in coherent allocator

2018-07-16 Thread Todd Poynor
From: Todd Poynor Remove extraneous statement in gasket_config_coherent_allocator() Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_ioctl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers

[PATCH 03/32] staging: gasket: fix typo in gasket_core.h comments

2018-07-16 Thread Todd Poynor
From: Todd Poynor Grammar fixup in gasket_core.h comments describing struct gasket_interrupt_desc. Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gasket/gasket_core.h b/drivers/staging

[PATCH 20/32] staging: gasket: fix class create bug handling

2018-07-16 Thread Todd Poynor
From: Todd Poynor class_create() never returns NULL, and this driver should never return PTR_ERR(NULL) anyway. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Reviewed-by: Dmitry Torokhov --- drivers/staging/gasket/gasket_core.c | 2 +- 1 file changed, 1

[PATCH 01/32] staging: gasket: remove X86 Kconfig restriction

2018-07-16 Thread Todd Poynor
From: Todd Poynor The gasket and apex drivers are to be used on other architectures besides X86. Signed-off-by: Todd Poynor --- drivers/staging/gasket/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gasket/Kconfig b/drivers/staging/gasket/Kconfig

[PATCH 00/32 v2] staging: gasket: sundry fixes and fixups

2018-07-16 Thread Todd Poynor
From: Todd Poynor Various fixes mainly from the chromium review of the gasket and apex drivers. More to come. Various (32): staging: gasket: remove X86 Kconfig restriction staging: gasket: fix typo in apex_enter_reset staging: gasket: fix typo in gasket_core.h comments staging: gasket

[PATCH 16/32] staging: gasket: always allow root open for write

2018-07-16 Thread Todd Poynor
From: Todd Poynor Always allow root to open device for writing. Drop special-casing of ioctl permissions for root vs. owner. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor Reviewed-by: Dmitry Torokhov --- drivers/staging/gasket/apex_driver.c | 9

[PATCH 18/32] staging: gasket: gasket_enable_dev remove unnecessary variable

2018-07-16 Thread Todd Poynor
From: Todd Poynor Remove unnecessary variable, pass constant param instead. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging

[PATCH 10/32] staging: gasket: fix gasket_wait_with_reschedule timeout return code

2018-07-16 Thread Todd Poynor
From: Todd Poynor Return -ETIMEDOUT, not -EINVAL, on timeout, including callers. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/apex_driver.c | 8 drivers/staging/gasket/gasket_core.c | 2 +- 2 files changed, 5

[PATCH 02/32] staging: gasket: fix typo in apex_enter_reset

2018-07-16 Thread Todd Poynor
From: Todd Poynor Fix typo in log message. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/apex_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gasket/apex_driver.c b/drivers/staging/gasket/apex_driver.c index

[PATCH 15/32] staging: gasket: drop gasket_cdev_get_info, use container_of

2018-07-16 Thread Todd Poynor
From: Todd Poynor Remove gasket_cdev_get_info(), use container_of() directly instead, drop unnecessary NULL checks. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 26 -- 1 file changed, 4

[PATCH 07/32] staging: gasket: Return EBUSY on mapping create when already in use

2018-07-16 Thread Todd Poynor
From: Todd Poynor gasket_sysfs_create_mapping() return EBUSY if sysfs mapping already in use. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gasket

[PATCH 14/32] staging: gasket: bail out of reset sequence on device callback error

2018-07-16 Thread Todd Poynor
From: Todd Poynor If device reset callback returns an error, error out at the gasket level. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a

[PATCH 04/32] staging: gasket: whitespace fix in gasket_page_table_init

2018-07-16 Thread Todd Poynor
From: Todd Poynor Tab replaced with space. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gasket/gasket_page_table.c b/drivers/staging/gasket

[PATCH 28/32] staging: gasket: fix comment syntax in apex.h

2018-07-16 Thread Todd Poynor
From: Todd Poynor Use kernel-style multi-line comment syntax. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/apex.h | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/gasket/apex.h b/drivers

[PATCH 13/32] staging: gasket: gasket_wait_with_reschedule use 32 bits of retry count

2018-07-16 Thread Todd Poynor
From: Todd Poynor Don't need a 64-bit retry counter. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 4 ++-- drivers/staging/gasket/gasket_core.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff

[PATCH 08/32] staging: gasket: Remove stale pointers on error allocating attr array

2018-07-16 Thread Todd Poynor
From: Todd Poynor If gasket_sysfs_create_mapping() hits errors allocating the attribute array, remove stale pointers to device info from the mapping object. Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_sysfs.c | 2 ++ 1 file changed, 2 insertions

[PATCH 17/32] staging: gasket: annotate ioctl arg with __user

2018-07-16 Thread Todd Poynor
From: Todd Poynor For sparse checking. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/apex_driver.c | 12 ++--- drivers/staging/gasket/gasket_core.c | 6 ++- drivers/staging/gasket/gasket_core.h | 4 +- drivers/staging

[PATCH 12/32] staging: gasket: gasket_wait_with_reschedule return when condition hit

2018-07-16 Thread Todd Poynor
From: Todd Poynor Return right away instead of break out of while and then return. Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging

[PATCH 26/32] staging: gasket: gasket page table functions use bool return type

2018-07-16 Thread Todd Poynor
From: Todd Poynor Convert from int to bool return type for gasket page table functions that return values used as booleans. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 58 +++--- drivers

[PATCH 11/32] staging: gasket: gasket_wait_with_reschedule use msleep

2018-07-16 Thread Todd Poynor
From: Todd Poynor Replace schedule_timeout() call with msleep(). Reported-by: Dmitry Torokhov Signed-off-by: Zhongze Hu Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/gasket

[PATCH 19/32] staging: gasket: remove code for no physical device

2018-07-16 Thread Todd Poynor
From: Todd Poynor gasket_enable_dev code for enabling a gasket device with no physical PCI device registered shouldn't be necessary. Reported-by: Greg Kroah-Hartman Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 12 +--- 1 file changed, 1 insertion(+

[PATCH 25/32] staging: gasket: apex_ioctl_check_permissions use bool return type

2018-07-16 Thread Todd Poynor
From: Todd Poynor Convert from int return to bool. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/apex_driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/gasket/apex_driver.c b

[PATCH 30/32] staging: gasket: gasket_mmap use PAGE_MASK

2018-07-16 Thread Todd Poynor
From: Todd Poynor Instead of math on PAGE_SIZE. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging

[PATCH 27/32] staging: gasket: remove else clause after return in if clause

2018-07-16 Thread Todd Poynor
From: Todd Poynor Else after return is unnecessary and may cause static code checkers to complain. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff

[PATCH 24/32] staging: gasket: apex_clock_gating simplify logic, reduce indentation

2018-07-16 Thread Todd Poynor
From: Todd Poynor Collapse together two checks and return immediately, avoid conditional indentation for most of function code. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/apex_driver.c | 44 +--- 1 file

[PATCH 22/32] staging: gasket: don't treat no device reset callback as an error

2018-07-16 Thread Todd Poynor
From: Todd Poynor It is not an error for a device to not have a reset callback registered. Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/staging/gasket

[PATCH 23/32] staging: gasket: gasket_mmap return error instead of valid BAR index

2018-07-16 Thread Todd Poynor
From: Todd Poynor When offset to be mapped matches both a BAR region and a coherent mapped region return an error as intended, not the BAR index. Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH 29/32] staging: gasket: remove unnecessary parens in page table code

2018-07-16 Thread Todd Poynor
From: Todd Poynor gasket_alloc_coherent_memory() extra parentheses in statement. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_page_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging

[PATCH 31/32] staging: gasket: remove extra parens in gasket_write_mappable_regions

2018-07-16 Thread Todd Poynor
From: Todd Poynor Remove unneeded parentheses around subexpressions. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gasket

[PATCH 32/32] staging: gasket: fix multi-line comment syntax in gasket_core.h

2018-07-16 Thread Todd Poynor
From: Todd Poynor Use consistent kernel-style multi-line comment syntax. Reported-by: Guenter Roeck Signed-off-by: Simon Que Signed-off-by: Todd Poynor --- drivers/staging/gasket/gasket_core.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/gasket

  1   2   3   4   >