All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v2 1/2] phy: rockchip-inno-usb2: correct clk_ops callback
From: Doug Anderson @ 2016-11-14 18:15 UTC (permalink / raw)
  To: William Wu
  Cc: Kishon Vijay Abraham I, Heiko Stübner,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	open list:ARM/Rockchip SoC..., devicetree@vger.kernel.org,
	Rob Herring, Frank Wang, 黄涛, Brian Norris,
	Guenter Roeck
In-Reply-To: <1479106911-16049-2-git-send-email-wulf@rock-chips.com>

William

On Sun, Nov 13, 2016 at 11:01 PM, William Wu <wulf@rock-chips.com> wrote:
> Since we needs to delay ~1ms to wait for 480MHz output clock
> of USB2 PHY to become stable after turn on it, the delay time
> is pretty long for something that's supposed to be "atomic"
> like a clk_enable(). Consider that clk_enable() will disable
> interrupt and that a 1ms interrupt latency is not sensible.
>
> The 480MHz output clock should be handled in prepare callbacks
> which support gate a clk if the operation may sleep.
>
> Signed-off-by: William Wu <wulf@rock-chips.com>
> ---
>  drivers/phy/phy-rockchip-inno-usb2.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

Reviewed-by: Douglas Anderson <dianders@chromium.org>

^ permalink raw reply

* [PATCH v2 1/2] phy: rockchip-inno-usb2: correct clk_ops callback
From: Doug Anderson @ 2016-11-14 18:15 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1479106911-16049-2-git-send-email-wulf@rock-chips.com>

William

On Sun, Nov 13, 2016 at 11:01 PM, William Wu <wulf@rock-chips.com> wrote:
> Since we needs to delay ~1ms to wait for 480MHz output clock
> of USB2 PHY to become stable after turn on it, the delay time
> is pretty long for something that's supposed to be "atomic"
> like a clk_enable(). Consider that clk_enable() will disable
> interrupt and that a 1ms interrupt latency is not sensible.
>
> The 480MHz output clock should be handled in prepare callbacks
> which support gate a clk if the operation may sleep.
>
> Signed-off-by: William Wu <wulf@rock-chips.com>
> ---
>  drivers/phy/phy-rockchip-inno-usb2.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

Reviewed-by: Douglas Anderson <dianders@chromium.org>

^ permalink raw reply

* Re: [PATCH v2 1/2] phy: rockchip-inno-usb2: correct clk_ops callback
From: Doug Anderson @ 2016-11-14 18:15 UTC (permalink / raw)
  To: William Wu
  Cc: Kishon Vijay Abraham I, Heiko Stübner,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	open list:ARM/Rockchip SoC...,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Rob Herring,
	Frank Wang, 黄涛, Brian Norris, Guenter Roeck
In-Reply-To: <1479106911-16049-2-git-send-email-wulf-TNX95d0MmH7DzftRWevZcw@public.gmane.org>

William

On Sun, Nov 13, 2016 at 11:01 PM, William Wu <wulf-TNX95d0MmH7DzftRWevZcw@public.gmane.org> wrote:
> Since we needs to delay ~1ms to wait for 480MHz output clock
> of USB2 PHY to become stable after turn on it, the delay time
> is pretty long for something that's supposed to be "atomic"
> like a clk_enable(). Consider that clk_enable() will disable
> interrupt and that a 1ms interrupt latency is not sensible.
>
> The 480MHz output clock should be handled in prepare callbacks
> which support gate a clk if the operation may sleep.
>
> Signed-off-by: William Wu <wulf-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
> ---
>  drivers/phy/phy-rockchip-inno-usb2.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

Reviewed-by: Douglas Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH v2] i2c: mux: fix up dependencies
From: Peter Rosin @ 2016-11-14 14:39 UTC (permalink / raw)
  To: Linus Walleij, Wolfram Sang, linux-i2c; +Cc: stable, Jonathan Cameron
In-Reply-To: <1479134057-30653-1-git-send-email-linus.walleij@linaro.org>

On 2016-11-14 15:34, Linus Walleij wrote:
> We get the following build error from UM Linux after adding
> an entry to drivers/iio/gyro/Kconfig that issues "select I2C_MUX":
> 
> ERROR: "devm_ioremap_resource"
>    [drivers/i2c/muxes/i2c-mux-reg.ko] undefined!
> ERROR: "of_address_to_resource"
>    [drivers/i2c/muxes/i2c-mux-reg.ko] undefined!
> 
> It appears that the I2C mux core code depends on HAS_IOMEM
> for historical reasons, while CONFIG_I2C_MUX_REG does *not*
> have a direct dependency on HAS_IOMEM.
> 
> This creates a situation where a allyesconfig or allmodconfig
> for UM Linux will select I2C_MUX, and will implicitly enable
> I2C_MUX_REG as well, and the compilation will fail for the
> register driver.
> 
> Fix this up by making I2C_MUX_REG depend on HAS_IOMEM and
> removing the dependency from I2C_MUX.
> 
> Cc: stable@vger.kernel.org
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Reported-by: Jonathan Cameron <jic23@jic23.retrosnub.co.uk>
> Cc: Jonathan Cameron <jic23@jic23.retrosnub.co.uk>
> Cc: Peter Rosin <peda@axentia.se>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Acked-by: Peter Rosin <peda@axentia.se>

Thanks!

Cheers,
Peter

^ permalink raw reply

* [GIT PULL] Samsung SoC driver updates for 4.10
From: Sylwester Nawrocki @ 2016-11-14 18:14 UTC (permalink / raw)
  To: LMML
In-Reply-To: <CGME20161114181500eucas1p2f4bc902fe54c96803440410b6325d237@eucas1p2.samsung.com>

Hi Mauro,

This includes mostly clean up and fixes of the s5p-mfc and exynos-gsc
drivers. Support for the Exynos5433 (64-bit ARM) SoC is added to the
exynos-gsc driver.

The following changes since commit 669c6141ea78dff885b5bf025456c7dffb669a61:

  [media] mtk-mdp: fix double mutex_unlock (2016-10-21 12:09:53 -0200)

are available in the git repository at:

  git://linuxtv.org/snawrocki/samsung.git for-v4.10/media/next

for you to fetch changes up to 37269235bfaab6ad0b801190dc8a8c7397476b5b:

  s5p-mfc: Fix clock management in s5p_mfc_release() function (2016-11-14 16:04:15 +0100)

----------------------------------------------------------------
Andrzej Hajda (1):
      s5p-mfc: Correct scratch buffer size of H.263 decoder

Donghwa Lee (1):
      s5p-mfc: Skip incomplete frame

Ingi Kim (1):
      s5p-mfc: Fix MFC context buffer size

Javier Martinez Canillas (7):
      exynos-gsc: change spamming try_fmt log message to debug
      exynos-gsc: don't clear format when freeing buffers with REQBUFS(0)
      exynos-gsc: fix supported RGB pixel format
      exynos-gsc: do proper bytesperline and sizeimage calculation
      exynos-gsc: don't release a non-dynamically allocated video_device
      exynos-gsc: unregister video device node on driver removal
      exynos-gsc: cleanup m2m src and dst vb2 queues on STREAMOFF

Marek Szyprowski (8):
      exynos-gsc: Simplify system PM even more
      exynos-gsc: Remove unused lclk_freqency entry
      exynos-gsc: Add missing newline char in debug messages
      exynos-gsc: Use of_device_get_match_data() helper
      exynos-gsc: Enable driver on ARCH_EXYNOS
      exynos-gsc: Add support for Exynos5433 specific version
      s5p-mfc: Use clock gating only on MFC v5 hardware
      s5p-mfc: Fix clock management in s5p_mfc_release() function

Nicolas Dufresne (1):
      exynos4-is: fimc: Roundup imagesize to row size for tiled formats

Shuah Khan (2):
      s5p-mfc: Collapse two error message into one
      s5p-mfc: include buffer size in error message

Ulf Hansson (7):
      exynos-gsc: Simplify clock management
      exynos-gsc: Convert gsc_m2m_resume() from int to void
      exynos-gsc: Make driver functional when CONFIG_PM is unset
      exynos-gsc: Make PM callbacks available conditionally
      exynos-gsc: Fixup clock management at ->remove()
      exynos-gsc: Do full clock gating at runtime PM suspend
      exynos-gsc: Simplify system PM

 .../bindings/media/exynos5-gsc.txt       |   3 +-
 drivers/media/platform/Kconfig           |   2 +-
 .../media/platform/exynos-gsc/gsc-core.c | 279 +++++++--------
 .../media/platform/exynos-gsc/gsc-core.h |  11 +-
 .../media/platform/exynos-gsc/gsc-m2m.c  |  38 +-
 .../platform/exynos4-is/fimc-core.c      |  13 +-
 .../media/platform/s5p-mfc/regs-mfc-v6.h |   3 +-
 .../media/platform/s5p-mfc/regs-mfc-v8.h |   2 +-
 .../media/platform/s5p-mfc/regs-mfc.h    |   3 +
 drivers/media/platform/s5p-mfc/s5p_mfc.c |  15 +-
 .../platform/s5p-mfc/s5p_mfc_common.h    |   2 +
 .../media/platform/s5p-mfc/s5p_mfc_opr.c |   6 +-
 .../media/platform/s5p-mfc/s5p_mfc_pm.c  |  17 +-
 13 files changed, 209 insertions(+), 185 deletions(-)

-- 
Thanks,
Sylwester

^ permalink raw reply

* Re: [PATCH] dt-bindings: Add Keith&Koep vendor prefix
From: Marek Vasut @ 2016-11-14 18:14 UTC (permalink / raw)
  To: devicetree-u79uwXL29TY76Z2rM5mHXA; +Cc: Rob Herring, Fabio Estevam, Shawn Guo
In-Reply-To: <20161114101217.3580-1-marex-ynQEQJNshbs@public.gmane.org>

On 11/14/2016 11:12 AM, Marek Vasut wrote:
> Add vendor prefix for Keith&Koep GmbH , http://keith-koep.com/en/
> 
> Signed-off-by: Marek Vasut <marex-ynQEQJNshbs@public.gmane.org>
> Cc: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Cc: Fabio Estevam <fabio.estevam-3arQi8VN3Tc@public.gmane.org>
> Cc: Shawn Guo <shawnguo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

Please ignore, I see the patch was applied and the rebase didn't drop
it. Sorry for the noise.

-- 
Best regards,
Marek Vasut
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: Long delays creating a netns after deleting one (possibly RCU related)
From: Paul E. McKenney @ 2016-11-14 18:14 UTC (permalink / raw)
  To: Cong Wang
  Cc: Rolf Neugebauer, LKML, Linux Kernel Network Developers,
	Justin Cormack, Ian Campbell
In-Reply-To: <CAM_iQpXL+JaVG86+h2ucYs4Dm0zJKHq+4Nm+gk75wESGOzTmJQ@mail.gmail.com>

On Mon, Nov 14, 2016 at 09:44:35AM -0800, Cong Wang wrote:
> On Mon, Nov 14, 2016 at 8:24 AM, Paul E. McKenney
> <paulmck@linux.vnet.ibm.com> wrote:
> > On Sun, Nov 13, 2016 at 10:47:01PM -0800, Cong Wang wrote:
> >> On Fri, Nov 11, 2016 at 4:55 PM, Cong Wang <xiyou.wangcong@gmail.com> wrote:
> >> > On Fri, Nov 11, 2016 at 4:23 PM, Paul E. McKenney
> >> > <paulmck@linux.vnet.ibm.com> wrote:
> >> >>
> >> >> Ah!  This net_mutex is different than RTNL.  Should synchronize_net() be
> >> >> modified to check for net_mutex being held in addition to the current
> >> >> checks for RTNL being held?
> >> >>
> >> >
> >> > Good point!
> >> >
> >> > Like commit be3fc413da9eb17cce0991f214ab0, checking
> >> > for net_mutex for this case seems to be an optimization, I assume
> >> > synchronize_rcu_expedited() and synchronize_rcu() have the same
> >> > behavior...
> >>
> >> Thinking a bit more, I think commit be3fc413da9eb17cce0991f
> >> gets wrong on rtnl_is_locked(), the lock could be locked by other
> >> process not by the current one, therefore it should be
> >> lockdep_rtnl_is_held() which, however, is defined only when LOCKDEP
> >> is enabled... Sigh.
> >>
> >> I don't see any better way than letting callers decide if they want the
> >> expedited version or not, but this requires changes of all callers of
> >> synchronize_net(). Hm.
> >
> > I must confess that I don't understand how it would help to use an
> > expedited grace period when some other process is holding RTNL.
> > In contrast, I do well understand how it helps when the current process
> > is holding RTNL.
> 
> Yeah, this is exactly my point. And same for ASSERT_RTNL() which checks
> rtnl_is_locked(), clearly we need to assert "it is held by the current process"
> rather than "it is locked by whatever process".
> 
> But given *_is_held() is always defined by LOCKDEP, so we probably need
> mutex to provide such a helper directly, mutex->owner is not always defined
> either. :-/

