Re: [PATCH 09/21] riscv: dma-mapping: skip invalidation before bidirectional DMA

2023-05-04 Thread Guo Ren
On Mon, Mar 27, 2023 at 8:15 PM Arnd Bergmann wrote: > > From: Arnd Bergmann > > For a DMA_BIDIRECTIONAL transfer, the caches have to be cleaned > first to let the device see data written by the CPU, and invalidated > after the transfer to let the CPU see data written by the device. > > riscv

Re: [PASEMI NEMO] Boot issue with the PowerPC updates 6.4-1

2023-05-04 Thread Christian Zigotzky
On 03 May 2023 at 08:15 pm, Rob Herring wrote: On Wed, May 3, 2023 at 12:40 PM Christian Zigotzky wrote: On 3. May 2023, at 18:51, Rob Herring wrote: On Wed, May 3, 2023 at 11:27 AM Christophe Leroy wrote: +Rob as he's the commit's Author. Le 03/05/2023 à 17:46, Christian Zigotzky a

[PATCH] mm: kfence: Fix false positives on big endian

2023-05-04 Thread Michael Ellerman
Since commit 1ba3cbf3ec3b ("mm: kfence: improve the performance of __kfence_alloc() and __kfence_free()"), kfence reports failures in random places at boot on big endian machines. The problem is that the new KFENCE_CANARY_PATTERN_U64 encodes the address of each byte in its value, so it needs to

Re: [PATCH v4 11/17] watchdog/hardlockup: Rename some "NMI watchdog" constants/function

2023-05-04 Thread Nicholas Piggin
On Fri May 5, 2023 at 8:13 AM AEST, Douglas Anderson wrote: > Do a search and replace of: > - NMI_WATCHDOG_ENABLED => HARD_WATCHDOG_ENABLED > - watchdog_nmi_ => watchdog_hardlockup_ These are just making prefixes inconsistent again. If you really want to do a prefix, I would call it hardlockup

Re: [PATCH v4 08/17] watchdog/hardlockup: Style changes to watchdog_hardlockup_check() / ..._is_lockedup()

2023-05-04 Thread Nicholas Piggin
On Fri May 5, 2023 at 8:13 AM AEST, Douglas Anderson wrote: > These are tiny style changes: > - Add a blank line before a "return". > - Renames two globals to use the "watchdog_hld" prefix. Particularly static ones don't really need the namespace prefixes. Not sure if processed is better than

Re: [PATCH v4 07/17] watchdog/hardlockup: Move perf hardlockup checking/panic to common watchdog.c

2023-05-04 Thread Nicholas Piggin
On Fri May 5, 2023 at 8:13 AM AEST, Douglas Anderson wrote: > The perf hardlockup detector works by looking at interrupt counts and > seeing if they change from run to run. The interrupt counts are > managed by the common watchdog code via its watchdog_timer_fn(). > > Currently the API between the

Re: [PATCH v4 06/17] watchdog/perf: Rename watchdog_hld.c to watchdog_perf.c

2023-05-04 Thread Nicholas Piggin
On Fri May 5, 2023 at 8:13 AM AEST, Douglas Anderson wrote: > The code currently in "watchdog_hld.c" is for detecting hardlockups > using perf, as evidenced by the line in the Makefile that only > compiles this file if CONFIG_HARDLOCKUP_DETECTOR_PERF is > defined. Rename the file to prepare for

Re: [PATCH v4 05/17] watchdog/hardlockup: Rename touch_nmi_watchdog() to touch_hardlockup_watchdog()

2023-05-04 Thread Nicholas Piggin
On Fri May 5, 2023 at 8:13 AM AEST, Douglas Anderson wrote: > In preparation for the buddy hardlockup detector, rename > touch_nmi_watchdog() to touch_hardlockup_watchdog() to make it clear > that it will touch whatever hardlockup detector is configured. We'll > add a #define for the old name

Re: [PATCH v4 03/17] watchdog/hardlockup: change watchdog_nmi_enable() to void

