lkml.org 
[lkml]   [2017]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2 11/18] powerpc/vas: Export HVWC to debugfs
Date
Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> writes:

> diff --git a/arch/powerpc/platforms/powernv/vas-window.c b/arch/powerpc/platforms/powernv/vas-window.c
> index 23c13a7..088ce56 100644
> --- a/arch/powerpc/platforms/powernv/vas-window.c
> +++ b/arch/powerpc/platforms/powernv/vas-window.c
> @@ -145,24 +145,42 @@ static void unmap_paste_region(struct vas_window *window)
> }
>
> /*
> - * Unmap the MMIO regions for a window.
> + * Unmap the MMIO regions for a window. Hold the vas_mutex so we don't
> + * unmap when the window's debugfs dir is in use. This serializes close
> + * of a window even on another VAS instance but since its not a critical
> + * path, just minimize the time we hold the mutex for now. We can add
> + * a per-instance mutex later if necessary.
> */
> static void unmap_winctx_mmio_bars(struct vas_window *window)
> {
> int len;
> + void *uwc_map;
> + void *hvwc_map;
> u64 busaddr_start;
>
> + mutex_lock(&vas_mutex);
> +
> if (window->hvwc_map) {
> - get_hvwc_mmio_bar(window, &busaddr_start, &len);
> - unmap_region(window->hvwc_map, busaddr_start, len);
> + hvwc_map = window->hvwc_map;
> window->hvwc_map = NULL;
> }
>
> if (window->uwc_map) {
> - get_uwc_mmio_bar(window, &busaddr_start, &len);
> - unmap_region(window->uwc_map, busaddr_start, len);
> + uwc_map = window->uwc_map;
> window->uwc_map = NULL;
> }
> +
> + mutex_unlock(&vas_mutex);
> +
> + if (hvwc_map) {
> + get_hvwc_mmio_bar(window, &busaddr_start, &len);
> + unmap_region(hvwc_map, busaddr_start, len);
> + }
> +
> + if (uwc_map) {
> + get_uwc_mmio_bar(window, &busaddr_start, &len);
> + unmap_region(uwc_map, busaddr_start, len);
> + }

arch/powerpc/platforms/powernv/vas-window.c: In function 'unmap_winctx_mmio_bars':
arch/powerpc/platforms/powernv/vas-window.c:137:2: error: 'uwc_map' may be used uninitialized in this function [-Werror=maybe-uninitialized]
iounmap(addr);
^
arch/powerpc/platforms/powernv/vas-window.c:168:8: note: 'uwc_map' was declared here
void *uwc_map;
^
arch/powerpc/platforms/powernv/vas-window.c:137:2: error: 'hvwc_map' may be used uninitialized in this function [-Werror=maybe-uninitialized]
iounmap(addr);
^
arch/powerpc/platforms/powernv/vas-window.c:169:8: note: 'hvwc_map' was declared here
void *hvwc_map;
^
cc1: all warnings being treated as errors


cheers

\
 
 \ /
  Last update: 2017-11-08 21:04    [W:0.115 / U:0.440 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site