There is always the option of making acquisition and release set a per-task
variable that can be tested.  (Where did I put that asbestos suit, anyway?)

							Thanx, Paul

^ permalink raw reply

* Re: [PATCH tip/core/rcu 0/2] Torture-test changes for 4.10
From: Josh Triplett @ 2016-11-14 18:14 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: linux-kernel, mingo, jiangshanlai, dipankar, akpm,
	mathieu.desnoyers, tglx, peterz, rostedt, dhowells, edumazet,
	dvhart, fweisbec, oleg, bobby.prani
In-Reply-To: <20161114175924.GA23488@linux.vnet.ibm.com>

On Mon, Nov 14, 2016 at 09:59:24AM -0800, Paul E. McKenney wrote:
> Hello!
> 
> This series contains a couple of torture-test changes:
> 
> 1.	Remove obsolete files from the rcutorture .gitignore file.
> 
> 2.	Prevent the --jitter flag from delaying --build-only runs.

Reviewed-by: Josh Triplett <josh@joshtriplett.org>

^ permalink raw reply

* [PATCH] drm/amdgpu/sdma: fix typo in packet setup
From: Alex Deucher @ 2016-11-14 18:13 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Alex Deucher

Use the correct define.  No functional change as both
defines are equivalent.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 2 +-
 drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