2023-05-04 Thread Nicholas Piggin
On Fri May 5, 2023 at 8:13 AM AEST, Douglas Anderson wrote: > From: Lecopzer Chen > > Nobody cares about the return value of watchdog_nmi_enable(), > changing its prototype to void. > Acked-by: Nicholas Piggin > Signed-off-by: Pingfan Liu > Signed-off-by: Lecopzer Chen > Reviewed-by: Petr

Re: [PATCH v4 01/17] watchdog/perf: Define dummy watchdog_update_hrtimer_threshold() on correct config

2023-05-04 Thread Nicholas Piggin
On Fri May 5, 2023 at 8:13 AM AEST, Douglas Anderson wrote: > The real watchdog_update_hrtimer_threshold() is defined in > watchdog_hardlockup_perf.c. That file is included if In kernel/watchdog_hld.c. > CONFIG_HARDLOCKUP_DETECTOR_PERF and the function is defined in that > file if

Re: [PATCH v4 13/17] watchdog/hardlockup: detect hard lockups using secondary (buddy) CPUs

2023-05-04 Thread Nicholas Piggin
On Fri May 5, 2023 at 8:13 AM AEST, Douglas Anderson wrote: > From: Colin Cross > > Implement a hardlockup detector that doesn't doesn't need any extra > arch-specific support code to detect lockups. Instead of using > something arch-specific we will use the buddy system, where each CPU > watches

Re: [PATCH v2] powerpc/iommu: DMA address offset is incorrectly calculated with 2MB TCEs

2023-05-04 Thread Michael Ellerman
Gaurav Batra writes: > Hello Michael, > > I agree with your concerns regarding a device been able to access memory > that doesn't belong to it. That exposure we have today with 2MB TCEs. > With 2MB TCEs, DMA window size will be big enough, for dedicated > adapters, that whole memory is going

Re: [PATCH v8 2/7] PCI: Export PCI link retrain timeout

2023-05-04 Thread Bjorn Helgaas
On Thu, Apr 06, 2023 at 01:21:09AM +0100, Maciej W. Rozycki wrote: > Rename LINK_RETRAIN_TIMEOUT to PCIE_LINK_RETRAIN_TIMEOUT and make it > available via "pci.h" for PCI drivers to use. > +#define PCIE_LINK_RETRAIN_TIMEOUT HZ This is basically just a rename and move, but since we're touching it

Re: [PATCH v8 7/7] PCI: Work around PCIe link training failures

2023-05-04 Thread Bjorn Helgaas
On Thu, Apr 06, 2023 at 01:21:31AM +0100, Maciej W. Rozycki wrote: > Attempt to handle cases such as with a downstream port of the ASMedia > ASM2824 PCIe switch where link training never completes and the link > continues switching between speeds indefinitely with the data link layer > never

[PATCH v4 17/17] arm64: Enable perf events based hard lockup detector

2023-05-04 Thread Douglas Anderson
With the recent feature added to enable perf events to use pseudo NMIs as interrupts on platforms which support GICv3 or later, its now been possible to enable hard lockup detector (or NMI watchdog) on arm64 platforms. So enable corresponding support. One thing to note here is that normally

[PATCH v4 16/17] arm64: add hw_nmi_get_sample_period for preparation of lockup detector

2023-05-04 Thread Douglas Anderson
From: Lecopzer Chen Set safe maximum CPU frequency to 5 GHz in case a particular platform doesn't implement cpufreq driver. Although, architecture doesn't put any restrictions on maximum frequency but 5 GHz seems to be safe maximum given the available Arm CPUs in the market which are clocked

[PATCH v4 15/17] watchdog/perf: Adapt the watchdog_perf interface for async model

2023-05-04 Thread Douglas Anderson
From: Lecopzer Chen When lockup_detector_init()->watchdog_hardlockup_probe(), PMU may be not ready yet. E.g. on arm64, PMU is not ready until device_initcall(armv8_pmu_driver_init). And it is deeply integrated with the driver model and cpuhp. Hence it is hard to push this initialization before

