Re: [PATCH] ibmvfc: add new fields for version 2 of several MADs

2020-10-27 Thread Tyrel Datwyler
On 10/26/20 6:56 PM, Martin K. Petersen wrote: > > Tyrel, > >> Introduce a targetWWPN field to several MADs. Its possible that a scsi >> ID of a target can change due to some fabric changes. The WWPN of the >> scsi target provides a better way to identify the target. Also, add >> flags for

[PATCH net-next 04/15] net: mlx5: Replace in_irq() usage.

2020-10-27 Thread Sebastian Andrzej Siewior
mlx5_eq_async_int() uses in_irq() to decide whether eq::lock needs to be acquired and released with spin_[un]lock() or the irq saving/restoring variants. The usage of in_*() in drivers is phased out and Linus clearly requested that code which changes behaviour depending on context should either

[PATCH net-next 08/15] net: airo: Replace in_atomic() usage.

2020-10-27 Thread Sebastian Andrzej Siewior
issuecommand() is using in_atomic() to decide if it is safe to invoke schedule() while waiting for the command to be accepted. Usage of in_atomic() for this is only half correct as it can not detect all condition where it is not allowed to schedule(). Also Linus clearly requested that code which

[PATCH net-next 07/15] net: airo: Always use JOB_STATS and JOB_EVENT

2020-10-27 Thread Sebastian Andrzej Siewior
issuecommand() is using in_atomic() to decide if it is safe to invoke schedule() while waiting for the command to be accepted. Usage of in_atomic() for this is only half correct as it can not detect all condition where it is not allowed to schedule(). Also Linus clearly requested that code which

[PATCH net-next 12/15] net: rtlwifi: Remove in_interrupt() usage in halbtc_send_bt_mp_operation()

2020-10-27 Thread Sebastian Andrzej Siewior
halbtc_send_bt_mp_operation() uses in_interrupt() to determine if it is safe to invoke wait_for_completion(). The usage of in_interrupt() in drivers is phased out and Linus clearly requested that code which changes behaviour depending on context should either be separated or the context be

[PATCH net-next 15/15] crypto: caam: Replace in_irq() usage.

2020-10-27 Thread Sebastian Andrzej Siewior
The driver uses in_irq() + in_serving_softirq() magic to decide if NAPI scheduling is required or packet processing. The usage of in_*() in drivers is phased out and Linus clearly requested that code which changes behaviour depending on context should either be seperated or the context be

[PATCH net-next 13/15] soc/fsl/qbman: Add an argument to signal if NAPI processing is required.

2020-10-27 Thread Sebastian Andrzej Siewior
dpaa_eth_napi_schedule() and caam_qi_napi_schedule() schedule NAPI if invoked from: - Hard interrupt context - Any context which is not serving soft interrupts Any context which is not serving soft interrupts includes hard interrupts so the in_irq() check is redundant. caam_qi_napi_schedule()

[PATCH net-next 11/15] net: rtlwifi: Remove in_interrupt() usage in is_any_client_connect_to_ap().

2020-10-27 Thread Sebastian Andrzej Siewior
is_any_client_connect_to_ap() is using in_interrupt() to determine whether it should acquire the lock prior accessing the list. The usage of in_interrupt() in drivers is phased out and Linus clearly requested that code which changes behaviour depending on context should either be separated or the

[PATCH net-next 06/15] net: airo: Invoke airo_read_wireless_stats() directly

2020-10-27 Thread Sebastian Andrzej Siewior
airo_get_wireless_stats() is the iw_handler_if::get_wireless_stats() callback of this driver. This callback was not allowed to sleep until commit a160ee69c6a46 ("wext: let get_wireless_stats() sleep") in v2.6.32. airo still delegates the readout to a thread, which is not longer necessary. Invoke

[PATCH net-next 03/15] net: forcedeth: Replace context and lock check with a lockdep_assert()

2020-10-27 Thread Sebastian Andrzej Siewior
nv_update_stats() triggers a WARN_ON() when invoked from hard interrupt context because the locks in use are not hard interrupt safe. It also has an assert_spin_locked() which was the lock check before the lockdep era. Lockdep has way broader locking correctness checks and covers both issues, so

Re: [PATCH 1/3] powerpc/uaccess: Switch __put_user_size_allowed() to __put_user_asm_goto()

2020-10-27 Thread Andreas Schwab
On Sep 04 2020, Christophe Leroy wrote: > __put_user_asm_goto() provides more flexibility to GCC and avoids using > a local variable to tell if the write succeeded or not. > GCC can then avoid implementing a cmp in the fast path. That breaks CLONE_CHILD_SETTID. I'm getting an assertion failure