index e81aa46..1b44d5b 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
@@ -775,7 +775,7 @@ static void sdma_v2_4_vm_write_pte(struct amdgpu_ib *ib, uint64_t pe,
 	unsigned ndw = count * 2;
 
 	ib->ptr[ib->length_dw++] = SDMA_PKT_HEADER_OP(SDMA_OP_WRITE) |
-		SDMA_PKT_HEADER_SUB_OP(SDMA_SUBOP_COPY_LINEAR);
+		SDMA_PKT_HEADER_SUB_OP(SDMA_SUBOP_WRITE_LINEAR);
 	ib->ptr[ib->length_dw++] = pe;
 	ib->ptr[ib->length_dw++] = upper_32_bits(pe);
 	ib->ptr[ib->length_dw++] = ndw;
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
index 77f1465..9425c69 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
@@ -977,7 +977,7 @@ static void sdma_v3_0_vm_write_pte(struct amdgpu_ib *ib, uint64_t pe,
 	unsigned ndw = count * 2;
 
 	ib->ptr[ib->length_dw++] = SDMA_PKT_HEADER_OP(SDMA_OP_WRITE) |
-		SDMA_PKT_HEADER_SUB_OP(SDMA_SUBOP_COPY_LINEAR);
+		SDMA_PKT_HEADER_SUB_OP(SDMA_SUBOP_WRITE_LINEAR);
 	ib->ptr[ib->length_dw++] = lower_32_bits(pe);
 	ib->ptr[ib->length_dw++] = upper_32_bits(pe);
 	ib->ptr[ib->length_dw++] = ndw;
-- 
2.5.5

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related

* Re: [PATCH tip/core/rcu 6/7] rcu: Make expedited grace periods recheck dyntick idle state
From: Paul E. McKenney @ 2016-11-14 18:12 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Josh Triplett, linux-kernel, mingo, jiangshanlai, dipankar, akpm,
	mathieu.desnoyers, tglx, rostedt, dhowells, edumazet, dvhart,
	fweisbec, oleg, bobby.prani
In-Reply-To: <20161114173733.GJ3142@twins.programming.kicks-ass.net>

On Mon, Nov 14, 2016 at 06:37:33PM +0100, Peter Zijlstra wrote:
> On Mon, Nov 14, 2016 at 09:25:12AM -0800, Josh Triplett wrote:
> > On Mon, Nov 14, 2016 at 08:57:12AM -0800, Paul E. McKenney wrote:
> > > Expedited grace periods check dyntick-idle state, and avoid sending
> > > IPIs to idle CPUs, including those running guest OSes, and, on NOHZ_FULL
> > > kernels, nohz_full CPUs.  However, the kernel has been observed checking
> > > a CPU while it was non-idle, but sending the IPI after it has gone
> > > idle.  This commit therefore rechecks idle state immediately before
> > > sending the IPI, refraining from IPIing CPUs that have since gone idle.
> > > 
> > > Reported-by: Rik van Riel <riel@redhat.com>
> > > Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> > 
> > atomic_add_return(0, ...) seems odd.  Do you actually want that, rather
> > than atomic_read(...)?  If so, can you please document exactly why?
> 
> Yes that is weird. The only effective difference is that it would do a
> load-exclusive instead of a regular load.

It is weird, and checking to see if it is safe to convert it and its
friends to something with less overhead is on my list.   This starts
with a patch series I will post soon that consolidates all these
atomic_add_return() calls into a single function, which will ease testing
and other verification.

All that aside, please keep in mind that much is required from this load.
It is part of a network of ordered operations that guarantee that any
operation from any CPU preceding a given grace period is seen to precede
any other operation from any CPU following that same grace period.
And each and every CPU must agree on the order of those two operations,
otherwise, RCU is broken.

In addition, please note also that these operations are nowhere near
any fastpaths.

In fact, the specific operation you are concerned about is in an expedited
grace period, which has significant overhead.  This this added IPI can
substitute for an IPI, so, believe it or not, is an optimization.

							Thanx, Paul

^ permalink raw reply

* Re: [PATCH] [v2] net: phy: phy drivers should not set SUPPORTED_[Asym_]Pause
From: David Miller @ 2016-11-14 18:12 UTC (permalink / raw)
  To: timur; +Cc: f.fainelli, jon.mason, netdev
In-Reply-To: <1478821561-26498-1-git-send-email-timur@codeaurora.org>

From: Timur Tabi <timur@codeaurora.org>
Date: Thu, 10 Nov 2016 17:46:01 -0600

> Instead of having individual PHY drivers set the SUPPORTED_Pause and
> SUPPORTED_Asym_Pause flags, phylib itself should set those flags.
> During autonegotiation, the PHYs will determine whether to enable
> pause frame support.
> 
> Pause frames are a feature that is supported by the MAC.  It is the MAC
> that generates the frames and that processes them.  The PHY can only be
> configured to allow them to pass through.
> 
> So the new process is:
 ...
> Signed-off-by: Timur Tabi <timur@codeaurora.org>
> ---
> 
> v2: set the Pause bits in phy_probe()
>     update broadcom.c which was recently changed

Florian please review this patch.

Thank you.

^ permalink raw reply

* [U-Boot] [PATCH v3 5/5] ARMv8: LS1043A: Enable LS1043A default PSCI support
From: york sun @ 2016-11-14 18:12 UTC (permalink / raw)
  To: u-boot
In-Reply-To: <1478492034-17912-6-git-send-email-hongbo.zhang@nxp.com>

On 11/06/2016 08:14 PM, macro.wave.z at gmail.com wrote:
> From: Hongbo Zhang <hongbo.zhang@nxp.com>
>
> A most basic PSCI implementation with only one psci_version is added for
> LS1043A, this can verify the generic PSCI framework, and more platform specific
> implementation will be added later.
>
> Signed-off-by: Hongbo Zhang <hongbo.zhang@nxp.com>
> ---
>  arch/arm/cpu/armv8/fsl-layerscape/Makefile       |  1 +
>  arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S | 20 ++++++++++++++++++++
>  board/freescale/ls1043ardb/Kconfig               |  9 +++++++++
>  configs/ls1043ardb_defconfig                     |  3 +++
>  4 files changed, 33 insertions(+)
>  create mode 100644 arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S
>
> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/Makefile b/arch/arm/cpu/armv8/fsl-layerscape/Makefile
> index 51c1cee..423b4b3 100644
> --- a/arch/arm/cpu/armv8/fsl-layerscape/Makefile
> +++ b/arch/arm/cpu/armv8/fsl-layerscape/Makefile
> @@ -28,6 +28,7 @@ endif
>
>  ifneq ($(CONFIG_LS1043A),)
>  obj-$(CONFIG_SYS_HAS_SERDES) += ls1043a_serdes.o
> +obj-$(CONFIG_ARMV8_PSCI) += ls1043a_psci.o
>  endif
>
>  ifneq ($(CONFIG_ARCH_LS1012A),)
> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S b/arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S
> new file mode 100644
> index 0000000..86045ac
> --- /dev/null
> +++ b/arch/arm/cpu/armv8/fsl-layerscape/ls1043a_psci.S
> @@ -0,0 +1,20 @@
> +/*
> + * Copyright 2016 Freescale Semiconductor, Inc.
> + * Author: Hongbo Zhang <hongbo.zhang@nxp.com>
> + *
> + * SPDX-License-Identifier:	GPL-2.0+
> + * This file implements LS102X platform PSCI SYSTEM-SUSPEND function
> + */
> +
> +#include <config.h>
> +#include <linux/linkage.h>
> +#include <asm/psci.h>
> +
> +	.pushsection ._secure.text, "ax"
> +
> +.globl	psci_version
> +psci_version:
> +	ldr	w0, =0x00010000		/* PSCI v1.0 */
> +	ret
> +
> +	.popsection
> diff --git a/board/freescale/ls1043ardb/Kconfig b/board/freescale/ls1043ardb/Kconfig
> index 51818ec..0c596f9 100644
> --- a/board/freescale/ls1043ardb/Kconfig
> +++ b/board/freescale/ls1043ardb/Kconfig
> @@ -13,4 +13,13 @@ config SYS_SOC
>  config SYS_CONFIG_NAME
>  	default "ls1043ardb"
>
> +config SYS_HAS_ARMV8_SECURE_BASE
> +	bool "Enable secure RAM for PSCI image"
> +	depends on ARMV8_PSCI
> +	default y
> +	help
> +	  PSCI image can be re-located to secure RAM.
> +	  If enabled, please also define the value for ARMV8_SECURE_BASE,
> +	  for LS1043ARDB, it is address in OCRAM.
> +
>  endif
> diff --git a/configs/ls1043ardb_defconfig b/configs/ls1043ardb_defconfig
> index 79a4eb2..cb189f3 100644
> --- a/configs/ls1043ardb_defconfig
> +++ b/configs/ls1043ardb_defconfig
> @@ -28,3 +28,6 @@ CONFIG_DM_USB=y
>  CONFIG_USB_XHCI_HCD=y
>  CONFIG_USB_XHCI_DWC3=y
>  CONFIG_USB_STORAGE=y
> +CONFIG_ARMV8_PSCI=y
> +CONFIG_ARMV8_PSCI_CPUS_PER_CLUSTER=4
> +CONFIG_ARMV8_SECURE_BASE=0x10010000
>

How do you decide the CONFIG_ARMV8_SECURE_BASE?

Zhiqiang,

Does this patch set interfere with existing PPA support?

York

^ permalink raw reply

* Re: [PATCH -tip v2 2/6] selftests: ftrace: Initialize ftrace before each test
From: Steven Rostedt @ 2016-11-14 18:12 UTC (permalink / raw)
  To: Masami Hiramatsu
  Cc: Shuah Khan, Shuah Khan, linux-kernel, Ingo Molnar, Namhyung Kim,
	Tom Zanussi, linux-kselftest
In-Reply-To: <147781045018.11952.9286420015716639736.stgit@devbox>

On Sun, 30 Oct 2016 15:54:10 +0900
Masami Hiramatsu <mhiramat@kernel.org> wrote:

> Reset ftrace to initial state before running each test.
> This fixes some test cases to enable tracing before starting
> trace test. This can avoid false-positive failure when
> previous testcase fails while disabling tracing.
> 
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> Suggested-by: Steven Rostedt <rostedt@goodmis.org>
> ---
>  tools/testing/selftests/ftrace/ftracetest       |    2 +-
>  tools/testing/selftests/ftrace/test.d/functions |   25 +++++++++++++++++++++++
>  2 files changed, 26 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
> index 4c6a0bf..a03d366 100755
> --- a/tools/testing/selftests/ftrace/ftracetest
> +++ b/tools/testing/selftests/ftrace/ftracetest
> @@ -228,7 +228,7 @@ trap 'SIG_RESULT=$XFAIL' $SIG_XFAIL
>  
>  __run_test() { # testfile
>    # setup PID and PPID, $$ is not updated.
> -  (cd $TRACING_DIR; read PID _ < /proc/self/stat ; set -e; set -x; . $1)
> +  (cd $TRACING_DIR; read PID _ < /proc/self/stat; set -e; set -x; initialize_ftrace; . $1)
>    [ $? -ne 0 ] && kill -s $SIG_FAIL $SIG_PID
>  }
>  
> diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions
> index c37262f..fbaf565 100644
> --- a/tools/testing/selftests/ftrace/test.d/functions
> +++ b/tools/testing/selftests/ftrace/test.d/functions
> @@ -23,3 +23,28 @@ reset_trigger() { # reset all current setting triggers
>      done
>  }
>  
> +reset_events_filter() { # reset all current setting filters
> +    grep -v ^none events/*/*/filter |
> +    while read line; do
> +	echo 0 > `echo $line | cut -f1 -d:`
> +    done
> +}
> +
> +disable_events() {
> +    echo 0 > events/enable
> +}
> +
> +initialize_ftrace() { # Reset ftrace to initial-state
> +# As the initial state, ftrace will be set to nop tracer,
> +# no events, no triggers, no filters, no function filters,
> +# no probes, and tracing on.
> +    disable_tracing
> +    reset_tracer
> +    reset_trigger
> +    reset_events_filter
> +    disable_events
> +    echo | tee set_ftrace_* set_graph_* stack_trace_filter set_event_pid

I just disabled function graph tracing, and this causes every test to
fail.

   tee: set_graph_*: Permission denied

-- Steve

> +    echo > kprobe_events
> +    echo > uprobe_events
> +    enable_tracing
> +}

^ permalink raw reply

* [PATCH] libselinux: fix subdir build and usage of cmdline CFLAGS
From: Stephen Smalley @ 2016-11-14 18:12 UTC (permalink / raw)
  To: selinux; +Cc: william.c.roberts, Stephen Smalley

commit 16c123f4b1f3c8d20b3f597df161d7e635620923 ("libselinux:
support ANDROID_HOST=1 on Mac") broke the ability to run make
in the src subdirectory of libselinux (because OS and COMPILER
were not defined) and also caused some warning flags that could
be overridden via command-line CFLAGS to be mandatory.  Fix it.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
---
 libselinux/src/Makefile   | 12 ++++++++++--
 libselinux/utils/Makefile | 10 +++++++++-
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/libselinux/src/Makefile b/libselinux/src/Makefile
index 24946ce..76efe49 100644
--- a/libselinux/src/Makefile
+++ b/libselinux/src/Makefile
@@ -23,6 +23,14 @@ LIBSEPOLA ?= $(LIBDIR)/libsepol.a
 VERSION = $(shell cat ../VERSION)
 LIBVERSION = 1
 
+OS ?= $(shell uname)
+
+ifeq ($(shell $(CC) -v 2>&1 | grep "clang"),)
+COMPILER ?= gcc
+else
+COMPILER ?= clang
+endif
+
 LIBA=libselinux.a 
 TARGET=libselinux.so
 LIBPC=libselinux.pc
@@ -67,12 +75,12 @@ CFLAGS ?= -O -Wall -W -Wundef -Wformat-y2k -Wformat-security -Winit-self -Wmissi
 LD_SONAME_FLAGS=-soname,$(LIBSO),-z,defs,-z,relro
 
 ifeq ($(COMPILER), gcc)
-override CFLAGS += -fipa-pure-const -Wlogical-op -Wpacked-bitfield-compat -Wsync-nand \
+CFLAGS += -fipa-pure-const -Wlogical-op -Wpacked-bitfield-compat -Wsync-nand \
 	-Wcoverage-mismatch -Wcpp -Wformat-contains-nul -Wnormalized=nfc -Wsuggest-attribute=const \
 	-Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wtrampolines -Wjump-misses-init \
 	-Wno-suggest-attribute=pure -Wno-suggest-attribute=const -Wp,-D_FORTIFY_SOURCE=2
 else
-override CFLAGS += -Wunused-command-line-argument
+CFLAGS += -Wunused-command-line-argument
 endif
 
 ifeq ($(OS), Darwin)
diff --git a/libselinux/utils/Makefile b/libselinux/utils/Makefile
index a4f9903..7744184 100644
--- a/libselinux/utils/Makefile
+++ b/libselinux/utils/Makefile
@@ -5,6 +5,14 @@ USRBINDIR ?= $(PREFIX)/sbin
 SBINDIR ?= $(DESTDIR)/sbin
 INCLUDEDIR ?= $(PREFIX)/include
 
+OS ?= $(shell uname)
+
+ifeq ($(shell $(CC) -v 2>&1 | grep "clang"),)
+COMPILER ?= gcc
+else
+COMPILER ?= clang
+endif
+
 MAX_STACK_SIZE=8192
 CFLAGS ?= -O -Wall -W -Wundef -Wformat-y2k -Wformat-security -Winit-self -Wmissing-include-dirs \
           -Wunused -Wunknown-pragmas -Wstrict-aliasing -Wshadow -Wpointer-arith \
@@ -26,7 +34,7 @@ CFLAGS ?= -O -Wall -W -Wundef -Wformat-y2k -Wformat-security -Winit-self -Wmissi
 LD_SONAME_FLAGS=-soname,$(LIBSO),-z,defs,-z,relro
 
 ifeq ($(COMPILER), gcc)
-override CFLAGS += -fipa-pure-const -Wpacked-bitfield-compat -Wsync-nand -Wcoverage-mismatch \
+CFLAGS += -fipa-pure-const -Wpacked-bitfield-compat -Wsync-nand -Wcoverage-mismatch \
 	-Wcpp -Wformat-contains-nul -Wnormalized=nfc -Wsuggest-attribute=const \
 	-Wsuggest-attribute=noreturn -Wsuggest-attribute=pure -Wtrampolines -Wjump-misses-init \
 	-Wno-suggest-attribute=pure -Wno-suggest-attribute=const
-- 
2.7.4

^ permalink raw reply related

* Re: ✗ Fi.CI.BAT: warning for drm/i915: Add a per-pipe plane identifier enum (rev4)
From: Ville Syrjälä @ 2016-11-14 18:11 UTC (permalink / raw)
  To: intel-gfx
In-Reply-To: <20161109162458.29877.47880@emeril.freedesktop.org>

On Wed, Nov 09, 2016 at 04:24:58PM -0000, Patchwork wrote:
> == Series Details ==
> 
> Series: drm/i915: Add a per-pipe plane identifier enum (rev4)
> URL   : https://patchwork.freedesktop.org/series/14978/
> State : warning
> 
> == Summary ==
> 
> Series 14978v4 drm/i915: Add a per-pipe plane identifier enum
> https://patchwork.freedesktop.org/api/1.0/series/14978/revisions/4/mbox/
> 
> Test drv_module_reload_basic:
>                 pass       -> DMESG-WARN (fi-skl-6770hq)

[   26.882144] [drm:drm_dp_dual_mode_detect] DP dual mode HDMI ID: DP-HDMI ADAPTOR\004 (err 0)
[   26.882800] [drm:drm_dp_dual_mode_detect] DP dual mode adaptor ID: 44 (err 0)
[   26.882823] [drm:lspcon_init [i915]] No LSPCON detected, found type 1 HDMI
[   26.882862] [drm:lspcon_init [i915]] *ERROR* Failed to probe lspcon
[   26.882884] [drm:intel_ddi_init [i915]] *ERROR* LSPCON init failed on port B

The bug seems to contain multiple lspcon issues potentially, so not sure
if we're tracking it all there or what:
https://bugs.freedesktop.org/show_bug.cgi?id=98353

> Test kms_force_connector_basic:
>         Subgroup force-connector-state:
>                 pass       -> SKIP       (fi-ivb-3520m)
>         Subgroup force-edid:
>                 pass       -> SKIP       (fi-ivb-3520m)
>         Subgroup force-load-detect:
>                 pass       -> SKIP       (fi-ivb-3520m)
>         Subgroup prune-stale-modes:
>                 pass       -> SKIP       (fi-ivb-3520m)

[  325.952021] [drm:drm_helper_probe_single_connector_modes] [CONNECTOR:50:VGA-1]
[  325.952051] [drm:intel_crt_detect [i915]] [CONNECTOR:50:VGA-1] force=1
[  325.952087] [drm:intel_crt_detect [i915]] ironlake hotplug adpa=0x40f40000, result 0
[  325.952112] [drm:intel_crt_detect [i915]] CRT not detected via hotplug
[  325.952392] [drm:gmbus_xfer [i915]] GMBUS [i915 gmbus vga] NAK for addr: 0050 w(1)
[  325.952421] [drm:gmbus_xfer [i915]] GMBUS [i915 gmbus vga] NAK on first message, retry
[  325.953097] [drm:gmbus_xfer [i915]] GMBUS [i915 gmbus vga] NAK for addr: 0050 w(1)
[  325.953104] [drm:drm_do_probe_ddc_edid] drm: skipping non-existent adapter i915 gmbus vga
[  325.953132] [drm:intel_crt_get_edid [i915]] CRT GMBUS EDID read failed, retry using GPIO bit-banging
[  325.953159] [drm:intel_gmbus_force_bit [i915]] enabling bit-banging on i915 gmbus vga. force bit now 1
[  325.954322] [drm:drm_do_probe_ddc_edid] drm: skipping non-existent adapter i915 gmbus vga
[  325.954351] [drm:intel_gmbus_force_bit [i915]] disabling bit-banging on i915 gmbus vga. force bit now 0
[  325.954378] [drm:intel_crt_detect_ddc [i915]] CRT not detected via DDC:0x50 [no valid EDID found]
[  325.954383] [drm:drm_helper_probe_single_connector_modes] [CONNECTOR:50:VGA-1] disconnected
[  325.954746] [drm:status_store] [CONNECTOR:50:VGA-1] force updated from 0 to 2 or reprobing
[  325.954752] [drm:drm_helper_probe_single_connector_modes] [CONNECTOR:50:VGA-1]
[  325.954758] [drm:drm_helper_probe_single_connector_modes] [CONNECTOR:50:VGA-1] status updated from disconnected to connected
[  325.955068] [drm:gmbus_xfer [i915]] GMBUS [i915 gmbus vga] NAK for addr: 0050 w(1)
[  325.955098] [drm:gmbus_xfer [i915]] GMBUS [i915 gmbus vga] NAK on first message, retry
[  325.955334] [drm:gmbus_xfer [i915]] GMBUS [i915 gmbus vga] NAK for addr: 0050 w(1)
[  325.955341] [drm:drm_do_probe_ddc_edid] drm: skipping non-existent adapter i915 gmbus vga
[  325.955368] [drm:intel_crt_get_edid [i915]] CRT GMBUS EDID read failed, retry using GPIO bit-banging
[  325.955394] [drm:intel_gmbus_force_bit [i915]] enabling bit-banging on i915 gmbus vga. force bit now 1
[  325.956456] [drm:drm_do_probe_ddc_edid] drm: skipping non-existent adapter i915 gmbus vga
[  325.956484] [drm:intel_gmbus_force_bit [i915]] disabling bit-banging on i915 gmbus vga. force bit now 0
[  325.956563] [drm:drm_helper_probe_single_connector_modes] [CONNECTOR:50:VGA-1] probed modes :
[  325.956584] [drm:drm_mode_debug_printmodeline] Modeline 74:"1024x768" 60 65000 1024 1048 1184 1344 768 771 777 806 0x40 0xa
[  325.956594] [drm:drm_mode_debug_printmodeline] Modeline 72:"800x600" 60 40000 800 840 968 1056 600 601 605 628 0x40 0x5
[  325.956601] [drm:drm_mode_debug_printmodeline] Modeline 71:"800x600" 56 36000 800 824 896 1024 600 601 603 625 0x40 0x5
[  325.956613] [drm:drm_mode_debug_printmodeline] Modeline 73:"848x480" 60 33750 848 864 976 1088 480 486 494 517 0x40 0x5
[  325.956620] [drm:drm_mode_debug_printmodeline] Modeline 70:"640x480" 60 25175 640 656 752 800 480 490 492 525 0x40 0xa
...
[  339.524802] [drm:status_store] [CONNECTOR:50:VGA-1] force updated from 2 to 0 or reprobing
[  339.524808] [drm:drm_helper_probe_single_connector_modes] [CONNECTOR:50:VGA-1]
[  339.524845] [drm:intel_crt_detect [i915]] [CONNECTOR:50:VGA-1] force=1
[  339.524880] [drm:intel_crt_detect [i915]] ironlake hotplug adpa=0x43f40000, result 1
[  339.524904] [drm:intel_crt_detect [i915]] CRT detected via hotplug
[  339.525639] [drm:gmbus_xfer [i915]] GMBUS [i915 gmbus vga] NAK for addr: 0050 w(1)
[  339.525681] [drm:gmbus_xfer [i915]] GMBUS [i915 gmbus vga] NAK on first message, retry
[  339.525941] [drm:gmbus_xfer [i915]] GMBUS [i915 gmbus vga] NAK for addr: 0050 w(1)
[  339.526246] [drm:drm_do_probe_ddc_edid] drm: skipping non-existent adapter i915 gmbus vga
[  339.526288] [drm:intel_crt_get_edid [i915]] CRT GMBUS EDID read failed, retry using GPIO bit-banging
[  339.526330] [drm:intel_gmbus_force_bit [i915]] enabling bit-banging on i915 gmbus vga. force bit now 1
[  339.527481] [drm:drm_do_probe_ddc_edid] drm: skipping non-existent adapter i915 gmbus vga
[  339.527512] [drm:intel_gmbus_force_bit [i915]] disabling bit-banging on i915 gmbus vga. force bit now 0
[  339.527562] [drm:drm_helper_probe_single_connector_modes] [CONNECTOR:50:VGA-1] probed modes :
[  339.527568] [drm:drm_mode_debug_printmodeline] Modeline 74:"1024x768" 60 65000 1024 1048 1184 1344 768 771 777 806 0x40 0xa
[  339.527572] [drm:drm_mode_debug_printmodeline] Modeline 72:"800x600" 60 40000 800 840 968 1056 600 601 605 628 0x40 0x5
[  339.527576] [drm:drm_mode_debug_printmodeline] Modeline 71:"800x600" 56 36000 800 824 896 1024 600 601 603 625 0x40 0x5
[  339.527581] [drm:drm_mode_debug_printmodeline] Modeline 73:"848x480" 60 33750 848 864 976 1088 480 486 494 517 0x40 0x5
[  339.527585] [drm:drm_mode_debug_printmodeline] Modeline 70:"640x480" 60 25175 640 656 752 800 480 490 492 525 0x40 0xa
[  339.552201] [drm:drm_fb_helper_hotplug_event] 

So something a bit fishy going on with the CRT HPD on that machine.

> 
> fi-bdw-5557u     total:244  pass:229  dwarn:0   dfail:0   fail:0   skip:15 
> fi-bsw-n3050     total:244  pass:204  dwarn:0   dfail:0   fail:0   skip:40 
> fi-bxt-t5700     total:244  pass:216  dwarn:0   dfail:0   fail:0   skip:28 
> fi-byt-j1900     total:244  pass:216  dwarn:0   dfail:0   fail:0   skip:28 
> fi-byt-n2820     total:244  pass:212  dwarn:0   dfail:0   fail:0   skip:32 
> fi-hsw-4770      total:244  pass:224  dwarn:0   dfail:0   fail:0   skip:20 
> fi-hsw-4770r     total:244  pass:224  dwarn:0   dfail:0   fail:0   skip:20 
> fi-ilk-650       total:244  pass:191  dwarn:0   dfail:0   fail:0   skip:53 
> fi-ivb-3520m     total:244  pass:218  dwarn:0   dfail:0   fail:0   skip:26 
> fi-ivb-3770      total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
> fi-kbl-7200u     total:244  pass:222  dwarn:0   dfail:0   fail:0   skip:22 
> fi-skl-6260u     total:244  pass:230  dwarn:0   dfail:0   fail:0   skip:14 
> fi-skl-6700hq    total:244  pass:223  dwarn:0   dfail:0   fail:0   skip:21 
> fi-skl-6700k     total:244  pass:222  dwarn:1   dfail:0   fail:0   skip:21 
> fi-skl-6770hq    total:244  pass:229  dwarn:1   dfail:0   fail:0   skip:14 
> fi-snb-2520m     total:244  pass:212  dwarn:0   dfail:0   fail:0   skip:32 
> fi-snb-2600      total:244  pass:211  dwarn:0   dfail:0   fail:0   skip:33 
> 
> 74d13d4fab710f664d5eeb15fd3de821a7f46818 drm-intel-nightly: 2016y-11m-09d-15h-02m-46s UTC integration manifest
> e7fdae4 drm/i915: Don't populate plane->plane for cursors and sprites
> 776f170 drm/i915: Rename the local 'plane' variable to 'plane_id' in primary plane code
> 8a691eb drm/i915: Use enum plane_id in VLV/CHV wm code
> daca75f drm/i915: Use enum plane_id in VLV/CHV sprite code
> 2fc5a0b drm/i915: Use enum plane_id in SKL plane code
> 698ce5d drm/i915: Use enum plane_id in SKL wm code
> e6a137a drm/i915: Add crtc->plane_ids_mask
> e37903b drm/i915: Add per-pipe plane identifier
> caadefb drm/i915: Remove some duplicated plane swapping logic
> 
> == Logs ==
> 
> For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_2943/

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply

* Re: [PATCHSET] Add support for simplified async direct-io
From: Christoph Hellwig @ 2016-11-14 18:11 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Christoph Hellwig, axboe, linux-block
In-Reply-To: <d9baad75-d105-2968-1b59-608a8598e3bb@fb.com>

On Mon, Nov 14, 2016 at 11:08:46AM -0700, Jens Axboe wrote:
> It'd be cleaner to loop one level out, and avoid all that 'dio' stuff
> instead. And then still retain the separate parts of the sync and async.
> There's nothing to share there imho, and it just makes the code harder
> to read.

How do you avoid it for the async case?  We can only call ki_complete
once all bios have finished, which means we need a tracking structure
for it.  For the synchronous case we could in theory wait for the
previous bio before sending the next, but there are plenty of RAID
arrays that would prefer > 1MB I/O.  And we can pretty much reuse the
async case for this anyway.

^ permalink raw reply

* Re: [Qemu-devel] [PATCH 07/13] virtio-scsi: always use dataplane path if ioeventfd is active
From: Paolo Bonzini @ 2016-11-14 18:10 UTC (permalink / raw)
  To: Alex Williamson; +Cc: cornelia.huck, famz, qemu-devel, stefanha, mst
In-Reply-To: <20161114100932.46a5a2a6@t450s.home>



On 14/11/2016 18:09, Alex Williamson wrote:
> Hmm, fixed yet not fixed.  I get a nice shutdown and it even eliminates
> a cpu spike shown in virt-manager at the end of shutdown that was
> typical previously, but then I noticed dmesg showing me segfaults, so I
> hooked up gdb and:

Well, that I don't get the segfault already says something...  Though 
it's not even clear from the backtrace what is causing the segfault.  
Let's try the same printf without the change.

Paolo

diff --git a/hw/scsi/virtio-scsi-dataplane.c b/hw/scsi/virtio-scsi-dataplane.c
index f2ea29d..ec0f750 100644
--- a/hw/scsi/virtio-scsi-dataplane.c
+++ b/hw/scsi/virtio-scsi-dataplane.c
@@ -108,11 +108,13 @@ static void virtio_scsi_clear_aio(VirtIOSCSI *s)
     VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(s);
     int i;
 
+    printf("before clear\n");
     virtio_queue_aio_set_host_notifier_handler(vs->ctrl_vq, s->ctx, NULL);
     virtio_queue_aio_set_host_notifier_handler(vs->event_vq, s->ctx, NULL);
     for (i = 0; i < vs->conf.num_queues; i++) {
         virtio_queue_aio_set_host_notifier_handler(vs->cmd_vqs[i], s->ctx, NULL);
     }
+    printf("after clear\n");
 }
 
 /* Context: QEMU global mutex held */
@@ -202,15 +204,18 @@ void virtio_scsi_dataplane_stop(VirtIODevice *vdev)
 
     aio_context_acquire(s->ctx);
     virtio_scsi_clear_aio(s);
     aio_context_release(s->ctx);
 
+    printf("before drain\n");
     blk_drain_all(); /* ensure there are no in-flight requests */
+    printf("after drain\n");
 
     for (i = 0; i < vs->conf.num_queues + 2; i++) {
         virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), i, false);
     }
 
     /* Clean up guest notifier (irq) */