[PATCH v4 14/17] watchdog/perf: Add a weak function for an arch to detect if perf can use NMIs

2023-05-04 Thread Douglas Anderson
On arm64, NMI support needs to be detected at runtime. Add a weak function to the perf hardlockup detector so that an architecture can implement it to detect whether NMIs are available. Signed-off-by: Douglas Anderson --- While I won't object to this patch landing, I consider it part of the

[PATCH v4 13/17] watchdog/hardlockup: detect hard lockups using secondary (buddy) CPUs

2023-05-04 Thread Douglas Anderson
From: Colin Cross Implement a hardlockup detector that doesn't doesn't need any extra arch-specific support code to detect lockups. Instead of using something arch-specific we will use the buddy system, where each CPU watches out for another one. Specifically, each CPU will use its softlockup

[PATCH v4 12/17] watchdog/hardlockup: Have the perf hardlockup use __weak functions more cleanly

2023-05-04 Thread Douglas Anderson
The fact that there watchdog_hardlockup_enable(), watchdog_hardlockup_disable(), and watchdog_hardlockup_probe() are declared __weak means that the configured hardlockup detector can define non-weak versions of those functions if it needs to. Instead of doing this, the perf hardlockup detector

[PATCH v4 11/17] watchdog/hardlockup: Rename some "NMI watchdog" constants/function

2023-05-04 Thread Douglas Anderson
Do a search and replace of: - NMI_WATCHDOG_ENABLED => HARD_WATCHDOG_ENABLED - watchdog_nmi_ => watchdog_hardlockup_ Then update a few comments near where names were changed. This is specifically to make it less confusing when we want to introduce the buddy hardlockup detector, which isn't using

[PATCH v4 10/17] watchdog/hardlockup: Move perf hardlockup watchdog petting to watchdog.c

2023-05-04 Thread Douglas Anderson
In preparation for the buddy hardlockup detector, which wants the same petting logic as the current perf hardlockup detector, move the code to watchdog.c. While doing this, rename the global variable to match others nearby. The arch_touch_nmi_watchdog() function is not renamed since that is

[PATCH v4 09/17] watchdog/hardlockup: Add a "cpu" param to watchdog_hardlockup_check()

2023-05-04 Thread Douglas Anderson
In preparation for the buddy hardlockup detector where the CPU checking for lockup might not be the currently running CPU, add a "cpu" parameter to watchdog_hardlockup_check(). Signed-off-by: Douglas Anderson --- Changes in v4: - ("Add a "cpu" param to watchdog_hardlockup_check()") new for v4.

[PATCH v4 08/17] watchdog/hardlockup: Style changes to watchdog_hardlockup_check() / ..._is_lockedup()

2023-05-04 Thread Douglas Anderson
These are tiny style changes: - Add a blank line before a "return". - Renames two globals to use the "watchdog_hld" prefix. - Store processor id in "unsigned int" rather than "int". - Minor comment rewording. - Use "else" rather than extra returns since it seemed more symmetric. Signed-off-by:

[PATCH v4 07/17] watchdog/hardlockup: Move perf hardlockup checking/panic to common watchdog.c

2023-05-04 Thread Douglas Anderson
The perf hardlockup detector works by looking at interrupt counts and seeing if they change from run to run. The interrupt counts are managed by the common watchdog code via its watchdog_timer_fn(). Currently the API between the perf detector and the common code is a function: is_hardlockup().

[PATCH v4 06/17] watchdog/perf: Rename watchdog_hld.c to watchdog_perf.c

2023-05-04 Thread Douglas Anderson
The code currently in "watchdog_hld.c" is for detecting hardlockups using perf, as evidenced by the line in the Makefile that only compiles this file if CONFIG_HARDLOCKUP_DETECTOR_PERF is defined. Rename the file to prepare for the buddy hardlockup detector, which doesn't use perf. It could be

[PATCH v4 05/17] watchdog/hardlockup: Rename touch_nmi_watchdog() to touch_hardlockup_watchdog()

