From: Michael Ellerman <mpe@ellerman.id.au>
To: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
mikey@neuling.org, hbabu@us.ibm.com, nicholas.piggin@gmail.com,
linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 11/18] powerpc/vas: Export HVWC to debugfs
Date: Tue, 07 Nov 2017 23:19:48 +1100 [thread overview]
Message-ID: <871sla46xn.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <1507343298-27496-12-git-send-email-sukadev@linux.vnet.ibm.com>
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
next prev parent reply other threads:[~2017-11-07 12:19 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-07 2:28 [PATCH v2 00/18] powerpc/vas: Add support for FTW Sukadev Bhattiprolu
2017-10-07 2:28 ` [PATCH v2 01/18] powerpc/vas: init missing fields from [rt]xattr Sukadev Bhattiprolu
2017-10-07 2:28 ` [PATCH v2 02/18] powerpc/vas: Validate window credits Sukadev Bhattiprolu
2017-10-07 2:28 ` [PATCH v2 03/18] powerpc/vas: Cleanup some debug code Sukadev Bhattiprolu
2017-10-07 2:28 ` [PATCH v2 04/18] powerpc/vas: Drop poll_window_cast_out() Sukadev Bhattiprolu
2017-10-07 2:28 ` [PATCH v2 05/18] powerpc/vas: Use helper to unpin/close window Sukadev Bhattiprolu
2017-10-07 2:28 ` [PATCH v2 06/18] powerpc/vas: Reduce polling interval for busy state Sukadev Bhattiprolu
2017-10-07 2:28 ` [PATCH v2 07/18] powerpc/vas: Save configured window credits Sukadev Bhattiprolu
2017-10-07 2:28 ` [PATCH v2 08/18] powerpc/vas: poll for return of " Sukadev Bhattiprolu
2017-10-07 2:28 ` [PATCH v2 09/18] powerpc/vas: Create cpu to vas id mapping Sukadev Bhattiprolu
2017-10-07 2:28 ` [PATCH v2 10/18] powerpc/vas, nx-842: Define and use chip_to_vas_id() Sukadev Bhattiprolu
2017-10-07 2:28 ` [PATCH v2 11/18] powerpc/vas: Export HVWC to debugfs Sukadev Bhattiprolu
2017-11-07 12:19 ` Michael Ellerman [this message]
2017-10-07 2:28 ` [PATCH v2 12/18] powerpc: have copy depend on CONFIG_BOOK3S_64 Sukadev Bhattiprolu
2017-10-07 2:28 ` [PATCH v2 13/18] powerpc: Add support for setting SPRN_TIDR Sukadev Bhattiprolu
2017-10-07 2:28 ` [PATCH v2 14/18] powerpc: Define set_thread_used_vas() Sukadev Bhattiprolu
2017-11-07 0:49 ` Nicholas Piggin
2017-11-09 11:01 ` Michael Ellerman
2017-10-07 2:28 ` [PATCH v2 15/18] powerpc: Emulate paste instruction Sukadev Bhattiprolu
2017-10-09 10:00 ` Michael Neuling
2017-10-10 5:54 ` Michael Ellerman
2017-10-07 2:28 ` [PATCH v2 16/18] powerpc/vas: Define vas_win_paste_addr() Sukadev Bhattiprolu
2017-10-07 2:28 ` [PATCH v2 17/18] powerpc/vas: Define vas_win_id() Sukadev Bhattiprolu
2017-10-07 2:28 ` [PATCH v2 18/18] powerpc/vas: Add support for user receive window Sukadev Bhattiprolu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871sla46xn.fsf@concordia.ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=benh@kernel.crashing.org \
--cc=hbabu@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=mikey@neuling.org \
--cc=nicholas.piggin@gmail.com \
--cc=sukadev@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®