+    printf("end of virtio_scsi_dataplane_stop\n");
     k->set_guest_notifiers(qbus->parent, vs->conf.num_queues + 2, false);
     s->dataplane_stopping = false;
     s->dataplane_started = false;
diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
index 3e5ae6a..dabcb54 100644
--- a/hw/scsi/virtio-scsi.c
+++ b/hw/scsi/virtio-scsi.c
@@ -75,6 +75,7 @@ static void virtio_scsi_complete_req(VirtIOSCSIReq *req)
     }
 
     if (req->sreq) {
+        printf("finish %x\n", req->sreq->tag);
         req->sreq->hba_private = NULL;
         scsi_req_unref(req->sreq);
     }
@@ -549,6 +550,7 @@ static int virtio_scsi_handle_cmd_req_prepare(VirtIOSCSI *s, VirtIOSCSIReq *req)
         return -ENOENT;
     }
     virtio_scsi_ctx_check(s, d);
+    printf("prepare %lx %x\n", req->req.cmd.tag, req->req.cmd.cdb[0]);
     req->sreq = scsi_req_new(d, req->req.cmd.tag,
                              virtio_scsi_get_lun(req->req.cmd.lun),
                              req->req.cmd.cdb, req);
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 62001b4..c75dec3 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -336,11 +336,13 @@ static int virtio_pci_ioeventfd_assign(DeviceState *d, EventNotifier *notifier,
 
 static void virtio_pci_start_ioeventfd(VirtIOPCIProxy *proxy)
 {
+    printf("start ioeventfd %s\n", object_class_get_name(object_get_class(OBJECT(proxy))));
     virtio_bus_start_ioeventfd(&proxy->bus);
 }
 
 static void virtio_pci_stop_ioeventfd(VirtIOPCIProxy *proxy)
 {
+    printf("stop ioeventfd %s\n", object_class_get_name(object_get_class(OBJECT(proxy))));
     virtio_bus_stop_ioeventfd(&proxy->bus);
 }
 
@@ -376,6 +378,7 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val)
         }
         break;
     case VIRTIO_PCI_STATUS:
+        printf("set status %s %x\n", object_class_get_name(object_get_class(OBJECT(proxy))), val & 0xFF);
         if (!(val & VIRTIO_CONFIG_S_DRIVER_OK)) {
             virtio_pci_stop_ioeventfd(proxy);
         }
@@ -1274,6 +1277,7 @@ static void virtio_pci_common_write(void *opaque, hwaddr addr,
         vdev->config_vector = val;
         break;
     case VIRTIO_PCI_COMMON_STATUS:
+        printf("set status %s %x\n", object_class_get_name(object_get_class(OBJECT(proxy))), (uint8_t)val);
         if (!(val & VIRTIO_CONFIG_S_DRIVER_OK)) {
             virtio_pci_stop_ioeventfd(proxy);
         }
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 89b0b80..9c894d7 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -2018,7 +2018,7 @@ EventNotifier *virtio_queue_get_guest_notifier(VirtQueue *vq)
     return &vq->guest_notifier;
 }
 