[PATCH net-next 00/15] in_interrupt() cleanup, part 2

2020-10-27 Thread Sebastian Andrzej Siewior
Folks, in the discussion about preempt count consistency across kernel configurations: https://lore.kernel.org/r/20200914204209.256266...@linutronix.de/ Linus clearly requested that code in drivers and libraries which changes behaviour based on execution context should either be split up so

[PATCH net-next 10/15] net: zd1211rw: Remove in_atomic() usage.

2020-10-27 Thread Sebastian Andrzej Siewior
The usage of in_atomic() in driver code is deprecated as it can not always detect all states where it is not allowed to sleep. All callers are in premptible thread context and all functions invoke core functions which have checks for invalid calling contexts already. Signed-off-by: Sebastian

[PATCH net-next 09/15] net: hostap: Remove in_atomic() check.

2020-10-27 Thread Sebastian Andrzej Siewior
hostap_get_wireless_stats() is the iw_handler_if::get_wireless_stats() callback of this driver. This callback was not allowed to sleep until commit a160ee69c6a46 ("wext: let get_wireless_stats() sleep") in v2.6.32. Remove the therefore pointless in_atomic() check. Signed-off-by: Sebastian

Re: [PATCH 1/3] powerpc/uaccess: Switch __put_user_size_allowed() to __put_user_asm_goto()

2020-10-27 Thread Andreas Schwab
On Okt 28 2020, Andreas Schwab wrote: > On Sep 04 2020, Christophe Leroy wrote: > >> __put_user_asm_goto() provides more flexibility to GCC and avoids using >> a local variable to tell if the write succeeded or not. >> GCC can then avoid implementing a cmp in the fast path. > > That breaks

Re: [PATCH 2/4] PM: hibernate: improve robustness of mapping pages in the direct map

2020-10-27 Thread Edgecombe, Rick P
On Tue, 2020-10-27 at 10:49 +0200, Mike Rapoport wrote: > On Mon, Oct 26, 2020 at 06:57:32PM +, Edgecombe, Rick P wrote: > > On Mon, 2020-10-26 at 11:15 +0200, Mike Rapoport wrote: > > > On Mon, Oct 26, 2020 at 12:38:32AM +, Edgecombe, Rick P > > > wrote: > > > > On Sun, 2020-10-25 at

[PATCH net-next 05/15] net: tlan: Replace in_irq() usage

2020-10-27 Thread Sebastian Andrzej Siewior
The driver uses in_irq() to determine if the tlan_priv::lock has to be acquired in tlan_mii_read_reg() and tlan_mii_write_reg(). The interrupt handler acquires the lock outside of these functions so the in_irq() check is meant to prevent a lock recursion deadlock. But this check is incorrect when

[PATCH net-next 02/15] net: neterion: s2io: Replace in_interrupt() for context detection

2020-10-27 Thread Sebastian Andrzej Siewior
wait_for_cmd_complete() uses in_interrupt() to detect whether it is safe to sleep or not. The usage of in_interrupt() in drivers is phased out and Linus clearly requested that code which changes behaviour depending on context should either be seperated or the context be conveyed in an argument

Re: [PATCH] ibmveth: Fix use of ibmveth in a bridge.

2020-10-27 Thread Jakub Kicinski
On Mon, 26 Oct 2020 20:04:07 +0100 Thomas Bogendoerfer wrote: > > On Mon, 26 Oct 2020 11:42:21 +0100 Michal Suchanek wrote: > > > From: Thomas Bogendoerfer > > > > > > The check for src mac address in ibmveth_is_packet_unsupported is wrong. > > > Commit 6f2275433a2f wanted to shut down

Re: [PATCH 1/3] powerpc/uaccess: Switch __put_user_size_allowed() to __put_user_asm_goto()

2020-10-27 Thread Michael Ellerman
Andreas Schwab writes: > On Okt 28 2020, Andreas Schwab wrote: > >> On Sep 04 2020, Christophe Leroy wrote: >> >>> __put_user_asm_goto() provides more flexibility to GCC and avoids using >>> a local variable to tell if the write succeeded or not. >>> GCC can then avoid implementing a cmp in the

Re: [PATCH] ibmvscsi: fix race potential race after loss of transport

2020-10-27 Thread Michael Ellerman
Tyrel Datwyler writes: > After a loss of tranport due to an adatper migration or crash/disconnect from > the host partner there is a tiny window where we can race adjusting the > request_limit of the adapter. The request limit is atomically inc/dec to track > the number of inflight requests