2023-05-04 Thread Douglas Anderson
In preparation for the buddy hardlockup detector, rename touch_nmi_watchdog() to touch_hardlockup_watchdog() to make it clear that it will touch whatever hardlockup detector is configured. We'll add a #define for the old name (touch_nmi_watchdog) so that we don't have to touch every piece of code

[PATCH v4 04/17] watchdog/perf: Ensure CPU-bound context when creating hardlockup detector event

2023-05-04 Thread Douglas Anderson
From: Pingfan Liu hardlockup_detector_event_create() should create perf_event on the current CPU. Preemption could not get disabled because perf_event_create_kernel_counter() allocates memory. Instead, the CPU locality is achieved by processing the code in a per-CPU bound kthread. Add a check

[PATCH v4 03/17] watchdog/hardlockup: change watchdog_nmi_enable() to void

2023-05-04 Thread Douglas Anderson
From: Lecopzer Chen Nobody cares about the return value of watchdog_nmi_enable(), changing its prototype to void. Signed-off-by: Pingfan Liu Signed-off-by: Lecopzer Chen Reviewed-by: Petr Mladek Signed-off-by: Douglas Anderson --- I yanked this patch from the mailing lists [1] into my

[PATCH v4 02/17] watchdog: remove WATCHDOG_DEFAULT

2023-05-04 Thread Douglas Anderson
From: Lecopzer Chen No reference to WATCHDOG_DEFAULT, remove it. Signed-off-by: Pingfan Liu Signed-off-by: Lecopzer Chen Reviewed-by: Petr Mladek Signed-off-by: Douglas Anderson --- I yanked this patch from the mailing lists [1] into my series just to make it easier to avoid conflicts

[PATCH v4 01/17] watchdog/perf: Define dummy watchdog_update_hrtimer_threshold() on correct config

2023-05-04 Thread Douglas Anderson
The real watchdog_update_hrtimer_threshold() is defined in watchdog_hardlockup_perf.c. That file is included if CONFIG_HARDLOCKUP_DETECTOR_PERF and the function is defined in that file if CONFIG_HARDLOCKUP_CHECK_TIMESTAMP. The dummy version of the function in "nmi.h" didn't get that quite right.

[PATCH v4 00/17] watchdog/hardlockup: Add the buddy hardlockup detector

2023-05-04 Thread Douglas Anderson
This patch series adds the "buddy" hardlockup detector. In brief, the buddy hardlockup detector can detect hardlockups without arch-level support by having CPUs checkup on a "buddy" CPU periodically. All the details are in the patch ("watchdog/hardlockup: detect hard lockups using secondary

Re: [PATCH v2] powerpc/iommu: DMA address offset is incorrectly calculated with 2MB TCEs

2023-05-04 Thread Gaurav Batra
Hello Michael, I agree with your concerns regarding a device been able to access memory that doesn't belong to it. That exposure we have today with 2MB TCEs. With 2MB TCEs, DMA window size will be big enough, for dedicated adapters, that whole memory is going to be mapped "direct". Which

[PATCH v3] powerpc/iommu: DMA address offset is incorrectly calculated with 2MB TCEs

2023-05-04 Thread Gaurav Batra
When DMA window is backed by 2MB TCEs, the DMA address for the mapped page should be the offset of the page relative to the 2MB TCE. The code was incorrectly setting the DMA address to the beginning of the TCE range. Mellanox driver is reporting timeout trying to ENABLE_HCA for an SR-IOV ethernet

Re: [PASEMI NEMO] Boot issue with the PowerPC updates 6.4-1

2023-05-04 Thread Christian Zigotzky
> On 3. May 2023, at 19:28, Christian Zigotzky wrote: > >  > >>> On 3. May 2023, at 18:51, Rob Herring wrote: >>> >>> On Wed, May 3, 2023 at 11:27 AM Christophe Leroy >>> wrote: >>> >>> +Rob as he's the commit's Author. >>> Le 03/05/2023 à 17:46, Christian Zigotzky a écrit :