-static void virtio_queue_host_notifier_aio_read(EventNotifier *n)
+void virtio_queue_host_notifier_aio_read(EventNotifier *n)
 {
     VirtQueue *vq = container_of(n, VirtQueue, host_notifier);
     if (event_notifier_test_and_clear(n)) {
@@ -2046,6 +2046,9 @@ void virtio_queue_host_notifier_read(EventNotifier *n)
 {
     VirtQueue *vq = container_of(n, VirtQueue, host_notifier);
     if (event_notifier_test_and_clear(n)) {
+        VirtIODevice *vdev = vq->vdev;
+
+        printf("virtio_queue_host_notifier_read %ld\n", vq - vdev->vq);
         virtio_queue_notify_vq(vq);
     }
 }
diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h
index 35ede30..d3dfc69 100644
--- a/include/hw/virtio/virtio.h
+++ b/include/hw/virtio/virtio.h
@@ -274,6 +274,7 @@ int virtio_device_grab_ioeventfd(VirtIODevice *vdev);
 void virtio_device_release_ioeventfd(VirtIODevice *vdev);
 bool virtio_device_ioeventfd_enabled(VirtIODevice *vdev);
 EventNotifier *virtio_queue_get_host_notifier(VirtQueue *vq);
+void virtio_queue_host_notifier_aio_read(EventNotifier *n);
 void virtio_queue_host_notifier_read(EventNotifier *n);
 void virtio_queue_aio_set_host_notifier_handler(VirtQueue *vq, AioContext *ctx,
                                                 void (*fn)(VirtIODevice *,



> Thread 3 "CPU 0/KVM" received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 0x7fb4f73ba700 (LWP 2713)]
> 0x00005593dacc2800 in virtio_queue_notify_aio_vq (vq=0x5593dd4a7378) at /net/gimli/home/alwillia/Work/qemu.git/hw/virtio/virtio.c:1242
> 1242	        trace_virtio_queue_notify(vdev, vq - vdev->vq, vq);
> (gdb) bt
> #0  0x00005593dacc2800 in virtio_queue_notify_aio_vq (vq=0x5593dd4a7378) at /net/gimli/home/alwillia/Work/qemu.git/hw/virtio/virtio.c:1242
> #1  0x00005593dacc4a4e in virtio_queue_host_notifier_aio_read (n=0x5593dd4a73d8) at /net/gimli/home/alwillia/Work/qemu.git/hw/virtio/virtio.c:2025
> #2  0x00005593daca4997 in virtio_scsi_dataplane_stop (vdev=0x5593dc0cc0f0) at /net/gimli/home/alwillia/Work/qemu.git/hw/scsi/virtio-scsi-dataplane.c:209
> #3  0x00005593daf6a4b7 in virtio_bus_stop_ioeventfd (bus=0x5593dc0cc078) at hw/virtio/virtio-bus.c:219
> #4  0x00005593daf64279 in virtio_pci_stop_ioeventfd (proxy=0x5593dc0c3ce0) at hw/virtio/virtio-pci.c:344
> #5  0x00005593daf643d5 in virtio_ioport_write (opaque=0x5593dc0c3ce0, addr=18, val=0) at hw/virtio/virtio-pci.c:380
> #6  0x00005593daf6484d in virtio_pci_config_write (opaque=0x5593dc0c3ce0, addr=18, val=0, size=1) at hw/virtio/virtio-pci.c:508
> #7  0x00005593dac592fd in memory_region_write_accessor (mr=0x5593dc0c45d0, addr=18, value=0x7fb4f73b74b8, size=1, shift=0, mask=255, attrs=...)
>     at /net/gimli/home/alwillia/Work/qemu.git/memory.c:526
> #8  0x00005593dac59515 in access_with_adjusted_size (addr=18, value=0x7fb4f73b74b8, size=1, access_size_min=1, access_size_max=4, access=
>     0x5593dac59213 <memory_region_write_accessor>, mr=0x5593dc0c45d0, attrs=...) at /net/gimli/home/alwillia/Work/qemu.git/memory.c:592
> #9  0x00005593dac5bc55 in memory_region_dispatch_write (mr=0x5593dc0c45d0, addr=18, data=0, size=1, attrs=...) at /net/gimli/home/alwillia/Work/qemu.git/memory.c:1323
> #10 0x00005593dac07583 in address_space_write_continue (as=0x5593db727de0 <address_space_io>, addr=49298, attrs=..., buf=0x7fb520354000 "", len=1, addr1=18, l=1, mr=0x5593dc0c45d0)
>     at /net/gimli/home/alwillia/Work/qemu.git/exec.c:2621
> #11 0x00005593dac076cb in address_space_write (as=0x5593db727de0 <address_space_io>, addr=49298, attrs=..., buf=0x7fb520354000 "", len=1)
>     at /net/gimli/home/alwillia/Work/qemu.git/exec.c:2666
> #12 0x00005593dac07a57 in address_space_rw (as=0x5593db727de0 <address_space_io>, addr=49298, attrs=..., buf=0x7fb520354000 "", len=1, is_write=true)
>     at /net/gimli/home/alwillia/Work/qemu.git/exec.c:2768
> #13 0x00005593dac558d7 in kvm_handle_io (port=49298, attrs=..., data=0x7fb520354000, direction=1, size=1, count=1) at /net/gimli/home/alwillia/Work/qemu.git/kvm-all.c:1800
> #14 0x00005593dac55ddd in kvm_cpu_exec (cpu=0x5593dc0a6490) at /net/gimli/home/alwillia/Work/qemu.git/kvm-all.c:1958
> #15 0x00005593dac3cc58 in qemu_kvm_cpu_thread_fn (arg=0x5593dc0a6490) at /net/gimli/home/alwillia/Work/qemu.git/cpus.c:998
> #16 0x00007fb5054715ca in start_thread (arg=0x7fb4f73ba700) at pthread_create.c:333
> #17 0x00007fb5051ab0ed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
> 
>> And if it doesn't work here is some printf debugging.  It's pretty verbose but
>> the interesting part starts pretty much where you issue the virsh shutdown or
>> system_powerdown command:
>>
>> diff --git a/hw/scsi/virtio-scsi-dataplane.c b/hw/scsi/virtio-scsi-dataplane.c
>> index f2ea29d..ec0f750 100644
>> --- a/hw/scsi/virtio-scsi-dataplane.c
>> +++ b/hw/scsi/virtio-scsi-dataplane.c
>> @@ -108,11 +108,13 @@ static void virtio_scsi_clear_aio(VirtIOSCSI *s)
>>      VirtIOSCSICommon *vs = VIRTIO_SCSI_COMMON(s);
>>      int i;
>>  
>> +    printf("before clear\n");
>>      virtio_queue_aio_set_host_notifier_handler(vs->ctrl_vq, s->ctx, NULL);
>>      virtio_queue_aio_set_host_notifier_handler(vs->event_vq, s->ctx, NULL);
>>      for (i = 0; i < vs->conf.num_queues; i++) {
>>          virtio_queue_aio_set_host_notifier_handler(vs->cmd_vqs[i], s->ctx, NULL);
>>      }
>> +    printf("after clear\n");
>>  }
>>  
>>  /* Context: QEMU global mutex held */
>> @@ -202,15 +204,20 @@ void virtio_scsi_dataplane_stop(VirtIODevice *vdev)
>>  
>>      aio_context_acquire(s->ctx);
>>      virtio_scsi_clear_aio(s);
>> -    aio_context_release(s->ctx);
>> -
>> -    blk_drain_all(); /* ensure there are no in-flight requests */
>>  
>>      for (i = 0; i < vs->conf.num_queues + 2; i++) {
>> +        VirtQueue *vq = virtio_get_queue(vdev, i);
>>          virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), i, false);
>> +        virtio_queue_host_notifier_aio_read(virtio_queue_get_guest_notifier(vq));
>>      }
>> +    aio_context_release(s->ctx);
>> +
>> +    printf("before drain\n");
>> +    blk_drain_all(); /* ensure there are no in-flight requests */
>> +    printf("after drain\n");
>>  
>>      /* Clean up guest notifier (irq) */
>> +    printf("end of virtio_scsi_dataplane_stop\n");
>>      k->set_guest_notifiers(qbus->parent, vs->conf.num_queues + 2, false);
>>      s->dataplane_stopping = false;
>>      s->dataplane_started = false;
>> diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c
>> index 3e5ae6a..e8b83d4 100644
>> --- a/hw/scsi/virtio-scsi.c
>> +++ b/hw/scsi/virtio-scsi.c
>> @@ -75,6 +75,7 @@ static void virtio_scsi_complete_req(VirtIOSCSIReq *req)
>>      }
>>  
>>      if (req->sreq) {
>> +        printf("finish %x\n", req->sreq->tag);
>>          req->sreq->hba_private = NULL;
>>          scsi_req_unref(req->sreq);
>>      }
>> @@ -549,6 +549,7 @@ static int virtio_scsi_handle_cmd_req_prepare(VirtIOSCSI *s, VirtIOSCSIReq *req)
>>          return -ENOENT;
>>      }
>>      virtio_scsi_ctx_check(s, d);
>> +    printf("prepare %lx %x\n", req->req.cmd.tag, req->req.cmd.cdb[0]);
>>      req->sreq = scsi_req_new(d, req->req.cmd.tag,
>>                               virtio_scsi_get_lun(req->req.cmd.lun),
>>                               req->req.cmd.cdb, req);
>> diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
>> index 62001b4..c75dec3 100644
>> --- a/hw/virtio/virtio-pci.c
>> +++ b/hw/virtio/virtio-pci.c
>> @@ -336,11 +336,13 @@ static int virtio_pci_ioeventfd_assign(DeviceState *d, EventNotifier *notifier,
>>  
>>  static void virtio_pci_start_ioeventfd(VirtIOPCIProxy *proxy)
>>  {
>> +    printf("start ioeventfd %s\n", object_class_get_name(object_get_class(OBJECT(proxy))));
>>      virtio_bus_start_ioeventfd(&proxy->bus);
>>  }
>>  
>>  static void virtio_pci_stop_ioeventfd(VirtIOPCIProxy *proxy)
>>  {
>> +    printf("stop ioeventfd %s\n", object_class_get_name(object_get_class(OBJECT(proxy))));
>>      virtio_bus_stop_ioeventfd(&proxy->bus);
>>  }
>>  
>> @@ -376,6 +378,7 @@ static void virtio_ioport_write(void *opaque, uint32_t addr, uint32_t val)
>>          }
>>          break;
>>      case VIRTIO_PCI_STATUS:
>> +        printf("set status %s %x\n", object_class_get_name(object_get_class(OBJECT(proxy))), val & 0xFF);
>>          if (!(val & VIRTIO_CONFIG_S_DRIVER_OK)) {
>>              virtio_pci_stop_ioeventfd(proxy);
>>          }
>> @@ -1274,6 +1277,7 @@ static void virtio_pci_common_write(void *opaque, hwaddr addr,
>>          vdev->config_vector = val;
>>          break;
>>      case VIRTIO_PCI_COMMON_STATUS:
>> +        printf("set status %s %x\n", object_class_get_name(object_get_class(OBJECT(proxy))), (uint8_t)val);
>>          if (!(val & VIRTIO_CONFIG_S_DRIVER_OK)) {
>>              virtio_pci_stop_ioeventfd(proxy);
>>          }
>>
> 
> This required making virtio_queue_host_notifier_aio_read() non-static
> and adding the forward declaration, stolen from the first patch.  The
> attached log starts at the point where there guest is idle and I issue
> a virsh shutdown.  This also results in a segfault nearly identical to
> above:
> 
> Thread 4 "CPU 1/KVM" received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 0x7f7194901700 (LWP 3804)]
> 0x000056358070788a in virtio_queue_notify_aio_vq (vq=0x56358310d378) at /net/gimli/home/alwillia/Work/qemu.git/hw/virtio/virtio.c:1242
> 1242	        trace_virtio_queue_notify(vdev, vq - vdev->vq, vq);
> (gdb) bt
> #0  0x000056358070788a in virtio_queue_notify_aio_vq (vq=0x56358310d378) at /net/gimli/home/alwillia/Work/qemu.git/hw/virtio/virtio.c:1242
> #1  0x0000563580709ad8 in virtio_queue_host_notifier_aio_read (n=0x56358310d3d8) at /net/gimli/home/alwillia/Work/qemu.git/hw/virtio/virtio.c:2025
> #2  0x00005635806e99fd in virtio_scsi_dataplane_stop (vdev=0x563581d320f0) at /net/gimli/home/alwillia/Work/qemu.git/hw/scsi/virtio-scsi-dataplane.c:211
> #3  0x00005635809af5fe in virtio_bus_stop_ioeventfd (bus=0x563581d32078) at hw/virtio/virtio-bus.c:219
> #4  0x00005635809a9353 in virtio_pci_stop_ioeventfd (proxy=0x563581d29ce0) at hw/virtio/virtio-pci.c:346
> #5  0x00005635809a94e0 in virtio_ioport_write (opaque=0x563581d29ce0, addr=18, val=0) at hw/virtio/virtio-pci.c:383
> #6  0x00005635809a995d in virtio_pci_config_write (opaque=0x563581d29ce0, addr=18, val=0, size=1) at hw/virtio/virtio-pci.c:511
> #7  0x000056358069e2fd in memory_region_write_accessor (mr=0x563581d2a5d0, addr=18, value=0x7f71948fe4b8, size=1, shift=0, mask=255, attrs=...)
>     at /net/gimli/home/alwillia/Work/qemu.git/memory.c:526
> #8  0x000056358069e515 in access_with_adjusted_size (addr=18, value=0x7f71948fe4b8, size=1, access_size_min=1, access_size_max=4, access=
>     0x56358069e213 <memory_region_write_accessor>, mr=0x563581d2a5d0, attrs=...) at /net/gimli/home/alwillia/Work/qemu.git/memory.c:592
> #9  0x00005635806a0c55 in memory_region_dispatch_write (mr=0x563581d2a5d0, addr=18, data=0, size=1, attrs=...) at /net/gimli/home/alwillia/Work/qemu.git/memory.c:1323
> #10 0x000056358064c583 in address_space_write_continue (as=0x56358116cde0 <address_space_io>, addr=49298, attrs=..., buf=0x7f71be099000 "", len=1, addr1=18, l=1, mr=0x563581d2a5d0)
>     at /net/gimli/home/alwillia/Work/qemu.git/exec.c:2621
> #11 0x000056358064c6cb in address_space_write (as=0x56358116cde0 <address_space_io>, addr=49298, attrs=..., buf=0x7f71be099000 "", len=1)
>     at /net/gimli/home/alwillia/Work/qemu.git/exec.c:2666
> #12 0x000056358064ca57 in address_space_rw (as=0x56358116cde0 <address_space_io>, addr=49298, attrs=..., buf=0x7f71be099000 "", len=1, is_write=true)
>     at /net/gimli/home/alwillia/Work/qemu.git/exec.c:2768
> #13 0x000056358069a8d7 in kvm_handle_io (port=49298, attrs=..., data=0x7f71be099000, direction=1, size=1, count=1) at /net/gimli/home/alwillia/Work/qemu.git/kvm-all.c:1800
> #14 0x000056358069addd in kvm_cpu_exec (cpu=0x563581d6d030) at /net/gimli/home/alwillia/Work/qemu.git/kvm-all.c:1958
> #15 0x0000563580681c58 in qemu_kvm_cpu_thread_fn (arg=0x563581d6d030) at /net/gimli/home/alwillia/Work/qemu.git/cpus.c:998
> #16 0x00007f71a31b95ca in start_thread (arg=0x7f7194901700) at pthread_create.c:333
> #17 0x00007f71a2ef30ed in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
> 
> If you care to match line numbers, my tree is based on
> 6bbcb76301a72dc80c8d29af13d40bb9a759c9c6, it includes you patch:
> 
> virtio: introduce grab/release_ioeventfd to fix vhost
> 
> Plus your first fix removing the assert and return 0 case from
> virtio_bus_set_host_notifier().  Thanks,
> 
> Alex
> 