[PATCH net-next 01/15] net: orinoco: Remove BUG_ON(in_interrupt/irq())

2020-10-27 Thread Sebastian Andrzej Siewior
The usage of in_irq()/in_interrupt() in drivers is phased out and the BUG_ON()'s based on those are not covering all contexts in which these functions cannot be called. Aside of that BUG_ON() should only be used as last resort, which is clearly not the case here. A broad variety of checks in the

[PATCH net-next 14/15] net: dpaa: Replace in_irq() usage.

2020-10-27 Thread Sebastian Andrzej Siewior
The driver uses in_irq() + in_serving_softirq() magic to decide if NAPI scheduling is required or packet processing. The usage of in_*() in drivers is phased out and Linus clearly requested that code which changes behaviour depending on context should either be seperated or the context be

[PATCH kernel v2 1/2] dma: Allow mixing bypass and normal IOMMU operation

2020-10-27 Thread Alexey Kardashevskiy
At the moment we allow bypassing DMA ops only when we can do this for the entire RAM. However there are configs with mixed type memory where we could still allow bypassing IOMMU in most cases; POWERPC with persistent memory is one example. This adds another check for the bus limit to determine

Re: [PATCH 02/10] fs: don't allow splice read/write without explicit ops

2020-10-27 Thread David Howells
Christoph Hellwig wrote: > > That said, for afs at least, the fix seems to be just this: > > And that is the correct fix, I was about to send it to you. Thanks. David

Re: [PATCH kernel 0/2] powerpc/dma: Fallback to dma_ops when persistent memory present

2020-10-27 Thread Christoph Hellwig
On Wed, Oct 21, 2020 at 02:20:24PM +1100, Alexey Kardashevskiy wrote: > This allows mixing direct DMA (to/from RAM) and > IOMMU (to/from apersistent memory) on the PPC64/pseries > platform. This was supposed to be a single patch but > unexpected move of direct DMA functions happened. > > This is

Re: [PATCH 0/4] arch, mm: improve robustness of direct map manipulation

2020-10-27 Thread David Hildenbrand
On 27.10.20 10:47, Mike Rapoport wrote: On Tue, Oct 27, 2020 at 09:46:35AM +0100, David Hildenbrand wrote: On 27.10.20 09:38, Mike Rapoport wrote: On Mon, Oct 26, 2020 at 06:05:30PM +, Edgecombe, Rick P wrote: On Mon, 2020-10-26 at 11:05 +0200, Mike Rapoport wrote: On Mon, Oct 26, 2020

Re: [PATCH 2/4] PM: hibernate: improve robustness of mapping pages in the direct map

2020-10-27 Thread Mike Rapoport
On Mon, Oct 26, 2020 at 06:57:32PM +, Edgecombe, Rick P wrote: > On Mon, 2020-10-26 at 11:15 +0200, Mike Rapoport wrote: > > On Mon, Oct 26, 2020 at 12:38:32AM +, Edgecombe, Rick P wrote: > > > On Sun, 2020-10-25 at 12:15 +0200, Mike Rapoport wrote: > > > > From: Mike Rapoport > > > > >

Re: [PATCH 0/4] arch, mm: improve robustness of direct map manipulation

2020-10-27 Thread David Hildenbrand
On 27.10.20 09:38, Mike Rapoport wrote: On Mon, Oct 26, 2020 at 06:05:30PM +, Edgecombe, Rick P wrote: On Mon, 2020-10-26 at 11:05 +0200, Mike Rapoport wrote: On Mon, Oct 26, 2020 at 01:13:52AM +, Edgecombe, Rick P wrote: On Sun, 2020-10-25 at 12:15 +0200, Mike Rapoport wrote:

[PATCH kernel v2 2/2] powerpc/dma: Fallback to dma_ops when persistent memory present

2020-10-27 Thread Alexey Kardashevskiy
So far we have been using huge DMA windows to map all the RAM available. The RAM is normally mapped to the VM address space contiguously, and there is always a reasonable upper limit for possible future hot plugged RAM which makes it easy to map all RAM via IOMMU. Now there is persistent memory

Re: [PATCH 02/10] fs: don't allow splice read/write without explicit ops

2020-10-27 Thread David Howells
David Howells wrote: > > default_file_splice_write is the last piece of generic code that uses > > set_fs to make the uaccess routines operate on kernel pointers. It > > implements a "fallback loop" for splicing from files that do not actually > > provide a proper splice_read method. The usual