^ permalink raw reply related

* Re: [PATCH v3 5/6] grep: enable recurse-submodules to work on <tree> objects
From: Junio C Hamano @ 2016-11-14 18:10 UTC (permalink / raw)
  To: jonathantanmy; +Cc: git, sbeller, Brandon Williams
In-Reply-To: <1478908273-190166-6-git-send-email-bmwill@google.com>

Brandon Williams <bmwill@google.com> writes:

> Teach grep to recursively search in submodules when provided with a
> <tree> object. This allows grep to search a submodule based on the state
> of the submodule that is present in a commit of the super project.
>
> When grep is provided with a <tree> object, the name of the object is
> prefixed to all output.  In order to provide uniformity of output
> between the parent and child processes the option `--parent-basename`
> has been added so that the child can preface all of it's output with the
> name of the parent's object instead of the name of the commit SHA1 of
> the submodule. This changes output from the command
> `git grep -e. -l --recurse-submodules HEAD` from:
> HEAD:file
> <commit sha1 of submodule>:sub/file
>
> to:
> HEAD:file
> HEAD:sub/file
>
> Signed-off-by: Brandon Williams <bmwill@google.com>
> ---

Unrelated tangent, but this makes readers wonder what the updated
trailer code would do to the last paragraph ;-).  Does it behave
sensibly (with some sane definition of sensibleness)?

I am guessing that it would, because neither To: or HEAD: is what we
normally recognize as a known trailer block element.



^ permalink raw reply

* Re: [PATCHSET] Add support for simplified async direct-io
From: Jens Axboe @ 2016-11-14 18:08 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: axboe, linux-block
In-Reply-To: <20161114180503.GA31126@infradead.org>

On 11/14/2016 11:05 AM, Christoph Hellwig wrote:
> On Mon, Nov 14, 2016 at 11:02:47AM -0700, Jens Axboe wrote:
>>> We need it unless we want unbounded allocations for the biovec.  With a
>>> 1GB I/O we're at a page size allocation, and with 64MB I/Os that aren't
>>> unheard of we'd be up to a 64 pages or an order 6 allocation which will
>>> take down the VM.  We also need to pin down all the user memory while
>>> doing the I/O instead of having throttling on the bio mempool before
>>> doing the get_user_pages.
>>
>> Just add the iterator and loop for every X pages? We can even put a plug
>> around it, if we have to.
>
> That's pretty much what my patch does..

It'd be cleaner to loop one level out, and avoid all that 'dio' stuff
instead. And then still retain the separate parts of the sync and async.
There's nothing to share there imho, and it just makes the code harder
to read.

-- 
Jens Axboe

^ permalink raw reply

* [PATCH RFC 3/2] ARM: improve arch_irq_work_has_interrupt()
From: Russell King - ARM Linux @ 2016-11-14 18:07 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <2e14b943-e3a5-6993-48c7-68200c8b08a2@arm.com>

On Mon, Nov 14, 2016 at 04:30:57PM +0000, Marc Zyngier wrote:
> diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h
> index 3d6dc8b..45612d2 100644
> --- a/arch/arm/include/asm/smp.h
> +++ b/arch/arm/include/asm/smp.h
> @@ -48,6 +48,16 @@ extern void smp_init_cpus(void);
>   */
>  extern void set_smp_cross_call(void (*)(const struct cpumask *, unsigned int));
>  
> +#ifdef CONFIG_SMP
> +#define setup_smp_ipi(f,i)			\
> +	do {					\
> +		set_smp_cross_call(f);		\
> +		irq_controller_can_ipi = (i);	\
> +	} while(0)
> +#else
> +#define setup_smp_ipi(f,i)	do { } while (0)
> +#endif
> +
>  /*
>   * Called from platform specific assembly code, this is the
>   * secondary CPU entry point.
> 
> with the similar entry point for arm64?

Note that asm/smp.h is not included if CONFIG_SMP is not set, so it's
not that easy.

Both ARM64 and ARM have asm/smp_plat.h which contains the platform
specifics of SMP, which is where set_smp_cross_call() really should
be anyway, and the GIC code already includes this.  So I'm moving
set_smp_cross_call() there for both arches.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply

* Re: Announcing btrfs-dedupe
From: Zygo Blaxell @ 2016-11-14 18:07 UTC (permalink / raw)
  To: James Pharaoh; +Cc: Mark Fasheh, linux-btrfs
In-Reply-To: <345b3aa4-6644-6730-09dd-549d320f58cb@wellbehavedsoftware.com>

[-- Attachment #1: Type: text/plain, Size: 4115 bytes --]

On Mon, Nov 07, 2016 at 07:49:51PM +0100, James Pharaoh wrote:
> Annoyingly I can't find this now, but I definitely remember reading someone,
> apparently someone knowledgable, claim that the latest version of the kernel
> which I was using at the time, still suffered from issues regarding the
> dedupe code.

> This was a while ago, and I would be very pleased to hear that there is high
> confidence in the current implementation! I'll post a link if I manage to
> find the comments.

I've been running the btrfs dedup ioctl 7 times per second on average
over 42TB of test data for most of a year (and at a lower rate for two
years).  I have not found any data corruptions due to _dedup_.  I did find
three distinct data corruption kernel bugs unrelated to dedup, and two
test machines with bad RAM, so I'm pretty sure my corruption detection
is working.

That said, I wouldn't run dedup on a kernel older than 4.4.  LTS kernels
might be OK too, but only if they're up to date with backported btrfs
fixes.

Kernels older than 3.13 lack the FILE_EXTENT_SAME ioctl and can
only deduplicate static data (i.e. data you are certain is not being
concurrently modified).  Before 3.12 there are so many bugs you might
as well not bother.

Older kernels are bad for dedup because of non-corruption reasons.
Between 3.13 and 4.4, the following bugs were fixed:

	- false-negative capability checks (e.g. same-inode, EOF extent)
	reduce dedup efficiency

	- ctime updates (older versions would update ctime when a file was
	deduped) mess with incremental backup tools, build systems, etc.

	- kernel memory leaks (self-explanatory)

	- multiple kernel hang/panic bugs (e.g. a deadlock if two threads
	try to read the same extent at the same time, and at least one
	of those threads is dedup; and there was some race condition
	leading to invalid memory access on dedup's comparison reads)
	which won't eat your data, but they might ruin your day anyway.

There is also a still-unresolved problem where the filesystem CPU usage
rises exponentially for some operations depending on the number of shared
references to an extent.  Files which contain blocks with more than a few
thousand shared references can trigger this problem.  A file over 1TB can
keep the kernel busy at 100% CPU for over 40 minutes at a time.

There might also be a correlation between delalloc data and hangs in
extent-same, but I have NOT been able to confirm this.  All I know
at this point is that doing a fsync() on the source FD just before
doing the extent-same ioctl dramatically reduces filesystem hang rates:
several weeks between hangs (or no hangs at all) with fsync, vs. 18 hours
or less without.

> James
> 
> On 07/11/16 18:59, Mark Fasheh wrote:
> >Hi James,
> >
> >Re the following text on your project page:
> >
> >"IMPORTANT CAVEAT — I have read that there are race and/or error
> >conditions which can cause filesystem corruption in the kernel
> >implementation of the deduplication ioctl."
> >
> >Can you expound on that? I'm not aware of any bugs right now but if
> >there is any it'd absolutely be worth having that info on the btrfs
> >list.
> >
> >Thanks,
> >    --Mark
> >
> >
> >On Sun, Nov 6, 2016 at 7:30 AM, James Pharaoh
> ><james@wellbehavedsoftware.com> wrote:
> >>Hi all,
> >>
> >>I'm pleased to announce my btrfs deduplication utility, written in Rust.
> >>This operates on whole files, is fast, and I believe complements the
> >>existing utilities (duperemove, bedup), which exist currently.
> >>
> >>Please visit the homepage for more information:
> >>
> >>http://btrfs-dedupe.com
> >>
> >>James Pharaoh
> >>--
> >>To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> >>the body of a message to majordomo@vger.kernel.org
> >>More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply

* [Buildroot] [PATCH v2] config: bump U-Boot to 2016.11 in synopsys defconfigs
From: Vlad Zakharov @ 2016-11-14 18:07 UTC (permalink / raw)
  To: buildroot

With this commit we upgrade U-Boot version to 2016.11
in "snps_axs101_defconfig" and "snps_axs103_defconfig".

Important fixes: new version fixes U-Boot build for arc700.
Since gcc-6.x "-marc700" option is no longer supported,
"-mcpu=arc700" should be used instead.

We haven't sent it before as we were waiting for U-Boot
2016.11 release.

Signed-off-by: Vlad Zakharov <vzakhar@synopsys.com>
---
Changes v1..v2
 - Replace 2016.11-rc3 release candidate with 2016.11 release version

 configs/snps_axs101_defconfig | 2 +-
 configs/snps_axs103_defconfig | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/configs/snps_axs101_defconfig b/configs/snps_axs101_defconfig
index f272853..dbc5003 100644
--- a/configs/snps_axs101_defconfig
+++ b/configs/snps_axs101_defconfig
@@ -21,6 +21,6 @@ BR2_LINUX_KERNEL_DEFCONFIG="axs101"
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION=y
-BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2016.07"
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2016.11"
 BR2_TARGET_UBOOT_BOARD_DEFCONFIG="axs101"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
diff --git a/configs/snps_axs103_defconfig b/configs/snps_axs103_defconfig
index 75596c9..93a62b2 100644
--- a/configs/snps_axs103_defconfig
+++ b/configs/snps_axs103_defconfig
@@ -22,6 +22,6 @@ BR2_LINUX_KERNEL_DEFCONFIG="axs103_smp"
 BR2_TARGET_UBOOT=y
 BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y
 BR2_TARGET_UBOOT_CUSTOM_VERSION=y
-BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2016.07"
+BR2_TARGET_UBOOT_CUSTOM_VERSION_VALUE="2016.11"
 BR2_TARGET_UBOOT_BOARD_DEFCONFIG="axs103"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
-- 
2.6.3

^ permalink raw reply related

* [PATCH v3 01/11] powerpc: Add #defs for paca->soft_enabled flags
From: Madhavan Srinivasan @ 2016-11-14 18:04 UTC (permalink / raw)
  To: mpe, benh; +Cc: anton, paulus, npiggin, linuxppc-dev, Madhavan Srinivasan
In-Reply-To: <1479146692-15726-1-git-send-email-maddy@linux.vnet.ibm.com>

Two #defs IRQ_DISABLE_LEVEL_NONE and IRQ_DISABLE_LEVEL_LINUX
are added to be used when updating paca->soft_enabled.
Replace the hardcoded values used when updating
paca->soft_enabled with IRQ_DISABLE_MASK_* #def.
No logic change.

Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
---
 arch/powerpc/include/asm/exception-64s.h |  2 +-
 arch/powerpc/include/asm/hw_irq.h        | 21 ++++++++++++++-------
 arch/powerpc/include/asm/irqflags.h      |  6 +++---
 arch/powerpc/include/asm/kvm_ppc.h       |  2 +-
 arch/powerpc/kernel/entry_64.S           | 16 ++++++++--------
 arch/powerpc/kernel/exceptions-64e.S     |  6 +++---
 arch/powerpc/kernel/head_64.S            |  5 +++--
 arch/powerpc/kernel/idle_book3e.S        |  3 ++-
 arch/powerpc/kernel/idle_power4.S        |  3 ++-
 arch/powerpc/kernel/irq.c                |  9 +++++----
 arch/powerpc/kernel/process.c            |  3 ++-
 arch/powerpc/kernel/setup_64.c           |  3 +++
 arch/powerpc/kernel/time.c               |  2 +-
 arch/powerpc/mm/hugetlbpage.c            |  2 +-
 arch/powerpc/perf/core-book3s.c          |  2 +-
 15 files changed, 50 insertions(+), 35 deletions(-)

diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h
index 84d49b197c32..53ba672fe9dc 100644
--- a/arch/powerpc/include/asm/exception-64s.h
+++ b/arch/powerpc/include/asm/exception-64s.h
@@ -403,7 +403,7 @@ END_FTR_SECTION_NESTED(ftr,ftr,943)
 
 #define __SOFTEN_TEST(h, vec)						\
 	lbz	r10,PACASOFTIRQEN(r13);					\
-	cmpwi	r10,0;							\
+	cmpwi	r10,IRQ_DISABLE_MASK_LINUX;				\
 	li	r10,SOFTEN_VALUE_##vec;					\
 	beq	masked_##h##interrupt
 
diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h
index eba60416536e..05b81bca15e9 100644
--- a/arch/powerpc/include/asm/hw_irq.h
+++ b/arch/powerpc/include/asm/hw_irq.h
@@ -27,6 +27,12 @@
 #define PACA_IRQ_EE_EDGE	0x10 /* BookE only */
 #define PACA_IRQ_HMI		0x20
 
+/*
+ * flags for paca->soft_enabled
+ */
+#define IRQ_DISABLE_MASK_NONE	1
+#define IRQ_DISABLE_MASK_LINUX	0
+
 #endif /* CONFIG_PPC64 */
 
 #ifndef __ASSEMBLY__
@@ -58,9 +64,10 @@ static inline unsigned long arch_local_irq_disable(void)
 	unsigned long flags, zero;
 
 	asm volatile(
-		"li %1,0; lbz %0,%2(13); stb %1,%2(13)"
+		"li %1,%3; lbz %0,%2(13); stb %1,%2(13)"
 		: "=r" (flags), "=&r" (zero)
-		: "i" (offsetof(struct paca_struct, soft_enabled))
+		: "i" (offsetof(struct paca_struct, soft_enabled)),\
+		  "i" (IRQ_DISABLE_MASK_LINUX)
 		: "memory");
 
 	return flags;
@@ -70,7 +77,7 @@ extern void arch_local_irq_restore(unsigned long);
 
 static inline void arch_local_irq_enable(void)
 {
-	arch_local_irq_restore(1);
+	arch_local_irq_restore(IRQ_DISABLE_MASK_NONE);
 }
 
 static inline unsigned long arch_local_irq_save(void)
@@ -80,7 +87,7 @@ static inline unsigned long arch_local_irq_save(void)
 
 static inline bool arch_irqs_disabled_flags(unsigned long flags)
 {
-	return flags == 0;
+	return flags == IRQ_DISABLE_MASK_LINUX;
 }
 
 static inline bool arch_irqs_disabled(void)
@@ -100,9 +107,9 @@ static inline bool arch_irqs_disabled(void)
 	u8 _was_enabled;				\
 	__hard_irq_disable();				\
 	_was_enabled = local_paca->soft_enabled;	\
-	local_paca->soft_enabled = 0;			\
+	local_paca->soft_enabled = IRQ_DISABLE_MASK_LINUX;\
 	local_paca->irq_happened |= PACA_IRQ_HARD_DIS;	\
-	if (_was_enabled)				\
+	if (_was_enabled == IRQ_DISABLE_MASK_NONE)	\
 		trace_hardirqs_off();			\
 } while(0)
 
@@ -125,7 +132,7 @@ static inline void may_hard_irq_enable(void)
 
 static inline bool arch_irq_disabled_regs(struct pt_regs *regs)
 {
-	return !regs->softe;
+	return (regs->softe == IRQ_DISABLE_MASK_LINUX);
 }
 
 extern bool prep_irq_for_idle(void);
diff --git a/arch/powerpc/include/asm/irqflags.h b/arch/powerpc/include/asm/irqflags.h
index f2149066fe5d..d0ed2a7d7d10 100644
--- a/arch/powerpc/include/asm/irqflags.h
+++ b/arch/powerpc/include/asm/irqflags.h
@@ -48,8 +48,8 @@
 #define RECONCILE_IRQ_STATE(__rA, __rB)		\
 	lbz	__rA,PACASOFTIRQEN(r13);	\
 	lbz	__rB,PACAIRQHAPPENED(r13);	\
-	cmpwi	cr0,__rA,0;			\
-	li	__rA,0;				\
+	cmpwi	cr0,__rA,IRQ_DISABLE_MASK_LINUX;\
+	li	__rA,IRQ_DISABLE_MASK_LINUX;	\
 	ori	__rB,__rB,PACA_IRQ_HARD_DIS;	\
 	stb	__rB,PACAIRQHAPPENED(r13);	\
 	beq	44f;				\
@@ -63,7 +63,7 @@
 
 #define RECONCILE_IRQ_STATE(__rA, __rB)		\
 	lbz	__rA,PACAIRQHAPPENED(r13);	\
-	li	__rB,0;				\
+	li	__rB,IRQ_DISABLE_MASK_LINUX;	\
 	ori	__rA,__rA,PACA_IRQ_HARD_DIS;	\
 	stb	__rB,PACASOFTIRQEN(r13);	\
 	stb	__rA,PACAIRQHAPPENED(r13)
diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h
index f6e49640dbe1..7d8d2b40c6a8 100644
--- a/arch/powerpc/include/asm/kvm_ppc.h
+++ b/arch/powerpc/include/asm/kvm_ppc.h
@@ -735,7 +735,7 @@ static inline void kvmppc_fix_ee_before_entry(void)
 
 	/* Only need to enable IRQs by hard enabling them after this */
 	local_paca->irq_happened = 0;
-	local_paca->soft_enabled = 1;
+	local_paca->soft_enabled = IRQ_DISABLE_MASK_NONE;
 #endif
 }
 
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 6432d4bf08c8..8e347ffca14e 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -132,7 +132,7 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR)
 	 */
 #if defined(CONFIG_TRACE_IRQFLAGS) && defined(CONFIG_BUG)
 	lbz	r10,PACASOFTIRQEN(r13)
-	xori	r10,r10,1
+	xori	r10,r10,IRQ_DISABLE_MASK_NONE
 1:	tdnei	r10,0
 	EMIT_BUG_ENTRY 1b,__FILE__,__LINE__,BUGFLAG_WARNING
 #endif
@@ -148,7 +148,7 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR)
 	/* We do need to set SOFTE in the stack frame or the return
 	 * from interrupt will be painful
 	 */
-	li	r10,1
+	li	r10,IRQ_DISABLE_MASK_NONE
 	std	r10,SOFTE(r1)
 
 	CURRENT_THREAD_INFO(r11, r1)
@@ -724,7 +724,7 @@ resume_kernel:
 	lwz	r8,TI_PREEMPT(r9)
 	cmpwi	cr1,r8,0
 	ld	r0,SOFTE(r1)
-	cmpdi	r0,0
+	cmpdi	r0,IRQ_DISABLE_MASK_LINUX
 	crandc	eq,cr1*4+eq,eq
 	bne	restore
 
@@ -764,11 +764,11 @@ restore:
 	 */
 	ld	r5,SOFTE(r1)
 	lbz	r6,PACASOFTIRQEN(r13)
-	cmpwi	cr0,r5,0
+	cmpwi	cr0,r5,IRQ_DISABLE_MASK_LINUX
 	beq	restore_irq_off
 
 	/* We are enabling, were we already enabled ? Yes, just return */
-	cmpwi	cr0,r6,1
+	cmpwi	cr0,r6,IRQ_DISABLE_MASK_NONE
 	beq	cr0,do_restore
 
 	/*
@@ -787,7 +787,7 @@ restore:
 	 */
 restore_no_replay:
 	TRACE_ENABLE_INTS
-	li	r0,1
+	li	r0,IRQ_DISABLE_MASK_NONE
 	stb	r0,PACASOFTIRQEN(r13);
 
 	/*
@@ -892,7 +892,7 @@ restore_irq_off:
 	beq	1f
 	rlwinm	r7,r7,0,~PACA_IRQ_HARD_DIS
 	stb	r7,PACAIRQHAPPENED(r13)
-1:	li	r0,0
+1:	li	r0,IRQ_DISABLE_MASK_LINUX
 	stb	r0,PACASOFTIRQEN(r13);
 	TRACE_DISABLE_INTS
 	b	do_restore
@@ -1010,7 +1010,7 @@ _GLOBAL(enter_rtas)
 	 * check it with the asm equivalent of WARN_ON
 	 */
 	lbz	r0,PACASOFTIRQEN(r13)
-1:	tdnei	r0,0
+1:	tdnei	r0,IRQ_DISABLE_MASK_LINUX
 	EMIT_BUG_ENTRY 1b,__FILE__,__LINE__,BUGFLAG_WARNING
 #endif
 	
diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S
index 38a1f96430e1..a39226c502c5 100644
--- a/arch/powerpc/kernel/exceptions-64e.S
+++ b/arch/powerpc/kernel/exceptions-64e.S
@@ -210,9 +210,9 @@ END_FTR_SECTION_IFSET(CPU_FTR_EMB_HV)
 	ld	r5,SOFTE(r1)
 
 	/* Interrupts had better not already be enabled... */
-	twnei	r6,0
+	twnei	r6,IRQ_DISABLE_MASK_LINUX
 
-	cmpwi	cr0,r5,0
+	cmpwi	cr0,r5,IRQ_DISABLE_MASK_LINUX
 	beq	1f
 
 	TRACE_ENABLE_INTS
@@ -352,7 +352,7 @@ ret_from_mc_except:
 
 #define PROLOG_ADDITION_MASKABLE_GEN(n)					    \
 	lbz	r10,PACASOFTIRQEN(r13); /* are irqs soft-disabled ? */	    \
-	cmpwi	cr0,r10,0;		/* yes -> go out of line */	    \
+	cmpwi	cr0,r10,IRQ_DISABLE_MASK_LINUX;	/* yes -> go out of line */ \
 	beq	masked_interrupt_book3e_##n
 
 #define PROLOG_ADDITION_2REGS_GEN(n)					    \
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 04c546e20cc0..9bc378e680b5 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -752,7 +752,7 @@ _GLOBAL(pmac_secondary_start)
 	/* Mark interrupts soft and hard disabled (they might be enabled
 	 * in the PACA when doing hotplug)
 	 */
-	li	r0,0
+	li	r0,IRQ_DISABLE_MASK_LINUX
 	stb	r0,PACASOFTIRQEN(r13)
 	li	r0,PACA_IRQ_HARD_DIS
 	stb	r0,PACAIRQHAPPENED(r13)
@@ -809,6 +809,7 @@ __secondary_start:
 	/* Mark interrupts soft and hard disabled (they might be enabled
 	 * in the PACA when doing hotplug)
 	 */
+	li	r7,IRQ_DISABLE_MASK_LINUX
 	stb	r7,PACASOFTIRQEN(r13)
 	li	r0,PACA_IRQ_HARD_DIS
 	stb	r0,PACAIRQHAPPENED(r13)
@@ -974,7 +975,7 @@ start_here_common:
 	/* Mark interrupts soft and hard disabled (they might be enabled
 	 * in the PACA when doing hotplug)
 	 */