[RFC PATCH kernel 0/2] irq: Add reference counting to IRQ mappings

2020-10-27 Thread Alexey Kardashevskiy
This is an attempt to fix a bug with PCI hot unplug with a bunch of PCIe bridges and devices sharing INTx. This did not hit us before as even if we did not call irq_domain_ops::unmap, the platform (PowerVM) would not produce an error but with POWER9's XIVE interrupt controller there is an error

Re: [PATCH 02/10] fs: don't allow splice read/write without explicit ops

2020-10-27 Thread David Howells
Christoph Hellwig wrote: > default_file_splice_write is the last piece of generic code that uses > set_fs to make the uaccess routines operate on kernel pointers. It > implements a "fallback loop" for splicing from files that do not actually > provide a proper splice_read method. The usual

Re: [PATCH 0/4] arch, mm: improve robustness of direct map manipulation

2020-10-27 Thread Mike Rapoport
On Mon, Oct 26, 2020 at 06:05:30PM +, Edgecombe, Rick P wrote: > On Mon, 2020-10-26 at 11:05 +0200, Mike Rapoport wrote: > > On Mon, Oct 26, 2020 at 01:13:52AM +, Edgecombe, Rick P wrote: > > > On Sun, 2020-10-25 at 12:15 +0200, Mike Rapoport wrote: > > > > Indeed, for architectures that

[RFC PATCH kernel 2/2] powerpc/pci: Remove LSI mappings on device teardown

2020-10-27 Thread Alexey Kardashevskiy
From: Oliver O'Halloran When a passthrough IO adapter is removed from a pseries machine using hash MMU and the XIVE interrupt mode, the POWER hypervisor expects the guest OS to clear all page table entries related to the adapter. If some are still present, the RTAS call which isolates the PCI

Re: [PATCH 02/10] fs: don't allow splice read/write without explicit ops

2020-10-27 Thread Christoph Hellwig
On Tue, Oct 27, 2020 at 09:51:34AM +, David Howells wrote: > David Howells wrote: > > > > default_file_splice_write is the last piece of generic code that uses > > > set_fs to make the uaccess routines operate on kernel pointers. It > > > implements a "fallback loop" for splicing from files

[RFC PATCH kernel 1/2] irq: Add reference counting to IRQ mappings

2020-10-27 Thread Alexey Kardashevskiy
PCI devices share 4 legacy INTx interrupts from the same PCI host bridge. Device drivers map/unmap hardware interrupts via irq_create_mapping()/ irq_dispose_mapping(). The problem with that these interrupts are shared and when performing hot unplug, we need to unmap the interrupt only when the

Re: [PATCH 0/4] arch, mm: improve robustness of direct map manipulation

2020-10-27 Thread Mike Rapoport
On Tue, Oct 27, 2020 at 09:46:35AM +0100, David Hildenbrand wrote: > On 27.10.20 09:38, Mike Rapoport wrote: > > On Mon, Oct 26, 2020 at 06:05:30PM +, Edgecombe, Rick P wrote: > > > On Mon, 2020-10-26 at 11:05 +0200, Mike Rapoport wrote: > > > > On Mon, Oct 26, 2020 at 01:13:52AM +,

[PATCH kernel v2 0/2] DMA, powerpc/dma: Fallback to dma_ops when persistent memory present

2020-10-27 Thread Alexey Kardashevskiy
This allows mixing direct DMA (to/from RAM) and IOMMU (to/from apersistent memory) on the PPC64/pseries platform. This replaces this: https://lkml.org/lkml/2020/10/20/1085 A lesser evil this is :) This is based on sha1 4525c8781ec0 Linus Torvalds "scsi: qla2xxx: remove incorrect sparse #ifdef".

Re: [RFC PATCH kernel 1/2] irq: Add reference counting to IRQ mappings

2020-10-27 Thread Marc Zyngier
Hi Alexey, On 2020-10-27 09:06, Alexey Kardashevskiy wrote: PCI devices share 4 legacy INTx interrupts from the same PCI host bridge. Device drivers map/unmap hardware interrupts via irq_create_mapping()/ irq_dispose_mapping(). The problem with that these interrupts are shared and when

Re: [PATCH kernel v2 1/2] dma: Allow mixing bypass and normal IOMMU operation

2020-10-27 Thread Christoph Hellwig
> +static inline bool dma_handle_direct(struct device *dev, dma_addr_t > dma_handle) > +{ > + return dma_handle >= dev->archdata.dma_offset; > +} This won't compile except for powerpc, and directly accesing arch members in common code is a bad idea. Maybe both your helpers need to be