-	li	r0,0
+	li	r0,IRQ_DISABLE_MASK_LINUX
 	stb	r0,PACASOFTIRQEN(r13)
 	li	r0,PACA_IRQ_HARD_DIS
 	stb	r0,PACAIRQHAPPENED(r13)
diff --git a/arch/powerpc/kernel/idle_book3e.S b/arch/powerpc/kernel/idle_book3e.S
index 48c21acef915..a459c306b04e 100644
--- a/arch/powerpc/kernel/idle_book3e.S
+++ b/arch/powerpc/kernel/idle_book3e.S
@@ -17,6 +17,7 @@
 #include <asm/processor.h>
 #include <asm/thread_info.h>
 #include <asm/epapr_hcalls.h>
+#include <asm/hw_irq.h>
 
 /* 64-bit version only for now */
 #ifdef CONFIG_PPC64
@@ -46,7 +47,7 @@ _GLOBAL(\name)
 	bl	trace_hardirqs_on
 	addi    r1,r1,128
 #endif
-	li	r0,1
+	li	r0,IRQ_DISABLE_MASK_NONE
 	stb	r0,PACASOFTIRQEN(r13)
 	
 	/* Interrupts will make use return to LR, so get something we want
diff --git a/arch/powerpc/kernel/idle_power4.S b/arch/powerpc/kernel/idle_power4.S
index f57a19348bdd..785e10619d8d 100644
--- a/arch/powerpc/kernel/idle_power4.S
+++ b/arch/powerpc/kernel/idle_power4.S
@@ -15,6 +15,7 @@
 #include <asm/ppc_asm.h>
 #include <asm/asm-offsets.h>
 #include <asm/irqflags.h>
+#include <asm/hw_irq.h>
 
 #undef DEBUG
 
@@ -53,7 +54,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_CAN_NAP)
 	mfmsr	r7
 #endif /* CONFIG_TRACE_IRQFLAGS */
 
-	li	r0,1
+	li	r0,IRQ_DISABLE_MASK_NONE
 	stb	r0,PACASOFTIRQEN(r13)	/* we'll hard-enable shortly */
 BEGIN_FTR_SECTION
 	DSSALL
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 3c05c311e35e..c6f1e13ff441 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -68,6 +68,7 @@
 #include <asm/debug.h>
 #include <asm/livepatch.h>
 #include <asm/asm-prototypes.h>
+#include <asm/hw_irq.h>
 
 #ifdef CONFIG_PPC64
 #include <asm/paca.h>
@@ -213,7 +214,7 @@ notrace void arch_local_irq_restore(unsigned long en)
 
 	/* Write the new soft-enabled value */
 	set_soft_enabled(en);
-	if (!en)
+	if (en == IRQ_DISABLE_MASK_LINUX)
 		return;
 	/*
 	 * From this point onward, we can take interrupts, preempt,
@@ -258,7 +259,7 @@ notrace void arch_local_irq_restore(unsigned long en)
 	}
 #endif /* CONFIG_TRACE_IRQFLAGS */
 
-	set_soft_enabled(0);
+	set_soft_enabled(IRQ_DISABLE_MASK_LINUX);
 
 	/*
 	 * Check if anything needs to be re-emitted. We haven't
@@ -268,7 +269,7 @@ notrace void arch_local_irq_restore(unsigned long en)
 	replay = __check_irq_replay();
 
 	/* We can soft-enable now */
-	set_soft_enabled(1);
+	set_soft_enabled(IRQ_DISABLE_MASK_NONE);
 
 	/*
 	 * And replay if we have to. This will return with interrupts
@@ -342,7 +343,7 @@ bool prep_irq_for_idle(void)
 	 * of entering the low power state.
 	 */
 	local_paca->irq_happened &= ~PACA_IRQ_HARD_DIS;
-	local_paca->soft_enabled = 1;
+	local_paca->soft_enabled = IRQ_DISABLE_MASK_NONE;
 
 	/* Tell the caller to enter the low power state */
 	return true;
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index ce6dc61b15b2..28b85d884688 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -54,6 +54,7 @@
 #include <asm/debug.h>
 #ifdef CONFIG_PPC64
 #include <asm/firmware.h>
+#include <asm/hw_irq.h>
 #endif
 #include <asm/code-patching.h>
 #include <asm/exec.h>
@@ -1474,7 +1475,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 			childregs->gpr[14] = ppc_function_entry((void *)usp);
 #ifdef CONFIG_PPC64
 		clear_tsk_thread_flag(p, TIF_32BIT);
-		childregs->softe = 1;
+		childregs->softe = IRQ_DISABLE_MASK_NONE;
 #endif
 		childregs->gpr[15] = kthread_arg;
 		p->thread.regs = NULL;	/* no user register state */
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 7ac8e6eaab5b..f31930b9bfc1 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -67,6 +67,7 @@
 #include <asm/livepatch.h>
 #include <asm/opal.h>
 #include <asm/cputhreads.h>
+#include <asm/hw_irq.h>
 
 #ifdef DEBUG
 #define DBG(fmt...) udbg_printf(fmt)
@@ -195,6 +196,8 @@ static void __init fixup_boot_paca(void)
 	get_paca()->cpu_start = 1;
 	/* Allow percpu accesses to work until we setup percpu data */
 	get_paca()->data_offset = 0;
+	/* Mark interrupts disabled in PACA */
+	get_paca()->soft_enabled = IRQ_DISABLE_MASK_LINUX;
 }
 
 static void __init configure_exceptions(void)
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index bc3f7d0d7b79..334144e300ca 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -269,7 +269,7 @@ void accumulate_stolen_time(void)
 	 * needs to reflect that so various debug stuff doesn't
 	 * complain
 	 */
-	local_paca->soft_enabled = 0;
+	local_paca->soft_enabled = IRQ_DISABLE_MASK_LINUX;
 
 	sst = scan_dispatch_log(acct->starttime_user);
 	ust = scan_dispatch_log(acct->starttime);
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index a5d3ecdabc44..441fdfbb9990 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -914,7 +914,7 @@ void flush_dcache_icache_hugepage(struct page *page)
  * So long as we atomically load page table pointers we are safe against teardown,
  * we can follow the address down to the the page and take a ref on it.
  * This function need to be called with interrupts disabled. We use this variant
- * when we have MSR[EE] = 0 but the paca->soft_enabled = 1
+ * when we have MSR[EE] = 0 but the paca->soft_enabled = IRQ_DISABLE_MASK_NONE
  */
 
 pte_t *__find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea,
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index 72c27b8d2cf3..a0861a8311c7 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -313,7 +313,7 @@ static inline void perf_read_regs(struct pt_regs *regs)
  */
 static inline int perf_intr_is_nmi(struct pt_regs *regs)
 {
-	return !regs->softe;
+	return (regs->softe == IRQ_DISABLE_MASK_LINUX);
 }
 
 /*
-- 
2.7.4

^ permalink raw reply related

* [PATCH v3 06/11] powerpc: Avoid using EXCEPTION_PROLOG_1 macro in MASKABLE_*
From: Madhavan Srinivasan @ 2016-11-14 18:04 UTC (permalink / raw)
  To: mpe, benh; +Cc: anton, paulus, npiggin, linuxppc-dev, Madhavan Srinivasan
In-Reply-To: <1479146692-15726-1-git-send-email-maddy@linux.vnet.ibm.com>

Currently we use both EXCEPTION_PROLOG_1 and __EXCEPTION_PROLOG_1
in the MASKABLE_* macros. As a cleanup, this patch makes MASKABLE_*
to use only __EXCEPTION_PROLOG_1. There is not logic change.

Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
---
 arch/powerpc/include/asm/exception-64s.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h
index 53ba672fe9dc..bcd5a7f7dafe 100644
--- a/arch/powerpc/include/asm/exception-64s.h
+++ b/arch/powerpc/include/asm/exception-64s.h
@@ -440,7 +440,7 @@ END_FTR_SECTION_NESTED(ftr,ftr,943)
 				    EXC_STD, SOFTEN_TEST_PR)
 
 #define MASKABLE_EXCEPTION_PSERIES_OOL(vec, label)			\
-	EXCEPTION_PROLOG_1(PACA_EXGEN, SOFTEN_TEST_PR, vec);		\
+	__EXCEPTION_PROLOG_1(PACA_EXGEN, SOFTEN_TEST_PR, vec);		\
 	EXCEPTION_PROLOG_PSERIES_1(label, EXC_STD)
 
 #define MASKABLE_EXCEPTION_HV(loc, vec, label)				\
@@ -448,7 +448,7 @@ END_FTR_SECTION_NESTED(ftr,ftr,943)
 				    EXC_HV, SOFTEN_TEST_HV)
 
 #define MASKABLE_EXCEPTION_HV_OOL(vec, label)				\
-	EXCEPTION_PROLOG_1(PACA_EXGEN, SOFTEN_TEST_HV, vec);		\
+	__EXCEPTION_PROLOG_1(PACA_EXGEN, SOFTEN_TEST_HV, vec);		\
 	EXCEPTION_PROLOG_PSERIES_1(label, EXC_HV)
 
 #define __MASKABLE_RELON_EXCEPTION_PSERIES(vec, label, h, extra)	\
@@ -469,7 +469,7 @@ END_FTR_SECTION_NESTED(ftr,ftr,943)
 					  EXC_HV, SOFTEN_NOTEST_HV)
 
 #define MASKABLE_RELON_EXCEPTION_HV_OOL(vec, label)			\
-	EXCEPTION_PROLOG_1(PACA_EXGEN, SOFTEN_NOTEST_HV, vec);		\
+	__EXCEPTION_PROLOG_1(PACA_EXGEN, SOFTEN_NOTEST_HV, vec);	\
 	EXCEPTION_PROLOG_PSERIES_1(label, EXC_HV)
 
 /*
-- 
2.7.4

^ permalink raw reply related

* [PATCH v3 04/11] powerpc: Add soft_enabled manipulation functions
From: Madhavan Srinivasan @ 2016-11-14 18:04 UTC (permalink / raw)
  To: mpe, benh; +Cc: anton, paulus, npiggin, linuxppc-dev, Madhavan Srinivasan
In-Reply-To: <1479146692-15726-1-git-send-email-maddy@linux.vnet.ibm.com>

Add new soft_enabled_* manipulation function and implement
arch_local_* using the soft_enabled_* wrappers.

Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
---
 arch/powerpc/include/asm/hw_irq.h | 32 ++++++++++++++------------------
 1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h
index 88f6a8e2b5e3..c292ef4b4bc5 100644
--- a/arch/powerpc/include/asm/hw_irq.h
+++ b/arch/powerpc/include/asm/hw_irq.h
@@ -62,21 +62,7 @@ static inline notrace void soft_enabled_set(unsigned long enable)
 	: "memory");
 }
 
-static inline notrace unsigned long soft_enabled_set_return(unsigned long enable)
-{
-	unsigned long flags;
-
-	asm volatile(
-		"lbz %0,%1(13); stb %2,%1(13)"
-		: "=r" (flags)
-		: "i" (offsetof(struct paca_struct, soft_enabled)),\
-		  "r" (enable)
-		: "memory");
-
-	return flags;
-}
-
-static inline unsigned long arch_local_save_flags(void)
+static inline notrace unsigned long soft_enabled_return(void)
 {
 	unsigned long flags;
 
@@ -88,20 +74,30 @@ static inline unsigned long arch_local_save_flags(void)
 	return flags;
 }
 
-static inline unsigned long arch_local_irq_disable(void)
+static inline notrace unsigned long soft_enabled_set_return(unsigned long enable)
 {
 	unsigned long flags, zero;
 
 	asm volatile(
-		"li %1,%3; lbz %0,%2(13); stb %1,%2(13)"
+		"mr %1,%3; lbz %0,%2(13); stb %1,%2(13)"
 		: "=r" (flags), "=&r" (zero)
 		: "i" (offsetof(struct paca_struct, soft_enabled)),\
-		  "i" (IRQ_DISABLE_MASK_LINUX)
+		  "r" (enable)
 		: "memory");
 
 	return flags;
 }
 
+static inline unsigned long arch_local_save_flags(void)
+{
+	return soft_enabled_return();
+}
+
+static inline unsigned long arch_local_irq_disable(void)
+{
+	return soft_enabled_set_return(IRQ_DISABLE_MASK_LINUX);
+}
+
 extern void arch_local_irq_restore(unsigned long);
 
 static inline void arch_local_irq_enable(void)
-- 
2.7.4

^ permalink raw reply related


This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.